text:
PATH=${PATH}
source installer/configs/global/install.conf

# Export remote repo
puppet-install() {
  export PKG_PATH=http://ftp.usa.openbsd.org/pub/OpenBSD/`uname -r`/packages/`arch -s`
  pkg_add puppet
}

puppet-config() {
  mv /etc/puppet/auth.conf /etc/puppet/auth.conf-local
  cp installer/configs/openbsd/auth.conf /etc/puppet/auth.conf
  echo "puppetd=YES" >> /etc/rc.conf.local
  sleep 5
  echo "server = '${SERVER}'" >> /etc/puppet/puppet.conf
}

puppet-cert() {
  echo ""
  echo "Check your puppet.master for a pending cert"
  echo ""
  puppet agent -v --server ${SERVER} --waitforcert ${TIMEOUT} --test
}

puppet-start() {
  /etc/rc.d/puppetd start
}

# Determine if root is running script.
if [ "$(id -u)" == "0" ]; then

  puppet-install
  puppet-config
  puppet-cert
  puppet-start

else
  echo "This script must be run as root."
fi
exit 0

redpajama_set_name: RedPajamaGithub


text:
'use strict'

/* npm libraries */

/* application libraries */
var db = require('../lib/database.js')
var immutable = require('../lib/immutable')

/* public functions */
module.exports = immutable.model('AddressReplace', {
    createAddressReplace: createAddressReplace,
})

/**
 * @function createAddressReplace
 *
 * @param {string} accountId - optional hex id of account to get addresses for
 * @param {object} session - request session
 *
 * @returns {Promise}
 */
function createAddressReplace (args) {
    // insert address replace record
    return db('immutable').query(
        'INSERT INTO addressReplace VALUES(UNHEX(:oldAddressId), UNHEX(:newAddressId), UNHEX(:accountId), UNHEX(:sessionId), :addressReplaceCreateTime)',
        {
            accountId: args.session.accountId,
            addressReplaceCreateTime: args.session.requestTimestamp,
            oldAddressId: args.oldAddressId,
            newAddressId: args.newAddressId,
            sessionId: args.session.sessionId,
        },
        undefined,
        args.session
    )
}


text:
This example shows the most basic idea behind Next. We have 2 pages: `pages/index.js` and `pages/about.js`. The former responds to `/` requests and the latter to `/about`. Using `next/link` you can add hyperlinks between them with universal routing capabilities. The `day` directory shows that you can have subdirectories.

## Deploy your own

Deploy the example using [Vercel](https://vercel.com?utm_source=github&utm_medium=readme&utm_campaign=next-example) or preview live with [StackBlitz](https://stackblitz.com/github/vercel/next.js/tree/canary/examples/hello-world)

[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/git/external?repository-url=https://github.com/vercel/next.js/tree/canary/examples/hello-world&project-name=hello-world&repository-name=hello-world)

## How to use

Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example:

```bash
npx create-next-app --example hello-world hello-world-app
# or
yarn create next-app --example hello-world hello-world-app
```

Deploy it to the cloud with [Vercel](https://vercel.com/new?utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)).


text:
import sys, os
from foundation import Indication

class UpDownRatio (Indication):
	@classmethod
	def isRealIndication(cls): return True
	@classmethod
	def getType(cls): return float

	def __init__(self, asset, parent=None, length=25):
		if asset.__class__ == Assets:
			Indication.__init__(self, asset, parent)
		else: raise TypeError("the class of 'asset' is not 'Assets'.")
		self.setLength(length)

	def setLength(self, length):
		if type(length) != int:
			raise TypeError("the type of 'length' is not 'int'.")
		elif length > 0: self.__length = length
		else: raise TypeError("the variable 'length' is not valid.")

	def getDescription(self):
		return "UpDownRatio(%i)" % len(self.asset)

	def evaluate(self, t):
		children = self.asset.children
		n = self.__length
		up = len([x for x in children if x.get(t-n) < x.get(t)])
		down = len([x for x in children if x.get(t-n) > x.get(t)])
		if down > 0:
			return float(up) / float(down)
		else: raise TypeError("the sum of volume on down days equals zero.")


text:
//
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license.
//
// Bot Auth Github:
// https://github.com/mattdot/BotAuth
//
// Copyright (c) Microsoft Corporation
// All rights reserved.
//
// MIT License:
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED ""AS IS"", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//

import crypto = require("crypto");
import cookie = require("cookie");

export interface IResumptionProvider {
    persistHandler(): (req: any, res: any, next: any) => void;
    restoreHandler(): (req: any, res: any, next: any) => void;
}

/**
 * Default implementation of IResumptionProvider uses cookies to store state
 * between redirect and callback of authentication.
 */
export class CookieResumption implements IResumptionProvider {
    /**
     *
     */
    constructor(private maxAge: number, private secret: string) {
    }

    /**
     *
     */
    public persistHandler(): (req: any, res: any, next: any) => void {
        let maxAge = Math.floor(this.maxAge);
        let secret = this.secret;

        return (req, res, next) => {
            let cypher = crypto.createCipher("aes192", secret);
            let cookieValue = cypher.update(req.query.state, "utf8", "base64") + cypher.final("base64");

            if (res.header("Set-Cookie")) {
                // todo: append cookie
            } else {
                let c = cookie.serialize("botauth", cookieValue, { maxAge : maxAge, httpOnly : true, secure : true });
                res.header("Set-Cookie", c);
            }
            next();
        };
    }

    /**
     *
     */
    public restoreHandler(): (req: any, res: any, next: any) => void {
        let secret = this.secret;

        // return implementation of the handler
        return (req, res, next) => {
            let cookies: any = cookie.parse(req.headers.cookie || "");

            if (cookies && cookies.botauth) {
                let decypher = crypto.createDecipher("aes192", secret);
                let cookieValue = decypher.update(cookies.botauth, "base64", "utf8") + decypher.final("utf8");

                // set the resumption token to decrypted cookie value
                req.locals = req.locals || {};
                req.locals.resumption = cookieValue;

                // delete the cookie
                res.header("Set-Cookie", cookie.serialize("botauth", "", { maxAge: 0, httpOnly: true, secure: true }));
            }

            next();
        };
    };
}


text:
import localStorage from 'local-storage';

function getDataPath(draftId, dataName) {
  return `${draftId}/${dataName}`;
}

function getSortPreferences(draftId) {

  const dataPath = getDataPath(draftId, 'playerTableSorts');
  return JSON.parse(localStorage.get(dataPath) || '[]');

}

function updateSortPreference(draftId, newData) {

  const currentData = getSortPreferences(draftId);
  const dataPath = getDataPath(draftId, 'playerTableSorts');

  localStorage.set(dataPath, JSON.stringify(newData));

  return newData;

}

export default {getSortPreferences, updateSortPreference};


text:
#ifndef _IAS_QS_base_Attributes_H_
#define _IAS_QS_base_Attributes_H_

#include <qs/api/Attributes.h>

namespace IAS {
namespace QS {
namespace Base {

/*************************************************************************/
/** The Attributes class.
 *
 */
class Attributes : public virtual API::Attributes {
public:

	virtual ~Attributes() throw();

	void read(std::istream& inStream);
	void write(std::ostream& outStream) const;

protected:

	Attributes();
	Attributes(const API::Attributes& other);

	friend class Factory<Attributes>;
};

/*************************************************************************/
}
}
}

#endif /* _IAS_QS_System_Attributes_H_ */


text:
from __future__ import unicode_literals

import base64
import sys
import time
from datetime import datetime
from hashlib import sha1

from django.conf import settings
from django.contrib.auth.models import User
from djblets.siteconfig.models import SiteConfiguration

from reviewboard import get_package_version

def get_install_key():
    """Return the installation key for this server."""
    return sha1(settings.SECRET_KEY).hexdigest()

def _norm_siteconfig_value(siteconfig, key):
    """Normalize site configuration values to strip extra quotation marks."""
    value = siteconfig.get(key)

    # To work around rb-site requiring values in previous releases for these,
    # people would try empty quotes. We want to convert those to actual
    # empty strings.
    if value in ('""', "''", None):
        value = ''

    return value

def serialize_support_data(request=None, force_is_admin=False):
    """Serialize support data into a base64-encoded string."""
    siteconfig = SiteConfiguration.objects.get_current()

    is_admin = (force_is_admin or
                (request is not None and request.user.is_staff))

    return base64.b64encode('\t'.join([
        get_install_key(),
        '%d' % is_admin,
        siteconfig.site.domain,
        _norm_siteconfig_value(siteconfig, 'site_admin_name'),
        _norm_siteconfig_value(siteconfig, 'site_admin_email'),
        get_package_version(),
        '%d' % User.objects.filter(is_active=True).count(),
        '%d' % int(time.mktime(datetime.now().timetuple())),
        _norm_siteconfig_value(siteconfig, 'company'),
        '%s.%s.%s' % sys.version_info[:3],
    ]))

def get_default_support_url(request=None, force_is_admin=False):
    """Return the URL for the default Review Board support page."""
    siteconfig = SiteConfiguration.objects.get_current()

    if siteconfig.get('send_support_usage_stats'):
        support_data = serialize_support_data(request, force_is_admin)
    else:
        support_data = ''

    return settings.DEFAULT_SUPPORT_URL % {
        'support_data': support_data,
    }

def get_register_support_url(request=None, force_is_admin=False):
    """Return the URL for registering the Review Board support page."""
    siteconfig = SiteConfiguration.objects.get_current()

    if siteconfig.get('send_support_usage_stats'):
        support_data = serialize_support_data(request, force_is_admin)
    else:
        support_data = ''

    return settings.REGISTER_SUPPORT_URL % {
        'support_data': support_data,
    }

def get_support_url(request):
    """Return the URL for the configured support page."""
    siteconfig = SiteConfiguration.objects.get_current()

    return (siteconfig.get('support_url') or
            get_default_support_url(request))


text:
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
  <component name="ChangeListManager">
    <list default="true" id="4997f0e4-699b-4754-a672-9df75f23d856" name="Default" comment="">
      <change type="DELETED" beforePath="$PROJECT_DIR$/src/com/calpoly/incredible/GoogleSentiment.java" afterPath="" />
      <change type="DELETED" beforePath="$PROJECT_DIR$/src/com/calpoly/incredible/LanguageTool.java" afterPath="" />
      <change type="DELETED" beforePath="$PROJECT_DIR$/src/com/calpoly/incredible/Skittle.java" afterPath="" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/libraries/com_microsoft_azure_azure_storage_5_0_0.xml" afterPath="$PROJECT_DIR$/.idea/libraries/com_microsoft_azure_azure_storage_5_0_0.xml" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/workspace.xml" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/com/calpoly/incredible/Article.java" afterPath="$PROJECT_DIR$/src/com/calpoly/incredible/Article.java" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/com/calpoly/incredible/Bing.java" afterPath="$PROJECT_DIR$/src/com/calpoly/incredible/Bing.java" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/com/calpoly/incredible/RawScoreCalculator.java" afterPath="$PROJECT_DIR$/src/com/calpoly/incredible/RawScoreCalculator.java" />
    </list>
    <ignored path="$PROJECT_DIR$/target/" />
    <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
    <option name="TRACKING_ENABLED" value="true" />
    <option name="SHOW_DIALOG" value="false" />
    <option name="HIGHLIGHT_CONFLICTS" value="true" />
    <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
    <option name="LAST_RESOLUTION" value="IGNORE" />
  </component>
  <component name="CreatePatchCommitExecutor">
    <option name="PATCH_PATH" value="" />
  </component>
  <component name="ExecutionTargetManager" SELECTED_TARGET="default_target" />
  <component name="FileEditorManager">
    <leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
      <file leaf-file-name="Incredible.java" pinned="false" current-in-tab="false">
        <entry file="file://$PROJECT_DIR$/src/com/calpoly/incredible/Incredible.java">
          <provider selected="true" editor-type-id="text-editor">
            <state relative-caret-position="340">
              <caret line="31" column="0" lean-forward="false" selection-start-line="31" selection-start-column="0" selection-end-line="31" selection-end-column="0" />
              <folding>
                <element signature="imports" expanded="true" />
                <marker date="1489173998000" expanded="true" signature="3051:3163" ph="//..." />
              </folding>
            </state>
          </provider>
        </entry>
      </file>
      <file leaf-file-name="Backend.java" pinned="false" current-in-tab="false">
        <entry file="file://$PROJECT_DIR$/src/com/calpoly/incredible/Backend.java">
          <provider selected="true" editor-type-id="text-editor">
            <state relative-caret-position="680">
              <caret line="44" column="30" lean-forward="false" selection-start-line="44" selection-start-column="30" selection-end-line="44" selection-end-column="30" />
              <folding>
                <element signature="imports" expanded="true" />
              </folding>
            </state>
          </provider>
        </entry>
      </file>
      <file leaf-file-name="SourceEntity.java" pinned="false" current-in-tab="false">
        <entry file="file://$PROJECT_DIR$/src/com/calpoly/incredible/SourceEntity.java">
          <provider selected="true" editor-type-id="text-editor">
            <state relative-caret-position="238">
              <caret line="14" column="35" lean-forward="false" selection-start-line="14" selection-start-column="35" selection-end-line="14" selection-end-column="35" />
              <folding />
            </state>
          </provider>
        </entry>
      </file>
      <file leaf-file-name="WeightEntity.java" pinned="false" current-in-tab="false">
        <entry file="file://$PROJECT_DIR$/src/com/calpoly/incredible/WeightEntity.java">
          <provider selected="true" editor-type-id="text-editor">
            <state relative-caret-position="153">
              <caret line="9" column="30" lean-forward="false" selection-start-line="9" selection-start-column="30" selection-end-line="9" selection-end-column="30" />
              <folding />
            </state>
          </provider>
        </entry>
      </file>
      <file leaf-file-name="NewsSource.java" pinned="false" current-in-tab="false">
        <entry file="file://$PROJECT_DIR$/src/com/calpoly/incredible/NewsSource.java">
          <provider selected="true" editor-type-id="text-editor">
            <state relative-caret-position="102">
              <caret line="6" column="13" lean-forward="false" selection-start-line="6" selection-start-column="13" selection-end-line="6" selection-end-column="13" />
              <folding />
            </state>
          </provider>
        </entry>
      </file>
      <file leaf-file-name="RawScoreCalculator.java" pinned="false" current-in-tab="true">
        <entry file="file://$PROJECT_DIR$/src/com/calpoly/incredible/RawScoreCalculator.java">
          <provider selected="true" editor-type-id="text-editor">
            <state relative-caret-position="425">
              <caret line="30" column="58" lean-forward="true" selection-start-line="30" selection-start-column="58" selection-end-line="30" selection-end-column="58" />
              <folding />
            </state>
          </provider>
        </entry>
      </file>
      <file leaf-file-name="Article.java" pinned="false" current-in-tab="false">
        <entry file="file://$PROJECT_DIR$/src/com/calpoly/incredible/Article.java">
          <provider selected="true" editor-type-id="text-editor">
            <state relative-caret-position="255">
              <caret line="94" column="39" lean-forward="false" selection-start-line="94" selection-start-column="39" selection-end-line="94" selection-end-column="39" />
              <folding />
            </state>
          </provider>
        </entry>
      </file>
      <file leaf-file-name="Bing.java" pinned="false" current-in-tab="false">
        <entry file="file://$PROJECT_DIR$/src/com/calpoly/incredible/Bing.java">
          <provider selected="true" editor-type-id="text-editor">
            <state relative-caret-position="175">
              <caret line="135" column="32" lean-forward="true" selection-start-line="135" selection-start-column="32" selection-end-line="135" selection-end-column="32" />
              <folding />
            </state>
          </provider>
        </entry>
      </file>
    </leaf>
  </component>
  <component name="FileTemplateManagerImpl">
    <option name="RECENT_TEMPLATES">
      <list>
        <option value="Class" />
      </list>
    </option>
  </component>
  <component name="FindInProjectRecents">
    <findStrings>
      <find>BingRes</find>
    </findStrings>
  </component>
  <component name="Git.Settings">
    <option name="UPDATE_TYPE" value="MERGE" />
    <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
  </component>
  <component name="GradleLocalSettings">
    <option name="externalProjectsViewState">
      <projects_view />
    </option>
  </component>
  <component name="IdeDocumentHistory">
    <option name="CHANGED_PATHS">
      <list>
        <option value="$PROJECT_DIR$/src/com/calpoly/incredible/Incredible.java" />
        <option value="$PROJECT_DIR$/src/com/calpoly/incredible/Backend.java" />
        <option value="$PROJECT_DIR$/src/com/calpoly/incredible/SourceEntity.java" />
        <option value="$PROJECT_DIR$/src/com/calpoly/incredible/WeightEntity.java" />
        <option value="$PROJECT_DIR$/src/com/calpoly/incredible/Article.java" />
        <option value="$PROJECT_DIR$/src/com/calpoly/incredible/Bing.java" />
        <option value="$PROJECT_DIR$/src/com/calpoly/incredible/RawScoreCalculator.java" />
      </list>
    </option>
  </component>
  <component name="ProjectFrameBounds">
    <option name="width" value="1280" />
    <option name="height" value="800" />
  </component>
  <component name="ProjectView">
    <navigator currentView="ProjectPane" proportions="" version="1">
      <flattenPackages />
      <showMembers />
      <showModules />
      <showLibraryContents />
      <hideEmptyPackages />
      <abbreviatePackageNames />
      <autoscrollToSource />
      <autoscrollFromSource />
      <sortByType />
      <manualOrder />
      <foldersAlwaysOnTop value="true" />
    </navigator>
    <panes>
      <pane id="PackagesPane" />
      <pane id="ProjectPane">
        <subPane>
          <PATH>
            <PATH_ELEMENT>
              <option name="myItemId" value="incredible" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="incredible" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
          </PATH>
          <PATH>
            <PATH_ELEMENT>
              <option name="myItemId" value="incredible" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="incredible" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="src" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="incredible" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
          </PATH>
        </subPane>
      </pane>
      <pane id="Scratches" />
      <pane id="Scope" />
    </panes>
  </component>
  <component name="PropertiesComponent">
    <property name="last_opened_file_path" value="$USER_HOME$/Desktop/azure-storage-java-master/microsoft-azure-storage/src/com/microsoft/azure/storage" />
    <property name="project.structure.last.edited" value="Modules" />
    <property name="project.structure.proportion" value="0.15" />
    <property name="project.structure.side.proportion" value="0.2" />
    <property name="Downloaded.Files.Path.Enabled" value="true" />
    <property name="Repository.Attach.JavaDocs" value="false" />
    <property name="Repository.Attach.Sources" value="false" />
    <property name="FullScreen" value="true" />
  </component>
  <component name="RunManager" selected="Application.Incredible">
    <configuration default="false" name="Incredible" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
      <extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea">
        <pattern>
          <option name="PATTERN" value="com.calpoly.incredible.*" />
          <option name="ENABLED" value="true" />
        </pattern>
      </extension>
      <option name="MAIN_CLASS_NAME" value="com.calpoly.incredible.Incredible" />
      <option name="VM_PARAMETERS" value="" />
      <option name="PROGRAM_PARAMETERS" value="http://www.cnn.com/2017/02/15/politics/pentagon-considering-recommending-combat-troops-in-syria/index.html" />
      <option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
      <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
      <option name="ALTERNATIVE_JRE_PATH" />
      <option name="ENABLE_SWING_INSPECTOR" value="false" />
      <option name="ENV_VARIABLES" />
      <option name="PASS_PARENT_ENVS" value="true" />
      <module name="incredible" />
      <envs />
      <method />
    </configuration>
    <configuration default="true" type="#org.jetbrains.idea.devkit.run.PluginConfigurationType" factoryName="Plugin">
      <module name="" />
      <option name="VM_PARAMETERS" value="-Xmx512m -Xms256m -XX:MaxPermSize=250m -ea" />
      <option name="PROGRAM_PARAMETERS" />
      <predefined_log_file id="idea.log" enabled="true" />
      <method />
    </configuration>
    <configuration default="true" type="AndroidRunConfigurationType" factoryName="Android App">
      <module name="" />
      <option name="DEPLOY" value="true" />
      <option name="ARTIFACT_NAME" value="" />
      <option name="PM_INSTALL_OPTIONS" value="" />
      <option name="ACTIVITY_EXTRA_FLAGS" value="" />
      <option name="MODE" value="default_activity" />
      <option name="TARGET_SELECTION_MODE" value="SHOW_DIALOG" />
      <option name="PREFERRED_AVD" value="" />
      <option name="CLEAR_LOGCAT" value="false" />
      <option name="SHOW_LOGCAT_AUTOMATICALLY" value="false" />
      <option name="SKIP_NOOP_APK_INSTALLATIONS" value="true" />
      <option name="FORCE_STOP_RUNNING_APP" value="true" />
      <option name="DEBUGGER_TYPE" value="Java" />
      <option name="USE_LAST_SELECTED_DEVICE" value="false" />
      <option name="PREFERRED_AVD" value="" />
      <Java />
      <Profilers>
        <option name="ENABLE_ADVANCED_PROFILING" value="true" />
        <option name="GAPID_ENABLED" value="false" />
        <option name="GAPID_DISABLE_PCS" value="false" />
        <option name="SUPPORT_LIB_ENABLED" value="true" />
        <option name="INSTRUMENTATION_ENABLED" value="true" />
      </Profilers>
      <option name="DEEP_LINK" value="" />
      <option name="ACTIVITY_CLASS" value="" />
      <method />
    </configuration>
    <configuration default="true" type="AndroidTestRunConfigurationType" factoryName="Android Tests">
      <module name="" />
      <option name="TESTING_TYPE" value="0" />
      <option name="INSTRUMENTATION_RUNNER_CLASS" value="" />
      <option name="METHOD_NAME" value="" />
      <option name="CLASS_NAME" value="" />
      <option name="PACKAGE_NAME" value="" />
      <option name="EXTRA_OPTIONS" value="" />
      <option name="TARGET_SELECTION_MODE" value="SHOW_DIALOG" />
      <option name="PREFERRED_AVD" value="" />
      <option name="CLEAR_LOGCAT" value="false" />
      <option name="SHOW_LOGCAT_AUTOMATICALLY" value="false" />
      <option name="SKIP_NOOP_APK_INSTALLATIONS" value="true" />
      <option name="FORCE_STOP_RUNNING_APP" value="true" />
      <option name="DEBUGGER_TYPE" value="Java" />
      <option name="USE_LAST_SELECTED_DEVICE" value="false" />
      <option name="PREFERRED_AVD" value="" />
      <Java />
      <Profilers>
        <option name="ENABLE_ADVANCED_PROFILING" value="true" />
        <option name="GAPID_ENABLED" value="false" />
        <option name="GAPID_DISABLE_PCS" value="false" />
        <option name="SUPPORT_LIB_ENABLED" value="true" />
        <option name="INSTRUMENTATION_ENABLED" value="true" />
      </Profilers>
      <method />
    </configuration>
    <configuration default="true" type="Applet" factoryName="Applet">
      <option name="HTML_USED" value="false" />
      <option name="WIDTH" value="400" />
      <option name="HEIGHT" value="300" />
      <option name="POLICY_FILE" value="$APPLICATION_HOME_DIR$/bin/appletviewer.policy" />
      <module />
      <method />
    </configuration>
    <configuration default="true" type="Application" factoryName="Application">
      <extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
      <option name="MAIN_CLASS_NAME" />
      <option name="VM_PARAMETERS" />
      <option name="PROGRAM_PARAMETERS" />
      <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
      <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
      <option name="ALTERNATIVE_JRE_PATH" />
      <option name="ENABLE_SWING_INSPECTOR" value="false" />
      <option name="ENV_VARIABLES" />
      <option name="PASS_PARENT_ENVS" value="true" />
      <module name="" />
      <envs />
      <method />
    </configuration>
    <configuration default="true" type="GradleRunConfiguration" factoryName="Gradle">
      <ExternalSystemSettings>
        <option name="executionName" />
        <option name="externalProjectPath" />
        <option name="externalSystemIdString" value="GRADLE" />
        <option name="scriptParameters" />
        <option name="taskDescriptions">
          <list />
        </option>
        <option name="taskNames">
          <list />
        </option>
        <option name="vmOptions" />
      </ExternalSystemSettings>
      <method />
    </configuration>
    <configuration default="true" type="JUnit" factoryName="JUnit">
      <extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
      <module name="" />
      <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
      <option name="ALTERNATIVE_JRE_PATH" />
      <option name="PACKAGE_NAME" />
      <option name="MAIN_CLASS_NAME" />
      <option name="METHOD_NAME" />
      <option name="TEST_OBJECT" value="class" />
      <option name="VM_PARAMETERS" value="-ea" />
      <option name="PARAMETERS" />
      <option name="WORKING_DIRECTORY" value="$MODULE_DIR$" />
      <option name="ENV_VARIABLES" />
      <option name="PASS_PARENT_ENVS" value="true" />
      <option name="TEST_SEARCH_SCOPE">
        <value defaultName="singleModule" />
      </option>
      <envs />
      <patterns />
      <method />
    </configuration>
    <configuration default="true" type="JarApplication" factoryName="JAR Application">
      <extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
      <envs />
      <method />
    </configuration>
    <configuration default="true" type="Java Scratch" factoryName="Java Scratch">
      <extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
      <option name="SCRATCH_FILE_ID" value="0" />
      <option name="MAIN_CLASS_NAME" />
      <option name="VM_PARAMETERS" />
      <option name="PROGRAM_PARAMETERS" />
      <option name="WORKING_DIRECTORY" />
      <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
      <option name="ALTERNATIVE_JRE_PATH" />
      <option name="ENABLE_SWING_INSPECTOR" value="false" />
      <option name="ENV_VARIABLES" />
      <option name="PASS_PARENT_ENVS" value="true" />
      <module name="" />
      <envs />
      <method />
    </configuration>
    <configuration default="true" type="JetRunConfigurationType" factoryName="Kotlin">
      <extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
      <option name="MAIN_CLASS_NAME" />
      <option name="VM_PARAMETERS" />
      <option name="PROGRAM_PARAMETERS" />
      <option name="WORKING_DIRECTORY" />
      <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
      <option name="ALTERNATIVE_JRE_PATH" />
      <option name="PASS_PARENT_ENVS" value="true" />
      <module name="incredible" />
      <envs />
      <method />
    </configuration>
    <configuration default="true" type="KotlinStandaloneScriptRunConfigurationType" factoryName="Kotlin script">
      <extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
      <option name="filePath" />
      <option name="vmParameters" />
      <option name="alternativeJrePath" />
      <option name="programParameters" />
      <option name="passParentEnvs" value="true" />
      <option name="workingDirectory" />
      <option name="isAlternativeJrePathEnabled" value="false" />
      <envs />
      <method />
    </configuration>
    <configuration default="true" type="Remote" factoryName="Remote">
      <option name="USE_SOCKET_TRANSPORT" value="true" />
      <option name="SERVER_MODE" value="false" />
      <option name="SHMEM_ADDRESS" value="javadebug" />
      <option name="HOST" value="localhost" />
      <option name="PORT" value="5005" />
      <method />
    </configuration>
    <configuration default="true" type="TestNG" factoryName="TestNG">
      <extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
      <module name="" />
      <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
      <option name="ALTERNATIVE_JRE_PATH" />
      <option name="SUITE_NAME" />
      <option name="PACKAGE_NAME" />
      <option name="MAIN_CLASS_NAME" />
      <option name="METHOD_NAME" />
      <option name="GROUP_NAME" />
      <option name="TEST_OBJECT" value="CLASS" />
      <option name="VM_PARAMETERS" value="-ea" />
      <option name="PARAMETERS" />
      <option name="WORKING_DIRECTORY" value="$MODULE_DIR$" />
      <option name="OUTPUT_DIRECTORY" />
      <option name="ANNOTATION_TYPE" />
      <option name="ENV_VARIABLES" />
      <option name="PASS_PARENT_ENVS" value="true" />
      <option name="TEST_SEARCH_SCOPE">
        <value defaultName="singleModule" />
      </option>
      <option name="USE_DEFAULT_REPORTERS" value="false" />
      <option name="PROPERTIES_FILE" />
      <envs />
      <properties />
      <listeners />
      <method />
    </configuration>
    <list size="1">
      <item index="0" class="java.lang.String" itemvalue="Application.Incredible" />
    </list>
    <recent_temporary>
      <list size="1">
        <item index="0" class="java.lang.String" itemvalue="Application.Incredible" />
      </list>
    </recent_temporary>
  </component>
  <component name="ShelveChangesManager" show_recycled="false">
    <option name="remove_strategy" value="false" />
  </component>
  <component name="SvnConfiguration">
    <configuration />
  </component>
  <component name="TaskManager">
    <task active="true" id="Default" summary="Default task">
      <changelist id="4997f0e4-699b-4754-a672-9df75f23d856" name="Default" comment="" />
      <created>1488565410673</created>
      <option name="number" value="Default" />
      <option name="presentableId" value="Default" />
      <updated>1488565410673</updated>
    </task>
    <servers />
  </component>
  <component name="TodoView">
    <todo-panel id="selected-file">
      <is-autoscroll-to-source value="true" />
    </todo-panel>
    <todo-panel id="all">
      <are-packages-shown value="true" />
      <is-autoscroll-to-source value="true" />
    </todo-panel>
  </component>
  <component name="ToolWindowManager">
    <frame x="0" y="0" width="1280" height="800" extended-state="0" />
    <editor active="true" />
    <layout>
      <window_info id="Palette" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
      <window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32950193" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
      <window_info id="Nl-Palette" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
      <window_info id="Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32802126" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
      <window_info id="Palette	" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
      <window_info id="Image Layers" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
      <window_info id="Capture Analysis" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
      <window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="true" content_ui="tabs" />
      <window_info id="Maven Projects" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
      <window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.30397728" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
      <window_info id="Run" active="true" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.32802126" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
      <window_info id="Properties" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
      <window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.22094509" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
      <window_info id="Capture Tool" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
      <window_info id="Designer" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
      <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.23046875" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
      <window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32934928" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
      <window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
      <window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
      <window_info id="UI Designer" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
      <window_info id="Theme Preview" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
      <window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="true" content_ui="tabs" />
      <window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
      <window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
      <window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
      <window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
      <window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
      <window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
    </layout>
  </component>
  <component name="VcsContentAnnotationSettings">
    <option name="myLimit" value="2678400000" />
  </component>
  <component name="XDebuggerManager">
    <breakpoint-manager />
    <watches-manager />
  </component>
  <component name="antWorkspaceConfiguration">
    <option name="IS_AUTOSCROLL_TO_SOURCE" value="false" />
    <option name="FILTER_TARGETS" value="false" />
  </component>
  <component name="editorHistoryManager">
    <entry file="file://$PROJECT_DIR$/src/com/calpoly/incredible/Incredible.java">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="340">
          <caret line="31" column="0" lean-forward="false" selection-start-line="31" selection-start-column="0" selection-end-line="31" selection-end-column="0" />
          <folding>
            <element signature="imports" expanded="true" />
            <marker date="1489173998000" expanded="true" signature="3051:3163" ph="//..." />
          </folding>
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/src/com/calpoly/incredible/Backend.java">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="680">
          <caret line="44" column="30" lean-forward="false" selection-start-line="44" selection-start-column="30" selection-end-line="44" selection-end-column="30" />
          <folding>
            <element signature="imports" expanded="true" />
          </folding>
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/src/com/calpoly/incredible/SourceEntity.java">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="238">
          <caret line="14" column="35" lean-forward="false" selection-start-line="14" selection-start-column="35" selection-end-line="14" selection-end-column="35" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/src/com/calpoly/incredible/WeightEntity.java">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="153">
          <caret line="9" column="30" lean-forward="false" selection-start-line="9" selection-start-column="30" selection-end-line="9" selection-end-column="30" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/src/com/calpoly/incredible/GoogleSentiment.java">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="0">
          <caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/src/com/calpoly/incredible/RawScoreCalculator.java">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="340">
          <caret line="25" column="13" lean-forward="false" selection-start-line="25" selection-start-column="13" selection-end-line="25" selection-end-column="13" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/src/com/calpoly/incredible/Article.java">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="952">
          <caret line="56" column="25" lean-forward="false" selection-start-line="56" selection-start-column="25" selection-end-line="56" selection-end-column="25" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/src/com/calpoly/incredible/Incredible.java">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="527">
          <caret line="31" column="0" lean-forward="true" selection-start-line="31" selection-start-column="0" selection-end-line="31" selection-end-column="0" />
          <folding>
            <element signature="imports" expanded="true" />
            <marker date="1489173998000" expanded="true" signature="3051:3163" ph="//..." />
          </folding>
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/src/com/calpoly/incredible/Backend.java">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="748">
          <caret line="44" column="30" lean-forward="true" selection-start-line="44" selection-start-column="30" selection-end-line="44" selection-end-column="30" />
          <folding>
            <element signature="imports" expanded="true" />
          </folding>
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/src/com/calpoly/incredible/SourceEntity.java">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="238">
          <caret line="14" column="35" lean-forward="false" selection-start-line="14" selection-start-column="35" selection-end-line="14" selection-end-column="35" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/src/com/calpoly/incredible/WeightEntity.java">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="0">
          <caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/src/com/calpoly/incredible/RawScoreCalculator.java">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="340">
          <caret line="25" column="13" lean-forward="false" selection-start-line="25" selection-start-column="13" selection-end-line="25" selection-end-column="13" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/src/com/calpoly/incredible/Article.java">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="952">
          <caret line="56" column="25" lean-forward="false" selection-start-line="56" selection-start-column="25" selection-end-line="56" selection-end-column="25" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/src/com/calpoly/incredible/Incredible.java">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="544">
          <caret line="32" column="11" lean-forward="false" selection-start-line="32" selection-start-column="11" selection-end-line="32" selection-end-column="11" />
          <folding>
            <element signature="imports" expanded="true" />
            <marker date="1489173998000" expanded="true" signature="3051:3163" ph="//..." />
          </folding>
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/src/com/calpoly/incredible/RawScoreCalculator.java">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="0">
          <caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/src/com/calpoly/incredible/Article.java">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="952">
          <caret line="56" column="25" lean-forward="false" selection-start-line="56" selection-start-column="25" selection-end-line="56" selection-end-column="25" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/src/com/calpoly/incredible/Incredible.java">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="0">
          <caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
          <folding>
            <element signature="imports" expanded="true" />
            <marker date="1489173998000" expanded="true" signature="3051:3163" ph="//..." />
          </folding>
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/src/com/calpoly/incredible/Incredible.java">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="0">
          <caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
          <folding>
            <element signature="imports" expanded="true" />
            <marker date="1489173998000" expanded="true" signature="3051:3163" ph="//..." />
          </folding>
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/src/com/calpoly/incredible/Incredible.java">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="0">
          <caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
          <folding>
            <element signature="imports" expanded="true" />
            <marker date="1489173998000" expanded="true" signature="3051:3163" ph="//..." />
          </folding>
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/README.md">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="-4369">
          <caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/.idea/workspace.xml">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="255">
          <caret line="15" column="43" lean-forward="true" selection-start-line="15" selection-start-column="43" selection-end-line="15" selection-end-column="43" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/src/com/calpoly/incredible/Incredible.java">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="340">
          <caret line="31" column="0" lean-forward="false" selection-start-line="31" selection-start-column="0" selection-end-line="31" selection-end-column="0" />
          <folding>
            <element signature="imports" expanded="true" />
            <marker date="1489173998000" expanded="true" signature="3051:3163" ph="//..." />
          </folding>
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/src/com/calpoly/incredible/Backend.java">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="680">
          <caret line="44" column="30" lean-forward="false" selection-start-line="44" selection-start-column="30" selection-end-line="44" selection-end-column="30" />
          <folding>
            <element signature="imports" expanded="true" />
          </folding>
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/src/com/calpoly/incredible/LanguageTool.java">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="51">
          <caret line="8" column="19" lean-forward="false" selection-start-line="8" selection-start-column="19" selection-end-line="8" selection-end-column="19" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/src/com/calpoly/incredible/Skittle.java">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="-1368">
          <caret line="32" column="35" lean-forward="true" selection-start-line="32" selection-start-column="35" selection-end-line="32" selection-end-column="35" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/src/com/calpoly/incredible/GoogleSentiment.java">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="17">
          <caret line="11" column="13" lean-forward="false" selection-start-line="11" selection-start-column="13" selection-end-line="11" selection-end-column="13" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/src/com/calpoly/incredible/WeightEntity.java">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="153">
          <caret line="9" column="30" lean-forward="false" selection-start-line="9" selection-start-column="30" selection-end-line="9" selection-end-column="30" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/src/com/calpoly/incredible/NewsSource.java">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="102">
          <caret line="6" column="13" lean-forward="false" selection-start-line="6" selection-start-column="13" selection-end-line="6" selection-end-column="13" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/src/com/calpoly/incredible/Article.java">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="255">
          <caret line="94" column="39" lean-forward="false" selection-start-line="94" selection-start-column="39" selection-end-line="94" selection-end-column="39" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/src/com/calpoly/incredible/SourceEntity.java">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="238">
          <caret line="14" column="35" lean-forward="false" selection-start-line="14" selection-start-column="35" selection-end-line="14" selection-end-column="35" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/src/com/calpoly/incredible/Bing.java">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="175">
          <caret line="135" column="32" lean-forward="true" selection-start-line="135" selection-start-column="32" selection-end-line="135" selection-end-column="32" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/src/com/calpoly/incredible/RawScoreCalculator.java">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="425">
          <caret line="30" column="58" lean-forward="true" selection-start-line="30" selection-start-column="58" selection-end-line="30" selection-end-column="58" />
          <folding />
        </state>
      </provider>
    </entry>
  </component>
  <component name="masterDetails">
    <states>
      <state key="ArtifactsStructureConfigurable.UI">
        <settings>
          <artifact-editor />
          <splitter-proportions>
            <option name="proportions">
              <list>
                <option value="0.2" />
              </list>
            </option>
          </splitter-proportions>
        </settings>
      </state>
      <state key="FacetStructureConfigurable.UI">
        <settings>
          <last-edited>No facets are configured</last-edited>
          <splitter-proportions>
            <option name="proportions">
              <list>
                <option value="0.2" />
              </list>
            </option>
          </splitter-proportions>
        </settings>
      </state>
      <state key="GlobalLibrariesConfigurable.UI">
        <settings>
          <last-edited>jackson-core-2.6.0</last-edited>
          <splitter-proportions>
            <option name="proportions">
              <list>
                <option value="0.2" />
              </list>
            </option>
          </splitter-proportions>
        </settings>
      </state>
      <state key="JdkListConfigurable.UI">
        <settings>
          <last-edited>1.8</last-edited>
          <splitter-proportions>
            <option name="proportions">
              <list>
                <option value="0.2" />
              </list>
            </option>
          </splitter-proportions>
        </settings>
      </state>
      <state key="ModuleStructureConfigurable.UI">
        <settings>
          <last-edited>incredible</last-edited>
          <splitter-proportions>
            <option name="proportions">
              <list>
                <option value="0.2" />
              </list>
            </option>
          </splitter-proportions>
        </settings>
      </state>
      <state key="ProjectLibrariesConfigurable.UI">
        <settings>
          <last-edited>unirest-java-1.4.9</last-edited>
          <splitter-proportions>
            <option name="proportions">
              <list>
                <option value="0.2" />
              </list>
            </option>
          </splitter-proportions>
        </settings>
      </state>
    </states>
  </component>
</project>


text: export {Subscriber} from 'rxjs/internal-compatibility';


text:
#ifndef INVERTED_LIST_HPP
#define INVERTED_LIST_HPP
#include <vector>
#include <algorithm>
#include <stdio.h>
#include <stdexcept>

//!  Struct do elemento nó.
/*!  Implementação do nó AVL, que será inserido
 *   na árvore de palavras em arquivo.
 */
typedef struct Word {
	char word[100];
	int height,
			 right,
			 left;
	int occurrences[5642];
	int occurrenceIndex;

	bool operator==(const Word& rhs) const {
		if (strcmp(word, rhs.word) == 0) {
			return true;
		}
		return false;
	}

	bool operator<(const Word& rhs) const {
		if (strcmp(word, rhs.word) < 0)  {
			return true;
		}
		return false;
	}

	bool operator>(const Word& rhs) const {
		if (strcmp(word, rhs.word) > 0)  {
			return true;
		}
		return false;
	}

} Word;

//!  Classe do elemento da estrutura de dado: Arvore AVL.
/*!  Implementação do nó AVL com especialização para
 *   operações em disco, realizada na disciplina de
 *   Estrutura de Dados - INE5408 como trabalho de implementação II do semestre.
 *   \author Bruno Marques Do Nascimento e Salomão Rodrigues Jacinto
 *   \since 10/07/2016
 *   \version 1.0
 */
class InvertedList {
 private:
	FILE *invertedDat;  /*!< Ponteiro para o arquivo que possui a árvore */
	Word node;  /*!< Struct Word que contém as informações do nó */

 public:
//! Contrutor com argumentos.
/*! Sempre que usado, este construtor criará um
 *  nó AVL, que possuirá filhos nulos, e seu dado conforme
 *  valor passado por parâmetro, além de altura 1;
 *  \param manPagePosition posição da palavra no manpage.dat.
 *  \param word nome da palavra a ser inserido.
 */
	InvertedList(int manPagePosition, const char word[100]) {
		node.height = 1;
		node.right = 0;
		node.left = 0;
		node.occurrenceIndex = 0;
		node.occurrences[node.occurrenceIndex] = manPagePosition;
		for(int j = 0; j < 100; j++) {
			node.word[j] = ' ';
		}
		strcpy(node.word, word);
		invertedDat = fopen("inverted.dat", "r+");
	}

//! Destrutor.
/*! Tem a função de destruir o nó AVL e fechar o arquivo da árvore.
 */
	~InvertedList() {
		fclose(invertedDat);
	}

//!  Função getHeight, informa a altura do nó.
/*!
 *   \return um inteiro que informa a altura do nó.
 *   \sa InvertedList(int manPagePosition, const char word[100])
 */
	int getHeight() {
		return node.height;
	}

//!  Função getLeft, informa o ponteiro para o filho da esquerda.
/*!
 *   \return um ponteiro que informa a posição do filho esquerdo no arquivo.
 *   \sa InvertedList(int manPagePosition, const char word[100])
 */
	int getLeft() {
		return node.left;
	}

//!  Função getRight, informa o ponteiro para o filho da direita.
/*!
 *   \return um ponteiro que informa a posição do filho direito no arquivo.
 *   \sa InvertedList(int manPagePosition, const char word[100])
 */
	int getRight() {
		return node.right;
	}

//!  Função getWord, informa o nodo.
/*!
 *   \return uma struct Word que foi criada.
 *   \sa InvertedList(int manPagePosition, const char word[100])
 */
	Word& getWord() {
		return node;
	}

//!  Função heightAVL, informa altura de um nó.
/*!
 *   \param node posição do nó no arquivo
 *   \return o valo da altura do nó.
 *   \sa InvertedList(int manPagePosition, const char word[100])
 */
	int heightAVL(int node) {
		if (node == 0) {
			return 0;
		} else {
			fseek(invertedDat, node, SEEK_SET);
			Word nodeTmp;
			fread(&nodeTmp, sizeof(Word), 1, invertedDat);
			return nodeTmp.height;
		}
	}

//!  Função getBalance, calcula a diferença das alturas dos nós filhos.
/*!
 *   \param nodo o nó pai.
 *   \return um inteiro que informa a diferença das alturas dos nós filhos.
 *   \sa InvertedList(int manPagePosition, const char word[100])
 */
	int getBalance(Word &node) {
		return heightAVL(node.left) - heightAVL(node.right);
	}

//!  Função rightRotation, realiza uma rotação simples para direita.
/*!
 *   \param y o nó raiz da rotação.
 *   \param root a posição do nó no arquivo.
 *   \return um ponteiro para o nó raiz ao final da rotação.
 *   \sa InvertedList(int manPagePosition, const char word[100])
 */
	int rightRotation(Word y, int root) {
		Word x;

		fseek(invertedDat, y.left, SEEK_SET);
		fread(&x, sizeof(Word), 1, invertedDat);

		int rootNew = y.left;
		int aux = x.right;

		x.right = root;
		fseek(invertedDat, y.left, SEEK_SET);
		fwrite(&x, sizeof(Word), 1, invertedDat);

		y.left = aux;
		fseek(invertedDat, root, SEEK_SET);
		fwrite(&y, sizeof(Word), 1, invertedDat);

		//  Atualiza altura
		y.height = std::max(heightAVL(y.left), heightAVL(y.right))+1;
		fseek(invertedDat, root, SEEK_SET);
		fwrite(&y, sizeof(Word), 1, invertedDat);

		x.height = std::max(heightAVL(x.left), heightAVL(x.right))+1;
		fseek(invertedDat, rootNew, SEEK_SET);
		fwrite(&x, sizeof(Word), 1, invertedDat);

		// Retorna nova raiz
		return rootNew;
	}

//!  Função leftRotation, realiza uma rotação simples para esquerda.
/*!
 *   \param x o nó raiz da rotação.
 *   \param root a posição do nó no arquivo.
 *   \return um ponteiro para o nó raiz ao final da rotação.
 *   \sa InvertedList(int manPagePosition, const char word[100])
 */
	int leftRotation(Word x, int root) {
		Word y;

		fseek(invertedDat, x.right, SEEK_SET);
		fread(&y, sizeof(Word), 1, invertedDat);

		int rootNew = x.right;
		int aux = y.left;

		y.left = root;
		fseek(invertedDat, x.right, SEEK_SET);
		fwrite(&y, sizeof(Word), 1, invertedDat);

		x.right = aux;
		fseek(invertedDat, root, SEEK_SET);
		fwrite(&x, sizeof(Word), 1, invertedDat);

		//  Atualiza altura
		x.height = std::max(heightAVL(x.left), heightAVL(x.right))+1;
		fseek(invertedDat, root, SEEK_SET);
		fwrite(&x, sizeof(Word), 1, invertedDat);

		y.height = std::max(heightAVL(y.left), heightAVL(y.right))+1;
		fseek(invertedDat, rootNew, SEEK_SET);
		fwrite(&y, sizeof(Word), 1, invertedDat);

		// Retorna nova raíz
		return rootNew;
	}

//!  Função insert, insere um dado em uma árvore AVL.
/*!
 *   \param node o nó a ser inserido na árvore.
 *   \param root ponteiro para raiz da árvore.
 *   \return um ponteiro para o nó inserido.
 *   \sa InvertedList(int manPagePosition, const char word[100])
 */
	int insert(Word &node, int root) {
		if (root == 0) {
			fseek(invertedDat, 0, SEEK_END);
			root = ftell(invertedDat);
			fwrite(&node, sizeof(Word), 1, invertedDat);
			return root;
		}

		fseek(invertedDat, root, SEEK_SET);
		Word nodeTmp;
		fread(&nodeTmp, sizeof(Word), 1, invertedDat);

		if(node == nodeTmp) {
			if(node.occurrences[node.occurrenceIndex] != nodeTmp.occurrences[nodeTmp.occurrenceIndex]) {
					nodeTmp.occurrenceIndex++;
					nodeTmp.occurrences[nodeTmp.occurrenceIndex] = node.occurrences[node.occurrenceIndex];
					fseek(invertedDat, root, SEEK_SET);
					fwrite(&nodeTmp, sizeof(Word), 1, invertedDat);
					fflush(invertedDat);
			}
		} else {

			if (node < nodeTmp) {
				nodeTmp.left = insert(node, nodeTmp.left);
			} else {
				nodeTmp.right = insert(node, nodeTmp.right);
			}
			fseek(invertedDat, root, SEEK_SET);
			fwrite(&nodeTmp, sizeof(Word), 1, invertedDat);

			nodeTmp.height = std::max( heightAVL(nodeTmp.left), heightAVL(nodeTmp.right) ) +1;

			fseek(invertedDat, root, SEEK_SET);
			fwrite(&nodeTmp, sizeof(Word), 1, invertedDat);

			int balance = getBalance(nodeTmp);

			Word nodeTmpRight, nodeTmpLeft;

			if(nodeTmp.left != 0){
				fseek(invertedDat, nodeTmp.left, SEEK_SET);
				fread(&nodeTmpLeft, sizeof(Word), 1, invertedDat);
			}

			if(nodeTmp.right != 0){
				fseek(invertedDat, nodeTmp.right, SEEK_SET);
				fread(&nodeTmpRight, sizeof(Word), 1, invertedDat);
			}

			// Caso Esquerda-Esquerda
			if (balance > 1 && node < nodeTmpLeft) {
				return rightRotation(nodeTmp, root);
			}

			// Caso Esquerda-Direita
			if (balance > 1 && node > nodeTmpLeft) {
				nodeTmp.left = leftRotation(nodeTmpLeft, nodeTmp.left);
				fseek(invertedDat, root, SEEK_SET);
				fwrite(&nodeTmp, sizeof(Word), 1, invertedDat);
				return rightRotation(nodeTmp, root);
			}

			// Caso Direita-Direita
			if (balance < -1 && node > nodeTmpRight) {
				return leftRotation(nodeTmp, root);
			}

			// Caso Direita-Esquerda
			if (balance < -1 && node < nodeTmpRight) {
				nodeTmp.right = rightRotation(nodeTmpRight, nodeTmp.right);
				fseek(invertedDat, root, SEEK_SET);
				fwrite(&nodeTmp, sizeof(Word), 1, invertedDat);
				return leftRotation(nodeTmp, root);
			}
		}
		return root;
	}

//!  Função search, busca por um dado em uma árvore AVL.
/*!
 *   \param node nó a ser buscado na árvore.
 *   \return o nó encontrado.
 *   \sa InvertedList(int manPagePosition, const char word[100])
 */
	Word search(Word node) {
		Word temp;
		int root;
		fseek(invertedDat, 0, SEEK_SET);
		fread(&root, sizeof(int), 1, invertedDat);

		fseek(invertedDat, root, SEEK_SET);
		fread(&temp, sizeof(Word), 1, invertedDat);

		while (root != 0 && !(node == temp)) {
			if (node < temp) {
				fseek(invertedDat, temp.left, SEEK_SET);
				root = temp.left;
				fread(&temp, sizeof(Word), 1, invertedDat);
			} else {
				fseek(invertedDat, temp.right, SEEK_SET);
				root = temp.right;
				fread(&temp, sizeof(Word), 1, invertedDat);
			}
		}

		if (root == 0) {
			temp.occurrenceIndex = -1;
			return temp;
		} else {
			return temp;
		}
	}

};

#endif /* INVERTED_LIST_HPP */


text:
/* ------------------------------------------------------------------------- */
//
// Copyright (c) 2010 CubeSoft, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//  http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
/* ------------------------------------------------------------------------- */
using System;
using System.Runtime.InteropServices;

namespace Cube.Forms.Gdi32
{
    /* --------------------------------------------------------------------- */
    ///
    /// Gdi32.NativeMethods
    ///
    /// <summary>
    /// Provides functions defined in user32.dll.
    /// </summary>
    ///
    /* --------------------------------------------------------------------- */
    internal static class NativeMethods
    {
        #region Methods

        /* ----------------------------------------------------------------- */
        ///
        /// CreateRoundRectRgn
        ///
        /// <summary>
        /// https://msdn.microsoft.com/ja-jp/library/windows/desktop/dd183516.aspx
        /// </summary>
        ///
        /* ----------------------------------------------------------------- */
        [DllImport(LibName)]
        public static extern IntPtr CreateRoundRectRgn(int nLeftRect, int nTopRect,
            int nRightRect, int nBottomRect, int nWidthEllipse, int nHeightEllipse);

        #endregion

        #region Fields
        const string LibName = "Gdi32.dll";
        #endregion
    }
}


text:
package com.jayway.restassured.itest.java;

import com.jayway.restassured.itest.java.support.WithJetty;
import org.apache.commons.io.IOUtils;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.xml.sax.SAXParseException;

import java.io.InputStream;

import static com.jayway.restassured.RestAssured.expect;
import static com.jayway.restassured.matcher.RestAssuredMatchers.matchesDtd;
import static com.jayway.restassured.matcher.RestAssuredMatchers.matchesXsd;

public class XMLValidationITest extends WithJetty {

    @Rule
    public ExpectedException exception = ExpectedException.none();

    @Test
    public void validatesXsdInputStream() throws Exception {
        final InputStream xsd = getClass().getResourceAsStream("/car-records.xsd");

        expect().body(matchesXsd(xsd)).when().get("/carRecords");
    }

    @Test
    public void validatesXsdString() throws Exception {
        final InputStream inputstream = getClass().getResourceAsStream("/car-records.xsd");
        final String xsd = IOUtils.toString(inputstream);

        expect().body(matchesXsd(xsd)).when().get("/carRecords");
    }

    @Test
    public void throwsExceptionWhenXsdValidationFails() throws Exception {
        exception.expect(SAXParseException.class);
        exception.expectMessage("Cannot find the declaration of element 'shopping'.");

        final InputStream xsd = getClass().getResourceAsStream("/car-records.xsd");

        expect().body(matchesXsd(xsd)).when().get("/shopping");
    }

    @Test
    public void validatesDtdInputStream() throws Exception {
        final InputStream dtd = getClass().getResourceAsStream("/videos.dtd");

        expect().body(matchesDtd(dtd)).when().get("/videos");
    }

    @Test
    public void validatesDtdString() throws Exception {
        final InputStream inputstream = getClass().getResourceAsStream("/videos.dtd");
        final String dtd = IOUtils.toString(inputstream);

        expect().body(matchesDtd(dtd)).when().get("/videos");
    }

    @Test
    public void throwsExceptionWhenDtdValidationFails() throws Exception {
        exception.expect(SAXParseException.class);
        exception.expectMessage("Element type \"shopping\" must be declared.");

        final InputStream dtd = getClass().getResourceAsStream("/videos.dtd");

        expect().body(matchesDtd(dtd)).when().get("/shopping");
    }

    @Test
    public void throwsExceptionWhenUsingDtdForXsd() throws Exception {
        exception.expect(SAXParseException.class);
        exception.expectMessage("The markup in the document preceding the root element must be well-formed.");

        final InputStream dtd = getClass().getResourceAsStream("/videos.dtd");

        expect().body(matchesXsd(dtd)).when().get("/carRecords");
    }

    @Test
    public void throwsExceptionWhenUsingXsdForDtd() throws Exception {
        exception.expect(SAXParseException.class);
        exception.expectMessage("The markup declarations contained or pointed to by the document type declaration must be well-formed.");

        final InputStream xsd = getClass().getResourceAsStream("/car-records.xsd");

        expect().body(matchesDtd(xsd)).when().get("/videos");
    }
}


text:
//=================================================================================================

//=================================================================================================

#ifndef _BLAZETEST_MATHTEST_ADAPTORS_HERMITIANMATRIX_DENSECOMPLEXTEST_H_
#define _BLAZETEST_MATHTEST_ADAPTORS_HERMITIANMATRIX_DENSECOMPLEXTEST_H_

//*************************************************************************************************
// Includes
//*************************************************************************************************

#include <sstream>
#include <stdexcept>
#include <string>
#include <blaze/math/constraints/ColumnMajorMatrix.h>
#include <blaze/math/constraints/DenseMatrix.h>
#include <blaze/math/constraints/Hermitian.h>
#include <blaze/math/constraints/RequiresEvaluation.h>
#include <blaze/math/constraints/RowMajorMatrix.h>
#include <blaze/math/constraints/Symmetric.h>
#include <blaze/math/DynamicMatrix.h>
#include <blaze/math/HermitianMatrix.h>
#include <blaze/math/typetraits/IsRowMajorMatrix.h>
#include <blaze/util/Complex.h>
#include <blaze/util/constraints/SameType.h>
#include <blazetest/system/Types.h>

namespace blazetest {

namespace mathtest {

namespace adaptors {

namespace hermitianmatrix {

//=================================================================================================
//
//  CLASS DEFINITION
//
//=================================================================================================

//*************************************************************************************************
/*!\brief Auxiliary class for all tests of the dense HermitianMatrix specialization.
//
// This class represents a test suite for the blaze::HermitianMatrix class template specialization
// for dense matrices with complex element type. It performs a series of both compile time as well
// as runtime tests.
*/
class DenseComplexTest
{
 public:
   //**Constructors********************************************************************************
   /*!\name Constructors */
   //@{
   explicit DenseComplexTest();
   // No explicitly declared copy constructor.
   //@}
   //**********************************************************************************************

   //**Destructor**********************************************************************************
   // No explicitly declared destructor.
   //**********************************************************************************************

 private:
   //**Test functions******************************************************************************
   /*!\name Test functions */
   //@{
   void testConstructors();
   void testAssignment  ();
   void testAddAssign   ();
   void testSubAssign   ();
   void testSchurAssign ();
   void testMultAssign  ();
   void testScaling     ();
   void testFunctionCall();
   void testIterator    ();
   void testNonZeros    ();
   void testReset       ();
   void testClear       ();
   void testResize      ();
   void testExtend      ();
   void testReserve     ();
   void testShrinkToFit ();
   void testSwap        ();
   void testTranspose   ();
   void testCTranspose  ();
   void testIsDefault   ();
   void testSubmatrix   ();
   void testRow         ();
   void testColumn      ();

   template< typename Type >
   void checkRows( const Type& matrix, size_t expectedRows ) const;

   template< typename Type >
   void checkColumns( const Type& matrix, size_t expectedColumns ) const;

   template< typename Type >
   void checkCapacity( const Type& matrix, size_t minCapacity ) const;

   template< typename Type >
   void checkNonZeros( const Type& matrix, size_t expectedNonZeros ) const;

   template< typename Type >
   void checkNonZeros( const Type& matrix, size_t index, size_t expectedNonZeros ) const;
   //@}
   //**********************************************************************************************

   //**Member variables****************************************************************************
   /*!\name Member variables */
   //@{
   std::string test_;  //!< Label of the currently performed test.
   //@}
   //**********************************************************************************************

   //**Type definitions****************************************************************************
   //! Complex element type.
   using cplx = blaze::complex<int>;

   //! Type of the row-major Hermitian matrix.
   using HT = blaze::HermitianMatrix< blaze::DynamicMatrix<cplx,blaze::rowMajor> >;

   //! Type of the column-major Hermitian matrix.
   using OHT = blaze::HermitianMatrix< blaze::DynamicMatrix<cplx,blaze::columnMajor> >;

   using RHT  = HT::Rebind< complex<double> >::Other;   //!< Rebound row-major Hermitian matrix type.
   using ORHT = OHT::Rebind< complex<double> >::Other;  //!< Rebound column-major Hermitian matrix type.
   //**********************************************************************************************

   //**Compile time checks*************************************************************************
   /*! \cond BLAZE_INTERNAL */
   BLAZE_CONSTRAINT_MUST_BE_DENSE_MATRIX_TYPE( HT                  );
   BLAZE_CONSTRAINT_MUST_BE_DENSE_MATRIX_TYPE( HT::ResultType      );
   BLAZE_CONSTRAINT_MUST_BE_DENSE_MATRIX_TYPE( HT::OppositeType    );
   BLAZE_CONSTRAINT_MUST_BE_DENSE_MATRIX_TYPE( HT::TransposeType   );
   BLAZE_CONSTRAINT_MUST_BE_DENSE_MATRIX_TYPE( OHT                 );
   BLAZE_CONSTRAINT_MUST_BE_DENSE_MATRIX_TYPE( OHT::ResultType     );
   BLAZE_CONSTRAINT_MUST_BE_DENSE_MATRIX_TYPE( OHT::OppositeType   );
   BLAZE_CONSTRAINT_MUST_BE_DENSE_MATRIX_TYPE( OHT::TransposeType  );
   BLAZE_CONSTRAINT_MUST_BE_DENSE_MATRIX_TYPE( RHT                 );
   BLAZE_CONSTRAINT_MUST_BE_DENSE_MATRIX_TYPE( RHT::ResultType     );
   BLAZE_CONSTRAINT_MUST_BE_DENSE_MATRIX_TYPE( RHT::OppositeType   );
   BLAZE_CONSTRAINT_MUST_BE_DENSE_MATRIX_TYPE( RHT::TransposeType  );
   BLAZE_CONSTRAINT_MUST_BE_DENSE_MATRIX_TYPE( ORHT                );
   BLAZE_CONSTRAINT_MUST_BE_DENSE_MATRIX_TYPE( ORHT::ResultType    );
   BLAZE_CONSTRAINT_MUST_BE_DENSE_MATRIX_TYPE( ORHT::OppositeType  );
   BLAZE_CONSTRAINT_MUST_BE_DENSE_MATRIX_TYPE( ORHT::TransposeType );

   BLAZE_CONSTRAINT_MUST_BE_ROW_MAJOR_MATRIX_TYPE   ( HT                  );
   BLAZE_CONSTRAINT_MUST_BE_ROW_MAJOR_MATRIX_TYPE   ( HT::ResultType      );
   BLAZE_CONSTRAINT_MUST_BE_COLUMN_MAJOR_MATRIX_TYPE( HT::OppositeType    );
   BLAZE_CONSTRAINT_MUST_BE_COLUMN_MAJOR_MATRIX_TYPE( HT::TransposeType   );
   BLAZE_CONSTRAINT_MUST_BE_COLUMN_MAJOR_MATRIX_TYPE( OHT                 );
   BLAZE_CONSTRAINT_MUST_BE_COLUMN_MAJOR_MATRIX_TYPE( OHT::ResultType     );
   BLAZE_CONSTRAINT_MUST_BE_ROW_MAJOR_MATRIX_TYPE   ( OHT::OppositeType   );
   BLAZE_CONSTRAINT_MUST_BE_ROW_MAJOR_MATRIX_TYPE   ( OHT::TransposeType  );
   BLAZE_CONSTRAINT_MUST_BE_ROW_MAJOR_MATRIX_TYPE   ( RHT                 );
   BLAZE_CONSTRAINT_MUST_BE_ROW_MAJOR_MATRIX_TYPE   ( RHT::ResultType     );
   BLAZE_CONSTRAINT_MUST_BE_COLUMN_MAJOR_MATRIX_TYPE( RHT::OppositeType   );
   BLAZE_CONSTRAINT_MUST_BE_COLUMN_MAJOR_MATRIX_TYPE( RHT::TransposeType  );
   BLAZE_CONSTRAINT_MUST_BE_COLUMN_MAJOR_MATRIX_TYPE( ORHT                );
   BLAZE_CONSTRAINT_MUST_BE_COLUMN_MAJOR_MATRIX_TYPE( ORHT::ResultType    );
   BLAZE_CONSTRAINT_MUST_BE_ROW_MAJOR_MATRIX_TYPE   ( ORHT::OppositeType  );
   BLAZE_CONSTRAINT_MUST_BE_ROW_MAJOR_MATRIX_TYPE   ( ORHT::TransposeType );

   BLAZE_CONSTRAINT_MUST_BE_HERMITIAN_MATRIX_TYPE( HT                  );
   BLAZE_CONSTRAINT_MUST_BE_HERMITIAN_MATRIX_TYPE( HT::ResultType      );
   BLAZE_CONSTRAINT_MUST_BE_HERMITIAN_MATRIX_TYPE( HT::OppositeType    );
   BLAZE_CONSTRAINT_MUST_BE_HERMITIAN_MATRIX_TYPE( HT::TransposeType   );
   BLAZE_CONSTRAINT_MUST_BE_HERMITIAN_MATRIX_TYPE( OHT                 );
   BLAZE_CONSTRAINT_MUST_BE_HERMITIAN_MATRIX_TYPE( OHT::ResultType     );
   BLAZE_CONSTRAINT_MUST_BE_HERMITIAN_MATRIX_TYPE( OHT::OppositeType   );
   BLAZE_CONSTRAINT_MUST_BE_HERMITIAN_MATRIX_TYPE( OHT::TransposeType  );
   BLAZE_CONSTRAINT_MUST_BE_HERMITIAN_MATRIX_TYPE( RHT                 );
   BLAZE_CONSTRAINT_MUST_BE_HERMITIAN_MATRIX_TYPE( RHT::ResultType     );
   BLAZE_CONSTRAINT_MUST_BE_HERMITIAN_MATRIX_TYPE( RHT::OppositeType   );
   BLAZE_CONSTRAINT_MUST_BE_HERMITIAN_MATRIX_TYPE( RHT::TransposeType  );
   BLAZE_CONSTRAINT_MUST_BE_HERMITIAN_MATRIX_TYPE( ORHT                );
   BLAZE_CONSTRAINT_MUST_BE_HERMITIAN_MATRIX_TYPE( ORHT::ResultType    );
   BLAZE_CONSTRAINT_MUST_BE_HERMITIAN_MATRIX_TYPE( ORHT::OppositeType  );
   BLAZE_CONSTRAINT_MUST_BE_HERMITIAN_MATRIX_TYPE( ORHT::TransposeType );

   BLAZE_CONSTRAINT_MUST_NOT_BE_SYMMETRIC_MATRIX_TYPE( HT                  );
   BLAZE_CONSTRAINT_MUST_NOT_BE_SYMMETRIC_MATRIX_TYPE( HT::ResultType      );
   BLAZE_CONSTRAINT_MUST_NOT_BE_SYMMETRIC_MATRIX_TYPE( HT::OppositeType    );
   BLAZE_CONSTRAINT_MUST_NOT_BE_SYMMETRIC_MATRIX_TYPE( HT::TransposeType   );
   BLAZE_CONSTRAINT_MUST_NOT_BE_SYMMETRIC_MATRIX_TYPE( OHT                 );
   BLAZE_CONSTRAINT_MUST_NOT_BE_SYMMETRIC_MATRIX_TYPE( OHT::ResultType     );
   BLAZE_CONSTRAINT_MUST_NOT_BE_SYMMETRIC_MATRIX_TYPE( OHT::OppositeType   );
   BLAZE_CONSTRAINT_MUST_NOT_BE_SYMMETRIC_MATRIX_TYPE( OHT::TransposeType  );
   BLAZE_CONSTRAINT_MUST_NOT_BE_SYMMETRIC_MATRIX_TYPE( RHT                 );
   BLAZE_CONSTRAINT_MUST_NOT_BE_SYMMETRIC_MATRIX_TYPE( RHT::ResultType     );
   BLAZE_CONSTRAINT_MUST_NOT_BE_SYMMETRIC_MATRIX_TYPE( RHT::OppositeType   );
   BLAZE_CONSTRAINT_MUST_NOT_BE_SYMMETRIC_MATRIX_TYPE( RHT::TransposeType  );
   BLAZE_CONSTRAINT_MUST_NOT_BE_SYMMETRIC_MATRIX_TYPE( ORHT                );
   BLAZE_CONSTRAINT_MUST_NOT_BE_SYMMETRIC_MATRIX_TYPE( ORHT::ResultType    );
   BLAZE_CONSTRAINT_MUST_NOT_BE_SYMMETRIC_MATRIX_TYPE( ORHT::OppositeType  );
   BLAZE_CONSTRAINT_MUST_NOT_BE_SYMMETRIC_MATRIX_TYPE( ORHT::TransposeType );

   BLAZE_CONSTRAINT_MUST_NOT_REQUIRE_EVALUATION( HT::ResultType      );
   BLAZE_CONSTRAINT_MUST_NOT_REQUIRE_EVALUATION( HT::OppositeType    );
   BLAZE_CONSTRAINT_MUST_NOT_REQUIRE_EVALUATION( HT::TransposeType   );
   BLAZE_CONSTRAINT_MUST_NOT_REQUIRE_EVALUATION( OHT::ResultType     );
   BLAZE_CONSTRAINT_MUST_NOT_REQUIRE_EVALUATION( OHT::OppositeType   );
   BLAZE_CONSTRAINT_MUST_NOT_REQUIRE_EVALUATION( OHT::TransposeType  );
   BLAZE_CONSTRAINT_MUST_NOT_REQUIRE_EVALUATION( RHT::ResultType     );
   BLAZE_CONSTRAINT_MUST_NOT_REQUIRE_EVALUATION( RHT::OppositeType   );
   BLAZE_CONSTRAINT_MUST_NOT_REQUIRE_EVALUATION( RHT::TransposeType  );
   BLAZE_CONSTRAINT_MUST_NOT_REQUIRE_EVALUATION( ORHT::ResultType    );
   BLAZE_CONSTRAINT_MUST_NOT_REQUIRE_EVALUATION( ORHT::OppositeType  );
   BLAZE_CONSTRAINT_MUST_NOT_REQUIRE_EVALUATION( ORHT::TransposeType );

   BLAZE_CONSTRAINT_MUST_BE_SAME_TYPE( HT::ElementType,   HT::ResultType::ElementType      );
   BLAZE_CONSTRAINT_MUST_BE_SAME_TYPE( HT::ElementType,   HT::OppositeType::ElementType    );
   BLAZE_CONSTRAINT_MUST_BE_SAME_TYPE( HT::ElementType,   HT::TransposeType::ElementType   );
   BLAZE_CONSTRAINT_MUST_BE_SAME_TYPE( OHT::ElementType,  OHT::ResultType::ElementType     );
   BLAZE_CONSTRAINT_MUST_BE_SAME_TYPE( OHT::ElementType,  OHT::OppositeType::ElementType   );
   BLAZE_CONSTRAINT_MUST_BE_SAME_TYPE( OHT::ElementType,  OHT::TransposeType::ElementType  );
   BLAZE_CONSTRAINT_MUST_BE_SAME_TYPE( RHT::ElementType,  RHT::ResultType::ElementType     );
   BLAZE_CONSTRAINT_MUST_BE_SAME_TYPE( RHT::ElementType,  RHT::OppositeType::ElementType   );
   BLAZE_CONSTRAINT_MUST_BE_SAME_TYPE( RHT::ElementType,  RHT::TransposeType::ElementType  );
   BLAZE_CONSTRAINT_MUST_BE_SAME_TYPE( ORHT::ElementType, ORHT::ResultType::ElementType    );
   BLAZE_CONSTRAINT_MUST_BE_SAME_TYPE( ORHT::ElementType, ORHT::OppositeType::ElementType  );
   BLAZE_CONSTRAINT_MUST_BE_SAME_TYPE( ORHT::ElementType, ORHT::TransposeType::ElementType );
   /*! \endcond */
   //**********************************************************************************************
};
//*************************************************************************************************

//=================================================================================================
//
//  TEST FUNCTIONS
//
//=================================================================================================

//*************************************************************************************************
/*!\brief Checking the number of rows of the given matrix.
//
// \param matrix The matrix to be checked.
// \param expectedRows The expected number of rows of the matrix.
// \return void
// \exception std::runtime_error Error detected.
//
// This function checks the number of rows of the given matrix. In case the actual number of
// rows does not correspond to the given expected number of rows, a \a std::runtime_error
// exception is thrown.
*/
template< typename Type >  // Type of the matrix
void DenseComplexTest::checkRows( const Type& matrix, size_t expectedRows ) const
{
   if( matrix.rows() != expectedRows ) {
      std::ostringstream oss;
      oss << " Test: " << test_ << "\n"
          << " Error: Invalid number of rows detected\n"
          << " Details:\n"
          << "   Number of rows         : " << matrix.rows() << "\n"
          << "   Expected number of rows: " << expectedRows << "\n";
      throw std::runtime_error( oss.str() );
   }
}
//*************************************************************************************************

//*************************************************************************************************
/*!\brief Checking the number of columns of the given matrix.
//
// \param matrix The matrix to be checked.
// \param expectedRows The expected number of columns of the matrix.
// \return void
// \exception std::runtime_error Error detected.
//
// This function checks the number of columns of the given matrix. In case the actual number of
// columns does not correspond to the given expected number of columns, a \a std::runtime_error
// exception is thrown.
*/
template< typename Type >  // Type of the matrix
void DenseComplexTest::checkColumns( const Type& matrix, size_t expectedColumns ) const
{
   if( matrix.columns() != expectedColumns ) {
      std::ostringstream oss;
      oss << " Test: " << test_ << "\n"
          << " Error: Invalid number of columns detected\n"
          << " Details:\n"
          << "   Number of columns         : " << matrix.columns() << "\n"
          << "   Expected number of columns: " << expectedColumns << "\n";
      throw std::runtime_error( oss.str() );
   }
}
//*************************************************************************************************

//*************************************************************************************************
/*!\brief Checking the capacity of the given matrix.
//
// \param matrix The matrix to be checked.
// \param minCapacity The expected minimum capacity of the matrix.
// \return void
// \exception std::runtime_error Error detected.
//
// This function checks the capacity of the given matrix. In case the actual capacity is smaller
// than the given expected minimum capacity, a \a std::runtime_error exception is thrown.
*/
template< typename Type >  // Type of the matrix
void DenseComplexTest::checkCapacity( const Type& matrix, size_t minCapacity ) const
{
   if( capacity( matrix ) < minCapacity ) {
      std::ostringstream oss;
      oss << " Test: " << test_ << "\n"
          << " Error: Invalid capacity detected\n"
          << " Details:\n"
          << "   Capacity                 : " << capacity( matrix ) << "\n"
          << "   Expected minimum capacity: " << minCapacity << "\n";
      throw std::runtime_error( oss.str() );
   }
}
//*************************************************************************************************

//*************************************************************************************************
/*!\brief Checking the number of non-zero elements of the given matrix.
//
// \param matrix The matrix to be checked.
// \param expectedNonZeros The expected number of non-zero elements of the matrix.
// \return void
// \exception std::runtime_error Error detected.
//
// This function checks the number of non-zero elements of the given matrix. In case the
// actual number of non-zero elements does not correspond to the given expected number,
// a \a std::runtime_error exception is thrown.
*/
template< typename Type >  // Type of the matrix
void DenseComplexTest::checkNonZeros( const Type& matrix, size_t expectedNonZeros ) const
{
   if( nonZeros( matrix ) != expectedNonZeros ) {
      std::ostringstream oss;
      oss << " Test: " << test_ << "\n"
          << " Error: Invalid number of non-zero elements\n"
          << " Details:\n"
          << "   Number of non-zeros         : " << nonZeros( matrix ) << "\n"
          << "   Expected number of non-zeros: " << expectedNonZeros << "\n";
      throw std::runtime_error( oss.str() );
   }

   if( capacity( matrix ) < nonZeros( matrix ) ) {
      std::ostringstream oss;
      oss << " Test: " << test_ << "\n"
          << " Error: Invalid capacity detected\n"
          << " Details:\n"
          << "   Number of non-zeros: " << nonZeros( matrix ) << "\n"
          << "   Capacity           : " << capacity( matrix ) << "\n";
      throw std::runtime_error( oss.str() );
   }
}
//*************************************************************************************************

//*************************************************************************************************
/*!\brief Checking the number of non-zero elements in a specific row/column of the given matrix.
//
// \param matrix The matrix to be checked.
// \param index The row/column to be checked.
// \param expectedNonZeros The expected number of non-zero elements in the specified row/column.
// \return void
// \exception std::runtime_error Error detected.
//
// This function checks the number of non-zero elements in the specified row/column of the
// given matrix. In case the actual number of non-zero elements does not correspond to the
// given expected number, a \a std::runtime_error exception is thrown.
*/
template< typename Type >  // Type of the matrix
void DenseComplexTest::checkNonZeros( const Type& matrix, size_t index, size_t expectedNonZeros ) const
{
   if( nonZeros( matrix, index ) != expectedNonZeros ) {
      std::ostringstream oss;
      oss << " Test: " << test_ << "\n"
          << " Error: Invalid number of non-zero elements in "
          << ( blaze::IsRowMajorMatrix<Type>::value ? "row " : "column " ) << index << "\n"
          << " Details:\n"
          << "   Number of non-zeros         : " << nonZeros( matrix, index ) << "\n"
          << "   Expected number of non-zeros: " << expectedNonZeros << "\n";
      throw std::runtime_error( oss.str() );
   }

   if( capacity( matrix, index ) < nonZeros( matrix, index ) ) {
      std::ostringstream oss;
      oss << " Test: " << test_ << "\n"
          << " Error: Invalid capacity detected in "
          << ( blaze::IsRowMajorMatrix<Type>::value ? "row " : "column " ) << index << "\n"
          << " Details:\n"
          << "   Number of non-zeros: " << nonZeros( matrix, index ) << "\n"
          << "   Capacity           : " << capacity( matrix, index ) << "\n";
      throw std::runtime_error( oss.str() );
   }
}
//*************************************************************************************************

//=================================================================================================
//
//  GLOBAL TEST FUNCTIONS
//
//=================================================================================================

//*************************************************************************************************
/*!\brief Testing the functionality of the dense HermitianMatrix specialization.
//
// \return void
*/
void runTest()
{
   DenseComplexTest();
}
//*************************************************************************************************

//=================================================================================================
//
//  MACRO DEFINITIONS
//
//=================================================================================================

//*************************************************************************************************
/*! \cond BLAZE_INTERNAL */
/*!\brief Macro for the execution of the HermitianMatrix dense complex test.
*/
#define RUN_HERMITIANMATRIX_DENSECOMPLEX_TEST \
   blazetest::mathtest::adaptors::hermitianmatrix::runTest()
/*! \endcond */
//*************************************************************************************************

} // namespace hermitianmatrix

} // namespace adaptors

} // namespace mathtest

} // namespace blazetest

#endif


text:
'''
  hipchat Bot
  -----------

  :copyright (c) 2014 Xavier Bruhiere.
  :license: Apache 2.0, see LICENSE for more details.
'''

import os
import requests
import dna.logging

log = dna.logging.logger(__name__)

class Bot(object):
    '''
    Hipchat api client that sends notifications to a specified room
    Doc: https://www.hipchat.com/docs/api
    '''

    api_key = os.environ.get('HIPCHAT_API')
    api_url = 'https://api.hipchat.com/v1'
    name = 'Intuition Bot'
    bg_color = 'green'
    intro = 'Hey guys, I detected an opportunity'

    def __init__(self, room_id, name=None, api_key=None):
        self.room_id = room_id
        if api_key:
            self.api_key = api_key
        if name:
            self.name = name

    def _test_token(self):
        ''' TODO '''
        pass

    def _api_call(self, path, data={}, http_method=requests.get):
        ''' Process an http call against the hipchat api '''
        log.info('performing api request', path=path)
        response = http_method('/'.join([self.api_url, path]),
                               params={'auth_token': self.api_key},
                               data=data)
        log.debug('{} remaining calls'.format(
            response.headers['x-ratelimit-remaining']))
        return response.json()

    def message(self, body, room_id, style='text'):
        ''' Send a message to the given room '''
        # TODO Automatically detect body format ?
        path = 'rooms/message'
        data = {
            'room_id': room_id,
            'message': body,
            'from': self.name,
            'notify': 1,
            'message_format': style,
            'color': self.bg_color
        }
        log.info('sending message to hipchat', message=body, room=room_id)
        feedback = self._api_call(path, data, requests.post)
        log.debug(feedback)
        return feedback

    def notify(self, datetime, orderbook):
        # TODO Same flood security as mobile
        if orderbook:
            body = '{} - {}

{}

'.format(
                datetime,
                self.intro,
                '

'.join(
                    ['{}: {}'.format(sid, quantity)
                        for sid, quantity in orderbook.iteritems()])
            )
            self.message(body, self.room_id, style='html')


text:
{
	pageTitle: 'Number Helper',

	content: Html.h2('NumberHelper') +
		Html.p('The NumberHelper provides functions that format numbers painlessly.') +

		Docs.example(
			"NumberHelper::format",
			"Format a number with decimal places and thousands separators.",
			function() {
Number.format(23847982374981.123123421) + '<br>' +
Number.format(23847982374981.123123421, 4, '-', '.')
			}
		)
}


text:
Contributors:
- glv (original odds parsing script)
- woodall (contribution instructions)

## Hands (in winning order)

- Six of a kind (333 333): 10 combinations
- Five of a kind (133 333): 540 combinations
- Two triples (223 233): 900 combinations
- Full house (113 333): 1,350 combinations
- Six straight (132 465): 3,600 combinations
- Three pair (113 773): 10,800 combinations
- Four of a kind (123 333): 10,800 combinations
- Five straight (132 495): 25,184 combinations
- Crowded house (113 733): 43,200 combinations
- One triple (111 798): 100,800 combinations
- Snowflake (123 798): 133,216 combinations
- Two pair (113 738): 226,800 combinations
- One pair (113 798): 442,800 combinations

Interestingly, unlike card poker, a hand with no duplicate numbers and no
sequence of five or more is not the most common hand; two-pair and one-pair
hands are much more common. That's one reason we've given such hands the name
"snowflake" rather than the nondescript "high card" name used for such hands
in poker.

Other interesting hands:

- All evens (246 862)
- All odds (133 795)
- Fibonacci (112 358)
- Primes (235 711)

### Notes

0 no longer acts as an Ace, high or low. It's simply low.


text:
package org.locationtech.geowave.adapter.raster.operations;

import java.nio.file.Path;
import java.nio.file.Paths;
import org.locationtech.geowave.adapter.raster.plugin.gdal.InstallGdal;
import org.locationtech.geowave.core.cli.annotations.GeowaveOperation;
import org.locationtech.geowave.core.cli.api.Command;
import org.locationtech.geowave.core.cli.api.DefaultOperation;
import org.locationtech.geowave.core.cli.api.OperationParams;
import com.beust.jcommander.Parameter;
import com.beust.jcommander.Parameters;

@GeowaveOperation(name = "installgdal", parentOperation = RasterSection.class)
@Parameters(commandDescription = "Install GDAL by downloading native libraries")
public class InstallGdalCommand extends DefaultOperation implements Command {
  private static final String DEFAULT_DOWNLOAD_DIR = "lib/utilities/gdal";

  @Parameter(names = "--dir", description = "The download directory", required = false)
  private String downloadDirectory = null;

  @Override
  public void execute(final OperationParams params) throws Exception {
    if (downloadDirectory == null) {
      final String homeDirectory = System.getProperty("geowave.home", ".");
      final Path path = Paths.get(homeDirectory, DEFAULT_DOWNLOAD_DIR);
      downloadDirectory = path.toString();
    }
    InstallGdal.main(new String[] {downloadDirectory});
  }
}