text:
package com.anysoftkeyboard.quicktextkeys;

import static androidx.test.core.app.ApplicationProvider.getApplicationContext;

import android.annotation.SuppressLint;
import com.anysoftkeyboard.AnySoftKeyboardRobolectricTestRunner;
import com.anysoftkeyboard.prefs.RxSharedPrefs;
import com.menny.android.anysoftkeyboard.AnyApplication;
import com.menny.android.anysoftkeyboard.R;
import java.util.List;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;

@RunWith(AnySoftKeyboardRobolectricTestRunner.class)
@SuppressLint("CommitPrefEdits")
public class QuickKeyHistoryRecordsTest {

    private RxSharedPrefs mSharedPreferences;
    private QuickKeyHistoryRecords mUnderTest;

    @Before
    public void setUp() {
        mSharedPreferences = AnyApplication.prefs(getApplicationContext());
    }

    @Test
    public void testLoadHasDefaultValue() {
        mUnderTest = new QuickKeyHistoryRecords(mSharedPreferences);
        List<QuickKeyHistoryRecords.HistoryKey> keys = mUnderTest.getCurrentHistory();
        Assert.assertNotNull(keys);
        Assert.assertEquals(1, keys.size());
        Assert.assertEquals(QuickKeyHistoryRecords.DEFAULT_EMOJI, keys.get(0).name);
        Assert.assertEquals(QuickKeyHistoryRecords.DEFAULT_EMOJI, keys.get(0).value);
    }

    @Test
    public void testEmptyHistory() {
        mSharedPreferences
                .getString(
                        R.string.settings_key_quick_text_history, R.string.settings_default_empty)
                .set("1,2,3,4,5,6");
        mUnderTest = new QuickKeyHistoryRecords(mSharedPreferences);
        List<QuickKeyHistoryRecords.HistoryKey> keys = mUnderTest.getCurrentHistory();
        Assert.assertEquals(3, keys.size());
        Assert.assertEquals("1", keys.get(0).name);
        Assert.assertEquals("2", keys.get(0).value);
        Assert.assertEquals("3", keys.get(1).name);
        Assert.assertEquals("4", keys.get(1).value);
        Assert.assertEquals("5", keys.get(2).name);
        Assert.assertEquals("6", keys.get(2).value);

        mUnderTest.clearHistory();
        // There has to be at least 1 entry in the history, have to fix this
        Assert.assertEquals(keys.size(), 1);
    }

    @Test
    public void testLoad() {
        mSharedPreferences
                .getString(
                        R.string.settings_key_quick_text_history, R.string.settings_default_empty)
                .set("1,2,3,4,5,6");
        mUnderTest = new QuickKeyHistoryRecords(mSharedPreferences);
        List<QuickKeyHistoryRecords.HistoryKey> keys = mUnderTest.getCurrentHistory();
        Assert.assertEquals(3, keys.size());
        Assert.assertEquals("1", keys.get(0).name);
        Assert.assertEquals("2", keys.get(0).value);
        Assert.assertEquals("3", keys.get(1).name);
        Assert.assertEquals("4", keys.get(1).value);
        Assert.assertEquals("5", keys.get(2).name);
        Assert.assertEquals("6", keys.get(2).value);
    }

    @Test
    public void testStoreAndLoadFromPrefs() {
        mUnderTest = new QuickKeyHistoryRecords(mSharedPreferences);
        mUnderTest.store("k", "v");
        List<QuickKeyHistoryRecords.HistoryKey> keys = mUnderTest.getCurrentHistory();
        Assert.assertEquals(2, keys.size());
        Assert.assertEquals(QuickKeyHistoryRecords.DEFAULT_EMOJI, keys.get(0).name);
        Assert.assertEquals(QuickKeyHistoryRecords.DEFAULT_EMOJI, keys.get(0).value);
        Assert.assertEquals("k", keys.get(1).name);
        Assert.assertEquals("v", keys.get(1).value);

        final QuickKeyHistoryRecords newRecord = new QuickKeyHistoryRecords(mSharedPreferences);
        final List<QuickKeyHistoryRecords.HistoryKey> newHistory = newRecord.getCurrentHistory();

        Assert.assertNotSame(keys, newHistory);
        Assert.assertEquals(keys.size(), newHistory.size());
        for (int historyIndex = 0; historyIndex < keys.size(); historyIndex++) {
            final QuickKeyHistoryRecords.HistoryKey k1 = keys.get(historyIndex);
            final QuickKeyHistoryRecords.HistoryKey k2 = newHistory.get(historyIndex);
            Assert.assertEquals(k1.name, k2.name);
            Assert.assertEquals(k1.value, k2.value);
        }
    }

    @Test
    public void testLoadMoreThanLimit() {
        StringBuilder exceedString = new StringBuilder();
        for (int i = 0; i < QuickKeyHistoryRecords.MAX_LIST_SIZE * 2; i++) {
            exceedString
                    .append(Integer.toString(2 * i))
                    .append(QuickKeyHistoryRecords.HISTORY_TOKEN_SEPARATOR)
                    .append(Integer.toString(2 * i + 1))
                    .append(QuickKeyHistoryRecords.HISTORY_TOKEN_SEPARATOR);
        }
        mSharedPreferences
                .getString(
                        R.string.settings_key_quick_text_history, R.string.settings_default_empty)
                .set(exceedString.toString());
        mUnderTest = new QuickKeyHistoryRecords(mSharedPreferences);
        List<QuickKeyHistoryRecords.HistoryKey> keys = mUnderTest.getCurrentHistory();
        Assert.assertEquals(QuickKeyHistoryRecords.MAX_LIST_SIZE, keys.size());
        Assert.assertEquals("0", keys.get(0).name);
        Assert.assertEquals("1", keys.get(0).value);
        Assert.assertEquals(
                Integer.toString(QuickKeyHistoryRecords.MAX_LIST_SIZE * 2 - 2),
                keys.get(QuickKeyHistoryRecords.MAX_LIST_SIZE - 1).name);
        Assert.assertEquals(
                Integer.toString(QuickKeyHistoryRecords.MAX_LIST_SIZE * 2 - 1),
                keys.get(QuickKeyHistoryRecords.MAX_LIST_SIZE - 1).value);
    }

    @Test
    public void testStore() {
        mUnderTest = new QuickKeyHistoryRecords(mSharedPreferences);
        mUnderTest.store("1", "2");
        mUnderTest.store("3", "4");
        mUnderTest.store("5", "6");

        final List<QuickKeyHistoryRecords.HistoryKey> currentHistory =
                mUnderTest.getCurrentHistory();
        Assert.assertEquals(3 + 1 /*first default emoji*/, currentHistory.size());

        Assert.assertEquals(QuickKeyHistoryRecords.DEFAULT_EMOJI, currentHistory.get(0).name);
        Assert.assertEquals(QuickKeyHistoryRecords.DEFAULT_EMOJI, currentHistory.get(0).value);
        Assert.assertEquals("1", currentHistory.get(1).name);
        Assert.assertEquals("2", currentHistory.get(1).value);
        Assert.assertEquals("3", currentHistory.get(2).name);
        Assert.assertEquals("4", currentHistory.get(2).value);
        Assert.assertEquals("5", currentHistory.get(3).name);
        Assert.assertEquals("6", currentHistory.get(3).value);
    }

    @Test
    public void testDoesNotLoadIfEmptyStrings() {
        mSharedPreferences
                .getString(
                        R.string.settings_key_quick_text_history, R.string.settings_default_empty)
                .set("1,2,,4,5,");
        mUnderTest = new QuickKeyHistoryRecords(mSharedPreferences);
        List<QuickKeyHistoryRecords.HistoryKey> keys = mUnderTest.getCurrentHistory();
        Assert.assertEquals(1, keys.size());
        Assert.assertEquals("1", keys.get(0).name);
        Assert.assertEquals("2", keys.get(0).value);
    }

    @Test
    public void testStoreDuplicateKey() {
        mUnderTest = new QuickKeyHistoryRecords(mSharedPreferences);
        mUnderTest.store("1", "2");
        mUnderTest.store("3", "4");
        mUnderTest.store("3", "6");

        List<QuickKeyHistoryRecords.HistoryKey> keys = mUnderTest.getCurrentHistory();

        Assert.assertEquals(2 + 1 /*first default emoji*/, keys.size());

        Assert.assertEquals(QuickKeyHistoryRecords.DEFAULT_EMOJI, keys.get(0).name);
        Assert.assertEquals(QuickKeyHistoryRecords.DEFAULT_EMOJI, keys.get(0).value);
        Assert.assertEquals("1", keys.get(1).name);
        Assert.assertEquals("2", keys.get(1).value);
        Assert.assertEquals("3", keys.get(2).name);
        Assert.assertEquals("6", keys.get(2).value);
    }

    @Test
    public void testStoreMoreThanLimit() {
        mUnderTest = new QuickKeyHistoryRecords(mSharedPreferences);
        for (int i = 0; i < QuickKeyHistoryRecords.MAX_LIST_SIZE * 4; i += 2) {
            mUnderTest.store("k" + Integer.toString(i), "v" + Integer.toString(i + 1));
        }

        mUnderTest.store("last", "last_last");

        List<QuickKeyHistoryRecords.HistoryKey> currentHistory = mUnderTest.getCurrentHistory();
        Assert.assertEquals(QuickKeyHistoryRecords.MAX_LIST_SIZE, currentHistory.size());

        Assert.assertEquals(
                "last", currentHistory.get(QuickKeyHistoryRecords.MAX_LIST_SIZE - 1).name);
        Assert.assertEquals(
                "last_last", currentHistory.get(QuickKeyHistoryRecords.MAX_LIST_SIZE - 1).value);
        Assert.assertEquals(
                "k118", currentHistory.get(QuickKeyHistoryRecords.MAX_LIST_SIZE - 2).name);
        Assert.assertEquals(
                "v119", currentHistory.get(QuickKeyHistoryRecords.MAX_LIST_SIZE - 2).value);
        Assert.assertEquals("k62", currentHistory.get(0).name);
        Assert.assertEquals("v63", currentHistory.get(0).value);

        mUnderTest.store("last_again", "last_again_last");

        currentHistory = mUnderTest.getCurrentHistory();
        Assert.assertEquals(QuickKeyHistoryRecords.MAX_LIST_SIZE, currentHistory.size());

        Assert.assertEquals(QuickKeyHistoryRecords.MAX_LIST_SIZE, currentHistory.size());

        Assert.assertEquals(
                "last_again", currentHistory.get(QuickKeyHistoryRecords.MAX_LIST_SIZE - 1).name);
        Assert.assertEquals(
                "last_again_last",
                currentHistory.get(QuickKeyHistoryRecords.MAX_LIST_SIZE - 1).value);
        Assert.assertEquals(
                "last", currentHistory.get(QuickKeyHistoryRecords.MAX_LIST_SIZE - 2).name);
        Assert.assertEquals(
                "last_last", currentHistory.get(QuickKeyHistoryRecords.MAX_LIST_SIZE - 2).value);
        Assert.assertEquals("k64", currentHistory.get(0).name);
        Assert.assertEquals("v65", currentHistory.get(0).value);
    }

    @Test
    public void testDoesNotStoreInIncognitoMode() {
        mUnderTest = new QuickKeyHistoryRecords(mSharedPreferences);
        final int initialItemsCount = 4;
        for (int i = 0; i < initialItemsCount * 2; i += 2) {
            mUnderTest.store("k" + Integer.toString(i), "v" + Integer.toString(i + 1));
        }

        mUnderTest.setIncognitoMode(true);
        List<QuickKeyHistoryRecords.HistoryKey> currentHistory = mUnderTest.getCurrentHistory();
        Assert.assertEquals(initialItemsCount + 1 /*initial emoji*/, currentHistory.size());

        for (int i = 10; i < 20; i += 2) {
            mUnderTest.store("k" + Integer.toString(i), "v" + Integer.toString(i + 1));
        }

        currentHistory = mUnderTest.getCurrentHistory();
        Assert.assertEquals(initialItemsCount + 1 /*initial emoji*/, currentHistory.size());
        Assert.assertEquals(QuickKeyHistoryRecords.DEFAULT_EMOJI, currentHistory.get(0).name);
        Assert.assertEquals(QuickKeyHistoryRecords.DEFAULT_EMOJI, currentHistory.get(0).value);
        Assert.assertEquals("k0", currentHistory.get(1).name);
        Assert.assertEquals("v1", currentHistory.get(1).value);
        Assert.assertEquals("k2", currentHistory.get(2).name);
        Assert.assertEquals("v3", currentHistory.get(2).value);
        Assert.assertEquals("k4", currentHistory.get(3).name);
        Assert.assertEquals("v5", currentHistory.get(3).value);
        Assert.assertEquals("k6", currentHistory.get(4).name);
        Assert.assertEquals("v7", currentHistory.get(4).value);

        // turning incognito mode off
        mUnderTest.setIncognitoMode(false);
        mUnderTest.store("last_again", "last_again_last");

        currentHistory = mUnderTest.getCurrentHistory();
        Assert.assertEquals(initialItemsCount + 1 + 1 /*the new record*/, currentHistory.size());

        Assert.assertEquals(QuickKeyHistoryRecords.DEFAULT_EMOJI, currentHistory.get(0).name);
        Assert.assertEquals(QuickKeyHistoryRecords.DEFAULT_EMOJI, currentHistory.get(0).value);
        Assert.assertEquals("k0", currentHistory.get(1).name);
        Assert.assertEquals("v1", currentHistory.get(1).value);
        Assert.assertEquals("k2", currentHistory.get(2).name);
        Assert.assertEquals("v3", currentHistory.get(2).value);
        Assert.assertEquals("k4", currentHistory.get(3).name);
        Assert.assertEquals("v5", currentHistory.get(3).value);
        Assert.assertEquals("k6", currentHistory.get(4).name);
        Assert.assertEquals("v7", currentHistory.get(4).value);
        Assert.assertEquals("last_again", currentHistory.get(5).name);
        Assert.assertEquals("last_again_last", currentHistory.get(5).value);
    }

    @Test
    public void testHistoryKeyEqualsOnlyName() {
        QuickKeyHistoryRecords.HistoryKey key1 = new QuickKeyHistoryRecords.HistoryKey("1", "2");
        QuickKeyHistoryRecords.HistoryKey key2 = new QuickKeyHistoryRecords.HistoryKey("1", "3");
        QuickKeyHistoryRecords.HistoryKey key3 = new QuickKeyHistoryRecords.HistoryKey("2", "2");
        QuickKeyHistoryRecords.HistoryKey key4 = new QuickKeyHistoryRecords.HistoryKey("2", "2");

        Assert.assertEquals(key1, key1);
        Assert.assertEquals(key1, key2);
        Assert.assertNotEquals(key1, key3);
        Assert.assertEquals(key3, key4);
    }
}


text:
namespace Google.Cloud.Datastore.Admin.V1.Snippets
{
    // [START datastore_v1_generated_DatastoreAdmin_ExportEntities_async_flattened]
    using Google.Cloud.Datastore.Admin.V1;
    using Google.LongRunning;
    using System.Collections.Generic;
    using System.Threading.Tasks;

    public sealed partial class GeneratedDatastoreAdminClientSnippets
    {
        /// <summary>Snippet for ExportEntitiesAsync</summary>
        /// <remarks>
        /// This snippet has been automatically generated for illustrative purposes only.
        /// It may require modifications to work in your environment.
        /// </remarks>
        public async Task ExportEntitiesAsync()
        {
            // Create client
            DatastoreAdminClient datastoreAdminClient = await DatastoreAdminClient.CreateAsync();
            // Initialize request argument(s)
            string projectId = "";
            IDictionary<string, string> labels = new Dictionary<string, string> { { "", "" }, };
            EntityFilter entityFilter = new EntityFilter();
            string outputUrlPrefix = "";
            // Make the request
            Operation<ExportEntitiesResponse, ExportEntitiesMetadata> response = await datastoreAdminClient.ExportEntitiesAsync(projectId, labels, entityFilter, outputUrlPrefix);

            // Poll until the returned long-running operation is complete
            Operation<ExportEntitiesResponse, ExportEntitiesMetadata> completedResponse = await response.PollUntilCompletedAsync();
            // Retrieve the operation result
            ExportEntitiesResponse result = completedResponse.Result;

            // Or get the name of the operation
            string operationName = response.Name;
            // This name can be stored, then the long-running operation retrieved later by name
            Operation<ExportEntitiesResponse, ExportEntitiesMetadata> retrievedResponse = await datastoreAdminClient.PollOnceExportEntitiesAsync(operationName);
            // Check if the retrieved long-running operation has completed
            if (retrievedResponse.IsCompleted)
            {
                // If it has completed, then access the result
                ExportEntitiesResponse retrievedResult = retrievedResponse.Result;
            }
        }
    }
    // [END datastore_v1_generated_DatastoreAdmin_ExportEntities_async_flattened]
}

redpajama_set_name: RedPajamaGithub


text:
param (
    [Parameter(Mandatory=$true)][string]$version,
    [switch]$debugProject
)
$sourceProjectFile = "Couchbase.Lite.Tests.UWP.Source.csproj"
if (-NOT (Test-Path $sourceProjectFile)) {
    $scriptpath = Split-Path $MyInvocation.MyCommand.Path
    Push-Location $scriptpath
    [Environment]::CurrentDirectory = $scriptpath

    $content = [System.IO.File]::ReadAllLines("Couchbase.Lite.Tests.UWP.csproj")

    $regex = New-Object -TypeName "System.Text.RegularExpressions.Regex" ".*?Version=`"([0-9]\.[0-9]\.[0-9]-b[0-9]{4}).*?"
    for($i = 0; $i -lt $content.Length; $i++) {
        $line = $content[$i]
        $matches = $regex.Matches($line)
        if($matches.Count -gt 0) {
            $oldVersion = $matches[0].Groups[1]
            $line = $line.Replace($oldVersion, $version)
            $content[$i] = $line
        }
    }

    [System.IO.File]::WriteAllLines("Couchbase.Lite.Tests.UWP.csproj", $content)
} else {
    $scriptpath = Split-Path $MyInvocation.MyCommand.Path
    Push-Location $scriptpath
    [Environment]::CurrentDirectory = $scriptpath

    if($debugProject){
        $content = [System.IO.File]::ReadAllLines("Couchbase.Lite.Tests.UWP.csproj")
    } else {
        $content = [System.IO.File]::ReadAllLines("Couchbase.Lite.Tests.UWP.Source.csproj")
    }

    $regex = New-Object -TypeName "System.Text.RegularExpressions.Regex" ".*?<Version>([0-9]\.[0-9]\.[0-9]-b[0-9]{4})<.*?"
    for($i = 0; $i -lt $content.Length; $i++) {
        $line = $content[$i]
        $matches = $regex.Matches($line)
        if($matches.Count -gt 0) {
            $oldVersion = $matches[0].Groups[1]
            $line = $line.Replace($oldVersion, $version)
            $content[$i] = $line
        }
    }

    if($debugProject){
        [System.IO.File]::WriteAllLines("Couchbase.Lite.Tests.UWP.csproj", $content)
    } else {
        [System.IO.File]::WriteAllLines("Couchbase.Lite.Tests.UWP.Source.csproj", $content)
    }
}


text:
namespace Abp.Auditing
{
    /// <summary>
    /// Null implementation of <see cref="IAuditInfoProvider"/>.
    /// </summary>
    internal class NullAuditInfoProvider : IAuditInfoProvider
    {
        public void Fill(AuditInfo auditInfo)
        {

        }
    }
}


text:
@interface BLKRequest : BLKBaseRequest
@end


text:
package httpauth

import (
	_ "github.com/lib/pq"
	"testing"
	. "github.com/smartystreets/goconvey/convey"
)

func TestNewSqlAuthBackend(t *testing.T) {

	c := goodCon
	Convey("With the correct connect string", t, func() {
		src := c.Source()
		_, err := NewSqlAuthBackend(c.Driver, src)
		So(err, ShouldBeNil)
	})
	Convey("With the incorrect user", t, func() {
		c.User = "fake"
		src := c.Source()
		_, err := NewSqlAuthBackend(c.Driver, src)
		So(err.Error(), ShouldNotBeNil)
	})
	Convey("With the incorrect password", t, func() {
		c.Password = "fake"
		src := c.Source()
		_, err := NewSqlAuthBackend(c.Driver, src)
		So(err.Error(), ShouldNotBeNil)
	})
	Convey("With the incorrect driver", t, func() {
		c.Driver = "fake"
		src := c.Source()
		_, err := NewSqlAuthBackend(c.Driver, src)
		So(err.Error(), ShouldNotBeNil)
	})
	Convey("With the incorrect DBName", t, func() {
		c.DBName = "fake"
		src := c.Source()
		_, err := NewSqlAuthBackend(c.Driver, src)
		So(err.Error(), ShouldNotBeNil)
	})
}

//func TestCreate(t *testing.T) {
//	Convey("Given a new user", t, func() {
//		u1 := Auth{Username: "user1"}
//		t.Log(u1)
//		err := b.Create(&u1)
//		t.Log(u1)
//		So(err, ShouldBeNil)
//	})
//}


text:
module Hog
  module Utils
    def explode(hsh, path, into_path)
      arr = hsh.delete(path)
      exploded = []
      arr.each do |item|
        exploded << ({ into_path => item }.merge(hsh))
      end
      exploded
    end
  end
end


text:
<?xml version = '1.0' encoding = 'UTF-8'?>
<FKIndexAssociation class="oracle.dbtools.crest.model.design.relational.FKIndexAssociation" directorySegmentName="seg_0" id="25F65A21-7BAD-65DF-555F-C25BF38DCB1B" containerWithKeyObject="FE14AC58-478B-2EBC-8595-887BF4F1907D" localFKIndex="AEA23935-194A-3BAE-7BD6-8E8B634EED14" name="voter_report_fact_county_dim_FKv1">
<createdBy>beng</createdBy>
<createdTime>2016-07-18 20:07:46 UTC</createdTime>
<generatorID>25D3FD05-7AA7-9563-B028-D75D7D8B9B7D</generatorID>
<ownerDesignName>VoterModel</ownerDesignName>
<deleteRule>NO ACTION</deleteRule>
<referredTableID>DEFE0409-FF7C-31B7-044D-7DCFD7D99716</referredTableID>
<keyObject>A1573213-FD43-FD3E-C75D-329F61239E3B</keyObject>
<referredKeyID>A1573213-FD43-FD3E-C75D-329F61239E3B</referredKeyID>
<mandatory>true</mandatory>
<transferable>true</transferable>
<rely>false</rely>
<columnDependencyConstraintGenerateInDDL>true</columnDependencyConstraintGenerateInDDL>
</FKIndexAssociation>


text:
package com.tremolosecurity.unison.jms.ibm;

import javax.jms.Connection;
import javax.jms.ConnectionFactory;
import javax.jms.JMSContext;
import javax.jms.JMSException;

import com.ibm.msg.client.jms.JmsConnectionFactory;
import com.ibm.msg.client.jms.JmsFactoryFactory;
import com.ibm.msg.client.wmq.WMQConstants;

/**
 * IbmMqConnectionFactory
 */
public class IbmMqConnectionFactory implements ConnectionFactory {

    JmsConnectionFactory mqConnectionFactory;

    public IbmMqConnectionFactory() throws JMSException {
        JmsFactoryFactory ff = JmsFactoryFactory.getInstance(WMQConstants.WMQ_PROVIDER);
        mqConnectionFactory = ff.createConnectionFactory();
        this.mqConnectionFactory.setIntProperty(WMQConstants.WMQ_CONNECTION_MODE, WMQConstants.WMQ_CM_CLIENT);
        this.mqConnectionFactory.setBooleanProperty(WMQConstants.USER_AUTHENTICATION_MQCSP, true);
    }

	@Override
	public Connection createConnection() throws JMSException {
		return mqConnectionFactory.createConnection();
	}

	@Override
	public Connection createConnection(String userName, String password) throws JMSException {
		return mqConnectionFactory.createConnection(userName, password);
	}

	@Override
	public JMSContext createContext() {
		return mqConnectionFactory.createContext();
	}

	@Override
	public JMSContext createContext(String userName, String password) {
		return mqConnectionFactory.createContext(userName, password);
	}

	@Override
	public JMSContext createContext(String userName, String password, int sessionMode) {
		return mqConnectionFactory.createContext(userName, password, sessionMode);
	}

	@Override
	public JMSContext createContext(int sessionMode) {
		return mqConnectionFactory.createContext(sessionMode);
	}

    public void setHost(String host) throws JMSException {
        this.mqConnectionFactory.setStringProperty(WMQConstants.WMQ_HOST_NAME, host);
    }

    public String getHost() throws JMSException {
        return this.mqConnectionFactory.getStringProperty(WMQConstants.WMQ_HOST_NAME);
    }

    public void setPort(String port) throws NumberFormatException, JMSException {
        this.mqConnectionFactory.setIntProperty(WMQConstants.WMQ_PORT, Integer.parseInt(port));
    }

    public String getPort() throws JMSException {
        return Integer.toString(this.mqConnectionFactory.getIntProperty(WMQConstants.WMQ_PORT));
    }

    public void setQueueManager(String qmgr) throws JMSException {
        this.mqConnectionFactory.setStringProperty(WMQConstants.WMQ_QUEUE_MANAGER, qmgr);
    }

    public String getQueueManager() throws JMSException {
        return this.mqConnectionFactory.getStringProperty(WMQConstants.WMQ_QUEUE_MANAGER);
    }

    public void setApplicationName(String appName) throws JMSException {
        this.mqConnectionFactory.setStringProperty(WMQConstants.WMQ_APPLICATIONNAME, appName);
    }

    public String getApplicationName() throws JMSException {
        return this.mqConnectionFactory.getStringProperty(WMQConstants.WMQ_APPLICATIONNAME);
    }

    public void setChannel(String channel) throws JMSException {
        this.mqConnectionFactory.setStringProperty(WMQConstants.WMQ_CHANNEL, channel);
    }

    public String getChannel() throws JMSException {
        return this.mqConnectionFactory.getStringProperty(WMQConstants.WMQ_CHANNEL);
    }
}


text:
using System;

namespace DesignPatternLib.Chain.NETOptimized
{
    /// <summary>
    /// The 'Handler' abstract class
    /// </summary>
    abstract class Approver
    {
        // Purchase event
        public EventHandler<PurchaseEventArgs> Purchase;
        // Purchase event handler
        public abstract void PurchaseHandler(object sender, PurchaseEventArgs e);
        // Constructor
        public Approver()
        {
            Purchase += PurchaseHandler;
        }
        public void ProcessRequest(Purchase purchase)
        {
            OnPurchase(new PurchaseEventArgs { Purchase = purchase });
        }
        // Invoke the Purchase event
        public virtual void OnPurchase(PurchaseEventArgs e)
        {
            if (Purchase != null)
            {
                Purchase(this, e);
            }
        }
        // Sets or gets the next approver
        public Approver Successor { get; set; }
    }
}


text:
 Политика за Бисквитките (COOKIES)

            Какво са "бисквитки" (cookies)
            "Бисквитката" е кратка текстова информация, изпратена до браузъра ви от посетен от Вас уебсайт. Тя помага на
            сайта да запомни информация за посещението Ви и настройките Ви. Това може да улесни следващото ви посещение
            и да направи сайта по-полезен за Вас.
            "Бисквитките" се използват за много цели – да се запомнят предпочитанията и настройките Ви за изглед, шрифт,
            език на сайта, да Ви бъдат предлагани релевантни на Вашите интереси реклами, за водене на статистика на
            посещенията на дадена страница, сайтът да Ви "запомни", че сте логнати и др.
            Уебсайтовете често събират информация за начина, по който потребителите взаимодействат с тях - това може да
            включва страниците, които хората посещават най-често, дали получават съобщения за грешка от някои от тях,
            как навигират в сайта и др. На база анализа на тази информация се предприемат действия за подобряване на
            услугите и работата на сайтовете с цел приятно и безпроблемно ползване от потребителите.
            Видове бисквитки:
            "Сесийни" бисквитки (Session Cookies)
            Сесийните бисквитки позволяват да бъдете разпознати по време на еднократно посещение на уебсайта, така че
            направените персонализации или промени по всяка страница да бъдат запомнени в други страници от сайта.
            Сесийните бисквитки са временни и тяхното действие приключва, когато затворите браузъра или излезете от
            сайта.
            Постоянни бисквитки (Persistent Cookies)
            Постоянните бисквитки остават запаметени на компютъра Ви за определен период от време след приключване на
            потребителската Ви сесия на сайта и позволяват предпочитанията и настройките Ви да бъдат "запомнени", когато
            посетите отново сайта.
            Бисквитки на трета страна (Third Party Cookies)
            Това са бисквитки за запаметяване на информация за отчитане на ефективността на сайта и рекламите по
            демографски признак, интереси, продължителност на сесиите и т.н. Този сайт използва Google Analytics, услуга
            за уеб анализ без да се идентифицират лично отделните посетители., предлагана от Google, Inc. Цялата тази
            информация се използва от нас само за статистически цели и за разпознаване на грешни линкове или програмни
            грешки. Разкриване на информация на трети лица не се извършва. Бисквитките не се използват за цели, различни
            от посочените тук.
            Как да контролирате бисквитките
            Можете да контролирате и/или изтривате бисквитки когато пожелаете. За повече информация посетете
            AllAboutCookies.org. Можете да изтриете всички или избрани бисквитки, които вече са запазени на Вашия
            компютър, а също така можете да настроите повечето браузъри да ги блокират. Ако направите това обаче, може
            да се наложи ръчно да настройвате някои параметри всеки път, когато посещавате даден сайт, а освен това е
            възможно някои услуги и функции да не работят.

            Затваряйки уведомлението или продължайки взаимодействието си с този сайт, Вие се съгласявате с използването
            от нас на бисквитки.


text:
A simple Elixir wrapper around [scrogson/oauth2](https://github.com/scrogson/oauth2) to retrieve
IFTTT Bearer tokens from their mobile api.

## Installation

First, add ifttt_oauth to your list of dependencies in `mix.exs`:
```elixir
def deps do
  [{:ifttt_oauth, "~> 0.0.1"}]
end
```

Next, ensure ifttt_oauth is started before your application:
```elixir
def application do
  [applications: [:ifttt_oauth]]
end
```

## Usage

```elixir
iex> response = IftttOauth.get_token! username: "nickgal", password: "password"
iex> response.other_params # Data returned from IFTTT
```

## License
[MIT](LICENSE.md)


text:
UNIX_FCSwitchSettingsProvider::UNIX_FCSwitchSettingsProvider()
{
}

UNIX_FCSwitchSettingsProvider::~UNIX_FCSwitchSettingsProvider()
{
}

CIMInstance UNIX_FCSwitchSettingsProvider::constructInstance(
	const CIMName &className,
	const CIMNamespaceName &nameSpace,
	const UNIX_FCSwitchSettings &_p)
{
	CIMProperty p;

	CIMInstance inst(className);

	// Set path
	inst.setPath(CIMObjectPath(String(""), // hostname
			nameSpace,
			CIMName("UNIX_FCSwitchSettings"),
			constructKeyBindings(_p)));

	//CIM_ManagedElement Properties
	if (_p.getInstanceID(p)) inst.addProperty(p);
	if (_p.getCaption(p)) inst.addProperty(p);
	if (_p.getDescription(p)) inst.addProperty(p);
	if (_p.getElementName(p)) inst.addProperty(p);

	//CIM_SettingData Properties
	if (_p.getChangeableType(p)) inst.addProperty(p);
	if (_p.getConfigurationName(p)) inst.addProperty(p);

	//CIM_FCSwitchSettings Properties
	if (_p.getPreferredDomainID(p)) inst.addProperty(p);
	if (_p.getDomainIDLocked(p)) inst.addProperty(p);
	if (_p.getPrincipalPriority(p)) inst.addProperty(p);

	return inst;
}

Array<CIMKeyBinding> UNIX_FCSwitchSettingsProvider::constructKeyBindings(const UNIX_FCSwitchSettings& _p)

{

	Array<CIMKeyBinding> keys;

	keys.append(CIMKeyBinding(
		PROPERTY_INSTANCE_ID,
		_p.getInstanceID(),
		CIMKeyBinding::STRING));

	return keys;
}

#define UNIX_PROVIDER UNIX_FCSwitchSettingsProvider
#define UNIX_PROVIDER_NAME "UNIX_FCSwitchSettingsProvider"
#define CLASS_IMPLEMENTATION UNIX_FCSwitchSettings
#define CLASS_IMPLEMENTATION_NAME "UNIX_FCSwitchSettings"
#define BASE_CLASS_NAME "CIM_FCSwitchSettings"
#define NUMKEYS_CLASS_IMPLEMENTATION 0

#include "UNIXProviderBase.hpp"


text:
/**
 * Sets BlocklyApp constants that depend on the page and level.
 * This encapsulates many functions used for StudioApp.requiredBlocks_.
 * In the future, some of these may be moved to common.js.
 */

var requiredBlockUtils = require('../required_block_utils');

// This tests for and creates a draw_a_square block on page 2.
function drawASquare(number) {
  return {test: 'draw_a_square',
          type: 'draw_a_square',
          values: {'VALUE': requiredBlockUtils.makeMathNumber(number)}};
}

// This tests for and creates a draw_a_snowman block on page 2.
function drawASnowman(number) {
  return {test: 'draw_a_snowman',
          type: 'draw_a_snowman',
          values: {'VALUE': requiredBlockUtils.makeMathNumber(number)}};
}

// This tests for and creates the limited "move forward" block used on the
// earlier levels of the tutorial.
var MOVE_FORWARD_INLINE = {test: 'moveForward', type: 'draw_move_by_constant'};

// allow move forward or backward, but show forward block if they've done neither
var MOVE_FORWARD_OR_BACKWARD_INLINE = {
  test: function (block) {
    return block.type == 'draw_move_by_constant';
  },
  type: 'draw_move_by_constant'
};

// This tests for and creates the limited "move forward" block used on the
// earlier levels of the tutorial with the given pixel number.
var moveForwardInline = function (pixels) {
  return {test: 'moveForward',
          type: 'draw_move_by_constant',
          titles: {'VALUE': pixels}};
};

// This tests for and creates the limited "move forward" block used on the
// earlier levels of the tutorial.
var MOVE_BACKWARD_INLINE = {test: 'moveBackward',
                            type: 'draw_move_by_constant',
                            titles: {'DIR': 'moveBackward'}};

// This tests for a [right] draw_turn_by_constant_restricted block
// and creates the block with the specified/recommended number of degrees as
// its input.  The restricted turn is used on the earlier levels of the
// tutorial.
var turnRightRestricted = function (degrees) {
  return {test: 'turnRight(',
          type: 'draw_turn_by_constant_restricted',
          titles: {'VALUE': degrees}};
};

// This tests for a [left] draw_turn_by_constant_restricted block
// and creates the block with the specified/recommended number of degrees as
// its input.  The restricted turn is used on the earlier levels of the
// tutorial.
var turnLeftRestricted = function (degrees) {
  return {test: 'turnLeft(',
          type: 'draw_turn_by_constant_restricted',
          titles: {'VALUE': degrees}};
};

// This tests for and creates a [right] draw_turn_by_constant block
// with the specified number of degrees as its input.
var turnRightByConstant = function (degrees) {
  return {
    test: function (block) {
      return block.type == 'draw_turn_by_constant' &&
          (degrees === '???' ||
           Blockly.JavaScript.valueToCode(
             block, 'VALUE', Blockly.JavaScript.ORDER_NONE) == degrees);
    },
    type: 'draw_turn_by_constant',
    titles: {'VALUE': degrees}};
};

// This tests for and creates a [right] draw_turn block with the specified
// number of degrees as its input.  For the earliest levels, the method
// turnRightRestricted should be used instead.
var turnRight = function (degrees) {
  return {
    test: function (block) {
      return block.type == 'draw_turn' &&
        block.getTitleValue('DIR') == 'turnRight';
      },
    type: 'draw_turn',
    titles: {'DIR': 'turnRight'},
    values: {'VALUE': requiredBlockUtils.makeMathNumber(degrees)}
  };
};

// This tests for and creates a left draw_turn block with the specified
// number of degrees as its input.  This method is not appropriate for the
// earliest levels of the tutorial, which do not provide draw_turn.
var turnLeft = function (degrees) {
  return {
    test: function (block) {
      return block.type == 'draw_turn' &&
        block.getTitleValue('DIR') == 'turnLeft';
      },
    type: 'draw_turn',
    titles: {'DIR': 'turnLeft'},
    values: {'VALUE': requiredBlockUtils.makeMathNumber(degrees)}
  };
};

// This tests for any draw_move block and, if not present, creates
// one with the specified distance.
var move = function (distance) {
  return {test: function (block) {return block.type == 'draw_move'; },
          type: 'draw_move',
          values: {'VALUE': requiredBlockUtils.makeMathNumber(distance)}};
};

// This tests for and creates a draw_turn_by_constant_restricted block.
var drawTurnRestricted = function (degrees) {
  return {
    test: function (block) {
      return block.type == 'draw_turn_by_constant_restricted';
    },
    type: 'draw_turn_by_constant_restricted',
    titles: {'VALUE': degrees}
  };
};

// This tests for and creates a draw_turn block.
var drawTurn = function () {
  return {
    test: function (block) {
      return block.type == 'draw_turn';
    },
    type: 'draw_turn',
    values: {'VALUE': requiredBlockUtils.makeMathNumber('???')}
  };
};

// This tests for and creates a "set colour" block with a colour picker
// as its input.
var SET_COLOUR_PICKER = {test: 'penColour(\'#',
  type: 'draw_colour',
  values: {'COLOUR': '<block type="colour_picker"></block>'}};

// This tests for and creates a "set colour" block with a random colour
// generator as its input.
var SET_COLOUR_RANDOM = {test: 'penColour(colour_random',
  type: 'draw_colour',
  values: {'COLOUR': '<block type="colour_random"></block>'}};

/**
 * Creates a required block specification for defining a function with an
 * argument.  Unlike the other functions to create required blocks, this
 * is defined outside of Turtle.setBlocklyAppConstants because it is accessed
 * when checking for a procedure on levels 8-9 of Turtle 3.
 * @param {string} func_name The name of the function.
 * @param {string} arg_name The name of the single argument.
 * @return A required block specification that tests for a call of the
 *     specified function with the specified argument name.  If not present,
 *     this contains the information to create such a block for display.
 */
var defineWithArg = function (func_name, arg_name) {
  return {
    test: function (block) {
      return block.type == 'procedures_defnoreturn' &&
          block.getTitleValue('NAME') == func_name &&
          block.parameterNames_ && block.parameterNames_.length &&
          block.parameterNames_[0] == arg_name;
    },
    type: 'procedures_defnoreturn',
    titles: {'NAME': func_name},
    extra: '<mutation><arg name="' + arg_name + '"></arg></mutation>'
  };
};

module.exports = {
  makeMathNumber: requiredBlockUtils.makeMathNumber,
  simpleBlock: requiredBlockUtils.simpleBlock,
  repeat: requiredBlockUtils.repeat,
  drawASquare: drawASquare,
  drawASnowman: drawASnowman,
  MOVE_FORWARD_INLINE: MOVE_FORWARD_INLINE,
  MOVE_FORWARD_OR_BACKWARD_INLINE: MOVE_FORWARD_OR_BACKWARD_INLINE,
  moveForwardInline: moveForwardInline,
  MOVE_BACKWARD_INLINE: MOVE_BACKWARD_INLINE,
  turnLeftRestricted: turnLeftRestricted,
  turnRightRestricted: turnRightRestricted,
  turnRightByConstant: turnRightByConstant,
  turnRight: turnRight,
  turnLeft: turnLeft,
  move: move,
  drawTurnRestricted: drawTurnRestricted,
  drawTurn: drawTurn,
  SET_COLOUR_PICKER: SET_COLOUR_PICKER,
  SET_COLOUR_RANDOM: SET_COLOUR_RANDOM,
  defineWithArg: defineWithArg,
};


text:
package org.apache.sshd.common.util.closeable;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.util.Objects;

import org.apache.sshd.common.util.ExceptionUtils;
import org.apache.sshd.common.util.GenericUtils;
import org.apache.sshd.common.util.ProxyUtils;
import org.apache.sshd.common.util.logging.LoggingUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * Wraps a target instance and an {@link AutoCloseable} delegate into a proxy instance that closes both when wrapper
 * {@link AutoCloseable#close() close} method called.
 *
 * @author Apache MINA SSHD Project
 */
public class AutoCloseableDelegateInvocationHandler implements InvocationHandler {
    private final Object proxyTarget;
    private final AutoCloseable delegate;
    // Order is important - we want to close the proxy before the delegate
    private final Object[] closers;

    public AutoCloseableDelegateInvocationHandler(Object proxyTarget, AutoCloseable delegate) {
        this.proxyTarget = Objects.requireNonNull(proxyTarget, "No proxy target to wrap");
        this.delegate = Objects.requireNonNull(delegate, "No delegate to auto-close");
        this.closers = new Object[] { proxyTarget, delegate };
    }

    public Object getProxyTarget() {
        return proxyTarget;
    }

    public AutoCloseable getAutoCloseableDelegate() {
        return delegate;
    }

    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
        // If not invoking "close" then propagate to target as-is
        if (!isCloseMethodInvocation(method, args)) {
            Object target = getProxyTarget();
            try {
                return method.invoke(target, args);
            } catch (Throwable t) {
                Class<?> targetType = target.getClass();
                Logger log = LoggerFactory.getLogger(targetType);
                LoggingUtils.debug(log, "invoke({}#{}) failed ({}) to execute: {}",
                        targetType.getSimpleName(), method.getName(), t.getClass().getSimpleName(), t.getMessage(), t);
                throw ProxyUtils.unwrapInvocationThrowable(t);
            }
        }

        Throwable err = null;
        for (Object c : closers) {
            if (!(c instanceof AutoCloseable)) {
                continue;   // OK if proxy target is not AutoCloseable
            }

            try {
                method.invoke(c, args);
            } catch (Throwable t) {
                Class<? extends Object> closerType = c.getClass();
                Logger log = LoggerFactory.getLogger(closerType);
                LoggingUtils.debug(log, "invoke({}#{}) failed ({}) to execute: {}",
                        closerType.getSimpleName(), method.getName(), t.getClass().getSimpleName(), t.getMessage(), t);
                err = ExceptionUtils.accumulateException(err, t);
            }
        }

        if (err != null) {
            throw ProxyUtils.unwrapInvocationThrowable(err);
        }

        return null;
    }

    /**
     * Wraps a target instance and an {@link AutoCloseable} delegate into a proxy instance that closes both when wrapper
     * {@link AutoCloseable#close() close} method called.
     *
     * @param  <T>         The generic {@link AutoCloseable} wrapping interface
     * @param  proxyTarget The (never {@code null}) target instance - if not {@link AutoCloseable} then it's
     *                     {@code close()} method will not be invoked (i.e., only the delegate)
     * @param  type        The target wrapping interface
     * @param  delegate    The (never {@code null}) delegate to close. Note: the delegate is closed after
     *                     the target instance.
     * @return             The wrapping proxy
     */
    public static <T extends AutoCloseable> T wrapDelegateCloseable(
            Object proxyTarget, Class<T> type, AutoCloseable delegate) {
        return ProxyUtils.newProxyInstance(type, new AutoCloseableDelegateInvocationHandler(proxyTarget, delegate));
    }

    public static boolean isCloseMethodInvocation(Method m, Object[] args) {
        return isCloseMethod(m) && GenericUtils.isEmpty(args);
    }

    public static boolean isCloseMethod(Method m) {
        int mods = (m == null) ? 0 : m.getModifiers();
        return (m != null)
                && "close".equals(m.getName())
                && Modifier.isPublic(mods)
                && (!Modifier.isStatic(mods))
                && (void.class == m.getReturnType())
                && GenericUtils.isEmpty(m.getParameterTypes());
    }
}


text:
<?xml version="1.0" encoding="utf-8" ?>
<object name="AggregateMatrixVersionLookup"
        connection="EidssConnectionString"
        generator="ObjectGenerator.xslt"
        xmlns="urn:schemas-bv:objectmodel">

    <storage>
        <get name="spAggregateMatrixVersion_SelectLookup" type="lookuplist" cache="true"/>
    </storage>

    <tables>
        <table name="AggregateMatrixVersionLookup" tostring="c => c.MatrixName">
        </table>
    </tables>

</object>


text:
package com.mbanna.swiftbraille.patterns.en;

import android.content.Context;

import com.mbanna.swiftbraille.Common;
import com.mbanna.swiftbraille.patterns.Pattern;
import com.mbanna.swiftbraille.R;
import java.util.Arrays;
import java.util.Collections;
import java.util.Set;

//Just contain English small characters pattern
public class EnglishSmallCharPattern extends Pattern {
    private Context context;
    private String patternPronounce = null;
    private String finalResultPattern = null;
    //--------------------------------------------------------------------------------------------//
    public EnglishSmallCharPattern(Context context){
        this.context = context;
        Common.currentLanguage = Common.ENGLISH_LANGUAGE_INPUT_METHOD;
        Common.currentLocaleLanguage = Common.englishLocale;
        Common.isRTL = false;
    }
    //--------------------------------------------------------------------------------------------//
    @SuppressWarnings("All")
    public void setPattern(Set pattern) {
        if (pattern.size() == 1 && pattern.containsAll(Collections.singletonList(1))) {
            Common.currentLocaleLanguage = Common.englishLocale;
            finalResultPattern = "a";
            patternPronounce = null;
        } else if (pattern.size() == 1 && pattern.containsAll(Collections.singletonList(2))) {
            Common.currentLocaleLanguage = Common.currentSystemLocaleLanguage;
            finalResultPattern = ",";
            patternPronounce = context.getString(R.string.comma_pattern);
        } else if (pattern.size() == 1 && pattern.containsAll(Collections.singletonList(3))) {
            Common.currentLocaleLanguage = Common.currentSystemLocaleLanguage;
            finalResultPattern = "'";
            patternPronounce = context.getString(R.string.apostrophe_pattern);
        } else if (pattern.size() == 1 && pattern.containsAll(Collections.singletonList(4))) {
            finalResultPattern = "@";
            patternPronounce = context.getString(R.string.at_pattern);
        } else if (pattern.size() == 2 && pattern.containsAll(Arrays.asList(1, 2))) {
            Common.currentLocaleLanguage = Common.englishLocale;
            finalResultPattern = "b";
            patternPronounce = null;
        } else if (pattern.size() == 2 && pattern.containsAll(Arrays.asList(1, 4))) {
            Common.currentLocaleLanguage = Common.englishLocale;
            finalResultPattern = "c";
            patternPronounce = null;
        } else if (pattern.size() == 2 && pattern.containsAll(Arrays.asList(1, 5))) {
            Common.currentLocaleLanguage = Common.englishLocale;
            finalResultPattern = "e";
            patternPronounce = null;
        } else if (pattern.size() == 2 && pattern.containsAll(Arrays.asList(2, 4))) {
            Common.currentLocaleLanguage = Common.englishLocale;
            finalResultPattern = "i";
            patternPronounce = null;
        } else if (pattern.size() == 2 && pattern.containsAll(Arrays.asList(1, 3))) {
            Common.currentLocaleLanguage = Common.englishLocale;
            finalResultPattern = "k";
            patternPronounce = null;
        } else if (pattern.size() == 3 && pattern.containsAll(Arrays.asList(1, 4, 5))) {
            Common.currentLocaleLanguage = Common.englishLocale;
            finalResultPattern = "d";
            patternPronounce = null;
        } else if (pattern.size() == 3 && pattern.containsAll(Arrays.asList(1, 2, 4))) {
            Common.currentLocaleLanguage = Common.englishLocale;
            finalResultPattern = "f";
            patternPronounce = null;
        } else if (pattern.size() == 3 && pattern.containsAll(Arrays.asList(1, 2, 5))) {
            Common.currentLocaleLanguage = Common.englishLocale;
            finalResultPattern = "h";
            patternPronounce = null;
        } else if (pattern.size() == 3 && pattern.containsAll(Arrays.asList(2, 4, 5))) {
            Common.currentLocaleLanguage = Common.englishLocale;
            finalResultPattern = "j";
            patternPronounce = null;
        } else if (pattern.size() == 3 && pattern.containsAll(Arrays.asList(1, 2, 3))) {
            Common.currentLocaleLanguage = Common.englishLocale;
            finalResultPattern = "l";
            patternPronounce = null;
        } else if (pattern.size() == 3 && pattern.containsAll(Arrays.asList(1, 3, 4))) {
            Common.currentLocaleLanguage = Common.englishLocale;
            finalResultPattern = "m";
            patternPronounce = null;
        } else if (pattern.size() == 3 && pattern.containsAll(Arrays.asList(1, 3, 5))) {
            Common.currentLocaleLanguage = Common.englishLocale;
            finalResultPattern = "o";
            patternPronounce = null;
        } else if (pattern.size() == 3 && pattern.containsAll(Arrays.asList(2, 3, 4))) {
            Common.currentLocaleLanguage = Common.englishLocale;
            finalResultPattern = "s";
            patternPronounce = null;
        } else if (pattern.size() == 3 && pattern.containsAll(Arrays.asList(2, 3, 5))) {
            Common.currentLocaleLanguage = Common.currentSystemLocaleLanguage;
            finalResultPattern = "!";
            patternPronounce = context.getString(R.string.exclamation_mark_pattern);
        } else if (pattern.size() == 3 && pattern.containsAll(Arrays.asList(2, 3, 6))) {
            Common.currentLocaleLanguage = Common.currentSystemLocaleLanguage;
            finalResultPattern = "?";
            patternPronounce = context.getString(R.string.question_mark_pattern);
        } else if (pattern.size() == 3 && pattern.containsAll(Arrays.asList(2, 5, 6))) {
            Common.currentLocaleLanguage = Common.currentSystemLocaleLanguage;
            finalResultPattern = ".";
            patternPronounce = context.getString(R.string.dot_pattern);
        } else if (pattern.size() == 3 && pattern.containsAll(Arrays.asList(1, 3, 6))) {
            Common.currentLocaleLanguage = Common.englishLocale;
            finalResultPattern = "u";
            patternPronounce = null;
        } else if (pattern.size() == 4 && pattern.containsAll(Arrays.asList(1, 2, 4, 5))) {
            Common.currentLocaleLanguage = Common.englishLocale;
            finalResultPattern = "g";
            patternPronounce = null;
        } else if (pattern.size() == 4 && pattern.containsAll(Arrays.asList(1, 3, 4, 5))) {
            Common.currentLocaleLanguage = Common.englishLocale;
            finalResultPattern = "n";
            patternPronounce = null;
        } else if (pattern.size() == 4 && pattern.containsAll(Arrays.asList(1, 2, 3, 4))) {
            Common.currentLocaleLanguage = Common.englishLocale;
            finalResultPattern = "p";
            patternPronounce = null;
        } else if (pattern.size() == 4 && pattern.containsAll(Arrays.asList(1, 2, 3, 5))) {
            Common.currentLocaleLanguage = Common.englishLocale;
            finalResultPattern = "r";
            patternPronounce = null;
        } else if (pattern.size() == 4 && pattern.containsAll(Arrays.asList(2, 3, 4, 5))) {
            Common.currentLocaleLanguage = Common.englishLocale;
            finalResultPattern = "t";
            patternPronounce = null;
        } else if (pattern.size() == 4 && pattern.containsAll(Arrays.asList(1, 2, 3, 6))) {
            Common.currentLocaleLanguage = Common.englishLocale;
            finalResultPattern = "v";
            patternPronounce = null;
        } else if (pattern.size() == 4 && pattern.containsAll(Arrays.asList(2, 4, 5, 6))) {
            Common.currentLocaleLanguage = Common.englishLocale;
            finalResultPattern = "w";
            patternPronounce = null;
        } else if (pattern.size() == 4 && pattern.containsAll(Arrays.asList(1, 3, 4, 6))) {
            Common.currentLocaleLanguage = Common.englishLocale;
            finalResultPattern = "x";
            patternPronounce = null;
        } else if (pattern.size() == 4 && pattern.containsAll(Arrays.asList(1, 3, 5, 6))) {
            Common.currentLocaleLanguage = Common.englishLocale;
            finalResultPattern = "z";
            patternPronounce = null;
        } else if (pattern.size() == 5 && pattern.containsAll(Arrays.asList(1, 2, 3, 4, 5))) {
            Common.currentLocaleLanguage = Common.englishLocale;
            finalResultPattern = "q";
            patternPronounce = null;
        } else if (pattern.size() == 5 && pattern.containsAll(Arrays.asList(1, 3, 4, 5, 6))) {
            Common.currentLocaleLanguage = Common.englishLocale;
            finalResultPattern = "y";
            patternPronounce = null;
        } else {
            finalResultPattern = null;
            patternPronounce = null;
        }
    }
    //--------------------------------------------------------------------------------------------//
    public String getPatternResult() {
        return finalResultPattern;
    }
    //--------------------------------------------------------------------------------------------//
    public String getPatternPronounce(){
        return patternPronounce != null ? patternPronounce : finalResultPattern;
    }
    //--------------------------------------------------------------------------------------------//
    public String getClassTitle(){
        Common.currentLocaleLanguage = Common.currentSystemLocaleLanguage;
        return context.getString(R.string.english_small_letters_keyboard);
    }
    //--------------------------------------------------------------------------------------------//
    public int getClassTitleSoundPath() {
        return -1;
    }
    //--------------------------------------------------------------------------------------------//
    public int getPatternSoundPronounce(){
        return -1;
    }
    //--------------------------------------------------------------------------------------------//
    public Pattern nextPattern(Context context){
        return new EnglishCapitalCharPattern(context);
    }
    //--------------------------------------------------------------------------------------------//
    public Pattern previousPattern(Context context){
        return new EnglishSpecialPattern(context);
    }
    //--------------------------------------------------------------------------------------------//
}


text:
"""
Created on Mon Dec 23 11:52:32 2013

@author: Tom
"""
import cv2
import Tkinter as tk
import tkFileDialog
import tkColorChooser
import pygame
import os
from fluidDoubleCone import *
import time
BUTTONHEIGHT = 32
FPS = 30
class FluidDCViewCtrl:
    def __init__(self, fluidDC, width, height):

        self.width = width
        self.height = height
        self.master = tk.Tk()
        self.frame = tk.Frame(self.master, width=width, height=height)
        self.frame.grid(sticky = tk.N, rowspan = 5)
        self.pickColorButton = tk.Button(self.master, text="Pick Color", \
            command = self.getNewColor)
        self.pickColorButton.grid(sticky = tk.N, row = 0, column = 1, columnspan = 3)
        self.updateDCButton = tk.Button(self.master, text="Update Fluid",\
            command = self.updateFluidDCwUndo)
        self.updateDCButton.grid(row = 1, column = 1)
        self.playDCButton = tk.Button(self.master, text="Play",\
            command = self.playFluid)
        self.playDCButton.grid(row = 1, column = 2)
        self.playSlider = tk.Scale(label = "Play seconds", orient = tk.HORIZONTAL,\
            from_ = 1.0/FPS, to = 10, resolution = 1.0/FPS)
        self.playSlider.grid(row=1, column = 3)
        self.undoButton = tk.Button(self.master, text="Undo",\
            command = self.undo)
        self.undoButton.grid(row = 2, column = 1)
        self.pickFileButton = tk.Button(self.master, text="Pick Record File",\
            command = self.setup_record)
        self.pickFileButton.grid(row = 2, column = 2)

        self.displayFile = tk.Entry(self.master, state = "readonly")
        self.displayFile.grid(row = 3, column = 2)

        self.recording = tk.IntVar()
        self.recordCheck = tk.Checkbutton(self.master, text = "Record",\
            variable = self.recording)

        self.recordCheck.grid(row = 3, column = 1)

        self.master.grid_rowconfigure(4, minsize = self.height-3*BUTTONHEIGHT)
        self.master.protocol('WM_DELETE_WINDOW', self.quit)

        self.undoCopys = []
        self.screen = None
        self.playing = False

        self.curColor = np.array([0, 0, 0])
        self.curRadius = 1
        self.fluidDC = fluidDC

        self.surface = None
        self.updateSurface()
        self.hasQuit = False

        self.videoWriter = cv2.VideoWriter()
        self.recordFile = ""

    def mainloop(self):
        os.environ['SDL_WINDOWID'] = str(self.frame.winfo_id())
        os.environ['SDL_VIDEODRIVER'] = 'windib'
        self.master.update()
        pygame.display.init()
        self.screen = pygame.display.set_mode((self.width, self.height))
        while(not self.hasQuit):
            self.update()

    def undo(self):
        if len(self.undoCopys) == 0:
            return
        self.fluidDC = self.undoCopys.pop()
        self.updateSurface()

    def setUndoCopy(self):
        self.undoCopys.append(self.fluidDC.copy())
        if len(self.undoCopys)>10:
            del self.undoCopys[0]

    def update(self, blockEvents = False):
        if not blockEvents:
            pygame.event.pump()
            self.pygameEventsHandler(pygame.event.get())
            pygame.event.clear()
        self.screen.blit(self.surface, (0, 0))
        pygame.display.flip()
        self.master.update()

    def playFluid(self):
        self.setUndoCopy()
        if not self.playing:
            self.playing = True
            lastTime = time.time()
            for i in range(int(self.playSlider.get()*FPS)+1):
                self.updateFluidDC()
                self.update()
                if time.time()- lastTime<1.0/FPS:
                    time.sleep(1.0/FPS-(time.time() - lastTime))
                lastTime = time.time()
        self.playing = False

    def getRecordFile(self):
        tmp = tkFileDialog.asksaveasfilename()
        if tmp:
            if self.videoWriter.isOpened():
                cv2.destroyAllWindows()
                self.videoWriter.release()
            self.displayFile.config(state = tk.NORMAL)
            self.displayFile.delete(0, tk.END)
            self.displayFile.insert(0, tmp)
            self.displayFile.config(state = "readonly")
            self.recordFile = tmp
            self.videoWriter = cv2.VideoWriter(self.recordFile,\
                -1, FPS, (self.fluidDC.width, self.fluidDC.height), True)
            if not self.videoWriter.isOpened():
                print "Invalid File"
                self.displayFile.config(state = tk.NORMAL)
                self.displayFile.delete(0, tk.END)
                self.displayFile.config(state = "readonly")

    def updateFluidDC(self):
        self.fluidDC.update(1.0/FPS)
        self.updateSurface()
        if self.recording.get()==1:
            self.recordFrame()

    def updateFluidDCwUndo(self):
        self.setUndoCopy()
        self.updateFluidDC()

    def updateSurface(self):
        img = cv2.cvtColor(self.fluidDC.fMat.astype(np.uint8), cv2.COLOR_LAB2BGR)
        img = cv2.transpose(img)
        self.surface = pygame.transform.scale(pygame.surfarray.make_surface(img),\
                (self.width, self.height))

    def setup_record(self):
        self.getRecordFile()

#    def save(self):
#        self.videoWriter.release()
#        self.displayFile.config(state = tk.NORMAL)
#        self.displayFile.delete(0, tk.END)
#        self.displayFile.config(state = "readonly")

    def recordFrame(self):
        if self.videoWriter.isOpened():
            img = cv2.cvtColor(self.fluidDC.fMat.astype(np.uint8), cv2.COLOR_LAB2RGB)
            self.videoWriter.write(img)

#    def start_record(self):
#        self.recording = True
#
#    def end_record(self):
#        self.recording = False

    def translatePointToFluidDC(self, point):
        return point[1]*self.fluidDC.height/float(self.height),\
                                point[0]*self.fluidDC.width/float(self.width)

    def rightClick(self):
        self.setUndoCopy()
        pygame.mouse.get_rel()
        mousePoses = set()
        stayInWhile = True
        while(stayInWhile):
            if pygame.event.wait().type == pygame.MOUSEBUTTONUP:
                stayInWhile = False
            mousePoses.add(pygame.mouse.get_pos())
        mouseVel = pygame.mouse.get_rel()
        mousePoses = [self.translatePointToFluidDC(mousePos) for mousePos in mousePoses]
        mouseVel = self.translatePointToFluidDC(mouseVel)
        for mousePos in mousePoses:
            self.fluidDC.velMat[int(mousePos[0]), int(mousePos[1])] = np.array(mouseVel)

    def leftClick(self):
        self.setUndoCopy()
        stayInWhile = True
        while(stayInWhile):
            if pygame.event.wait().type == pygame.MOUSEBUTTONUP:
                stayInWhile = False
            mousePos = pygame.mouse.get_pos()
            mousePos = self.translatePointToFluidDC(mousePos)
            color = self.curColor.astype(np.uint8).reshape(1, 1, 3)
            color = cv2.cvtColor(color, cv2.COLOR_BGR2LAB)[0,0]
            self.fluidDC.addFluid(color, mousePos, self.curRadius)
            self.updateSurface()
            self.update(blockEvents = True)

    def pygameEventsHandler(self, events):
        for event in events:
            if event.type == pygame.MOUSEBUTTONDOWN:

                pressedButtons = pygame.mouse.get_pressed()
                if pressedButtons[0]:
                    self.leftClick()
                elif pressedButtons[2]:
                    self.rightClick()

    def getNewColor(self):
        newColor = tkColorChooser.askcolor(parent=self.master)
        self.curColor = np.array(newColor[0])

    def quit(self):
        self.hasQuit = True
        self.master.destroy()
        pygame.display.quit()
        cv2.destroyAllWindows()
        self.videoWriter.release()


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">

<title>LINK :: rel : copyright</title>
<link rel="copyright" href="http://opera.com">

Activating "copyright" button on the navigation bar in Opera should take you to Opera homepage


text:
#include <stdio.h>
#include "crypto/ctype.h"
#include "internal/cryptlib.h"
#include "internal/unicode.h"
#include <openssl/asn1.h>

static int traverse_string(const unsigned char *p, int len, int inform,
                           int (*rfunc) (unsigned long value, void *in),
                           void *arg);
static int in_utf8(unsigned long value, void *arg);
static int out_utf8(unsigned long value, void *arg);
static int type_str(unsigned long value, void *arg);
static int cpy_asc(unsigned long value, void *arg);
static int cpy_bmp(unsigned long value, void *arg);
static int cpy_univ(unsigned long value, void *arg);
static int cpy_utf8(unsigned long value, void *arg);

/*
 * These functions take a string in UTF8, ASCII or multibyte form and a mask
 * of permissible ASN1 string types. It then works out the minimal type
 * (using the order Numeric < Printable < IA5 < T61 < BMP < Universal < UTF8)
 * and creates a string of the correct type with the supplied data. Yes this is
 * horrible: it has to be :-( The 'ncopy' form checks minimum and maximum
 * size limits too.
 */

int ASN1_mbstring_copy(ASN1_STRING **out, const unsigned char *in, int len,
                       int inform, unsigned long mask)
{
    return ASN1_mbstring_ncopy(out, in, len, inform, mask, 0, 0);
}

int ASN1_mbstring_ncopy(ASN1_STRING **out, const unsigned char *in, int len,
                        int inform, unsigned long mask,
                        long minsize, long maxsize)
{
    int str_type;
    int ret;
    char free_out;
    int outform, outlen = 0;
    ASN1_STRING *dest;
    unsigned char *p;
    int nchar;
    int (*cpyfunc) (unsigned long, void *) = NULL;
    if (len == -1)
        len = strlen((const char *)in);
    if (!mask)
        mask = DIRSTRING_TYPE;
    if (len < 0)
        return -1;

    /* First do a string check and work out the number of characters */
    switch (inform) {

    case MBSTRING_BMP:
        if (len & 1) {
            ERR_raise(ERR_LIB_ASN1, ASN1_R_INVALID_BMPSTRING_LENGTH);
            return -1;
        }
        nchar = len >> 1;
        break;

    case MBSTRING_UNIV:
        if (len & 3) {
            ERR_raise(ERR_LIB_ASN1, ASN1_R_INVALID_UNIVERSALSTRING_LENGTH);
            return -1;
        }
        nchar = len >> 2;
        break;

    case MBSTRING_UTF8:
        nchar = 0;
        /* This counts the characters and does utf8 syntax checking */
        ret = traverse_string(in, len, MBSTRING_UTF8, in_utf8, &nchar);
        if (ret < 0) {
            ERR_raise(ERR_LIB_ASN1, ASN1_R_INVALID_UTF8STRING);
            return -1;
        }
        break;

    case MBSTRING_ASC:
        nchar = len;
        break;

    default:
        ERR_raise(ERR_LIB_ASN1, ASN1_R_UNKNOWN_FORMAT);
        return -1;
    }

    if ((minsize > 0) && (nchar < minsize)) {
        ERR_raise_data(ERR_LIB_ASN1, ASN1_R_STRING_TOO_SHORT,
                       "minsize=%ld", minsize);
        return -1;
    }

    if ((maxsize > 0) && (nchar > maxsize)) {
        ERR_raise_data(ERR_LIB_ASN1, ASN1_R_STRING_TOO_LONG,
                       "maxsize=%ld", maxsize);
        return -1;
    }

    /* Now work out minimal type (if any) */
    if (traverse_string(in, len, inform, type_str, &mask) < 0) {
        ERR_raise(ERR_LIB_ASN1, ASN1_R_ILLEGAL_CHARACTERS);
        return -1;
    }

    /* Now work out output format and string type */
    outform = MBSTRING_ASC;
    if (mask & B_ASN1_NUMERICSTRING)
        str_type = V_ASN1_NUMERICSTRING;
    else if (mask & B_ASN1_PRINTABLESTRING)
        str_type = V_ASN1_PRINTABLESTRING;
    else if (mask & B_ASN1_IA5STRING)
        str_type = V_ASN1_IA5STRING;
    else if (mask & B_ASN1_T61STRING)
        str_type = V_ASN1_T61STRING;
    else if (mask & B_ASN1_BMPSTRING) {
        str_type = V_ASN1_BMPSTRING;
        outform = MBSTRING_BMP;
    } else if (mask & B_ASN1_UNIVERSALSTRING) {
        str_type = V_ASN1_UNIVERSALSTRING;
        outform = MBSTRING_UNIV;
    } else {
        str_type = V_ASN1_UTF8STRING;
        outform = MBSTRING_UTF8;
    }
    if (!out)
        return str_type;
    if (*out) {
        free_out = 0;
        dest = *out;
        OPENSSL_free(dest->data);
        dest->data = NULL;
        dest->length = 0;
        dest->type = str_type;
    } else {
        free_out = 1;
        dest = ASN1_STRING_type_new(str_type);
        if (dest == NULL) {
            ERR_raise(ERR_LIB_ASN1, ERR_R_MALLOC_FAILURE);
            return -1;
        }
        *out = dest;
    }
    /* If both the same type just copy across */
    if (inform == outform) {
        if (!ASN1_STRING_set(dest, in, len)) {
            ERR_raise(ERR_LIB_ASN1, ERR_R_MALLOC_FAILURE);
            return -1;
        }
        return str_type;
    }

    /* Work out how much space the destination will need */
    switch (outform) {
    case MBSTRING_ASC:
        outlen = nchar;
        cpyfunc = cpy_asc;
        break;

    case MBSTRING_BMP:
        outlen = nchar << 1;
        cpyfunc = cpy_bmp;
        break;

    case MBSTRING_UNIV:
        outlen = nchar << 2;
        cpyfunc = cpy_univ;
        break;

    case MBSTRING_UTF8:
        outlen = 0;
        traverse_string(in, len, inform, out_utf8, &outlen);
        cpyfunc = cpy_utf8;
        break;
    }
    if ((p = OPENSSL_malloc(outlen + 1)) == NULL) {
        if (free_out)
            ASN1_STRING_free(dest);
        ERR_raise(ERR_LIB_ASN1, ERR_R_MALLOC_FAILURE);
        return -1;
    }
    dest->length = outlen;
    dest->data = p;
    p[outlen] = 0;
    traverse_string(in, len, inform, cpyfunc, &p);
    return str_type;
}

/*
 * This function traverses a string and passes the value of each character to
 * an optional function along with a void * argument.
 */

static int traverse_string(const unsigned char *p, int len, int inform,
                           int (*rfunc) (unsigned long value, void *in),
                           void *arg)
{
    unsigned long value;
    int ret;
    while (len) {
        if (inform == MBSTRING_ASC) {
            value = *p++;
            len--;
        } else if (inform == MBSTRING_BMP) {
            value = *p++ << 8;
            value |= *p++;
            len -= 2;
        } else if (inform == MBSTRING_UNIV) {
            value = ((unsigned long)*p++) << 24;
            value |= ((unsigned long)*p++) << 16;
            value |= *p++ << 8;
            value |= *p++;
            len -= 4;
        } else {
            ret = UTF8_getc(p, len, &value);
            if (ret < 0)
                return -1;
            len -= ret;
            p += ret;
        }
        if (rfunc) {
            ret = rfunc(value, arg);
            if (ret <= 0)
                return ret;
        }
    }
    return 1;
}

/* Various utility functions for traverse_string */

/* Just count number of characters */

static int in_utf8(unsigned long value, void *arg)
{
    int *nchar;

    if (!is_unicode_valid(value))
        return -2;
    nchar = arg;
    (*nchar)++;
    return 1;
}

/* Determine size of output as a UTF8 String */

static int out_utf8(unsigned long value, void *arg)
{
    int *outlen, len;

    len = UTF8_putc(NULL, -1, value);
    if (len <= 0)
        return len;
    outlen = arg;
    *outlen += len;
    return 1;
}

/*
 * Determine the "type" of a string: check each character against a supplied
 * "mask".
 */

static int type_str(unsigned long value, void *arg)
{
    unsigned long types = *((unsigned long *)arg);
    const int native = value > INT_MAX ? INT_MAX : ossl_fromascii(value);

    if ((types & B_ASN1_NUMERICSTRING) && !(ossl_isdigit(native)
                                            || native == ' '))
        types &= ~B_ASN1_NUMERICSTRING;
    if ((types & B_ASN1_PRINTABLESTRING) && !ossl_isasn1print(native))
        types &= ~B_ASN1_PRINTABLESTRING;
    if ((types & B_ASN1_IA5STRING) && !ossl_isascii(native))
        types &= ~B_ASN1_IA5STRING;
    if ((types & B_ASN1_T61STRING) && (value > 0xff))
        types &= ~B_ASN1_T61STRING;
    if ((types & B_ASN1_BMPSTRING) && (value > 0xffff))
        types &= ~B_ASN1_BMPSTRING;
    if ((types & B_ASN1_UTF8STRING) && !is_unicode_valid(value))
        types &= ~B_ASN1_UTF8STRING;
    if (!types)
        return -1;
    *((unsigned long *)arg) = types;
    return 1;
}

/* Copy one byte per character ASCII like strings */

static int cpy_asc(unsigned long value, void *arg)
{
    unsigned char **p, *q;
    p = arg;
    q = *p;
    *q = (unsigned char)value;
    (*p)++;
    return 1;
}

/* Copy two byte per character BMPStrings */

static int cpy_bmp(unsigned long value, void *arg)
{
    unsigned char **p, *q;
    p = arg;
    q = *p;
    *q++ = (unsigned char)((value >> 8) & 0xff);
    *q = (unsigned char)(value & 0xff);
    *p += 2;
    return 1;
}

/* Copy four byte per character UniversalStrings */

static int cpy_univ(unsigned long value, void *arg)
{
    unsigned char **p, *q;
    p = arg;
    q = *p;
    *q++ = (unsigned char)((value >> 24) & 0xff);
    *q++ = (unsigned char)((value >> 16) & 0xff);
    *q++ = (unsigned char)((value >> 8) & 0xff);
    *q = (unsigned char)(value & 0xff);
    *p += 4;
    return 1;
}

/* Copy to a UTF8String */

static int cpy_utf8(unsigned long value, void *arg)
{
    unsigned char **p;
    int ret;
    p = arg;
    /* We already know there is enough room so pass 0xff as the length */
    ret = UTF8_putc(*p, 0xff, value);
    *p += ret;
    return 1;
}


text:
from __future__ import unicode_literals
# start tutorial
from django import forms
from django.core.exceptions import ValidationError
from djangular.forms.fields import FloatField
from djangular.styling.bootstrap3.forms import Bootstrap3Form

def validate_password(value):
    # Just for demo. Do not validate passwords like this!
    if value != 'secret':
        raise ValidationError('The password is wrong.')

class SubscribeForm(Bootstrap3Form):
    CONTINENT_CHOICES = (('am', 'America'), ('eu', 'Europe'), ('as', 'Asia'), ('af', 'Africa'),
                         ('au', 'Australia'), ('oc', 'Oceania'), ('an', 'Antartica'),)
    TRAVELLING_BY = (('foot', 'Foot'), ('bike', 'Bike'), ('mc', 'Motorcycle'), ('car', 'Car'),
                     ('public', 'Public Transportation'), ('train', 'Train'), ('air', 'Airplane'),)
    NOTIFY_BY = (('email', 'EMail'), ('phone', 'Phone'), ('sms', 'SMS'), ('postal', 'Postcard'),)

    first_name = forms.CharField(label='First name', min_length=3, max_length=20)
    last_name = forms.RegexField(r'^[A-Z][a-z -]?', label='Last name',
        error_messages={'invalid': 'Last names shall start in upper case'})
    sex = forms.ChoiceField(choices=(('m', 'Male'), ('f', 'Female')),
        widget=forms.RadioSelect, error_messages={'invalid_choice': 'Please select your sex'})
    email = forms.EmailField(label='E-Mail', required=True,
        help_text='Please enter a valid email address')
    subscribe = forms.BooleanField(label='Subscribe Newsletter',
        initial=False, required=False)
    phone = forms.RegexField(r'^\+?[0-9 .-]{4,25}$', label='Phone number',
        error_messages={'invalid': 'Phone number have 4-25 digits and may start with +'})
    birth_date = forms.DateField(label='Date of birth',
        widget=forms.DateInput(attrs={'validate-date': '^(\d{4})-(\d{1,2})-(\d{1,2})$'}),
        help_text='Allowed date format: yyyy-mm-dd')
    continent = forms.ChoiceField(choices=CONTINENT_CHOICES, label='Living on continent',
        error_messages={'invalid_choice': 'Please select your continent'})
    weight = forms.IntegerField(min_value=42, max_value=95, label='Weight in kg',
        error_messages={'min_value': 'You are too lightweight'})
    height = FloatField(min_value=1.48, max_value=1.95, step=0.05, label='Height in meters',
        error_messages={'max_value': 'You are too tall'})
    traveling = forms.MultipleChoiceField(choices=TRAVELLING_BY, label='Traveling by',
        help_text='Choose one or more carriers', required=True)
    notifyme = forms.MultipleChoiceField(choices=NOTIFY_BY, label='Notify by',
        widget=forms.CheckboxSelectMultiple, required=True,
        help_text='Must choose at least one type of notification')
    annotation = forms.CharField(label='Annotation', required=True,
        widget=forms.Textarea(attrs={'cols': '80', 'rows': '3'}))
    agree = forms.BooleanField(label='Agree with our terms and conditions',
        initial=False, required=True)
    password = forms.CharField(label='Password', widget=forms.PasswordInput,
        validators=[validate_password],
        help_text='The password is "secret"')
    confirmation_key = forms.CharField(max_length=40, required=True, widget=forms.HiddenInput(),
        initial='hidden value')


text:
using System;

using Orleankka;
using Orleankka.Behaviors;

namespace ProcessManager
{
    class Supervision
    {
        readonly ActorGrain actor;
        readonly TimeSpan pingback;
        readonly string reminderName;

        public Supervision(ActorGrain actor, TimeSpan? pingback = null)
        {
            this.actor = actor;
            this.pingback = pingback ?? TimeSpan.FromMinutes(1);
            reminderName = $"{actor.GetType().Name}_keepalive";
        }

        public Receive On(Receive next) => async message =>
        {
            switch (message)
            {
                case Become _:
                    await actor.Reminders.Register(reminderName, due: pingback, period: pingback);
                    break;
                case Reminder reminder when reminder.Name == reminderName:
                    return Done.Result;
            }

            return await next(message);
        };

        public Receive Off(Receive next) => async message =>
        {
            var result = await next(message);

            switch (message)
            {
                case Become _:
                    await actor.Reminders.Unregister(reminderName);
                    break;
                case Reminder reminder when reminder.Name == reminderName:
                    await actor.Reminders.Unregister(reminderName);
                    return Done.Result;
            }

            return result;
        };
    }
}


text:
function last(ar) {
	return ar[ar.length - 1];
}

var translations = {
	'wait {$number} turn(s).': ['wait {$number} turn.', 'wait {$number} turns.'],
};

function pickPlural(msgs, variables) {
	if (msgs instanceof Array) {
		return (variables.number == 1 ? msgs[0] : msgs[1]);
	}
	return msgs;
}

function translate(msg, variables) {
	msg = pickPlural(translations[msg] || msg, variables);
	return msg.replace(/\{\$([^}]+)}/g, function(match, key) {
		return (key in variables ? variables[key] : match);
	});
}

function changePlaying(value) {
	playing = value;
	document.getElementById('playLink' + getNextPlayerIndex()).appendChild(document.getElementById('playLink'));
	for (var i = 0, field; field = fields[i]; i++) {
		if (field.bettable) {
			field.updateEarns();
		}
	}
}

function getNextPlayerIndex() {
	if (!players.length) {
		return maxPlayers - 1;
	}
	var i = playing;
	do {
		i = (i + 1) % players.length;
	} while (!players[i]);
	return i;
}

/** @this {Place|Rail|Service} */
function offerBuying(player) {
	ask(translate('buy {$name} for {$price}?', {name: this.name, price: this.price}), player, buy.bind(this));
}

/** @this {Place|Rail|Service} */
function buy(player) {
	if (!player.tryPaying(this.price)) {
		return false;
	}
	changeOwner.call(this, player);
}

/** @this {Place|Rail|Service} */
function changeOwner(owner) {
	if (this.owner) {
		this.div.classList.remove('owner' + this.owner.index);
	}
	this.owner = owner;
	if (owner) {
		this.div.classList.add('owner' + owner.index);
		this.div.classList.add('owned');
		this.div.onclick = offerSelling.bind(this);
	} else {
		this.div.classList.remove('owned');
		this.div.onclick = this.onclick;
	}
	if (this.updateEarns) {
		this.updateEarns();
	}
}

/** @this {Place|Rail|Service} */
function offerSelling() {
	var input = '<input class=price type=number step=100 min=0 value=' + (this.price + (this.upgrades * this.upgradePrice || 0)) + '>';
	var options = [];
	if (this.owner.money < 0) {
		options.push('<option value=-1>' + translate('bank'));
	}
	for (var i = 0; i < maxPlayers; i++) {
		var player = players[i];
		if (player && player != this.owner) {
			options.push('<option value=' + i + '>' + escape(player.name));
		}
	}
	if (!options.length) {
		say(translate('nobody to sell to.'), this.owner);
		return;
	}
	// TODO: Disable selling if there are upgrades with the same color.
	var onchange = (this.owner.money < 0 ? ' onchange="buyerChange.call(this, ' + (this.price + (this.upgrades * this.upgradePrice / 2 || 0)) + ');"' : '');
	var select = '<select class=buyer size=' + options.length + onchange + '>' + options.join('') + '</select>';
	ask(translate('sell {$name} for {$price} to {$buyer}?', {name: this.name, price: input, buyer: select}), this.owner, sell.bind(this));
}

/** @this {HTMLSelectElement} */
function buyerChange(bankPrice) {
	var element = this.parentNode.querySelector('.price');
	var isBank = (this.value == -1);
	if (element.disabled != isBank) {
		element.disabled = isBank;
		if (isBank) {
			element.lastValue = element.value;
			element.value = bankPrice;
		} else if (element.lastValue) {
			element.value = element.lastValue;
		}
	}
}

/** @this {Place|Rail|Service} */
function sell() {
	var price = +last(document.getElementsByClassName('price')).value;
	var buyerIndex = last(document.getElementsByClassName('buyer')).value;
	if (!price || price < 0) { // price might be NaN.
		say(translate('input a valid price.'), this.owner);
		return false;
	}
	if (!buyerIndex) {
		say(translate('select a buyer.'), this.owner);
		return false;
	}
	var buyer = players[buyerIndex];
	if (!buyer) {
		earn(price, this.owner);
		if (this.upgrades) {
			this.upgrades = 0;
		}
	} else if (!buyer.tryPaying(price, this.owner)) {
		return false;
	}
	changeOwner.call(this, buyer);
}

function createDom(tag, attributes, content) {
	var el = document.createElement(tag);
	for (var key in attributes || {}) {
		var val = attributes[key];
		if (typeof val == 'object') {
			for (var key2 in val) {
				el[key][key2] = val[key2];
			}
		} else {
			el[key] = val;
		}
	}
	var contents = (content instanceof Array ? content : [content]);
	for (var i = 0; content = contents[i]; i++) {
		el.appendChild(typeof content == 'string' ? document.createTextNode(content) : content);
	}
	return el;
}

function escape(s) {
	return s.replace(/&/g, '&').replace(/</g, '<');
}

function say(message, player) {
	var p = createDom('p', {innerHTML: (player ? escape(player.name) + ', ' : '') + message});
	document.getElementById('message').appendChild(p);
	var element = p.querySelector('input, select');
	if (element) {
		element.focus();
		if (element.select) {
			element.select();
		}
	}
	p.scrollIntoView();
}

function ask(message, player, callback) {
	var question = '' + message + '';
	if (!questions.length || last(questions).message != question) {
		disableOldQuestions();
		say(question, player);
		var index = questions.length && questions[0].primary ? 1 : 0;
		questions[index] = {message: question, player: player, callback: callback};
		document.querySelector('.cancel').disabled = questions.length < 2;
	}
}

function disableOldQuestions() {
	var inputs = document.getElementById('message').querySelectorAll('select, input');
	for (var i = 0, input; input = inputs[i]; i++) {
		input.disabled = true;
	}
}

function position(i) {
	return {
		top: 10 + 66 * (i < 10 ? 0 : i < 20 ? i - 10 : i < 30 ? 10 : 40 - i),
		left: 10 + 128 * (i < 10 ? i : i < 20 ? 10 : i < 30 ? 30 - i : 0)
	};
}

function clearDice() {
	for (var i = 1; i <= 2; i++) {
		var element = document.getElementById('dice' + i);
		if (element) {
			element.textContent = '';
		}
	}
}

var maxPlayers = 6;
var players = [];
var playing = -1;

(function () {
	function createScoreRow(index, name) {
		return createDom('tr', {}, [
			createDom('td', {}, createDom('span', {className: 'player' + index}, '👤')),
			createDom('td', {id: 'name' + index}, createDom('input', {size: 10, value: name || ''})),
			createDom('td', {id: 'money' + index, className: 'money'}),
			createDom('td', {id: 'playLink' + index}),
		]);
	}

	var board = document.body.appendChild(createDom('div', {id: 'board'}));

	var scoreTable = board.appendChild(createDom('table', {id: 'score'}));
	var defaultNames = ['Jakub', 'Kryštof', 'Prokop', 'Jana'];
	for (var i = 0; i < maxPlayers; i++) {
		scoreTable.appendChild(createScoreRow(i, defaultNames[i]));
	}
	document.getElementById('playLink' + (maxPlayers - 1)).appendChild(createDom('span', {id: 'playLink'}, [
		createDom('button', {}, translate('Play')), ' [Space]',
	]));

	board.appendChild(createDom('div', {className: 'restart'}, [
		createDom('button', {id: 'undo'}, translate('Undo')),
		createDom('button', {id: 'restart'}, translate('Restart')),
	]));
	board.appendChild(createDom('div', {className: 'buttons'}, [
		createDom('button', {className: 'confirm'}, translate('Confirm')), ' [Enter]',
		createDom('button', {className: 'cancel', disabled: true}, translate('Cancel')), ' [Esc]',
	]));
	board.appendChild(createDom('div', {id: 'dice'}, createDom('span', {id: 'dice1'})));
	board.appendChild(createDom('div', {id: 'message'}));

	for (var i = 0, field; field = fields[i]; i++) {
		field.index = i;
		var pos = position(i);
		var style = {top: pos.top + 'px', left: pos.left + 'px'};
		if (field.color) {
			style.borderTopColor = field.color;
		}
		field.div = createDom('div', {
			className: 'field',
			style: style,
			innerHTML: field.name + (field.price ? ' (' + field.price + ')' : '') + '
' + (field.getEarns ? field.getEarns() : field.earns || '') + '',
			onclick: field.onclick,
		});
		field.div.style.top = pos.top + 'px';
		field.div.style.left = pos.left + 'px';
		board.appendChild(field.div);
	}
})();


text:
<?php

namespace Brasa\RecursoHumanoBundle\Repository;

use Doctrine\ORM\EntityRepository;

/**
 *
 * This class was generated by the Doctrine ORM. Add your own custom
 * repository methods below.
 */
class RhuCreditoRepository extends EntityRepository {

    public function listaDQL($strIdentificacion = "", $strDesde = "", $strHasta = "") {
        $em = $this->getEntityManager();
        $dql   = "SELECT c, e FROM BrasaRecursoHumanoBundle:RhuCredito c JOIN c.empleadoRel e WHERE c.codigoCreditoPk <> 0 AND c.estadoPagado <> 1";
        if($strIdentificacion != "" ) {
            $dql .= " AND e.numeroIdentificacion = '" . $strIdentificacion . "'";
        }
        if($strDesde != "" || $strDesde != '0'){
            //$strDesde = new \DateTime($strDesde);
            $dql .= " AND c.fechaInicio >='" . $strDesde . "'";
        }
        if($strHasta != "" || $strHasta != '0') {
            //$strHasta = new \DateTime($strHasta);
            $dql .= " AND c.fechaInicio <='" . $strHasta . "'";
        }

        //$dql .= " ORDER BY p.empleadoRel.nombreCorto";
        return $dql;
    }

    public function listaCreditoDQL($strIdentificacion = "", $strDesde = "", $strHasta = "") {
        $em = $this->getEntityManager();
        $dql   = "SELECT c, e FROM BrasaRecursoHumanoBundle:RhuCredito c JOIN c.empleadoRel e WHERE c.codigoCreditoPk <> 0";

        if($strIdentificacion != "") {
            $dql .= " AND e.numeroIdentificacion = '" . $strIdentificacion . "'";
        }
        if ($strDesde != "" ){
            $dql .= " AND c.fechaInicio >='" . $strDesde . "'";
        }
        if($strHasta != "" ) {
            $dql .= " AND c.fechaInicio <='" . $strHasta . "'";
        }

        //$dql .= " ORDER BY p.empleadoRel.nombreCorto";
        return $dql;
    }

    public function fechaAntigua() {
        $em = $this->getEntityManager();
        $dql   = "SELECT min(c.fecha) FROM BrasaRecursoHumanoBundle:RhuCredito c WHERE c.estadoPagado <> 1";
        $query = $em->createQuery($dql);
        $fechaAntigua = $query->getSingleScalarResult();
        return $fechaAntigua;
    }

    public function fechaAntiguaCredito() {
        $em = $this->getEntityManager();
        $dql   = "SELECT min(c.fecha) FROM BrasaRecursoHumanoBundle:RhuCredito c";
        $query = $em->createQuery($dql);
        $fechaAntigua = $query->getSingleScalarResult();
        return $fechaAntigua;
    }

    /**
     * Devuelve el total de la cuota de los creditos de un empleado.
     *
     * @author		Mario Estrada
     *
     * @param integer	Codigo del empleado
     * @return float    Valor de la cuota
     */
    public function cuotaCreditosNomina($codigoEmpleado) {
        $em = $this->getEntityManager();
        $dql   = "SELECT SUM(c.vrCuota) FROM BrasaRecursoHumanoBundle:RhuCredito c "
                . "WHERE c.codigoEmpleadoFk = " . $codigoEmpleado . " "
                . "AND c.codigoCreditoTipoPagoFk = 1 "
                . "AND c.estadoPagado = 0 "
                . "AND c.estadoSuspendido = 0";
        $query = $em->createQuery($dql);
        $floCuota = $query->getSingleScalarResult();
        return $floCuota;
    }

    /**
     * Devuelve los creditos pendientes de un empleado.
     *
     * @author		Mario Estrada
     *
     * @param integer	Codigo del empleado
     * @return objeto   Clase creditos
     */

    public function pendientes($codigoEmpleado = "") {
        $em = $this->getEntityManager();
        $dql   = "SELECT c FROM BrasaRecursoHumanoBundle:RhuCredito c "
                . "WHERE c.saldo > 0 "
                . "AND c.codigoEmpleadoFk = " . $codigoEmpleado;
        $query = $em->createQuery($dql);
        $arCreditos = $query->getResult();
        return $arCreditos;
    }

    public function TotalPendientes($codigoEmpleado = "") {
        $em = $this->getEntityManager();
        $dql   = "SELECT SUM(c.saldo) FROM BrasaRecursoHumanoBundle:RhuCredito c "
                . "WHERE c.saldoTotal > 0 "
                . "AND c.codigoEmpleadoFk = " . $codigoEmpleado;
        $query = $em->createQuery($dql);
        $arCreditos = $query->getResult();
        return $arCreditos;
    }
}


text:
'use strict';

var
	path = require('path'),
	util = require('util');

var
	slash = require('slash'),
	findIndex = require('find-index');

var
	parse = require('./parse-path'),
	logger = require('../../../../logger'),
	outfileSource = require('../../outfile-source');

var
	regex = /(['"])\@([.@][^\n\r\t\1]+?)\1/g,
	isDir = /[\\/]$/,
	log = logger.child({component: 'uri-resolver'}),
	levelSet;

module.exports = function (entry, opts, stream) {

	if (!levelSet) {
		levelSet = true;
		log.level(logger.level());
	}

	var
		dir = entry.isPackage ? entry.fullpath : path.dirname(entry.fullpath);

	entry.contents = entry.contents.replace(regex, function (match, delim, uri) {

		var
			ch = uri.charAt(0),
			file, ret;

		// allows us to know that @. is relative path and @@ means library name to help
		// differentiate from valid CSS nested in JavaScript strings
		if (ch == '@') {

			uri = uri.slice(1);

			var
				parsed = parse(uri),
				lib = parsed.dirs ? parsed.dirs.shift() : null,
				roots = opts.assetRoots,
				libp, idx;

			if (!lib) {
				log.debug({module: entry.relName}, 'ignoring %s because we could not find a library in the string', match);
				return match;
			}

			if (roots) {
				if (roots.length) {
					idx = findIndex(roots, function (e) { return e.name == lib; });
					if (idx !== -1) {
						libp = roots[idx].path;
					}
				}
				if (!libp && roots.all) libp = roots.all;
			}

			if (!libp) {
				log.debug({module: entry.relName}, 'no special path provided for library %s, using default', lib);
				ret = uri;
			} else {
				// deliberately forcing posix here because this is in the runtime JavaScript
				ret = path.posix.join(libp, uri);
			}
		} else {
			file = path.resolve(dir, uri);
			ret = outfileSource(file, entry, opts);
		}

		if (isDir.test(uri)) ret += '/';

		if (log.debug()) log.debug({module: entry.relName}, 'replacing %s with %s', match, ret);

		return '\'' + ret + '\'';

	});
};


text:
SYNONYM

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Grevillea 15(no. 73): 27 (1886)

#### Original name
Poria cincinnati Berk. ex Cooke, 1886

### Remarks
null


text:
An node app that converts incoming HTTP requests to Docker command, run those command through ```docker run```, and returns a webpage with a cloud-IDE and a cloud-terminal.

## Disclaimer
NOT secure due to docker needs ROOT access. Read more from [Docker](https://docs.docker.com/articles/security/)
> Running containers (and applications) with Docker implies running the Docker daemon. This daemon currently requires root privileges, and you should therefore be aware of some important details.

## Set up your own CloudIDE service
- Create a [DigitalOcean droplet with ref code](https://www.digitalocean.com/?refcode=24bf100573ba)
- Choose 'Docker on Ubuntu' under 'Select Image'->'Applications'. see ![screenshot](http://imgur.com/rw7TlGZ.png)
- Set up the droplet as usual
- Clone down this repo
- Set up this repo

## How this works at a high level
- Assuming your droplet can be accessed by ```azat.howtox.com```
- Assuming the docker image ```howtox/express``` already exist on your droplet
- The user clicks azat.howtox.com:3000/launch/howtox/express
- Express.js run this command
```
docker run -d -p 63814:3131 -p 63815:3132 -p 63816:3133 howtox/azat-express /usr/local/bin/supervisord
```
- Express.js then redirect the user to azat.howtox.com:3000/box/63814, and present the user with the following HTML
```
#first iframe is the editor
<iframe src="//azat.howtox.com:63814">
#second iframe is the terminal
<iframe src="//azat.howtox.com:63815">
```

## How to setup the droplet
- Make sure you picked the correct image 'Docker on Ubuntu'
```
apt-get update
apt-get upgrade -y
apt-get install nodejs -y
apt-get install npm -y
ln -s `which nodejs` /usr/local/bin/node
cd /home
git clone https://github.com/howtox/howtox-server
cd /home/howtox-server && npm install
# run the app by node app.js
#
#add env
#
vi ~/.bashrc
#optional
#export p_analytics_secret='secret_write_key_from_segment.io'
export EDITOR=vi
```
- Basically, you want to set up node.js and some environment variables. The other way to set up node/npm is using nvm.
- Finally, edit app.js to change the following global variables
```
global.APP_CONFIG = {
  domain: 'azat.howtox.com',
  containerLifespan: 600, //in seconds
  whitelistedImages: ["howtox/yc_base", "howtox/azat-express", "howtox/express"]
};
```

## Pull docker images to the droplet
```
docker pull howtox/yc_base
```

## Two ways of building a howtox-compatible Docker image

### Make a howtox-compatible Docker image with [Docker Automated Build](http://docs.docker.com/docker-hub/builds/)
TBD

### Make a howtox-compatible Docker image from scratch
- Get the url for the repo of interest. In this case, https://github.com/howtox/express.
- In the droplet
```
cd /home/howtox-server/controllers
node docker_build_image_cmd.js howtox/express
```
- Wait for a very long time...
- Verify the image has been built by
```
docker images | grep 'howtox/express'
```
- Update the app.js to add that image to the whitelist
```
global.APP_CONFIG = {
  domain: 'azat.howtox.com',
  containerLifespan: 60, //in seconds
  whitelistedImages: ["howtox/yc_base", "howtox/azat-express", "howtox/express"]
};
```
- Start the node app by ```node app.js``` and you should be able to visit the new image at: http://azat.howtox.com:3000/launch/howtox/express

### Troubleshoot
#### howtox-tty.js failed
```
npm install howtox-tty.js
```
- might need [xcode command line tool](https://github.com/atom/terminal/issues/28#issuecomment-39405908)

### License(MIT)


text:
<?php

namespace Fnayou\InstapushPHP\Http;

use Http\Client\Common\Plugin;
use Http\Client\Common\PluginClient;

/**
 * Configure an HTTP client.
 */
class HttpClientConfigurator extends AbstractHttpClientConfigurator implements HttpClientConfiguratorInterface
{
    const USER_AGENT = 'fnayou/instapush-php';

    /**
     * @var string
     */
    private $endpoint = 'http://api.instapush.im/v1';

    /**
     * @var string
     */
    private $apiUserToken;

    /**
     * @var string
     */
    private $apiAppIdentifier;

    /**
     * @var string
     */
    private $apiAppSecret;

    /**
     * @return \Http\Client\HttpClient
     */
    public function createConfiguredClient()
    {
        $plugins = $this->getPrependPlugins();
        $plugins[] = new Plugin\AddHostPlugin($this->getUriFactory()->createUri($this->getEndpoint()));
        $plugins[] = new Plugin\HeaderDefaultsPlugin($this->getHeaders());

        return new PluginClient($this->getHttpClient(), \array_merge($plugins, $this->getAppendPlugins()));
    }

    /**
     * @return string
     */
    public function getEndpoint()
    {
        return $this->endpoint;
    }

    /**
     * @param string $endpoint
     *
     * @return $this
     */
    public function setEndpoint(string $endpoint)
    {
        $this->endpoint = $endpoint;

        return $this;
    }

    /**
     * @return string
     */
    public function getApiUserToken()
    {
        return $this->apiUserToken;
    }

    /**
     * @param string $apiUserToken
     *
     * @return $this
     */
    public function setApiUserToken(string $apiUserToken = null)
    {
        $this->apiUserToken = $apiUserToken;

        return $this;
    }

    /**
     * @return string
     */
    public function getApiAppIdentifier()
    {
        return $this->apiAppIdentifier;
    }

    /**
     * @param string $apiAppIdentifier
     *
     * @return $this
     */
    public function setApiAppIdentifier(string $apiAppIdentifier = null)
    {
        $this->apiAppIdentifier = $apiAppIdentifier;

        return $this;
    }

    /**
     * @return string
     */
    public function getApiAppSecret()
    {
        return $this->apiAppSecret;
    }

    /**
     * @param string $apiAppSecret
     *
     * @return $this
     */
    public function setApiAppSecret(string $apiAppSecret = null)
    {
        $this->apiAppSecret = $apiAppSecret;

        return $this;
    }

    /**
     * @return array
     */
    private function getHeaders()
    {
        $headers = [
            'User-Agent' => static::USER_AGENT,
        ];

        if (null !== $this->getApiUserToken()) {
            $headers['X-INSTAPUSH-TOKEN'] = $this->getApiUserToken();
        }

        if (null !== $this->getApiAppIdentifier()) {
            $headers['X-INSTAPUSH-APPID'] = $this->getApiAppIdentifier();
        }

        if (null !== $this->getApiAppSecret()) {
            $headers['X-INSTAPUSH-APPSECRET'] = $this->getApiAppSecret();
        }

        return $headers;
    }
}