text:
ITEM.name = "Zip Tie"
ITEM.desc = "An orange zip-tie used to restrict players."
ITEM.price = 50
ITEM.model = "models/items/crossbowrounds.mdl"
ITEM.factions = {FACTION_CP, FACTION_OW}
ITEM.functions.Use = {
	onRun = function(item)
		if (item.beingUsed) then
			return false
		end

		local client = item.player
		local data = {}
			data.start = client:GetShootPos()
			data.endpos = data.start + client:GetAimVector()*96
			data.filter = client
		local target = util.TraceLine(data).Entity

		if (IsValid(target) and target:IsPlayer() and target:getChar() and !target:getNetVar("tying") and !target:getNetVar("restricted")) then
			item.beingUsed = true

			client:EmitSound("physics/plastic/plastic_barrel_strain"..math.random(1, 3)..".wav")
			client:setAction("@tying", 5)
			client:doStaredAction(target, function()
				item:remove()

				target:setRestricted(true)
				target:setNetVar("tying")

				client:EmitSound("npc/barnacle/neck_snap1.wav", 100, 140)
			end, 5, function()
				client:setAction()

				target:setAction()
				target:setNetVar("tying")

				item.beingUsed = false
			end)

			target:setNetVar("tying", true)
			target:setAction("@beingTied", 5)
		else
			item.player:notifyLocalized("plyNotValid")
		end

		return false
	end,
	onCanRun = function(item)
		return !IsValid(item.entity)
	end
}

function ITEM:onCanBeTransfered(inventory, newInventory)
	return !self.beingUsed
end


text:
from django.conf import settings
from django import http
from django.template.loader import render_to_string
from django.urls import reverse
from django.urls import reverse_lazy
from django.utils.translation import ugettext_lazy as _

from horizon import exceptions
from horizon import forms
from horizon import tables
from horizon.utils import memoized
from horizon import views

from openstack_dashboard import api
from openstack_dashboard.utils import settings as setting_utils

from openstack_dashboard.dashboards.identity.application_credentials \
    import forms as project_forms
from openstack_dashboard.dashboards.identity.application_credentials \
    import tables as project_tables

INDEX_URL = "horizon:identity:application_credentials:index"

class IndexView(tables.DataTableView):
    table_class = project_tables.ApplicationCredentialsTable
    template_name = 'identity/application_credentials/index.html'
    page_title = _("Application Credentials")

    def needs_filter_first(self, table):
        return self._needs_filter_first

    def get_data(self):
        app_creds = []
        filters = self.get_filters()

        self._needs_filter_first = False

        # If filter_first is set and if there are not other filters
        # selected, then search criteria must be provided
        # and return an empty list
        if (setting_utils.get_dict_config(
                'FILTER_DATA_FIRST',
                'identity.application_credentials') and not filters):
            self._needs_filter_first = True
            return app_creds

        try:
            app_creds = api.keystone.application_credential_list(
                self.request, filters=filters)
        except Exception:
            exceptions.handle(
                self.request,
                _('Unable to retrieve application credential list.'))

        return app_creds

class CreateView(forms.ModalFormView):
    template_name = 'identity/application_credentials/create.html'
    form_id = 'create_application_credential_form'
    form_class = project_forms.CreateApplicationCredentialForm
    submit_label = _("Create Application Credential")
    submit_url = reverse_lazy(
        'horizon:identity:application_credentials:create')
    success_url = reverse_lazy(
        'horizon:identity:application_credentials:success')
    page_title = _("Create Application Credential")

    def get_form_kwargs(self):
        kwargs = super(CreateView, self).get_form_kwargs()
        kwargs['next_view'] = CreateSuccessfulView
        return kwargs

    def get_context_data(self, **kwargs):
        context = super(CreateView, self).get_context_data(**kwargs)
        context['kubeconfig_enabled'] = settings.KUBECONFIG_ENABLED
        return context

class CreateSuccessfulView(forms.ModalFormView):
    template_name = 'identity/application_credentials/success.html'
    page_title = _("Your Application Credential")
    form_class = project_forms.CreateSuccessfulForm
    model_id = "create_application_credential_successful_modal"
    success_url = reverse_lazy(
        'horizon:identity:application_credentials:index')
    cancel_label = _("Close")
    download_openrc_label = _("Download openrc file")
    download_clouds_yaml_label = _("Download clouds.yaml")
    download_kubeconfig_label = _("Download kubeconfig file")

    def get_context_data(self, **kwargs):
        context = super(CreateSuccessfulView, self).get_context_data(**kwargs)
        context['download_openrc_label'] = self.download_openrc_label
        context['download_clouds_yaml_label'] = self.download_clouds_yaml_label
        context['download_kubeconfig_label'] = self.download_kubeconfig_label
        context['download_openrc_url'] = reverse(
            'horizon:identity:application_credentials:download_openrc')
        context['download_clouds_yaml_url'] = reverse(
            'horizon:identity:application_credentials:download_clouds_yaml')
        if settings.KUBECONFIG_ENABLED:
            context['download_kubeconfig_url'] = reverse(
                'horizon:identity:application_credentials:download_kubeconfig')
        return context

    def get_initial(self):
        app_cred = self.request.session['application_credential']
        return {
            'app_cred_id': app_cred['id'],
            'app_cred_name': app_cred['name'],
            'app_cred_secret': app_cred['secret']
        }

def _get_context(request):
    auth_url = api.base.url_for(request,
                                'identity',
                                endpoint_type='publicURL')
    interface = 'public'
    region = getattr(request.user, 'services_region', '')
    app_cred = request.session['application_credential']
    context = {
        'auth_url': auth_url,
        'interface': interface,
        'region': region,
        'user': request.user,
        'application_credential_id': app_cred['id'],
        'application_credential_name': app_cred['name'],
        'application_credential_secret': app_cred['secret'],
        'kubernetes_namespace': app_cred['kubernetes_namespace'],
        'kubernetes_url': settings.KUBECONFIG_KUBERNETES_URL,
        'kubernetes_certificate_authority_data':
            settings.KUBECONFIG_CERTIFICATE_AUTHORITY_DATA}
    return context

def _render_attachment(filename, template, context, request):
    content = render_to_string(template, context, request=request)
    disposition = 'attachment; filename="%s"' % filename
    response = http.HttpResponse(content, content_type="text/plain")
    response['Content-Disposition'] = disposition.encode('utf-8')
    response['Content-Length'] = str(len(response.content))
    return response

def download_rc_file(request):
    context = _get_context(request)
    template = 'identity/application_credentials/openrc.sh.template'
    filename = 'app-cred-%s-openrc.sh' % context['application_credential_name']
    response = _render_attachment(filename, template, context, request)
    return response

def download_clouds_yaml_file(request):
    context = _get_context(request)
    context['cloud_name'] = getattr(
        settings, "OPENSTACK_CLOUDS_YAML_NAME", 'openstack')
    context['profile'] = getattr(
        settings, "OPENSTACK_CLOUDS_YAML_PROFILE", None)
    context['regions'] = [
        region_tuple[1] for region_tuple in getattr(
            settings, "AVAILABLE_REGIONS", [])
    ]
    template = 'identity/application_credentials/clouds.yaml.template'
    filename = 'clouds.yaml'
    return _render_attachment(filename, template, context, request)

def download_kubeconfig_file(request):
    context = _get_context(request)
    template = 'identity/application_credentials/kubeconfig.template'
    filename = 'app-cred-%s-kubeconfig' % context['application_credential_name']
    response = _render_attachment(filename, template, context, request)
    return response

class DetailView(views.HorizonTemplateView):
    template_name = 'identity/application_credentials/detail.html'
    page_title = "{{ application_credential.name }}"

    def get_context_data(self, **kwargs):
        context = super(DetailView, self).get_context_data(**kwargs)
        app_cred = self.get_data()
        table = project_tables.ApplicationCredentialsTable(self.request)
        context["application_credential"] = app_cred
        context["url"] = reverse(INDEX_URL)
        context["actions"] = table.render_row_actions(app_cred)

        return context

    @memoized.memoized_method
    def get_data(self):
        try:
            app_cred_id = self.kwargs['application_credential_id']
            app_cred = api.keystone.application_credential_get(self.request,
                                                               app_cred_id)
        except Exception:
            exceptions.handle(
                self.request,
                _('Unable to retrieve application credential details.'),
                redirect=reverse(INDEX_URL))
        return app_cred

redpajama_set_name: RedPajamaGithub


text:
{-# LANGUAGE Trustworthy #-}
{-# LANGUAGE CPP, NoImplicitPrelude, ScopedTypeVariables, MagicHash #-}
{-# LANGUAGE BangPatterns #-}
{-# OPTIONS_HADDOCK hide #-}

-----------------------------------------------------------------------------
-- |
-- Module      :  GHC.List
-- Copyright   :  (c) The University of Glasgow 1994-2002
-- License     :  see libraries/base/LICENSE
--
-- Maintainer  :  cvs-ghc@haskell.org
-- Stability   :  internal
-- Portability :  non-portable (GHC Extensions)
--
-- The List data type and its operations
--
-----------------------------------------------------------------------------

-- NOTE: This code was adapted from the GHC.List module specified above.
-- All licensing remains as specified above.

module MyList (
   -- [] (..),          -- built-in syntax; can't be used in export list

   map, (++), filter, concat,
   head, last, tail, init, uncons, null, length, (!!),
   intersperse, intercalate, subsequences, permutations,
   foldl, foldl1, foldr, foldr1,
   iterate, repeat, replicate, cycle,
   take, drop, sum, product, maximum, minimum, splitAt, takeWhile, dropWhile,
   span, break, reverse, and, or,
   elem, notElem, lookup,
   concatMap,
   zip, zipWith, unzip, sort

 ) where

import Data.Maybe
import GHC.Base
import GHC.Num (Num(..))
import GHC.Integer (Integer)

infixl 9  !!
infix  4 `elem`, `notElem`

sort :: (Ord a) => [a] -> [a]
sort = foldr (insertBy compare) []

-- | The non-overloaded version of 'insert'.
insertBy :: (a -> a -> Ordering) -> a -> [a] -> [a]
insertBy _   x [] = [x]
insertBy cmp x ys@(y:ys')
 = case cmp x y of
     GT -> y : insertBy cmp x ys'
     _  -> x : ys

--------------------------------------------------------------
-- List-manipulation functions
--------------------------------------------------------------

-- | Extract the first element of a list, which must be non-empty.
head                    :: [a] -> a
head (x:_)              =  x
head []                 =  badHead
{-# NOINLINE [1] head #-}

badHead :: a
badHead = errorEmptyList "head"

-- This rule is useful in cases like
--      head [y | (x,y) <- ps, x==t]
{-# RULES
"head/build"    forall (g::forall b.(a->b->b)->b->b) .
                head (build g) = g (\x _ -> x) badHead
"head/augment"  forall xs (g::forall b. (a->b->b) -> b -> b) .
                head (augment g xs) = g (\x _ -> x) (head xs)
 #-}

-- | Decompose a list into its head and tail. If the list is empty,
-- returns 'Nothing'. If the list is non-empty, returns @'Just' (x, xs)@,
-- where @x@ is the head of the list and @xs@ its tail.
--
-- @since 4.8.0.0
uncons                  :: [a] -> Maybe (a, [a])
uncons []               = Nothing
uncons (x:xs)           = Just (x, xs)

-- | Extract the elements after the head of a list, which must be non-empty.
tail                    :: [a] -> [a]
tail (_:xs)             =  xs
tail []                 =  errorEmptyList "tail"

-- | Extract the last element of a list, which must be finite and non-empty.
last                    :: [a] -> a
#ifdef USE_REPORT_PRELUDE
last [x]                =  x
last (_:xs)             =  last xs
last []                 =  errorEmptyList "last"
#else
-- use foldl to allow fusion
last = foldl (\_ x -> x) (errorEmptyList "last")
#endif

-- | Return all the elements of a list except the last one.
-- The list must be non-empty.
init                    :: [a] -> [a]
#ifdef USE_REPORT_PRELUDE
init [x]                =  []
init (x:xs)             =  x : init xs
init []                 =  errorEmptyList "init"
#else
-- eliminate repeated cases
init []                 =  errorEmptyList "init"
init (x:xs)             =  init' x xs
  where init' _ []     = []
        init' y (z:zs) = y : init' z zs
#endif

-- | Test whether a list is empty.
null                    :: [a] -> Bool
null []                 =  True
null (_:_)              =  False

-- | /O(n)/. 'length' returns the length of a finite list as an 'Int'.
-- It is an instance of the more general 'Data.List.genericLength',
-- the result type of which may be any kind of number.
{-# NOINLINE [1] length #-}
length                  :: [a] -> Int
length xs               = lenAcc xs 0

lenAcc          :: [a] -> Int -> Int
lenAcc []     n = n
lenAcc (_:ys) n = lenAcc ys (n+1)

-- | 'filter', applied to a predicate and a list, returns the list of
-- those elements that satisfy the predicate; i.e.,
--
-- > filter p xs = [ x | x <- xs, p x]

{-# NOINLINE [1] filter #-}
filter :: (a -> Bool) -> [a] -> [a]
filter _pred []    = []
filter pred (x:xs)
  | pred x         = x : filter pred xs
  | otherwise      = filter pred xs

-- Note the filterFB rule, which has p and q the "wrong way round" in the RHS.
--     filterFB (filterFB c p) q a b
--   = if q a then filterFB c p a b else b
--   = if q a then (if p a then c a b else b) else b
--   = if q a && p a then c a b else b
--   = filterFB c (\x -> q x && p x) a b
-- I originally wrote (\x -> p x && q x), which is wrong, and actually
-- gave rise to a live bug report.  SLPJ.

-- | 'foldl', applied to a binary operator, a starting value (typically
-- the left-identity of the operator), and a list, reduces the list
-- using the binary operator, from left to right:
--
-- > foldl f z [x1, x2, ..., xn] == (...((z `f` x1) `f` x2) `f`...) `f` xn
--
-- The list must be finite.

-- We write foldl as a non-recursive thing, so that it
-- can be inlined, and then (often) strictness-analysed,
-- and hence the classic space leak on foldl (+) 0 xs

foldl :: forall a b. (b -> a -> b) -> b -> [a] -> b
{-# INLINE foldl #-}
foldl k z0 xs =
  foldr (\(v::a) (fn::b->b) -> (\(z::b) -> fn (k z v))) (id :: b -> b) xs z0
  -- See Note [Left folds via right fold]

{-
Note [Left folds via right fold]

Implementing foldl et. al. via foldr is only a good idea if the compiler can
optimize the resulting code (eta-expand the recursive "go"). See #7994.
We hope that one of the two measure kick in:

   * Call Arity (-fcall-arity, enabled by default) eta-expands it if it can see
     all calls and determine that the arity is large.
   * The oneShot annotation gives a hint to the regular arity analysis that
     it may assume that the lambda is called at most once.
     See [One-shot lambdas] in CoreArity and especially [Eta expanding thunks]
     in CoreArity.

The oneShot annotations used in this module are correct, as we only use them in
argumets to foldr, where we know how the arguments are called.
-}

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

-- | 'foldl1' is a variant of 'foldl' that has no starting value argument,
-- and thus must be applied to non-empty lists.
foldl1                  :: (a -> a -> a) -> [a] -> a
foldl1 f (x:xs)         =  foldl f x xs
foldl1 _ []             =  errorEmptyList "foldl1"

-- -----------------------------------------------------------------------------
-- List sum and product

-- | The 'sum' function computes the sum of a finite list of numbers.
sum                     :: (Num a) => [a] -> a
{-# INLINE sum #-}
sum                     =  foldl (+) 0

-- | The 'product' function computes the product of a finite list of numbers.
product                 :: (Num a) => [a] -> a
{-# INLINE product #-}
product                 =  foldl (*) 1

-- foldr, foldr1, scanr, and scanr1 are the right-to-left duals of the
-- above functions.

-- | 'foldr1' is a variant of 'foldr' that has no starting value argument,
-- and thus must be applied to non-empty lists.

foldr1                  :: (a -> a -> a) -> [a] -> a
foldr1 _ [x]            =  x
foldr1 f (x:xs)         =  f x (foldr1 f xs)
foldr1 _ []             =  errorEmptyList "foldr1"

-- | 'maximum' returns the maximum value from a list,
-- which must be non-empty, finite, and of an ordered type.
-- It is a special case of 'Data.List.maximumBy', which allows the
-- programmer to supply their own comparison function.
maximum                 :: (Ord a) => [a] -> a
{-# INLINE [1] maximum #-}
maximum []              =  errorEmptyList "maximum"
maximum xs              =  foldl1 max xs

-- | 'minimum' returns the minimum value from a list,
-- which must be non-empty, finite, and of an ordered type.
-- It is a special case of 'Data.List.minimumBy', which allows the
-- programmer to supply their own comparison function.
minimum                 :: (Ord a) => [a] -> a
{-# INLINE [1] minimum #-}
minimum []              =  errorEmptyList "minimum"
minimum xs              =  foldl1 min xs

-- | 'iterate' @f x@ returns an infinite list of repeated applications
-- of @f@ to @x@:
--
-- > iterate f x == [x, f x, f (f x), ...]

{-# NOINLINE [1] iterate #-}
iterate :: (a -> a) -> a -> [a]
iterate f x =  x : iterate f (f x)

-- | 'repeat' @x@ is an infinite list, with @x@ the value of every element.
repeat :: a -> [a]
{-# INLINE [0] repeat #-}
-- The pragma just gives the rules more chance to fire
repeat x = xs where xs = x : xs

-- | 'replicate' @n x@ is a list of length @n@ with @x@ the value of
-- every element.
-- It is an instance of the more general 'Data.List.genericReplicate',
-- in which @n@ may be of any integral type.
{-# INLINE replicate #-}
replicate               :: Int -> a -> [a]
replicate n x           =  take n (repeat x)

-- | 'cycle' ties a finite list into a circular one, or equivalently,
-- the infinite repetition of the original list.  It is the identity
-- on infinite lists.

cycle                   :: [a] -> [a]
cycle []                = errorEmptyList "cycle"
cycle xs                = xs' where xs' = xs ++ xs'

-- | 'takeWhile', applied to a predicate @p@ and a list @xs@, returns the
-- longest prefix (possibly empty) of @xs@ of elements that satisfy @p@:
--
-- > takeWhile (< 3) [1,2,3,4,1,2,3,4] == [1,2]
-- > takeWhile (< 9) [1,2,3] == [1,2,3]
-- > takeWhile (< 0) [1,2,3] == []
--

{-# NOINLINE [1] takeWhile #-}
takeWhile               :: (a -> Bool) -> [a] -> [a]
takeWhile _ []          =  []
takeWhile p (x:xs)
            | p x       =  x : takeWhile p xs
            | otherwise =  []

-- | 'dropWhile' @p xs@ returns the suffix remaining after 'takeWhile' @p xs@:
--
-- > dropWhile (< 3) [1,2,3,4,5,1,2,3] == [3,4,5,1,2,3]
-- > dropWhile (< 9) [1,2,3] == []
-- > dropWhile (< 0) [1,2,3] == [1,2,3]
--

dropWhile               :: (a -> Bool) -> [a] -> [a]
dropWhile _ []          =  []
dropWhile p xs@(x:xs')
            | p x       =  dropWhile p xs'
            | otherwise =  xs

-- | 'take' @n@, applied to a list @xs@, returns the prefix of @xs@
-- of length @n@, or @xs@ itself if @n > 'length' xs@:
--
-- > take 5 "Hello World!" == "Hello"
-- > take 3 [1,2,3,4,5] == [1,2,3]
-- > take 3 [1,2] == [1,2]
-- > take 3 [] == []
-- > take (-1) [1,2] == []
-- > take 0 [1,2] == []
--
-- It is an instance of the more general 'Data.List.genericTake',
-- in which @n@ may be of any integral type.
take                   :: Int -> [a] -> [a]
#ifdef USE_REPORT_PRELUDE
take n _      | n <= 0 =  []
take _ []              =  []
take n (x:xs)          =  x : take (n-1) xs
#else

{- We always want to inline this to take advantage of a known length argument
sign. Note, however, that it's important for the RULES to grab take, rather
than trying to INLINE take immediately and then letting the RULES grab
unsafeTake. Presumably the latter approach doesn't grab it early enough; it led
to an allocation regression in nofib/fft2. -}
{-# INLINE [1] take #-}
take n xs | 0 < n     = unsafeTake n xs
          | otherwise = []

-- A version of take that takes the whole list if it's given an argument less
-- than 1.
{-# NOINLINE [1] unsafeTake #-}
unsafeTake :: Int -> [a] -> [a]
unsafeTake !_  []     = []
unsafeTake 1   (x: _) = [x]
unsafeTake m   (x:xs) = x : unsafeTake (m - 1) xs

#endif

-- | 'drop' @n xs@ returns the suffix of @xs@
-- after the first @n@ elements, or @[]@ if @n > 'length' xs@:
--
-- > drop 6 "Hello World!" == "World!"
-- > drop 3 [1,2,3,4,5] == [4,5]
-- > drop 3 [1,2] == []
-- > drop 3 [] == []
-- > drop (-1) [1,2] == [1,2]
-- > drop 0 [1,2] == [1,2]
--
-- It is an instance of the more general 'Data.List.genericDrop',
-- in which @n@ may be of any integral type.
drop                   :: Int -> [a] -> [a]
#ifdef USE_REPORT_PRELUDE
drop n xs     | n <= 0 =  xs
drop _ []              =  []
drop n (_:xs)          =  drop (n-1) xs
#else /* hack away */
{-# INLINE drop #-}
drop n ls
  | n <= 0     = ls
  | otherwise  = unsafeDrop n ls
  where
    -- A version of drop that drops the whole list if given an argument
    -- less than 1
    unsafeDrop :: Int -> [a] -> [a]
    unsafeDrop !_ []     = []
    unsafeDrop 1  (_:xs) = xs
    unsafeDrop m  (_:xs) = unsafeDrop (m - 1) xs
#endif

-- | 'splitAt' @n xs@ returns a tuple where first element is @xs@ prefix of
-- length @n@ and second element is the remainder of the list:
--
-- > splitAt 6 "Hello World!" == ("Hello ","World!")
-- > splitAt 3 [1,2,3,4,5] == ([1,2,3],[4,5])
-- > splitAt 1 [1,2,3] == ([1],[2,3])
-- > splitAt 3 [1,2,3] == ([1,2,3],[])
-- > splitAt 4 [1,2,3] == ([1,2,3],[])
-- > splitAt 0 [1,2,3] == ([],[1,2,3])
-- > splitAt (-1) [1,2,3] == ([],[1,2,3])
--
-- It is equivalent to @('take' n xs, 'drop' n xs)@ when @n@ is not @_|_@
-- (@splitAt _|_ xs = _|_@).
-- 'splitAt' is an instance of the more general 'Data.List.genericSplitAt',
-- in which @n@ may be of any integral type.
splitAt                :: Int -> [a] -> ([a],[a])

#ifdef USE_REPORT_PRELUDE
splitAt n xs           =  (take n xs, drop n xs)
#else
splitAt n ls
  | n <= 0 = ([], ls)
  | otherwise          = splitAt' n ls
    where
        splitAt' :: Int -> [a] -> ([a], [a])
        splitAt' _  []     = ([], [])
        splitAt' 1  (x:xs) = ([x], xs)
        splitAt' m  (x:xs) = (x:xs', xs'')
          where
            (xs', xs'') = splitAt' (m - 1) xs
#endif /* USE_REPORT_PRELUDE */

-- | 'span', applied to a predicate @p@ and a list @xs@, returns a tuple where
-- first element is longest prefix (possibly empty) of @xs@ of elements that
-- satisfy @p@ and second element is the remainder of the list:
--
-- > span (< 3) [1,2,3,4,1,2,3,4] == ([1,2],[3,4,1,2,3,4])
-- > span (< 9) [1,2,3] == ([1,2,3],[])
-- > span (< 0) [1,2,3] == ([],[1,2,3])
--
-- 'span' @p xs@ is equivalent to @('takeWhile' p xs, 'dropWhile' p xs)@

span                    :: (a -> Bool) -> [a] -> ([a],[a])
span _ xs@[]            =  (xs, xs)
span p xs@(x:xs')
         | p x          =  let (ys,zs) = span p xs' in (x:ys,zs)
         | otherwise    =  ([],xs)

-- | 'break', applied to a predicate @p@ and a list @xs@, returns a tuple where
-- first element is longest prefix (possibly empty) of @xs@ of elements that
-- /do not satisfy/ @p@ and second element is the remainder of the list:
--
-- > break (> 3) [1,2,3,4,1,2,3,4] == ([1,2,3],[4,1,2,3,4])
-- > break (< 9) [1,2,3] == ([],[1,2,3])
-- > break (> 9) [1,2,3] == ([1,2,3],[])
--
-- 'break' @p@ is equivalent to @'span' ('not' . p)@.

break                   :: (a -> Bool) -> [a] -> ([a],[a])
#ifdef USE_REPORT_PRELUDE
break p                 =  span (not . p)
#else
-- HBC version (stolen)
break _ xs@[]           =  (xs, xs)
break p xs@(x:xs')
           | p x        =  ([],xs)
           | otherwise  =  let (ys,zs) = break p xs' in (x:ys,zs)
#endif

-- | 'reverse' @xs@ returns the elements of @xs@ in reverse order.
-- @xs@ must be finite.
reverse                 :: [a] -> [a]
#ifdef USE_REPORT_PRELUDE
reverse                 =  foldl (flip (:)) []
#else
reverse l =  rev l []
  where
    rev []     a = a
    rev (x:xs) a = rev xs (x:a)
#endif

-- | The 'subsequences' function returns the list of all subsequences of the argument.
--
-- > subsequences "abc" == ["","a","b","ab","c","ac","bc","abc"]
subsequences            :: [a] -> [[a]]
subsequences xs         =  [] : nonEmptySubsequences xs

-- | The 'nonEmptySubsequences' function returns the list of all subsequences of the argument,
--   except for the empty list.
--
-- > nonEmptySubsequences "abc" == ["a","b","ab","c","ac","bc","abc"]
nonEmptySubsequences         :: [a] -> [[a]]
nonEmptySubsequences []      =  []
nonEmptySubsequences (x:xs)  =  [x] : foldr f [] (nonEmptySubsequences xs)
  where f ys r = ys : (x : ys) : r

-- | The 'permutations' function returns the list of all permutations of the argument.
--
-- > permutations "abc" == ["abc","bac","cba","bca","cab","acb"]
permutations            :: [a] -> [[a]]
permutations xs0        =  xs0 : perms xs0 []
  where
    perms []     _  = []
    perms (t:ts) is = foldr interleave (perms ts (t:is)) (permutations is)
      where interleave    xs     r = let (_,zs) = interleave' id xs r in zs
            interleave' _ []     r = (ts, r)
            interleave' f (y:ys) r = let (us,zs) = interleave' (f . (y:)) ys r
                                     in  (y:us, f (t:y:us) : zs)

-- | The 'intersperse' function takes an element and a list and
-- \`intersperses\' that element between the elements of the list.
-- For example,
--
-- > intersperse ',' "abcde" == "a,b,c,d,e"

intersperse             :: a -> [a] -> [a]
intersperse _   []      = []
intersperse sep (x:xs)  = x : prependToAll sep xs

-- Not exported:
-- We want to make every element in the 'intersperse'd list available
-- as soon as possible to avoid space leaks. Experiments suggested that
-- a separate top-level helper is more efficient than a local worker.
prependToAll            :: a -> [a] -> [a]
prependToAll _   []     = []
prependToAll sep (x:xs) = sep : x : prependToAll sep xs

-- | 'intercalate' @xs xss@ is equivalent to @('concat' ('intersperse' xs xss))@.
-- It inserts the list @xs@ in between the lists in @xss@ and concatenates the
-- result.
intercalate :: [a] -> [[a]] -> [a]
intercalate xs xss = concat (intersperse xs xss)

-- | 'and' returns the conjunction of a Boolean list.  For the result to be
-- 'True', the list must be finite; 'False', however, results from a 'False'
-- value at a finite index of a finite or infinite list.
and                     :: [Bool] -> Bool
#ifdef USE_REPORT_PRELUDE
and                     =  foldr (&&) True
#else
and []          =  True
and (x:xs)      =  x && and xs
{-# NOINLINE [1] and #-}

{-# RULES
"and/build"     forall (g::forall b.(Bool->b->b)->b->b) .
                and (build g) = g (&&) True
 #-}
#endif

-- | 'or' returns the disjunction of a Boolean list.  For the result to be
-- 'False', the list must be finite; 'True', however, results from a 'True'
-- value at a finite index of a finite or infinite list.
or                      :: [Bool] -> Bool
#ifdef USE_REPORT_PRELUDE
or                      =  foldr (||) False
#else
or []           =  False
or (x:xs)       =  x || or xs
{-# NOINLINE [1] or #-}

{-# RULES
"or/build"      forall (g::forall b.(Bool->b->b)->b->b) .
                or (build g) = g (||) False
 #-}
#endif

-- | 'elem' is the list membership predicate, usually written in infix form,
-- e.g., @x \`elem\` xs@.  For the result to be
-- 'False', the list must be finite; 'True', however, results from an element
-- equal to @x@ found at a finite index of a finite or infinite list.
elem                    :: (Eq a) => a -> [a] -> Bool
#ifdef USE_REPORT_PRELUDE
elem x                  =  any (== x)
#else
elem _ []       = False
elem x (y:ys)   = x==y || elem x ys
{-# NOINLINE [1] elem #-}
{-# RULES
"elem/build"    forall x (g :: forall b . Eq a => (a -> b -> b) -> b -> b)
   . elem x (build g) = g (\ y r -> (x == y) || r) False
 #-}
#endif

-- | 'notElem' is the negation of 'elem'.
notElem                 :: (Eq a) => a -> [a] -> Bool
#ifdef USE_REPORT_PRELUDE
notElem x               =  all (/= x)
#else
notElem _ []    =  True
notElem x (y:ys)=  x /= y && notElem x ys
{-# NOINLINE [1] notElem #-}
{-# RULES
"notElem/build" forall x (g :: forall b . Eq a => (a -> b -> b) -> b -> b)
   . notElem x (build g) = g (\ y r -> (x /= y) && r) True
 #-}
#endif

-- | 'lookup' @key assocs@ looks up a key in an association list.
lookup                  :: (Eq a) => a -> [(a,b)] -> Maybe b
lookup _key []          =  Nothing
lookup  key ((x,y):xys)
    | key == x          =  Just y
    | otherwise         =  lookup key xys

-- | Map a function over a list and concatenate the results.
concatMap               :: (a -> [b]) -> [a] -> [b]
concatMap f             =  foldr ((++) . f) []

{-# NOINLINE [1] concatMap #-}

{-# RULES
"concatMap" forall f xs . concatMap f xs =
    build (\c n -> foldr (\x b -> foldr c b (f x)) n xs)
 #-}

-- | Concatenate a list of lists.
concat :: [[a]] -> [a]
concat = foldr (++) []

{-# NOINLINE [1] concat #-}

{-# RULES
  "concat" forall xs. concat xs =
     build (\c n -> foldr (\x y -> foldr c y x) n xs)
-- We don't bother to turn non-fusible applications of concat back into concat
 #-}

-- | List index (subscript) operator, starting from 0.
-- It is an instance of the more general 'Data.List.genericIndex',
-- which takes an index of any integral type.
(!!)                    :: [a] -> Int -> a
#ifdef USE_REPORT_PRELUDE
xs     !! n | n < 0 =  error "Prelude.!!: negative index"
[]     !! _         =  error "Prelude.!!: index too large"
(x:_)  !! 0         =  x
(_:xs) !! n         =  xs !! (n-1)
#else

-- We don't really want the errors to inline with (!!).
-- We may want to fuss around a bit with NOINLINE, and
-- if so we should be careful not to trip up known-bottom
-- optimizations.
tooLarge :: Int -> a
tooLarge _ = error (prel_list_str ++ "!!: index too large")

negIndex :: a
negIndex = error $ prel_list_str ++ "!!: negative index"

{-# INLINABLE (!!) #-}
xs !! n
  | n < 0     = negIndex
  | otherwise = foldr (\x r k -> case k of
                                   0 -> x
                                   _ -> r (k-1)) tooLarge xs n
#endif

--------------------------------------------------------------
-- The zip family
--------------------------------------------------------------

----------------------------------------------
-- | 'zip' takes two lists and returns a list of corresponding pairs.
-- If one input list is short, excess elements of the longer list are
-- discarded.
--
-- 'zip' is right-lazy:
--
-- > zip [] _|_ = []
{-# NOINLINE [1] zip #-}
zip :: [a] -> [b] -> [(a,b)]
zip []     _bs    = []
zip _as    []     = []
zip (a:as) (b:bs) = (a,b) : zip as bs

-- The zipWith family generalises the zip family by zipping with the
-- function given as the first argument, instead of a tupling function.

----------------------------------------------
-- | 'zipWith' generalises 'zip' by zipping with the function given
-- as the first argument, instead of a tupling function.
-- For example, @'zipWith' (+)@ is applied to two lists to produce the
-- list of corresponding sums.
--
-- 'zipWith' is right-lazy:
--
-- > zipWith f [] _|_ = []
{-# NOINLINE [1] zipWith #-}
zipWith :: (a->b->c) -> [a]->[b]->[c]
zipWith _f []     _bs    = []
zipWith _f _as    []     = []
zipWith f  (a:as) (b:bs) = f a b : zipWith f as bs

-- | 'unzip' transforms a list of pairs into a list of first components
-- and a list of second components.
unzip    :: [(a,b)] -> ([a],[b])
{-# INLINE unzip #-}
unzip    =  foldr (\(a,b) ~(as,bs) -> (a:as,b:bs)) ([],[])

--------------------------------------------------------------
-- Error code
--------------------------------------------------------------

-- Common up near identical calls to `error' to reduce the number
-- constant strings created when compiled:

errorEmptyList :: String -> a
errorEmptyList fun =
  error (prel_list_str ++ fun ++ ": empty list")

prel_list_str :: String
prel_list_str = "Prelude."


text:
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using DG.Tweening;

public class ActionSelect : MonoBehaviour
{
    private GameObject BreathingButton;
    private GameObject CameraButton;

    public bool Disabled = false;

    public IEnumerator Enable()
    {
        Disabled = false;
        yield return transform.DOMoveY(0f, .5f).SetEase(Ease.OutBack).WaitForCompletion();
    }

    public IEnumerator Disable()
    {
        Disabled = true;
        yield return transform.DOMoveY(-5f, .5f).SetEase(Ease.InBack).WaitForCompletion();
    }
}


text:
/* The PyMem_ family:  low-level memory allocation interfaces.
   See objimpl.h for the PyObject_ memory family.
*/

#ifndef Py_PYMEM_H
#define Py_PYMEM_H

#include "pyport.h"

#ifdef __cplusplus
extern "C" {
#endif

/* BEWARE:

   Each interface exports both functions and macros.  Extension modules should
   use the functions, to ensure binary compatibility across Python versions.
   Because the Python implementation is free to change internal details, and
   the macros may (or may not) expose details for speed, if you do use the
   macros you must recompile your extensions with each Python release.

   Never mix calls to PyMem_ with calls to the platform malloc/realloc/
   calloc/free.  For example, on Windows different DLLs may end up using
   different heaps, and if you use PyMem_Malloc you'll get the memory from the
   heap used by the Python DLL; it could be a disaster if you free()'ed that
   directly in your own extension.  Using PyMem_Free instead ensures Python
   can return the memory to the proper heap.  As another example, in
   PYMALLOC_DEBUG mode, Python wraps all calls to all PyMem_ and PyObject_
   memory functions in special debugging wrappers that add additional
   debugging info to dynamic memory blocks.  The system routines have no idea
   what to do with that stuff, and the Python wrappers have no idea what to do
   with raw blocks obtained directly by the system routines then.

   The GIL must be held when using these APIs.
*/

/*
 * Raw memory interface
 * ====================
 */

/* Functions

   Functions supplying platform-independent semantics for malloc/realloc/
   free.  These functions make sure that allocating 0 bytes returns a distinct
   non-NULL pointer (whenever possible -- if we're flat out of memory, NULL
   may be returned), even if the platform malloc and realloc don't.
   Returned pointers must be checked for NULL explicitly.  No action is
   performed on failure (no exception is set, no warning is printed, etc).
*/

PyAPI_FUNC(void *) PyMem_Malloc(size_t);
PyAPI_FUNC(void *) PyMem_Realloc(void *, size_t);
PyAPI_FUNC(void) PyMem_Free(void *);

/* Starting from Python 1.6, the wrappers Py_{Malloc,Realloc,Free} are
   no longer supported. They used to call PyErr_NoMemory() on failure. */

/* Macros. */
#ifdef PYMALLOC_DEBUG
/* Redirect all memory operations to Python's debugging allocator. */
#define PyMem_MALLOC		PyObject_MALLOC
#define PyMem_REALLOC		PyObject_REALLOC
#define PyMem_FREE		PyObject_FREE

#else	/* ! PYMALLOC_DEBUG */

/* PyMem_MALLOC(0) means malloc(1). Some systems would return NULL
   for malloc(0), which would be treated as an error. Some platforms
   would return a pointer with no memory behind it, which would break
   pymalloc. To solve these problems, allocate an extra byte. */
/* Returns NULL to indicate error if a negative size or size larger than
   Py_ssize_t can represent is supplied.  Helps prevents security holes. */
#define PyMem_MALLOC(n)		(((n) < 0 || (n) > PY_SSIZE_T_MAX) ? NULL \
				: malloc((n) ? (n) : 1))
#define PyMem_REALLOC(p, n)	(((n) < 0 || (n) > PY_SSIZE_T_MAX) ? NULL \
				: realloc((p), (n) ? (n) : 1))
#define PyMem_FREE		free

#endif	/* PYMALLOC_DEBUG */

/*
 * Type-oriented memory interface
 * ==============================
 *
 * Allocate memory for n objects of the given type.  Returns a new pointer
 * or NULL if the request was too large or memory allocation failed.  Use
 * these macros rather than doing the multiplication yourself so that proper
 * overflow checking is always done.
 */

#define PyMem_New(type, n) \
  ( ((size_t)(n) > PY_SSIZE_T_MAX / sizeof(type)) ? NULL :	\
	( (type *) PyMem_Malloc((n) * sizeof(type)) ) )
#define PyMem_NEW(type, n) \
  ( ((size_t)(n) > PY_SSIZE_T_MAX / sizeof(type)) ? NULL :	\
	( (type *) PyMem_MALLOC((n) * sizeof(type)) ) )

/*
 * The value of (p) is always clobbered by this macro regardless of success.
 * The caller MUST check if (p) is NULL afterwards and deal with the memory
 * error if so.  This means the original value of (p) MUST be saved for the
 * caller's memory error handler to not lose track of it.
 */
#define PyMem_Resize(p, type, n) \
  ( (p) = ((size_t)(n) > PY_SSIZE_T_MAX / sizeof(type)) ? NULL :	\
	(type *) PyMem_Realloc((p), (n) * sizeof(type)) )
#define PyMem_RESIZE(p, type, n) \
  ( (p) = ((size_t)(n) > PY_SSIZE_T_MAX / sizeof(type)) ? NULL :	\
	(type *) PyMem_REALLOC((p), (n) * sizeof(type)) )

/* PyMem{Del,DEL} are left over from ancient days, and shouldn't be used
 * anymore.  They're just confusing aliases for PyMem_{Free,FREE} now.
 */
#define PyMem_Del		PyMem_Free
#define PyMem_DEL		PyMem_FREE

#ifdef __cplusplus
}
#endif

#endif /* !Py_PYMEM_H */


text:
package com.iancaffey.access.google.maps;

import com.iancaffey.access.util.StatusCode;

import java.util.Arrays;

/**
 * Distances
 *
 * @author Ian Caffey
 * @since 1.0
 */
public class Distances {
    private final StatusCode code;
    private final String[] origins;
    private final String[] destinations;
    private final DistanceElement[][] elements;

    public Distances(StatusCode code, String[] origins, String[] destinations, DistanceElement[][] elements) {
        if (origins == null || destinations == null || elements == null)
            throw new IllegalArgumentException();
        this.code = code;
        this.origins = Arrays.copyOf(origins, origins.length);
        this.destinations = Arrays.copyOf(destinations, destinations.length);
        this.elements = Arrays.copyOf(elements, elements.length);
    }

    public StatusCode getCode() {
        return code;
    }

    public String[] getOrigins() {
        return Arrays.copyOf(origins, origins.length);
    }

    public String[] getDestinations() {
        return Arrays.copyOf(destinations, destinations.length);
    }

    public DistanceElement[][] getElements() {
        return Arrays.copyOf(elements, elements.length);
    }

    @Override
    public String toString() {
        return String.format("%s[code=%s, origins=%s, destinations=%s, elements%s]", getClass().getCanonicalName(), getCode(), Arrays.toString(getOrigins()), Arrays.toString(getDestinations()), Arrays.deepToString(getElements()));
    }
}


text:
title: Property File Data To JSON Format Converter | Developer Tools
layout: post
---

    {% include common-meta %}
    <title>{{ page.title }}</title>

    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <meta name="description" content="This is easy to use open source tool to convert JSON data to property file entry format. " />
    <meta name="keywords" content="online,tool,json,property,properties,convert,converter,web,opensource" />

    {% include theme-css %}

    {% include ie-fixes %}

        {% include theme-header %}

        {% include theme-sidebar %}

Convert Property Format Data To JSON

                                <form role="form">

                                        Property File Data
                                        <textarea class="form-control" rows="10" id="property" placeholder="Enter your Property File Data here" autofocus></textarea>

                                </form>

                                        <button type="button" class="btn btn-info" id="generate">Convert to JSON</button>

Copy Your JSON Data From Here

                                    JSON Format Converted Data
                                    <textarea class="form-control" id="jsonValues" rows="10"></textarea>

About Property to JSON Converter Tool

This is a free online tool to convert a property file format to JSON formatted data to. This can be useful tool for converting all property file entries to a single JSON document. You can convert any KEY = VALUE  format data to JSON data using this tool.

This tool can take care of nested property conversion to nested JSON objects by name matching.

What is a JSON Format?

JSON (JavaScript Object Notation) is a popular format used to transfer data between applications. It is very common object format in web applications. JavaScript applications do not require any speciall handling for this type of data since its is already an object of javascript format.

What is a Property format?

Property files are common way to provide KEY, VALUE pair configuration for programs.

Many programming langugages use configuration files that have simple format that stores each KEY = VALUE pair in new line.

What is a Property File format convention?

A commonly accepted propeerty file convention is to use dot (.)or underscore (_)  as a separator in keys.

e.g. dot  (.) as a separator

                        Persons.person.name = John
                        Persons.person.age = 30
                        Persons.person.city = SFO

Or underscore  (_) as a separator

                        Persons_person_name = John
                        Persons_person_age = 30
                        Persons_person_city = SFO

In case your property file does not follow this convention you may need to specify the separator for successful conversion to JSON format.

Why Convert From Property File to JSON Object format?

JSON Objects are easy to read using JavaScript and can also be easily consumed by many REST based services. This tool can help data conversion easy for property file to JSON format on one click.

Why Do We Need A Property File to a JSON Object Format Converter Online?

The online converter is a good help for property file format data  to JSON format. This tool can be handy since you just need to paste the property file data in the input field and hit convert button.

The same task can be done manually, however it can be cumbersome. This tool can save you some time and follow a consistent pattern to create a valid JSON document from well formatted property file.

You just need to copy and paste the property file content into this tool and get the JSON format data.

JSON Objects are easy to read in JavaScript, you can easily convert data in a property file to a JavaScript Object and access it easily in Node.js , Express.js, React.js anre more JavaScript based applications and frameworks.

Many times, we do not want to use property files. In that case this tool can help you convert entire property file into a JSON document.

The tool follows a simple naming convention and can identify nested property values based on name matching (case-sensitive).

            {% include addthis %}

        {% include theme-footer %}

    {% include theme-bottom-js %}


text:
package org.aikodi.chameleon.core.namespace;

public interface NamespaceFactory {

	public Namespace create(String name);
}


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

namespace LumiSoft.Net.SIP.Message
{
    ///
    /// Implements SIP "Cseq" value. Defined in RFC 3261.
    /// A CSeq in a request contains a single decimal sequence number and
    /// the request method. The method part of CSeq is case-sensitive. The CSeq header
    /// field serves to order transactions within a dialog, to provide a means to uniquely
    /// identify transactions, and to differentiate between new requests and request retransmissions.
    ///
    /// <remarks>
    ///
    /// RFC 3261 Syntax:
    ///     CSeq = 1*DIGIT LWS Method
    ///
    /// </remarks>
    public class SIP_t_CSeq : SIP_t_Value
    {
        private int    m_SequenceNumber = 1;
        private string m_RequestMethod  = "";

        ///
        /// Default constructor.
        ///
        /// <param name="value">CSeq: header field value.</param>
        public SIP_t_CSeq(string value)
        {
            Parse(new StringReader(value));
        }

        ///
        /// Default constructor.
        ///
        /// <param name="sequenceNumber">Command sequence number.</param>
        /// <param name="requestMethod">Request method.</param>
        public SIP_t_CSeq(int sequenceNumber,string requestMethod)
        {
            m_SequenceNumber = sequenceNumber;
            m_RequestMethod  = requestMethod;
        }

        #region method Parse

        ///
        /// Parses "CSeq" from specified value.
        ///
        /// <param name="value">SIP "CSeq" value.</param>
        /// <exception cref="ArgumentNullException">Raised when value is null.</exception>
        /// <exception cref="SIP_ParseException">Raised when invalid SIP message.</exception>
        public void Parse(string value)
        {
            if(value == null){
                throw new ArgumentNullException("value");
            }

            Parse(new StringReader(value));
        }

        ///
        /// Parses "CSeq" from specified reader.
        ///
        /// <param name="reader">Reader from where to parse.</param>
        /// <exception cref="ArgumentNullException">Raised when reader is null.</exception>
        /// <exception cref="SIP_ParseException">Raised when invalid SIP message.</exception>
        public override void Parse(StringReader reader)
        {
            // CSeq = 1*DIGIT LWS Method

            if(reader == null){
                throw new ArgumentNullException("reader");
            }

            // Get sequence number
            string word = reader.ReadWord();
            if(word == null){
                throw new SIP_ParseException("Invalid 'CSeq' value, sequence number is missing !");
            }
            try{
                m_SequenceNumber = Convert.ToInt32(word);
            }
            catch{
                throw new SIP_ParseException("Invalid CSeq 'sequence number' value !");
            }

            // Get request method
            word = reader.ReadWord();
            if(word == null){
                throw new SIP_ParseException("Invalid 'CSeq' value, request method is missing !");
            }
            m_RequestMethod = word;
        }

        #endregion

        #region method ToStringValue

        ///
        /// Converts this to valid "CSeq" value.
        ///
        /// <returns>Returns "CSeq" value.</returns>
        public override string ToStringValue()
        {
            return m_SequenceNumber + " " + m_RequestMethod;
        }

        #endregion

        #region Properties Implementation

        ///
        /// Gets or sets sequence number.
        ///
        public int SequenceNumber
        {
            get{ return m_SequenceNumber; }

            set{
                if(value < 1){
                    throw new ArgumentException("Property SequenceNumber value must be >= 1 !");
                }

                m_SequenceNumber = value;
            }
        }

        ///
        /// Gets or sets request method. Note: this value is case-sensitive !
        ///
        public string RequestMethod
        {
            get{ return m_RequestMethod; }

            set{
                if(string.IsNullOrEmpty(value)){
                    throw new ArgumentException("Property RequestMethod value can't be null or empty !");
                }

                m_RequestMethod = value;
            }
        }

        #endregion

    }
}


text:
package com.github.dnbn.submerge.boot.model;

import java.time.Instant;
import java.time.ZoneId;
import java.time.ZonedDateTime;
import java.util.UUID;

import software.amazon.awssdk.enhanced.dynamodb.mapper.annotations.DynamoDbAttribute;
import software.amazon.awssdk.enhanced.dynamodb.mapper.annotations.DynamoDbBean;
import software.amazon.awssdk.enhanced.dynamodb.mapper.annotations.DynamoDbPartitionKey;

@DynamoDbBean
public class MergeHisto {

	private String id;
	private Instant date;
	private MergeHistoItem item1;
	private MergeHistoItem item2;

	public MergeHisto() {
		super();
	}

	public MergeHisto(MergeHistoItem item1, MergeHistoItem item2) {
		super();
		this.id = UUID.randomUUID().toString();
		this.date = ZonedDateTime.now(ZoneId.of("Europe/Paris")).toInstant();
		this.item1 = item1;
		this.item2 = item2;
	}

	@DynamoDbPartitionKey
	@DynamoDbAttribute(value = "id")
	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	@DynamoDbAttribute(value = "date")
	public Instant getDate() {
		return date;
	}

	public void setDate(Instant date) {
		this.date = date;
	}

	@DynamoDbAttribute(value = "item1")
	public MergeHistoItem getItem1() {
		return item1;
	}

	public void setItem1(MergeHistoItem item1) {
		this.item1 = item1;
	}

	@DynamoDbAttribute(value = "item2")
	public MergeHistoItem getItem2() {
		return item2;
	}

	public void setItem2(MergeHistoItem item2) {
		this.item2 = item2;
	}

}


text:
namespace DAVA
{
class RenderObject;
class RenderBatch;
class CloneLastBatchCommand : public RECommand
{
public:
    CloneLastBatchCommand(RenderObject* renderObject);
    virtual ~CloneLastBatchCommand();

    void Undo() override;
    void Redo() override;

    inline const Vector<RenderBatch*>& GetNewBatches() const;

protected:
    RenderObject* renderObject;
    int32 maxLodIndexes[2];

    int32 requestedSwitchIndex;
    Vector<RenderBatch*> newBatches;

    DAVA_VIRTUAL_REFLECTION(CloneLastBatchCommand, RECommand);
};

inline const Vector<RenderBatch*>& CloneLastBatchCommand::GetNewBatches() const
{
    return newBatches;
}
} // namespace DAVA


text:
package kafka.consumer

import kafka.api.{FetchRequestBuilder, FetchResponsePartitionData, OffsetRequest, Request}
import kafka.cluster.BrokerEndPoint
import kafka.message.ByteBufferMessageSet
import kafka.server.{AbstractFetcherThread, PartitionFetchState}
import kafka.common.{ErrorMapping, TopicAndPartition}

import scala.collection.Map
import ConsumerFetcherThread._
import org.apache.kafka.common.TopicPartition
import org.apache.kafka.common.record.MemoryRecords

class ConsumerFetcherThread(name: String,
                            val config: ConsumerConfig,
                            sourceBroker: BrokerEndPoint,
                            partitionMap: Map[TopicPartition, PartitionTopicInfo],
                            val consumerFetcherManager: ConsumerFetcherManager)
        extends AbstractFetcherThread(name = name,
                                      clientId = config.clientId,
                                      sourceBroker = sourceBroker,
                                      fetchBackOffMs = config.refreshLeaderBackoffMs,
                                      isInterruptible = true) {

  type REQ = FetchRequest
  type PD = PartitionData

  private val clientId = config.clientId
  private val fetchSize = config.fetchMessageMaxBytes

  private val simpleConsumer = new SimpleConsumer(sourceBroker.host, sourceBroker.port, config.socketTimeoutMs,
    config.socketReceiveBufferBytes, config.clientId)

  private val fetchRequestBuilder = new FetchRequestBuilder().
    clientId(clientId).
    replicaId(Request.OrdinaryConsumerId).
    maxWait(config.fetchWaitMaxMs).
    minBytes(config.fetchMinBytes).
    requestVersion(kafka.api.FetchRequest.CurrentVersion)

  override def initiateShutdown(): Boolean = {
    val justShutdown = super.initiateShutdown()
    if (justShutdown && isInterruptible)
      simpleConsumer.disconnectToHandleJavaIOBug()
    justShutdown
  }

  override def shutdown(): Unit = {
    super.shutdown()
    simpleConsumer.close()
  }

  // process fetched data
  def processPartitionData(topicPartition: TopicPartition, fetchOffset: Long, partitionData: PartitionData) {
    val pti = partitionMap(topicPartition)
    if (pti.getFetchOffset != fetchOffset)
      throw new RuntimeException("Offset doesn't match for partition [%s,%d] pti offset: %d fetch offset: %d"
                                .format(topicPartition.topic, topicPartition.partition, pti.getFetchOffset, fetchOffset))
    pti.enqueue(partitionData.underlying.messages.asInstanceOf[ByteBufferMessageSet])
  }

  // handle a partition whose offset is out of range and return a new fetch offset
  def handleOffsetOutOfRange(topicPartition: TopicPartition): Long = {
    val startTimestamp = config.autoOffsetReset match {
      case OffsetRequest.SmallestTimeString => OffsetRequest.EarliestTime
      case OffsetRequest.LargestTimeString => OffsetRequest.LatestTime
      case _ => OffsetRequest.LatestTime
    }
    val topicAndPartition = TopicAndPartition(topicPartition.topic, topicPartition.partition)
    val newOffset = simpleConsumer.earliestOrLatestOffset(topicAndPartition, startTimestamp, Request.OrdinaryConsumerId)
    val pti = partitionMap(topicPartition)
    pti.resetFetchOffset(newOffset)
    pti.resetConsumeOffset(newOffset)
    newOffset
  }

  // any logic for partitions whose leader has changed
  def handlePartitionsWithErrors(partitions: Iterable[TopicPartition]) {
    removePartitions(partitions.toSet)
    consumerFetcherManager.addPartitionsWithError(partitions)
  }

  protected def buildFetchRequest(partitionMap: collection.Seq[(TopicPartition, PartitionFetchState)]): FetchRequest = {
    partitionMap.foreach { case ((topicPartition, partitionFetchState)) =>
      if (partitionFetchState.isActive)
        fetchRequestBuilder.addFetch(topicPartition.topic, topicPartition.partition, partitionFetchState.offset,
          fetchSize)
    }

    new FetchRequest(fetchRequestBuilder.build())
  }

  protected def fetch(fetchRequest: FetchRequest): Seq[(TopicPartition, PartitionData)] =
    simpleConsumer.fetch(fetchRequest.underlying).data.map { case (TopicAndPartition(t, p), value) =>
      new TopicPartition(t, p) -> new PartitionData(value)
    }
}

object ConsumerFetcherThread {

  class FetchRequest(val underlying: kafka.api.FetchRequest) extends AbstractFetcherThread.FetchRequest {
    private lazy val tpToOffset: Map[TopicPartition, Long] = underlying.requestInfo.map { case (tp, fetchInfo) =>
      new TopicPartition(tp.topic, tp.partition) -> fetchInfo.offset
    }.toMap
    def isEmpty: Boolean = underlying.requestInfo.isEmpty
    def offset(topicPartition: TopicPartition): Long = tpToOffset(topicPartition)
  }

  class PartitionData(val underlying: FetchResponsePartitionData) extends AbstractFetcherThread.PartitionData {
    def errorCode: Short = underlying.error
    def toRecords: MemoryRecords = underlying.messages.asInstanceOf[ByteBufferMessageSet].asRecords
    def highWatermark: Long = underlying.hw
    def exception: Option[Throwable] =
      if (errorCode == ErrorMapping.NoError) None else Some(ErrorMapping.exceptionFor(errorCode))

  }
}


text:
package json

import (
	"bytes"
	"encoding/json"
	"io"
	"net"

	"github.com/doubledutch/mux"
)

type Pool struct {
}

func (p *Pool) NewBufferEncoder() mux.BufferEncoder {
	return NewBufferEncoder(new(bytes.Buffer))
}

func (p *Pool) NewBufferDecoder() mux.BufferDecoder {
	return NewBufferDecoder(new(bytes.Buffer))
}

func (p *Pool) NewEncoder(w io.Writer) mux.Encoder {
	return json.NewEncoder(w)
}

func (p *Pool) NewDecoder(r io.Reader) mux.Decoder {
	return json.NewDecoder(r)
}

func (p *Pool) NewReceiver(ch interface{}) mux.Receiver {
	return mux.NewReceiver(ch, p)
}

func (p *Pool) NewServer(conn net.Conn, config *mux.Config) (mux.Server, error) {
	return NewServer(conn, config)
}

func (p *Pool) NewClient(conn net.Conn, config *mux.Config) (mux.Client, error) {
	return NewClient(conn, config)
}


text:
package org.apereo.cas.authentication.policy;

import org.apereo.cas.authentication.Authentication;
import org.apereo.cas.authentication.AuthenticationPolicy;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * Authentication policy that is satisfied by at least one successfully authenticated credential.
 *
 * @author Marvin S. Addison
 * @since 4.0.0
 */
public class AnyAuthenticationPolicy implements AuthenticationPolicy {
    private static final Logger LOGGER = LoggerFactory.getLogger(AnyAuthenticationPolicy.class);

    /**
     * Flag to try all credentials before policy is satisfied. Defaults to {@code false}.
     */
    private boolean tryAll;

    /**
     * Instantiates a new Any authentication policy.
     */
    public AnyAuthenticationPolicy() {
    }

    /**
     * Instantiates a new Any authentication policy.
     *
     * @param tryAll the try all
     */
    public AnyAuthenticationPolicy(final boolean tryAll) {
        this.tryAll = tryAll;
    }

    /**
     * Sets the flag to try all credentials before the policy is satisfied.
     * This flag is disabled by default such that the policy is satisfied immediately upon the first
     * successfully authenticated credential. Defaults to {@code false}.
     *
     * @param tryAll True to force all credentials to be authenticated, false otherwise.
     */
    public void setTryAll(final boolean tryAll) {
        this.tryAll = tryAll;
    }

    @Override
    public boolean isSatisfiedBy(final Authentication authn) throws Exception {
        if (this.tryAll) {
            if (authn.getCredentials().size() != authn.getSuccesses().size() + authn.getFailures().size()) {
                LOGGER.warn("Number of provided credentials does not match the sum of authentication successes and failures");
                return false;
            }
            LOGGER.debug("Authentication policy is satisfied with all authentication transactions");
            return true;
        }
        if (!authn.getSuccesses().isEmpty()) {
            LOGGER.debug("Authentication policy is satisfied having found at least one authentication transactions");
            return true;
        }
        LOGGER.warn("Authentication policy has failed to find a successful authentication transaction");
        return false;
    }
}


text:
package microsoft.exchange.webservices.data.core.response;

import microsoft.exchange.webservices.data.core.EwsServiceXmlReader;
import microsoft.exchange.webservices.data.core.EwsUtilities;
import microsoft.exchange.webservices.data.exception.ServiceLocalException;
import microsoft.exchange.webservices.data.exception.ServiceXmlDeserializationException;
import microsoft.exchange.webservices.data.misc.UserConfiguration;

import javax.xml.stream.XMLStreamException;

/**
 * Represents a response to a GetUserConfiguration request.
 */
public final class GetUserConfigurationResponse extends ServiceResponse {

  /**
   * The user configuration.
   */
  private UserConfiguration userConfiguration;

  /**
   * Initializes a new instance of the class.
   *
   * @param userConfiguration the user configuration
   */
  public GetUserConfigurationResponse(UserConfiguration userConfiguration) {
    super();
    EwsUtilities.EwsAssert(userConfiguration != null, "GetUserConfigurationResponse.ctor",
                           "userConfiguration is null");

    this.userConfiguration = userConfiguration;
  }

  /**
   * Reads response elements from XML.
   *
   * @param reader the reader
   * @throws ServiceXmlDeserializationException                        the service xml deserialization exception
   * @throws javax.xml.stream.XMLStreamException                       the xML stream exception
   * @throws InstantiationException                                    the instantiation exception
   * @throws IllegalAccessException                                    the illegal access exception
   * @throws microsoft.exchange.webservices.data.exception.ServiceLocalException the service local exception
   * @throws Exception                                                 the exception
   */
  @Override
  protected void readElementsFromXml(EwsServiceXmlReader reader)
      throws ServiceXmlDeserializationException, XMLStreamException,
      InstantiationException, IllegalAccessException, ServiceLocalException, Exception {
    super.readElementsFromXml(reader);
    this.userConfiguration.loadFromXml(reader);
  }

  /**
   * Gets the user configuration that was created.
   *
   * @return the user configuration
   */
  public UserConfiguration getUserConfiguration() {
    return this.userConfiguration;
  }
}


text:
#ifndef OPENSSL_HEADER_CRYPTO_FIPSMODULE_ECDSA_INTERNAL_H
#define OPENSSL_HEADER_CRYPTO_FIPSMODULE_ECDSA_INTERNAL_H

#include <openssl/base.h>

#if defined(__cplusplus)
extern "C" {
#endif

// ecdsa_sign_with_nonce_for_known_answer_test behaves like |ECDSA_do_sign| but
// takes a fixed nonce. This function is used as part of known-answer tests in
// the FIPS module.
ECDSA_SIG *ecdsa_sign_with_nonce_for_known_answer_test(const uint8_t *digest,
                                                       size_t digest_len,
                                                       const EC_KEY *eckey,
                                                       const uint8_t *nonce,
                                                       size_t nonce_len);

#if defined(__cplusplus)
}
#endif

#endif  // OPENSSL_HEADER_CRYPTO_FIPSMODULE_ECDSA_INTERNAL_H


text:
<!DOCTYPE html>

    <title>FileWriter Test: FileWriter_write_normal</title>
    <link rel="author" title="Intel" href="http://www.intel.com" />
    <link rel="help" href="http://dev.w3.org/2009/dap/file-system/file-writer.html#widl-FileWriter-write-void-Blob-data" />
    <meta name="flags" content="" />
    <meta name="assert" content="Check if FileWriter.write method is normal" />


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;

namespace Utterance.Linq
{
	public static class SkipWhile
	{
		internal class Access<TSource> : Utterance.Access.AccessBase
		{
			public LambdaExpression SourcePredicate { get { return Cache<TSource>.SourcePredicate; } }
			public LambdaExpression SourceIndexedPredicate { get { return Cache<TSource>.SourceIndexedPredicate; } }
		}
		public static class Cache<TSource>
		{
			public static readonly Expression<Func<IEnumerable<TSource>, Func<TSource, bool>, IEnumerable<TSource>>> SourcePredicate = (source, predicate) => source.SkipWhile(predicate);
			public static readonly Expression<Func<IEnumerable<TSource>, Func<TSource, int, bool>, IEnumerable<TSource>>> SourceIndexedPredicate = (source, predicate) => source.SkipWhile(predicate);
		}
	}
}


text:
package org.apache.guacamole;

import com.google.inject.Injector;
import javax.inject.Inject;
import javax.servlet.ServletContext;
import javax.ws.rs.ApplicationPath;
import org.glassfish.hk2.api.ServiceLocator;
import org.glassfish.jersey.jackson.JacksonFeature;
import org.glassfish.jersey.server.ResourceConfig;
import org.jvnet.hk2.guice.bridge.api.GuiceBridge;
import org.jvnet.hk2.guice.bridge.api.GuiceIntoHK2Bridge;
import org.slf4j.bridge.SLF4JBridgeHandler;

/**
 * JAX-RS Application which serves as the root definition of the Guacamole
 * REST API. The HK2 dependency injection used by Jersey is automatically
 * bridged to Guice, allowing injections managed by Guice to be injected within
 * classes served by Jersey.
 */
@ApplicationPath("/*")
public class GuacamoleApplication extends ResourceConfig {

    /**
     * Creates a new GuacamoleApplication which defines the Guacamole REST API,
     * automatically configuring Jersey's HK2 dependency injection to
     * additionally pull services from a Guice injector.
     *
     * @param servletContext
     *     The ServletContext which has already associated with a Guice
     *     injector via a GuacamoleServletContextListener.
     *
     * @param serviceLocator
     *     The HK2 service locator (injector).
     */
    @Inject
    public GuacamoleApplication(ServletContext servletContext,
            ServiceLocator serviceLocator) {

        // Bridge Jersey logging (java.util.logging) to SLF4J
        SLF4JBridgeHandler.removeHandlersForRootLogger();
        SLF4JBridgeHandler.install();

        // Bridge HK2 service locator with Guice injector
        Injector guiceInjector = (Injector) servletContext.getAttribute(GuacamoleServletContextListener.GUICE_INJECTOR);
        GuiceBridge.getGuiceBridge().initializeGuiceBridge(serviceLocator);
        GuiceIntoHK2Bridge bridge = serviceLocator.getService(GuiceIntoHK2Bridge.class);
        bridge.bridgeGuiceInjector(guiceInjector);

        // Automatically scan for REST resources
        packages("org.apache.guacamole.rest");

        // Use Jackson for JSON
        register(JacksonFeature.class);

    }

}


text:
[![Build Status](https://img.shields.io/travis/smooth-code/svgr.svg)](https://travis-ci.org/smooth-code/svgr)
[![Version](https://img.shields.io/npm/v/@svgr/plugin-svgo.svg)](https://www.npmjs.com/package/@svgr/plugin-svgo)
[![MIT License](https://img.shields.io/npm/l/@svgr/plugin-svgo.svg)](https://github.com/smooth-code/svgr/blob/master/LICENSE)

Optimize SVG using SVGO.

## Install

```
npm install --save-dev @svgr/plugin-svgo
```

## Usage

**.svgrrc**

```json
{
  "plugins": ["@svgr/plugin-svgo"]
}
```

## License

MIT


text:
package repair

import (
	"errors"
	"koding/klient/remote/req"
	"koding/klientctl/util"
	"os"
	"strings"

	"github.com/koding/logging"
)

// dncSuffix is the suffix of the error mesage returned by the OS when trying to
// open a not-configured device directory.
const dncSuffix = "device not configured"

// DeviceNotConfiguredRepair looks at the given mount directory and checks if
// is a device not configured. If so, remount.
type DeviceNotConfiguredRepair struct {
	Log logging.Logger

	Stdout *util.Fprint

	MountName string

	// The klient we will be communicating with.
	Klient interface {
		RemoteMountInfo(string) (req.MountInfoResponse, error)
		RemoteRemount(string) error
	}
}

func (r *DeviceNotConfiguredRepair) String() string {
	return "DeviceNotConfiguredRepair"
}

func (r *DeviceNotConfiguredRepair) getMountPath() (string, error) {
	// Get the mount dir.
	info, err := r.Klient.RemoteMountInfo(r.MountName)
	if err != nil {
		return "", err
	}

	return info.LocalPath, nil
}

// Status stats the mount directory that klient returns, and if it errors with
// Permission denied, return an error.
func (r *DeviceNotConfiguredRepair) Status() (bool, error) {
	path, err := r.getMountPath()

	// If we can't even get the mount dir from klient, return the error
	// so that repair can fail with the same issue.
	if err != nil {
		return false, err
	}

	f, err := os.Open(path)

	// If open fails with device not configured, we return not okay.
	if err != nil && strings.HasSuffix(err.Error(), dncSuffix) {
		return false, nil
	}

	// If it's another error, log it. In this case there's nothing to do,
	// we don't know what's wrong.
	if err != nil {
		r.Log.Warning("Encountered error not in scope of this repair. err:%s", err)
		return true, nil
	}

	// Not returning an error for mount closing failure. Just logging it.
	if err := f.Close(); err != nil {
		r.Log.Warning(
			"Failed to close MountDir. mountName:%s, dir:%s, err:%s",
			r.MountName, path, err,
		)
	}

	return true, nil
}

// Repair simply remounts the given directory, and then checks the status one more
// time before exiting.
func (r *DeviceNotConfiguredRepair) Repair() error {
	r.Stdout.Printlnf("Mount is no longer valid, remounting...")

	if err := r.Klient.RemoteRemount(r.MountName); err != nil {
		r.Stdout.Printlnf("Unable to remount %s", r.MountName)
		return err
	}

	if ok, err := r.Status(); !ok || err != nil {
		r.Stdout.Printlnf("Unable to repair mount issue.")
		if err == nil {
			err = errors.New("Status returned not-okay after Repair")
		}
		return err
	}

	r.Stdout.Printlnf("Remounted successfully.")

	return nil
}


text:
curl -s "https://www.postgresql.org/media/keys/ACCC4CF8.asc" | apt-key add -

echo "deb http://apt.postgresql.org/pub/repos/apt/ jessie-pgdg main" | sudo tee -a /etc/apt/sources.list.d/postgresql.list

apt-get update
apt-get install -y postgresql-9.5

sudo -u postgres psql -c "CREATE USER vagrant WITH PASSWORD 'vagrant'"
sudo -u postgres psql -c "CREATE DATABASE ghmirror"
sudo -u postgres psql -c "GRANT ALL PRIVILEGES ON DATABASE ghmirror TO vagrant"

sudo sed -i "s/#listen_addresses.*/listen_addresses = '*'/g" /etc/postgresql/9.5/main/postgresql.conf
sudo sed -i '$s/$/\n\nhost all all 0.0.0.0\/0 md5/' /etc/postgresql/9.5/main/pg_hba.conf
sudo systemctl restart postgresql


text: from .blendercommandhive import blendercommandhive, blendercommandapp


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Http;
using System.Web.Mvc;
using System.Web.Optimization;
using System.Web.Routing;
using MongoDB.Messaging;
using MongoDB.Messaging.SignalR;

namespace QueueBrowser
{
    public class WebApiApplication : System.Web.HttpApplication
    {
        private static readonly Lazy<ChangeNotificationService> _changeService;

        static WebApiApplication()
        {
            _changeService = new Lazy<ChangeNotificationService>(() => new ChangeNotificationService("MongoMessaging", "Messaging.*"));
        }

        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();
            GlobalConfiguration.Configure(WebApiConfig.Register);
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);

            // config message queue
            MessageQueue.Default.Configure(c => c
                .Connection("MongoMessaging")
            );

            // start broadcasting changes
            _changeService.Value.Start();
        }

        protected void Application_Stop()
        {
            _changeService.Value.Stop();
        }
    }
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DotVVM.Framework.Testing.SeleniumHelpers.Proxies
{
    public class GridViewTextColumnProxy : WebElementProxyBase
    {
        public GridViewTextColumnProxy(SeleniumHelperBase helper, PathSelector selector) : base(helper, selector)
        {
        }
    }
}


text:
import {reducerBuilder} from '../../reducers/reducer-builder';
import {loadUserTypes} from '../actions/user-actions';
import {saveUserTypes} from '../actions/user-actions';

//types to use
// question here is should loadUserTypes be more like {request, receive} instead of {REQUEST_LOAD_USER, RESPONSE_LOAD_USER}
// I prefer the things as they are now but I would like your opinion @BernardStanislas and @Tommass

// default data
const DEFAULT_DATA = {
    firstName:'UserYolo',
    childs: []
};

// Reducer for the user entity with a state modification on load and save.
const userReducer = reducerBuilder({
    name: 'USER.INFORMATION',
    loadTypes: loadUserTypes,
    saveTypes: saveUserTypes,
    defaultData: DEFAULT_DATA
});

export default userReducer;


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

using ProtoBuf;

namespace InWorldz.Phlox.Serialization
{
    /// <summary>
    /// This class is a representation of the LSLList primitive type but can be serialized
    /// </summary>
    [ProtoContract]
    public class SerializedLSLList
    {
        [ProtoMember(1)]
        public List<SerializedLSLPrimitive> ListContents;

        /// <summary>
        /// Create a new Serializable List from the LSLList primitive type
        /// </summary>
        /// <param name="lSLList"></param>
        /// <returns></returns>
        public static SerializedLSLList FromList(Types.LSLList lSLList)
        {
            SerializedLSLList list = new SerializedLSLList();
            list.ListContents = new List<SerializedLSLPrimitive>();

            foreach (object obj in lSLList.Members)
            {
                SerializedLSLPrimitive primitive = new SerializedLSLPrimitive();
                primitive.Value = obj;
                list.ListContents.Add(primitive);
            }

            return list;
        }

        public SerializedLSLList()
        {
        }

        /// <summary>
        /// Transforms this list into an LSLList primitive type
        /// </summary>
        /// <returns></returns>
        public Types.LSLList ToList()
        {
            object[] members;

            if (ListContents != null)
            {
                members = new object[ListContents.Count];
            }
            else
            {
                members = new object[0];
            }

            for (int i = 0; i < members.Length; i++)
            {
                members[i] = ListContents[i].Value;
            }

            Types.LSLList lslList = new Types.LSLList(members);
            return lslList;
        }
    }
}


text:
package cn.zxl.orm.common.config;

import org.springframework.beans.factory.support.BeanDefinitionBuilder;
import org.springframework.beans.factory.xml.AbstractSingleBeanDefinitionParser;
import org.springframework.beans.factory.xml.ParserContext;
import org.w3c.dom.Element;

import cn.zxl.common.StringUtil;
import cn.zxl.orm.common.spring.StringFactoryBean;

public class StringParser extends AbstractSingleBeanDefinitionParser {

	private static final String VALUE_NAME = "value";

	@Override
	protected boolean shouldGenerateIdAsFallback() {
		return true;
	}

	@Override
	protected Class<?> getBeanClass(Element element) {
		return String.class;
	}

	@Override
	protected void doParse(Element element, ParserContext parserContext, BeanDefinitionBuilder builder) {
		if (StringUtil.isEmpty(element.getAttribute(ID_ATTRIBUTE)) || StringUtil.isEmpty(element.getAttribute(VALUE_NAME))) {
			parserContext.getReaderContext().error("Properties must have id and value", element);
		}
		builder.getBeanDefinition().setBeanClass(StringFactoryBean.class);
		builder.addPropertyValue("string", element.getAttribute(VALUE_NAME));
	}

}


text:
FOUNDATION_EXPORT double JSQMessagesVersionNumber;

//! Project version string for JSQMessages.
FOUNDATION_EXPORT const unsigned char JSQMessagesVersionString[];

// In this header, you should import all the public headers of your framework using statements like #import <JSQMessages/PublicHeader.h>

#import "JSQMessagesViewController.h"

//  Views
#import "JSQMessagesCollectionView.h"
#import "JSQMessagesCollectionViewCellIncoming.h"
#import "JSQMessagesCollectionViewCellOutgoing.h"
#import "JSQMessagesTypingIndicatorFooterView.h"
#import "JSQMessagesLoadEarlierHeaderView.h"

//  Layout
#import "JSQMessagesCollectionViewFlowLayout.h"
#import "JSQMessagesCollectionViewLayoutAttributes.h"
#import "JSQMessagesCollectionViewFlowLayoutInvalidationContext.h"

//  Toolbar
#import "JSQMessagesComposerTextView.h"
#import "JSQMessagesInputToolbar.h"
#import "JSQMessagesToolbarContentView.h"

//  Model
#import "JSQMessage.h"

#import "JSQMediaItem.h"
#import "JSQPhotoMediaItem.h"
#import "JSQLocationMediaItem.h"
#import "JSQVideoMediaItem.h"

#import "JSQMessagesBubbleImage.h"
#import "JSQMessagesAvatarImage.h"

//  Protocols
#import "JSQMessageData.h"
#import "JSQMessageMediaData.h"
#import "JSQMessageAvatarImageDataSource.h"
#import "JSQMessageBubbleImageDataSource.h"
#import "JSQMessagesCollectionViewDataSource.h"
#import "JSQMessagesCollectionViewDelegateFlowLayout.h"

//  Factories
#import "JSQMessagesAvatarImageFactory.h"
#import "JSQMessagesBubbleImageFactory.h"
#import "JSQMessagesMediaViewBubbleImageMasker.h"
#import "JSQMessagesTimestampFormatter.h"
#import "JSQMessagesToolbarButtonFactory.h"

//  Categories
#import "JSQSystemSoundPlayer+JSQMessages.h"
#import "NSString+JSQMessages.h"
#import "UIColor+JSQMessages.h"
#import "UIImage+JSQMessages.h"
#import "UIView+JSQMessages.h"


text:
//--------------------------------------------------------------------------------------------------
//
//   Copyright Tom Lu <luqiang1983@gmail.com>
//
//   Licensed under the Apache License, Version 2.0 (the "License");
//   you may not use this file except in compliance with the License.
//   You may obtain a copy of the License at
//
//       http://www.apache.org/licenses/LICENSE-2.0
//
//   Unless required by applicable law or agreed to in writing, software
//   distributed under the License is distributed on an "AS IS" BASIS,
//   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//   See the License for the specific language governing permissions and
//   limitations under the License.
//
//--------------------------------------------------------------------------------------------------

using System;
using System.Text;

// Ivi type mapping
using ViStatus = System.Int32;
using ViSession = System.IntPtr;
using ViString = System.String;
using ViBoolean = System.Boolean;
using ViInt8 = System.Byte;
using ViInt16 = System.Int16;
using ViInt32 = System.Int32;
using ViAttr = System.UInt32;
using ViInt64 = System.Int64;
using ViReal64 = System.Double;

namespace IVI.C.NET.Adapter.IviCInterop
{
    public interface IviFgen : IviDriver
    {
        /*- IviFgenBase Capability Group  -*/
        ViStatus ConfigureOutputMode(ViSession vi,
                                      ViInt32 outputMode);
        ViStatus ConfigureOperationMode(ViSession vi,
                                         ViString channelName,
                                         ViInt32 operationMode);

        ViStatus ConfigureRefClockSource(ViSession vi,
                                          ViInt32 refClockSource);

        ViStatus ConfigureOutputImpedance(ViSession vi,
                                           ViString channelName,
                                           ViReal64 outputImpedance);

        ViStatus ConfigureOutputEnabled(ViSession vi,
                                         ViString channelName,
                                         ViBoolean enabled);

        ViStatus GetChannelName(ViSession vi,
                                 ViInt32 index,
                                 ViInt32 bufferSize,
                                 StringBuilder name);

        ViStatus InitiateGeneration(ViSession vi);

        ViStatus AbortGeneration(ViSession vi);

        /*- IviFgenStdFunc Extension Group -*/
        ViStatus ConfigureStandardWaveform(ViSession vi,
                                            ViString channelName,
                                            ViInt32 waveform,
                                            ViReal64 amplitude,
                                            ViReal64 dcOffset,
                                            ViReal64 frequency,
                                            ViReal64 startPhase);

        /*- IviFgenArbWfm Extension Group -*/
        ViStatus QueryArbWfmCapabilities(ViSession vi,
                                          ref ViInt32 maxNumWfms,
                                          ref ViInt32 wfmQuantum,
                                          ref ViInt32 minWfmSize,
                                          ref ViInt32 maxWfmSize);

        ViStatus CreateArbWaveform(ViSession vi,
                                    ViInt32 wfmSize,
                                    ref ViReal64[] wfmData,
                                    ref ViInt32 wfmHandle);

        ViStatus ConfigureSampleRate(ViSession vi,
                                      ViReal64 sampleRate);

        ViStatus ConfigureArbWaveform(ViSession vi,
                                       ViString channelName,
                                       ViInt32 wfmHandle,
                                       ViReal64 arbGain,
                                       ViReal64 arbOffset);

        ViStatus ClearArbWaveform(ViSession vi,
                                   ViInt32 wfmHandle);

        /*- IviFgenArbFrequency Extension Group -*/
        ViStatus ConfigureArbFrequency(ViSession vi,
                                        ViString channelName,
                                        ViReal64 frequency);

        /*- IviFgenArbSeq Extension Group -*/
        ViStatus QueryArbSeqCapabilities(ViSession vi,
                                          ref ViInt32 maxNumSeqs,
                                          ref ViInt32 minSeqLength,
                                          ref ViInt32 maxSeqLength,
                                          ref ViInt32 maxLoopCount);

        ViStatus CreateArbSequence(ViSession vi,
                                    ViInt32 seqLength,
                                    ViInt32[] wfmHandle,
                                    ViInt32[] wfmLoopCount,
                                    ref ViInt32 seqHandle);

        ViStatus ConfigureArbSequence(ViSession vi,
                                       ViString channelName,
                                       ViInt32 seqHandle,
                                       ViReal64 arbGain,
                                       ViReal64 arbOffset);

        ViStatus ClearArbSequence(ViSession vi,
                                   ViInt32 seqHandle);

        ViStatus ClearArbMemory(ViSession vi);

        /*- IviFgenTrigger Extension Group -*/
        ViStatus ConfigureTriggerSource(ViSession vi,
                                         ViString channelName,
                                         ViInt32 trigSource);

        /*- IviFgenStartTrigger Extension Group -*/
        ViStatus ConfigureStartTrigger(ViSession vi,
                                        ViString channelName,
                                        ViString source,
                                        ViInt32 slope);

        /*- IviFgenStopTrigger Extension Group -*/
        ViStatus ConfigureStopTrigger(ViSession vi,
                                       ViString channelName,
                                       ViString source,
                                       ViInt32 slope);

        ViStatus SendSoftwareStopTrigger(ViSession vi);

        /*- IviFgenHoldTrigger Extension Group -*/
        ViStatus ConfigureHoldTrigger(ViSession vi,
                                       ViString channelName,
                                       ViString source,
                                       ViInt32 slope);

        ViStatus SendSoftwareHoldTrigger(ViSession vi);

        /*- IviFgenResumeTrigger Extension Group -*/
        ViStatus ConfigureResumeTrigger(ViSession vi,
                                         ViString channelName,
                                         ViString source,
                                         ViInt32 slope);

        ViStatus SendSoftwareResumeTrigger(ViSession vi);

        /*- IviFgenAdvanceTrigger Extension Group -*/
        ViStatus ConfigureAdvanceTrigger(ViSession vi,
                                          ViString channelName,
                                          ViString source,
                                          ViInt32 slope);

        ViStatus SendSoftwareAdvanceTrigger(ViSession vi);

        /*- IviFgenInternalTrigger Extension Group -*/
        ViStatus ConfigureInternalTriggerRate(ViSession vi,
                                               ViReal64 rate);

        /*- IviFgenSoftwareTrigger Extension Group -*/
        ViStatus SendSoftwareTrigger(ViSession vi);

        /*- IviFgenBurst Extension Group -*/
        ViStatus ConfigureBurstCount(ViSession vi,
                                      ViString channelName,
                                      ViInt32 count);

        /*- IviFgenModulateAM Extension Group -*/
        ViStatus ConfigureAMEnabled(ViSession vi,
                                     ViString channelName,
                                     ViBoolean enabled);

        ViStatus ConfigureAMSource(ViSession vi,
                                    ViString channelName,
                                    ViInt32 source);

        ViStatus ConfigureAMInternal(ViSession vi,
                                      ViReal64 amdepth,
                                      ViInt32 amWaveform,
                                      ViReal64 amFrequency);

        /*- IviFgenModulateFM Extension Group -*/
        ViStatus ConfigureFMEnabled(ViSession vi,
                                     ViString channelName,
                                     ViBoolean enabled);

        ViStatus ConfigureFMSource(ViSession vi,
                                    ViString channelName,
                                    ViInt32 source);

        ViStatus ConfigureFMInternal(ViSession vi,
                                      ViReal64 fmdeviation,
                                      ViInt32 fmWaveform,
                                      ViReal64 fmFrequency);

        /*- IviFgenSampleClock Extension Group -*/
        ViStatus ConfigureSampleClock(ViSession vi,
                                       ViInt32 source);

        ViStatus ConfigureSampleClockOutputEnabled(ViSession vi,
                                                    ViBoolean enabled);

        /*- IviFgenArbWfmSize64 Extension Group -*/
        ViStatus QueryArbWfmCapabilities64(ViSession vi,
                                            ref ViInt32 maxNumWfms,
                                            ref ViInt32 wfmQuantum,
                                            ref ViInt64 minWfmSize,
                                            ref ViInt64 maxWfmSize);

        /*- IviFgenArbChannelWfm Extension Group -*/
        ViStatus CreateChannelArbWaveform(ViSession vi,
                                           ViString channelName,
                                           ViInt64 wfmSize,
                                           ViReal64[] wfmData,
                                           ref ViInt32 wfmHandle);

        /*- IviFgenArbWfmBinary Extension Group -*/
        ViStatus CreateChannelArbWaveform16(ViSession vi,
                                             ViString channelName,
                                             ViInt64 wfmSize,
                                             ViInt16[] wfmData,
                                             ref ViInt32 wfmHandle);

        ViStatus CreateChannelArbWaveform32(ViSession vi,
                                             ViString channelName,
                                             ViInt64 wfmSize,
                                             ViInt32[] wfmData,
                                             ref ViInt32 wfmHandle);

        /*- IviFgenDataMarker Extension Group -*/
        ViStatus ConfigureDataMarker(ViSession vi,
                                      ViString name,
                                      ViString sourceChannel,
                                      ViInt32 bitPosition,
                                      ViString destination);

        ViStatus GetDataMarkerName(ViSession vi,
                                    ViInt32 index,
                                    ViInt32 nameBufferSize,
                                    StringBuilder name);

        ViStatus DisableAllDataMarkers(ViSession vi);

        /*- IviFgenSparseMarker Extension Group -*/
        ViStatus ConfigureSparseMarker(ViSession vi,
                                        ViString name,
                                        ViInt32 wfmHandle,
                                        ViInt64 numIndexes,
                                        ViInt64[] indexes,
                                        ViString destination);

        ViStatus GetSparseMarkerName(ViSession vi,
                                      ViInt32 index,
                                      ViInt32 nameBufferSize,
                                      StringBuilder name);

        ViStatus GetSparseMarkerIndexes(ViSession vi,
                                         ViString name,
                                         ViInt64 indexesArraySize,
                                         IntPtr indexes,
                                         ref ViInt64 indexesActualSize);

        ViStatus SetSparseMarkerIndexes(ViSession vi,
                                         ViString name,
                                         ViInt64 indexesArraySize,
                                         ViInt64[] indexes);

        ViStatus DisableAllSparseMarkers(ViSession vi);
    }
}


text:
"""
Python-Flask Model for the respective table in the db.
"""
from app import db
__author__ = "Michel Llorens"
__copyright__ = "Copyright 2016"
__license__ = "MIT"
__version__ = "1.0.0"
__email__ = "mllorens@dcc.uchile.cl"

class GoogleInformation(db.Model):
    __tablename__ = 'google_information'
    id = db.Column(db.Integer, db.ForeignKey('sample.id'), primary_key=True)
    city = db.Column(db.String(100))
    region = db.Column(db.String(100))
    country = db.Column(db.String(100))

    def __init__(self, _id, city, region, country):
        self.id = _id
        self.city = city
        self.region = region
        self.country = country


text:
namespace IdokladSdk.ApiFilters
{
    /// <summary>
    /// Custom filter for issued invoice
    /// </summary>
    public class IssuedInvoiceFilter : FilterableObjectBase
    {
        public FilterItem Id { get; set; } = new FilterItem("Id");
        public FilterItem ConstantSymbolId { get; set; } = new FilterItem("ConstantSymbolId");
        public FilterItem CurrencyId { get; set; } = new FilterItem("CurrencyId");
        public CompareFilterItem DateLastChanged { get; set; } = new CompareFilterItem("DateLastChange");
        public CompareFilterItem DateOfIssue { get; set; } = new CompareFilterItem("DateOfIssue");
        public CompareFilterItem DateOfPayment { get; set; } = new CompareFilterItem("DateOfPayment");
        public CompareFilterItem DateOfMaturity { get; set; } = new CompareFilterItem("DateOfMaturity");
        public FilterItem Exported { get; set; } = new FilterItem("Exported");
        public ContainFilterItem Description { get; set; } = new ContainFilterItem("Description");
        public FilterItem NumericSequenceId { get; set; } = new FilterItem("NumericSequenceId");
        public ContainFilterItem DocumentNumber { get; set; } = new ContainFilterItem("DocumentNumber");
        public FilterItem IsPaid { get; set; } = new FilterItem("IsPaid");
        public FilterItem PurchaserId { get; set; } = new FilterItem("PurchaserId");
    }
}


text:
package com.github.paolorotolo.appintroexample;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Toast;

import com.github.paolorotolo.appintro.AppIntro;
//import com.github.paolorotolo.appintro.AppIntro2;

public class DefaultIntro extends AppIntro {
    @Override
    public void init(Bundle savedInstanceState) {
        addSlide(SampleSlide.newInstance(R.layout.changejar_intro_1));
        addSlide(SampleSlide.newInstance(R.layout.changejar_intro_2));
        addSlide(SampleSlide.newInstance(R.layout.changejar_intro_3));
    }

    private void loadMainActivity(){
        Intent intent = new Intent(this, MainActivity.class);
        startActivity(intent);
    }

    @Override
    public void onNextPressed() {
    }

    @Override
    public void onSkipPressed() {
        loadMainActivity();
        Toast.makeText(getApplicationContext(),
                getString(R.string.skip), Toast.LENGTH_SHORT).show();
    }

    @Override
    public void onDonePressed() {
        loadMainActivity();
    }

    @Override
    public void onSlideChanged() {
    }

    public void getStarted(View v){
        loadMainActivity();
    }
}