text:
/// <reference path="firebase.d.ts" />
var AUTH_TOKEN: string = "12345";
var dataRef:Firebase = new Firebase("https://SampleChat.firebaseio-demo.com/");
//Log me in
dataRef.auth(AUTH_TOKEN, function(error, result) {
  if(error) {
    console.log("Login Failed!", error);
  } else {
    console.log('Authenticated successfully with payload:', result.auth);
    console.log('Auth expires at:', new Date(result.expires * 1000));
  }
});

//Time to log out!
dataRef.unauth();

var usersRef:Firebase = new Firebase('https://SampleChat.firebaseIO-demo.com/users/');
var fredRef:Firebase = usersRef.child('fred');
var fredFirstNameRef:Firebase = fredRef.child('name/first');
var x:string = fredFirstNameRef.toString();
// x is now 'https://SampleChat.firebaseIO-demo.com/users/fred/name/first'.

var usersRef2:Firebase = new Firebase('https://SampleChat.firebaseIO-demo.com/users/');
var sampleChatRef:Firebase = usersRef2.parent();
var x2:string = sampleChatRef.toString();
// x is now 'https://SampleChat.firebaseIO-demo.com'.
var y:Firebase = sampleChatRef.parent();
// y is now null, since sampleChatRef refers to the root of the Firebase.

var fredRef2:Firebase = new Firebase('https://SampleChat.firebaseIO-demo.com/users/fred');
var sampleChatRef2 :Firebase= fredRef2.root();
var x3:string = sampleChatRef2.toString();
// x is now 'https://SampleChat.firebaseIO-demo.com'.

var fredRef3:Firebase = new Firebase('https://SampleChat.firebaseIO-demo.com/users/fred');
var x4:string = fredRef3.name();
// x is now 'fred'.

// Increment Fred's rank by 1.
var fredRankRef:Firebase = new Firebase('https://SampleChat.firebaseIO-demo.com/users/fred/rank');
fredRankRef.transaction(function(currentRank: number) {
  return currentRank+1;
});

// Try to create a user for wilma, but only if the user id 'wilma' isn't already taken.
var wilmaRef: Firebase = new Firebase('https://SampleChat.firebaseIO-demo.com/users/wilma');
wilmaRef.transaction(function(currentData) {
  if (currentData === null) {
    return {name: {first: 'Wilma', last: 'Flintstone'} };
  } else {
    console.log('User wilma already exists.');
    return; // Abort the transaction.
  }
}, function(error: any, committed: bool, snapshot: IFirebaseDataSnapshot) {
  if (error)
    console.log('Transaction failed abnormally!', error);
  else if (!committed)
    console.log('We aborted the transaction (because wilma already exists).');
  else
    console.log('User wilma added!');
  console.log('Wilma\'s data: ', snapshot.val());
});

var messageListRef: Firebase = new Firebase('https://SampleChat.firebaseIO-demo.com/message_list');
var lastMessagesQuery:IFirebaseQuery = messageListRef.endAt().limit(500);
lastMessagesQuery.on('child_added', function(childSnapshot: IFirebaseDataSnapshot) { /* handle child add */ });

var messageListRef2:Firebase = new Firebase('https://SampleChat.firebaseIO-demo.com/message_list');
var firstMessagesQuery:IFirebaseQuery = messageListRef2.startAt().limit(500);
firstMessagesQuery.on('child_added', function(childSnapshot: IFirebaseDataSnapshot) { /* handle child add */ });

var usersRef3: Firebase = new Firebase('https://SampleChat.firebaseIO-demo.com/users');
var usersQuery: IFirebaseQuery = usersRef3.startAt(1000).limit(50);
usersQuery.on('child_added', function(userSnapshot: IFirebaseDataSnapshot) { /* handle user */ });


text:
require 'spec_helper'

RSpec.describe Cryptoexchange::Exchanges::Nusax::Market do
  it { expect(described_class::NAME).to eq 'nusax' }
  it { expect(described_class::API_URL).to eq 'https://nusax.co.id/api/v2' }
end

redpajama_set_name: RedPajamaGithub


text:
package com.simsilica.lemur.event;

import com.jme3.scene.Spatial;

/**
 *  Implementations of this interface can be registered with the
 *  CursorEventControl to receive cursor events for a Spatial.
 *
 *  @author    Paul Speed
 */
public interface CursorListener {

    public void cursorButtonEvent( CursorButtonEvent event, Spatial target, Spatial capture );

    public void cursorEntered( CursorMotionEvent event, Spatial target, Spatial capture );

    public void cursorExited( CursorMotionEvent event, Spatial target, Spatial capture );

    public void cursorMoved( CursorMotionEvent event, Spatial target, Spatial capture );
}


text:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="blue.mesh.test"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk android:minSdkVersion="7" android:targetSdkVersion="7" />

    <uses-permission android:name="android.permission.BLUETOOTH"></uses-permission>
    <uses-permission android:name="android.permission.BLUETOOTH_ADMIN"></uses-permission>

    <application
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name" >
        <activity
            android:label="@string/app_name"
            android:name=".BlueMeshTestApp"
            android:screenOrientation="portrait" >
            <intent-filter >
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>

</manifest>


text:
from icalendar.tests import unittest

import datetime
import icalendar
import os

class TestTime(unittest.TestCase):

    def setUp(self):
        icalendar.cal.types_factory.types_map['X-SOMETIME'] = 'time'

    def tearDown(self):
        icalendar.cal.types_factory.types_map.pop('X-SOMETIME')

    def test_create_from_ical(self):
        directory = os.path.dirname(__file__)
        ics = open(os.path.join(directory, 'time.ics'), 'rb')
        cal = icalendar.Calendar.from_ical(ics.read())
        ics.close()

        self.assertEqual(cal['X-SOMETIME'].dt, datetime.time(17, 20, 10))
        self.assertEqual(cal['X-SOMETIME'].to_ical(), '172010')

    def test_create_to_ical(self):
        cal = icalendar.Calendar()
        cal.add('X-SOMETIME', datetime.time(17, 20, 10))
        self.assertTrue(b'X-SOMETIME;VALUE=TIME:172010' in
                        cal.to_ical().splitlines())


text:
package org.apache.spark.deploy.yarn

import org.apache.hadoop.yarn.api.records._
import org.apache.hadoop.yarn.client.api.AMRMClient.ContainerRequest
import org.scalatest.BeforeAndAfterEach
import org.scalatest.matchers.must.Matchers

import org.apache.spark.SparkFunSuite
import org.apache.spark.resource.ResourceProfile

class ContainerPlacementStrategySuite extends SparkFunSuite with Matchers with BeforeAndAfterEach {

  private val yarnAllocatorSuite = new YarnAllocatorSuite
  import yarnAllocatorSuite._

  def createContainerRequest(nodes: Array[String]): ContainerRequest =
    new ContainerRequest(containerResource, nodes, null, Priority.newInstance(1))

  override def beforeEach(): Unit = {
    yarnAllocatorSuite.beforeEach()
  }

  override def afterEach(): Unit = {
    yarnAllocatorSuite.afterEach()
  }

  val defaultResourceProfileId = ResourceProfile.DEFAULT_RESOURCE_PROFILE_ID

  test("allocate locality preferred containers with enough resource and no matched existed " +
    "containers") {
    // 1. All the locations of current containers cannot satisfy the new requirements
    // 2. Current requested container number can fully satisfy the pending tasks.

    val (handler, allocatorConf) = createAllocator(2)
    handler.updateResourceRequests()
    handler.handleAllocatedContainers(Array(createContainer("host1"), createContainer("host2")))

    ResourceProfile.clearDefaultProfile
    val rp = ResourceProfile.getOrCreateDefaultProfile(allocatorConf)
    val localities = handler.containerPlacementStrategy.localityOfRequestedContainers(
      3, 15, Map("host3" -> 15, "host4" -> 15, "host5" -> 10),
      handler.allocatedHostToContainersMapPerRPId(defaultResourceProfileId), Seq.empty, rp)

    assert(localities.map(_.nodes) === Array(
      Array("host3", "host4", "host5"),
      Array("host3", "host4", "host5"),
      Array("host3", "host4")))
  }

  test("allocate locality preferred containers with enough resource and partially matched " +
    "containers") {
    // 1. Parts of current containers' locations can satisfy the new requirements
    // 2. Current requested container number can fully satisfy the pending tasks.

    val (handler, allocatorConf) = createAllocator(3)
    handler.updateResourceRequests()
    handler.handleAllocatedContainers(Array(
      createContainer("host1"),
      createContainer("host1"),
      createContainer("host2")
    ))

    ResourceProfile.clearDefaultProfile
    val rp = ResourceProfile.getOrCreateDefaultProfile(allocatorConf)

    val localities = handler.containerPlacementStrategy.localityOfRequestedContainers(
      3, 15, Map("host1" -> 15, "host2" -> 15, "host3" -> 10),
      handler.allocatedHostToContainersMapPerRPId(defaultResourceProfileId), Seq.empty, rp)

    assert(localities.map(_.nodes) ===
      Array(null, Array("host2", "host3"), Array("host2", "host3")))
  }

  test("allocate locality preferred containers with limited resource and partially matched " +
    "containers") {
    // 1. Parts of current containers' locations can satisfy the new requirements
    // 2. Current requested container number cannot fully satisfy the pending tasks.

    val (handler, allocatorConf) = createAllocator(3)
    handler.updateResourceRequests()
    handler.handleAllocatedContainers(Array(
      createContainer("host1"),
      createContainer("host1"),
      createContainer("host2")
    ))

    ResourceProfile.clearDefaultProfile
    val rp = ResourceProfile.getOrCreateDefaultProfile(allocatorConf)
    val localities = handler.containerPlacementStrategy.localityOfRequestedContainers(
      1, 15, Map("host1" -> 15, "host2" -> 15, "host3" -> 10),
      handler.allocatedHostToContainersMapPerRPId(defaultResourceProfileId), Seq.empty, rp)

    assert(localities.map(_.nodes) === Array(Array("host2", "host3")))
  }

  test("allocate locality preferred containers with fully matched containers") {
    // Current containers' locations can fully satisfy the new requirements

    val (handler, allocatorConf) = createAllocator(5)
    handler.updateResourceRequests()
    handler.handleAllocatedContainers(Array(
      createContainer("host1"),
      createContainer("host1"),
      createContainer("host2"),
      createContainer("host2"),
      createContainer("host3")
    ))

    ResourceProfile.clearDefaultProfile
    val rp = ResourceProfile.getOrCreateDefaultProfile(allocatorConf)
    val localities = handler.containerPlacementStrategy.localityOfRequestedContainers(
      3, 15, Map("host1" -> 15, "host2" -> 15, "host3" -> 10),
      handler.allocatedHostToContainersMapPerRPId(defaultResourceProfileId), Seq.empty, rp)

    assert(localities.map(_.nodes) === Array(null, null, null))
  }

  test("allocate containers with no locality preference") {
    // Request new container without locality preference

    val (handler, allocatorConf) = createAllocator(2)
    handler.updateResourceRequests()
    handler.handleAllocatedContainers(Array(createContainer("host1"), createContainer("host2")))

    ResourceProfile.clearDefaultProfile
    val rp = ResourceProfile.getOrCreateDefaultProfile(allocatorConf)
    val localities = handler.containerPlacementStrategy.localityOfRequestedContainers(
      1, 0, Map.empty,
      handler.allocatedHostToContainersMapPerRPId(defaultResourceProfileId), Seq.empty, rp)

    assert(localities.map(_.nodes) === Array(null))
  }

  test("allocate locality preferred containers by considering the localities of pending requests") {
    val (handler, allocatorConf) = createAllocator(3)
    handler.updateResourceRequests()
    handler.handleAllocatedContainers(Array(
      createContainer("host1"),
      createContainer("host1"),
      createContainer("host2")
    ))

    val pendingAllocationRequests = Seq(
      createContainerRequest(Array("host2", "host3")),
      createContainerRequest(Array("host1", "host4")))

    ResourceProfile.clearDefaultProfile
    val rp = ResourceProfile.getOrCreateDefaultProfile(allocatorConf)
    val localities = handler.containerPlacementStrategy.localityOfRequestedContainers(
      1, 15, Map("host1" -> 15, "host2" -> 15, "host3" -> 10),
      handler.allocatedHostToContainersMapPerRPId(defaultResourceProfileId),
      pendingAllocationRequests, rp)

    assert(localities.map(_.nodes) === Array(Array("host3")))
  }
}


text: class Transfiguration < Event ;end


text:
//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

namespace DSourceControlsHW {

    public partial class Continents {

        /// <summary>
        /// form1 control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.HtmlControls.HtmlForm form1;

        /// <summary>
        /// ListBoxContinets control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.ListBox ListBoxContinets;

        /// <summary>
        /// EntityDataSourceContinents control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.EntityDataSource EntityDataSourceContinents;
    }
}


text:
<form angular-validator-submit="$ctrl.AgregarEncuesta()" name="PregumntaForm" novalidate angular-validator>

        {{$ctrl.Titulo}}

  Inicio>Encuestas

          <button title="Guardar encuesta" class="btn btn-primary btn-sm" type="submit"> Guardar</button>
          <button title="Cancelar cambios" class="btn btn-default btn-sm" type="button" ui-sref="home.encuestas.encuesta">Cancelar</button>

          Nombre de la encuesta
          <input type="text" class="form-control input-sm" name="npregunta" required-message="'Este campo es obligatorio'" ng-required="true"
            validate-on="dirty" ng-model="$ctrl.NombreEnc" placeholder="Nombre de la encuesta">

          Descripción
          <input class="form-control input-sm" name="npregunta" required-message="'Este campo es obligatorio'" ng-required="true" validate-on="dirty"
            ng-model="$ctrl.DescripcionEnc" placeholder="Describe brevemente la finalidad de la encuesta">

Selecciona las preguntas que se añadiran a la encuesta

Preguntas disponibles

                      {{ item.Pregunta }}
 Tipo : {{ item.TipoPreguntas.Descripcion }}
                      <button title="Agregar pregunta a la encuesta" type="button" class="btn ink-reaction  btn-xs btn-success" ng-click="$ctrl.transfer($ctrl.obj.items, $ctrl.obj.selectedItems, $ctrl.obj.items.indexOf(item))"> Agregar </button>
                       ver respuestas

Preguntas seleccionadas

                      {{ item.Pregunta }}
 Tipo : {{ item.TipoPreguntas.Descripcion }}
                      <button title="Quitar pregunta a la encuesta" ng-click="$ctrl.transfer($ctrl.obj.selectedItems, $ctrl.obj.items, $ctrl.obj.selectedItems.indexOf(item))" type="button" class="btn ink-reaction  btn-xs btn-warning">  Quitar </button>
                       ver respuestas

</form>


text:
// Copyright 2016 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

package org.chromium.chrome.browser.infobar;

import android.content.Context;
import android.text.style.ClickableSpan;
import android.view.View;

import org.chromium.base.ContextUtils;
import org.chromium.base.annotations.CalledByNative;
import org.chromium.base.metrics.RecordHistogram;
import org.chromium.chrome.R;
import org.chromium.chrome.browser.download.DownloadOpenSource;
import org.chromium.chrome.browser.download.DownloadUtils;
import org.chromium.chrome.browser.download.DuplicateDownloadClickableSpan;
import org.chromium.chrome.browser.profiles.OTRProfileID;
import org.chromium.components.infobars.ConfirmInfoBar;
import org.chromium.components.infobars.InfoBar;
import org.chromium.components.infobars.InfoBarLayout;

/**
 * An infobar to ask whether to proceed downloading a file that already exists locally or is still
 * being downloaded.
 */
public class DuplicateDownloadInfoBar extends ConfirmInfoBar {
    private static final String TAG = "DuplicateDownloadInfoBar";
    private final String mFilePath;
    private final boolean mIsOfflinePage;
    private final String mPageUrl;
    private final OTRProfileID mOTRProfileID;
    private final boolean mDuplicateRequestExists;

    @CalledByNative
    private static InfoBar createInfoBar(String filePath, boolean isOfflinePage, String pageUrl,
            OTRProfileID otrProfileID, boolean duplicateRequestExists) {
        return new DuplicateDownloadInfoBar(ContextUtils.getApplicationContext(), filePath,
                isOfflinePage, pageUrl, otrProfileID, duplicateRequestExists);
    }

    /**
     * Constructs DuplicateDownloadInfoBar.
     * @param context Application context.
     * @param filePath The file path.
     * @param isOfflinePage Whether the download is for offline page.
     * @param pageUrl Url of the page, ignored if this is a regular download.
     * @param otrProfileID The {@link OTRProfileID} of the download. Null if in regular mode.
     * @param duplicateRequestExists Whether the duplicate is a download in progress.
     */
    private DuplicateDownloadInfoBar(Context context, String filePath, boolean isOfflinePage,
            String pageUrl, OTRProfileID otrProfileID, boolean duplicateRequestExists) {
        super(R.drawable.infobar_downloading, R.color.infobar_icon_drawable_color, null, null, null,
                context.getString(R.string.duplicate_download_infobar_download_button),
                context.getString(R.string.cancel));
        mFilePath = filePath;
        mIsOfflinePage = isOfflinePage;
        mPageUrl = pageUrl;
        mOTRProfileID = otrProfileID;
        mDuplicateRequestExists = duplicateRequestExists;
    }

    @Override
    public void createContent(InfoBarLayout layout) {
        super.createContent(layout);
        Context context = layout.getContext();
        if (mIsOfflinePage) {
            layout.setMessage(DownloadUtils.getOfflinePageMessageText(
                    context, mFilePath, mDuplicateRequestExists, new ClickableSpan() {
                        @Override
                        public void onClick(View view) {
                            DownloadUtils.openPageUrl(context, mPageUrl);
                            recordLinkClicked(true);
                        }
                    }));
        } else {
            DuplicateDownloadClickableSpan span =
                    new DuplicateDownloadClickableSpan(context, mFilePath,
                            ()
                                    -> this.recordLinkClicked(false),
                            mOTRProfileID, DownloadOpenSource.INFO_BAR);
            layout.setMessage(DownloadUtils.getDownloadMessageText(context,
                    context.getString(R.string.duplicate_download_infobar_text), mFilePath,
                    false /*addSizeStringIfAvailable*/, 0 /*totalBytes*/, span));
        }
    }

    /**
     * Records the link clicked histogram.
     * @param isOfflinePage Whether this is an offline page download.
     */
    private void recordLinkClicked(boolean isOfflinePage) {
        RecordHistogram.recordEnumeratedHistogram(isOfflinePage
                        ? "Download.DuplicateInfobarEvent.OfflinePage"
                        : "Download.DuplicateInfobarEvent.Download",
                DuplicateDownloadInfobarEvent.LINK_CLICKED, DuplicateDownloadInfobarEvent.COUNT);
    }
}


text:
namespace Js
{
ScriptContextOptimizationOverrideInfo::ScriptContextOptimizationOverrideInfo()
    : sideEffects(SideEffects_None),
    arraySetElementFastPathVtable(VirtualTableInfo<Js::JavascriptArray>::Address),
    intArraySetElementFastPathVtable(VirtualTableInfo<Js::JavascriptNativeIntArray>::Address),
    floatArraySetElementFastPathVtable(VirtualTableInfo<Js::JavascriptNativeFloatArray>::Address),
    crossSiteRoot(nullptr), crossSitePrev(nullptr), crossSiteNext(nullptr)
{
}

ScriptContextOptimizationOverrideInfo::~ScriptContextOptimizationOverrideInfo()
{
    ScriptContextOptimizationOverrideInfo * next = crossSiteNext;
    if (next != nullptr)
    {
        ScriptContextOptimizationOverrideInfo * root = crossSiteRoot;
        Assert(root != nullptr);
        if (this == root)
        {
            // Change the root
            ForEachCrossSiteInfo([next](ScriptContextOptimizationOverrideInfo * info)
            {
                info->crossSiteRoot = next;
            });
        }
        ScriptContextOptimizationOverrideInfo * prev = crossSitePrev;
        Assert(prev != nullptr);
        next->crossSitePrev = prev;
        prev->crossSiteNext = next;
    }
}

template <typename Fn>
void ScriptContextOptimizationOverrideInfo::ForEachCrossSiteInfo(Fn fn)
{
    Assert(crossSiteRoot != nullptr);
    ScriptContextOptimizationOverrideInfo * current = this;
    do
    {
        fn(current);
        current = current->crossSiteNext;
    }
    while (current != this);

}

template <typename Fn>
void ScriptContextOptimizationOverrideInfo::ForEachEditingCrossSiteInfo(Fn fn)
{
    Assert(crossSiteRoot != nullptr);
    ScriptContextOptimizationOverrideInfo * current = this;
    do
    {
        ScriptContextOptimizationOverrideInfo * next = current->crossSiteNext;
        fn(current);
        current = next;
    }
    while (current != this);
}

void
ScriptContextOptimizationOverrideInfo::Merge(ScriptContextOptimizationOverrideInfo * info)
{
    ScriptContextOptimizationOverrideInfo * thisRoot = this->crossSiteRoot;
    ScriptContextOptimizationOverrideInfo * infoRoot = info->crossSiteRoot;
    if (thisRoot == infoRoot)
    {
        if (thisRoot != nullptr)
        {
            // Both info is already in the same info group
            return;
        }

        // Both of them are null, just group them

        // Update this to be the template
        this->Update(info);

        // Initialize the cross site list
        this->crossSiteRoot = this;
        this->crossSitePrev = this;
        this->crossSiteNext = this;

        // Insert the info to the list
        this->Insert(info);
    }
    else
    {
        if (thisRoot == nullptr)
        {
            thisRoot = infoRoot;
            infoRoot = nullptr;
            info = this;
        }

        thisRoot->Update(info);

        // Spread the information on the current group
        thisRoot->ForEachCrossSiteInfo([thisRoot](ScriptContextOptimizationOverrideInfo * i)
        {
            thisRoot->CopyTo(i);
        });

        if (infoRoot == nullptr)
        {
            thisRoot->Insert(info);
        }
        else
        {
            // Insert the other group
            info->ForEachEditingCrossSiteInfo([thisRoot](ScriptContextOptimizationOverrideInfo * i)
            {
                thisRoot->Insert(i);
            });
        }
    }

    DebugOnly(Verify());
}

void
ScriptContextOptimizationOverrideInfo::CopyTo(ScriptContextOptimizationOverrideInfo * info)
{
    info->arraySetElementFastPathVtable = this->arraySetElementFastPathVtable;
    info->intArraySetElementFastPathVtable = this->intArraySetElementFastPathVtable;
    info->floatArraySetElementFastPathVtable = this->floatArraySetElementFastPathVtable;
    info->sideEffects = this->sideEffects;
}

void
ScriptContextOptimizationOverrideInfo::Insert(ScriptContextOptimizationOverrideInfo * info)
{
    // Copy the information
    this->CopyTo(info);

    // Insert
    // Only insert at the root
    Assert(this == this->crossSiteRoot);
    info->crossSiteRoot = this;
    info->crossSiteNext = this;
    info->crossSitePrev = this->crossSitePrev;
    this->crossSitePrev->crossSiteNext = info;
    this->crossSitePrev = info;
}

void
ScriptContextOptimizationOverrideInfo::Update(ScriptContextOptimizationOverrideInfo * info)
{
    if (!info->IsEnabledArraySetElementFastPath())
    {
        this->DisableArraySetElementFastPath();
    }

    this->sideEffects = (SideEffects)(this->sideEffects | info->sideEffects);
}

void
ScriptContextOptimizationOverrideInfo::SetSideEffects(SideEffects se)
{
    if (this->crossSiteRoot == nullptr)
    {
        sideEffects = (SideEffects)(sideEffects | se);
    }
    else if ((sideEffects & se) != se)
    {
        ForEachCrossSiteInfo([se](ScriptContextOptimizationOverrideInfo * info)
        {
            Assert((info->sideEffects & se) != se);
            info->sideEffects = (SideEffects)(info->sideEffects | se);
        });
    }
}
bool
ScriptContextOptimizationOverrideInfo::IsEnabledArraySetElementFastPath() const
{
    return arraySetElementFastPathVtable != InvalidVtable;
}

void
ScriptContextOptimizationOverrideInfo::DisableArraySetElementFastPath()
{
    if (this->crossSiteRoot == nullptr)
    {
        arraySetElementFastPathVtable = InvalidVtable;
        intArraySetElementFastPathVtable = InvalidVtable;
        floatArraySetElementFastPathVtable = InvalidVtable;
    }
    else if (IsEnabledArraySetElementFastPath())
    {
        // disable for all script context in the cross site group
        ForEachCrossSiteInfo([](ScriptContextOptimizationOverrideInfo * info)
        {
            Assert(info->IsEnabledArraySetElementFastPath());
            info->arraySetElementFastPathVtable = InvalidVtable;
            info->intArraySetElementFastPathVtable = InvalidVtable;
            info->floatArraySetElementFastPathVtable = InvalidVtable;
        });
    }
}

INT_PTR
ScriptContextOptimizationOverrideInfo::GetArraySetElementFastPathVtable() const
{
    return arraySetElementFastPathVtable;
}

INT_PTR
ScriptContextOptimizationOverrideInfo::GetIntArraySetElementFastPathVtable() const
{
    return intArraySetElementFastPathVtable;
}

INT_PTR
ScriptContextOptimizationOverrideInfo::GetFloatArraySetElementFastPathVtable() const
{
    return floatArraySetElementFastPathVtable;
}

void *
ScriptContextOptimizationOverrideInfo::GetAddressOfArraySetElementFastPathVtable()
{
    return &arraySetElementFastPathVtable;
}

void *
ScriptContextOptimizationOverrideInfo::GetAddressOfIntArraySetElementFastPathVtable()
{
    return &intArraySetElementFastPathVtable;
}

void *
ScriptContextOptimizationOverrideInfo::GetAddressOfFloatArraySetElementFastPathVtable()
{
    return &floatArraySetElementFastPathVtable;
}

#if DBG
void
ScriptContextOptimizationOverrideInfo::Verify()
{
    if (this->crossSiteRoot == nullptr)
    {
        return;
    }

    this->ForEachCrossSiteInfo([this](ScriptContextOptimizationOverrideInfo * i)
    {
        Assert(i->crossSiteRoot == this->crossSiteRoot);
        Assert(i->sideEffects == this->sideEffects);
        Assert(i->arraySetElementFastPathVtable == this->arraySetElementFastPathVtable);
        Assert(i->intArraySetElementFastPathVtable == this->intArraySetElementFastPathVtable);
        Assert(i->floatArraySetElementFastPathVtable == this->floatArraySetElementFastPathVtable);
    });
}
#endif
};


text:
title       : (2021) Lighthouse Liquor Cabinet
excerpt     : Converting a Lighthouse Redemption Machine into a liquor and glassware cabinet
post_date   : 2021-11-22 00:00:00
header      :
  teaser    : /public/uploads/2021/lighthouse_banner.jpg
toc         : true
toc_sticky  : true
---

## The Find

 I found a Lighthouse Redemption machine on the side of the road in the pouring rain. It looked like it had fallen out of the back of a truck.

> Lighthouse is a one-player, prize redemption game, where players attempt to move the lighthouse levels lamps from Level one, past level five, and into the "win" level. If the "win" level is reached then the player can select a prize to be dispensed. Lighthouse was produced by [LAI](https://laigames.com/) in 2000.
>
> Weight: 152 kg (337lb), Height: 2000mm (78.5"), Width: 640mm (25"), Length: 770mm (30.5")
>
> Source: [Lighthouse Operation Manual](https://laigames.com/wp-content/uploads/2018/01/LighthouseOperationManual.pdf)

 It weigh a ton. I had to call in a friend to get into the back of my mini-van. It just barely fit.

After I got it back to my shop, dried it out, and plugged it in. As expected it didn't work. I checked the power supply, it produced current but none of the boards lit up. I expect that the rain damage destroyed most of the electronics if they even worked.

The coin receiver had been removed, I assume this machine didn't work and someone was abandoning it on the side of the road.

The coin meters were still in the device that counted how many tokens have been inserted into this machine over the years. Coin Meter 1: 24,658, Coin Meter 2: 594, Prize Meter: 732

 According to the operator manual if this machine was set up with the defaults it would have cost $0.50 to play, with a payout every 400 plays, using $75 prizes. In other words for every $200 in the cash box 1x $75 prize would have been awarded. Assuming the defaults were used. 723 prizes == $144,600 (coins inserted) - $54,225 (prizes paid out) == $90,375 in profit. Not bad!

Reading the manual, you could also configure this machine to **NEVER PAYOUT**.

The manual did come with a complete schematic and 3D exploded parts diagram.

## The Plan

 We decided to turn this into a glassware and liquor cabinet. Three shelves of glassware, and four racks of hanging stem wear from the ceiling. Below is a rough mockup of what we were thinking.

Then replace the spinner with a new decal that allowed people to randomly select a type of alcohol. Rum, Whisky, Gin, Vodka, Wine, absinthe, etc... When the person presses the play button the spinner spins around a few times and randomly stops on one of the alcohol choices.

I was thinking of how to do an attract mode that would be visually appealing but not distracting when I was watching TV. I decided to turn the lighthouse into a [cuckoo clock](https://en.wikipedia.org/wiki/Cuckoo_clock) where twice a day at midnight and noon. The lighthouse spinner would spin, LEDs in the different layers of illuminate.

I could also integrate the LEDs into the alcohol selection process. Lots of options.

## The Process

The first thing we did was rip out all the electronics, wiring, and prize shoot that weren't needed anymore. This significantly reduced the weight of the machine. The power supply alone was a good 20lbs of wire.

```ToDo: Insert photos from removing parts```

The shelves needed to be a weird shape because of the lighthouse in the center. They need a semi-circle cut out of the back of them. I called several local custom glass places and got quotes of +$300. I decided to cut the shelves out of Plexi instead of using glass. It wouldn't look as nice but it would be considerably cheaper.

More to come soon.


text:
package com.hussainmukadam.watchit.detailpage.view;

import android.app.Activity;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.os.Bundle;
import android.os.Parcelable;
import android.support.annotation.Nullable;
import android.support.annotation.RequiresApi;
import android.support.design.widget.CollapsingToolbarLayout;
import android.support.v4.app.Fragment;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.graphics.Palette;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.Toolbar;
import android.text.TextUtils;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;

import com.google.android.flexbox.FlexboxLayoutManager;
import com.google.android.flexbox.JustifyContent;
import com.hussainmukadam.watchit.BuildConfig;
import com.hussainmukadam.watchit.R;
import com.hussainmukadam.watchit.detailpage.DetailsMVPContract;
import com.hussainmukadam.watchit.detailpage.adapter.GenreAdapter;
import com.hussainmukadam.watchit.detailpage.model.MovieDetails;
import com.hussainmukadam.watchit.detailpage.model.TvSeriesDetails;
import com.hussainmukadam.watchit.detailpage.presenter.DetailsPresenter;
import com.hussainmukadam.watchit.BaseActivity;
import com.hussainmukadam.watchit.mainpage.model.Movie;
import com.hussainmukadam.watchit.mainpage.model.TvSeries;
import com.hussainmukadam.watchit.util.Util;
import com.hussainmukadam.watchit.watchlaterpage.view.WatchLaterActivity;
import com.squareup.picasso.Picasso;
import com.squareup.picasso.Target;

import java.util.List;

import butterknife.BindView;
import butterknife.BindViews;
import butterknife.ButterKnife;

/**
 * Created by hussain on 23/10/17.
 */

public class DetailsFragment extends Fragment implements DetailsMVPContract.DetailsView {
    private static final String TAG = "DetailsFragment";

    @BindView(R.id.iv_poster)
    ImageView ivDetailsPoster;
    @BindView(R.id.iv_backdrop)
    ImageView ivBackdropPoster;
    @BindView(R.id.tv_release_date)
    TextView tvReleaseDate;
    @BindView(R.id.tv_overview_placeholder)
    TextView tvOverviewPlaceholder;
    @BindView(R.id.collapsing_toolbar)
    CollapsingToolbarLayout collapsingToolbarLayout;
    @BindViews({R.id.tv_vote_average_details, R.id.tv_overview_details, R.id.tv_tagline, R.id.tv_runtime})
    List<TextView> textViewsList;
    @BindView(R.id.rv_genre)
    RecyclerView rvGenreList;
    @BindView(R.id.details_toolbar)
    Toolbar toolbar;

    private DetailsMVPContract.DetailsBasePresenter detailsBasePresenter;
    Toolbar customToolbar;
    DetailsPresenter detailsPresenter;
    Movie movie;
    TvSeries tvSeries;
    Target backdropTarget;
    GenreAdapter genreAdapter;
    WatchLaterActivity watchLaterActivity;
    BaseActivity baseActivity;
    Bundle data;
    boolean isMovie = false;

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.fragment_details, container, false);
        ButterKnife.bind(this, view);

        if (getArguments() != null) {
            if (getArguments().containsKey("NOTIFICATION_ITEM")) {
                Log.d(TAG, "onCreateView: Inside Details Fragment contains ITEM");
                Toast.makeText(getContext(), "From Notifications", Toast.LENGTH_SHORT).show();
                startNotificationFlow(getArguments().getParcelable("NOTIFICATION_ITEM"));
            }
        } else {
            startNormalFlow();
        }

        return view;
    }

    private void startNotificationFlow(Object arguments) {
//        Movie data = (Movie) arguments;

        detailsPresenter = new DetailsPresenter(this);
        setupRecyclerView();

        if (arguments instanceof Movie) {
            isMovie = true;
            this.movie = (Movie) arguments;
        } else {
            this.tvSeries = (TvSeries) arguments;
        }

        backdropTarget = new Target() {
            @Override
            public void onBitmapLoaded(Bitmap bitmap, Picasso.LoadedFrom from) {
                ivBackdropPoster.setImageBitmap(bitmap);
                if (Build.VERSION.SDK_INT >= 21) {
                    createPaletteAsync(bitmap);
                }
            }

            @Override
            public void onBitmapFailed(Drawable errorDrawable) {
            }

            @Override
            public void onPrepareLoad(Drawable placeHolderDrawable) {
            }
        };

        initTransitionViews();

        if (getContext() != null) {
            if (Util.isConnected(getContext())) {
                if (isMovie) {
                    detailsPresenter.fetchMovieDetails(movie.getMovieId());
                } else {
                    detailsPresenter.fetchTvSeriesDetails(tvSeries.getTvId());
                }
            } else {
                Toast.makeText(getContext(), "No Internet Connection", Toast.LENGTH_SHORT).show();
            }
        }

        toolbar.setNavigationOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                if (getActivity() != null) {
                    Intent i = new Intent(getContext(), BaseActivity.class);
                    startActivity(i);
                }
            }
        });

    }

    private void startNormalFlow() {
        if (getActivity() instanceof BaseActivity) {
            baseActivity = (BaseActivity) getActivity();
            data = baseActivity.getData();
        } else {
            watchLaterActivity = (WatchLaterActivity) getActivity();
            customToolbar = watchLaterActivity.findViewById(R.id.toolbar_main);
            customToolbar.setVisibility(View.GONE);
            data = watchLaterActivity.getData();
        }

        detailsPresenter = new DetailsPresenter(this);
        setupRecyclerView();

        Object dataObject = data.getParcelable("ITEM");
        if (dataObject instanceof Movie) {
            isMovie = true;
            this.movie = (Movie) dataObject;
        } else {
            this.tvSeries = (TvSeries) dataObject;
        }

        backdropTarget = new Target() {
            @Override
            public void onBitmapLoaded(Bitmap bitmap, Picasso.LoadedFrom from) {
                ivBackdropPoster.setImageBitmap(bitmap);
                if (Build.VERSION.SDK_INT >= 21) {
                    createPaletteAsync(bitmap);
                }
            }

            @Override
            public void onBitmapFailed(Drawable errorDrawable) {
            }

            @Override
            public void onPrepareLoad(Drawable placeHolderDrawable) {
            }
        };

        initTransitionViews();

        if (getContext() != null) {
            if (Util.isConnected(getContext())) {
                if (isMovie) {
                    detailsPresenter.fetchMovieDetails(movie.getMovieId());
                } else {
                    detailsPresenter.fetchTvSeriesDetails(tvSeries.getTvId());
                }
            } else {
                Toast.makeText(getContext(), "No Internet Connection", Toast.LENGTH_SHORT).show();
            }
        }

        toolbar.setNavigationOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                if (getActivity() != null) {
                    getActivity().onBackPressed();
                }
            }
        });

    }

    private void initTransitionViews() {

        if (isMovie) {
            collapsingToolbarLayout.setTitle(movie.getMovieTitle());

            Picasso.with(getContext())
                    .load(BuildConfig.imageBaseUrl + movie.getPosterPath())
                    .error(getActivity().getResources().getDrawable(R.drawable.ic_broken_image_black_24dp))
                    .into(ivDetailsPoster);

            Picasso.with(getContext())
                    .load(BuildConfig.imageBaseUrl + movie.getBackdropPath())
                    .error(getActivity().getResources().getDrawable(R.drawable.ic_broken_image_black_24dp))
                    .into(backdropTarget);

            tvReleaseDate.setText(movie.getReleaseDate());
            textViewsList.get(0).setText(String.valueOf(movie.getMovieVoteAverage()));
            if (!TextUtils.isEmpty(movie.getMovieOverview())) {
                textViewsList.get(1).setText(movie.getMovieOverview());
            } else {
                tvOverviewPlaceholder.setText("No Overview");
            }

        } else {
            collapsingToolbarLayout.setTitle(tvSeries.getTvTitle());

            Picasso.with(getContext())
                    .load(BuildConfig.imageBaseUrl + tvSeries.getTvPosterPath())
                    .error(getActivity().getResources().getDrawable(R.drawable.ic_broken_image_black_24dp))
                    .into(ivDetailsPoster);

            Picasso.with(getContext())
                    .load(BuildConfig.imageBaseUrl + tvSeries.getTvBackdropPath())
                    .error(getActivity().getResources().getDrawable(R.drawable.ic_broken_image_black_24dp))
                    .into(backdropTarget);

            tvReleaseDate.setText(tvSeries.getTvReleaseDate());
            textViewsList.get(0).setText(String.valueOf(tvSeries.getTvVoteAverage()));
            if (!TextUtils.isEmpty(tvSeries.getTvOverview())) {
                textViewsList.get(1).setText(tvSeries.getTvOverview());
            } else {
                tvOverviewPlaceholder.setText("No Overview");
            }
        }
    }

    @Override
    public void setPresenter(DetailsMVPContract.DetailsBasePresenter presenter) {
        this.detailsBasePresenter = presenter;
    }

    @Override
    public void showProgress(boolean isLoading) {
        if (isLoading) {
            Util.debugLog(TAG, "showProgress: Loading Started");
        } else {
            Util.debugLog(TAG, "showProgress: Loading Stopped");
        }
    }

    @Override
    public void showError(String error) {
        if (getContext() != null) {
            Toast.makeText(getContext(), error, Toast.LENGTH_SHORT).show();
        }
    }

    @Override
    public void displayMovieDetails(MovieDetails movieDetails) {
        loadFetchedViews(movieDetails, null);
    }

    @Override
    public void displayTvDetails(TvSeriesDetails tvSeriesDetails) {
        loadFetchedViews(null, tvSeriesDetails);
    }

    private void loadFetchedViews(MovieDetails movieDetails, TvSeriesDetails tvSeriesDetails) {
        if (isMovie && movieDetails != null) {

            if (!TextUtils.isEmpty(movieDetails.getTagline())) {
                textViewsList.get(2).setText(movieDetails.getTagline());
            } else {
                textViewsList.get(2).setText("No Tagline");
            }

            if (!TextUtils.isEmpty(String.valueOf(movieDetails.getRuntime()))) {
                textViewsList.get(3).setText(String.valueOf(movieDetails.getRuntime() + " mins"));
            } else {
                textViewsList.get(3).setText("-");
            }

            genreAdapter = new GenreAdapter(movieDetails.getGenres());
            rvGenreList.setAdapter(genreAdapter);
            genreAdapter.notifyDataSetChanged();
        } else if (tvSeriesDetails != null) {

            if (tvSeriesDetails.getEpisodeRunTime().size() != 0) {
                textViewsList.get(3).setText(String.valueOf(Double.valueOf((Double) tvSeriesDetails.getEpisodeRunTime().get(0))) + " mins");
            } else {
                textViewsList.get(3).setText("-");
            }

            if (!TextUtils.isEmpty(tvSeriesDetails.getStatus())) {
                textViewsList.get(2).setText(tvSeriesDetails.getStatus());
            } else {
                textViewsList.get(2).setText("No Status");
            }

            genreAdapter = new GenreAdapter(tvSeriesDetails.getGenres());
            rvGenreList.setAdapter(genreAdapter);
            genreAdapter.notifyDataSetChanged();
        }
    }

    // Generate palette asynchronously and use it on a different
    // thread using onGenerated()
    public void createPaletteAsync(Bitmap bitmap) {
        Palette.from(bitmap).generate(new Palette.PaletteAsyncListener() {
            @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
            public void onGenerated(Palette p) {
                // Use generated instance
                Palette.Swatch darkVibrantSwatch = p.getDarkVibrantSwatch();
                Palette.Swatch vibrantSwatch = p.getVibrantSwatch();

                if (darkVibrantSwatch != null && vibrantSwatch != null) {

                    if (getActivity() != null) {
                        Window window = getActivity().getWindow();

                        window.setStatusBarColor(darkVibrantSwatch.getRgb());
                        collapsingToolbarLayout.setContentScrimColor(vibrantSwatch.getRgb());
                    }
                }
            }
        });
    }

    private void setupRecyclerView() {
        FlexboxLayoutManager layoutManager = new FlexboxLayoutManager(getContext());
        layoutManager.setJustifyContent(JustifyContent.FLEX_START);
        rvGenreList.setLayoutManager(layoutManager);
    }
}


text:
require_dependency 'datashift_journey/application_controller'

module DatashiftJourney

  class JourneyEndsController < ApplicationController

    def show
      journey_plan_class = params[:journey_plan_class] ? params[:journey_plan_class].constantize : DatashiftJourney.journey_plan_class

      token = params[:id] || params[:journey_plan_id]

      @journey_plan = token ? journey_plan_class.find(token) : journey_plan_class.new

      @journey_plan.on_journey_end if @journey_plan.respond_to? :on_journey_end

    end

  end
end


text:
namespace aura {
class Window;
}

namespace ash {

namespace internal {
class WindowSelectorTest;
}

class WindowSelector;

// Manages a window selector which displays an overview of all windows and
// allows selecting a window to activate it.
class ASH_EXPORT WindowSelectorController
    : public WindowSelectorDelegate {
 public:
  WindowSelectorController();
  virtual ~WindowSelectorController();

  // Returns true if selecting windows in an overview is enabled. This is false
  // at certain times, such as when the lock screen is visible.
  static bool CanSelect();

  // Enters overview mode. This is essentially the window cycling mode however
  // not released on releasing the alt key and allows selecting with the mouse
  // or touch rather than keypresses.
  void ToggleOverview();

  // Cycles between windows in the given |direction|. It is assumed that the
  // alt key is held down and a key filter is installed to watch for alt being
  // released.
  void HandleCycleWindow(WindowSelector::Direction direction);

  // Returns true if window selection mode is active.
  bool IsSelecting();

  // WindowSelectorDelegate:
  virtual void OnWindowSelected(aura::Window* window) OVERRIDE;
  virtual void OnSelectionCanceled() OVERRIDE;

 private:
  friend class internal::WindowSelectorTest;

  // Dispatched when window selection begins.
  void OnSelectionStarted();

  scoped_ptr<WindowSelector> window_selector_;
  base::Time last_selection_time_;

  DISALLOW_COPY_AND_ASSIGN(WindowSelectorController);
};

}  // namespace ash

#endif  // ASH_WM_OVERVIEW_WINDOW_SELECTOR_CONTROLLER_H_


text:
package reactor.netty.examples.documentation.http.server.metrics.custom;

import reactor.core.publisher.Mono;
import reactor.netty.DisposableServer;
import reactor.netty.http.server.HttpServer;
import reactor.netty.http.server.HttpServerMetricsRecorder;

import java.net.SocketAddress;
import java.time.Duration;

public class Application {

	public static void main(String[] args) {
		DisposableServer server =
				HttpServer.create()
				          .metrics(true, CustomHttpServerMetricsRecorder::new) //<1>
				          .route(r ->
				              r.get("/stream/{n}",
				                   (req, res) -> res.sendString(Mono.just(req.param("n"))))
				               .get("/bytes/{n}",
				                   (req, res) -> res.sendString(Mono.just(req.param("n")))))
				          .bindNow();

		server.onDispose()
		      .block();
	}

	private static class CustomHttpServerMetricsRecorder implements HttpServerMetricsRecorder {

		@Override
		public void recordDataReceived(SocketAddress remoteAddress, String uri, long bytes) {
		}

		@Override
		public void recordDataSent(SocketAddress remoteAddress, String uri, long bytes) {
		}

		@Override
		public void incrementErrorsCount(SocketAddress remoteAddress, String uri) {
		}

		@Override
		public void recordDataReceivedTime(String uri, String method, Duration time) {
		}

		@Override
		public void recordDataSentTime(String uri, String method, String status, Duration time) {
		}

		@Override
		public void recordResponseTime(String uri, String method, String status, Duration time) {
		}

		@Override
		public void recordDataReceived(SocketAddress socketAddress, long l) {
		}

		@Override
		public void recordDataSent(SocketAddress socketAddress, long l) {
		}

		@Override
		public void incrementErrorsCount(SocketAddress socketAddress) {
		}

		@Override
		public void recordTlsHandshakeTime(SocketAddress socketAddress, Duration duration, String s) {
		}

		@Override
		public void recordConnectTime(SocketAddress socketAddress, Duration duration, String s) {
		}

		@Override
		public void recordResolveAddressTime(SocketAddress socketAddress, Duration duration, String s) {
		}
	}
}


text:
package net.sourceforge.marathon.editor.ace;

import java.util.ArrayList;
import java.util.List;
import java.util.logging.Logger;

import net.sourceforge.marathon.json.JSONArray;
import net.sourceforge.marathon.json.JSONObject;

public class AceEditorPreferencesInfo {

    public static final Logger LOGGER = Logger.getLogger(AceEditorPreferencesInfo.class.getName());

    private List<AceEditorTheme> themes = new ArrayList<>();
    private JSONObject options;

    public AceEditorPreferencesInfo(ACEEditor aceEditor) {
        JSONArray o = aceEditor.getThemes().getJSONArray("themes");
        for (int i = 0; i < o.length(); i++) {
            themes.add(new AceEditorTheme(o.getJSONObject(i)));
        }
        options = aceEditor.getOptions();
    }

    public List<AceEditorTheme> getThemes() {
        return themes;
    }

    public AceEditorTheme getSelectedTheme() {
        String selectedTheme = options.getString("theme");
        if (selectedTheme == null) {
            return null;
        }
        for (AceEditorTheme aceEditorTheme : themes) {
            if (aceEditorTheme.getTheme().equals(selectedTheme)) {
                return aceEditorTheme;
            }
        }
        return null;
    }

    public String getKeyboardHandler() {
        return options.getString("keyboardHandler");
    }

    public int getTabSize() {
        return options.getInt("tabSize");
    }

    public boolean getTabConversion() {
        return options.getBoolean("tabConversion");
    }

    public boolean getShowLineNumbers() {
        return options.getBoolean("showLineNumbers");
    }

    public boolean getShowInvisibles() {
        return options.getBoolean("showInvisibles");
    }

    public String getFontSize() {
        return options.getString("fontSize");
    }

}


text:
using System;
using System.Text;
using System.IO;

using log4net.Util;

namespace log4net.Util.PatternStringConverters
{
	/// <summary>
	/// Pattern converter for literal string instances in the pattern
	/// </summary>
	/// <remarks>
	/// <para>
	/// Writes the literal string value specified in the
	/// <see cref="log4net.Util.PatternConverter.Option"/> property to
	/// the output.
	/// </para>
	/// </remarks>
	/// <author>Nicko Cadell</author>
	internal class LiteralPatternConverter : PatternConverter
	{
		/// <summary>
		/// Set the next converter in the chain
		/// </summary>
		/// <param name="pc">The next pattern converter in the chain</param>
		/// <returns>The next pattern converter</returns>
		/// <remarks>
		/// <para>
		/// Special case the building of the pattern converter chain
		/// for <see cref="LiteralPatternConverter"/> instances. Two adjacent
		/// literals in the pattern can be represented by a single combined
		/// pattern converter. This implementation detects when a
		/// <see cref="LiteralPatternConverter"/> is added to the chain
		/// after this converter and combines its value with this converter's
		/// literal value.
		/// </para>
		/// </remarks>
		public override PatternConverter SetNext(PatternConverter pc)
		{
			LiteralPatternConverter literalPc = pc as LiteralPatternConverter;
			if (literalPc != null)
			{
				// Combine the two adjacent literals together
				Option = Option + literalPc.Option;

				// We are the next converter now
				return this;
			}

			return base.SetNext(pc);
		}

		/// <summary>
		/// Write the literal to the output
		/// </summary>
		/// <param name="writer">the writer to write to</param>
		/// <param name="state">null, not set</param>
		/// <remarks>
		/// <para>
		/// Override the formatting behavior to ignore the FormattingInfo
		/// because we have a literal instead.
		/// </para>
		/// <para>
		/// Writes the value of <see cref="log4net.Util.PatternConverter.Option"/>
		/// to the output <paramref name="writer"/>.
		/// </para>
		/// </remarks>
		override public void Format(TextWriter writer, object state)
		{
			writer.Write(Option);
		}

		/// <summary>
		/// Convert this pattern into the rendered message
		/// </summary>
		/// <param name="writer"><see cref="TextWriter" /> that will receive the formatted result.</param>
		/// <param name="state">null, not set</param>
		/// <remarks>
		/// <para>
		/// This method is not used.
		/// </para>
		/// </remarks>
		override protected void Convert(TextWriter writer, object state)
		{
			throw new InvalidOperationException("Should never get here because of the overridden Format method");
		}
	}
}


text:
package fr.univnantes.termsuite.test.unit.utils;

import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.Assert.assertEquals;

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

import fr.univnantes.termsuite.utils.StringUtils;

public class StringUtilsSpec {

	@Before
	public void setUp() {
	}

	@Test
	public void testToOnelineSentences() {
		assertThat(StringUtils.toOnelineSentences("Bonjour tout le monde."))
			.isEqualTo("Bonjour tout le monde.");

		assertThat(StringUtils.toOnelineSentences("Bonjour\ntout le monde."))
		.isEqualTo("Bonjour\ntout le monde.");
		assertThat(StringUtils.toOnelineSentences("Bonjour\n\n  \ntout le monde."))
		.isEqualTo("Bonjour\ntout le monde.");

	}

	@Test
	public void nbDigitSequences() {
		assertEquals(0, StringUtils.nbDigitSequences("ergqsdrgsqergeq"));
		assertEquals(1, StringUtils.nbDigitSequences("er232gqsdrgsqergeq"));
		assertEquals(1, StringUtils.nbDigitSequences("er232gqsdrgsqergeq"));
		assertEquals(2, StringUtils.nbDigitSequences("er232gqsdrg2sqergeq"));
	}

	@Test
	public void getOrthographicScore() {
		assertEquals(1d, StringUtils.getOrthographicScore("eqergeq"), 0.00001);
		assertEquals(1d/1.8, StringUtils.getOrthographicScore("123eqergeq"), 0.00001);
		assertEquals(1d/1.8, StringUtils.getOrthographicScore("eqergeq456"), 0.00001);
		assertEquals(0.85, StringUtils.getOrthographicScore("3eqergeq"), 0.00001);
		assertEquals(0.85, StringUtils.getOrthographicScore("eqergeq4"), 0.00001);
		assertEquals(1d/1.8, StringUtils.getOrthographicScore("eq2ergeq"), 0.00001);
		assertEquals(1d/1.8, StringUtils.getOrthographicScore("eq25ergeq"), 0.00001);
		assertEquals(1d/(1.8*1.8), StringUtils.getOrthographicScore("eq25erge2q"), 0.00001);
		assertEquals(0.70d/(1.8), StringUtils.getOrthographicScore("e25"), 0.00001);
		assertEquals(0.70d/1.8, StringUtils.getOrthographicScore("e2a"), 0.00001);
		assertEquals(0.95d/1.8/2, StringUtils.getOrthographicScore("e2a*"), 0.00001);

	}

	@Test
	public void nbDigits() {
		assertEquals(0, StringUtils.nbDigits("eqergeq"));
		assertEquals(1, StringUtils.nbDigits("eqerge2q"));
		assertEquals(2, StringUtils.nbDigits("eq34ergeq"));
		assertEquals(2, StringUtils.nbDigits("eqe2rg4eq"));
	}

}


text:
package vcs.citydb.wfs.kvp.parser;

import vcs.citydb.wfs.exception.KVPParseException;

public class StringParser extends ValueParser<String> {

	@Override
	public String parse(String key, String value) throws KVPParseException {
		return value.trim();
	}

}


text:
package main

import (
	"os"

	"github.com/codegangsta/cli"
	"github.com/nati/goifmap/goifmap"
)

//Run execute main command
func Run(name, usage, version string) {
	app := cli.NewApp()
	app.Name = name
	app.Usage = usage
	app.Version = version
	app.Commands = []cli.Command{
		ifMapYAMLDumpClient(),
		serverCommand(),
	}
	app.Run(os.Args)
}

func ifMapYAMLDumpClient() cli.Command {
	return cli.Command{
		Name:      "yaml_client",
		ShortName: "yaml",
		Usage:     "Watch ifmap server and dumps data in yaml format",
		Description: `
Watch ifmap server and dumps data in yaml format`,
		Flags: []cli.Flag{
			cli.StringFlag{Name: "host", Value: "", Usage: "Host Name"},
			cli.StringFlag{Name: "username, u", Value: "", Usage: "Username"},
			cli.StringFlag{Name: "password, p", Value: "", Usage: "Password"},
		},
		Action: func(c *cli.Context) {
			host := c.String("host")
			username := c.String("username")
			password := c.String("password")
			ifmap, err := goifmap.NewIFMapClient(host, username, password)
			if err != nil {
				panic(err)
			}
			err = ifmap.Poll(&goifmap.LoggingCallback{})
			if err != nil {
				panic(err)
			}
		},
	}
}

func serverCommand() cli.Command {
	return cli.Command{
		Name:      "server",
		ShortName: "srv",
		Usage:     "Start ifmap server",
		Description: `
Start ifmap server`,
		Flags: []cli.Flag{
			cli.StringFlag{Name: "address", Value: "", Usage: "Bind Address"},
			cli.StringFlag{Name: "cert", Value: "", Usage: "Path for cert file"},
			cli.StringFlag{Name: "key", Value: "", Usage: "Path for key file"},
			cli.StringFlag{Name: "backend", Value: "file", Usage: "backend type"},
			cli.StringFlag{Name: "watchkey", Value: "/config", Usage: "watch key"},
			cli.StringFlag{Name: "connection, c", Value: "ile", Usage: "backend connection"},
		},
		Action: func(c *cli.Context) {
			address := c.String("address")
			cert := c.String("cert")
			key := c.String("key")
			backend := c.String("backend")
			connection := c.String("connection")
			watchkey := c.String("watchkey")
			server, err := goifmap.NewIFMapServer(
				address, cert, key, backend, connection, watchkey)
			if err != nil {
				panic("backend error")
			}
			server.Start()
		},
	}
}

func main() {
	Run("goifmap", "Goifmap", "0.1.0")
}


text:
package com.sleepycat.persist.model;

import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.DirectoryScanner;
import org.apache.tools.ant.Task;
import org.apache.tools.ant.types.FileSet;

/**
 * An {@code ant} task for running the {@link ClassEnhancer}.
 *
 *
{@code ClassEnhancerTask} objects are thread-safe.  Multiple threads may
 * safely call the methods of a shared {@code ClassEnhancerTask} object.

 *
 *
The class enhancer task element has no attributes.  It may contain one or
 * more nested {@code fileset} elements specifying the classes to be enhanced.
 * The class files are replaced when they are enhanced, without changing the
 * file modification date.  For example:

 *
 *

 * {@literal <taskdef name="enhance-persistent-classes"}
 *          {@literal classname="com.sleepycat.persist.model.ClassEnhancerTask"}
 *          {@literal classpath="${je.home}/lib/je-<version>.jar"/>}
 *
 * {@literal <target name="main">}
 *     {@literal <enhance-persistent-classes verbose="no">}
 *         {@literal <fileset dir="classes"/>}
 *     {@literal </enhance-persistent-classes>}
 * {@literal </target>}

 *
 *
The verbose attribute may be specified as "true", "yes" or "on" (like
 * other Ant boolean attributes) to print the name of each class file that is
 * enhanced.  The total number of class files enhanced will always be
 * printed.

 *
 * @author Mark Hayes
 */
public class ClassEnhancerTask extends Task {

    private List<FileSet> fileSets = new ArrayList<FileSet>();
    private boolean verbose;

    public void execute() throws BuildException {
        if (fileSets.size() == 0) {
            throw new BuildException("At least one fileset must be specified");
        }
        try {
            int nFiles = 0;
            ClassEnhancer enhancer = new ClassEnhancer();
            enhancer.setVerbose(verbose);
            for (FileSet fileSet : fileSets) {
                DirectoryScanner scanner =
                    fileSet.getDirectoryScanner(getProject());
                String[] fileNames = scanner.getIncludedFiles();
                for (String fileName : fileNames) {
                    File file = new File(scanner.getBasedir(), fileName);
                    try {
                        nFiles += enhancer.enhanceFile(file);
                    } catch (IOException e) {
                        throw new BuildException(e);
                    }
                }
            }
            if (nFiles > 0) {
                System.out.println("Enhanced: " + nFiles + " files");
            }
        } catch (RuntimeException e) {
            e.printStackTrace();
            throw e;
        }
    }

    public void addConfiguredFileset(FileSet files) {
        fileSets.add(files);
    }

    public void setVerbose(boolean verbose) {
        this.verbose = verbose;
    }
}


text:
module UiBibz::Ui::Core::Forms::Dropdowns
  # Create a button dropdown
  #
  # This element is an extend of UiBibz::Ui::Core::Forms::Dropdowns::Dropdown.
  #
  # ==== Attributes
  #
  # * +content+ - Content of element
  # * +options+ - Options of element
  # * +html_options+ - Html Options of element
  #
  # ==== Options
  #
  # You can add HTML attributes using the +html_options+.
  # You can pass arguments in options attribute:
  # * +status+ - status of element with symbol value:
  #   (+:primary+, +:secondary+, +:info+, +:warning+, +:danger+)
  # * +size+
  #   (+:xs+, +:sm+, +:lg+)
  # * +outline+ - Boolean
  # * +state+ - Symbol (+:active+, +:disabled)
  # * +type+ - Symbol (+:block)
  # * +glyph+ - Add glyph with name or hash options
  #   * +name+ - String
  #   * +size+ - Integer
  #   * +type+ - Symbol
  #
  # ==== Signatures
  #
  #   UiBibz::Ui::Core::Forms::Dropdowns::SplitDropdown.new(options = nil, html_options = nil).tap do |d|
  #     d.list content = nil, options = nil, html_options = nil, &block
  #     d.list content = nil, options = nil, html_options = nil, &block
  #     d.list content = nil, options = nil, html_options = nil, &block
  #     ...
  #   end
  #
  # ==== Examples
  #
  #   UiBibz::Ui::Core::Forms::Dropdowns::SplitDropdown.new(name, status: :success).tap do |d|
  #     d.list link_to('test', '#')
  #     d.list('---')
  #     d.list('Header 1', { type: :header })
  #     d.list link_to('test2', '#')
  #   end.render
  #
  # ==== Helper
  #
  #  split_dropdown(name, options = {}, html_options = {}) do |b|
  #     d.list(content, options = {}, html_options = {})
  #     d.list(options = {}, html_options = {}) do
  #       content
  #     end
  #   end
  #
  class SplitDropdown < UiBibz::Ui::Core::Forms::Dropdowns::Dropdown
    # See UiBibz::Ui::Core::Forms::Dropdowns::Dropdown.initialize

    # Render html tag
    def pre_render
      content_tag :div, html_options do
        concat button_html
        concat split_html
        concat ul_html
      end
    end

    private

    def component_html_classes
      ['btn-group', position, alignment, open, inline, keep_open]
    end

    def button_html
      content_tag :button, button_content, (options[:html_button] || {}).merge(class: join_classes('btn', button_status, size, options[:html_button].try(:[], :class)))
    end

    def split_html
      content_tag :button, split_content, (options[:html_split] || {}).merge(class: split_classes, type: 'button',
                                                                             'data-bs-toggle' => 'dropdown', 'aria-haspopup' => true, 'aria-expanded' => false)
    end

    def split_content
      src_only
    end

    def split_classes
      join_classes('btn', button_status, size, 'dropdown-toggle', 'dropdown-toggle-split', options[:split_html].try(:[], :class))
    end

    def src_only
      content_tag :span, 'Toggle Dropdown', class: 'sr-only'
    end
  end
end


text:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<!--
    Mapping file autogenerated by MyEclipse Persistence Tools
-->
<hibernate-mapping>
    <class name="com.model.Rankings" table="rankings" catalog="sole_love">
        <id name="id" type="java.lang.Integer">
            <column name="id" />
            <generator class="identity" />
        </id>
        <property name="saleroom" type="java.lang.Double">
            <column name="saleroom" precision="22" scale="0">
                <comment>销售额</comment>
            </column>
        </property>
        <property name="name" type="java.lang.String">
            <column name="name" length="20">
                <comment>用户名</comment>
            </column>
        </property>
        <property name="city" type="java.lang.String">
            <column name="city" length="20">
                <comment>城市</comment>
            </column>
        </property>
        <property name="updatetime" type="java.sql.Timestamp">
            <column name="updatetime" length="0">
                <comment>更新时间</comment>
            </column>
        </property>
        <property name="creationtime" type="java.sql.Timestamp">
            <column name="creationtime" length="0">
                <comment>创建时间</comment>
            </column>
        </property>
    </class>
</hibernate-mapping>


text:
package com.researchworx.cresco.controller.core;

import com.researchworx.cresco.library.messaging.MsgEvent;
import com.researchworx.cresco.library.plugin.core.CExecutor;
import com.researchworx.cresco.library.utilities.CLogger;

class Executor extends CExecutor {
    private Launcher mainPlugin;
    private CLogger logger;

    Executor(Launcher plugin) {
        super(plugin);
        this.mainPlugin = plugin;
        this.logger = new CLogger(Executor.class, plugin.getMsgOutQueue(), plugin.getRegion(), plugin.getAgent(), plugin.getPluginID());
    }

    @Override
    public MsgEvent processConfig(MsgEvent msg) {
        logger.trace("Processing Config message");
        if (msg.getParam("configtype") == null || msg.getMsgBody() == null) return null;
        logger.debug("Config-type is properly set, as well as message body");
        switch (msg.getParam("configtype")) {
            case "comminit":
                logger.debug("comminit message type found");
                mainPlugin.commInit();
                msg.setParam("set_region", this.plugin.getRegion());
                msg.setParam("set_agent", this.plugin.getAgent());
                msg.setParam("is_regional_controller", Boolean.toString(this.mainPlugin.isRegionalController()));
                msg.setParam("is_active", Boolean.toString(this.plugin.isActive()));
                logger.debug("Returning communication details to Cresco agent");
                return msg;
            default:
                logger.debug("Unknown configtype found: {}", msg.getParam("configtype"));
                return null;
        }
    }
}


text:
from geotrek.land.tests.test_filters import LandFiltersTest

from geotrek.trekking.filters import TrekFilterSet
from geotrek.trekking.tests.factories import TrekFactory

class TrekFilterLandTest(LandFiltersTest):

    filterclass = TrekFilterSet

    def test_land_filters_are_well_setup(self):
        filterset = TrekFilterSet()
        self.assertIn('work', filterset.filters)

    def create_pair_of_distinct_path(self):
        useless_path, seek_path = super().create_pair_of_distinct_path()
        self.create_pair_of_distinct_topologies(TrekFactory, useless_path, seek_path)
        return useless_path, seek_path


text:
from __future__ import division, absolute_import, print_function

from numpy import put
from numpy.testing import TestCase, assert_raises

class TestPut(TestCase):

    def test_bad_array(self):
        # We want to raise a TypeError in the
        # case that a non-ndarray object is passed
        # in since `np.put` modifies in place and
        # hence would do nothing to a non-ndarray
        v = 5
        indx = [0, 2]
        bad_array = [1, 2, 3]
        assert_raises(TypeError, put, bad_array, indx, v)


text: <iframe id="mypdfdoc" src="" width="695px" height="680px"></iframe>


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="ShantibanApp">
    <meta name="author" content="ShantibanApp">

    <title>Shantiban Society Financial Model</title>

    <link href="css/bootstrap.min.css" rel="stylesheet">

    <link href="css/agency.css" rel="stylesheet">
    <link rel="stylesheet" type="text/css" href="table.css">

    <link href="font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
    <link href="https://fonts.googleapis.com/css?family=Montserrat:400,700" rel="stylesheet" type="text/css">
    <link href='https://fonts.googleapis.com/css?family=Kaushan+Script' rel='stylesheet' type='text/css'>
    <link href='https://fonts.googleapis.com/css?family=Droid+Serif:400,700,400italic,700italic' rel='stylesheet' type='text/css'>
    <link href='https://fonts.googleapis.com/css?family=Roboto+Slab:400,100,300,700' rel='stylesheet' type='text/css'>

                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
                    Toggle navigation

                </button>
                Shantiban Society Financial Model

Club House

    Check
    Member Name
    Plot no.
    Hours Rented
    Cost
    Date Rented
    Payment Date
    Payment Method
    Cheque Number

<?php
$servername = "localhost";
$username = "root";
$password = "root";
$dbname = "PARS";

// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
    die("Connection failed: " . $conn->connect_error);
}

$sql = "SELECT * FROM Members";
$result = $conn->query($sql);
?>

Maintenance reocord

    Check
	Member name
	Plot number
Telephone
Mobile number
email id

	Paid for
	Total amount paid

<?php
$j = 0;
if ($result->num_rows > 0) {
    // output data of each row
    while($row = $result->fetch_assoc()) {
        $j = $j + 1;
        echo "
";
        echo "";
        echo $row["member_name"];
        echo "";

        echo "";
        echo $row["plot_number"];
        echo "";

        echo "";
        echo $row["telephone"];
        echo "";

        echo "";
        echo $row["mobile_number"];
        echo "";

        echo "";
        echo $row["email_id"];
        echo "";
		$sql1 = "SELECT * FROM AnnualMaintenance where AnnualMaintenance.plot_number = Members.plot_number";
		$result1 = $conn->query($sql1);
		$duration = "Not Paid";
		$amount = 0;
		if($result1->num_rows > 0) {
		    while($row = $result->fetch_assoc()) {
				$amount = $amount + $row[total_amount];
				if($row[duration] == '1 year'||$row[duration] == '12 months') {
					$duration = '1 year';
				}
				if($duration == '1 year') {
					break;
				}
				else {
					if(substr($row[duration], 2,5) == 'month') {
						if($a = intval(substr($duration, 0,1) + substr($row[duration], 0,1)) <= 12) {
							$duration = $a +  ' months';
						}
					}
				}
			}
		}
         echo "";
        echo $duration;
        echo "";

         echo "";
        echo $amount;
        echo "";

        echo "
";
    }
} else {
    echo "No Maintenance Records";
}
echo"
";
echo "

";

echo "";
echo"

";

$conn->close();
?>


text:
cask :v1 => 'datagraph' do
  version :latest
  sha256 :no_check

  url 'http://www.visualdatatools.com/DataGraph/DataGraph.dmg'
  homepage 'http://www.visualdatatools.com/DataGraph/'
  license :unknown    # todo: change license and remove this comment; ':unknown' is a machine-generated placeholder

  app 'DataGraph.app'
end


text:
require 'cukesalad/salad'
require 'cukesalad/cucumber_steps'


text:
<?php

namespace Yamiko\CacheAdministrationBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Session\Session;
use Yamiko\CacheAdministrationBundle\CacheManager;

/**
 * Default controller.
 *
 * Class DefaultController
 */
class DefaultController extends Controller
{

    /** @var CacheManager */
    private $cacheManager;

    /** @var Session */
    private $session;

    /**
     * @param CacheManager $cacheManager
     * @param Session      $session
     */
    public function __construct(CacheManager $cacheManager, Session $session)
    {
        $this->cacheManager = $cacheManager;
        $this->session = $session;
    }

    /**
     * clears annotations cache
     * @param Request $request
     * @return RedirectResponse
     */
    public function annotationsAction(Request $request)
    {
        $this->cacheManager->clearAnnotations();

        return $this->flashResponse($request, 'annotations', true);
    }

    /**
     * clear assetic cache
     * @param Request $request
     * @return RedirectResponse
     */
    public function asseticAction(Request $request)
    {
        $this->cacheManager->clearAssetic();

        return $this->flashResponse($request, 'assetic', true);
    }

    /**
     * clear doctrine cache
     * @param Request $request
     * @return RedirectResponse
     */
    public function doctrineAction(Request $request)
    {
        $this->cacheManager->clearDoctrine();

        return $this->flashResponse($request, 'doctrine', true);
    }

    /**
     * clear translations cache
     * @param Request $request
     * @return RedirectResponse
     */
    public function translationsAction(Request $request)
    {
        $this->cacheManager->clearTranslations();

        return $this->flashResponse($request, 'translations', true);
    }

    /**
     * clear profiles cache
     * @param Request $request
     * @return RedirectResponse
     */
    public function profilesAction(Request $request)
    {
        $this->cacheManager->clearProfiles();

        return $this->flashResponse($request, 'profilers', true);
    }

    /**
     * clear container cache
     * @param Request $request
     * @return RedirectResponse
     */
    public function containerAction(Request $request)
    {
        $this->cacheManager->clearContainer();

        return $this->flashResponse($request, 'container', true);
    }

    /**
     * clear routing cache
     * @param Request $request
     * @return RedirectResponse
     */
    public function routingAction(Request $request)
    {
        $this->cacheManager->clearAnnotations();

        return $this->flashResponse($request, 'annotations', true);
    }

    /**
     * clear class map cache
     * @param Request $request
     * @return RedirectResponse
     */
    public function classesAction(Request $request)
    {
        $this->cacheManager->clearClasses();

        return $this->flashResponse($request, 'classes', true);
    }

    /**
     * clear templates cache
     * @param Request $request
     * @return RedirectResponse
     */
    public function templatesAction(Request $request)
    {
        $this->cacheManager->clearTemplates();

        return $this->flashResponse($request, 'templates', true);
    }

    /**
     * clear all caches
     * @param Request $request
     * @return RedirectResponse
     */
    public function allAction(Request $request)
    {
        $this->cacheManager->clearAll();

        return $this->flashResponse($request, 'all', true);
    }

    /**
     * generates a flash message and redirects the user to the previous page or the home page
     * @param Request $request
     * @param string $cacheName
     * @param bool|true $success
     * @return RedirectResponse
     */
    protected function flashResponse(Request $request, $cacheName, $success = true)
    {
        $flashType = $success ? 'success' : 'alert';
        $flashMessage = $success ? sprintf("Successfully removed %s cache(s)", $cacheName) : sprintf(
            "Unable to remove %s cache",
            $cacheName
        );
        $redirect = $request->headers->get('referer') ?: "/";

        $this->session->getFlashBag()->add($flashType, $flashMessage);

        return new RedirectResponse($redirect, 302);
    }
}


text:
using API.Domain;
using API.Interface;
using MongoRepository;
using ServiceStack;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace API.Services
{
    public class ActivityService : IService
    {
        public MongoRepository<Activity> Repository { get; set; }  //Injected by IOC

        public object Get(ActivityAPI request)
        {
            return Repository.Where(x => x.Description == request.Description);
        }

        public object Post(ActivityAPI request)
        {
            var activity = new Activity { Description = request.Description };
            return Repository.Add(activity);
        }

    }
}


text:
<link rel="import"
      href="/bower_components/polymer/polymer.html">
<link rel="import" href="/bower_components/google-map/google-map.html">

<dom-module id="hack-map">
    <template>
        <google-map
                latitude="{{latitude}}"
                longitude="{{longitude}}"
                zoom="{{zoom}}"
                showCenterMarker="{{showCenterMarker}}"
                apiKey="AIzaSyAfeGSI9u8wcryhbjb1CXfwiE5C3LIz8O8"
                >

        </google-map>
    </template>
</dom-module>

<script>

    Polymer({
        // properties and methods here
        is: "hack-map",
        created: function() {
            var map = this;

            // get geo location
            if (navigator && navigator.geolocation) {
                navigator.geolocation.getCurrentPosition(updateMapCenter);
            }
            else {
                console.error('geolocaiton not supported.');
            }

            function updateMapCenter(position) {
                map.properties.latitute = position.coords.latitude;
                map.properties.longitude = position.coords.longitude;
                var gMap = document.querySelector('google-map');
                gMap.map = gMap;
                gMap.latitude = map.properties.latitute;
                gMap.longitude = map.properties.longitude;
            }
        },
        addPin: function(lat, lon, title, info) {
            var gMap = document.querySelector('google-map');
            var pin = document.createElement('google-map-marker');

            pin.latitude = lat;
            pin.longitude = lon;
            pin.title = title;
            pin.innerHTML = info;

//            gMap.appendChild(pin);
            Polymer.dom(gMap).appendChild(pin);
        },
        properties: {
            latitude: {
                type: Number,
                value: 43.029614
            },
            longitude: {
                type: Number,
                value: -87.909111
            },
            zoom: {
                type: Number,
                value: 16
            },
            showCenterMarker: {
                type: Boolean,
                value: true
            }
        }
    });
</script>


text:
package net.jsunit.interceptor;

import com.opensymphony.xwork.Action;
import net.jsunit.BrowserTestRunner;
import net.jsunit.action.JsUnitBrowserTestRunnerAction;

public class BrowserTestRunnerInterceptor extends JsUnitInterceptor {

    private static BrowserTestRunnerSource source = new DefaultBrowserTestRunnerSource();

    public static void setBrowserTestRunnerSource(BrowserTestRunnerSource aSource) {
        source = aSource;
    }

    protected void execute(Action action) {
        JsUnitBrowserTestRunnerAction jsUnitAction = ((JsUnitBrowserTestRunnerAction) action);
        BrowserTestRunner runner = source.getRunner();
        jsUnitAction.setBrowserTestRunner(runner);
    }

}


text:
package little_project;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

/**
 * Created by kcubria on 2/4/16.
 */

@SpringBootApplication(scanBasePackages = "little_project")
public class Application extends WebMvcConfigurerAdapter {

	public static void main(String[] args) throws Exception {
		SpringApplication.run(Application.class, args);
	}
}


text:
/*
 * Tests for Template module - EasyAutocomplete
 *
 * @author Łukasz Pawełczak
 */

QUnit.test("Template - module", function( assert ) {

	//execute
	var Template = new EasyAutocomplete.Template();

	//assert
	assert.ok(typeof EasyAutocomplete.Template === "function", "Constructor found");
	assert.ok(Template, "Constructor");
	assert.ok(typeof Template === "object", "created object");
	assert.ok(typeof Template.build === "function", "Template has method build");
});

QUnit.test("Template - default template", function( assert ) {

	//given
	var options = {};

	//execute
	var Template = new EasyAutocomplete.Template(options);

	//assert
	assert.ok(typeof Template.build == "function", "Build is function");
	assert.ok(Template.build("suggestion") === "suggestion", "Build returns value");
	assert.ok(Template.build.toString() === 'function (element) { return element; }', "Build equals def value");

	expect(3);
});

QUnit.test("Template - description template", function( assert ) {

	//given
	var	options = {type: "description", fields: {description: "description"}};

	//execute
	var template = new EasyAutocomplete.Template(options);

	//assert
	assert.ok(typeof template.build == "function", "Build is function");
	assert.ok(template.build("bruce", {description: "willis"}) === "bruce - willis", "Build returns value");
	//assert.ok(template.build.toString() === 'function (element) {	return element + " - description"; }', "Build equals def value");
	expect(2);
});

QUnit.test("Template - custom template", function( assert ) {

	//given
	var	options = {type: "custom", method: function() {}};

	//execute
	var template = new EasyAutocomplete.Template(options);

	//assert
	assert.ok(typeof template.build === "function", "Build is function");
	assert.ok(template.build.toString() === 'function () {}', "Build equals def value");
	expect(2);
});

QUnit.test("Template - cssClass description", function( assert ) {

	//given
	var	options = {type: "description", method: function() {}};

	//execute
	var template = new EasyAutocomplete.Template(options);

	//assert
	assert.ok(typeof template.getTemplateClass === "function", "Build is function");
	assert.ok(template.getTemplateClass() === 'eac-description', "Build equals def value");
	expect(2);
});


text:
package org.bulatnig.smpp.pdu.impl;

import org.bulatnig.smpp.pdu.CommandId;
import org.bulatnig.smpp.pdu.PduException;
import org.bulatnig.smpp.util.ByteBuffer;

/**
 * This message can be sent by either the ESME or SMSC and is used to provide a
 * confidencecheck of the communication path between an ESME and an SMSC. On
 * receipt of this request the receiving party should respond with an
 * enquire_link_resp, thus verifying that the application level connection
 * between the SMSC and the ESME is functioning. The ESME may also respond by
 * sending any valid SMPP primitive.
 *
 * @author Bulat Nigmatullin
 */
public class EnquireLink extends AbstractPdu {

    public EnquireLink() {
        super(CommandId.ENQUIRE_LINK);
    }

    protected EnquireLink(ByteBuffer bb) throws PduException {
        super(bb);
    }

    @Override
    protected ByteBuffer body() {
        return null;
    }

}


text:
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

using System;
using System.IO;
using Microsoft.Extensions.Configuration;

namespace Microsoft.Azure.WebJobs.Extensions.Storage.Common.Tests
{
    public static class TestConfigurationBuilderExtensions
    {
        /// <summary>
        /// Allows configuration to come from %userprofile%\.azurefunctions\appsettings.tests.json
        /// </summary>
        /// <param name="builder">The configuration builder.</param>
        /// <returns>The modified configuration builder.</returns>
        public static IConfigurationBuilder AddTestSettings(this IConfigurationBuilder builder)
        {
            string configPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".azurefunctions", "appsettings.tests.json");
            return builder.AddJsonFile(configPath, true);
        }
    }
}


text:
package com.esri.arcgisruntime.sample.statisticalquerygroupandsort;

import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;

import android.content.Context;
import android.graphics.Typeface;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseExpandableListAdapter;
import android.widget.TextView;

/**
 * Expandable list view which displays grouped results from a LinkedHashMap.
 */
class ExpandableListViewAdapter extends BaseExpandableListAdapter {

  private final Context context;
  private final List<String> mGroupList;
  private final LinkedHashMap<String, List<String>> mStatList;

  public ExpandableListViewAdapter(Context context, LinkedHashMap<String, List<String>> statList) {
    this.context = context;
    mGroupList = new ArrayList<>(statList.keySet());
    mStatList = statList;
  }

  @Override
  public Object getChild(int groupListPosition, int statListPosition) {
    return mStatList.get(mGroupList.get(groupListPosition)).get(statListPosition);
  }

  @Override
  public long getChildId(int groupPosition, int statListPosition) {
    return statListPosition;
  }

  @Override
  public View getChildView(int groupListPosition, final int statListPosition, boolean isLastChild, View convertView,
      ViewGroup parent) {
    final String expandedListText = (String) getChild(groupListPosition, statListPosition);
    if (convertView == null) {
      LayoutInflater layoutInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
      convertView = layoutInflater.inflate(android.R.layout.simple_expandable_list_item_1, null);
    }
    TextView expandedListTextView = convertView.findViewById(android.R.id.text1);
    expandedListTextView.setText(expandedListText);
    return convertView;
  }

  @Override
  public int getChildrenCount(int listPosition) {
    return mStatList.get(mGroupList.get(listPosition)).size();
  }

  @Override
  public Object getGroup(int listPosition) {
    return mGroupList.get(listPosition);
  }

  @Override
  public int getGroupCount() {
    return mGroupList.size();
  }

  @Override
  public long getGroupId(int listPosition) {
    return listPosition;
  }

  @Override
  public View getGroupView(int listPosition, boolean isExpanded, View convertView, ViewGroup parent) {
    String listTitle = (String) getGroup(listPosition);
    if (convertView == null) {
      LayoutInflater layoutInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
      convertView = layoutInflater.inflate(android.R.layout.simple_expandable_list_item_1, null);
    }
    TextView listTitleTextView = convertView.findViewById(android.R.id.text1);
    listTitleTextView.setTypeface(null, Typeface.BOLD);
    listTitleTextView.setText(listTitle);
    return convertView;
  }

  @Override
  public boolean hasStableIds() {
    return false;
  }

  @Override
  public boolean isChildSelectable(int listPosition, int expandedListPosition) {
    return true;
  }
}