text:
package com.scipionyx.butterflyeffect.frontend.core.ui.view.common;

import org.springframework.beans.factory.annotation.Autowired;

import com.scipionyx.butterflyeffect.frontend.core.services.MenuService;
import com.scipionyx.butterflyeffect.frontend.core.ui.view.panel.bottom.BottomPanel;
import com.vaadin.navigator.View;
import com.vaadin.ui.VerticalLayout;

/**
 *
 *
 *
 *
 * @author Renato Mendes
 *
 */
public abstract class AbstractDialogView extends VerticalLayout implements View {

	/**
	 *
	 */
	private static final long serialVersionUID = 1L;

	// Services
	@Autowired
	protected transient MenuService userMenuService;

	protected BottomPanel bottomPanel;

	// TODO Is this needed ?

	protected boolean built;

	public void build() throws Exception {

		if (built) {
			return;
		}

		built = true;

		//
		//

		doBuild();

	}

	//
	public abstract void doBuild();

	public MenuService getUserMenuService() {
		return userMenuService;
	}

	public void setUserMenuService(MenuService userMenuService) {
		this.userMenuService = userMenuService;
	}

}


text:
package org.blendee.jdbc;

import java.util.Collections;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.regex.Pattern;

import org.blendee.internal.U;

/**
 * Blendee の現在の設定を使用するためのクラスです。
 * @author 千葉 哲嗣
 * @see BlendeeManager#getConfigure()
 */
public final class Configure {

	private final Class<? extends TransactionFactory> transactionFactoryClass;

	private final Class<? extends ErrorConverter> errorConverterClass;

	private final Class<? extends DataTypeConverter> dataTypeConverterClass;

	private final Class<? extends MetadataFactory> metadataFactoryClass;

	private final Class<? extends BLogger> loggerClass;

	private final Class<? extends SQLExtractor> sqlExtractorClass;

	private final String[] schemaNames;

	private final boolean useAutoCommit;

	private final boolean useLazyTransaction;

	private final boolean useMetadataCache;

	private final int autoCloseIntervalMillis;

	private final Pattern logStackTracePattern;

	private final int maxStatementsPerConnection;

	private final Map<OptionKey<?>, ?> options;

	private MetadataFactory metadataFactory;

	private TransactionFactory transactionFactory;

	private BLogger logger;

	private SQLExtractor sqlExtractor;

	private ErrorConverter errorConverter;

	private DataTypeConverter dataTypeConverter;

	private boolean initialized = false;

	Configure(
		Class<? extends TransactionFactory> transactionFactoryClass,
		Class<? extends ErrorConverter> errorConverterClass,
		Class<? extends DataTypeConverter> dataTypeConverterClass,
		Class<? extends MetadataFactory> metadataFactoryClass,
		Class<? extends BLogger> loggerClass,
		Class<? extends SQLExtractor> sqlExtractorClass,
		String[] schemaNames,
		boolean useAutoCommit,
		boolean useLazyTransaction,
		boolean useMetadataCache,
		int autoCloseIntervalMillis,
		Pattern logStackTracePattern,
		int maxStatementsPerConnection,
		Map<OptionKey<?>, ?> options) {
		this.transactionFactoryClass = transactionFactoryClass;
		this.errorConverterClass = errorConverterClass;
		this.dataTypeConverterClass = dataTypeConverterClass;
		this.metadataFactoryClass = metadataFactoryClass;
		this.loggerClass = loggerClass;
		this.sqlExtractorClass = sqlExtractorClass;
		this.schemaNames = schemaNames.clone();
		this.useAutoCommit = useAutoCommit;
		this.useLazyTransaction = useLazyTransaction;
		this.useMetadataCache = useMetadataCache;
		this.autoCloseIntervalMillis = autoCloseIntervalMillis;
		this.logStackTracePattern = logStackTracePattern;
		this.maxStatementsPerConnection = maxStatementsPerConnection;
		this.options = Collections.unmodifiableMap(options);
	}

	/**
	 * この設定で使用している {@link TransactionFactory} を返します。
	 * @return この設定で使用している {@link TransactionFactory}
	 * @throws IllegalStateException 古い設定を使用している場合
	 */
	public TransactionFactory getTransactionFactory() {
		check();
		return getTransactionFactoryWithoutCheck();
	}

	/**
	 * この設定で使用している {@link ErrorConverter} を返します。
	 * @return この設定で使用している {@link ErrorConverter}
	 * @throws IllegalStateException 古い設定を使用している場合
	 */
	public synchronized ErrorConverter getErrorConverter() {
		check();
		if (!initialized) initialize();
		return errorConverter;
	}

	/**
	 * この設定で使用している {@link DataTypeConverter} を返します。
	 * @return この設定で使用している {@link DataTypeConverter}
	 * @throws IllegalStateException 古い設定を使用している場合
	 */
	public synchronized DataTypeConverter getDataTypeConverter() {
		check();
		if (!initialized) initialize();
		return dataTypeConverter;
	}

	/**
	 * この設定で使用している {@link MetadataFactory} を返します。
	 * @return この設定で使用している {@link MetadataFactory}
	 * @throws IllegalStateException 古い設定を使用している場合
	 */
	public MetadataFactory getMetadataFactory() {
		check();
		return getMetadataFactoryWithoutCheck();
	}

	/**
	 * この設定で使用している {@link BLogger} を返します。
	 * @return この設定で使用している {@link BLogger}
	 * @throws IllegalStateException 古い設定を使用している場合
	 */
	public BLogger getLogger() {
		check();
		return getLoggerWithoutCheck();
	}

	/**
	 * この設定で使用している {@link SQLExtractor} を返します。
	 * @return この設定で使用している {@link SQLExtractor}
	 * @throws IllegalStateException 古い設定を使用している場合
	 */
	public SQLExtractor getSQLExtractor() {
		check();
		return getSQLExtractorWithoutCheck();
	}

	/**
	 * この設定で使用しているスキーマ名を返します。
	 * @return この設定で使用しているスキーマ名
	 * @throws IllegalStateException 古い設定を使用している場合
	 */
	public String[] getSchemaNames() {
		check();
		return schemaNames.clone();
	}

	/**
	 * この設定で使用しているスキーマ名にパラメータのスキーマ名が含まれるかを検査します。
	 * @param schemaName 検査するスキーマ名
	 * @return 含まれている場合、 true
	 * @throws IllegalStateException 古い設定を使用している場合
	 */
	public boolean containsSchemaName(String schemaName) {
		check();
		for (var i = 0; i < schemaNames.length; i++) {
			if (schemaNames[i].equals(schemaName)) return true;
		}

		return false;
	}

	/**
	 * 自動コミットを行うかを設定します。
	 * @return 自動コミットを行う場合、 true
	 * @throws IllegalStateException 古い設定を使用している場合
	 */
	public boolean usesAutoCommit() {
		check();
		return useAutoCommit;
	}

	/**
	 * 遅延実行トランザクションを使用するかどうかを検査します。
	 * @return 遅延実行トランザクションを使用するかどうか
	 * @throws IllegalStateException 古い設定を使用している場合
	 */
	public boolean usesLazyTransaction() {
		check();
		return useLazyTransaction;
	}

	/**
	 * データベースの定義情報をキャッシュするかどうかを検査します。
	 * @return データベースの定義情報をキャッシュするかどうか
	 * @throws IllegalStateException 古い設定を使用している場合
	 */
	public boolean usesMetadataCache() {
		check();
		return useMetadataCache;
	}

	/**
	 * {@link AutoCloseable} を実装した Blendee の各インスタンスを、もう使用されなくなったときに close() するためのチェック間隔(ミリ秒)を検査します。
	 * @return close() するためのチェック間隔(ミリ秒)
	 * @throws IllegalStateException 古い設定を使用している場合
	 */
	public int getAutoCloseIntervalMillis() {
		check();
		return autoCloseIntervalMillis;
	}

	/**
	 * SQL 文生成箇所のスタックトレースをフィルタするパターンを返します。
	 * @return スタックトレースをフィルタするパターン
	 * @throws IllegalStateException 古い設定を使用している場合
	 */
	public Pattern getLogStackTraceFilter() {
		check();
		return logStackTracePattern;
	}

	/**
	 * 一つの接続で最大いくつのステートメントを同時に使用できるかを返します。
	 * @return 一接続あたりの最大ステートメント数
	 */
	public int getMaxStatementsPerConnection() {
		check();
		return maxStatementsPerConnection;
	}

	/**
	 * この設定が現在の Blendee の設定かどうか検査します。
	 * @return 現在の Blendee の設定かどうか
	 */
	public boolean isCurrent() {
		return ContextManager.get(BlendeeManager.class).isCurrent(this);
	}

	/**
	 * Initializer から渡されたオプションの値を取得します。
	 * @param <T> オプション値の型
	 * @param key オプションのキー
	 * @return 値
	 */
	public <T> Optional<T> getOption(OptionKey<T> key) {
		return Objects.requireNonNull(key).extract(options);
	}

	@Override
	public String toString() {
		return U.toString(this);
	}

	void check() {
		//古い設定を使用しています
		if (!isCurrent()) throw new IllegalStateException("This " + Configure.class.getSimpleName() + " is old.");
	}

	synchronized TransactionFactory getTransactionFactoryWithoutCheck() {
		if (!initialized) initialize();
		return transactionFactory;
	}

	synchronized MetadataFactory getMetadataFactoryWithoutCheck() {
		if (!initialized) initialize();
		return metadataFactory;
	}

	synchronized BLogger getLoggerWithoutCheck() {
		if (!initialized) initialize();
		return logger;
	}

	synchronized SQLExtractor getSQLExtractorWithoutCheck() {
		if (!initialized) initialize();
		return sqlExtractor;
	}

	Pattern getLogStackTracePatternWithoutCheck() {
		return logStackTracePattern;
	}

	synchronized void initialize() {
		if (initialized) return;

		metadataFactory = createInstance(metadataFactoryClass);
		transactionFactory = createInstance(transactionFactoryClass);
		errorConverter = createInstance(errorConverterClass);
		dataTypeConverter = createInstance(dataTypeConverterClass);
		logger = createInstance(loggerClass);
		sqlExtractor = createInstance(sqlExtractorClass);

		initialized = true;
	}

	private static <T> T createInstance(Class<? extends T> clazz) {
		try {
			return clazz.getDeclaredConstructor().newInstance();
		} catch (Exception e) {
			throw new RuntimeException(e);
		}
	}
}

redpajama_set_name: RedPajamaGithub


text:
@interface Message : NSObject

KOString from;
KOString content;

- (instancetype)initWithFrom:(NSString *)from content:(NSString *)content;

+ (instancetype)messageWithFrom:(NSString *)from content:(NSString *)content;

@end


text:
<?php
use DaveJamesMiller\Breadcrumbs;
use Mockery as m;

class ManagerTest extends PHPUnit_Framework_TestCase
{
    public function setUp()
    {
        if (class_exists('Illuminate\View\Factory'))
            $this->factory = m::mock('Illuminate\View\Factory');
        else
            $this->factory = m::mock('Illuminate\View\Environment');

        $this->router = m::mock('Illuminate\Routing\Router');
        $this->manager = new Breadcrumbs\Manager($this->factory, $this->router);

        $this->manager->register('sample', function() {});
    }

    public function testSetView()
    {
        $view = 'my.sample.view';

        $this->manager->setView($view);

        $this->assertSame($view, $this->manager->getView());
    }

    public function testExists()
    {
        $this->assertTrue($this->manager->exists('sample'));
        $this->assertFalse($this->manager->exists('invalid'));

        $this->manager->setCurrentRoute('sample');
        $this->assertTrue($this->manager->exists());

        $this->manager->setCurrentRoute('invalid');
        $this->assertFalse($this->manager->exists());
    }
}


text:
layout: docs
title: Conflict Resolution and Salience
permalink: /docs/conflictsalience/
---

### Conflict Resolution
When a set of inserted facts match multiple rules, we have to answer a question: in what order should the matched rules fire? Resolving this question in a rule engine is referred to as _conflict resolution_.

In almost all cases we should design our rules so that order of firing does not matter. Because Clara, like most rule engines, offers truth maintenance, newly derived information is automatically retracted in case its support changes. Relying on order of rule firing is a poor practice in designing rulesets because it makes rules that should be independent and makes them implicitly depend on one another with a defined ordering. The resulting complexity makes rulesets harder to maintain because rule authors need to keep track of it.

However, there remains some cases where we really do care about the order of execution of rules. Rule right-hand sides may have side effects, for instance. We prefer to avoid side effects for the same reason functional programming does, but sometimes they are necessary.

Order of rule execution can also be important for performance in some rulesets. If a rule is transitively dependent on inserted information from many other rules, it makes sense to fire the dependent rule last. This shouldn't affect _correctness_ -- since truth maintenance will clean up inserted facts that become untrue. But it re-evaluating and automatically retracting facts many times has a cost that adds up if dealing with many thousands of facts in a working memory.

### Salience
Clara offers a simple way to specify conflict resolution called _salience_. Salience is simply a integer property attached to the rule, where rules with higher values will fire before rules with lower values. Here is a simple example:

{% highlight clojure %}
(defrule this-fires-first
  {:salience 100}
  [Person (= ?name name))]
  =>
  (println "Hello," ?name))

(defrule this-fires-last
  {:salience -100}
  [Person (= ?name name) (= ?age age)]
  =>
  (println ?name "is" ?age "years old))
{% endhighlight %}

Rules that don't explicitly define salience have a salience value of zero.

### Specialized Activation Groups
For most users either salience or undefined rule ordering should be sufficient. But starting with Clara 0.8.0, users with specialized needs can also provide arbitrary logic to resolve activation conflicts between rules. This logic is defined by two functions. The first is an _activation group_ function, which given a rule structure returns a value to identify the group in which the rule should be activated. The second is a comparator-style function that defines the ordering of the activation groups themselves. (There is not a defined ordering within a group.)

These can be specified by providing the following options when calling mk-session:

* **:activation-group-fn**, a function applied to production structures and returns the group they should be activated with. It defaults to returning the value of the :salience property on the rule, or 0 if none exists.
* **:activation-group-sort-fn**, a comparator function used to sort the values returned by the above :activation-group-fn. It defaults to >, so rules with a higher salience are executed first.

The above is defined in the documentation for the mk-session function.


text:
require 'rubygems'
require 'test/unit'
require 'shoulda'
require 'matchy'
require 'fakeweb'

FakeWeb.allow_net_connect = false

$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
$LOAD_PATH.unshift(File.dirname(__FILE__))
require 'btexty'

class Test::Unit::TestCase
end


text:
<?php namespace App\Http\Controllers;

use App\Mail\FirstvdsPromocodeMail;
use App\Rules\Email;

class Coupons
{
    public function airbnb()
    {
        return view('coupons.airbnb', ['metaTitle' => $this->getServiceMetaTitle('airbnb')]);
    }

    public function booking()
    {
        return view('coupons.booking', ['metaTitle' => $this->getServiceMetaTitle('booking')]);
    }

    public function digitalocean()
    {
        return view('coupons.digitalocean', ['metaTitle' => $this->getServiceMetaTitle('do')]);
    }

    public function drimsim()
    {
        return view('coupons.drimsim', ['metaTitle' => $this->getServiceMetaTitle('drimsim')]);
    }

    public function firstvds()
    {
        request()->validate(['email' => Email::rules()]);

        \Mail::to(request('email'))
            ->locale(\App::getLocale())
            ->send(new FirstvdsPromocodeMail);

        return back()->with('message', __('coupons.promocode_sent'));
    }

    public function timeweb()
    {
        return view('coupons.timeweb', ['metaTitle' => $this->getServiceMetaTitle('timeweb')]);
    }

    protected function getServiceMetaTitle(string $service): string
    {
        return __("coupons.{$service}.title", [
            'month' => now()->isoFormat('MMMM'),
            'year' => now()->year,
        ]);
    }
}


text:
@import url(https://fonts.googleapis.com/css?family=Rokkitt|Libre+Baskerville:700|Alegreya+Sans:900);
#monster-manager-container {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  position: absolute;
  z-index: 100000; }
  #monster-manager-container div, #monster-manager-container span, #monster-manager-container applet, #monster-manager-container object, #monster-manager-container iframe,
  #monster-manager-container h1, #monster-manager-container h2, #monster-manager-container h3, #monster-manager-container h4, #monster-manager-container h5, #monster-manager-container h6, #monster-manager-container p, #monster-manager-container blockquote, #monster-manager-container pre,
  #monster-manager-container a, #monster-manager-container abbr, #monster-manager-container acronym, #monster-manager-container address, #monster-manager-container big, #monster-manager-container cite, #monster-manager-container code,
  #monster-manager-container del, #monster-manager-container dfn, #monster-manager-container em, #monster-manager-container img, #monster-manager-container ins, #monster-manager-container kbd, #monster-manager-container q, #monster-manager-container s, #monster-manager-container samp,
  #monster-manager-container small, #monster-manager-container strike, #monster-manager-container strong, #monster-manager-container sub, #monster-manager-container sup, #monster-manager-container tt, #monster-manager-container var,
  #monster-manager-container b, #monster-manager-container u, #monster-manager-container i, #monster-manager-container center,
  #monster-manager-container dl, #monster-manager-container dt, #monster-manager-container dd, #monster-manager-container ol, #monster-manager-container ul, #monster-manager-container li,
  #monster-manager-container fieldset, #monster-manager-container form, #monster-manager-container label, #monster-manager-container legend,
  #monster-manager-container table, #monster-manager-container caption, #monster-manager-container tbody, #monster-manager-container tfoot, #monster-manager-container thead, #monster-manager-container tr, #monster-manager-container th, #monster-manager-container td,
  #monster-manager-container article, #monster-manager-container aside, #monster-manager-container canvas, #monster-manager-container details, #monster-manager-container embed,
  #monster-manager-container figure, #monster-manager-container figcaption, #monster-manager-container footer, #monster-manager-container header, #monster-manager-container hgroup,
  #monster-manager-container menu, #monster-manager-container nav, #monster-manager-container output, #monster-manager-container ruby, #monster-manager-container section, #monster-manager-container summary,
  #monster-manager-container time, #monster-manager-container mark, #monster-manager-container audio, #monster-manager-container video {
    margin: 0;
    padding: 0;
    border: 0;
    font: inherit;
    font-size: 100%;
    vertical-align: baseline; }
  #monster-manager-container table {
    border-collapse: collapse;
    border-spacing: 0; }
  #monster-manager-container caption, #monster-manager-container th, #monster-manager-container td {
    text-align: left;
    font-weight: normal;
    vertical-align: middle; }
  #monster-manager-container q, #monster-manager-container blockquote {
    quotes: none; }
    #monster-manager-container q:before, #monster-manager-container q:after, #monster-manager-container blockquote:before, #monster-manager-container blockquote:after {
      content: "";
      content: none; }
  #monster-manager-container a img {
    border: none; }
  #monster-manager-container .monster-manager {
    -moz-user-select: -moz-none;
    -ms-user-select: none;
    -webkit-user-select: none;
    user-select: none;
    position: absolute;
    cursor: move; }
    #monster-manager-container .monster-manager .monster-manager-administrator {
      position: relative;
      z-index: 5;
      width: 482px; }
      #monster-manager-container .monster-manager .monster-manager-administrator .toolbar {
        border: 1px solid #fff;
        border-radius: 10px;
        box-shadow: 1px 2px 5px rgba(0, 0, 0, 0.3);
        box-sizing: border-box;
        width: 100%;
        padding: 0 10px;
        margin-bottom: 40px;
        display: -webkit-flex;
        display: -webkit-box;
        display: -ms-flexbox;
        display: flex;
        -webkit-justify-content: space-between;
        -webkit-box-pack: justify;
            -ms-flex-pack: justify;
                justify-content: space-between;
        text-align: left;
        color: #FFFFFF;
        background-color: #485E70;
        *zoom: 1;
        filter: progid:DXImageTransform.Microsoft.gradient(gradientType=1, startColorstr='#FF1E364A', endColorstr='#FF485E70');
        background-image: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJvYmplY3RCb3VuZGluZ0JveCIgeDE9IjAuNSIgeTE9IjAuMCIgeDI9IjAuNSIgeTI9IjEuMCI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iIzFlMzY0YSIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iIzQ4NWU3MCIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA==');
        background-size: 100%;
        background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #1e364a), color-stop(100%, #485e70));
        background-image: -webkit-linear-gradient(top, #1e364a 0%, #485e70 100%);
        background-image: linear-gradient(to bottom, #1e364a 0%, #485e70 100%); }
        #monster-manager-container .monster-manager .monster-manager-administrator .toolbar .logo {
          background-image: url("../img/d20_white.svg");
          width: 20px;
          height: 20px;
          padding: 10px 0 10px 0;
          background-size: cover;
          background-repeat: no-repeat;
          background-position: 50% 0;
          background-origin: content-box; }
        #monster-manager-container .monster-manager .monster-manager-administrator .toolbar .search-bar {
          -webkit-flex-grow: 1;
          -webkit-box-flex: 1;
              -ms-flex-positive: 1;
                  flex-grow: 1; }
        #monster-manager-container .monster-manager .monster-manager-administrator .toolbar .open-close-button {
          width: 20px;
          height: 20px;
          margin: 10px 0 10px 15px;
          cursor: pointer;
          border-radius: 20px / 20px; }
          #monster-manager-container .monster-manager .monster-manager-administrator .toolbar .open-close-button .icon {
            background-repeat: no-repeat;
            background-origin: content-box;
            background-position: 50% 0;
            background-size: cover; }
            #monster-manager-container .monster-manager .monster-manager-administrator .toolbar .open-close-button .icon.active {
              background-position: 50% 100%; }
          #monster-manager-container .monster-manager .monster-manager-administrator .toolbar .open-close-button:hover .icon {
            background-position: 50% 100%; }
          #monster-manager-container .monster-manager .monster-manager-administrator .toolbar .open-close-button:hover {
            background-color: #FFFFFF; }
          #monster-manager-container .monster-manager .monster-manager-administrator .toolbar .open-close-button .icon {
            -webkit-transform: rotate(45deg);
                -ms-transform: rotate(45deg);
                    transform: rotate(45deg);
            -webkit-transition: -webkit-transform 150ms ease-out;
                    transition: transform 150ms ease-out;
            background-image: url("../img/close.svg");
            background-size: cover;
            width: 50%;
            height: 50%;
            margin: 25%; }
          #monster-manager-container .monster-manager .monster-manager-administrator .toolbar .open-close-button.expanded .icon {
            -webkit-transform: rotate(180deg);
                -ms-transform: rotate(180deg);
                    transform: rotate(180deg); }
        #monster-manager-container .monster-manager .monster-manager-administrator .toolbar .toolbar-item.active .button {
          background-color: #FFFFFF; }
        #monster-manager-container .monster-manager .monster-manager-administrator .toolbar .toolbar-item.active .drawer {
          visibility: visible; }
        #monster-manager-container .monster-manager .monster-manager-administrator .toolbar .toolbar-item .button {
          width: 20px;
          height: 20px;
          padding: 10px;
          cursor: pointer; }
          #monster-manager-container .monster-manager .monster-manager-administrator .toolbar .toolbar-item .button .icon {
            background-repeat: no-repeat;
            background-origin: content-box;
            background-position: 50% 0;
            background-size: cover; }
            #monster-manager-container .monster-manager .monster-manager-administrator .toolbar .toolbar-item .button .icon.active {
              background-position: 50% 100%; }
          #monster-manager-container .monster-manager .monster-manager-administrator .toolbar .toolbar-item .button:hover .icon {
            background-position: 50% 100%; }
          #monster-manager-container .monster-manager .monster-manager-administrator .toolbar .toolbar-item .button:hover {
            background-color: #FFFFFF; }
          #monster-manager-container .monster-manager .monster-manager-administrator .toolbar .toolbar-item .button .icon {
            width: 100%;
            height: 100%; }
        #monster-manager-container .monster-manager .monster-manager-administrator .toolbar .toolbar-item .drawer {
          background-color: #1E364A;
          border: 1px solid #fff;
          border-radius: 0 0 10px 10px;
          box-shadow: inset 0 4px 5px -2px rgba(0, 0, 0, 0.3), 1px 2px 5px rgba(0, 0, 0, 0.3);
          position: absolute;
          bottom: 1px;
          right: 10px;
          visibility: hidden;
          width: calc(100% - 20px);
          z-index: 10;
          -webkit-transform: translateY(100%);
              -ms-transform: translateY(100%);
                  transform: translateY(100%);
          cursor: default;
          padding: 5px 5px 5px 5px;
          box-sizing: border-box; }
          #monster-manager-container .monster-manager .monster-manager-administrator .toolbar .toolbar-item .drawer::before {
            font-size: 15px;
            padding: 0 5px 5px 5px;
            line-height: 20px;
            display: block;
            font-family: "Libre Baskerville", serif;
            font-weight: bold;
            text-shadow: 0 1px 0 rgba(0, 0, 0, 0.1); }
          #monster-manager-container .monster-manager .monster-manager-administrator .toolbar .toolbar-item .drawer .drawer-content {
            border-radius: 5px;
            color: #1E364A;
            text-align: left;
            overflow: hidden; }
            #monster-manager-container .monster-manager .monster-manager-administrator .toolbar .toolbar-item .drawer .drawer-content .action-list li {
              padding: 12px 10px 8px 28px;
              font-family: "Rokkitt", serif;
              cursor: pointer;
              font-size: 16px;
              font-weight: normal;
              background: #FFFFFF;
              position: relative;
              line-height: 18px; }
              #monster-manager-container .monster-manager .monster-manager-administrator .toolbar .toolbar-item .drawer .drawer-content .action-list li:not(:last-child) {
                border-bottom: 1px solid #1E364A; }
              #monster-manager-container .monster-manager .monster-manager-administrator .toolbar .toolbar-item .drawer .drawer-content .action-list li:hover {
                background-color: #485E70;
                color: #FFFFFF; }
              #monster-manager-container .monster-manager .monster-manager-administrator .toolbar .toolbar-item .drawer .drawer-content .action-list li::before {
                background-repeat: no-repeat;
                background-origin: content-box;
                background-position: 50% 0;
                background-size: cover; }
                #monster-manager-container .monster-manager .monster-manager-administrator .toolbar .toolbar-item .drawer .drawer-content .action-list li::before.active {
                  background-position: 50% 100%; }
              #monster-manager-container .monster-manager .monster-manager-administrator .toolbar .toolbar-item .drawer .drawer-content .action-list li:hover::before {
                background-position: 50% 100%; }
              #monster-manager-container .monster-manager .monster-manager-administrator .toolbar .toolbar-item .drawer .drawer-content .action-list li::before {
                content: '';
                width: 18px;
                height: 18px;
                display: block;
                position: absolute;
                top: 50%;
                left: 5px;
                margin-top: -9px; }
              #monster-manager-container .monster-manager .monster-manager-administrator .toolbar .toolbar-item .drawer .drawer-content .action-list li.filter::before {
                background-image: url("../img/filter.svg"); }
              #monster-manager-container .monster-manager .monster-manager-administrator .toolbar .toolbar-item .drawer .drawer-content .action-list li.edit::before {
                background-image: url("../img/edit.svg"); }
              #monster-manager-container .monster-manager .monster-manager-administrator .toolbar .toolbar-item .drawer .drawer-content .action-list li.load::before {
                background-image: url("../img/load.svg"); }
        #monster-manager-container .monster-manager .monster-manager-administrator .toolbar .toolbar-item.settings .drawer::before {
          content: 'Settings'; }
        #monster-manager-container .monster-manager .monster-manager-administrator .toolbar .toolbar-item.settings .icon {
          background-image: url("../img/settings.svg"); }
        #monster-manager-container .monster-manager .monster-manager-administrator .toolbar .toolbar-item.list .drawer::before {
          content: 'Bulk Actions'; }
        #monster-manager-container .monster-manager .monster-manager-administrator .toolbar .toolbar-item.list .icon {
          background-image: url("../img/list.svg"); }
      #monster-manager-container .monster-manager .monster-manager-administrator .dialog-container {
        -moz-user-select: -moz-none;
        -ms-user-select: none;
        -webkit-user-select: none;
        user-select: none; }
        #monster-manager-container .monster-manager .monster-manager-administrator .dialog-container .modal-overlay {
          position: fixed;
          left: 0;
          top: 0;
          width: 100%;
          height: 100%;
          z-index: 10000;
          background-color: rgba(0, 0, 0, 0.2);
          cursor: default;
          display: -webkit-flex;
          display: -webkit-box;
          display: -ms-flexbox;
          display: flex;
          -webkit-justify-content: center;
          -webkit-box-pack: center;
              -ms-flex-pack: center;
                  justify-content: center;
          -webkit-align-items: center;
          -webkit-box-align: center;
              -ms-flex-align: center;
                  align-items: center; }
          #monster-manager-container .monster-manager .monster-manager-administrator .dialog-container .modal-overlay .action-dialog {
            color: #FFFFFF;
            background-color: #1E364A;
            border: 1px solid #fff;
            border-radius: 10px 10px;
            box-shadow: inset 0 4px 5px -2px rgba(0, 0, 0, 0.3), 1px 2px 5px rgba(0, 0, 0, 0.3);
            padding: 5px 5px 5px 5px;
            box-sizing: border-box; }
            #monster-manager-container .monster-manager .monster-manager-administrator .dialog-container .modal-overlay .action-dialog.load::before {
              content: 'Load Monster Data'; }
            #monster-manager-container .monster-manager .monster-manager-administrator .dialog-container .modal-overlay .action-dialog::before {
              font-size: 15px;
              padding: 0 5px 5px 5px;
              line-height: 20px;
              display: block;
              font-family: "Libre Baskerville", serif;
              font-weight: bold;
              text-shadow: 0 1px 0 rgba(0, 0, 0, 0.1); }
            #monster-manager-container .monster-manager .monster-manager-administrator .dialog-container .modal-overlay .action-dialog .dialog-content {
              border-radius: 5px;
              color: #1E364A;
              text-align: left;
              font-size: 16px;
              font-weight: normal;
              background: #FFFFFF;
              padding: 12px 10px 12px 10px; }
        #monster-manager-container .monster-manager .monster-manager-administrator .dialog-container .data-loader-form {
          width: 400px;
          display: -webkit-flex;
          display: -webkit-box;
          display: -ms-flexbox;
          display: flex;
          -webkit-flex-direction: column;
          -webkit-box-orient: vertical;
          -webkit-box-direction: normal;
              -ms-flex-direction: column;
                  flex-direction: column;
          -webkit-align-items: stretch;
          -webkit-box-align: stretch;
              -ms-flex-align: stretch;
                  align-items: stretch;
          font-family: "Rokkitt", serif;
          font-size: 18px; }
          #monster-manager-container .monster-manager .monster-manager-administrator .dialog-container .data-loader-form .instructions {
            margin-bottom: 10px; }
          #monster-manager-container .monster-manager .monster-manager-administrator .dialog-container .data-loader-form .file-input {
            padding: 10px;
            border-radius: 5px / 5px;
            border: 1px dashed #485E70;
            width: 100%;
            box-sizing: border-box;
            line-height: 100%;
            height: auto !important; }
          #monster-manager-container .monster-manager .monster-manager-administrator .dialog-container .data-loader-form .controls {
            display: -webkit-flex;
            display: -webkit-box;
            display: -ms-flexbox;
            display: flex;
            -webkit-justify-content: space-between;
            -webkit-box-pack: justify;
                -ms-flex-pack: justify;
                    justify-content: space-between;
            margin-top: 20px; }
          #monster-manager-container .monster-manager .monster-manager-administrator .dialog-container .data-loader-form .error {
            color: #700e0d;
            font-weight: bold;
            margin-top: 10px; }
            #monster-manager-container .monster-manager .monster-manager-administrator .dialog-container .data-loader-form .error ul {
              padding: 10px 0 0 20px; }
          #monster-manager-container .monster-manager .monster-manager-administrator .dialog-container .data-loader-form button {
            cursor: pointer; }
            #monster-manager-container .monster-manager .monster-manager-administrator .dialog-container .data-loader-form button:disabled {
              cursor: not-allowed; }
          #monster-manager-container .monster-manager .monster-manager-administrator .dialog-container .data-loader-form progress {
            display: none; }
    #monster-manager-container .monster-manager .monster-row {
      font-size: 16px;
      color: #000;
      -moz-user-select: -moz-none;
      -ms-user-select: none;
      -webkit-user-select: none;
      user-select: none;
      margin: 0 0 50px 0; }
      #monster-manager-container .monster-manager .monster-row .sidebar-container {
        background-color: #F7F6F3;
        border: 1px solid #a5962e;
        border-radius: 10px;
        box-shadow: 1px 2px 5px rgba(0, 0, 0, 0.3);
        position: absolute;
        top: 0;
        right: -10px;
        z-index: -10;
        padding: 5px;
        -webkit-transform: translateX(100%) scale(0, 0);
            -ms-transform: translateX(100%) scale(0, 0);
                transform: translateX(100%) scale(0, 0);
        -webkit-transition: all 250ms ease-out;
                transition: all 250ms ease-out;
        opacity: 0; }
        #monster-manager-container .monster-manager .monster-row .sidebar-container ::-webkit-scrollbar-corner {
          -webkit-appearance: none; }
        #monster-manager-container .monster-manager .monster-row .sidebar-container ::-webkit-scrollbar {
          -webkit-appearance: none;
          width: 12px;
          background: transparent; }
        #monster-manager-container .monster-manager .monster-row .sidebar-container ::-webkit-scrollbar-thumb {
          border-radius: 12px;
          border: 4px solid rgba(255, 255, 255, 0);
          background-clip: content-box;
          background-color: #A0A0A0; }
        #monster-manager-container .monster-manager .monster-row .sidebar-container:after, #monster-manager-container .monster-manager .monster-row .sidebar-container:before {
          content: " ";
          height: 0;
          width: 0;
          position: absolute;
          pointer-events: none;
          border: solid rgba(255, 255, 255, 0); }
        #monster-manager-container .monster-manager .monster-row .sidebar-container:after {
          border-color: rgba(255, 255, 255, 0);
          border-width: 9px;
          left: -18px;
          border-right-color: #F7F6F3;
          top: 0;
          margin-top: 31px; }
        #monster-manager-container .monster-manager .monster-row .sidebar-container:before {
          border-color: rgba(255, 255, 255, 0);
          border-width: 10px;
          left: -20px;
          border-right-color: #a5962e;
          top: 0;
          margin-top: 30px; }
        #monster-manager-container .monster-manager .monster-row .sidebar-container .cover {
          width: 100%;
          height: 100%;
          position: absolute;
          top: 0;
          left: 0; }
        #monster-manager-container .monster-manager .monster-row .sidebar-container .sidebar-scrollable-area {
          overflow: hidden; }
        #monster-manager-container .monster-manager .monster-row .sidebar-container .sidebar-inner {
          display: -webkit-flex;
          display: -webkit-box;
          display: -ms-flexbox;
          display: flex;
          -webkit-flex-direction: row;
          -webkit-box-orient: horizontal;
          -webkit-box-direction: normal;
              -ms-flex-direction: row;
                  flex-direction: row;
          -webkit-align-items: flex-start;
          -webkit-box-align: start;
              -ms-flex-align: start;
                  align-items: flex-start;
          max-height: 600px;
          overflow-y: scroll;
          overflow-x: hidden;
          position: relative;
          margin-right: -12px;
          border-radius: 5px; }
        #monster-manager-container .monster-manager .monster-row .sidebar-container .sidebar-content-pane {
          position: relative; }
          #monster-manager-container .monster-manager .monster-row .sidebar-container .sidebar-content-pane:nth-child(2) {
            margin-left: 5px; }
        #monster-manager-container .monster-manager .monster-row .sidebar-container .sidebar-content {
          width: 400px;
          background-size: contain;
          background-repeat: no-repeat;
          border-radius: 5px;
          box-shadow: inset 0px 1px 3px 2px rgba(0, 0, 0, 0.5); }
          #monster-manager-container .monster-manager .monster-row .sidebar-container .sidebar-content img {
            visibility: hidden;
            width: 400px; }
      #monster-manager-container .monster-manager .monster-row .shelf-clipping-box {
        position: absolute;
        top: 0;
        left: 0;
        z-index: -5;
        height: 100%;
        width: 100%;
        clip: rect(10px, auto, 2000px, 0); }
      #monster-manager-container .monster-manager .monster-row .action-shelf {
        background-color: #F7F6F3;
        border: 1px solid #a5962e;
        border-radius: 10px;
        box-shadow: 1px 2px 5px rgba(0, 0, 0, 0.3);
        font-family: "Rokkitt", serif;
        position: absolute;
        bottom: 10px;
        left: 10px;
        padding: 15px 5px 5px 5px;
        z-index: -10;
        width: 452px;
        height: auto;
        vertical-align: middle;
        -webkit-backface-visibility: hidden;
                backface-visibility: hidden;
        -webkit-transition: all 250ms ease-out;
                transition: all 250ms ease-out;
        -webkit-transition-property: -webkit-transform;
                transition-property: transform;
        -webkit-transform: translateY(0%);
            -ms-transform: translateY(0%);
                transform: translateY(0%); }
        #monster-manager-container .monster-manager .monster-row .action-shelf .monster-attack {
          margin: 2px;
          border-radius: 10px / 10px;
          padding: 1px 4px;
          display: -webkit-flex;
          display: -webkit-box;
          display: -ms-flexbox;
          display: flex;
          -webkit-align-items: center;
          -webkit-box-align: center;
              -ms-flex-align: center;
                  align-items: center;
          cursor: pointer;
          border: 1px solid rgba(165, 150, 46, 0);
          border-radius: 10px;
          -webkit-transition-property: background-color, border;
          transition-property: background-color, border;
          -webkit-transition-duration: 50ms;
          transition-duration: 50ms;
          -webkit-transition-timing-function: ease-in;
          transition-timing-function: ease-in; }
          #monster-manager-container .monster-manager .monster-row .action-shelf .monster-attack:hover {
            border: 1px solid #a5962e;
            background-color: rgba(165, 150, 46, 0.18); }
          #monster-manager-container .monster-manager .monster-row .action-shelf .monster-attack:active {
            background-color: rgba(165, 150, 46, 0.48); }
          #monster-manager-container .monster-manager .monster-row .action-shelf .monster-attack:hover .attack-icon {
            -webkit-transform: scale(1.1);
                -ms-transform: scale(1.1);
                    transform: scale(1.1); }
          #monster-manager-container .monster-manager .monster-row .action-shelf .monster-attack:active .to-hit .icon {
            -webkit-transform: rotateZ(0deg);
                    transform: rotateZ(0deg); }
          #monster-manager-container .monster-manager .monster-row .action-shelf .monster-attack:not(:active) .to-hit .icon {
            -webkit-transform: rotateZ(720deg);
                    transform: rotateZ(720deg);
            -webkit-transition: -webkit-transform 500ms ease-out;
                    transition: transform 500ms ease-out; }
          #monster-manager-container .monster-manager .monster-row .action-shelf .monster-attack .attack-icon {
            -moz-user-select: -moz-none;
            -ms-user-select: none;
            -webkit-user-select: none;
            user-select: none;
            cursor: default;
            width: 35px;
            height: 35px;
            position: relative;
            display: inline-block;
            background: no-repeat center;
            background-size: contain;
            -webkit-transform: scale(0.8);
                -ms-transform: scale(0.8);
                    transform: scale(0.8);
            -webkit-transition: -webkit-transform 250ms ease-out;
                    transition: transform 250ms ease-out;
            cursor: pointer;
            margin-right: 5px; }
            #monster-manager-container .monster-manager .monster-row .action-shelf .monster-attack .attack-icon.hp {
              background-image: url("../img/hp.svg"); }
            #monster-manager-container .monster-manager .monster-row .action-shelf .monster-attack .attack-icon.ac {
              background-image: url("../img/ac.svg"); }
            #monster-manager-container .monster-manager .monster-row .action-shelf .monster-attack .attack-icon .value {
              position: absolute;
              top: 0;
              left: 0;
              width: 35px;
              height: 35px;
              line-height: 35px;
              vertical-align: middle;
              text-align: center;
              font-family: "Alegreya Sans", sans-serif;
              font-weight: bold;
              /* WebKit (Safari/Chrome) Only */
              -webkit-text-stroke: 2px black;
              /* If we weren't using text-shadow, we'd set a fallback color
                 and use this to set color instead
                -webkit-text-fill-color: white; */
              -webkit-text-fill-color: white;
              color: white;
              font-size: 26px; }
              #monster-manager-container .monster-manager .monster-row .action-shelf .monster-attack .attack-icon .value:not(:-moz-handler-blocked) {
                /* Simulated effect for Firefox and Opera */
                text-shadow: 3px 3px 0 black, -1px -1px 0 black, 1px -1px 0 black, -1px 1px 0 black, 1px 1px 0 black; }
            #monster-manager-container .monster-manager .monster-row .action-shelf .monster-attack .attack-icon .icon {
              width: 100%;
              height: 100%;
              background: no-repeat center;
              background-size: contain; }
            #monster-manager-container .monster-manager .monster-row .action-shelf .monster-attack .attack-icon.to-hit .icon {
              background-image: url("../img/d20.svg"); }
            #monster-manager-container .monster-manager .monster-row .action-shelf .monster-attack .attack-icon.to-hit .value {
              left: -2px; }
            #monster-manager-container .monster-manager .monster-row .action-shelf .monster-attack .attack-icon.dc .icon {
              background-image: url("../img/dc.svg"); }
            #monster-manager-container .monster-manager .monster-row .action-shelf .monster-attack .attack-icon.dc .value {
              top: 6px;
              left: 2px; }
          #monster-manager-container .monster-manager .monster-row .action-shelf .monster-attack .attack-name {
            font-weight: bold;
            margin-right: 5px; }
      #monster-manager-container .monster-manager .monster-row .monster-card:hover {
        z-index: 10; }
        #monster-manager-container .monster-manager .monster-row .monster-card:hover .action-shelf {
          -webkit-transform: translateY(100%);
              -ms-transform: translateY(100%);
                  transform: translateY(100%); }
        #monster-manager-container .monster-manager .monster-row .monster-card:hover .sidebar-container {
          -webkit-transform: translateX(100%) scale(1, 1);
              -ms-transform: translateX(100%) scale(1, 1);
                  transform: translateX(100%) scale(1, 1);
          opacity: 1; }
        #monster-manager-container .monster-manager .monster-row .monster-card:hover .avatar,
        #monster-manager-container .monster-manager .monster-row .monster-card:hover .monster-card-values {
          -ms-transform: scale(1.2, 1.2);
          -webkit-transform: scale(1.2, 1.2);
          transform: scale(1.2, 1.2); }
        #monster-manager-container .monster-manager .monster-row .monster-card:hover .avatar {
          -webkit-animation: green-pulse 1.5s ease-in-out infinite;
          animation: green-pulse 1.5s ease-in-out infinite; }
      #monster-manager-container .monster-manager .monster-row .avatar,
      #monster-manager-container .monster-manager .monster-row .monster-card-values {
        -webkit-transition: all 250ms ease-out;
                transition: all 250ms ease-out; }
@-webkit-keyframes green-pulse {
  0% {
    box-shadow: -1px 0px 2px 0.5px #FFFFFF, 0px 0px 1px 2px #08ff35, 0 0 2px #08ff35, 0 0 4px #08ff35, 1px 1px 7px #08ff35, 0 -1px 9px #08ff35, 0 -1px 10px #08ff35, 1px 0 12px #58ba0c; }
  50% {
    box-shadow: 1px -1px 2px 0.5px #FFFFFF, 0px 0px 2px 4px #08ff35, 0 0 4px #08ff35, 0 0 7px #08ff35, 0 0 8px #08ff35, -1px 1px 10px #08ff35, -1px 0 15px #08ff35, 0 1px 17px #58ba0c; }
  100% {
    box-shadow: -1px 0px 2px 0.5px #FFFFFF, 0px 0px 1px 2px #08ff35, 0 0 2px #08ff35, 0 0 4px #08ff35, 1px 1px 7px #08ff35, 0 -1px 9px #08ff35, 0 -1px 10px #08ff35, 1px 0 12px #58ba0c; } }
@keyframes green-pulse {
  0% {
    box-shadow: -1px 0px 2px 0.5px #FFFFFF, 0px 0px 1px 2px #08ff35, 0 0 2px #08ff35, 0 0 4px #08ff35, 1px 1px 7px #08ff35, 0 -1px 9px #08ff35, 0 -1px 10px #08ff35, 1px 0 12px #58ba0c; }
  50% {
    box-shadow: 1px -1px 2px 0.5px #FFFFFF, 0px 0px 2px 4px #08ff35, 0 0 4px #08ff35, 0 0 7px #08ff35, 0 0 8px #08ff35, -1px 1px 10px #08ff35, -1px 0 15px #08ff35, 0 1px 17px #58ba0c; }
  100% {
    box-shadow: -1px 0px 2px 0.5px #FFFFFF, 0px 0px 1px 2px #08ff35, 0 0 2px #08ff35, 0 0 4px #08ff35, 1px 1px 7px #08ff35, 0 -1px 9px #08ff35, 0 -1px 10px #08ff35, 1px 0 12px #58ba0c; } }
      #monster-manager-container .monster-manager .monster-row .monster-card {
        position: relative;
        margin-top: 25px;
        width: 482px;
        z-index: 1; }
        #monster-manager-container .monster-manager .monster-row .monster-card .card-border {
          background-color: #F7F6F3;
          border: 1px solid #a5962e;
          border-radius: 10px;
          box-shadow: 1px 2px 5px rgba(0, 0, 0, 0.3);
          width: 370px;
          height: 67px;
          padding: 5px 5px 5px 105px;
          top: 20px; }
        #monster-manager-container .monster-manager .monster-row .monster-card .avatar {
          width: 70px;
          height: 70px;
          display: inline-block;
          border-radius: 500px / 500px;
          max-width: 100%;
          vertical-align: middle;
          padding: 4px;
          background-color: #fff;
          border: 3px solid #999999;
          box-shadow: 1px 2px 3px rgba(0, 0, 0, 0.2);
          position: absolute;
          margin: 0 10px;
          top: -20px; }
          #monster-manager-container .monster-manager .monster-row .monster-card .avatar .cover {
            width: 100%;
            height: 100%;
            position: absolute;
            top: 0;
            left: 0; }
          #monster-manager-container .monster-manager .monster-row .monster-card .avatar div {
            width: 100%;
            height: 100%;
            border-radius: 500px / 500px; }
          #monster-manager-container .monster-manager .monster-row .monster-card .avatar .image {
            background-size: cover;
            background-origin: content-box;
            background-position: 50% 50%;
            background-repeat: no-repeat; }
            #monster-manager-container .monster-manager .monster-row .monster-card .avatar .image.missing {
              background-image: url(../img/missing-avatar.svg);
              background-size: 80px;
              background-position: top; }
        #monster-manager-container .monster-manager .monster-row .monster-card .monster-name {
          -moz-user-select: -moz-none;
          -ms-user-select: none;
          -webkit-user-select: none;
          user-select: none;
          font-family: "Libre Baskerville", serif;
          font-weight: bold;
          border-radius: 10px / 10px;
          box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
          background-color: white;
          text-align: center;
          padding: 2px 5px; }
        #monster-manager-container .monster-manager .monster-row .monster-card .monster-card-values {
          position: absolute;
          width: 100px;
          padding: 0 2px;
          top: 35px; }
          #monster-manager-container .monster-manager .monster-row .monster-card .monster-card-values .monster-value {
            -moz-user-select: -moz-none;
            -ms-user-select: none;
            -webkit-user-select: none;
            user-select: none;
            cursor: default;
            width: 35px;
            height: 35px;
            position: relative;
            display: inline-block;
            background: no-repeat center;
            background-size: contain; }
            #monster-manager-container .monster-manager .monster-row .monster-card .monster-card-values .monster-value.hp {
              background-image: url("../img/hp.svg"); }
            #monster-manager-container .monster-manager .monster-row .monster-card .monster-card-values .monster-value.ac {
              background-image: url("../img/ac.svg"); }
            #monster-manager-container .monster-manager .monster-row .monster-card .monster-card-values .monster-value .value {
              position: absolute;
              top: 0;
              left: 0;
              width: 35px;
              height: 35px;
              line-height: 35px;
              vertical-align: middle;
              text-align: center;
              font-family: "Alegreya Sans", sans-serif;
              font-weight: bold;
              /* WebKit (Safari/Chrome) Only */
              -webkit-text-stroke: 2px black;
              /* If we weren't using text-shadow, we'd set a fallback color
                 and use this to set color instead
                -webkit-text-fill-color: white; */
              -webkit-text-fill-color: white;
              color: white;
              font-size: 26px; }
              #monster-manager-container .monster-manager .monster-row .monster-card .monster-card-values .monster-value .value:not(:-moz-handler-blocked) {
                /* Simulated effect for Firefox and Opera */
                text-shadow: 3px 3px 0 black, -1px -1px 0 black, 1px -1px 0 black, -1px 1px 0 black, 1px 1px 0 black; }
          #monster-manager-container .monster-manager .monster-row .monster-card .monster-card-values .hp {
            float: left; }
          #monster-manager-container .monster-manager .monster-row .monster-card .monster-card-values .ac {
            float: right; }
        #monster-manager-container .monster-manager .monster-row .monster-card .body {
          font-family: "Rokkitt", serif;
          padding: 8px 8px 0 8px;
          text-align: center;
          line-height: normal; }
          #monster-manager-container .monster-manager .monster-row .monster-card .body .stat-values {
            display: -webkit-flex;
            display: -webkit-box;
            display: -ms-flexbox;
            display: flex;
            -webkit-align-items: center;
            -webkit-box-align: center;
                -ms-flex-align: center;
                    align-items: center;
            -webkit-justify-content: space-between;
            -webkit-box-pack: justify;
                -ms-flex-pack: justify;
                    justify-content: space-between; }
          #monster-manager-container .monster-manager .monster-row .monster-card .body .stat-value {
            cursor: pointer;
            display: block;
            text-align: center;
            width: 48px;
            margin: 0;
            padding: 1px;
            border-radius: 10px / 10px;
            -webkit-transition-property: background-color;
            transition-property: background-color;
            -webkit-transition-duration: 50ms;
            transition-duration: 50ms;
            -webkit-transition-timing-function: ease-in;
            transition-timing-function: ease-in; }
            #monster-manager-container .monster-manager .monster-row .monster-card .body .stat-value .stat-container .name {
              font-weight: 900;
              font-size: 90%;
              line-height: 15px;
              vertical-align: middle; }
            #monster-manager-container .monster-manager .monster-row .monster-card .body .stat-value .stat-container .value {
              line-height: 19px;
              vertical-align: middle; }
              #monster-manager-container .monster-manager .monster-row .monster-card .body .stat-value .stat-container .value.negative {
                color: darkred; }
              #monster-manager-container .monster-manager .monster-row .monster-card .body .stat-value .stat-container .value.positive {
                color: darkgreen; }
              #monster-manager-container .monster-manager .monster-row .monster-card .body .stat-value .stat-container .value.extreme {
                font-weight: 900;
                font-size: 110%; }
            #monster-manager-container .monster-manager .monster-row .monster-card .body .stat-value:hover {
              border: 1px solid #a5962e;
              padding: 0;
              background-color: rgba(165, 150, 46, 0.18); }
              #monster-manager-container .monster-manager .monster-row .monster-card .body .stat-value:hover .stat-container {
                background-image: url("../img/d20.svg");
                background-size: 20px;
                background-repeat: no-repeat;
                background-position: center;
                background-origin: content-box; }
              #monster-manager-container .monster-manager .monster-row .monster-card .body .stat-value:hover .name, #monster-manager-container .monster-manager .monster-row .monster-card .body .stat-value:hover .value {
                opacity: 0; }
            #monster-manager-container .monster-manager .monster-row .monster-card .body .stat-value:active {
              background-color: rgba(165, 150, 46, 0.48); }
              #monster-manager-container .monster-manager .monster-row .monster-card .body .stat-value:active .stat-container {
                -webkit-transform: rotateZ(0deg);
                        transform: rotateZ(0deg); }
            #monster-manager-container .monster-manager .monster-row .monster-card .body .stat-value:not(:active) .stat-container {
              -webkit-transform: rotateZ(720deg);
                      transform: rotateZ(720deg);
              -webkit-transition: -webkit-transform 500ms ease-out;
                      transition: transform 500ms ease-out; }
            #monster-manager-container .monster-manager .monster-row .monster-card .body .stat-value:not(:hover) .stat-container {
              -webkit-transition: none;
                      transition: none; }

.no-touch #monster-manager-container {
  left: 100px;
  top: 50px; }

/*# sourceMappingURL=monster-manager.css.map */


text:
package Table;

/**
 * Created by Thomas on 1/29/14.
 */
public class Chalcogen extends NonMetal {

    public int atomicNumber;
    public double atomicMass;

    public Chalcogen(int aN, double aM){
        int atomicNumber = aN;
        double atomicMass = aM;
    }

    Chalcogen oxygen = new Chalcogen(8, 15.9994);
    Chalcogen sulfur = new Chalcogen(16, 31.06);
    Chalcogen selenium = new Chalcogen(34, 78.96);
    Chalcogen tellurium = new Chalcogen(52, 127.6);
    Chalcogen poloium = new Chalcogen(84, 127.6);

}


text:
layout: post
date: 2012-06-15
time: "09:00:00"
author: "Greg Wilson"
title: Pretty Well Sums It Up
category: ["Noticed"]
---

Speaking at a conference in the UK today, Andrew Eland (of Google) said:

Think of the things scientists won't build because they're not exposed to computing in school.

+1 to that.


text:
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.

#pragma once

/*=============================================================================
 *	Helpers:
 *============================================================================*/

/**
 *	float4 vector register type, where the first float (X) is stored in the lowest 32 bits, and so on.
 */
typedef __m128	VectorRegister;

/**
 * @param A0	Selects which component (0-3) from 'A' into 1st slot in the result
 * @param A1	Selects which component (0-3) from 'A' into 2nd slot in the result
 * @param B2	Selects which component (0-3) from 'B' into 3rd slot in the result
 * @param B3	Selects which component (0-3) from 'B' into 4th slot in the result
 */
#define SHUFFLEMASK(A0,A1,B2,B3) ( (A0) | ((A1)<<2) | ((B2)<<4) | ((B3)<<6) )

/**
 * Returns a bitwise equivalent vector based on 4 DWORDs.
 *
 * @param X		1st uint32 component
 * @param Y		2nd uint32 component
 * @param Z		3rd uint32 component
 * @param W		4th uint32 component
 * @return		Bitwise equivalent vector with 4 floats
 */
FORCEINLINE VectorRegister MakeVectorRegister( uint32 X, uint32 Y, uint32 Z, uint32 W )
{
	union { VectorRegister v; uint32 f[4]; } Tmp;
	Tmp.f[0] = X;
	Tmp.f[1] = Y;
	Tmp.f[2] = Z;
	Tmp.f[3] = W;
	return Tmp.v;
}

/**
 * Returns a vector based on 4 FLOATs.
 *
 * @param X		1st float component
 * @param Y		2nd float component
 * @param Z		3rd float component
 * @param W		4th float component
 * @return		Vector of the 4 FLOATs
 */
FORCEINLINE VectorRegister MakeVectorRegister( float X, float Y, float Z, float W )
{
	return _mm_setr_ps( X, Y, Z, W );
}

/** Vector that represents (1,1,1,1) */
static const VectorRegister SSE_ONE = MakeVectorRegister( 1.0f, 1.0f, 1.0f, 1.0f );

/** Bitmask to AND out the XYZ components in a vector */
static const VectorRegister SSE_XYZ_MASK = MakeVectorRegister( (uint32)0xffffffff, (uint32)0xffffffff, (uint32)0xffffffff, (uint32)0x00000000 );

/** Bitmask to AND out the sign bit of each components in a vector */
#define SIGN_BIT (~(1 << 31))
static const VectorRegister SSE_SIGN_MASK = MakeVectorRegister( (uint32)SIGN_BIT, (uint32)SIGN_BIT, (uint32)SIGN_BIT, (uint32)SIGN_BIT );

/*=============================================================================
 *	Intrinsics:
 *============================================================================*/

#if PLATFORM_MAC || PLATFORM_LINUX
#undef VectorZero
#undef VectorOne
#undef VectorLoad
#undef VectorLoadFloat3
#undef VectorLoadFloat3_W0
#undef VectorLoadFloat3_W1
#undef VectorLoadAligned
#undef VectorLoadFloat1
#undef VectorStoreAligned
#undef VectorStore
#undef VectorStoreFloat3
#undef VectorStoreFloat1
#undef VectorReplicate
#undef VectorAbs
#undef VectorNegate
#undef VectorSwizzle
#undef VectorLoadByte4Reverse
#undef VectorGetControlRegister
#undef VectorSetControlRegister
#undef VECTOR_ROUND_TOWARD_ZERO
#endif

/**
 * Returns a vector with all zeros.
 *
 * @return		VectorRegister(0.0f, 0.0f, 0.0f, 0.0f)
 */
#define VectorZero()					_mm_setzero_ps()

/**
 * Returns a vector with all ones.
 *
 * @return		VectorRegister(1.0f, 1.0f, 1.0f, 1.0f)
 */
#define VectorOne()						SSE_ONE

/**
 * Returns an component from a vector.
 *
 * @param Vec				Vector register
 * @param ComponentIndex	Which component to get, X=0, Y=1, Z=2, W=3
 * @return					The component as a float
 */
#define VectorGetComponent( Vec, ComponentIndex )	(((float*) &(Vec))[ComponentIndex])

/**
 * Loads 4 FLOATs from unaligned memory.
 *
 * @param Ptr	Unaligned memory pointer to the 4 FLOATs
 * @return		VectorRegister(Ptr[0], Ptr[1], Ptr[2], Ptr[3])
 */
#define VectorLoad( Ptr )				_mm_loadu_ps( (float*)(Ptr) )

/**
 * Loads 3 FLOATs from unaligned memory and leaves W undefined.
 *
 * @param Ptr	Unaligned memory pointer to the 3 FLOATs
 * @return		VectorRegister(Ptr[0], Ptr[1], Ptr[2], undefined)
 */
#define VectorLoadFloat3( Ptr )			MakeVectorRegister( ((const float*)(Ptr))[0], ((const float*)(Ptr))[1], ((const float*)(Ptr))[2], 0.0f )

/**
 * Loads 3 FLOATs from unaligned memory and sets W=0.
 *
 * @param Ptr	Unaligned memory pointer to the 3 FLOATs
 * @return		VectorRegister(Ptr[0], Ptr[1], Ptr[2], 0.0f)
 */
#define VectorLoadFloat3_W0( Ptr )		MakeVectorRegister( ((const float*)(Ptr))[0], ((const float*)(Ptr))[1], ((const float*)(Ptr))[2], 0.0f )

/**
 * Loads 3 FLOATs from unaligned memory and sets W=1.
 *
 * @param Ptr	Unaligned memory pointer to the 3 FLOATs
 * @return		VectorRegister(Ptr[0], Ptr[1], Ptr[2], 1.0f)
 */
#define VectorLoadFloat3_W1( Ptr )		MakeVectorRegister( ((const float*)(Ptr))[0], ((const float*)(Ptr))[1], ((const float*)(Ptr))[2], 1.0f )

/**
 * Loads 4 FLOATs from aligned memory.
 *
 * @param Ptr	Aligned memory pointer to the 4 FLOATs
 * @return		VectorRegister(Ptr[0], Ptr[1], Ptr[2], Ptr[3])
 */
#define VectorLoadAligned( Ptr )		_mm_load_ps( (float*)(Ptr) )

/**
 * Loads 1 float from unaligned memory and replicates it to all 4 components.
 *
 * @param Ptr	Unaligned memory pointer to the float
 * @return		VectorRegister(Ptr[0], Ptr[0], Ptr[0], Ptr[0])
 */
#define VectorLoadFloat1( Ptr )			_mm_load1_ps( (float*)(Ptr) )

/**
 * Propagates passed in float to all registers
 *
 * @param F		Float to set
 * @return		VectorRegister(F,F,F,F)
 */
#define VectorSetFloat1( F )	_mm_set1_ps( F )

/**
 * Creates a vector out of three FLOATs and leaves W undefined.
 *
 * @param X		1st float component
 * @param Y		2nd float component
 * @param Z		3rd float component
 * @return		VectorRegister(X, Y, Z, undefined)
 */
#define VectorSetFloat3( X, Y, Z )		MakeVectorRegister( X, Y, Z, 0.0f )

/**
 * Creates a vector out of four FLOATs.
 *
 * @param X		1st float component
 * @param Y		2nd float component
 * @param Z		3rd float component
 * @param W		4th float component
 * @return		VectorRegister(X, Y, Z, W)
 */
#define VectorSet( X, Y, Z, W )			MakeVectorRegister( X, Y, Z, W )

/**
 * Stores a vector to aligned memory.
 *
 * @param Vec	Vector to store
 * @param Ptr	Aligned memory pointer
 */
#define VectorStoreAligned( Vec, Ptr )	_mm_store_ps( (float*)(Ptr), Vec )

/**
 * Stores a vector to memory (aligned or unaligned).
 *
 * @param Vec	Vector to store
 * @param Ptr	Memory pointer
 */
#define VectorStore( Vec, Ptr )			_mm_storeu_ps( (float*)(Ptr), Vec )

/**
 * Stores the XYZ components of a vector to unaligned memory.
 *
 * @param Vec	Vector to store XYZ
 * @param Ptr	Unaligned memory pointer
 */
FORCEINLINE void VectorStoreFloat3( const VectorRegister& Vec, void* Ptr )
{
	union { VectorRegister v; float f[4]; } Tmp;
	Tmp.v = Vec;
	float* FloatPtr = (float*)(Ptr);
	FloatPtr[0] = Tmp.f[0];
	FloatPtr[1] = Tmp.f[1];
	FloatPtr[2] = Tmp.f[2];
}

/**
 * Stores the X component of a vector to unaligned memory.
 *
 * @param Vec	Vector to store X
 * @param Ptr	Unaligned memory pointer
 */
#define VectorStoreFloat1( Vec, Ptr )	_mm_store_ss((float*)(Ptr), Vec)

/**
 * Truncates the X component of a vector and returns it as an integer.
 *
 * @param	Vec		Vector to truncate X component
 * @return	(int32) Truncate( Vec.X )
 */
#define VectorTruncate( Vec ) _mm_cvttss_si32( Vec )

/**
 * Multiplexes two vectors using upper two floating point values.
 *
 * @param	Vec1	Source vector
 * @param	Vec2	Source vector
 * @param	VectorRegister( Vec1.z, Vec1.w, Vec2.z, Vec2.w )
 */
#define VectorMultiplexHigh( Vec1, Vec2 )	_mm_movehl_ps( Vec1, Vec2 )

/**
 * Multiplexes two vectors using lower two floating point values.
 *
 * @param	Vec1	Source vector
 * @param	Vec2	Source vector
 * @param	VectorRegister( Vec1.x, Vec1.y, Vec2.x, Vec2.y )
 */
#define VectorMultiplexLow( Vec1, Vec2 )	_mm_movelh_ps( Vec1, Vec2 )

/**
 * Replicates one component into all four components and returns the new vector.
 *
 * @param Vec				Source vector
 * @param ComponentIndex	Index (0-3) of the component to replicate
 * @return					VectorRegister( Vec[ComponentIndex], Vec[ComponentIndex], Vec[ComponentIndex], Vec[ComponentIndex] )
 */
#define VectorReplicate( Vec, ComponentIndex )	_mm_shuffle_ps( Vec, Vec, SHUFFLEMASK(ComponentIndex,ComponentIndex,ComponentIndex,ComponentIndex) )

/**
 * Returns the absolute value (component-wise).
 *
 * @param Vec			Source vector
 * @return				VectorRegister( abs(Vec.x), abs(Vec.y), abs(Vec.z), abs(Vec.w) )
 */
#define VectorAbs( Vec )				_mm_and_ps(Vec, SSE_SIGN_MASK)

/**
 * Returns the negated value (component-wise).
 *
 * @param Vec			Source vector
 * @return				VectorRegister( -Vec.x, -Vec.y, -Vec.z, -Vec.w )
 */
#define VectorNegate( Vec )				_mm_sub_ps(_mm_setzero_ps(),Vec)

/**
 * Adds two vectors (component-wise) and returns the result.
 *
 * @param Vec1	1st vector
 * @param Vec2	2nd vector
 * @return		VectorRegister( Vec1.x+Vec2.x, Vec1.y+Vec2.y, Vec1.z+Vec2.z, Vec1.w+Vec2.w )
 */
#define VectorAdd( Vec1, Vec2 )			_mm_add_ps( Vec1, Vec2 )

/**
 * Subtracts a vector from another (component-wise) and returns the result.
 *
 * @param Vec1	1st vector
 * @param Vec2	2nd vector
 * @return		VectorRegister( Vec1.x-Vec2.x, Vec1.y-Vec2.y, Vec1.z-Vec2.z, Vec1.w-Vec2.w )
 */
#define VectorSubtract( Vec1, Vec2 )	_mm_sub_ps( Vec1, Vec2 )

/**
 * Multiplies two vectors (component-wise) and returns the result.
 *
 * @param Vec1	1st vector
 * @param Vec2	2nd vector
 * @return		VectorRegister( Vec1.x*Vec2.x, Vec1.y*Vec2.y, Vec1.z*Vec2.z, Vec1.w*Vec2.w )
 */
#define VectorMultiply( Vec1, Vec2 )	_mm_mul_ps( Vec1, Vec2 )

/**
 * Divides two vectors (component-wise) and returns the result.
 *
 * @param Vec1	1st vector
 * @param Vec2	2nd vector
 * @return		VectorRegister( Vec1.x/Vec2.x, Vec1.y/Vec2.y, Vec1.z/Vec2.z, Vec1.w/Vec2.w )
 */
#define VectorDivide( Vec1, Vec2 )		_mm_div_ps( Vec1, Vec2 )

/**
 * Multiplies two vectors (component-wise), adds in the third vector and returns the result.
 *
 * @param Vec1	1st vector
 * @param Vec2	2nd vector
 * @param Vec3	3rd vector
 * @return		VectorRegister( Vec1.x*Vec2.x + Vec3.x, Vec1.y*Vec2.y + Vec3.y, Vec1.z*Vec2.z + Vec3.z, Vec1.w*Vec2.w + Vec3.w )
 */
#define VectorMultiplyAdd( Vec1, Vec2, Vec3 )	_mm_add_ps( _mm_mul_ps(Vec1, Vec2), Vec3 )

/**
 * Calculates the dot3 product of two vectors and returns a vector with the result in all 4 components.
 * Only really efficient on Xbox 360.
 *
 * @param Vec1	1st vector
 * @param Vec2	2nd vector
 * @return		d = dot3(Vec1.xyz, Vec2.xyz), VectorRegister( d, d, d, d )
 */
FORCEINLINE VectorRegister VectorDot3( const VectorRegister& Vec1, const VectorRegister& Vec2 )
{
	VectorRegister Temp = VectorMultiply( Vec1, Vec2 );
	return VectorAdd( VectorReplicate(Temp,0), VectorAdd( VectorReplicate(Temp,1), VectorReplicate(Temp,2) ) );
}

/**
 * Calculates the dot4 product of two vectors and returns a vector with the result in all 4 components.
 * Only really efficient on Xbox 360.
 *
 * @param Vec1	1st vector
 * @param Vec2	2nd vector
 * @return		d = dot4(Vec1.xyzw, Vec2.xyzw), VectorRegister( d, d, d, d )
 */
FORCEINLINE VectorRegister VectorDot4( const VectorRegister& Vec1, const VectorRegister& Vec2 )
{
	VectorRegister Temp1, Temp2;
	Temp1 = VectorMultiply( Vec1, Vec2 );
	Temp2 = _mm_shuffle_ps( Temp1, Temp1, SHUFFLEMASK(2,3,0,1) );	// (Z,W,X,Y).
	Temp1 = VectorAdd( Temp1, Temp2 );								// (X*X + Z*Z, Y*Y + W*W, Z*Z + X*X, W*W + Y*Y)
	Temp2 = _mm_shuffle_ps( Temp1, Temp1, SHUFFLEMASK(1,2,3,0) );	// Rotate left 4 bytes (Y,Z,W,X).
	return VectorAdd( Temp1, Temp2 );								// (X*X + Z*Z + Y*Y + W*W, Y*Y + W*W + Z*Z + X*X, Z*Z + X*X + W*W + Y*Y, W*W + Y*Y + X*X + Z*Z)
}

/**
 * Calculates the cross product of two vectors (XYZ components). W is set to 0.
 *
 * @param Vec1	1st vector
 * @param Vec2	2nd vector
 * @return		cross(Vec1.xyz, Vec2.xyz). W is set to 0.
 */
FORCEINLINE VectorRegister VectorCross( const VectorRegister& Vec1, const VectorRegister& Vec2 )
{
	VectorRegister A_YZXW = _mm_shuffle_ps( Vec1, Vec1, SHUFFLEMASK(1,2,0,3) );
	VectorRegister B_ZXYW = _mm_shuffle_ps( Vec2, Vec2, SHUFFLEMASK(2,0,1,3) );
	VectorRegister A_ZXYW = _mm_shuffle_ps( Vec1, Vec1, SHUFFLEMASK(2,0,1,3) );
	VectorRegister B_YZXW = _mm_shuffle_ps( Vec2, Vec2, SHUFFLEMASK(1,2,0,3) );
	return VectorSubtract( VectorMultiply(A_YZXW,B_ZXYW), VectorMultiply(A_ZXYW, B_YZXW) );
}

/**
 * Calculates x raised to the power of y (component-wise).
 *
 * @param Base		Base vector
 * @param Exponent	Exponent vector
 * @return			VectorRegister( Base.x^Exponent.x, Base.y^Exponent.y, Base.z^Exponent.z, Base.w^Exponent.w )
 */
FORCEINLINE VectorRegister VectorPow( const VectorRegister& Base, const VectorRegister& Exponent )
{
	//@TODO: Optimize
	union { VectorRegister v; float f[4]; } B, E;
	B.v = Base;
	E.v = Exponent;
	return _mm_setr_ps( powf(B.f[0], E.f[0]), powf(B.f[1], E.f[1]), powf(B.f[2], E.f[2]), powf(B.f[3], E.f[3]) );
}

/**
 * Multiplies two 4x4 matrices.
 *
 * @param Result	Pointer to where the result should be stored
 * @param Matrix1	Pointer to the first matrix
 * @param Matrix2	Pointer to the second matrix
 */
FORCEINLINE void VectorMatrixMultiply( void *Result, const void* Matrix1, const void* Matrix2 )
{
	const VectorRegister *A	= (const VectorRegister *) Matrix1;
	const VectorRegister *B	= (const VectorRegister *) Matrix2;
	VectorRegister *R		= (VectorRegister *) Result;
	VectorRegister Temp, R0, R1, R2, R3;

	// First row of result (Matrix1[0] * Matrix2).
	Temp	= VectorMultiply( VectorReplicate( A[0], 0 ), B[0] );
	Temp	= VectorMultiplyAdd( VectorReplicate( A[0], 1 ), B[1], Temp );
	Temp	= VectorMultiplyAdd( VectorReplicate( A[0], 2 ), B[2], Temp );
	R0		= VectorMultiplyAdd( VectorReplicate( A[0], 3 ), B[3], Temp );

	// Second row of result (Matrix1[1] * Matrix2).
	Temp	= VectorMultiply( VectorReplicate( A[1], 0 ), B[0] );
	Temp	= VectorMultiplyAdd( VectorReplicate( A[1], 1 ), B[1], Temp );
	Temp	= VectorMultiplyAdd( VectorReplicate( A[1], 2 ), B[2], Temp );
	R1		= VectorMultiplyAdd( VectorReplicate( A[1], 3 ), B[3], Temp );

	// Third row of result (Matrix1[2] * Matrix2).
	Temp	= VectorMultiply( VectorReplicate( A[2], 0 ), B[0] );
	Temp	= VectorMultiplyAdd( VectorReplicate( A[2], 1 ), B[1], Temp );
	Temp	= VectorMultiplyAdd( VectorReplicate( A[2], 2 ), B[2], Temp );
	R2		= VectorMultiplyAdd( VectorReplicate( A[2], 3 ), B[3], Temp );

	// Fourth row of result (Matrix1[3] * Matrix2).
	Temp	= VectorMultiply( VectorReplicate( A[3], 0 ), B[0] );
	Temp	= VectorMultiplyAdd( VectorReplicate( A[3], 1 ), B[1], Temp );
	Temp	= VectorMultiplyAdd( VectorReplicate( A[3], 2 ), B[2], Temp );
	R3		= VectorMultiplyAdd( VectorReplicate( A[3], 3 ), B[3], Temp );

	// Store result
	R[0] = R0;
	R[1] = R1;
	R[2] = R2;
	R[3] = R3;
}

/**
 * Calculate the inverse of an FMatrix.
 *
 * @param DstMatrix		FMatrix pointer to where the result should be stored
 * @param SrcMatrix		FMatrix pointer to the Matrix to be inversed
 */
#define VectorMatrixInverse( DstMatrix, SrcMatrix ) D3DXMatrixInverse( (D3DXMATRIX*) DstMatrix, NULL, (const D3DXMATRIX*)SrcMatrix )

/**
 * Returns the minimum values of two vectors (component-wise).
 *
 * @param Vec1	1st vector
 * @param Vec2	2nd vector
 * @return		VectorRegister( min(Vec1.x,Vec2.x), min(Vec1.y,Vec2.y), min(Vec1.z,Vec2.z), min(Vec1.w,Vec2.w) )
 */
#define VectorMin( Vec1, Vec2 )			_mm_min_ps( Vec1, Vec2 )

/**
 * Returns the maximum values of two vectors (component-wise).
 *
 * @param Vec1	1st vector
 * @param Vec2	2nd vector
 * @return		VectorRegister( max(Vec1.x,Vec2.x), max(Vec1.y,Vec2.y), max(Vec1.z,Vec2.z), max(Vec1.w,Vec2.w) )
 */
#define VectorMax( Vec1, Vec2 )			_mm_max_ps( Vec1, Vec2 )

/**
 * Returns the minimum values of the first component of two vectors and passes through
 * others from first vectors.
 *
 * @param Vec1	1st vector
 * @param Vec2	2nd vector
 * @return		VectorRegister( min(Vec1.x,Vec2.x), Vec1.y, Vec1.z, Vec1.w )
 */
#define VectorMinFloat1( Vec1, Vec2 )	_mm_min_ss( Vec1, Vec2 )

/**
 * Returns the maximum values of the first component of two vectors and passes through
 * others from first vectors.
 *
 * @param Vec1	1st vector
 * @param Vec2	2nd vector
 * @return		VectorRegister( max(Vec1.x,Vec2.x), Vec1.y, Vec1.z, Vec1.w )
 */
#define VectorMaxFloat1( Vec1, Vec2 )	_mm_max_ss( Vec1, Vec2 )

/**
 * Compares first component of Vec1 to first component of Vec2 and returns
 * true if Vec1 >= Vec2.
 *
 * @param	Vec1	Vector to compare
 * @param	Vec2	Vector to compare
 * @return (Vec1.x >= Vec2.x) ? true : false
 */
#define VectorCompareGEFloat1( Vec1, Vec2 )	_mm_comige_ss( Vec1, Vec2 )

/**
 * Compares Vec1 to Vec2 and returns 0xFFFFFFFF per component if it was GE
 * or 0 if it wasn't.
 *
 * @param	Vec1	Vector to compare
 * @param	Vec2	Vector to compare
 * @return  VectorRegister( Vec1.x >= Vec2.x ? 0xFFFFFFFF : 0, Vec1.y >= Vec2.y ? 0xFFFFFFFF : 0, Vec1.z >= Vec2.z ? 0xFFFFFFFF : 0, Vec1.w >= Vec2.w ? 0xFFFFFFFF : 0 )
 */
#define VectorCompareGE( Vec1, Vec2 )	_mm_cmpge_ps( Vec1, Vec2 )

/**
 * Compares Vec1 to Vec2 and returns 0xFFFFFFFF per component if it was GT
 * or 0 if it wasn't.
 *
 * @param	Vec1	Vector to compare
 * @param	Vec2	Vector to compare
 * @return  VectorRegister( Vec1.x > Vec2.x ? 0xFFFFFFFF : 0, Vec1.y > Vec2.y ? 0xFFFFFFFF : 0, Vec1.z > Vec2.z ? 0xFFFFFFFF : 0, Vec1.w > Vec2.w ? 0xFFFFFFFF : 0 )
 */
#define VectorCompareGT( Vec1, Vec2 )	_mm_cmpgt_ps( Vec1, Vec2 )

/**
 * Returns the bitwise AND.
 *
 * @param	Vec1	Vector to AND
 * @param	Vec2	Vector to AND
 * @return	bitwise per component AND operation.
 */
#define VectorBitwiseAND( Vec1, Vec2 )	_mm_and_ps( (Vec1), (Vec2) )

/**
 * Returns the bitwise OR.
 *
 * @param	Vec1	Vector to OR
 * @param	Vec2	Vector to OR
 * @return	bitwise per component OR operation.
 */
#define VectorBitwiseOR( Vec1, Vec2 )	_mm_or_ps( (Vec1), (Vec2) )

/**
 * Returns the bitwise AND NOT.
 *
 * @param	Vec1	Vector to NOT AND
 * @param	Vec2	Vector to AND
 * @return	VectorRegister( ~Vec1.x & Vec2.x, ~Vec1.y & Vec2.y, ~Vec1.z & Vec2.z, ~Vec1.w & Vec2.w )
 */
#define VectorBitwiseANDNOT( Vec1, Vec2 )	_mm_andnot_ps( (Vec1), (Vec2) )

/**
 * Selects the passed in vectors based on mask.
 *
 * @param	Vec1	Vector to choose from
 * @param	Vec2	Vector to choose from
 * @param	Mask	Mask to use for chosing. Can be thought of as "alpha"
 * @return	VectorRegister( Mask.X == 0xFFFFFFFF ? Vec2.X : Vec1.X, Mask.Y == 0xFFFFFFFF ? Vec2.Y : Vec1.Y, Mask.Z == 0xFFFFFFFF ? Vec2.Z : Vec1.Z, Mask.W == 0xFFFFFFFF ? Vec2.W : Vec1.W );
 */
FORCEINLINE VectorRegister VectorSelect( const VectorRegister& Vec1, const VectorRegister& Vec2, const VectorRegister& Mask )
{
	return _mm_or_ps( _mm_and_ps( Vec2, Mask ), _mm_andnot_ps( Mask, Vec1 ) );
}

/**
 * Swizzles the 4 components of a vector and returns the result.
 *
 * @param Vec		Source vector
 * @param X			Index for which component to use for X (literal 0-3)
 * @param Y			Index for which component to use for Y (literal 0-3)
 * @param Z			Index for which component to use for Z (literal 0-3)
 * @param W			Index for which component to use for W (literal 0-3)
 * @return			The swizzled vector
 */
#define VectorSwizzle( Vec, X, Y, Z, W )	_mm_shuffle_ps( Vec, Vec, SHUFFLEMASK(X,Y,Z,W) )

/**
 * Loads 4 BYTEs from unaligned memory and converts them into 4 FLOATs.
 * IMPORTANT: You need to call VectorResetFloatRegisters() before using scalar FLOATs after you've used this intrinsic!
 *
 * @param Ptr			Unaligned memory pointer to the 4 BYTEs.
 * @return				VectorRegister( float(Ptr[0]), float(Ptr[1]), float(Ptr[2]), float(Ptr[3]) )
 */
//#define VectorLoadByte4( Ptr )			_mm_cvtpu8_ps( *((__m64*)Ptr) )

/**
 * Loads 4 BYTEs from unaligned memory and converts them into 4 FLOATs in reversed order.
 * IMPORTANT: You need to call VectorResetFloatRegisters() before using scalar FLOATs after you've used this intrinsic!
 *
 * @param Ptr			Unaligned memory pointer to the 4 BYTEs.
 * @return				VectorRegister( float(Ptr[3]), float(Ptr[2]), float(Ptr[1]), float(Ptr[0]) )
 */
FORCEINLINE VectorRegister VectorLoadByte4Reverse( void* Ptr )
{
	VectorRegister Temp = _mm_cvtpu8_ps( *((__m64*)Ptr) );
	return _mm_shuffle_ps( Temp, Temp, SHUFFLEMASK(3,2,1,0) );
}

/**
 * Returns non-zero if any component in Vec1 is greater than the corresponding component in Vec2, otherwise 0.
 *
 * @param Vec1			1st source vector
 * @param Vec2			2nd source vector
 * @return				Non-zero integer if (Vec1.x > Vec2.x) || (Vec1.y > Vec2.y) || (Vec1.z > Vec2.z) || (Vec1.w > Vec2.w)
 */
#define VectorAnyGreaterThan( Vec1, Vec2 )		_mm_movemask_ps( _mm_cmpgt_ps(Vec1, Vec2) )

/**
 * Returns non-zero if all components in Vec1 are greater than the corresponding components in Vec2, otherwise 0.
 *
 * @param Vec1			1st source vector
 * @param Vec2			2nd source vector
 * @return				Non-zero integer if (Vec1.x > Vec2.x) && (Vec1.y > Vec2.y) && (Vec1.z > Vec2.z) && (Vec1.w > Vec2.w)
 */
#define VectorAllGreaterThan( Vec1, Vec2 )		(!_mm_movemask_ps( _mm_cmple_ps(Vec1, Vec2) ))

/**
 * Returns non-zero if any component in Vec1 is less than the corresponding component in Vec2, otherwise 0.
 *
 * @param Vec1			1st source vector
 * @param Vec2			2nd source vector
 * @return				Non-zero integer if (Vec1.x < Vec2.x) || (Vec1.y < Vec2.y) || (Vec1.z < Vec2.z) || (Vec1.w < Vec2.w)
 */
#define VectorAnyLessThan( Vec1, Vec2 )		_mm_movemask_ps( _mm_cmplt_ps(Vec1, Vec2) )

/**
 * Returns non-zero if all components in Vec1 are less than the corresponding components in Vec2, otherwise 0.
 *
 * @param Vec1			1st source vector
 * @param Vec2			2nd source vector
 * @return				Non-zero integer if (Vec1.x < Vec2.x) && (Vec1.y < Vec2.y) && (Vec1.z < Vec2.z) && (Vec1.w < Vec2.w)
 */
#define VectorAllLessThan( Vec1, Vec2 )		(!_mm_movemask_ps( _mm_cmpge_ps(Vec1, Vec2) ))

/**
 * These functions return a vector mask to indicate which components pass the comparison.
 * Each component is 0xffffffff if it passes, 0x00000000 if it fails.
 *
 * @param Vec1			1st source vector
 * @param Vec2			2nd source vector
 * @return				Vector with a mask for each component.
 */
#define VectorMask_LT( Vec1, Vec2 )			_mm_cmplt_ps(Vec1, Vec2)
#define VectorMask_LE( Vec1, Vec2 )			_mm_cmple_ps(Vec1, Vec2)
#define VectorMask_GT( Vec1, Vec2 )			_mm_cmpgt_ps(Vec1, Vec2)
#define VectorMask_GE( Vec1, Vec2 )			_mm_cmpge_ps(Vec1, Vec2)
#define VectorMask_EQ( Vec1, Vec2 )			_mm_cmpeq_ps(Vec1, Vec2)
#define VectorMask_NE( Vec1, Vec2 )			_mm_cmpneq_ps(Vec1, Vec2)

/**
 * Returns an integer bit-mask (0x00 - 0x0f) based on the sign-bit for each component in a vector.
 *
 * @param VecMask		Vector
 * @return				Bit 0 = sign(VecMask.x), Bit 1 = sign(VecMask.y), Bit 2 = sign(VecMask.z), Bit 3 = sign(VecMask.w)
 */
#define VectorMaskBits( VecMask )			_mm_movemask_ps( VecMask )

/**
 * Returns the control register.
 *
 * @return			The uint32 control register
 */
#define VectorGetControlRegister()		_mm_getcsr()

/**
 * Sets the control register.
 *
 * @param ControlStatus		The uint32 control status value to set
 */
#define	VectorSetControlRegister(ControlStatus) _mm_setcsr( ControlStatus )

/**
 * Control status bit to round all floating point math results towards zero.
 */
#define VECTOR_ROUND_TOWARD_ZERO		_MM_ROUND_TOWARD_ZERO

// To be continued...


text:
from datetime import datetime, timedelta
from math import ceil

from apscheduler.util import convert_to_datetime, timedelta_seconds

class IntervalTrigger(object):
    def __init__(self, interval, start_date=None):
        if not isinstance(interval, timedelta):
            raise TypeError('interval must be a timedelta')
        if start_date:
            start_date = convert_to_datetime(start_date)

        self.interval = interval
        self.interval_length = timedelta_seconds(self.interval)
        if self.interval_length == 0:
            self.interval = timedelta(seconds=1)
            self.interval_length = 1

        if start_date is None:
            self.start_date = datetime.now() + self.interval
        else:
            self.start_date = convert_to_datetime(start_date)

    def get_next_fire_time(self, start_date):
        if start_date < self.start_date:
            return self.start_date

        timediff_seconds = timedelta_seconds(start_date - self.start_date)
        next_interval_num = int(ceil(timediff_seconds / self.interval_length))
        return self.start_date + self.interval * next_interval_num

    def __str__(self):
        return 'interval[%s]' % str(self.interval)

    def __repr__(self):
        return "<%s (interval=%s, start_date=%s)>" % (
            self.__class__.__name__, repr(self.interval),
            repr(self.start_date))