text:
{-# LANGUAGE CPP                  #-}
{-# LANGUAGE FlexibleInstances    #-}
{-# LANGUAGE ScopedTypeVariables  #-}
{-# LANGUAGE UnicodeSyntax        #-}

-- Only are translated the functions that will be translate as TPTP
-- definitions.

module Apia.Translation.Functions ( fnToFormula ) where

------------------------------------------------------------------------------

import Apia.Prelude

import Agda.Syntax.Abstract.Name ( QName )

import Agda.Syntax.Common
  ( Arg(Arg)
  , defaultArgInfo
  , Dom(Dom)
  , Nat
  )

import Agda.Syntax.Internal
  ( Abs(Abs)
  , Clause(Clause)
  , Elim'(Apply)
  , Elims
  , Level(Max)
  , namedClausePats
  , PlusLevel(ClosedLevel)
  , Sort(Type)
  , Tele(ExtendTel)
  , Term(Def, Pi, Sort)
  , Type
  , Type'(El)
  , var
  )

import Agda.Utils.Impossible ( Impossible(Impossible), throwImpossible )

import Apia.FOL.Types ( LFormula(Bicond, Eq, ForAll) )

import Apia.Monad.Base
  ( getTVars
  , popTVar
  , pushTNewVar
  , T
  , tErr
  , TErr ( NoFOLDefinition
         , NoOneClauseDefinition
         , ProofTermInDefintion
         )
  )

import Apia.Monad.Reports ( reportSLn )

import Apia.Translation.Terms
  ( agdaTermToFormula
  , agdaTermToTerm
  )

import Apia.Utils.AgdaAPI.EtaExpansion ( EtaExpandible(etaExpand) )

-- import Apia.Utils.AgdaAPI.IgnoreSharing ( IgnoreSharing(ignoreSharing) )

#include "undefined.h"

------------------------------------------------------------------------------
-- Auxiliary functions

varsToElims ∷ Nat → Elims
varsToElims 0 = []
varsToElims n = Apply (Arg defaultArgInfo (var (n - 1))) : varsToElims (n - 1)

------------------------------------------------------------------------------
-- In general a definition's function is given by various clauses
-- (i.e. equations), for example every equation in a definition by
-- pattern matching. In our case it is only necessary to translate
-- definitions with only one clause.

-- | Translate an ATP definition to a target logic formula.
fnToFormula ∷ QName → Type → [Clause] → T LFormula
fnToFormula _      _  []   = __IMPOSSIBLE__
fnToFormula qName  ty [cl] =
  clauseToFormula qName ty cl (length $ namedClausePats cl)
fnToFormula qName _ _ = tErr $ NoOneClauseDefinition qName

-- A Clause is defined by (Agda.Syntax.Internal, 2016-12-25):

-- data Clause = Clause
--     { clauseRange     :: Range
--     , clauseTel       :: Telescope
--       -- ^ @Δ@: The types of the pattern variables in dependency order.
--     , namedClausePats :: [NamedArg DeBruijnPattern]
--       -- ^ @Δ ⊢ ps@.  The de Bruijn indices refer to @Δ@.
--     , clauseBody      :: Maybe Term
--       -- ^ @Just v@ with @Δ ⊢ v@ for a regular clause, or @Nothing@ for an
--       --   absurd one.
--     , clauseType      :: Maybe (Arg Type)
--       -- ^ @Δ ⊢ t@.  The type of the rhs under @clauseTel@.
--       --   Used, e.g., by @TermCheck@.
--       --   Can be 'Irrelevant' if we encountered an irrelevant projection
--       --   pattern on the lhs.
--     , clauseCatchall  :: Bool
--       -- ^ Clause has been labelled as CATCHALL.
--     }

-- The LHS of the definition's function is given by the @QName@ and
-- the @Type@. The RHS is given by the @Clause@. Before translating
-- the LHS and the RHS (i.e. the body of the clause) it is necessary
-- to generate a universal quantification on an equal number of
-- variables to length @[NamedArg DeBruijnPattern]@.
clauseToFormula ∷ QName → Type → Clause → Int → T LFormula
-- There is at most one variable in the clause's pattern.
clauseToFormula qName ty cl@(Clause lr fr tel (_ : ncps) (Just cBody) cTy cc unreachable)
                totalBoundedVars = do
  reportSLn "def2f" 20 $ "cl: " ++ show cl

  case tel of
    -- The bounded variable is quantified on a @Set@,
    --
    -- e.g. the bounded variable is @d : D@ where @D : Set@,
    --
    -- so we can create a fresh variable and quantify on it without
    -- any problem.
    --
    -- N.B. the pattern matching on @(Def _ [])@.
    ExtendTel (Dom _ _ (El (Type (Max [])) (Def _ []))) (Abs x tels) → do
      reportSLn "def2f" 20 $ "Processing variable " ++ show x

      freshVar ← pushTNewVar
      -- We process forward in the telescope and the pattern.
      f ← clauseToFormula qName ty (Clause lr fr tels ncps (Just cBody) cTy cc unreachable)
                          totalBoundedVars
      popTVar

      return $ ForAll freshVar $ const f

    -- The bounded variable is quantified on a proof,
    --
    -- e.g. the bounded variable is @Nn : N n@ where @D : Set@,
    -- @n : D@, and @N : D → Set@,
    --
    -- so we need drop this quantification. In this case, we erase the
    -- quantification on the bounded variable and we try it as a
    -- function type (using @Cond@ instead of @ForAll@).

    -- N.B. the pattern matching on @(Def _ _)@.

    -- See Issue #81.
    ExtendTel (Dom _ _ (El (Type (Max [])) (Def _ _))) (Abs _ _) →
      tErr $ ProofTermInDefintion qName

    ExtendTel (Dom _ _ (El (Type (Max [])) (Pi _ _))) _ →
      tErr $ NoFOLDefinition qName

    -- Issue #80.
    ExtendTel (Dom _ _ (El (Type (Max [_])) (Sort _))) _ →
      tErr $ NoFOLDefinition qName

    _ → do
        reportSLn "def2f" 20 $ "tel: " ++ show tel  -- (ignoreSharing tel)
        __IMPOSSIBLE__

-- The clause's patterns is empty, i.e. we have generated the required
-- universal quantification, so we translate the LHS and the RHS.
clauseToFormula qName ty (Clause _ _ _ [] (Just cBody) _ _ _) totalBoundedVars = do
  vars ← getTVars
  reportSLn "def2f" 20 $ "vars: " ++ show vars
  reportSLn "def2f" 20 $ "totalBoundedVars: " ++ show totalBoundedVars

  case ty of
    -- The defined symbol is a predicate.
    El (Type (Max [ClosedLevel 1])) _ → do

      -- We create the Agda term corresponds to the LHS of the symbol's
      -- definition.
      let lhs ∷ Term
          lhs = Def qName $ varsToElims $ length vars

      -- Because the LHS and the RHS (the body of the clause) are
      -- formulae, they are related via a biconditional connective.
      liftM2 Bicond
             (agdaTermToFormula lhs)
             (etaExpand cBody >>= agdaTermToFormula)

    -- The defined symbol is a function.
    El (Type (Max [])) _ → do
      -- We create the Agda term corresponds to the LHS of the symbol's
      -- definition.

      -- We use @totalBoundedVars@ because we need to handle definitions like
      --
      -- @foo ∷ D → D@
      -- @foo = λ d → ...

      let lhs ∷ Term
          lhs = Def qName $ varsToElims totalBoundedVars

      if length vars == totalBoundedVars
        -- The definition is of the form
        --
        -- @foo ∷ D → D@
        -- @foo d = ...
        --
        -- so we don't need to add new fresh variables.

        -- 16 July 2012. N.B. We don't η-expand the term before the
        -- translation because we don't have a test case where it is
        -- neeed.
        then liftM2 Eq (agdaTermToTerm lhs) (agdaTermToTerm cBody)
        -- The definition is of the form
        --
        -- @foo ∷ D → D@
        -- @foo = λ d → ...
        --
        -- so we need to add some fresh variables to the state before
        -- call the translation for @lhs@ and @cBody@.
        else if length vars < totalBoundedVars
          then do
            let diff ∷ Int
                diff = totalBoundedVars - length vars

            freshVars ← replicateM diff pushTNewVar
            reportSLn "def2f" 20 $ "Freshvars: " ++ show freshVars
            tLHS ← agdaTermToTerm lhs
            replicateM_ diff popTVar
            -- 16 July 2012. N.B. We don't η-expand the term before
            -- the translation (we don't have a test case where it is
            -- neeed).
            tRHS ← agdaTermToTerm cBody

            -- Because the LHS and the RHS (the body of the clause)
            -- are terms, they are related via the target logic
            -- equaliy.
            let helper ∷ [String] → LFormula
                helper []       = __IMPOSSIBLE__
                helper [x]      = ForAll x $ \_ → Eq tLHS tRHS
                helper (x : xs) = ForAll x $ \_ → helper xs

            return $ helper freshVars
          else __IMPOSSIBLE__

    _ → __IMPOSSIBLE__

clauseToFormula _ _ _ _  = __IMPOSSIBLE__


text:
package io.datakernel.serializer.annotations;

import io.datakernel.serializer.CompatibilityLevel;
import io.datakernel.serializer.SerializerBuilder.Helper;
import io.datakernel.serializer.impl.SerializerDefBuilder;

import java.lang.annotation.Annotation;

public interface AnnotationHandler<A extends Annotation, P extends Annotation> {
	SerializerDefBuilder createBuilder(Helper serializerBuilder, A annotation, CompatibilityLevel compatibilityLevel);

	int[] extractPath(A annotation);

	A[] extractList(P plural);
}

redpajama_set_name: RedPajamaGithub


text:
namespace exo {
namespace test {

////////////////////////////////////////////////////////////////////////////////
// ExoTestBase, public:

ExoTestBase::ExoTestBase() : exo_test_helper_(new ExoTestHelper) {}

ExoTestBase::~ExoTestBase() {}

void ExoTestBase::SetUp() {
  base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
  // Disable window animation when running tests.
  command_line->AppendSwitch(wm::switches::kWindowAnimationsDisabled);
  AshTestBase::SetUp();
  wm_helper_ = base::MakeUnique<WMHelperAsh>();
  WMHelper::SetInstance(wm_helper_.get());
}

void ExoTestBase::TearDown() {
  WMHelper::SetInstance(nullptr);
  wm_helper_.reset();
  AshTestBase::TearDown();
}

}  // namespace test
}  // namespace exo


text:
package io.github.benas.randombeans.beans;

import lombok.Data;

@Data
public class ClassUsingAbstractEnum {

    private AbstractEnum testEnum;
}


text:
<!DOCTYPE html>

	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<meta name="google-site-verification" content="H8RGMD_f_siP2w-pSgSovLpeKIMac--hZGy47rZWoUM" />

	<title>Curious Techizen</title>

	<link rel="icon" href="favicon.ico" type="image/png" />

	<link href="https://fonts.googleapis.com/css?family=Roboto+Mono|Roboto+Slab&display=swap" rel="stylesheet">
	<link href="https://use.fontawesome.com/releases/v5.12.0/css/all.css" rel="stylesheet">
	<link rel="stylesheet" href="css_landing/reset.css">
	<link rel="stylesheet" href="css_landing/styles.css">
	<link rel="stylesheet" href="css_landing/themes/white-green.css">

Hello, I'm Kiran Rao

Android Developer | Tech Enthusiast | Serial Dabbler

		Landing page based on flexdinesh/dev-landing-page(MIT Licensed)


text:
using System;
using System.Collections;
using System.Collections.Generic;
using NUnit.Framework;

namespace FileHelpers.Tests.CommonTests
{
    [TestFixture]
    public class QuotedStringEntities
    {
        [Test]
        public void OrdersQuoted()
        {
            var engine = new FileHelperEngine<OrdersQuotedType>();

            OrdersQuotedType[] res = TestCommon.ReadTest<OrdersQuotedType>(engine, "Good", "QuotedOrders.txt");

            Assert.AreEqual(6, res.Length);

            Assert.AreEqual("VINET", res[0].CustomerID);
            Assert.AreEqual("TO,SP", res[1].CustomerID);
            Assert.AreEqual("HA\"AR", res[2].CustomerID);
            Assert.AreEqual("VICTE", res[3].CustomerID);
            Assert.AreEqual("S\"U\"P\"\"", res[4].CustomerID);
            Assert.AreEqual("HANAR", res[5].CustomerID);
        }

        [Test]
        public void OrdersQuoted2()
        {
            var engine = new FileHelperEngine<OrdersQuoted2Type>();

            var res = TestCommon.ReadTest<OrdersQuoted2Type>(engine, "Good", "QuotedOrders2.txt");

            Assert.AreEqual(6, res.Length);

            Assert.AreEqual("VINET", res[0].CustomerID);
            Assert.AreEqual("T,O", res[1].CustomerID);
            Assert.AreEqual("HA,,AR", res[2].CustomerID);
            Assert.AreEqual("VICTE", res[3].CustomerID);
            Assert.AreEqual("S,\",\"", res[4].CustomerID);
            Assert.AreEqual("HA,NAR", res[5].CustomerID);
        }

        [Test]
        public void CustomersQuoted()
        {
            var engine = new FileHelperEngine<CustomersQuotedType>();

            var res = TestCommon.ReadTest<CustomersQuotedType>(engine, "Good", "QuotedCustomers.txt");

            Assert.AreEqual(10, res.Length);

            Assert.AreEqual("Alfreds Futterkiste", res[0].CompanyName);
            Assert.AreEqual("Ana Trujillo Emparedados y helados", res[1].CompanyName);
            Assert.AreEqual(@"Berglunds snabbkp", res[4].CompanyName);
        }

        [Test]
        public void CustomersQuoted2()
        {
            var engine = new FileHelperEngine<CustomersQuotedType2>();

            var res = TestCommon.ReadTest<CustomersQuotedType2>(engine, "Good", "QuotedCustomers2.txt");

            Assert.AreEqual(10, res.Length);

            Assert.AreEqual("Alfreds Futterkiste", res[0].CompanyName);
            Assert.AreEqual("Ana Trujillo Emparedados y helados", res[1].CompanyName);
            Assert.AreEqual(@"Berglunds snabbkp", res[4].CompanyName);
        }

        [Test]
        public void OrdersQuotedWrite()
        {
            var engine = new FileHelperEngine<OrdersQuotedType>();

            OrdersQuotedType[] res = TestCommon.ReadTest<OrdersQuotedType>(engine, "Good", "QuotedOrders.txt");
            engine.WriteFile("temp2.txt", res);
            res = (OrdersQuotedType[]) engine.ReadFile("temp2.txt");

            Assert.AreEqual(6, res.Length);

            Assert.AreEqual("VINET", res[0].CustomerID);
            Assert.AreEqual("TO,SP", res[1].CustomerID);
            Assert.AreEqual("HA\"AR", res[2].CustomerID);
            Assert.AreEqual("VICTE", res[3].CustomerID);
            Assert.AreEqual("S\"U\"P\"\"", res[4].CustomerID);
            Assert.AreEqual("HANAR", res[5].CustomerID);
        }
    }

    [DelimitedRecord("|")]
    public class OrdersQuotedType
    {
        public int OrderID;

        [FieldQuoted]
        public string CustomerID;

        public int EmployeeID;
        public DateTime OrderDate;
        public DateTime RequiredDate;

        [FieldNullValue(typeof (DateTime), "2005-1-1")]
        public DateTime ShippedDate;

        public int ShipVia;
        public decimal Freight;
    }

    [DelimitedRecord(",")]
    public class OrdersQuoted2Type
    {
        public int OrderID;

        [FieldQuoted]
        public string CustomerID;

        public int EmployeeID;
        public DateTime OrderDate;
        public DateTime RequiredDate;

        [FieldNullValue(typeof (DateTime), "2005-1-1")]
        public DateTime ShippedDate;

        public int ShipVia;
        public decimal Freight;
    }

    [DelimitedRecord("|")]
    public class CustomersQuotedType
    {
        public string CustomerID;

        [FieldQuoted(QuoteMode.AlwaysQuoted, MultilineMode.NotAllow)]
        public string CompanyName;

        public string ContactName;
        public string ContactTitle;
        public string Address;
        public string City;
        public string Country;
    }

    [DelimitedRecord("|")]
    public class CustomersNoQuotedType
    {
        public string CustomerID;

        [FieldQuoted('\0', QuoteMode.AlwaysQuoted, MultilineMode.NotAllow)]
        public string CompanyName;

        public string ContactName;
        public string ContactTitle;
        public string Address;
        public string City;
        public string Country;
    }

    [DelimitedRecord("|")]
    public class CustomersQuotedType2
    {
        public string CustomerID;

        [FieldQuoted]
        [FieldTrim(TrimMode.Both)]
        public string CompanyName;

        public string ContactName;
        public string ContactTitle;
        public string Address;
        public string City;
        public string Country;
    }
}


text:
module Rtree
  class Shape < Struct.new(:bounding_box, :point_array)
    def self.sort_by_bounding_box(shapes)
      shapes.sort_by { |s| s.bounding_box.top_left }
    end
  end
end


text:
#ifndef	_IDE_H
#define _IDE_H

#define IDE_BUS(dev)	(dev / (CONFIG_SYS_IDE_MAXDEVICE / CONFIG_SYS_IDE_MAXBUS))

#define	ATA_CURR_BASE(dev)	(CONFIG_SYS_ATA_BASE_ADDR+ide_bus_offset[IDE_BUS(dev)])
extern ulong ide_bus_offset[];

#ifdef CONFIG_IDE_LED

/*
 * LED Port
 */
#define	LED_PORT	((uchar *)(PER8_BASE + 0x3000))
#define LED_IDE1	0x01
#define LED_IDE2	0x02
#define	DEVICE_LED(d)	((d & 2) | ((d & 2) == 0)) /* depends on bit positions! */

void ide_led(uchar led, uchar status);
#endif /* CONFIG_IDE_LED */

#ifdef CONFIG_SYS_64BIT_LBA
typedef uint64_t lbaint_t;
#define LBAF "%llx"
#define LBAFU "%llu"
#else
typedef ulong lbaint_t;
#define LBAF "%lx"
#define LBAFU "%lu"
#endif

/*
 * Function Prototypes
 */

void ide_init(void);
ulong ide_read(int device, lbaint_t blknr, lbaint_t blkcnt, void *buffer);
ulong ide_write(int device, lbaint_t blknr, lbaint_t blkcnt,
		const void *buffer);

#ifdef CONFIG_IDE_PREINIT
int ide_preinit(void);
#endif

#ifdef CONFIG_IDE_INIT_POSTRESET
int ide_init_postreset(void);
#endif

#if defined(CONFIG_OF_IDE_FIXUP)
int ide_device_present(int dev);
#endif

#if defined(CONFIG_IDE_AHB)
unsigned char ide_read_register(int dev, unsigned int port);
void ide_write_register(int dev, unsigned int port, unsigned char val);
void ide_read_data(int dev, ulong *sect_buf, int words);
void ide_write_data(int dev, const ulong *sect_buf, int words);
#endif

/*
 * I/O function overrides
 */
unsigned char ide_inb(int dev, int port);
void ide_outb(int dev, int port, unsigned char val);
void ide_input_swap_data(int dev, ulong *sect_buf, int words);
void ide_input_data(int dev, ulong *sect_buf, int words);
void ide_output_data(int dev, const ulong *sect_buf, int words);
void ide_input_data_shorts(int dev, ushort *sect_buf, int shorts);
void ide_output_data_shorts(int dev, ushort *sect_buf, int shorts);

void ide_led(uchar led, uchar status);

/**
 * board_start_ide() - Start up the board IDE interfac
 *
 * @return 0 if ok
 */
int board_start_ide(void);

#endif /* _IDE_H */


text:
usefull software for h4ck3r5

Please buy me a Beer. I need really need some :D
Bitcoin:
1vRUxHgqyK4jmSMTofTrYuskHRvuz2Xsf


text:
CKEDITOR.plugins.setLang( 'language', 'sl', {
	button: 'Nastavi jezik',
	remove: 'Odstrani jezik'
} );


text:
module Elastix
  class User < ActiveRecord::Base
    def self.use_existing_db_connection connection
      establish_connection connection
    end
  end
end


text:
import Dismissible from './dismissible'
import Dropdowns from './dropdowns'
import Offcanvas from './offcanvas'
import Tabs from './tabs'

const dismissible = new Dismissible()
const dropdowns = new Dropdowns()
const offcanvas = new Offcanvas()
const tabs = new Tabs()


text:
from .errors import NoMatch
from .tokens import tokens_list, tokens_shlex, tokens_text, regex_lexer, tokens_gen, tokens
from .parsers import parsnip, text, regex
from .parsers import seq, lift, lift2, liftNth, choice, choiceConsumeAll, option, matchNM, exactlyN
from .parsers import tag, tagfn, mapfn, maptags, loopref, loop, many, many1, unless, manyTill, manyAndTill
from .parsers import sep, anything, end, wrap, doc, parse


text:
using System;
using System.Collections.Generic;

namespace GameJolt.API {
    /// <summary>
    /// DataStore operations.
    /// </summary>
    public enum DataStoreOperation { Add, Subtract, Multiply, Divide, Append, Prepend };

    /// <summary>
    /// The DataStore API methods.
    /// </summary>
    public static class DataStore {
        /// <summary>
        /// Save the key/value pair in the DataStore.
        /// </summary>
        /// <param name="key">The key name.</param>
        /// <param name="value">The value to store.</param>
        /// <param name="global">A boolean indicating whether the key is global (<c>true<c/>) or private to the user (<c>false<c/>).</param>
        /// <param name="callback">A callback function accepting a single parameter, a boolean indicating success.</param>
        public static void Set(string key, string value, bool global, Action<bool> callback = null) {
            var parameters = new Dictionary<string, string>();
            parameters.Add("key", key);

            var payload = new Dictionary<string, string>();
            payload.Add("data", value);

            Core.Request.Post(Constants.API_DATASTORE_SET, parameters, payload, (Core.Response response) => {
                if (callback != null) {
                    callback(response.success);
                }
            }, !global);
        }

        /// <summary>
        /// Update the value for a given key in the DataStore.
        /// </summary>
        /// <param name="key">The key name.</param>
        /// <param name="value">The new value to operate with.</param>
        /// <param name="operation">The <see cref="DataStoreOperation"/> to perform.</param>
        /// <param name="global">A boolean indicating whether the key is global (<c>true<c/>) or private to the user (<c>false<c/>).</param>
        /// <param name="callback">A callback function accepting a single parameter, a the updated key value.</param>
        public static void Update(string key, string value, DataStoreOperation operation, bool global, Action<string> callback = null) {
            var parameters = new Dictionary<string, string>();
            parameters.Add("key", key);
            parameters.Add("operation", operation.ToString().ToLower());

            var payload = new Dictionary<string, string>();
            payload.Add("value", value);

            Core.Request.Post(Constants.API_DATASTORE_UPDATE, parameters, payload, (Core.Response response) => {
                if (callback != null) {
                    if (response.success) {
                        callback(response.dump);
                    } else {
                        callback(null);
                    }
                }
            }, !global, Core.ResponseFormat.Dump);
        }

        /// <summary>
        /// Get the value for a given key from the DataStore.
        /// </summary>
        /// <param name="key">The key name.</param>
        /// <param name="global">A boolean indicating whether the key is global (<c>true<c/>) or private to the user (<c>false<c/>).</param>
        /// <param name="callback">A callback function accepting a single parameter, the key value.</param>
        public static void Get(string key, bool global, Action<string> callback) {
            var parameters = new Dictionary<string, string>();
            parameters.Add("key", key);

            Core.Request.Get(Constants.API_DATASTORE_FETCH, parameters, (Core.Response response) => {
                string value;
                if (response.success) {
                    value = response.dump;
                } else {
                    value = null;
                }

                if (callback != null) {
                    callback(value);
                }
            }, !global, Core.ResponseFormat.Dump);
        }

        /// <summary>
        /// Delete the key from the DataStore.
        /// </summary>
        /// <param name="key">The key name.</param>
        /// <param name="global">A boolean indicating whether the key is global (<c>true<c/>) or private to the user (<c>false<c/>).</param>
        /// <param name="callback">A callback function accepting a single parameter, a boolean indicating success.</param>
        public static void Delete(string key, bool global, Action<bool> callback = null) {
            var parameters = new Dictionary<string, string>();
            parameters.Add("key", key);

            Core.Request.Get(Constants.API_DATASTORE_REMOVE, parameters, (Core.Response response) => {
                if (callback != null) {
                    callback(response.success);
                }
            }, !global);
        }

        public static void Contains(string key, bool global, Action<bool> callback) {
            Get(
                key,
                global,
                s => {
                    callback(!string.IsNullOrEmpty(s));
                }
                );
        }

        /// <summary>
        /// Gets the list of available keys in the DataStore.
        /// </summary>
        /// <param name="global">A boolean indicating whether the keys are global (<c>true<c/>) or private to the user (<c>false<c/>).</param>
        /// <param name="callback">A callback function accepting a single parameter, a list of key names.</param>
        public static void GetKeys(bool global, Action<string[]> callback) {
            Core.Request.Get(Constants.API_DATASTORE_KEYS_FETCH, null, (Core.Response response) => {
                string[] keys;
                if (response.success) {
                    int count = response.json["keys"].AsArray.Count;
                    keys = new string[count];

                    for (int i = 0; i < count; ++i) {
                        keys[i] = response.json["keys"][i]["key"].Value;
                    }
                } else {
                    keys = null;
                }

                if (callback != null) {
                    callback(keys);
                }
            }, !global);
        }
    }
}


text:
egrep-q() {
  egrep "$@" >/dev/null 2>/dev/null
}

die() {
	echo 'failure during hook setup' 1>&2
	echo '-------------------------' 1>&2
	echo '' 1>&2
	echo "$@" 1>&2
	exit 1
}

u=$(cd "$(echo "$0"|sed 's/[^/]*$//')"; pwd)
cd "$u/../../.git/hooks"

# We need to have a git repository to do a pull.
if ! test -d ./.git; then
  git init || die "Could not run git init."
fi

# Grab the hooks.
# Use the local hooks if possible.
echo "Pulling the hooks..."
if GIT_DIR=.. git for-each-ref refs/remotes/origin/hooks 2>/dev/null | \
  egrep-q 'refs/remotes/origin/hooks$'; then
  git fetch .. remotes/origin/hooks
else
  git fetch git@github.com:thewtex/ITKExamples.git hooks
fi &&
git reset --hard FETCH_HEAD || die "Failed to install hooks"
cd ../..

# Disable the 'hooks' branch submodule check.
# We have a check that blocks addition of submodules.
git config hooks.submodule false

# Set up uncrustify hook.
#echo "Setting up the uncrustify hook..."
#git config hooks.uncrustify.conf "Utilities/Maintenance/uncrustify_itk.cfg"

# Set up KWStyle hook.
#echo "Setting up the KWStyle hook..."
#git config hooks.KWStyle.conf "Utilities/KWStyle/ITK.kws.xml.in"
#git config hooks.KWStyle.overwriteRulesConf "Utilities/KWStyle/ITKOverwrite.txt"
#git config hooks.KWStyle true

# Set up hook chaining.
#echo "Setting up ITK hook chaining: prepare-commit-msg, commit-msg, pre-commit"
git config hooks.chain-prepare-commit-msg Utilities/Hooks/prepare-commit-msg
git config hooks.chain-commit-msg Utilities/Hooks/commit-msg
git config hooks.chain-pre-commit Utilities/Hooks/pre-commit

echo "Done."


text:
<!DOCTYPE html>

<meta charset="UTF-8">

<title>class Purchase - RDoc Documentation</title>

<link href="./css/fonts.css" rel="stylesheet">
<link href="./css/rdoc.css" rel="stylesheet">

    Home

    Pages
    Classes
    Methods

  <form action="#" method="get" accept-charset="utf-8">

      <input id="search-field" role="combobox" aria-label="Search"
             aria-autocomplete="list" aria-controls="search-results"
             type="text" name="search" placeholder="Search" spellcheck="false"
             title="Type to search, Up and Down to navigate, Enter to load">

  </form>

Parent

Object

Methods

::apiKey

::createPurchase

::deletePurchase

::getAllByAccountId

::getOne

::updatePurchase

::url

::urlWithEntity

    class Purchase

Public Class Methods

          apiKey()

          click to toggle source

# File lib/capital_one/purchase.rb, line 11
def self.apiKey
        return Config.apiKey
end

          createPurchase(accId, purchase)

          click to toggle source

*** POST ***

createPurchase¶ ↑

Creates a new purchase for a given account

Parameters: AccountId, PurchaseHash¶ ↑

PurchaseHash is formatted as follows:
{
    "merchant_id": "string",
    "medium": "balance",
    "purchase_date": "string",
    "amount": 0,
    "status": "pending",
    "description": "string"
}
Returns http response code

# File lib/capital_one/purchase.rb, line 53
def self.createPurchase(accId, purchase)
        purchaseToCreate = purchase.to_json
        url = "#{self.urlWithEntity}/#{accId}/purchases?&key=#{self.apiKey}"
        uri = URI.parse(url)
        http = Net::HTTP.new(uri.host, uri.port)
        request = Net::HTTP::Post.new(uri.request_uri, initheader = {'Content-Type' =>'application/json'})
        request.body = purchaseToCreate
        response = http.request(request)
        return JSON.parse(response.body)
end

          deletePurchase(id)

          click to toggle source

deletePurchase¶ ↑

Deletes a purchase for a given ID

Parameters: PurchaseId¶ ↑

Returns http response code

# File lib/capital_one/purchase.rb, line 99
def self.deletePurchase(id)
        url = "#{self.url}/purchases/#{id}?key=#{self.apiKey}"
        uri = URI.parse(url)
        http = Net::HTTP.new(uri.host, uri.port)
        key="?key=#{self.apiKey}"
        request = Net::HTTP::Delete.new(uri.path+key)
        response = http.request(request)
end

          getAllByAccountId(accId)

          click to toggle source

getAll¶ ↑

Returns all purchases for a given account

Parameters: AccountId¶ ↑

Returns an array of hashes

# File lib/capital_one/purchase.rb, line 22
def self.getAllByAccountId(accId)
        url = "#{self.urlWithEntity}/#{accId}/purchases?&key=#{self.apiKey}"
        resp = Net::HTTP.get_response(URI.parse(url))
        data = JSON.parse(resp.body)
end

          getOne(id)

          click to toggle source

getOne¶ ↑

Returns a purchase for a given ID

Parameters: PurchaseId¶ ↑

Returns a hash

# File lib/capital_one/purchase.rb, line 33
def self.getOne(id)
        url = "#{self.url}/purchases/#{id}?&key=#{self.apiKey}"
        resp = Net::HTTP.get_response(URI.parse(url))
        data = JSON.parse(resp.body)
end

          updatePurchase(id, purchase)

          click to toggle source

updatePurchase¶ ↑

Updates an existing purchase

Parameters: PurchaseId, PurchaseHash¶ ↑

PurchaseHash is formatted as follows:
{
    "merchant_id": "string",
    "medium": "balance",
    "purchase_date": "string",
    "amount": 0,
    "status": "pending",
    "description": "string"
}
Returns http response code

# File lib/capital_one/purchase.rb, line 80
def self.updatePurchase(id, purchase)
        purchaseToUpdate = purchase.to_json
        url = "#{self.url}/purchases/#{id}?key=#{self.apiKey}"
        uri = URI.parse(url)
        http = Net::HTTP.new(uri.host, uri.port)
        key = "?key=#{self.apiKey}"
        request = Net::HTTP::Put.new(uri.path+key, initheader = {'Content-Type' =>'application/json'})
        request.body = purchaseToUpdate
        response = http.request(request)
        return JSON.parse(response.body)
end

          url()

          click to toggle source

# File lib/capital_one/purchase.rb, line 7
def self.url
        return Config.baseUrl
end

          urlWithEntity()

          click to toggle source

# File lib/capital_one/purchase.rb, line 3
def self.urlWithEntity
        return Config.baseUrl + "/accounts"
end

Validate

Generated by RDoc 4.2.0.

Based on Darkfish by Michael Granger.


text:
from django.test import modify_settings, TestCase
from django.urls import reverse

@modify_settings(INSTALLED_APPS={
    'append': 'tests.core'})
class Test(TestCase):

    def test_route(self):
        from django.urls.resolvers import get_resolver
        get_resolver.cache_clear()
        self.assertEqual(
            reverse('default:test:a'),
            '/test/a/')

        self.assertEqual(
            reverse('api:test:a'),
            '/api/test/a/')


text:
<TITLE>Console Server Manual</TITLE>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<link href="RaknetManual.css" rel="stylesheet" type="text/css">
<meta name="title" content="RakNet - Advanced multiplayer game networking API">

     Command Console Server Overview

Use the console to remotely control a game server

Sometimes it is useful to control a server when you are not in front of that particular computer. This can arise due to server hosting, where the host is located offsite. Or perhaps you have many servers, and you want to control them via a script. The ConsoleServer, CommandParserInterface, and TransportInterface are three classes that work together to meet these needs.

ConsoleServer

The ConsoleServer class, located at ConsoleServer.h, contains a list of CommandParserInterface classes, added with ConsoleServer::AddCommandParser(). By calling ConsoleServer::Update() once per game tick, all CommandParserInterface classes are processed for incoming input

CommandParserInterface

A command parser is a class which operates on a named set of registered commands. CommandParserInterface is a base class from which you should derive functionality for each command parser. For example, RakNetCommandParser.h exposes most functions that are available to call in RakPeerInterface. RakNetTransportCommandParser exposes functions that deal with the RakNetTransport class, used to actually send data used by the ConsoleServer.

TransportInterface

The TransportInterface class provides functionality to the ConsoleServer to send strings. There are currently two implementations of TransportInterface: TelnetTransport, and RakNetTransport. TelnetTransport uses TCPInterface.h to reply to a remote telnet terminal. RakNetTransport sends strings through an instance of RakPeer, with secure connections enabled.

Putting it all together

Excerpts from the sample CommandConsoleServer

ConsoleServer consoleServer;

      TelnetTransport tt;

      RakNetCommandParser rcp;

LogCommandParser lcp;

consoleServer.AddCommandParser(&rcp);

  consoleServer.AddCommandParser(&lcp);

consoleServer.SetTransportProvider(ti, port);

lcp.AddChannel("TestChannel");

while (1)

{

lcp.WriteLog("TestChannel", "Test of logger");

consoleServer.Update();

// Game loop here

        }

It's quite simple in practice. You have one instance of a console server, one instance of a transport interface (EIther TelnetTransport or RakNetTransport), and your command parsers. Call ConsoleServer::AddCommandParser for each parser, ConsoleServer::SetTransportProvider() for telnet or RakNet, and ConsoleServer::Update() once per tick. Here I also add an output channel to the LogCommandParser, and output to the log once per tick.

Assuming the server is already started, you can connect as follows:

Start telnet from the start menu

Connect to your server with telnet

The system should handle everything else

     RakNetTransport

Secure console connections

Telnet is easy to use but not secure. If you want to send passwords or other sensitive data, you should use RakNetTransport on the server instead. This comes with an additional command parser, RakNetTransportCommandParser, which adds the functionality to change the password on the instance of RakPeer that is internal to RakNetTransport. It was designed this way so remote users connect to the command parser without connecting to the game itself, and the game and the command parser can have different passwords.

For the client-side, the sample CommandConsoleClient is an implementation of a console application that uses RakNet to connect to RakNetTransport

     Creating your own command parser

Predefine commands and/or pass the command strings directly to your scripting system

To add a new command parser, first derive a class from CommandParserInterface, as was done in RakNetCommandParser.h. You will want to override OnCommand, GetName, and SendHelp. Additionally, any functionality you need to communicate with your game, such as SetGamePointer() or SetLogger(), you should add on your own.

1. In the constructor of your new class, call RegisterCommand for each command you want to add. Here is an example from RakNetCommandParser.cpp

RegisterCommand(4, "Startup","( unsigned short maxConnections, int _threadSleepTimer, unsigned short localPort, const char *forceHostAddress );");

The first parameter, 4, is the number of parameters to pass to the function. The second parameter, "Startup" is the name of the command, and will show up in the abbreviated command list. The third parameter, "unsigned short maxConnections ...", defines the helpString, displayed when help is called on a particular named command.

Given this syntax, ConsoleServer will verify that the correct number of parameters was passed, and return an error to the user should this not be the case when calling a particular command.

2. In OnCommand(), compare the command string to your registered commands, and take the desired action

if (strcmp(command, "Startup")==0)

{

SocketDescriptor socketDescriptor((unsigned short)atoi(parameterList[1]), parameterList[3]);

ReturnResult(peer->Startup((unsigned short)atoi(parameterList[0]), atoi(parameterList[2]), &socketDescriptor, 1), command, transport, systemAddress);

}

The return value of OnCommand is currently not used, so just return true.

ReturnResult is a function you can optionally call that will return back a string to the requesting system.

3. Implement GetName(), returning the name of your command parser. This will show up in the command parser listing.

4. Implement SendHelp(), which will return extended help when queried for your particular parser. If your parser is not runnable due to failed preconditions, it is a good idea to return a notification message about that here.

Unknown or variable number of parameters:

Pass CommandParserInterface::VARIABLE_NUMBER_OF_PARAMETERS as the first parameter to RegisterCommand. CommandServer will not check for a valid number of parameters in this case. It is up to you in OnCommand() to deal with error conditions that may come up in this case.

Direct string parsing

If you don't want ConsoleServer to parse the incoming string for you, use the parameter originalString passed to OnCommand. For example, if you are controlling your scripting system, you would probably want to pass this string directly along.

Changing delineators

If you want to separate your commands by something other than space, or separate your strings by something other than quotation marks, the defines are found in CommandServer.cpp

#define COMMAND_DELINATOR ' '

      #define COMMAND_DELINATOR_TOGGLE '"'

        See Also

Index

          Telnet (Wikipedia)

            TCP Interface

            Secure connections


text:
<?php

namespace WS\ReduceMigrations\Scenario\Exceptions;

class ApplyScenarioException extends \Exception {

}


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<TITLE>
Àà darks.orm.core.data.xml.QueryAspectWrapper µÄʹÓÃ
</TITLE>

<META NAME="date" CONTENT="2014-09-10">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../../stylesheet.css" TITLE="Style">

      ¸ÅÊö
      Èí¼þ°ü
      Àà
    ʹÓÃ
      Ê÷
      Òѹýʱ
      Ë÷Òý
      °ïÖú

 ÉÏÒ»¸ö
 ÏÂÒ»¸ö

  ¿ò¼Ü
 ÎÞ¿ò¼Ü

  ËùÓÐÀà

Àà darks.orm.core.data.xml.QueryAspectWrapper
µÄʹÓÃ

ʹÓà QueryAspectWrapper µÄÈí¼þ°ü

darks.orm.core.aspect

darks.orm.core.aspect.jclass

darks.orm.core.aspect.js

darks.orm.core.aspect.jython

darks.orm.core.executor

darks.orm.core.factory

darks.orm.core.aspect ÖÐ QueryAspectWrapper µÄʹÓÃ

²ÎÊýÀàÐÍΪ QueryAspectWrapper µÄ darks.orm.core.aspect Öеķ½·¨

 boolean
QueryAspectAdapter.afterInvoke(SqlSession session,
            AspectData aspectData,
            QueryAspectWrapper queryWrapper,
            QueryEnumType queryEnumType)

 boolean
QueryAspect.afterInvoke(SqlSession session,
            AspectData aspectData,
            QueryAspectWrapper sqlMapAspectData,
            QueryEnumType queryEnumType)

 boolean
AspectQueryContext.afterInvoke(SqlSession dao,
            AspectData aspectData,
            QueryAspectWrapper queryWrapper,
            QueryEnumType queryEnumType)

 boolean
QueryAspectAdapter.beforeInvoke(SqlSession session,
             AspectData aspectData,
             QueryAspectWrapper queryWrapper,
             QueryEnumType queryEnumType)

 boolean
QueryAspect.beforeInvoke(SqlSession session,
             AspectData aspectData,
             QueryAspectWrapper sqlMapAspectData,
             QueryEnumType queryEnumType)

 boolean
AspectQueryContext.beforeInvoke(SqlSession dao,
             AspectData aspectData,
             QueryAspectWrapper queryWrapper,
             QueryEnumType queryEnumType)

darks.orm.core.aspect.jclass ÖÐ QueryAspectWrapper µÄʹÓÃ

²ÎÊýÀàÐÍΪ QueryAspectWrapper µÄ darks.orm.core.aspect.jclass Öеķ½·¨

 boolean
JavaClassQueryAspect.afterInvoke(SqlSession dao,
            AspectData aspectData,
            QueryAspectWrapper queryWrapper,
            QueryEnumType queryEnumType)

 boolean
JavaClassQueryAspect.beforeInvoke(SqlSession dao,
             AspectData aspectData,
             QueryAspectWrapper queryWrapper,
             QueryEnumType queryEnumType)

darks.orm.core.aspect.js ÖÐ QueryAspectWrapper µÄʹÓÃ

²ÎÊýÀàÐÍΪ QueryAspectWrapper µÄ darks.orm.core.aspect.js Öеķ½·¨

 boolean
JsQueryAspect.afterInvoke(SqlSession dao,
            AspectData aspectData,
            QueryAspectWrapper queryWrapper,
            QueryEnumType queryEnumType)

 boolean
JsQueryAspect.beforeInvoke(SqlSession dao,
             AspectData aspectData,
             QueryAspectWrapper queryWrapper,
             QueryEnumType queryEnumType)

darks.orm.core.aspect.jython ÖÐ QueryAspectWrapper µÄʹÓÃ

²ÎÊýÀàÐÍΪ QueryAspectWrapper µÄ darks.orm.core.aspect.jython Öеķ½·¨

 boolean
PythonQueryAspect.afterInvoke(SqlSession dao,
            AspectData aspectData,
            QueryAspectWrapper queryWrapper,
            QueryEnumType queryEnumType)

 boolean
PythonQueryAspect.beforeInvoke(SqlSession dao,
             AspectData aspectData,
             QueryAspectWrapper queryWrapper,
             QueryEnumType queryEnumType)

darks.orm.core.executor ÖÐ QueryAspectWrapper µÄʹÓÃ

·µ»Ø QueryAspectWrapper µÄ darks.orm.core.executor Öеķ½·¨

 QueryAspectWrapper
SqlMapQueryExecutor.getSqlMapAspectData()

²ÎÊýÀàÐÍΪ QueryAspectWrapper µÄ darks.orm.core.executor Öеķ½·¨

 void
SqlMapUpdateExecutor.setSqlMapAspectData(QueryAspectWrapper simpleWrapper)

 void
SqlMapQueryExecutor.setSqlMapAspectData(QueryAspectWrapper queryWrapper)

²ÎÊýÀàÐÍΪ QueryAspectWrapper µÄ darks.orm.core.executor ÖеĹ¹Ôì·½·¨

SqlMapQueryExecutor(DMLData dmlData,
                    DMLQueryData queryData,
                    QueryAspectWrapper queryWrapper,
                    QueryEnumType queryEnumType,
                    SqlSession session)

darks.orm.core.factory ÖÐ QueryAspectWrapper µÄʹÓÃ

²ÎÊýÀàÐÍΪ QueryAspectWrapper µÄ darks.orm.core.factory Öеķ½·¨

static SqlMapExecutor
ExecutorFactory.getSqlMapQueryExecutor(SqlSession session,
                       DMLData dmlData,
                       DMLQueryData queryData,
                       QueryAspectWrapper queryWrapper,
                       QueryEnumType queryEnumType)

          »ñµÃSqlMap²éѯִÐÐÆ÷

      ¸ÅÊö
      Èí¼þ°ü
      Àà
    ʹÓÃ
      Ê÷
      Òѹýʱ
      Ë÷Òý
      °ïÖú

 ÉÏÒ»¸ö
 ÏÂÒ»¸ö

  ¿ò¼Ü
 ÎÞ¿ò¼Ü

  ËùÓÐÀà


text:
extern crate criterion;
use criterion::Criterion;

extern crate arrow;

use arrow::array::*;
use arrow::compute::kernels::length::length;

fn bench_length() {
    fn double_vec<T: Clone>(v: Vec<T>) -> Vec<T> {
        [&v[..], &v[..]].concat()
    }

    // double ["hello", " ", "world", "!"] 10 times
    let mut values = vec!["one", "on", "o", ""];
    let mut expected = vec![3, 2, 1, 0];
    for _ in 0..10 {
        values = double_vec(values);
        expected = double_vec(expected);
    }
    let array = StringArray::from(values);

    criterion::black_box(length(&array).unwrap());
}

fn add_benchmark(c: &mut Criterion) {
    c.bench_function("length", |b| b.iter(bench_length));
}

criterion_group!(benches, add_benchmark);
criterion_main!(benches);


text:
$:.unshift(File.dirname(__FILE__) + '/../lib')
require 'test/unit'
require 'htmlentities'

ENCODING_AWARE_RUBY = "1.9".respond_to?(:encoding)
$KCODE = 'u' unless ENCODING_AWARE_RUBY


text:
/**
* FlightDetails.js
*
* @description :: TODO: You might write a short summary of how this model works and what it represents here.
* @docs        :: http://sailsjs.org/#!documentation/models
*/

module.exports = {
  attributes: {
    _type   : { type: 'string' },
    _row    : { type: 'integer'},
    _flight : { type: 'string', index: true },
  },
};