text:
/*
 * HTML5 Boilerplate
 *
 * What follows is the result of much research on cross-browser styling.
 * Credit left inline and big thanks to Nicolas Gallagher, Jonathan Neal,
 * Kroc Camen, and the H5BP dev community and team.
 */

/* ==========================================================================
   Base styles: opinionated defaults
   ========================================================================== */

html,
button,
input,
select,
textarea {
    color: #222;
}

body {
    font-size: 1em;
    line-height: 1.4;
}

/*
 * Remove text-shadow in selection highlight: h5bp.com/i
 * These selection rule sets have to be separate.
 * Customize the background color to match your design.
 */

::-moz-selection {
    background: #b3d4fc;
    text-shadow: none;
}

::selection {
    background: #b3d4fc;
    text-shadow: none;
}

/*
 * A better looking default horizontal rule
 */

hr {
    display: block;
    height: 1px;
    border: 0;
    border-top: 1px solid #ccc;
    margin: 1em 0;
    padding: 0;
}

/*
 * Remove the gap between images and the bottom of their containers: h5bp.com/i/440
 */

img {
    vertical-align: middle;
}

/*
 * Remove default fieldset styles.
 */

fieldset {
    border: 0;
    margin: 0;
    padding: 0;
}

/*
 * Allow only vertical resizing of textareas.
 */

textarea {
    resize: vertical;
}

/* ==========================================================================
   Chrome Frame prompt
   ========================================================================== */

.chromeframe {
    margin: 0.2em 0;
    background: #ccc;
    color: #000;
    padding: 0.2em 0;
}

/* ==========================================================================
   Author's custom styles
   ========================================================================== */

/* ==========================================================================
   Helper classes
   ========================================================================== */

/*
 * Image replacement
 */

.ir {
    background-color: transparent;
    border: 0;
    overflow: hidden;
    /* IE 6/7 fallback */
    *text-indent: -9999px;
}

.ir:before {
    content: "";
    display: block;
    width: 0;
    height: 150%;
}

/*
 * Hide from both screenreaders and browsers: h5bp.com/u
 */

.hidden {
    display: none !important;
    visibility: hidden;
}

/*
 * Hide only visually, but have it available for screenreaders: h5bp.com/v
 */

.visuallyhidden {
    border: 0;
    clip: rect(0 0 0 0);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
}

/*
 * Extends the .visuallyhidden class to allow the element to be focusable
 * when navigated to via the keyboard: h5bp.com/p
 */

.visuallyhidden.focusable:active,
.visuallyhidden.focusable:focus {
    clip: auto;
    height: auto;
    margin: 0;
    overflow: visible;
    position: static;
    width: auto;
}

/*
 * Hide visually and from screenreaders, but maintain layout
 */

.invisible {
    visibility: hidden;
}

/*
 * Clearfix: contain floats
 *
 * For modern browsers
 * 1. The space content is one way to avoid an Opera bug when the
 *    `contenteditable` attribute is included anywhere else in the document.
 *    Otherwise it causes space to appear at the top and bottom of elements
 *    that receive the `clearfix` class.
 * 2. The use of `table` rather than `block` is only necessary if using
 *    `:before` to contain the top-margins of child elements.
 */

.clearfix:before,
.clearfix:after {
    content: " "; /* 1 */
    display: table; /* 2 */
}

.clearfix:after {
    clear: both;
}

/*
 * For IE 6/7 only
 * Include this rule to trigger hasLayout and contain floats.
 */

.clearfix {
    *zoom: 1;
}

/* ==========================================================================
   EXAMPLE Media Queries for Responsive Design.
   These examples override the primary ('mobile first') styles.
   Modify as content requires.
   ========================================================================== */

@media only screen and (min-width: 35em) {
    /* Style adjustments for viewports that meet the condition */
}

@media print,
       (-o-min-device-pixel-ratio: 5/4),
       (-webkit-min-device-pixel-ratio: 1.25),
       (min-resolution: 120dpi) {
    /* Style adjustments for high resolution devices */
}

/* ==========================================================================
   Print styles.
   Inlined to avoid required HTTP connection: h5bp.com/r
   ========================================================================== */

@media print {
    * {
        background: transparent !important;
        color: #000 !important; /* Black prints faster: h5bp.com/s */
        box-shadow: none !important;
        text-shadow: none !important;
    }

    a,
    a:visited {
        text-decoration: underline;
    }

    a[href]:after {
        content: " (" attr(href) ")";
    }

    abbr[title]:after {
        content: " (" attr(title) ")";
    }

    /*
     * Don't show links for images, or javascript/internal links
     */

    .ir a:after,
    a[href^="javascript:"]:after,
    a[href^="#"]:after {
        content: "";
    }

    pre,
    blockquote {
        border: 1px solid #999;
        page-break-inside: avoid;
    }

    thead {
        display: table-header-group; /* h5bp.com/t */
    }

    tr,
    img {
        page-break-inside: avoid;
    }

    img {
        max-width: 100% !important;
    }

    @page {
        margin: 0.5cm;
    }

    p,
    h2,
    h3 {
        orphans: 3;
        widows: 3;
    }

    h2,
    h3 {
        page-break-after: avoid;
    }
}

* {
    box-sizing:border-box;
    -webkit-box-sizing:border-box;
    -moz-box-sizing:border-box;
}

html,body {
    width:100%;
    height:100%;
}

body {
    background-color:gray;
}

#wrapper {
    width:100%;
    height:100%;
    position:relative;
}

#container {
    position:absolute;
    top:0;
    right:0;
    bottom:0;
    left:0;
    margin:auto;
    width:0;
    height:0;
}

.dot {
    position:absolute;

    -webkit-border-radius: 999px;
    -moz-border-radius: 999px;
    border-radius: 999px;

    width:20px;
    height:20px;
    background:black;

    cursor:pointer;

    -moz-transition:left 2s, top 2s, width 0.3s, height 0.3s;
    -webkit-transition:left 2s, top 2s, width 0.3s, height 0.3s;
    -o-transition:left 2s, top 2s, width 0.3s, height 0.3s;
    transition:left 2s, top 2s, width 0.3s, height 0.3s;
}

.dot.active {
    background-color:white;
    z-index:1;
}

.dot.selected {
    border:2px solid green;
}

.dot.active.selected {
    width:30px;
    height:30px;
}


text:
package org.apache.hadoop.hdfs.server.blockmanagement;

import org.apache.hadoop.classification.InterfaceAudience;
import org.apache.hadoop.fs.StorageType;
import org.apache.hadoop.hdfs.protocol.DatanodeInfo;
import org.apache.hadoop.net.Node;
import org.apache.hadoop.net.NodeBase;

import java.util.*;

/**
 * The class is responsible for choosing the desired number of targets
 * for placing block replicas.
 * The strategy is that it tries its best to place the replicas to most racks.
 */
@InterfaceAudience.Private
public class BlockPlacementPolicyRackFaultTolerant extends BlockPlacementPolicyDefault {

  @Override
  protected int[] getMaxNodesPerRack(int numOfChosen, int numOfReplicas) {
    int clusterSize = clusterMap.getNumOfLeaves();
    int totalNumOfReplicas = numOfChosen + numOfReplicas;
    if (totalNumOfReplicas > clusterSize) {
      numOfReplicas -= (totalNumOfReplicas-clusterSize);
      totalNumOfReplicas = clusterSize;
    }
    // No calculation needed when there is only one rack or picking one node.
    int numOfRacks = clusterMap.getNumOfRacks();
    // HDFS-14527 return default when numOfRacks = 0 to avoid
    // ArithmeticException when calc maxNodesPerRack at following logic.
    if (numOfRacks <= 1 || totalNumOfReplicas <= 1) {
      return new int[] {numOfReplicas, totalNumOfReplicas};
    }
    // If more racks than replicas, put one replica per rack.
    if (totalNumOfReplicas < numOfRacks) {
      return new int[] {numOfReplicas, 1};
    }
    // If more replicas than racks, evenly spread the replicas.
    // This calculation rounds up.
    int maxNodesPerRack = (totalNumOfReplicas - 1) / numOfRacks + 1;
    return new int[] {numOfReplicas, maxNodesPerRack};
  }

  /**
   * Choose numOfReplicas in order:
   * 1. If total replica expected is less than numOfRacks in cluster, it choose
   * randomly.
   * 2. If total replica expected is bigger than numOfRacks, it choose:
   *  2a. Fill each rack exactly (maxNodesPerRack-1) replicas.
   *  2b. For some random racks, place one more replica to each one of them,
   *  until numOfReplicas have been chosen.

   * 3. If after step 2, there are still replicas not placed (due to some
   * racks have fewer datanodes than maxNodesPerRack), the rest of the replicas
   * is placed evenly on the rest of the racks who have Datanodes that have
   * not been placed a replica.
   * 4. If after step 3, there are still replicas not placed. A
   * {@link NotEnoughReplicasException} is thrown.
   *

   * For normal setups, step 2 would suffice. So in the end, the difference
   * of the numbers of replicas for each two racks is no more than 1.
   * Either way it always prefer local storage.
   * @return local node of writer
   */
  @Override
  protected Node chooseTargetInOrder(int numOfReplicas,
                                 Node writer,
                                 final Set<Node> excludedNodes,
                                 final long blocksize,
                                 final int maxNodesPerRack,
                                 final List<DatanodeStorageInfo> results,
                                 final boolean avoidStaleNodes,
                                 final boolean newBlock,
                                 EnumMap<StorageType, Integer> storageTypes)
                                 throws NotEnoughReplicasException {
    int totalReplicaExpected = results.size() + numOfReplicas;
    int numOfRacks = clusterMap.getNumOfRacks();
    if (totalReplicaExpected < numOfRacks ||
        totalReplicaExpected % numOfRacks == 0) {
      writer = chooseOnce(numOfReplicas, writer, excludedNodes, blocksize,
          maxNodesPerRack, results, avoidStaleNodes, storageTypes);
      return writer;
    }

    assert totalReplicaExpected > (maxNodesPerRack -1) * numOfRacks;

    // Calculate numOfReplicas for filling each rack exactly (maxNodesPerRack-1)
    // replicas.
    HashMap<String, Integer> rackCounts = new HashMap<>();
    for (DatanodeStorageInfo dsInfo : results) {
      String rack = dsInfo.getDatanodeDescriptor().getNetworkLocation();
      Integer count = rackCounts.get(rack);
      if (count != null) {
        rackCounts.put(rack, count + 1);
      } else {
        rackCounts.put(rack, 1);
      }
    }
    int excess = 0; // Sum of the above (maxNodesPerRack-1) part of nodes in results
    for (int count : rackCounts.values()) {
      if (count > maxNodesPerRack -1) {
        excess += count - (maxNodesPerRack -1);
      }
    }
    numOfReplicas = Math.min(totalReplicaExpected - results.size(),
        (maxNodesPerRack -1) * numOfRacks - (results.size() - excess));

    try {
      // Try to spread the replicas as evenly as possible across racks.
      // This is done by first placing with (maxNodesPerRack-1), then spreading
      // the remainder by calling again with maxNodesPerRack.
      writer = chooseOnce(numOfReplicas, writer, new HashSet<>(excludedNodes),
          blocksize, maxNodesPerRack - 1, results, avoidStaleNodes,
          storageTypes);

      // Exclude the chosen nodes
      for (DatanodeStorageInfo resultStorage : results) {
        addToExcludedNodes(resultStorage.getDatanodeDescriptor(),
            excludedNodes);
      }
      LOG.trace("Chosen nodes: {}", results);
      LOG.trace("Excluded nodes: {}", excludedNodes);

      numOfReplicas = totalReplicaExpected - results.size();
      chooseOnce(numOfReplicas, writer, excludedNodes, blocksize,
          maxNodesPerRack, results, avoidStaleNodes, storageTypes);
    } catch (NotEnoughReplicasException e) {
      LOG.warn("Only able to place {} of total expected {}"
              + " (maxNodesPerRack={}, numOfReplicas={}) nodes "
              + "evenly across racks, falling back to evenly place on the "
              + "remaining racks. This may not guarantee rack-level fault "
              + "tolerance. Please check if the racks are configured properly.",
          results.size(), totalReplicaExpected, maxNodesPerRack, numOfReplicas);
      LOG.debug("Caught exception was:", e);
      chooseEvenlyFromRemainingRacks(writer, excludedNodes, blocksize,
          maxNodesPerRack, results, avoidStaleNodes, storageTypes,
          totalReplicaExpected, e);

    }

    return writer;
  }

  /**
   * Choose as evenly as possible from the racks which have available datanodes.
   */
  private void chooseEvenlyFromRemainingRacks(Node writer,
      Set<Node> excludedNodes, long blocksize, int maxNodesPerRack,
      List<DatanodeStorageInfo> results, boolean avoidStaleNodes,
      EnumMap<StorageType, Integer> storageTypes, int totalReplicaExpected,
      NotEnoughReplicasException e) throws NotEnoughReplicasException {
    int numResultsOflastChoose = 0;
    NotEnoughReplicasException lastException = e;
    int bestEffortMaxNodesPerRack = maxNodesPerRack;
    while (results.size() != totalReplicaExpected &&
        numResultsOflastChoose != results.size()) {
      // Exclude the chosen nodes
      final Set<Node> newExcludeNodes = new HashSet<>();
      for (DatanodeStorageInfo resultStorage : results) {
        addToExcludedNodes(resultStorage.getDatanodeDescriptor(),
            newExcludeNodes);
      }

      LOG.trace("Chosen nodes: {}", results);
      LOG.trace("Excluded nodes: {}", excludedNodes);
      LOG.trace("New Excluded nodes: {}", newExcludeNodes);
      final int numOfReplicas = totalReplicaExpected - results.size();
      numResultsOflastChoose = results.size();
      try {
        chooseOnce(numOfReplicas, writer, newExcludeNodes, blocksize,
            ++bestEffortMaxNodesPerRack, results, avoidStaleNodes,
            storageTypes);
      } catch (NotEnoughReplicasException nere) {
        lastException = nere;
      } finally {
        excludedNodes.addAll(newExcludeNodes);
      }
    }

    if (numResultsOflastChoose != totalReplicaExpected) {
      LOG.debug("Best effort placement failed: expecting {} replicas, only "
          + "chose {}.", totalReplicaExpected, numResultsOflastChoose);
      throw lastException;
    }
  }

  /**
   * Randomly choose numOfReplicas targets from the given scope.
   * Except that 1st replica prefer local storage.
   * @return local node of writer.
   */
  private Node chooseOnce(int numOfReplicas,
                            Node writer,
                            final Set<Node> excludedNodes,
                            final long blocksize,
                            final int maxNodesPerRack,
                            final List<DatanodeStorageInfo> results,
                            final boolean avoidStaleNodes,
                            EnumMap<StorageType, Integer> storageTypes)
                            throws NotEnoughReplicasException {
    if (numOfReplicas == 0) {
      return writer;
    }
    writer = chooseLocalStorage(writer, excludedNodes, blocksize,
        maxNodesPerRack, results, avoidStaleNodes, storageTypes, true)
        .getDatanodeDescriptor();
    if (--numOfReplicas == 0) {
      return writer;
    }
    chooseRandom(numOfReplicas, NodeBase.ROOT, excludedNodes, blocksize,
        maxNodesPerRack, results, avoidStaleNodes, storageTypes);
    return writer;
  }

  @Override
  public BlockPlacementStatus verifyBlockPlacement(DatanodeInfo[] locs,
      int numberOfReplicas) {
    if (locs == null)
      locs = DatanodeDescriptor.EMPTY_ARRAY;
    if (!clusterMap.hasClusterEverBeenMultiRack()) {
      // only one rack
      return new BlockPlacementStatusDefault(1, 1, 1);
    }
    // 1. Check that all locations are different.
    // 2. Count locations on different racks.
    Set<String> racks = new TreeSet<>();
    for (DatanodeInfo dn : locs) {
      racks.add(dn.getNetworkLocation());
    }
    return new BlockPlacementStatusDefault(racks.size(), numberOfReplicas,
        clusterMap.getNumOfRacks());
  }

  @Override
  protected Collection<DatanodeStorageInfo> pickupReplicaSet(
      Collection<DatanodeStorageInfo> moreThanOne,
      Collection<DatanodeStorageInfo> exactlyOne,
      Map<String, List<DatanodeStorageInfo>> rackMap) {
    return moreThanOne.isEmpty() ? exactlyOne : moreThanOne;
  }
}

redpajama_set_name: RedPajamaGithub


text: See https://github.com/matthiasnoback/doctrine-orm-value-object


text:
/*
 * 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.
 */
/*
 * This code was generated by https://github.com/googleapis/google-api-java-client-services/
 * Modify at your own risk.
 */

package com.google.api.services.androidpublisher.model;

/**
 * Download metadata for an asset pack slice.
 *
 *
 This is the Java data model class that specifies how to parse/serialize into the JSON that is
 * transmitted over HTTP when working with the Google Play Android Developer API. For a detailed
 * explanation see:
 * https://developers.google.com/api-client-library/java/google-http-java-client/json
 *

 *
 * @author Google, Inc.
 */
@SuppressWarnings("javadoc")
public final class GeneratedAssetPackSlice extends com.google.api.client.json.GenericJson {

  /**
   * Download ID, which uniquely identifies the APK to download. Should be supplied to
   * `generatedapks.download` method.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String downloadId;

  /**
   * Name of the module that this asset slice belongs to.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String moduleName;

  /**
   * Asset slice ID.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String sliceId;

  /**
   * Asset module version.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key @com.google.api.client.json.JsonString
  private java.lang.Long version;

  /**
   * Download ID, which uniquely identifies the APK to download. Should be supplied to
   * `generatedapks.download` method.
   * @return value or {@code null} for none
   */
  public java.lang.String getDownloadId() {
    return downloadId;
  }

  /**
   * Download ID, which uniquely identifies the APK to download. Should be supplied to
   * `generatedapks.download` method.
   * @param downloadId downloadId or {@code null} for none
   */
  public GeneratedAssetPackSlice setDownloadId(java.lang.String downloadId) {
    this.downloadId = downloadId;
    return this;
  }

  /**
   * Name of the module that this asset slice belongs to.
   * @return value or {@code null} for none
   */
  public java.lang.String getModuleName() {
    return moduleName;
  }

  /**
   * Name of the module that this asset slice belongs to.
   * @param moduleName moduleName or {@code null} for none
   */
  public GeneratedAssetPackSlice setModuleName(java.lang.String moduleName) {
    this.moduleName = moduleName;
    return this;
  }

  /**
   * Asset slice ID.
   * @return value or {@code null} for none
   */
  public java.lang.String getSliceId() {
    return sliceId;
  }

  /**
   * Asset slice ID.
   * @param sliceId sliceId or {@code null} for none
   */
  public GeneratedAssetPackSlice setSliceId(java.lang.String sliceId) {
    this.sliceId = sliceId;
    return this;
  }

  /**
   * Asset module version.
   * @return value or {@code null} for none
   */
  public java.lang.Long getVersion() {
    return version;
  }

  /**
   * Asset module version.
   * @param version version or {@code null} for none
   */
  public GeneratedAssetPackSlice setVersion(java.lang.Long version) {
    this.version = version;
    return this;
  }

  @Override
  public GeneratedAssetPackSlice set(String fieldName, Object value) {
    return (GeneratedAssetPackSlice) super.set(fieldName, value);
  }

  @Override
  public GeneratedAssetPackSlice clone() {
    return (GeneratedAssetPackSlice) super.clone();
  }

}


text:
<?php
if (isset($pasal)) {
    $id = $pasal['pasal_id'];
    $TitleValue = $pasal['pasal_title'];
} else {
    $TitleValue = set_value('pasal_title');
}
?>

            Pasal
            <?php echo $operation; ?>

<a href="<?php echo site_url('admin') ?>"> Home

Pasal

<?php echo $operation; ?>

        <?php echo form_open(current_url()); ?>

                        <?php echo validation_errors(); ?>
                        <?php if (isset($pasal)) { ?>
                            <input type="hidden" name="pasal_id" value="<?php echo $pasal['pasal_id']; ?>">
                        <?php } ?>

                            Judul Pasal *
                            <input name="pasal_title" type="text" class="form-control" value="<?php echo $TitleValue ?>" placeholder="Judul Pasal">

*) Kolom wajib diisi.

                        <button type="submit" class="btn btn-flat btn-block btn-success"> Simpan</button>
                        <a href="<?php echo site_url('admin/pasal'); ?>" class="btn btn-flat btn-block btn-info"> Batal
                        <?php if (isset($pasal)) { ?>
                             Hapus
                        <?php } ?>

        <?php echo form_close(); ?>

    <?php if (isset($pasal)) { ?>

                        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                            ×</button>

 Konfirmasi penghapusan

Apakah anda yakin akan menghapus data ini?

                        <?php echo form_open('admin/pasal/delete/' . $pasal['pasal_id']); ?>
                        <input type="hidden" name="delName" value="<?php echo $pasal['pasal_title']; ?>">
                        <button type="button" class="btn btn-danger" data-dismiss="modal"> Batal</button>
                        <button type="submit" class="btn btn-outline"> Hapus</button>
                        <?php echo form_close(); ?>

    <?php } ?>


text:
'use strict';

exports = module.exports = function(app, mongoose) {

    var PagesSchema = new mongoose.Schema({
        name: String,
        url: String
    });

    app.db.model('Pages', PagesSchema);
};


text:
    <meta charset="UTF-8">
    <title>Angular UI Map</title>

    <input type="textbox" ng-model="address">
    <input type="button" value="Geocode" ng-click="codeAddress()">


text:
import * as assert from 'assert';
import { FontStyle } from 'vs/editor/common/encodedTokenAttributes';
import { ColorMap, ExternalThemeTrieElement, ParsedTokenThemeRule, ThemeTrieElementRule, TokenTheme, parseTokenTheme, strcmp } from 'vs/editor/common/languages/supports/tokenization';

suite('Token theme matching', () => {

	test('gives higher priority to deeper matches', () => {
		const theme = TokenTheme.createFromRawTokenTheme([
			{ token: '', foreground: '100000', background: '200000' },
			{ token: 'punctuation.definition.string.begin.html', foreground: '300000' },
			{ token: 'punctuation.definition.string', foreground: '400000' },
		], []);

		const colorMap = new ColorMap();
		colorMap.getId('100000');
		const _B = colorMap.getId('200000');
		colorMap.getId('400000');
		const _D = colorMap.getId('300000');

		const actual = theme._match('punctuation.definition.string.begin.html');

		assert.deepStrictEqual(actual, new ThemeTrieElementRule(FontStyle.None, _D, _B));
	});

	test('can match', () => {
		const theme = TokenTheme.createFromRawTokenTheme([
			{ token: '', foreground: 'F8F8F2', background: '272822' },
			{ token: 'source', background: '100000' },
			{ token: 'something', background: '100000' },
			{ token: 'bar', background: '200000' },
			{ token: 'baz', background: '200000' },
			{ token: 'bar', fontStyle: 'bold' },
			{ token: 'constant', fontStyle: 'italic', foreground: '300000' },
			{ token: 'constant.numeric', foreground: '400000' },
			{ token: 'constant.numeric.hex', fontStyle: 'bold' },
			{ token: 'constant.numeric.oct', fontStyle: 'bold italic underline' },
			{ token: 'constant.numeric.bin', fontStyle: 'bold strikethrough' },
			{ token: 'constant.numeric.dec', fontStyle: '', foreground: '500000' },
			{ token: 'storage.object.bar', fontStyle: '', foreground: '600000' },
		], []);

		const colorMap = new ColorMap();
		const _A = colorMap.getId('F8F8F2');
		const _B = colorMap.getId('272822');
		const _C = colorMap.getId('200000');
		const _D = colorMap.getId('300000');
		const _E = colorMap.getId('400000');
		const _F = colorMap.getId('500000');
		const _G = colorMap.getId('100000');
		const _H = colorMap.getId('600000');

		function assertMatch(scopeName: string, expected: ThemeTrieElementRule): void {
			const actual = theme._match(scopeName);
			assert.deepStrictEqual(actual, expected, 'when matching <<' + scopeName + '>>');
		}

		function assertSimpleMatch(scopeName: string, fontStyle: FontStyle, foreground: number, background: number): void {
			assertMatch(scopeName, new ThemeTrieElementRule(fontStyle, foreground, background));
		}

		function assertNoMatch(scopeName: string): void {
			assertMatch(scopeName, new ThemeTrieElementRule(FontStyle.None, _A, _B));
		}

		// matches defaults
		assertNoMatch('');
		assertNoMatch('bazz');
		assertNoMatch('asdfg');

		// matches source
		assertSimpleMatch('source', FontStyle.None, _A, _G);
		assertSimpleMatch('source.ts', FontStyle.None, _A, _G);
		assertSimpleMatch('source.tss', FontStyle.None, _A, _G);

		// matches something
		assertSimpleMatch('something', FontStyle.None, _A, _G);
		assertSimpleMatch('something.ts', FontStyle.None, _A, _G);
		assertSimpleMatch('something.tss', FontStyle.None, _A, _G);

		// matches baz
		assertSimpleMatch('baz', FontStyle.None, _A, _C);
		assertSimpleMatch('baz.ts', FontStyle.None, _A, _C);
		assertSimpleMatch('baz.tss', FontStyle.None, _A, _C);

		// matches constant
		assertSimpleMatch('constant', FontStyle.Italic, _D, _B);
		assertSimpleMatch('constant.string', FontStyle.Italic, _D, _B);
		assertSimpleMatch('constant.hex', FontStyle.Italic, _D, _B);

		// matches constant.numeric
		assertSimpleMatch('constant.numeric', FontStyle.Italic, _E, _B);
		assertSimpleMatch('constant.numeric.baz', FontStyle.Italic, _E, _B);

		// matches constant.numeric.hex
		assertSimpleMatch('constant.numeric.hex', FontStyle.Bold, _E, _B);
		assertSimpleMatch('constant.numeric.hex.baz', FontStyle.Bold, _E, _B);

		// matches constant.numeric.oct
		assertSimpleMatch('constant.numeric.oct', FontStyle.Bold | FontStyle.Italic | FontStyle.Underline, _E, _B);
		assertSimpleMatch('constant.numeric.oct.baz', FontStyle.Bold | FontStyle.Italic | FontStyle.Underline, _E, _B);

		// matches constant.numeric.bin
		assertSimpleMatch('constant.numeric.bin', FontStyle.Bold | FontStyle.Strikethrough, _E, _B);
		assertSimpleMatch('constant.numeric.bin.baz', FontStyle.Bold | FontStyle.Strikethrough, _E, _B);

		// matches constant.numeric.dec
		assertSimpleMatch('constant.numeric.dec', FontStyle.None, _F, _B);
		assertSimpleMatch('constant.numeric.dec.baz', FontStyle.None, _F, _B);

		// matches storage.object.bar
		assertSimpleMatch('storage.object.bar', FontStyle.None, _H, _B);
		assertSimpleMatch('storage.object.bar.baz', FontStyle.None, _H, _B);

		// does not match storage.object.bar
		assertSimpleMatch('storage.object.bart', FontStyle.None, _A, _B);
		assertSimpleMatch('storage.object', FontStyle.None, _A, _B);
		assertSimpleMatch('storage', FontStyle.None, _A, _B);

		assertSimpleMatch('bar', FontStyle.Bold, _A, _C);
	});
});

suite('Token theme parsing', () => {

	test('can parse', () => {

		const actual = parseTokenTheme([
			{ token: '', foreground: 'F8F8F2', background: '272822' },
			{ token: 'source', background: '100000' },
			{ token: 'something', background: '100000' },
			{ token: 'bar', background: '010000' },
			{ token: 'baz', background: '010000' },
			{ token: 'bar', fontStyle: 'bold' },
			{ token: 'constant', fontStyle: 'italic', foreground: 'ff0000' },
			{ token: 'constant.numeric', foreground: '00ff00' },
			{ token: 'constant.numeric.hex', fontStyle: 'bold' },
			{ token: 'constant.numeric.oct', fontStyle: 'bold italic underline' },
			{ token: 'constant.numeric.dec', fontStyle: '', foreground: '0000ff' },
		]);

		const expected = [
			new ParsedTokenThemeRule('', 0, FontStyle.NotSet, 'F8F8F2', '272822'),
			new ParsedTokenThemeRule('source', 1, FontStyle.NotSet, null, '100000'),
			new ParsedTokenThemeRule('something', 2, FontStyle.NotSet, null, '100000'),
			new ParsedTokenThemeRule('bar', 3, FontStyle.NotSet, null, '010000'),
			new ParsedTokenThemeRule('baz', 4, FontStyle.NotSet, null, '010000'),
			new ParsedTokenThemeRule('bar', 5, FontStyle.Bold, null, null),
			new ParsedTokenThemeRule('constant', 6, FontStyle.Italic, 'ff0000', null),
			new ParsedTokenThemeRule('constant.numeric', 7, FontStyle.NotSet, '00ff00', null),
			new ParsedTokenThemeRule('constant.numeric.hex', 8, FontStyle.Bold, null, null),
			new ParsedTokenThemeRule('constant.numeric.oct', 9, FontStyle.Bold | FontStyle.Italic | FontStyle.Underline, null, null),
			new ParsedTokenThemeRule('constant.numeric.dec', 10, FontStyle.None, '0000ff', null),
		];

		assert.deepStrictEqual(actual, expected);
	});
});

suite('Token theme resolving', () => {

	test('strcmp works', () => {
		const actual = ['bar', 'z', 'zu', 'a', 'ab', ''].sort(strcmp);

		const expected = ['', 'a', 'ab', 'bar', 'z', 'zu'];
		assert.deepStrictEqual(actual, expected);
	});

	test('always has defaults', () => {
		const actual = TokenTheme.createFromParsedTokenTheme([], []);
		const colorMap = new ColorMap();
		const _A = colorMap.getId('000000');
		const _B = colorMap.getId('ffffff');
		assert.deepStrictEqual(actual.getColorMap(), colorMap.getColorMap());
		assert.deepStrictEqual(actual.getThemeTrieElement(), new ExternalThemeTrieElement(new ThemeTrieElementRule(FontStyle.None, _A, _B)));
	});

	test('respects incoming defaults 1', () => {
		const actual = TokenTheme.createFromParsedTokenTheme([
			new ParsedTokenThemeRule('', -1, FontStyle.NotSet, null, null)
		], []);
		const colorMap = new ColorMap();
		const _A = colorMap.getId('000000');
		const _B = colorMap.getId('ffffff');
		assert.deepStrictEqual(actual.getColorMap(), colorMap.getColorMap());
		assert.deepStrictEqual(actual.getThemeTrieElement(), new ExternalThemeTrieElement(new ThemeTrieElementRule(FontStyle.None, _A, _B)));
	});

	test('respects incoming defaults 2', () => {
		const actual = TokenTheme.createFromParsedTokenTheme([
			new ParsedTokenThemeRule('', -1, FontStyle.None, null, null)
		], []);
		const colorMap = new ColorMap();
		const _A = colorMap.getId('000000');
		const _B = colorMap.getId('ffffff');
		assert.deepStrictEqual(actual.getColorMap(), colorMap.getColorMap());
		assert.deepStrictEqual(actual.getThemeTrieElement(), new ExternalThemeTrieElement(new ThemeTrieElementRule(FontStyle.None, _A, _B)));
	});

	test('respects incoming defaults 3', () => {
		const actual = TokenTheme.createFromParsedTokenTheme([
			new ParsedTokenThemeRule('', -1, FontStyle.Bold, null, null)
		], []);
		const colorMap = new ColorMap();
		const _A = colorMap.getId('000000');
		const _B = colorMap.getId('ffffff');
		assert.deepStrictEqual(actual.getColorMap(), colorMap.getColorMap());
		assert.deepStrictEqual(actual.getThemeTrieElement(), new ExternalThemeTrieElement(new ThemeTrieElementRule(FontStyle.Bold, _A, _B)));
	});

	test('respects incoming defaults 4', () => {
		const actual = TokenTheme.createFromParsedTokenTheme([
			new ParsedTokenThemeRule('', -1, FontStyle.NotSet, 'ff0000', null)
		], []);
		const colorMap = new ColorMap();
		const _A = colorMap.getId('ff0000');
		const _B = colorMap.getId('ffffff');
		assert.deepStrictEqual(actual.getColorMap(), colorMap.getColorMap());
		assert.deepStrictEqual(actual.getThemeTrieElement(), new ExternalThemeTrieElement(new ThemeTrieElementRule(FontStyle.None, _A, _B)));
	});

	test('respects incoming defaults 5', () => {
		const actual = TokenTheme.createFromParsedTokenTheme([
			new ParsedTokenThemeRule('', -1, FontStyle.NotSet, null, 'ff0000')
		], []);
		const colorMap = new ColorMap();
		const _A = colorMap.getId('000000');
		const _B = colorMap.getId('ff0000');
		assert.deepStrictEqual(actual.getColorMap(), colorMap.getColorMap());
		assert.deepStrictEqual(actual.getThemeTrieElement(), new ExternalThemeTrieElement(new ThemeTrieElementRule(FontStyle.None, _A, _B)));
	});

	test('can merge incoming defaults', () => {
		const actual = TokenTheme.createFromParsedTokenTheme([
			new ParsedTokenThemeRule('', -1, FontStyle.NotSet, null, 'ff0000'),
			new ParsedTokenThemeRule('', -1, FontStyle.NotSet, '00ff00', null),
			new ParsedTokenThemeRule('', -1, FontStyle.Bold, null, null),
		], []);
		const colorMap = new ColorMap();
		const _A = colorMap.getId('00ff00');
		const _B = colorMap.getId('ff0000');
		assert.deepStrictEqual(actual.getColorMap(), colorMap.getColorMap());
		assert.deepStrictEqual(actual.getThemeTrieElement(), new ExternalThemeTrieElement(new ThemeTrieElementRule(FontStyle.Bold, _A, _B)));
	});

	test('defaults are inherited', () => {
		const actual = TokenTheme.createFromParsedTokenTheme([
			new ParsedTokenThemeRule('', -1, FontStyle.NotSet, 'F8F8F2', '272822'),
			new ParsedTokenThemeRule('var', -1, FontStyle.NotSet, 'ff0000', null)
		], []);
		const colorMap = new ColorMap();
		const _A = colorMap.getId('F8F8F2');
		const _B = colorMap.getId('272822');
		const _C = colorMap.getId('ff0000');
		assert.deepStrictEqual(actual.getColorMap(), colorMap.getColorMap());
		const root = new ExternalThemeTrieElement(new ThemeTrieElementRule(FontStyle.None, _A, _B), {
			'var': new ExternalThemeTrieElement(new ThemeTrieElementRule(FontStyle.None, _C, _B))
		});
		assert.deepStrictEqual(actual.getThemeTrieElement(), root);
	});

	test('same rules get merged', () => {
		const actual = TokenTheme.createFromParsedTokenTheme([
			new ParsedTokenThemeRule('', -1, FontStyle.NotSet, 'F8F8F2', '272822'),
			new ParsedTokenThemeRule('var', 1, FontStyle.Bold, null, null),
			new ParsedTokenThemeRule('var', 0, FontStyle.NotSet, 'ff0000', null),
		], []);
		const colorMap = new ColorMap();
		const _A = colorMap.getId('F8F8F2');
		const _B = colorMap.getId('272822');
		const _C = colorMap.getId('ff0000');
		assert.deepStrictEqual(actual.getColorMap(), colorMap.getColorMap());
		const root = new ExternalThemeTrieElement(new ThemeTrieElementRule(FontStyle.None, _A, _B), {
			'var': new ExternalThemeTrieElement(new ThemeTrieElementRule(FontStyle.Bold, _C, _B))
		});
		assert.deepStrictEqual(actual.getThemeTrieElement(), root);
	});

	test('rules are inherited 1', () => {
		const actual = TokenTheme.createFromParsedTokenTheme([
			new ParsedTokenThemeRule('', -1, FontStyle.NotSet, 'F8F8F2', '272822'),
			new ParsedTokenThemeRule('var', -1, FontStyle.Bold, 'ff0000', null),
			new ParsedTokenThemeRule('var.identifier', -1, FontStyle.NotSet, '00ff00', null),
		], []);
		const colorMap = new ColorMap();
		const _A = colorMap.getId('F8F8F2');
		const _B = colorMap.getId('272822');
		const _C = colorMap.getId('ff0000');
		const _D = colorMap.getId('00ff00');
		assert.deepStrictEqual(actual.getColorMap(), colorMap.getColorMap());
		const root = new ExternalThemeTrieElement(new ThemeTrieElementRule(FontStyle.None, _A, _B), {
			'var': new ExternalThemeTrieElement(new ThemeTrieElementRule(FontStyle.Bold, _C, _B), {
				'identifier': new ExternalThemeTrieElement(new ThemeTrieElementRule(FontStyle.Bold, _D, _B))
			})
		});
		assert.deepStrictEqual(actual.getThemeTrieElement(), root);
	});

	test('rules are inherited 2', () => {
		const actual = TokenTheme.createFromParsedTokenTheme([
			new ParsedTokenThemeRule('', -1, FontStyle.NotSet, 'F8F8F2', '272822'),
			new ParsedTokenThemeRule('var', -1, FontStyle.Bold, 'ff0000', null),
			new ParsedTokenThemeRule('var.identifier', -1, FontStyle.NotSet, '00ff00', null),
			new ParsedTokenThemeRule('constant', 4, FontStyle.Italic, '100000', null),
			new ParsedTokenThemeRule('constant.numeric', 5, FontStyle.NotSet, '200000', null),
			new ParsedTokenThemeRule('constant.numeric.hex', 6, FontStyle.Bold, null, null),
			new ParsedTokenThemeRule('constant.numeric.oct', 7, FontStyle.Bold | FontStyle.Italic | FontStyle.Underline, null, null),
			new ParsedTokenThemeRule('constant.numeric.dec', 8, FontStyle.None, '300000', null),
		], []);
		const colorMap = new ColorMap();
		const _A = colorMap.getId('F8F8F2');
		const _B = colorMap.getId('272822');
		const _C = colorMap.getId('100000');
		const _D = colorMap.getId('200000');
		const _E = colorMap.getId('300000');
		const _F = colorMap.getId('ff0000');
		const _G = colorMap.getId('00ff00');
		assert.deepStrictEqual(actual.getColorMap(), colorMap.getColorMap());
		const root = new ExternalThemeTrieElement(new ThemeTrieElementRule(FontStyle.None, _A, _B), {
			'var': new ExternalThemeTrieElement(new ThemeTrieElementRule(FontStyle.Bold, _F, _B), {
				'identifier': new ExternalThemeTrieElement(new ThemeTrieElementRule(FontStyle.Bold, _G, _B))
			}),
			'constant': new ExternalThemeTrieElement(new ThemeTrieElementRule(FontStyle.Italic, _C, _B), {
				'numeric': new ExternalThemeTrieElement(new ThemeTrieElementRule(FontStyle.Italic, _D, _B), {
					'hex': new ExternalThemeTrieElement(new ThemeTrieElementRule(FontStyle.Bold, _D, _B)),
					'oct': new ExternalThemeTrieElement(new ThemeTrieElementRule(FontStyle.Bold | FontStyle.Italic | FontStyle.Underline, _D, _B)),
					'dec': new ExternalThemeTrieElement(new ThemeTrieElementRule(FontStyle.None, _E, _B)),
				})
			})
		});
		assert.deepStrictEqual(actual.getThemeTrieElement(), root);
	});

	test('custom colors are first in color map', () => {
		const actual = TokenTheme.createFromParsedTokenTheme([
			new ParsedTokenThemeRule('var', -1, FontStyle.NotSet, 'F8F8F2', null)
		], [
			'000000', 'FFFFFF', '0F0F0F'
		]);
		const colorMap = new ColorMap();
		colorMap.getId('000000');
		colorMap.getId('FFFFFF');
		colorMap.getId('0F0F0F');
		colorMap.getId('F8F8F2');
		assert.deepStrictEqual(actual.getColorMap(), colorMap.getColorMap());
	});
});


text:
using Staffinfo.DAL.Models;

namespace Staffinfo.DAL.Mapping
{
    public class ServiceMap: BaseMap<Service>
    {
        public ServiceMap(): base("tbl_Service")
        {
            this.Property(t => t.ServiceName).IsRequired().HasColumnName("ServiceName");
            this.Property(t => t.ServiceShortName).IsOptional().HasColumnName("ServiceShortName");
            this.Property(t => t.ServiceGroupId).IsRequired().HasColumnName("ServiceGroupId");
            this.Property(t => t.Description).IsOptional().HasColumnName("Description");
        }
    }
}


text:
/**
 * Created by dhl on 2016/11/3.
 */
/**
 * Created by dhl on 2016/11/3.
 */
function  createMeg(msg) {
  console.log(msg);
}
function sayHello(){
  console.log("hello world");
}
export default {
  createMeg,sayHello
}


text:
/**
 * @fileoverview Prevent extra closing tags for components without children
 * @author Yannick Croissant
 */

'use strict';

// ------------------------------------------------------------------------------
// Requirements
// ------------------------------------------------------------------------------

const RuleTester = require('eslint').RuleTester;
const rule = require('../../../lib/rules/self-closing-comp');

const parsers = require('../../helpers/parsers');

const parserOptions = {
  ecmaVersion: 2018,
  sourceType: 'module',
  ecmaFeatures: {
    jsx: true,
  },
};

// ------------------------------------------------------------------------------
// Tests
// ------------------------------------------------------------------------------

const ruleTester = new RuleTester({ parserOptions });
ruleTester.run('self-closing-comp', rule, {
  valid: parsers.all([
    {
      code: 'var HelloJohn = <Hello name="John" />;',
    },
    {
      code: 'var HelloJohn = <Hello.Compound name="John" />;',
    },
    {
      code: 'var Profile = <Hello name="John"></Hello>;',
    },
    {
      code: 'var Profile = <Hello.Compound name="John"></Hello.Compound>;',
    },
    {
      code: `
        <Hello>
          <Hello name="John" />
        </Hello>
      `,
    },
    {
      code: `
        <Hello.Compound>
          <Hello.Compound name="John" />
        </Hello.Compound>
      `,
    },
    {
      code: 'var HelloJohn = <Hello name="John"> </Hello>;',
    },
    {
      code: 'var HelloJohn = <Hello.Compound name="John"> </Hello.Compound>;',
    },
    {
      code: 'var HelloJohn = <Hello name="John">        </Hello>;',
    },
    {
      code: 'var HelloJohn = <Hello.Compound name="John">        </Hello.Compound>;',
    },
    {
      code: 'var HelloJohn =

;',
    },
    {
      code: 'var HelloJohn =
{\' \'}
;',
    },
    {
      code: 'var HelloJohn = <Hello name="John"> </Hello>;',
    },
    {
      code: 'var HelloJohn = <Hello.Compound name="John"> </Hello.Compound>;',
    },
    {
      code: 'var HelloJohn = <Hello name="John" />;',
      options: [],
    },
    {
      code: 'var HelloJohn = <Hello.Compound name="John" />;',
      options: [],
    },
    {
      code: 'var Profile = <Hello name="John"></Hello>;',
      options: [],
    },
    {
      code: 'var Profile = <Hello.Compound name="John"></Hello.Compound>;',
      options: [],
    },
    {
      code: `
        <Hello>
          <Hello name="John" />
        </Hello>
      `,
      options: [],
    },
    {
      code: `
        <Hello.Compound>
          <Hello.Compound name="John" />
        </Hello.Compound>
      `,
      options: [],
    },
    {
      code: 'var HelloJohn =

;',
      options: [],
    },
    {
      code: 'var HelloJohn =

;',
      options: [],
    },
    {
      code: 'var HelloJohn =

;',
      options: [],
    },
    {
      code: 'var HelloJohn =
{\' \'}
;',
      options: [],
    },
    {
      code: 'var HelloJohn = <Hello name="John"> </Hello>;',
      options: [],
    },
    {
      code: 'var HelloJohn = <Hello.Compound name="John"> </Hello.Compound>;',
      options: [],
    },
    {
      code: 'var HelloJohn = <Hello name="John"></Hello>;',
      options: [{ component: false }],
    },
    {
      code: 'var HelloJohn = <Hello.Compound name="John"></Hello.Compound>;',
      options: [{ component: false }],
    },
    {
      code: 'var HelloJohn = <Hello name="John">\n</Hello>;',
      options: [{ component: false }],
    },
    {
      code: 'var HelloJohn = <Hello.Compound name="John">\n</Hello.Compound>;',
      options: [{ component: false }],
    },
    {
      code: 'var HelloJohn = <Hello name="John"> </Hello>;',
      options: [{ component: false }],
    },
    {
      code: 'var HelloJohn = <Hello.Compound name="John"> </Hello.Compound>;',
      options: [{ component: false }],
    },
    {
      code: 'var contentContainer =
;',
      options: [{ html: true }],
    },
    {
      code: 'var contentContainer =

;',
      options: [{ html: true }],
    },
    {
      code: `

      `,
      options: [{ html: true }],
    },
  ]),

  invalid: parsers.all([
    {
      code: 'var contentContainer =

;',
      output: 'var contentContainer =
;',
      errors: [{ messageId: 'notSelfClosing' }],
    },
    {
      code: 'var contentContainer =

;',
      output: 'var contentContainer =
;',
      options: [],
      errors: [{ messageId: 'notSelfClosing' }],
    },
    {
      code: 'var HelloJohn = <Hello name="John"></Hello>;',
      output: 'var HelloJohn = <Hello name="John" />;',
      errors: [{ messageId: 'notSelfClosing' }],
    },
    {
      code: 'var CompoundHelloJohn = <Hello.Compound name="John"></Hello.Compound>;',
      output: 'var CompoundHelloJohn = <Hello.Compound name="John" />;',
      errors: [{ messageId: 'notSelfClosing' }],
    },
    {
      code: 'var HelloJohn = <Hello name="John">\n</Hello>;',
      output: 'var HelloJohn = <Hello name="John" />;',
      errors: [{ messageId: 'notSelfClosing' }],
    },
    {
      code: 'var HelloJohn = <Hello.Compound name="John">\n</Hello.Compound>;',
      output: 'var HelloJohn = <Hello.Compound name="John" />;',
      errors: [{ messageId: 'notSelfClosing' }],
    },
    {
      code: 'var HelloJohn = <Hello name="John"></Hello>;',
      output: 'var HelloJohn = <Hello name="John" />;',
      options: [],
      errors: [{ messageId: 'notSelfClosing' }],
    },
    {
      code: 'var HelloJohn = <Hello.Compound name="John"></Hello.Compound>;',
      output: 'var HelloJohn = <Hello.Compound name="John" />;',
      options: [],
      errors: [{ messageId: 'notSelfClosing' }],
    },
    {
      code: 'var HelloJohn = <Hello name="John">\n</Hello>;',
      output: 'var HelloJohn = <Hello name="John" />;',
      options: [],
      errors: [{ messageId: 'notSelfClosing' }],
    },
    {
      code: 'var HelloJohn = <Hello.Compound name="John">\n</Hello.Compound>;',
      output: 'var HelloJohn = <Hello.Compound name="John" />;',
      options: [],
      errors: [{ messageId: 'notSelfClosing' }],
    },
    {
      code: 'var contentContainer =

;',
      output: 'var contentContainer =
;',
      options: [{ html: true }],
      errors: [{ messageId: 'notSelfClosing' }],
    },
    {
      code: 'var contentContainer =
\n
;',
      output: 'var contentContainer =
;',
      options: [{ html: true }],
      errors: [{ messageId: 'notSelfClosing' }],
    },
  ]),
});


text:
var mediaTags = require('jsmediatags')

module.exports = TagReader

function TagReader () {

}

TagReader.prototype.tagsFromFile = function (file, callback) {
  mediaTags.read(file, {
      onSuccess: function(tag) {
        tag = tag.tags

        //https://github.com/aadsm/jsmediatags/issues/13
        if (tag.picture) {
            var base64String = ''
            for (var i = 0; i < tag.picture.data.length; i++) {
                base64String += String.fromCharCode(tag.picture.data[i])
            }
            var base64 = 'data:image/jpeg;base64,' + window.btoa(base64String)
            tag.picture = base64
          } else {
            //TODO: use placeholder image
            tag.picture = null
          }

        var meta = {
          artist: tag.artist,
          title: tag.title,
          cover: tag.picture,

          combinedTitle: tag.title + ' - ' + tag.artist //Here Comes the Sun - The Beatles
        }

        callback(meta)
      },
      onError: function(error) {
        console.log('Error reading MP3 tags: ', error)
        // TODO: call callback with error
      }
    })
}


text:
import Vue from 'vue'
import Vuex from 'vuex'
import appService from '../app.service'
import postsModule from './posts'

Vue.use(Vuex)

const state = {
  isAuthenticated: false
}

const store = new Vuex.Store({
  modules: {
    postsModule
  },
  state,
  getters: {
    isAuthenticated (state) {
      // if necessary, include here extra logic
      return state.isAuthenticated
    }
  },
  actions: {
    logout (context) {
      context.commit('logout')
    },
    login (context, credentials) {
      return new Promise(resolve => {
        appService.login(credentials)
          .then((data) => {
            context.commit('login', data)
            resolve()
          }).catch(() => window.alert('Could not log in!'))
      })
    }
  },
  mutations: {
    logout (state) {
      if (typeof window !== 'undefined') {
        window.localStorage.setItem('token', null)
        window.localStorage.setItem('tokenExpiration', null)
      }
      state.isAuthenticated = false
    },
    login (state, token) {
      if (typeof window !== 'undefined') {
        window.localStorage.setItem('token', token.token)
        window.localStorage.setItem('tokenExpiration', token.expiration)
      }
      state.isAuthenticated = true
    }
  }
})

if (typeof window !== 'undefined') {
  document.addEventListener('DOMContentLoaded', (event) => {
    let expiration = window.localStorage.getItem('tokenExpiration')
    var unixTimestamp = new Date().getTime() / 1000
    if (expiration && parseInt(expiration) - unixTimestamp > 0) {
      // to be very disciplined, you may want to create
      // another mutation for this, and another action
      store.state.isAuthenticated = true
    }
  })
}

export default store


text:
namespace extensions {

const int kPort = 8888;

class SocketsTcpServerApiTest : public ShellApiTest {};

IN_PROC_BROWSER_TEST_F(SocketsTcpServerApiTest, SocketTCPCreateGood) {
  scoped_refptr<api::SocketsTcpServerCreateFunction> socket_create_function(
      new api::SocketsTcpServerCreateFunction());
  scoped_refptr<const Extension> empty_extension(
      ExtensionBuilder("Test").Build());

  socket_create_function->set_extension(empty_extension.get());
  socket_create_function->set_has_callback(true);

  std::unique_ptr<base::Value> result(
      api_test_utils::RunFunctionAndReturnSingleResult(
          socket_create_function.get(), "[]", browser_context()));
  ASSERT_EQ(base::Value::Type::DICTIONARY, result->type());
  std::unique_ptr<base::DictionaryValue> value =
      base::DictionaryValue::From(std::move(result));
  absl::optional<int> socketId = value->FindIntKey("socketId");
  ASSERT_TRUE(socketId);
  ASSERT_TRUE(*socketId > 0);
}

IN_PROC_BROWSER_TEST_F(SocketsTcpServerApiTest, SocketTCPServerExtension) {
  ResultCatcher catcher;
  catcher.RestrictToBrowserContext(browser_context());
  ExtensionTestMessageListener listener("info_please",
                                        ReplyBehavior::kWillReply);
  ASSERT_TRUE(LoadApp("sockets_tcp_server/api"));
  EXPECT_TRUE(listener.WaitUntilSatisfied());
  listener.Reply(base::StringPrintf("tcp_server:127.0.0.1:%d", kPort));

  EXPECT_TRUE(catcher.GetNextResult()) << catcher.message();
}

// Flaky. http://crbug.com/561474
IN_PROC_BROWSER_TEST_F(SocketsTcpServerApiTest,
                       DISABLED_SocketTCPServerUnbindOnUnload) {
  std::string path("sockets_tcp_server/unload");
  ResultCatcher catcher;
  const Extension* extension = LoadApp(path);
  ASSERT_TRUE(extension);
  EXPECT_TRUE(catcher.GetNextResult()) << catcher.message();

  UnloadApp(extension);

  ASSERT_TRUE(LoadApp(path)) << message_;
  EXPECT_TRUE(catcher.GetNextResult()) << catcher.message();
}

}  // namespace extensions


text:
<TITLE>Review for Big Kahuna, The (1999)</TITLE>
<LINK REL="STYLESHEET" TYPE="text/css" HREF="/ramr.css">

Big Kahuna, The (1999)

reviewed by
Steve Rhodes

THE BIG KAHUNA
A film review by Steve Rhodes
Copyright 2000 Steve Rhodes
RATING (0 TO ****):  ***

THE BIG KAHUNA is about a lot of things, including God, friendship and
industrial lubricants.  In short, it's about the meaning of life as seen
from the perspective of two mid-Western, veteran, industrial lubricant
salesmen (Kevin Spacey and Danny DeVito) and a fresh young kid from
research (Peter Facinelli) in town together for a convention.

As directed by John Swanbeck and written by Roger Rueff, based on his
play, THE BIG KAHUNA will immediately remind you of GLENGARRY GLEN ROSS,
adapted by David Mamet from his own play.  Although not as good or as
raunchy the Mamet film/play, THE BIG KAHUNA is no less ambitious.
Sometimes seeming to bite off more than it can chew, the film dares to
ask many questions but provide few answers.

What it does most successfully is showcase Spacey and DeVito's acting
talents.  Getting the flashiest role, Spacey, the grand master of the
art of sarcasm, plays Larry Mann, a salesman who is petrified that they
may not have a grand-enough hospitality suite to lure in "El Kahuna
Grande," their biggest potential client ever.  The quality of their hors
d'oeuvres also troubles him.

With the meatiest part, DeVito plays Phil Cooper, a recently divorced
man who pensively ponders what he really wants to do with his life.
Although his good friend Larry knows that success means making the big
sale, a tired and weary Phil isn't sure anymore about anything.  "You
take guys away from their wives for any length of time, and they don't
know how to behave," Phil says, supposedly talking about the other
conventioneers but probably talking more about himself now that he is
wifeless.

Bob (Facinelli) is the most unusual of the characters and the hardest to
peg.  He is an All-American-boy type, who wears his faithfulness to his
wife on his sleeve.  Appearing to be some sort of born-again Christian,
he feels that it's his obligation to turn conversations, including those
with customers, toward his Lord.  The story, which takes no religious
sides, makes his character the most intriguing and the biggest enigma.
One could easily read into his character that he represents salvation,
but there are other possible interpretations.

"You ought to apply for sainthood, Bob," Larry tells him, mockingly
uncomfortable with Bob's faith.  "Competition isn't as stiff as it used
to be."  A likable cynic, Larry loves to taunt Bob and ridicule religion
in general.  "You don't smoke," Larry says to Phil.  "I don't drink.
And Bob here doesn't lust after women.  Between the three of us here,
we're practically Jesus!"

Basically a filmed play, the movie happens almost entirely in a single
room, which is both a blessing and a curse.  Although it can be
claustrophobic, this approach focuses our attention on the acting and
the script and away from such diversions as supporting characters,
props, camerawork and all of the other trappings of traditional motion
pictures.  Most films would quickly become stuffy with this limiting
approach, but it is a tribute to the sharpness of the acting and the
dialog that THE BIG KAHUNA rarely does.  In fact, it is only when the
director tries to open up the play just a bit by including a few brief
dream sequences that the movie goes seriously awry.

A hard-core non-believer, Larry resists attempts to suggest that life
has a bigger purpose than closing the next big sale.  In one of the
movie's best interchanges, Phil suggests certain possibilities to Larry.
"Strange things happen," Phil tells him in summation.  "No they don't,
not unless they're printed in USA TODAY first."

THE BIG KAHUNA runs a fast 1:30.  It is rated R for language and would
be acceptable for most teenagers.

Email: Steve.Rhodes@InternetReviews.com
Web: http://www.InternetReviews.com

The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).

The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.

Please direct comments/criticisms of the review to relevant newsgroups.

Broken URLs inthe reviews are the responsibility of the author.

The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.

Related links: index of all rec.arts.movies.reviews reviews


text:
package e2e_node

import (
	"fmt"
	"time"

	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
	"k8s.io/kubernetes/pkg/api/v1"
	"k8s.io/kubernetes/test/e2e/framework"

	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"
)

// Eviction Policy is described here:
// https://github.com/kubernetes/kubernetes/blob/master/docs/proposals/kubelet-eviction.md

const (
	postTestConditionMonitoringPeriod = 2 * time.Minute
	evictionPollInterval              = 2 * time.Second
	// pressure conditions often surface after evictions because of delay in propegation of metrics to pressure
	// we wait this period after evictions to make sure that we wait out this delay
	pressureDelay = 20 * time.Second
)

var _ = framework.KubeDescribe("InodeEviction [Slow] [Serial] [Disruptive] [Flaky]", func() {
	f := framework.NewDefaultFramework("inode-eviction-test")

	podTestSpecs := []podTestSpec{
		{
			evictionPriority: 1, // This pod should be evicted before the normal memory usage pod
			pod: v1.Pod{
				ObjectMeta: metav1.ObjectMeta{Name: "container-inode-hog-pod"},
				Spec: v1.PodSpec{
					RestartPolicy: v1.RestartPolicyNever,
					Containers: []v1.Container{
						{
							Image: "gcr.io/google_containers/busybox:1.24",
							Name:  "container-inode-hog-pod",
							Command: []string{
								"sh",
								"-c", // Make 100 billion small files (more than we have inodes)
								"i=0; while [[ $i -lt 100000000000 ]]; do touch smallfile$i.txt; sleep 0.001; i=$((i+=1)); done;",
							},
						},
					},
				},
			},
		},
		{
			evictionPriority: 1, // This pod should be evicted before the normal memory usage pod
			pod: v1.Pod{
				ObjectMeta: metav1.ObjectMeta{Name: "volume-inode-hog-pod"},
				Spec: v1.PodSpec{
					RestartPolicy: v1.RestartPolicyNever,
					Containers: []v1.Container{
						{
							Image: "gcr.io/google_containers/busybox:1.24",
							Name:  "volume-inode-hog-pod",
							Command: []string{
								"sh",
								"-c", // Make 100 billion small files (more than we have inodes)
								"i=0; while [[ $i -lt 100000000000 ]]; do touch /test-empty-dir-mnt/smallfile$i.txt; sleep 0.001; i=$((i+=1)); done;",
							},
							VolumeMounts: []v1.VolumeMount{
								{MountPath: "/test-empty-dir-mnt", Name: "test-empty-dir"},
							},
						},
					},
					Volumes: []v1.Volume{
						{Name: "test-empty-dir", VolumeSource: v1.VolumeSource{EmptyDir: &v1.EmptyDirVolumeSource{}}},
					},
				},
			},
		},
		{
			evictionPriority: 0, // This pod should never be evicted
			pod: v1.Pod{
				ObjectMeta: metav1.ObjectMeta{Name: "normal-memory-usage-pod"},
				Spec: v1.PodSpec{
					RestartPolicy: v1.RestartPolicyNever,
					Containers: []v1.Container{
						{
							Image: "gcr.io/google_containers/busybox:1.24",
							Name:  "normal-memory-usage-pod",
							Command: []string{
								"sh",
								"-c", //make one big (5 Gb) file
								"dd if=/dev/urandom of=largefile bs=5000000000 count=1; while true; do sleep 5; done",
							},
						},
					},
				},
			},
		},
	}
	evictionTestTimeout := 30 * time.Minute
	testCondition := "Disk Pressure due to Inodes"
	// Set the EvictionHard threshold lower to decrease test time
	evictionHardLimit := "nodefs.inodesFree<50%"

	runEvictionTest(f, testCondition, podTestSpecs, evictionHardLimit, evictionTestTimeout, hasInodePressure)
})

// Struct used by runEvictionTest that specifies the pod, and when that pod should be evicted, relative to other pods
type podTestSpec struct {
	// 0 should never be evicted, 1 shouldn't evict before 2, etc.
	// If two are ranked at 1, either is permitted to fail before the other.
	// The test ends when all other than the 0 have been evicted
	evictionPriority int
	pod              v1.Pod
}

// runEvictionTest sets up a testing environment given the provided nodes, and checks a few things:
//		It ensures that the desired testCondition is actually triggered.
//		It ensures that evictionPriority 0 pods are not evicted
//		It ensures that lower evictionPriority pods are always evicted before higher evictionPriority pods (2 evicted before 1, etc.)
//		It ensures that all lower evictionPriority pods are eventually evicted.
// runEvictionTest then cleans up the testing environment by deleting provided nodes, and ensures that testCondition no longer exists
func runEvictionTest(f *framework.Framework, testCondition string, podTestSpecs []podTestSpec, evictionHard string,
	evictionTestTimeout time.Duration, hasPressureCondition func(*framework.Framework, string) (bool, error)) {

	Context(fmt.Sprintf("when we run containers that should cause %s", testCondition), func() {

		tempSetEvictionHard(f, evictionHard)
		BeforeEach(func() {
			By("seting up pods to be used by tests")
			for _, spec := range podTestSpecs {
				By(fmt.Sprintf("creating pod with container: %s", spec.pod.Name))
				f.PodClient().CreateSync(&spec.pod)
			}
		})

		It(fmt.Sprintf("should eventually see %s, and then evict all of the correct pods", testCondition), func() {
			Eventually(func() error {
				hasPressure, err := hasPressureCondition(f, testCondition)
				if err != nil {
					return err
				}
				if hasPressure {
					return nil
				}
				return fmt.Errorf("Condition: %s not encountered", testCondition)
			}, evictionTestTimeout, evictionPollInterval).Should(BeNil())

			Eventually(func() error {
				// Gather current information
				updatedPodList, err := f.ClientSet.Core().Pods(f.Namespace.Name).List(metav1.ListOptions{})
				updatedPods := updatedPodList.Items
				for _, p := range updatedPods {
					framework.Logf("fetching pod %s; phase= %v", p.Name, p.Status.Phase)
				}
				_, err = hasPressureCondition(f, testCondition)
				if err != nil {
					return err
				}

				By("checking eviction ordering and ensuring important pods dont fail")
				done := true
				for _, priorityPodSpec := range podTestSpecs {
					var priorityPod v1.Pod
					for _, p := range updatedPods {
						if p.Name == priorityPodSpec.pod.Name {
							priorityPod = p
						}
					}
					Expect(priorityPod).NotTo(BeNil())

					// Check eviction ordering.
					// Note: it is alright for a priority 1 and priority 2 pod (for example) to fail in the same round
					for _, lowPriorityPodSpec := range podTestSpecs {
						var lowPriorityPod v1.Pod
						for _, p := range updatedPods {
							if p.Name == lowPriorityPodSpec.pod.Name {
								lowPriorityPod = p
							}
						}
						Expect(lowPriorityPod).NotTo(BeNil())
						if priorityPodSpec.evictionPriority < lowPriorityPodSpec.evictionPriority && lowPriorityPod.Status.Phase == v1.PodRunning {
							Expect(priorityPod.Status.Phase).NotTo(Equal(v1.PodFailed),
								fmt.Sprintf("%s pod failed before %s pod", priorityPodSpec.pod.Name, lowPriorityPodSpec.pod.Name))
						}
					}

					// EvictionPriority 0 pods should not fail
					if priorityPodSpec.evictionPriority == 0 {
						Expect(priorityPod.Status.Phase).NotTo(Equal(v1.PodFailed),
							fmt.Sprintf("%s pod failed (and shouldn't have failed)", priorityPod.Name))
					}

					// If a pod that is not evictionPriority 0 has not been evicted, we are not done
					if priorityPodSpec.evictionPriority != 0 && priorityPod.Status.Phase != v1.PodFailed {
						done = false
					}
				}
				if done {
					return nil
				}
				return fmt.Errorf("pods that caused %s have not been evicted.", testCondition)
			}, evictionTestTimeout, evictionPollInterval).Should(BeNil())

			// We observe pressure from the API server.  The eviction manager observes pressure from the kubelet internal stats.
			// This means the eviction manager will observe pressure before we will, creating a delay between when the eviction manager
			// evicts a pod, and when we observe the pressure by querrying the API server.  Add a delay here to account for this delay
			By("making sure pressure from test has surfaced before continuing")
			time.Sleep(pressureDelay)

			By("making sure conditions eventually return to normal")
			Eventually(func() error {
				hasPressure, err := hasPressureCondition(f, testCondition)
				if err != nil {
					return err
				}
				if hasPressure {
					return fmt.Errorf("Conditions havent returned to normal, we still have %s", testCondition)
				}
				return nil
			}, evictionTestTimeout, evictionPollInterval).Should(BeNil())

			By("making sure conditions do not return, and that pods that shouldnt fail dont fail")
			Consistently(func() error {
				hasPressure, err := hasPressureCondition(f, testCondition)
				if err != nil {
					// Race conditions sometimes occur when checking pressure condition due to #38710 (Docker bug)
					// Do not fail the test when this occurs, since this is expected to happen occasionally.
					framework.Logf("Failed to check pressure condition. Error: %v", err)
					return nil
				}
				if hasPressure {
					return fmt.Errorf("%s dissappeared and then reappeared", testCondition)
				}
				// Gather current information
				updatedPodList, _ := f.ClientSet.Core().Pods(f.Namespace.Name).List(metav1.ListOptions{})
				for _, priorityPodSpec := range podTestSpecs {
					// EvictionPriority 0 pods should not fail
					if priorityPodSpec.evictionPriority == 0 {
						for _, p := range updatedPodList.Items {
							if p.Name == priorityPodSpec.pod.Name && p.Status.Phase == v1.PodFailed {
								return fmt.Errorf("%s pod failed (delayed) and shouldn't have failed", p.Name)
							}
						}
					}
				}
				return nil
			}, postTestConditionMonitoringPeriod, evictionPollInterval).Should(BeNil())

			By("making sure we can start a new pod after the test")
			podName := "test-admit-pod"
			f.PodClient().CreateSync(&v1.Pod{
				ObjectMeta: metav1.ObjectMeta{
					Name: podName,
				},
				Spec: v1.PodSpec{
					RestartPolicy: v1.RestartPolicyNever,
					Containers: []v1.Container{
						{
							Image: framework.GetPauseImageNameForHostArch(),
							Name:  podName,
						},
					},
				},
			})
		})

		AfterEach(func() {
			By("deleting pods")
			for _, spec := range podTestSpecs {
				By(fmt.Sprintf("deleting pod: %s", spec.pod.Name))
				f.PodClient().DeleteSync(spec.pod.Name, &metav1.DeleteOptions{}, podDisappearTimeout)
			}

			if CurrentGinkgoTestDescription().Failed {
				if framework.TestContext.DumpLogsOnFailure {
					logPodEvents(f)
					logNodeEvents(f)
				}
				By("sleeping to allow for cleanup of test")
				time.Sleep(postTestConditionMonitoringPeriod)
			}
		})
	})
}

// Returns TRUE if the node has disk pressure due to inodes exists on the node, FALSE otherwise
func hasInodePressure(f *framework.Framework, testCondition string) (bool, error) {

	nodeList, err := f.ClientSet.Core().Nodes().List(metav1.ListOptions{})
	framework.ExpectNoError(err, "getting node list")
	if len(nodeList.Items) != 1 {
		return false, fmt.Errorf("expected 1 node, but see %d. List: %v", len(nodeList.Items), nodeList.Items)
	}

	_, pressure := v1.GetNodeCondition(&nodeList.Items[0].Status, v1.NodeDiskPressure)
	Expect(pressure).NotTo(BeNil())
	hasPressure := pressure.Status == v1.ConditionTrue
	By(fmt.Sprintf("checking if pod has %s: %v", testCondition, hasPressure))

	// Additional Logging relating to Inodes
	summary, err := getNodeSummary()
	if err != nil {
		return false, err
	}
	if summary.Node.Runtime != nil && summary.Node.Runtime.ImageFs != nil && summary.Node.Runtime.ImageFs.Inodes != nil && summary.Node.Runtime.ImageFs.InodesFree != nil {
		framework.Logf("imageFsInfo.Inodes: %d, imageFsInfo.InodesFree: %d", *summary.Node.Runtime.ImageFs.Inodes, *summary.Node.Runtime.ImageFs.InodesFree)
	}
	if summary.Node.Fs != nil && summary.Node.Fs.Inodes != nil && summary.Node.Fs.InodesFree != nil {
		framework.Logf("rootFsInfo.Inodes: %d, rootFsInfo.InodesFree: %d", *summary.Node.Fs.Inodes, *summary.Node.Fs.InodesFree)
	}
	for _, pod := range summary.Pods {
		framework.Logf("Pod: %s", pod.PodRef.Name)
		for _, container := range pod.Containers {
			if container.Rootfs != nil && container.Rootfs.InodesUsed != nil {
				framework.Logf("--- summary Container: %s inodeUsage: %d", container.Name, *container.Rootfs.InodesUsed)
			}
		}
		for _, volume := range pod.VolumeStats {
			if volume.FsStats.InodesUsed != nil {
				framework.Logf("--- summary Volume: %s inodeUsage: %d", volume.Name, *volume.FsStats.InodesUsed)
			}
		}
	}
	return hasPressure, nil
}


text:
const winston = require('winston');
const keys = require('../config/keys');
require('winston-papertrail').Papertrail;

const papertrailEnabled = keys.IS_ENV_PRODUCTION && keys.PAPERTRAIL_HOST && keys.PAPERTRAIL_PORT;

const transports = [];

transports.push(
  new winston.transports.Console({
    colorize: true,
    prettyPrint: true,
  })
);

if (papertrailEnabled) {
  transports.push(
    new winston.transports.Papertrail({
      host: keys.PAPERTRAIL_HOST,
      port: keys.PAPERTRAIL_PORT,
      colorize: true,
    })
  );
}

const logger = new winston.Logger({
  transports: transports,
});

module.exports = logger;


text:
<?php
// Silence is golden. Do not delete this file to keep your inner balance.


text:
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:state_window_focused="false" android:state_enabled="true"
        android:drawable="@drawable/button_bar_default" />
?    <item android:state_window_focused="false" android:state_enabled="false"
        android:drawable="@drawable/button_disabled" />
    <item android:state_pressed="true"
        android:drawable="@drawable/button_pressed" />
    <item android:state_focused="true" android:state_enabled="true"
        android:drawable="@drawable/button_focused" />
    <item android:state_selected="true"
          android:drawable="@drawable/button_pressed" />
    <item android:state_enabled="true"
        android:drawable="@drawable/button_bar_default" />
    <item android:state_focused="true"
        android:drawable="@drawable/button_disabled_focused" />
    <item android:drawable="@drawable/button_disabled" />
</selector>


text:
We are looking for an active maintainers and or someone to take the "bull by the horns" on the project. @nmccready is active on other projects right now and does not have the time to dedicate to this project as needed. Therefore we are looking for some developers who would like to take the lead on this project. It is totally ripe for a rewrite (3.0, and angular 2.0). Email or private msg (gitter) nmccready if interested.

# angular-google-maps

> AngularJS directives for Google Maps

For Pull Requests please see branching scheme below! Realize that PRS to master are for 2.1.X only. If you want it rolled into a 2.0.X release PR to **2.0.X**.

[![Dependencies](https://david-dm.org/angular-ui/angular-google-maps.svg)](https://david-dm.org/angular-ui/angular-google-maps)
[![Dependencies](https://david-dm.org/angular-ui/angular-google-maps/dev-status.svg)](https://david-dm.org/angular-ui/angular-google-maps)

Master (2.1.X): [![Build Status](https://travis-ci.org/angular-ui/angular-google-maps.svg?branch=master)](https://travis-ci.org/angular-ui/angular-google-maps)
2.1.X: [![Build Status](https://travis-ci.org/angular-ui/angular-google-maps.svg?branch=2.1.X)](https://travis-ci.org/angular-ui/angular-google-maps)
2.0.X: [![Build Status](https://travis-ci.org/angular-ui/angular-google-maps.svg?branch=2.0.X)](https://travis-ci.org/angular-ui/angular-google-maps)

task board: [![Stories in Ready](https://badge.waffle.io/angular-ui/angular-google-maps.png?label=ready&title=Ready)](https://waffle.io/angular-ui/angular-google-maps)

[![Gitter chat](https://badges.gitter.im/angular-ui/angular-google-maps.svg)](https://gitter.im/angular-ui/angular-google-maps)

<img src="http://benschwarz.github.io/bower-badges/badge@2x.png?pkgname=angular-google-maps" width="130" height="30">

__________________
## Getting started
This is a set of directives and services for AngularJS `~1.0.7+, ^1.2.2+`.

If you plan to hack on the directives or want to run the example, first thing to do is to install NPM dependencies:

```shell
npm install #note bower install is run on post install
```

* Installing for [Meteor](https://www.meteor.com/) application:

```shell
meteor add angularui:angular-google-maps
```

### Building
To build the library after you made changes, simply run grunt:

```shell
grunt
```

If you get errors from `jshint` or specs, just add the `--force` argument.

### Generating SourceMap(s)
```shell
grunt mappAll
```
This will generate source maps for development (angular-google-maps_dev_mapped.js) (non minified) and source maps to minified
(angular-google-maps_dev_mapped.min.js) files. They each have their own corresponding map files.  To get the coinciding source
files you will need to copy the generated `/tmp` directory (currently not under scc).

### Running the example
To run the example page, just run

```shell
grunt example
```

and open your browser on `http://localhost:3000/example.html`.

### Documentation
The various directives are documented at [official site](http://angular-google-maps.org).

### Contributing

Filing issues:
 Prior to submiting an issue:
- Search open/**closed** issues, src examples (./examples), gitter, and then google plus community! **Again please search!**
- issues w/ plnkrs get attention quicker

Pull requests more than welcome! If you're adding new features, it would be appreciated if you would provide some docs about the feature.
This can be done either by adding a card to our [Waffle.io board](https://waffle.io/angular-ui/angular-google-maps), forking the website
branch and issuing a PR with the updated documentation page, or by opening an issue for us to add the documentation to the site.

### Branching Scheme

- master: points to the active targeted next release branch (2.1.X)
- 2.0.X: latest of 2.0.X
- 2.1.X: ""
... etc


text:
package WordSearch;

import org.junit.Before;
import org.junit.Test;

import static org.assertj.core.api.Assertions.assertThat;

public class WordSearchSolutionTest {

    private WordSearchSolution solution;

    @Before
    public void setUp() throws Exception {
        solution = new WordSearchSolution();
    }

    @Test
    public void testExistCase1() {
        char[][] board = new char[][]{{'A', 'B', 'C', 'E'}, {'S', 'F', 'C', 'S'}, {'A', 'D', 'E', 'E'}};
        String word = "ABCCED";

        boolean exist = solution.exist(board, word);

        assertThat(exist).isTrue();
    }

    @Test
    public void testExistCase2() {
        char[][] board = new char[][]{{'A', 'B', 'C', 'E'}, {'S', 'F', 'C', 'S'}, {'A', 'D', 'E', 'E'}};
        String word = "SEE";

        boolean exist = solution.exist(board, word);

        assertThat(exist).isTrue();
    }

    @Test
    public void testNotExistCase1() {
        char[][] board = new char[][]{{'A', 'B', 'C', 'E'}, {'S', 'F', 'C', 'S'}, {'A', 'D', 'E', 'E'}};
        String word = "WAS";

        boolean exist = solution.exist(board, word);

        assertThat(exist).isFalse();
    }

    @Test
    public void testNotExistCase2_CanNotUseSameLetter() {
        char[][] board = new char[][]{{'A', 'B', 'C', 'E'}, {'S', 'F', 'C', 'S'}, {'A', 'D', 'E', 'E'}};
        String word = "ABCB";

        boolean exist = solution.exist(board, word);

        assertThat(exist).isFalse();
    }

    @Test
    public void testExistCase3() {
        char[][] board = new char[][]{{'a', 'a', 'a', 'a'}, {'a', 'a', 'a', 'a'}, {'a', 'a', 'a', 'a'}};
        String word = "aaaaaaaaaaaa";

        boolean exist = solution.exist(board, word);

        assertThat(exist).isTrue();
    }
}


text:
package pipe.actions.gui;

import pipe.controllers.PetriNetController;
import pipe.controllers.RateParameterController;
import pipe.controllers.application.PipeApplicationController;
import pipe.gui.AbstractDatum;
import pipe.gui.RateEditorPanel;
import pipe.historyActions.MultipleEdit;
import pipe.historyActions.component.AddPetriNetObject;
import pipe.historyActions.component.DeletePetriNetObject;
import pipe.utilities.gui.GuiUtils;
import uk.ac.imperial.pipe.exceptions.InvalidRateException;
import uk.ac.imperial.pipe.exceptions.PetriNetComponentException;
import uk.ac.imperial.pipe.exceptions.PetriNetComponentNotFoundException;
import uk.ac.imperial.pipe.models.petrinet.FunctionalRateParameter;
import uk.ac.imperial.pipe.models.petrinet.PetriNet;
import uk.ac.imperial.pipe.models.petrinet.RateParameter;

import javax.swing.*;
import javax.swing.undo.UndoableEdit;

import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.InputEvent;
import java.awt.event.KeyEvent;
import java.util.LinkedList;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;

@SuppressWarnings("serial")
public class SpecifyRateParameterAction extends GuiAction {
    private static final Logger LOGGER = Logger.getLogger(SpecifyRateParameterAction.class.getName());

    private final PipeApplicationController pipeApplicationController;

    private RateEditorPanel rateEditorPanel;

    private JDialog guiDialog;

    public SpecifyRateParameterAction(PipeApplicationController pipeApplicationController) {
        super("Rate Parameter", "Specify Rate Parameters (alt-R)", KeyEvent.VK_R, InputEvent.ALT_DOWN_MASK);
        this.pipeApplicationController = pipeApplicationController;
    }

    /**
     * Pops up with an editor for the token rates if there is an active petri net
     *
     * @param e event
     */
    @Override
    public void actionPerformed(ActionEvent e) {
        if (pipeApplicationController.getActivePetriNetController() != null) {
            buildGuiClasses();
            showGui();
        }

    }

    private void buildGuiClasses() {
        rateEditorPanel = new RateEditorPanel(pipeApplicationController.getActivePetriNetController());
        guiDialog = new RateDialog();

    }

    private void showGui() {
        guiDialog.setSize(600, 200);
        guiDialog.setLocationRelativeTo(null);
        rateEditorPanel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
        rateEditorPanel.setOpaque(true);

        JPanel buttonPane = new JPanel();
        buttonPane.setLayout(new BoxLayout(buttonPane, BoxLayout.LINE_AXIS));
        buttonPane.setBorder(BorderFactory.createEmptyBorder(0, 10, 10, 10));
        buttonPane.add(Box.createHorizontalGlue());
        JButton ok = new JButton("OK");
        ok.addActionListener((ActionListener) guiDialog);
        buttonPane.add(ok);
        buttonPane.add(Box.createRigidArea(new Dimension(10, 0)));
        JButton cancel = new JButton("Cancel");
        cancel.addActionListener((ActionListener) guiDialog);
        buttonPane.add(cancel);

        guiDialog.add(rateEditorPanel, BorderLayout.CENTER);
        guiDialog.add(buttonPane, BorderLayout.PAGE_END);
        rateEditorPanel.setVisible(true);

        guiDialog.setVisible(true);
    }

    private class RateDialog extends JDialog implements ActionListener {

        @Override
        public void actionPerformed(ActionEvent e) {
            if (e.getActionCommand().equals("OK")) {
                if (rateEditorPanel.isDataValid()) {
                    updateFromTable(rateEditorPanel.getTableData());
                    removeDeletedData(rateEditorPanel.getDeletedData());
                    setVisible(false);
                }
            } else if (e.getActionCommand().equals("Cancel")) {
                setVisible(false);
            }
        }

        /**
         * Removes any data deleted from the table if it was in the Petri net
         * when table loaded
         */
        private void removeDeletedData(Iterable<RateEditorPanel.RateModel.Datum> deletedData) {
            PetriNetController petriNetController = pipeApplicationController.getActivePetriNetController();
            PetriNet petriNet = petriNetController.getPetriNet();
            List<UndoableEdit> undoableEdits = new LinkedList<>();
            for (RateEditorPanel.RateModel.Datum datum : deletedData) {
                if (rateEditorPanel.isExistingRateParameter(datum)) {
                    try {
                        RateParameter rateParameter = petriNet.getComponent(datum.id, RateParameter.class);
                        UndoableEdit historyItem = new DeletePetriNetObject(rateParameter, petriNet);
                        undoableEdits.add(historyItem);
                        petriNet.removeRateParameter(rateParameter);
                    } catch (PetriNetComponentNotFoundException e) {
                        LOGGER.log(Level.SEVERE, e.getMessage());
                    }
                }
            }
            if (undoableEdits.size() > 0) {
                registerUndoEvent(new MultipleEdit(undoableEdits));
            }
        }

        /**
         * Performs an update on the table data items
         *
         * @param data list of data in the table
         */
        private void updateFromTable(Iterable<RateEditorPanel.RateModel.Datum> data) {
            PetriNetController petriNetController = pipeApplicationController.getActivePetriNetController();
            List<UndoableEdit> undoableEdits = new LinkedList<>();
            for (RateEditorPanel.RateModel.Datum modified : data) {
                if (rateEditorPanel.isExistingRateParameter(modified)) {
                    AbstractDatum initial = modified.initial;
                    if (!modified.equals(initial) && modified.hasBeenSet()) {
                        try {
                            RateParameterController rateController =
                                    petriNetController.getRateParameterController(initial.id);
                            rateController.startMultipleEdits();
                            rateController.setId(modified.id);
                            rateController.setRate(modified.expression);
                            rateController.finishMultipleEdits();
                        } catch (PetriNetComponentNotFoundException | InvalidRateException e) {
                            GuiUtils.displayErrorMessage(null, e.getMessage());
                        }
                    }
                } else if (modified.hasBeenSet()) {
                    RateParameter rateParameter =
                            new FunctionalRateParameter(modified.expression, modified.id, modified.id);
                    try {
                        petriNetController.getPetriNet().add(rateParameter);
                        undoableEdits.add(new AddPetriNetObject(rateParameter, petriNetController.getPetriNet()));
                    } catch (PetriNetComponentException e) {
                        GuiUtils.displayErrorMessage(null, e.getMessage());
                    }
                }
            }
            if (undoableEdits.size() > 0) {
                registerUndoEvent(new MultipleEdit(undoableEdits));
            }
        }
    }
}


text:
/// <reference path="OOAPI.d.ts" />
/**
* AS3 Like Timer Control for Runtime
*/
declare module Runtime {
  /**
  * Timers interface similar to AS3
  */
  class Timer {
    private _repeatCount;
    private _delay;
    private _microtime;
    private _timer;
    private _listeners;
    private _complete;
    public currentCount: number;
    constructor(delay: number, repeatCount?: number);
    public isRunning : boolean;
    public start(): void;
    public stop(): void;
    public reset(): void;
    public addEventListener(type: string, listener: Function): void;
    public dispatchEvent(event: string): void;
  }
  /**
   * Internal class to help other methods keep time
   */
  class TimeKeeper {
    private _clock;
    private _lastTime;
    constructor(clock?:Function);
    public elapsed:number;
    public reset():void;
  }
  /**
  *  Get the master timer instance
  */
  function getTimer(): any;
  /**
  * Update the rate in which the enterFrame event is broadcasted
  * This synchronizes the frameRate value of the Display object.
  * By default, the frame rate is 24fps.
  */
  function updateFrameRate(frameRate: number): void;
}
/**
* Runtime permissions
*/
declare module Runtime {
  function requestPermission(name: string, callback?: Function): void;
  function hasPermission(name: string): boolean;
  function openWindow(url: string, params?: any, callback?: Function): void;
  function injectStyle(referenceObject: string, style: Object): void;
  function privilegedCode(): void;
}
declare module Runtime {
  type IMetaObject = RegisterableObject & Listenable;
  export interface Listenable {
    addEventListener(
      event:string,
      listener:Function,
      useCapture?:boolean,
      priority?:number):void;
    removeEventListener(
      event:string,
      listener:Function,
      useCapture?:boolean
    ):void;
    hasEventListener(event:string):boolean;
  }
  interface RegisterableObject {
    getId():string;
    dispatchEvent(event:string, data?:any):void;
    serialize():Object;
    unload():void;
  }
  var registeredObjects: Object;
  /**
  * Checks to see if an object is registered under the id given
  * @param objectId - Id to check
  * @returns {boolean} - whether the objectid is registered
  */
  function hasObject(objectId: string): boolean;
  /**
  * Gets the object registered by id
  * @param objectId - objectid of object
  * @returns {RegisterableObject} - object or undefined if not found
  */
  function getObject<T extends RegisterableObject>(objectId: string): T;
  /**
  * Registers an object to allow two way communication between the API
  * and the host.
  * @param object - object to be registered. Must have getId method.
  */
  function registerObject(object: RegisterableObject): void;
  /**
  * De-Registers an object from the runtime. This not only removes the object
  * from the stage if it is onstage, but also prevents the element from
  * receiving any more events.
  *
  * @param objectId - objectid to remove
  */
  function deregisterObject(objectId: string): void;
  /**
  * Generates an objectid that isn't registered
  * @param type - object type
  * @returns {string} - objectid that has not been registered
  */
  function generateId(type?: string): string;
  /**
  * De-registers all objects. This also unloads them. Objects
  * will not receive any more events
  */
  function reset(): void;
  /**
  * Unloads all objects. Does not deregister them, so they may
  * still receive events.
  */
  function clear(): void;
  /**
  * Invoke termination of script
  */
  function crash(): void;
  /**
  * Invoke exit of script engine
  */
  function exit(): void;
  /**
  * Attempts to invoke an alert dialog.
  * Note that this may not work if the Host policy does not allow it
  * @param msg - message for alert
  */
  function alert(msg: string): void;
}


text:
<?xml version="1.0" encoding="utf-8"?>
<ScrollView
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@drawable/main_background">

    <android.support.constraint.ConstraintLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content">

        <android.support.v7.widget.AppCompatTextView
            android:id="@+id/private_greeting_container"
            style="@style/DefaultAppTextView"
            android:text="@string/private_greeting_message"
            android:textAppearance="?android:attr/textAppearanceLarge"
            android:textStyle="bold"
            app:layout_constraintLeft_toLeftOf="parent"
            app:layout_constraintRight_toRightOf="parent"
            app:layout_constraintTop_toTopOf="parent"/>

        <android.support.v7.widget.AppCompatTextView
            android:id="@+id/private_text_container"
            style="@style/DefaultAppTextView"
            android:gravity="fill_horizontal"
            android:text="@string/private_text_message"
            app:layout_constraintLeft_toLeftOf="parent"
            app:layout_constraintRight_toRightOf="parent"
            app:layout_constraintTop_toBottomOf="@+id/private_greeting_container"/>

        <android.support.v7.widget.AppCompatButton
            android:id="@+id/exit_button"
            style="@style/DefaultAppButton"
            android:text="@string/action_exit_from_app"
            app:layout_constraintLeft_toLeftOf="parent"
            app:layout_constraintRight_toRightOf="parent"
            app:layout_constraintTop_toBottomOf="@+id/private_text_container"/>

        <android.support.v7.widget.AppCompatButton
            android:id="@+id/forget_user_button"
            style="@style/DefaultAppButton"
            android:text="@string/action_forget_user"
            app:layout_constraintLeft_toLeftOf="parent"
            app:layout_constraintRight_toRightOf="parent"
            app:layout_constraintTop_toBottomOf="@+id/exit_button"
            app:layout_constraintBottom_toBottomOf="parent"/>

    </android.support.constraint.ConstraintLayout>

</ScrollView>


text:
@interface CallLogDetailViewController : RootViewController

@property (nonatomic, strong) CallLog *callLog;

@end


text:
import { attr } from '@ember-data/model';
import Fragment from 'ember-data-model-fragments/fragment';
import { validator, buildValidations } from 'ember-cp-validations';
import { computed } from '@ember/object';
import { isBlank } from '@ember/utils';

const Validations = buildValidations({
  schemeUri: [
    validator('url-format', {
      allowBlank: true,
      message: 'Related Identifier scheme URI has to be a valid URI',
      disabled: computed('model.relatedIdentifierType', function () {
        return ['HasMetadata', 'IsMetadataFor'].includes(
          this.model.get('relatedIdentifierType')
        );
      })
    })
  ],
  relatedIdentifier: [
    // validator('url-format', {
    //   allowBlank: true,
    //   message: 'Please enter a valid URL.',
    //   disabled: computed('model.relatedIdentifierType', 'model.state', function() {
    //     return this.model.get('state') === 'draft' || ![ 'PURL','URL' ].includes(this.model.get('relatedIdentifierType'));
    //   }),
    // }),
    validator('identifier-format', {
      allowBlank: true,
      dependentKeys: ['model.relatedIdentifierType'],
      disabled: computed('model.relatedIdentifier', function () {
        return isBlank(this.model.get('relatedIdentifier'));
      })
    })
  ],
  relatedIdentifierType: [
    validator('presence', {
      presence: true,
      message:
        'Please enter a Related Identifier Type for the Related Identifier.',
      disabled: computed('model.{relatedIdentifier,state}', function () {
        return (
          this.model.get('state') === 'draft' ||
          isBlank(this.model.get('relatedIdentifier'))
        );
      })
    })
  ],
  relationType: [
    validator('presence', {
      presence: true,
      message: 'Please enter a Relation Type for the Related Identifier.',
      disabled: computed('model.{relatedIdentifier,state}', function () {
        return (
          this.model.get('state') === 'draft' ||
          isBlank(this.model.get('relatedIdentifier'))
        );
      })
    })
  ],
  resourceTypeGeneral: [
    validator('presence', {
      presence: true,
      message:
        'Please enter a Resource Type for the Related Identifier Metadata.',
      disabled: computed('model.{relatedIdentifierType,state}', function () {
        return (
          this.model.get('state') === 'draft' ||
          !['HasMetadata', 'IsMetadataFor'].includes(
            this.model.get('relatedIdentifierType')
          )
        );
      })
    })
  ]
});

export default Fragment.extend(Validations, {
  relatedIdentifier: attr('string', { defaultValue: null }),
  relatedIdentifierType: attr('string', { defaultValue: null }),
  relationType: attr('string', { defaultValue: null }),
  relatedMetadataScheme: attr('string', { defaultValue: null }),
  schemeUri: attr('string', { defaultValue: null }),
  schemeType: attr('string', { defaultValue: null }),
  resourceTypeGeneral: attr('string', { defaultValue: null })
});


text:
class SY::Measure
  class << self
    # Identity measure.
    #
    def identity
      simple_scale 1
    end

    # Simple scaling measure. (Eg. pounds vs kilograms)
    #
    def simple_scale scale
      new( ratio: scale )
    end

    # Simple offset measure. (Such as °C)
    #
    def simple_offset offset
      new( r: lambda { |ref_amnt| ref_amnt - offset },
           w: lambda { |amnt| amnt + offset } )
    end

    # Linear (scaled offset) measure. Expects a hash with 2 points demonstrating
    # the relationship: { ref_amount_1 => amount_1, ref_amount_2 => amount_2 }.
    # (Example: Fahrenheit degrees vs. Kelvins.)
    #
    def linear hsh
      ref_amnt_1, amnt_1, ref_amnt_2, amnt_2 = hsh.to_a.flatten
      scale = ( ref_amnt_2 - ref_amnt_1 ) / ( amnt_2 - amnt_1 )
      new( r: lambda { |ref_amnt| amnt_1 + ( ref_amnt - ref_amnt_1 ) / scale },
           w: lambda { |amnt| ref_amnt_1 + ( amnt - amnt_1 ) * scale } )
    end

    # Logarithmic.
    #
    def logarithmic base=Math::E
      new( r: lambda { |ref_amnt| Math.log ref_amnt, base },
           w: lambda { |amnt| base ** amnt } )
    end

    # Negative logarithmic.
    #
    def negative_logarithmic base=Math::E
      new( r: lambda { |ref_amnt| -Math.log( ref_amnt, base ) },
           w: lambda { |amnt| base ** ( -amnt ) } )
    end
  end

  attr_reader :r, :w, :ratio

  # The constructor expects :r and :w arguments for read and write closure.
  #
  def initialize( ratio: nil, r: nil, w: nil )
    if ratio.nil?
      fail TypeError, ":r and :w arguments must both be closures if ratio " +
        "not given!" unless r.is_a?( Proc ) && w.is_a?( Proc )
      @ratio, @r, @w = nil, r, w
    else
      fail ArgumentError, ":r or :w must not be given if :ratio given!" if r || w
      @ratio = ratio
      @r = lambda { |ref_amnt| ref_amnt / ratio }
      @w = lambda { |amnt| amnt * ratio }
    end
  end

  # Convenience method to read a magnitude of a reference quantity.
  #
  def read magnitude_of_reference_quantity, quantity
    quantity.magnitude r.( magnitude_of_reference_quantity.amount )
  end

  # Convenience method to convert a magnitude back to the reference quantity.
  #
  def write magnitude, reference_quantity
    reference_quantity.magnitude w.( magnitude.amount )
  end

  # Inverse measure.
  #
  def inverse
    if ratio.nil? then
      self.class.new( r: w, w: r ) # swap closures
    else
      self.class.new( ratio: 1 / ratio )
    end
  end

  # Measure composition (like f * g function composition).
  #
  def * other
    if ratio.nil? then
      r1, r2, w1, w2 = r, other.r, w, other.w
      self.class.new( r: lambda { |ref_amnt| r1.( r2.( ref_amnt ) ) },
                      w: lambda { |amnt| w2.( w1.( amnt ) ) } )
    else
      self.class.new( ratio: ratio * other.ratio )
    end
  end

  # Measure composition with inverse of another measure.
  #
  def / other
    self * other.inverse
  end

  # Measure power.
  #
  def ** n
    if ratio.nil? then
      r_closure, w_closure = r, w
      self.class.new( r: lambda { |ref_amnt|
                        n.times.inject ref_amnt do |m, _| r_closure.( m ) end
                      },
                      w: lambda { |amnt|
                        n.times.inject amnt do |m, _| w_closure.( m ) end
                      } )
    else
      self.class.new( ratio: ratio ** n )
    end
  end

  protected

  def []( *args )
    send *args
  end
end # class SY::Measure


text: export default () => 'isomorphic-export'