text:
package avrora.monitors;

import avrora.arch.legacy.LegacyInstr;
import avrora.core.ControlFlowGraph.Block;
import avrora.core.Program;
import avrora.core.SourceMapping;
import avrora.sim.Simulator;
import avrora.sim.State;
import cck.text.Terminal;
import cck.text.TermUtil;

import java.util.*;

/**
 * The EnergyProfiler class is a monitor that tracks the power consumption of the cpu
 * instructions. It provides a breakdown to the procedures and records the exact cycles spend in each
 * procedure.
 *
 * @author Olaf Landsiedel
 */
public class EnergyProfiler extends MonitorFactory {

    /**
     * The EnergyProfiler class is a monitor that tracks the power consumption of the cpu
     * instructions. It provides a breakdown to the procedures and records the exact cycles spend in each
     * procedure.
     */
    public class Monitor implements avrora.monitors.Monitor {
        private final Simulator simulator;
        private final Program program;

        /**
         * labelLookup provides a HashMap to lookup procedures, e.g. labels. The HashMap key is
         * the label address, as value EnergyProfile is used
         */
        private final HashMap labelLookup;

        /**
         * profiles: list of all EnergyProfiles
         */
        private final LinkedList profiles;

        /**
         * procedureProbe: probes for entering a new basic block, always need to check whether we
         * are entering a new procedure
         */
        private final ProcedureProbe procedureProbe;
        /**
         * sleepProbe: GlobalProbe for entering sleep mode
         */
        private final SleepProbe sleepProbe;

        /**
         * currentMode: the current procedure, the program is in
         */
        private EnergyProfile currentMode;
        /**
         * lastChange: the cycle count of the moment the program entered a new basic block
         * lasttime
         */
        private long lastChange;
        /**
         * sleepCycles: counts the cycles spend in a sleep mode
         */
        private long sleepCycles;

        /**
         * construct a new monitor
         *
         * @param s Simulator
         */
        Monitor(Simulator s) {
            simulator = s;
            program = s.getProgram();
            labelLookup = new HashMap();
            profiles = new LinkedList();

            procedureProbe = new ProcedureProbe();
            sleepCycles = 0;
            sleepProbe = new SleepProbe();
            //find all sleep opcodes in the program
            findSleep();

            //scan all labels and put the in the list
            setupLabels();

            //startup values
            lastChange = 0;
            currentMode = nearestLabel(0);
            //scan each basic block and find the corresponding label, e.g. procedure
            Iterator it = program.getCFG().getSortedBlockIterator();
            int address;
            int size;
            while (it.hasNext()) {
                Block block = (Block)it.next();
                size = block.getSize();
                address = block.getAddress();
                if (size > 0 && program.readInstr(address) != null) {
                    labelLookup.put(new Integer(address), nearestLabel(address));
                    s.insertProbe(procedureProbe, address);
                }
            }
        }

        /**
         * scan all labels and put them in the list
         */
        private void setupLabels() {
            Iterator it = program.getSourceMapping().getIterator();
            while (it.hasNext()) {
                SourceMapping.Location tempLoc = (SourceMapping.Location)it.next();
                if (".text".equals(tempLoc.section) )
                    profiles.add(new EnergyProfile(tempLoc));
            }
        }

        /**
         * find the label nearest to the address. This returns the name of the procedure the address is in.
         *
         * @param address address to lookup
         * @return the nearest Label
         */
        private EnergyProfile nearestLabel(int address) {
            Iterator it = profiles.iterator();
            EnergyProfile match = null;
            while (it.hasNext()) {
                EnergyProfile temp = (EnergyProfile)it.next();
                if ((temp.location.lma_addr <= address) && ((match == null) || (temp.location.lma_addr > match.location.lma_addr))) {
                    match = temp;
                }
            }
            return match;
        }

        /**
         * find all sleep opcodes in the program
         */
        private void findSleep() {
            int i = 0;
            while (i < program.program_length) {
                LegacyInstr instr = (LegacyInstr)program.readInstr(i);
                if (instr != null) {
                    if ("sleep".equals(instr.properties.name)) {
                        simulator.insertProbe(sleepProbe, i);
                    }
                    i += instr.getSize();
                } else
                    i += 1;
            }
        }

        /**
         * The report() method generates a textual report after the simulation is complete. The
         * text contains a breakdown each procedure called in the program and the corresponding number of
         * cycles spent in it during program execution. Addionally the number of cycles spent in sleep mode is
         * provided.
         */
        public void report() {
            //log current state
            long cycles = simulator.getState().getCycles() - lastChange;
            if (cycles > 0) {
                if (currentMode != null) {
                    //system not sleeping
                    currentMode.cycles += cycles;
                } else {
                    //system sleeping
                    sleepCycles += cycles;
                }
            }
            //display data
            TermUtil.printSeparator("Energy breakdown for node "+simulator.getID());
            Terminal.printCyan("notation: procedureName@Address: cycles\n");
            Iterator it = profiles.iterator();
            while (it.hasNext()) {
                EnergyProfile profile = (EnergyProfile)it.next();
                if (profile.cycles > 0) {
                    Terminal.println("   " + profile.location.name + '@' + profile.location.lma_addr + ": " + profile.cycles);
                }
            }
            if (sleepCycles > 0)
                Terminal.println("   sleeping: " + sleepCycles);
            Terminal.println("");
        }

        /**
         * @author Olaf Landsiedel
         *

         *         Class for a GlobalProbe which is called when a new basic block is entered
         */
        public class ProcedureProbe extends Simulator.Probe.Empty {

            /**
             * fired before the basic block is entered, it logs the previos state
             *
             * @see Simulator.Probe#fireBefore(State,int)
             */
            public void fireBefore(State s, int pc) {
                long cycles = simulator.getState().getCycles() - lastChange;
                if (cycles > 0) {
                    if (currentMode != null) {
                        //system not sleeping
                        currentMode.cycles += cycles;
                    } else {
                        //system sleeping
                        sleepCycles += cycles;
                    }
                }
                lastChange = simulator.getState().getCycles();
                currentMode = (EnergyProfile)labelLookup.get(new Integer(pc));
            }

        }

        /**
         * @author Olaf Landsiedel
         *

         *         Class for a probe when a sleep mode is enered
         */
        public class SleepProbe extends Simulator.Probe.Empty {

            /**
             * fired before a sleep mode is entered, it logs the previos state
             *
             * @see Simulator.Probe#fireBefore(State,int)
             */
            public void fireBefore(State s, int pc) {
                long cycles = simulator.getState().getCycles() - lastChange;
                if (cycles > 0) {
                    if (currentMode != null) {
                        //system not sleeping
                        currentMode.cycles += cycles;
                    } else {
                        //system sleeping
                        sleepCycles += cycles;
                    }
                }
                lastChange = simulator.getState().getCycles();
                currentMode = null;
            }

        }
    }

    /**
     * The constructor for the EnergyProfiler class builds a new MonitorFactory
     * capable of creating monitors for each Simulator instance passed to the
     * newMonitor() method.
     */
    public EnergyProfiler() {
        super("The \"energy profile\" monitor tracks the power consumption of procedures and displays " +
                "a report at the end of execution.");
    }

    /**
     * The newMonitor() method creates a new monitor that is capable of energy profiling. It
     * provides a breakdown to the individual procedures of the program.
     *
     * @param s the simulator to create a monitor for
     * @return an instance of the Monitor interface for the specified simulator
     */
    public avrora.monitors.Monitor newMonitor(Simulator s) {
        return new Monitor(s);
    }

    /**
     * @author Olaf Landsiedel
     *

     *         Simple class for a energy profile. It contains the location, e.g. address of the procedure and
     *         the number of cycles spent in it.
     */
    public class EnergyProfile {
        /**
         * cycles: number of cycles spend in this procedure
         */
        public long cycles;
        /**
         * location: name and address of this procedure
         */
        public SourceMapping.Location location;

        /**
         * construct a new energy profile
         *
         * @param loc Location, e.g. name and address, of the profile
         */
        public EnergyProfile(SourceMapping.Location loc) {
            cycles = 0;
            location = loc;
        }
    }

}


text:
package main

type foo struct {
	x bar // ERROR "undefined"
}

func main() {
	var f foo
	go f.bar()
	defer f.bar()
}

redpajama_set_name: RedPajamaGithub


text:
<component name="libraryTable">
  <library name="tasks-core">
    <CLASSES>
      <root url="jar://$APPLICATION_HOME_DIR$/plugins/tasks/lib/tasks-core.jar!/" />
    </CLASSES>
    <JAVADOC />
    <SOURCES />
  </library>
</component>


text:
package konstructs.api;

/**
 * Represents a line shape that extends from a certain position in a certain direction.
 */
public class DirectionalLine implements BoxShape {
    private final Direction direction;
    private final int length;
    private final InclusiveBox box;

    /**
     * Creates a new immutable DirectionalLine
     * @param start The start position of the line
     * @param direction The direction of the line
     * @param length The length of the line (in number of blocks)
     */
    public DirectionalLine(Position start, Direction direction, int length) {
        this.box = new InclusiveBox(start, start.add(direction.getVector().multiply(length)));
        this.direction = direction;
        this.length = length;
    }

    /**
     * Returns the start position of the line
     * @return The start position
     */
    public Position getStart() {
        return box.getStart();
    }

    /**
     * Returns the end position of the line
     * @return The end
     */
    public Position getEnd() {
        return box.getEnd();
    }

    /**
     * Returns the direction of the line
     * @return The direction
     */
    public Direction getDirection() {
        return direction;
    }

    /**
     * Returns the length of the line
     * @return The length
     */
    public int getLength() {
        return length;
    }

    /**
     * Returns an array index local to the line, starting at {@link #getStart()}
     * @param index The index of the block on the line
     * @return The index of the block in the array
     */
    public int arrayIndexLocal(int index) {
        return getBox().arrayIndex(box.getStart().add(direction.getVector().multiply(index)));
    }

    /**
     * Returns a block from an array based on a local index
     * @param index The index of the block on the line
     * @param blocks The array of blocks
     * @param <T> The type of the block
     * @return The block
     * @see #arrayIndexLocal(int)
     */
    public <T> T getLocal(int index, T blocks[]) {
        return blocks[arrayIndexLocal(index)];
    }

    @Override
    public Box getBox() {
        return box.getBox();
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        DirectionalLine that = (DirectionalLine) o;

        return box.equals(that.box);

    }

    @Override
    public int hashCode() {
        return box.hashCode();
    }

    @Override
    public String toString() {
        return "DirectionalLine(" +
                "direction=" + direction +
                ", length=" + length +
                ", start=" + getStart() +
                ')';
    }
}


text:
package com.navercorp.pinpoint.common.server.bo;

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

import com.navercorp.pinpoint.common.buffer.AutomaticBuffer;
import com.navercorp.pinpoint.common.buffer.Buffer;
import com.navercorp.pinpoint.common.buffer.FixedBuffer;

/**
 * @author hyungil.jeong
 */
public class ServerMetaDataBo {

    private final String serverInfo;
    private final List<String> vmArgs;
    private final List<ServiceInfoBo> serviceInfos;

    private ServerMetaDataBo(Builder builder) {
        this.serverInfo = builder.serverInfo;
        this.vmArgs = builder.vmArgs;
        this.serviceInfos = builder.serviceInfos;
    }

    public String getServerInfo() {
        return this.serverInfo;
    }

    public List<String> getVmArgs() {
        return this.vmArgs;
    }

    public List<ServiceInfoBo> getServiceInfos() {
        return this.serviceInfos;
    }

    public byte[] writeValue() {
        final Buffer buffer = new AutomaticBuffer();
        buffer.put2PrefixedString(this.serverInfo);
        final int numVmArgs = this.vmArgs == null ? 0 : this.vmArgs.size();
        buffer.putVInt(numVmArgs);
        if (this.vmArgs != null) {
            for (String vmArg : this.vmArgs) {
                buffer.put2PrefixedString(vmArg);
            }
        }
        final int numServiceInfos = this.serviceInfos == null ? 0 : this.serviceInfos.size();
        buffer.putVInt(numServiceInfos);
        if (this.serviceInfos != null) {
            for (ServiceInfoBo serviceInfo : this.serviceInfos) {
                buffer.putPrefixedBytes(serviceInfo.writeValue());
            }
        }
        return buffer.getBuffer();
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder("ServerMetaDataBo{");
        sb.append("serverInfo='").append(this.serverInfo).append('\'');
        sb.append(", vmArgs=").append(this.vmArgs);
        sb.append(", serviceInfos=").append(this.serviceInfos.toString());
        return sb.toString();
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((serverInfo == null) ? 0 : serverInfo.hashCode());
        result = prime * result + ((serviceInfos == null) ? 0 : serviceInfos.hashCode());
        result = prime * result + ((vmArgs == null) ? 0 : vmArgs.hashCode());
        return result;
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;
        if (getClass() != obj.getClass())
            return false;
        ServerMetaDataBo other = (ServerMetaDataBo)obj;
        if (serverInfo == null) {
            if (other.serverInfo != null)
                return false;
        } else if (!serverInfo.equals(other.serverInfo))
            return false;
        if (serviceInfos == null) {
            if (other.serviceInfos != null)
                return false;
        } else if (!serviceInfos.equals(other.serviceInfos))
            return false;
        if (vmArgs == null) {
            if (other.vmArgs != null)
                return false;
        } else if (!vmArgs.equals(other.vmArgs))
            return false;
        return true;
    }

    public static class Builder {
        private String serverInfo;
        private List<String> vmArgs;
        private List<ServiceInfoBo> serviceInfos;

        public Builder() {
        }

        public Builder(final byte[] value) {
            final Buffer buffer = new FixedBuffer(value);
            this.serverInfo = buffer.read2PrefixedString();
            final int numVmArgs = buffer.readVInt();
            this.vmArgs = new ArrayList<>(numVmArgs);
            for (int i = 0; i < numVmArgs; i++) {
                this.vmArgs.add(buffer.read2PrefixedString());
            }
            final int numServiceInfos = buffer.readVInt();
            this.serviceInfos = new ArrayList<>(numServiceInfos);
            for (int i = 0; i < numServiceInfos; i++) {
                ServiceInfoBo serviceInfoBo = new ServiceInfoBo.Builder(buffer.readPrefixedBytes()).build();
                this.serviceInfos.add(serviceInfoBo);
            }
        }

        public void serverInfo(String serverInfo) {
            this.serverInfo = serverInfo;
        }

        public void vmArgs(List<String> vmArgs) {
            this.vmArgs = vmArgs;
        }

        public void serviceInfos(List<ServiceInfoBo> serviceInfos) {
            this.serviceInfos = serviceInfos;
        }

        public ServerMetaDataBo build() {
            if (this.serverInfo == null) {
                this.serverInfo = "";
            }
            if (this.vmArgs == null) {
                this.vmArgs = Collections.emptyList();
            }
            if (this.serviceInfos == null) {
                this.serviceInfos = Collections.emptyList();
            }
            return new ServerMetaDataBo(this);
        }
    }
}


text:
""" Dummy implementation of cxmanage_api.ipretriever.IPRetriever """

from cxmanage_api.cx_exceptions import IPDiscoveryError

class DummyIPRetriever(object):
    """ Dummy IP retriever """

    def __init__(self, ecme_ip, aggressive=False, verbosity=0, **kwargs):
        self.executed = False
        self.ecme_ip = ecme_ip
        self.aggressive = aggressive
        self.verbosity = verbosity
        self.server_ip = None
        for name, value in kwargs.iteritems():
            setattr(self, name, value)

    def run(self):
        """ Set the server_ip variable. Raises an error if called more than
        once. """
        if self.executed:
            raise IPDiscoveryError("DummyIPRetriever.run() was called twice!")
        self.executed = True
        self.server_ip = "192.168.200.1"


text:
Originally published: 2012-04-03 16:21:31
Last updated: 2012-04-03 17:13:35
Author: Garrett

What if you had a list like this: [1, -10, [1,2,[3,4]], xrange(200)], and you just wanted to go through each element in order (wanted it to return a simple list of [1,-10,1,2,3,4,1,2,3,4...199])

I've seen a couple of attempts to flatten arbitrarily deep lists.  Many of them involve recursion, like this one: http://rightfootin.blogspot.com/2006/09/more-on-python-flatten.html

Recursion is generally considered non-pythonic (at least to my knowledge), so I have used one which just involves simple iterators instead.  Also, recursion will fail if the list is too deep (so it wouldn't really be arbitrary, would it?).


text:
from __future__ import unicode_literals

from django.db.backends.postgresql_psycopg2 import base

from .creation import DatabaseCreation

from .schema import DatabaseSchemaEditor

class DatabaseWrapper(base.DatabaseWrapper):
    """
    This is a simple subclass of the Postrges DatabaseWrapper,
    but using our new :class:`DatabaseCreation` class.
    """
    def __init__(self, *args, **kwargs):
        super(DatabaseWrapper, self).__init__(*args, **kwargs)
        self.creation = DatabaseCreation(self)

    def schema_editor(self, *args, **kwargs):
        return DatabaseSchemaEditor(self, *args, **kwargs)


text:
{% extends "base.html" %}
{% import "bootstrap/wtf.html" as wtf %}

{% block head %}
{{ super() }}
{% endblock %}
{% block sidebar %}

{{current_user.username}}

               Edit profile

               Inbox

               Sign out

Dashboard

            {% if current_user.is_authenticated and current_user.is_admin %}
               Dashboard
            {% elif current_user.is_authenticated and current_user.is_employee  %}
             Dashboard
            {% else %}
             Dashboard
            {% endif %}

Pages

               Account

Edit profile

Change Password

Change E-Mail Address

Log Out

               Request Loan

               My Loan History

               Chudi Investments Profile

Terms and Conditions

Company Policy

Our Mission

Our Vision

Social Media

{% endblock %}
{% block navbar %}
{{super () }}
{% endblock %}

{% block content %}

              Submit  Loan Application

            Please enter amount you would like to borrow.

               <form method="post" role="form">
				{{ wtf.quick_form(form) }}

                </form>

{% endblock %}

{% block footer %}{% endblock %}

{% block scripts %}
{{ super() }}
{{ moment.include_moment() }}
{% endblock %}


text:
==============
mongo-c-driver
==============

About
=====

mongo-c-driver is a client library written in C for MongoDB.

mongo-c-driver depends on `Libbson <https://github.com/mongodb/libbson>`_.
Libbson will automatically be built if you do not have it installed on your system.

If you are looking for the legacy C driver, it can be found in the
`legacy branch <https://github.com/mongodb/mongo-c-driver/tree/legacy>`_.

Documentation / Support / Feedback
==================================

The documentation is available at http://api.mongodb.org/c/current/.
For issues with, questions about, or feedback for libmongoc, please look into
our `support channels <http://www.mongodb.org/about/support>`_. Please
do not email any of the libmongoc developers directly with issues or
questions - you're more likely to get an answer on the `mongodb-user list`_
on Google Groups.

Bugs / Feature Requests
=======================

Think you've found a bug? Want to see a new feature in libmongoc? Please open a
case in our issue management tool, JIRA:

- `Create an account and login <https://jira.mongodb.org>`_.
- Navigate to `the CDRIVER project <https://jira.mongodb.org/browse/CDRIVER>`_.
- Click **Create Issue** - Please provide as much information as possible about the issue type and how to reproduce it.

Bug reports in JIRA for all driver projects (i.e. CDRIVER, CSHARP, JAVA) and the
Core Server (i.e. SERVER) project are **public**.

How To Ask For Help
-------------------

If you are having difficulty building the driver after reading the below instructions, please email
the `mongodb-user list`_ to ask for help. Please include in your email all of the following
information:

- The version of the driver you are trying to build (branch or tag).
    - Examples: master branch, 1.1.11 tag
- Host OS, version, and architecture.
    - Examples: Windows 8 64-bit x86, Ubuntu 12.04 32-bit x86, OS X Mavericks
- C Compiler and version.
    - Examples: GCC 4.8.2, MSVC 2013 Express, clang 3.4, XCode 5
- The output of ``./autogen.sh`` or ``./configure`` (depending on whether you are building from a
  repository checkout or from a tarball). The output starting from "libbson was configured with
  the following options" is sufficient.
- The text of the error you encountered.

Failure to include the relevant information will result in additional round-trip
communications to ascertain the necessary details, delaying a useful response.
Here is a made-up example of a help request that provides the relevant
information:

  Hello, I'm trying to build the C driver with SSL, from mongo-c-driver-1.1.11.tar.gz. I'm on Ubuntu
  14.04, 64-bit Intel, with gcc 4.8.2. I run configure like::

    $ ./configure --enable-sasl=yes
    checking for gcc... gcc
    checking whether the C compiler works... yes

    ... SNIPPED OUTPUT, but when you ask for help, include full output without any omissions ...

    checking for pkg-config... no
    checking for SASL... no
    checking for sasl_client_init in -lsasl2... no
    checking for sasl_client_init in -lsasl... no
    configure: error: You must install the Cyrus SASL libraries and development headers to enable SASL support.

  Can you tell me what I need to install? Thanks!

.. _mongodb-user list: http://groups.google.com/group/mongodb-user

Security Vulnerabilities
------------------------

If you've identified a security vulnerability in a driver or any other
MongoDB project, please report it according to the `instructions here
<http://docs.mongodb.org/manual/tutorial/create-a-vulnerability-report>`_.

Building from Release Tarball
=============================

Unless you intend on contributing to the mongo-c-driver, you will want to build
from a release tarball.

The most current release is 1.1.11 which you can download here.
`mongo-c-driver-1.1.11.tar.gz <https://github.com/mongodb/mongo-c-driver/releases/download/1.1.11/mongo-c-driver-1.1.11.tar.gz>`_.

To build on UNIX-like systems, do the following::

  $ tar xzf mongo-c-driver-1.1.11.tar.gz
  $ cd mongo-c-driver-1.1.11
  $ ./configure
  $ make
  $ sudo make install

To see all of the options available to you during configuration, run::

  $ ./configure --help

To build on Windows Vista or newer with Visual Studio 2010, do the following::

  cd mongo-c-driver-1.1.11
  cd src\libbson
  cmake -DCMAKE_INSTALL_PREFIX=C:\usr -G "Visual Studio 10 Win64" .
  msbuild.exe ALL_BUILD.vcxproj
  msbuild.exe INSTALL.vcxproj
  cd ..\..
  cmake -DCMAKE_INSTALL_PREFIX=C:\usr -DBSON_ROOT_DIR=C:\usr -G "Visual Studio 10 Win64" .
  msbuild.exe ALL_BUILD.vcxproj
  msbuild.exe INSTALL.vcxproj

Building From Git
=================

mongo-c-driver contains a copy of libbson in the case that your system does
not already have libbson installed. The configure script will detect if
libbson is not installed and install it too.

Dependencies
------------

Fedora::

  $ sudo yum install git gcc automake autoconf libtool

Debian::

  $ sudo apt-get install git gcc automake autoconf libtool

FreeBSD::

  $ su -c 'pkg install git gcc automake autoconf libtool'

Fetch Sources and Build
-----------------------

You can use the following to checkout and build mongo-c-driver::

  git clone https://github.com/mongodb/mongo-c-driver.git
  cd mongo-c-driver
  ./autogen.sh
  make
  sudo make install

In standard automake fasion, ./autogen.sh only needs to be run once.
You can use ./configure directly going forward.
Also, see ./configure --help for all configure options.

Building on Windows
===================

Currently, the cmake build system for mongo-c-driver does not build the libbson
package as well. This needs to be done manually with cmake.

SSL is supported through the use of OpenSSL. SASL is not currently supported
but is planned. To enable OpenSSL support, install the appropriate OpenSSL for
Windows from `here <http://slproweb.com/products/Win32OpenSSL.html>`_. The
instructions below assume 64-bit builds, so you would want to get the version
for "Win64 OpenSSL 1.0.1f" which includes libraries and headers.

If you are building from git, and not a release tarball, you also need to
initialize the git submodule for libbson::

  git submodule init
  git submodule update

Then proceed to build and install libbson using cmake and Visual Studio's
command line tool, msbuild.exe. You can of course open these project files
from Visual Studio as well::

  cd src\libbson
  cmake -DCMAKE_INSTALL_PREFIX=C:\usr -G "Visual Studio 10 Win64" .
  msbuild.exe ALL_BUILD.vcxproj
  msbuild.exe INSTALL.vcxproj
  cd ..\..
  cmake -DCMAKE_INSTALL_PREFIX=C:\usr -DBSON_ROOT_DIR=C:\usr -G "Visual Studio 10 Win64" .
  msbuild.exe ALL_BUILD.vcxproj
  msbuild.exe INSTALL.vcxproj

Generating the Docs
===================

To generate the documentation you must install the :code:`yelp-tools` package.
On Linux this package can be found in the package manager for your distribution,
on OSX we recommend using `TingPing's homebrew-gnome tap <https://github.com/TingPing/homebrew-gnome>`_.

Then use the following :code:`./configure` options:

* :code:`--enable-html-docs` - builds the HTML documentation
* :code:`--enable-man-pages` - builds and installs the man-pages.


text:
package com.microsoft.aad.msal4j;

import labapi.*;
import org.testng.Assert;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;

import java.util.Collections;
import java.util.Set;

public class TokenCacheIT {

    private LabUserProvider labUserProvider;

    @BeforeClass
    public void setUp() {
        labUserProvider = LabUserProvider.getInstance();
    }

    @Test
    public void singleAccountInCache_RemoveAccountTest() throws Exception {
        User user = labUserProvider.getDefaultUser();

        PublicClientApplication pca = PublicClientApplication.builder(
                user.getAppId()).
                authority(TestConstants.ORGANIZATIONS_AUTHORITY).
                build();

        // Check that cache is empty
        Assert.assertEquals(pca.getAccounts().join().size(), 0);

        pca.acquireToken(UserNamePasswordParameters.
                builder(Collections.singleton(TestConstants.GRAPH_DEFAULT_SCOPE),
                        user.getUpn(),
                        user.getPassword().toCharArray())
                .build())
                .get();

        // Check that cache contains one account
        Assert.assertEquals(pca.getAccounts().join().size(), 1);

        pca.removeAccount(pca.getAccounts().join().iterator().next()).join();

        // Check that account has been removed
        Assert.assertEquals(pca.getAccounts().join().size(), 0);
    }

    @Test
    public void twoAccountsInCache_RemoveAccountTest() throws Exception {

        User managedUser = labUserProvider.getDefaultUser();

        PublicClientApplication pca = PublicClientApplication.builder(
                managedUser.getAppId()).
                authority(TestConstants.ORGANIZATIONS_AUTHORITY).
                build();

        Assert.assertEquals(pca.getAccounts().join().size(), 0);

        pca.acquireToken(UserNamePasswordParameters.
                builder(Collections.singleton(TestConstants.GRAPH_DEFAULT_SCOPE),
                        managedUser.getUpn(),
                        managedUser.getPassword().toCharArray())
                .build())
                .get();

        Assert.assertEquals(pca.getAccounts().join().size(), 1);

        // get lab user for different account
        User adfsUser = labUserProvider.getFederatedAdfsUser(FederationProvider.ADFS_4);

        // acquire token for different account
        pca.acquireToken(UserNamePasswordParameters.
                builder(Collections.singleton(TestConstants.GRAPH_DEFAULT_SCOPE),
                        adfsUser.getUpn(),
                        adfsUser.getPassword().toCharArray())
                .build())
                .get();

        Assert.assertEquals(pca.getAccounts().join().size(), 2);

        Set<IAccount> accounts = pca.getAccounts().join();
        IAccount accountLabResponse1 = accounts.stream().filter(
                x -> x.username().equalsIgnoreCase(
                        managedUser.getUpn())).findFirst().orElse(null);

        pca.removeAccount(accountLabResponse1).join();

        Assert.assertEquals(pca.getAccounts().join().size(), 1);

        IAccount accountLabResponse2 = pca.getAccounts().get().iterator().next();

        // Check that the right account was left in the cache
        Assert.assertEquals(accountLabResponse2.username(), adfsUser.getUpn());
    }

    @Test
    public void twoAccountsInCache_SameUserDifferentTenants_RemoveAccountTest() throws Exception {

        UserQueryParameters query = new UserQueryParameters();
        query.parameters.put(UserQueryParameters.USER_TYPE, UserType.GUEST);

        User guestUser = labUserProvider.getLabUser(query);
        Lab lab = LabService.getLab(guestUser.getLabName());

        String dataToInitCache = TestHelper.readResource(
                this.getClass(),
                "/cache_data/remove-account-test-cache.json");

        // check that cache is empty
        Assert.assertEquals(dataToInitCache, "");

        ITokenCacheAccessAspect persistenceAspect = new TokenPersistence(dataToInitCache);

        // acquire tokens for home tenant, and serialize cache
        PublicClientApplication pca = PublicClientApplication.builder(
                guestUser.getAppId()).
                authority(TestConstants.ORGANIZATIONS_AUTHORITY)
                .setTokenCacheAccessAspect(persistenceAspect)
                .build();

        pca.acquireToken(UserNamePasswordParameters.
                builder(Collections.singleton(TestConstants.GRAPH_DEFAULT_SCOPE),
                        guestUser.getHomeUPN(),
                        guestUser.getPassword().toCharArray())
                .build())
                .get();

        String guestTenantAuthority = TestConstants.MICROSOFT_AUTHORITY_HOST + lab.getTenantId();

        // initialize pca with tenant where user is guest, deserialize cache, and acquire second token
        PublicClientApplication pca2 = PublicClientApplication.builder(
                guestUser.getAppId()).
                authority(guestTenantAuthority).
                setTokenCacheAccessAspect(persistenceAspect).
                build();

        pca2.acquireToken(UserNamePasswordParameters.
                builder(Collections.singleton(TestConstants.GRAPH_DEFAULT_SCOPE),
                        guestUser.getHomeUPN(),
                        guestUser.getPassword().toCharArray())
                .build())
                .get();

        // There should be two tokens in cache, with same accounts except for tenant
        Assert.assertEquals(pca2.getAccounts().join().iterator().next().getTenantProfiles().size(), 2);

        IAccount account = pca2.getAccounts().get().iterator().next();

        // RemoveAccount should remove both cache entities
        pca2.removeAccount(account).join();

        Assert.assertEquals(pca.getAccounts().join().size(), 0);

        //clean up file
        TestHelper.deleteFileContent(
                this.getClass(),
                "/cache_data/remove-account-test-cache.json");
    }

    private static class TokenPersistence implements ITokenCacheAccessAspect {
        String data;

        TokenPersistence(String data) {
            this.data = data;
        }

        @Override
        public void beforeCacheAccess(ITokenCacheAccessContext iTokenCacheAccessContext) {
            iTokenCacheAccessContext.tokenCache().deserialize(data);
        }

        @Override
        public void afterCacheAccess(ITokenCacheAccessContext iTokenCacheAccessContext) {
            data = iTokenCacheAccessContext.tokenCache().serialize();
        }
    }
}


text:
package com.bylak.network.neural.teach;

/**
 * Created with IntelliJ IDEA.
 * User: Artur.Bylak
 * Date: 06.11.13
 * Time: 13:56
 * To change this template use File | Settings | File Templates.
 */
public class DefaultLearningFactorCalculator implements LeaningFactorCalculator {
    private static final double KW = 1.04;
    private static final double PI = 1.05;
    private static final double PD = 0.7;

    @Override
    public double calculate(final double currentSSE, final double lastSSE, final double lastLearningFactor) {
        double learningFactor = 0;
        if (currentSSE - KW * lastSSE > 0) {
            learningFactor = lastLearningFactor * PD;
        } else {
            learningFactor = lastLearningFactor * PI;
        }

        return learningFactor;
    }
}


text:
using UnityEngine;
using System.Collections;
using Lib;

/*
 * This module is used to initialized some of the public variable/objects within Lib
 * Initialization should always be in the awake method.
 * */
public class JMenuInitController : MonoBehaviour {

	void Awake () {

		UIComponents.Init ();
		AudioClips.Init ();

	}

	// Use this for initialization
	void Start () {
		UIComponents.MAIN_MENU.enabled = true;
		UIComponents.SERVER_SELECTION.enabled = false;
		UIComponents.TUTORIAL.enabled = false;
	}

	// Update is called once per frame
	void Update () {
	}
}


text:
(function () {
    "use strict";

    app.directive("spinner", [function () {
        return {
            restrict: "E",
            template: "

",
            controller: function () {},
            controllerAs: "spinner"
        };
    }]);

}());


text:
FROM phusion/baseimage:0.9.15
MAINTAINER Victor Lin <hello@victorlin.me>

# install dependencies
RUN apt-get -qq update && \
    apt-get install -y \
        python \
        python-pip \
    && \
    apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

RUN easy_install -U setuptools && \
    pip install -U pip

# add echoapp service
ADD echoapp.sh /etc/service/echoapp/run
RUN chmod +x /etc/service/echoapp/run

# install packages
ADD echoapp.tar /srv/echoapp
RUN pip install -e /srv/echoapp

VOLUME ["/var/log"]
ENTRYPOINT ["/sbin/my_init"]
EXPOSE 80


text:
MediaOnDemand
=============

MediaOnDemand~[ Earthos/GlobalOnDemandSystems/GODS/"]/,DisneyParksCanada MediaRepositories-DisneyOnDemand-HarmonyServerSystems. -CUCSM


text:
ACCEPTED

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

#### Published in
Stud. Mycol. 46: 184 (2001)

#### Original name
Sesquicillium asymmetricum Samuels, 1989

### Remarks
null


text:
<?php declare(strict_types=1);

namespace FeatureToggle\Strategy;

use DateTime;
use FeatureToggle\Feature\FeatureInterface;
use FeatureToggle\Strategy\ComparisonOperator\GreaterThan;
use FeatureToggle\Strategy\ComparisonOperator\LowerThan;

/**
 * DateTimeRange strategy.
 */
final class DateTimeRangeStrategy extends AbstractStrategy
{

    const COMPARATORS = [
        'minRange' => GreaterThan::class,
        'maxRange' => LowerThan::class
    ];

    /**
     * Include start and end date time or not.
     *
     * @var boolean
     */
    private $inclusive;

    /**
     * Maximum date time.
     *
     * @var string
     */
    private $maxRange;

    /**
     * Minimum date time.
     *
     * @var string
     */
    private $minRange;

    /**
     * Constructor.
     *
     * @param \DateTime $minRange Minimum date time.
     * @param \DateTime $maxRange Maximum date time.
     * @param bool $inclusive Include minimum and maximum dates in range.
     */
    public function __construct(DateTime $minRange, DateTime $maxRange, bool $inclusive = false)
    {
        $this->minRange = $minRange;
        $this->maxRange = $maxRange;
        $this->inclusive = $inclusive;
    }

    /**
     * {@inheritdoc}
     */
    public function __invoke(FeatureInterface $Feature, array $args = []): bool
    {
        $strategies = [];

        foreach (static::COMPARATORS as $var => $comparator) {
            if ($this->inclusive) {
                $comparator .= 'Equal';
            }

            $strategies[$var] = new DateTimeStrategy($this->$var, new $comparator);
        }

        $result = true;
        foreach ($strategies as $var => $Strategy) {
            if (!call_user_func($Strategy, $Feature)) {
                $result = false;
            }
        }

        return $result;
    }

    /**
     * {@inheritdoc}
     */
    public function serialize(): string
    {
        return json_encode([
            'minRange' => $this->minRange->getTimestamp(),
            'maxRange' => $this->maxRange->getTimestamp(),
            'inclusive' => $this->inclusive,
        ]);
    }

    /**
     * {@inheritdoc}
     */
    public function unserialize($serialized)
    {
        $data = json_decode($serialized, true);
        $this->minRange = (new DateTime('now'))->setTimestamp($data['minRange']);
        $this->maxRange = (new DateTime('now'))->setTimestamp($data['maxRange']);
        $this->inclusive = $data['inclusive'];
    }
}


text:
package apple.mobilecoreservices;

import java.io.*;
import java.nio.*;
import java.util.*;
import com.google.j2objc.annotations.*;
import com.google.j2objc.runtime.*;
import com.google.j2objc.runtime.block.*;
import apple.audiotoolbox.*;
import apple.corefoundation.*;
import apple.coregraphics.*;
import apple.coreservices.*;
import apple.foundation.*;

/*<javadoc>*/
/*</javadoc>*/
@Library("MobileCoreServices/MobileCoreServices.h")
public class UTTagClass
    extends Object
     {

    /**
     * @since Available in iOS 3.0 and later.
     */
    @GlobalConstant("kUTTagClassFilenameExtension")
    public static native CFString FilenameExtensionValue();
    /**
     * @since Available in iOS 3.0 and later.
     */
    @GlobalConstant("kUTTagClassMIMEType")
    public static native CFString MIMETypeValue();

}


text:
/* All rights reserved. */

/* This file is part of niggli. */

/* 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 the niggli project 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 HOLDER 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. */

#ifndef __NIGGLI_H__
#define __NIGGLI_H__

#define NIGGLI_MAJOR_VERSION 0
#define NIGGLI_MINOR_VERSION 2
#define NIGGLI_MICRO_VERSION 0

int niggli_get_major_version(void);
int niggli_get_minor_version(void);
int niggli_get_micro_version(void);
int niggli_reduce(double *lattice_, const double eps_);

#endif


text:
package breeze.optimize

import org.scalatest.junit._
import org.scalacheck._
import org.junit.runner.RunWith

import breeze.linalg._

@RunWith(classOf[JUnitRunner])
class LBFGSTest extends OptimizeTestBase {

  test("optimize a simple multivariate gaussian") {
    val lbfgs = new LBFGS[DenseVector[Double]](100,4)

    def optimizeThis(init: DenseVector[Double]) = {
      val f = new DiffFunction[DenseVector[Double]] {
        def calculate(x: DenseVector[Double]) = {
          (norm((x - 3.0) ^:^ 2.0, 1), (x *:* 2.0) - 6.0)
        }
      }

      val result = lbfgs.minimize(f,init)
      norm(result - 3.0,2) < 1E-10
    }

    check(Prop.forAll(optimizeThis _))
  }

  test("L2 sends unused counter weights to 0") {
    val lbfgs = new LBFGS[Counter[String, Double]](1000, 4)

    def optimizeThis(init: Counter[String,Double]): Boolean = {
      val f = new DiffFunction[Counter[String,Double]] {
        def calculate(x: Counter[String,Double]) = {
          ((x("A") - 3.0) * (x("A") - 3.0), Counter("A" -> (x("A") * 2.0 - 6.0)))
        }
      }

      val result = lbfgs.minimize(DiffFunction.withL2Regularization(f, 2.0), init)
      for((k, v) <- result.iterator) {
        if (k == "A" && math.abs(v - 1.5) >= 1E-5 || k != "A" && math.abs(v) >= 1E-5) {
          println(init.toString + " " + result)
          return false
        }
      }
      true
    }

    check(Prop.forAll(optimizeThis _))
  }

  test("optimize a simple multivariate gaussian with counters") {
    val lbfgsString = new LBFGS[Counter[String,Double]](1000,4)

    def optimizeThis(init: Counter[String,Double]) = {
      val f = new DiffFunction[Counter[String,Double]] {
        def calculate(x: Counter[String,Double]) = {
          ((x - 3.0) dot (x - 3.0),(x *:* 2.0) - 6.0)
        }
      }

      val result = lbfgsString.minimize(f,init)
      norm(result - 3.0,2) < 1E-5
    }

    check(Prop.forAll(optimizeThis _ ))

  }

  test("optimize a simple multivariate gaussian with l2 regularization") {
    val lbfgs = new LBFGS[DenseVector[Double]](10000,4)

    def optimizeThis(init: DenseVector[Double]) = {
      val f = new DiffFunction[DenseVector[Double]] {
        def calculate(x: DenseVector[Double]) = {
          ((x - 3.0) dot (x - 3.0), (x *:* 2.0) - 6.0)
        }
      }

      val targetValue = 3 / (1.0 / 2 + 1)
      val result = lbfgs.minimize(DiffFunction.withL2Regularization(f, 1.0),init)
      val ok = norm(result -:- (DenseVector.ones[Double](init.size) *:* targetValue),2)/result.size < 3E-3
      ok || (throw new RuntimeException("Failed to find optimum for init " + init))
    }

    check(Prop.forAll(optimizeThis _))

   }

   test("lbfgs-c rosenbroch example") {
    val lbfgs = new LBFGS[DenseVector[Double]](40,6)

    def optimizeThis(init: DenseVector[Double]) = {
      val f = new DiffFunction[DenseVector[Double]] {

        def calculate(x: DenseVector[Double]) = {
          var fx = 0.0
          val g = DenseVector.zeros[Double](x.length)

          for(i <- 0 until x.length by 2) {
            val t1 = 1.0 - x(i)
            val t2 = 10.0 * (x(i+1) - (x(i) * x(i)))
            g(i+1) = 20 * t2
            g(i) = -2 * (x(i) * g(i+1) + t1)
            fx += t1 * t1 + t2 * t2

          }
          fx -> g

        }
      }

      val targetValue = 1.0

      val result = lbfgs.minimize(f,init)

      val ok = norm(result -:- DenseVector.ones[Double](init.size) * targetValue,2)/result.size < 1E-5
      ok || (throw new RuntimeException("Failed to find optimum for init " + init))
    }
    val init = DenseVector.zeros[Double](100)
    init(0 until init.length by 2) := -1.2
    init(1 until init.length by 2) := 1.0
    assert(optimizeThis(init))

   }

}


text:
using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
using ESRI.ArcGIS.Geodatabase;
using ESRI.ArcGIS.TrackingAnalyst;
using ESRI.ArcGIS.esriSystem;
using ESRI.ArcGIS.Carto;
using System.Windows.Forms;
using ESRI.ArcGIS.DataSourcesGDB;
using ESRI.ArcGIS.Display;

namespace TAAddHistoricalTrackingLayer
{
  public class AddTemporalLayerButton : ESRI.ArcGIS.Desktop.AddIns.Button
  {

    private bool m_bInitialized = false;

    public AddTemporalLayerButton()
    {
    }

    protected override void OnClick()
    {
      setupTrackingEnv();
      //Open the year 2000 hurricanes shapefile
      IFeatureClass featureClass = openTemporalData();

      //Create and add a Temporal Layer to the map
      AddTemporalLayer(featureClass, "EVENTID", "Date_Time");

      //Turn on Dynamic Display
      EnableDynamicDisplay();

      ArcMap.Application.CurrentTool = null;
    }
    protected override void OnUpdate()
    {
      Enabled = ArcMap.Application != null;
    }

    //Initialize the Tracking Environment, you only need to do this once
    private void setupTrackingEnv()
    {
      if (!m_bInitialized && ArcMap.Application != null)
      {
        IExtensionManager extentionManager = new ExtensionManagerClass();

        UID uid = new UIDClass();
        uid.Value = "esriTrackingAnalyst.TrackingEngineUtil";
        object mapRef = ArcMap.Application;

        ((IExtensionManagerAdmin)extentionManager).AddExtension(uid, ref mapRef);

        ITrackingEnvironment3 trackingEnv = new TrackingEnvironmentClass();
        try
        {
          trackingEnv.Initialize(ref mapRef);
        }
        catch (Exception ex)
        {
        }
        trackingEnv.EnableTemporalDisplayManagement = true;

        m_bInitialized = true;
      }
    }
        /// <summary>
        /// Turns Dynamic Display On.
        /// </summary>
        private void EnableDynamicDisplay()
        {

            IDynamicMap dynamicMap = ArcMap.Document.FocusMap as IDynamicMap;

            if (dynamicMap != null)
            {
                dynamicMap.DynamicMapEnabled = true;
            }

        }

    /// <summary>
    /// Opens a feature class from a shapefile stored on disk.
    /// </summary>
    /// <returns>The opened feature class</returns>
    private IFeatureClass openTemporalData()
    {
      //set the path to the featureclass
      string path = System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), @"ArcGIS\data\Time\ProjectData.gdb");
      if (!System.IO.Directory.Exists(path))
      {
        MessageBox.Show("Cannot find hurricane data:\n" + path, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
        return null;
      }

      IWorkspaceFactory2 wsFactory = new FileGDBWorkspaceFactoryClass();
      IWorkspace workspace = wsFactory.OpenFromFile( path, 0 );
      IFeatureClass featureClass = ((IFeatureWorkspace)workspace).OpenFeatureClass( "atlantic_hurricanes_2000" );

      return featureClass;
    }

        /// <summary>
        /// Creates a Temporal Layer using the specified feature class and add it to the map.
        /// </summary>
        /// <param name="featureClass">The feature class to use for the temporal layer.</param>
        /// <param name="eventFieldName">Indicates the feature class column that identifies or groups temporal observations with time series.</param>
        /// <param name="temporalFieldName">Identifies the temporal field, which must be a field type whose data can be converted to a date value.</param>
        private void AddTemporalLayer(IFeatureClass featureClass, string eventFieldName, string temporalFieldName)
        {
            ITemporalLayer temporalFeatureLayer = new TemporalFeatureLayerClass();
            IFeatureLayer2 featureLayer = temporalFeatureLayer as IFeatureLayer2;
            ILayer layer = temporalFeatureLayer as ILayer;
            ITemporalRenderer temporalRenderer = new CoTrackSymbologyRendererClass();
			ITemporalRenderer2 temporalRenderer2 = (ITemporalRenderer2)temporalRenderer;
            IFeatureRenderer featureRenderer = temporalRenderer as IFeatureRenderer;
			ITrackSymbologyRenderer trackRenderer = temporalRenderer as ITrackSymbologyRenderer;

            if (featureLayer != null)
            {
                featureLayer.FeatureClass = featureClass;
            }

            if (featureRenderer != null)
            {
                temporalRenderer.TemporalObjectColumnName = eventFieldName;
                temporalRenderer.TemporalFieldName = temporalFieldName;
                temporalFeatureLayer.Renderer = featureRenderer;
            }

			if (trackRenderer != null)
			{
				//Create green color value
				IRgbColor rgbColor = new RgbColorClass();
				rgbColor.RGB = 0x00FF00;

				//Create simple thin green line
				ISimpleLineSymbol simpleLineSymbol = new SimpleLineSymbolClass();
				simpleLineSymbol.Color = (IColor)rgbColor;
				simpleLineSymbol.Width = 1.0;

				//Create simple renderer using line symbol
				ISimpleRenderer simpleRenderer = new SimpleRendererClass();
				simpleRenderer.Symbol = (ISymbol)simpleLineSymbol;

				//Apply line renderer as track symbol and enable track rendering
				trackRenderer.TrackSymbologyRenderer = (IFeatureRenderer)simpleRenderer;
				trackRenderer.ShowTrackSymbologyLegendGroup = true;
				temporalRenderer2.TrackRendererEnabled = true;
			}

            if (layer != null)
            {
              ArcMap.Document.FocusMap.AddLayer(layer);
            }
        }
    }
}


text:
<?xml version="1.0" encoding="US-ASCII"?>
<!DOCTYPE api PUBLIC "-//XINS//DTD XINS API 1.5//EN" "http://xins.sourceforge.net/dtd/api_1_5.dtd">

<api name="allinone" owner="johnd"
rcsversion="$Revision: 1.16 $" rcsdate="$Date: 2006/09/25 13:34:21 $">

	<description>API that uses all the features included in XINS.</description>

	<function name="AttributeCombo"  />
	<function name="DataSection"     />
	<function name="DataSection2" freeze="1.1" />
	<function name="DataSection3"    />
	<function name="DataSection4"    />
	<function name="DefaultValue"    />
	<function name="DefinedTypes"    />
	<function name="Echo"            />
	<function name="Logdoc"          />
	<function name="ParamCombo"      />
	<function name="ParamComboNotAll"/>
	<function name="ParamComboValue" />
	<function name="ResultCode"      />
	<function name="RuntimeProps"    />
	<function name="SimpleOutput"    />
	<function name="SimpleTypes"     />

	<type name="Age"                  />
	<type name="AgeNameProperties"    />
	<type name="IPAddress"            />
	<type name="Salutation"           />
	<type name="TextList"          freeze="1.1" />
	<type name="portal/Password"      />
	<type name="portal/Username"      />

	<resultcode name="AlreadySet"     />
	<resultcode name="InvalidNumber"  />
	<resultcode name="MissingInput" />

	<category name="DataSections" />
</api>


text:
package at.dotpoint.gradle.cross.variant.resolver;

import at.dotpoint.gradle.cross.variant.model.IVariant;
import at.dotpoint.gradle.cross.variant.requirement.IVariantRequirement;
import org.gradle.api.ExtensiblePolymorphicDomainObjectContainer;

/**
 * Created by RK on 28.03.2016.
 */
public abstract class VariantResolver<TVariant extends IVariant, TRequirement extends IVariantRequirement>
		implements IVariantResolver<TVariant, TRequirement>
{

	//
	protected final ExtensiblePolymorphicDomainObjectContainer<TVariant> variantContainer;

	//
	public VariantResolver( ExtensiblePolymorphicDomainObjectContainer<TVariant> variantContainer )
	{
		this.variantContainer = variantContainer;
	}

	// -------------------------------------------------------- //
	// -------------------------------------------------------- //

	@Override
	abstract public Class<TVariant> getVariantType();

	@Override
	abstract public Class<TRequirement> getRequirementType();

	// -------------------------------------------------------- //
	// -------------------------------------------------------- //

	@Override
	public TVariant resolve(TRequirement requirement)
	{
		TVariant existing = this.getVariantFromContainer( requirement );

		if ( existing == null )
			return this.createVariant( requirement );

		return existing;
	}

	//
	protected TVariant getVariantFromContainer( TRequirement requirement )
	{
		for ( TVariant variant : this.variantContainer )
		{
			if ( variant.getName().equals( requirement.getName() ) )
				return variant;
		}

		return null;
	}

	//
	protected TVariant createVariant( TRequirement requirement )
	{
		return this.variantContainer.create( requirement.getName(), this.getVariantType() );
	}
}


text:
layout: post
date: 2016-01-21
title: "Jovani Black A-line Dress 25150 Sleeveless Floor-Length Aline/Princess"
category: Jovani
tags: [Jovani ,Jovani,Aline/Princess ,Illusion,Floor-Length,Sleeveless]
---
### Jovani Black A-line Dress 25150
Just **$443.98**
###   Sleeveless Floor-Length Aline/Princess

BRANDS	Jovani

Silhouette	Aline/Princess

Neckline	Illusion

Hemline/Train	Floor-Length

Sleeve	Sleeveless

Buy it: [https://www.readybrides.com/en/jovani-/39796-jovani-black-a-line-dress-25150.html](https://www.readybrides.com/en/jovani-/39796-jovani-black-a-line-dress-25150.html)


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

namespace YinYang.Api
{
	public class FormValue
	{
		public string StringValue => (this as FormString)?.Value;
		public IEnumerable<FileUpload> FilesValue => (this as FormFiles)?.Files;
	}

	public sealed class FormString : FormValue
	{
		public string Value { get; }
		public FormString(string value)
		{
			if (value == null) throw new ArgumentNullException(nameof(value));
			Value = value;
		}
	}

	public sealed class FormFiles : FormValue
	{
		public IEnumerable<FileUpload> Files { get; }

		public FormFiles(IEnumerable<FileUpload> files)
		{
			if (files == null) throw new ArgumentNullException(nameof(files));
			Files = files.ToArray();
		}
	}

	public sealed class FileUpload
	{
		public string FileName { get; }
		public byte[] Contents { get; }

		public FileUpload(string fileName, byte[] contents)
		{
			FileName = fileName;
			Contents = contents;
		}
	}
}