text:
import logging
import os
import shutil

import pyauto_functional  # Must be imported before pyauto
import pyauto
import test_utils

class PrefsTest(pyauto.PyUITest):
  """TestCase for Preferences."""

  INFOBAR_TYPE = 'rph_infobar'

  def Debug(self):
    """Test method for experimentation.

    This method will not run automatically.
    """
    while True:
      raw_input('Interact with the browser and hit <enter> to dump prefs... ')
      self.pprint(self.GetPrefsInfo().Prefs())

  def testSessionRestore(self):
    """Test session restore preference."""
    url1 = 'http://www.google.com/'
    url2 = 'http://news.google.com/'
    self.NavigateToURL(url1)
    self.AppendTab(pyauto.GURL(url2))
    num_tabs = self.GetTabCount()
    # Set pref to restore session on startup.
    self.SetPrefs(pyauto.kRestoreOnStartup, 1)
    logging.debug('Setting %s to 1' % pyauto.kRestoreOnStartup)
    self.RestartBrowser(clear_profile=False)
    self.assertEqual(self.GetPrefsInfo().Prefs(pyauto.kRestoreOnStartup), 1)
    self.assertEqual(num_tabs, self.GetTabCount())
    self.ActivateTab(0)
    self.assertEqual(url1, self.GetActiveTabURL().spec())
    self.ActivateTab(1)
    self.assertEqual(url2, self.GetActiveTabURL().spec())

  def testNavigationStateOnSessionRestore(self):
    """Verify navigation state is preserved on session restore."""
    urls = ('http://www.google.com/',
            'http://news.google.com/',
            'http://dev.chromium.org/',)
    for url in urls:
      self.NavigateToURL(url)
    tab = self.GetBrowserWindow(0).GetTab(0)
    tab.GoBack()
    self.assertEqual(self.GetActiveTabURL().spec(), urls[-2])
    self.SetPrefs(pyauto.kRestoreOnStartup, 1)  # set pref to restore session
    self.RestartBrowser(clear_profile=False)
    # Verify that navigation state (forward/back state) is restored.
    tab = self.GetBrowserWindow(0).GetTab(0)
    tab.GoBack()
    self.assertEqual(self.GetActiveTabURL().spec(), urls[0])
    for i in (-2, -1):
      tab.GoForward()
      self.assertEqual(self.GetActiveTabURL().spec(), urls[i])

  def testSessionRestoreURLs(self):
    """Verify restore URLs preference."""
    url1 = self.GetFileURLForPath(os.path.join(self.DataDir(), 'title1.html'))
    url2 = self.GetFileURLForPath(os.path.join(self.DataDir(), 'title2.html'))
    # Set pref to restore given URLs on startup
    self.SetPrefs(pyauto.kRestoreOnStartup, 4)  # 4 is for restoring URLs
    self.SetPrefs(pyauto.kURLsToRestoreOnStartup, [url1, url2])
    self.RestartBrowser(clear_profile=False)
    # Verify
    self.assertEqual(self.GetPrefsInfo().Prefs(pyauto.kRestoreOnStartup), 4)
    self.assertEqual(2, self.GetTabCount())
    self.ActivateTab(0)
    self.assertEqual(url1, self.GetActiveTabURL().spec())
    self.ActivateTab(1)
    self.assertEqual(url2, self.GetActiveTabURL().spec())

  def testSessionRestoreShowBookmarkBar(self):
    """Verify restore for bookmark bar visibility."""
    assert not self.GetPrefsInfo().Prefs(pyauto.kShowBookmarkBar)
    self.SetPrefs(pyauto.kShowBookmarkBar, True)
    self.assertEqual(True, self.GetPrefsInfo().Prefs(pyauto.kShowBookmarkBar))
    self.RestartBrowser(clear_profile=False)
    self.assertEqual(True, self.GetPrefsInfo().Prefs(pyauto.kShowBookmarkBar))
    self.assertTrue(self.GetBookmarkBarVisibility())

  def testDownloadDirPref(self):
    """Verify download dir pref."""
    test_dir = os.path.join(self.DataDir(), 'downloads')
    file_url = self.GetFileURLForPath(os.path.join(test_dir, 'a_zip_file.zip'))
    download_dir = self.GetDownloadDirectory().value()
    new_dl_dir = os.path.join(download_dir, 'My+Downloads Folder')
    downloaded_pkg = os.path.join(new_dl_dir, 'a_zip_file.zip')
    os.path.exists(new_dl_dir) and shutil.rmtree(new_dl_dir)
    os.makedirs(new_dl_dir)
    # Set pref to download in new_dl_dir
    self.SetPrefs(pyauto.kDownloadDefaultDirectory, new_dl_dir)
    self.DownloadAndWaitForStart(file_url)
    self.WaitForAllDownloadsToComplete()
    self.assertTrue(os.path.exists(downloaded_pkg))
    shutil.rmtree(new_dl_dir, ignore_errors=True)  # cleanup

  def testToolbarButtonsPref(self):
    """Verify toolbar buttons prefs."""
    # Assert defaults first
    self.assertFalse(self.GetPrefsInfo().Prefs(pyauto.kShowHomeButton))
    self.SetPrefs(pyauto.kShowHomeButton, True)
    self.RestartBrowser(clear_profile=False)
    self.assertTrue(self.GetPrefsInfo().Prefs(pyauto.kShowHomeButton))

  def testNetworkPredictionEnabledPref(self):
    """Verify DNS prefetching pref."""
    # Assert default
    self.assertTrue(self.GetPrefsInfo().Prefs(pyauto.kNetworkPredictionEnabled))
    self.SetPrefs(pyauto.kNetworkPredictionEnabled, False)
    self.RestartBrowser(clear_profile=False)
    self.assertFalse(self.GetPrefsInfo().Prefs(
        pyauto.kNetworkPredictionEnabled))

  def testHomepagePrefs(self):
    """Verify homepage prefs."""
    # "Use the New Tab page"
    self.SetPrefs(pyauto.kHomePageIsNewTabPage, True)
    logging.debug('Setting %s to 1' % pyauto.kHomePageIsNewTabPage)
    self.RestartBrowser(clear_profile=False)
    self.assertEqual(self.GetPrefsInfo().Prefs(pyauto.kHomePageIsNewTabPage),
                     True)
    # "Open this page"
    url = self.GetFileURLForPath(os.path.join(self.DataDir(), 'title1.html'))
    self.SetPrefs(pyauto.kHomePage, url)
    self.SetPrefs(pyauto.kHomePageIsNewTabPage, False)
    self.RestartBrowser(clear_profile=False)
    self.assertEqual(self.GetPrefsInfo().Prefs(pyauto.kHomePage), url)
    self.assertFalse(self.GetPrefsInfo().Prefs(pyauto.kHomePageIsNewTabPage))
    # TODO(nirnimesh): Actually verify that homepage loads.
    # This requires telling pyauto *not* to set about:blank as homepage.

  def testGeolocationPref(self):
    """Verify geolocation pref.

    Checks for the geolocation infobar.
    """
    # GetBrowserInfo() call seems to fail later on in this test. Call it early.
    # crbug.com/89000
    branding = self.GetBrowserInfo()['properties']['branding']
    from webdriver_pages import settings
    from webdriver_pages.settings import Behaviors, ContentTypes
    driver = self.NewWebDriver()
    url = self.GetFileURLForPath(os.path.join(  # triggers geolocation
        self.DataDir(), 'geolocation', 'geolocation_on_load.html'))
    self.assertEqual(3,  # default state
        self.GetPrefsInfo().Prefs(pyauto.kGeolocationDefaultContentSetting))
    self.NavigateToURL(url)
    self.assertTrue(self.WaitForInfobarCount(1))
    self.assertTrue(self.GetBrowserInfo()['windows'][0]['tabs'][0]['infobars'])
    # Disable geolocation
    self.SetPrefs(pyauto.kGeolocationDefaultContentSetting, 2)
    self.assertEqual(2,
        self.GetPrefsInfo().Prefs(pyauto.kGeolocationDefaultContentSetting))
    self.GetBrowserWindow(0).GetTab(0).Reload()
    # Fails on Win7/Vista Chromium bots.  crbug.com/89000
    if (self.IsWin7() or self.IsWinVista()) and branding == 'Chromium':
      return
    behavior = driver.execute_async_script(
        'triggerGeoWithCallback(arguments[arguments.length - 1]);')
    self.assertEqual(
        behavior, Behaviors.BLOCK,
        msg='Behavior is "%s" when it should be BLOCKED.'  % behavior)

  def testUnderTheHoodPref(self):
    """Verify the security preferences for Under the Hood.
    The setting is enabled by default."""
    pref_list = [pyauto.kNetworkPredictionEnabled, pyauto.kSafeBrowsingEnabled,
                 pyauto.kAlternateErrorPagesEnabled,
                 pyauto.kSearchSuggestEnabled, pyauto.kShowOmniboxSearchHint]
    for pref in pref_list:
      # Verify the default value
      self.assertEqual(self.GetPrefsInfo().Prefs(pref), True)
      self.SetPrefs(pref, False)
    self.RestartBrowser(clear_profile=False)
    for pref in pref_list:
      self.assertEqual(self.GetPrefsInfo().Prefs(pref), False)

  def testJavaScriptEnableDisable(self):
    """Verify enabling disabling javascript prefs work """
    self.assertTrue(
        self.GetPrefsInfo().Prefs(pyauto.kWebKitGlobalJavascriptEnabled))
    url = self.GetFileURLForDataPath(
              os.path.join('javaScriptTitle.html'))
    title1 = 'Title from script javascript enabled'
    self.NavigateToURL(url)
    self.assertEqual(title1, self.GetActiveTabTitle())
    self.SetPrefs(pyauto.kWebKitGlobalJavascriptEnabled, False)
    title = 'This is html title'
    self.NavigateToURL(url)
    self.assertEqual(title, self.GetActiveTabTitle())

  def testHaveLocalStatePrefs(self):
    """Verify that we have some Local State prefs."""
    self.assertTrue(self.GetLocalStatePrefsInfo())

  def testAllowSelectedGeoTracking(self):
    """Verify hostname pattern and behavior for allowed tracking."""
    # Default location tracking option "Ask me".
    self.SetPrefs(pyauto.kGeolocationDefaultContentSetting, 3)
    self.NavigateToURL(
        self.GetHttpURLForDataPath('geolocation', 'geolocation_on_load.html'))
    self.assertTrue(self.WaitForInfobarCount(1))
    self.PerformActionOnInfobar('accept', infobar_index=0)  # Allow tracking.
    # Get the hostname pattern (e.g. http://127.0.0.1:57622).
    hostname_pattern = (
        '/'.join(self.GetHttpURLForDataPath('').split('/')[0:3]))
    self.assertEqual(
        # Allow the hostname.
        {hostname_pattern+','+hostname_pattern: {'geolocation': 1}},
        self.GetPrefsInfo().Prefs(pyauto.kContentSettingsPatternPairs))

  def testDismissedInfobarSavesNoEntry(self):
    """Verify dismissing infobar does not save an exception entry."""
    # Default location tracking option "Ask me".
    self.SetPrefs(pyauto.kGeolocationDefaultContentSetting, 3)
    self.NavigateToURL(
        self.GetFileURLForDataPath('geolocation', 'geolocation_on_load.html'))
    self.assertTrue(self.WaitForInfobarCount(1))
    self.PerformActionOnInfobar('dismiss', infobar_index=0)
    self.assertEqual(
        {}, self.GetPrefsInfo().Prefs(pyauto.kContentSettingsPatternPairs))

  def testGeolocationBlockedWhenTrackingDenied(self):
    """Verify geolocations is blocked when tracking is denied.

    The test verifies the blocked hostname pattern entry on the Geolocations
    exceptions page.
    """
    from webdriver_pages import settings
    from webdriver_pages.settings import Behaviors, ContentTypes
    driver = self.NewWebDriver()
    # Ask for permission when site wants to track.
    self.SetPrefs(pyauto.kGeolocationDefaultContentSetting, 3)
    self.NavigateToURL(
        self.GetHttpURLForDataPath('geolocation', 'geolocation_on_load.html'))
    self.assertTrue(self.WaitForInfobarCount(1))
    self.PerformActionOnInfobar('cancel', infobar_index=0)  # Deny tracking.
    behavior = driver.execute_async_script(
        'triggerGeoWithCallback(arguments[arguments.length - 1]);')
    self.assertEqual(
        behavior, Behaviors.BLOCK,
        msg='Behavior is "%s" when it should be BLOCKED.'  % behavior)
    # Get the hostname pattern (e.g. http://127.0.0.1:57622).
    hostname_pattern = (
        '/'.join(self.GetHttpURLForDataPath('').split('/')[0:3]))
    self.assertEqual(
        # Block the hostname.
        {hostname_pattern+','+hostname_pattern: {'geolocation': 2}},
        self.GetPrefsInfo().Prefs(pyauto.kContentSettingsPatternPairs))

  def _CheckForVisibleImage(self, tab_index=0, windex=0):
    """Checks whether or not an image is visible on the webpage.

    Args:
      tab_index: Tab index. Defaults to 0 (first tab).
      windex: Window index. Defaults to 0 (first window).

    Returns:
      True if image is loaded, otherwise returns False if image is not loaded.
    """
    # Checks whether an image is loaded by checking the area (width
    # and height) of the image. If the area is non zero then the image is
    # visible. If the area is zero then the image is not loaded.
    # Chrome zeros the |naturalWidth| and |naturalHeight|.
    script = """
      for (i=0; i < document.images.length; i++) {
        if ((document.images[i].naturalWidth != 0) &&
            (document.images[i].naturalHeight != 0)) {
          window.domAutomationController.send(true);
        }
      }
      window.domAutomationController.send(false);
    """
    return self.ExecuteJavascript(script, windex=windex, tab_index=tab_index)

  def testImageContentSettings(self):
    """Verify image content settings show or hide images."""
    url = self.GetHttpURLForDataPath('settings', 'image_page.html')
    self.NavigateToURL(url)
    self.assertTrue(self._CheckForVisibleImage(),
                    msg='No visible images found.')
    # Set to block all images from loading.
    self.SetPrefs(pyauto.kDefaultContentSettings, {'images': 2})
    self.NavigateToURL(url)
    self.assertFalse(self._CheckForVisibleImage(),
                     msg='At least one visible image found.')

  def testImagesNotBlockedInIncognito(self):
    """Verify images are not blocked in Incognito mode."""
    url = self.GetHttpURLForDataPath('settings', 'image_page.html')
    self.RunCommand(pyauto.IDC_NEW_INCOGNITO_WINDOW)
    self.NavigateToURL(url, 1, 0)
    self.assertTrue(self._CheckForVisibleImage(windex=1),
                    msg='No visible images found in Incognito mode.')

  def testBlockImagesForHostname(self):
    """Verify images blocked for defined hostname pattern."""
    from webdriver_pages import settings
    from webdriver_pages.settings import Behaviors, ContentTypes
    url = 'http://www.google.com'
    driver = self.NewWebDriver()
    page = settings.ManageExceptionsPage.FromNavigation(
        driver, ContentTypes.IMAGES)
    pattern, behavior = (url, Behaviors.BLOCK)
    # Add an exception BLOCK for hostname pattern 'www.google.com'.
    page.AddNewException(pattern, behavior)
    self.NavigateToURL(url)
    self.assertFalse(self._CheckForVisibleImage(),
                     msg='At least one visible image found.')

  def testAllowImagesForHostname(self):
    """Verify images allowed for defined hostname pattern."""
    from webdriver_pages import settings
    from webdriver_pages.settings import Behaviors, ContentTypes
    url = 'http://www.google.com'
    driver = self.NewWebDriver()
    page = settings.ManageExceptionsPage.FromNavigation(
        driver, ContentTypes.IMAGES)
    pattern, behavior = (url, Behaviors.ALLOW)
    # Add an exception ALLOW for hostname pattern 'www.google.com'.
    page.AddNewException(pattern, behavior)
    self.NavigateToURL(url)
    self.assertTrue(self._CheckForVisibleImage(),
                    msg='No visible images found.')

  def testProtocolHandlerRegisteredCorrectly(self):
    """Verify sites that ask to be default handlers registers correctly."""
    url = self.GetHttpURLForDataPath('settings', 'protocol_handler.html')
    self.NavigateToURL(url)
    self.PerformActionOnInfobar(
        'accept', infobar_index=test_utils.WaitForInfobarTypeAndGetIndex(
            self, self.INFOBAR_TYPE))
    driver = self.NewWebDriver()
    driver.find_element_by_id('test_protocol').click()
    self.assertTrue(
        driver.execute_script('return verifyQueryConformsToProtocol();'),
        msg='Protocol did not register correctly.')

if __name__ == '__main__':
  pyauto_functional.Main()


text:
FROM phusion/baseimage:0.9.16
MAINTAINER Mike McCallister <mike@mccllstr.com>

# ----------------------------------------------------------------------------
# Pull in the components we need from Ubuntu. This is done here
# instead of in the server setup script because it lets Docker take
# advantage of its cache, which greatly speeds up subsequent builds.

RUN apt-get update \
    && apt-get install --no-install-recommends --no-install-suggests -y \
        apg \
        curl \
        git-core \
        haveged \
        ipython-notebook \
        openjdk-7-jre-headless \
        openssl \
        psmisc \
        python-imaging \
        python-pip \
        python-pygame \
        supervisor \
        tmux \
        unison \
        unzip \
        zip \
    && apt-get clean \
    && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

# Upgrade IPython to get improved usability of the Notebook server
RUN pip install --upgrade jsonschema==2.4.0 tornado==4.0.0 ipython==3.1.0

# ----------------------------------------------------------------------------
# Minor configurations

# Set up Supervisor to run the pieces of the student's environment
COPY minecraft-lab.conf /etc/supervisor/conf.d/minecraft-lab.conf

# Copy our convenience commands into the image
COPY commands/ /usr/local/bin

# Expose the ports for the IPython notebook server and Minecraft
EXPOSE 8888
EXPOSE 25565

# Set the default command when a container is run
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/supervisord.conf"]

# Set up the student user
RUN ["adduser", "student", "--disabled-password", "--disabled-login", "--gecos", ""]

# ----------------------------------------------------------------------------
# Prepare the image to run the Canary (Minecraft) Server

# Copy the default Canary configuration/files/world into the image

# NOTE: the contents of the following directory can be recreated with
# the following commands:
#
#     rm -rf server-files/*
#     cd server-files
#     java -jar CANARY_JAR_FILE nogui
#
# Then, make the necessary edits by hand. Do this if the Canary
# version moves ahead far enough that we need to create new default
# configuration files.

COPY default-canary-files/ /usr/local/share/default-canary-files/

# Get a copy of the RaspberryJuice plugin from GitHub

ADD https://github.com/martinohanlon/CanaryRaspberryJuice/blob/master/jars/canaryraspberryjuice-1.3.jar?raw=true /usr/local/share/default-canary-files/plugins/

# Download the Canary jar file

#ADD https://ci.visualillusionsent.net/job/CanaryMod/805/artifact/target/CanaryMod-1.8.0-1.2.1-SNAPSHOT-shaded.jar /usr/local/bin/
ADD http://canarymod.net/releases/CanaryMod-1.2.0.jar /usr/local/bin/CanaryMod-1.8.0-1.2.0-shaded.jar

redpajama_set_name: RedPajamaGithub


text:
namespace sql {

SQLTestSuite::SQLTestSuite(int argc, char** argv)
    : base::TestSuite(argc, argv) {}

SQLTestSuite::~SQLTestSuite() = default;

void SQLTestSuite::Initialize() {
  base::TestSuite::Initialize();
  sql::test::RegisterPathProvider();
}

void SQLTestSuite::Shutdown() {
  base::TestSuite::Shutdown();
}

}  // namespace sql


text:
package com.tomgibara.chess;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.function.Consumer;

public class Sequence {

	private final Pieces pieces;
	private final List<Position> positions;
	public final boolean mutable;
	private int index = 0;

	// used to create a new continuation of a sequence at a specific position
	private Sequence(Sequence that) {
		pieces = that.pieces.mutableCopy();
		positions = new ArrayList<>();
		positions.add( that.position().copy(this) );
		mutable = true;
	}

	// used to create a new continuation of a sequence after a particular move
	private Sequence(Position position, int code) {
		//TODO assumes supplied position is 'active' in its sequence
		pieces = position.sequence.pieces.mutableCopy();
		positions = new ArrayList<>();
		positions.add( position.copy(this, code) );
		mutable = true;
	}

	// used to create a copy of a sequence
	private Sequence(Sequence that, boolean mutable) {
		this.pieces = that.pieces.mutableCopy();
		List<Position> positions;
		if (mutable) {
			Position[] array = new Position[ that.positions.size() ];
			positions = Arrays.asList( that.positions.toArray(array) );
		} else {
			positions = new ArrayList<>(that.positions);
		}
		this.positions = positions;
		this.mutable = mutable;
	}

	public Sequence() {
		this(Board.initial().pieces, Colour.WHITE);
	}

	Sequence(Pieces pieces, Colour toMove) {
		this(pieces, toMove, CastlingRights.BG_BC_WG_WC, null);
	}

	Sequence(Pieces pieces, Colour toMove, CastlingRights castlingRights, File enPassantFile) {
		this(pieces, toMove, castlingRights, enPassantFile, 0, 0);
	}

	Sequence(Pieces pieces, Colour toMove, CastlingRights castlingRights, File enPassantFile, int moveNumber, int stalemateClock) {
		if (pieces == null) throw new IllegalArgumentException("null pieces");
		if (toMove == null) throw new IllegalArgumentException("null toMove");
		if (castlingRights == null) throw new IllegalArgumentException("null castlingRights");
		if (moveNumber < 0) throw new IllegalArgumentException("negative moveNumber");
		if (stalemateClock < 0) throw new IllegalArgumentException("negative stalemateClock");
		this.pieces = pieces.mutableCopy();
		positions = new ArrayList<>();
		positions.add( new Position(this, toMove, castlingRights, enPassantFile, moveNumber, stalemateClock) );
		mutable = true;
	}

	public int length() {
		return positions.size();
	}

	public Position position() {
		return positions.get(index);
	}

	public Position initialPosition() {
		index = 0;
		return position();
	}

	public Position finalPosition() {
		index = positions.size() - 1;
		return position();
	}

	public Position position(int index) {
		if (index < 0) throw new IllegalArgumentException();
		if (index >= positions.size()) throw new IllegalArgumentException();
		return positions.get(index);
	}

	public Sequence newContinuation() {
		return new Sequence(this);
	}

	public void setLength(int length) {
		int size = positions.size();
		if (length == size) return;
		if (length > size) throw new IllegalArgumentException();
		checkMutable();
		discard(length);
	}

	public void forEach(Consumer<Position> action) {
		forEachImpl(action, 0, length());
	}

	public void forEach(Consumer<Position> action, int fromIndex, int toIndex) {
		if (fromIndex < 0) throw new IllegalArgumentException("negative fromIndex");
		if (toIndex > length()) throw new IllegalArgumentException("toIndex exceeds length");
		if (fromIndex > toIndex) throw new IllegalArgumentException("fromIndex exceeds toIndex");
		if (toIndex != fromIndex) forEachImpl(action, fromIndex, toIndex);
	}

	public Sequence immutable() {
		return mutable ? new Sequence(this, false) : this;
	}

	public Sequence mutableCopy() {
		return new Sequence(this, true);
	}

	Board newBoard() {
		return new Board(pieces);
	}

	// position assumed to be active
	Position makeMove(Position position, int code) {
		Position p;
		if (mutable && position.isLast()) {
			p = position.copy(this, code);
			positions.add(p);
			index ++; // since position copy will have advanced state of pieces
		} else {
			p = new Sequence(position, code).position();
		}
		return p;
	}

	int index() {
		return index;
	}

	void toIndex(int toIndex) {
		if (index == toIndex) return;

		while (index > toIndex) { // work backwards
			positions.get(index--).unapply(pieces);
		}

		while (index < toIndex) { // work forwards
			positions.get(++index).apply(pieces);
		}
	}

	void discard(int fromIndex) {
		int size = positions.size();
		if (fromIndex + 1 == size) {
			Position position = positions.remove(fromIndex);
			position.markAsDiscarded();
		} else {
			List<Position> list = fromIndex == 0 ? positions : positions.subList(fromIndex, size);
			list.forEach(p -> p.markAsDiscarded());
			list.clear();
		}
	}

	private void forEachImpl(Consumer<Position> action, int fromIndex, int toIndex) {
		for (int i = fromIndex; i < toIndex; i++) {
			action.accept(positions.get(i));
		}
	}

	private void checkMutable() {
		if (!mutable) throw new IllegalStateException("immutable");
	}

}


text: CKEDITOR.plugins.setLang("sourcedialog","fi",{toolbar:"Koodi",title:"Koodi"});


text:
// Boost.Units - A C++ library for zero-overhead dimensional analysis and
// unit/quantity manipulation and conversion
//
// Copyright (C) 2003-2008 Matthias Christian Schabel
// Copyright (C) 2007-2008 Steven Watanabe
//
// Distributed under the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)

/**
\file

\brief test_unscale.cpp

\details
Test that unscale works in an attempt to isolate the sun problems.

Output:
@verbatim
@endverbatim
**/

#include <boost/units/reduce_unit.hpp>
#include <boost/units/detail/unscale.hpp>
#include <boost/units/base_units/temperature/fahrenheit.hpp>

#include <boost/mpl/assert.hpp>
#include <boost/type_traits/is_same.hpp>

BOOST_MPL_ASSERT((boost::is_same<boost::units::unscale<boost::units::temperature::fahrenheit_base_unit::unit_type::system_type>::type,
                  boost::units::temperature::fahrenheit_base_unit::unit_type::system_type>));

BOOST_MPL_ASSERT((boost::is_same<boost::units::unscale<boost::units::temperature::fahrenheit_base_unit::unit_type>::type,
                 boost::units::temperature::fahrenheit_base_unit::unit_type>));

BOOST_MPL_ASSERT((boost::is_same<boost::units::unscale<boost::units::reduce_unit<boost::units::temperature::fahrenheit_base_unit::unit_type>::type>::type,
                 boost::units::temperature::fahrenheit_base_unit::unit_type>));

BOOST_MPL_ASSERT((boost::is_same<
                    boost::units::temperature::fahrenheit_base_unit::unit_type,
                    boost::units::unit<
                        boost::units::temperature_dimension,
                        boost::units::heterogeneous_system<
                            boost::units::heterogeneous_system_impl<
                                boost::units::list<
                                    boost::units::heterogeneous_system_dim<
                                        boost::units::temperature::fahrenheit_base_unit,
                                        boost::units::static_rational<1>
                                    >,
                                    boost::units::dimensionless_type
                                >,
                                boost::units::temperature_dimension,
                                boost::units::dimensionless_type
                            >
                        >
                    >
>));


text:
SYNONYM

#### According to
Index Fungorum

#### Published in
Syll. fung. (Abellini) 8: 801 (1889)

#### Original name
Patellaria hyperici W. Phillips

### Remarks
null


text:
//
//  PushTableViewCell.h
//  LXFrameWork_OC
//
//  Created by 李晓 on 15/12/22.
//  Copyright © 2015年 LXFrameWork. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <WatchKit/WatchKit.h>

@interface PushTableViewCell : NSObject

/**
 *  Cell 显示的图片
 */
@property (unsafe_unretained, nonatomic) IBOutlet WKInterfaceImage *cellImage;
/**
 *  Cell 显示的名称
 */
@property (unsafe_unretained, nonatomic) IBOutlet WKInterfaceLabel *cellLabel;

@end


text:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Rest {

	private $CI;

	private $code = array(
							402 => 'Invalid Token',
							403 => 'Token has been expired',
							400 => 'Success',
							405 => 'Invalid request type',
							406 => 'Invalid data',
							407 => 'Wrong user details',
							408 => 'token missing',
							409 => 'user already exist',
							410 => 'user already liked this post',
							411 => 'post should not null'
						 );

	function __construct(){

		$this->CI = & get_instance();
	}

	public function tokenValidate($token = ''){

		if($token == '4028b71c7f65566d9eef6a0b8a229ec9'){

			return true;
		}else{

			$data['code'] = 402;
			$this->response($data);
		}

		$ValidateToken = $this->CI->db->get_where('tokens',array('token'=>$token));

		if($ValidateToken->num_rows()==1){

			$TokenData = $ValidateToken->row();

			$to_time = strtotime($TokenData->timestamp);

			$from_time = strtotime(date('Y-m-d H:i:s'));

			$Minuts = round(abs($from_time - $to_time) / 60,2);

			if($Minuts>15){

				$DeleteOldToken = $this->CI->db->where('token',$token)->delete('tokens');

				$data['code'] = 403;

				$this->response($data);

			}else{

				$UpdateTimeStamp = $this->CI->db->where('token',$token)->update('tokens',array('timestamp'=>date('Y-m-d H:i:s')));

				return true;
			}

		}else{ // Token Not Found in Database

			$data['code'] = 402;

			$this->response($data);
		}
	}

	public function response($response = array()){

		if(isset($response['message'])){

			echo json_encode($response);

			exit;
		}else{

			$response['message'] = $this->code[$response['code']];

			echo json_encode($response);

			exit;
		}
	}

	public function getResponse(){

		$postData = $this->CI->input->post();
		return $postData;
	}
}


text:
package gitea

type MarkdownOption struct {
	Text    string
	Mode    string
	Context string
}


text:
package com.pedro.rocha.rater.views;

import android.app.Activity;
import android.widget.Toast;

import com.google.android.gms.auth.api.signin.GoogleSignInApi;
import com.pedro.rocha.rater.R;
import com.pedro.rocha.rater.domain.User;
import com.pedro.rocha.rater.presenters.LoginPresenter;

import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.powermock.core.classloader.annotations.PrepareForTest;
import org.powermock.modules.junit4.PowerMockRunner;

import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic;
import static org.hamcrest.CoreMatchers.instanceOf;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import static org.powermock.api.mockito.PowerMockito.mockStatic;

@RunWith(PowerMockRunner.class)
@PrepareForTest({Toast.class, GoogleSignInApi.class})
public class LoginViewTest {

    @Mock
    private Activity activity;

    private LoginView loginView;

    @Before
    public void setUp() {
        loginView = new LoginView(activity);
    }

    @Test
    public void shouldBeAnInstanceOfLoginPresenterView() {
        assertThat(loginView, is(instanceOf(LoginPresenter.View.class)));
    }

    @Test
    public void shouldCallToastWithSuccessMessage() {
        String successMessage = randomAlphabetic(10);
        String name = randomAlphabetic(20);
        Toast toast = mock(Toast.class);
        User user = mock(User.class);
        mockStatic(Toast.class);
        when(user.getName()).thenReturn(name);
        when(activity.getString(R.string.login_success)).thenReturn(successMessage);
        when(Toast.makeText(activity, successMessage + ": " + name, Toast.LENGTH_LONG))
                .thenReturn
                (toast);

        loginView.successLogin(user);

        verify(toast).show();
    }

    @Test
    public void shouldCallToastWithFailureMessage() {
        Toast toast = mock(Toast.class);
        mockStatic(Toast.class);
        when(Toast.makeText(activity, R.string.login_failed, Toast.LENGTH_SHORT)).thenReturn
                (toast);

        loginView.failLogin();

        verify(toast).show();
    }
}


text:
// This class has been generated, DO NOT EDIT!

package org.tensorflow.op.math;

import java.util.Arrays;
import org.tensorflow.GraphOperation;
import org.tensorflow.Operand;
import org.tensorflow.Operation;
import org.tensorflow.OperationBuilder;
import org.tensorflow.Output;
import org.tensorflow.op.RawOp;
import org.tensorflow.op.RawOpInputs;
import org.tensorflow.op.Scope;
import org.tensorflow.op.annotation.Endpoint;
import org.tensorflow.op.annotation.OpInputsMetadata;
import org.tensorflow.op.annotation.OpMetadata;
import org.tensorflow.op.annotation.Operator;
import org.tensorflow.proto.framework.DataType;
import org.tensorflow.types.family.TType;

/**
 * Returns 0 if x == 0, and x * log(y) otherwise, elementwise.
 *
 * @param <T> data type for {@code z} output
 */
@OpMetadata(
    opType = Xlogy.OP_NAME,
    inputsClass = Xlogy.Inputs.class
)
@Operator(
    group = "math"
)
public final class Xlogy<T extends TType> extends RawOp implements Operand<T> {
  /**
   * The name of this op, as known by TensorFlow core engine
   */
  public static final String OP_NAME = "Xlogy";

  private Output<T> z;

  public Xlogy(Operation operation) {
    super(operation, OP_NAME);
    int outputIdx = 0;
    z = operation.output(outputIdx++);
  }

  /**
   * Factory method to create a class wrapping a new Xlogy operation.
   *
   * @param scope current scope
   * @param x The x value
   * @param y The y value
   * @param <T> data type for {@code Xlogy} output and operands
   * @return a new instance of Xlogy
   */
  @Endpoint(
      describeByClass = true
  )
  public static <T extends TType> Xlogy<T> create(Scope scope, Operand<T> x, Operand<T> y) {
    OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Xlogy");
    opBuilder.addInput(x.asOutput());
    opBuilder.addInput(y.asOutput());
    return new Xlogy<>(opBuilder.build());
  }

  /**
   * Gets z.
   *
   * @return z.
   */
  public Output<T> z() {
    return z;
  }

  @Override
  public Output<T> asOutput() {
    return z;
  }

  @OpInputsMetadata(
      outputsClass = Xlogy.class
  )
  public static class Inputs<T extends TType> extends RawOpInputs<Xlogy<T>> {
    /**
     * The x input
     */
    public final Operand<T> x;

    /**
     * The y input
     */
    public final Operand<T> y;

    /**
     * The T attribute
     */
    public final DataType T;

    public Inputs(GraphOperation op) {
      super(new Xlogy<>(op), op, Arrays.asList("T"));
      int inputIndex = 0;
      x = (Operand<T>) op.input(inputIndex++);
      y = (Operand<T>) op.input(inputIndex++);
      T = op.attributes().getAttrType("T");
    }
  }
}


text:
<!DOCTYPE HTML>

    <meta http-equiv="content-type" content="text/html; charset=utf-8">
    <meta name="viewport" content="width=device-width, user-scalable=no">
    <link rel="stylesheet" href="css/main.css">
    <title>Video Puzzle</title>
    <link rel="apple-touch-icon" sizes="57x57" href="/meta/apple-touch-icon-57x57.png">
    <link rel="apple-touch-icon" sizes="60x60" href="/meta/apple-touch-icon-60x60.png">
    <link rel="apple-touch-icon" sizes="72x72" href="/meta/apple-touch-icon-72x72.png">
    <link rel="apple-touch-icon" sizes="76x76" href="/meta/apple-touch-icon-76x76.png">
    <link rel="apple-touch-icon" sizes="114x114" href="/meta/apple-touch-icon-114x114.png">
    <link rel="apple-touch-icon" sizes="120x120" href="/meta/apple-touch-icon-120x120.png">
    <link rel="apple-touch-icon" sizes="144x144" href="/meta/apple-touch-icon-144x144.png">
    <link rel="apple-touch-icon" sizes="152x152" href="/meta/apple-touch-icon-152x152.png">
    <link rel="apple-touch-icon" sizes="180x180" href="/meta/apple-touch-icon-180x180.png">
    <link rel="icon" type="image/png" href="/meta/favicon-32x32.png" sizes="32x32">
    <link rel="icon" type="image/png" href="/meta/android-chrome-192x192.png" sizes="192x192">
    <link rel="icon" type="image/png" href="/meta/favicon-96x96.png" sizes="96x96">
    <link rel="icon" type="image/png" href="/meta/favicon-16x16.png" sizes="16x16">
    <link rel="manifest" href="/manifest.json">
    <link rel="mask-icon" href="/meta/safari-pinned-tab.svg" color="#5bbad5">
    <meta name="msapplication-TileColor" content="#da532c">
    <meta name="msapplication-TileImage" content="/meta/mstile-144x144.png">
    <meta name="theme-color" content="#118a65">

Video Puzzle

      <video autoplay></video>

        <canvas id="canvas"></canvas>

You !

            <button id="restart">Restart</button>

<button id="shuffle">New Game</button>

<button id="sort" class="disabled">Surrender</button>


text:
A basic css-framework.

Take a look at [the demo](https://philippg777.github.io/pg.css/docu/showcase/test.html) of all elements.
And take a look at the [documentation](https://philippg777.github.io/pg.css/docu/). (comming soon)

There is also a CDN:

[![](https://data.jsdelivr.com/v1/package/gh/philippG777/pg.css/badge)](https://www.jsdelivr.com/package/gh/philippG777/pg.css)


text:
.. _signdy-data:

Data Collection with PDB IDs
===============================================================================

The first step in signature dynamics analysis is to collect a set of related
protein structures and build a :class:`.PDBEnsemble`. This can be achieved by
multiple routes: a query search of the PDB using :func:`.blastPDB` or :func:`.searchDali`,
extraction of PDB IDs from the Pfam or CATH database, or input of a pre-defined list.

We demonstrate the usage of SignDy with a pre-defined list of transporter proteins sharing
the common LeuT fold [YS13]_. These proteins cycle through four typical states to transport
a substrate molecule: outward-facing open (OFo), outward-facing closed (OFc), inward-facing
open (IFo), inward-facing closed (IFc), but only the first three states have PDB structures
available. If you know how to prepare an ensemble of structural homologs and wish to skip
this part, you can download the ensemble file used in [SZ18]_ from here and proceed to the
next tutorial.

First, make necessary imports from ProDy_ and Matplotlib_ packages if you haven't already.

.. ipython:: python

    from prody import *
    from pylab import *
    ion()

Prepare ensemble
-------------------------------------------------------------------------------

For convinience and clarity, we define LeuT folds in separate lists taxonomically. For example,
the PDB identifiers for bacterial Leucine transporters are defined as follows:

.. ipython:: python

    LeuTs = ['2A65', '2Q6H', '2Q72', '2QB4', '2QEI', '2QJU', '3F3A', '3F3C',
             '3F3D', '3F3E', '3F48', '3F4I', '3F4J', '3GJC', '3GJD', '3GWU',
             '3GWV', '3GWW', '3MPN', '3MPQ', '3QS4', '3QS5', '3QS6', '3TT1',
             '3TU0', '3USG', '3USI', '3USJ', '3USK', '3USL', '3USM', '3USO',
             '3USP', '4FXZ', '4FY0', '4HMK', '4HOD', '4MM4', '4MM5', '4MM6',
             '4MM7', '4MM8', '4MM9', '4MMA', '4MMB', '4MMC', '4MMD', '4MME',
             '4MMF', '3TT3']

Despite the fact that bacterial Leucine transporters can form dimers, we will only take the
chain A in each structure:

.. ipython:: python

    LeuTs = [protID + 'A' for protID in LeuTs]

Note that in the above line, we use `list comprehension`_ to add a letter 'A' to each PDB
identifier in the list to select chain A. We define other LeuT folds similarily:

.. ipython:: python

    DATs = ['4M48', '4XNU', '4XNX', '4XP1', '4XP4', '4XP5', '4XP6',
            '4XP9C', '4XPA', '4XPB', '4XPF', '4XPG', '4XPH', '4XPT']
    DATs = [protID + 'A' for protID in DATs if protID is not '4XP9C']
    MhsTs = ['4US4A', '4US3A']
    vSGLTs = ['2XQ2A']
    Mhp1s = ['2JLN', '2X79', '4D1A', '4D1B', '4D1C', '4D1D']
    Mhp1s = [protID + 'A' for protID in Mhp1s]
    BetPs = ['2WITA', '2WITB', '2WITC', '3P03A', '3P03B', '3P03C',
             '4AINA', '4AINB', '4AINC', '4C7RA', '4C7RB', '4C7RC',
             '4DOJA', '4DOJB', '4DOJC', '4LLHA', '4LLHB', '4LLHC']
    AdiCs = ['3L1L', '3LRB', '3LRC', '3NCY', '3OB6', '5J4I', '5J4N']
    AdiCs = [protID + 'A' for protID in AdiCs]
    CaiTs = ['4M8JA', '2WSXA', '2WSXB', '2WSXC', '2WSWA', '3HFXA']

:func:`.parsePDB` allows us to parse multiple structures all at once, and we can use it to
load all the PDB structures into ProDy_ in one line. We only need the alpha carbon for our
purpose, so we set ``subset='ca'``:

.. ipython:: python

    pdb_ids = LeuTs + DATs + MhsTs + vSGLTs + Mhp1s + BetPs + AdiCs + CaiTs
    ags = parsePDB(pdb_ids)
    len(ags)

Any element in the list *ags* should be an :class:`.AtomGroup` instance. We can conveniently
feed this list to :func:`.buildPDBEnsemble` and let it build an :class:`.PDBEnsemble` for downstream
analyses. We set ``mapping=ce`` to tell the function to use a structure alignment algorithm,
CEalign [IS98]_, for building the ensemble. We also set ``seqid=0`` and ``overlap=0`` to make sure
we apply no threshold of sequence identity or coverage/overlap to the building process.

.. ipython:: python

    ens = buildPDBEnsemble(ags, mapping='ce', seqid=0, overlap=0, title='LeuT', subset='ca')
    ens

Finally we save the ensemble for later processing:

.. ipython:: python

    saveEnsemble(ens, 'LeuT')

A more refined alignment procedure was adopted in the [SZ18]_ paper. A representative structure is chosen
from each subtype of the proteins, e.g. LeuT, DAT, etc., and they are aligned to the LeuT representative
using CEalign [IS98]_. Then the rest are aligned to the representative structure of their own kind using
the pairwise alignment algorithm because they are sequentially the same despite small differences.

.. _`Structure Analysis Tutorial`: http://prody.csb.pitt.edu/tutorials/structure_analysis/blastpdb.html
.. _`list comprehension`: https://docs.python.org/2/tutorial/datastructures.html#list-comprehensions

.. [YS13] Shi Y.
    Common folds and transport mechanisms of secondary active transporters.
    *Annu. Rev. Biophys.* **2013** 42:51-72


text:
Modern Optimization Methods in Python
=======================================

Highly-constrained, large-dimensional, and non-linear optimizations are found
at the root of most of today's forefront problems in statistics,
quantitative finance, risk, operations research, materials design, and other
predictive sciences. Tools for optimization, however, have not changed much in
the past 40 years -- until very recently. The abundance of parallel computing
resources has stimulated a shift away from using reduced models to solve
statistical and predictive problems, and toward more direct methods for solving
high-dimensional nonlinear optimization problems.

This tutorial will introduce
modern tools for solving optimization problems -- beginning with traditional
methods, and extending to solving high-dimensional non-convex optimization
problems with highly nonlinear constraints. We will start by introducing the
cost function, and it's use in local and global optimization. We will then
address how to monitor and diagnose your optimization convergence and results,
tune your optimizer, and utilize compound termination conditions. This tutorial
will discuss building and applying box constraints, penalty functions, and
symbolic constraints. We will then demonstrate methods to efficiently reduce
search space through the use of robust optimization constraints. Real-world
inverse problems can be expensive, thus we will show how to enable your
optimization to seamlessly leverage parallel computing. Large-scale
optimizations also can greatly benefit from efficient solver restarts and the
saving of state. This tutorial will cover using asynchronous computing for
results caching and archiving, dynamic real-time optimization, and dimensional
reduction. Next we will discuss new optimization methods that leverage parallel
computing to perform blazingly-fast global optimizations and n-dimensional
global searches. Finally, we will close with applications of global
optimization in statistics and quantitative finance.

The audience need not be
an expert in optimization, but should have interest in solving hard real-world
optimization problems. We will begin with a walk through some introductory
optimizations, learning how to build confidence in understanding your results.
By the end of the tutorial, participants will have working knowledge of how to
use modern constrained optimization tools, how to enable their solvers to
leverage high-performance parallel computing, and how to utilize legacy data
and surrogate models in statistical and predictive risk modeling.

Content
---------

All tutorial content can be obtained from this repository either with
`git, or by downloading the repository content as a zip file.  If you use
git, you can clone this repostory with::

    $ git clone https://github.com/mmckerns/tutmom.git

or, download and unzip the zipfile.

As the day of the tutorial get nearer, it is highly recommended to update
this repository.  When tutorial content is added or modified, it is
recommended to update your copy of the tutorial.  Tutorial content may be
updated up to the day of the tutorial, during the tutorial, and beyond.
To update your copy of the tutorial content with git, change to the tutorial
directory (i.e. `tutmom`), then pull an update with::

    $ git pull

or, download and unzip a new copy of the zipfile.

Requirements
--------------

To be able to run the examples, demos, and exercises in this tutorial,
the following packages must be installed::

    numpy >= 1.0,
    scipy >= 0.6.0,
    sympy >= 0.6.7,
    matplotlib >= 0.91,
    pox >= 0.2.2,
    dill >= 0.2.4,
    multiprocess >= 0.70.3,
    ppft >= 1.6.4.5,
    klepto >= 0.1.1,
    pathos >= 0.2a1.dev0,
    mystic >= 0.2a2.dev0

and optionally::

    sqlalchemy >= 0.8.4

Installation
--------------

All packages can be installed with `pip`::

    >$ pip install setuptools
    >$ pip install numpy
    >$ pip install sympy
    >$ pip install git+https://github.com/uqfoundation/pathos.git@master
    >$ pip install git+https://github.com/uqfoundation/mystic.git@master
    >$ pip install matplotlib
    >$ pip install scipy

and optionally::

    >$ pip install sqlalchemy

The `pip` installs of `numpy`, `matplotlib`, and `scipy` often fail.
A more stable choice for installing these three packages is to use a
scientific python distribution such as `canopy` or `anaconda`.

The following steps were used by the tutorial author to test on Windows:

    # installed Visual Studio Community 2015 RC
    # installed Python Tools 2.2 RC for Visual Studio 2015
    # installed Microsoft Visual C++ Compiler for Python 2.7
    # installed Miniconda 3.10.1 (64-bit) for Python 2.7
    # installed Git for Windows 1.9.5-preview20150319 (including cmd tools)
    >$ conda install pip
    >$ conda install setuptools
    >$ conda install numpy
    >$ conda install scipy
    >$ conda install matplotlib
    >$ conda install sympy
    >$ conda install sqlalchemy
    # get https://github.com/uqfoundation/pox/blob/master/tools/pythonstartup
    # save as ~\.python (also add as PYTHONSTARTUP to environment variables)
    # associate .py file with conda's python.exe
    # fix bug where conda doesn't respect all `sys.argv`
    #   regedit HKEY_CLASSES_ROOT\Applications\python27.exe\shell\open\command
    #   regedit HKEY_CLASSES_ROOT\py_auto_file\shell\open\command
    >$ pip install git+https://github.com/uqfoundation/pathos.git@master
    >$ pip install git+https://github.com/uqfoundation/mystic.git@master

Verification
--------------

To test your installation, change to the tutorial directory, and run::

    >$ python check_env.py
    OK.

If you choose not install all optional dependencies, you will see a warning::

    >$ python check_env.py
    sqlalchemy:: No module named sqlalchemy

Feel free to ignore warnings for optional dependencies.


text:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Changelog for package agvs_sim_bringup
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Forthcoming
-----------
* indigo-0.1.1
* Redoing CHANGELOGS

0.1.1 (2015-07-29)
------------------
* Adding changelogs for the release
* Adding the install macro to the CMakelists
* Cleaning CMakelists and more
* First indigo version commit
* Contributors: Elena Gambaro, RomanRobotnik


text:
/**
 * Created by Alex on 10/6/15.
 */

/*********************************************************************************************************
 * <lab-details>
 *     This directive is the primary view for labs.  It enables information to be modified and also
 *     aggregates information.
 *
 *********************************************************************************************************/

miz.directive("dashItemHome", function () {
    return {
        restrict: 'E',
        templateUrl: 'client/dashboard/components/dash-item-home/dash-item-home.ng.html',
        controllerAs: 'db_home',
        bindToController: true,
        scope: {},
        transclude: true,
        controller: function ($scope, $reactive) {

            $reactive(this).attach($scope);

            /** HELPERS **/

            this.helpers({
                o2w_serial: () => {

                    if (Meteor.user()) {
                        let user = Meteor.user();
                        return user.profile.o2w_serial;
                    }
                }
            });

            /** SUBSCRIPTIONS **/

            /** AUTORUN**/
            this.autorun(() => {

                /** UPDATE FUNDAMENTAL PARTNER FIELDS IN METEOR WHEN ANGULAR CHANGES **/
                //run autorun anytime any of these primary partner fields change
                //not included are arrays because this causes an infiite loop
                //of updating and digestion
                /* NOT INCLUDED
                 this.getReactively('partner.parentPartners');
                 this.getReactively('partner.bizDevOwners');
                 */

            }); //autorun

            /** FUNCTIONS */

            //mark this item, active

            /** INITIALIZE */

        } // controller
    };  //return
});


text:
import theano.tensor as tt
import pymc3 as pm

class HotBinomial(pm.Binomial):
    """
    A "hot" Binomial distribution.

    Parameters
    ----------
    beta_temp : float on interval [0, 1]
        Beta value (inverse temperature) of the distribution.

    Returns
    -------
    output : pymc3 distribution
        Hot Binomial distribution.
    """
    def __init__(self, beta_temp, *args, **kwargs):
        super(HotBinomial, self).__init__(*args, **kwargs)
        if not (0 < beta_temp <= 1):
            raise RuntimeError('Must have 0 < beta_temp ≤ 1.')
        self.beta_temp = beta_temp

    def logp(self, value):
        return self.beta_temp * pm.Binomial.logp(self, value)

class HotBetaBinomial(pm.BetaBinomial):
    """
    A "hot" BetaBinomial distribution.

    Parameters
    ----------
    beta_temp : float on interval [0, 1]
        Beta value (inverse temperature) of the distribution.

    Returns
    -------
    output : pymc3 distribution
        Hot BetaBinomial distribution.
    """
    def __init__(self, beta_temp, *args, **kwargs):
        super(HotBetaBinomial, self).__init__(*args, **kwargs)
        if not (0 < beta_temp <= 1):
            raise RuntimeError('Must have 0 < beta_temp ≤ 1.')
        self.beta_temp = beta_temp

    def logp(self, value):
        return self.beta_temp * pm.BetaBinomial.logp(self, value)

class HotBernoulli(pm.Bernoulli):
    """
    A "hot" Bernoulli distribution.

    Parameters
    ----------
    beta_temp : float on interval [0, 1]
        Beta value (inverse temperature) of the distribution.

    Returns
    -------
    output : pymc3 distribution
        Hot Bernoulli distribution.
    """
    def __init__(self, beta_temp, *args, **kwargs):
        super(HotBernoulli, self).__init__(*args, **kwargs)
        if not (0 < beta_temp <= 1):
            raise RuntimeError('Must have 0 < beta_temp ≤ 1.')
        self.beta_temp = beta_temp

    def logp(self, value):
        return self.beta_temp * pm.Bernoulli.logp(self, value)

class HotDiscreteWeibull(pm.DiscreteWeibull):
    """
    A "hot" DiscreteWeibull distribution.

    Parameters
    ----------
    beta_temp : float on interval [0, 1]
        Beta value (inverse temperature) of the distribution.

    Returns
    -------
    output : pymc3 distribution
        Hot DiscreteWeibull distribution.
    """
    def __init__(self, beta_temp, *args, **kwargs):
        super(HotDiscreteWeibull, self).__init__(*args, **kwargs)
        if not (0 < beta_temp <= 1):
            raise RuntimeError('Must have 0 < beta_temp ≤ 1.')
        self.beta_temp = beta_temp

    def logp(self, value):
        return self.beta_temp * pm.DiscreteWeibull.logp(self, value)

class HotPoisson(pm.Poisson):
    """
    A "hot" Poisson distribution.

    Parameters
    ----------
    beta_temp : float on interval [0, 1]
        Beta value (inverse temperature) of the distribution.

    Returns
    -------
    output : pymc3 distribution
        Hot Poisson distribution.
    """
    def __init__(self, beta_temp, *args, **kwargs):
        super(HotPoisson, self).__init__(*args, **kwargs)
        if not (0 < beta_temp <= 1):
            raise RuntimeError('Must have 0 < beta_temp ≤ 1.')
        self.beta_temp = beta_temp

    def logp(self, value):
        return self.beta_temp * pm.Poisson.logp(self, value)

class HotNegativeBinomial(pm.NegativeBinomial):
    """
    A "hot" NegativeBinomial distribution.

    Parameters
    ----------
    beta_temp : float on interval [0, 1]
        Beta value (inverse temperature) of the distribution.

    Returns
    -------
    output : pymc3 distribution
        Hot NegativeBinomial distribution.
    """
    def __init__(self, beta_temp, *args, **kwargs):
        super(HotNegativeBinomial, self).__init__(*args, **kwargs)
        if not (0 < beta_temp <= 1):
            raise RuntimeError('Must have 0 < beta_temp ≤ 1.')
        self.beta_temp = beta_temp

    def logp(self, value):
        return self.beta_temp * pm.NegativeBinomial.logp(self, value)

class HotConstantDist(pm.ConstantDist):
    """
    A "hot" ConstantDist distribution.

    Parameters
    ----------
    beta_temp : float on interval [0, 1]
        Beta value (inverse temperature) of the distribution.

    Returns
    -------
    output : pymc3 distribution
        Hot ConstantDist distribution.
    """
    def __init__(self, beta_temp, *args, **kwargs):
        super(HotConstantDist, self).__init__(*args, **kwargs)
        if not (0 < beta_temp <= 1):
            raise RuntimeError('Must have 0 < beta_temp ≤ 1.')
        self.beta_temp = beta_temp

    def logp(self, value):
        return self.beta_temp * pm.ConstantDist.logp(self, value)

class HotConstant(pm.Constant):
    """
    A "hot" Constant distribution.

    Parameters
    ----------
    beta_temp : float on interval [0, 1]
        Beta value (inverse temperature) of the distribution.

    Returns
    -------
    output : pymc3 distribution
        Hot Constant distribution.
    """
    def __init__(self, beta_temp, *args, **kwargs):
        super(HotConstant, self).__init__(*args, **kwargs)
        if not (0 < beta_temp <= 1):
            raise RuntimeError('Must have 0 < beta_temp ≤ 1.')
        self.beta_temp = beta_temp

    def logp(self, value):
        return self.beta_temp * pm.Constant.logp(self, value)

class HotZeroInflatedPoisson(pm.ZeroInflatedPoisson):
    """
    A "hot" ZeroInflatedPoisson distribution.

    Parameters
    ----------
    beta_temp : float on interval [0, 1]
        Beta value (inverse temperature) of the distribution.

    Returns
    -------
    output : pymc3 distribution
        Hot ZeroInflatedPoisson distribution.
    """
    def __init__(self, beta_temp, *args, **kwargs):
        super(HotZeroInflatedPoisson, self).__init__(*args, **kwargs)
        if not (0 < beta_temp <= 1):
            raise RuntimeError('Must have 0 < beta_temp ≤ 1.')
        self.beta_temp = beta_temp

    def logp(self, value):
        return self.beta_temp * pm.ZeroInflatedPoisson.logp(self, value)

class HotZeroInflatedBinomial(pm.ZeroInflatedBinomial):
    """
    A "hot" ZeroInflatedBinomial distribution.

    Parameters
    ----------
    beta_temp : float on interval [0, 1]
        Beta value (inverse temperature) of the distribution.

    Returns
    -------
    output : pymc3 distribution
        Hot ZeroInflatedBinomial distribution.
    """
    def __init__(self, beta_temp, *args, **kwargs):
        super(HotZeroInflatedBinomial, self).__init__(*args, **kwargs)
        if not (0 < beta_temp <= 1):
            raise RuntimeError('Must have 0 < beta_temp ≤ 1.')
        self.beta_temp = beta_temp

    def logp(self, value):
        return self.beta_temp * pm.ZeroInflatedBinomial.logp(self, value)

class HotZeroInflatedNegativeBinomial(pm.ZeroInflatedNegativeBinomial):
    """
    A "hot" ZeroInflatedNegativeBinomial distribution.

    Parameters
    ----------
    beta_temp : float on interval [0, 1]
        Beta value (inverse temperature) of the distribution.

    Returns
    -------
    output : pymc3 distribution
        Hot ZeroInflatedNegativeBinomial distribution.
    """
    def __init__(self, beta_temp, *args, **kwargs):
        super(HotZeroInflatedNegativeBinomial, self).__init__(*args, **kwargs)
        if not (0 < beta_temp <= 1):
            raise RuntimeError('Must have 0 < beta_temp ≤ 1.')
        self.beta_temp = beta_temp

    def logp(self, value):
        return self.beta_temp * pm.ZeroInflatedNegativeBinomial.logp(self, value)

class HotDiscreteUniform(pm.DiscreteUniform):
    """
    A "hot" DiscreteUniform distribution.

    Parameters
    ----------
    beta_temp : float on interval [0, 1]
        Beta value (inverse temperature) of the distribution.

    Returns
    -------
    output : pymc3 distribution
        Hot DiscreteUniform distribution.
    """
    def __init__(self, beta_temp, *args, **kwargs):
        super(HotDiscreteUniform, self).__init__(*args, **kwargs)
        if not (0 < beta_temp <= 1):
            raise RuntimeError('Must have 0 < beta_temp ≤ 1.')
        self.beta_temp = beta_temp

    def logp(self, value):
        return self.beta_temp * pm.DiscreteUniform.logp(self, value)

class HotGeometric(pm.Geometric):
    """
    A "hot" Geometric distribution.

    Parameters
    ----------
    beta_temp : float on interval [0, 1]
        Beta value (inverse temperature) of the distribution.

    Returns
    -------
    output : pymc3 distribution
        Hot Geometric distribution.
    """
    def __init__(self, beta_temp, *args, **kwargs):
        super(HotGeometric, self).__init__(*args, **kwargs)
        if not (0 < beta_temp <= 1):
            raise RuntimeError('Must have 0 < beta_temp ≤ 1.')
        self.beta_temp = beta_temp

    def logp(self, value):
        return self.beta_temp * pm.Geometric.logp(self, value)

class HotCategorical(pm.Categorical):
    """
    A "hot" Categorical distribution.

    Parameters
    ----------
    beta_temp : float on interval [0, 1]
        Beta value (inverse temperature) of the distribution.

    Returns
    -------
    output : pymc3 distribution
        Hot Categorical distribution.
    """
    def __init__(self, beta_temp, *args, **kwargs):
        super(HotCategorical, self).__init__(*args, **kwargs)
        if not (0 < beta_temp <= 1):
            raise RuntimeError('Must have 0 < beta_temp ≤ 1.')
        self.beta_temp = beta_temp

    def logp(self, value):
        return self.beta_temp * pm.Categorical.logp(self, value)

class HotUniform(pm.Uniform):
    """
    A "hot" Uniform distribution.

    Parameters
    ----------
    beta_temp : float on interval [0, 1]
        Beta value (inverse temperature) of the distribution.

    Returns
    -------
    output : pymc3 distribution
        Hot Uniform distribution.
    """
    def __init__(self, beta_temp, *args, **kwargs):
        super(HotUniform, self).__init__(*args, **kwargs)
        if not (0 < beta_temp <= 1):
            raise RuntimeError('Must have 0 < beta_temp ≤ 1.')
        self.beta_temp = beta_temp

    def logp(self, value):
        return self.beta_temp * pm.Uniform.logp(self, value)

class HotFlat(pm.Flat):
    """
    A "hot" Flat distribution.

    Parameters
    ----------
    beta_temp : float on interval [0, 1]
        Beta value (inverse temperature) of the distribution.

    Returns
    -------
    output : pymc3 distribution
        Hot Flat distribution.
    """
    def __init__(self, beta_temp, *args, **kwargs):
        super(HotFlat, self).__init__(*args, **kwargs)
        if not (0 < beta_temp <= 1):
            raise RuntimeError('Must have 0 < beta_temp ≤ 1.')
        self.beta_temp = beta_temp

    def logp(self, value):
        return self.beta_temp * pm.Flat.logp(self, value)

class HotHalfFlat(pm.HalfFlat):
    """
    A "hot" HalfFlat distribution.

    Parameters
    ----------
    beta_temp : float on interval [0, 1]
        Beta value (inverse temperature) of the distribution.

    Returns
    -------
    output : pymc3 distribution
        Hot HalfFlat distribution.
    """
    def __init__(self, beta_temp, *args, **kwargs):
        super(HotHalfFlat, self).__init__(*args, **kwargs)
        if not (0 < beta_temp <= 1):
            raise RuntimeError('Must have 0 < beta_temp ≤ 1.')
        self.beta_temp = beta_temp

    def logp(self, value):
        return self.beta_temp * pm.HalfFlat.logp(self, value)

class HotNormal(pm.Normal):
    """
    A "hot" Normal distribution.

    Parameters
    ----------
    beta_temp : float on interval [0, 1]
        Beta value (inverse temperature) of the distribution.

    Returns
    -------
    output : pymc3 distribution
        Hot Normal distribution.
    """
    def __init__(self, beta_temp, *args, **kwargs):
        super(HotNormal, self).__init__(*args, **kwargs)
        if not (0 < beta_temp <= 1):
            raise RuntimeError('Must have 0 < beta_temp ≤ 1.')
        self.beta_temp = beta_temp

    def logp(self, value):
        return self.beta_temp * pm.Normal.logp(self, value)

class HotBeta(pm.Beta):
    """
    A "hot" Beta distribution.

    Parameters
    ----------
    beta_temp : float on interval [0, 1]
        Beta value (inverse temperature) of the distribution.

    Returns
    -------
    output : pymc3 distribution
        Hot Beta distribution.
    """
    def __init__(self, beta_temp, *args, **kwargs):
        super(HotBeta, self).__init__(*args, **kwargs)
        if not (0 < beta_temp <= 1):
            raise RuntimeError('Must have 0 < beta_temp ≤ 1.')
        self.beta_temp = beta_temp

    def logp(self, value):
        return self.beta_temp * pm.Beta.logp(self, value)

class HotExponential(pm.Exponential):
    """
    A "hot" Exponential distribution.

    Parameters
    ----------
    beta_temp : float on interval [0, 1]
        Beta value (inverse temperature) of the distribution.

    Returns
    -------
    output : pymc3 distribution
        Hot Exponential distribution.
    """
    def __init__(self, beta_temp, *args, **kwargs):
        super(HotExponential, self).__init__(*args, **kwargs)
        if not (0 < beta_temp <= 1):
            raise RuntimeError('Must have 0 < beta_temp ≤ 1.')
        self.beta_temp = beta_temp

    def logp(self, value):
        return self.beta_temp * pm.Exponential.logp(self, value)

class HotLaplace(pm.Laplace):
    """
    A "hot" Laplace distribution.

    Parameters
    ----------
    beta_temp : float on interval [0, 1]
        Beta value (inverse temperature) of the distribution.

    Returns
    -------
    output : pymc3 distribution
        Hot Laplace distribution.
    """
    def __init__(self, beta_temp, *args, **kwargs):
        super(HotLaplace, self).__init__(*args, **kwargs)
        if not (0 < beta_temp <= 1):
            raise RuntimeError('Must have 0 < beta_temp ≤ 1.')
        self.beta_temp = beta_temp

    def logp(self, value):
        return self.beta_temp * pm.Laplace.logp(self, value)

class HotStudentT(pm.StudentT):
    """
    A "hot" StudentT distribution.

    Parameters
    ----------
    beta_temp : float on interval [0, 1]
        Beta value (inverse temperature) of the distribution.

    Returns
    -------
    output : pymc3 distribution
        Hot StudentT distribution.
    """
    def __init__(self, beta_temp, *args, **kwargs):
        super(HotStudentT, self).__init__(*args, **kwargs)
        if not (0 < beta_temp <= 1):
            raise RuntimeError('Must have 0 < beta_temp ≤ 1.')
        self.beta_temp = beta_temp

    def logp(self, value):
        return self.beta_temp * pm.StudentT.logp(self, value)

class HotCauchy(pm.Cauchy):
    """
    A "hot" Cauchy distribution.

    Parameters
    ----------
    beta_temp : float on interval [0, 1]
        Beta value (inverse temperature) of the distribution.

    Returns
    -------
    output : pymc3 distribution
        Hot Cauchy distribution.
    """
    def __init__(self, beta_temp, *args, **kwargs):
        super(HotCauchy, self).__init__(*args, **kwargs)
        if not (0 < beta_temp <= 1):
            raise RuntimeError('Must have 0 < beta_temp ≤ 1.')
        self.beta_temp = beta_temp

    def logp(self, value):
        return self.beta_temp * pm.Cauchy.logp(self, value)

class HotHalfCauchy(pm.HalfCauchy):
    """
    A "hot" HalfCauchy distribution.

    Parameters
    ----------
    beta_temp : float on interval [0, 1]
        Beta value (inverse temperature) of the distribution.

    Returns
    -------
    output : pymc3 distribution
        Hot HalfCauchy distribution.
    """
    def __init__(self, beta_temp, *args, **kwargs):
        super(HotHalfCauchy, self).__init__(*args, **kwargs)
        if not (0 < beta_temp <= 1):
            raise RuntimeError('Must have 0 < beta_temp ≤ 1.')
        self.beta_temp = beta_temp

    def logp(self, value):
        return self.beta_temp * pm.HalfCauchy.logp(self, value)

class HotGamma(pm.Gamma):
    """
    A "hot" Gamma distribution.

    Parameters
    ----------
    beta_temp : float on interval [0, 1]
        Beta value (inverse temperature) of the distribution.

    Returns
    -------
    output : pymc3 distribution
        Hot Gamma distribution.
    """
    def __init__(self, beta_temp, *args, **kwargs):
        super(HotGamma, self).__init__(*args, **kwargs)
        if not (0 < beta_temp <= 1):
            raise RuntimeError('Must have 0 < beta_temp ≤ 1.')
        self.beta_temp = beta_temp

    def logp(self, value):
        return self.beta_temp * pm.Gamma.logp(self, value)

class HotWeibull(pm.Weibull):
    """
    A "hot" Weibull distribution.

    Parameters
    ----------
    beta_temp : float on interval [0, 1]
        Beta value (inverse temperature) of the distribution.

    Returns
    -------
    output : pymc3 distribution
        Hot Weibull distribution.
    """
    def __init__(self, beta_temp, *args, **kwargs):
        super(HotWeibull, self).__init__(*args, **kwargs)
        if not (0 < beta_temp <= 1):
            raise RuntimeError('Must have 0 < beta_temp ≤ 1.')
        self.beta_temp = beta_temp

    def logp(self, value):
        return self.beta_temp * pm.Weibull.logp(self, value)

HotHalfStudentT = pm.Bound(pm.StudentT, lower=0)

class HotLognormal(pm.Lognormal):
    """
    A "hot" Lognormal distribution.

    Parameters
    ----------
    beta_temp : float on interval [0, 1]
        Beta value (inverse temperature) of the distribution.

    Returns
    -------
    output : pymc3 distribution
        Hot Lognormal distribution.
    """
    def __init__(self, beta_temp, *args, **kwargs):
        super(HotLognormal, self).__init__(*args, **kwargs)
        if not (0 < beta_temp <= 1):
            raise RuntimeError('Must have 0 < beta_temp ≤ 1.')
        self.beta_temp = beta_temp

    def logp(self, value):
        return self.beta_temp * pm.Lognormal.logp(self, value)

class HotChiSquared(pm.ChiSquared):
    """
    A "hot" ChiSquared distribution.

    Parameters
    ----------
    beta_temp : float on interval [0, 1]
        Beta value (inverse temperature) of the distribution.

    Returns
    -------
    output : pymc3 distribution
        Hot ChiSquared distribution.
    """
    def __init__(self, beta_temp, *args, **kwargs):
        super(HotChiSquared, self).__init__(*args, **kwargs)
        if not (0 < beta_temp <= 1):
            raise RuntimeError('Must have 0 < beta_temp ≤ 1.')
        self.beta_temp = beta_temp

    def logp(self, value):
        return self.beta_temp * pm.ChiSquared.logp(self, value)

class HotHalfNormal(pm.HalfNormal):
    """
    A "hot" HalfNormal distribution.

    Parameters
    ----------
    beta_temp : float on interval [0, 1]
        Beta value (inverse temperature) of the distribution.

    Returns
    -------
    output : pymc3 distribution
        Hot HalfNormal distribution.
    """
    def __init__(self, beta_temp, *args, **kwargs):
        super(HotHalfNormal, self).__init__(*args, **kwargs)
        if not (0 < beta_temp <= 1):
            raise RuntimeError('Must have 0 < beta_temp ≤ 1.')
        self.beta_temp = beta_temp

    def logp(self, value):
        return self.beta_temp * pm.HalfNormal.logp(self, value)

class HotWald(pm.Wald):
    """
    A "hot" Wald distribution.

    Parameters
    ----------
    beta_temp : float on interval [0, 1]
        Beta value (inverse temperature) of the distribution.

    Returns
    -------
    output : pymc3 distribution
        Hot Wald distribution.
    """
    def __init__(self, beta_temp, *args, **kwargs):
        super(HotWald, self).__init__(*args, **kwargs)
        if not (0 < beta_temp <= 1):
            raise RuntimeError('Must have 0 < beta_temp ≤ 1.')
        self.beta_temp = beta_temp

    def logp(self, value):
        return self.beta_temp * pm.Wald.logp(self, value)

class HotPareto(pm.Pareto):
    """
    A "hot" Pareto distribution.

    Parameters
    ----------
    beta_temp : float on interval [0, 1]
        Beta value (inverse temperature) of the distribution.

    Returns
    -------
    output : pymc3 distribution
        Hot Pareto distribution.
    """
    def __init__(self, beta_temp, *args, **kwargs):
        super(HotPareto, self).__init__(*args, **kwargs)
        if not (0 < beta_temp <= 1):
            raise RuntimeError('Must have 0 < beta_temp ≤ 1.')
        self.beta_temp = beta_temp

    def logp(self, value):
        return self.beta_temp * pm.Pareto.logp(self, value)

class HotInverseGamma(pm.InverseGamma):
    """
    A "hot" InverseGamma distribution.

    Parameters
    ----------
    beta_temp : float on interval [0, 1]
        Beta value (inverse temperature) of the distribution.

    Returns
    -------
    output : pymc3 distribution
        Hot InverseGamma distribution.
    """
    def __init__(self, beta_temp, *args, **kwargs):
        super(HotInverseGamma, self).__init__(*args, **kwargs)
        if not (0 < beta_temp <= 1):
            raise RuntimeError('Must have 0 < beta_temp ≤ 1.')
        self.beta_temp = beta_temp

    def logp(self, value):
        return self.beta_temp * pm.InverseGamma.logp(self, value)

class HotExGaussian(pm.ExGaussian):
    """
    A "hot" ExGaussian distribution.

    Parameters
    ----------
    beta_temp : float on interval [0, 1]
        Beta value (inverse temperature) of the distribution.

    Returns
    -------
    output : pymc3 distribution
        Hot ExGaussian distribution.
    """
    def __init__(self, beta_temp, *args, **kwargs):
        super(HotExGaussian, self).__init__(*args, **kwargs)
        if not (0 < beta_temp <= 1):
            raise RuntimeError('Must have 0 < beta_temp ≤ 1.')
        self.beta_temp = beta_temp

    def logp(self, value):
        return self.beta_temp * pm.ExGaussian.logp(self, value)

class HotVonMises(pm.VonMises):
    """
    A "hot" VonMises distribution.

    Parameters
    ----------
    beta_temp : float on interval [0, 1]
        Beta value (inverse temperature) of the distribution.

    Returns
    -------
    output : pymc3 distribution
        Hot VonMises distribution.
    """
    def __init__(self, beta_temp, *args, **kwargs):
        super(HotVonMises, self).__init__(*args, **kwargs)
        if not (0 < beta_temp <= 1):
            raise RuntimeError('Must have 0 < beta_temp ≤ 1.')
        self.beta_temp = beta_temp

    def logp(self, value):
        return self.beta_temp * pm.VonMises.logp(self, value)

class HotSkewNormal(pm.SkewNormal):
    """
    A "hot" SkewNormal distribution.

    Parameters
    ----------
    beta_temp : float on interval [0, 1]
        Beta value (inverse temperature) of the distribution.

    Returns
    -------
    output : pymc3 distribution
        Hot SkewNormal distribution.
    """
    def __init__(self, beta_temp, *args, **kwargs):
        super(HotSkewNormal, self).__init__(*args, **kwargs)
        if not (0 < beta_temp <= 1):
            raise RuntimeError('Must have 0 < beta_temp ≤ 1.')
        self.beta_temp = beta_temp

    def logp(self, value):
        return self.beta_temp * pm.SkewNormal.logp(self, value)

class HotLogistic(pm.Logistic):
    """
    A "hot" Logistic distribution.

    Parameters
    ----------
    beta_temp : float on interval [0, 1]
        Beta value (inverse temperature) of the distribution.

    Returns
    -------
    output : pymc3 distribution
        Hot Logistic distribution.
    """
    def __init__(self, beta_temp, *args, **kwargs):
        super(HotLogistic, self).__init__(*args, **kwargs)
        if not (0 < beta_temp <= 1):
            raise RuntimeError('Must have 0 < beta_temp ≤ 1.')
        self.beta_temp = beta_temp

    def logp(self, value):
        return self.beta_temp * pm.Logistic.logp(self, value)

class HotInterpolated(pm.Interpolated):
    """
    A "hot" Interpolated distribution.

    Parameters
    ----------
    beta_temp : float on interval [0, 1]
        Beta value (inverse temperature) of the distribution.

    Returns
    -------
    output : pymc3 distribution
        Hot Interpolated distribution.
    """
    def __init__(self, beta_temp, *args, **kwargs):
        super(HotInterpolated, self).__init__(*args, **kwargs)
        if not (0 < beta_temp <= 1):
            raise RuntimeError('Must have 0 < beta_temp ≤ 1.')
        self.beta_temp = beta_temp

    def logp(self, value):
        return self.beta_temp * pm.Interpolated.logp(self, value)

class HotMvNormal(pm.MvNormal):
    """
    A "hot" MvNormal distribution.

    Parameters
    ----------
    beta_temp : float on interval [0, 1]
        Beta value (inverse temperature) of the distribution.

    Returns
    -------
    output : pymc3 distribution
        Hot MvNormal distribution.
    """
    def __init__(self, beta_temp, *args, **kwargs):
        super(HotMvNormal, self).__init__(*args, **kwargs)
        if not (0 < beta_temp <= 1):
            raise RuntimeError('Must have 0 < beta_temp ≤ 1.')
        self.beta_temp = beta_temp

    def logp(self, value):
        return self.beta_temp * pm.MvNormal.logp(self, value)

class HotMvStudentT(pm.MvStudentT):
    """
    A "hot" MvStudentT distribution.

    Parameters
    ----------
    beta_temp : float on interval [0, 1]
        Beta value (inverse temperature) of the distribution.

    Returns
    -------
    output : pymc3 distribution
        Hot MvStudentT distribution.
    """
    def __init__(self, beta_temp, *args, **kwargs):
        super(HotMvStudentT, self).__init__(*args, **kwargs)
        if not (0 < beta_temp <= 1):
            raise RuntimeError('Must have 0 < beta_temp ≤ 1.')
        self.beta_temp = beta_temp

    def logp(self, value):
        return self.beta_temp * pm.MvStudentT.logp(self, value)

class HotDirichlet(pm.Dirichlet):
    """
    A "hot" Dirichlet distribution.

    Parameters
    ----------
    beta_temp : float on interval [0, 1]
        Beta value (inverse temperature) of the distribution.

    Returns
    -------
    output : pymc3 distribution
        Hot Dirichlet distribution.
    """
    def __init__(self, beta_temp, *args, **kwargs):
        super(HotDirichlet, self).__init__(*args, **kwargs)
        if not (0 < beta_temp <= 1):
            raise RuntimeError('Must have 0 < beta_temp ≤ 1.')
        self.beta_temp = beta_temp

    def logp(self, value):
        return self.beta_temp * pm.Dirichlet.logp(self, value)

class HotMultinomial(pm.Multinomial):
    """
    A "hot" Multinomial distribution.

    Parameters
    ----------
    beta_temp : float on interval [0, 1]
        Beta value (inverse temperature) of the distribution.

    Returns
    -------
    output : pymc3 distribution
        Hot Multinomial distribution.
    """
    def __init__(self, beta_temp, *args, **kwargs):
        super(HotMultinomial, self).__init__(*args, **kwargs)
        if not (0 < beta_temp <= 1):
            raise RuntimeError('Must have 0 < beta_temp ≤ 1.')
        self.beta_temp = beta_temp

    def logp(self, value):
        return self.beta_temp * pm.Multinomial.logp(self, value)

class HotWishart(pm.Wishart):
    """
    A "hot" Wishart distribution.

    Parameters
    ----------
    beta_temp : float on interval [0, 1]
        Beta value (inverse temperature) of the distribution.

    Returns
    -------
    output : pymc3 distribution
        Hot Wishart distribution.
    """
    def __init__(self, beta_temp, *args, **kwargs):
        super(HotWishart, self).__init__(*args, **kwargs)
        if not (0 < beta_temp <= 1):
            raise RuntimeError('Must have 0 < beta_temp ≤ 1.')
        self.beta_temp = beta_temp

    def logp(self, value):
        return self.beta_temp * pm.Wishart.logp(self, value)

class HotLKJCorr(pm.LKJCorr):
    """
    A "hot" LKJCorr distribution.

    Parameters
    ----------
    beta_temp : float on interval [0, 1]
        Beta value (inverse temperature) of the distribution.

    Returns
    -------
    output : pymc3 distribution
        Hot LKJCorr distribution.
    """
    def __init__(self, beta_temp, *args, **kwargs):
        super(HotLKJCorr, self).__init__(*args, **kwargs)
        if not (0 < beta_temp <= 1):
            raise RuntimeError('Must have 0 < beta_temp ≤ 1.')
        self.beta_temp = beta_temp

    def logp(self, value):
        return self.beta_temp * pm.LKJCorr.logp(self, value)

class HotLKJCholeskyCov(pm.LKJCholeskyCov):
    """
    A "hot" LKJCholeskyCov distribution.

    Parameters
    ----------
    beta_temp : float on interval [0, 1]
        Beta value (inverse temperature) of the distribution.

    Returns
    -------
    output : pymc3 distribution
        Hot LKJCholeskyCov distribution.
    """
    def __init__(self, beta_temp, *args, **kwargs):
        super(HotLKJCholeskyCov, self).__init__(*args, **kwargs)
        if not (0 < beta_temp <= 1):
            raise RuntimeError('Must have 0 < beta_temp ≤ 1.')
        self.beta_temp = beta_temp

    def logp(self, value):
        return self.beta_temp * pm.LKJCholeskyCov.logp(self, value)

class HotMixture(pm.Mixture):
    """
    A "hot" Mixture distribution.

    Parameters
    ----------
    beta_temp : float on interval [0, 1]
        Beta value (inverse temperature) of the distribution.

    Returns
    -------
    output : pymc3 distribution
        Hot Mixture distribution.
    """
    def __init__(self, beta_temp, w, comp_dists, *args, **kwargs):

        super(HotMixture, self).__init__(w, comp_dists, *args, **kwargs)

        if not (0 < beta_temp <= 1):
            raise RuntimeError('Must have 0 < beta_temp ≤ 1.')
        self.beta_temp = beta_temp

    def logp(self, value):
        return self.beta_temp * pm.Mixture.logp(self, value)

class HotNormalMixture(pm.NormalMixture):
    """
    A "hot" NormalMixture distribution.

    Parameters
    ----------
    beta_temp : float on interval [0, 1]
        Beta value (inverse temperature) of the distribution.

    Returns
    -------
    output : pymc3 distribution
        Hot NormalMixture distribution.
    """
    def __init__(self, beta_temp, w, mu, *args, **kwargs):
        super(HotNormalMixture, self).__init__(w, mu, *args, **kwargs)
        if not (0 < beta_temp <= 1):
            raise RuntimeError('Must have 0 < beta_temp ≤ 1.')
        self.beta_temp = beta_temp

    def logp(self, value):
        return self.beta_temp * pm.NormalMixture.logp(self, value)


text:
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Web;

namespace OnlineTeachingSystem.Models
{
    public class ExamList
    {
        [Key]
        public string ExamName { get; set; }
        public int Group { get; set; }
        public DateTime StartTime { get; set; }
        public int Duration { get; set; }
    }
}


text:
package ameba.message.filtering;

import ameba.core.Requests;
import ameba.message.internal.BeanPathProperties;
import ameba.util.bean.BeanMap;
import org.apache.commons.lang3.StringUtils;

import javax.ws.rs.core.UriInfo;
import java.util.Collection;
import java.util.List;

/**
 *
EntityFieldsUtils class.

 *
 * @author icode
 *
 */
public class EntityFieldsUtils {
    /**
     * Constant PATH_PROPS_PARSED="EntityFieldsUtils.class + .BeanPathProp"{trunked}
     */
    public static final String PATH_PROPS_PARSED = EntityFieldsUtils.class + ".BeanPathProperties";

    private EntityFieldsUtils() {
    }

    /**
     * Parse and return a BeanPathProperties format from UriInfo
     *
     * @param uriInfo uri info
     * @return query fields
     */
    public static String parseQueryFields(UriInfo uriInfo) {
        List<String> selectables = uriInfo.getQueryParameters()
                .get(EntityFieldsScopeResolver.FIELDS_PARAM_NAME);
        StringBuilder builder = new StringBuilder();
        if (selectables != null) {
            for (int i = 0; i < selectables.size(); i++) {
                String s = selectables.get(i);
                if (StringUtils.isNotBlank(s)) {
                    if (!s.startsWith("(")) {
                        builder.append("(");
                    }
                    builder.append(s);
                    if (!s.endsWith(")")) {
                        builder.append(")");
                    }
                    if (i < selectables.size() - 1) {
                        builder.append(":");
                    }
                }
            }
        }
        return builder.length() == 0 ? null : builder.toString();
    }

    /**
     * Parse and return a BeanPathProperties format from UriInfo
     *
     * @return query fields
     */
    public static String parseQueryFields() {
        return parseQueryFields(Requests.getUriInfo());
    }

    /**
     * Parse and return a BeanPathProperties from nested string format like
     * (a,b,c(d,e),f(g)) where "c" is a path containing "d" and "e" and "f" is a
     * path containing "g" and the root path contains "a","b","c" and "f".
     *
     * @param uriInfo uri info
     * @return path properties
     */
    public static BeanPathProperties parsePathProperties(UriInfo uriInfo) {
        return BeanPathProperties.parse(parseQueryFields(uriInfo));
    }

    /**
     * Parse and return a BeanPathProperties from nested string format like
     * (a,b,c(d,e),f(g)) where "c" is a path containing "d" and "e" and "f" is a
     * path containing "g" and the root path contains "a","b","c" and "f".
     *
     * @return pah properties
     */
    public static BeanPathProperties parsePathProperties() {
        Object pathProperties = Requests.getProperty(PATH_PROPS_PARSED);
        if (pathProperties == null) {
            String fields = parseQueryFields();
            if (fields != null) {
                pathProperties = BeanPathProperties.parse(fields);
                Requests.setProperty(PATH_PROPS_PARSED, pathProperties);
            } else {
                Requests.setProperty(PATH_PROPS_PARSED, false);
            }
        } else if (pathProperties.equals(false)) {
            return null;
        }
        return (BeanPathProperties) pathProperties;
    }

    /**
     *
filterBeanFields.

     *
     * @param src a T object.
     * @param pathProperties a {@link ameba.message.internal.BeanPathProperties} object.
     * @param <T> a T object.
     * @return a {@link ameba.util.bean.BeanMap} object.
     */
    @SuppressWarnings("unchecked")
    public static <T> BeanMap<T> filterBeanFields(T src, BeanPathProperties pathProperties) {
        return (BeanMap<T>) FilteringBeanMap.from(src, pathProperties);
    }

    /**
     *
filterBeanFields.

     *
     * @param src an array of T objects.
     * @param pathProperties a {@link ameba.message.internal.BeanPathProperties} object.
     * @param <T> a T object.
     * @return an array of {@link ameba.util.bean.BeanMap} objects.
     */
    @SuppressWarnings("unchecked")
    public static <T> BeanMap[] filterBeanFields(T[] src, BeanPathProperties pathProperties) {
        return (BeanMap[]) FilteringBeanMap.from(src, pathProperties);
    }

    /**
     *
filterBeanFields.

     *
     * @param src a {@link java.util.Collection} object.
     * @param pathProperties a {@link ameba.message.internal.BeanPathProperties} object.
     * @param <T> a T object.
     * @return a {@link java.util.Collection} object.
     */
    @SuppressWarnings("unchecked")
    public static <T> Collection<BeanMap<T>> filterBeanFields(Collection<T> src, BeanPathProperties pathProperties) {
        return (Collection<BeanMap<T>>) FilteringBeanMap.from(src, pathProperties);
    }

    /**
     *
filterRequestFields.

     *
     * @param src a T object.
     * @param <T> a T object.
     * @return a {@link ameba.util.bean.BeanMap} object.
     */
    @SuppressWarnings("unchecked")
    public static <T> BeanMap<T> filterRequestFields(T src) {
        return (BeanMap<T>) FilteringBeanMap.from(src, parsePathProperties());
    }

    /**
     *
filterRequestFields.

     *
     * @param src an array of T objects.
     * @param <T> a T object.
     * @return an array of {@link ameba.util.bean.BeanMap} objects.
     */
    @SuppressWarnings("unchecked")
    public static <T> BeanMap[] filterRequestFields(T[] src) {
        return (BeanMap[]) FilteringBeanMap.from(src, parsePathProperties());
    }

    /**
     *
filterRequestFields.

     *
     * @param src a {@link java.util.Collection} object.
     * @param <T> a T object.
     * @return a {@link java.util.Collection} object.
     */
    @SuppressWarnings("unchecked")
    public static <T> Collection<BeanMap<T>> filterRequestFields(Collection<T> src) {
        return (Collection<BeanMap<T>>) FilteringBeanMap.from(src, parsePathProperties());
    }

}


text:
//
//  LYPhotoBrowserViewController.m
//  TaiYangHua
//
//  Created by admin on 16/12/15.
//  Copyright © 2016年 hhly. All rights reserved.
//

#import "LYPhotoBrowserViewController.h"
#import "LYPhotoBrowserView.h"
#import "SGPictureTool.h"
#import "SDWebImage/SDImageCache.h"
#import "LYPhotoAminator.h"
#import "LYPhotoBottomToolBar.h"
#import "Masonry.h"

@implementation UIViewController (LYVisible)
/**
 当前在视图上的控制器 (一般为自己,但如果本身不在Windows上就会找出它modal的控制器)

 @return 控制器
 */
- (instancetype)visibleViewController {
    if (self.view.window) {
        return self;
    }
    // 递归寻找 当前控制器的可视 控制器
    return [self.presentedViewController visibleViewController];
}
/**
 keywindow上的可视根控制器

 @return 控制器
 */
+ (UIViewController *)rootVisibaleViewController {
    return [UIApplication sharedApplication].keyWindow.rootViewController.visibleViewController;
}
@end
/**********************************************************************/
#pragma mark - LYPhotoBrowserViewController
@interface LYPhotoBrowserViewController () <LYPhotoAminatorDelegate,LYPhotoBrowserViewDelegate>
{
    NSInteger _initalIndex; // 展示起始位置索引值
    BOOL _finishedLoadImageView;
}

/** 开始动画视图 aninatorView */
@property(nonatomic,weak) UIImageView * startImageView;
/** modal动画器 */
@property(nonatomic,strong) LYPhotoAminator * animator;
/** 浏览视图(self.view) */
@property(nonatomic,weak) LYPhotoBrowserView * photoBrowserView;

@end

@implementation LYPhotoBrowserViewController
#pragma mark - 控制器视图配置
- (void)loadView {

    LYPhotoBrowserView *photoBrowserView = [[LYPhotoBrowserView alloc] init];
    photoBrowserView.frame = [UIScreen mainScreen].bounds;
    self.view = photoBrowserView;
    self.photoBrowserView = photoBrowserView;
    photoBrowserView.delegate = self;
}
#pragma mark - 构造方法
- (instancetype)init {
    if (self = [super init]) {
        _animator = [[LYPhotoAminator alloc] init];
        _animator.delegate = self;
        self.modalPresentationStyle = UIModalPresentationCustom;
        self.transitioningDelegate = self.animator;
        self.automaticallyAdjustsScrollViewInsets = NO;
    }
    return self;
}
- (instancetype)initWithDataSource:(NSArray<LYPhotoDataSourceProtocol> *)dataSource {
    if (self = [self init]) {
        ///
        _dataSource = dataSource;
    }
    return self;
}
#pragma mark - life cycle
- (void)viewDidLoad {
    [super viewDidLoad];
    [self setUpsubView];
}
- (void)viewDidAppear:(BOOL)animated {
    [super viewDidAppear:animated];
    // 隐藏状态栏
    [[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:UIStatusBarAnimationFade];
}

- (void)viewWillDisappear:(BOOL)animated {
    [super viewWillDisappear:animated];
    // 隐藏状态栏
    [[UIApplication sharedApplication] setStatusBarHidden:NO withAnimation:UIStatusBarAnimationFade];
}
// 添加子控件
- (void)setUpsubView {
    if (self.isHiddenBottomToolBar) {
        return;
    }
    LYPhotoBottomToolBar *bar = [[LYPhotoBottomToolBar alloc] init];
    self.bottomToolBar = bar;
    [self.view addSubview:bar];
    [bar saveButtonAddTarget:self action:@selector(saveCurrentIamge:) forControlEvents:UIControlEventTouchUpInside];
    [bar mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.bottom.right.equalTo(self.view);
        make.height.equalTo(@49);
    }];
}
#pragma mark - clcik events
// 保存当前图片
- (void)saveCurrentIamge:(id)sender {
    [self saveCurrentIamge];
}
- (void)saveCurrentIamge {
    // 获取图片
    UIImage *image = [self.photoBrowserView currentImageView].image;
    // 不需要保存
    if ([self.delegate respondsToSelector:@selector(photoBrowserViewController:shouldSaveImage:withImageIdex:)] &&
        ![self.delegate photoBrowserViewController:self shouldSaveImage:image withImageIdex:self.photoBrowserView.currentIndex]) {
        return;
    }

    __weak typeof(self) weakSelf = self;

    // 保存图片到相册
    [SGPictureTool sg_saveAImage:image withFolferName:self.photoDirectoryName error:^(NSError *error) {
        // 通知代理
        if ([weakSelf.delegate respondsToSelector:@selector(photoBrowserViewController:didSaveImage:withError:)]) {
            [weakSelf.delegate photoBrowserViewController:weakSelf didSaveImage:image withError:error];
        }
    }];
}
#pragma mark - custom modal Anima
// modal 处理
- (void)presentedWithView:(UIImageView *)imageView imageIndex:(NSInteger)imageIndex viewController:(UIViewController *)vc {
    //容错处理
    if (![imageView isKindOfClass:[UIImageView class]]) {
        return;
    }
    // 起始位置索引配置
    _initalIndex = imageIndex;
    // 配置视图控制器起始model位置图片
    self.startImageView = imageView;

    // 加载视图 初始化index
    [self view];
    [self.bottomToolBar setCurrentIndex:imageIndex totalItemsCount:self.dataSource.count];

    if (vc.view.window == nil) {
        vc = [UIViewController rootVisibaleViewController];
    }
    //modal 浏览器
    [vc presentViewController:self animated:YES completion:nil];
}
- (void)presentedWithView:(UIImageView *)imageView imageIndex:(NSInteger)imageIndex{
    [self presentedWithView:imageView imageIndex:imageIndex viewController:nil];
}
#pragma mark - setter
- (void)setHiddenBottomToolBar:(BOOL)hiddenBottomToolBar {
    _hiddenBottomToolBar = hiddenBottomToolBar;
    _bottomToolBar.hidden = hiddenBottomToolBar;
}
// 设置无限滚动
- (void)setInfiniteCycleBrowserEnable:(BOOL)enable {
    [(LYPhotoBrowserView *)self.view setInfifiteCycleEnable:enable];
}
#pragma mark - LYPhotoBrowserViewDelegate 视图代理
// 获取图片个数的总数
- (NSInteger)numberOfItemsForInfiniteSlideView:(LYPhotoBrowserView *)photoBrowserView {
    return self.dataSource.count;
}
//// 获取图片URL
//- (NSString *)imageURLForPhotoBrowserView:(LYPhotoBrowserView *)photoBrowserView inIndex:(NSInteger)index {
//    return [self.dataSource[index] ly_imageURL];
//}
- (id <LYPhotoDataSourceProtocol>)photoForPhotoBrowserView:(LYPhotoBrowserView *)photoBrowserView inIndex:(NSInteger)index {
    return self.dataSource[index];
}
// 单击视图action
- (void)didSingleTapPhotoBrowserView:(LYPhotoBrowserView *)browserView {
    [self dismissViewControllerAnimated:YES completion:nil];
}
// 图片加载完毕
- (void)didLoadStartImageIndex:(NSInteger)startIndex photoBrowserView:(LYPhotoBrowserView *)photoBrowserView {
    // 加载第一张图
    if (_finishedLoadImageView && startIndex == _initalIndex) {
        [self.startImageView removeFromSuperview];
        self.startImageView = nil;
        _finishedLoadImageView = NO;
    }
    [self didLoadImageAtIndex:startIndex];
}
- (void)didLoadImageAtIndex:(NSInteger)index {

}

// 即将展示的视图索引
- (void)photoBrowserView:(LYPhotoBrowserView *)photoBrowserView willShowIndex:(NSInteger)index {

    [self.bottomToolBar setCurrentIndex:index totalItemsCount:self.dataSource.count];

    if ([self.delegate respondsToSelector:@selector(photoBrowserView:willShowIndex:)]) {
        [self.delegate photoBrowserViewController:self willShowIndex:index];
    }
}

// 已近展示了第几张图
- (void)photoBrowserView:(LYPhotoBrowserView *)photoBrowserView didShowIndex:(NSInteger)index {
    if ([self.delegate respondsToSelector:@selector(photoBrowserView:didShowIndex:)]) {
        [self.delegate photoBrowserViewController:self didShowIndex:index];
    }
}

#pragma mark - LYPhotoAminatorDelegate 动画代理
// 获取起始图片位置
- (UIImageView *)initalPositonAnimateViewWithPhotoAminator:(LYPhotoAminator *)animator {
    UIImageView *imageView = self.startImageView;
    if (!imageView) {
        imageView = [[UIImageView alloc] init];
        imageView.center = [UIApplication sharedApplication].keyWindow.rootViewController.view.center;
    }
    return imageView;
}

// 获取结束视图位置
- (UIView *)dismissToViewWithPhotoAminator:(LYPhotoAminator *)animator {
    if ([self.delegate respondsToSelector:@selector(viewForDisMissWithImageIndex:photoBrowserViewController:)]) {
        return [self.delegate viewForDisMissWithImageIndex:self.photoBrowserView.currentIndex photoBrowserViewController:self];
    }
    return nil;
}
// 获取结束要缩小的图
- (UIImageView *)dismissFromImageViewWithPhotoAminator:(LYPhotoAminator *)animator {
    return self.photoBrowserView.currentImageView;
}

// 完成model 动画调用
- (void)photoAminator:(LYPhotoAminator *)animator didPresectedWithView:(UIView *)animaView {
    // 设置起始位置
    _finishedLoadImageView = YES;
    [self.photoBrowserView setInitalIndex:_initalIndex];
}

// 即将modal时候调用
- (void)photoAminator:(LYPhotoAminator *)animator willPresentingWithView:(UIView *)animaView {
    self.startImageView = (UIImageView *)animaView;
}
#pragma mark - lazy load
- (NSString *)photoDirectoryName { // 相册名称
    if (!_photoDirectoryName) {
        _photoDirectoryName =  [NSBundle mainBundle].infoDictionary[(NSString *)kCFBundleExecutableKey];
    }
    return _photoDirectoryName;
}
@end


text:
class AddNeedHelpCommentToProjectContentItem < ActiveRecord::Migration[5.0]
  def change
    add_column :project_content_items, :need_help_comment, :text
  end
end


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

public class ParticleBehaviour : MonoBehaviour
{
    public ParticleSystem particles;

    void Start ()
    {
        particles = this.GetComponent<ParticleSystem>();
    }

    public void SetParticleState(bool value)
    {
        if (value) particles.Play();
        else if (!value) particles.Play();
        else return;
    }
}


text:
package io.school.api;

import io.school.annotation.IgnoreAuth;
import io.school.entity.UserEntity;
import io.school.service.UserService;
import io.school.utils.R;
import io.school.validator.Assert;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 注册
 * @author school
 * @email
 * @date 2017-03-26 17:27
 */
@RestController
@RequestMapping("/api")
public class ApiRegisterController {
    @Autowired
    private UserService userService;

    /**
     * 注册
     */
    @IgnoreAuth
    @PostMapping("register")
    public R register(@RequestBody UserEntity user){
        Assert.isBlank(user.getMobile(), "手机号不能为空");
        Assert.isBlank(user.getPassword(), "密码不能为空");

        userService.save(user);

        return R.ok();
    }
}


text:
import template from './availability.html';

export const availabilityComponentName = 'appAvailability';

export const availabilityComponent = {
    template,
    controller: AvailabilityController,
    controllerAs: 'vm',
    bindings: {
        record: '<',
    },
};

/////

function AvailabilityController() {
    var vm = this;
}


text:
package com.neleth.anagram;

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

public class Word implements Comparable<Word>{
	private final String text;
	private final String sortedText;

	public Word(String text) {
		this.text = null != text ? text.trim() : null;
//				eSpecialCharacters(text.trim());
		this.sortedText = sortText();
	}

	public boolean isAnagramOf(Word word2) {
		return null != word2 && null != sortedText && null != word2.sortedText
				&& sortedText.equalsIgnoreCase(word2.sortedText);
	}

	String eSpecialCharacters(String text) {
		List<Character> letterList = toLetterList(text);
		return new String(toCharacterArray(letterList));
	}

	private char[] toCharacterArray(List<Character> letterList) {
		char[] letters = new char[letterList.size()];
		for (int i = 0; i < letterList.size(); i++)
			letters[i] = letterList.get(i);
		return letters;
	}

	private List<Character> toLetterList(String text) {
		char[] characters = text.toCharArray();
		List<Character> letterList = new ArrayList<Character>();
		for (char character : characters)
//			if (Character.isAlphabetic(character))
				letterList.add(character);
		return letterList;
	}

	String sortText() {
		String sortedWord = null;
		if (null != text) {
			List<Character> letterList = toLetterList(text);
			Collections.sort(letterList);
			char[] letters = toCharacterArray(letterList);
			sortedWord = new String(letters);
		}
		return sortedWord;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((text == null) ? 0 : text.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;
		Word other = (Word) obj;
		if (text == null) {
			if (other.text != null)
				return false;
		} else if (!text.equals(other.text))
			return false;
		return true;
	}

	@Override
	public int compareTo(Word o) {
		int c = -1;
		if (null != text)
			c = (null == o || null == o.text) ?  1 : text.compareTo(o.text);
		return c;
	}

	public String getText() {
		return text;
	}

	public String getSortedText() {
		return sortedText;
	}

	public int getLength() {
		return null != text ? text.length() : 0;
	}
}