text:
{-# OPTIONS -fglasgow-exts #-}
-----------------------------------------------------------------------------
{-| Module    : QMimeData_h.hs
    Copyright : (c) David Harley 2010
    Project   : qtHaskell
    Version   : 1.1.4
    Modified  : 2010-09-02 17:02:31

    Warning   : this file is machine generated - do not modify.
--}
-----------------------------------------------------------------------------

module Qtc.Core.QMimeData_h (
  QhasFormat_h(..)
  ) where

import Qtc.Enums.Base
import Qtc.Enums.Core.QVariant

import Qtc.Classes.Base
import Qtc.Classes.Qccs_h
import Qtc.Classes.Core_h
import Qtc.ClassTypes.Core
import Qth.ClassTypes.Core
import Foreign.Marshal.Array

instance QunSetUserMethod (QMimeData ()) where
 unSetUserMethod qobj evid
  = withBoolResult $
    withObjectPtr qobj $ \cobj_qobj ->
    qtc_QMimeData_unSetUserMethod cobj_qobj (toCInt 0) (toCInt evid)

foreign import ccall "qtc_QMimeData_unSetUserMethod" qtc_QMimeData_unSetUserMethod :: Ptr (TQMimeData a) -> CInt -> CInt -> IO (CBool)

instance QunSetUserMethod (QMimeDataSc a) where
 unSetUserMethod qobj evid
  = withBoolResult $
    withObjectPtr qobj $ \cobj_qobj ->
    qtc_QMimeData_unSetUserMethod cobj_qobj (toCInt 0) (toCInt evid)

instance QunSetUserMethodVariant (QMimeData ()) where
 unSetUserMethodVariant qobj evid
  = withBoolResult $
    withObjectPtr qobj $ \cobj_qobj ->
    qtc_QMimeData_unSetUserMethod cobj_qobj (toCInt 1) (toCInt evid)

instance QunSetUserMethodVariant (QMimeDataSc a) where
 unSetUserMethodVariant qobj evid
  = withBoolResult $
    withObjectPtr qobj $ \cobj_qobj ->
    qtc_QMimeData_unSetUserMethod cobj_qobj (toCInt 1) (toCInt evid)

instance QunSetUserMethodVariantList (QMimeData ()) where
 unSetUserMethodVariantList qobj evid
  = withBoolResult $
    withObjectPtr qobj $ \cobj_qobj ->
    qtc_QMimeData_unSetUserMethod cobj_qobj (toCInt 2) (toCInt evid)

instance QunSetUserMethodVariantList (QMimeDataSc a) where
 unSetUserMethodVariantList qobj evid
  = withBoolResult $
    withObjectPtr qobj $ \cobj_qobj ->
    qtc_QMimeData_unSetUserMethod cobj_qobj (toCInt 2) (toCInt evid)

instance QsetUserMethod (QMimeData ()) (QMimeData x0 -> IO ()) where
 setUserMethod _eobj _eid _handler
  = do
    funptr  <- wrapSetUserMethod_QMimeData setHandlerWrapper
    stptr   <- newStablePtr (Wrap _handler)
    funptr_d  <- wrapSetUserMethod_QMimeData_d setHandlerWrapper_d
    withObjectPtr _eobj $ \cobj_eobj ->
      qtc_QMimeData_setUserMethod cobj_eobj (toCInt _eid) (toCFunPtr funptr) (castStablePtrToPtr stptr) (toCFunPtr funptr_d)
    return ()
  where
    setHandlerWrapper :: Ptr (TQMimeData x0) -> IO ()
    setHandlerWrapper x0
      = do
        x0obj <- objectFromPtr_nf x0
        if (objectIsNull x0obj)
         then return ()
         else _handler x0obj

    setHandlerWrapper_d :: Ptr fun -> Ptr () -> Ptr fun_d -> IO ()
    setHandlerWrapper_d funptr stptr funptr_d
      = do when (stptr/=ptrNull)
            (freeStablePtr (castPtrToStablePtr stptr))
           when (funptr/=ptrNull)
            (freeHaskellFunPtr (castPtrToFunPtr funptr))
           when (funptr_d/=ptrNull)
            (freeHaskellFunPtr (castPtrToFunPtr funptr_d))
           return ()

foreign import ccall "qtc_QMimeData_setUserMethod" qtc_QMimeData_setUserMethod :: Ptr (TQMimeData a) -> CInt -> Ptr (Ptr (TQMimeData x0) -> IO ()) -> Ptr () -> Ptr (Ptr fun -> Ptr state -> Ptr fun_d -> IO ()) -> IO ()

foreign import ccall "wrapper" wrapSetUserMethod_QMimeData :: (Ptr (TQMimeData x0) -> IO ()) -> IO (FunPtr (Ptr (TQMimeData x0) -> IO ()))

foreign import ccall "wrapper" wrapSetUserMethod_QMimeData_d :: (Ptr fun -> Ptr state -> Ptr fun_d -> IO ()) -> IO (FunPtr (Ptr fun -> Ptr state -> Ptr fun_d -> IO ()))

instance QsetUserMethod (QMimeDataSc a) (QMimeData x0 -> IO ()) where
 setUserMethod _eobj _eid _handler
  = do
    funptr  <- wrapSetUserMethod_QMimeData setHandlerWrapper
    stptr   <- newStablePtr (Wrap _handler)
    funptr_d  <- wrapSetUserMethod_QMimeData_d setHandlerWrapper_d
    withObjectPtr _eobj $ \cobj_eobj ->
      qtc_QMimeData_setUserMethod cobj_eobj (toCInt _eid) (toCFunPtr funptr) (castStablePtrToPtr stptr) (toCFunPtr funptr_d)
    return ()
  where
    setHandlerWrapper :: Ptr (TQMimeData x0) -> IO ()
    setHandlerWrapper x0
      = do
        x0obj <- objectFromPtr_nf x0
        if (objectIsNull x0obj)
         then return ()
         else _handler x0obj

    setHandlerWrapper_d :: Ptr fun -> Ptr () -> Ptr fun_d -> IO ()
    setHandlerWrapper_d funptr stptr funptr_d
      = do when (stptr/=ptrNull)
            (freeStablePtr (castPtrToStablePtr stptr))
           when (funptr/=ptrNull)
            (freeHaskellFunPtr (castPtrToFunPtr funptr))
           when (funptr_d/=ptrNull)
            (freeHaskellFunPtr (castPtrToFunPtr funptr_d))
           return ()

instance QsetUserMethod (QMimeData ()) (QMimeData x0 -> QVariant () -> IO (QVariant ())) where
 setUserMethod _eobj _eid _handler
  = do
    funptr  <- wrapSetUserMethodVariant_QMimeData setHandlerWrapper
    stptr   <- newStablePtr (Wrap _handler)
    funptr_d  <- wrapSetUserMethodVariant_QMimeData_d setHandlerWrapper_d
    withObjectPtr _eobj $ \cobj_eobj ->
      qtc_QMimeData_setUserMethodVariant cobj_eobj (toCInt _eid) (toCFunPtr funptr) (castStablePtrToPtr stptr) (toCFunPtr funptr_d)
    return ()
  where
    setHandlerWrapper :: Ptr (TQMimeData x0) -> Ptr (TQVariant ()) -> IO (Ptr (TQVariant ()))
    setHandlerWrapper x0 x1
      = do
        x0obj <- objectFromPtr_nf x0
        x1obj <- objectFromPtr_nf x1
        rv <- if (objectIsNull x0obj)
               then return $ objectCast x0obj
               else _handler x0obj x1obj
        withObjectPtr rv $ \cobj_rv -> return cobj_rv

    setHandlerWrapper_d :: Ptr fun -> Ptr () -> Ptr fun_d -> IO ()
    setHandlerWrapper_d funptr stptr funptr_d
      = do when (stptr/=ptrNull)
            (freeStablePtr (castPtrToStablePtr stptr))
           when (funptr/=ptrNull)
            (freeHaskellFunPtr (castPtrToFunPtr funptr))
           when (funptr_d/=ptrNull)
            (freeHaskellFunPtr (castPtrToFunPtr funptr_d))
           return ()

foreign import ccall "qtc_QMimeData_setUserMethodVariant" qtc_QMimeData_setUserMethodVariant :: Ptr (TQMimeData a) -> CInt -> Ptr (Ptr (TQMimeData x0) -> Ptr (TQVariant ()) -> IO (Ptr (TQVariant ()))) -> Ptr () -> Ptr (Ptr fun -> Ptr state -> Ptr fun_d -> IO ()) -> IO ()

foreign import ccall "wrapper" wrapSetUserMethodVariant_QMimeData :: (Ptr (TQMimeData x0) -> Ptr (TQVariant ()) -> IO (Ptr (TQVariant ()))) -> IO (FunPtr (Ptr (TQMimeData x0) -> Ptr (TQVariant ()) -> IO (Ptr (TQVariant ()))))

foreign import ccall "wrapper" wrapSetUserMethodVariant_QMimeData_d :: (Ptr fun -> Ptr state -> Ptr fun_d -> IO ()) -> IO (FunPtr (Ptr fun -> Ptr state -> Ptr fun_d -> IO ()))

instance QsetUserMethod (QMimeDataSc a) (QMimeData x0 -> QVariant () -> IO (QVariant ())) where
 setUserMethod _eobj _eid _handler
  = do
    funptr  <- wrapSetUserMethodVariant_QMimeData setHandlerWrapper
    stptr   <- newStablePtr (Wrap _handler)
    funptr_d  <- wrapSetUserMethodVariant_QMimeData_d setHandlerWrapper_d
    withObjectPtr _eobj $ \cobj_eobj ->
      qtc_QMimeData_setUserMethodVariant cobj_eobj (toCInt _eid) (toCFunPtr funptr) (castStablePtrToPtr stptr) (toCFunPtr funptr_d)
    return ()
  where
    setHandlerWrapper :: Ptr (TQMimeData x0) -> Ptr (TQVariant ()) -> IO (Ptr (TQVariant ()))
    setHandlerWrapper x0 x1
      = do
        x0obj <- objectFromPtr_nf x0
        x1obj <- objectFromPtr_nf x1
        rv <- if (objectIsNull x0obj)
               then return $ objectCast x0obj
               else _handler x0obj x1obj
        withObjectPtr rv $ \cobj_rv -> return cobj_rv

    setHandlerWrapper_d :: Ptr fun -> Ptr () -> Ptr fun_d -> IO ()
    setHandlerWrapper_d funptr stptr funptr_d
      = do when (stptr/=ptrNull)
            (freeStablePtr (castPtrToStablePtr stptr))
           when (funptr/=ptrNull)
            (freeHaskellFunPtr (castPtrToFunPtr funptr))
           when (funptr_d/=ptrNull)
            (freeHaskellFunPtr (castPtrToFunPtr funptr_d))
           return ()

instance QunSetHandler (QMimeData ()) where
 unSetHandler qobj evid
  = withBoolResult $
    withObjectPtr qobj $ \cobj_qobj ->
    withCWString evid $ \cstr_evid ->
    qtc_QMimeData_unSetHandler cobj_qobj cstr_evid

foreign import ccall "qtc_QMimeData_unSetHandler" qtc_QMimeData_unSetHandler :: Ptr (TQMimeData a) -> CWString -> IO (CBool)

instance QunSetHandler (QMimeDataSc a) where
 unSetHandler qobj evid
  = withBoolResult $
    withObjectPtr qobj $ \cobj_qobj ->
    withCWString evid $ \cstr_evid ->
    qtc_QMimeData_unSetHandler cobj_qobj cstr_evid

instance QsetHandler (QMimeData ()) (QMimeData x0 -> String -> IO (Bool)) where
 setHandler _eobj _eid _handler
  = do
    funptr  <- wrapSetHandler_QMimeData1 setHandlerWrapper
    stptr   <- newStablePtr (Wrap _handler)
    funptr_d  <- wrapSetHandler_QMimeData1_d setHandlerWrapper_d
    withObjectPtr _eobj $ \cobj_eobj ->
      withCWString _eid $ \cstr_eid ->
      qtc_QMimeData_setHandler1 cobj_eobj cstr_eid (toCFunPtr funptr) (castStablePtrToPtr stptr) (toCFunPtr funptr_d)
    return()
  where
    setHandlerWrapper :: Ptr (TQMimeData x0) -> Ptr (TQString ()) -> IO (CBool)
    setHandlerWrapper x0 x1
      = do x0obj <- qMimeDataFromPtr x0
           x1str <- stringFromPtr x1
           let rv =
                if (objectIsNull x0obj)
                 then return False
                 else _handler x0obj x1str
           rvf <- rv
           return (toCBool rvf)

    setHandlerWrapper_d :: Ptr fun -> Ptr () -> Ptr fun_d -> IO ()
    setHandlerWrapper_d funptr stptr funptr_d
      = do when (stptr/=ptrNull)
            (freeStablePtr (castPtrToStablePtr stptr))
           when (funptr/=ptrNull)
            (freeHaskellFunPtr (castPtrToFunPtr funptr))
           when (funptr_d/=ptrNull)
            (freeHaskellFunPtr (castPtrToFunPtr funptr_d))
           return ()

foreign import ccall "qtc_QMimeData_setHandler1" qtc_QMimeData_setHandler1 :: Ptr (TQMimeData a) -> CWString -> Ptr (Ptr (TQMimeData x0) -> Ptr (TQString ()) -> IO (CBool)) -> Ptr () -> Ptr (Ptr fun -> Ptr state -> Ptr fun_d -> IO ()) -> IO ()

foreign import ccall "wrapper" wrapSetHandler_QMimeData1 :: (Ptr (TQMimeData x0) -> Ptr (TQString ()) -> IO (CBool)) -> IO (FunPtr (Ptr (TQMimeData x0) -> Ptr (TQString ()) -> IO (CBool)))

foreign import ccall "wrapper" wrapSetHandler_QMimeData1_d :: (Ptr fun -> Ptr state -> Ptr fun_d -> IO ()) -> IO (FunPtr (Ptr fun -> Ptr state -> Ptr fun_d -> IO ()))

instance QsetHandler (QMimeDataSc a) (QMimeData x0 -> String -> IO (Bool)) where
 setHandler _eobj _eid _handler
  = do
    funptr  <- wrapSetHandler_QMimeData1 setHandlerWrapper
    stptr   <- newStablePtr (Wrap _handler)
    funptr_d  <- wrapSetHandler_QMimeData1_d setHandlerWrapper_d
    withObjectPtr _eobj $ \cobj_eobj ->
      withCWString _eid $ \cstr_eid ->
      qtc_QMimeData_setHandler1 cobj_eobj cstr_eid (toCFunPtr funptr) (castStablePtrToPtr stptr) (toCFunPtr funptr_d)
    return()
  where
    setHandlerWrapper :: Ptr (TQMimeData x0) -> Ptr (TQString ()) -> IO (CBool)
    setHandlerWrapper x0 x1
      = do x0obj <- qMimeDataFromPtr x0
           x1str <- stringFromPtr x1
           let rv =
                if (objectIsNull x0obj)
                 then return False
                 else _handler x0obj x1str
           rvf <- rv
           return (toCBool rvf)

    setHandlerWrapper_d :: Ptr fun -> Ptr () -> Ptr fun_d -> IO ()
    setHandlerWrapper_d funptr stptr funptr_d
      = do when (stptr/=ptrNull)
            (freeStablePtr (castPtrToStablePtr stptr))
           when (funptr/=ptrNull)
            (freeHaskellFunPtr (castPtrToFunPtr funptr))
           when (funptr_d/=ptrNull)
            (freeHaskellFunPtr (castPtrToFunPtr funptr_d))
           return ()

class QhasFormat_h x0 x1 where
 hasFormat_h :: x0 -> x1 -> IO (Bool)

instance QhasFormat_h (QMimeData ()) ((String)) where
 hasFormat_h x0 (x1)
  = withBoolResult $
    withObjectPtr x0 $ \cobj_x0 ->
    withCWString x1 $ \cstr_x1 ->
    qtc_QMimeData_hasFormat cobj_x0 cstr_x1

foreign import ccall "qtc_QMimeData_hasFormat" qtc_QMimeData_hasFormat :: Ptr (TQMimeData a) -> CWString -> IO CBool

instance QhasFormat_h (QMimeDataSc a) ((String)) where
 hasFormat_h x0 (x1)
  = withBoolResult $
    withObjectPtr x0 $ \cobj_x0 ->
    withCWString x1 $ \cstr_x1 ->
    qtc_QMimeData_hasFormat cobj_x0 cstr_x1

instance QsetHandler (QMimeData ()) (QMimeData x0 -> QEvent t1 -> IO (Bool)) where
 setHandler _eobj _eid _handler
  = do
    funptr  <- wrapSetHandler_QMimeData2 setHandlerWrapper
    stptr   <- newStablePtr (Wrap _handler)
    funptr_d  <- wrapSetHandler_QMimeData2_d setHandlerWrapper_d
    withObjectPtr _eobj $ \cobj_eobj ->
      withCWString _eid $ \cstr_eid ->
      qtc_QMimeData_setHandler2 cobj_eobj cstr_eid (toCFunPtr funptr) (castStablePtrToPtr stptr) (toCFunPtr funptr_d)
    return()
  where
    setHandlerWrapper :: Ptr (TQMimeData x0) -> Ptr (TQEvent t1) -> IO (CBool)
    setHandlerWrapper x0 x1
      = do x0obj <- qMimeDataFromPtr x0
           x1obj <- objectFromPtr_nf x1
           let rv =
                if (objectIsNull x0obj)
                 then return False
                 else _handler x0obj x1obj
           rvf <- rv
           return (toCBool rvf)

    setHandlerWrapper_d :: Ptr fun -> Ptr () -> Ptr fun_d -> IO ()
    setHandlerWrapper_d funptr stptr funptr_d
      = do when (stptr/=ptrNull)
            (freeStablePtr (castPtrToStablePtr stptr))
           when (funptr/=ptrNull)
            (freeHaskellFunPtr (castPtrToFunPtr funptr))
           when (funptr_d/=ptrNull)
            (freeHaskellFunPtr (castPtrToFunPtr funptr_d))
           return ()

foreign import ccall "qtc_QMimeData_setHandler2" qtc_QMimeData_setHandler2 :: Ptr (TQMimeData a) -> CWString -> Ptr (Ptr (TQMimeData x0) -> Ptr (TQEvent t1) -> IO (CBool)) -> Ptr () -> Ptr (Ptr fun -> Ptr state -> Ptr fun_d -> IO ()) -> IO ()

foreign import ccall "wrapper" wrapSetHandler_QMimeData2 :: (Ptr (TQMimeData x0) -> Ptr (TQEvent t1) -> IO (CBool)) -> IO (FunPtr (Ptr (TQMimeData x0) -> Ptr (TQEvent t1) -> IO (CBool)))

foreign import ccall "wrapper" wrapSetHandler_QMimeData2_d :: (Ptr fun -> Ptr state -> Ptr fun_d -> IO ()) -> IO (FunPtr (Ptr fun -> Ptr state -> Ptr fun_d -> IO ()))

instance QsetHandler (QMimeDataSc a) (QMimeData x0 -> QEvent t1 -> IO (Bool)) where
 setHandler _eobj _eid _handler
  = do
    funptr  <- wrapSetHandler_QMimeData2 setHandlerWrapper
    stptr   <- newStablePtr (Wrap _handler)
    funptr_d  <- wrapSetHandler_QMimeData2_d setHandlerWrapper_d
    withObjectPtr _eobj $ \cobj_eobj ->
      withCWString _eid $ \cstr_eid ->
      qtc_QMimeData_setHandler2 cobj_eobj cstr_eid (toCFunPtr funptr) (castStablePtrToPtr stptr) (toCFunPtr funptr_d)
    return()
  where
    setHandlerWrapper :: Ptr (TQMimeData x0) -> Ptr (TQEvent t1) -> IO (CBool)
    setHandlerWrapper x0 x1
      = do x0obj <- qMimeDataFromPtr x0
           x1obj <- objectFromPtr_nf x1
           let rv =
                if (objectIsNull x0obj)
                 then return False
                 else _handler x0obj x1obj
           rvf <- rv
           return (toCBool rvf)

    setHandlerWrapper_d :: Ptr fun -> Ptr () -> Ptr fun_d -> IO ()
    setHandlerWrapper_d funptr stptr funptr_d
      = do when (stptr/=ptrNull)
            (freeStablePtr (castPtrToStablePtr stptr))
           when (funptr/=ptrNull)
            (freeHaskellFunPtr (castPtrToFunPtr funptr))
           when (funptr_d/=ptrNull)
            (freeHaskellFunPtr (castPtrToFunPtr funptr_d))
           return ()

instance Qevent_h (QMimeData ()) ((QEvent t1)) where
 event_h x0 (x1)
  = withBoolResult $
    withObjectPtr x0 $ \cobj_x0 ->
    withObjectPtr x1 $ \cobj_x1 ->
    qtc_QMimeData_event cobj_x0 cobj_x1

foreign import ccall "qtc_QMimeData_event" qtc_QMimeData_event :: Ptr (TQMimeData a) -> Ptr (TQEvent t1) -> IO CBool

instance Qevent_h (QMimeDataSc a) ((QEvent t1)) where
 event_h x0 (x1)
  = withBoolResult $
    withObjectPtr x0 $ \cobj_x0 ->
    withObjectPtr x1 $ \cobj_x1 ->
    qtc_QMimeData_event cobj_x0 cobj_x1

instance QsetHandler (QMimeData ()) (QMimeData x0 -> QObject t1 -> QEvent t2 -> IO (Bool)) where
 setHandler _eobj _eid _handler
  = do
    funptr  <- wrapSetHandler_QMimeData3 setHandlerWrapper
    stptr   <- newStablePtr (Wrap _handler)
    funptr_d  <- wrapSetHandler_QMimeData3_d setHandlerWrapper_d
    withObjectPtr _eobj $ \cobj_eobj ->
      withCWString _eid $ \cstr_eid ->
      qtc_QMimeData_setHandler3 cobj_eobj cstr_eid (toCFunPtr funptr) (castStablePtrToPtr stptr) (toCFunPtr funptr_d)
    return()
  where
    setHandlerWrapper :: Ptr (TQMimeData x0) -> Ptr (TQObject t1) -> Ptr (TQEvent t2) -> IO (CBool)
    setHandlerWrapper x0 x1 x2
      = do x0obj <- qMimeDataFromPtr x0
           x1obj <- qObjectFromPtr x1
           x2obj <- objectFromPtr_nf x2
           let rv =
                if (objectIsNull x0obj)
                 then return False
                 else _handler x0obj x1obj x2obj
           rvf <- rv
           return (toCBool rvf)

    setHandlerWrapper_d :: Ptr fun -> Ptr () -> Ptr fun_d -> IO ()
    setHandlerWrapper_d funptr stptr funptr_d
      = do when (stptr/=ptrNull)
            (freeStablePtr (castPtrToStablePtr stptr))
           when (funptr/=ptrNull)
            (freeHaskellFunPtr (castPtrToFunPtr funptr))
           when (funptr_d/=ptrNull)
            (freeHaskellFunPtr (castPtrToFunPtr funptr_d))
           return ()

foreign import ccall "qtc_QMimeData_setHandler3" qtc_QMimeData_setHandler3 :: Ptr (TQMimeData a) -> CWString -> Ptr (Ptr (TQMimeData x0) -> Ptr (TQObject t1) -> Ptr (TQEvent t2) -> IO (CBool)) -> Ptr () -> Ptr (Ptr fun -> Ptr state -> Ptr fun_d -> IO ()) -> IO ()

foreign import ccall "wrapper" wrapSetHandler_QMimeData3 :: (Ptr (TQMimeData x0) -> Ptr (TQObject t1) -> Ptr (TQEvent t2) -> IO (CBool)) -> IO (FunPtr (Ptr (TQMimeData x0) -> Ptr (TQObject t1) -> Ptr (TQEvent t2) -> IO (CBool)))

foreign import ccall "wrapper" wrapSetHandler_QMimeData3_d :: (Ptr fun -> Ptr state -> Ptr fun_d -> IO ()) -> IO (FunPtr (Ptr fun -> Ptr state -> Ptr fun_d -> IO ()))

instance QsetHandler (QMimeDataSc a) (QMimeData x0 -> QObject t1 -> QEvent t2 -> IO (Bool)) where
 setHandler _eobj _eid _handler
  = do
    funptr  <- wrapSetHandler_QMimeData3 setHandlerWrapper
    stptr   <- newStablePtr (Wrap _handler)
    funptr_d  <- wrapSetHandler_QMimeData3_d setHandlerWrapper_d
    withObjectPtr _eobj $ \cobj_eobj ->
      withCWString _eid $ \cstr_eid ->
      qtc_QMimeData_setHandler3 cobj_eobj cstr_eid (toCFunPtr funptr) (castStablePtrToPtr stptr) (toCFunPtr funptr_d)
    return()
  where
    setHandlerWrapper :: Ptr (TQMimeData x0) -> Ptr (TQObject t1) -> Ptr (TQEvent t2) -> IO (CBool)
    setHandlerWrapper x0 x1 x2
      = do x0obj <- qMimeDataFromPtr x0
           x1obj <- qObjectFromPtr x1
           x2obj <- objectFromPtr_nf x2
           let rv =
                if (objectIsNull x0obj)
                 then return False
                 else _handler x0obj x1obj x2obj
           rvf <- rv
           return (toCBool rvf)

    setHandlerWrapper_d :: Ptr fun -> Ptr () -> Ptr fun_d -> IO ()
    setHandlerWrapper_d funptr stptr funptr_d
      = do when (stptr/=ptrNull)
            (freeStablePtr (castPtrToStablePtr stptr))
           when (funptr/=ptrNull)
            (freeHaskellFunPtr (castPtrToFunPtr funptr))
           when (funptr_d/=ptrNull)
            (freeHaskellFunPtr (castPtrToFunPtr funptr_d))
           return ()

instance QeventFilter_h (QMimeData ()) ((QObject t1, QEvent t2)) where
 eventFilter_h x0 (x1, x2)
  = withBoolResult $
    withObjectPtr x0 $ \cobj_x0 ->
    withObjectPtr x1 $ \cobj_x1 ->
    withObjectPtr x2 $ \cobj_x2 ->
    qtc_QMimeData_eventFilter cobj_x0 cobj_x1 cobj_x2

foreign import ccall "qtc_QMimeData_eventFilter" qtc_QMimeData_eventFilter :: Ptr (TQMimeData a) -> Ptr (TQObject t1) -> Ptr (TQEvent t2) -> IO CBool

instance QeventFilter_h (QMimeDataSc a) ((QObject t1, QEvent t2)) where
 eventFilter_h x0 (x1, x2)
  = withBoolResult $
    withObjectPtr x0 $ \cobj_x0 ->
    withObjectPtr x1 $ \cobj_x1 ->
    withObjectPtr x2 $ \cobj_x2 ->
    qtc_QMimeData_eventFilter cobj_x0 cobj_x1 cobj_x2


text:
package casbin

import (
	"github.com/casbin/casbin/util"
	"log"
	"testing"
)

func testGetRoles(t *testing.T, e *Enforcer, name string, res []string) {
	myRes := e.GetRolesForUser(name)
	log.Print("Roles for ", name, ": ", myRes)

	if !util.SetEquals(res, myRes) {
		t.Error("Roles for ", name, ": ", myRes, ", supposed to be ", res)
	}
}

func TestRoleAPI(t *testing.T) {
	e := NewEnforcer("examples/rbac_model.conf", "examples/rbac_policy.csv")

	testGetRoles(t, e, "alice", []string{"data2_admin"})
	testGetRoles(t, e, "bob", []string{})
	testGetRoles(t, e, "data2_admin", []string{})
	testGetRoles(t, e, "non_exist", []string{})

	e.AddRoleForUser("alice", "data1_admin")

	testGetRoles(t, e, "alice", []string{"data1_admin", "data2_admin"})
	testGetRoles(t, e, "bob", []string{})
	testGetRoles(t, e, "data2_admin", []string{})

	e.DeleteRolesForUser("alice")

	testGetRoles(t, e, "alice", []string{})
	testGetRoles(t, e, "bob", []string{})
	testGetRoles(t, e, "data2_admin", []string{})

	e.AddRoleForUser("alice", "data1_admin")
	e.DeleteUser("alice")

	testGetRoles(t, e, "alice", []string{})
	testGetRoles(t, e, "bob", []string{})
	testGetRoles(t, e, "data2_admin", []string{})

	e.AddRoleForUser("alice", "data2_admin")

	testEnforce(t, e, "alice", "data1", "read", true)
	testEnforce(t, e, "alice", "data1", "write", false)
	testEnforce(t, e, "alice", "data2", "read", true)
	testEnforce(t, e, "alice", "data2", "write", true)
	testEnforce(t, e, "bob", "data1", "read", false)
	testEnforce(t, e, "bob", "data1", "write", false)
	testEnforce(t, e, "bob", "data2", "read", false)
	testEnforce(t, e, "bob", "data2", "write", true)

	e.DeleteRole("data2_admin")

	testEnforce(t, e, "alice", "data1", "read", true)
	testEnforce(t, e, "alice", "data1", "write", false)
	testEnforce(t, e, "alice", "data2", "read", false)
	testEnforce(t, e, "alice", "data2", "write", false)
	testEnforce(t, e, "bob", "data1", "read", false)
	testEnforce(t, e, "bob", "data1", "write", false)
	testEnforce(t, e, "bob", "data2", "read", false)
	testEnforce(t, e, "bob", "data2", "write", true)
}

func testGetPermissions(t *testing.T, e *Enforcer, name string, res []string) {
	myRes := e.GetPermissionsForUser(name)
	log.Print("Permissions for ", name, ": ", myRes)

	if !util.SetEquals(res, myRes) {
		t.Error("Permissions for ", name, ": ", myRes, ", supposed to be ", res)
	}
}

func TestPermissionAPI(t *testing.T) {
	e := NewEnforcer("examples/basic_model_without_resources.conf", "examples/basic_policy_without_resources.csv")

	testEnforceWithoutUsers(t, e, "alice", "read", true)
	testEnforceWithoutUsers(t, e, "alice", "write", false)
	testEnforceWithoutUsers(t, e, "bob", "read", false)
	testEnforceWithoutUsers(t, e, "bob", "write", true)

	testGetPermissions(t, e, "alice", []string{"read"})
	testGetPermissions(t, e, "bob", []string{"write"})

	e.DeletePermission("read")

	testEnforceWithoutUsers(t, e, "alice", "read", false)
	testEnforceWithoutUsers(t, e, "alice", "write", false)
	testEnforceWithoutUsers(t, e, "bob", "read", false)
	testEnforceWithoutUsers(t, e, "bob", "write", true)

	e.AddPermissionForUser("bob", "read")

	testEnforceWithoutUsers(t, e, "alice", "read", false)
	testEnforceWithoutUsers(t, e, "alice", "write", false)
	testEnforceWithoutUsers(t, e, "bob", "read", true)
	testEnforceWithoutUsers(t, e, "bob", "write", true)

	e.DeletePermissionsForUser("bob")

	testEnforceWithoutUsers(t, e, "alice", "read", false)
	testEnforceWithoutUsers(t, e, "alice", "write", false)
	testEnforceWithoutUsers(t, e, "bob", "read", false)
	testEnforceWithoutUsers(t, e, "bob", "write", false)
}

redpajama_set_name: RedPajamaGithub


text:
"""
Net of the generator of DCGAN

Adopted from:
https://github.com/tqchen/mxnet-gan/blob/master/mxgan/generator.py

Reference:
Radford, Alec, Luke Metz, and Soumith Chintala.
"Unsupervised representation learning with deep convolutional generative adversarial networks."
arXiv preprint arXiv:1511.06434 (2015).
"""
from tvm import relay
from . import layers
from .init import create_workload

def deconv2d(data, ishape, oshape, kshape, name, stride=(2, 2)):
    """a deconv layer that enlarges the feature map"""
    target_shape = (oshape[-2], oshape[-1])

    pad_y = (kshape[0] - 1) // 2
    pad_x = (kshape[1] - 1) // 2
    adj_y = (target_shape[0] + 2 * pad_y - kshape[0]) % stride[0]
    adj_x = (target_shape[1] + 2 * pad_x - kshape[1]) % stride[1]

    net = layers.conv2d_transpose(data,
                                  kernel_size=kshape,
                                  strides=stride,
                                  channels=oshape[0],
                                  padding=(pad_y, pad_x),
                                  output_padding=(adj_y, adj_x),
                                  name=name)
    return net

def deconv2d_bn_relu(data, prefix, **kwargs):
    """a block of deconv + batch norm + relu"""
    eps = 1e-5 + 1e-12
    net = deconv2d(data, name="%s_deconv" % prefix, **kwargs)
    net = layers.batch_norm_infer(net, epsilon=eps, name="%s_batch_norm" % prefix)
    net = relay.nn.relu(net)
    return net

def get_net(batch_size, random_len=100, oshape=(3, 64, 64), ngf=128, code=None, dtype="float32"):
    """get net of dcgan generator"""
    assert oshape[-1] == 64, "Only support 64x64 image"
    assert oshape[-2] == 64, "Only support 64x64 image"

    code = relay.var("data", dtype=dtype, shape=(batch_size, random_len)) if code is None else code
    dense_weight = relay.var("dense_weight")
    dense = relay.nn.dense(code, weight=dense_weight, units=4*4*ngf*8)
    relu = relay.nn.relu(dense)
    # 4 x 4
    reshape = relay.reshape(relu, newshape=(-1, ngf * 8, 4, 4))
    # 8 x 8
    dc8 = deconv2d_bn_relu(
        reshape, ishape=(ngf * 8, 4, 4), oshape=(ngf * 4, 8, 8), kshape=(4, 4), prefix="g2")
    # 16x16
    dc16 = deconv2d_bn_relu(
        dc8, ishape=(ngf * 4, 8, 8), oshape=(ngf * 2, 16, 16), kshape=(4, 4), prefix="g3")
    # 32x32
    dc32 = deconv2d_bn_relu(
        dc16, ishape=(ngf * 2, 16, 16), oshape=(ngf, 32, 32), kshape=(4, 4), prefix="g4")
    # 64x64
    dc64 = deconv2d(
        dc32, ishape=(ngf, 32, 32), oshape=oshape[-3:], kshape=(4, 4), name="g5_deconv")
    tanh = relay.tanh(dc64)

    args = relay.analysis.free_vars(tanh)
    return relay.Function(args, tanh)

def get_workload(batch_size, oshape=(3, 64, 64), ngf=128, random_len=100, dtype="float32"):
    """Get benchmark workload for a DCGAN generator

    Parameters
    ----------
    batch_size : int
        The batch size used in the model
    oshape : tuple, optional
        The shape of output image, layout="CHW"
    ngf: int, optional
        The number of final feature maps in the generator
    random_len : int, optional
        The length of random input
    dtype : str, optional
        The data type

    Returns
    -------
    mod : tvm.relay.Module
        The relay module that contains a DCGAN network.
    params : dict of str to NDArray
        The parameters.
    """
    net = get_net(batch_size, random_len, oshape=oshape, ngf=ngf, dtype=dtype)
    return create_workload(net)


text:
package org.apache.geronimo.console.databasemanager.wizard;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import org.apache.geronimo.converter.DatabaseConversionStatus;
import org.apache.geronimo.converter.AbstractDatabasePool;
import org.apache.geronimo.converter.JDBCPool;
import org.apache.geronimo.converter.XADatabasePool;

/**
 * Tracks the progress of a database pool import operation.
 *
 * @version $Rev$ $Date$
 */
public class ImportStatus implements Serializable {
    private DatabaseConversionStatus original;
    private int currentPool = -1;
    private PoolProgress[] pools;

    public ImportStatus(DatabaseConversionStatus original) {
        this.original = original;
        List list = new ArrayList();
        for (int i = 0; i < original.getNoTXPools().length; i++) {
            JDBCPool pool = original.getNoTXPools()[i];
            list.add(new PoolProgress(pool, PoolProgress.TYPE_NOTX));
        }
        for (int i = 0; i < original.getJdbcPools().length; i++) {
            JDBCPool pool = original.getJdbcPools()[i];
            list.add(new PoolProgress(pool, PoolProgress.TYPE_LOCAL));
        }
        for (int i = 0; i < original.getXaPools().length; i++) {
            XADatabasePool pool = original.getXaPools()[i];
            final PoolProgress progress = new PoolProgress(pool, PoolProgress.TYPE_XA);
            if(pool.getXaDataSourceClass().indexOf("apache.derby") < 0) {
                progress.setSkipped(true);
            }
            list.add(progress);
        }
        pools = (PoolProgress[]) list.toArray(new PoolProgress[list.size()]);
    }

    public boolean isFinished() {
        for (int i = 0; i < pools.length; i++) {
            PoolProgress pool = pools[i];
            if(!pool.isFinished() && !pool.isSkipped()) {
                return false;
            }
        }
        return true;
    }

    public void setCurrentPoolIndex(int currentPool) {
        this.currentPool = currentPool;
        getCurrentPool().setStarted(true);
    }

    public DatabaseConversionStatus getOriginal() {
        return original;
    }

    public int getCurrentPoolIndex() {
        return currentPool;
    }

    public PoolProgress getCurrentPool() {
        return currentPool > -1 ? pools[currentPool] : null;
    }

    public PoolProgress[] getPools() {
        return pools;
    }

    public int getPendingCount() {
        int count = 0;
        for (int i = 0; i < pools.length; i++) {
            PoolProgress pool = pools[i];
            if(!pool.isSkipped() && !pool.isStarted()) {
                ++count;
            }
        }
        return count;
    }

    public int getStartedCount() {
        int count = 0;
        for (int i = 0; i < pools.length; i++) {
            PoolProgress pool = pools[i];
            if(pool.isStarted() && !pool.isFinished() && !pool.isSkipped()) {
                ++count;
            }
        }
        return count;
    }

    public int getFinishedCount() {
        int count = 0;
        for (int i = 0; i < pools.length; i++) {
            PoolProgress pool = pools[i];
            if(!pool.isSkipped() && pool.isFinished()) {
                ++count;
            }
        }
        return count;
    }

    public int getSkippedCount() {
        int count = 0;
        for (int i = 0; i < pools.length; i++) {
            PoolProgress pool = pools[i];
            if(pool.isSkipped()) {
                ++count;
            }
        }
        return count;
    }

    public final static class PoolProgress implements Serializable {
        public final static String TYPE_NOTX = "NoTX";
        public final static String TYPE_LOCAL = "JDBC";
        public final static String TYPE_XA = "XA";

        private AbstractDatabasePool pool;
        private boolean started;
        private boolean finished;
        private boolean skipped;
        private String type;
        private String name; // Once in Geronimo
        private String configurationName; // Once in Geronimo

        public PoolProgress(AbstractDatabasePool pool, String type) {
            this.pool = pool;
            this.type = type;
        }

        public AbstractDatabasePool getPool() {
            return pool;
        }

        public boolean isStarted() {
            return started;
        }

        public void setStarted(boolean started) {
            this.started = started;
        }

        public boolean isFinished() {
            return finished;
        }

        public void setFinished(boolean finished) {
            this.finished = finished;
        }

        public boolean isSkipped() {
            return skipped;
        }

        public void setSkipped(boolean skipped) {
            this.skipped = skipped;
        }

        public String getType() {
            return type;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public String getConfigurationName() {
            return configurationName;
        }

        public void setConfigurationName(String configurationName) {
            this.configurationName = configurationName;
        }

        public String getStatus() {
            return isSkipped() ? "Ignored" : isFinished() ? "Deployed as "+name : isStarted() ? "Started" : "Pending";
        }
    }
}


text:
<Conformance xmlns="http://hl7.org/fhir">
  <extension url="http://hl7.org/fhir/Profile/tools-extensions#supported-system">
    <valueUri value="http://snomed.info/sct"/>
  </extension>
  <text>
    <status value="generated"/>

  </text>
  <publisher value="Health Intersections"/>
  <date value="2014-03-12T01:00:56Z"/>
  <software>
    <name value="Reference Server"/>
    <version value="0.80-2286"/>
    <releaseDate value="2013-11-03"/>
  </software>
  <fhirVersion value="0.80-2286"/>
  <format value="application/xml+fhir"/>
  <format value="application/json+fhir"/>
  <rest>
    <mode value="server"/>
    <resource>
      <type value="AdverseReaction"/>
      <profile>
        <reference value="http://fhir.healthintersections.com.au/open/Profile/adversereaction"/>
      </profile>
      <operation>

      </operation>
      <operation>

      </operation>
      <operation>

      </operation>
      <operation>

      </operation>
      <operation>

      </operation>
      <operation>

      </operation>
      <operation>

      </operation>
      <operation>

      </operation>
      <readHistory value="true"/>
    </resource>
    <resource>
      <type value="Alert"/>
      <profile>
        <reference value="http://fhir.healthintersections.com.au/open/Profile/alert"/>
      </profile>
      <operation>

      </operation>
      <operation>

      </operation>
      <operation>

      </operation>
      <operation>

      </operation>
      <operation>

      </operation>
      <operation>

      </operation>
      <operation>

      </operation>
      <operation>

      </operation>
      <readHistory value="true"/>
    </resource>
  </rest>
</Conformance>


text:
@class Alarm;

@interface AlarmScheduler : NSObject

+ (void)initialize;
+ (void)deinitialize;

// Saving alarm info to user defaults
+ (void)savePrefs;

// Getting alarms
+ (Alarm *)alarmReferenceForIndex:(int)index;
+ (Alarm *)alarmCloneForIndex:(int)index;

// Changing alarms
+ (void)setAlarm:(Alarm *)clone forReference:(Alarm *)reference;
+ (void)addAlarm:(Alarm *)newAlarm;
+ (void)removeAlarm:(Alarm *)deletedAlarm;

// Updating alarms
+ (void)updateAllAlarms;

// Getting number of alarms
+ (NSUInteger)numberOfAlarms;

// Getting info about next and last alarm
+ (Alarm *)lastAlarmClone;
+ (NSDate *)nextAlarmDate;

// Querying for sounding alarms
+ (int)alarmStatus:(NSDate *)now;

@end


text:
package eu.bcvsolutions.idm.core.model.repository.eav;

import eu.bcvsolutions.idm.core.eav.repository.AbstractFormValueRepository;
import eu.bcvsolutions.idm.core.model.entity.IdmConceptRoleRequest;
import eu.bcvsolutions.idm.core.model.entity.eav.IdmConceptRoleRequestFormValue;

/**
 * Extended attributes for concept role request
 *
 * @author Vít Švanda
 *
 */
public interface IdmConceptRoleRequestFormValueRepository extends AbstractFormValueRepository<IdmConceptRoleRequest, IdmConceptRoleRequestFormValue> {

}


text:
/**
 * AdCustomizerFeedAttribute.java
 *
 * This file was auto-generated from WSDL
 * by the Apache Axis 1.4 Mar 02, 2009 (07:08:06 PST) WSDL2Java emitter.
 */

package com.google.api.ads.adwords.axis.v201601.cm;

/**
 * An attribute of an AdCustomizerFeed.
 */
public class AdCustomizerFeedAttribute  implements java.io.Serializable {
    /* The ID of the attribute. */
    private java.lang.Long id;

    /* The name of the attribute.
     *                 This field is required
     * and should not be {@code null} when it is contained within {@link
     * Operator}s : ADD, SET.
     *                 The length of
     * this string should be between 1 and 30, inclusive, (trimmed). */
    private java.lang.String name;

    /* The type of data this attribute contains.
     *                 This field is required
     * and should not be {@code null} when it is contained within {@link
     * Operator}s : ADD, SET. */
    private com.google.api.ads.adwords.axis.v201601.cm.AdCustomizerFeedAttributeType type;

    public AdCustomizerFeedAttribute() {
    }

    public AdCustomizerFeedAttribute(
           java.lang.Long id,
           java.lang.String name,
           com.google.api.ads.adwords.axis.v201601.cm.AdCustomizerFeedAttributeType type) {
           this.id = id;
           this.name = name;
           this.type = type;
    }

    /**
     * Gets the id value for this AdCustomizerFeedAttribute.
     *
     * @return id   * The ID of the attribute.
     */
    public java.lang.Long getId() {
        return id;
    }

    /**
     * Sets the id value for this AdCustomizerFeedAttribute.
     *
     * @param id   * The ID of the attribute.
     */
    public void setId(java.lang.Long id) {
        this.id = id;
    }

    /**
     * Gets the name value for this AdCustomizerFeedAttribute.
     *
     * @return name   * The name of the attribute.
     *                 This field is required
     * and should not be {@code null} when it is contained within {@link
     * Operator}s : ADD, SET.
     *                 The length of
     * this string should be between 1 and 30, inclusive, (trimmed).
     */
    public java.lang.String getName() {
        return name;
    }

    /**
     * Sets the name value for this AdCustomizerFeedAttribute.
     *
     * @param name   * The name of the attribute.
     *                 This field is required
     * and should not be {@code null} when it is contained within {@link
     * Operator}s : ADD, SET.
     *                 The length of
     * this string should be between 1 and 30, inclusive, (trimmed).
     */
    public void setName(java.lang.String name) {
        this.name = name;
    }

    /**
     * Gets the type value for this AdCustomizerFeedAttribute.
     *
     * @return type   * The type of data this attribute contains.
     *                 This field is required
     * and should not be {@code null} when it is contained within {@link
     * Operator}s : ADD, SET.
     */
    public com.google.api.ads.adwords.axis.v201601.cm.AdCustomizerFeedAttributeType getType() {
        return type;
    }

    /**
     * Sets the type value for this AdCustomizerFeedAttribute.
     *
     * @param type   * The type of data this attribute contains.
     *                 This field is required
     * and should not be {@code null} when it is contained within {@link
     * Operator}s : ADD, SET.
     */
    public void setType(com.google.api.ads.adwords.axis.v201601.cm.AdCustomizerFeedAttributeType type) {
        this.type = type;
    }

    private java.lang.Object __equalsCalc = null;
    public synchronized boolean equals(java.lang.Object obj) {
        if (!(obj instanceof AdCustomizerFeedAttribute)) return false;
        AdCustomizerFeedAttribute other = (AdCustomizerFeedAttribute) obj;
        if (obj == null) return false;
        if (this == obj) return true;
        if (__equalsCalc != null) {
            return (__equalsCalc == obj);
        }
        __equalsCalc = obj;
        boolean _equals;
        _equals = true &&
            ((this.id==null && other.getId()==null) ||
             (this.id!=null &&
              this.id.equals(other.getId()))) &&
            ((this.name==null && other.getName()==null) ||
             (this.name!=null &&
              this.name.equals(other.getName()))) &&
            ((this.type==null && other.getType()==null) ||
             (this.type!=null &&
              this.type.equals(other.getType())));
        __equalsCalc = null;
        return _equals;
    }

    private boolean __hashCodeCalc = false;
    public synchronized int hashCode() {
        if (__hashCodeCalc) {
            return 0;
        }
        __hashCodeCalc = true;
        int _hashCode = 1;
        if (getId() != null) {
            _hashCode += getId().hashCode();
        }
        if (getName() != null) {
            _hashCode += getName().hashCode();
        }
        if (getType() != null) {
            _hashCode += getType().hashCode();
        }
        __hashCodeCalc = false;
        return _hashCode;
    }

    // Type metadata
    private static org.apache.axis.description.TypeDesc typeDesc =
        new org.apache.axis.description.TypeDesc(AdCustomizerFeedAttribute.class, true);

    static {
        typeDesc.setXmlType(new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201601", "AdCustomizerFeedAttribute"));
        org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc();
        elemField.setFieldName("id");
        elemField.setXmlName(new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201601", "id"));
        elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "long"));
        elemField.setMinOccurs(0);
        elemField.setNillable(false);
        typeDesc.addFieldDesc(elemField);
        elemField = new org.apache.axis.description.ElementDesc();
        elemField.setFieldName("name");
        elemField.setXmlName(new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201601", "name"));
        elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"));
        elemField.setMinOccurs(0);
        elemField.setNillable(false);
        typeDesc.addFieldDesc(elemField);
        elemField = new org.apache.axis.description.ElementDesc();
        elemField.setFieldName("type");
        elemField.setXmlName(new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201601", "type"));
        elemField.setXmlType(new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201601", "AdCustomizerFeedAttribute.Type"));
        elemField.setMinOccurs(0);
        elemField.setNillable(false);
        typeDesc.addFieldDesc(elemField);
    }

    /**
     * Return type metadata object
     */
    public static org.apache.axis.description.TypeDesc getTypeDesc() {
        return typeDesc;
    }

    /**
     * Get Custom Serializer
     */
    public static org.apache.axis.encoding.Serializer getSerializer(
           java.lang.String mechType,
           java.lang.Class _javaType,
           javax.xml.namespace.QName _xmlType) {
        return
          new  org.apache.axis.encoding.ser.BeanSerializer(
            _javaType, _xmlType, typeDesc);
    }

    /**
     * Get Custom Deserializer
     */
    public static org.apache.axis.encoding.Deserializer getDeserializer(
           java.lang.String mechType,
           java.lang.Class _javaType,
           javax.xml.namespace.QName _xmlType) {
        return
          new  org.apache.axis.encoding.ser.BeanDeserializer(
            _javaType, _xmlType, typeDesc);
    }

}


text:
sap.ui.getCore().attachInit(function () {
	"use strict";

	sap.ui.require([
		"sap/m/Panel",
		"sap/m/Text",
		"sap/ui/core/mvc/XMLView",
		"sap/ui/core/mvc/Controller",
		"sap/ui/model/odata/v2/ODataModel",
		"sap/ui/core/util/MockServer"
	], function (
		Panel,
		Text,
		XMLView,
		Controller,
		ODataModel,
		MockServer
	) {
		var MyController = Controller.extend("mainView.controller", {
			onInit: function () {
				var oModel,
					sServiceName = "testService";

				this.setupMockServer(sServiceName);

				oModel = new ODataModel(sServiceName + "/", {
					useBatch: false,
					defaultCountMode: "Inline",
					defaultBindingMode: "TwoWay"
				});

				this.getView().setModel(oModel);
			},
			bindToExisting: function () {
				this.byId("c1").bindAggregation("items", {
					path: "/Employees",
					template: new sap.ui.core.Item({
						key: "{ID}",
						text: "{Name}"
					})
				});
			},
			handleLoadItems: function (oControlEvent) {
				var oComboBox = oControlEvent.getSource();

				if (!oComboBox.getItems().length) {
					oControlEvent.getSource().getBinding("items").refresh();
				}

				oControlEvent.getSource().getBinding("items").resume();
			},
			setupMockServer: function (service) {
				var basePath = service;

				var mockServer = new MockServer({
					rootUri: basePath
				});

				MockServer.config({
					autoRespond: true,
					autoRespondAfter: 3000
				});

				var reqList = mockServer.getRequests();

				// $metadata
				reqList.push({
					method: 'GET',
					path: '/\\$metadata(.*)',
					response: function (req, resp) {
						req.respondXML(200, {}, document.getElementById("metadata").textContent);
					}
				});

				// Data
				reqList.push({
					method: 'GET',
					path: '/\\Employees(.*)',
					response: function (req, resp) {
						req.respondJSON(200, {}, document.getElementById("employees").textContent);
					}
				});

				mockServer.setRequests(reqList);
				mockServer.simulate(basePath + '/$metadata',
					{
						sMockdataBaseUrl: basePath + '/Employees',
						bGenerateMissingMockData: true
					});
				mockServer.start();
			}
		});

		XMLView.create({
			id: "idView",
			definition: document.getElementById("mainView").textContent,
			controller: new MyController()
		}).then(function (oView) {
			oView.placeAt("content");
		});

	});

});


text:
package io.spotnext.jfly.ui.base;

import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.UUID;

import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.fasterxml.jackson.annotation.JsonIgnore;

import io.spotnext.jfly.ComponentHandler;
import io.spotnext.jfly.attributes.Attributes.Attribute;
import io.spotnext.jfly.attributes.Styles.Style;
import io.spotnext.jfly.event.DomEvent;
import io.spotnext.jfly.event.EventHandler;
import io.spotnext.jfly.event.Events.EventType;
import io.spotnext.jfly.event.Events.GenericEvent;
import io.spotnext.jfly.event.Events.JsEvent;
import io.spotnext.jfly.util.KeyValueListMapping;
import io.spotnext.jfly.util.KeyValueMapping;

public abstract class AbstractComponent implements Component, EventTarget, Comparable<AbstractComponent> {

	private static final Logger LOG = LoggerFactory.getLogger(AbstractComponent.class);

	@JsonIgnore
	private final transient Set<ClientUpdateCommand> drawCommands = new LinkedHashSet<>();
	@JsonIgnore
	private final transient List<String> eventData = new ArrayList<>();
	@JsonIgnore
	private transient ComponentHandler handler;

	private String type;
	private final String uuid;
	private final Set<String> styleClasses = new HashSet<>();
	private final KeyValueMapping<Attribute, String> attributes = new KeyValueMapping<>();
	private boolean visible = true;

	protected KeyValueListMapping<EventType, EventHandler> eventHandlers = new KeyValueListMapping<>();

	/*
	 * Initialization
	 */

	public AbstractComponent() {
		// this strange uid is necessary, as we are also using this for vue
		// property binding
		// there are no dashes allowed, and each uuid must start with a letter.
		uuid = "comp" + Math.abs(UUID.randomUUID().toString().hashCode());
		type = this.getClass().getSimpleName();
	}

	protected AbstractComponent(final ComponentHandler handler) {
		this();
		this.handler = handler;
		getHandler().registerComponent(this);
	}

	/*
	 * Properties
	 */

	@Override
	public String getUuid() {
		return uuid;
	}

	public boolean isVisible() {
		return visible;
	}

	public void setVisible(final boolean visible) {
		if (this.visible != visible) {
			this.visible = visible;
			updateClientComponent();
		}
	}

	public Map<Attribute, String> getAttributes() {
		return Collections.unmodifiableMap(attributes);
	}

	public Set<String> getStyleClasses() {
		return Collections.unmodifiableSet(styleClasses);
	}

	public void addStyleClass(final String styleClass) {
		this.styleClasses.add(styleClass);
		updateClientComponent();
	}

	public void addStyleClass(final Style styleClass) {
		addStyleClass(styleClass.getInternalName());
	}

	public void removeStyleClass(final String styleClass) {
		this.styleClasses.remove(styleClass);
		updateClientComponent();
	}

	public void removeStyleClass(final Style styleClass) {
		removeStyleClass(styleClass.getInternalName());
	}

	public void addAttribute(final Attribute attribute) {
		addAttribute(attribute, attribute.getInternalName());
	}

	public void addAttribute(final Attribute attribute, String value) {
		this.attributes.put(attribute, value);
		updateClientComponent();
	}

	public void removeAttribute(final Attribute attribute) {
		this.attributes.remove(attribute);
		updateClientComponent();
	}

	/**
	 * Returns an immutable set of the style classes.
	 */
	public Set<String> styleClasses() {
		return Collections.unmodifiableSet(styleClasses);
	}

	/*
	 * Events
	 */

	/**
	 * Registers an event handler for the given javascript event. The event can
	 * be unregistered by passing null as handler.
	 *
	 * @param eventType
	 * @param handler
	 * @return
	 */
	protected void onEvent(final EventType eventType, final EventHandler handler) {
		if (handler != null) {
			this.eventHandlers.putOrAdd(eventType, handler);
		}
	}

	public void unregisterEventHandler(JsEvent eventType, EventHandler handler) {
		eventHandlers.remove(eventType, handler);
	}

	@Override
	public void handleEvent(final DomEvent event) {
		final List<EventHandler> handlers = eventHandlers.get(event.getEventType());

		if (handlers.size() == 0) {
			LOG.warn(String.format("No event handler for event '%s' found", event.getType()));
		} else {
			handlers.stream().forEach((h) -> h.handle(event));
		}
	}

	@Override
	public boolean hasPendingClientUpdateCommands() {
		return drawCommands.size() > 0;
	}

	@Override
	public void clearPendingClientUpdateCommands() {
		drawCommands.clear();
	}

	@JsonIgnore
	@Override
	public Set<ClientUpdateCommand> getClientUpdateCommands() {
		return drawCommands;
	}

	public Set<EventType> getRegisteredEvents() {
		return this.eventHandlers.keySet();
	}

	public boolean isEventHandled(EventType eventType) {
		return this.eventHandlers.keySet().stream().anyMatch(k -> eventType.equals(k));
	}

	/*
	 * INTERNAL
	 */

	protected ComponentHandler getHandler() {
		return handler;
	}

	public String getRegisteredEventsString() {
		return StringUtils.join(getRegisteredEvents(), " ");
	}

	@Override
	public String render() {
		clearPendingClientUpdateCommands();
		return getHandler().renderComponent(this);
	}

	@Override
	public void redraw() {
		updateClientComponent("replaceAll", render());
	}

	protected void updateClientComponent() {
		drawCommands.add(new ClientUpdateCommand(DrawCommandType.ComponentStateUpdate, null, null, null));
	}

	protected void updateClientComponent(final String method, final Object... params) {
		drawCommands.add(new ClientUpdateCommand(DrawCommandType.ObjectManipulation, null, method, params));
	}

	protected void callClientFunction(final String object, final String function, final Object... params) {
		drawCommands.add(new ClientUpdateCommand(DrawCommandType.FunctionCall, object, function, params));
	}

	protected void updateClient(ComponentManipulationFunction function, final Object... params) {
		String functionName = null;

		if (ComponentManipulationFunction.ADD.equals(function)) {
			functionName = "addChildComponent";
		} else if (ComponentManipulationFunction.REMOVE.equals(function)) {
			functionName = "removeChildComponent";
		} else if (ComponentManipulationFunction.REPLACE.equals(function)) {
			functionName = "replaceChildComponent";
		}

		drawCommands.add(new ClientUpdateCommand(DrawCommandType.FunctionCall, "jfly", functionName, params));
	}

	@Override
	public int compareTo(final AbstractComponent o) {
		if (o == null) {
			return 1;
		}

		return getUuid().compareTo(o.getUuid());
	}

	/*
	 * EVENT HANDLERS
	 */

	public void onClick(final EventHandler handler) {
		onEvent(JsEvent.Click, handler);
	}

	public void onDoubleClick(final EventHandler handler) {
		onEvent(JsEvent.DoubleClick, handler);
	}

	public void onMouseOut(final EventHandler handler) {
		onEvent(JsEvent.MouseOut, handler);
	}

	public void onMouseMove(final EventHandler handler) {
		onEvent(JsEvent.MouseMove, handler);
	}

	public void onMouseDown(final EventHandler handler) {
		onEvent(JsEvent.MouseDown, handler);
	}

	public void onMouseOver(final EventHandler handler) {
		onEvent(JsEvent.MouseOver, handler);
	}

	public void onMouseUp(final EventHandler handler) {
		onEvent(JsEvent.MouseUp, handler);
	}

	public void onMouseWheel(final EventHandler handler) {
		onEvent(JsEvent.MouseWheel, handler);
	}

	public void onStateChanged(final EventHandler handler, final String componentPropery) {
		EventHandler stateChangedHandler = (e) -> {
			if (StringUtils.equals((String) e.getData().get("property"), componentPropery)) {
				handler.handle(e);
			}
		};

		onEvent(GenericEvent.StateChanged, stateChangedHandler);
	}

	public enum ComponentManipulationFunction {
		/**
		 * Adds an element as a new child element to the parent.
		 */
		ADD,
		/**
		 * Appends an element after the parent element.
		 */
		APPEND,
		/**
		 * Removes an element.
		 */
		REMOVE,
		/**
		 * Replaces an element with another one.
		 */
		REPLACE
	}
}


text:
import Ember from 'ember';
import layout from 'ember-bootstrap/templates/components/bs-form/element/label';

/**

 @class FormElementLabel
 @namespace Components
 @extends Ember.Component
 @private
 */
export default Ember.Component.extend({
  layout,
  tagName: '',

  /**
   * @property label
   * @type string
   * @public
   */
  label: null,

  /**
   * @property invisibleLabel
   * @type boolean
   * @public
   */
  invisibleLabel: false,

  /**
   * @property formElementId
   * @type {String}
   * @public
   */
  formElementId: null,

  /**
   * @property labelClass
   * @type {String}
   * @public
   */
  labelClass: null
});


text:
<?php

declare(strict_types=1);

namespace ApiPlatform\Symfony\Validator\Metadata\Property\Restriction;

use ApiPlatform\Metadata\ApiProperty;
use Symfony\Component\Validator\Constraint;

/**
 * Interface PropertySchemaRestrictionsInterface.
 *
 * @author Andrii Penchuk penja7@gmail.com
 */
interface PropertySchemaRestrictionMetadataInterface
{
    /**
     * Creates json schema restrictions based on the validation constraints.
     *
     * @param Constraint  $constraint       The validation constraint
     * @param ApiProperty $propertyMetadata The property metadata
     *
     * @return array The array of restrictions
     */
    public function create(Constraint $constraint, ApiProperty $propertyMetadata): array;

    /**
     * Is the constraint supported by the schema restriction?
     *
     * @param Constraint  $constraint       The validation constraint
     * @param ApiProperty $propertyMetadata The property metadata
     */
    public function supports(Constraint $constraint, ApiProperty $propertyMetadata): bool;
}


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

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.common.base.Joiner;
import io.prestosql.spi.connector.ConnectorTableHandle;
import io.prestosql.spi.connector.SchemaTableName;

import javax.annotation.Nullable;

import java.util.Objects;

import static java.util.Objects.requireNonNull;

public final class JdbcTableHandle
        implements ConnectorTableHandle
{
    private final String connectorId;
    private final SchemaTableName schemaTableName;
    private final String catalogName;
    private final String schemaName;
    private final String tableName;

    @JsonCreator
    public JdbcTableHandle(
            @JsonProperty("connectorId") String connectorId,
            @JsonProperty("schemaTableName") SchemaTableName schemaTableName,
            @JsonProperty("catalogName") @Nullable String catalogName,
            @JsonProperty("schemaName") @Nullable String schemaName,
            @JsonProperty("tableName") String tableName)
    {
        this.connectorId = requireNonNull(connectorId, "connectorId is null");
        this.schemaTableName = requireNonNull(schemaTableName, "schemaTableName is null");
        this.catalogName = catalogName;
        this.schemaName = schemaName;
        this.tableName = requireNonNull(tableName, "tableName is null");
    }

    @JsonProperty
    public String getConnectorId()
    {
        return connectorId;
    }

    @JsonProperty
    public SchemaTableName getSchemaTableName()
    {
        return schemaTableName;
    }

    @JsonProperty
    @Nullable
    public String getCatalogName()
    {
        return catalogName;
    }

    @JsonProperty
    @Nullable
    public String getSchemaName()
    {
        return schemaName;
    }

    @JsonProperty
    public String getTableName()
    {
        return tableName;
    }

    @Override
    public boolean equals(Object obj)
    {
        if (this == obj) {
            return true;
        }
        if ((obj == null) || (getClass() != obj.getClass())) {
            return false;
        }
        JdbcTableHandle o = (JdbcTableHandle) obj;
        return Objects.equals(this.connectorId, o.connectorId) &&
                Objects.equals(this.schemaTableName, o.schemaTableName);
    }

    @Override
    public int hashCode()
    {
        return Objects.hash(connectorId, schemaTableName);
    }

    @Override
    public String toString()
    {
        return Joiner.on(":").useForNull("null").join(connectorId, schemaTableName, catalogName, schemaName, tableName);
    }
}


text:
<!---
Copyright 2015 The AMP HTML Authors. All Rights Reserved.

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.
-->

[![Build Status](https://travis-ci.org/ampproject/amphtml.svg?branch=master)](https://travis-ci.org/ampproject/amphtml)
[![Issue Stats](http://issuestats.com/github/ampproject/amphtml/badge/pr?style=flat)](http://issuestats.com/github/ampproject/amphtml)
[![Issue Stats](http://issuestats.com/github/ampproject/amphtml/badge/issue?style=flat)](http://issuestats.com/github/ampproject/amphtml)

# AMP HTML ⚡

[AMP HTML](https://www.ampproject.org/docs/get_started/about-amp.html) is a way to build web pages for static content that render with reliable, fast performance. It is our attempt at fixing what many perceive as painfully slow page load times – especially when reading content on the mobile web.

AMP HTML is entirely built on existing web technologies. It achieves reliable performance by restricting some parts of HTML, CSS and JavaScript. These restrictions are enforced with a validator that ships with AMP HTML. To make up for those limitations AMP HTML defines a set of [custom elements](http://www.html5rocks.com/en/tutorials/webcomponents/customelements/) for rich content beyond basic HTML. Learn more about [how AMP speeds up performance](https://www.ampproject.org/docs/get_started/technical_overview.html).

# How does AMP HTML work?

AMP HTML works by including the AMP JS library and adding a bit of boilerplate to a web page, so that it meets the AMP HTML Specification. The simplest AMP HTML file looks like this:

```html
<!doctype html>
<html ⚡>
  <head>
    <meta charset="utf-8">
    <link rel="canonical" href="hello-world.html" >
    <meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1">
    <style amp-boilerplate>body{-webkit-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-moz-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-ms-animation:-amp-start 8s steps(1,end) 0s 1 normal both;animation:-amp-start 8s steps(1,end) 0s 1 normal both}@-webkit-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-moz-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-ms-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-o-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}</style><noscript><style amp-boilerplate>body{-webkit-animation:none;-moz-animation:none;-ms-animation:none;animation:none}</style></noscript>
    <script async src="https://cdn.ampproject.org/v0.js"></script>
  </head>
  <body>Hello World!</body>
</html>
```

This allows the AMP library to include:
* The AMP JS library, that manages the loading of external resources to ensure a
  fast rendering of the page.
* An AMP validator that provides a way for web developers to easily validate
  that their code meets the AMP HTML specification.
* Some custom elements, called AMP HTML components, which make common patterns
  easy to implement in a performant way.

Get started [creating your first AMP page](https://www.ampproject.org/docs/get_started/create_page.html).

[Full docs and reference.](https://www.ampproject.org/docs/get_started/about-amp.html)

## The AMP JS library

The AMP JS library provides [builtin](builtins/README.md) AMP Components, manages the loading of external resources, and ensures a reliably fast time-to-paint.

## The AMP Validator

[The AMP Validator](validator/README.md) allows a web developer to easily
identify if the web page doesn't meet the
[AMP HTML specification](https://www.ampproject.org/docs/reference/spec.html).

Adding "#development=1" to the URL of the page instructs the AMP Runtime to run
a series of assertions confirming the page's markup meets the AMP HTML
Specification.  Validation errors are logged to the browser's console when the
page is rendered, allowing web developers to easily see how complex changes in
web code might impact performance and user experience.

It also allows apps that integrate web content to validate the web page against
the specification.  This allows an app to make sure the page is fast and
mobile-friendly, as pages adhering to the AMP HTML specification are reliably
fast.

Learn more about
[validating your AMP pages](https://www.ampproject.org/docs/guides/validate.html).
Also see [additional choices to invoke the validator](validator/README.md).

## AMP HTML Components

AMP HTML Components are a series of extended custom elements that supplement
or replace functionality of core HTML5 elements to allow the runtime to ensure
it is solely responsible for loading external assets and to provide for shared
best practices in implementation.

See our [docs and reference](https://www.ampproject.org/docs/get_started/about-amp.html) for more info.

# Releases

We push a new release of AMP to all AMP pages every week on Thursday. The more detailed schedule is as follows:

- Every Thursday we cut a green release from our `master` branch.
- This is then pushed to users of AMP who opted into the [AMP Dev Channel](#amp-dev-channel).
- On Monday we check error rates for opt-in users and bug reports and if everything looks fine, we push this new release to 1% of AMP pages.
- We then continue to monitor error rates and bug reports throughout the week.
- On Thursday the "Dev Channel" release from last Thursday is then pushed to all users.

You can always follow the current release state of AMP on our [releases page](https://github.com/ampproject/amphtml/releases). The release used by most users is marked as `Latest release` and the current Dev Channel release is marked as `Pre-release`.

## AMP Dev Channel

AMP Dev Channel is a way to opt a browser into using a newer version of the AMP JS libraries.

This release **may be less stable** and it may contain features not available to all users. Opt into this option if you'd like to help test new versions of AMP, report bugs or build documents that require a new feature that is not yet available to everyone.

Opting into Dev Channel is great to:

- test and play with new features not yet available to all users.
- use in Q&A to ensure that your site is compatible with the next version of AMP.

If you find an issue that appears to only occur in the Dev Channel version of AMP, please [file an issue](https://github.com/ampproject/amphtml/issues/new) with a description of the problem. Please always include a URL to a page that reproduces the issue.

To opt your browser into the AMP Dev Channel, go to [the AMP experiments page](https://cdn.ampproject.org/experiments.html) and activate the "AMP Dev Channel" experiment. Please subscribe to our [low-volume announcements](https://groups.google.com/forum/#!forum/amphtml-announce) mailing list to get notified about important/breaking changes about AMP.

# Further Reading

If you are creating AMP pages,
check out the docs on [ampproject.org](https://www.ampproject.org/) and samples on [ampbyexample.com](https://ampbyexample.com/).

These docs are public and open-source: [https://github.com/ampproject/docs/](https://github.com/ampproject/docs/).
See something that's missing from the docs, or that could be worded better?
[Create an issue](https://github.com/ampproject/docs/issues) and
we will do our best to respond quickly.

Resources:
* [AMP HTML samples](examples/)
* [AMP-HTML on StackOverflow](https://stackoverflow.com/questions/tagged/amp-html)

<!--
Not yet done.
* [Integrating your AMP HTML page](docs/integrating.md)
* [Extending AMP HTML with new elements](docs/extending.md)
* [Embedding AMP HTML content in your app](docs/embedding.md)
-->

Reference:
* [AMP HTML core built-in elements](builtins/README.md)
* [AMP HTML optional extended elements](extensions/README.md)

Technical Specifications:
* [AMP HTML format specification](spec/amp-html-format.md)
* [AMP HTML custom element specification](spec/amp-html-components.md)

# Who makes AMP HTML?

AMP HTML is made by the [AMP Project](https://www.ampproject.org/), and is licensed
under the [Apache License, Version 2.0](LICENSE).

## Contributing

Please see [the CONTRIBUTING file](CONTRIBUTING.md) for information on contributing to the AMP Project, and [the DEVELOPING file](DEVELOPING.md) for documentation on the AMP library internals and [hints how to get started](DEVELOPING.md#starter-issues).

### Security disclosures

The AMP Project accepts responsible security disclosures through the [Google Application Security program](https://www.google.com/about/appsecurity/).

### [Code of conduct](CODE_OF_CONDUCT.md)


text:
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using Myrtille.Helpers;
using Myrtille.Services.Contracts;

namespace Myrtille.Services
{
    public class FileStorage : IFileStorage
    {
        public List<string> GetUserDocumentsFolderFiles(
            string domain,
            string userName,
            string userPassword)
        {
            var documentsFolder = AccountHelper.GetUserDocumentsFolder(domain, userName, userPassword);

            try
            {
                var fileNames = Directory.GetFiles(documentsFolder);
                for (var i = 0; i < fileNames.Length; i++)
                {
                    fileNames[i] = Path.GetFileName(fileNames[i]);
                }
                return new List<string>(fileNames);
            }
            catch (Exception exc)
            {
                Trace.TraceError("Failed to retrieve file(s) from user {0} documents folder {1} ({2})", userName, documentsFolder, exc);
                throw;
            }
        }

        public void UploadFileToUserDocumentsFolder(
            UploadRequest uploadRequest)
        {
            var documentsFolder = AccountHelper.GetUserDocumentsFolder(uploadRequest.Domain, uploadRequest.UserName, uploadRequest.UserPassword);

            try
            {
                // replace if already exists
                if (File.Exists(Path.Combine(documentsFolder, uploadRequest.FileName)))
                {
                    File.Delete(Path.Combine(documentsFolder, uploadRequest.FileName));
                }

                var fileStream = File.Create(Path.Combine(documentsFolder, uploadRequest.FileName));

                int bytesRead;
                var buffer = new byte[4096];

                while ((bytesRead = uploadRequest.Stream.Read(buffer, 0, buffer.Length)) > 0)
                {
                    fileStream.Write(buffer, 0, bytesRead);
                }

                fileStream.Close();
                uploadRequest.Stream.Close();
            }
            catch (Exception exc)
            {
                Trace.TraceError("Failed to upload file {0} to user {1} documents folder {2} ({3})", uploadRequest.FileName, uploadRequest.UserName, documentsFolder, exc);
                throw;
            }

            Trace.TraceInformation("Uploaded file {0} to user {1} documents folder {2}", uploadRequest.FileName, uploadRequest.UserName, documentsFolder);
        }

        public Stream DownloadFileFromUserDocumentsFolder(
            string domain,
            string userName,
            string userPassword,
            string fileName)
        {
            var documentsFolder = AccountHelper.GetUserDocumentsFolder(domain, userName, userPassword);

            Trace.TraceInformation("Downloading file {0} from user {1} documents folder {2}", fileName, userName, documentsFolder);

            try
            {
                return File.Open(Path.Combine(documentsFolder, fileName), FileMode.Open, FileAccess.Read, FileShare.Read);
            }
            catch (Exception exc)
            {
                Trace.TraceError("Failed to download file {0} from user {1} documents folder {2} ({3})", fileName, userName, documentsFolder, exc);
                throw;
            }
        }
    }
}


text:
'use strict';

angular.module('loginHandler', ['firebase', 'firebase.utils'])

  // a simple wrapper on simpleLogin.getUser() that rejects the promise
  // if the user does not exists (i.e. makes user required)
  .factory('requireUser', ['loginHandler', '$q', function(simpleLogin, $q) {
    return function() {
      return simpleLogin.getUser().then(function (user) {
        return user ? user : $q.reject({ authRequired: true });
      });
    };
  }])

  .factory('loginHandler', ['$firebaseAuth', 'fbutil',
    function($firebaseAuth, fbutil) {
      var auth = $firebaseAuth(fbutil.ref());
      var listeners = [];

      function statusChange() {
        fns.user = auth.$getAuth();
        angular.forEach(listeners, function(fn) {
          fn(fns.user);
        });
      }

      var fns = {
        user: null,

        getUser: function() {
          return auth.$waitForAuth();
        },

        /**
         * @param {string} email
         * @param {string} pass
         * @returns {*}
         */
        login: function() {
          return auth.$authWithOAuthPopup('facebook').then(function(authData) {
              // console.log('Logged in as:', authData.uid);
            }).catch(function(error) {
              // console.error('Authentication failed: ', error);
            });
        },

        logout: function() {
          auth.$unauth();
        },

        watch: function(cb, $scope) {
          fns.getUser().then(function(user) {
            cb(user);
          });
          listeners.push(cb);
          var unbind = function() {
            var i = listeners.indexOf(cb);
            if( i > -1 ) { listeners.splice(i, 1); }
          };
          if( $scope ) {
            $scope.$on('$destroy', unbind);
          }
          return unbind;
        }
      };

      auth.$onAuth(statusChange);
      statusChange();

      return fns;
    }]);


text:
package twizansk.hivemind.api.model;

/**
 * Classes implementing the Stepper interface are responsible for determining
 * the step size for each model update.
 *
 * @author Tommer Wizansky
 *
 */
public interface Stepper {

	/**
	 * Get the step size for the next model update.
	 *
	 * @return The step size.
	 */
	double getStepSize();

	/**
	 * Initialize the stepper. This method is idempotent and brings the
	 * stepper to the same state regardless of the original state.
	 */
	void reset();

}


text:
.. image:: https://badge.fury.io/py/folium.png
   :target: http://badge.fury.io/py/folium
.. image:: https://api.travis-ci.org/python-visualization/folium.png?branch=master
   :target: https://travis-ci.org/python-visualization/folium
.. image:: https://badges.gitter.im/Join%20Chat.svg
   :target: https://gitter.im/python-visualization/folium?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge
.. image:: https://zenodo.org/badge/18669/python-visualization/folium.svg
   :target: https://zenodo.org/badge/latestdoi/18669/python-visualization/folium

Folium
======

|Folium|

Python Data. Leaflet.js Maps.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Folium builds on the data wrangling strengths of the Python ecosystem
and the mapping strengths of the Leaflet.js library. Manipulate your
data in Python, then visualize it in on a Leaflet map via Folium.

Concept
-------

Folium makes it easy to visualize data that's been manipulated in Python
on an interactive Leaflet map. It enables both the binding of data to a
map for choropleth visualizations as well as passing Vincent/Vega
visualizations as markers on the map.

The library has a number of built-in tilesets from OpenStreetMap,
MapQuest Open, MapQuest Open Aerial, Mapbox, and Stamen, and supports
custom tilesets with Mapbox or Cloudmade API keys. Folium supports both
GeoJSON and TopoJSON overlays, as well as the binding of data to those
overlays to create choropleth maps with color-brewer color schemes.

Installation
------------

.. code:: bash

    $ pip install folium

Getting Started
---------------

To create a base map, simply pass your starting coordinates to Folium:

.. code:: python

    import folium
    map_osm = folium.Map(location=[45.5236, -122.6750])
    map_osm.create_map(path='osm.html')

|baseOSM|

| Folium defaults to OpenStreetMap tiles, but Stamen Terrain, Stamen
  Toner,
| Mapbox Bright, and Mapbox Control room tiles are built in:

.. code:: python

    stamen = folium.Map(location=[45.5236, -122.6750], tiles='Stamen Toner',
                        zoom_start=13)
    stamen.create_map(path='stamen_toner.html')

|stamen|

Folium also supports Cloudmade and Mapbox custom tilesets- simply pass
your key to the ``API_key`` keyword:

.. code:: python

    custom = folium.Map(location=[45.5236, -122.6750], tiles='Mapbox',
                        API_key='wrobstory.map-12345678')

Lastly, Folium supports passing any Leaflet.js compatible custom
tileset:

.. code:: python

    tileset = r'http://{s}.tiles.yourtiles.com/{z}/{x}/{y}.png'
    map = folium.Map(location=[45.372, -121.6972], zoom_start=12,
                     tiles=tileset, attr='My Data Attribution')

Markers
-------

| Folium supports the plotting of numerous marker types, starting with a
  simple Leaflet
| style location marker with popup text:

.. code:: python

    map_1 = folium.Map(location=[45.372, -121.6972], zoom_start=12,
                       tiles='Stamen Terrain')
    map_1.simple_marker([45.3288, -121.6625], popup='Mt. Hood Meadows')
    map_1.simple_marker([45.3311, -121.7113], popup='Timberline Lodge')
    map_1.create_map(path='mthood.html')

|hood|

`Live example <http://bl.ocks.org/wrobstory/5609718>`__

Folium supports colors and marker icon types (from bootstrap)

.. code:: python

    map_1 = folium.Map(location=[45.372, -121.6972], zoom_start=12,tiles='Stamen Terrain')
    map_1.simple_marker([45.3288, -121.6625], popup='Mt. Hood Meadows',marker_icon='cloud')
    map_1.simple_marker([45.3311, -121.7113], popup='Timberline Lodge',marker_color='green')
    map_1.simple_marker([45.3300, -121.6823], popup='Some Other Location',marker_color='red',marker_icon='info-sign')
    map_1.create_map(path='iconTest.html')

|iconTest|

Folium also supports circle-style markers, with custom size and color:

.. code:: python

    map_2 = folium.Map(location=[45.5236, -122.6750], tiles='Stamen Toner',
                       zoom_start=13)
    map_2.simple_marker(location=[45.5244, -122.6699], popup='The Waterfront')
    map_2.circle_marker(location=[45.5215, -122.6261], radius=500,
                        popup='Laurelhurst Park', line_color='#3186cc',
                        fill_color='#3186cc')
    map_2.create_map(path='portland.html')

|circle|

`Live example <http://bl.ocks.org/wrobstory/5609747>`__

Folium has a convenience function to enable lat/lng popovers:

.. code:: python

    map_3 = folium.Map(location=[46.1991, -122.1889], tiles='Stamen Terrain',
                       zoom_start=13)
    map_3.lat_lng_popover()
    map_3.create_map(path='sthelens.html')

|latlng|

`Live example <http://bl.ocks.org/wrobstory/5609756>`__

Click-for-marker functionality will allow for on-the-fly placement of
markers:

.. code:: python

    map_4 = folium.Map(location=[46.8527, -121.7649], tiles='Stamen Terrain',
                       zoom_start=13)
    map_4.simple_marker(location=[46.8354, -121.7325], popup='Camp Muir')
    map_4.click_for_marker(popup='Waypoint')
    map_4.create_map(path='mtrainier.html')

|waypoints|

`Live example <http://bl.ocks.org/wrobstory/5609762>`__

Folium also supports the Polygon marker set from the
`Leaflet-DVF <https://github.com/humangeo/leaflet-dvf>`__:

.. code:: python

    map_5 = folium.Map(location=[45.5236, -122.6750], zoom_start=13)
    map_5.polygon_marker(location=[45.5012, -122.6655], popup='Ross Island Bridge',
                         fill_color='#132b5e', num_sides=3, radius=10)
    map_5.polygon_marker(location=[45.5132, -122.6708], popup='Hawthorne Bridge',
                         fill_color='#45647d', num_sides=4, radius=10)
    map_5.polygon_marker(location=[45.5275, -122.6692], popup='Steel Bridge',
                         fill_color='#769d96', num_sides=6, radius=10)
    map_5.polygon_marker(location=[45.5318, -122.6745], popup='Broadway Bridge',
                         fill_color='#769d96', num_sides=8, radius=10)
    map_5.create_map(path='bridges.html')

|polygon|

`Live example <http://bl.ocks.org/wrobstory/5609786>`__

Vincent/Vega Markers
--------------------

Folium enables passing
`vincent <https://github.com/wrobstory/vincent>`__ visualizations to any
marker type, with the visualization as the popover:

.. code:: python

    buoy_map = folium.Map(location=[46.3014, -123.7390], zoom_start=7,
                          tiles='Stamen Terrain')
    buoy_map.polygon_marker(location=[47.3489, -124.708], fill_color='#43d9de',
                            radius=12, popup=(vis1, 'vis1.json'))
    buoy_map.polygon_marker(location=[44.639, -124.5339], fill_color='#43d9de',
                            radius=12, popup=(vis2, 'vis2.json'))
    buoy_map.polygon_marker(location=[46.216, -124.1280], fill_color='#43d9de',
                            radius=12, popup=(vis3, 'vis3.json'))
    buoy_map.create_map(path='NOAA_buoys.html')

|vincent|

`Live example <http://bl.ocks.org/wrobstory/5609803>`__

GeoJSON/TopoJSON Overlays
-------------------------

Both GeoJSON and TopoJSON layers can be passed to the map as an overlay,
and multiple layers can be visualized on the same map:

.. code:: python

    geo_path = r'data/antarctic_ice_edge.json'
    topo_path = r'data/antarctic_ice_shelf_topo.json'

    ice_map = folium.Map(location=[-59.1759, -11.6016],
                       tiles='Mapbox Bright', zoom_start=2)
    ice_map.geo_json(geo_path=geo_path)
    ice_map.geo_json(geo_path=topo_path, topojson='objects.antarctic_ice_shelf')
    ice_map.create_map(path='ice_map.html')

|ice|

`Live example <http://bl.ocks.org/wrobstory/5609811>`__

Choropleth Maps
---------------

Folium allows for the binding of data between Pandas DataFrames/Series
and Geo/TopoJSON geometries. `Color Brewer <http://colorbrewer2.org/>`__
sequential color schemes are built-in to the library, and can be passed
to quickly visualize different combinations:

.. code:: python

    import folium
    import pandas as pd

    state_geo = r'data/us-states.json'
    state_unemployment = r'data/US_Unemployment_Oct2012.csv'

    state_data = pd.read_csv(state_unemployment)

    #Let Folium determine the scale
    map = folium.Map(location=[48, -102], zoom_start=3)
    map.geo_json(geo_path=state_geo, data=state_data,
                 columns=['State', 'Unemployment'],
                 key_on='feature.id',
                 fill_color='YlGn', fill_opacity=0.7, line_opacity=0.2,
                 legend_name='Unemployment Rate (%)')
    map.create_map(path='us_states.html')

|states_1|

`Live example <http://bl.ocks.org/wrobstory/5609830>`__

Folium creates the legend on the upper right based on a D3 threshold
scale, and makes the best-guess at values via quantiles. Passing your
own threshold values is simple:

.. code:: python

    map.geo_json(geo_path=state_geo, data=state_data,
                 columns=['State', 'Unemployment'],
                 threshold_scale=[5, 6, 7, 8, 9, 10],
                 key_on='feature.id',
                 fill_color='BuPu', fill_opacity=0.7, line_opacity=0.5,
                 legend_name='Unemployment Rate (%)',
                 reset=True)
    map.create_map(path='us_states.html')

|states_2|

`Live example <http://bl.ocks.org/wrobstory/5609856>`__

By binding data via the Pandas DataFrame, different datasets can be
quickly visualized. In the following example, the ``df`` DataFrame
contains six columns with different economic data, a few of which we
will visualize:

.. code:: python

    #Number of employed with auto scale
    map_1 = folium.Map(location=[48, -102], zoom_start=3)
    map_1.geo_json(geo_path=county_geo, data_out='data1.json', data=df,
                   columns=['GEO_ID', 'Employed_2011'],
                   key_on='feature.id',
                   fill_color='YlOrRd', fill_opacity=0.7, line_opacity=0.3,
                   topojson='objects.us_counties_20m')
    map_1.create_map(path='map_1.html')

|counties_1|

`Live example <http://bl.ocks.org/wrobstory/5609889>`__

.. code:: python

    #Unemployment with custom defined scale
    map_2 = folium.Map(location=[40, -99], zoom_start=4)
    map_2.geo_json(geo_path=county_geo, data_out='data2.json', data=df,
                   columns=['GEO_ID', 'Unemployment_rate_2011'],
                   key_on='feature.id',
                   threshold_scale=[0, 5, 7, 9, 11, 13],
                   fill_color='YlGnBu', line_opacity=0.3,
                   legend_name='Unemployment Rate 2011 (%)',
                   topojson='objects.us_counties_20m')
    map_2.create_map(path='map_2.html')

|counties_2|

`Live example <http://bl.ocks.org/wrobstory/5609934>`__

.. code:: python

    #Median Household income
    map_3 = folium.Map(location=[40, -99], zoom_start=4)
    map_3.geo_json(geo_path=county_geo, data_out='data3.json', data=df,
                   columns=['GEO_ID', 'Median_Household_Income_2011'],
                   key_on='feature.id',
                   fill_color='PuRd', line_opacity=0.3,
                   legend_name='Median Household Income 2011 ($)',
                   topojson='objects.us_counties_20m')
    map_3.create_map(path='map_3.html')

|counties_3|

`Live example <http://bl.ocks.org/wrobstory/5609959>`__

Dependencies
------------

Jinja2

Pandas (Map Data Binding only)

Numpy (Map Data Binding only)

Vincent (Map Data Binding only)

Status
------

Beta

Docs
----

https://folium.readthedocs.org/

.. |Folium| image:: http://farm3.staticflickr.com/2860/8754661081_c40e5a214c_o.jpg
.. |baseOSM| image:: http://farm6.staticflickr.com/5334/8754817259_de071db265_c.jpg
.. |stamen| image:: http://farm3.staticflickr.com/2883/8755937912_1d9ef78118_c.jpg
.. |hood| image:: http://farm4.staticflickr.com/3666/8755937936_d7efbc6dee_c.jpg
.. |iconTest| image:: http://cl.ly/image/2b0l1K0v370P/icon_test.png
.. |circle| image:: http://farm9.staticflickr.com/8280/8755938394_9f491ef79f_c.jpg
.. |latlng| image:: http://farm4.staticflickr.com/3698/8755938152_14bc024bde_c.jpg
.. |waypoints| image:: http://farm6.staticflickr.com/5343/8754817433_2ecde65790_c.jpg
.. |polygon| image:: http://farm8.staticflickr.com/7405/8754817131_24285bff5f_c.jpg
.. |vincent| image:: http://farm4.staticflickr.com/3699/8754817119_4a14ebc3fe_c.jpg
.. |ice| image:: http://farm8.staticflickr.com/7335/8754817253_f32155f902_c.jpg
.. |states_1| image:: http://farm3.staticflickr.com/2837/8755937872_ed5ec8e854_c.jpg
.. |states_2| image:: http://farm9.staticflickr.com/8542/8754816951_752b8a7867_c.jpg
.. |counties_1| image:: http://farm4.staticflickr.com/3792/8755938318_bc82a81c64_c.jpg
.. |counties_2| image:: http://farm9.staticflickr.com/8140/8754817355_2bfea43ff5_c.jpg
.. |counties_3| image:: http://farm4.staticflickr.com/3755/8755938218_06fdc51d40_c.jpg


text:
namespace Microsoft.Azure.Management.Redis.Models
{
    using System;
    using System.Linq;
    using System.Collections.Generic;
    using Newtonsoft.Json;
    using Microsoft.Rest;
    using Microsoft.Rest.Serialization;
    using Microsoft.Rest.Azure;

    /// <summary>
    /// Parameters for redis export operation.
    /// </summary>
    public partial class ExportRDBParameters
    {
        /// <summary>
        /// Initializes a new instance of the ExportRDBParameters class.
        /// </summary>
        public ExportRDBParameters() { }

        /// <summary>
        /// Initializes a new instance of the ExportRDBParameters class.
        /// </summary>
        public ExportRDBParameters(string prefix, string container, string format = default(string))
        {
            Format = format;
            Prefix = prefix;
            Container = container;
        }

        /// <summary>
        /// Gets or sets file format.
        /// </summary>
        [JsonProperty(PropertyName = "format")]
        public string Format { get; set; }

        /// <summary>
        /// Gets or sets prifix to use for exported files.
        /// </summary>
        [JsonProperty(PropertyName = "prefix")]
        public string Prefix { get; set; }

        /// <summary>
        /// Gets or sets container name to export to.
        /// </summary>
        [JsonProperty(PropertyName = "container")]
        public string Container { get; set; }

        /// <summary>
        /// Validate the object. Throws ValidationException if validation fails.
        /// </summary>
        public virtual void Validate()
        {
            if (Prefix == null)
            {
                throw new ValidationException(ValidationRules.CannotBeNull, "Prefix");
            }
            if (Container == null)
            {
                throw new ValidationException(ValidationRules.CannotBeNull, "Container");
            }
        }
    }
}


text:
package org.issue;

import java.util.Set;

import javax.annotation.processing.AbstractProcessor;
import javax.annotation.processing.Messager;
import javax.annotation.processing.RoundEnvironment;
import javax.annotation.processing.SupportedAnnotationTypes;
import javax.annotation.processing.SupportedSourceVersion;
import javax.lang.model.SourceVersion;
import javax.lang.model.element.TypeElement;
import javax.tools.Diagnostic.Kind;

/* @formatter:off */
@SupportedAnnotationTypes( {
    "org.issue.MCompiler224"
} )
/* @formatter:on */
@SupportedSourceVersion( SourceVersion.RELEASE_6 )
public class MCompiler224AnnotationProcessor
    extends AbstractProcessor
{

    @Override
    public boolean process( final Set<? extends TypeElement> elts, final RoundEnvironment env )
    {
        if ( elts.isEmpty() )
        {
            return true;
        }

        final Messager messager = this.processingEnv.getMessager();

        for ( final Kind kind : Kind.values() )
        {
            if ( Kind.ERROR == kind )
            {
                continue;
            }

            System.out.println( "Testing message for: " + kind );
            messager.printMessage( kind, kind + " Test message." );
        }

        return true;
    }

}


text:
  TypeName
  SA1128ConstructorInitializerMustBeOnOwnLine

  CheckId
  SA1128

  Category
  Readability Rules

:memo: This rule is new for StyleCop Analyzers, and was not present in StyleCop Classic.

## Cause

A constructor initializer is on the same line as the constructor declaration, within a C# code file.

## Rule description

A violation of this rule occurs whenever the code contains a constructor initializer that is partially or completely on the same line as the constructor declaration.

For example, the following code would produce a violation of this rule:

```csharp
public class TypeName
{
    public TypeName() : this(0)
    {
    }

    public TypeName(int value)
    {
    }
}
```

The `:` (colon) character is treated as part of the initializer and should be on the same line as the `base` or `this` keyword.

The following code would also produce a violation of this rule:

```csharp
public class TypeName
{
	public TypeName() :
		base()
	{
	}
}
```

The following code would not produce any violations:

```csharp
public class TypeName
{
    public TypeName()
        : this(0)
    {
    }

    public TypeName(int value)
    {
    }
}
```

## How to fix violations

To fix a violation of this rule, move the constructor initializer, including the `:` character, to its own line.

## How to suppress violations

```csharp
public class TypeName
{
#pragma warning disable SA1128 // Constructor initializers should be on their own line
    public TypeName() : this(0)
#pragma warning restore SA1128 // Constructor initializers should be on their own line
    {
    }

    public TypeName(int value)
    {
    }
}
```


text:
<?php

namespace CmsCommon\Form\View\Helper;

use Zend\Form\FormInterface,
    Zend\View\Renderer\RendererInterface;

/**
 * @author Dmitry Popov <d.popov@altgraphic.com>
 */
trait FormProviderTrait
{
    /**
     * @var string
     */
    protected $formKey = 'form';

    /**
     * @var FormInterface
     */
    protected $form;

    /**
     * @param FormInterface $form
     * @return self
     */
    public function setForm(FormInterface $form)
    {
        $this->form = $form;
        return $this;
    }

    /**
     * @return FormInterface
     */
    public function getForm()
    {
        if (null === $this->form) {
            $key = $this->getFormKey();
            return $this->getView()->$key;
        }

        return $this->form;
    }

    /**
     * @param string $formKey
     * @return self
     */
    public function setFormKey($formKey)
    {
        $this->formKey = $formKey;
        return $this;
    }

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

    /**
     * @return RendererInterface
     */
    abstract public function getView();
}


text:
package com.navercorp.pinpoint.web.vo.chart;

import com.navercorp.pinpoint.web.util.TimeWindow;
import org.springframework.util.CollectionUtils;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.function.Function;

/**
 * @author HyunGil Jeong
 * @author minwoo.jung
 */
public class TimeSeriesChartBuilder<P extends Point> {

    private final Point.UncollectedPointCreator<P> uncollectedPointCreator;

    public TimeSeriesChartBuilder(Point.UncollectedPointCreator<P> uncollectedPointCreator) {
        this.uncollectedPointCreator = Objects.requireNonNull(uncollectedPointCreator, "uncollectedPointCreator");
    }

    private void checkTimeWindow(TimeWindow timeWindow) {
        Objects.requireNonNull(timeWindow, "timeWindow");

        if (timeWindow.getWindowRangeCount() > Integer.MAX_VALUE) {
            throw new IllegalArgumentException("range yields too many timeslots");
        }
    }

    public Chart<P> build(TimeWindow timeWindow, List<P> sampledPoints) {
        checkTimeWindow(timeWindow);

        if (CollectionUtils.isEmpty(sampledPoints)) {
            return new Chart<>(Collections.emptyList());
        }
        List<P> points = createInitialPoints(timeWindow);
        for (P sampledPoint : sampledPoints) {
            int timeslotIndex = timeWindow.getWindowIndex(sampledPoint.getXVal());
            if (timeslotIndex < 0 || timeslotIndex >= timeWindow.getWindowRangeCount()) {
                continue;
            }
            points.set(timeslotIndex, sampledPoint);
        }
        return new Chart<>(points);
    }

    public <S> Chart<P> build(TimeWindow timeWindow, List<S> sourceList, Function<S, P> function) {
        Objects.requireNonNull(function, "function");

        List<P> filter = applyFilter(sourceList, function);
        return build(timeWindow, filter);
    }

    private <S> List<P> applyFilter(List<S> sourceList, Function<S, P> filter) {
        if (CollectionUtils.isEmpty(sourceList)) {
            return Collections.emptyList();
        }

        final List<P> result = new ArrayList<>(sourceList.size());
        for (S source : sourceList) {
            P apply = filter.apply(source);
            result.add(apply);
        }
        return result;
    }

    private List<P> createInitialPoints(TimeWindow timeWindow) {
        int numTimeslots = (int) timeWindow.getWindowRangeCount();
        List<P> points = new ArrayList<>(numTimeslots);
        for (long timestamp : timeWindow) {
            points.add(uncollectedPointCreator.createUnCollectedPoint(timestamp));
        }
        return points;
    }
}