text:
#ifndef _EFI_DRIVER_LIB_H_
#define _EFI_DRIVER_LIB_H_

#include "EfiStatusCode.h"
#include "EfiCommonLib.h"
#include "EfiPerf.h"
#include "LinkedList.h"
#include "GetImage.h"
#include "EfiImageFormat.h"
#include "EfiCompNameSupport.h"

#include EFI_GUID_DEFINITION (DxeServices)
#include EFI_GUID_DEFINITION (EventGroup)
#include EFI_GUID_DEFINITION (EventLegacyBios)
#include EFI_GUID_DEFINITION (FrameworkDevicePath)
#include EFI_PROTOCOL_DEFINITION (FirmwareVolume)
#include EFI_PROTOCOL_DEFINITION (FirmwareVolume2)
#include EFI_PROTOCOL_DEFINITION (DataHub)
#include EFI_PROTOCOL_DEFINITION (DriverBinding)
#include EFI_PROTOCOL_DEFINITION (ComponentName)
#include EFI_PROTOCOL_DEFINITION (ComponentName2)
#include EFI_PROTOCOL_DEFINITION (DriverConfiguration)
#include EFI_PROTOCOL_DEFINITION (DriverConfiguration2)
#include EFI_PROTOCOL_DEFINITION (DriverDiagnostics)
#include EFI_PROTOCOL_DEFINITION (DriverDiagnostics2)

#include EFI_PROTOCOL_DEFINITION (DebugMask)

#if defined(__GNUC__) && defined(ECP_CPU_IPF)

VOID
EFIAPI
EcpEfiBreakPoint (
  VOID
  )
/*++

Routine Description:

  Generates a breakpoint on the CPU.

  Generates a breakpoint on the CPU. The breakpoint must be implemented such
  that code can resume normal execution after the breakpoint.

Arguments:

  VOID

Returns:

  VOID

--*/
;

VOID
EFIAPI
EcpMemoryFence (
  VOID
  )
/*++

Routine Description:

  Used to serialize load and store operations.

  All loads and stores that proceed calls to this function are guaranteed to be
  globally visible when this function returns.

Arguments:

  VOID

Returns:

  VOID

--*/
;

#endif

typedef struct {
  CHAR8   *Language;
  CHAR16  *UnicodeString;
} EFI_UNICODE_STRING_TABLE;
#if (EFI_SPECIFICATION_VERSION >= 0x00020000)
#define LANGUAGE_CODE_ENGLISH    "en-US"
#else
#define LANGUAGE_CODE_ENGLISH    "eng"
#endif

//
// Macros for EFI Driver Library Functions that are really EFI Boot Services
//
#define EfiCopyMem(_Destination, _Source, _Length)  gBS->CopyMem ((_Destination), (_Source), (_Length))
#define EfiSetMem(_Destination, _Length, _Value)    gBS->SetMem ((_Destination), (_Length), (_Value))
#define EfiZeroMem(_Destination, _Length)           gBS->SetMem ((_Destination), (_Length), 0)

//
// Driver Lib Globals.
//
extern EFI_BOOT_SERVICES        *gBS;
extern EFI_DXE_SERVICES         *gDS;
extern EFI_RUNTIME_SERVICES     *gRT;
extern EFI_SYSTEM_TABLE         *gST;
extern UINTN                    gErrorLevel;
extern EFI_GUID                 gEfiCallerIdGuid;
extern EFI_DEBUG_MASK_PROTOCOL  *gDebugMaskInterface;

EFI_STATUS
EfiInitializeDriverLib (
  IN EFI_HANDLE           ImageHandle,
  IN EFI_SYSTEM_TABLE     *SystemTable
  )
/*++

Routine Description:

  Intialize Driver Lib if it has not yet been initialized.

Arguments:

  ImageHandle     - The firmware allocated handle for the EFI image.

  SystemTable     - A pointer to the EFI System Table.

Returns:

  EFI_STATUS always returns EFI_SUCCESS

--*/
;

EFI_STATUS
DxeInitializeDriverLib (
  IN EFI_HANDLE           ImageHandle,
  IN EFI_SYSTEM_TABLE     *SystemTable
  )
/*++

Routine Description:

  Intialize Driver Lib if it has not yet been initialized.

Arguments:

  ImageHandle     - The firmware allocated handle for the EFI image.

  SystemTable     - A pointer to the EFI System Table.

Returns:

  EFI_STATUS always returns EFI_SUCCESS

--*/
;

EFI_STATUS
EfiLibInstallDriverBinding (
  IN EFI_HANDLE                   ImageHandle,
  IN EFI_SYSTEM_TABLE             *SystemTable,
  IN EFI_DRIVER_BINDING_PROTOCOL  *DriverBinding,
  IN EFI_HANDLE                   DriverBindingHandle
  )
/*++

Routine Description:

  Intialize a driver by installing the Driver Binding Protocol onto the
  driver's DriverBindingHandle.  This is typically the same as the driver's
  ImageHandle, but it can be different if the driver produces multiple
  DriverBinding Protocols.  This function also initializes the EFI Driver
  Library that initializes the global variables gST, gBS, gRT.

Arguments:

  ImageHandle         - The image handle of the driver

  SystemTable         - The EFI System Table that was passed to the driver's entry point

  DriverBinding       - A Driver Binding Protocol instance that this driver is producing

  DriverBindingHandle - The handle that DriverBinding is to be installe onto.  If this
                        parameter is NULL, then a new handle is created.

Returns:

  EFI_SUCCESS is DriverBinding is installed onto DriverBindingHandle

  Otherwise, then return status from gBS->InstallProtocolInterface()

--*/
;

EFI_STATUS
EfiLibInstallAllDriverProtocols (
  IN EFI_HANDLE                         ImageHandle,
  IN EFI_SYSTEM_TABLE                   *SystemTable,
  IN EFI_DRIVER_BINDING_PROTOCOL        *DriverBinding,
  IN EFI_HANDLE                         DriverBindingHandle,
  IN EFI_COMPONENT_NAME_PROTOCOL        *ComponentName, OPTIONAL
  IN EFI_DRIVER_CONFIGURATION_PROTOCOL  *DriverConfiguration, OPTIONAL
  IN EFI_DRIVER_DIAGNOSTICS_PROTOCOL    *DriverDiagnostics OPTIONAL
  )
/*++

Routine Description:

  Intialize a driver by installing the Driver Binding Protocol onto the
  driver's DriverBindingHandle.  This is typically the same as the driver's
  ImageHandle, but it can be different if the driver produces multiple
  DriverBinding Protocols.  This function also initializes the EFI Driver
  Library that initializes the global variables gST, gBS, gRT.

Arguments:

  ImageHandle         - The image handle of the driver

  SystemTable         - The EFI System Table that was passed to the driver's entry point

  DriverBinding       - A Driver Binding Protocol instance that this driver is producing

  DriverBindingHandle - The handle that DriverBinding is to be installe onto.  If this
                        parameter is NULL, then a new handle is created.

  ComponentName       - A Component Name Protocol instance that this driver is producing

  DriverConfiguration - A Driver Configuration Protocol instance that this driver is producing

  DriverDiagnostics   - A Driver Diagnostics Protocol instance that this driver is producing

Returns:

  EFI_SUCCESS if all the protocols were installed onto DriverBindingHandle

  Otherwise, then return status from gBS->InstallProtocolInterface()

--*/
;

EFI_STATUS
EfiLibInstallAllDriverProtocols2 (
  IN EFI_HANDLE                         ImageHandle,
  IN EFI_SYSTEM_TABLE                   *SystemTable,
  IN EFI_DRIVER_BINDING_PROTOCOL        *DriverBinding,
  IN EFI_HANDLE                         DriverBindingHandle,
  IN EFI_COMPONENT_NAME2_PROTOCOL       *ComponentName2, OPTIONAL
  IN EFI_DRIVER_CONFIGURATION2_PROTOCOL *DriverConfiguration2, OPTIONAL
  IN EFI_DRIVER_DIAGNOSTICS2_PROTOCOL   *DriverDiagnostics2 OPTIONAL
  )
/*++

Routine Description:

  Intialize a driver by installing the Driver Binding Protocol onto the
  driver's DriverBindingHandle.  This is typically the same as the driver's
  ImageHandle, but it can be different if the driver produces multiple
  DriverBinding Protocols.  This function also initializes the EFI Driver
  Library that initializes the global variables gST, gBS, gRT.

Arguments:

  ImageHandle         - The image handle of the driver

  SystemTable         - The EFI System Table that was passed to the driver's entry point

  DriverBinding       - A Driver Binding Protocol instance that this driver is producing

  DriverBindingHandle - The handle that DriverBinding is to be installe onto.  If this
                        parameter is NULL, then a new handle is created.

  ComponentName2      - A Component Name2 Protocol instance that this driver is producing

  DriverConfiguration2- A Driver Configuration2 Protocol instance that this driver is producing

  DriverDiagnostics2  - A Driver Diagnostics2 Protocol instance that this driver is producing

Returns:

  EFI_SUCCESS if all the protocols were installed onto DriverBindingHandle

  Otherwise, then return status from gBS->InstallProtocolInterface()

--*/
;

EFI_STATUS
EfiLibGetSystemConfigurationTable (
  IN EFI_GUID *TableGuid,
  OUT VOID **Table
  )
/*++

Routine Description:

  Return the EFI 1.0 System Tabl entry with TableGuid

Arguments:

  TableGuid - Name of entry to return in the system table
  Table     - Pointer in EFI system table associated with TableGuid

Returns:

  EFI_SUCCESS - Table returned;
  EFI_NOT_FOUND - TableGuid not in EFI system table

--*/
;

BOOLEAN
EfiLibCompareLanguage (
  CHAR8  *Language1,
  CHAR8  *Language2
  )
/*++

Routine Description:

  Compare two languages to say whether they are identical.

Arguments:

  Language1 - first language
  Language2 - second language

Returns:

  TRUE      - identical
  FALSE     - not identical

--*/
;

//
// DevicePath.c
//
BOOLEAN
EfiIsDevicePathMultiInstance (
  IN EFI_DEVICE_PATH_PROTOCOL  *DevicePath
  )
/*++

Routine Description:
  Return TRUE is this is a multi instance device path.

Arguments:
  DevicePath  - A pointer to a device path data structure.

Returns:
  TRUE - If DevicePath is multi instance.
  FALSE - If DevicePath is not multi instance.

--*/
;

EFI_DEVICE_PATH_PROTOCOL        *
EfiDevicePathInstance (
  IN OUT EFI_DEVICE_PATH_PROTOCOL   **DevicePath,
  OUT UINTN                         *Size
  )
/*++

Routine Description:
  Function retrieves the next device path instance from a device path data structure.

Arguments:
  DevicePath           - A pointer to a device path data structure.

  Size                 - A pointer to the size of a device path instance in bytes.

Returns:

  This function returns a pointer to the current device path instance.
  In addition, it returns the size in bytes of the current device path instance in Size,
  and a pointer to the next device path instance in DevicePath.
  If there are no more device path instances in DevicePath, then DevicePath will be set to NULL.

--*/
;

UINTN
EfiDevicePathSize (
  IN EFI_DEVICE_PATH_PROTOCOL  *DevPath
  )
/*++

Routine Description:

  Calculate the size of a whole device path.

Arguments:

  DevPath - The pointer to the device path data.

Returns:

  Size of device path data structure..

--*/
;

EFI_DEVICE_PATH_PROTOCOL        *
EfiAppendDevicePath (
  IN EFI_DEVICE_PATH_PROTOCOL  *Src1,
  IN EFI_DEVICE_PATH_PROTOCOL  *Src2
  )
/*++

Routine Description:
  Function is used to append a Src1 and Src2 together.

Arguments:
  Src1  - A pointer to a device path data structure.

  Src2  - A pointer to a device path data structure.

Returns:

  A pointer to the new device path is returned.
  NULL is returned if space for the new device path could not be allocated from pool.
  It is up to the caller to free the memory used by Src1 and Src2 if they are no longer needed.

--*/
;

EFI_DEVICE_PATH_PROTOCOL        *
EfiDevicePathFromHandle (
  IN EFI_HANDLE       Handle
  )
/*++

Routine Description:

  Locate device path protocol interface on a device handle.

Arguments:

  Handle  - The device handle

Returns:

  Device path protocol interface located.

--*/
;

EFI_DEVICE_PATH_PROTOCOL        *
EfiDuplicateDevicePath (
  IN EFI_DEVICE_PATH_PROTOCOL  *DevPath
  )
/*++

Routine Description:
  Duplicate a new device path data structure from the old one.

Arguments:
  DevPath  - A pointer to a device path data structure.

Returns:
  A pointer to the new allocated device path data.
  Caller must free the memory used by DevicePath if it is no longer needed.

--*/
;

EFI_DEVICE_PATH_PROTOCOL        *
EfiAppendDevicePathNode (
  IN EFI_DEVICE_PATH_PROTOCOL  *Src1,
  IN EFI_DEVICE_PATH_PROTOCOL  *Src2
  )
/*++

Routine Description:
  Function is used to append a device path node to the end of another device path.

Arguments:
  Src1  - A pointer to a device path data structure.

  Src2 - A pointer to a device path data structure.

Returns:
  This function returns a pointer to the new device path.
  If there is not enough temporary pool memory available to complete this function,
  then NULL is returned.

--*/
;

EFI_DEVICE_PATH_PROTOCOL        *
EfiFileDevicePath (
  IN EFI_HANDLE               Device  OPTIONAL,
  IN CHAR16                   *FileName
  )
/*++

Routine Description:
  Create a device path that appends a MEDIA_DEVICE_PATH with
  FileNameGuid to the device path of DeviceHandle.

Arguments:
  Device   - Optional Device Handle to use as Root of the Device Path

  FileName - FileName

Returns:
  EFI_DEVICE_PATH_PROTOCOL that was allocated from dynamic memory
  or NULL pointer.

--*/
;

EFI_DEVICE_PATH_PROTOCOL        *
EfiAppendDevicePathInstance (
  IN EFI_DEVICE_PATH_PROTOCOL  *Src,
  IN EFI_DEVICE_PATH_PROTOCOL  *Instance
  )
/*++

Routine Description:

  Append a device path instance to another.

Arguments:

  Src       - The device path instance to be appended with.
  Instance  - The device path instance appending the other.

Returns:

  The contaction of these two.

--*/
;

//
// Lock.c
//
typedef struct {
  EFI_TPL Tpl;
  EFI_TPL OwnerTpl;
  UINTN   Lock;
} EFI_LOCK;

VOID
EfiInitializeLock (
  IN OUT EFI_LOCK *Lock,
  IN EFI_TPL      Priority
  )
/*++

Routine Description:

  Initialize a basic mutual exclusion lock.   Each lock
  provides mutual exclusion access at it's task priority
  level.  Since there is no-premption (at any TPL) or
  multiprocessor support, acquiring the lock only consists
  of raising to the locks TPL.

  Note on a check build ASSERT()s are used to ensure proper
  lock usage.

Arguments:

  Lock        - The EFI_LOCK structure to initialize

  Priority    - The task priority level of the lock

Returns:

  An initialized Efi Lock structure.

--*/
;

//
// Macro to initialize the state of a lock when a lock variable is declared
//
#define EFI_INITIALIZE_LOCK_VARIABLE(Tpl) {Tpl,0,0}

VOID
EfiAcquireLock (
  IN EFI_LOCK *Lock
  )
/*++

Routine Description:

  Raising to the task priority level of the mutual exclusion
  lock, and then acquires ownership of the lock.

Arguments:

  Lock - The lock to acquire

Returns:

  None

--*/
;

EFI_STATUS
EfiAcquireLockOrFail (
  IN EFI_LOCK  *Lock
  )
/*++

Routine Description:

  Initialize a basic mutual exclusion lock.   Each lock
  provides mutual exclusion access at it's task priority
  level.  Since there is no-premption (at any TPL) or
  multiprocessor support, acquiring the lock only consists
  of raising to the locks TPL.

Arguments:

  Lock        - The EFI_LOCK structure to initialize

Returns:

  EFI_SUCCESS       - Lock Owned.
  EFI_ACCESS_DENIED - Reentrant Lock Acquisition, Lock not Owned.

--*/
;

VOID
EfiReleaseLock (
  IN EFI_LOCK *Lock
  )
/*++

Routine Description:

    Releases ownership of the mutual exclusion lock, and
    restores the previous task priority level.

Arguments:

    Lock - The lock to release

Returns:

    None

--*/
;

VOID *
EfiLibAllocatePool (
  IN  UINTN   AllocationSize
  )
/*++

Routine Description:

  Allocate EfiBootServicesData pool of size AllocationSize

Arguments:

  AllocationSize  - Pool size

Returns:

  Pointer to the pool allocated

--*/
;

VOID *
EfiLibAllocateRuntimePool (
  IN  UINTN   AllocationSize
  )
/*++

Routine Description:

  Allocate EfiRuntimeServicesData pool of size AllocationSize

Arguments:

  AllocationSize  - Pool size

Returns:

  Pointer to the pool allocated

--*/
;

VOID *
EfiLibAllocateZeroPool (
  IN  UINTN   AllocationSize
  )
/*++

Routine Description:

  Allocate EfiBootServicesData pool of size AllocationSize and set memory to zero.

Arguments:

  AllocationSize  - Pool size

Returns:

  Pointer to the pool allocated

--*/
;

VOID *
EfiLibAllocateRuntimeZeroPool (
  IN  UINTN   AllocationSize
  )
/*++

Routine Description:

  Allocate EfiRuntimeServicesData pool of size AllocationSize and set memory to zero.

Arguments:

  AllocationSize  - Pool size

Returns:

  Pointer to the pool allocated

--*/
;

VOID *
EfiLibAllocateCopyPool (
  IN  UINTN   AllocationSize,
  IN  VOID    *Buffer
  )
/*++

Routine Description:

  Allocate BootServicesData pool and use a buffer provided by
  caller to fill it.

Arguments:

  AllocationSize  - The size to allocate

  Buffer          - Buffer that will be filled into the buffer allocated

Returns:

  Pointer of the buffer allocated.

--*/
;

VOID *
EfiLibAllocateRuntimeCopyPool (
  IN  UINTN            AllocationSize,
  IN  VOID             *Buffer
  )
/*++

Routine Description:

  Allocate RuntimeServicesData pool and use a buffer provided by
  caller to fill it.

Arguments:

  AllocationSize  - The size to allocate

  Buffer          - Buffer that will be filled into the buffer allocated

Returns:

  Pointer of the buffer allocated.

--*/
;

//
// Event.c
//
EFI_EVENT
EfiLibCreateProtocolNotifyEvent (
  IN EFI_GUID             *ProtocolGuid,
  IN EFI_TPL              NotifyTpl,
  IN EFI_EVENT_NOTIFY     NotifyFunction,
  IN VOID                 *NotifyContext,
  OUT VOID                **Registration
  )
/*++

Routine Description:

  Create a protocol notification event and return it.

Arguments:

  ProtocolGuid    - Protocol to register notification event on.

  NotifyTpl       - Maximum TPL to single the NotifyFunction.

  NotifyFunction  - EFI notification routine.

  NotifyContext   - Context passed into Event when it is created.

  Registration    - Registration key returned from RegisterProtocolNotify().

Returns:

  The EFI_EVENT that has been registered to be signaled when a ProtocolGuid
  is added to the system.

--*/
;

EFI_STATUS
EfiLibNamedEventSignal (
  IN EFI_GUID            *Name
  )
/*++

Routine Description:
  Signals a named event. All registered listeners will run.
  The listeners should register using EfiLibNamedEventListen() function.

  NOTE: For now, the named listening/signalling is implemented
  on a protocol interface being installed and uninstalled.
  In the future, this maybe implemented based on a dedicated mechanism.

Arguments:
  Name - Name to perform the signaling on. The name is a GUID.

Returns:
  EFI_SUCCESS if successfull.

--*/
;

EFI_STATUS
EfiLibNamedEventListen (
  IN EFI_GUID             * Name,
  IN EFI_TPL              NotifyTpl,
  IN EFI_EVENT_NOTIFY     NotifyFunction,
  IN VOID                 *NotifyContext
  )
/*++

Routine Description:
  Listenes to signals on the name.
  EfiLibNamedEventSignal() signals the event.

  NOTE: For now, the named listening/signalling is implemented
  on a protocol interface being installed and uninstalled.
  In the future, this maybe implemented based on a dedicated mechanism.

Arguments:
  Name            - Name to register the listener on.
  NotifyTpl       - Maximum TPL to singnal the NotifyFunction.
  NotifyFunction  - The listener routine.
  NotifyContext   - Context passed into the listener routine.

Returns:
  EFI_SUCCESS if successful.

--*/
;

//
// Handle.c
//
EFI_STATUS
EfiLibLocateHandleProtocolByProtocols (
  IN OUT EFI_HANDLE        * Handle, OPTIONAL
  OUT    VOID              **Interface, OPTIONAL
  ...
  )
/*++
Routine Description:

  Function locates Protocol and/or Handle on which all Protocols specified
  as a variable list are installed.
  It supports continued search. The caller must assure that no handles are added
  or removed while performing continued search, by e.g., rising the TPL and not
  calling any handle routines. Otherwise the behavior is undefined.

Arguments:

  Handle        - The address of handle to receive the handle on which protocols
                  indicated by the variable list are installed.
                  If points to NULL, all handles are searched. If pointing to a
                  handle returned from previous call, searches starting from next handle.
                  If NULL, the parameter is ignored.

  Interface     - The address of a pointer to a protocol interface that will receive
                  the interface indicated by first variable argument.
                  If NULL, the parameter is ignored.

  ...           - A variable argument list containing protocol GUIDs. Must end with NULL.

Returns:

  EFI_SUCCESS  - All the protocols where found on same handle.
  EFI_NOT_FOUND - A Handle with all the protocols installed was not found.
  Other values as may be returned from LocateHandleBuffer() or HandleProtocol().

--*/
;

//
// Debug.c init
//
EFI_STATUS
EfiDebugAssertInit (
  VOID
  )
/*++

Routine Description:

  Locate Debug Assert Protocol and set as mDebugAssert

Arguments:

  None

Returns:

  Status code

--*/
;

//
// Unicode String Support
//
EFI_STATUS
EfiLibLookupUnicodeString (
  CHAR8                     *Language,
  CHAR8                     *SupportedLanguages,
  EFI_UNICODE_STRING_TABLE  *UnicodeStringTable,
  CHAR16                    **UnicodeString
  )
/*++

Routine Description:

  Translate a unicode string to a specified language if supported.

Arguments:

  Language              - The name of language to translate to
  SupportedLanguages    - Supported languages set
  UnicodeStringTable    - Pointer of one item in translation dictionary
  UnicodeString         - The translated string

Returns:

  EFI_INVALID_PARAMETER - Invalid parameter
  EFI_UNSUPPORTED       - System not supported this language or this string translation
  EFI_SUCCESS           - String successfully translated

--*/
;

EFI_STATUS
EfiLibAddUnicodeString (
  CHAR8                     *Language,
  CHAR8                     *SupportedLanguages,
  EFI_UNICODE_STRING_TABLE  **UnicodeStringTable,
  CHAR16                    *UnicodeString
  )
/*++

Routine Description:

  Add an translation to the dictionary if this language if supported.

Arguments:

  Language              - The name of language to translate to
  SupportedLanguages    - Supported languages set
  UnicodeStringTable    - Translation dictionary
  UnicodeString         - The corresponding string for the language to be translated to

Returns:

  EFI_INVALID_PARAMETER - Invalid parameter
  EFI_UNSUPPORTED       - System not supported this language
  EFI_ALREADY_STARTED   - Already has a translation item of this language
  EFI_OUT_OF_RESOURCES  - No enough buffer to be allocated
  EFI_SUCCESS           - String successfully translated

--*/
;

EFI_STATUS
EfiLibFreeUnicodeStringTable (
  EFI_UNICODE_STRING_TABLE  *UnicodeStringTable
  )
/*++

Routine Description:

  Free a string table.

Arguments:

  UnicodeStringTable      - The string table to be freed.

Returns:

  EFI_SUCCESS       - The table successfully freed.

--*/
;

EFI_STATUS
EfiLibReportStatusCode (
  IN EFI_STATUS_CODE_TYPE     Type,
  IN EFI_STATUS_CODE_VALUE    Value,
  IN UINT32                   Instance,
  IN EFI_GUID                 *CallerId OPTIONAL,
  IN EFI_STATUS_CODE_DATA     *Data     OPTIONAL
  )
/*++

Routine Description:

  Report status code.

Arguments:

  Type        - Code type
  Value       - Code value
  Instance    - Instance number
  CallerId    - Caller name
  DevicePath  - Device path that to be reported

Returns:

  Status code.

  EFI_OUT_OF_RESOURCES - No enough buffer could be allocated

--*/
;

EFI_STATUS
ReportStatusCodeWithDevicePath (
  IN EFI_STATUS_CODE_TYPE     Type,
  IN EFI_STATUS_CODE_VALUE    Value,
  IN UINT32                   Instance,
  IN EFI_GUID                 * CallerId OPTIONAL,
  IN EFI_DEVICE_PATH_PROTOCOL * DevicePath
  )
/*++

Routine Description:

  Report device path through status code.

Arguments:

  Type        - Code type
  Value       - Code value
  Instance    - Instance number
  CallerId    - Caller name
  DevicePath  - Device path that to be reported

Returns:

  Status code.

  EFI_OUT_OF_RESOURCES - No enough buffer could be allocated

--*/
;

EFI_STATUS
EFIAPI
EfiCreateEventLegacyBoot (
  IN EFI_TPL                      NotifyTpl,
  IN EFI_EVENT_NOTIFY             NotifyFunction,
  IN VOID                         *NotifyContext,
  OUT EFI_EVENT                   *LegacyBootEvent
  )
/*++

Routine Description:
  Create a Legacy Boot Event.
  Tiano extended the CreateEvent Type enum to add a legacy boot event type.
  This was bad as Tiano did not own the enum. In UEFI 2.0 CreateEventEx was
  added and now it's possible to not voilate the UEFI specification by
  declaring a GUID for the legacy boot event class. This library supports
  the EFI 1.10 form and UEFI 2.0 form and allows common code to work both ways.

Arguments:
  LegacyBootEvent  Returns the EFI event returned from gBS->CreateEvent(Ex)

Returns:
  EFI_SUCCESS   Event was created.
  Other         Event was not created.

--*/
;

EFI_STATUS
EFIAPI
EfiCreateEventReadyToBoot (
  IN EFI_TPL                      NotifyTpl,
  IN EFI_EVENT_NOTIFY             NotifyFunction,
  IN VOID                         *NotifyContext,
  OUT EFI_EVENT                   *ReadyToBootEvent
  )
/*++

Routine Description:
  Create a Read to Boot Event.

  Tiano extended the CreateEvent Type enum to add a ready to boot event type.
  This was bad as Tiano did not own the enum. In UEFI 2.0 CreateEventEx was
  added and now it's possible to not voilate the UEFI specification and use
  the ready to boot event class defined in UEFI 2.0. This library supports
  the EFI 1.10 form and UEFI 2.0 form and allows common code to work both ways.

Arguments:
  @param LegacyBootEvent  Returns the EFI event returned from gBS->CreateEvent(Ex)

Return:
  EFI_SUCCESS   - Event was created.
  Other         - Event was not created.

--*/
;

VOID
EFIAPI
EfiInitializeFwVolDevicepathNode (
  IN  MEDIA_FW_VOL_FILEPATH_DEVICE_PATH     *FvDevicePathNode,
  IN EFI_GUID                               *NameGuid
  )
/*++
Routine Description:
  Initialize a Firmware Volume (FV) Media Device Path node.

Arguments:
  FvDevicePathNode   - Pointer to a FV device path node to initialize
  NameGuid           - FV file name to use in FvDevicePathNode

--*/
;

EFI_GUID *
EFIAPI
EfiGetNameGuidFromFwVolDevicePathNode (
  IN  MEDIA_FW_VOL_FILEPATH_DEVICE_PATH   *FvDevicePathNode
  )
/*++
Routine Description:
  Check to see if the Firmware Volume (FV) Media Device Path is valid.

Arguments:
  FvDevicePathNode   - Pointer to FV device path to check

Return:
  NULL    - FvDevicePathNode is not valid.
  Other   - FvDevicePathNode is valid and pointer to NameGuid was returned.

--*/
;

VOID
EfiLibSafeFreePool (
  IN  VOID             *Buffer
  )
/*++

Routine Description:

  Free pool safely.

Arguments:

  Buffer          - The allocated pool entry to free

Returns:

  Pointer of the buffer allocated.

--*/
;

EFI_STATUS
EfiLibTestManagedDevice (
  IN EFI_HANDLE       ControllerHandle,
  IN EFI_HANDLE       DriverBindingHandle,
  IN EFI_GUID         *ManagedProtocolGuid
  )
/*++

Routine Description:

  Test to see if the controller is managed by a specific driver.

Arguments:

  ControllerHandle          - Handle for controller to test

  DriverBindingHandle       - Driver binding handle for controller

  ManagedProtocolGuid       - The protocol guid the driver opens on controller

Returns:

  EFI_SUCCESS     - The controller is managed by the driver

  EFI_UNSUPPORTED - The controller is not managed by the driver

--*/
;

EFI_STATUS
EfiLibTestChildHandle (
  IN EFI_HANDLE       ControllerHandle,
  IN EFI_HANDLE       ChildHandle,
  IN EFI_GUID         *ConsumedGuid
  )
/*++

Routine Description:

  Test to see if the child handle is the child of the controller

Arguments:

  ControllerHandle          - Handle for controller (parent)

  ChildHandle               - Child handle to test

  ConsumsedGuid             - Protocol guid consumed by child from controller

Returns:

  EFI_SUCCESS     - The child handle is the child of the controller

  EFI_UNSUPPORTED - The child handle is not the child of the controller

--*/
;
#endif


text:
package net.soulwolf.image.picturelib.view.cropwindow.edge;

/**
 * Simple class to hold a pair of Edges.
 */
public class EdgePair {

    // Member Variables ////////////////////////////////////////////////////////

    public Edge primary;
    public Edge secondary;

    // Constructor /////////////////////////////////////////////////////////////

    public EdgePair(Edge edge1, Edge edge2) {
        primary = edge1;
        secondary = edge2;
    }
}

redpajama_set_name: RedPajamaGithub


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

namespace ReportsOrganizer.Localization.Settings {
    using System;

    /// <summary>
    ///   A strongly-typed resource class, for looking up localized strings, etc.
    /// </summary>
    // This class was auto-generated by the StronglyTypedResourceBuilder
    // class via a tool like ResGen or Visual Studio.
    // To add or remove a member, edit your .ResX file then rerun ResGen
    // with the /str option, or rebuild your VS project.
    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")]
    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
    internal class Settings {

        private static global::System.Resources.ResourceManager resourceMan;

        private static global::System.Globalization.CultureInfo resourceCulture;

        [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
        internal Settings() {
        }

        /// <summary>
        ///   Returns the cached ResourceManager instance used by this class.
        /// </summary>
        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
        internal static global::System.Resources.ResourceManager ResourceManager {
            get {
                if (object.ReferenceEquals(resourceMan, null)) {
                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ReportsOrganizer.Localization.Settings.Settings", typeof(Settings).Assembly);
                    resourceMan = temp;
                }
                return resourceMan;
            }
        }

        /// <summary>
        ///   Overrides the current thread's CurrentUICulture property for all
        ///   resource lookups using this strongly typed resource class.
        /// </summary>
        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
        internal static global::System.Globalization.CultureInfo Culture {
            get {
                return resourceCulture;
            }
            set {
                resourceCulture = value;
            }
        }

        /// <summary>
        ///   Looks up a localized string similar to Start ReportsOrginizer with Windows.
        /// </summary>
        internal static string General_AutoRun {
            get {
                return ResourceManager.GetString("General_AutoRun", resourceCulture);
            }
        }

        /// <summary>
        ///   Looks up a localized string similar to Display language.
        /// </summary>
        internal static string General_Language {
            get {
                return ResourceManager.GetString("General_Language", resourceCulture);
            }
        }

        /// <summary>
        ///   Looks up a localized string similar to Remember last location of Notification window.
        /// </summary>
        internal static string General_RememberLastLocation {
            get {
                return ResourceManager.GetString("General_RememberLastLocation", resourceCulture);
            }
        }

        /// <summary>
        ///   Looks up a localized string similar to Start ReportsOrginizer minimized in the system tray.
        /// </summary>
        internal static string General_RunMinimized {
            get {
                return ResourceManager.GetString("General_RunMinimized", resourceCulture);
            }
        }

        /// <summary>
        ///   Looks up a localized string similar to General.
        /// </summary>
        internal static string Group_General {
            get {
                return ResourceManager.GetString("Group_General", resourceCulture);
            }
        }

        /// <summary>
        ///   Looks up a localized string similar to Manage projects.
        /// </summary>
        internal static string Group_ManageProjects {
            get {
                return ResourceManager.GetString("Group_ManageProjects", resourceCulture);
            }
        }

        /// <summary>
        ///   Looks up a localized string similar to Notification.
        /// </summary>
        internal static string Group_Notification {
            get {
                return ResourceManager.GetString("Group_Notification", resourceCulture);
            }
        }

        /// <summary>
        ///   Looks up a localized string similar to Personalization.
        /// </summary>
        internal static string Group_Personalization {
            get {
                return ResourceManager.GetString("Group_Personalization", resourceCulture);
            }
        }

        /// <summary>
        ///   Looks up a localized string similar to Settings.
        /// </summary>
        internal static string Group_Settings {
            get {
                return ResourceManager.GetString("Group_Settings", resourceCulture);
            }
        }

        /// <summary>
        ///   Looks up a localized string similar to Add project.
        /// </summary>
        internal static string ManageProjects_AddProject {
            get {
                return ResourceManager.GetString("ManageProjects_AddProject", resourceCulture);
            }
        }

        /// <summary>
        ///   Looks up a localized string similar to Full name.
        /// </summary>
        internal static string ManageProjects_FullName {
            get {
                return ResourceManager.GetString("ManageProjects_FullName", resourceCulture);
            }
        }

        /// <summary>
        ///   Looks up a localized string similar to Actual.
        /// </summary>
        internal static string ManageProjects_IsActual {
            get {
                return ResourceManager.GetString("ManageProjects_IsActual", resourceCulture);
            }
        }

        /// <summary>
        ///   Looks up a localized string similar to Select an project to edit.
        /// </summary>
        internal static string ManageProjects_SelectProject {
            get {
                return ResourceManager.GetString("ManageProjects_SelectProject", resourceCulture);
            }
        }

        /// <summary>
        ///   Looks up a localized string similar to Short name.
        /// </summary>
        internal static string ManageProjects_ShortName {
            get {
                return ResourceManager.GetString("ManageProjects_ShortName", resourceCulture);
            }
        }

        /// <summary>
        ///   Looks up a localized string similar to Don't show notification at selected times.
        /// </summary>
        internal static string Notification_IgnoreTime {
            get {
                return ResourceManager.GetString("Notification_IgnoreTime", resourceCulture);
            }
        }

        /// <summary>
        ///   Looks up a localized string similar to Show notification at intervals.
        /// </summary>
        internal static string Notification_Interval {
            get {
                return ResourceManager.GetString("Notification_Interval", resourceCulture);
            }
        }

        /// <summary>
        ///   Looks up a localized string similar to Show notification at selected times.
        /// </summary>
        internal static string Notification_SelectedTime {
            get {
                return ResourceManager.GetString("Notification_SelectedTime", resourceCulture);
            }
        }

        /// <summary>
        ///   Looks up a localized string similar to Choose your color theme.
        /// </summary>
        internal static string Personalization_Theme {
            get {
                return ResourceManager.GetString("Personalization_Theme", resourceCulture);
            }
        }
    }
}


text:
using UnityEngine;
using System.Collections;

public class CreatureManager_Script : MonoBehaviour
{
	public GameObject caterpillarPrefab;
	public GameObject pestPrefab;

	GameObject[] caterpillars;

	// Use this for initialization
	void Start ()
	{
		caterpillars = new GameObject[10];

		for (int c=0; c < 10; c++)
			caterpillars[c] = CreateCaterpillar();
	}

	// Update is called once per frame
	void Update ()
	{
		UpdateMetrics();
	}

	void UpdateMetrics()
	{
		/*
		for (int c=0; c < 10; c++)
		{
			if (caterpillars[c] == null)
				caterpillars[c] = CreateCaterpillar();
		}*/
	}

	GameObject CreateCaterpillar()
	{

		float xloc = Random.Range (-30, 30);
		float zloc;

		if (xloc > -2)
		{
			zloc = Random.Range (-16, 18);
		}
		else
		{
			zloc = Random.Range (-16, 4);
		}

		return Instantiate (caterpillarPrefab, new Vector3(xloc, -.2f, zloc), Quaternion.identity) as GameObject;

	}

	public void DestroyCaterpillar(GameObject caterpillar_in)
	{
		for (int c=0; c < 10; c++)
		{
			if (caterpillars[c] == caterpillar_in)
			{
				Destroy (caterpillar_in);
				caterpillars[c] = CreateCaterpillar ();
			}
		}
	}
}


text:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    xmlns:tools="http://schemas.android.com/tools"
    android:background="@color/color_blue_qb"
    android:paddingBottom="20dp"
    android:paddingLeft="20dp"
    android:paddingRight="20dp"
    android:paddingTop="20dp"
    android:gravity="top"
    android:id="@+id/nav_header_layout"
    android:clickable="true">

    <RelativeLayout
        android:id="@+id/container_avatar"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"
        android:layout_alignParentTop="true"
        android:gravity="center">

        <ImageView
            android:id="@+id/image_user_avatar"
            android:layout_width="60dp"
            android:layout_height="60dp"
            android:background="@drawable/shape_oval_white"
            android:layout_centerInParent="true"
            android:scaleType="centerInside"
            android:padding="3dp"
            tools:ignore="ContentDescription"
            tools:src="@color/random_color_3" />

        <TextView
            android:id="@+id/user_avatar_title"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerInParent="true"
            android:layout_marginTop="8dp"
            android:paddingBottom="3dp"
            android:textColor="@color/text_color_white"
            android:textSize="22sp"
            android:textStyle="normal"
            tools:text="E" />
    </RelativeLayout>

    <TextView
        android:id="@+id/nav_head_username"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="User Name"
        android:textSize="17sp"
        android:textStyle="bold"
        android:layout_marginTop="8dp"
        android:textColor="@color/white"
        android:layout_below="@+id/container_avatar"
        android:layout_alignParentLeft="true"/>

    <TextView
        android:id="@+id/nav_head_login"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:textSize="13sp"
        android:layout_marginTop="4dp"
        android:text="username@quickblox.com"
        android:textColor="@color/white"
        android:layout_alignParentLeft="true"
        android:layout_below="@+id/nav_head_username"/>

    <TextView
        android:id="@+id/nav_head_user_id"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:textSize="13sp"
        android:layout_marginTop="4dp"
        android:text="8374563785"
        android:textColor="@color/white"
        android:layout_alignParentLeft="true"
        android:layout_below="@+id/nav_head_login"/>

</RelativeLayout>


text:
<?php

namespace SMW\SQLStore\ListLookup;

use SMW\InvalidPropertyException;
use SMW\SQLStore\ListLookup;
use SMW\DIProperty;
use SMW\Store;
use SMWDIError as DIError;
use SMWRequestOptions as RequestOptions;
use RuntimeException;

/**
 * @license GNU GPL v2+
 * @since 2.2
 *
 * @author mwjames
 * @author Nischay Nahata
 */
class UndeclaredPropertyListLookup implements ListLookup {

	/**
	 * @var Store
	 */
	private $store;

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

	/**
	 * @var RequestOptions
	 */
	private $requestOptions;

	/**
	 * @since 2.2
	 *
	 * @param Store $store
	 * @param string $defaultPropertyType
	 * @param RequestOptions $requestOptions|null
	 */
	public function __construct( Store $store, $defaultPropertyType, RequestOptions $requestOptions = null ) {
		$this->store = $store;
		$this->defaultPropertyType = $defaultPropertyType;
		$this->requestOptions = $requestOptions;
	}

	/**
	 * @since 2.2
	 *
	 * @return DIProperty[]
	 * @throws RuntimeException
	 */
	public function fetchList() {

		if ( $this->requestOptions === null ) {
			throw new RuntimeException( "Missing requestOptions" );
		}

		// Wanted Properties must have the default type
		$propertyTable = $this->getPropertyTableForType( $this->defaultPropertyType );

		if ( $propertyTable->isFixedPropertyTable() ) {
			return array();
		}

		return $this->buildPropertyList( $this->selectPropertiesFromTable( $propertyTable ) );
	}

	/**
	 * @since 2.2
	 *
	 * @return boolean
	 */
	public function isCached() {
		return false;
	}

	/**
	 * @since 2.2
	 *
	 * @return integer
	 */
	public function getTimestamp() {
		return wfTimestamp( TS_UNIX );
	}

	/**
	 * @since 2.2
	 *
	 * @return string
	 */
	public function getLookupIdentifier() {
		return __METHOD__ . json_encode( (array)$this->requestOptions );
	}

	private function selectPropertiesFromTable( $propertyTable ) {

		$options = $this->store->getSQLOptions( $this->requestOptions, 'title' );
		$idTable = $this->store->getObjectIds()->getIdTable();

		$options['ORDER BY'] = 'count DESC';
		$options['GROUP BY'] = 'smw_title';

		$conditions = array(
			'smw_id > 50', // FIXME Use \SMWSql3SmwIds::PPBORDERID
			'page_id IS NULL',
		);

		$db = $this->store->getConnection( 'mw.db' );

		$res = $db->select(
			array( $idTable, 'page', $propertyTable->getName() ),
			array( 'smw_title', 'COUNT(*) as count' ),
			$conditions,
			__METHOD__,
			$options,
			array(
				$idTable => array(
					'INNER JOIN', 'p_id=smw_id'
				),
				'page' => array(
					'LEFT JOIN', array( 'page_namespace=' . $db->addQuotes( SMW_NS_PROPERTY ), 'page_title=smw_title'  )
				)
			)
		);

		return $res;
	}

	private function buildPropertyList( $res ) {

		$result = array();

		foreach ( $res as $row ) {
			$result[] = array( $this->addPropertyFor( $row->smw_title ), $row->count );
		}

		return $result;
	}

	private function addPropertyFor( $title ) {

		try {
			$property = new DIProperty( $title );
		} catch ( InvalidPropertyException $e ) {
			$property = new DIError( new \Message( 'smw_noproperty', array( $title ) ) );
		}

		return $property;
	}

	private function getPropertyTableForType( $type ) {

		$propertyTables = $this->store->getPropertyTables();
		$tableIdForType = $this->store->findTypeTableId( $type );

		if ( isset( $propertyTables[$tableIdForType] ) ) {
			return $propertyTables[$tableIdForType];
		}

		throw new RuntimeException( "Tried to access a table that doesn't exist for {$type}." );
	}

}


text:
let request = null,
    exit = null,
    change = null,
    error = null,
    element = null,
    enabled = null;

const docEl = (typeof document !== 'undefined' && document.documentElement) || {};

if (typeof docEl.requestFullscreen !== 'undefined') {
    request = 'requestFullscreen';
    exit = 'exitFullscreen';
    change = 'fullscreenchange';
    error = 'fullscreenerror';
    element = 'fullscreenElement';
    enabled = 'fullscreenEnabled';
} else if (typeof docEl.mozRequestFullScreen !== 'undefined') {
    request = 'mozRequestFullScreen';
    exit = 'mozCancelFullScreen';
    change = 'mozfullscreenchange';
    error = 'mozfullscreenerror';
    element = 'mozFullScreenElement';
    enabled = 'mozFullScreenEnabled';
} else if (typeof docEl.msRequestFullscreen !== 'undefined') {
    request = 'msRequestFullscreen';
    exit = 'msExitFullscreen';
    change = 'MSFullscreenChange';
    error = 'MSFullscreenError';
    element = 'msFullscreenElement';
    enabled = 'msFullscreenEnabled';
} else if (typeof docEl.webkitRequestFullscreen !== 'undefined') {
    request = 'webkitRequestFullscreen';
    exit = 'webkitExitFullscreen';
    change = 'webkitfullscreenchange';
    error = 'webkitFullscreenError';
    element = 'webkitFullscreenElement';
    enabled = 'webkitFullscreenEnabled';
}

export default {
    request,
    exit,
    change,
    error,
    element,
    enabled
};


text:
"""
Collection of Amazon Web Services related jobs. Due to the distributed nature
of AWS, executing calls in parallel is super useful.
"""

import time
from Queue import Queue

from workerpool import WorkerPool, SimpleJob, EquippedWorker

try:
    import boto
except ImportError:
    print """
    This module requires `boto` to communicate with Amazon's web services.
    Install it using easy_install:
        easy_install boto
    """
    raise

class SDBToolBox(object):
    "Create a connection to SimpleDB and hold on to it."
    def __init__(self, domain):
        self.conn = boto.connect_sdb()
        self.domain = self.conn.get_domain(domain)

class SdbJob(SimpleJob):
    def run(self, toolbox):
        msg = "Method pointer must come from the Domain class"
        assert isinstance(toolbox.domain, self.method.im_class), msg
        r = self.method(toolbox.domain, *self.args)
        self.result.put(r)

def main():
    DOMAIN = "benchmark"
    conn = boto.connect_sdb()
    domain = conn.get_domain(DOMAIN)

    # Prepare item list
    items = []
    now = time.time()
    for i in domain:
        items.append(i)
    elapsed = time.time() - now

    if not items:
        print "No items found."
        return

    msg = "Fetched manifest of %d items in %f seconds, proceeding."
    print msg % (len(items), elapsed)

    # THE REAL MEAT:

    # Prepare the pool
    print "Initializing pool."

    def toolbox_factory():
        return SDBToolBox(DOMAIN)

    def worker_factory(job_queue):
        return EquippedWorker(job_queue, toolbox_factory)

    pool = WorkerPool(size=20, worker_factory=worker_factory)

    print "Starting to fetch items..."
    now = time.time()

    # Insert jobs
    results_queue = Queue()
    for i in items:
        j = SdbJob(results_queue, boto.sdb.domain.Domain.get_item, [i])
        pool.put(j)

    # Fetch results
    r = [results_queue.get() for i in items]
    elapsed = time.time() - now

    print "Fetched %d items paralleled in %f seconds." % (len(r), elapsed)

    pool.shutdown()

if __name__ == "__main__":
    main()


text:
/*
   -- MAGMA (version 1.6.1) --
   Univ. of Tennessee, Knoxville
   Univ. of California, Berkeley
   Univ. of Colorado, Denver
   @date January 2015

   @author Azzam Haidar
   @author Adrien Remy

   @precisions normal z -> s d c
 */
#include "common_magma.h"
#include "batched_kernel_param.h"

///////////////////////////////////////////////////////////////////////////////////////
/**
    Purpose
    -------
    ZGETRF computes an LU factorization of a general M-by-N matrix A
    using partial pivoting with row interchanges.

    The factorization has the form
        A = P * L * U
    where P is a permutation matrix, L is lower triangular with unit
    diagonal elements (lower trapezoidal if m > n), and U is upper
    triangular (upper trapezoidal if m < n).

    This is the right-looking Level 3 BLAS version of the algorithm.

    If the current stream is NULL, this version replaces it with a new
    stream to overlap computation with communication.

    Arguments
    ---------
    @param[in]
    m       INTEGER
            The number of rows of the matrix A.  M >= 0.

    @param[in]
    n       INTEGER
            The number of columns of the matrix A.  N >= 0.

    @param[in,out]
    dA      COMPLEX_16 array on the GPU, dimension (LDDA,N).
            On entry, the M-by-N matrix to be factored.
            On exit, the factors L and U from the factorization
            A = P*L*U; the unit diagonal elements of L are not stored.

    @param[in]
    ldda     INTEGER
            The leading dimension of the array A.  LDDA >= max(1,M).

    @param[out]
    ipiv    INTEGER array, dimension (min(M,N))
            The pivot indices; for 1 <= i <= min(M,N), row i of the
            matrix was interchanged with row IPIV(i).

    @param[out]
    info    INTEGER
      -     = 0:  successful exit
      -     < 0:  if INFO = -i, the i-th argument had an illegal value
                  or another error occured, such as memory allocation failed.
      -     > 0:  if INFO = i, U(i,i) is exactly zero. The factorization
                  has been completed, but the factor U is exactly
                  singular, and division by zero will occur if it is used
                  to solve a system of equations.

    @ingroup magma_zgesv_comp
    ********************************************************************/
extern "C" magma_int_t
magma_zgetrf_nopiv_batched(
        magma_int_t m, magma_int_t n,
        magmaDoubleComplex **dA_array,
        magma_int_t lda,
        magma_int_t *info_array,
        magma_int_t batchCount, magma_queue_t queue)
{
#define A(i_, j_)  (A + (i_) + (j_)*lda)
    magma_int_t min_mn = min(m, n);
    cudaMemset(info_array, 0, batchCount*sizeof(magma_int_t));

    /* Check arguments */
    magma_int_t arginfo = 0;
    if (m < 0)
        arginfo = -1;
    else if (n < 0)
        arginfo = -2;
    else if (lda < max(1,m))
        arginfo = -4;

    if (arginfo != 0) {
        magma_xerbla( __func__, -(arginfo) );
        return arginfo;
    }

    /* Quick return if possible */
    if (m == 0 || n == 0)
        if(min_mn == 0 ) return arginfo;

    if( m >  2048 || n > 2048 ){
        printf("=========================================================================================\n");
        printf("   WARNING batched routines are designed for small sizes it might be better to use the\n   Native/Hybrid classical routines if you want performance\n");
        printf("=========================================================================================\n");
    }

    magmaDoubleComplex neg_one = MAGMA_Z_NEG_ONE;
    magmaDoubleComplex one  = MAGMA_Z_ONE;
    magma_int_t ib, i, k, pm;
    magma_int_t nb = BATRF_NB;
    magma_int_t gemm_crossover = nb > 32 ? 127 : 160;
    // magma_int_t gemm_crossover = 0;// use only stream gemm

#if defined(USE_CUOPT)
    cublasHandle_t myhandle;
    cublasCreate_v2(&myhandle);
#else
    cublasHandle_t myhandle=NULL;
#endif

    magmaDoubleComplex **dA_displ   = NULL;
    magmaDoubleComplex **dW0_displ  = NULL;
    magmaDoubleComplex **dW1_displ  = NULL;
    magmaDoubleComplex **dW2_displ  = NULL;
    magmaDoubleComplex **dW3_displ  = NULL;
    magmaDoubleComplex **dW4_displ  = NULL;
    magmaDoubleComplex **dinvA_array = NULL;
    magmaDoubleComplex **dwork_array = NULL;

    magma_malloc((void**)&dA_displ,   batchCount * sizeof(*dA_displ));
    magma_malloc((void**)&dW0_displ,  batchCount * sizeof(*dW0_displ));
    magma_malloc((void**)&dW1_displ,  batchCount * sizeof(*dW1_displ));
    magma_malloc((void**)&dW2_displ,  batchCount * sizeof(*dW2_displ));
    magma_malloc((void**)&dW3_displ,  batchCount * sizeof(*dW3_displ));
    magma_malloc((void**)&dW4_displ,  batchCount * sizeof(*dW4_displ));
    magma_malloc((void**)&dinvA_array, batchCount * sizeof(*dinvA_array));
    magma_malloc((void**)&dwork_array, batchCount * sizeof(*dwork_array));

    magma_int_t invA_msize = ((n+TRI_NB-1)/TRI_NB)*TRI_NB*TRI_NB;
    magma_int_t dwork_msize = max(m,n)*nb;
    magmaDoubleComplex* dinvA      = NULL;
    magmaDoubleComplex* dwork      = NULL;// dinvA and dwork are workspace in ztrsm
    magmaDoubleComplex **cpuAarray = NULL;
    magma_zmalloc( &dinvA, invA_msize * batchCount);
    magma_zmalloc( &dwork, dwork_msize * batchCount );
    magma_malloc_cpu((void**) &cpuAarray, batchCount*sizeof(magmaDoubleComplex*));
   /* check allocation */
    if ( dA_displ  == NULL || dW0_displ == NULL || dW1_displ   == NULL || dW2_displ   == NULL ||
         dW3_displ == NULL || dW4_displ == NULL || dinvA_array == NULL || dwork_array == NULL ||
         dinvA     == NULL || dwork     == NULL || cpuAarray   == NULL ) {
        magma_free(dA_displ);
        magma_free(dW0_displ);
        magma_free(dW1_displ);
        magma_free(dW2_displ);
        magma_free(dW3_displ);
        magma_free(dW4_displ);
        magma_free(dinvA_array);
        magma_free(dwork_array);
        magma_free( dinvA );
        magma_free( dwork );
        free(cpuAarray);
        magma_int_t info = MAGMA_ERR_DEVICE_ALLOC;
        magma_xerbla( __func__, -(info) );
        return info;
    }

    magmablas_zlaset_q(MagmaFull, invA_msize, batchCount, MAGMA_Z_ZERO, MAGMA_Z_ZERO, dinvA, invA_msize, queue);
    magmablas_zlaset_q(MagmaFull, dwork_msize, batchCount, MAGMA_Z_ZERO, MAGMA_Z_ZERO, dwork, dwork_msize, queue);
    zset_pointer(dwork_array, dwork, n, 0, 0, dwork_msize, batchCount, queue);
    zset_pointer(dinvA_array, dinvA, TRI_NB, 0, 0, invA_msize, batchCount, queue);

    // printf(" I am in zgetrfbatched\n");
    magma_queue_t cstream;
    magmablasGetKernelStream(&cstream);
    magma_int_t streamid;
    const magma_int_t nbstreams=32;
    magma_queue_t stream[nbstreams];
    for(i=0; i<nbstreams; i++){
        magma_queue_create( &stream[i] );
    }
    magma_getvector( batchCount, sizeof(magmaDoubleComplex*), dA_array, 1, cpuAarray, 1);

    //printf(" I am after malloc\n");

    for(i = 0; i < min_mn; i+=nb)
    {
        magmablasSetKernelStream(NULL);

        ib = min(nb, min_mn-i);
        pm = m-i;

        magma_zdisplace_pointers(dA_displ, dA_array, lda, i, i, batchCount, queue);
        zset_pointer(dwork_array, dwork, nb, 0, 0, dwork_msize, batchCount, queue);
#if 0
        /* buggy: TODO */
        arginfo = magma_zgetrf_panel_nopiv_batched(
                pm, ib,
                dA_displ, lda,
                dwork_array, nb,
                dinvA_array, invA_msize,
                dW0_displ, dW1_displ, dW2_displ,
                dW3_displ, dW4_displ,
                info_array, i,
                batchCount, myhandle, queue);

#else
        arginfo = magma_zgetrf_recpanel_nopiv_batched(
                pm, ib, 32,
                dA_displ, lda,
                dwork_array, nb,
                dinvA_array, invA_msize,
                dW0_displ, dW1_displ, dW2_displ,
                dW3_displ, dW4_displ,
                info_array, i,
                batchCount, myhandle, queue);
#endif

        if(arginfo != 0 ) goto fin;

#define RUN_ALL
#ifdef RUN_ALL

        if( (i + ib) < n)
        {
            // swap right side and trsm
            //magma_zdisplace_pointers(dA_displ, dA_array, lda, i, i+ib, batchCount);
            zset_pointer(dwork_array, dwork, nb, 0, 0, dwork_msize, batchCount, queue); // I don't think it is needed Azzam

            magma_zdisplace_pointers(dA_displ, dA_array, lda, i, i, batchCount, queue);
            magma_zdisplace_pointers(dW0_displ, dA_array, lda, i, i+ib, batchCount, queue);
            magmablas_ztrsm_work_batched(MagmaLeft, MagmaLower, MagmaNoTrans, MagmaUnit, 1,
                    ib, n-i-ib,
                    MAGMA_Z_ONE,
                    dA_displ,    lda, // dA
                    dW0_displ,   lda, // dB
                    dwork_array,  nb, // dX
                    dinvA_array,  invA_msize,
                    dW1_displ,   dW2_displ,
                    dW3_displ,   dW4_displ,
                    1, batchCount, queue);

            if( (i + ib) < m)
            {
                // if gemm size is >160 use a streamed classical cublas gemm since it is faster
                // the batched is faster only when M=N<=160 for K40c
                //-------------------------------------------
                //          USE STREAM  GEMM
                //-------------------------------------------
                if( (m-i-ib) > gemm_crossover  && (n-i-ib) > gemm_crossover)
                {
                    //printf("caling streamed dgemm %d %d %d \n", m-i-ib, n-i-ib, ib);

                    // since it use different stream I need to wait the TRSM and swap.
                    // But since the code use the NULL stream everywhere,
                    // so I don't need it, because the NULL stream do the sync by itself
                    // magma_queue_sync(NULL);
                    for(k=0; k<batchCount; k++)
                    {
                        streamid = k%nbstreams;
                        magmablasSetKernelStream(stream[streamid]);
                        magma_zgemm(MagmaNoTrans, MagmaNoTrans,
                                m-i-ib, n-i-ib, ib,
                                neg_one, cpuAarray[k] + (i+ib)+i*lda, lda,
                                         cpuAarray[k] + i+(i+ib)*lda, lda,
                                one,     cpuAarray[k] + (i+ib)+(i+ib)*lda, lda);
                    }
                    // need to synchronise to be sure that zgetf2 do not start before
                    // finishing the update at least of the next panel
                    // BUT no need for it as soon as the other portion of the code
                    // use the NULL stream which do the sync by itself
                    //magma_device_sync();
                }
                //-------------------------------------------
                //          USE BATCHED GEMM
                //-------------------------------------------
                else
                {
                    magma_zdisplace_pointers(dA_displ, dA_array,  lda, i+ib,    i, batchCount, queue);
                    magma_zdisplace_pointers(dW1_displ, dA_array, lda,    i, i+ib, batchCount, queue);
                    magma_zdisplace_pointers(dW2_displ, dA_array, lda, i+ib, i+ib, batchCount, queue);
                    //printf("caling batched dgemm %d %d %d \n", m-i-ib, n-i-ib, ib);
                    magmablas_zgemm_batched( MagmaNoTrans, MagmaNoTrans, m-i-ib, n-i-ib, ib,
                            neg_one, dA_displ, lda,
                            dW1_displ, lda,
                            one,  dW2_displ, lda,
                            batchCount, queue);
                } // end of batched/stream gemm
            } // end of  if( (i + ib) < m)
        } // end of if( (i + ib) < n)
#endif
    }// end of for

fin:
    magma_queue_sync(NULL);

    for(i=0; i<nbstreams; i++){
        magma_queue_destroy( stream[i] );
    }
    magmablasSetKernelStream(cstream);

#if defined(USE_CUOPT)
    cublasDestroy_v2(myhandle);
#endif

    magma_free(dA_displ);
    magma_free(dW0_displ);
    magma_free(dW1_displ);
    magma_free(dW2_displ);
    magma_free(dW3_displ);
    magma_free(dW4_displ);
    magma_free(dinvA_array);
    magma_free(dwork_array);
    magma_free( dinvA );
    magma_free( dwork );
    free(cpuAarray);

    return arginfo;

}


text:
using System.Linq;
using EDEngineer.Models;

namespace EDEngineer.Filters
{
    public class EngineerFilter : BlueprintFilter
    {
        public string Engineer { get; }

        public override bool AppliesTo(Blueprint blueprint)
        {
            return blueprint.Engineers.Contains(Engineer);
        }

        public EngineerFilter(string engineer, string uniqueName) : base(uniqueName)
        {
            Engineer = engineer;
        }

        public static EngineerFilter MagicFilter => new EngineerFilter(null, "EFmagic")
        {
            Checked = true,
            Magic = true
        };
    }
}


text:
export const createErrorFromErrorData = (errorData) => {
  const {
    message,
    ...extraErrorInfo
  } = errorData || {};
  const error = new Error(message);
  error.framesToPop = 1;
  return Object.assign(error, extraErrorInfo);
}


text:
package pl.kodujdlapolski.na4lapy.ui.browse.list;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.support.design.widget.TabLayout;
import android.support.v4.app.FragmentPagerAdapter;
import android.support.v4.view.ViewPager;
import android.util.Log;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ProgressBar;
import android.widget.TextView;
import android.widget.Toast;

import butterknife.BindView;
import butterknife.ButterKnife;
import pl.kodujdlapolski.na4lapy.R;
import pl.kodujdlapolski.na4lapy.ui.browse.BrowseContract;
import pl.kodujdlapolski.na4lapy.ui.browse.BrowsePresenter;
import pl.kodujdlapolski.na4lapy.ui.details.DetailsActivity;
import pl.kodujdlapolski.na4lapy.ui.drawer.AbstractDrawerActivity;

public class ListBrowseActivity extends AbstractDrawerActivity implements BrowseContract.View {

    private BrowseContract.Presenter browsePresenter;
    @BindView(R.id.container)
    ViewPager viewPager;
    @BindView(R.id.animals_list_progress)
    ProgressBar progressBar;
    @BindView(R.id.error_message)
    TextView errorMessage;
    @BindView(R.id.error_container)
    ViewGroup errorContainer;

    FragmentPagerAdapter adapter;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        ButterKnife.bind(this);

        if (getSupportActionBar() != null) {
            getSupportActionBar().setTitle(R.string.fav_animals_list_activity);
        }
        browsePresenter = new BrowsePresenter(this, true);
        adapter = new ListBrowsePagerAdapter(this, browsePresenter.getAnimals(), getSupportFragmentManager());
    }

    @Override
    protected int getContentView() {
        return R.layout.activity_list_browse;
    }

    @Override
    public void onPostCreate(Bundle savedInstanceState) {
        super.onPostCreate(savedInstanceState);
        viewPager.setAdapter(adapter);
        viewPager.setOffscreenPageLimit(1);
        TabLayout tabLayout = (TabLayout) findViewById(R.id.tabs);
        if (tabLayout != null)
            tabLayout.setupWithViewPager(viewPager);

    }

    @Override
    public BrowseContract.Adapter getAdapter() {
        return (BrowseContract.Adapter) adapter;
    }

    @Override
    public Activity getActivity() {
        return this;
    }

    @Override
    public void showStateWaitingForData() {
        progressBar.setVisibility(View.VISIBLE);
        viewPager.setVisibility(View.GONE);
        errorContainer.setVisibility(View.GONE);
    }

    @Override
    public void showStateNoInternetConnection() {
        Toast.makeText(getApplicationContext(), R.string.error_data_no_internet_connection, Toast.LENGTH_LONG).show();
    }

    @Override
    public void showStateDataIsAvailable() {
        progressBar.setVisibility(View.GONE);
        viewPager.setVisibility(View.VISIBLE);
        errorContainer.setVisibility(View.GONE);
    }

    @Override
    public void showStateDataIsEmpty() {
        progressBar.setVisibility(View.GONE);
        viewPager.setVisibility(View.GONE);
        errorContainer.setVisibility(View.VISIBLE);
        errorMessage.setText(R.string.error_no_data_fav);
    }

    @Override
    public void showStateError(Throwable t) {
        //  Toast.makeText(getApplicationContext(), R.string.error_data_cannot_be_loaded, Toast.LENGTH_LONG).show();
        //todo 457  uncomment when new database is ready
        if (t != null && t.getMessage() != null) {
            Log.d(this.getClass().toString(), t.getMessage());
        }
    }

    @Override
    protected void onResume() {
        super.onResume();
        handler.onResume();
    }

    @Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        if (requestCode == DetailsActivity.REQUEST_CODE_ANIMAL && resultCode == Activity.RESULT_OK) {
            Long changedAnimalId = data.getLongExtra(DetailsActivity.EXTRA_ANIMAL_ID, -1);
            if (changedAnimalId != -1)
                browsePresenter.onChangedAnimalAvailable(changedAnimalId);
        }
    }

    public BrowseContract.Presenter getPresenter() {
        return browsePresenter;
    }
}


text:
.navbar {
  overflow: hidden;
  position: relative;
  height: 45px;
  margin: 0 auto;
  -moz-user-select: none;
  -webkit-user-select: none;
  user-select: none;
}
.navbar h1 {
  margin: 0;
  font-weight: 500;
  font-size: 17px;
}
.navbar a {
  cursor: pointer;
}
.navbar-screen {
  z-index: 2;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}
.navbar-back,
.navbar-action,
.navbar-title {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  margin: 0;
  opacity: 1;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}
.navbar-back a,
.navbar-action a,
.navbar-title a,
.navbar-back h1,
.navbar-action h1,
.navbar-title h1 {
  display: inline-block;
  height: 100%;
  padding: 0 10px;
  color: #000;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}
.navbar-back a,
.navbar-action a,
.navbar-back h1,
.navbar-action h1 {
  color: #157dfb;
}
.navbar-back {
  -webkit-transform: translate3d(0%, 0, 0);
  transform: translate3d(0%, 0, 0);
}
.navbar-back a,
.navbar-back h1 {
  -webkit-transform: translate3d(0%, 0, 0);
  transform: translate3d(0%, 0, 0);
}
.navbar-action {
  -webkit-transform: translate3d(100%, 0, 0);
  transform: translate3d(100%, 0, 0);
}
.navbar-action a,
.navbar-action h1 {
  -webkit-transform: translate3d(-100%, 0, 0);
  transform: translate3d(-100%, 0, 0);
}
.navbar-title {
  -webkit-transform: translate3d(50%, 0, 0);
  transform: translate3d(50%, 0, 0);
}
.navbar-title a,
.navbar-title h1 {
  -webkit-transform: translate3d(-50%, 0, 0);
  transform: translate3d(-50%, 0, 0);
}
.navbar-screen.previous {
  display: none;
  z-index: 1;
}
.navbar .navbar-back,
.navbar .navbar-title,
.navbar .navbar-action,
.navbar a,
.navbar h1 {
  -webkit-transition: none;
  transition: none;
}
.navbar.before-rtl .navbar-back,
.navbar.before-rtl .navbar-title,
.navbar.before-rtl .navbar-action,
.navbar.before-rtl a,
.navbar.before-rtl h1 {
  -webkit-transition: none;
  transition: none;
}
.navbar.before-rtl .current .navbar-back {
  -webkit-transform: translate3d(50%, 0, 0);
  transform: translate3d(50%, 0, 0);
}
.navbar.before-rtl .current .navbar-back a,
.navbar.before-rtl .current .navbar-back h1 {
  -webkit-transform: translate3d(-50%, 0, 0);
  transform: translate3d(-50%, 0, 0);
}
.navbar.before-rtl .current .navbar-title {
  -webkit-transform: translate3d(100%, 0, 0);
  transform: translate3d(100%, 0, 0);
}
.navbar.before-rtl .current .navbar-title a,
.navbar.before-rtl .current .navbar-title h1 {
  -webkit-transform: translate3d(0%, 0, 0);
  transform: translate3d(0%, 0, 0);
}
.navbar.before-rtl .current .navbar-back,
.navbar.before-rtl .current .navbar-title,
.navbar.before-rtl .current .navbar-action {
  opacity: 0;
}
.navbar.before-rtl .previous {
  display: block;
}
.navbar.before-rtl.show-rtl .navbar-back,
.navbar.before-rtl.show-rtl .navbar-title,
.navbar.before-rtl.show-rtl .navbar-action,
.navbar.before-rtl.show-rtl a,
.navbar.before-rtl.show-rtl h1 {
  -webkit-transition: -webkit-transform 0.6s cubic-bezier(0.1, 0.7, 0.1, 1), opacity 0.6s cubic-bezier(0.1, 0.7, 0.1, 1);
  transition: transform 0.6s cubic-bezier(0.1, 0.7, 0.1, 1), opacity 0.6s cubic-bezier(0.1, 0.7, 0.1, 1);
}
.navbar.before-rtl.show-rtl .current .navbar-back {
  -webkit-transform: translate3d(0%, 0, 0);
  transform: translate3d(0%, 0, 0);
  opacity: 1;
}
.navbar.before-rtl.show-rtl .current .navbar-back a,
.navbar.before-rtl.show-rtl .current .navbar-back h1 {
  -webkit-transform: translate3d(0%, 0, 0);
  transform: translate3d(0%, 0, 0);
}
.navbar.before-rtl.show-rtl .current .navbar-title {
  -webkit-transform: translate3d(50%, 0, 0);
  transform: translate3d(50%, 0, 0);
  opacity: 1;
}
.navbar.before-rtl.show-rtl .current .navbar-title a,
.navbar.before-rtl.show-rtl .current .navbar-title h1 {
  -webkit-transform: translate3d(-50%, 0, 0);
  transform: translate3d(-50%, 0, 0);
}
.navbar.before-rtl.show-rtl .current .navbar-action {
  opacity: 1;
  -webkit-transition: opacity 0.6s cubic-bezier(0.1, 0.7, 0.1, 1);
  transition: opacity 0.6s cubic-bezier(0.1, 0.7, 0.1, 1);
}
.navbar.before-rtl.show-rtl .previous .navbar-back {
  -webkit-transform: translate3d(0%, 0, 0);
  transform: translate3d(0%, 0, 0);
  opacity: 0;
}
.navbar.before-rtl.show-rtl .previous .navbar-back a,
.navbar.before-rtl.show-rtl .previous .navbar-back h1 {
  -webkit-transform: translate3d(-100%, 0, 0);
  transform: translate3d(-100%, 0, 0);
}
.navbar.before-rtl.show-rtl .previous .navbar-title {
  -webkit-transform: translate3d(0%, 0, 0);
  transform: translate3d(0%, 0, 0);
  opacity: 0;
}
.navbar.before-rtl.show-rtl .previous .navbar-title a,
.navbar.before-rtl.show-rtl .previous .navbar-title h1 {
  -webkit-transform: translate3d(0%, 0, 0);
  transform: translate3d(0%, 0, 0);
}
.navbar.before-rtl.show-rtl .previous .navbar-action {
  -webkit-transition: opacity 0.1s cubic-bezier(0.1, 0.7, 0.1, 1);
  transition: opacity 0.1s cubic-bezier(0.1, 0.7, 0.1, 1);
  opacity: 0;
}
.navbar.before-ltr .navbar-back,
.navbar.before-ltr .navbar-title,
.navbar.before-ltr .navbar-action,
.navbar.before-ltr a,
.navbar.before-ltr h1 {
  -webkit-transition: none;
  transition: none;
}
.navbar.before-ltr .current .navbar-back {
  -webkit-transform: translate3d(0%, 0, 0);
  transform: translate3d(0%, 0, 0);
}
.navbar.before-ltr .current .navbar-back a,
.navbar.before-ltr .current .navbar-back h1 {
  -webkit-transform: translate3d(-100%, 0, 0);
  transform: translate3d(-100%, 0, 0);
}
.navbar.before-ltr .current .navbar-title {
  -webkit-transform: translate3d(0%, 0, 0);
  transform: translate3d(0%, 0, 0);
}
.navbar.before-ltr .current .navbar-title a,
.navbar.before-ltr .current .navbar-title h1 {
  -webkit-transform: translate3d(0%, 0, 0);
  transform: translate3d(0%, 0, 0);
}
.navbar.before-ltr .current .navbar-back,
.navbar.before-ltr .current .navbar-title,
.navbar.before-ltr .current .navbar-action {
  opacity: 0;
}
.navbar.before-ltr .previous {
  display: block;
}
.navbar.before-ltr.show-ltr .navbar-back,
.navbar.before-ltr.show-ltr .navbar-title,
.navbar.before-ltr.show-ltr .navbar-action,
.navbar.before-ltr.show-ltr a,
.navbar.before-ltr.show-ltr h1 {
  -webkit-transition: -webkit-transform 0.6s cubic-bezier(0.1, 0.7, 0.1, 1), opacity 0.6s cubic-bezier(0.1, 0.7, 0.1, 1);
  transition: transform 0.6s cubic-bezier(0.1, 0.7, 0.1, 1), opacity 0.6s cubic-bezier(0.1, 0.7, 0.1, 1);
}
.navbar.before-ltr.show-ltr .current .navbar-back {
  -webkit-transform: translate3d(0%, 0, 0);
  transform: translate3d(0%, 0, 0);
  opacity: 1;
}
.navbar.before-ltr.show-ltr .current .navbar-back a,
.navbar.before-ltr.show-ltr .current .navbar-back h1 {
  -webkit-transform: translate3d(0%, 0, 0);
  transform: translate3d(0%, 0, 0);
}
.navbar.before-ltr.show-ltr .current .navbar-title {
  -webkit-transform: translate3d(50%, 0, 0);
  transform: translate3d(50%, 0, 0);
  opacity: 1;
}
.navbar.before-ltr.show-ltr .current .navbar-title a,
.navbar.before-ltr.show-ltr .current .navbar-title h1 {
  -webkit-transform: translate3d(-50%, 0, 0);
  transform: translate3d(-50%, 0, 0);
}
.navbar.before-ltr.show-ltr .current .navbar-action {
  opacity: 1;
  -webkit-transition: opacity 0.6s cubic-bezier(0.1, 0.7, 0.1, 1);
  transition: opacity 0.6s cubic-bezier(0.1, 0.7, 0.1, 1);
}
.navbar.before-ltr.show-ltr .previous .navbar-back {
  -webkit-transform: translate3d(50%, 0, 0);
  transform: translate3d(50%, 0, 0);
  opacity: 0;
}
.navbar.before-ltr.show-ltr .previous .navbar-back a,
.navbar.before-ltr.show-ltr .previous .navbar-back h1 {
  -webkit-transform: translate3d(-50%, 0, 0);
  transform: translate3d(-50%, 0, 0);
}
.navbar.before-ltr.show-ltr .previous .navbar-title {
  -webkit-transform: translate3d(100%, 0, 0);
  transform: translate3d(100%, 0, 0);
  opacity: 0;
}
.navbar.before-ltr.show-ltr .previous .navbar-title a,
.navbar.before-ltr.show-ltr .previous .navbar-title h1 {
  -webkit-transform: translate3d(0%, 0, 0);
  transform: translate3d(0%, 0, 0);
}
.navbar.before-ltr.show-ltr .previous .navbar-action {
  -webkit-transition: opacity 0.1s cubic-bezier(0.1, 0.7, 0.1, 1);
  transition: opacity 0.1s cubic-bezier(0.1, 0.7, 0.1, 1);
  opacity: 0;
}
.demo {
  width: 320px;
  height: 480px;
  margin: 0 auto;
  background: #fff;
  border: 1px solid #808080;
}
.demo .navbar {
  height: 45px;
  margin: 0 auto;
  border-bottom: 1px solid #808080;
  font: 300 17px/45px "Helvetica Neue";
  -webkit-font-smoothing: antialiased;
}
.demo .navbar h1 {
  font-weight: 500;
  font-size: 17px;
}
.demo {
  width: 320px;
  height: 480px;
  margin: 0 auto;
  background: #fff;
  border: 1px solid #808080;
}
.demo .navbar {
  height: 45px;
  margin: 0 auto;
  border-bottom: 1px solid #808080;
  font: 300 17px/45px "Helvetica Neue";
  -webkit-font-smoothing: antialiased;
}
.demo .navbar h1 {
  font-weight: 500;
  font-size: 17px;
}


text:
package com.sktutilities.notes;

import com.sktutilities.sandhi.SandhiJFrame;
import com.sktutilities.util.EncodingUtil;
import com.sktutilities.util.Log;

public class Comments
{
	//private Vector<String> notes_vec;
	public final static String sutra = "Given by Panini Sutra";
	public final static String vartika = "Given by Katyayana Vartika";
	static int options;
	private String sutraNum[]; // number such as 1.4.42
	private String sutraPath[]; // Pan Sutra such as 'ade~N guNaH.
	private String vartikaPath[]; // Kat Vartika such as "RRiti RRi va vacanam
	private String sandhiType[]; // Vowel Sandhi, Con Sandhi, Visarga Sandhi
	private String sutraProc[]; // schutva adesha etc
	private String notesNotes;
	private String source[]; // sutra or vartika

	private String conditions[];
	private int optionsPointer;
	private String default_notes = "Two words in proximity";
	private final int DEFAULT_ARRAY_SIZE = 6;
	//private EncodingUtil encoding;

//*******************BEGINNING OF Default Constructor********************//
	public Comments()
	{
		Log.logInfo("i came in constructor of tippani ");
		//encoding = new EncodingUtil();
		notesNotes = default_notes;
		options = 1;
		optionsPointer = -1;
		sutraNum = new String[DEFAULT_ARRAY_SIZE] ;
		sutraPath = new String[DEFAULT_ARRAY_SIZE] ;
		vartikaPath = 	new String[DEFAULT_ARRAY_SIZE] ;
		sandhiType = new String[DEFAULT_ARRAY_SIZE] ;
		sutraProc = new String[DEFAULT_ARRAY_SIZE] ;
		source = new String[DEFAULT_ARRAY_SIZE] ;
		conditions = new String[DEFAULT_ARRAY_SIZE] ;
		Log.logInfo("isEmpty() ?" + isEmpty());
		Log.logInfo("i came in constructor of tippani ");
	}
//*******************END OF Default Constructor**********************//

//*******************BEGINNING OF FUNCTION********************//
	public void increment_pointer()
	{
		//if(options_pointer < options - 1) // changed on 12:17 PM 8jun
		optionsPointer++;
	}
//*******************END OF FUNCTION**********************//

//*******************BEGINNING OF FUNCTION********************//
	public void decrementPointer()
	{
		//if(options_pointer < options - 1) // changed on 12:17 PM 8jun
		if(optionsPointer > -1)
		{
			//set_sandhi_type("");
			setSutraProc("");
			setSource("");
			setSutraPath("");
			setSutraNum("");
			setVartikaPath("");
			setConditions("");
			optionsPointer--;
		}
	}
//*******************END OF FUNCTION**********************//

//*******************BEGINNING OF FUNCTION********************//
	public boolean isEmpty()
	{
		Log.logInfo("i am in isEmpty()");
		if(optionsPointer == -1)
		return true;
		return false;
	}
//*******************END OF FUNCTION**********************//

//*******************BEGINNING OF FUNCTION********************//
	public boolean rikta_asti()
	{
		Log.logInfo("i am in isEmpty()"); flush();
		if(optionsPointer == -1)
		return true;
		return false;
	}
//*******************END OF FUNCTION**********************//

//*******************BEGINNING OF FUNCTION********************//
	public void setNotes()
	{
		notesNotes = get_sandhi_type(0) + "\n"; // what if their are many other kinds of sandhis

		for(int i = 0; i <= optionsPointer; i++)
		{
		if(optionsPointer > 0 ) notesNotes += "Optional Form " + (i + 1) + ": " + "\n";

		notesNotes += get_sutra_proc(i) + "\n";
		notesNotes += get_source(i) + " ";
		notesNotes += get_sutra_path(i) + " ";
		//if(get_sutra_num(i) != null ||  get_sutra_num(i).length() <= 0 || get_sutra_num(i).equals("") )
		notesNotes += get_sutra_num(i) ;

		//if(get_vartika_path(i) != null || get_vartika_path(i).length() <= 0)
		notesNotes += " " +  get_vartika_path(i) + " ";

		notesNotes += "\n" + "Conditions: " + "\n";
		notesNotes += get_conditions(i) + "\n\n";
		}

		Log.logInfo("*_*_*_*_*_*_*_*_options_pointer == " + optionsPointer );
		Log.logInfo( "\n *_*_*_*_*_*_*_*_notes_notes == "  + notesNotes);

	}

//*******************END OF FUNCTION**********************//

//*******************BEGINNING OF FUNCTION********************//
public void copyNotes(Comments n)
{
	//setNotes();
	for(int i = 0; i <= n.get_options_pointer(); i++)
	{
	start_adding_notes();
	setSutraNum(n.get_sutra_num(i));
	setSutraPath(n.get_sutra_path(i));
	setSutraProc(n.get_sutra_proc(i));
	setSource(n.get_source(i));
	setConditions(n.get_conditions(i));
	setVartikaPath(n.get_vartika_path(i));

	}
}
//*******************END OF FUNCTION**********************//

//*******************BEGINNING OF FUNCTION********************//
	public String getNotes()
	{
		setNotes();

		return notesNotes;
	}
//*******************END OF FUNCTION**********************//

public void start_adding_notes() {
	 Log.logInfo( "*_*_*_*_*_*_*_*_ started Adding Notes... ");
		Log.logInfo("*_*_*_*_*_*_*_*_*_*_options_pointer == " + optionsPointer );
	 optionsPointer++;
	 }

//setters
public void setSutraNum(String s1) {
	sutraNum[optionsPointer] = s1;
	}

public void setSutraPath(String s1) {
	if(SandhiJFrame.romanSutra == false )
	sutraPath[optionsPointer] = EncodingUtil.convertRawItransToDevanagari(s1) ;
	else {sutraPath[optionsPointer] = s1;	}
	}

public void set_sandhi_type(String s1) {sandhiType[0] = s1; }
public void setSutraProc(String s1) {sutraProc[optionsPointer] = s1; }

public void setSource(String s1) {
	source[optionsPointer] = s1;
	Log.logInfo("*_*_*_*_*_*_*_*_*_*_options_pointer == " + optionsPointer );
	}

public void setVartikaPath(String s1) {
	if(SandhiJFrame.romanSutra == false )
	vartikaPath[optionsPointer] = EncodingUtil .convertRawItransToDevanagari(s1) ;
	else {vartikaPath[optionsPointer] = s1;	}
	}

public void setConditions(String s1) {conditions[optionsPointer] = s1; }
public void append_condition(String s1) {
	String append_me = get_conditions(optionsPointer) + "\n\n" + s1;
	conditions[optionsPointer] = append_me;

	}
public void set_options(int i1) {options = i1; }
public void set_options_pointer(int i1) {optionsPointer = i1; }

//getters
public String get_sutra_num(int i)
{
	if(sutraNum[i] == null || sutraNum[i].length() == 0 ) return "";
	else return "(" + sutraNum[i]  + ")";
}

public String get_sutra_path(int i){
	if (sutraPath[i] == null || sutraPath[i].length() == 0) return "";
	else return "'" + sutraPath[i]  + "'";
	}
public String get_vartika_path(int i){
	if (vartikaPath[i] == null || vartikaPath[i].length() == 0) return "";
	else return "'" + vartikaPath[i]  + "'";
	}

public String get_sandhi_type(int i) {return sandhiType[i];}
public String get_sutra_proc(int i){return sutraProc[i];}
public String get_source(int i){return source[i]; }
public String get_conditions(int i){return conditions[i] ; }
public int get_options(){return options; }
public int get_options_pointer(){return optionsPointer; }

//*******************BEGINNING OF FUNCTION********************//
	public void flush()
	{

		notesNotes = default_notes;
		//set_options(1);
		for(int i = 0; i < DEFAULT_ARRAY_SIZE; i++)
		{
		set_sandhi_type("");
		setSutraProc("");
		setSource("");
		setSutraPath("");
		setSutraNum("");
		setVartikaPath("");
		setConditions("");
		}
		optionsPointer = -1;
	}
//*******************END OF FUNCTION**********************//

}


text:
      Translation in language:

    <select id="audioTranslationLanguageCodeField" class="oppia-language-selector" ng-change="changeTranslationLanguage()" ng-model="languageCode"
            ng-options="language.id as language.description for language in languageCodesAndDescriptions">
    </select>


text:
//
// Copyright (c) Microsoft.  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.

namespace Microsoft.Azure.Commands.ApiManagement.Helpers
{
    using AutoMapper;
    using Management.ApiManagement.Models;
    using Models;
    using System;
    using System.Collections.Generic;
    using System.Linq;

    public static class Mappers
    {
        public static HostnameType MapHostnameType(PsApiManagementHostnameType hostnameType)
        {
            switch(hostnameType)
            {
                case PsApiManagementHostnameType.Proxy: return HostnameType.Proxy;
                case PsApiManagementHostnameType.Portal: return HostnameType.Portal;
                case PsApiManagementHostnameType.Management: return HostnameType.Management;
                case PsApiManagementHostnameType.Scm: return HostnameType.Scm;
                default: throw new ArgumentException("Unrecognized Hostname Type.");
            }
        }

        public static PsApiManagementHostnameType MapHostnameType(HostnameType hostnameType)
        {
            switch (hostnameType)
            {
                case HostnameType.Proxy: return PsApiManagementHostnameType.Proxy;
                case HostnameType.Portal: return PsApiManagementHostnameType.Portal;
                case HostnameType.Management: return PsApiManagementHostnameType.Management;
                case HostnameType.Scm: return PsApiManagementHostnameType.Scm;
                default: throw new ArgumentException("Unrecognized Hostname Type.");
            }
        }

        public static string MapSku(PsApiManagementSku sku)
        {
            switch (sku)
            {
                case PsApiManagementSku.Developer: return SkuType.Developer;
                case PsApiManagementSku.Standard: return SkuType.Standard;
                case PsApiManagementSku.Premium: return SkuType.Premium;
                case PsApiManagementSku.Basic: return SkuType.Basic;
                default: throw new ArgumentException("Unrecognized Sku");
            }
        }

        public static PsApiManagementSku MapSku(string sku)
        {
            switch (sku)
            {
                case SkuType.Developer: return PsApiManagementSku.Developer;
                case SkuType.Standard: return PsApiManagementSku.Standard;
                case SkuType.Premium: return PsApiManagementSku.Premium;
                case SkuType.Basic: return PsApiManagementSku.Basic;
                default: throw new ArgumentException("Unrecognized Sku");
            }
        }

        public static string MapVirtualNetworkType(PsApiManagementVpnType vpnType)
        {
            switch (vpnType)
            {
                case PsApiManagementVpnType.External: return VirtualNetworkType.External;
                case PsApiManagementVpnType.Internal: return VirtualNetworkType.Internal;
                case PsApiManagementVpnType.None: return VirtualNetworkType.None;
                default: throw new ArgumentException("Unrecognized Virtual Network Type");
            }
        }

        public static ApiManagementServiceIdentity MapPsApiManagementIdentity(PsApiManagementServiceIdentity identity)
        {
            if (identity == null)
            {
                return null;
            }

            return new ApiManagementServiceIdentity();
        }

        public static ApiManagementServiceResource MapPsApiManagement(PsApiManagement apiManagement)
        {
            var parameters = new ApiManagementServiceResource
            {
                Location = apiManagement.Location,
                PublisherEmail = apiManagement.PublisherEmail,
                PublisherName = apiManagement.OrganizationName,
                NotificationSenderEmail = apiManagement.NotificationSenderEmail,
                VirtualNetworkType = MapVirtualNetworkType(apiManagement.VpnType),
                Sku = new ApiManagementServiceSkuProperties
                {
                    Capacity = apiManagement.Capacity,
                    Name = MapSku(apiManagement.Sku)
                },
                Tags = apiManagement.Tags
            };

            if (apiManagement.VirtualNetwork != null)
            {
                parameters.VirtualNetworkConfiguration = new VirtualNetworkConfiguration
                {
                    SubnetResourceId = apiManagement.VirtualNetwork.SubnetResourceId
                };
            }

            if (apiManagement.AdditionalRegions != null && apiManagement.AdditionalRegions.Any())
            {
                parameters.AdditionalLocations =
                    apiManagement.AdditionalRegions
                        .Select(region =>
                            new AdditionalLocation
                            {
                                Location = region.Location,
                                Sku = new ApiManagementServiceSkuProperties()
                                {
                                    Name = MapSku(region.Sku),
                                    Capacity = region.Capacity
                                },
                                VirtualNetworkConfiguration = region.VirtualNetwork == null
                                    ? null
                                    : new VirtualNetworkConfiguration
                                    {
                                        SubnetResourceId = region.VirtualNetwork.SubnetResourceId
                                    }
                            })
                        .ToList();
            }

            if (apiManagement.ProxyCustomHostnameConfiguration != null ||
                apiManagement.PortalCustomHostnameConfiguration != null ||
                apiManagement.ManagementCustomHostnameConfiguration != null ||
                apiManagement.ScmCustomHostnameConfiguration != null)
            {
                parameters.HostnameConfigurations = new List<HostnameConfiguration>();

                if (apiManagement.ProxyCustomHostnameConfiguration != null)
                {
                    foreach(var proxyCustomHostnameConfiguration in apiManagement.ProxyCustomHostnameConfiguration)
                    {
                        parameters.HostnameConfigurations.Add(proxyCustomHostnameConfiguration.GetHostnameConfiguration());
                    }
                }
                if (apiManagement.PortalCustomHostnameConfiguration != null)
                {
                    parameters.HostnameConfigurations.Add(apiManagement.PortalCustomHostnameConfiguration.GetHostnameConfiguration());
                }
                if (apiManagement.ManagementCustomHostnameConfiguration != null)
                {
                    parameters.HostnameConfigurations.Add(apiManagement.ManagementCustomHostnameConfiguration.GetHostnameConfiguration());
                }
                if (apiManagement.ScmCustomHostnameConfiguration != null)
                {
                    parameters.HostnameConfigurations.Add(apiManagement.ScmCustomHostnameConfiguration.GetHostnameConfiguration());
                }
            }

            if (apiManagement.SystemCertificates != null)
            {
                parameters.Certificates = new List<CertificateConfiguration>();
                foreach(var systemCertificate in apiManagement.SystemCertificates)
                {
                    parameters.Certificates.Add(systemCertificate.GetCertificateConfiguration());
                }
            }

            if (apiManagement.Identity != null)
            {
                parameters.Identity = MapPsApiManagementIdentity(apiManagement.Identity);
            }

            return parameters;
        }
    }
}


text:
import { TranslateService } from '@ngx-translate/core';
import { Observable } from 'rxjs';
import { BehaviorSubject } from 'rxjs/BehaviorSubject';
import { InfiniteScroll, Refresher, NavParams } from 'ionic-angular';
import { Injector, ViewChild } from '@angular/core';
import { Store } from '@ngrx/store';
import _get from 'lodash/get';

import { AppState } from '../../reducers';
import { Toast, Config } from './../../providers';
import { getUniqueStoreKey } from '../../utils/list';

export interface IListResult {
    page: number;
    totalPages: number;
    list: Array<any>;
}

export class ListParent {
    config: Config;
    navParams: NavParams;
    toast: Toast;
    translate: TranslateService;

    isLoading$: Observable<boolean>;
    showSpinner$: Observable<boolean>;
    store$: Observable<any>;
    stream$: Observable<any>;
    itemsToDisplay$: Observable<number>;
    isPaginationEnabled$: Observable<boolean>;
    hasError$: Observable<boolean>;
    currentPage$ = new BehaviorSubject<number>(0);
    type: string;
    store: Store<AppState>;

    @ViewChild(InfiniteScroll) infinite: InfiniteScroll;

    constructor(
        public injector: Injector,
    ) {
        this.config = injector.get(Config, Config);
        this.navParams = injector.get(NavParams, NavParams);
        this.toast = injector.get(Toast, Toast);
        this.store = injector.get(Store, Store);
        this.translate = injector.get(TranslateService, TranslateService);
    }

    setType = (type: string) => this.type = type;
    setStream = (stream: Observable<any>) => this.stream$ = stream;
    setIsLoadingStream = (loading: Observable<any>) => this.isLoading$ = loading;
    setShowSpinnerStream = (showSpinner: Observable<any>) => this.showSpinner$ = showSpinner;
    setStoreStream = (store: Observable<any>) => this.store$ = store;
    setHasErrorStream = (hasError: Observable<boolean>) => this.hasError$ = hasError;
    setItemsToDisplayStream = (itemsToDisplay: Observable<number>) => this.itemsToDisplay$ = itemsToDisplay;
    setIsPaginationEnableStream = (isPaginationEnabled: Observable<boolean>) => this.isPaginationEnabled$ = isPaginationEnabled;

    public getSyncPropFromStore(property: string, otherwise: any): any {
        let prop;
        this.store$.first().subscribe(listParams => prop = _get(listParams, property, otherwise));
        return prop;
    }

    public getLoadedPage = (): number => this.getSyncPropFromStore('loadedPage', 0);
    public getTotalPages = (): number => this.getSyncPropFromStore('totalPages', 0);

    public getCurrentPage(): any {
        let currentPage;
        this.currentPage$.first().subscribe(page => currentPage = page);
        return currentPage;
    }

    public getQuery(): any {
        return Object.assign({
            per_page: this.config.getApi('per_page', 5),
        }, this.config.get(`[${this.type}].query`, {}));
    }

    public getUniqueStoreKey(): string {
        return getUniqueStoreKey(this.type, this.getQuery())
    }

    public resetPage = () => this.currentPage$.next(0);
    public nextPage = () => this.currentPage$.next(this.getCurrentPage() + 1);

    public doLoad(reset: boolean = false, cb = () => this.nextPage()): void { }

    doRefresh(refresher: Refresher): void {
        this.doLoad(true, () => {
            this.nextPage();
            refresher.complete();
        });
    }

    doInfinite(infiniteScroll: InfiniteScroll): void {
        this.doLoad(false, () => {
            this.nextPage();
            infiniteScroll.complete();
        });
    }

    trackById = (index: number, item) => item.id;
}


text:
@interface StopService : NSObject

-(NSArray*) getStopsWithRoute:(NSString*)route;

@end


text:
// Licensed to the .NET Foundation under one or more agreements.
// See the LICENSE file in the project root for more information.

//
//
// Authors:
//      Marek Habersack <mhabersack@novell.com>
//
// Copyright (C) 2010 Novell, Inc. (http://novell.com/)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//

using System;
using System.Collections.Generic;
using System.Runtime.Caching;

using Xunit;
using MonoTests.Common;

namespace MonoTests.System.Runtime.Caching
{
    public class ObjectCacheTest
    {
        [Fact]
        [ActiveIssue(25168)]
        private static void Host_SetToProvider()
        {
            var tns1 = new TestNotificationSystem();
            var tns2 = new TestNotificationSystem();
            ObjectCache.Host = tns1;
            Assert.NotNull(ObjectCache.Host);
            Assert.Equal(tns1, ObjectCache.Host);

            Assert.Throws<InvalidOperationException>(() =>
            {
                ObjectCache.Host = tns2;
            });
        }

        [Fact]
        public void Add_CacheItem_CacheItemPolicy()
        {
            var poker = new PokerObjectCache();
            bool ret;

            ret = poker.Add(null, null);
            Assert.True(ret);
            Assert.Equal("AddOrGetExisting (CacheItem value, CacheItemPolicy policy)", poker.MethodCalled);

            var item = new CacheItem("key", 1234);
            ret = poker.Add(item, null);
            Assert.True(ret);
            Assert.Equal("AddOrGetExisting (CacheItem value, CacheItemPolicy policy)", poker.MethodCalled);

            ret = poker.Add(item, null);
            Assert.False(ret);
            Assert.Equal("AddOrGetExisting (CacheItem value, CacheItemPolicy policy)", poker.MethodCalled);
        }

        [Fact]
        public void Add_String_Object_CacheItemPolicy_String()
        {
            var poker = new PokerObjectCache();
            bool ret;

            ret = poker.Add(null, null, null, null);
            Assert.True(ret);
            Assert.Equal("AddOrGetExisting (string key, object value, CacheItemPolicy policy, string regionName = null)", poker.MethodCalled);

            ret = poker.Add("key", 1234, null, null);
            Assert.True(ret);
            Assert.Equal("AddOrGetExisting (string key, object value, CacheItemPolicy policy, string regionName = null)", poker.MethodCalled);

            ret = poker.Add("key", 1234, null, null);
            Assert.False(ret);
            Assert.Equal("AddOrGetExisting (string key, object value, CacheItemPolicy policy, string regionName = null)", poker.MethodCalled);
        }

        [Fact]
        public void Add_String_Object_DateTimeOffset_String()
        {
            var poker = new PokerObjectCache();
            bool ret;

            ret = poker.Add(null, null, DateTimeOffset.Now, null);
            Assert.True(ret);
            Assert.Equal("AddOrGetExisting (string key, object value, DateTimeOffset absoluteExpiration, string regionName = null)", poker.MethodCalled);

            ret = poker.Add("key", 1234, DateTimeOffset.Now, null);
            Assert.True(ret);
            Assert.Equal("AddOrGetExisting (string key, object value, DateTimeOffset absoluteExpiration, string regionName = null)", poker.MethodCalled);

            ret = poker.Add("key", 1234, DateTimeOffset.Now, null);
            Assert.False(ret);
            Assert.Equal("AddOrGetExisting (string key, object value, DateTimeOffset absoluteExpiration, string regionName = null)", poker.MethodCalled);
        }

        [Fact]
        public void GetValues()
        {
            var poker = new PokerObjectCache();

            IDictionary<string, object> values = poker.GetValues(null, (string[])null);
            Assert.NotNull(values);
            Assert.Equal(0, values.Count);
            Assert.Equal("IDictionary<string, object> GetValues (IEnumerable<string> keys, string regionName = null)", poker.MethodCalled);

            poker.Add("key1", 1, null);
            poker.Add("key2", 2, null);
            poker.Add("key3", 3, null);

            values = poker.GetValues(new string[] { "key1", "key2", "key3" });
            Assert.NotNull(values);
            Assert.Equal(3, values.Count);
            Assert.Equal("IDictionary<string, object> GetValues (IEnumerable<string> keys, string regionName = null)", poker.MethodCalled);

            values = poker.GetValues(new string[] { "key1", "key22", "key3" });
            Assert.NotNull(values);
            Assert.Equal(2, values.Count);
            Assert.Equal("IDictionary<string, object> GetValues (IEnumerable<string> keys, string regionName = null)", poker.MethodCalled);
        }

        [Fact]
        public void Defaults()
        {
            Assert.Equal(DateTimeOffset.MaxValue, ObjectCache.InfiniteAbsoluteExpiration);
            Assert.Equal(TimeSpan.Zero, ObjectCache.NoSlidingExpiration);
        }
    }
}