text:
package org.onosproject.cli.net.vnet;

import org.apache.karaf.shell.commands.Argument;
import org.apache.karaf.shell.commands.Command;
import org.onosproject.cli.AbstractShellCommand;
import org.onosproject.incubator.net.virtual.NetworkId;
import org.onosproject.incubator.net.virtual.VirtualDevice;
import org.onosproject.incubator.net.virtual.VirtualNetworkAdminService;
import org.onosproject.incubator.net.virtual.VirtualNetworkService;
import org.onosproject.net.DefaultAnnotations;
import org.onosproject.net.DefaultDevice;
import org.onosproject.net.DefaultPort;
import org.onosproject.net.Device;
import org.onosproject.net.DeviceId;
import org.onosproject.net.Port;
import org.onosproject.net.PortNumber;
import org.onosproject.net.device.DeviceService;

import java.util.Set;

import static com.google.common.base.Preconditions.checkNotNull;

/**
 * Creates a new virtual port.
 */
@Command(scope = "onos", name = "vnet-create-port",
        description = "Creates a new virtual port in a network.")
public class VirtualPortCreateCommand extends AbstractShellCommand {

    @Argument(index = 0, name = "networkId", description = "Network ID",
            required = true, multiValued = false)
    Long networkId = null;

    @Argument(index = 1, name = "deviceId", description = "Virtual Device ID",
            required = true, multiValued = false)
    String deviceId = null;

    @Argument(index = 2, name = "portNum", description = "Virtual device port number",
            required = true, multiValued = false)
    Integer portNum = null;

    @Argument(index = 3, name = "physDeviceId", description = "Physical Device ID",
            required = true, multiValued = false)
    String physDeviceId = null;

    @Argument(index = 4, name = "physPortNum", description = "Physical device port number",
            required = true, multiValued = false)
    Integer physPortNum = null;

    @Override
    protected void execute() {
        VirtualNetworkAdminService service = get(VirtualNetworkAdminService.class);
        DeviceService deviceService = get(DeviceService.class);
        VirtualDevice virtualDevice = getVirtualDevice(DeviceId.deviceId(deviceId));
        checkNotNull(virtualDevice, "The virtual device does not exist.");

        DefaultAnnotations annotations = DefaultAnnotations.builder().build();
        Device physDevice = new DefaultDevice(null, DeviceId.deviceId(physDeviceId),
                                              null, null, null, null, null, null, annotations);
        Port realizedBy = new DefaultPort(physDevice, PortNumber.portNumber(physPortNum), true);
        service.createVirtualPort(NetworkId.networkId(networkId), DeviceId.deviceId(deviceId),
                                  PortNumber.portNumber(portNum), realizedBy);
        print("Virtual port successfully created.");
    }

    /**
     * Returns the virtual device matching the device identifier.
     *
     * @param aDeviceId device identifier
     * @return matching virtual device, or null.
     */
    private VirtualDevice getVirtualDevice(DeviceId aDeviceId) {
        VirtualNetworkService service = get(VirtualNetworkService.class);

        Set<VirtualDevice> virtualDevices = service.getVirtualDevices(NetworkId.networkId(networkId));

        for (VirtualDevice virtualDevice : virtualDevices) {
            if (virtualDevice.id().equals(aDeviceId)) {
                return virtualDevice;
            }
        }
        return null;
    }
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Linq;

namespace Xamarin.Payments.Stripe {
    public class StripeEvent : StripeId {
        [JsonProperty (PropertyName = "livemode")]
        public bool LiveMode { get; set; }

        [JsonProperty (PropertyName = "created")]
        [JsonConverter (typeof (UnixDateTimeConverter))]
        public DateTime? Created { get; set; }

        [JsonProperty (PropertyName = "type")]
        public string Type { get; set; }

        [JsonProperty (PropertyName= "data")]
        public EventData Data { get; set; }

        public class EventData {
            [JsonProperty (PropertyName = "object")]
            [JsonConverter (typeof (StripeObjectConverter))]
            public StripeObject Object { get; set; }

            [JsonProperty (PropertyName = "previous_attributes")]
            public JObject PreviousAttributes { get; set; }
        }
    }
}

redpajama_set_name: RedPajamaGithub


text:
<!doctype html>

    <title>Code coverage report for api/middlewares/validator.js</title>
    <meta charset="utf-8" />
    <link rel="stylesheet" href="../../prettify.css" />
    <link rel="stylesheet" href="../../base.css" />
    <meta name="viewport" content="width=device-width, initial-scale=1">

      All files / api/middlewares validator.js

        88.24%
        Statements
        15/17

        75%
        Branches
        3/4

        83.33%
        Functions
        5/6

        93.33%
        Lines
        14/15

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33

20x
47x

20x
20x
11x

11x

4x

2x
6x

2x
2x

2x

2x

1x

function requireFields(...fields) {
  function wrapped(req, res, next) {
    for (let field of fields) {
      req.checkBody(field, field + " is missing.").notEmpty();
    }
    const errors = req.validationErrors();
    if (errors) {
      return res.status(400).json({error: errors.map(err => err.msg)});
    }
    next();
  }
  return wrapped;
}

function requireQuery(...queries) {
  function wrapped(req, res, next) {
    for (const query of queries) {
      req.checkQuery(query, `${query} is missing.`).notEmpty();
    }
    const errors = req.validationErrors();
    Iif (errors) {
      return res.status(400).json({error: errors.map(err => err.msg)});
    }
    next();
  }
  return wrapped;
}

module.exports = {
  requireFields,
  requireQuery
}

  Code coverage
  generated by istanbul at Thu Nov 30 2017 16:54:37 GMT+0100 (CET)


text:
package uk.co.blackpepper.support.retrofit.jsoup.spring;

import org.jsoup.nodes.Element;

import com.google.common.base.Function;

/**
 * Factory for functions that convert from HTML to string.
 *
 * @see AbstractBeanHtmlConverter#setProperty(String, Function, String)
 */
public final class FromBody {

	private FromBody() {
		throw new AssertionError();
	}

	public static Function<Element, String> textById(final String id) {
		return new Function<Element, String>() {
			@Override
			public String apply(Element element) {
				Element propertyElement = element.getElementById(id);
				return (propertyElement == null) ? null : propertyElement.text();
			}
		};
	}

	public static Function<Element, String> textByClass(final String className) {
		return new Function<Element, String>() {
			@Override
			public String apply(Element element) {
				Element propertyElement = element.getElementsByClass(className).first();
				return (propertyElement == null) ? null : propertyElement.text();
			}
		};
	}

	public static Function<Element, String> attributeById(final String id, final String attributeName) {
		return new Function<Element, String>() {
			@Override
			public String apply(Element element) {
				Element propertyElement = element.getElementById(id);
				return (propertyElement == null) ? null : propertyElement.attr(attributeName);
			}
		};
	}

	public static Function<Element, String> attributeByClass(final String className, final String attributeName) {
		return new Function<Element, String>() {
			@Override
			public String apply(Element element) {
				Element propertyElement = element.getElementsByClass(className).first();
				return (propertyElement == null) ? null : propertyElement.attr(attributeName);
			}
		};
	}
}


text:
Copyright © 2010 Chromium Authors
Generated on $datetime
Doxygen $doxygenversion

QT Chromium


text:
                <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
                    Toggle navigation

                </button>
                <a class="navbar-brand" href="<?php echo base_url('index.php');?>">

<a href="<?php echo base_url('index.php/main_controller');?>">Cesty

<a href="<?php echo base_url('index.php/controller_taxikar');?>">Taxikári (current)

<a href="<?php echo base_url('index.php/controller_sluzba');?>">Služby (current)

<a href="<?php echo base_url('index.php/controller_auto');?>">Autá (current)

<a href="<?php echo base_url('index.php/about');?>">About

                        Dropdown

<a href="<?php echo base_url('index.php/main_controller');?>">Cesty

<a href="<?php echo base_url('index.php/controller_taxikar');?>">Taxikári

<a href="<?php echo base_url('index.php/controller_sluzba');?>">Služby

<a href="<?php echo base_url('index.php/controller_auto');?>">Autá

<a href="<?php echo base_url('index.php/about');?>">About


text:
package teetime.stage.io;

import java.io.File;
import java.io.FileFilter;
import java.util.Arrays;
import java.util.Comparator;

import teetime.stage.basic.AbstractFilter;

public final class Directory2FilesFilter extends AbstractFilter<File> {

	private FileFilter filter;
	private Comparator<File> fileComparator;

	/**
	 *
	 * @param fileFilter
	 *            to emit only files matching the filter.
	 */
	public Directory2FilesFilter(final FileFilter fileFilter) {
		this.setFilter(fileFilter);
	}

	/**
	 * @param fileComparator
	 *            to sort the files before emitting each one by one.
	 */
	public Directory2FilesFilter(final Comparator<File> fileComparator) {
		this.setFileComparator(fileComparator);
	}

	/**
	 *
	 * @param fileFilter
	 *            to emit only files matching the filter.
	 * @param fileComparator
	 *            to sort the files before emitting each one by one.
	 */
	public Directory2FilesFilter(final FileFilter fileFilter, final Comparator<File> fileComparator) {
		this.setFilter(fileFilter);
		this.setFileComparator(fileComparator);
	}

	public Directory2FilesFilter() {
		super();
	}

	@Override
	protected void execute(final File inputDir) {
		final File[] inputFiles = inputDir.listFiles(this.filter);

		if (inputFiles == null) {
			this.logger.error("Directory '" + inputDir + "' does not exist or an I/O error occured.");
			return;
		}

		if (this.fileComparator != null) {
			Arrays.sort(inputFiles, this.fileComparator);
		}

		for (final File file : inputFiles) {
			this.outputPort.send(file);
		}
	}

	public FileFilter getFilter() {
		return this.filter;
	}

	public void setFilter(final FileFilter filter) {
		this.filter = filter;
	}

	public Comparator<File> getFileComparator() {
		return this.fileComparator;
	}

	public void setFileComparator(final Comparator<File> fileComparator) {
		this.fileComparator = fileComparator;
	}

}


text:
package org.opentele.server.provider.integration.cpr.stamdatalookup.generated;

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

/**
 *
Java class for SimpleCPRPersonType complex type.
 *
 *
The following schema fragment specifies the expected content contained within this class.
 *
 *

 * <complexType name="SimpleCPRPersonType">
 *   <complexContent>
 *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 *       <sequence>
 *         <element ref="{http://rep.oio.dk/itst.dk/xml/schemas/2006/01/17/}PersonNameStructure"/>
 *         <element ref="{http://rep.oio.dk/cpr.dk/xml/schemas/core/2005/03/18/}PersonCivilRegistrationIdentifier"/>
 *       </sequence>
 *     </restriction>
 *   </complexContent>
 * </complexType>
 *

 *
 *
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "SimpleCPRPersonType", namespace = "http://rep.oio.dk/cpr.dk/xml/schemas/core/2006/01/17/", propOrder = {
    "personNameStructure",
    "personCivilRegistrationIdentifier"
})
public class SimpleCPRPersonType {

    @XmlElement(name = "PersonNameStructure", namespace = "http://rep.oio.dk/itst.dk/xml/schemas/2006/01/17/", required = true)
    protected PersonNameStructureType personNameStructure;
    @XmlElement(name = "PersonCivilRegistrationIdentifier", namespace = "http://rep.oio.dk/cpr.dk/xml/schemas/core/2005/03/18/", required = true)
    protected String personCivilRegistrationIdentifier;

    /**
     * Gets the value of the personNameStructure property.
     *
     * @return
     *     possible object is
     *     {@link PersonNameStructureType }
     *
     */
    public PersonNameStructureType getPersonNameStructure() {
        return personNameStructure;
    }

    /**
     * Sets the value of the personNameStructure property.
     *
     * @param value
     *     allowed object is
     *     {@link PersonNameStructureType }
     *
     */
    public void setPersonNameStructure(PersonNameStructureType value) {
        this.personNameStructure = value;
    }

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

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

}


text:
from openerp.tests.common import TransactionCase
from openerp.exceptions import ValidationError

class GlobalTestOpenAcademySession(TransactionCase):
    '''
    Test Model Session
    '''

    def setUp(self):
        super(GlobalTestOpenAcademySession, self).setUp()
        self.session = self.env['openacademy.session']
        self.partner_vauxoo = self.env.ref('base.res_partner_23')
        self.course = self.env.ref('openacademy.course1')
        self.partner_attende = self.env.ref('base.res_partner_5')

    def test_10_instructor_is_attende(self):
        '''
        Check _check_instructor_not_in_attendees constrains
        '''
        with self.assertRaisesRegexp(
                ValidationError,
                "A session's instructor can't be an attendee"
        ):
            self.session.create({
                'name': 'Session test 1',
                'seats': 1,
                'instructor_id': self.partner_vauxoo.id,
                'attendee_ids': [(6, 0, [self.partner_vauxoo.id])],
                'course_id': self.course.id,
            })

    def test_20_wkf_done(self):
        '''
        Check the workflow
        '''
        session_test = self.session.create({
            'name': 'Session test 1',
            'seats': 2,
            'instructor_id': self.partner_vauxoo.id,
            'attendee_ids': [(6, 0, [self.partner_attende.id])],
            'course_id': self.course.id,
        })

        # Check draft state
        self.assertEqual(session_test.state, 'draft',
                         'Initial state should be in "draft"')

        # Change confirmed state
        session_test.signal_workflow('confirm')
        self.assertEqual(session_test.state, 'confirmed',
                         "Signal confirm don't work fine!")

        # Change done state
        session_test.signal_workflow('done')
        self.assertEqual(session_test.state, 'done',
                         "Signal done don't work fine!")


text:
/*
 * StaticDeclarations.h
 *
 *  Created on: 17.10.2016
 *      Author: Stefan
 */

#ifndef GLOBALDECLARATIONS_H_
#define GLOBALDECLARATIONS_H_
#include <map>
#include <set>

#include "../../Black_Jack_lib/src/Console.h"
// constexpr because all values are known at compile time
constexpr auto MIN_WAGER = 1.0;
constexpr auto MAX_WAGER = 500.0;
constexpr std::size_t MAX_SETS = 8;
constexpr std::size_t MAX_PLAYERS = 8;
constexpr auto MIN_INIT_BALANCE = 1.0;
constexpr auto MAX_INIT_BALANCE = 100000.0;
constexpr std::string::size_type MAX_CHARS = 20 ;

const std::set<std::string> SUIT{"h","d","c","s"};
// Face is a map, to make assigning the value to a card easy.
const std::map<std::string, unsigned int> FACE = {{"2", 2}, {"3", 3}, {"4", 4}, {"5", 5}, {"6", 6}, {"7", 7}, {"8", 8}, {"9", 9}, {"T", 10}, {"J", 10}, {"Q", 10}, {"K", 10}, {"A", 11}};

// The actions of a player are identified by a string.
static const std::string HIT = "h";
static const std::string DOUBLE = "d";
static const std::string SPLIT = "p";
static const std::string STAND = "s";

const std::set<std::string> ACTION_SPLIT_DOUBLE{HIT,STAND,DOUBLE, SPLIT};
const std::set<std::string> ACTION_DOUBLE{HIT,STAND, DOUBLE};
const std::set<std::string> ACTION_STANDARD{HIT,STAND};

static Console console(std::cout, std::cin);

#endif


text:
<?php

namespace Dive\TestSuite;

use Dive\Connection\Connection;
use Dive\Connection\Driver\DriverInterface;
use Dive\Platform\PlatformInterface;
use Dive\Schema\Migration\Migration;
use Dive\Schema\Migration\MigrationInterface;
use Dive\Schema\Schema;

/**
 * @author Steffen Zeidler <sigma_z@sigma-scripts.de>
 * Date: 08.12.12
 */
class DbInit
{

    /**
     * @var Connection
     */
    private $conn;
    /**
     * @var Schema
     */
    private $schema;

    /**
     * @param Connection $conn
     * @param Schema     $schema
     */
    public function __construct(Connection $conn, Schema $schema)
    {
        $this->conn = $conn;
        $this->schema = $schema;
    }

    public function init()
    {
        $this->conn->getEventDispatcher()->addListener(Connection::EVENT_POST_CONNECT, array($this, 'initSchema'));
    }

    public function initSchema()
    {
        $driver = $this->conn->getDriver();

        // (re)create tables
        $tableNames = $this->schema->getTableNames();
        $this->conn->disableForeignKeys();
        foreach ($tableNames as $tableName) {
            $this->dropTable($driver, $tableName);
            $this->createTable($driver, $tableName);
        }
        $this->conn->enableForeignKeys();

        // (re)create views
        $viewNames = $this->schema->getViewNames();
        $platform = $driver->getPlatform();
        foreach ($viewNames as $viewName) {
            $this->dropView($platform, $viewName);
            $this->createView($platform, $viewName);
        }
    }

    /**
     * drop table
     *
     * @param DriverInterface $driver
     * @param string          $tableName
     */
    private function dropTable(DriverInterface $driver, $tableName)
    {
        $driver->createSchemaMigration($this->conn, $tableName, MigrationInterface::DROP_TABLE)->execute();
    }

    /**
     * (re)create table
     *
     * @param DriverInterface $driver
     * @param string          $tableName
     */
    private function createTable(DriverInterface $driver, $tableName)
    {
        /** @var $createMigration Migration */
        $createMigration = $driver->createSchemaMigration($this->conn, $tableName, MigrationInterface::CREATE_TABLE);
        $createMigration->importFromSchema($this->schema);
        if ($this->conn->getScheme() === 'mysql') {
            // TODO tableOptions should be defined by Schema
            $createMigration->setTableOption('engine', 'InnoDB');
            $createMigration->setTableOption('collation', 'utf8_unicode_ci');
        }
        $createMigration->execute();
    }

    /**
     * drop view
     *
     * @param PlatformInterface $platform
     * @param string            $viewName
     */
    private function dropView(PlatformInterface $platform, $viewName)
    {
        $sql = $platform->getDropViewSql($viewName);
        $this->conn->exec($sql);
    }

    /**
     * (re)create view
     *
     * @param PlatformInterface $platform
     * @param string            $viewName
     */
    private function createView(PlatformInterface $platform, $viewName)
    {
        $sqlStatement = $this->schema->getViewStatement($viewName);
        $sql = $platform->getCreateViewSql($viewName, $sqlStatement);
        $this->conn->exec($sql);
    }

}


text:
package org.apache.thrift.transport;

public class TestTFastFramedTransport extends TestTFramedTransport {
  @Override
  protected TTransport getTransport(TTransport underlying) {
    return new TFastFramedTransport(underlying, 50, 10 * 1024 * 1024);
  }

  @Override
  protected TTransport getTransport(TTransport underlying, int maxLength) {
    return new TFastFramedTransport(underlying, 50, maxLength);
  }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE book
  PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
<book>

  <bookinfo>
    <title>Roundtrip Parameter Reference</title>
    <releaseinfo role="meta">
      $Id: param.xweb 6510 2007-01-18 02:54:56Z xmldoc $
    </releaseinfo>
    <author>
      <surname>Ball</surname>
      <firstname>Steve</firstname>
    </author>
    <copyright>
      <year>2005</year>
      <year>2004</year>
      <holder>Steve Ball</holder>
    </copyright>
    <abstract>
      <para>This is reference documentation for all user-configurable
      parameters in the DocBook "Roundtrip" Stylesheets (for
      transforming DocBook to WordML, OpenDocument, and Apple Pages,
      and for converting from those formats back to DocBook).</para>
    </abstract>
  </bookinfo>

  <reference id="params">
  <title>Parameters</title>
<refentry id="wordml.template">
<refmeta>
<refentrytitle>wordml.template</refentrytitle>
</refmeta>
<refnamediv>
<refname>wordml.template</refname>
<refpurpose>Specify the template WordML document</refpurpose>
</refnamediv>

<refsynopsisdiv>
<programlisting id="wordml.template.frag">
<xsl:param name="wordml.template" select="''"></xsl:param>
</programlisting>
</refsynopsisdiv>

<refsect1><title>Description</title>

<para>The <parameter>wordml.template</parameter> parameter specifies a WordML document to use as a template for the generated document.  The template document is used to define the (extensive) headers for the generated document, in particular the paragraph and character styles that are used to format the various elements.  Any content in the template document is ignored.</para>

<para>A template document is used in order to allow maintenance of the paragraph and character styles to be done using Word itself, rather than these XSL stylesheets.</para>

</refsect1>
</refentry>

<refentry id="pages.template">
<refmeta>
<refentrytitle>pages.template</refentrytitle>
</refmeta>
<refnamediv>
<refname>pages.template</refname>
<refpurpose>Specify the template Pages document</refpurpose>
</refnamediv>

<refsynopsisdiv>
<programlisting id="pages.template.frag">
<xsl:param name="pages.template" select="''"></xsl:param>
</programlisting>
</refsynopsisdiv>

<refsect1><title>Description</title>

<para>The <parameter>pages.template</parameter> parameter specifies a Pages (the Apple word processing application) document to use as a template for the generated document.  The template document is used to define the (extensive) headers for the generated document, in particular the paragraph and character styles that are used to format the various elements.  Any content in the template document is ignored.</para>

<para>A template document is used in order to allow maintenance of the paragraph and character styles to be done using Pages itself, rather than these XSL stylesheets.</para>

</refsect1>
</refentry>

  </reference>
  <appendix id="stylesheet">
    <title>The Stylesheet</title>

    <para>The <filename>param.xsl</filename> stylesheet is just a wrapper around all of these parameters.</para>

    <programlisting id="top">
<xsl:stylesheet exclude-result-prefixes="src" version="1.0">

<!-- This file is generated from param.xweb; do not edit this file! -->

<!-- ********************************************************************
     $Id: param.xweb 6510 2007-01-18 02:54:56Z xmldoc $
     ********************************************************************

     This file is part of the XSL DocBook Stylesheet distribution.
     See ../README or http://nwalsh.com/docbook/xsl/ for copyright
     and other information.

     ******************************************************************** -->

<src:fragref linkend="wordml.template.frag"></src:fragref>
<src:fragref linkend="pages.template.frag"></src:fragref>
</xsl:stylesheet>
    </programlisting>

  </appendix>
</book>


text:
namespace Rewtek.GameLibrary.Rendering
{
    public interface IDrawable
    {
        void Draw();
    }
}


text:
package com.esri;

import com.esri.arcgis.geodatabase.FeatureClass;
import com.esri.arcgis.geodatabase.IFeature;
import com.esri.arcgis.geodatabase.IFeatureClass;
import com.esri.arcgis.geodatabase.IFeatureClassProxy;
import com.esri.arcgis.geodatabase.IFeatureCursor;
import com.esri.arcgis.geodatabase.IFields;
import com.esri.arcgis.geodatabase.IGPMessages;
import com.esri.arcgis.geodatabase.IGPValue;
import com.esri.arcgis.geometry.IGeometry;
import com.esri.arcgis.geometry.Point;
import com.esri.arcgis.geometry.Polygon;
import com.esri.arcgis.geometry.Polyline;
import com.esri.arcgis.geoprocessing.IGPEnvironmentManager;
import com.esri.arcgis.interop.AutomationException;
import com.esri.arcgis.interop.Cleaner;
import com.esri.arcgis.system.Array;
import com.esri.arcgis.system.IArray;
import org.apache.avro.Schema;
import org.apache.avro.file.DataFileWriter;
import org.apache.avro.generic.GenericData;
import org.apache.avro.generic.GenericDatumWriter;
import org.apache.avro.generic.GenericRecord;
import org.apache.avro.io.DatumWriter;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FSDataInputStream;
import org.apache.hadoop.fs.FSDataOutputStream;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.security.UserGroupInformation;

import java.io.IOException;
import java.security.PrivilegedExceptionAction;

/**
 */
public final class ExportToGenericAvroTool extends AbstractTool
{
    private static final long serialVersionUID = 6206775842012442573L;

    public static final String NAME = ExportToGenericAvroTool.class.getSimpleName();

    @Override
    protected void doExecute(
            final IArray parameters,
            final IGPMessages messages,
            final IGPEnvironmentManager environmentManager) throws Exception
    {
        final IGPValue hadoopConfValue = gpUtilities.unpackGPValue(parameters.getElement(0));
        final IGPValue hadoopUserValue = gpUtilities.unpackGPValue(parameters.getElement(1));
        final IGPValue featureClassValue = gpUtilities.unpackGPValue(parameters.getElement(2));
        final IGPValue schemaValue = gpUtilities.unpackGPValue(parameters.getElement(3));
        final IGPValue outputValue = gpUtilities.unpackGPValue(parameters.getElement(4));

        final UserGroupInformation ugi = UserGroupInformation.createRemoteUser(hadoopUserValue.getAsText());
        final int count = ugi.doAs(new PrivilegedExceptionAction<Integer>()
        {
            public Integer run() throws Exception
            {
                return doExport(hadoopConfValue, featureClassValue, schemaValue, outputValue);
            }
        });
        messages.addMessage(String.format("Exported %d features.", count));
    }

    private int doExport(
            final IGPValue hadoopPropValue,
            final IGPValue featureClassValue,
            final IGPValue schemaValue,
            final IGPValue outputValue) throws Exception
    {
        int count = 0;
        final IFeatureClass[] featureClasses = new IFeatureClass[]{new IFeatureClassProxy()};
        gpUtilities.decodeFeatureLayer(featureClassValue, featureClasses, null);
        final FeatureClass featureClass = new FeatureClass(featureClasses[0]);

        final int wkid = getWkid(featureClass);

        final Configuration configuration = createConfiguration(hadoopPropValue.getAsText());

        final Schema schema = parseSchema(schemaValue.getAsText(), configuration);

        final Path path = new Path(outputValue.getAsText());
        final FileSystem fileSystem = path.getFileSystem(configuration);
        try
        {
            final FSDataOutputStream fsDataOutputStream = fileSystem.create(path, true);
            try
            {
                final DatumWriter<GenericRecord> datumWriter = new GenericDatumWriter<GenericRecord>(schema);
                final DataFileWriter<GenericRecord> dataFileWriter = new DataFileWriter<GenericRecord>(datumWriter);
                dataFileWriter.create(schema, fsDataOutputStream);
                try
                {
                    final IFeatureCursor cursor = featureClass.search(null, false);
                    try
                    {
                        final IFields fields = cursor.getFields();
                        IFeature feature = cursor.nextFeature();
                        try
                        {
                            while (feature != null)
                            {
                                final IGeometry shape = feature.getShape();
                                if (shape instanceof Point)
                                {
                                    dataFileWriter.append(buildRecord(schema, wkid, fields, feature, (Point) shape));
                                    count++;
                                }
                                else if (shape instanceof Polyline)
                                {
                                    dataFileWriter.append(buildRecord(schema, wkid, fields, feature, (Polyline) shape));
                                    count++;
                                }
                                else if (shape instanceof Polygon)
                                {
                                    dataFileWriter.append(buildRecord(schema, wkid, fields, feature, (Polygon) shape));
                                    count++;
                                }
                                feature = cursor.nextFeature();
                            }
                        }
                        finally
                        {
                            Cleaner.release(fields);
                        }
                    }
                    finally
                    {
                        Cleaner.release(cursor);
                    }
                }
                finally
                {
                    dataFileWriter.close();
                }
            }
            finally
            {
                fsDataOutputStream.close();
            }
        }
        finally
        {
            fileSystem.close();
        }
        Cleaner.release(featureClass);
        return count;
    }

    private GenericRecord buildRecord(
            final Schema schema,
            final int wkid,
            final IFields fields,
            final IFeature feature,
            final Polygon shape)
    {
        // TODO
        return null;
    }

    private GenericRecord buildRecord(
            final Schema schema,
            final int wkid,
            final IFields fields,
            final IFeature feature,
            final Polyline shape)
    {
        // TODO
        return null;
    }

    private GenericRecord buildRecord(
            final Schema schema,
            final int wkid,
            final IFields fields,
            final IFeature feature,
            final Point shape) throws IOException
    {
        final GenericRecord genericRecord = new GenericData.Record(schema);
        for (final Schema.Field schemaField : schema.getFields())
        {
            final int index = fields.findField(schemaField.name());
            if (index > -1)
            {
                genericRecord.put(schemaField.name(), feature.getValue(index));
            }
        }

        final Schema.Field geometryField = schema.getField("geometry");
        final Schema geometrySchema = geometryField.schema();
        final GenericRecord geometry = new GenericData.Record(geometrySchema);
        genericRecord.put("geometry", geometry);

        final Schema.Field spatialReferenceField = geometrySchema.getField("spatialReference");
        final GenericRecord spatialReference = new GenericData.Record(spatialReferenceField.schema());
        spatialReference.put("wkid", wkid);
        geometry.put("spatialReference", spatialReference);

        final Schema.Field coordField = geometrySchema.getField("coord");
        final GenericRecord coord = new GenericData.Record(coordField.schema());
        coord.put("x", shape.getX());
        coord.put("y", shape.getY());
        geometry.put("coord", coord);

        return genericRecord;
    }

    private Schema parseSchema(
            final String location,
            final Configuration configuration) throws IOException
    {
        final Schema schema;
        final Path path = new Path(location);
        final FileSystem fileSystem = path.getFileSystem(configuration);
        try
        {
            final FSDataInputStream dataInputStream = fileSystem.open(path);
            try
            {
                schema = new Schema.Parser().parse(dataInputStream);
            }
            finally
            {
                dataInputStream.close();
            }
        }
        finally
        {
            fileSystem.close();
        }
        return schema;
    }

    @Override
    public IArray getParameterInfo() throws IOException, AutomationException
    {
        final String username = "cloudera"; // System.getProperty("user.name");

        final IArray parameters = new Array();

        addParamHadoopProperties(parameters);
        addParamHadoopUser(parameters, username);
        addParamFeatureLayer(parameters);
        addParamString(parameters, "Input schema", "in_schema", "/user/" + username + "/features.avsc");
        addParamString(parameters, "Remote output path", "in_output_path", "/user/" + username + "/features.avro");

        return parameters;
    }

    @Override
    public String getName() throws IOException, AutomationException
    {
        return NAME;
    }

    @Override
    public String getDisplayName() throws IOException, AutomationException
    {
        return NAME;
    }
}


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

  <style name="BaseTheme.V14" parent="android:Theme.Holo.Light.NoActionBar" />

  <style name="AppTheme" parent="BaseTheme.V14"></style>
</resources>


text:
package seph.lang;

/**
 * @author Ola Bini
 */
public class Runtime_nil {
    public final static SephObject instance = Runtime.NIL;
}// Runtime_nil


text:
    <java-class-file name="D:\Experiments\Analisi di Sopravvivenza\Progetto16715\ProgettiDaAnalizzare\jhotdraw\JHotDraw 7.4.1\JHotDraw 7.4.1\Source\jhotdraw7\src\main\java\org\jhotdraw\gui\plaf\palette\PaletteFontChooserPreviewPanel.java">
        <package-decl name="org.jhotdraw.gui.plaf.palette"/>
        <class name="PaletteFontChooserPreviewPanel" visibility="public">
            <constructor visibility="public" name="PaletteFontChooserPreviewPanel">
            </constructor>
            <method name="setSelectedFont" visibility="public">
            </method>
            <method name="beautifyName" visibility="private">
            </method>
            <method name="initComponents" visibility="private">
            </method>
        </class>
    </java-class-file>


text:
require "recurrence/namespace"

# The default namespace. If you already have Recurrence constant set on your codebase,
# you can inherit from SimplesIdeias::Recurrence and have your own namespace.
#
#   require "recurrence/namespace"
#
#   class RecurrentEvent < SimplesIdeias::Recurrence
#   end
#
#   r = RecurrentEvent.new(:every => :day)
#
# Remember require <tt>recurrence/namespace</tt> instead of just <tt>recurrence</tt>.
# If you're using Rails/Bundler or something like that, remember to override the
# <tt>:require</tt> option.
#
#   # Gemfile
#   source :rubygems
#   gem "recurrence", :require => "recurrence/namespace"
#
class Recurrence < SimplesIdeias::Recurrence
end


text:
namespace FreeImageAPI
{
	/// <summary>
	/// Color channels. Constants used in color manipulation routines.
	/// </summary>
	public enum FREE_IMAGE_COLOR_CHANNEL
	{
		/// <summary>
		/// Use red, green and blue channels
		/// </summary>
		FICC_RGB = 0,
		/// <summary>
		/// Use red channel
		/// </summary>
		FICC_RED = 1,
		/// <summary>
		/// Use green channel
		/// </summary>
		FICC_GREEN = 2,
		/// <summary>
		/// Use blue channel
		/// </summary>
		FICC_BLUE = 3,
		/// <summary>
		/// Use alpha channel
		/// </summary>
		FICC_ALPHA = 4,
		/// <summary>
		/// Use black channel
		/// </summary>
		FICC_BLACK = 5,
		/// <summary>
		/// Complex images: use real part
		/// </summary>
		FICC_REAL = 6,
		/// <summary>
		/// Complex images: use imaginary part
		/// </summary>
		FICC_IMAG = 7,
		/// <summary>
		/// Complex images: use magnitude
		/// </summary>
		FICC_MAG = 8,
		/// <summary>
		/// Complex images: use phase
		/// </summary>
		FICC_PHASE = 9
	}
}


text:
package main.java.engine.objects.detector;

import java.awt.geom.Point2D;
import java.util.List;

import main.java.engine.EnvironmentKnowledge;
import main.java.engine.objects.monster.Monster;

/**
 * Abstract super class designed specifically for
 * tower defense detectors.
 * Contains some common methods to avoid duplication
 *
 * @author Lawrence
 *
 */
public abstract class TDDetector implements TargetDetectorInterface{

	/**
	 * Returns the center of the object for targeting
	 *
	 * @param m object coordinate
	 * @return the center of the objects image according to the imageBBox
	 */
	protected Point2D centerCoordinate (Monster m) {
//		        return new Point2D.Double(m.getCurrentCoor().getX() + m.getImageBBoxConst().width / 2,
//		                                  m.getCurrentCoor().getY() + m.getImageBBoxConst().height / 2);
		return new Point2D.Double(m.getCurrentCoor().getX(),
				m.getCurrentCoor().getY());
	}

	/**
	 * Check whether the distance between target and object
	 * is smaller than distance passed in
	 * @param obj
	 * @param target
	 * @param distance
	 * @return true if the distance between target and object
	 * is smaller than distance passed in
	 */
	protected boolean isWithinDistance(Point2D obj, Point2D target, double distance) {
		return (obj.distance(target) < distance);
	}

}


text:
// Copyright 2006-2008 the V8 project authors. All rights reserved.
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
//     * Redistributions of source code must retain the above copyright
//       notice, this list of conditions and the following disclaimer.
//     * Redistributions in binary form must reproduce the above
//       copyright notice, this list of conditions and the following
//       disclaimer in the documentation and/or other materials provided
//       with the distribution.
//     * Neither the name of Google Inc. nor the names of its
//       contributors may be used to endorse or promote products derived
//       from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

// This is a JavaScript implementation of the Richards
// benchmark from:
//
//    http://www.cl.cam.ac.uk/~mr10/Bench.html
//
// The benchmark was originally implemented in BCPL by
// Martin Richards.

/**
 * The Richards benchmark simulates the task dispatcher of an
 * operating system.
 **/
function runRichards() {
  var scheduler = new Scheduler();
  scheduler.addIdleTask(ID_IDLE, 0, null, COUNT);

  var queue = new Packet(null, ID_WORKER, KIND_WORK);
  queue = new Packet(queue,  ID_WORKER, KIND_WORK);
  scheduler.addWorkerTask(ID_WORKER, 1000, queue);

  queue = new Packet(null, ID_DEVICE_A, KIND_DEVICE);
  queue = new Packet(queue,  ID_DEVICE_A, KIND_DEVICE);
  queue = new Packet(queue,  ID_DEVICE_A, KIND_DEVICE);
  scheduler.addHandlerTask(ID_HANDLER_A, 2000, queue);

  queue = new Packet(null, ID_DEVICE_B, KIND_DEVICE);
  queue = new Packet(queue,  ID_DEVICE_B, KIND_DEVICE);
  queue = new Packet(queue,  ID_DEVICE_B, KIND_DEVICE);
  scheduler.addHandlerTask(ID_HANDLER_B, 3000, queue);

  scheduler.addDeviceTask(ID_DEVICE_A, 4000, null);

  scheduler.addDeviceTask(ID_DEVICE_B, 5000, null);

  scheduler.schedule();

  if (scheduler.queueCount != EXPECTED_QUEUE_COUNT ||
      scheduler.holdCount != EXPECTED_HOLD_COUNT) {
    var msg =
        "Error during execution: queueCount = " + scheduler.queueCount +
        ", holdCount = " + scheduler.holdCount + ".";
    throw new Error(msg);
  }
}

var COUNT = 1000;

/**
 * These two constants specify how many times a packet is queued and
 * how many times a task is put on hold in a correct run of richards.
 * They don't have any meaning a such but are characteristic of a
 * correct run so if the actual queue or hold count is different from
 * the expected there must be a bug in the implementation.
 **/
var EXPECTED_QUEUE_COUNT = 2322;
var EXPECTED_HOLD_COUNT = 928;

/**
 * A scheduler can be used to schedule a set of tasks based on their relative
 * priorities.  Scheduling is done by maintaining a list of task control blocks
 * which holds tasks and the data queue they are processing.
 * @constructor
 */
function Scheduler() {
  this.queueCount = 0;
  this.holdCount = 0;
  this.blocks = new Array(NUMBER_OF_IDS);
  this.list = null;
  this.currentTcb = null;
  this.currentId = null;
}

var ID_IDLE       = 0;
var ID_WORKER     = 1;
var ID_HANDLER_A  = 2;
var ID_HANDLER_B  = 3;
var ID_DEVICE_A   = 4;
var ID_DEVICE_B   = 5;
var NUMBER_OF_IDS = 6;

var KIND_DEVICE   = 0;
var KIND_WORK     = 1;

/**
 * Add an idle task to this scheduler.
 * @param {int} id the identity of the task
 * @param {int} priority the task's priority
 * @param {Packet} queue the queue of work to be processed by the task
 * @param {int} count the number of times to schedule the task
 */
Scheduler.prototype.addIdleTask = function (id, priority, queue, count) {
  this.addRunningTask(id, priority, queue, new IdleTask(this, 1, count));
};

/**
 * Add a work task to this scheduler.
 * @param {int} id the identity of the task
 * @param {int} priority the task's priority
 * @param {Packet} queue the queue of work to be processed by the task
 */
Scheduler.prototype.addWorkerTask = function (id, priority, queue) {
  this.addTask(id, priority, queue, new WorkerTask(this, ID_HANDLER_A, 0));
};

/**
 * Add a handler task to this scheduler.
 * @param {int} id the identity of the task
 * @param {int} priority the task's priority
 * @param {Packet} queue the queue of work to be processed by the task
 */
Scheduler.prototype.addHandlerTask = function (id, priority, queue) {
  this.addTask(id, priority, queue, new HandlerTask(this));
};

/**
 * Add a handler task to this scheduler.
 * @param {int} id the identity of the task
 * @param {int} priority the task's priority
 * @param {Packet} queue the queue of work to be processed by the task
 */
Scheduler.prototype.addDeviceTask = function (id, priority, queue) {
  this.addTask(id, priority, queue, new DeviceTask(this))
};

/**
 * Add the specified task and mark it as running.
 * @param {int} id the identity of the task
 * @param {int} priority the task's priority
 * @param {Packet} queue the queue of work to be processed by the task
 * @param {Task} task the task to add
 */
Scheduler.prototype.addRunningTask = function (id, priority, queue, task) {
  this.addTask(id, priority, queue, task);
  this.currentTcb.setRunning();
};

/**
 * Add the specified task to this scheduler.
 * @param {int} id the identity of the task
 * @param {int} priority the task's priority
 * @param {Packet} queue the queue of work to be processed by the task
 * @param {Task} task the task to add
 */
Scheduler.prototype.addTask = function (id, priority, queue, task) {
  this.currentTcb = new TaskControlBlock(this.list, id, priority, queue, task);
  this.list = this.currentTcb;
  this.blocks[id] = this.currentTcb;
};

/**
 * Execute the tasks managed by this scheduler.
 */
Scheduler.prototype.schedule = function () {
  this.currentTcb = this.list;
  while (this.currentTcb != null) {
    if (this.currentTcb.isHeldOrSuspended()) {
      this.currentTcb = this.currentTcb.link;
    } else {
      this.currentId = this.currentTcb.id;
      this.currentTcb = this.currentTcb.run();
    }
  }
};

/**
 * Release a task that is currently blocked and return the next block to run.
 * @param {int} id the id of the task to suspend
 */
Scheduler.prototype.release = function (id) {
  var tcb = this.blocks[id];
  if (tcb == null) return tcb;
  tcb.markAsNotHeld();
  if (tcb.priority > this.currentTcb.priority) {
    return tcb;
  } else {
    return this.currentTcb;
  }
};

/**
 * Block the currently executing task and return the next task control block
 * to run.  The blocked task will not be made runnable until it is explicitly
 * released, even if new work is added to it.
 */
Scheduler.prototype.holdCurrent = function () {
  this.holdCount++;
  this.currentTcb.markAsHeld();
  return this.currentTcb.link;
};

/**
 * Suspend the currently executing task and return the next task control block
 * to run.  If new work is added to the suspended task it will be made runnable.
 */
Scheduler.prototype.suspendCurrent = function () {
  this.currentTcb.markAsSuspended();
  return this.currentTcb;
};

/**
 * Add the specified packet to the end of the worklist used by the task
 * associated with the packet and make the task runnable if it is currently
 * suspended.
 * @param {Packet} packet the packet to add
 */
Scheduler.prototype.queue = function (packet) {
  var t = this.blocks[packet.id];
  if (t == null) return t;
  this.queueCount++;
  packet.link = null;
  packet.id = this.currentId;
  return t.checkPriorityAdd(this.currentTcb, packet);
};

/**
 * A task control block manages a task and the queue of work packages associated
 * with it.
 * @param {TaskControlBlock} link the preceding block in the linked block list
 * @param {int} id the id of this block
 * @param {int} priority the priority of this block
 * @param {Packet} queue the queue of packages to be processed by the task
 * @param {Task} task the task
 * @constructor
 */
function TaskControlBlock(link, id, priority, queue, task) {
  this.link = link;
  this.id = id;
  this.priority = priority;
  this.queue = queue;
  this.task = task;
  if (queue == null) {
    this.state = STATE_SUSPENDED;
  } else {
    this.state = STATE_SUSPENDED_RUNNABLE;
  }
}

/**
 * The task is running and is currently scheduled.
 */
var STATE_RUNNING = 0;

/**
 * The task has packets left to process.
 */
var STATE_RUNNABLE = 1;

/**
 * The task is not currently running.  The task is not blocked as such and may
* be started by the scheduler.
 */
var STATE_SUSPENDED = 2;

/**
 * The task is blocked and cannot be run until it is explicitly released.
 */
var STATE_HELD = 4;

var STATE_SUSPENDED_RUNNABLE = STATE_SUSPENDED | STATE_RUNNABLE;
var STATE_NOT_HELD = ~STATE_HELD;

TaskControlBlock.prototype.setRunning = function () {
  this.state = STATE_RUNNING;
};

TaskControlBlock.prototype.markAsNotHeld = function () {
  this.state = this.state & STATE_NOT_HELD;
};

TaskControlBlock.prototype.markAsHeld = function () {
  this.state = this.state | STATE_HELD;
};

TaskControlBlock.prototype.isHeldOrSuspended = function () {
  return (this.state & STATE_HELD) != 0 || (this.state == STATE_SUSPENDED);
};

TaskControlBlock.prototype.markAsSuspended = function () {
  this.state = this.state | STATE_SUSPENDED;
};

TaskControlBlock.prototype.markAsRunnable = function () {
  this.state = this.state | STATE_RUNNABLE;
};

/**
 * Runs this task, if it is ready to be run, and returns the next task to run.
 */
TaskControlBlock.prototype.run = function () {
  var packet;
  if (this.state == STATE_SUSPENDED_RUNNABLE) {
    packet = this.queue;
    this.queue = packet.link;
    if (this.queue == null) {
      this.state = STATE_RUNNING;
    } else {
      this.state = STATE_RUNNABLE;
    }
  } else {
    packet = null;
  }
  return this.task.run(packet);
};

/**
 * Adds a packet to the worklist of this block's task, marks this as runnable if
 * necessary, and returns the next runnable object to run (the one
 * with the highest priority).
 */
TaskControlBlock.prototype.checkPriorityAdd = function (task, packet) {
  if (this.queue == null) {
    this.queue = packet;
    this.markAsRunnable();
    if (this.priority > task.priority) return this;
  } else {
    this.queue = packet.addTo(this.queue);
  }
  return task;
};

TaskControlBlock.prototype.toString = function () {
  return "tcb { " + this.task + "@" + this.state + " }";
};

/**
 * An idle task doesn't do any work itself but cycles control between the two
 * device tasks.
 * @param {Scheduler} scheduler the scheduler that manages this task
 * @param {int} v1 a seed value that controls how the device tasks are scheduled
 * @param {int} count the number of times this task should be scheduled
 * @constructor
 */
function IdleTask(scheduler, v1, count) {
  this.scheduler = scheduler;
  this.v1 = v1;
  this.count = count;
}

IdleTask.prototype.run = function (packet) {
  this.count--;
  if (this.count == 0) return this.scheduler.holdCurrent();
  if ((this.v1 & 1) == 0) {
    this.v1 = this.v1 >> 1;
    return this.scheduler.release(ID_DEVICE_A);
  } else {
    this.v1 = (this.v1 >> 1) ^ 0xD008;
    return this.scheduler.release(ID_DEVICE_B);
  }
};

IdleTask.prototype.toString = function () {
  return "IdleTask"
};

/**
 * A task that suspends itself after each time it has been run to simulate
 * waiting for data from an external device.
 * @param {Scheduler} scheduler the scheduler that manages this task
 * @constructor
 */
function DeviceTask(scheduler) {
  this.scheduler = scheduler;
  this.v1 = null;
}

DeviceTask.prototype.run = function (packet) {
  if (packet == null) {
    if (this.v1 == null) return this.scheduler.suspendCurrent();
    var v = this.v1;
    this.v1 = null;
    return this.scheduler.queue(v);
  } else {
    this.v1 = packet;
    return this.scheduler.holdCurrent();
  }
};

DeviceTask.prototype.toString = function () {
  return "DeviceTask";
};

/**
 * A task that manipulates work packets.
 * @param {Scheduler} scheduler the scheduler that manages this task
 * @param {int} v1 a seed used to specify how work packets are manipulated
 * @param {int} v2 another seed used to specify how work packets are manipulated
 * @constructor
 */
function WorkerTask(scheduler, v1, v2) {
  this.scheduler = scheduler;
  this.v1 = v1;
  this.v2 = v2;
}

WorkerTask.prototype.run = function (packet) {
  if (packet == null) {
    return this.scheduler.suspendCurrent();
  } else {
    if (this.v1 == ID_HANDLER_A) {
      this.v1 = ID_HANDLER_B;
    } else {
      this.v1 = ID_HANDLER_A;
    }
    packet.id = this.v1;
    packet.a1 = 0;
    for (var i = 0; i < DATA_SIZE; i++) {
      this.v2++;
      if (this.v2 > 26) this.v2 = 1;
      packet.a2[i] = this.v2;
    }
    return this.scheduler.queue(packet);
  }
};

WorkerTask.prototype.toString = function () {
  return "WorkerTask";
};

/**
 * A task that manipulates work packets and then suspends itself.
 * @param {Scheduler} scheduler the scheduler that manages this task
 * @constructor
 */
function HandlerTask(scheduler) {
  this.scheduler = scheduler;
  this.v1 = null;
  this.v2 = null;
}

HandlerTask.prototype.run = function (packet) {
  if (packet != null) {
    if (packet.kind == KIND_WORK) {
      this.v1 = packet.addTo(this.v1);
    } else {
      this.v2 = packet.addTo(this.v2);
    }
  }
  if (this.v1 != null) {
    var count = this.v1.a1;
    var v;
    if (count < DATA_SIZE) {
      if (this.v2 != null) {
        v = this.v2;
        this.v2 = this.v2.link;
        v.a1 = this.v1.a2[count];
        this.v1.a1 = count + 1;
        return this.scheduler.queue(v);
      }
    } else {
      v = this.v1;
      this.v1 = this.v1.link;
      return this.scheduler.queue(v);
    }
  }
  return this.scheduler.suspendCurrent();
};

HandlerTask.prototype.toString = function () {
  return "HandlerTask";
};

/* --- *
 * P a c k e t
 * --- */

var DATA_SIZE = 4;

/**
 * A simple package of data that is manipulated by the tasks.  The exact layout
 * of the payload data carried by a packet is not importaint, and neither is the
 * nature of the work performed on packets by the tasks.
 *
 * Besides carrying data, packets form linked lists and are hence used both as
 * data and worklists.
 * @param {Packet} link the tail of the linked list of packets
 * @param {int} id an ID for this packet
 * @param {int} kind the type of this packet
 * @constructor
 */
function Packet(link, id, kind) {
  this.link = link;
  this.id = id;
  this.kind = kind;
  this.a1 = 0;
  this.a2 = new Array(DATA_SIZE);
}

/**
 * Add this packet to the end of a worklist, and return the worklist.
 * @param {Packet} queue the worklist to add this packet to
 */
Packet.prototype.addTo = function (queue) {
  this.link = null;
  if (queue == null) return this;
  var peek, next = queue;
  while ((peek = next.link) != null)
    next = peek;
  next.link = this;
  return queue;
};

Packet.prototype.toString = function () {
  return "Packet";
};

for (var i = 0; i < 350; ++i)
  runRichards();


text:
@interface ImageSizeViewController ()
@property (nonatomic, weak) IBOutlet UIButton *btn1;
@property (nonatomic, weak) IBOutlet UIButton *btn2;
@end

@implementation ImageSizeViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [_btn1 setImage:[UIImage imageWithImage:[UIImage imageNamed:@"ranking_list"] scaledToSize:CGSizeMake(24, 22)] forState:UIControlStateNormal];
    [_btn2 setImage:[UIImage imageWithImage:[UIImage imageNamed:@"ranking_list"] scaledToSize:CGSizeMake(12, 11)] forState:UIControlStateNormal];
}

@end


text:
package com.indeed.proctor.webapp.extensions;

/**
 * @author chrisc
 */
public interface CommitMessageDisplayFormatter {
    public String formatMessage(String commitMessage);
}


text:
namespace Delecs.BarzinPlatform.Infrastructure.Repository.Core
{
    /// <summary>
    /// Entity interface.
    /// </summary>
    /// <typeparam name="TPrimaryKey">Type of primary key of this entity.</typeparam>
    public interface IEntity<TPrimaryKey>
    {
        /// <summary>
        /// Unique Id.
        /// </summary>
        TPrimaryKey Id { get; set; }
    }
}


text:
@interface DetailViewController ()

@end

@implementation DetailViewController

- (id)initWithStyle:(UITableViewStyle)style
{
    self = [super initWithStyle:style];
    if (self) {
        // Custom initialization
        self.moreLoadEnabled = NO;
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];

    // 返信ボタン配置
	UIBarButtonItem *replyButton =
	[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemReply
												  target:self
												  action:@selector(replyButtonAction)];

    // スターボタン配置
	UIBarButtonItem *starButton =
    [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"star.png"]
                                     style:UIBarButtonItemStylePlain
                                    target:self
                                    action:@selector(starButtonAction)];

    self.navigationItem.rightBarButtonItems = @[replyButton, starButton];

    _haikuManager = [[HaikuManager alloc] init];
    _haikuManager.delegate = self;

    [self fetchStatusDetail];
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

#pragma mark - Private method

- (void)postButtonAction
{
    NSDictionary *option = @{@"in_reply_to_status_id": self.statusId,
                            @"in_reply_to": self.userName};
    [self postButtonActionWithOption:option];
}

- (void)replyButtonAction
{
    LOG_CURRENT_METHOD;

    if (![[AuthManager sharedManager] isAuthenticated])
    {
        UIAlertController *alertController = [UIAlertController alertControllerWithTitle:nil
                                                                                message:NO_LOGIN_MESSAGE
                                                                          preferredStyle:UIAlertControllerStyleAlert];
        [alertController addAction:[UIAlertAction actionWithTitle:CANCEL_BUTTON_TITLE
                                                            style:UIAlertActionStyleCancel
                                                          handler:nil]];
        [alertController addAction:[UIAlertAction actionWithTitle:LOGIN_BUTTON_TITLE
                                                            style:UIAlertActionStyleDefault
                                                          handler:^(UIAlertAction *action)
                                    {
                                        AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
                                        [appDelegate showLoginView];
                                    }]];
        [self presentViewController:alertController
                           animated:YES
                         completion:nil];
        return;
    }

    NSDictionary *status = (self.statuses)[0];
    NSString *statusId = status[@"id"];
    NSString *userName = status[@"user"][@"name"];
    NSString *html = [self generateHtmlFromStatus:status];
    NSString *profileImageUrl = status[@"user"][@"profile_image_url"];
    NSDictionary *option = @{@"in_reply_to_status_id": statusId,
                            @"in_reply_to": userName,
                            @"html": html,
                            @"profile_image_url": profileImageUrl};

    ReplyViewController *viewController = [[ReplyViewController alloc] initWithStyle:UITableViewStylePlain];
    viewController.option = option;
    UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:viewController];
    navigationController.toolbar.tintColor = THEME_COLOR;
    [self presentViewController:navigationController animated:YES completion:nil];
}

- (void)starButtonAction
{
    LOG_CURRENT_METHOD;

    // ログインされてない
    if (![[AuthManager sharedManager] isAuthenticated])
    {
        UIAlertController *alertController = [UIAlertController alertControllerWithTitle:nil
                                                                                message:NO_LOGIN_MESSAGE
                                                                          preferredStyle:UIAlertControllerStyleAlert];
        [alertController addAction:[UIAlertAction actionWithTitle:CANCEL_BUTTON_TITLE
                                                            style:UIAlertActionStyleCancel
                                                          handler:nil]];
        [alertController addAction:[UIAlertAction actionWithTitle:LOGIN_BUTTON_TITLE
                                                            style:UIAlertActionStyleDefault
                                                          handler:^(UIAlertAction *action)
                                    {
                                        AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
                                        [appDelegate showLoginView];
                                    }]];
        [self presentViewController:alertController
                           animated:YES
                         completion:nil];
        return;
    }

    [UIApplication sharedApplication].networkActivityIndicatorVisible = YES;
    [SVProgressHUD show];

    [_haikuManager createFavoritesWithStatusId:self.statusId];
}

- (void)refreshOccured:(id)sender
{
    LOG_CURRENT_METHOD;

    [self fetchStatusDetail];
}

// 投稿詳細を取得
- (void)fetchStatusDetail
{
    LOG_CURRENT_METHOD;

    [UIApplication sharedApplication].networkActivityIndicatorVisible = YES;
    [SVProgressHUD show];

    [_haikuManager fetchStatusDetailWithEid:self.statusId];
}

#pragma mark - HaikuManager delegate

- (void)haikuManager:(HaikuManager *)manager didFetchStatusDetailWithData:(NSData *)data error:(NSError *)error
{
    LOG_CURRENT_METHOD;

    [UIApplication sharedApplication].networkActivityIndicatorVisible = NO;
    [SVProgressHUD dismiss];

    [self.refreshControl endRefreshing];

    if (error == nil)
    {
        NSData *jsonData = data;

        // 結果取得
        NSDictionary *statusDic = [NSJSONSerialization JSONObjectWithData:jsonData options:0 error:nil];
        [self.statuses removeAllObjects];
        [self.statuses addObject:statusDic];
        self.replies = statusDic[@"replies"];

        self.title = statusDic[@"keyword"];
        self.userId = statusDic[@"user"][@"id"];
        self.userName = statusDic[@"user"][@"name"];

        [self.tableView reloadData];
    }
    else {
        UIAlertController *alertController =
        [UIAlertController alertControllerWithTitle:ERROR_TITLE
                                            message:FETCH_ERROR_MESSAGE
                                     preferredStyle:UIAlertControllerStyleAlert];
        [alertController addAction:[UIAlertAction actionWithTitle:OK_BUTTON_TITLE
                                                            style:UIAlertActionStyleCancel
                                                          handler:nil]];
        [self presentViewController:alertController
                           animated:YES
                         completion:nil];
        return;
    }
}

- (void)haikuManager:(HaikuManager *)manager didCreateFavoritesWithData:(NSData *)data error:(NSError *)error
{
    LOG_CURRENT_METHOD;
    LOG(@"data = %@", [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]);

    // トークン切れチェック
    NSString *response = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
    if ([response isEqualToString:@"oauth_problem=token_rejected"])
    {
        AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
        [appDelegate showLoginView];

        [UIApplication sharedApplication].networkActivityIndicatorVisible = NO;
        [SVProgressHUD showSuccessWithStatus:@"ログイン期限が切れました"];

        return;
    }

    if (error == nil)
    {
        [UIApplication sharedApplication].networkActivityIndicatorVisible = NO;
        [SVProgressHUD showSuccessWithStatus:@"スターをつけました"];

        // ちょっと時間開けないとサクセスメッセージが出ない
        [self performSelector:@selector(fetchStatusDetail) withObject:nil afterDelay:1.0];
    }
    else {
        LOG(@"error = %@", error);
        [UIApplication sharedApplication].networkActivityIndicatorVisible = NO;
        [SVProgressHUD showErrorWithStatus:@"スター追加に失敗しました"];
    }
}

#pragma mark - Table view data source

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
    // Return the number of sections.
    return 2;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    // Return the number of rows in the section.
    switch (section)
    {
        case 0:
            return [self.statuses count];
            break;

        case 1:
            return [self.replies count];
            break;

        default:
            break;
    }

    return 0;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    UITableViewCell *cell = [super tableView:tableView cellForRowAtIndexPath:indexPath];

    switch (indexPath.section)
    {
        case 0:
        {
            cell.accessoryType = UITableViewCellAccessoryNone;
            cell.selectionStyle = UITableViewCellSelectionStyleNone;
            break;
        }

        // 返信一覧
        case 1:
        {
            cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
            cell.selectionStyle = UITableViewCellSelectionStyleGray;
            break;
        }

        default:
            break;
    }

    return cell;
}

#pragma mark - Table view delegate

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    switch (indexPath.section)
    {
        case 0:
        {
            // なにもしない
            break;
        }

            // 返信一覧
        case 1:
        {
            [super tableView:tableView didSelectRowAtIndexPath:indexPath];
            break;
        }

        default:
            break;
    }
}

@end


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

 Copyright 2003 - 2014 The eFaps Team

 Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
 You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.

-->
<ui-command xmlns="http://www.efaps.org/xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.efaps.org/xsd http://www.efaps.org/xsd/eFaps_1.0.xsd">
    <uuid>981e4331-87a2-45fa-9460-76c84ded06f8</uuid>
    <file-application>eFapsApp-Assets</file-application>
    <definition>
        <version-expression>(version==latest)</version-expression>
        <name>Assets_AssetTree_Menu_Action_SetSold</name>
        <access>
            <role>Sales_Admin</role>
            <role>Sales_Accounting</role>
            <role>Sales_IncomingDocument</role>
        </access>
        <target>
            <execute method="setStatus" program="org.efaps.esjp.admin.datamodel.StatusValue">
                <property name="Status">Sold</property>
            </execute>
            <trigger event="UI_ACCESSCHECK" method="check4Status"
                name="Sales_InvoiceTree_Menu_Action_SetOpen.UI_ACCESSCHECK"
                program="org.efaps.esjp.admin.access.AccessCheck4UI">
                <property name="Status">Open</property>
            </trigger>
        </target>
        <property name="AskUser">true</property>
        <property name="Submit">true</property>
        <property name="SubmitSelectedRows">-1</property>
    </definition>
</ui-command>


text:
angular.module( 'mmUploader' ).factory( 'mmUpload', [function() {
	var upload = function(upload) {
		this.setId( upload );
		this.setName( upload );
		this.setFilename( upload );
		this.setFullFilename( upload );
		this.setExtension( upload );
		this.setFileWebSource( upload );
		this.setFileRealSource( upload );
		this.setThumbnailWebSource( upload );
		this.setThumbnailRealSource( upload );
		this.setX50( upload );
		this.setX100( upload );
		this.setX200( upload );
		this.setX300( upload );
		this.setX400( upload );
		this.setX500( upload );
		this.setX600( upload );
		this.setX700( upload );
		this.setX800( upload );
		this.setX900( upload );
		this.setX1000( upload );
		this.setCdn( upload );
		this.setFilesize( upload );
		this.setWidth( upload );
		this.setHeight( upload );
		this.setMime( upload );
		this.setCaption( upload );
		this.setAlt( upload );
		this.setDescription( upload );
		this.setCreated( upload );
		this.setLastModified( upload );
		this.setFolders( upload );

	};
	upload.prototype.setId = function(upload) { return this.id = upload.id || 0; };
	upload.prototype.setName = function(upload) { return this.name = upload.name || ''; };
	upload.prototype.setFilename = function(upload) { return this.filename = upload.filename || ''; };
	upload.prototype.setFullFilename = function(upload) { return this.full_filename = upload.full_filename || null; };
	upload.prototype.setExtension = function(upload) { return this.extension = upload.extension || null; };
	upload.prototype.setFileWebSource = function(upload) { return this.file_web_source = upload.file_web_source || null; };
	upload.prototype.setFileRealSource = function(upload) { return this.file_real_source = upload.file_real_source || null; };
	upload.prototype.setThumbnailWebSource = function(upload) { return this.thumbnail_web_source = upload.thumbnail_web_source || null; };
	upload.prototype.setThumbnailRealSource = function(upload) { return this.thumbnail_real_source = upload.thumbnail_real_source || null; };
	upload.prototype.setX50 = function(upload) { return this.x50 = upload.x50 || null; };
	upload.prototype.setX100 = function(upload) { return this.x100 = upload.x100 || null; };
	upload.prototype.setX200 = function(upload) { return this.x200 = upload.x200 || null; };
	upload.prototype.setX300 = function(upload) { return this.x300 = upload.x300 || null; };
	upload.prototype.setX400 = function(upload) { return this.x400 = upload.x400 || null; };
	upload.prototype.setX500 = function(upload) { return this.x500 = upload.x500 || null; };
	upload.prototype.setX600 = function(upload) { return this.x600 = upload.x600 || null; };
	upload.prototype.setX700 = function(upload) { return this.x700 = upload.x700 || null; };
	upload.prototype.setX800 = function(upload) { return this.x800 = upload.x800 || null; };
	upload.prototype.setX900 = function(upload) { return this.x900 = upload.x900 || null; };
	upload.prototype.setX1000 = function(upload) { return this.x1000 = upload.x1000 || null; };
	upload.prototype.setCdn = function(upload) { return this.cdn = upload.cdn || null; };
	upload.prototype.setFilesize = function(upload) { return this.filesize = upload.filesize || null; };
	upload.prototype.setWidth = function(upload) { return this.width = upload.width || null; };
	upload.prototype.setHeight = function(upload) { return this.height = upload.height || null; };
	upload.prototype.setMime = function(upload) { return this.mime = upload.mime || null; };
	upload.prototype.setCaption = function(upload) { return this.caption = upload.caption || null; };
	upload.prototype.setAlt = function(upload) { return this.alt = upload.alt || null; };
	upload.prototype.setDescription = function(upload) { return this.description = upload.description || null; };
	upload.prototype.setCreated = function(upload) { return this.created = upload.created || null; };
	upload.prototype.setLastModified = function(upload) { return this.last_modified = upload.last_modified || null; };
	upload.prototype.setFolders = function(upload) { return this.folders = upload.folders || null; };

	return upload;

},
] );


text:
class CreateTypes < ActiveRecord::Migration
  def change
    create_table :types do |t|
      t.string :name
      t.string :description

      t.timestamps
    end
  end
end


text:
Example of symfony2 app using rabbitmq for asynchronous tasks

# Installation

```bash
docker-compose build
docker-compose up -d
docker-compose run web bin/console rabbitmq:vhost:define # Create rabbitmq vhost
```

# Check installation

http://{localhost|docker-machine IP}:15672 should display rabbitmq admin interface (login with guest / guest)

http://{localhost|docker-machine IP}:8888 should display an upload form and images should be uploadables

<img width="819" alt="capture d ecran 2016-02-23 a 15 50 55" src="https://cloud.githubusercontent.com/assets/1516110/13255224/614dbb2a-da45-11e5-9aa8-02b9370db156.png">


text:
<dom-module id="grid-columns-demos">
  <template>

Column Grouping

      Columns can be grouped together with <vaadin-grid-column-group> elements.
      Grouped columns can have a common header and footer cells.

      Note: Remember to define explicit bounds for images in order to avoid glitches once an image has fully loaded.

      NOTE: You must explicitly import the vaadin-grid-column-group.html in order to use <vaadin-grid-column-group>.

    <vaadin-demo-snippet id='grid-columns-demos-column-grouping'>
      <template preserve-content>
        <dom-bind>
          <template is="dom-bind">

            <x-data-provider data-provider="{{dataProvider}}"></x-data-provider>

            <vaadin-grid aria-label="Column Grouping Example" data-provider="[[dataProvider]]" size="200">

              <vaadin-grid-column width="30px" flex-grow="0">
                <template class="header">#</template>
                <template>[[index]]</template>
              </vaadin-grid-column>

              <vaadin-grid-column width="50px" flex-grow="0">
                <template class="header">

                </template>
                <template>
                  <iron-image width="30" height="30" sizing="cover" alt="[[item.name.first]] [[item.name.last]]" src="[[item.picture.thumbnail]]"></iron-image>
                </template>
              </vaadin-grid-column>

              <vaadin-grid-column-group>
                <template class="header">Name</template>

                <vaadin-grid-column width="calc(25% - 20px)">
                  <template class="header">First</template>
                  <template>[[item.name.first]]</template>
                </vaadin-grid-column>

                <vaadin-grid-column width="calc(25% - 20px)">
                  <template class="header">Last</template>
                  <template>[[item.name.last]]</template>
                </vaadin-grid-column>
              </vaadin-grid-column-group>

              <vaadin-grid-column-group>
                <template class="header">Location</template>

                <vaadin-grid-column width="calc(25% - 20px)">
                  <template class="header">City</template>
                  <template>[[item.location.city]]</template>
                </vaadin-grid-column>

                <vaadin-grid-column width="calc(25% - 20px)">
                  <template class="header">State</template>
                  <template>[[item.location.state]]</template>
                </vaadin-grid-column>

                <vaadin-grid-column width="200px">
                  <template class="header">Street</template>
                  <template>
[[item.location.street]]
</template>
                </vaadin-grid-column>
              </vaadin-grid-column-group>

            </vaadin-grid>
          </template>
        </dom-bind>
      </template>
    </vaadin-demo-snippet>

Freezing Columns

      Applying frozen on a column will make it frozen. It can be
      also be applied to a column group to freeze all of its child columns.

      Note: Columns are frozen in-place, freeze columns from left to right
      for a consistent outcome.

    <vaadin-demo-snippet id='grid-columns-demos-freezing-columns'>
      <template preserve-content>
        <dom-bind>
          <template is="dom-bind">
            <x-data-provider data-provider="{{dataProvider}}"></x-data-provider>
            <paper-checkbox checked="{{frozen}}">Freeze First Two Columns</paper-checkbox>

            <vaadin-grid aria-label="Freezing Columns Example" data-provider="[[dataProvider]]" size="200">

              <vaadin-grid-column width="50px" flex-grow="0" frozen="[[frozen]]">
                <template class="header">#</template>
                <template>[[index]]</template>
              </vaadin-grid-column>

              <vaadin-grid-column width="50px" flex-grow="0" frozen="[[frozen]]">
                <template class="header">

                </template>
                <template>
                  <iron-image width="30" height="30" sizing="cover" alt="[[item.name.first]] [[item.name.last]]" src="[[item.picture.thumbnail]]"></iron-image>
                </template>
              </vaadin-grid-column>

              <vaadin-grid-column width="33%">
                <template class="header">First Name</template>
                <template>[[item.name.first]]</template>
              </vaadin-grid-column>

              <vaadin-grid-column width="33%">
                <template class="header">Last Name</template>
                <template>[[item.name.last]]</template>
              </vaadin-grid-column>

              <vaadin-grid-column width="33%">
                <template class="header">Email</template>
                <template>[[item.email]]</template>
              </vaadin-grid-column>

            </vaadin-grid>
          </template>
        </dom-bind>
      </template>
    </vaadin-demo-snippet>

Hiding Columns

      Applying hidden on a column or column group will hide it.

      Hint: Using hidden together with <iron-media-query>
      is an easy way to create a responsive grid.

    <vaadin-demo-snippet id='grid-columns-demos-hiding-columns'>
      <template preserve-content>
        <dom-bind>
          <template is="dom-bind">
            <x-data-provider data-provider="{{dataProvider}}"></x-data-provider>
            <paper-checkbox checked="{{hidden}}">Hide First Two Columns</paper-checkbox>
            <iron-media-query query-matches="{{hidden}}" query="(max-width: 700px)"></iron-media-query>

            <vaadin-grid aria-label="Hiding Columns Example" data-provider="[[dataProvider]]" size="200">

              <vaadin-grid-column width="50px" flex-grow="0" hidden="[[hidden]]">
                <template class="header">#</template>
                <template>[[index]]</template>
              </vaadin-grid-column>

              <vaadin-grid-column width="50px" flex-grow="0" hidden="[[hidden]]">
                <template class="header">

                </template>
                <template>
                  <iron-image width="30" height="30" sizing="cover" alt="[[item.name.first]] [[item.name.last]]" src="[[item.picture.thumbnail]]"></iron-image>
                </template>
              </vaadin-grid-column>

              <vaadin-grid-column width="33%">
                <template class="header">First Name</template>
                <template>[[item.name.first]]</template>
              </vaadin-grid-column>

              <vaadin-grid-column width="33%">
                <template class="header">Last Name</template>
                <template>[[item.name.last]]</template>
              </vaadin-grid-column>

              <vaadin-grid-column width="33%">
                <template class="header">Email</template>
                <template>[[item.email]]</template>
              </vaadin-grid-column>

            </vaadin-grid>
          </template>
        </dom-bind>
      </template>
    </vaadin-demo-snippet>

Reordering and Resizing Columns

      Applying column-reordering-allowed on the grid will make all
      columns reordeable.

      Applying resizable on a column will make it resizable.

      Note: When using column groups, columns can be reordered only within
      their parent group.

    <vaadin-demo-snippet id='grid-columns-demos-reordering-and-resizing-columns'>
      <template preserve-content>
        <dom-bind>
          <template is="dom-bind">
            <x-data-provider data-provider="{{dataProvider}}"></x-data-provider>

            <vaadin-grid aria-label="Reordering and Resizing Columns Example" data-provider="[[dataProvider]]" size="200" column-reordering-allowed>

              <vaadin-grid-column width="30px" flex-grow="0" resizable>
                <template class="header">#</template>
                <template>[[index]]</template>
              </vaadin-grid-column>

              <vaadin-grid-column width="50px" flex-grow="0" resizable>
                <template class="header">

                </template>
                <template>
                  <iron-image width="30" height="30" sizing="cover" alt="[[item.name.first]] [[item.name.last]]" src="[[item.picture.thumbnail]]"></iron-image>
                </template>
              </vaadin-grid-column>

              <vaadin-grid-column-group resizable>
                <template class="header">Name</template>

                <vaadin-grid-column width="calc(25% - 20px)">
                  <template class="header">First</template>
                  <template>[[item.name.first]]</template>
                </vaadin-grid-column>

                <vaadin-grid-column width="calc(25% - 20px)">
                  <template class="header">Last</template>
                  <template>[[item.name.last]]</template>
                </vaadin-grid-column>
              </vaadin-grid-column-group>

              <vaadin-grid-column-group resizable>
                <template class="header">Location</template>

                <vaadin-grid-column width="calc(25% - 20px)">
                  <template class="header">City</template>
                  <template>[[item.location.city]]</template>
                </vaadin-grid-column>

                <vaadin-grid-column width="calc(25% - 20px)">
                  <template class="header">State</template>
                  <template>[[item.location.state]]</template>
                </vaadin-grid-column>

                <vaadin-grid-column width="200px" resizable>
                  <template class="header">Street</template>
                  <template>[[item.location.street]]</template>
                </vaadin-grid-column>
              </vaadin-grid-column-group>

            </vaadin-grid>
          </template>
        </dom-bind>
      </template>
    </vaadin-demo-snippet>

Dynamic Columns using dom-repeat

    <vaadin-demo-snippet id='grid-columns-demos-dynamic-columns-using-dom-repeat'>
      <template preserve-content>
        <x-dynamic-columns></x-dynamic-columns>
        <dom-module id="x-dynamic-columns">
          <template preserve-content>
            <x-data-provider data-provider="{{dataProvider}}"></x-data-provider>
            <vaadin-grid aria-label="Dynamic Columns Example" id="grid" data-provider="[[dataProvider]]" size="200">
              <template is="dom-repeat" items="[[columns]]" as="column">

                <vaadin-grid-column>
                  <template class="header">[[column]]</template>
                  <template>[[get(column, item)]]</template>
                </vaadin-grid-column>
              </template>

            </vaadin-grid>
          </template>

        </dom-module>
      </template>
    </vaadin-demo-snippet>

  </template>

</dom-module>


text:
<!doctype html>

	<meta charset="utf-8" />
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
	<link rel="apple-touch-icon" sizes="76x76" href="assets/img/apple-icon.png" />
	<link rel="icon" type="image/png" href="assets/img/favicon.png" />
	<title>Paper Bootstrap Wizard by Creative Tim</title>

	<meta content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0' name='viewport' />
    <meta name="viewport" content="width=device-width" />

    <link href="assets/css/bootstrap.min.css" rel="stylesheet" />
	<link href="assets/css/paper-bootstrap-wizard.css" rel="stylesheet" />

	<link href="assets/css/demo.css" rel="stylesheet" />

    <link href="http://netdna.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.css" rel="stylesheet">
	<link href='https://fonts.googleapis.com/css?family=Muli:400,300' rel='stylesheet' type='text/css'>
	<link href="assets/css/themify-icons.css" rel="stylesheet">

	                Creative Tim

PK

Made with Paper Kit

		                    <form action="" method="">

Find your next desk

Book from thousands of unique work and meeting spaces.

												Details

												Timetable

												Description

 Let's start with the basic details

			                                        What city do you want to work in?
			                                        <input type="text" class="form-control" id="exampleInputEmail1" placeholder="e.g Silicon Valley">

			                                        Space
			                                        <select class="form-control">
			                                            <option disabled="" selected="">- choose a space -</option>
			                                            <option>Work Space</option>
			                                            <option>Meeting Space</option>
			                                        </select>

			                                        Type of Desk
			                                        <select class="form-control">
			                                            <option disabled="" selected="">- choose an option -</option>
			                                            <option>Private</option>
			                                            <option>Shared</option>
			                                        </select>

			                                        Monthly Budget

		                                            	<input type="text" class="form-control">
		                                            	$

How do you want to rent the office?

		                                                <input type="checkbox" name="jobb" value="Design">

By hour

		                                                <input type="checkbox" name="jobb" value="Design">

By day

 Tell us about your ideal working space.

		                                            Desk description
		                                            <textarea class="form-control" placeholder="" rows="9"></textarea>

		                                            Example

"If you're heavily armed with a mug, smartphone and a laptop, then our hot desks will provide the pure functionality and space needed to get your work done and move on to the next one."

		                                <input type='button' class='btn btn-next btn-fill btn-primary btn-wd' name='next' value='Next' />
		                                <input type='button' class='btn btn-finish btn-fill btn-primary btn-wd' name='finish' value='Finish' />

		                                <input type='button' class='btn btn-previous btn-default btn-wd' name='previous' value='Previous' />

		                    </form>

	             Made with  by Creative Tim. Free download here.


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

namespace Daves.DeepDataDuplicator.Metadata
{
    public class CheckConstraint
    {
        public CheckConstraint(object name, object tableId, object definition)
            : this((string)name, (int)tableId, (string)definition)
        { }

        public CheckConstraint(string name, int tableId, string definition)
        {
            Name = name;
            TableId = tableId;
            Definition = definition;
        }

        public string Name { get; }
        public int TableId { get; }
        public string Definition { get; }
        public Table Table { get; protected set; }

        public virtual void Initialize(IReadOnlyList<Table> tables)
            => Table = tables.Single(t => t.Id == TableId);

        // Could make more accurate, but is there a solution that's not string-based?
        public virtual bool CoalescesOver(Column column)
            => Definition.IndexOf("COALESCE", StringComparison.OrdinalIgnoreCase) >= 0
            && Definition.IndexOf(column.Name, StringComparison.OrdinalIgnoreCase) >= 0
            && Definition.IndexOf("IS NOT NULL", StringComparison.OrdinalIgnoreCase) >= 0;

        public override string ToString()
            => $"{Table}: {Name}";
    }
}


text:
package mocks

import mock "github.com/stretchr/testify/mock"
import oauth2 "github.com/mbict/go-oauth2"
import time "time"
import url "net/url"

// AccessTokenRequest is an autogenerated mock type for the AccessTokenRequest type
type AccessTokenRequest struct {
	mock.Mock
}

// Client provides a mock function with given fields:
func (_m *AccessTokenRequest) Client() oauth2.Client {
	ret := _m.Called()

	var r0 oauth2.Client
	if rf, ok := ret.Get(0).(func() oauth2.Client); ok {
		r0 = rf()
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(oauth2.Client)
		}
	}

	return r0
}

// Code provides a mock function with given fields:
func (_m *AccessTokenRequest) Code() string {
	ret := _m.Called()

	var r0 string
	if rf, ok := ret.Get(0).(func() string); ok {
		r0 = rf()
	} else {
		r0 = ret.Get(0).(string)
	}

	return r0
}

// RedirectUri provides a mock function with given fields:
func (_m *AccessTokenRequest) RedirectUri() *url.URL {
	ret := _m.Called()

	var r0 *url.URL
	if rf, ok := ret.Get(0).(func() *url.URL); ok {
		r0 = rf()
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(*url.URL)
		}
	}

	return r0
}

// RequestValues provides a mock function with given fields:
func (_m *AccessTokenRequest) RequestValues() url.Values {
	ret := _m.Called()

	var r0 url.Values
	if rf, ok := ret.Get(0).(func() url.Values); ok {
		r0 = rf()
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(url.Values)
		}
	}

	return r0
}

// RequestedAt provides a mock function with given fields:
func (_m *AccessTokenRequest) RequestedAt() time.Time {
	ret := _m.Called()

	var r0 time.Time
	if rf, ok := ret.Get(0).(func() time.Time); ok {
		r0 = rf()
	} else {
		r0 = ret.Get(0).(time.Time)
	}

	return r0
}

// RequestedScopes provides a mock function with given fields:
func (_m *AccessTokenRequest) RequestedScopes() oauth2.Scope {
	ret := _m.Called()

	var r0 oauth2.Scope
	if rf, ok := ret.Get(0).(func() oauth2.Scope); ok {
		r0 = rf()
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(oauth2.Scope)
		}
	}

	return r0
}

// Session provides a mock function with given fields:
func (_m *AccessTokenRequest) Session() oauth2.Session {
	ret := _m.Called()

	var r0 oauth2.Session
	if rf, ok := ret.Get(0).(func() oauth2.Session); ok {
		r0 = rf()
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(oauth2.Session)
		}
	}

	return r0
}

// SetSession provides a mock function with given fields: _a0
func (_m *AccessTokenRequest) SetSession(_a0 oauth2.Session) {
	_m.Called(_a0)
}


text:
package io.bootique.jersey.client;

import io.bootique.di.Binder;
import io.bootique.di.SetBuilder;

import javax.ws.rs.core.Feature;

public class JerseyClientModuleExtender {

    private Binder binder;
    private SetBuilder<Feature> features;

    JerseyClientModuleExtender(Binder binder) {
        this.binder = binder;
    }

    JerseyClientModuleExtender initAllExtensions() {
        contributeFeatures();
        return this;
    }

    public JerseyClientModuleExtender addFeature(Feature feature) {
        contributeFeatures().addInstance(feature);
        return this;
    }

    public <T extends Feature> JerseyClientModuleExtender addFeature(Class<T> featureType) {
        contributeFeatures().add(featureType);
        return this;
    }

    protected SetBuilder<Feature> contributeFeatures() {

        if (features == null) {
            features = binder.bindSet(Feature.class, JerseyClientFeatures.class);
        }

        return features;
    }
}


text:
<!DOCTYPE html>

        <meta charset="utf-8">
        <title>Unité de Logopédie de la voix</title>
        <meta name="description" content="">
        <meta name="viewport" content="width=device-width">

        <link rel="stylesheet" href="../css/main.css">
        <link rel="stylesheet" type="text/css" href="css/print.css" media="print" />
        <link href='http://fonts.googleapis.com/css?family=Exo:400,800' rel='stylesheet' type='text/css'>

Unité de logopédie de la Voix

Menu de navigation

HOME

UNITE

NOS RECHERCHES

FORMATIONS

STAGE

CONTACT

Bannière

Sidebar

Recherche

                        <input class='input' type="text" name="search" id='search' placeholder="Recherche"><input type="submit" value="Ok" class="connex" />

Connexion

                    <input class ="input" type="text" placeholder="Nom d'utilisateur">
                    <input class="input" type="password" placeholder="Mot de passe">
                    <input type="submit" value="Connexion" class="connex" />

Liens

Chanter juste

Dissection de la voix

Ma voix, c'est moi!

Restaurer la voix

Tournée sensibilisation

Musée de la musique

Etude de la voix à Namur

Unité de Logopédie des Troubles de la Voix

                        L'Unité de Logopédie des Troubles de la Voix, dirigée par le Professeur D. Morsomme, a vu le jour au sein de la Faculté de Psychologie et des Sciences de l'Éducation en octobre 2008.

                        Une grande partie des activités cliniques de Dominique Morsomme se déroule au CHU de Liège. Les patients qui consultent souffrent de dysphonie (trouble de la voix parlée) et/ou de dysodie (trouble de la voix chantée). Les troubles de la voix sont d'origine dysfonctionnelle avec ou sans lésion organique.

                        La rééducation vocale fait suite à un diagnostic médical posé par un Oto Rhino Laryngologue spécialisé en phoniatrie. C'est sur base du diagnostic médical, du bilan vocal et d'une discussion entre l'ORL, le patient et le logopède qu'un plan thérapeutique est proposé.

Lien avec le CPLU

                            Au sein de la CPLU, l'Unité propose une consultation spécialisée pour les sujets souffrant de dysmusie ou d'amusie (trouble spécifique à la perception ou production musicale, sans atteinte organique ou neurologique), et pour ceux souffrant de troubles myo fonctionnels.

                            Concernant la recherche, l'Unité s'intéresse à la charge vocale, c'est-à-dire à la quantité d'utilisation vocale. L'objectif est de quantifier l'usage vocal et d'étudier son impact sur la voix. La population des enseignants est particulièrement étudiée en raison de leur demande vocale élevée, faisant d'eux des « professionnels de la voix ». L'equipe s'intéresse également à la justesse vocale. L'objectif est de définir ce qu'est « chanter faux », de comprendre pourquoi certains d'entre nous ne parviennent pas à « chanter juste » afin de trouver des outils pour y remédier. La féminisation vocale est aussi étudiée afin de préciser et d'étayer les outils de rééducation proposés aux personnes souffrant de troubles de la voix liés au genre.

L'équipe

Chef de Service de l'Unité de Logopédie de la Voix

Professeure Dominique MORSOMME

Chercheurs

Pauline LARROUY-MAESTRI

Angélique REMACLE

Nos collaborateurs

Clinicien à la CPLU

Gisèle MARTINOT

Collaboration pédagogique

Martine GASPAR

Collaboration clinique au CHU de Liège

Professeure Camille FINCK

Chef de de Clinique au département d'ORL du CHU de Liège

Catherine Jansen

Plan du site

Accueil

Unité

Nos recherches

Formations

Stages

Contact

Contact

                    <address itemscope="" itemtype="http://schema.org/PostalAddress"  class="adr">
                        Faculté de Psychologie des Sciences de l'Education

                        5, Boulevard du Rectorat

                        4000,
                        Liège

                        Belgique
                    </address>

Tous droits réservés