text:
#include <linux/config.h>
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/init.h>
#include <linux/kernel.h>	/* printk() */
#include <linux/slab.h>		/* kmalloc() */
#include <linux/fs.h>		/* everything... */
#include <linux/errno.h>	/* error codes */
#include <linux/types.h>	/* size_t */
#include <linux/proc_fs.h>
#include <linux/fcntl.h>	/* O_ACCMODE */
#include <linux/aio.h>
#include <asm/uaccess.h>
#include <linux/vmalloc.h>
#include "scullv.h"		/* local definitions */

int scullv_major =   SCULLV_MAJOR;
int scullv_devs =    SCULLV_DEVS;	/* number of bare scullv devices */
int scullv_qset =    SCULLV_QSET;
int scullv_order =   SCULLV_ORDER;

module_param(scullv_major, int, 0);
module_param(scullv_devs, int, 0);
module_param(scullv_qset, int, 0);
module_param(scullv_order, int, 0);
MODULE_AUTHOR("Alessandro Rubini");
MODULE_LICENSE("Dual BSD/GPL");

struct scullv_dev *scullv_devices; /* allocated in scullv_init */

int scullv_trim(struct scullv_dev *dev);
void scullv_cleanup(void);

#ifdef SCULLV_USE_PROC /* don't waste space if unused */
/*
 * The proc filesystem: function to read and entry
 */

void scullv_proc_offset(char *buf, char **start, off_t *offset, int *len)
{
	if (*offset == 0)
		return;
	if (*offset >= *len) {
		/* Not there yet */
		*offset -= *len;
		*len = 0;
	} else {
		/* We're into the interesting stuff now */
		*start = buf + *offset;
		*offset = 0;
	}
}

/* FIXME: Do we need this here??  It be ugly  */
int scullv_read_procmem(char *buf, char **start, off_t offset,
                   int count, int *eof, void *data)
{
	int i, j, order, qset, len = 0;
	int limit = count - 80; /* Don't print more than this */
	struct scullv_dev *d;

	*start = buf;
	for(i = 0; i < scullv_devs; i++) {
		d = &scullv_devices[i];
		if (down_interruptible (&d->sem))
			return -ERESTARTSYS;
		qset = d->qset;  /* retrieve the features of each device */
		order = d->order;
		len += sprintf(buf+len,"\nDevice %i: qset %i, order %i, sz %li\n",
				i, qset, order, (long)(d->size));
		for (; d; d = d->next) { /* scan the list */
			len += sprintf(buf+len,"  item at %p, qset at %p\n",d,d->data);
			scullv_proc_offset (buf, start, &offset, &len);
			if (len > limit)
				goto out;
			if (d->data && !d->next) /* dump only the last item - save space */
				for (j = 0; j < qset; j++) {
					if (d->data[j])
						len += sprintf(buf+len,"    % 4i:%8p\n",j,d->data[j]);
					scullv_proc_offset (buf, start, &offset, &len);
					if (len > limit)
						goto out;
				}
		}
	  out:
		up (&scullv_devices[i].sem);
		if (len > limit)
			break;
	}
	*eof = 1;
	return len;
}

#endif /* SCULLV_USE_PROC */

/*
 * Open and close
 */

int scullv_open (struct inode *inode, struct file *filp)
{
	struct scullv_dev *dev; /* device information */

	/*  Find the device */
	dev = container_of(inode->i_cdev, struct scullv_dev, cdev);

    	/* now trim to 0 the length of the device if open was write-only */
	if ( (filp->f_flags & O_ACCMODE) == O_WRONLY) {
		if (down_interruptible (&dev->sem))
			return -ERESTARTSYS;
		scullv_trim(dev); /* ignore errors */
		up (&dev->sem);
	}

	/* and use filp->private_data to point to the device data */
	filp->private_data = dev;

	return 0;          /* success */
}

int scullv_release (struct inode *inode, struct file *filp)
{
	return 0;
}

/*
 * Follow the list
 */
struct scullv_dev *scullv_follow(struct scullv_dev *dev, int n)
{
	while (n--) {
		if (!dev->next) {
			dev->next = kmalloc(sizeof(struct scullv_dev), GFP_KERNEL);
			memset(dev->next, 0, sizeof(struct scullv_dev));
		}
		dev = dev->next;
		continue;
	}
	return dev;
}

/*
 * Data management: read and write
 */

ssize_t scullv_read (struct file *filp, char __user *buf, size_t count,
                loff_t *f_pos)
{
	struct scullv_dev *dev = filp->private_data; /* the first listitem */
	struct scullv_dev *dptr;
	int quantum = PAGE_SIZE << dev->order;
	int qset = dev->qset;
	int itemsize = quantum * qset; /* how many bytes in the listitem */
	int item, s_pos, q_pos, rest;
	ssize_t retval = 0;

	if (down_interruptible (&dev->sem))
		return -ERESTARTSYS;
	if (*f_pos > dev->size)
		goto nothing;
	if (*f_pos + count > dev->size)
		count = dev->size - *f_pos;
	/* find listitem, qset index, and offset in the quantum */
	item = ((long) *f_pos) / itemsize;
	rest = ((long) *f_pos) % itemsize;
	s_pos = rest / quantum; q_pos = rest % quantum;

    	/* follow the list up to the right position (defined elsewhere) */
	dptr = scullv_follow(dev, item);

	if (!dptr->data)
		goto nothing; /* don't fill holes */
	if (!dptr->data[s_pos])
		goto nothing;
	if (count > quantum - q_pos)
		count = quantum - q_pos; /* read only up to the end of this quantum */

	if (copy_to_user (buf, dptr->data[s_pos]+q_pos, count)) {
		retval = -EFAULT;
		goto nothing;
	}
	up (&dev->sem);

	*f_pos += count;
	return count;

  nothing:
	up (&dev->sem);
	return retval;
}

ssize_t scullv_write (struct file *filp, const char __user *buf, size_t count,
                loff_t *f_pos)
{
	struct scullv_dev *dev = filp->private_data;
	struct scullv_dev *dptr;
	int quantum = PAGE_SIZE << dev->order;
	int qset = dev->qset;
	int itemsize = quantum * qset;
	int item, s_pos, q_pos, rest;
	ssize_t retval = -ENOMEM; /* our most likely error */

	if (down_interruptible (&dev->sem))
		return -ERESTARTSYS;

	/* find listitem, qset index and offset in the quantum */
	item = ((long) *f_pos) / itemsize;
	rest = ((long) *f_pos) % itemsize;
	s_pos = rest / quantum; q_pos = rest % quantum;

	/* follow the list up to the right position */
	dptr = scullv_follow(dev, item);
	if (!dptr->data) {
		dptr->data = kmalloc(qset * sizeof(void *), GFP_KERNEL);
		if (!dptr->data)
			goto nomem;
		memset(dptr->data, 0, qset * sizeof(char *));
	}
	/* Allocate a quantum using virtual addresses */
	if (!dptr->data[s_pos]) {
		dptr->data[s_pos] = (void *)vmalloc(PAGE_SIZE << dptr->order);
		if (!dptr->data[s_pos])
			goto nomem;
		memset(dptr->data[s_pos], 0, PAGE_SIZE << dptr->order);
	}
	if (count > quantum - q_pos)
		count = quantum - q_pos; /* write only up to the end of this quantum */
	if (copy_from_user (dptr->data[s_pos]+q_pos, buf, count)) {
		retval = -EFAULT;
		goto nomem;
	}
	*f_pos += count;

    	/* update the size */
	if (dev->size < *f_pos)
		dev->size = *f_pos;
	up (&dev->sem);
	return count;

  nomem:
	up (&dev->sem);
	return retval;
}

/*
 * The ioctl() implementation
 */

int scullv_ioctl (struct inode *inode, struct file *filp,
                 unsigned int cmd, unsigned long arg)
{

	int err = 0, ret = 0, tmp;

	/* don't even decode wrong cmds: better returning  ENOTTY than EFAULT */
	if (_IOC_TYPE(cmd) != SCULLV_IOC_MAGIC) return -ENOTTY;
	if (_IOC_NR(cmd) > SCULLV_IOC_MAXNR) return -ENOTTY;

	/*
	 * the type is a bitmask, and VERIFY_WRITE catches R/W
	 * transfers. Note that the type is user-oriented, while
	 * verify_area is kernel-oriented, so the concept of "read" and
	 * "write" is reversed
	 */
	if (_IOC_DIR(cmd) & _IOC_READ)
		err = !access_ok(VERIFY_WRITE, (void __user *)arg, _IOC_SIZE(cmd));
	else if (_IOC_DIR(cmd) & _IOC_WRITE)
		err =  !access_ok(VERIFY_READ, (void __user *)arg, _IOC_SIZE(cmd));
	if (err)
		return -EFAULT;

	switch(cmd) {

	case SCULLV_IOCRESET:
		scullv_qset = SCULLV_QSET;
		scullv_order = SCULLV_ORDER;
		break;

	case SCULLV_IOCSORDER: /* Set: arg points to the value */
		ret = __get_user(scullv_order, (int __user *) arg);
		break;

	case SCULLV_IOCTORDER: /* Tell: arg is the value */
		scullv_order = arg;
		break;

	case SCULLV_IOCGORDER: /* Get: arg is pointer to result */
		ret = __put_user (scullv_order, (int __user *) arg);
		break;

	case SCULLV_IOCQORDER: /* Query: return it (it's positive) */
		return scullv_order;

	case SCULLV_IOCXORDER: /* eXchange: use arg as pointer */
		tmp = scullv_order;
		ret = __get_user(scullv_order, (int __user *) arg);
		if (ret == 0)
			ret = __put_user(tmp, (int __user *) arg);
		break;

	case SCULLV_IOCHORDER: /* sHift: like Tell + Query */
		tmp = scullv_order;
		scullv_order = arg;
		return tmp;

	case SCULLV_IOCSQSET:
		ret = __get_user(scullv_qset, (int __user *) arg);
		break;

	case SCULLV_IOCTQSET:
		scullv_qset = arg;
		break;

	case SCULLV_IOCGQSET:
		ret = __put_user(scullv_qset, (int __user *)arg);
		break;

	case SCULLV_IOCQQSET:
		return scullv_qset;

	case SCULLV_IOCXQSET:
		tmp = scullv_qset;
		ret = __get_user(scullv_qset, (int __user *)arg);
		if (ret == 0)
			ret = __put_user(tmp, (int __user *)arg);
		break;

	case SCULLV_IOCHQSET:
		tmp = scullv_qset;
		scullv_qset = arg;
		return tmp;

	default:  /* redundant, as cmd was checked against MAXNR */
		return -ENOTTY;
	}

	return ret;
}

/*
 * The "extended" operations
 */

loff_t scullv_llseek (struct file *filp, loff_t off, int whence)
{
	struct scullv_dev *dev = filp->private_data;
	long newpos;

	switch(whence) {
	case 0: /* SEEK_SET */
		newpos = off;
		break;

	case 1: /* SEEK_CUR */
		newpos = filp->f_pos + off;
		break;

	case 2: /* SEEK_END */
		newpos = dev->size + off;
		break;

	default: /* can't happen */
		return -EINVAL;
	}
	if (newpos<0) return -EINVAL;
	filp->f_pos = newpos;
	return newpos;
}

/*
 * A simple asynchronous I/O implementation.
 */

struct async_work {
	struct kiocb *iocb;
	int result;
	struct work_struct work;
};

/*
 * "Complete" an asynchronous operation.
 */
static void scullv_do_deferred_op(void *p)
{
	struct async_work *stuff = (struct async_work *) p;
	aio_complete(stuff->iocb, stuff->result, 0);
	kfree(stuff);
}

static int scullv_defer_op(int write, struct kiocb *iocb, char __user *buf,
		size_t count, loff_t pos)
{
	struct async_work *stuff;
	int result;

	/* Copy now while we can access the buffer */
	if (write)
		result = scullv_write(iocb->ki_filp, buf, count, &pos);
	else
		result = scullv_read(iocb->ki_filp, buf, count, &pos);

	/* If this is a synchronous IOCB, we return our status now. */
	if (is_sync_kiocb(iocb))
		return result;

	/* Otherwise defer the completion for a few milliseconds. */
	stuff = kmalloc (sizeof (*stuff), GFP_KERNEL);
	if (stuff == NULL)
		return result; /* No memory, just complete now */
	stuff->iocb = iocb;
	stuff->result = result;
	INIT_WORK(&stuff->work, scullv_do_deferred_op, stuff);
	schedule_delayed_work(&stuff->work, HZ/100);
	return -EIOCBQUEUED;
}

static ssize_t scullv_aio_read(struct kiocb *iocb, char __user *buf, size_t count,
		loff_t pos)
{
	return scullv_defer_op(0, iocb, buf, count, pos);
}

static ssize_t scullv_aio_write(struct kiocb *iocb, const char __user *buf,
		size_t count, loff_t pos)
{
	return scullv_defer_op(1, iocb, (char __user *) buf, count, pos);
}

/*
 * Mmap *is* available, but confined in a different file
 */
extern int scullv_mmap(struct file *filp, struct vm_area_struct *vma);

/*
 * The fops
 */

struct file_operations scullv_fops = {
	.owner =     THIS_MODULE,
	.llseek =    scullv_llseek,
	.read =	     scullv_read,
	.write =     scullv_write,
	.ioctl =     scullv_ioctl,
	.mmap =	     scullv_mmap,
	.open =	     scullv_open,
	.release =   scullv_release,
	.aio_read =  scullv_aio_read,
	.aio_write = scullv_aio_write,
};

int scullv_trim(struct scullv_dev *dev)
{
	struct scullv_dev *next, *dptr;
	int qset = dev->qset;   /* "dev" is not-null */
	int i;

	if (dev->vmas) /* don't trim: there are active mappings */
		return -EBUSY;

	for (dptr = dev; dptr; dptr = next) { /* all the list items */
		if (dptr->data) {
			/* Release the quantum-set */
			for (i = 0; i < qset; i++)
				if (dptr->data[i])
					vfree(dptr->data[i]);

			kfree(dptr->data);
			dptr->data=NULL;
		}
		next=dptr->next;
		if (dptr != dev) kfree(dptr); /* all of them but the first */
	}
	dev->size = 0;
	dev->qset = scullv_qset;
	dev->order = scullv_order;
	dev->next = NULL;
	return 0;
}

static void scullv_setup_cdev(struct scullv_dev *dev, int index)
{
	int err, devno = MKDEV(scullv_major, index);

	cdev_init(&dev->cdev, &scullv_fops);
	dev->cdev.owner = THIS_MODULE;
	dev->cdev.ops = &scullv_fops;
	err = cdev_add (&dev->cdev, devno, 1);
	/* Fail gracefully if need be */
	if (err)
		printk(KERN_NOTICE "Error %d adding scull%d", err, index);
}

/*
 * Finally, the module stuff
 */

int scullv_init(void)
{
	int result, i;
	dev_t dev = MKDEV(scullv_major, 0);

	/*
	 * Register your major, and accept a dynamic number.
	 */
	if (scullv_major)
		result = register_chrdev_region(dev, scullv_devs, "scullv");
	else {
		result = alloc_chrdev_region(&dev, 0, scullv_devs, "scullv");
		scullv_major = MAJOR(dev);
	}
	if (result < 0)
		return result;

	/*
	 * allocate the devices -- we can't have them static, as the number
	 * can be specified at load time
	 */
	scullv_devices = kmalloc(scullv_devs*sizeof (struct scullv_dev), GFP_KERNEL);
	if (!scullv_devices) {
		result = -ENOMEM;
		goto fail_malloc;
	}
	memset(scullv_devices, 0, scullv_devs*sizeof (struct scullv_dev));
	for (i = 0; i < scullv_devs; i++) {
		scullv_devices[i].order = scullv_order;
		scullv_devices[i].qset = scullv_qset;
		sema_init (&scullv_devices[i].sem, 1);
		scullv_setup_cdev(scullv_devices + i, i);
	}

#ifdef SCULLV_USE_PROC /* only when available */
	create_proc_read_entry("scullvmem", 0, NULL, scullv_read_procmem, NULL);
#endif
	return 0; /* succeed */

  fail_malloc:
	unregister_chrdev_region(dev, scullv_devs);
	return result;
}

void scullv_cleanup(void)
{
	int i;

#ifdef SCULLV_USE_PROC
	remove_proc_entry("scullvmem", NULL);
#endif

	for (i = 0; i < scullv_devs; i++) {
		cdev_del(&scullv_devices[i].cdev);
		scullv_trim(scullv_devices + i);
	}
	kfree(scullv_devices);
	unregister_chrdev_region(MKDEV (scullv_major, 0), scullv_devs);
}

module_init(scullv_init);
module_exit(scullv_cleanup);


text:
package org.football.controller;

import static org.football.controller.ControllerAttributeConstants.COMPETITIONS_ATTR;
import static org.football.controller.ControllerUrlConstants.HOME_URL;
import static org.football.controller.ControllerViewConstants.HomePage;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.football.persistance.competition.Competition;
import org.football.persistance.fixture.Fixture;
import org.football.repository.CompetitionRepository;
import org.football.repository.FixtureRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
@RequestMapping(HOME_URL)
public class HomeController extends AbstractController {

	@Autowired
	private CompetitionRepository competitionRepository;
	@Autowired
	private FixtureRepository fixtureRepository;

	@GetMapping
	public String getHomePage(final Model model) {

		final Map<Competition, List<Fixture>> competitionCurrentFixtures = new HashMap<>();

		competitionRepository.findAll()
				.forEach(competition -> competitionCurrentFixtures.put(competition,
						fixtureRepository.findByCompetitionIdAndMatchdayOrderByDate(competition.getId(), competition.getCurrentMatchday())));

		model.addAttribute(COMPETITIONS_ATTR, competitionCurrentFixtures);

		return HomePage;
	}
}

redpajama_set_name: RedPajamaGithub


text:
salt.states.boto_vpc
====================

.. automodule:: salt.states.boto_vpc
    :members:


text:
package com.google.leafcoin.protocols.channels;

/**
 * Used to indicate that a channel was closed before it was expected to be closed.
 * This could mean the connection timed out, the other send sent an error or a CLOSE message, etc
 */
public class PaymentChannelCloseException extends Exception {
    public enum CloseReason {
        /** We could not find a version which was mutually acceptable with the client/server */
        NO_ACCEPTABLE_VERSION,
        /** Generated by a client when the server attempted to lock in our funds for an unacceptably long time */
        TIME_WINDOW_TOO_LARGE,
        /** Generated by a client when the server requested we lock up an unacceptably high value */
        SERVER_REQUESTED_TOO_MUCH_VALUE,
        /** Generated by the server when the client has used up all the value in the channel. */
        CHANNEL_EXHAUSTED,

        // Values after here indicate its probably possible to try reopening channel again

        /**
         *
The {@link com.google.leafcoin.protocols.channels.PaymentChannelClient#settle()} method was called or the
         * client sent a CLOSE message.

         *
As long as the server received the CLOSE message, this means that the channel is settling and the payment
         * transaction (if any) will be broadcast. If the client attempts to open a new connection, a new channel will
         * have to be opened.

         */
        CLIENT_REQUESTED_CLOSE,

        /**
         *
The {@link com.google.leafcoin.protocols.channels.PaymentChannelServer#close()} method was called or server
         * sent a CLOSE message.

         *
         *
This may occur if the server opts to close the connection for some reason, or automatically if the channel
         * times out (called by {@link StoredPaymentChannelServerStates}).

         *
         *
For a client, this usually indicates that we should try again if we need to continue paying (either
         * opening a new channel or continuing with the same one depending on the server's preference)

         */
        SERVER_REQUESTED_CLOSE,

        /** Remote side sent an ERROR message */
        REMOTE_SENT_ERROR,
        /** Remote side sent a message we did not understand */
        REMOTE_SENT_INVALID_MESSAGE,

        /** The connection was closed without an ERROR/CLOSE message */
        CONNECTION_CLOSED,
    }

    private final CloseReason error;

    public PaymentChannelCloseException(String message, CloseReason error) {
        super(message);
        this.error = error;
    }

    public CloseReason getCloseReason() {
        return error;
    }

    public String toString() {
        return "PaymentChannelCloseException for reason " + getCloseReason().toString();
    }
}


text:
module RuboCop
  module Cop
    module RSpec
      # Checks that `context` docstring starts with an allowed prefix.
      #
      # The default list of prefixes is minimal. Users are encouraged to tailor
      # the configuration to meet project needs. Other acceptable prefixes may
      # include `if`, `unless`, `for`, `before`, `after`, or `during`.
      # They may consist of multiple words if desired.
      #
      # @see https://rspec.rubystyle.guide/#context-descriptions
      # @see http://www.betterspecs.org/#contexts
      #
      # @example `Prefixes` configuration
      #   # .rubocop.yml
      #   # RSpec/ContextWording:
      #   #   Prefixes:
      #   #     - when
      #   #     - with
      #   #     - without
      #   #     - if
      #   #     - unless
      #   #     - for
      #
      # @example
      #   # bad
      #   context 'the display name not present' do
      #     # ...
      #   end
      #
      #   # good
      #   context 'when the display name is not present' do
      #     # ...
      #   end
      #
      # This cop can be customized allowed context description pattern
      # with `AllowedPatterns`. By default, there are no checking by pattern.
      #
      # @example `AllowedPatterns` configuration
      #
      #   # .rubocop.yml
      #   # RSpec/ContextWording:
      #   #   AllowedPatterns:
      #   #     - /とき$/
      #
      # @example
      #   # bad
      #   context '条件を満たす' do
      #     # ...
      #   end
      #
      #   # good
      #   context '条件を満たすとき' do
      #     # ...
      #   end
      #
      class ContextWording < Base
        include AllowedPattern

        MSG = 'Context description should match %<patterns>s.'

        # @!method context_wording(node)
        def_node_matcher :context_wording, <<-PATTERN
          (block (send #rspec? { :context :shared_context } $(str $_) ...) ...)
        PATTERN

        def on_block(node) # rubocop:disable InternalAffairs/NumblockHandler
          context_wording(node) do |context, description|
            if bad_pattern?(description)
              message = format(MSG, patterns: expect_patterns)
              add_offense(context, message: message)
            end
          end
        end

        private

        def allowed_patterns
          super + prefix_regexes
        end

        def prefix_regexes
          @prefix_regexes ||= prefixes.map { |pre| /^#{Regexp.escape(pre)}\b/ }
        end

        def bad_pattern?(description)
          return false if allowed_patterns.empty?

          !matches_allowed_pattern?(description)
        end

        def expect_patterns
          inspected = allowed_patterns.map(&:inspect)
          return inspected.first if inspected.size == 1

          inspected << "or #{inspected.pop}"
          inspected.join(', ')
        end

        def prefixes
          Array(cop_config.fetch('Prefixes', []))
        end
      end
    end
  end
end


text:
Public Class adiciona_socio_form
    Dim dataBaseConn As database_manager = New database_manager
    Dim gf As globalFunctions = New globalFunctions
    Dim partner_id As Integer = 0
    Dim partner_parent As partner
    Dim isParent As Boolean = False
    Dim savedImage As Boolean = False
    Dim main As Windows.Forms.Form
    Dim saveImage As Boolean = False
    Dim filepath As String = ""
    Dim fileExtension As String = ""
    Dim imageId As Integer = 0

    Sub New(partnerId As Integer, mf As Windows.Forms.Form)

        ' This call is required by the designer.
        InitializeComponent()
        partner_parent = dataBaseConn.hasParent(partnerId)
        isParent = True
        partner_id = partnerId
        If partner_parent IsNot Nothing Then
            'lets fill the form
            Me.partnerIdTxt.Text = partner_parent.partnerNumber.ToString
            Me.partnerNameTxt.Text = partner_parent.partnerName
            Me.partnerBirthDateDfl.Value = partner_parent.partnerBirthDate
            Me.partnerGenderCbx.SelectedIndex = CInt(partner_parent.partnerGender)
            Me.partnerCCTxt.Text = partner_parent.partnerCC
            Me.partnerAddressTxt.Text = partner_parent.partnerAddress
            Me.partnerPostalTxt.Text = partner_parent.partnerPostal
            Me.partnerCityTxt.Text = partner_parent.partnerCity
            Me.partnerPhoneTxt.Text = partner_parent.partnerPhone.ToString
            Me.partnerMobileTxt.Text = partner_parent.partnerMobile.ToString
            Me.partnerEmailTxt.Text = partner_parent.partnerEmail
            Me.partnerObsTxt.Text = partner_parent.partnerObs
            Me.partnerNifTxt.Text = partner_parent.partnerNif
            Me.partnerImageBox.Image = dataBaseConn.getImage(partner_parent.partnerImageId)
        End If
        ' Add any initialization after the InitializeComponent() call.
        main = mf
        main.Hide()

    End Sub

    Sub New(mf As main_form)

        ' This call is required by the designer.
        InitializeComponent()
        main = mf
        main.Hide()
        ' Add any initialization after the InitializeComponent() call.

    End Sub

    Private Sub partnerImageBox_Click(sender As Object, e As EventArgs) Handles partnerImageBox.Click
        'Set the filter
        openImageDialog.Filter = "Ficheiros de Imagem |*.jpg;*.png;*.bmp;*.gif"
        'Set default directory
        openImageDialog.InitialDirectory = "C:\"
        'Clear the file name
        openImageDialog.FileName = ""

        'Show it
        If openImageDialog.ShowDialog(Me) = Windows.Forms.DialogResult.OK Then
            'get the image name
            filepath = openImageDialog.FileName
            fileExtension = System.IO.Path.GetExtension(filepath)
            'Create a new Bitmap and display it
            partnerImageBox.Image = System.Drawing.Bitmap.FromFile(filepath)
            saveImage = True
        End If
    End Sub

    Private Sub partnerQuitBtn_Click(sender As Object, e As EventArgs) Handles partnerQuitBtn.Click
        main.Show()
        Me.Close()
    End Sub

    Private Sub partnerSaveBtn_Click(sender As Object, e As EventArgs) Handles partnerSaveBtn.Click
        Dim partner As New partner
        If isParent And partnerIdTxt.Text = "" Then
            dataBaseConn.removeParentFromPartner(partner_id)
        Else
            If (partnerIdTxt.Text = "") Then
                partner.partnerNumber = 0
            Else
                partner.partnerNumber = Integer.Parse(partnerIdTxt.Text)
            End If
            If filepath <> "" Then
                imageId = dataBaseConn.saveImage(filepath, fileExtension)
            End If
            If savedImage Then
                partner.partnerImageId = imageId
            End If
            If isParent Then
                partner.partnerImageId = imageId
            End If
            If (partnerIdTxt.Text = "") Then
                MsgBox("Não pode adicionar um sócio sem número")
                Exit Sub
            End If
            partner.partnerIsCompetition = isCompetitionChk.Checked
            partner.partnerState = addSocioActiveChk.Checked
            partner.partnerName = partnerNameTxt.Text
            partner.partnerBirthDate = partnerBirthDateDfl.Value
            partner.partnerGender = partnerGenderCbx.SelectedIndex.ToString
            partner.partnerCC = partnerCCTxt.Text
            partner.partnerAddress = partnerAddressTxt.Text
            partner.partnerPostal = partnerPostalTxt.Text
            partner.partnerCity = partnerCityTxt.Text
            partner.partnerPhone = partnerPhoneTxt.Text
            partner.partnerMobile = partnerMobileTxt.Text
            If Not gf.validateEmail(partnerEmailTxt.Text) Then
                MsgBox("O Email inserido não é valido.")
                Exit Sub
            End If
            partner.partnerEmail = partnerEmailTxt.Text
            partner.partnerObs = partnerObsTxt.Text
            partner.partnerNif = partnerNifTxt.Text
            If isParent Then
                dataBaseConn.addParentToPartner(partner_id, Integer.Parse(partnerIdTxt.Text))
                partner.partnerParent = 0
            Else
                partner.partnerParent = 0
            End If
            partner.partnerCard = gf.preparaNumeroCartao(partner.partnerNumber.ToString)
            If partner.partnerNumber = 0 Then
                MsgBox("O número de sócio não é valido.")
            ElseIf dataBaseConn.getPartner(partner.partnerNumber) Is Nothing Or isParent Then
                If isParent Then
                    partner.update()
                    MsgBox("Sócio atualizado com sucesso.")
                Else
                    partner.save()
                    MsgBox("Sócio criado com sucesso.")
                End If
                If partner_id > 0 Then
                    Me.Dispose()
                    main.Show()
                Else
                    resetForm()
                End If
            Else
                MsgBox("Sócio com este número ja existe.")
            End If
        End If

    End Sub

    Private Sub resetForm()
        partnerIdTxt.Clear()
        partnerIdTxt.Enabled = True
        addSocioActiveChk.Checked = False
        isCompetitionChk.Checked = False
        partnerNameTxt.Clear()
        partnerBirthDateDfl.ResetText()
        partnerGenderCbx.ResetText()
        partnerCCTxt.Clear()
        partnerAddressTxt.Clear()
        partnerPostalTxt.Clear()
        partnerCityTxt.Clear()
        partnerPhoneTxt.Clear()
        partnerMobileTxt.Clear()
        partnerEmailTxt.Clear()
        partnerImageBox.Image = Nothing
        partnerObsTxt.Clear()
        partnerNifTxt.Clear()
    End Sub

    Private Sub partnerClearBtn_Click(sender As Object, e As EventArgs) Handles partnerClearBtn.Click
        resetForm()
    End Sub

    Private Sub partnerGetIdBtn_Click(sender As Object, e As EventArgs) Handles partnerGetIdBtn.Click
        Dim lastPartnerId As Integer = dataBaseConn.getPartnerLastId
        If lastPartnerId = 0 Or lastPartnerId = -1 Then
            partnerIdTxt.Text = 1.ToString
        ElseIf lastPartnerId > 0 Then
            partnerIdTxt.Text = (lastPartnerId + 1).ToString
        End If
        partnerIdTxt.Enabled = False
    End Sub

    Private Sub partnerIdTxt_KeyPress(sender As Object, e As KeyPressEventArgs) Handles partnerIdTxt.KeyPress
        gf.strictNumbers(e)
    End Sub

    Private Sub partnerPhoneTxt_KeyPress(sender As Object, e As KeyPressEventArgs) Handles partnerPhoneTxt.KeyPress
        gf.strictNumbers(e)
    End Sub

    Private Sub partnerMobileTxt_KeyPress(sender As Object, e As KeyPressEventArgs) Handles partnerMobileTxt.KeyPress
        gf.strictNumbers(e)
    End Sub

    Private Sub partnerNifTxt_KeyPress(sender As Object, e As KeyPressEventArgs) Handles partnerNifTxt.KeyPress
        gf.strictNumbers(e)
    End Sub

    Private Sub partnerIdTxt_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles partnerIdTxt.LostFocus
        If isParent Then
            If partnerIdTxt.Text = "" Then
                If partnerNameTxt.Text.Length > 0 Then
                    MsgBox("Para aplicar as alterações é necessário guardar !")
                End If
                resetForm()
            Else
                If dataBaseConn.existsPartner(CInt(partnerIdTxt.Text)) Then
                    loadPartnerParent(CInt(partnerIdTxt.Text))
                Else
                    MsgBox("O sócio com esse número não existe. Tente outra vez por favor.")
                    resetForm()
                End If
            End If
        End If
    End Sub

    Private Sub loadPartnerParent(partnerId As Integer)
        Dim partner As partner
        partner = dataBaseConn.getPartner(partnerId)
        partner_parent = partner
        If partner IsNot Nothing Then
            Me.partnerIdTxt.Text = partner.partnerNumber.ToString
            Me.partnerNameTxt.Text = partner.partnerName
            Me.partnerBirthDateDfl.Value = partner.partnerBirthDate
            Me.partnerGenderCbx.SelectedIndex = CInt(partner.partnerGender)
            Me.partnerCCTxt.Text = partner.partnerCC
            Me.partnerAddressTxt.Text = partner.partnerAddress
            Me.partnerPostalTxt.Text = partner.partnerPostal
            Me.partnerCityTxt.Text = partner.partnerCity
            Me.partnerPhoneTxt.Text = partner.partnerPhone.ToString
            Me.partnerMobileTxt.Text = partner.partnerMobile.ToString
            Me.partnerEmailTxt.Text = partner.partnerEmail
            Me.partnerObsTxt.Text = partner.partnerObs
            Me.partnerNifTxt.Text = partner.partnerNif
            Me.partnerImageBox.Image = dataBaseConn.getImage(partner.partnerImageId)
            Me.addSocioActiveChk.Checked = partner.partnerState
            Me.isCompetitionChk.Checked = partner.partnerIsCompetition
        End If
    End Sub

    Private Sub adiciona_socio_form_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        partnerImageBox.Image = New Bitmap(My.Resources.blankAvatart)
    End Sub
End Class


text:
'use strict';

const alphabet = 'abcdefghijklmnopqrstuvwxyz'.split('');
const ALPHABET = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'.split('');

function batchgetall_test(storeName, func, name) {
  indexeddb_test((t, connection, tx) => {
    var store;
    var index;
    switch (storeName) {
      case 'generated':
        store = connection.createObjectStore(
            'generated', {autoIncrement: true, keyPath: 'id'});
        index = store.createIndex('test_idx', 'upper');
        alphabet.forEach(letter => {
          store.put({ch: letter, upper: letter.toUpperCase()});
        });
        break;
      case 'out-of-line':
        store = connection.createObjectStore('out-of-line', null);
        index = store.createIndex('test_idx', 'upper');
        alphabet.forEach(letter => {
          store.put({ch: letter, upper: letter.toUpperCase()}, letter);
        });
        break;
      case 'out-of-line-not-unique':
        store = connection.createObjectStore('out-of-line-not-unique', null);
        index = store.createIndex('test_idx', 'half');
        alphabet.forEach(letter => {
          if (letter <= 'd')
            store.put({ch: letter, half: 'first'}, letter);
          else if (letter < 'x')
            store.put({ch: letter, half: 'second'}, letter);
          else
            store.put({ch: letter, half: 'third'}, letter);
        });
        break;
      case 'out-of-line-multi':
        store = connection.createObjectStore('out-of-line-multi', null);
        index = store.createIndex('test_idx', 'attribs', {multiEntry: true});
        alphabet.forEach(function(letter) {
          let attrs = [];
          if (['a', 'e', 'i', 'o', 'u'].indexOf(letter) != -1)
            attrs.push('vowel');
          else
            attrs.push('consonant');
          if (letter == 'a')
            attrs.push('first');
          if (letter == 'z')
            attrs.push('last');
          store.put({ch: letter, attribs: attrs}, letter);
        });
        break;
      case 'empty':
        store = connection.createObjectStore('empty', null);
        store.createIndex('test_idx', 'upper');
        break;
      default:
        t.fail(`Unsupported storeName: ${storeName}`);
    }
  }, func, name);
}

function createBatchGetAllRequest(t, storeName, connection, ranges, maxCount) {
  const transaction = connection.transaction(storeName, 'readonly');
  const store = transaction.objectStore(storeName);
  const index = store.index('test_idx');
  const req = index.batchGetAll(ranges, maxCount);
  req.onerror = t.unreached_func('batchGetsAll request should succeed');
  return req;
}

function assertTwoDArrayEquals(result, expected) {
  assert_equals(JSON.stringify(result), JSON.stringify(expected));
}

batchgetall_test('out-of-line', (t, connection) => {
  const req = createBatchGetAllRequest(t, 'out-of-line', connection, ['C']);
  req.onsuccess = t.step_func(evt => {
    let expected = [[{'ch': 'c', 'upper': 'C'}]];
    let result = evt.target.result;
    assert_class_string(result, 'Array', 'result should be an array');
    assertTwoDArrayEquals(result, expected);
    t.done();
  });
}, 'Single getAll');

batchgetall_test('out-of-line', (t, connection) => {
  const req =
      createBatchGetAllRequest(t, 'out-of-line', connection, ['C', 'D', 'E']);
  req.onsuccess = t.step_func(evt => {
    let result = evt.target.result;
    let expected = [
      [{'ch': 'c', 'upper': 'C'}], [{'ch': 'd', 'upper': 'D'}],
      [{'ch': 'e', 'upper': 'E'}]
    ];
    assert_class_string(result, 'Array', 'result should be an array');
    assertTwoDArrayEquals(result, expected);
    t.done();
  });
}, 'Multiple getAll');

batchgetall_test('out-of-line', (t, connection) => {
  var req = createBatchGetAllRequest(
      t, 'out-of-line', connection, [IDBKeyRange.bound('C', 'E')]);
  req.onsuccess = t.step_func(function(evt) {
    let result = evt.target.result;
    let expected = [[
      {'ch': 'c', 'upper': 'C'}, {'ch': 'd', 'upper': 'D'},
      {'ch': 'e', 'upper': 'E'}
    ]];
    assertTwoDArrayEquals(result, expected);
    t.done();
  });
}, 'Get bound range');

batchgetall_test('out-of-line', (t, connection) => {
  var req = createBatchGetAllRequest(
      t, 'out-of-line', connection,
      [IDBKeyRange.bound('C', 'M'), IDBKeyRange.bound('O', 'Z')], 3);
  req.onsuccess = t.step_func(function(evt) {
    let result = evt.target.result;
    let expected = [
      [
        {'ch': 'c', 'upper': 'C'}, {'ch': 'd', 'upper': 'D'},
        {'ch': 'e', 'upper': 'E'}
      ],
      [
        {'ch': 'o', 'upper': 'O'}, {'ch': 'p', 'upper': 'P'},
        {'ch': 'q', 'upper': 'Q'}
      ]
    ];
    assertTwoDArrayEquals(result, expected);
    t.done();
  });
}, 'Get bound range with maxCount');

batchgetall_test('out-of-line', (t, connection) => {
  var req = createBatchGetAllRequest(
      t, 'out-of-line', connection, ['Doesn\'t exist1', 'Doesn\'t exist2']);
  req.onsuccess = t.step_func(function(evt) {
    let result = evt.target.result;
    let expected = [[], []];
    assertTwoDArrayEquals(result, expected);
    t.done();
  });
}, 'Non existent key');

batchgetall_test('out-of-line-not-unique', (t, connection) => {
  var req = createBatchGetAllRequest(
      t, 'out-of-line-not-unique', connection, ['first', 'third']);
  req.onsuccess = t.step_func(function(evt) {
    let result = evt.target.result;
    let expected = [
      [
        {'ch': 'a', 'half': 'first'}, {'ch': 'b', 'half': 'first'},
        {'ch': 'c', 'half': 'first'}, {'ch': 'd', 'half': 'first'}
      ],
      [
        {'ch': 'x', 'half': 'third'}, {'ch': 'y', 'half': 'third'},
        {'ch': 'z', 'half': 'third'}
      ]
    ];
    assertTwoDArrayEquals(result, expected);
    t.done();
  });
}, 'Retrieve multiEntry key');

batchgetall_test('out-of-line-multi', (t, connection) => {
  var req =
      createBatchGetAllRequest(t, 'out-of-line-multi', connection, ['vowel']);
  req.onsuccess = t.step_func(function(evt) {
    let result = evt.target.result;
    let expected = [[
      {'ch': 'a', 'attribs': ['vowel', 'first']},
      {'ch': 'e', 'attribs': ['vowel']}, {'ch': 'i', 'attribs': ['vowel']},
      {'ch': 'o', 'attribs': ['vowel']}, {'ch': 'u', 'attribs': ['vowel']}
    ]];
    assertTwoDArrayEquals(result, expected);
    t.done();
  });
}, 'Retrieve one key multiple values');


text:
OWIN SCIM 1.1 & 2.0 implementation for .NET >= 4.5.1
[![Build status](https://ci.appveyor.com/api/projects/status/qgblu9mx4f53tvee/branch/master?svg=true)](https://ci.appveyor.com/project/powerdms/owin-scim/branch/master) [![NuGet Pre Release](https://img.shields.io/nuget/vpre/Owin.Scim.svg?maxAge=1800)](https://www.nuget.org/packages/Owin.Scim/)

RFC 7643
RFC 7644

Looking for solid contributers to expedite this effort!
email me:  daniel.gioulakis [at] powerdms [dot] com

If you have been evaluating the alpha builds from nuget, we would love to hear feedback from you. Please reach out and share how your experience has been working with Owin.Scim. Any issues and feature requests are welcome. Help us shape Owin.Scim into the best fully-featured and compliant open-source SCIM server!

Latest News!
============
We're excited to announce that Owin.Scim is now actively deployed to Azure AppServices as part of our way to showcase the capabilities of Owin.Scim. You can access all live SCIM endpoints at: http://owin-scim.azurewebsites.net/scim/ (e.g. `http://owin-scim.azurewebsites.net/scim/<version>/<endpoint>`)

#### Live Endpoints for Interoperability Testing
*NOTE:* The current live implementation is being hosted inside IIS which unfortunately blocks `:` in URL paths if they exist before the `?` query-string delimiter. Therefore, live endpoints for `/schemas/{schemaId}` and `/resourcetypes/{resourceTypeId}` are not accessible, however, they do work. We'll look to host our sample differently in the future.

##### SCIM v2
- http://owin-scim.azurewebsites.net/scim/v2/serviceproviderconfig
- http://owin-scim.azurewebsites.net/scim/v2/schemas
- http://owin-scim.azurewebsites.net/scim/v2/resourcetypes
- http://owin-scim.azurewebsites.net/scim/v2/users
- http://owin-scim.azurewebsites.net/scim/v2/groups

##### SCIM v1
- http://owin-scim.azurewebsites.net/scim/v1/serviceproviderconfigs
- http://owin-scim.azurewebsites.net/scim/v1/schemas
- http://owin-scim.azurewebsites.net/scim/v1/users
- http://owin-scim.azurewebsites.net/scim/v1/groups

PROJECT STATUS
==============
This project is in active development with the goal of completing basic protocol implementation by mid-2016.

Roadmap
-------
The list below doesn't necessarily denote priority or order.

- [ ] Finish users endpoints
  - [x] Create
  - [x] Retrieve
  - [x] Replace
  - [ ] Update (Patch) (in progress - cleanup code)
    - [x] Add
    - [x] Replace
    - [x] Remove
  - [x] Delete
  - [x] Query
- [x] Schema extensions
- [x] Add SCIM server configuration endpoints
  - [x] /ServiceProviderConfig
  - [x] /Schemas
  - [x] /ResourceTypes
- [x] Add support for mutability rule-processing.
- [ ] Add support for bulk processing
- [ ] Add groups endpoints
  - [x] Create
  - [x] Retrieve
  - [x] Replace
  - [ ] Update (Patch)  (in progress - cleanup code)
    - [x] Add
    - [x] Replace
    - [x] Remove
  - [x] Delete
  - [x] Query
- [ ] Add support for querying
  - [x] Filtering
  - [ ] Sorting (in design)
  - [ ] Ordering (in design)
  - [ ] Pagination (in design)
  - [ ] Projection (in progress - currently only works with top-level attributes / non-urn qualified references)
- [x] SCIM Extensiblity
  - [x] Canonicalization
  - [x] Validation
  - [x] Attribute Behavior (mutability, caseExact, returned, uniqueness, etc)
  - [x] Custom resource types and endpoints
- [x] Add endpoint authorization support
- [ ] Add endpoint for supporting query-on-root
- [x] Add support for SCIM v1.1
- [ ] Add logging functionality
- [ ] Outbound Provisioning (SCIM Event Notification)
  - [ ] Event Triggers / Handlers
  - [ ] Client Subscription Management

Getting Started
===============
Please see the WIKI for all documentation. It is being continually updated as the project develops into a stable SCIM implementation.


text:
package com.swfarm.biz.magento.bo.magentoapi;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;

/**
 *

 * Java class for anonymous complex type.
 *
 *

 * The following schema fragment specifies the expected content contained within
 * this class.
 *
 *

 * <complexType>
 *   <complexContent>
 *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 *       <sequence>
 *         <element name="sessionId" type="{http://www.w3.org/2001/XMLSchema}string"/>
 *         <element name="addressId" type="{http://www.w3.org/2001/XMLSchema}int"/>
 *         <element name="addressData" type="{urn:Magento}customerAddressEntityCreate"/>
 *       </sequence>
 *     </restriction>
 *   </complexContent>
 * </complexType>
 *

 *
 *
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = { "sessionId", "addressId", "addressData" })
@XmlRootElement(name = "customerAddressUpdateRequestParam")
public class CustomerAddressUpdateRequestParam {

	@XmlElement(required = true)
	protected String sessionId;
	protected int addressId;
	@XmlElement(required = true)
	protected CustomerAddressEntityCreate addressData;

	/**
	 * Gets the value of the sessionId property.
	 *
	 * @return possible object is {@link String }
	 *
	 */
	public String getSessionId() {
		return sessionId;
	}

	/**
	 * Sets the value of the sessionId property.
	 *
	 * @param value
	 *            allowed object is {@link String }
	 *
	 */
	public void setSessionId(String value) {
		this.sessionId = value;
	}

	/**
	 * Gets the value of the addressId property.
	 *
	 */
	public int getAddressId() {
		return addressId;
	}

	/**
	 * Sets the value of the addressId property.
	 *
	 */
	public void setAddressId(int value) {
		this.addressId = value;
	}

	/**
	 * Gets the value of the addressData property.
	 *
	 * @return possible object is {@link CustomerAddressEntityCreate }
	 *
	 */
	public CustomerAddressEntityCreate getAddressData() {
		return addressData;
	}

	/**
	 * Sets the value of the addressData property.
	 *
	 * @param value
	 *            allowed object is {@link CustomerAddressEntityCreate }
	 *
	 */
	public void setAddressData(CustomerAddressEntityCreate value) {
		this.addressData = value;
	}

}


text:
(function() {

  var proto = {

      /**
       * A simple string label for the tooltip to display. To display a rich
       * HTML tooltip instead, omit `label` and include the `tip` attribute
       * on a child node of `core-tooltip`.
       *
       * @attribute label
       * @type string
       * @default null
       */
      label: null,

      computed: {
        // Indicates whether the tooltip has a set label propety or
        // an element with the `tip` attribute.
        hasTooltipContent: 'label || !!tipElement'
      },

      publish: {
        /**
         * Forces the tooltip to display. If `disabled` is set, this property is ignored.
         *
         * @attribute show
         * @type boolean
         * @default false
         */
        show: {value: false, reflect: true},

        /**
         * Positions the tooltip to the top, right, bottom, left of its content.
         *
         * @attribute position
         * @type string
         * @default 'bottom'
         */
        position: {value: 'bottom', reflect: true},

        /**
         * If true, the tooltip an arrow pointing towards the content.
         *
         * @attribute noarrow
         * @type boolean
         * @default false
         */
        noarrow: {value: false, reflect: true}
      },

      /**
       * Customizes the attribute used to specify which content
       * is the rich HTML tooltip.
       *
       * @attribute tipAttribute
       * @type string
       * @default 'tip'
       */
      tipAttribute: 'tip',

      attached: function() {
        this.updatedChildren();
      },

      updatedChildren: function () {
        this.tipElement = null;

        for (var i = 0, el; el = this.$.c.getDistributedNodes()[i]; ++i) {
          if (el.hasAttribute && el.hasAttribute('tip')) {
            this.tipElement = el;
            break;
          }
        }

        // Job ensures we're not double calling setPosition() on DOM attach.
        this.job('positionJob', this.setPosition);

        // Monitor children to re-position tooltip when light dom changes.
        this.onMutation(this, this.updatedChildren);
      },

      labelChanged: function(oldVal, newVal) {
        this.job('positionJob', this.setPosition);
      },

      positionChanged: function(oldVal, newVal) {
        this.job('positionJob', this.setPosition);
      },

      setPosition: function() {
        var controlWidth = this.clientWidth;
        var controlHeight = this.clientHeight;
        var toolTipWidth = this.$.tooltip.clientWidth;
        var toolTipHeight = this.$.tooltip.clientHeight;

        switch (this.position) {
          case 'top':
          case 'bottom':
            this.$.tooltip.style.left = (controlWidth - toolTipWidth) / 2 + 'px';
            this.$.tooltip.style.top = null;
            break;
          case 'left':
          case 'right':
            this.$.tooltip.style.left = null;
            this.$.tooltip.style.top = (controlHeight - toolTipHeight) / 2 + 'px';
            break;
        }
      }

    };

    Polymer.mixin2(proto, Polymer.CoreFocusable);
    Polymer(proto);
  })();


text:
package org.powlab.jeye.tests.boxing;

public class BoxingTest16a3 {
    private void test(Object reference0) {
//        System.out.println("Object");
    }

    private void test(Integer reference0) {
//        System.out.println("Integer");
    }

    private void test(Number reference0) {
//        System.out.println("Integer");
    }

    private void test(int int0) {
//        System.out.println("int");
    }

    private void t(int int0) {
        Integer reference1 = int0;
        test(reference1);
        test((Object)reference1);
        test((Number)reference1);
    }

}


text:
<?php

namespace mageekguy\atoum\report\fields\runner\coverage;

require_once __DIR__ . '/../../../../../constants.php';

use
	mageekguy\atoum,
	mageekguy\atoum\locale,
	mageekguy\atoum\report,
	mageekguy\atoum\template,
	mageekguy\atoum\exceptions,
	mageekguy\atoum\cli\prompt,
	mageekguy\atoum\cli\colorizer
;

class html extends report\fields\runner\coverage\cli
{
	const htmlExtensionFile = '.html';

	protected $urlPrompt = null;
	protected $urlColorizer = null;
	protected $adapter = null;
	protected $rootUrl = '';
	protected $projectName = '';
	protected $srcDirectories = array();
	protected $templatesDirectory = null;
	protected $destinationDirectory = null;
	protected $templateParser = null;
	protected $reflectionClassInjector = null;

	public function __construct($projectName, $destinationDirectory)
	{
		parent::__construct();

		$this
			->setProjectName($projectName)
			->setDestinationDirectory($destinationDirectory)
			->setAdapter()
			->setUrlPrompt()
			->setUrlColorizer()
			->setTemplatesDirectory()
			->setTemplateParser()
			->setRootUrl('/')
		;
	}

	public function __toString()
	{
		$string = parent::__toString();

		if ($this->adapter->extension_loaded('xdebug') === true)
		{
			foreach ($this->srcDirectories as $srcDirectory)
			{
				foreach ($this->getSrcDirectoryIterators() as $srcDirectoryIterator)
				{
					foreach ($srcDirectoryIterator as $file)
					{
						$this->adapter->xdebug_start_code_coverage(XDEBUG_CC_UNUSED | XDEBUG_CC_DEAD_CODE);

						$declaredClasses = $this->adapter->get_declared_classes();

						require_once $file->getPathname();

						$xDebugData = $this->adapter->xdebug_get_code_coverage();

						$this->adapter->xdebug_stop_code_coverage();

						foreach (array_diff($this->adapter->get_declared_classes(), $declaredClasses) as $class)
						{
							$this->coverage->addXdebugDataForClass($class, $xDebugData);
						}
					}
				}
			}
		}

		if (sizeof($this->coverage) > 0)
		{
			try
			{
				$this->cleanDestinationDirectory();

				$this->adapter->copy($this->templatesDirectory . DIRECTORY_SEPARATOR . 'screen.css', $this->destinationDirectory . DIRECTORY_SEPARATOR . 'screen.css');

				$classes = $this->coverage->getClasses();

				$indexTemplate = $this->templateParser->parseFile($this->templatesDirectory . DIRECTORY_SEPARATOR . 'index.tpl');
				$indexTemplate->projectName = $this->projectName;
				$indexTemplate->rootUrl = $this->rootUrl;

				$coverageValue = $this->coverage->getValue();

				if ($coverageValue === null)
				{
					$indexTemplate->coverageUnavailable->build();
				}
				else
				{
					$indexTemplate->coverageAvailable->build(array('coverageValue' => round($coverageValue * 100, 2)));
				}

				$classCoverageTemplates = $indexTemplate->classCoverage;

				$classCoverageAvailableTemplates = $classCoverageTemplates->classCoverageAvailable;
				$classCoverageUnavailableTemplates = $classCoverageTemplates->classCoverageUnavailable;

				ksort($classes, \SORT_STRING);

				foreach ($classes as $className => $classFile)
				{
					$classCoverageTemplates->className = $className;
					$classCoverageTemplates->classUrl = str_replace('\\', '/', $className) . self::htmlExtensionFile;

					$classCoverageValue = $this->coverage->getValueForClass($className);

					if ($classCoverageValue === null)
					{
						$classCoverageUnavailableTemplates->build();
					}
					else
					{
						$classCoverageAvailableTemplates->build(array('classCoverageValue' => round($classCoverageValue * 100, 2)));
					}

					$classCoverageTemplates->build();

					$classCoverageAvailableTemplates->resetData();
					$classCoverageUnavailableTemplates->resetData();
				}

				$this->adapter->file_put_contents($this->destinationDirectory . DIRECTORY_SEPARATOR . 'index.html', (string) $indexTemplate->build());

				$classTemplate = $this->templateParser->parseFile($this->templatesDirectory . DIRECTORY_SEPARATOR . 'class.tpl');

				$classTemplate->rootUrl = $this->rootUrl;
				$classTemplate->projectName = $this->projectName;

				$classCoverageAvailableTemplates = $classTemplate->classCoverageAvailable;
				$classCoverageUnavailableTemplates = $classTemplate->classCoverageUnavailable;

				$methodsTemplates = $classTemplate->methods;
				$methodTemplates = $methodsTemplates->method;

				$methodCoverageAvailableTemplates = $methodTemplates->methodCoverageAvailable;
				$methodCoverageUnavailableTemplates = $methodTemplates->methodCoverageUnavailable;

				$sourceFileTemplates = $classTemplate->sourceFile;

				$lineTemplates = $sourceFileTemplates->line;
				$coveredLineTemplates = $sourceFileTemplates->coveredLine;
				$notCoveredLineTemplates = $sourceFileTemplates->notCoveredLine;

				foreach ($this->coverage->getMethods() as $className => $methods)
				{
					$classTemplate->className = $className;
					$classTemplate->relativeRootUrl = str_repeat('../', substr_count($className, '\\'));

					$classCoverageValue = $this->coverage->getValueForClass($className);

					if ($classCoverageValue === null)
					{
						$classCoverageUnavailableTemplates->build();
					}
					else
					{
						$classCoverageAvailableTemplates->build(array('classCoverageValue' => round($classCoverageValue * 100, 2)));
					}

					$reflectedMethods = array();

					foreach (array_filter($this->getReflectionClass($className)->getMethods(), function($reflectedMethod) use ($className) { return $reflectedMethod->isAbstract() === false && $reflectedMethod->getDeclaringClass()->getName() === $className; }) as $reflectedMethod)
					{
						$reflectedMethods[$reflectedMethod->getName()] = $reflectedMethod;
					}

					if (sizeof($reflectedMethods) > 0)
					{
						foreach (array_intersect(array_keys($reflectedMethods), array_keys($methods)) as $methodName)
						{
							$methodCoverageValue = $this->coverage->getValueForMethod($className, $methodName);

							if ($methodCoverageValue === null)
							{
								$methodCoverageUnavailableTemplates->build(array('methodName' => $methodName));
							}
							else
							{
								$methodCoverageAvailableTemplates->build(array(
										'methodName' => $methodName,
										'methodCoverageValue' => round($methodCoverageValue * 100, 2)
									)
								);
							}

							$methodTemplates->build();

							$methodCoverageAvailableTemplates->resetData();
							$methodCoverageUnavailableTemplates->resetData();
						}

						$methodsTemplates->build();

						$methodTemplates->resetData();
					}

					$srcFile = $this->adapter->fopen($classes[$className], 'r');

					if ($srcFile !== false)
					{
						$methodLines = array();

						foreach ($reflectedMethods as $reflectedMethodName => $reflectedMethod)
						{
							$methodLines[$reflectedMethod->getStartLine()] = $reflectedMethodName;
						}

						$currentMethod = null;

						for ($currentMethod = null, $lineNumber = 1, $line = $this->adapter->fgets($srcFile); $line !== false; $lineNumber++, $line = $this->adapter->fgets($srcFile))
						{
							if (isset($methodLines[$lineNumber]) === true)
							{
								$currentMethod = $methodLines[$lineNumber];
							}

							switch (true)
							{
								case isset($methods[$currentMethod]) === false || (isset($methods[$currentMethod][$lineNumber]) === false || $methods[$currentMethod][$lineNumber] == -2):
									$lineTemplateName = 'lineTemplates';
									break;

								case isset($methods[$currentMethod]) === true && isset($methods[$currentMethod][$lineNumber]) === true && $methods[$currentMethod][$lineNumber] == -1:
									$lineTemplateName = 'notCoveredLineTemplates';
									break;

								default:
									$lineTemplateName = 'coveredLineTemplates';
							}

							${$lineTemplateName}->lineNumber = $lineNumber;
							${$lineTemplateName}->code = htmlentities($line, ENT_QUOTES, 'UTF-8');

							if (isset($methodLines[$lineNumber]) === true)
							{
								foreach (${$lineTemplateName}->anchor as $anchorTemplate)
								{
									$anchorTemplate->resetData();
									$anchorTemplate->method = $currentMethod;
									$anchorTemplate->build();
								}
							}

							${$lineTemplateName}
								->addToParent()
								->resetData()
							;
						}

						$this->adapter->fclose($srcFile);
					}

					$file = $this->destinationDirectory . DIRECTORY_SEPARATOR . str_replace('\\', '/', $className) . self::htmlExtensionFile;

					$directory = $this->adapter->dirname($file);

					if ($this->adapter->is_dir($directory) === false)
					{
						$this->adapter->mkdir($directory, 0777, true);
					}

					$this->adapter->file_put_contents($file, (string) $classTemplate->build());

					$classTemplate->resetData();

					$classCoverageAvailableTemplates->resetData();
					$classCoverageUnavailableTemplates->resetData();

					$methodsTemplates->resetData();

					$sourceFileTemplates->resetData();
				}

				$string .= $this->urlPrompt . $this->urlColorizer->colorize(sprintf($this->locale->_('Details of code coverage are available at %s.'), $this->rootUrl)) . PHP_EOL;
			}
			catch (\exception $exception)
			{
				$string .= $this->urlPrompt . $this->urlColorizer->colorize(sprintf($this->locale->_('Unable to generate code coverage at %s: %s.'), $this->rootUrl, $exception->getMessage())) . PHP_EOL;
			}
		}

		return $string;
	}

	public function setReflectionClassInjector(\closure $reflectionClassInjector)
	{
		$closure = new \reflectionMethod($reflectionClassInjector, '__invoke');

		if ($closure->getNumberOfParameters() != 1)
		{
			throw new exceptions\logic\invalidArgument('Reflection class injector must take one argument');
		}

		$this->reflectionClassInjector = $reflectionClassInjector;

		return $this;
	}

	public function getReflectionClass($class)
	{
		$reflectionClass = null;

		if ($this->reflectionClassInjector === null)
		{
			$reflectionClass = new \reflectionClass($class);
		}
		else
		{
			$reflectionClass = $this->reflectionClassInjector->__invoke($class);

			if ($reflectionClass instanceof \reflectionClass === false)
			{
				throw new exceptions\runtime\unexpectedValue('Reflection class injector must return a \reflectionClass instance');
			}
		}

		return $reflectionClass;
	}

	public function setProjectName($projectName)
	{
		$this->projectName = (string) $projectName;

		return $this;
	}

	public function getProjectName()
	{
		return $this->projectName;
	}

	public function setDestinationDirectory($path)
	{
		$this->destinationDirectory = (string) $path;

		return $this;
	}

	public function getDestinationDirectory()
	{
		return $this->destinationDirectory;
	}

	public function setAdapter(atoum\adapter $adapter = null)
	{
		$this->adapter = $adapter ?: new atoum\adapter();

		return $this;
	}

	public function getAdapter()
	{
		return $this->adapter;
	}

	public function setUrlPrompt(prompt $prompt = null)
	{
		$this->urlPrompt = $prompt ?: new prompt();

		return $this;
	}

	public function getUrlPrompt()
	{
		return $this->urlPrompt;
	}

	public function setUrlColorizer(colorizer $colorizer = null)
	{
		$this->urlColorizer = $colorizer ?: new colorizer();

		return $this;
	}

	public function getUrlColorizer()
	{
		return $this->urlColorizer;
	}

	public function setTemplatesDirectory($path = null)
	{
		$this->templatesDirectory = ($path !== null ? (string) $path : atoum\directory . DIRECTORY_SEPARATOR . 'resources' . DIRECTORY_SEPARATOR . 'templates' . DIRECTORY_SEPARATOR . 'coverage');

		return $this;
	}

	public function getTemplatesDirectory()
	{
		return $this->templatesDirectory;
	}

	public function setTemplateParser(template\parser $parser = null)
	{
		$this->templateParser = $parser ?: new template\parser();

		return $this;
	}

	public function getTemplateParser()
	{
		return $this->templateParser;
	}

	public function setRootUrl($rootUrl)
	{
		$this->rootUrl = rtrim((string) $rootUrl, '/') . '/';

		return $this;
	}

	public function getRootUrl()
	{
		return $this->rootUrl;
	}

	public function addSrcDirectory($srcDirectory, \closure $filterClosure = null)
	{
		$srcDirectory = (string) $srcDirectory;

		if (isset($this->srcDirectories[$srcDirectory]) === false)
		{
			$this->srcDirectories[$srcDirectory] = $filterClosure === null ? array() : array($filterClosure);
		}
		else if ($filterClosure !== null)
		{
			$this->srcDirectories[$srcDirectory][] = $filterClosure;
		}

		return $this;
	}

	public function getSrcDirectories()
	{
		return $this->srcDirectories;
	}

	public function getDestinationDirectoryIterator()
	{
		return new \recursiveIteratorIterator(new \recursiveDirectoryIterator($this->destinationDirectory, \filesystemIterator::KEY_AS_PATHNAME | \filesystemIterator::CURRENT_AS_FILEINFO | \filesystemIterator::SKIP_DOTS), \recursiveIteratorIterator::CHILD_FIRST);
	}

	public function getSrcDirectoryIterators()
	{
		$iterators = array();

		foreach ($this->srcDirectories as $srcDirectory => $closures)
		{
			$iterators[] = $iterator = new \recursiveIteratorIterator(new atoum\iterators\filters\recursives\closure(new \recursiveDirectoryIterator($srcDirectory)));

			foreach ($closures as $closure)
			{
				$iterator->addClosure($closure);
			}
		}

		return $iterators;
	}

	public function cleanDestinationDirectory()
	{
		try
		{
			foreach ($this->getDestinationDirectoryIterator() as $inode)
			{
				if ($inode->isDir() === false)
				{
					$this->adapter->unlink($inode->getPathname());
				}
				else if (($pathname = $inode->getPathname()) !== $this->destinationDirectory)
				{
					$this->adapter->rmdir($pathname);
				}
			}
		}
		catch (\exception $exception) {}

		return $this;
	}
}


text:
/**
*
* Login
*
*/

import React from 'react';

import styles from './styles.css';
import validator from 'email-validator';
import TextInput from '../TextInput';

class Login extends React.Component { // eslint-disable-line react/prefer-stateless-function
  static propTypes = {
    login: React.PropTypes.func.isRequired,
    cancelLogin: React.PropTypes.func.isRequired,
  };

  state = {};

  login = () => {
    const email = this.emailField.value();
    if (!validator.validate(email)) {
      this.setState({
        errorText: 'Please provide a valid email',
      });
      return;
    }

    this.setState({
      errorText: null,
    });

    this.props.login(email);
  }

  render() {
    return (

          Login with your email

        <TextInput
               placeholder="Your email"
               ref={(f) => { this.emailField = f; }}
               errorText={this.state.errorText}/>

            cancel

            log in

    );
  }
}

export default Login;


text:
/**
 * SECTION:gstpushsrc
 * @title: GstPushSrc
 * @short_description: Base class for push based source elements
 * @see_also: #GstBaseSrc
 *
 * This class is mostly useful for elements that cannot do
 * random access, or at least very slowly. The source usually
 * prefers to push out a fixed size buffer.
 *
 * Subclasses usually operate in a format that is different from the
 * default GST_FORMAT_BYTES format of #GstBaseSrc.
 *
 * Classes extending this base class will usually be scheduled
 * in a push based mode. If the peer accepts to operate without
 * offsets and within the limits of the allowed block size, this
 * class can operate in getrange based mode automatically. To make
 * this possible, the subclass should implement and override the
 * SCHEDULING query.
 *
 * The subclass should extend the methods from the baseclass in
 * addition to the ::create method.
 *
 * Seeking, flushing, scheduling and sync is all handled by this
 * base class.
 */

#ifdef HAVE_CONFIG_H
#  include "config.h"
#endif

#include <stdlib.h>
#include <string.h>

#include "gstpushsrc.h"
#include "gsttypefindhelper.h"

GST_DEBUG_CATEGORY_STATIC (gst_push_src_debug);
#define GST_CAT_DEFAULT gst_push_src_debug

#define _do_init \
    GST_DEBUG_CATEGORY_INIT (gst_push_src_debug, "pushsrc", 0, \
        "pushsrc element");

#define gst_push_src_parent_class parent_class
G_DEFINE_TYPE_WITH_CODE (GstPushSrc, gst_push_src, GST_TYPE_BASE_SRC, _do_init);

static gboolean gst_push_src_query (GstBaseSrc * src, GstQuery * query);
static GstFlowReturn gst_push_src_create (GstBaseSrc * bsrc, guint64 offset,
    guint length, GstBuffer ** ret);
static GstFlowReturn gst_push_src_alloc (GstBaseSrc * bsrc, guint64 offset,
    guint length, GstBuffer ** ret);
static GstFlowReturn gst_push_src_fill (GstBaseSrc * bsrc, guint64 offset,
    guint length, GstBuffer * ret);

static void
gst_push_src_class_init (GstPushSrcClass * klass)
{
  GstBaseSrcClass *gstbasesrc_class = (GstBaseSrcClass *) klass;

  gstbasesrc_class->create = GST_DEBUG_FUNCPTR (gst_push_src_create);
  gstbasesrc_class->alloc = GST_DEBUG_FUNCPTR (gst_push_src_alloc);
  gstbasesrc_class->fill = GST_DEBUG_FUNCPTR (gst_push_src_fill);
  gstbasesrc_class->query = GST_DEBUG_FUNCPTR (gst_push_src_query);
}

static void
gst_push_src_init (GstPushSrc * pushsrc)
{
  /* nop */
}

static gboolean
gst_push_src_query (GstBaseSrc * src, GstQuery * query)
{
  gboolean ret;

  switch (GST_QUERY_TYPE (query)) {
    case GST_QUERY_SCHEDULING:
    {
      /* a pushsrc can by default never operate in pull mode override
       * if you want something different. */
      gst_query_set_scheduling (query, GST_SCHEDULING_FLAG_SEQUENTIAL, 1, -1,
          0);
      gst_query_add_scheduling_mode (query, GST_PAD_MODE_PUSH);

      ret = TRUE;
      break;
    }
    default:
      ret = GST_BASE_SRC_CLASS (parent_class)->query (src, query);
      break;
  }
  return ret;
}

static GstFlowReturn
gst_push_src_create (GstBaseSrc * bsrc, guint64 offset, guint length,
    GstBuffer ** ret)
{
  GstFlowReturn fret;
  GstPushSrc *src;
  GstPushSrcClass *pclass;

  src = GST_PUSH_SRC (bsrc);
  pclass = GST_PUSH_SRC_GET_CLASS (src);
  if (pclass->create)
    fret = pclass->create (src, ret);
  else
    fret =
        GST_BASE_SRC_CLASS (parent_class)->create (bsrc, offset, length, ret);

  return fret;
}

static GstFlowReturn
gst_push_src_alloc (GstBaseSrc * bsrc, guint64 offset, guint length,
    GstBuffer ** ret)
{
  GstFlowReturn fret;
  GstPushSrc *src;
  GstPushSrcClass *pclass;

  src = GST_PUSH_SRC (bsrc);
  pclass = GST_PUSH_SRC_GET_CLASS (src);
  if (pclass->alloc)
    fret = pclass->alloc (src, ret);
  else
    fret = GST_BASE_SRC_CLASS (parent_class)->alloc (bsrc, offset, length, ret);

  return fret;
}

static GstFlowReturn
gst_push_src_fill (GstBaseSrc * bsrc, guint64 offset, guint length,
    GstBuffer * ret)
{
  GstFlowReturn fret;
  GstPushSrc *src;
  GstPushSrcClass *pclass;

  src = GST_PUSH_SRC (bsrc);
  pclass = GST_PUSH_SRC_GET_CLASS (src);
  if (pclass->fill)
    fret = pclass->fill (src, ret);
  else
    fret = GST_BASE_SRC_CLASS (parent_class)->fill (bsrc, offset, length, ret);

  return fret;
}


text:
//
//  M13ProgressViewStripedBar.m
//  M13ProgressView
//

#import "M13ProgressViewStripedBar.h"

@interface M13ProgressViewStripedBar ()
/**The start progress for the progress animation.*/
@property (nonatomic, assign) CGFloat animationFromValue;
/**The end progress for the progress animation.*/
@property (nonatomic, assign) CGFloat animationToValue;
/**The start time interval for the animaiton.*/
@property (nonatomic, assign) CFTimeInterval animationStartTime;
/**Link to the display to keep animations in sync.*/
@property (nonatomic, strong) CADisplayLink *displayLink;
/**Allow us to write to the progress.*/
@property (nonatomic, readwrite) CGFloat progress;
/**The layer that contains the progress layer. That also masks the progress layer.*/
@property (nonatomic, retain) CALayer *progressSuperLayer;
/**The layer that displays progress in the progress bar.*/
@property (nonatomic, retain) CALayer *progressLayer;
/**The layer that masks the stripes of the progress layer.*/
@property (nonatomic, retain) CAShapeLayer *progressMaskLayer;
/**The mask layer for the progress layer.*/
@property (nonatomic, retain) CAShapeLayer *maskLayer;
/**The background layer that displays the border.*/
@property (nonatomic, retain) CAShapeLayer *backgroundLayer;
/**The layer that is used to animate indeterminate progress.*/
@property (nonatomic, retain) CALayer *indeterminateLayer;
/**The action currently being performed.*/
@property (nonatomic, assign) M13ProgressViewAction currentAction;
/**The stripes layer.*/
@property (nonatomic, retain) CALayer *stripesLayer;
@end

@implementation M13ProgressViewStripedBar
{
    UIColor *_currentColor;
}

@dynamic progress;

#pragma mark Initalization and setup

- (id)init
{
    self = [super init];
    if (self) {
        [self setup];
    }
    return self;
}

- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self setup];
    }
    return self;
}

- (id)initWithCoder:(NSCoder *)aDecoder
{
    self = [super initWithCoder:aDecoder];
    if (self) {
        [self setup];
    }
    return self;
}

- (void)setup
{
    //Set own background color
    self.backgroundColor = [UIColor clearColor];

    //Set defauts
    self.animationDuration = .3;
    _cornerType = M13ProgressViewStripedBarCornerTypeSquare;
    _cornerRadius = 3.0;
    _stripeWidth = 7.0;
    _borderWidth = 1.0;
    _showStripes = YES;

    //Set default colors
    self.primaryColor = [UIColor colorWithRed:0 green:122/255.0 blue:1.0 alpha:1.0];
    self.secondaryColor = [UIColor colorWithRed:181/255.0 green:182/255.0 blue:183/255.0 alpha:1.0];
    self.stripeColor = [UIColor whiteColor];
    _currentColor = self.primaryColor;

    //BackgroundLayer
    _backgroundLayer = [CAShapeLayer layer];
    _backgroundLayer.strokeColor = self.secondaryColor.CGColor;
    _backgroundLayer.fillColor = nil;
    _backgroundLayer.lineWidth = _borderWidth;
    [self.layer addSublayer:_backgroundLayer];

    //Main mask layer
    _progressSuperLayer = [CALayer layer];
    _maskLayer = [CAShapeLayer layer];
    _maskLayer.fillColor = [UIColor blackColor].CGColor;
    _maskLayer.backgroundColor = [UIColor clearColor].CGColor;
    _progressSuperLayer.mask = _maskLayer;
    [self.layer addSublayer:_progressSuperLayer];

    //ProgressLayer
    _progressLayer = [CALayer layer];
    _progressMaskLayer = [CAShapeLayer layer];
    _progressMaskLayer.fillColor = [UIColor whiteColor].CGColor;
    _progressMaskLayer.backgroundColor = [UIColor clearColor].CGColor;
    _progressLayer.mask = _progressMaskLayer;
    [_progressSuperLayer addSublayer:_progressLayer];
    _stripesLayer = [CALayer layer];
    [_progressLayer addSublayer:_stripesLayer];

    //Layout
    [self layoutSubviews];

    //Start stripes animation
    [self setAnimateStripes:YES];
}

#pragma mark Appearance

- (void)setPrimaryColor:(UIColor *)primaryColor
{
    [super setPrimaryColor:primaryColor];
    if (_currentAction == M13ProgressViewActionNone) {
        _currentColor = self.primaryColor;
    }
    [self setNeedsDisplay];
}

- (void)setSecondaryColor:(UIColor *)secondaryColor
{
    [super setSecondaryColor:secondaryColor];
    _backgroundLayer.strokeColor = self.secondaryColor.CGColor;
    [self setNeedsDisplay];
}

- (void)setStripeColor:(UIColor *)stripeColor
{
    _stripeColor = stripeColor;
}

- (void)setCornerType:(M13ProgressViewStripedBarCornerType)cornerType
{
    _cornerType = cornerType;
    [self setNeedsDisplay];
}

- (void)setCornerRadius:(CGFloat)cornerRadius
{
    _cornerRadius = cornerRadius;
    [self setNeedsDisplay];
}

- (void)setStripeWidth:(CGFloat)stripeWidth
{
    _stripeWidth = stripeWidth;
    [self invalidateIntrinsicContentSize];
    [self setNeedsDisplay];
}

- (void)setBorderWidth:(CGFloat)borderWidth
{
    _borderWidth = borderWidth;
    [self invalidateIntrinsicContentSize];
    [self setNeedsDisplay];
}

- (void)setShowStripes:(BOOL)showStripes
{
    _showStripes = showStripes;
    [self drawStripes];
}

- (void)setAnimateStripes:(BOOL)animateStripes
{
    _animateStripes = animateStripes;

    //reset the animations
    [_stripesLayer removeAllAnimations];
    if (_animateStripes) {
        //Set the stripes frame
        _stripesLayer.frame = CGRectMake(0, 0, self.bounds.size.width + (4 * _stripeWidth), self.bounds.size.height);
        //Add the animation
        //Create the animation
        CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:@"position"];
        animation.duration = 2 * self.animationDuration;
        animation.repeatCount = HUGE_VALF;
        animation.removedOnCompletion = YES;
        animation.fromValue = [NSValue valueWithCGPoint:CGPointMake(- (2 *_stripeWidth) + (self.bounds.size.width / 2), self.bounds.size.height / 2.0)];
        animation.toValue = [NSValue valueWithCGPoint:CGPointMake(0 + (self.bounds.size.width / 2.0), self.bounds.size.height / 2.0)];
        [_stripesLayer addAnimation:animation forKey:@"position"];
    }
}

#pragma mark Actions

- (void)setProgress:(CGFloat)progress animated:(BOOL)animated
{
    if (animated == NO) {
        if (_displayLink) {
            //Kill running animations
            [_displayLink removeFromRunLoop:[NSRunLoop mainRunLoop] forMode:NSRunLoopCommonModes];
            _displayLink = nil;
        }
        [super setProgress:progress animated:NO];
        [self setNeedsDisplay];
    } else {
        _animationStartTime = CACurrentMediaTime();
        _animationFromValue = self.progress;
        _animationToValue = progress;
        if (!_displayLink) {
            //Create and setup the display link
            [self.displayLink removeFromRunLoop:NSRunLoop.mainRunLoop forMode:NSRunLoopCommonModes];
            self.displayLink = [CADisplayLink displayLinkWithTarget:self selector:@selector(animateProgress:)];
            [self.displayLink addToRunLoop:NSRunLoop.mainRunLoop forMode:NSRunLoopCommonModes];
        } /*else {
           //Reuse the current display link
           }*/
    }
}

- (void)animateProgress:(CADisplayLink *)displayLink
{
    dispatch_async(dispatch_get_main_queue(), ^{
        CGFloat dt = (displayLink.timestamp - _animationStartTime) / self.animationDuration;
        if (dt >= 1.0) {
            //Order is important! Otherwise concurrency will cause errors, because setProgress: will detect an animation in progress and try to stop it by itself. Once over one, set to actual progress amount. Animation is over.
            [self.displayLink removeFromRunLoop:NSRunLoop.mainRunLoop forMode:NSRunLoopCommonModes];
            self.displayLink = nil;
            [super setProgress:_animationToValue animated:NO];
            [self setNeedsDisplay];
            return;
        }

        //Set progress
        [super setProgress:_animationFromValue + dt * (_animationToValue - _animationFromValue) animated:YES];
        [self setNeedsDisplay];

    });
}

- (void)performAction:(M13ProgressViewAction)action animated:(BOOL)animated
{
    if (action == M13ProgressViewActionNone && _currentAction != M13ProgressViewActionNone) {
        _currentColor = self.primaryColor;
    } else if (action == M13ProgressViewActionSuccess && _currentAction != M13ProgressViewActionSuccess) {
        _currentColor = [UIColor colorWithRed:63.0f/255.0f green:226.0f/255.0f blue:80.0f/255.0f alpha:1];
    } else if (action == M13ProgressViewActionFailure && _currentAction != M13ProgressViewActionFailure) {
        _currentColor = [UIColor colorWithRed:249.0f/255.0f green:37.0f/255.0f blue:0 alpha:1];
    }
    _currentAction = action;
    [self drawStripes];
}

- (void)setIndeterminate:(BOOL)indeterminate
{
    [super setIndeterminate:indeterminate];
    [self drawProgress];
}

#pragma mark Layout

- (void)layoutSubviews
{
    //Set the proper location and size of the text.
    _backgroundLayer.frame = self.bounds;
    _progressSuperLayer.frame = self.bounds;
    _progressMaskLayer.frame = self.bounds;
    [self setAnimateStripes:YES];
    [self calculateMask];
    [self drawStripes];
}

- (CGSize)intrinsicContentSize
{
    //Border + border to progress bar margin.
    CGFloat base = (_borderWidth * 2) + (_borderWidth * 2) + 1;
    //Add some stripes so we can see them.
    CGFloat width = base + (2 * _stripeWidth);
    return CGSizeMake(width, base);
}

#pragma mark Drawing

- (void)drawRect:(CGRect)rect
{
    [self drawProgress];
    [self drawBackground];
}

- (void)drawProgress
{
    //Calculate the corner radius
    CGFloat cornerRadius = 0;
    if (_cornerType == M13ProgressViewStripedBarCornerTypeRounded) {
        cornerRadius = _cornerRadius;
    } else if (_cornerType == M13ProgressViewStripedBarCornerTypeCircle) {
        cornerRadius = self.bounds.size.height - (2 * _borderWidth);
    }

    //Draw the path
    CGRect rect;
    if (!self.indeterminate) {
        rect = CGRectMake(_borderWidth * 2, _borderWidth * 2, (self.bounds.size.width - (4 * _borderWidth)) * self.progress, self.bounds.size.height - (4 * _borderWidth));
    } else {
        rect = CGRectMake(_borderWidth * 2, _borderWidth * 2, (self.bounds.size.width - (4 * _borderWidth)), self.bounds.size.height - (4 * _borderWidth));
    }

    UIBezierPath *path = [UIBezierPath bezierPathWithRoundedRect:rect cornerRadius:cornerRadius];
    [_progressMaskLayer setPath:path.CGPath];
}

- (void)drawBackground
{
    //Create the path to stroke
    //Calculate the corner radius
    CGFloat cornerRadius = 0;
    if (_cornerType == M13ProgressViewStripedBarCornerTypeRounded) {
        cornerRadius = _cornerRadius;
    } else if (_cornerType == M13ProgressViewStripedBarCornerTypeCircle) {
            cornerRadius = (self.bounds.size.height - _borderWidth) / 2.0;
    }

    //Draw the path
    CGRect rect = CGRectMake(_borderWidth / 2.0, _borderWidth / 2.0, self.bounds.size.width - _borderWidth, self.bounds.size.height - _borderWidth);
    UIBezierPath *path;
    if (_cornerType == M13ProgressViewStripedBarCornerTypeSquare) {
        //Having a 0 corner radius does not display properly since the rect displays like it is not closed.
        path = [UIBezierPath bezierPathWithRect:rect];
    } else {
        path = [UIBezierPath bezierPathWithRoundedRect:rect cornerRadius:cornerRadius];;
    }
    _backgroundLayer.path = path.CGPath;
}

- (void)drawStripes
{
    if (!_showStripes && !self.indeterminate) {
        //Fill with a solid color
        _stripesLayer.backgroundColor = _currentColor.CGColor;
    } else {
        //Start the image context
        UIGraphicsBeginImageContextWithOptions(CGSizeMake(_stripeWidth * 4.0, _stripeWidth * 4.0), NO, [UIScreen mainScreen].scale);

        //Fill the background
        [_currentColor setFill];
        UIBezierPath *fillPath = [UIBezierPath bezierPathWithRect:CGRectMake(0, 0, _stripeWidth * 4.0, _stripeWidth * 4.0)];
        [fillPath fill];

        //Draw the stripes
        [_stripeColor setFill];
        for (int i = 0; i < 4; i++) {
            //Create the four inital points of the fill shape
            CGPoint bottomLeft = CGPointMake(-(_stripeWidth * 4.0), _stripeWidth * 4.0);
            CGPoint topLeft = CGPointMake(0, 0);
            CGPoint topRight = CGPointMake(_stripeWidth, 0);
            CGPoint bottomRight = CGPointMake(-(_stripeWidth * 4.0) + _stripeWidth, _stripeWidth * 4.0);
            //Shift all four points as needed to draw all four stripes
            bottomLeft.x += i * (2 * _stripeWidth);
            topLeft.x += i * (2 * _stripeWidth);
            topRight.x += i * (2 * _stripeWidth);
            bottomRight.x += i * (2 * _stripeWidth);
            //Create the fill path
            UIBezierPath *path = [UIBezierPath bezierPath];
            [path moveToPoint:bottomLeft];
            [path addLineToPoint:topLeft];
            [path addLineToPoint:topRight];
            [path addLineToPoint:bottomRight];
            [path closePath];
            [path fill];
        }

        //Retreive the image
        UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
        UIGraphicsEndImageContext();

        //Set the background of the progress layer
        _stripesLayer.backgroundColor = [UIColor colorWithPatternImage:image].CGColor;
    }
}

- (void)calculateMask
{
    //Calculate the corner radius
    CGFloat cornerRadius = 0;
    if (_cornerType == M13ProgressViewStripedBarCornerTypeRounded) {
        cornerRadius = _cornerRadius;
    } else if (_cornerType == M13ProgressViewStripedBarCornerTypeCircle) {
        cornerRadius = self.bounds.size.height - (2 * _borderWidth);
    }

    //Draw the path
    CGRect rect = CGRectMake(_borderWidth * 2, _borderWidth * 2, self.bounds.size.width - (4 * _borderWidth), self.bounds.size.height - (4 * _borderWidth));

    UIBezierPath *path = [UIBezierPath bezierPathWithRoundedRect:rect cornerRadius:cornerRadius];

    //Create the mask
    _maskLayer.path = path.CGPath;

    //Set the frame
    _maskLayer.frame = self.bounds;
    _progressSuperLayer.frame = self.bounds;
}

@end


text:
package net.kem.tquickfix.builder;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Created with IntelliJ IDEA.
 * User: EvgenyK
 * Date: 10/30/14
 * Time: 2:43 PM
 * Generates QF Field class file.
 */
public class QFFieldClassBuilder {

    //	 <field number="5" javaType="AdvTransType" javaType="STRING">
//	     <value enum="N" description="NEW"/>
//	     <value enum="C" description="CANCEL"/>
//	     <value enum="R" description="REPLACE"/>
//	 </field>
    static class TypeMetadata {
        private boolean useByStringInstantiation;
        private String superclassName;
        private String javaType;
        private String imports;

        String getByStringInstantiation(boolean hasPredefinedValues) {
            if(useByStringInstantiation) {
                String jDoc = "\n\t/**\n" +
                        "\t * Creates instance of {@linkplain $CLASS_NAME} from the given raw String value.\n" +
                        "\t * @param rawValue the field string value.\n" +
                        "\t * @param validateValue validation policy.\n" +
                        "\t * @return instance of {@linkplain $CLASS_NAME}.\n" +
                        "\t * @throws IllegalArgumentException if the given validation policy restricts instance creation with the given value.\n" +
                        "\t * @see Validation\n" +
                        "\t */\n";
                if(hasPredefinedValues) {
                    return jDoc + "\tpublic static $CLASS_NAME getInstance(String rawValue, Validation validateValue) throws IllegalArgumentException {\n" +
                            "\t\t$CLASS_NAME res = getPredefinedInstance(rawValue, validateValue);\n" +
                            "\t\tif(res == null) {\n" +
                            "\t\t\tres = new $CLASS_NAME(rawValue, validateValue);\n" +
                            "\t\t}\n" +
                            "\t\treturn res;\n" +
                            "\t}\n";
                } else {
                    return jDoc + "\tpublic static $CLASS_NAME getInstance(String rawValue, Validation validateValue) throws IllegalArgumentException {\n" +
                            "\t\treturn new $CLASS_NAME(rawValue, validateValue);\n" +
                            "\t}\n";
                }
            } else {
                return "";
            }
        }

        String getByTypeInstantiation(boolean hasPredefinedValues) {
            String jDoc, res;
            if(hasPredefinedValues) {
                jDoc = "\t/**\n" +
                        "\t * Creates instance of {@linkplain $CLASS_NAME}.\n" +
                        "\t * @param value the field value.\n" +
                        "\t * @param validateValue validation policy.\n" +
                        "\t * @return instance of {@linkplain $CLASS_NAME}.\n" +
                        "\t * @throws IllegalArgumentException if the given validation policy restricts instance creation with the given value.\n" +
                        "\t * @see Validation\n" +
                        "\t */\n";
                res = jDoc + "\tpublic static $CLASS_NAME getInstance($TYPE value, Validation validateValue) throws IllegalArgumentException {\n" +
                        "\t\t$CLASS_NAME res = getPredefinedInstance(value, validateValue);\n" +
                        "\t\tif(res == null) {\n" +
                        "\t\t\tres = new $CLASS_NAME(value, validateValue);\n" +
                        "\t\t}\n" +
                        "\t\treturn res;\n" +
                        "\t}\n";
            } else {
                jDoc = "\t/**\n" +
                        "\t * Creates instance of {@linkplain $CLASS_NAME}.\n" +
                        "\t * @param value the field value.\n" +
                        "\t * @param validateValue validation policy. Since this field doesn't have predefined values, \n" +
                        "\t *                      the {@linkplain Validation#OMIT_PREDEFINED} will have the same meaning as {@linkplain Validation#FULL}.\n" +
                        "\t * @return instance of {@linkplain $CLASS_NAME}.\n" +
                        "\t * @throws IllegalArgumentException if the given validation policy restricts instance creation with the given value.\n" +
                        "\t * @see Validation\n" +
                        "\t */\n";
                res = jDoc + "\tpublic static $CLASS_NAME getInstance($TYPE value, Validation validateValue) throws IllegalArgumentException {\n" +
                        "\t\treturn new $CLASS_NAME(value, validateValue);\n" +
                        "\t}\n";
            }
            return res;
        }

        String getByStringCtor(boolean hasPredefinedValues) {
            return useByStringInstantiation? "\tprotected $CLASS_NAME(String rawValue, Validation validateValue) {\n" +
                    "\t\tsuper(NAME, NUMBER, rawValue, validateValue);\n" +
                    "\t}\n":
                    "";
        }

        String getByTypeCtor(boolean hasPredefinedValues) {
            return "\tprotected $CLASS_NAME($TYPE value, Validation validateValue) {\n" +
                    "\t\tsuper(NUMBER, NAME, value, validateValue);\n" +
                    "\t}\n";
        }

        String getByObjectObjectInstantiation(boolean hasPredefinedValues) {
            return hasPredefinedValues?
                    "\t/**\n" +
                    "\t * Tries to retrieve predefined $CLASS_NAME instance based on the given value.\n" +
                    "\t * @param value         field value.\n" +
                    "\t * @param validateValue validation rule.\n" +
                    "\t * @return $CLASS_NAME instance if the instance with the given value is defined. Otherwise the method either returns null or throws exception (see below).\n" +
                    "\t * @throws IllegalArgumentException if $CLASS_NAME instance with the given value is not defined and validateValue is {@linkplain Validation#FULL}.\n" +
                    "\t */\n" +
                    "\tprivate static $CLASS_NAME getPredefinedInstance(Object value, Validation validateValue) throws IllegalArgumentException {\n" +
                    "\t\t$CLASS_NAME res = FIELD_VALUES.get(value);\n" +
                    "\t\tif(res == null && validateValue == Validation.FULL) {\n" +
//                    "\t\t\tQFParser.getInstance().getThreadContext().addError(ThreadContext.ErrorType.OUT_OF_PREDEFINED_SCOPE, \"Value \" + value + \" is out of predefined values set of tag $CLASS_NAME (\" + $CLASS_NAME.NUMBER + \")\");\n" +
                    "\t\t\tthrow new IllegalArgumentException(\"Value \" + value + \" is out of predefined values set of tag $CLASS_NAME (\" + $CLASS_NAME.NUMBER + \")\");\n" +
                    "\t\t}\n" +
                    "\t\treturn res;\n" +
                    "\t}\n":

                    "";
        }

        TypeMetadata(String superclassName, String javaType, String imports, boolean useByStringInstantiation) {
            this.superclassName = superclassName;
            this.javaType = javaType;
            this.imports = imports;
            this.useByStringInstantiation = useByStringInstantiation;
        }
    }
    private static final TypeMetadata TMD_String = new TypeMetadata("QFStringField", "String", null, false);
    private static final TypeMetadata TMD_Character = new TypeMetadata("QFCharacterField", "Character", null, true);
    private static final TypeMetadata TMD_BigDecimal = new TypeMetadata("QFBigDecimalField", "BigDecimal", "import java.math.BigDecimal;", true);
    private static final TypeMetadata TMD_Integer = new TypeMetadata("QFIntegerField", "Integer", null, true);
    private static final TypeMetadata TMD_Double = new TypeMetadata("QFDoubleField", "Double", null, true);
    private static final TypeMetadata TMD_Boolean = new TypeMetadata("QFBooleanField", "Boolean", null, true);
    private static final TypeMetadata TMD_Float = new TypeMetadata("QFFloatField", "Float", null, true);
    private static final TypeMetadata TMD_Currency = new TypeMetadata("QFCurrencyField", "Currency", "import java.util.Currency;", true);

    private static final TypeMetadata TMD_DateTime = new TypeMetadata("QFDateTimeField", "Date", "import java.util.Date;", true);
    private static final TypeMetadata TMD_Date = new TypeMetadata("QFDateField", "Date", "import java.util.Date;", true);
    private static final TypeMetadata TMD_MonthYear = new TypeMetadata("QFMonthYearField", "Date", "import java.util.Date;", true);
    private static final TypeMetadata TMD_Time = new TypeMetadata("QFTimeField", "Date", "import java.util.Date;", true);

    private static final Map<String, TypeMetadata> FIX_TYPE_TO_JAVA_TYPE = new HashMap<>();
    static {
        FIX_TYPE_TO_JAVA_TYPE.put("STRING", TMD_String);
        FIX_TYPE_TO_JAVA_TYPE.put("MULTIPLECHARVALUE", TMD_String);
        FIX_TYPE_TO_JAVA_TYPE.put("EXCHANGE", TMD_String);
        FIX_TYPE_TO_JAVA_TYPE.put("DATA", TMD_String);
        FIX_TYPE_TO_JAVA_TYPE.put("LOCALMKTDATE", TMD_String);
        FIX_TYPE_TO_JAVA_TYPE.put("MONTHYEAR", TMD_String);
        FIX_TYPE_TO_JAVA_TYPE.put("MULTIPLESTRINGVALUE", TMD_String);
        FIX_TYPE_TO_JAVA_TYPE.put("MULTIPLEVALUESTRING", TMD_String); // In FIX v4.4 only.
        FIX_TYPE_TO_JAVA_TYPE.put("COUNTRY", TMD_String);
        FIX_TYPE_TO_JAVA_TYPE.put("TZTIMEONLY", TMD_String);
        FIX_TYPE_TO_JAVA_TYPE.put("TZTIMESTAMP", TMD_String);
        FIX_TYPE_TO_JAVA_TYPE.put("XMLDATA", TMD_String);
        FIX_TYPE_TO_JAVA_TYPE.put("LANGUAGE", TMD_String);

        FIX_TYPE_TO_JAVA_TYPE.put("CHAR", TMD_Character);
        FIX_TYPE_TO_JAVA_TYPE.put("PRICE", TMD_BigDecimal);
        FIX_TYPE_TO_JAVA_TYPE.put("CURRENCY", TMD_Currency);

        FIX_TYPE_TO_JAVA_TYPE.put("LENGTH", TMD_Integer);
        FIX_TYPE_TO_JAVA_TYPE.put("NUMINGROUP", TMD_Integer);
        FIX_TYPE_TO_JAVA_TYPE.put("SEQNUM", TMD_Integer);
        FIX_TYPE_TO_JAVA_TYPE.put("INT", TMD_Integer);
        FIX_TYPE_TO_JAVA_TYPE.put("DAY-OF-MONTH", TMD_Integer); // In FIX v5.0 only.

        FIX_TYPE_TO_JAVA_TYPE.put("AMT", TMD_Double);
        FIX_TYPE_TO_JAVA_TYPE.put("QTY", TMD_Double);
        FIX_TYPE_TO_JAVA_TYPE.put("PERCENTAGE", TMD_Double);
        FIX_TYPE_TO_JAVA_TYPE.put("PRICEOFFSET", TMD_Double);
        FIX_TYPE_TO_JAVA_TYPE.put("BOOLEAN", TMD_Boolean);
        FIX_TYPE_TO_JAVA_TYPE.put("FLOAT", TMD_Float);

        FIX_TYPE_TO_JAVA_TYPE.put("UTCTIMESTAMP", TMD_DateTime);
        FIX_TYPE_TO_JAVA_TYPE.put("UTCDATEONLY", TMD_Date); // In FIX v4.0 only.
        FIX_TYPE_TO_JAVA_TYPE.put("DATE", TMD_Date);
        FIX_TYPE_TO_JAVA_TYPE.put("UTCTIMEONLY", TMD_Time);
        FIX_TYPE_TO_JAVA_TYPE.put("TIME", TMD_Time); // In FIX v4.0 only.
        FIX_TYPE_TO_JAVA_TYPE.put("MONTH-YEAR", TMD_MonthYear); // In FIX v5.0 only.
    }

    public static String generateClassFile(String fNumber, String fName, String fType, List<String[]> fEnumDescr) {
        TypeMetadata tmd = FIX_TYPE_TO_JAVA_TYPE.get(fType);
        boolean hasPredefinedValues = !fEnumDescr.isEmpty();
        String res = TEMPLATE_CLASS
                .replace("$PACKAGE", getPackage())// $PACKAGE package net.kem.tquickfix.qf.field;
                .replace("$IMPORT", getImport(tmd.superclassName, tmd.imports, fEnumDescr))// $IMPORT    ...
                .replace("$SUPERCLASS", tmd.superclassName)// $SUPERCLASS  QFIntegerField
                .replace("$NUMBER", fNumber)// $NUMBER  1144
                .replace("$PREDEFINED_SECTION", getFieldValuesSection(fName, tmd.javaType, tmd.useByStringInstantiation, fEnumDescr).toString())

                .replace("$INSTANCE_BY_STRING", tmd.getByStringInstantiation(hasPredefinedValues))
                .replace("$INSTANCE_BY_TYPE", tmd.getByTypeInstantiation(hasPredefinedValues))
                .replace("$INSTANCE_NO_VALIDATION", getByTypeInstantiationNoValidation(hasPredefinedValues))

                .replace("$CTOR_BY_STRING", tmd.getByStringCtor(hasPredefinedValues))
                .replace("$CTOR_BY_TYPE", tmd.getByTypeCtor(hasPredefinedValues))
                .replace("$INSTANCE_BY_OBJECT", tmd.getByObjectObjectInstantiation(hasPredefinedValues))

                .replace("$TYPE", tmd.javaType)// $CTOR_METHOD_BODY    ...
                .replace("$CLASS_NAME", fName);// $CLASS_NAME  ImpliedMarketIndicator
        return res;
    }

    private static CharSequence getPackage() {
        return "package " + QFBuilder.getSoucesPackage() + QFBuilder.qfVersion + ".field;\n";
    }

    private static CharSequence getImport(CharSequence superclassName, CharSequence imports, List<String[]> fEnumDescr) {
        StringBuilder sb = new StringBuilder();
//        sb.append("import QFParser;\n");
//        sb.append("import ThreadContext;\n");
        sb.append("import net.kem.tquickfix.blocks.").append(superclassName).append(";\n");
        if(imports != null) {
            sb.append(imports).append("\n");
        }
        if(!fEnumDescr.isEmpty()) {
            sb.append("\nimport java.util.HashMap;\nimport java.util.Map;\n");
        }
        return sb;
    }

    private static StringBuilder getFieldValuesSection(CharSequence className, CharSequence fType, boolean useByStringInstantiation, List<String[]> fEnumDescr) {
        StringBuilder sb = new StringBuilder();
        if(fEnumDescr.isEmpty()) {
            return sb;
        }

        //protected static final Map<Integer, ModelType> M_FIELD_VALUES = new HashMap<>(116);
        sb.append("\tprivate static final Map<Object, $CLASS_NAME> FIELD_VALUES = new HashMap<Object, $CLASS_NAME>($SIZE);\n".replace("$TYPE", fType).replace("$CLASS_NAME", className).replace("$SIZE", String.valueOf(fEnumDescr.size())));

        //public static final ModelType M_UTILITY_PROVIDED_STANDARD_MODEL = new ModelType(0, true);
        //public static final ModelType M_PROPRIETARY_MODEL = new ModelType(1, true);
        String member = "\tpublic static final $CLASS_NAME $CONST_NAME = new $CLASS_NAME($CONST_VALUE, Validation.OMIT_PREDEFINED);\n";
        char fEnumBoundares;
        if(fType.equals("String")) {
            fEnumBoundares = '"';
        } else {
            if(fType.equals("Character")) {
                fEnumBoundares = '\'';
            } else {
                if(fType.equals("Boolean")) {
                    fEnumBoundares = 1;
                } else {
                    fEnumBoundares = 0;
                }
            }
        }
        for(String[] ed : fEnumDescr) {
            String fEnum = ed[0], fDescr = ed[1];
            if(fEnumBoundares != 0) {
                if(fEnumBoundares == 1) {
                    fEnum = fEnum.charAt(0) == 'Y'? "true": "false";
                } else {
                    fEnum = fEnumBoundares + fEnum + fEnumBoundares;
                }
            }
            sb.append(member.replace("$CLASS_NAME", className).replace("$CONST_NAME", fDescr).replace("$CONST_VALUE", fEnum));
        }

        sb.append("\tstatic {\n");
        for(String[] ed : fEnumDescr) {
            String fDescr = ed[1];
            sb.append(String.format("\t\tFIELD_VALUES.put(%s.value, %s);%n", fDescr, fDescr));
            if(useByStringInstantiation) {
                sb.append(String.format("\t\tFIELD_VALUES.put(%s.rawValue, %s);%n", fDescr, fDescr));
            }
        }
        sb.append("\t}\n");

        sb.append("\t@Override\n" +
                "\tprotected boolean isPredefined() {\n" +
                "\t\treturn FIELD_VALUES.containsKey(value)");
        if(useByStringInstantiation) {
            sb.append(" || FIELD_VALUES.containsKey(rawValue);\n\t}");
        } else {
            sb.append(";\n\t}");
        }
        return sb;
    }

    private static CharSequence getByTypeInstantiationNoValidation(boolean hasPredefinedValues) {
        if(hasPredefinedValues) {
            return "";
        }
        return "\t/**\n" +
                "\t * Creates non-validated instance of {@linkplain $CLASS_NAME}.\n" +
                "\t * Since this field doesn't have predefined values, the validation is not necessary.\n" +
                "\t * @param value the field value. In general, the null value is allowed.\n" +
                "\t *              In this case method {@linkplain #getValue()} will return null,\n" +
                "\t *              method {@linkplain #getRawValue()} will return null and\n" +
                "\t * @return non-validated instance of {@linkplain $CLASS_NAME}.\n" +
                "\t */\n" +
                "\tpublic static $CLASS_NAME getInstance($TYPE value) {\n" +
                "\t\treturn new $CLASS_NAME(value, Validation.NONE);\n" +
                "\t}\n\n";
    }

    private static final String TEMPLATE_CLASS =
            "$PACKAGE\n" +
            "$IMPORT" +
            "\n" +
            "/**\n" +
            " * Field $CLASS_NAME\n" +
            " */\n" +
            "@SuppressWarnings(\"unused\")\n" +
            "public class $CLASS_NAME extends $SUPERCLASS {\n" +
            "\tpublic static final String NAME = \"$CLASS_NAME\";\n" +
            "\tpublic static final int NUMBER = $NUMBER;\n" +
            "\n" +

            "$PREDEFINED_SECTION\n" +

            "$INSTANCE_BY_STRING\n" +
            "$INSTANCE_BY_TYPE\n" +
            "$INSTANCE_NO_VALIDATION" +
            "$CTOR_BY_STRING\n" +
            "$CTOR_BY_TYPE\n" +
            "$INSTANCE_BY_OBJECT\n" +
            "}";
}


text:
import DS from 'ember-data';

var Category = DS.Model.extend({

});

Category.reopenClass({
  getIndexApiUrl: function(targetDiscourseUrl) {
    var url = "/categories.json";
    if (targetDiscourseUrl) {
      url = "/remote_discourse/categories.json?host=" + targetDiscourseUrl;
    }
    return url;
  },
  getTopicListApiUrl: function(categorySlug, targetDiscourseUrl) {
    var url = "/c/" + categorySlug + ".json";
    if (targetDiscourseUrl) {
      url = "/remote_discourse/topics_per_category.json?category=" + categorySlug + "&host=" + targetDiscourseUrl;
    }
    return url;
  }
});

export default Category;


text:
using System.Runtime.CompilerServices;

[assembly: InternalsVisibleTo("KubernetesClient.Tests")]


text:
package com.google.caliper.runner.instrument;

import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.ElementType.PARAMETER;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

import java.lang.annotation.Retention;
import java.lang.annotation.Target;
import javax.inject.Qualifier;

/** Binding annotation for the options applied to an instrument. */
@Retention(RUNTIME)
@Target({FIELD, PARAMETER, METHOD})
@Qualifier
@interface InstrumentOptions {}


text:
include theos/makefiles/common.mk

BUNDLE_NAME = AppHeadsSettings
AppHeadsSettings_FILES = $(wildcard *.m) $(wildcard *.mm)
AppHeadsSettings_INSTALL_PATH = /Library/PreferenceBundles
AppHeadsSettings_FRAMEWORKS = UIKit CoreGraphics Social
AppHeadsSettings_PRIVATE_FRAMEWORKS = Preferences
AppHeadsSettings_LDFLAGS = -L$(LIB_DIR)
AppHeadsSettings_LIBRARIES = AppHeads applist
AppHeadsSettings_CFLAGS = -fobjc-arc

include $(THEOS_MAKE_PATH)/bundle.mk

internal-stage::
	$(ECHO_NOTHING)mkdir -p $(THEOS_STAGING_DIR)/Library/PreferenceLoader/Preferences$(ECHO_END)
	$(ECHO_NOTHING)cp entry.plist $(THEOS_STAGING_DIR)/Library/PreferenceLoader/Preferences/AppHeadsSettings.plist$(ECHO_END)