text:
/*global define, console, window, angular*/

define(function () {
    'use strict';

    function ctrl($rootScope, $scope, $filter, DataService, EffectService, UtilityService, ColorService) {

        $scope.$on("$ionicView.beforeEnter", function () {
            getLightList();
        });
        $scope.picker1 = {
            colors: [{
                color: "#ffffff"
            }]
        };

        var getLightList = function () {
            DataService.getEnrichedLightInfos(true).then(function (data) {
                var tmp = [];
                angular.forEach(data, function (value, key) {
                    value.id = key;
                    tmp.push(value);
                });
                $scope.lights = tmp;
            });
        };

        var getOrderedSelectedLights = function () {
            var orderedSelectedLightIds = [];
            angular.forEach($scope.lights, function (light) {
                var id = parseInt(light.id);
                if (id in $scope.copySelection && $scope.copySelection[id] === true) {
                    orderedSelectedLightIds.push(parseInt(light.id));
                }
            });
            return orderedSelectedLightIds;
        };

        $scope.$on("$destroy", function () {

        });

        $scope.sliderOptions = {
            start: [10],
            connect: 'lower',
            step: 1,
            range: {
                'min': 1,
                'max': 30
            }
        };

        $scope.effectName = $filter('translate')('Effect_Beacon');

        $scope.test = {};
        $scope.test.customLoopTime = 10;
        $scope.copySelection = {};
        $scope.copyToSelection = function () {
            var orderedSelectedLights = getOrderedSelectedLights();
            var timeInMs = parseInt($scope.sliderOptions.start[0]) * 1000;
            var color1 = $scope.picker1.colors[0].color;
            var xyColor = ColorService.getGamutXyFromHex("C", color1);

            EffectService.startBeacon(orderedSelectedLights, timeInMs, xyColor);
        };

    }

    ctrl.$inject = ['$rootScope', '$scope', '$filter', 'DataService', 'EffectService', 'UtilityService', 'ColorService'];
    return ctrl;

});


text:
package org.wso2.carbon.dashboards.core.widget.info;

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

/**
 * This is the dataholder for WidgetInformationProvider implementations.
 */
public class WidgetDataHolder {

    private static WidgetDataHolder instance = new WidgetDataHolder();

    private List<WidgetInfoProvider> widgetInfoProvidersList = new ArrayList<>();

    /**
     * provide an instance of WidgetDataHolder.
     *
     * @return instance of WidgetDataHolder
     */
    public static WidgetDataHolder getInstance() {
        return instance;
    }

    /**
     * add WidgetInfoProvider object to the ArrayList.
     *
     * @param widgetInfoProvider object that implements WidgetInfoProvider
     */
    public void addWidgetInfoProvider(WidgetInfoProvider widgetInfoProvider) {
        widgetInfoProvidersList.add(widgetInfoProvider);
    }

    /**
     * remove WidgetInfoProvider object from the list.
     *
     * @param widgetInfoProvider
     */
    public void removeWidgetInfoProvider(WidgetInfoProvider widgetInfoProvider) {
        widgetInfoProvidersList.removeIf(widgetInfoProviders -> widgetInfoProviders.equals(widgetInfoProvider));
    }

    /**
     * provide list of objects added using addObject method.
     *
     * @return list of objects that implements WidgetInfoProvider
     */
    public List<WidgetInfoProvider> getWidgetInfoProviders() {
        return instance.widgetInfoProvidersList;
    }
}

redpajama_set_name: RedPajamaGithub


text:
<?php
/**
 * Command
 *
 * @author Pierre - dev@nettools.ovh
 * @license MIT
 */

namespace Nettools\Simple_Framework;

use \Nettools\Core\Helpers\FileHelper;

/**
 * Base class for application command
 */
abstract class Command {

    /**
     * @var mixed Returned value (which is a Value object)
     */
    protected $_return;

    /**
     * Get a string describing the command. Usually the CMD get/post parameter
     *
     * @return string The command name being executed, in lowercase
     */
    public function getCommandName()
    {
        // get the classname with namespace, remove it and only return classname
        return strtolower(substr(strrchr('\\'.get_class($this), '\\'), 1));
    }

	/**
	 * Does the command require authentication (through one or many SecurityHandlers\SecurityHandler objects) ?
	 *
	 * @return bool By default, no authentication is needed (false is returned)
	 */
	public function requiresAuthentication()
	{
		return false;
	}

    /**
     * Get return value
     *
     * @return ReturnedValues\Value Value returned by command execution
     */
    public function getReturn()
    {
        return $this->_return;
    }

    /**
     * Validate a request (mandatory parameters)
     *
     * @param Request $r Request to validate
     * @return bool Returns true if request is valid
     */
    public function validateRequest(Request $r)
    {
        return true;
    }

    /**
     * Execute request on some parameters
     *
     * @param Request $req Object request
     * @param Application $app Application object
     * @return ReturnedValues\Value Return a Value object representing the command result
     * @throws Exceptions\CommandFailedException Thrown if user aborts the command execution (due to some error condition, for example)
     */
    abstract public function execute(Request $req, Application $app);

    /**
     * Aborts the command execution
     *
     * @param string $msg Error message
     * @throws Exceptions\CommandFailedException
     */
    protected function fail($msg = NULL)
    {
        throw new Exceptions\CommandFailedException($msg ? $msg : 'Command \'' . $this->getCommandName() . '\' aborted');
    }

    /**
     * Returns a NULL value (shortcut to `returnPHP(NULL)`)
     */
    protected function returnNull()
    {
        return $this->returnPHP(NULL);
    }

    /**
     * Returns a PHP value
     *
     * @param mixed $v Value to be returned (any kind of PHP type)
     */
    protected function returnPHP($v)
    {
        return $this->_return = new ReturnedValues\PHP($v);
    }

    /**
     * Returns HTML content
     *
     * @param string $html HTML string to be returned
     */
    protected function returnHTML($html)
    {
        return $this->_return = new ReturnedValues\HTML($html);
    }

    /**
     * Returns a PHP string (useful for output to screen)
     *
     * @param string $s
     */
    protected function returnString($s)
    {
        return $this->returnPHP($s);
    }

    /**
     * Returns a PHP float
     *
     * @param float $f
     */
    protected function returnFloat($f)
    {
        return $this->returnPHP($f);
    }

    /**
     * Returns a PHP int
     *
     * @param int $i
     */
    protected function returnInt($i)
    {
        return $this->returnPHP($i);
    }

    /**
     * Returns a PHP bool
     *
     * @param bool $b
     */
    protected function returnBool($b)
    {
        return $this->returnPHP($b);
    }

    /**
     * Returns a Json string (useful for xmlhttp requests)
     *
     * @param string|string[]|object $s Value to be returned (either a json-formatted string, an associative array or a litteral object)
     */
    protected function returnJson($s)
    {
        if ( is_string($s) )
            return $this->_return = new ReturnedValues\Json($s);
        else
            return $this->_return = new ReturnedValues\Json(json_encode($s));
    }

    /**
     * Prepare a string download
     *
     * @param string $s Value to be downloaded
     * @param string $fname Filename to suggest to user
     * @param string $contentType Content-type to output
     */
    protected function returnStringDownload($s, $fname, $contentType = 'application/octet-stream')
    {
        return $this->_return = new ReturnedValues\StringDownload($s, $fname, $contentType);
    }

    /**
     * Prepare a file download
     *
     * @param string $s File path to the file to be downloaded
     * @param string $fname Filename to suggest to user
     * @param string $contentType Content-type to output
     */
    protected function returnFileDownload($s, $fname = NULL, $contentType = NULL)
    {
        if ( !$fname )
            $fname = basename($s);
        if ( !$contentType )
            $contentType = FileHelper::guessMimeType($s);

        return $this->_return = new ReturnedValues\FileDownload($s, $fname, $contentType);
    }
}

?>


text:
int pipeWrite(struct Pipe *pipe, const void *buffer, size_t size) {
	const char *cbuf = (const char *)buffer;
	while (size) {
		semWait(&pipe->bytesFree);
		pipe->buf[pipe->wIndex] = *cbuf;
		semSignal(&pipe->bytesUsed);

		pipe->wIndex = (pipe->wIndex + 1) % PIPE_BUF;
		cbuf++;
		size--;
	}
	return 0;
}

ssize_t pipeRead(struct Pipe *pipe, void *buffer, size_t size) {
	char *cbuf = (char *)buffer;
	ssize_t ret = 0;
	while (ret != (ssize_t)size) {
		semWait(&pipe->bytesUsed);
		*cbuf = pipe->buf[pipe->rIndex];
		semSignal(&pipe->bytesFree);

		pipe->rIndex = (pipe->rIndex + 1) % PIPE_BUF;
		ret++;
		cbuf++;
	}
	return ret;
}

int sysPipe(int fd[2], int flags) {
	int error = validateUserPointer(fd, sizeof(*fd) * 2);
	if (error) return error;
	int readFD;
	int writeFD;

	struct Process *proc = getCurrentThread()->process;
	acquireSpinlock(&proc->fdLock);

	struct ProcessFile *rf;
	readFD = allocateFD(proc, &rf);
	if (readFD < 0) {
		error = readFD;
		releaseSpinlock(&proc->fdLock);
		goto release;
	}
	struct ProcessFile *wf;
	writeFD = allocateFD(proc, &wf);
	if (writeFD < 0) {
		error = readFD;
		releaseSpinlock(&proc->fdLock);
		goto deallocReadFD;
	}

	void *buf = allocKPages(PIPE_BUF, PAGE_FLAG_WRITE);
	if (!buf) {
		error = -ENOMEM;
		releaseSpinlock(&proc->fdLock);
		goto deallocWriteFD;
	}

	struct Pipe *pipe = kmalloc(sizeof(*pipe));
	if (!pipe) {
		error = -ENOMEM;
		releaseSpinlock(&proc->fdLock);
		goto deallocBuf;
	}
	memset(pipe, 0, sizeof(*pipe));
	pipe->buf = buf;
	pipe->refCount = 2;
	semInit(&pipe->bytesFree, PIPE_BUF);
	semInit(&pipe->bytesUsed, 0);

	if (flags & SYSOPEN_FLAG_CLOEXEC) {
		rf->flags |= PROCFILE_FLAG_CLOEXEC;
	}
	rf->flags |= PROCFILE_FLAG_PIPE;
	wf->flags = rf->flags | PROCFILE_FLAG_PIPE_WRITE;
	rf->pipe = pipe;
	wf->pipe = pipe;

	fd[0] = readFD;
	fd[1] = writeFD;

	goto release;

	deallocBuf:
	deallocPages(buf, PIPE_BUF);
	deallocWriteFD:
	sysClose(writeFD);
	deallocReadFD:
	sysClose(readFD);
	return error;

	release:
	releaseSpinlock(&proc->fdLock);
	return error;
}

void copyFD(struct ProcessFile *pf, struct ProcessFile *newPF, struct File *shared) {
	if ( !(pf->flags & PROCFILE_FLAG_USED)) {
		return;
	}
	if (pf->flags & PROCFILE_FLAG_PIPE) {
		pf->pipe->refCount++;
		newPF->flags = pf->flags;
		newPF->pipe = pf->pipe;
		return;
	}
	if ( !(pf->flags & PROCFILE_FLAG_SHARED)) {
		memset(shared, 0, sizeof(struct File));
		shared->inode = pf->file.inode;
		shared->refCount = 1;
		pf->flags |= PROCFILE_FLAG_SHARED;
		pf->sharedFile = shared;
	}
	newPF->flags = pf->flags;
	newPF->sharedFile = pf->sharedFile;
	pf->sharedFile->refCount++;
	return;
}

int sysDup(int oldFD, int newFD, int flags) {
	int error = 0;
	struct Process *proc = getCurrentThread()->process;
	acquireSpinlock(&proc->fdLock);

	struct ProcessFile *oldPF;
	if (oldFD < NROF_INLINE_FDS) {
		oldPF = &proc->inlineFDs[oldFD];
	} else {
		if (oldFD - NROF_INLINE_FDS >= proc->nrofFDs) {
			error = -EBADF;
			goto release;
		}
		oldPF = &proc->fds[oldFD - NROF_INLINE_FDS];
	}
	if ( !(oldFD & PROCFILE_FLAG_USED)) {
		error = -EBADF;
		goto release;
	}
	struct File *shared = NULL;
	if ( !(oldPF->flags & PROCFILE_FLAG_PIPE || oldPF->flags & PROCFILE_FLAG_SHARED)) {
		shared = kmalloc(sizeof(*shared));
		if (!shared) {
			error = -ENOMEM;
			goto release;
		}
	}

	struct ProcessFile *newPF;
	if (newFD < 0) {
		newFD = allocateFD(proc, &newPF);
	} else {
		if (newFD >= MAX_FDS) {
			error = -EBADF;
			goto deallocShared;
		}
		if (newFD - NROF_INLINE_FDS >= proc->nrofFDs) {
			struct ProcessFile *fds = krealloc(proc->fds, (newFD - NROF_INLINE_FDS + 1) * sizeof(*fds));
			if (!fds) {
				error = -ENOMEM;
				goto deallocShared;
			}
			memset(fds + proc->nrofFDs, 0, newFD - NROF_INLINE_FDS + 1 - proc->nrofFDs);
			proc->fds = fds;
			proc->nrofFDs = newFD - NROF_INLINE_FDS + 1;
			proc->nrofUsedFDs += newFD - NROF_INLINE_FDS;
			newPF = &fds[newFD - NROF_INLINE_FDS];
		} else {
			releaseSpinlock(&proc->fdLock);
			sysClose(newFD);
			acquireSpinlock(&proc->fdLock);
		}
	}

	copyFD(oldPF, newPF, shared);
	if (flags & SYSOPEN_FLAG_CLOEXEC) {
		newPF->flags |= PROCFILE_FLAG_CLOEXEC;
	} else {
		newPF->flags &= ~PROCFILE_FLAG_CLOEXEC;
	}

	releaseSpinlock(&proc->fdLock);
	return newFD;

	deallocShared:
	if (shared) {
		kfree(shared);
	}
	release:
	releaseSpinlock(&proc->fdLock);
	return error;
}


text:
'use strict';

var db         = require('mano').db
  , UsDollars  = require('dbjs-ext/number/currency/us-dollar')(db)
  , BusinessProcessNew = require('../../model/business-process-new')(db,
		{ className: 'BusinessProcessNew' })

  , _  = require('mano').i18n.bind('Model');

module.exports = require('../../model/lib/define-inventory')(BusinessProcessNew, {
	currencyType: UsDollars,
	assets: {
		label: _("Property"),
		inputPlaceholder: _("Property #1"),
		description: _("All the buildings, land and other immovable property belonging to the " +
			"merchant and are affected to their activity.")
	},
	machinery: {
		label: _("Machinery, equipment and vehicles"),
		inputPlaceholder: _("Machinery, equipment and vehicles #1"),
		description: _("All the machines, tools, computer equipment, vehicles and other movable " +
			"property affected to the commercial activity."),
		addLabel: _("Add")
	},
	goods: {
		label: _("Goods"),
		inputPlaceholder: _("Goods #1"),
		description: _("Value of the goods or animals which has in stock and for sale."),
		addLabel: _("Add")
	},
	banks: {
		label: _("Banks"),
		inputPlaceholder: _("Bank #1"),
		description: _("Balance(s) bank account(s)."),
		addLabel: _("Add")
	},
	receivables: {
		label: _("Accounts receivable"),
		inputPlaceholder: _("Account receivable #1"),
		description: _("The ' or receivable recorded increases and decreases resulting from the" +
			" sale of concepts other than goods or provision of services, exclusively to documented " +
			"credit (credit titles, bills of Exchange and promissory notes) in favor of the company " +
			"and for this there is programs to carry out operations."),
		addLabel: _("Add")
	},
	cash: {
		label: _("Cash"),
		inputPlaceholder: _("Cash #1"),
		description: _("Total amount in cash")
	}
});


text:
require 'puppet/indirector/ssl_file'
require 'puppet/ssl/key'

class Puppet::SSL::Key::Ca < Puppet::Indirector::SslFile
  desc "Manage the CA's private on disk.  This terminus *only* works
    with the CA key, because that's the only key that the CA ever interacts
    with."

  store_in :privatekeydir

  store_ca_at :cakey
end


text:
"""This module provides the rpo command to gsutil."""

from __future__ import absolute_import
from __future__ import print_function

import textwrap

from gslib import metrics
from gslib.command import Command
from gslib.command_argument import CommandArgument
from gslib.cs_api_map import ApiSelector
from gslib.exception import CommandException
from gslib.exception import NO_URLS_MATCHED_TARGET
from gslib.help_provider import CreateHelpText
from gslib.third_party.storage_apitools import storage_v1_messages as apitools_messages
from gslib.utils.constants import NO_MAX

VALID_RPO_VALUES = ('ASYNC_TURBO', 'DEFAULT')
VALID_RPO_VALUES_STRING = '({})'.format('|'.join(VALID_RPO_VALUES))

_SET_SYNOPSIS = """
  gsutil rpo set {} gs://<bucket_name>...
""".format(VALID_RPO_VALUES_STRING)

_GET_SYNOPSIS = """
  gsutil rpo get gs://<bucket_name>...
"""

_SYNOPSIS = _SET_SYNOPSIS + _GET_SYNOPSIS.lstrip('\n')

_SET_DESCRIPTION = """
SET
  The ``rpo set`` command configures turbo replication
  for dual-region Google Cloud Storage buckets.

SET EXAMPLES
  Configure your buckets to use turbo replication:

    gsutil rpo set ASYNC_TURBO gs://redbucket gs://bluebucket

  Configure your buckets to NOT use turbo replication:

    gsutil rpo set DEFAULT gs://redbucket gs://bluebucket
"""

_GET_DESCRIPTION = """
GET
  The ``rpo get`` command returns the replication setting
  for the specified Cloud Storage buckets.

GET EXAMPLES
  Check if your buckets are using turbo replication:

    gsutil rpo get gs://redbucket gs://bluebucket
"""

_DESCRIPTION = """
  The ``rpo`` command is used to retrieve or configure the
  `replication setting
  <https://cloud.google.com/storage/docs/turbo-replication>`_ of
  dual-region Cloud Storage buckets.
  This command has two sub-commands: ``get`` and ``set``.
""" + _GET_DESCRIPTION + _SET_DESCRIPTION

_DETAILED_HELP_TEXT = CreateHelpText(_SYNOPSIS, _DESCRIPTION)
_set_help_text = CreateHelpText(_SET_SYNOPSIS, _SET_DESCRIPTION)
_get_help_text = CreateHelpText(_GET_SYNOPSIS, _GET_DESCRIPTION)

class RpoCommand(Command):
  """Implements the gsutil rpo command."""

  command_spec = Command.CreateCommandSpec(
      'rpo',
      command_name_aliases=[],
      usage_synopsis=_SYNOPSIS,
      min_args=2,
      max_args=NO_MAX,
      supported_sub_args='',
      file_url_ok=False,
      provider_url_ok=False,
      urls_start_arg=2,
      gs_api_support=[ApiSelector.JSON],
      gs_default_api=ApiSelector.JSON,
      argparse_arguments={
          'get': [CommandArgument.MakeNCloudURLsArgument(1)],
          'set': [
              CommandArgument('mode', choices=list(VALID_RPO_VALUES)),
              CommandArgument.MakeZeroOrMoreCloudBucketURLsArgument(),
          ],
      })
  # Help specification. See help_provider.py for documentation.
  help_spec = Command.HelpSpec(
      help_name='rpo',
      help_name_aliases=[],
      help_type='command_help',
      help_one_line_summary='Configure replication',
      help_text=_DETAILED_HELP_TEXT,
      subcommand_help_text={
          'get': _get_help_text,
          'set': _set_help_text,
      },
  )

  def _ValidateBucketListingRefAndReturnBucketName(self, blr):
    if blr.storage_url.scheme != 'gs':
      raise CommandException(
          'The %s command can only be used with gs:// bucket URLs.' %
          self.command_name)

  def _GetRpo(self, blr):
    """Gets the rpo setting for a bucket."""
    bucket_url = blr.storage_url

    bucket_metadata = self.gsutil_api.GetBucket(bucket_url.bucket_name,
                                                fields=['rpo'],
                                                provider=bucket_url.scheme)
    rpo = bucket_metadata.rpo
    bucket = str(bucket_url).rstrip('/')
    print('%s: %s' % (bucket, rpo))

  def _SetRpo(self, blr, rpo_value):
    """Sets the rpo setting for a bucket."""
    bucket_url = blr.storage_url
    formatted_rpo_value = rpo_value
    if formatted_rpo_value not in VALID_RPO_VALUES:
      raise CommandException(
          'Invalid value for rpo set.'
          ' Should be one of {}'.format(VALID_RPO_VALUES_STRING))

    bucket_metadata = apitools_messages.Bucket(rpo=formatted_rpo_value)

    self.logger.info('Setting rpo %s for %s' %
                     (formatted_rpo_value, str(bucket_url).rstrip('/')))

    self.gsutil_api.PatchBucket(bucket_url.bucket_name,
                                bucket_metadata,
                                fields=['rpo'],
                                provider=bucket_url.scheme)
    return 0

  def _Rpo(self):
    """Handles rpo command on Cloud Storage buckets."""
    subcommand = self.args.pop(0)

    if subcommand not in ('get', 'set'):
      raise CommandException('rpo only supports get|set')

    subcommand_func = None
    subcommand_args = []

    if subcommand == 'get':
      subcommand_func = self._GetRpo
    elif subcommand == 'set':
      subcommand_func = self._SetRpo
      setting_arg = self.args.pop(0)
      subcommand_args.append(setting_arg)

    # TODO: Remove this as rpo should work for XML as well.
    if self.gsutil_api.GetApiSelector('gs') != ApiSelector.JSON:
      raise CommandException('\n'.join(
          textwrap.wrap(('The "%s" command can only be with the Cloud Storage '
                         'JSON API.') % self.command_name)))

    # Iterate over bucket args, performing the specified subsubcommand.
    some_matched = False
    url_args = self.args
    if not url_args:
      self.RaiseWrongNumberOfArgumentsException()
    for url_str in url_args:
      # Throws a CommandException if the argument is not a bucket.
      bucket_iter = self.GetBucketUrlIterFromArg(url_str)
      for bucket_listing_ref in bucket_iter:
        # TODO: Make this more general when adding RPO support for the XML API.
        if self.gsutil_api.GetApiSelector(
            bucket_listing_ref.storage_url.scheme) != ApiSelector.JSON:
          raise CommandException('\n'.join(
              textwrap.wrap(('The "%s" command can only be used for GCS '
                             'buckets.') % self.command_name)))

        some_matched = True
        subcommand_func(bucket_listing_ref, *subcommand_args)

    if not some_matched:
      raise CommandException(NO_URLS_MATCHED_TARGET % list(url_args))
    return 0

  def RunCommand(self):
    """Command entry point for the rpo command."""
    action_subcommand = self.args[0]
    self.ParseSubOpts(check_args=True)

    if action_subcommand == 'get' or action_subcommand == 'set':
      metrics.LogCommandParams(sub_opts=self.sub_opts)
      metrics.LogCommandParams(subcommands=[action_subcommand])
      return self._Rpo()
    else:
      raise CommandException('Invalid subcommand "%s", use get|set instead.' %
                             action_subcommand)


text:
<?php
namespace Fujicat\Sardine;

class Model_Mysqli extends Rdb\Mysqli
{
	static public function table_name() {
		return static::$_table_name;
	}

	static public function connect( array $options=array() ) {
		$options = array(
			'host'	=> 'localhost',
			'port'	=> 3306,
			'user'	=> 'root',
			'pass'	=> '',
			'database'	=> 'test',
		);
		return parent::connect($options);
	}
}


text:
package cn.wayne.mamypoko.mode.movement.entity;

public class DataEntity {
        /**
         * time_type : 1
         * city : 1
         * m_sdated : 2015-03-31 17:00:00
         * prize_num : 200
         * m_states : 1
         * gift_types : 1
         * pic : http://filebaby.qubaobei.com/files/box/2015/l/20150331174940720.png
         * time_str : 1天23小时
         * platform : 1
         * url : http://baby.ci123.com/box/mobile/detail.php?gid=429&action=goto_innerweb
         * m_title : 新用户活动
         * bigimg : http://baby.ci123.com/files/box/2015/l/20150331174940720.png
         * min_id : 0
         * m_pic :
         * act_type : 1
         * id : 429
         * m_edated : 2015-04-07 23:59:59
         */
        private int time_type;
        private String city;
        private String m_sdated;
        private String prize_num;
        private int m_states;
        private String gift_types;
        private String pic;
        private String time_str;
        private String platform;
        private String url;
        private String m_title;
        private String bigimg;
        private String min_id;
        private String m_pic;
        private int act_type;
        private String id;
        private String m_edated;

        public void setTime_type(int time_type) {
            this.time_type = time_type;
        }

        public void setCity(String city) {
            this.city = city;
        }

        public void setM_sdated(String m_sdated) {
            this.m_sdated = m_sdated;
        }

        public void setPrize_num(String prize_num) {
            this.prize_num = prize_num;
        }

        public void setM_states(int m_states) {
            this.m_states = m_states;
        }

        public void setGift_types(String gift_types) {
            this.gift_types = gift_types;
        }

        public void setPic(String pic) {
            this.pic = pic;
        }

        public void setTime_str(String time_str) {
            this.time_str = time_str;
        }

        public void setPlatform(String platform) {
            this.platform = platform;
        }

        public void setUrl(String url) {
            this.url = url;
        }

        public void setM_title(String m_title) {
            this.m_title = m_title;
        }

        public void setBigimg(String bigimg) {
            this.bigimg = bigimg;
        }

        public void setMin_id(String min_id) {
            this.min_id = min_id;
        }

        public void setM_pic(String m_pic) {
            this.m_pic = m_pic;
        }

        public void setAct_type(int act_type) {
            this.act_type = act_type;
        }

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

        public void setM_edated(String m_edated) {
            this.m_edated = m_edated;
        }

        public int getTime_type() {
            return time_type;
        }

        public String getCity() {
            return city;
        }

        public String getM_sdated() {
            return m_sdated;
        }

        public String getPrize_num() {
            return prize_num;
        }

        public int getM_states() {
            return m_states;
        }

        public String getGift_types() {
            return gift_types;
        }

        public String getPic() {
            return pic;
        }

        public String getTime_str() {
            return time_str;
        }

        public String getPlatform() {
            return platform;
        }

        public String getUrl() {
            return url;
        }

        public String getM_title() {
            return m_title;
        }

        public String getBigimg() {
            return bigimg;
        }

        public String getMin_id() {
            return min_id;
        }

        public String getM_pic() {
            return m_pic;
        }

        public int getAct_type() {
            return act_type;
        }

        public String getId() {
            return id;
        }

        public String getM_edated() {
            return m_edated;
        }
    }


text:
<!doctype html>

    <meta charset="utf-8">
    <title>Formed Paths</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Cinzel">
    <link rel="stylesheet" href="visualise.css">
    <link rel="icon" type="image/png" href="logo.png">
     <link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.css" />
    <link href='http://fonts.googleapis.com/css?family=Lato:100,300,400' rel='stylesheet' type='text/css'>

FORMED § PATHS

Arran Holloway


text:
// Copyright 2018 Verily Life Sciences Inc.
//
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

import {Component, EventEmitter, Inject, Input, OnInit, Output, Renderer2, ViewChild} from '@angular/core';
import {DateTime, Duration, Interval} from 'luxon';
import * as moment from 'moment';
import {DaterangepickerDirective} from 'ngx-daterangepicker-material';
import {APP_TIMESPAN, recordGoogleAnalyticsEvent, UI_CONSTANTS_TOKEN} from 'src/constants';

import {Encounter} from '../../fhir-resources/encounter';
import {ResultError} from '../../result-error';
import {getDaysForIntervalSet} from '../../utils/date_utils';

/**
 * Date range picker for selecting the time span to show in all the charts.
 *
 * There is a lot of messy date conversion in this class. The problem is that
 * we use luxon DateTime for our date handling across this application, but the
 * date range picker only works with Moment.js datetimes. The only format both
 * classes have converters for is JSDate, so we pass dates through that
 * several places.
 */
@Component({
  selector: 'app-timeline-controller',
  templateUrl: './timeline-controller.component.html',
  styleUrls: ['./timeline-controller.component.css']
})
export class TimelineControllerComponent implements OnInit {
  @Output() changeDateRange = new EventEmitter<Interval>();
  @ViewChild(DaterangepickerDirective)
  pickerDirective: DaterangepickerDirective;

  /**
   * Holds the encounters for this patient.
   */
  @Input() encounters: Encounter[];

  /**
   * Holds the error if there was an error getting the encounters.
   */
  @Input() encountersError: ResultError;

  /**
   * Holds the date range to default to on initial setup. If unset, we'll
   * default to the last seven days.
   */
  @Input() selectedDateRange: Interval;

  /**
   * Holds all the ISO strings for days covered by all the patient encounters
   * above. Used to gray out datepicker options that are not part of
   * a patient's encounter.
   */
  private daysCoveredByAnEncounter = new Set<string>();

  /** Bounds the dates that may be selected. */
  earliestAvailableDate = moment.utc(APP_TIMESPAN.start.toJSDate());
  readonly latestAvailableDate = moment.utc(APP_TIMESPAN.end.toJSDate());

  /** Selected timespan is past seven days by default. */
  readonly defaultDateRange = {
    startDate: moment(DateTime.local()
                          .minus(Duration.fromObject({days: 7}))
                          .startOf('day')
                          .toJSDate()),
    endDate: moment(DateTime.local().startOf('day').toJSDate())
  };

  /**
   * The date range picker binds to this variable.
   */
  selected: {startDate: moment.Moment, endDate: moment.Moment};

  /** The list of encounters to display as available ranges to select. */
  readonly datePickerRanges = {};

  /**
   * Whether there was an encounter input into this component.
   */
  hasEncounterError = false;

  constructor(
      private renderer: Renderer2,
      @Inject(UI_CONSTANTS_TOKEN) readonly uiConstants: any) {}

  ngOnInit() {
    // Set the initial date range selection and fire off a change event.
    const selectedRange = {
      startDate: moment(this.selectedDateRange.start.startOf('day').toJSDate()),
      endDate: moment(this.selectedDateRange.end.startOf('day').toJSDate())
    };
    this.selected = selectedRange;
    this.datesUpdated(selectedRange);

    // Set up the encounters in the date picker.
    if (this.encounters && this.encounters.length > 0 &&
        !this.encountersError) {
      this.hasEncounterError = false;

      this.encounters = this.encounters.sort(
          (a, b) => a.period.start.toMillis() - b.period.start.toMillis());

      // Set the minimum date to select to be the beginning of the
      // earliest encounter that had days that fell inside the app
      // timespan, in UTC.
      this.earliestAvailableDate = moment(
          this.encounters[0].period.start.startOf('day').toUTC().toJSDate());

      // We have to store everything as an ISO string because if we
      // store as objects the set membership check doesn't work.
      this.daysCoveredByAnEncounter = new Set<string>(
          getDaysForIntervalSet(this.encounters.map(x => x.period))
              .map(x => x.toISO().slice(0, 10)));

      // We manually update the ranges stored in the daterangepicker
      // so that the list of encounters is displayed.
      // We store these in local time to prevent errors with
      // displaying a date different than the dates of the encounter.
      // While being communicated with charts, the interval will be
      // converted to UTC.
      for (const encounter of this.encounters) {
        const start = moment(encounter.period.start.startOf('day').toJSDate());
        const end = moment(encounter.period.end.endOf('day').toJSDate());
        const label =
            start.format('MM/DD/YYYY') + '-' + end.format('MM/DD/YYYY');
        this.datePickerRanges[label] = [start, end];
      }
      this.datePickerRanges[this.uiConstants.LAST_ONE_DAY] = [
        moment(DateTime.local()
                   .minus(Duration.fromObject({days: 1}))
                   .startOf('day')
                   .toJSDate()),
        this.defaultDateRange.endDate
      ];
      this.datePickerRanges[this.uiConstants.LAST_THREE_DAYS] = [
        moment(DateTime.local()
                   .minus(Duration.fromObject({days: 3}))
                   .startOf('day')
                   .toJSDate()),
        this.defaultDateRange.endDate
      ];
      this.datePickerRanges[this.uiConstants.LAST_SEVEN_DAYS] =
          [this.defaultDateRange.startDate, this.defaultDateRange.endDate];
      this.datePickerRanges[this.uiConstants.LAST_MONTH] = [
        moment(DateTime.local()
                   .minus(Duration.fromObject({months: 1}))
                   .startOf('day')
                   .toJSDate()),
        this.defaultDateRange.endDate
      ];
      this.datePickerRanges[this.uiConstants.LAST_THREE_MONTHS] = [
        moment(DateTime.local()
                   .minus(Duration.fromObject({months: 3}))
                   .startOf('day')
                   .toJSDate()),
        this.defaultDateRange.endDate
      ];
    } else {
      this.hasEncounterError = true;
    }
  }

  /**
   * Used to add a style to dates in the date picker so that the user can
   * differentiate between dates inside and outside of encounters.
   */
  addCustomClass =
      (m: moment.Moment) => {
        // The slice gets jus tthe date portion of the ISO string.
        return this.daysCoveredByAnEncounter.has(m.toISOString().slice(0, 10)) ?
            'inEncounter' :
            'notInEncounter';
      }

  /**
   * Emits the date range picked in the date picker as an event.
   * @param range The date range selected in the picker.
   */
  datesUpdated(rangeIn: {startDate: moment.Moment, endDate: moment.Moment}) {
    if (!rangeIn.startDate || !rangeIn.endDate || !this.selected) {
      return;
    }
    if (rangeIn.startDate.isBefore(rangeIn.endDate)) {
      this.selected = rangeIn;
      // Convert to UTC time.
      const interval = Interval.fromDateTimes(
          DateTime.fromJSDate(rangeIn.startDate.toDate())
              .startOf('day')
              .toUTC(),
          DateTime.fromJSDate(rangeIn.endDate.toDate()).endOf('day').toUTC());
      this.changeDateRange.emit(interval);

      recordGoogleAnalyticsEvent(
          'dateRangeChanged', 'timeline',
          interval.start.toLocaleString() + ' - ' +
              interval.end.toLocaleString());
    }
  }
}


text:
const templates = (() => {

	function get(name) {
		var promise = new Promise(function (resolve, reject) {
			var url = `/templates/${name}.html`;
			$.get(url, function (html) {
				var template = Handlebars.compile(html);
				resolve(template);
			});
		});

		return promise;
	};

	return {
		get
	};
})();


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
	xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/gradeLinearLayout"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:background="@color/bg"
    android:orientation="vertical">
<TextView
    android:id="@+id/gradeTitle"
    android:layout_width="match_parent"
	android:layout_height="wrap_content"
	android:textSize="30sp"
	android:layout_marginBottom="10dp"
	 android:background="@color/bg"
	android:textColor="#000"
	android:gravity="center"
	android:text=""
	/>

    <ScrollView
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
  >
	  <TableLayout
			    android:id="@+id/gradesTable"
			    android:layout_width="wrap_content"
			    android:layout_height="wrap_content"
			    android:layout_gravity="center_horizontal"
			    android:shrinkColumns="0"
			    android:layout_marginLeft="40dip"
			    android:layout_marginRight="40dip"
			    >

		</TableLayout>

  </ScrollView>
</LinearLayout>


text:
package org.jadira.usertype.dateandtime.joda;

import org.jadira.usertype.dateandtime.joda.columnmapper.StringColumnLocalDateTimeMapper;
import org.jadira.usertype.spi.shared.AbstractSingleColumnUserType;
import org.joda.time.LocalDateTime;

/**
 * Persist {@link LocalDateTime} via Hibernate.
 */
public class PersistentLocalDateTimeAsString extends AbstractSingleColumnUserType<LocalDateTime, String, StringColumnLocalDateTimeMapper> {

    private static final long serialVersionUID = 6089350124392309729L;
}


text:
title: Create, Open and Save Workbooks
page_title: Create, Open and Save Workbooks | RadSpreadProcessing for ASP.NET AJAX Documentation
description: Create, Open and Save Workbooks
slug: radspreadprocessing-working-with-workbooks-create-open-and-save-workbooks
tags: create,,open,and,save,workbooks
published: True
position: 1
---

# Create, Open and Save Workbooks

You have the possibility to create workbooks from scratch, open existing files as workbooks and save workbooks into different file formats. This article aims to help you get familiar with these operations.

* [Create a Workbook](#create-a-workbook)

* [Open a Workbook](#open-a-workbook)

* [Save a Workbook](#save-a-workbook)

## Create a Workbook

The fact that the document model of __RadSpreadsheet__ is completely decoupled from UI enables numerous server side scenarios that build a document from scratch. The model allows you to instantiate a new workbook using the nullary constructor of the __Workbook__ class. Note that when a new workbook is created in this manner its __Worksheet__'s collection is still empty. __Example 1__ creates a new workbook and adds its first worksheet, which also becomes the __ActiveWorksheet__ of the workbook:

#### __[C#] Example 1: Create a workbook and add a worksheet to it__

{{region radspreadprocessing-working-with-workbooks-create-open-and-save-workbooks_0}}
    Workbook workbook = new Workbook();
    Worksheet worksheet = workbook.Worksheets.Add();
{{endregion}}

## Open a Workbook

__RadSpreadsheet__ document model allows you to easily import a workbook from a number of formats. Currently, the model supports csv, txt and xlsx formats. To import a workbook, you need to instantiate a specific format provider, invoke its __Import()__ method and pass a stream as an argument. __Example 2__ uses a WebClient to download a csv file stored on a server. Further, the code creates a __CsvFormatProvider__ object and invokes its __Import()__ method:

#### __[C#] Example 2: Download and import xlsx file__

{{region radspreadprocessing-working-with-workbooks-create-open-and-save-workbooks_1}}
    const string FilePath = @"http://localhost:54352/Resourses/SampleFile.xlsx";
    WebClient webClient = new WebClient();

    webClient.OpenReadCompleted += (sender, eventArgs) =>
    {
        XlsxFormatProvider formatProvider = new XlsxFormatProvider();
        Workbook workbook = formatProvider.Import(eventArgs.Result);
    };

    webClient.OpenReadAsync(new Uri(FilePath));
{{endregion}}

More information about import is available in the [Formats and Conversion]({%slug radspreadprocessing-formats-and-conversion-general-information%}) section.

## Save a Workbook{% if site.site_name == 'Silverlight' %}

__RadSpreadsheet__ also allows you to save a workbook into a csv, txt and xlsx formats. To export a workbook, you need to instantiate the format provider you would like to use and invoke its __Export()__ method.

For security purposes accessing files in Silverlight can be achieved only through user-initiated dialogs. That said, to save workbook's contents into a csv file, you need to use the SaveFileDialog. __Example 3__ passes the stream returned by the dialog and the current workbook to the __Export()__ method of the __CsvFormatProvider__:

#### __[C#] Example 3: Save csv file using SaveFileDialog__

{{region radspreadprocessing-working-with-workbooks-create-open-and-save-workbooks_2}}
    Workbook workbook = new Workbook();
    workbook.Worksheets.Add();

    SaveFileDialog saveFileDialog = new SaveFileDialog();
    CsvFormatProvider formatProvider = new CsvFormatProvider();
    saveFileDialog.Filter = "CSV (comma delimited) (*.csv)|*.csv|All Files (*.*)|*.*";

    if (saveFileDialog.ShowDialog() == true)
    {
        using (Stream output = saveFileDialog.OpenFile())
        {
            formatProvider.Export(workbook, output);
        }
    }
{{endregion}}

{% endif %}{% if site.site_name == 'AJAX' %}

__RadSpreadsheet__ also allows you to save a workbook into a csv, txt and xlsx formats. To export a workbook, you need to instantiate the format provider you would like to use and invoke its __Export()__ method. __Example 3__ demonstrates how to export an existing Workbook to a csv file. The snippet creates a new workbook with a single worksheet. Further, it creates a __CsvFormatProvider__ and invokes its __Export()__ method:

#### __[C#] Example 3: Save csv file__

{{region radspreadprocessing-working-with-workbooks-create-open-and-save-workbooks_3}}
    Workbook workbook = new Workbook();
    workbook.Worksheets.Add();

    string fileName = "SampleFile.csv";
    IWorkbookFormatProvider formatProvider = new CsvFormatProvider();

    using (FileStream output = new FileStream(fileName, FileMode.Create))
    {
        formatProvider.Export(workbook, output);
    }
{{endregion}}

{% endif %}

More information about export is available in the [Formats and Conversion]({%slug radspreadprocessing-formats-and-conversion-general-information%}) section.


text:
package ut.com.atlassian.jgitflow.core;

import java.io.File;
import java.util.List;

import com.atlassian.jgitflow.core.InitContext;
import com.atlassian.jgitflow.core.JGitFlow;
import com.atlassian.jgitflow.core.JGitFlowInitCommand;
import com.atlassian.jgitflow.core.exception.*;
import com.atlassian.jgitflow.core.util.GitHelper;

import org.apache.commons.io.FileUtils;
import org.eclipse.jgit.api.Git;
import org.eclipse.jgit.lib.Constants;
import org.eclipse.jgit.lib.Ref;
import org.eclipse.jgit.revwalk.RevCommit;
import org.eclipse.jgit.transport.TagOpt;
import org.junit.Test;

import ut.com.atlassian.jgitflow.core.testutils.RepoUtil;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;

/**
 * @since version
 */
public class HotfixStartTest extends BaseGitFlowTest
{
    @Test
    public void startHotfix() throws Exception
    {
        Git git = RepoUtil.createRepositoryWithMasterAndTag(newDir());
        JGitFlowInitCommand initCommand = new JGitFlowInitCommand();
        JGitFlow flow = initCommand.setDirectory(git.getRepository().getWorkTree()).call();

        flow.hotfixStart("1.1").call();

        assertEquals(flow.getHotfixBranchPrefix() + "1.1", git.getRepository().getBranch());
    }

    @Test(expected = IllegalStateException.class)
    public void startHotfixWithNoTags() throws Exception
    {
        Git git = RepoUtil.createRepositoryWithMaster(newDir());
        JGitFlowInitCommand initCommand = new JGitFlowInitCommand();
        JGitFlow flow = initCommand.setDirectory(git.getRepository().getWorkTree()).call();

        flow.hotfixStart("1.0").call();

        assertEquals(flow.getHotfixBranchPrefix() + "1.0", git.getRepository().getBranch());
    }

    @Test
    public void startHotfixWithFetch() throws Exception
    {
        Git git = null;
        Git remoteGit = null;
        remoteGit = RepoUtil.createRepositoryWithMasterAndDevelop(newDir());

        git = Git.cloneRepository().setDirectory(newDir()).setURI("file://" + remoteGit.getRepository().getWorkTree().getPath()).call();

        JGitFlowInitCommand initCommand = new JGitFlowInitCommand();
        JGitFlow flow = initCommand.setDirectory(git.getRepository().getWorkTree()).call();
        git.push().setRemote("origin").add("master").call();

        //do a commit to the remote develop branch
        remoteGit.checkout().setName("master").call();
        File junkFile = new File(remoteGit.getRepository().getWorkTree(), "junk.txt");
        FileUtils.writeStringToFile(junkFile, "I am junk");
        remoteGit.add().addFilepattern(junkFile.getName()).call();
        remoteGit.commit().setMessage("adding junk file").call();
        remoteGit.tag().setName("1.1").setAnnotated(true).setMessage("tagging release 1.1").call();

        //update local
        git.fetch().setTagOpt(TagOpt.FETCH_TAGS).call();
        git.checkout().setName("master").call();
        git.pull().call();

        flow.hotfixStart("1.2").setFetch(true).call();

        assertEquals(flow.getHotfixBranchPrefix() + "1.2", git.getRepository().getBranch());
    }

    @Test
    public void startHotfixWithPush() throws Exception
    {
        Git git = null;
        Git remoteGit = null;
        remoteGit = RepoUtil.createRepositoryWithMasterAndTag(newDir());

        git = Git.cloneRepository().setDirectory(newDir()).setURI("file://" + remoteGit.getRepository().getWorkTree().getPath()).call();

        JGitFlowInitCommand initCommand = new JGitFlowInitCommand();
        JGitFlow flow = initCommand.setDirectory(git.getRepository().getWorkTree()).call();
        git.push().setRemote("origin").add("master").call();

        flow.hotfixStart("1.1").setFetch(true).setPush(true).call();

        assertTrue(GitHelper.remoteBranchExists(git, "hotfix/1.1"));

    }

    @Test
    public void startHotfixWithFetchLocalBehindMasterNoFetch() throws Exception
    {
        Git git = null;
        Git remoteGit = null;
        remoteGit = RepoUtil.createRepositoryWithMasterAndTag(newDir());

        git = Git.cloneRepository().setDirectory(newDir()).setURI("file://" + remoteGit.getRepository().getWorkTree().getPath()).call();

        JGitFlowInitCommand initCommand = new JGitFlowInitCommand();
        JGitFlow flow = initCommand.setDirectory(git.getRepository().getWorkTree()).call();
        git.push().setRemote("origin").add("master").call();

        //do a commit to the remote develop branch
        remoteGit.checkout().setName("master").call();
        File junkFile = new File(remoteGit.getRepository().getWorkTree(), "junk.txt");
        FileUtils.writeStringToFile(junkFile, "I am junk");
        remoteGit.add().addFilepattern(junkFile.getName()).call();
        remoteGit.commit().setMessage("adding junk file").call();
        remoteGit.tag().setName("1.1").setAnnotated(true).setMessage("tagging release 1.1").call();

        flow.hotfixStart("1.2").call();

        assertEquals(flow.getHotfixBranchPrefix() + "1.2", git.getRepository().getBranch());

    }

    public void startHotfixWithFetchNoRemote() throws Exception
    {
        Git git = RepoUtil.createRepositoryWithMaster(newDir());
        JGitFlowInitCommand initCommand = new JGitFlowInitCommand();
        JGitFlow flow = initCommand.setDirectory(git.getRepository().getWorkTree()).call();

        flow.hotfixStart("1.0").setFetch(true).call();

    }

    @Test(expected = NotInitializedException.class)
    public void startHotfixWithoutFlowInit() throws Exception
    {
        Git git = RepoUtil.createRepositoryWithMaster(newDir());
        JGitFlow flow = JGitFlow.get(git.getRepository().getWorkTree());

        flow.hotfixStart("1.0").call();
    }

    @Test(expected = DirtyWorkingTreeException.class)
    public void startHotfixWithUnStagedFile() throws Exception
    {
        Git git = RepoUtil.createRepositoryWithMasterAndDevelop(newDir());
        JGitFlowInitCommand initCommand = new JGitFlowInitCommand();
        JGitFlow flow = initCommand.setDirectory(git.getRepository().getWorkTree()).call();

        //create a new file
        File junkFile = new File(git.getRepository().getWorkTree(), "junk.txt");
        FileUtils.writeStringToFile(junkFile, "I am junk");

        flow.hotfixStart("1.0").call();
    }

    @Test(expected = DirtyWorkingTreeException.class)
    public void startHotfixUnCommittedFile() throws Exception
    {
        Git git = RepoUtil.createRepositoryWithMasterAndDevelop(newDir());
        JGitFlowInitCommand initCommand = new JGitFlowInitCommand();
        JGitFlow flow = initCommand.setDirectory(git.getRepository().getWorkTree()).call();

        //create a new file and add it to the index
        File junkFile = new File(git.getRepository().getWorkTree(), "junk.txt");
        FileUtils.writeStringToFile(junkFile, "I am junk");
        git.add().addFilepattern(junkFile.getName()).call();

        flow.hotfixStart("1.0").call();
    }

    @Test
    public void startHotfixWithNewCommit() throws Exception
    {
        Git git = RepoUtil.createRepositoryWithMasterAndDevelop(newDir());
        JGitFlowInitCommand initCommand = new JGitFlowInitCommand();
        JGitFlow flow = initCommand.setDirectory(git.getRepository().getWorkTree()).call();

        //we should be on develop branch
        flow.git().checkout().setName(flow.getDevelopBranchName()).call();
        assertEquals(flow.getDevelopBranchName(), git.getRepository().getBranch());

        //switch to master
        git.checkout().setName("master").call();

        //create a new commit
        File junkFile = new File(git.getRepository().getWorkTree(), "junk.txt");
        FileUtils.writeStringToFile(junkFile, "I am junk");
        git.add().addFilepattern(junkFile.getName()).call();
        RevCommit commit = git.commit().setMessage("committing junk file").call();
        git.tag().setName("1.1").setAnnotated(true).setMessage("tagging release 1.1").call();

        flow.hotfixStart("1.2").call();

        assertEquals(flow.getHotfixBranchPrefix() + "1.2", git.getRepository().getBranch());

        //the hotfix branch should have our commit
        assertTrue("hotfix branch does not have our commit: " + commit.toString(), GitHelper.isMergedInto(git, commit, flow.getHotfixBranchPrefix() + "1.2"));

    }

    @Test(expected = HotfixBranchExistsException.class)
    public void startHotfixWithExistingLocalBranch() throws Exception
    {
        Git git = null;

        git = RepoUtil.createRepositoryWithMaster(newDir());
        JGitFlowInitCommand initCommand = new JGitFlowInitCommand();
        JGitFlow flow = initCommand.setDirectory(git.getRepository().getWorkTree()).call();

        git.branchCreate().setName(flow.getHotfixBranchPrefix() + "1.0").call();

        flow.hotfixStart("1.0").call();
    }

    @Test(expected = TagExistsException.class)
    public void startHotfixWithExistingLocalTag() throws Exception
    {
        Git git = null;

        git = RepoUtil.createRepositoryWithMaster(newDir());
        JGitFlowInitCommand initCommand = new JGitFlowInitCommand();
        JGitFlow flow = initCommand.setDirectory(git.getRepository().getWorkTree()).call();

        git.tag().setName(flow.getVersionTagPrefix() + "1.0").call();

        flow.hotfixStart("1.0").call();
    }

    @Test(expected = TagExistsException.class)
    public void startHotfixWithExistingLocalPrefixedTag() throws Exception
    {
        Git git = null;

        git = RepoUtil.createRepositoryWithMaster(newDir());
        JGitFlowInitCommand initCommand = new JGitFlowInitCommand();
        InitContext ctx = new InitContext();
        ctx.setVersiontag("vtag/");

        JGitFlow flow = initCommand.setInitContext(ctx).setDirectory(git.getRepository().getWorkTree()).call();

        git.tag().setName(flow.getVersionTagPrefix() + "1.0").call();

        //just to make sure
        List<Ref> refs = git.tagList().call();
        String name = refs.get(0).getName();

        assertEquals(Constants.R_TAGS + "vtag/1.0", name);

        flow.hotfixStart("1.0").call();
    }

    @Test(expected = TagExistsException.class)
    public void startHotfixWithExistingRemoteTagAndFetch() throws Exception
    {
        Git git = null;
        Git remoteGit = null;
        remoteGit = RepoUtil.createRepositoryWithMasterAndDevelop(newDir());

        git = Git.cloneRepository().setDirectory(newDir()).setURI("file://" + remoteGit.getRepository().getWorkTree().getPath()).call();

        JGitFlowInitCommand initCommand = new JGitFlowInitCommand();
        JGitFlow flow = initCommand.setDirectory(git.getRepository().getWorkTree()).call();
        git.push().setRemote("origin").add("master").call();

        //add the remote tag
        remoteGit.tag().setName(flow.getVersionTagPrefix() + "1.0").call();

        flow.hotfixStart("1.0").setFetch(true).call();

    }

    @Test
    public void startHotfixWithExistingRemoteTagNoFetch() throws Exception
    {
        Git git = null;
        Git remoteGit = null;
        remoteGit = RepoUtil.createRepositoryWithMasterAndTag(newDir());

        git = Git.cloneRepository().setDirectory(newDir()).setURI("file://" + remoteGit.getRepository().getWorkTree().getPath()).call();

        JGitFlowInitCommand initCommand = new JGitFlowInitCommand();
        JGitFlow flow = initCommand.setDirectory(git.getRepository().getWorkTree()).call();
        git.push().setRemote("origin").add("master").call();

        //add the remote tag
        remoteGit.tag().setName(flow.getVersionTagPrefix() + "1.1").call();

        flow.hotfixStart("1.1").call();

        assertEquals(flow.getHotfixBranchPrefix() + "1.1", git.getRepository().getBranch());

    }
}


text:
package com.matejdro.RegionTiler;

import com.mojang.nbt.CompoundTag;
import com.mojang.nbt.ListTag;
import com.mojang.nbt.NbtIo;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.HashSet;
import java.util.UUID;
import net.minecraft.world.level.chunk.storage.RegionFile;

/**
 * Created by Matej on 29.5.2014.
 */
public class Main
{
    private static HashSet<String> villagers = new HashSet<String>();

    public static void main(String[] args)
    {
        if (args.length < 5)
        {
            System.out.println("usage: java -jar RegionTiler.jar <origin chunk x> <origin chunk z> <min region x> <max region x> <min region z> <max region z>");
            return;
        }

        int originX = Integer.parseInt(args[0]);
        int originZ = Integer.parseInt(args[1]);
        int minX = Integer.parseInt(args[2]);
        int maxX = Integer.parseInt(args[3]);
        int minZ = Integer.parseInt(args[4]);
        int maxZ = Integer.parseInt(args[5]);

        try
        {
            System.out.println("loading origin chunk...");
            int originRegionX = originX / 32;
            int originRegionZ = originZ / 32;
            int insideOriginChunkX = originX % 32;
            int insideOriginChunkZ = originZ % 32;

            File originRegionFile = new File("r." + originRegionX + "." + originRegionZ + ".mca");
            RegionFile originRegion = new RegionFile(originRegionFile);
            DataInputStream originChunkStream = originRegion.getChunkDataInputStream(insideOriginChunkX, insideOriginChunkZ);
            CompoundTag originChunk = NbtIo.read(originChunkStream);
            originChunkStream.close();
            originRegion.close();

            for (int x = minX; x <= maxX; x++)
            {
                for (int z = minZ; z <= maxZ; z++)
                {
                    System.out.println("writing region " + x + " " + z + "...");
                    File regionFile = new File("r." + x + "." + z + ".mca");
                    RegionFile region = new RegionFile(regionFile);

                    for (int cX = 0; cX < 32; cX++)
                    {
                        for (int cZ = 0; cZ < 32; cZ++)
                        {
                            int actualChunkX = x * 32 + cX;
                            int actualChunkZ = z * 32 + cZ;

                            modifyChunkCoordinates(originChunk, actualChunkX, actualChunkZ);

                            DataOutputStream stream = region.getChunkDataOutputStream(cX, cZ);
                            NbtIo.write(originChunk, stream);
                            stream.close();
                        }
                    }

                    region.close();
                }
            }

        }
        catch (IOException e)
        {
            e.printStackTrace();
        }

    }

//    public static void fillChunks(File file, int originChunkX, int originChunkZ)
//    {
//        System.out.println("Tiling Chunk (0,0) over whole origin region ...");
//        try
//        {
//            RegionFile region = new RegionFile(file);
//            DataInputStream middleChunkSteam = region.getChunkDataInputStream(16, 16);
//            CompoundTag middleChunk = NbtIo.read(middleChunkSteam);
//            CompoundTag levelTag = middleChunk.getCompound("Level");
//
//            int baseX = levelTag.getInt("xPos") - 16;
//            int baseZ = levelTag.getInt("zPos") - 16;
//
//

//            for (int x = 0; x < 32; x++)
//            {
//                for (int z = 0; z < 32; z++)
//                {
//                    modifyChunkCoordinates();
//                    DataOutputStream chunkStream = region.getChunkDataOutputStream(x, z);
//                    CompoundTag tag = NbtIo.read(chunkStream);
//                    CompoundTag levelTag = tag.getCompound("Level");
//                    ListTag entitiesTag = (ListTag) levelTag.get("Entities");
//
//                    for (int i = 0; i < entitiesTag.size(); i++)
//                    {
//                        CompoundTag entity = (CompoundTag) entitiesTag.get(i);
//                        String id = entity.getString("id");
//
//                        if (!"Villager".equals(id))
//                            continue;
//
//                        long uuidMost = entity.getLong("UUIDMost");
//                        long uuidLeast = entity.getLong("UUIDLeast");
//
//                        UUID uuid = new UUID(uuidMost, uuidLeast);
//                        villagers.add(uuid.toString());
//                    }
//
//
//                    chunkStream.close();
//                }
//            }
//
//        } catch (FileNotFoundException e)
//        {
//            e.printStackTrace();
//        } catch (IOException e)
//        {
//            e.printStackTrace();
//        }
//    }

    public static void processRegion(File file)
    {
        System.out.println("    Processing region " + file.getName() + " ...");
        try
        {
            RegionFile region = new RegionFile(file);
            for (int x = 0; x < 32; x++)
            {
                for (int z = 0; z < 32; z++)
                {
                    if (!region.hasChunk(x, z))
                        continue;

                    DataInputStream chunkStream = region.getChunkDataInputStream(x, z);
                    CompoundTag tag = NbtIo.read(chunkStream);
                    CompoundTag levelTag = tag.getCompound("Level");
                    ListTag entitiesTag = (ListTag) levelTag.get("Entities");

                    for (int i = 0; i < entitiesTag.size(); i++)
                    {
                        CompoundTag entity = (CompoundTag) entitiesTag.get(i);
                        String id = entity.getString("id");

                        if (!"Villager".equals(id))
                            continue;

                        long uuidMost = entity.getLong("UUIDMost");
                        long uuidLeast = entity.getLong("UUIDLeast");

                        UUID uuid = new UUID(uuidMost, uuidLeast);
                        villagers.add(uuid.toString());
                    }

                    chunkStream.close();
                 }
            }

        } catch (FileNotFoundException e)
        {
            e.printStackTrace();
        } catch (IOException e)
        {
            e.printStackTrace();
        }
    }

    public static void modifyChunkCoordinates(CompoundTag chunk, int x, int z)
    {
        CompoundTag levelTag = chunk.getCompound("Level");
        levelTag.putInt("xPos", x);
        levelTag.putInt("zPos", z);
    }

    private static void copyFile(File origin, File destination)
    {
        try
        {
            FileInputStream in = new FileInputStream(origin);
            FileOutputStream out = new FileOutputStream(destination);

            byte[] buffer = new byte[100000];

            while (true)
            {
                int read = in.read(buffer);
                if (read == -1)
                    break;

                out.write(buffer, 0, read);
            }

            in.close();
            out.close();
        }
        catch (IOException e)
        {
            e.printStackTrace();
        }
    }
}


text:
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class Data_base
    Inherits System.Windows.Forms.Form

    'Form overrides dispose to clean up the component list.
    <System.Diagnostics.DebuggerNonUserCode()> _
    Protected Overrides Sub Dispose(ByVal disposing As Boolean)
        Try
            If disposing AndAlso components IsNot Nothing Then
                components.Dispose()
            End If
        Finally
            MyBase.Dispose(disposing)
        End Try
    End Sub

    'Required by the Windows Form Designer
    Private components As System.ComponentModel.IContainer

    'NOTE: The following procedure is required by the Windows Form Designer
    'It can be modified using the Windows Form Designer.
    'Do not modify it using the code editor.
    <System.Diagnostics.DebuggerStepThrough()> _
    Private Sub InitializeComponent()
        Me.Label1 = New System.Windows.Forms.Label()
        Me.Label2 = New System.Windows.Forms.Label()
        Me.Label3 = New System.Windows.Forms.Label()
        Me.Label4 = New System.Windows.Forms.Label()
        Me.Label5 = New System.Windows.Forms.Label()
        Me.data_base_endereco_server = New System.Windows.Forms.TextBox()
        Me.data_base_porta = New System.Windows.Forms.TextBox()
        Me.data_base_login = New System.Windows.Forms.TextBox()
        Me.data_base_senha = New System.Windows.Forms.TextBox()
        Me.data_base_nome_do_bando = New System.Windows.Forms.TextBox()
        Me.data_base_cadastrar = New System.Windows.Forms.Button()
        Me.data_base_fechar = New System.Windows.Forms.Button()
        Me.SuspendLayout()
        '
        'Label1
        '
        Me.Label1.AutoSize = True
        Me.Label1.Location = New System.Drawing.Point(12, 19)
        Me.Label1.Name = "Label1"
        Me.Label1.Size = New System.Drawing.Size(111, 13)
        Me.Label1.TabIndex = 0
        Me.Label1.Text = "Endereço do servidor:"
        '
        'Label2
        '
        Me.Label2.AutoSize = True
        Me.Label2.Location = New System.Drawing.Point(13, 45)
        Me.Label2.Name = "Label2"
        Me.Label2.Size = New System.Drawing.Size(35, 13)
        Me.Label2.TabIndex = 1
        Me.Label2.Text = "Porta:"
        '
        'Label3
        '
        Me.Label3.AutoSize = True
        Me.Label3.Location = New System.Drawing.Point(12, 71)
        Me.Label3.Name = "Label3"
        Me.Label3.Size = New System.Drawing.Size(36, 13)
        Me.Label3.TabIndex = 2
        Me.Label3.Text = "Login:"
        '
        'Label4
        '
        Me.Label4.AutoSize = True
        Me.Label4.Location = New System.Drawing.Point(12, 97)
        Me.Label4.Name = "Label4"
        Me.Label4.Size = New System.Drawing.Size(41, 13)
        Me.Label4.TabIndex = 3
        Me.Label4.Text = "Senha:"
        '
        'Label5
        '
        Me.Label5.AutoSize = True
        Me.Label5.Location = New System.Drawing.Point(12, 123)
        Me.Label5.Name = "Label5"
        Me.Label5.Size = New System.Drawing.Size(86, 13)
        Me.Label5.TabIndex = 4
        Me.Label5.Text = "Nome de banco:"
        '
        'data_base_endereco_server
        '
        Me.data_base_endereco_server.Location = New System.Drawing.Point(129, 16)
        Me.data_base_endereco_server.Name = "data_base_endereco_server"
        Me.data_base_endereco_server.Size = New System.Drawing.Size(143, 20)
        Me.data_base_endereco_server.TabIndex = 5
        '
        'data_base_porta
        '
        Me.data_base_porta.Location = New System.Drawing.Point(50, 42)
        Me.data_base_porta.Name = "data_base_porta"
        Me.data_base_porta.Size = New System.Drawing.Size(222, 20)
        Me.data_base_porta.TabIndex = 6
        '
        'data_base_login
        '
        Me.data_base_login.Location = New System.Drawing.Point(50, 68)
        Me.data_base_login.Name = "data_base_login"
        Me.data_base_login.Size = New System.Drawing.Size(222, 20)
        Me.data_base_login.TabIndex = 7
        '
        'data_base_senha
        '
        Me.data_base_senha.Location = New System.Drawing.Point(50, 94)
        Me.data_base_senha.Name = "data_base_senha"
        Me.data_base_senha.Size = New System.Drawing.Size(222, 20)
        Me.data_base_senha.TabIndex = 8
        '
        'data_base_nome_do_bando
        '
        Me.data_base_nome_do_bando.Location = New System.Drawing.Point(104, 120)
        Me.data_base_nome_do_bando.Name = "data_base_nome_do_bando"
        Me.data_base_nome_do_bando.Size = New System.Drawing.Size(168, 20)
        Me.data_base_nome_do_bando.TabIndex = 9
        '
        'data_base_cadastrar
        '
        Me.data_base_cadastrar.Location = New System.Drawing.Point(197, 151)
        Me.data_base_cadastrar.Name = "data_base_cadastrar"
        Me.data_base_cadastrar.Size = New System.Drawing.Size(75, 23)
        Me.data_base_cadastrar.TabIndex = 10
        Me.data_base_cadastrar.Text = "Cadastrar"
        Me.data_base_cadastrar.UseVisualStyleBackColor = True
        '
        'data_base_fechar
        '
        Me.data_base_fechar.Location = New System.Drawing.Point(116, 151)
        Me.data_base_fechar.Name = "data_base_fechar"
        Me.data_base_fechar.Size = New System.Drawing.Size(75, 23)
        Me.data_base_fechar.TabIndex = 11
        Me.data_base_fechar.Text = "Fechar"
        Me.data_base_fechar.UseVisualStyleBackColor = True
        '
        'Data_base
        '
        Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
        Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
        Me.CancelButton = Me.data_base_fechar
        Me.ClientSize = New System.Drawing.Size(284, 186)
        Me.Controls.Add(Me.data_base_fechar)
        Me.Controls.Add(Me.data_base_cadastrar)
        Me.Controls.Add(Me.data_base_nome_do_bando)
        Me.Controls.Add(Me.data_base_senha)
        Me.Controls.Add(Me.data_base_login)
        Me.Controls.Add(Me.data_base_porta)
        Me.Controls.Add(Me.data_base_endereco_server)
        Me.Controls.Add(Me.Label5)
        Me.Controls.Add(Me.Label4)
        Me.Controls.Add(Me.Label3)
        Me.Controls.Add(Me.Label2)
        Me.Controls.Add(Me.Label1)
        Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle
        Me.MaximizeBox = False
        Me.MinimizeBox = False
        Me.Name = "Data_base"
        Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
        Me.Text = "Data Base "
        Me.ResumeLayout(False)
        Me.PerformLayout()

    End Sub
    Friend WithEvents Label1 As System.Windows.Forms.Label
    Friend WithEvents Label2 As System.Windows.Forms.Label
    Friend WithEvents Label3 As System.Windows.Forms.Label
    Friend WithEvents Label4 As System.Windows.Forms.Label
    Friend WithEvents Label5 As System.Windows.Forms.Label
    Friend WithEvents data_base_endereco_server As System.Windows.Forms.TextBox
    Friend WithEvents data_base_porta As System.Windows.Forms.TextBox
    Friend WithEvents data_base_login As System.Windows.Forms.TextBox
    Friend WithEvents data_base_senha As System.Windows.Forms.TextBox
    Friend WithEvents data_base_nome_do_bando As System.Windows.Forms.TextBox
    Friend WithEvents data_base_cadastrar As System.Windows.Forms.Button
    Friend WithEvents data_base_fechar As System.Windows.Forms.Button
End Class


text:
package com.smartg.swing.table;

import java.awt.Color;
import java.awt.Component;
import java.awt.Graphics;

import javax.swing.Box;
import javax.swing.BoxLayout;
import javax.swing.Icon;
import javax.swing.JButton;
import javax.swing.JComponent;
import javax.swing.JLabel;
import javax.swing.JTable;
import javax.swing.table.TableCellRenderer;

import com.smartg.swing.NullMarginButton;
import com.smartg.swing.layout.JNodeLayout;
import com.smartg.swing.layout.LayoutNode;
import com.smartg.swing.layout.NodeAlignment;
import com.smartg.swing.layout.NodeConstraints;

public class TableCellRendererWithButton implements TableCellRenderer {

	private final JComponent panel = new JLabel();
	private final StealthButton button = new StealthButton();
	private TableCellRenderer renderer;
	private final JComponent rendererPanel = new Box(BoxLayout.LINE_AXIS);

	private final RendererFunctionFactory functionFactory = new RendererFunctionFactory();

	public TableCellRendererWithButton(TableCellRenderer renderer) {
		this(renderer, 4);
	}

	public TableCellRendererWithButton(TableCellRenderer renderer, int buttonAlignment) {
		this.renderer = renderer;
		LayoutNode.HorizontalNode root = new LayoutNode.HorizontalNode("root");
		JNodeLayout layout = new JNodeLayout(this.panel, root);

		this.panel.setLayout(layout);
		this.panel.setOpaque(true);
		if (buttonAlignment == 4) {
			this.panel.add(this.rendererPanel, new NodeConstraints("root"));
			LayoutNode.HorizontalNode buttonNode = new LayoutNode.HorizontalNode("button");
			buttonNode.setHorizontalAlignment(NodeAlignment.RIGHT);
			root.add(buttonNode);
			this.panel.add(this.button, new NodeConstraints("button"));
			layout.setHorizontalAlignment(this.rendererPanel, NodeAlignment.RIGHT);
			root.setHorizontalAlignment(NodeAlignment.RIGHT);
			layout.setHorizontalAlignment(this.button, NodeAlignment.RIGHT);
		} else {
			LayoutNode.HorizontalNode buttonNode = new LayoutNode.HorizontalNode("button");
			buttonNode.setHorizontalAlignment(NodeAlignment.LEFT);
			root.add(buttonNode);
			this.panel.add(this.button, new NodeConstraints("button"));

			this.panel.add(this.rendererPanel, new NodeConstraints("root"));
			layout.setHorizontalAlignment(this.rendererPanel, NodeAlignment.LEFT);
			root.setHorizontalAlignment(NodeAlignment.LEFT);
			layout.setHorizontalAlignment(this.button, NodeAlignment.LEFT);
		}
		layout.setHorizontalAlignment(this.button, NodeAlignment.RIGHT);
	}

	public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus,
			int row, int column) {

		CellRendererParams params = new CellRendererParams().setTable(table).setValue(value).setSelected(isSelected)
				.setHasFocus(hasFocus).setRow(row).setColumn(column);

		String string = "";
		if (value != null) {
			string = value.toString();
		}
		this.button.setContentAreaFilled(isButtonContentAreaFilled(params));
		this.button.setBorderPainted(isButtonBorderPainted(params));

		Icon buttonIcon = getButtonIcon(params);
		if (buttonIcon != null) {
			this.button.setIcon(buttonIcon);
		} else {
			String buttonText = getButtonText(params);
			if ((buttonText != null) && (!buttonText.isEmpty())) {
				this.button.setText(buttonText);
			} else {
				this.button.setText("...");
			}
		}
		this.button.setStealthMode(!showButton(params));
		JLabel comp;
		if (isUseValueForButton(params)) {
			comp = (JLabel) this.renderer.getTableCellRendererComponent(table, "", isSelected, hasFocus, row, column);
			this.button.setText(string);
			comp.setVisible(false);
		} else {
			comp = (JLabel) this.renderer.getTableCellRendererComponent(table, value, isSelected, hasFocus, row,
					column);
			comp.setVisible(true);
		}
		comp.setHorizontalTextPosition(4);
		comp.setHorizontalAlignment(4);

		comp.setOpaque(true);

		Color bg = getBackgroundColor(params);
		this.panel.setBackground(bg);
		comp.setBackground(bg);
		this.rendererPanel.setBackground(bg);
		comp.setBackground(bg);
		this.rendererPanel.add(comp, "Center");

		return this.panel;
	}

	public Color getBackgroundColor(CellRendererParams t) {
		return this.functionFactory.getBackgroundcolor().apply(t);
	}

	public boolean isUseValueForButton(CellRendererParams t) {
		return this.functionFactory.getUseValueForButton().apply(t);
	}

	public String getButtonText(CellRendererParams t) {
		return this.functionFactory.getButtonText().apply(t);
	}

	public Icon getButtonIcon(CellRendererParams t) {
		return this.functionFactory.getButtonIcon().apply(t);
	}

	public boolean isButtonContentAreaFilled(CellRendererParams t) {
		return this.functionFactory.getButtonContentAreaFilled().apply(t);
	}

	public boolean isButtonBorderPainted(CellRendererParams t) {
		return this.functionFactory.getButtonBorderPainted().apply(t);
	}

	public boolean showButton(CellRendererParams t) {
		return this.functionFactory.getShowButton().apply(t);
	}

	public JButton getButton() {
		return this.button;
	}

	public RendererFunctionFactory getFunctionFactory() {
		return this.functionFactory;
	}

	static class StealthButton extends NullMarginButton {

		private static final long serialVersionUID = -9008065882485328141L;
		private boolean stealthMode;

		public void paint(Graphics g) {
			if (!this.stealthMode) {
				super.paint(g);
			}
		}

		public boolean isStealthMode() {
			return this.stealthMode;
		}

		public void setStealthMode(boolean stealthMode) {
			this.stealthMode = stealthMode;
		}
	}

}


text:
const express = require('express');
const RegressionController = require('./orderByRegression.controller');
const AscendingController = require('./orderByAscending.controller');
const DescendingController = require('./orderByDescending.controller');
const router = express.Router();

const curdy = require('./../../../../../../index');

router.use('/regression/', curdy.generateRoutes(RegressionController));
router.use('/ascending/', curdy.generateRoutes(AscendingController));
router.use('/descending/', curdy.generateRoutes(DescendingController));

module.exports = router;


text:
package uk.co.skyem.projects.emuZ80.cpu.instructionGroups.unprefixed;

public class MiscFlags {
}


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

using Kaltek.Drawing;

namespace Kaltek.PDF
{
    public class PdfParagraph : IPageElement
    {
        public PdfParagraph()
        {
            Font = Fonts.Arial;
            Color = Color.Black;
        }

        public string Font { get; set; }

        public Color Color { get; set; }

        public string Text { get; set; }

        public Rectangle Bounds { get; set; }
    }
}


text:
function varargout = v_sceneFromRGB(varargin)
% Test how isetbio creates a scene from an rgb data using sceneFromFile
%
% Function sceneFromFile uses 1) the rgb data and the spectral power
% distributions (spds) of the display color primaries to calculate the
% spectral radiance of the displayed image, and 2) the spectral power
% distribution of the display white point as an estimate of the scene
% illuminant.
%
% Notes about the method
%     If we have display calibration data, we can accurately predict the
%     radiance emitted when an image is rendered on the display. But we
%     need a scene illuminant to estimate scene reflectances. We use the
%     spectral power of the display whitepoint (max r, max g, max b) as an
%     estimate of the scene illuminant. We then calculate reflectances of
%     surfaces in the scene by dividing the scene radiance by the
%     illuminant spd. The surface reflectances will not be accurate, but
%     they will be feasible. And, more importantly, calculating scene
%     reflectances makes it possible to render the scene under a different
%     illuminant.
%
% In this exammple, the scene illuminant is also changed.
%
% For this example, the gamma function of the display is not used.
%
% Copyright ImagEval, 2011

    varargout = UnitTest.runValidationRun(@ValidationFunction, nargout, varargin);
end

%% Function implementing the isetbio validation code
function ValidationFunction(runTimeParams)%% s_sceneFromRGB

    DEBUG_LEVEL = 0;

    %% Initialize
    ieInit

    %% Load display calibration data
    displayCalFile = 'LCD-Apple.mat';
    load(displayCalFile,'d'); dsp = d;
    wave = displayGet(dsp,'wave');
    spd = displayGet(dsp,'spd');
    if (runTimeParams.generatePlots)
        vcNewGraphWin; plot(wave,spd);
        xlabel('Wave (nm)'); ylabel('Energy'); grid on
        title('Spectral Power Distribution of Display Color Primaries');
    end

    if (DEBUG_LEVEL >= 1)
        UnitTest.validationData('wave', wave);
        UnitTest.validationData('spd', spd);
    end

    %% Analyze the display properties: Chromaticity
    d = displayCreate(displayCalFile);
    whtSPD = displayGet(d,'white spd');
    wave   = displayGet(d,'wave');
    whiteXYZ = ieXYZFromEnergy(whtSPD',wave);
    if (runTimeParams.generatePlots)
        fig = chromaticityPlot(chromaticity(whiteXYZ));
    end

    if (DEBUG_LEVEL >= 1)
        UnitTest.validationData('wave1', wave);
        UnitTest.validationData('spd1', spd);
    end

    %% Read in an rgb file and create calibrated display values
    rgbFile = fullfile(isetbioDataPath,'images','rgb','eagle.jpg');
    scene = sceneFromFile(rgbFile,'rgb',[],displayCalFile);
    if (runTimeParams.generatePlots)
        vcAddAndSelectObject(scene); sceneWindow;
    end

    if (DEBUG_LEVEL >= 2)
        UnitTest.validationData('scene', scene);
    end

    %% Internal validation
    %
    % We are having cross-platform issues with the horizontal angular
    % extent of the scene varying.  So we'll compute it from first
    % principles here.
    testByHand.hFovDegreesFromScene = sceneGet(scene,'hfov');
    testByHand.displayDPI = displayGet(d,'dpi');
    testByHand.displayMetersPerDot = displayGet(d,'meters per dot');
    testByHand.distance = sceneGet(scene,'distance');
    testByHand.degreesPerDot = displayGet(d,'deg per dot');
    testByHand.degreesPerDotCheck = 2*atand(testByHand.displayMetersPerDot/(2*testByHand.distance));
    testByHand.hSceneDots = sceneGet(scene,'cols');
    testByHand.hFovMeters = testByHand.displayMetersPerDot*testByHand.hSceneDots;
    testByHand.hFovDegreeesCheck = testByHand.hSceneDots*testByHand.degreesPerDot;

    tolerance = 1e-12;
    quantityOfInterest = testByHand.hFovDegreesFromScene-testByHand.hFovDegreeesCheck;
    UnitTest.assertIsZero(quantityOfInterest,'Hand check of h fov',tolerance);

    if (DEBUG_LEVEL >= 3)
        UnitTest.validationData('testByHand', testByHand);
    end

    %% Change the illuminant to 4000 K
    bb = blackbody(sceneGet(scene,'wave'),4000,'energy');
    scene = sceneAdjustIlluminant(scene,bb);
    if (runTimeParams.generatePlots)
        vcAddAndSelectObject(scene); sceneWindow;
    end

    if (DEBUG_LEVEL >= 4)
        UnitTest.validationData('bb', bb);
    end

    if (DEBUG_LEVEL >= 5)
        UnitTest.validationData('scene1', scene);
    end

    %% End
end


text:
package org.ripple.power.ui.table;

import java.awt.Component;

import javax.swing.ImageIcon;
import javax.swing.JLabel;
import javax.swing.JTable;
import javax.swing.table.DefaultTableCellRenderer;

import org.ripple.power.ui.graphics.LImage;

public class ImageRenderer extends DefaultTableCellRenderer {
	/**
	 *
	 */
	private static final long serialVersionUID = 1L;

	private final static ImageIcon XRP_ICON = new ImageIcon(
			LImage.createImage("icons/ripple.png").scaledInstance(16, 16).getBufferedImage());

	private final static ImageIcon BTC_ICON = new ImageIcon(
			LImage.createImage("icons/btc.png").scaledInstance(16, 16).getBufferedImage());

	private final static ImageIcon DOG_ICON = new ImageIcon(
			LImage.createImage("icons/dog.png").scaledInstance(16, 16).getBufferedImage());

	private final static ImageIcon LTC_ICON = new ImageIcon(
			LImage.createImage("icons/ltc.png").scaledInstance(16, 16).getBufferedImage());

	private final static ImageIcon USD_ICON = new ImageIcon(
			LImage.createImage("icons/flags/us.png").scaledInstance(16, 16).getBufferedImage());

	private final static ImageIcon JPY_ICON = new ImageIcon(
			LImage.createImage("icons/flags/jp.png").scaledInstance(16, 16).getBufferedImage());

	private final static ImageIcon KRW_ICON = new ImageIcon(
			LImage.createImage("icons/flags/kr.png").scaledInstance(16, 16).getBufferedImage());

	private final static ImageIcon EUR_ICON = new ImageIcon(
			LImage.createImage("icons/flags/eu.png").scaledInstance(16, 16).getBufferedImage());

	private final static ImageIcon CNY_ICON = new ImageIcon(
			LImage.createImage("icons/flags/cn.png").scaledInstance(16, 16).getBufferedImage());

	private final static ImageIcon OTHER_ICON = new ImageIcon(
			LImage.createImage("icons/other.png").scaledInstance(16, 16).getBufferedImage());

	public ImageRenderer(int alignment) {
		super();
		setHorizontalAlignment(alignment);
	}

	public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus,
			int row, int column) {
		JLabel label = (JLabel) super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
		String type = (String) value;
		if ("xrp".equalsIgnoreCase(type)) {
			label.setIcon(XRP_ICON);
		} else if ("btc".equalsIgnoreCase(type)) {
			label.setIcon(BTC_ICON);
		} else if ("dog".equalsIgnoreCase(type)) {
			label.setIcon(DOG_ICON);
		} else if ("ltc".equalsIgnoreCase(type)) {
			label.setIcon(LTC_ICON);
		} else if ("usd".equalsIgnoreCase(type)) {
			label.setIcon(USD_ICON);
		} else if ("jpy".equalsIgnoreCase(type)) {
			label.setIcon(JPY_ICON);
		} else if ("krw".equalsIgnoreCase(type)) {
			label.setIcon(KRW_ICON);
		} else if ("eur".equalsIgnoreCase(type)) {
			label.setIcon(EUR_ICON);
		} else if ("cny".equalsIgnoreCase(type)) {
			label.setIcon(CNY_ICON);
		} else {
			label.setIcon(OTHER_ICON);
		}
		label.setHorizontalAlignment(getHorizontalAlignment());
		return label;
	}
}


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

public class MyTraceListener : TraceListener
{
    public List<string> Messages = new List<string>();

    public override void Write(string message)
    {
        Messages.Add(message);
    }

    public override void WriteLine(string message)
    {
        Messages.Add(message);

    }
}


text:
Contributors MUST:
Comply with the templates using [conventional commit](https://www.conventionalcommits.org/en/v1.0.0-beta.4/) or **explicitly reason why not**

## Merge Requests

Contributors MUST:

- Comply with the templates using [conventional commit](https://www.conventionalcommits.org/en/v1.0.0-beta.4/) or **explicitly reason why not**
- For **bug fixes** fill 1. Description, 2.Related issue, 3.Regression test, 4.Refactoring statement, 6.Documentation and 7.Performance
- For **features** fill 1. Description, 2.Related discussion, 3.Unit test, 4. Integration test, 5. Refactoring statement, 6.Documentation and 7.Performance
- For **BREAKING CHANGE**, where valid programs are not working anymore, create a Request For Comment(RFC)
- Format your code with `cargo +nightly fmt` before creating a commit
- Squash commits, such that each commit clearly does a specific thing, either locally or using gitlab's custom checkbox.
- [Adhere to a git workflow using rebase](https://medium.com/singlestone/a-git-workflow-using-rebase-1b1210de83e5)
- Rebase upon the master branch, rather than merging it
- [Allow us to make commits on your merge request](https://docs.gitlab.com/ee/user/project/merge_requests/allow_collaboration.html)

Contributors MUST NOT:

- Have merge commits in their merge requests
- Have breaking changes without RFC
- Have commits which do not adhere to [Conventional Commit](https://www.conventionalcommits.org/en/v1.0.0-beta.4/) guidelines

Contributors SHOULD NOT:

- Worry about code style, because `cargo fmt` renders this a non-issue

[conventional commit]: https://www.conventionalcommits.org/en/v1.0.0-beta.4/

## Finding an issue

1. Find an area to work on within the shell or one of it's related projects.
This may be:

- An existing issue which has been reported
- A feature that is missing that you would like to develop
- An issue you've discovered that you would like to fix

2. Submit your intent to the issue board. Write into an existing issue or create a new issue.

## On Unit & Integration Tests

Feature addition to the code should be accompanied by unit and integration tests,
in order to prevent issues from creating on refactoring in the future.
Bug fixes should be combined with regression tests in order to prevent issues from
re-occuring in the future.

If you see an area that deserves a test, feel free to add extra tests in your pull requests.
When submitting new functionality, especially complex functionality, try to write as many
tests as you can think of to cover all possible code paths that your function(s) might take.
Integration tests are located in the **tests** directory, and are the most important place
to create tests -- unit tests come second after the integration tests.
Regression tests are both integration and unit tests, depending on the bug.

Integration tests are much more useful in general, as they cover real world use cases and
stress larger portions of the code base at once. Yet unit tests still have their place, as
they are able to test bits of functionality which may not necessarily be covered by existing
integration tests.

> In order to create unit tests for otherwise untestable code that depends on greater runtime
> specifics, you should likely write your functions to accept generic inputs, where unit
> tests can pass dummy types and environments into your functions for the purpose of testing
> the function, whereas in practice the function is hooked up to it's appropriate types.

## Test your code

Before submitting a merge request (MR) on GitLab, ensure that you've run your tests locally and that they
pass. This can be done by running the following two commands:

```sh
cargo +nightly test --lib && bash tests/run_examples.sh
```

## Format your code

In addition, format your code before submitting a MR. This will require that
you've installed the `rustfmt` Cargo component.

```sh
cargo +nightly fmt
```

Now you're ready to submit your work for review!

## Sumbitting your work for review

Submitting your work on the Redox OS GitLab server can be done by creating a [merge request (MR)](https://gitlab.redox-os.org/help/user/project/merge_requests/index.md).

**Important** Make sure you [enable commit edits from upstream members](https://gitlab.redox-os.org/help/user/project/merge_requests/allow_collaboration.md#enabling-commit-edits-from-upstream-members) by clicking the *"Allow commits from members who can merge to the target branch"* checkbox.

## Chatroom

Send an email to [info@redox-os.org](mailto:info@redox-os.org) to request invitation for joining
the developer chatroom for Ion. Experience with Rust is not required for contributing to Ion. There
are ways to contribute to Ion at all levels of experience, from writing scripts in Ion and reporting
issues, to seeking mentorship on how to implement solutions for specific issues on the issue board.

## Discussion

In addition to the chatroom, there's a [thread in the Redox forums](https://discourse.redox-os.org/t/ion-shell-development-discussion/682)
that can be used for discussions relating to Ion and Ion shell development. These are mostly served
by the GitHub issue board, but general discussions can take place there instead.


text:
<?php

namespace AppBundle\Tests\Controller;

use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
use Sonata\CoreBundle\Tests\Entity\EntityManager;

class MainPageControllerTest extends WebTestCase
{
    public function testIndex()
    {
        $client = static::createClient();

        $crawler = $client->request('GET', '/');

        $this->assertEquals(200, $client->getResponse()->getStatusCode());

        $serviceGroups = $client->getContainer()->get('doctrine')
            ->getRepository('AppBundle:ServiceGroup')
            ->findBy(array("visible" => 0));

        foreach ($serviceGroups as $serviceGroup) {
            $this->assertFalse($crawler->filter('html:contains("' . $serviceGroup->getName() . '")')->count() > 0, $serviceGroup->getName());
        }

        $articles = $client->getContainer()->get('doctrine')
            ->getRepository('AppBundle:Article')
            ->findBy(array("visible" => 0));

        foreach ($articles as $article) {
            $this->assertFalse($crawler->filter('html:contains("' . $article->getTitle() . '")')->count() > 0, $article->getTitle());
        }
    }
}


text:
<!DOCTYPE html>

    <meta charset="UTF-8">
    <title>Code Quiz</title>
    <link rel="shortcut icon" href="imgs/favicon.ico" type="image/x-icon">
    <link rel="icon" href="imgs/favicon.ico" type="image/x-icon">
    <link rel="stylesheet" href="http://bootswatch.com/flatly/bootstrap.min.css"/>
    <link rel="stylesheet" href="css/bootstrap.min.css"/>
    <link rel="stylesheet" href="css/code-styles.css"/>
    <link rel="stylesheet" href="css/reset.css"/>
    <link rel="stylesheet" href="css/style.css"/>

                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navigationbar">
                    Toggle navigation

                </button>

Battle Play

Hall Of Fame

Languages

Feedback

                        <fb:login-button id="profile-info" class="fb-login-button"
                                         data-size="large" show-faces="false" width="200"
                                         data-auto-logout-link="true" max-rows="1" id="log" >
                        </fb:login-button>

      <input type="button" value="Start game" class="btn btn-success" id="button-start">

Create a room for game or join to play!

Mana: 0

                      Time:

Team Codeberry Black

Fork me on GitHub

HackFMI


text:
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));

var _react = require("@testing-library/react");

var _react2 = _interopRequireDefault(require("react"));

var _styledComponents = _interopRequireDefault(require("styled-components"));

var _src = require("../../../../components-test-utils/src");

var _text_decoration = require("./text_decoration");

var _templateObject;

test('text-decoration', function () {
  var Test = _styledComponents["default"].p.withConfig({
    displayName: "text_decorationspec__Test",
    componentId: "sc-1eut5db-0"
  })(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n    ", "\n  "])), _text_decoration.textDecoration);

  (0, _src.renderWithTheme)(_react2["default"].createElement(Test, {
    textDecoration: "underline"
  }, "Find me"));
  expect(_react.screen.getByText('Find me')).toHaveStyle('text-decoration: underline');
});
//# sourceMappingURL=text_decoration.spec.js.map