text:
import typescript from 'rollup-plugin-typescript2'
import pkg from './package.json'

export default {
  input: 'src/index.ts',
  plugins: [
    typescript({
      tsconfig: './src/tsconfig.json'
    })
  ],
  external: ['@most/core', '@most/scheduler'],
  output: [
    {
      file: pkg.main,
      format: 'umd',
      name: 'mostHold',
      sourcemap: true,
      globals: {
        '@most/core': 'mostCore',
        '@most/scheduler': 'mostScheduler'
      }
    },
    {
      file: pkg.module,
      format: 'es',
      sourcemap: true
    }
  ]
}

redpajama_set_name: RedPajamaGithub


text:
<?xml version="1.0"?>
<Document>

	<Sentence>
		<value>Propoxyphene is medicine used to relieve pain.</value>
		<pattern_crowdsource> [[Propoxyphene|C0033493]] is [[medicine|C0013227]] used to relieve [[pain|C0030193]].		</pattern_crowdsource>
		<annotations>
			<annotation>
				<surface-form>Propoxyphene</surface-form>
				<RDF-ID>C0033493</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>medicine</surface-form>
				<RDF-ID>C0013227</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>pain</surface-form>
				<RDF-ID>C0030193</RDF-ID>
			</annotation>
		</annotations>
		<triples>
			<triple>C0033493 ISA C0013227</triple>
			<triple>C0013227 TREATS C0030193</triple>
			<triple>C0033493 TREATS C0030193</triple>
		</triples>
	</Sentence>
	<Sentence>
		<value>The person may receive:  - Activated charcoal  - Airway support, including oxygen, breathing tube through the mouth (intubation),and ventilator (breathing machine)  - Blood and urine tests  - Chest x-ray  - EKG (electrocardiogram, or heart tracing)  - Fluids through the vein (intravenous or IV)  - Laxative  - Medicines to treat symptoms</value>
		<pattern_crowdsource> The person may receive:  - Activated charcoal  - Airway support, including oxygen, breathing tube through the mouth (intubation),and ventilator (breathing machine)  - Blood and urine tests  - Chest x-ray  - EKG (electrocardiogram, or heart tracing)  - Fluids through the vein (intravenous or IV)  - Laxative  - [[Medicines|C0013227]] to treat [[symptoms|C1457887]]		</pattern_crowdsource>
		<annotations>
			<annotation>
				<surface-form>person</surface-form>
				<RDF-ID>C0027361</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>Activated charcoal</surface-form>
				<RDF-ID>C0001275</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>support</surface-form>
				<RDF-ID>C0183683</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>oxygen</surface-form>
				<RDF-ID>C0030054</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>tube</surface-form>
				<RDF-ID>C1561954</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>mouth</surface-form>
				<RDF-ID>C1278910</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>intubation</surface-form>
				<RDF-ID>C0021925</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>breathing</surface-form>
				<RDF-ID>C0035203</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>machine</surface-form>
				<RDF-ID>C0336779</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>Blood</surface-form>
				<RDF-ID>C0005767</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>urine tests</surface-form>
				<RDF-ID>C0042014</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>Chest x-ray</surface-form>
				<RDF-ID>C0039985</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>EKG</surface-form>
				<RDF-ID>C0013798</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>electrocardiogram</surface-form>
				<RDF-ID>C0013798</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>heart</surface-form>
				<RDF-ID>C0018787</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>vein</surface-form>
				<RDF-ID>C0042449</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>intravenous</surface-form>
				<RDF-ID>C0348016</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>Laxative</surface-form>
				<RDF-ID>C0282090</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>Medicines</surface-form>
				<RDF-ID>C0013227</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>symptoms</surface-form>
				<RDF-ID>C1457887</RDF-ID>
			</annotation>
		</annotations>
		<triples>
			<triple>C0013227 TREATS C1457887</triple>
		</triples>
	</Sentence>
	<Sentence>
		<value>If the proper narcotic antagonist (drug to counteract the effects of narcotics) can be given, recovery from an acute overdose occurs within 24 to 48 hours.</value>
		<pattern_crowdsource> If the proper [[narcotic antagonist|C0027410]] ([[drug|C0013227]] to counteract the effects of narcotics) can be given, recovery from an acute overdose occurs within 24 to 48 hours.		</pattern_crowdsource>
		<annotations>
			<annotation>
				<surface-form>narcotic antagonist</surface-form>
				<RDF-ID>C0027410</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>drug</surface-form>
				<RDF-ID>C0013227</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>effects</surface-form>
				<RDF-ID>C1280500</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>narcotics</surface-form>
				<RDF-ID>C0027415</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>recovery</surface-form>
				<RDF-ID>C0237820</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>acute</surface-form>
				<RDF-ID>C0205178</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>overdose</surface-form>
				<RDF-ID>C0029944</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>48 hours</surface-form>
				<RDF-ID>C0439586</RDF-ID>
			</annotation>
		</annotations>
		<triples>
			<triple>C0027410 ISA C0013227</triple>
		</triples>
	</Sentence>

</Document>


text:
/* -*- Mode: C++; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */

/*
 *   Copyright 2013 Zynga 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.
 */
#ifndef SQLITE_PST_H
#define SQLITE_PST_H 1

#include <sqlite3.h>
#include <assert.h>
#include <fcntl.h>
#include <string>
#include <iostream>
#include <sstream>
#include <sys/stat.h>
#include <stdlib.h>
#include <stdio.h>
#include <errno.h>
#include <stdint.h>
#include <string.h>

class PreparedStatement;
class SQLiteDB;

/**
 * A sqlite prepared statement.
 *
 * Note that each bind method returns the number of columns it
 * consumed (allowing you to, for example, bind a std::pair over two
 * columns).
 */
class PreparedStatement {
public:

    /**
     * Construct a prepared statement.
     *
     * @param d the DB where the prepared statement will execute
     * @param query the query to prepare
     */
    PreparedStatement(sqlite3 *d, const char *query);

    /**
     * Clean up.
     */
    ~PreparedStatement();

    /**
     * Bind a string parameter to a binding in this statement.
     *
     * @param pos the binding position (starting at 1)
     * @param s the value to bind
     * @param nbytes number of bytes in the string.
     *
     * @return 1
     */
    int bind(int pos, const char *s, size_t nbytes);

    /**
     * Bind a blob parameter to a binding in this statement.
     *
     * @param pos the binding position (starting at 1)
     * @param s the value to bind
     * @param nbytes number of bytes in the string.
     *
     * @return 1
     */
    int bind_blob(int pos, const char *s, size_t nbytes);

    /**
     * Bind a uint32 value.
     *
     * @param pos the binding position (starting at 1)
     * @param d the value to bind
     */
    int bind(int pos, int d);

    /**
     * Bind a uint64 value.
     *
     * @param pos the binding position (starting at 1)
     * @param d the value to bind
     *
     * @return 1
     */
    int bind64(int pos, uint64_t d);

    /**
     * Return the number of parameters required by this statement.
     */
    size_t paramCount();

    /**
     * Execute a prepared statement that does not return results.
     *
     * @return how many rows were affected
     */
    int execute();

    /**
     * Execute a prepared statement that does return results
     * and/or return the next row.
     *
     * @return true if there are more rows after this one
     */
    bool fetch();

    /**
     * Reset the bindings.
     *
     * Call this before reusing a prepared statement.
     */
    void reset();

    /**
     * Get the value at a given column in the current row.
     *
     * Use this along with fetch.
     *
     * @param x the column number
     * @return the value
     */
    const char *column(int x);

    /**
     * Get the value as a blob from the given column in the current
     * row.
     *
     * Use this along with fetch and column_bytes().
     *
     * @param x the column number
     * @return the value
     */
    const void *column_blob(int x);

    /**
     * Get the number of bytes stored in the given column for the
     * current row.
     *
     * Use this along with fetch and column() or column_blob().
     *
     * @param x the column number
     * @return the number of bytes found
     */
    int column_bytes(int x);

    /**
     * Get the integer valueof the given column at the current row.
     *
     * Use this along with fetch.
     *
     * @param x the column number
     * @return the value
     */
    int column_int(int x);

    /**
     * Get the 64-bit integer value of the given column at the current
     * row.
     *
     * Use this along with fetch.
     *
     * @param x the column number
     * @return the value
     */
    uint64_t column_int64(int x);

private:
    sqlite3      *db;
    sqlite3_stmt *st;
};

class SQLiteDB {

public:
    SQLiteDB(std::string name, int flags);

    void set_journal_mode(std::string mode);

    sqlite3 *getDB();

    void start_transaction();

    void commit_transaction();

    size_t getSize();

    int getVersion();

    void setVersion(int version);

    void closeDB();

    ~SQLiteDB();

private:
    sqlite3 *db;
    int file_fd;
    std::string file;
};

#endif /* SQLITE_PST_H */


text:
@interface PodsDummy_Pods_DTZFloatingActionButton_Example : NSObject
@end
@implementation PodsDummy_Pods_DTZFloatingActionButton_Example
@end


text:
@implementation NimbleStore (Defaults)

+ (NSString *)nb_appName
{
  return [[NSBundle mainBundle] infoDictionary][@"CFBundleDisplayName"];
}

+ (NSString *)nb_defaultStoreName
{
  return [NSString stringWithFormat:@"%@.sqlite", [self nb_appName]];
}

+ (NSString *)nb_applicationDocumentsDirectory
{
  NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
  return ([paths count] > 0) ? [paths objectAtIndex:0] : nil;
}

+ (NSURL *)nb_URLToStoreWithFilename:(NSString *)filename
{
  NSString *fileURL = [NSString localizedStringWithFormat:@"%@/%@", [self.class nb_applicationDocumentsDirectory], filename];
  NSURL *localStoreURL = [NSURL fileURLWithPath:fileURL];
  return localStoreURL;
}

+ (NSURL *)nb_URLForUbiquityContainer
{
  return [[NSFileManager defaultManager] URLForUbiquityContainerIdentifier:nil];
}

+ (NSURL *)nb_iCloudURLToStoreWithFilename:(NSString *)filename
{
  NSString *fileURL = [NSString localizedStringWithFormat:@"%@/%@", [self.class nb_URLForUbiquityContainer], filename];
  NSURL *localStoreURL = [NSURL fileURLWithPath:fileURL];
  return localStoreURL;
}

@end


text:
using d60.Cirqus.Aggregates;
using d60.Cirqus.Events;

namespace d60.Cirqus.Tests.Contracts.Views.Models.GeneralViewManagerTest
{
    public class EventEmitter : AggregateRoot, IEmit<AnEvent>
    {
        public void Apply(AnEvent e)
        {
        }

        public void DoIt()
        {
            Emit(new AnEvent());
        }
    }
}


text:
/**
 * @license
 * SPDX-License-Identifier: Apache-2.0
 */

/** Class for holding element and attribute policies used for sanitization. */
export class SanitizerTable {
  constructor(
      readonly allowedElements: ReadonlySet<string>,
      readonly elementPolicies: ReadonlyMap<string, ElementPolicy>,
      readonly allowedGlobalAttributes: ReadonlySet<string>,
      readonly globalAttributePolicies: ReadonlyMap<string, AttributePolicy>) {}

  isAllowedElement(elementName: string): boolean {
    // Note: `HTMLFormElement`s are always dropped, supporting them is very
    // costly because of the DOM clobberring they can cause. The additional code
    // size required to properly work around DOM clobberring issues is large and
    // shouldn't be put on every user of the sanitizer. Thoroughly review
    // b/210975025 and the CLs linked there before you start allowing form
    // elements.
    return elementName.toLowerCase() !== 'form' &&
        (this.allowedElements.has(elementName) ||
         this.elementPolicies.has(elementName));
  }

  getAttributePolicy(attributeName: string, elementName: string):
      AttributePolicy {
    const elementPolicy = this.elementPolicies.get(elementName);
    if (elementPolicy?.has(attributeName)) {
      return elementPolicy.get(attributeName)!;
    }

    if (this.allowedGlobalAttributes.has(attributeName)) {
      return {policyAction: AttributePolicyAction.KEEP};
    }

    const globalPolicy = this.globalAttributePolicies.get(attributeName);
    return globalPolicy || {policyAction: AttributePolicyAction.DROP};
  }
}

/**
 * Holds information on how to sanitize the attributes of a particular element.
 * An element with an ElementPolicy specified is implicitly kept in the output.
 */
export type ElementPolicy = ReadonlyMap<string, AttributePolicy>;

/**
 * Values derived from
 * https://godoc.corp.google.com/pkg/google3/third_party/safehtml/sanitizer/policy#AttributePolicy
 */
export enum AttributePolicyAction {
  DROP,
  KEEP,
  KEEP_AND_SANITIZE_URL,
  KEEP_AND_NORMALIZE,
  KEEP_AND_SANITIZE_STYLE,
}

/**
 * Holds information on how to sanitize the values of a particular attribute.
 */
export interface AttributePolicy {
  readonly policyAction: AttributePolicyAction;
  // This attribute is only allowed if the attributes (used as the keys in
  // the map) is equal to one of the values in the set.
  readonly conditions?: ReadonlyMap<string, Set<string>>;
}


text:
package org.postgresql.test.jdbc2;

import org.postgresql.test.TestUtil;
import junit.framework.TestCase;
import java.sql.*;
import org.postgresql.core.Encoding;
import java.io.IOException;
import java.util.Arrays;

/*
 * Test case for various encoding problems.
 *
 * Ensure that we can do a round-trip of all server-supported unicode
 * values without trashing them, and that bad encodings are
 * detected.
 */
public class DatabaseEncodingTest extends TestCase
{
    private Connection con;

    public DatabaseEncodingTest(String name)
    {
        super(name);
    }

    private static final int STEP = 100;

    // Set up the fixture for this testcase: a connection to a database with
    // a table for this test.
    protected void setUp() throws Exception
    {
        con = TestUtil.openDB();
        TestUtil.createTable(con,
                             "testdbencoding",
                             "unicode_ordinal integer primary key not null, unicode_string varchar(" + STEP + ")");
        // disabling auto commit makes the test run faster
        // by not committing each insert individually.
        con.setAutoCommit(false);
    }

    // Tear down the fixture for this test case.
    protected void tearDown() throws Exception
    {
        con.setAutoCommit(true);
        TestUtil.dropTable(con, "testdbencoding");
        TestUtil.closeDB(con);
    }

    private static String dumpString(String s) {
        StringBuffer sb = new StringBuffer(s.length() * 6);
        for (int i = 0; i < s.length(); ++i)
        {
            sb.append("\\u");
            char c = s.charAt(i);
            sb.append(Integer.toHexString((c >> 12)&15));
            sb.append(Integer.toHexString((c >> 8)&15));
            sb.append(Integer.toHexString((c >> 4)&15));
            sb.append(Integer.toHexString(c&15));
        }
        return sb.toString();
    }

    public void testEncoding() throws Exception {
        // Check that we have a UTF8 server encoding, or we must skip this test.
        Statement stmt = con.createStatement();
        ResultSet rs = stmt.executeQuery("SELECT getdatabaseencoding()");
        assertTrue(rs.next());

        String dbEncoding = rs.getString(1);
        if (!dbEncoding.equals("UTF8"))
        {
            System.err.println("DatabaseEncodingTest: Skipping UTF8 database tests as test database encoding is " + dbEncoding);
            rs.close();
            return ; // not a UTF8 database.
        }

        rs.close();

        boolean testHighUnicode = TestUtil.haveMinimumServerVersion(con, "8.1");

        // Create data.
        // NB: we avoid d800-dfff as those are reserved for surrogates in UTF-16
        PreparedStatement insert = con.prepareStatement("INSERT INTO testdbencoding(unicode_ordinal, unicode_string) VALUES (?,?)");
        for (int i = 1; i < 0xd800; i += STEP)
        {
            int count = (i + STEP) > 0xd800 ? 0xd800 - i : STEP;
            char[] testChars = new char[count];
            for (int j = 0; j < count; ++j)
                testChars[j] = (char)(i + j);

            String testString = new String(testChars);

            insert.setInt(1, i);
            insert.setString(2, testString);
            assertEquals(1, insert.executeUpdate());
        }

        for (int i = 0xe000; i < 0x10000; i += STEP)
        {
            int count = (i + STEP) > 0x10000 ? 0x10000 - i : STEP;
            char[] testChars = new char[count];
            for (int j = 0; j < count; ++j)
                testChars[j] = (char)(i + j);

            String testString = new String(testChars);

            insert.setInt(1, i);
            insert.setString(2, testString);
            assertEquals(1, insert.executeUpdate());
        }

        if (testHighUnicode) {
            for (int i = 0x10000; i < 0x110000; i += STEP)
            {
                int count = (i + STEP) > 0x110000 ? 0x110000 - i : STEP;
                char[] testChars = new char[count*2];
                for (int j = 0; j < count; ++j) {
                    testChars[j*2]   = (char)(0xd800 + ((i + j - 0x10000) >> 10));
                    testChars[j*2+1] = (char)(0xdc00 + ((i + j - 0x10000) & 0x3ff));
                }

                String testString = new String(testChars);

                insert.setInt(1, i);
                insert.setString(2, testString);

                //System.err.println("Inserting: " + dumpString(testString));

                assertEquals(1, insert.executeUpdate());
            }
        }

        con.commit();

        // Check data.
        stmt.setFetchSize(1);
        rs = stmt.executeQuery("SELECT unicode_ordinal, unicode_string FROM testdbencoding ORDER BY unicode_ordinal");
        for (int i = 1; i < 0xd800; i += STEP)
        {
            assertTrue(rs.next());
            assertEquals(i, rs.getInt(1));

            int count = (i + STEP) > 0xd800 ? 0xd800 - i : STEP;
            char[] testChars = new char[count];
            for (int j = 0; j < count; ++j)
                testChars[j] = (char)(i + j);

            String testString = new String(testChars);

            assertEquals("Test string: " + dumpString(testString), dumpString(testString), dumpString(rs.getString(2)));
        }

        for (int i = 0xe000; i < 0x10000; i += STEP)
        {
            assertTrue(rs.next());
            assertEquals(i, rs.getInt(1));

            int count = (i + STEP) > 0x10000 ? 0x10000 - i : STEP;
            char[] testChars = new char[count];
            for (int j = 0; j < count; ++j)
                testChars[j] = (char)(i + j);

            String testString = new String(testChars);

            assertEquals("Test string: " + dumpString(testString), dumpString(testString), dumpString(rs.getString(2)));
        }

        if (testHighUnicode) {
            for (int i = 0x10000; i < 0x110000; i += STEP)
            {
                assertTrue(rs.next());
                assertEquals(i, rs.getInt(1));

                int count = (i + STEP) > 0x110000 ? 0x110000 - i : STEP;
                char[] testChars = new char[count*2];
                for (int j = 0; j < count; ++j) {
                    testChars[j*2]   = (char)(0xd800 + ((i + j - 0x10000) >> 10));
                    testChars[j*2+1] = (char)(0xdc00 + ((i + j - 0x10000) & 0x3ff));
                }

                String testString = new String(testChars);

                assertEquals("Test string: " + dumpString(testString), dumpString(testString), dumpString(rs.getString(2)));
            }
        }
    }

    public void testUTF8Decode() throws Exception {
        // Tests for our custom UTF-8 decoder.

        Encoding utf8Encoding = Encoding.getJVMEncoding("UTF-8");

        for (int ch = 0; ch < 0x110000; ++ch) {
            if (ch >= 0xd800 && ch < 0xe000)
                continue; // Surrogate range.

            String testString;
            if (ch >= 0x10000) {
                testString = new String(new char[] {
                    (char) (0xd800 + ((ch-0x10000) >> 10)),
                    (char) (0xdc00 + ((ch-0x10000) & 0x3ff)) });
            } else {
                testString = new String(new char[] { (char)ch });
            }

            byte[] jvmEncoding = testString.getBytes("UTF-8");
            String jvmDecoding = new String(jvmEncoding, 0, jvmEncoding.length, "UTF-8");
            String ourDecoding = utf8Encoding.decode(jvmEncoding, 0, jvmEncoding.length);

            assertEquals("Test string: " + dumpString(testString), dumpString(testString), dumpString(jvmDecoding));
            assertEquals("Test string: " + dumpString(testString), dumpString(testString), dumpString(ourDecoding));
        }
    }

    public void testBadUTF8Decode() throws Exception {
        Encoding utf8Encoding = Encoding.getJVMEncoding("UTF-8");

        byte[][] badSequences = new byte[][] {
            // One-byte illegal sequences
            { (byte)0x80 }, // First byte may not be 10xxxxxx

            // Two-byte illegal sequences
            { (byte)0xc0, (byte)0x00 },  // Second byte must be 10xxxxxx
            { (byte)0xc0, (byte)0x80 },  // Can't represent a value < 0x80

            // Three-byte illegal sequences
            { (byte)0xe0, (byte)0x00 },  // Second byte must be 10xxxxxx
            { (byte)0xe0, (byte)0x80, (byte)0x00 },  // Third byte must be 10xxxxxx
            { (byte)0xe0, (byte)0x80, (byte)0x80 },  // Can't represent a value < 0x800
            { (byte)0xed, (byte)0xa0, (byte)0x80 },  // Not allowed to encode the range d800..dfff

            // Four-byte illegal sequences
            { (byte)0xf0, (byte)0x00 },  // Second byte must be 10xxxxxx
            { (byte)0xf0, (byte)0x80, (byte)0x00 },  // Third byte must be 10xxxxxx
            { (byte)0xf0, (byte)0x80, (byte)0x80, (byte)0x00 },  // Fourth byte must be 10xxxxxx
            { (byte)0xf0, (byte)0x80, (byte)0x80, (byte)0x80 },  // Can't represent a value < 0x10000

            // Five-byte illegal sequences
            { (byte)0xf8 }, // Can't have a five-byte sequence.

            // Six-byte illegal sequences
            { (byte)0xfc }, // Can't have a six-byte sequence.

            // Seven-byte illegal sequences
            { (byte)0xfe }, // Can't have a seven-byte sequence.

            // Eigth-byte illegal sequences
            { (byte)0xff }, // Can't have an eight-byte sequence.
        };

        byte[] paddedSequence = new byte[32];
        for (int i = 0; i < badSequences.length; ++i) {
            byte[] sequence = badSequences[i];

            try {
                String str = utf8Encoding.decode(sequence, 0, sequence.length);
                fail("Expected an IOException on sequence " + i + ", but decoded to <" + str + ">");
            } catch (IOException ioe) {
                // Expected exception.
            }

            // Try it with padding.
            Arrays.fill(paddedSequence, (byte)0);
            System.arraycopy(sequence, 0, paddedSequence, 0, sequence.length);

            try {
                String str = utf8Encoding.decode(paddedSequence, 0, paddedSequence.length);
                fail("Expected an IOException on sequence " + i + ", but decoded to <" + str + ">");
            } catch (IOException ioe) {
                // Expected exception.
            }
        }
    }

    public void testTruncatedUTF8Decode() throws Exception {
        Encoding utf8Encoding = Encoding.getJVMEncoding("UTF-8");

        byte[][] shortSequences = new byte[][] {
            { (byte)0xc0 },              // Second byte must be present

            { (byte)0xe0 },              // Second byte must be present
            { (byte)0xe0, (byte)0x80 },  // Third byte must be present

            { (byte)0xf0 },              // Second byte must be present
            { (byte)0xf0, (byte)0x80 },  // Third byte must be present
            { (byte)0xf0, (byte)0x80, (byte)0x80 },  // Fourth byte must be present
        };

        byte[] paddedSequence = new byte[32];
        for (int i = 0; i < shortSequences.length; ++i) {
            byte[] sequence = shortSequences[i];

            try {
                String str = utf8Encoding.decode(sequence, 0, sequence.length);
                fail("Expected an IOException on sequence " + i + ", but decoded to <" + str + ">");
            } catch (IOException ioe) {
                // Expected exception.
            }

            // Try it with padding and a truncated length.
            Arrays.fill(paddedSequence, (byte)0);
            System.arraycopy(sequence, 0, paddedSequence, 0, sequence.length);

            try {
                String str = utf8Encoding.decode(paddedSequence, 0, sequence.length);
                fail("Expected an IOException on sequence " + i + ", but decoded to <" + str + ">");
            } catch (IOException ioe) {
                // Expected exception.
            }
        }
    }
}


text:
import React from 'react';
// import { FormattedMessage } from 'react-intl';
import { Button } from 'react-bootstrap';
// Import Style
import styles from './Footer.css';
import { withBaseIcon } from 'react-icons-kit';
import { facebook, twitter, instagram } from 'react-icons-kit/fa';

const IconGreen32 =
        withBaseIcon({ size: 32, style: { color: '#4caf50' } });

// Import Images
// import bg from './LOGO2.png';

export function Footer() {
  return (

© 2017 · INVESTNAIRA ·

    {/* <FormattedMessage id="twitterMessage" /> : @mern_io */}
      Let's keep the conversation going
         <Button bsStyle="link" href="https://www.facebook.com/investnaira" target="_blank"><IconGreen32 icon={facebook} /></Button>
         <Button bsStyle="link" href="https://www.instagram.com/investnaira" target="_blank"><IconGreen32 icon={instagram} /></Button>
         <Button bsStyle="link" href="https://www.twitter.com/investnaira" target="_blank"><IconGreen32 icon={twitter} /></Button>

  );
}

export default Footer;


text:
import { ModuleWithProviders } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { SpecialitiesListComponent } from './components/list/list.component';
import { SpecialitiesAddComponent } from './components/add/add.component';
import { SpecialitiesEditComponent } from './components/edit/edit.component';

const routes: Routes = [
    {
        path: 'specialities',
        component: SpecialitiesListComponent,
    },
    {
        path: 'specialities/new',
        component: SpecialitiesAddComponent,
    },
    {
        path: 'specialities/:id',
        component: SpecialitiesEditComponent,
    },
];

export const SpecialitiesRoutesModule: ModuleWithProviders = RouterModule.forRoot(routes);


text:
project_path: /web/_project.yaml
book_path: /web/updates/_book.yaml
description: Support for canvas.toBlob set to land in Chrome 50.

{# wf_updated_on: 2016-03-14 #}
{# wf_published_on: 2016-03-14 #}
{# wf_tags: images,performance,workers,chrome50 #}
{# wf_featured_image: /web/updates/images/generic/photo.png #}

# Canvas toBlob() Support Added in Chrome 50 {: .page-title }

{% include "web/_shared/contributors/paullewis.html" %}

The canvas element is getting an upgrade as of Chrome 50: it now supports the `toBlob()` method! This is great news for anyone generating images on the client side, who wants to -- say -- upload them to their server, or store them in IndexedDB for future use.

    function sendImageToServer (canvas, url) {

      function onBlob (blob) {
        var request = new XMLHttpRequest();
        request.open('POST', url);
        request.onload = function (evt) {
          // Blob sent to server.
        }

        request.send(blob);
      }

      canvas.toBlob(onBlob);
    }

Using `toBlob()` is great, because instead of manipulating a base64 encoded string that you get from `toDataURL()`, you can now you work with the encoded binary data directly. It's smaller, and it tends to fit more use-cases than a data URI.

If you're wondering whether you can draw image blobs to another canvas context, the answer is -- in Firefox and Chrome -- yes, absolutely! [You can do this with the `createImageBitmap()` API](./createimagebitmap-in-chrome-50), which is also landing in Chrome 50.


text:
package org.kairosdb.core.health;

import com.google.inject.Binding;
import com.google.inject.Inject;
import com.google.inject.Injector;
import com.google.inject.Key;

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

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

public class HealthCheckServiceImpl implements HealthCheckService
{
	private final List<HealthStatus> checks = new ArrayList<HealthStatus>();

	@Inject
	public HealthCheckServiceImpl(Injector injector)
	{
		checkNotNull(injector);

		Map<Key<?>, Binding<?>> bindings = injector.getAllBindings();

		for (Key<?> key : bindings.keySet())
		{
			Class bindingClass = key.getTypeLiteral().getRawType();
			if (HealthStatus.class.isAssignableFrom(bindingClass))
			{
				checks.add((HealthStatus)injector.getInstance(bindingClass));
			}
		}
	}

	@Override
	public List<HealthStatus> getChecks()
	{
		return Collections.unmodifiableList(checks);
	}
}


text:
using System.Windows;
using Microsoft.Practices.Prism.Modularity;
using Microsoft.Practices.Prism.UnityExtensions;
using Microsoft.Practices.Unity;
using TascheAtWork.Core.Infrastructure;

namespace TascheAtWork.Shell
{
    public class Bootstrapper : UnityBootstrapper
    {

        protected override void InitializeShell()
        {
            base.InitializeShell();

            Application.Current.MainWindow = (Window)Shell;
            Application.Current.MainWindow.Show();
        }

        private void RegisterServices(IUnityContainer container)
        {

        }

        protected override void ConfigureModuleCatalog()
        {
            base.ConfigureModuleCatalog();

            var moduleCatalog = (ModuleCatalog)ModuleCatalog;
//            moduleCatalog.AddModule(typeof(Modules.InitModules));
        }

        /// <summary>
        /// Creates the shell or main window of the application.
        /// </summary>
        /// <returns>The shell of the application.</returns>
        /// <remarks>
        /// If the returned instance is a <see cref="DependencyObject"/>, the
        /// <see cref="Bootstrapper"/> will attach the default <seealso cref="Microsoft.Practices.Composite.Regions.IRegionManager"/> of
        /// the application in its <see cref="Microsoft.Practices.Composite.Presentation.Regions.RegionManager.RegionManagerProperty"/> attached property
        /// in order to be able to add regions by using the <seealso cref="Microsoft.Practices.Composite.Presentation.Regions.RegionManager.RegionNameProperty"/>
        /// attached property from XAML.
        /// </remarks>
        protected override DependencyObject CreateShell()
        {
            return Container.Resolve<MainWindow>();
        }

        /// <summary>
        /// Configures the <see cref="IUnityContainer"/>. May be overwritten in a derived class to add specific
        /// type mappings required by the application.
        /// </summary>

        protected override void ConfigureContainer()
        {
            base.ConfigureContainer();
            ServiceLocator.Container = Container;

            RegisterControlsAndControllers(Container);
            RegisterServices(Container);
        }

        private void RegisterControlsAndControllers(IUnityContainer container)
        {

        }
    }
}


text:
require 'test_helper'

class ExpiryDateTest < Test::Unit::TestCase
  def test_should_be_expired
    last_month = 2.months.ago
    date = CreditCard::ExpiryDate.new(last_month.month, last_month.year)
    assert date.expired?
  end

  def test_today_should_not_be_expired
    today = Time.now
    date = CreditCard::ExpiryDate.new(today.month, today.year)
    assert_false date.expired?
  end

  def test_dates_in_the_future_should_not_be_expired
    next_month = 1.month.from_now
    date = CreditCard::ExpiryDate.new(next_month.month, next_month.year)
    assert_false date.expired?
  end
end


text:
/**
 * @file
 * Seven styles for jQuery UI.
 * Overrides /core/assets/vendor/jquery.ui/themes/base/theme.css.
 */

/**
 * Component containers
 */
.ui-widget {
  background: none;
}
.ui-widget-content {
  border: none;
}

/**
 * Interaction states
 */
.ui-state-default,
.ui-state-hover,
.ui-state-focus,
.ui-state-active {
  outline: 0;
}
.ui-state-active {
  font-weight: bold;
}

/**
 * Interaction cues
 */
.ui-state-highlight,
.ui-widget-content .ui-state-highlight {
  color: #840;
  background: #fe6;
  border: solid 1px #ed5;
}
.ui-state-error,
.ui-widget-content .ui-state-error {
  color: #fff;
  background: #e63;
  border-color: #d52;
}
.ui-state-disabled,
.ui-widget-content .ui-state-disabled {
  opacity: .35;
  filter: Alpha(Opacity=35);
}
.ui-priority-secondary,
.ui-widget-content .ui-priority-secondary {
  opacity: .7;
  filter: Alpha(Opacity=70);
}

/**
 * Icons
 */
/* states and images */
.ui-icon {
  display: block;
  text-indent: -99999px;
  width: 16px;
  height: 16px;
  overflow: hidden;
  background-repeat: no-repeat;
  background-image: url(../../../images/ui-icons-222222-256x240.png);
}
.ui-widget-content .ui-icon,
.ui-widget-header .ui-icon {
  background-image: url(../../../images/ui-icons-222222-256x240.png);
}
.ui-state-default .ui-icon {
  background-image: url(../../../images/ui-icons-888888-256x240.png);
}
.ui-state-hover .ui-icon,
.ui-state-focus .ui-icon,
.ui-state-active .ui-icon {
  background-image: url(../../../images/ui-icons-454545-256x240.png);
}
.ui-state-highlight .ui-icon {
  background-image: url(../../../images/ui-icons-800000-256x240.png);
}
.ui-state-error .ui-icon,
.ui-state-error-text .ui-icon {
  background-image: url(../../../images/ui-icons-ffffff-256x240.png);
}
.ui-widget p .ui-icon {
  margin: 2px 3px 0 0; /* LTR */
}

[dir="rtl"] .ui-widget p .ui-icon {
  margin: 2px 0 0 3px;
}
/* positioning */
.ui-icon-carat-1-ne { background-position: -16px 0; }
.ui-icon-carat-1-e { background-position: -32px 0; }
.ui-icon-carat-1-se { background-position: -48px 0; }
.ui-icon-carat-1-s { background-position: -64px 0; }
.ui-icon-carat-1-sw { background-position: -80px 0; }
.ui-icon-carat-1-w { background-position: -96px 0; }
.ui-icon-carat-1-nw { background-position: -112px 0; }
.ui-icon-carat-2-n-s { background-position: -128px 0; }
.ui-icon-carat-2-e-w { background-position: -144px 0; }
.ui-icon-triangle-1-n { background-position: 0 -16px; }
.ui-icon-triangle-1-ne { background-position: -16px -16px; }
.ui-icon-triangle-1-e { background-position: -32px -16px; }
.ui-icon-triangle-1-se { background-position: -48px -16px; }
.ui-icon-triangle-1-s { background-position: -64px -16px; }
.ui-icon-triangle-1-sw { background-position: -80px -16px; }
.ui-icon-triangle-1-w { background-position: -96px -16px; }
.ui-icon-triangle-1-nw { background-position: -112px -16px; }
.ui-icon-triangle-2-n-s { background-position: -128px -16px; }
.ui-icon-triangle-2-e-w { background-position: -144px -16px; }
.ui-icon-arrow-1-n { background-position: 0 -32px; }
.ui-icon-arrow-1-ne { background-position: -16px -32px; }
.ui-icon-arrow-1-e { background-position: -32px -32px; }
.ui-icon-arrow-1-se { background-position: -48px -32px; }
.ui-icon-arrow-1-s { background-position: -64px -32px; }
.ui-icon-arrow-1-sw { background-position: -80px -32px; }
.ui-icon-arrow-1-w { background-position: -96px -32px; }
.ui-icon-arrow-1-nw { background-position: -112px -32px; }
.ui-icon-arrow-2-n-s { background-position: -128px -32px; }
.ui-icon-arrow-2-ne-sw { background-position: -144px -32px; }
.ui-icon-arrow-2-e-w { background-position: -160px -32px; }
.ui-icon-arrow-2-se-nw { background-position: -176px -32px; }
.ui-icon-arrowstop-1-n { background-position: -192px -32px; }
.ui-icon-arrowstop-1-e { background-position: -208px -32px; }
.ui-icon-arrowstop-1-s { background-position: -224px -32px; }
.ui-icon-arrowstop-1-w { background-position: -240px -32px; }
.ui-icon-arrowthick-1-n { background-position: 0 -48px; }
.ui-icon-arrowthick-1-ne { background-position: -16px -48px; }
.ui-icon-arrowthick-1-e { background-position: -32px -48px; }
.ui-icon-arrowthick-1-se { background-position: -48px -48px; }
.ui-icon-arrowthick-1-s { background-position: -64px -48px; }
.ui-icon-arrowthick-1-sw { background-position: -80px -48px; }
.ui-icon-arrowthick-1-w { background-position: -96px -48px; }
.ui-icon-arrowthick-1-nw { background-position: -112px -48px; }
.ui-icon-arrowthick-2-n-s { background-position: -128px -48px; }
.ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; }
.ui-icon-arrowthick-2-e-w { background-position: -160px -48px; }
.ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; }
.ui-icon-arrowthickstop-1-n { background-position: -192px -48px; }
.ui-icon-arrowthickstop-1-e { background-position: -208px -48px; }
.ui-icon-arrowthickstop-1-s { background-position: -224px -48px; }
.ui-icon-arrowthickstop-1-w { background-position: -240px -48px; }
.ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; }
.ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; }
.ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; }
.ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; }
.ui-icon-arrowreturn-1-w { background-position: -64px -64px; }
.ui-icon-arrowreturn-1-n { background-position: -80px -64px; }
.ui-icon-arrowreturn-1-e { background-position: -96px -64px; }
.ui-icon-arrowreturn-1-s { background-position: -112px -64px; }
.ui-icon-arrowrefresh-1-w { background-position: -128px -64px; }
.ui-icon-arrowrefresh-1-n { background-position: -144px -64px; }
.ui-icon-arrowrefresh-1-e { background-position: -160px -64px; }
.ui-icon-arrowrefresh-1-s { background-position: -176px -64px; }
.ui-icon-arrow-4 { background-position: 0 -80px; }
.ui-icon-arrow-4-diag { background-position: -16px -80px; }
.ui-icon-extlink { background-position: -32px -80px; }
.ui-icon-newwin { background-position: -48px -80px; }
.ui-icon-refresh { background-position: -64px -80px; }
.ui-icon-shuffle { background-position: -80px -80px; }
.ui-icon-transfer-e-w { background-position: -96px -80px; }
.ui-icon-transferthick-e-w { background-position: -112px -80px; }
.ui-icon-folder-collapsed { background-position: 0 -96px; }
.ui-icon-folder-open { background-position: -16px -96px; }
.ui-icon-document { background-position: -32px -96px; }
.ui-icon-document-b { background-position: -48px -96px; }
.ui-icon-note { background-position: -64px -96px; }
.ui-icon-mail-closed { background-position: -80px -96px; }
.ui-icon-mail-open { background-position: -96px -96px; }
.ui-icon-suitcase { background-position: -112px -96px; }
.ui-icon-comment { background-position: -128px -96px; }
.ui-icon-person { background-position: -144px -96px; }
.ui-icon-print { background-position: -160px -96px; }
.ui-icon-trash { background-position: -176px -96px; }
.ui-icon-locked { background-position: -192px -96px; }
.ui-icon-unlocked { background-position: -208px -96px; }
.ui-icon-bookmark { background-position: -224px -96px; }
.ui-icon-tag { background-position: -240px -96px; }
.ui-icon-home { background-position: 0 -112px; }
.ui-icon-flag { background-position: -16px -112px; }
.ui-icon-calendar { background-position: -32px -112px; }
.ui-icon-cart { background-position: -48px -112px; }
.ui-icon-pencil { background-position: -64px -112px; }
.ui-icon-clock { background-position: -80px -112px; }
.ui-icon-disk { background-position: -96px -112px; }
.ui-icon-calculator { background-position: -112px -112px; }
.ui-icon-zoomin { background-position: -128px -112px; }
.ui-icon-zoomout { background-position: -144px -112px; }
.ui-icon-search { background-position: -160px -112px; }
.ui-icon-wrench { background-position: -176px -112px; }
.ui-icon-gear { background-position: -192px -112px; }
.ui-icon-heart { background-position: -208px -112px; }
.ui-icon-star { background-position: -224px -112px; }
.ui-icon-link { background-position: -240px -112px; }
.ui-icon-cancel { background-position: 0 -128px; }
.ui-icon-plus { background-position: -16px -128px; }
.ui-icon-plusthick { background-position: -32px -128px; }
.ui-icon-minus { background-position: -48px -128px; }
.ui-icon-minusthick { background-position: -64px -128px; }
.ui-icon-close { background-position: -80px -128px; }
.ui-icon-closethick { background-position: -96px -128px; }
.ui-icon-key { background-position: -112px -128px; }
.ui-icon-lightbulb { background-position: -128px -128px; }
.ui-icon-scissors { background-position: -144px -128px; }
.ui-icon-clipboard { background-position: -160px -128px; }
.ui-icon-copy { background-position: -176px -128px; }
.ui-icon-contact { background-position: -192px -128px; }
.ui-icon-image { background-position: -208px -128px; }
.ui-icon-video { background-position: -224px -128px; }
.ui-icon-script { background-position: -240px -128px; }
.ui-icon-alert { background-position: 0 -144px; }
.ui-icon-info { background-position: -16px -144px; }
.ui-icon-notice { background-position: -32px -144px; }
.ui-icon-help { background-position: -48px -144px; }
.ui-icon-check { background-position: -64px -144px; }
.ui-icon-bullet { background-position: -80px -144px; }
.ui-icon-radio-off { background-position: -96px -144px; }
.ui-icon-radio-on { background-position: -112px -144px; }
.ui-icon-pin-w { background-position: -128px -144px; }
.ui-icon-pin-s { background-position: -144px -144px; }
.ui-icon-play { background-position: 0 -160px; }
.ui-icon-pause { background-position: -16px -160px; }
.ui-icon-seek-next { background-position: -32px -160px; }
.ui-icon-seek-prev { background-position: -48px -160px; }
.ui-icon-seek-end { background-position: -64px -160px; }
.ui-icon-seek-first { background-position: -80px -160px; }
.ui-icon-stop { background-position: -96px -160px; }
.ui-icon-eject { background-position: -112px -160px; }
.ui-icon-volume-off { background-position: -128px -160px; }
.ui-icon-volume-on { background-position: -144px -160px; }
.ui-icon-power { background-position: 0 -176px; }
.ui-icon-signal-diag { background-position: -16px -176px; }
.ui-icon-signal { background-position: -32px -176px; }
.ui-icon-battery-0 { background-position: -48px -176px; }
.ui-icon-battery-1 { background-position: -64px -176px; }
.ui-icon-battery-2 { background-position: -80px -176px; }
.ui-icon-battery-3 { background-position: -96px -176px; }
.ui-icon-circle-plus { background-position: 0 -192px; }
.ui-icon-circle-minus { background-position: -16px -192px; }
.ui-icon-circle-close { background-position: -32px -192px; }
.ui-icon-circle-triangle-e { background-position: -48px -192px; }
.ui-icon-circle-triangle-s { background-position: -64px -192px; }
.ui-icon-circle-triangle-w { background-position: -80px -192px; }
.ui-icon-circle-triangle-n { background-position: -96px -192px; }
.ui-icon-circle-arrow-e { background-position: -112px -192px; }
.ui-icon-circle-arrow-s { background-position: -128px -192px; }
.ui-icon-circle-arrow-w { background-position: -144px -192px; }
.ui-icon-circle-arrow-n { background-position: -160px -192px; }
.ui-icon-circle-zoomin { background-position: -176px -192px; }
.ui-icon-circle-zoomout { background-position: -192px -192px; }
.ui-icon-circle-check { background-position: -208px -192px; }
.ui-icon-circlesmall-plus { background-position: 0 -208px; }
.ui-icon-circlesmall-minus { background-position: -16px -208px; }
.ui-icon-circlesmall-close { background-position: -32px -208px; }
.ui-icon-squaresmall-plus { background-position: -48px -208px; }
.ui-icon-squaresmall-minus { background-position: -64px -208px; }
.ui-icon-squaresmall-close { background-position: -80px -208px; }
.ui-icon-grip-dotted-vertical { background-position: 0 -224px; }
.ui-icon-grip-dotted-horizontal { background-position: -16px -224px; }
.ui-icon-grip-solid-vertical { background-position: -32px -224px; }
.ui-icon-grip-solid-horizontal { background-position: -48px -224px; }
.ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; }
.ui-icon-grip-diagonal-se { background-position: -80px -224px; }
.ui-icon-carat-1-n { background-position: 0 0; }

/**
 * Accordion
 */
.ui-accordion {
  border: none;
}
.ui-accordion .ui-accordion-header {
  border: solid 1px #ccc;
  text-transform: uppercase;
}
.ui-accordion h3.ui-accordion-header,
#block-system-main h3.ui-accordion-header {
  font-size: 1.1em;
  margin: 10px 0;
}
#block-system-main .ui-accordion h3.ui-state-active,
.ui-accordion h3.ui-state-active {
  margin-bottom: 0;
}
.ui-accordion .ui-accordion-header a {
  display: block;
}
.ui-accordion .ui-accordion-content {
  padding: 1em 2.2em;
  border: solid 1px #ccc;
  border-top: 0;
}

/**
 * Tabs
 */
.ui-tabs {
  padding: 0;
}
.ui-tabs .ui-tabs-nav {
  padding: 5px 10px 4px;
  margin: 0;
  line-height: 20px;
  border-bottom: solid 1px #ccc;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}
.ui-tabs .ui-tabs-nav li {
  padding: 0 1em 0 10px; /* LTR */
  margin: 0;
  list-style: none;
}
[dir="rtl"] .ui-tabs .ui-tabs-nav li {
  padding: 0 10px 0 1em;
}
.ui-tabs .ui-tabs-nav li a {
  float: none;
  padding: 0 10px;
  border-radius: 10px;
}
.ui-tabs .ui-tabs-nav li.ui-tabs-selected a {
  color: #fff;
  background: #666;
  font-weight: normal;
}

/**
 * Overlays
 */
.ui-widget-overlay {
  background: #000;
  opacity: .70;
  filter: Alpha(Opacity=70);
}

/**
 * Slider
 */
.ui-slider {
  border: solid 1px #ccc;
}
.ui-slider .ui-slider-range {
  background: #e4e4e4;
}
.ui-slider .ui-slider-handle {
  border: 1px solid #e4e4e4;
  border-bottom: 1px solid #b4b4b4;
  border-left-color: #D2D2D2;
  border-right-color: #D2D2D2;
  background-color: #e4e4e4;
  border-radius: 4px;
}
.ui-slider a.ui-state-active,
.ui-slider .ui-slider-handle:active {
  background: #666;
  color: #fff;
  border: solid 1px #555;
}

/**
 * Progress Bar
 */
.ui-progressbar {
  background: #e4e4e4;
  height: 1.4em;
}
.ui-progressbar .ui-progressbar-value {
  background: #0072b9 url(../../../../../misc/progress.gif);
  height: 1.5em;
}

/**
 * Date Picker
 */
.ui-datepicker {
  border: none;
}
.ui-datepicker td span, .ui-datepicker td a {
  text-align: center;
}
.ui-datepicker .ui-state-highlight {
  background: #E4E4E4;
  border-color: #D2D2D2;
  color: #000;
}

/**
 * Autocomplete
 */
.ui-autocomplete {
  background: #fff;
  border: 1px solid #ccc;
}

/* Suggestion list */
.ui-autocomplete .ui-menu-item.ui-state-focus,
.autocomplete .ui-menu-item.ui-state-hover {
  background: #0072b9;
  margin: 0;
}
.ui-autocomplete .ui-state-focus a,
.autocomplete .ui-state-hover a {
  color: #fff;
}


text:
<!DOCTYPE frameset SYSTEM "frameset.dtd">
<frameset>
    <note>
        Frames file for 'report' based on first handful of sentences from large
        corpus, plus reference to 'expect' and 'say'
    </note>
    <predicate lemma="report">
        <roleset id="report.01" name="report, tell" vncls="29.1 37.7">
            <roles>
                <role descr="Reporter" n="0">
                    <vnrole vncls="29.1" vntheta="Agent"/>
                    <vnrole vncls="37.7" vntheta="Agent"/>
                </role>
                <role descr="thing reported" n="1">
                    <vnrole vncls="29.1" vntheta="Predicate"/>
                    <vnrole vncls="37.7" vntheta="Topic"/>
                </role>
                <role descr="entity reported to" n="2">
                    <vnrole vncls="29.1" vntheta="Theme"/>
                    <vnrole vncls="37.7" vntheta="Recipient"/>
                </role>
            </roles>

            <example name="just the news">
                <text>
                    Commonwealth Edison reported earnings of $737 million.
                </text>
                <arg n="0">Commonwealth Edison</arg>
                <rel>reported</rel>
                <arg n="1">earnings of $737 million</arg>
            </example>

            <example name="just hearer">
                <text>
                    He will report to Donald Pardus.
                </text>
                <arg n="0">He</arg>
                <rel>report</rel>
                <arg n="2">to Donald Pardus</arg>
            </example>

            <example name="passivized">
                <text>
                    Preliminary findings were reported more than a year ago by the AMA
                </text>
                <arg n="1">Preliminary findings</arg>
                <rel>reported</rel>
                <arg f="TMP" n="M">more than a year ago</arg>
                <arg n="0">(by the AMA)</arg>
            </example>

            <example name="passive extraction">
                <text>
                    Retail sales were reported *trace* slow in most districts.
                </text>
                <arg n="1">[Retail sales] [*trace* slow]</arg>
                <rel>reported</rel>
                <arg f="LOC" n="M">in most districts</arg>
            </example>

            <example name="another passive extraction">
                <text>
                    Hammersmith is reported *trace* to have been sold.
                </text>
                <arg n="1">[Hammersmith] [*trace* to have been sold]</arg>
                <rel>reported</rel>
            </example>

            <example name="untargeted passive">
                <text>
                    This goes past what had been reported *trace=what* before.
                </text>
                <rel>reported</rel>
                <arg n="0">*trace*</arg>
                <arg n="M" f="RCL">what</arg>
                <arg f="TMP" n="M">before</arg>
            </example>

            <example name="fronted">
                <text>
                    [The FBI found evidence for an alien invasion]-1, Agt Mulder reported
                    *trace*-1
                </text>
                <arg n="0">Agt Mulder</arg>
                <rel>reported</rel>
                <arg n="1">*trace*</arg>
            </example>

            <example name="inverted">
                <text>
                    Japanese corporations bought South Dakota, reported *trace* Newsweek.
                </text>
                <rel>reported</rel>
                <arg n="1">*trace* -> Japanese coporations bought South Dakota </arg>
                <arg n="0">Newsweek</arg>
            </example>

            <example name="discourse-connective">
                <text>
                    As *trace-1* reported *trace-2*, John said something stupid again.
                </text>
                <arg n="0">*trace-1*</arg>
                <rel>expected</rel>
                <arg n="1">*trace-2*</arg>
            </example>

            <note>
                (Note: traces don't connect to anything)
            </note>

            <note>
                Note: as with "say", the automatic tagger chooses an embedded S as the
                argument of "report" rather than the S-BAR, even in cases with a
                complementizer ("reported that blah").  To avoid having to change too
                many sentences, we should follow this pattern.
            </note>
        </roleset>
    </predicate>
</frameset>


text:
define(function(require) {
    'use strict';

    var $ = require('jquery');
    var _ = require('underscore');
    var base64 = require('base64');
    var BaseView = require('oroform/js/app/views/select2-view');

    var Select2EmailRecipientsView = BaseView.extend({
        $contextEl: null,
        clearSearch: null,

        events: {
            'change': '_onchange',
            'recipient:add': '_onRecipientAdd',
            'select2-blur': '_onSelect2Blur'
        },

        initialize: function() {
            this.$contextEl = $('[data-ftid=oro_email_email_contexts]');
            this.$el.on('input-widget:init', _.bind(this._onSelect2Init, this));
            this._initEditation();
            Select2EmailRecipientsView.__super__.initialize.apply(this, arguments);
        },

        /**
         * Adds selected recipient in context
         * + mark organization of the recipient as current one
         */
        _onRecipientAdd: function(e, id) {
            var contexts = this.$el.data('contexts');
            var organizations = this.$el.data('organizations');
            if (typeof contexts[id] === 'undefined') {
                return;
            }

            var data = this.$contextEl.inputWidget('data');
            this.$el.data('organization', _.result(organizations, id, null));
            data.push(contexts[id]);
            this.$contextEl.inputWidget('data', data);
        },

        _onchange: function(e) {
            this.$el.valid();
            this.searchChoice.data = {id: '', text: ''};

            var data = this.$contextEl.inputWidget('data');
            if (e.added) {
                this.$el.trigger('recipient:add', e.added.id);
            }

            if (e.removed) {
                var contexts = this.$el.data('contexts');
                if (typeof contexts[e.removed.id] !== 'undefined') {
                    var newData = _.reject(data, function(item) {
                        return item.id === contexts[e.removed.id].id;
                    });
                    this.$contextEl.inputWidget('data', newData);
                }

                if (_.isEmpty(this.$el.inputWidget('data'))) {
                    this.$el.data('organization', null);
                }
            } else {
                this.clearSearch();
            }
        },

        _onSelect2Init: function() {
            var select2 = this.$el.data('select2');
            this.select2 = select2;
            this.searchChoice = this.$el.data('search-choice');

            /**
             * Updates searchChoice value so that if user press enter
             * it will select currently typed text
             * (not custom selected one in case last response wasn't finished or even started)
             */
            select2.search.on('keyup', _.bind(this._onKeyUp, this));
            select2.search.on('paste', _.bind(this._onPaste, this));

            /**
             * It will select currently typed value if enter is pressed
             * in case no response from server was ever received yet for current autocomplete
             */
            select2.selectHighlighted = _.wrap(select2.selectHighlighted, _.bind(this._selectHighlighted, this));
            this.clearSearch = _.bind(select2.clearSearch, select2);
            select2.clearSearch = function() {};
            this.clearSearch();
        },

        _selectHighlighted: function(originalMethod) {
            var val = this.select2.search.val();
            if (val) {
                var id = this._generateId(val);
                var valueExistsAlready = _.some(this.select2.opts.element.inputWidget('data'), function(item) {
                    return id === item.id;
                });

                if (!valueExistsAlready) {
                    this.select2.onSelect({
                        id: id,
                        text: val
                    });
                }
            }
            return originalMethod.apply(this.select2, _.rest(arguments));
        },

        _onKeyUp: function() {
            var val = this._extractItemsFromSearch(true);
            if (!val) {
                return;
            }
            this.searchChoice.data.text = val;
            this.searchChoice.data.id = this._generateId(val);
        },

        _onPaste: function() {
            this.select2.search.one('input', _.bind(function(e) {
                this._extractItemsFromString(e.currentTarget.value);
            }, this));
        },

        _onSelect2Blur: function() {
            if (!this.select2.opened()) {
                this._extractItemsFromSearch();
            }
            this.clearSearch();
        },

        /**
         * Make selected data editable
         */
        _initEditation: function() {
            var $el = this.$el;
            $el.parent('.controls').on('click', '.select2-search-choice', _.bind(function(e) {
                var $choice = $(e.currentTarget);
                this._extractItemsFromSearch();
                $el.one('change', _.bind(function(e) {
                    $el.inputWidget('search', e.removed.text);
                }, this));
                $choice.find('.select2-search-choice-close').click();
            }, this));
        },

        _extractItemsFromSearch: function(withoutLast) {
            var value = $(this.select2.search).val() || '';
            var rest = this._extractItemsFromString(value, withoutLast);
            if (rest && rest !== value) {
                this.select2.externalSearch(rest);
            }
        },

        _extractItemsFromString: function(value, withoutLast) {
            var gate = withoutLast ? 2 : 1;
            var rest = '';
            var splitRegEx = new RegExp('[' + Select2EmailRecipientsView.SEPARATORS.join() + ']');
            var parts = value.split(splitRegEx);
            if (parts.length >= gate) {
                if (withoutLast) {
                    rest = parts.pop();
                }
                var existingIds = _.pluck(this.select2.data(), 'id');
                parts.forEach(_.bind(function(item) {
                    item = item.trim();
                    if (item.length > 0) {
                        var id = this._generateId(item);
                        if (!_.contains(existingIds, id)) {
                            this.select2.onSelect({
                                id: id,
                                text: item
                            }, {noFocus: !withoutLast});
                        }
                    }
                }, this));
            } else {
                rest = value;
            }
            return rest;
        },

        _generateId: function(value) {
            return base64.encode(encodeURIComponent(value));
        }
    }, {
        SEPARATORS: [',', ';']
    });

    return Select2EmailRecipientsView;
});


text:
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <!-- Navigation bar is taller in portrait. -->
    <dimen name="navigation_bar_height">56dp</dimen>
</resources>


text:
#ifndef ARM_COMPUTE_CPU_SOFTMAX_H
#define ARM_COMPUTE_CPU_SOFTMAX_H

#include "arm_compute/core/TensorInfo.h"
#include "arm_compute/core/experimental/Types.h"
#include "src/cpu/ICpuKernel.h"
#include "src/cpu/ICpuOperator.h"
#include "src/cpu/operators/CpuPermute.h"
#include <memory>

namespace arm_compute
{
namespace cpu
{
class CpuLogits1DMaxKernel;
template <bool IS_LOG>
class CpuLogits1DSoftmaxKernel;

/** Basic function to compute a SoftmaxLayer and a Log SoftmaxLayer.
 *
 * Softmax is calculated by :
 * @f[ out = exp((x - max(x)) * beta) / sum(exp((x - max(x)) * beta)) @f]
 *
 * Log Softmax is calculated by :
 * @f[ out = (x - max(x) * beta) - log(\sum{e^{x - max(x) * beta}}) @f]
 *
 * This function runs the following function/kernels:
 * -# If axis is not 0:
 * -# @ref CpuPermute
 * -# @ref kernels::CpuLogits1DMaxKernel
 * -# @ref kernels::CpuLogits1DSoftmaxKernel
 */
template <bool IS_LOG = false>
class CpuSoftmaxGeneric : public ICpuOperator
{
public:
    CpuSoftmaxGeneric();
    /** Set the input and output tensors.
     *
     * @param[in,out] src  Source tensor info. Data types supported: QASYMM8/QASYMM8_SIGNED/F16/F32.
     *                     last value of each row to the nearest multiple.
     * @param[out]    dst  Destination tensor ifo. Data types supported: same as @p input.
     * @param[in]     beta (Optional) A scaling factor for the exponent.
     * @param[in]     axis (Optional) The dimension in which to apply the function. E.g. for input of shape 4x5x6 and
     *                       axis=1, softmax will be applied to 4x6=24 vectors of size 5. Defaults to 0
     */
    void configure(const ITensorInfo *src, ITensorInfo *dst, float beta = 1.0f, int32_t axis = 0);
    /** Static function to check if given info will lead to a valid configuration
     *
     * Similar to @ref CpuSoftmaxGeneric::configure()
     *
     * @return a status
     */
    static Status validate(const ITensorInfo *src, const ITensorInfo *dst, float beta = 1.0f, int32_t axis = 0);

    // Inherited methods overridden:
    void run(ITensorPack &tensors) override;
    experimental::MemoryRequirements workspace() const override;

private:
    enum InternalTensorIdx
    {
        MAX = 0,
        TMP,
        PERMUTED_SRC,
        PERMUTED_DST,
        COUNT
    };

    CpuPermute                  _permute_input;
    CpuPermute                  _permute_output;
    std::unique_ptr<ICPPKernel> _max_kernel;
    std::unique_ptr<ICPPKernel> _softmax_kernel;

    TensorInfo _max;
    TensorInfo _tmp;
    TensorInfo _input_permuted;
    TensorInfo _output_permuted;

    bool                             _needs_permute;
    experimental::MemoryRequirements _aux_mem{};
};
using CpuSoftmax    = CpuSoftmaxGeneric<false>;
using CpuLogSoftmax = CpuSoftmaxGeneric<true>;

} // namespace cpu
} // namespace arm_compute
#endif /* ARM_COMPUTE_CPU_SOFTMAX_H */