text:
Window
======

### Prefix: wnd

Table of Content
----------------

<!-- toc -->

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

`Enum`

CodeEnumArrangeOrigin
---------------------

-   **LeftOrTop**
-   **Middle**
-   **RightOrBottom**

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

`Enum`

MoveMethod
----------

-   **Nothing**
-   **Simple**
-   **EaseInSine**
-   **EaseOutSine**
-   **EaseInOutSine**
-   **EaseInQuad**
-   **EaseOutQuad**
-   **EaseInOutQuad**
-   **EaseInCubic**
-   **EaseOutCubic**
-   **EaseInOutCubic**
-   **EaseInQuart**
-   **EaseOutQuart**
-   **EaseInOutQuart**
-   **EaseInQuint**
-   **EaseOutQuint**
-   **EaseInOutQuint**
-   **EaseInExpo**
-   **EaseOutExpo**
-   **EaseInOutExpo**
-   **EaseInCirc**
-   **EaseOutCirc**
-   **EaseInOutCirc**
-   **EaseInBack**
-   **EaseOutBack**
-   **EaseInOutBack**

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

`Event`

AnimEnded
---------

### Params

-   **wndHandler** **([Window](../WindowControls/Window.md))** - The
    window that fires the event
-   **wndControl** **([Window](../WindowControls/Window.md))** - The
    window control with the event happened
-   **strAnimDataId** **(String)**

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

`Event`

AnimStarted
-----------

### Params

-   **wndHandler** **([Window](../WindowControls/Window.md))** - The
    window that fires the event
-   **wndControl** **([Window](../WindowControls/Window.md))** - The
    window control with the event happened
-   **strAnimDataId** **(String)**

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

`Event`

AnimStopped
-----------

### Params

-   **wndHandler** **([Window](../WindowControls/Window.md))** - The
    window that fires the event
-   **wndControl** **([Window](../WindowControls/Window.md))** - The
    window control with the event happened
-   **strAnimDataId** **(String)**

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

`Event`

DragDrop
--------

### Params

-   **wndHandler** **([Window](../WindowControls/Window.md))** - The
    window that fires the event
-   **wndControl** **([Window](../WindowControls/Window.md))** - The
    window control with the event happened
-   **x** **(Integer)**
-   **y** **(Integer)**
-   **wndSource** **([Window](../WindowControls/Window.md))**
-   **strType** **(String)**
-   **iData** **(Integer)**
-   **bDragDropHasBeenReset** **(Boolean)**

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

`Event`

DragDropCancel
--------------

### Params

-   **wndHandler** **([Window](../WindowControls/Window.md))** - The
    window that fires the event
-   **wndControl** **([Window](../WindowControls/Window.md))** - The
    window control with the event happened
-   **strType** **(String)**
-   **iData** **(Integer)**
-   **eReason** **(EDragDropCancelReason)**
-   **bDragDropHasBeenReset** **(Boolean)**

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

`Event`

DragDropClear
-------------

### Params

-   **wndHandler** **([Window](../WindowControls/Window.md))** - The
    window that fires the event
-   **wndControl** **([Window](../WindowControls/Window.md))** - The
    window control with the event happened

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

`Event`

DragDropEnd
-----------

### Params

-   **wndHandler** **([Window](../WindowControls/Window.md))** - The
    window that fires the event
-   **wndControl** **([Window](../WindowControls/Window.md))** - The
    window control with the event happened
-   **strType** **(String)**
-   **iData** **(Integer)**
-   **bDragDropHasBeenReset** **(Boolean)**

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

`Event`

DragDropNothingCursor
---------------------

### Params

-   **wndHandler** **([Window](../WindowControls/Window.md))** - The
    window that fires the event
-   **wndControl** **([Window](../WindowControls/Window.md))** - The
    window control with the event happened
-   **strType** **(String)**
-   **iData** **(Integer)**

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

`Event`

DragDropTargetNotify
--------------------

### Params

-   **wndHandler** **([Window](../WindowControls/Window.md))** - The
    window that fires the event
-   **wndControl** **([Window](../WindowControls/Window.md))** - The
    window control with the event happened
-   **bMe** **(Boolean)**

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

`Event`

GenerateTooltip
---------------

### Params

-   **wndHandler** **([Window](../WindowControls/Window.md))** - The
    window that fires the event
-   **wndControl** **([Window](../WindowControls/Window.md))** - The
    window control with the event happened
-   **eToolTipType** **(EToolTipType)**
-   **x** **(Integer)**
-   **y** **(Integer)**

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

`Event`

MouseButtonDown
---------------

### Params

-   **wndHandler** **([Window](../WindowControls/Window.md))** - The
    window that fires the event
-   **wndControl** **([Window](../WindowControls/Window.md))** - The
    window control with the event happened
-   **eMouseButton** **(EMouseButton)**
-   **nLastRelativeMouseX** **(Integer)**
-   **nLastRelativeMouseY** **(Integer)**
-   **bDoubleClick** **(Boolean)**
-   **bStopPropagation** **(Boolean)**

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

`Event`

MouseButtonUp
-------------

### Params

-   **wndHandler** **([Window](../WindowControls/Window.md))** - The
    window that fires the event
-   **wndControl** **([Window](../WindowControls/Window.md))** - The
    window control with the event happened
-   **eMouseButton** **(EMouseButton)**
-   **nLastRelativeMouseX** **(Integer)**
-   **nLastRelativeMouseY** **(Integer)**

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

`Event`

MouseEnter
----------

### Params

-   **wndHandler** **([Window](../WindowControls/Window.md))** - The
    window that fires the event
-   **wndControl** **([Window](../WindowControls/Window.md))** - The
    window control with the event happened
-   **x** **(Integer)**
-   **y** **(Integer)**

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

`Event`

MouseExit
---------

### Params

-   **wndHandler** **([Window](../WindowControls/Window.md))** - The
    window that fires the event
-   **wndControl** **([Window](../WindowControls/Window.md))** - The
    window control with the event happened
-   **x** **(Integer)**
-   **y** **(Integer)**

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

`Event`

MouseMove
---------

### Params

-   **wndHandler** **([Window](../WindowControls/Window.md))** - The
    window that fires the event
-   **wndControl** **([Window](../WindowControls/Window.md))** - The
    window control with the event happened
-   **nLastRelativeMouseX** **(Integer)**
-   **nLastRelativeMouseY** **(Integer)**

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

`Event`

MouseWheel
----------

### Params

-   **wndHandler** **([Window](../WindowControls/Window.md))** - The
    window that fires the event
-   **wndControl** **([Window](../WindowControls/Window.md))** - The
    window control with the event happened
-   **nLastRelativeMouseX** **(Integer)**
-   **nLastRelativeMouseY** **(Integer)**
-   **fScrollAmount** **(Float)**
-   **bConsumeMouseWheel** **(Boolean)**

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

`Event`

QueryBeginClickStick (Deprecated)
---------------------------------

### Params

-   **wndHandler** **([Window](../WindowControls/Window.md))** - The
    window that fires the event
-   **wndControl** **([Window](../WindowControls/Window.md))** - The
    window control with the event happened
-   **x** **(Integer)**
-   **y** **(Integer)**
-   **bClickStickStarted** **(Boolean)**

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

`Event`

QueryBeginDragDrop (Deprecated)
-------------------------------

### Params

-   **wndHandler** **([Window](../WindowControls/Window.md))** - The
    window that fires the event
-   **wndControl** **([Window](../WindowControls/Window.md))** - The
    window control with the event happened
-   **x** **(Integer)**
-   **y** **(Integer)**
-   **bDragDropStarted** **(Boolean)**

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

`Event`

QueryCursor
-----------

### Params

-   **wndHandler** **([Window](../WindowControls/Window.md))** - The
    window that fires the event
-   **wndControl** **([Window](../WindowControls/Window.md))** - The
    window control with the event happened

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

`Event`

QueryDragDrop
-------------

### Params

-   **wndHandler** **([Window](../WindowControls/Window.md))** - The
    window that fires the event
-   **wndControl** **([Window](../WindowControls/Window.md))** - The
    window control with the event happened
-   **x** **(Integer)**
-   **y** **(Integer)**
-   **wndSource** **([Window](../WindowControls/Window.md))**
-   **strType** **(String)**
-   **iData** **(Integer)**
-   **eResult** **(EDragDropQueryResult)**

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

`Event`

TopLevelWindowMove
------------------

### Params

-   **wndHandler** **([Window](../WindowControls/Window.md))** - The
    window that fires the event
-   **wndControl** **([Window](../WindowControls/Window.md))** - The
    window control with the event happened

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

`Event`

UDE
---

### Params

-   **wndHandler** **([Window](../WindowControls/Window.md))** - The
    window that fires the event
-   **wndControl** **([Window](../WindowControls/Window.md))** - The
    window control with the event happened

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

`Event`

WindowClosed
------------

### Params

-   **wndHandler** **([Window](../WindowControls/Window.md))** - The
    window that fires the event
-   **wndControl** **([Window](../WindowControls/Window.md))** - The
    window control with the event happened

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

`Event`

WindowGainedFocus (Deprecated)
------------------------------

### Description

Fires when a window gains focus

### Params

-   **wndHandler** **([Window](../WindowControls/Window.md))** - The
    window that fires the event
-   **wndControl** **([Window](../WindowControls/Window.md))** - The
    window control with the event happened

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

`Event`

WindowHide
----------

### Params

-   **wndHandler** **([Window](../WindowControls/Window.md))** - The
    window that fires the event
-   **wndControl** **([Window](../WindowControls/Window.md))** - The
    window control with the event happened

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

`Event`

WindowKeyDown
-------------

### Params

-   **wndHandler** **([Window](../WindowControls/Window.md))** - The
    window that fires the event
-   **wndControl** **([Window](../WindowControls/Window.md))** - The
    window control with the event happened
-   **strKeyName** **(String)**
-   **nScanCode** **(Integer)**
-   **nMetakeys** **(Integer)**

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

`Event`

WindowKeyEscape
---------------

### Params

-   **wndHandler** **([Window](../WindowControls/Window.md))** - The
    window that fires the event
-   **wndControl** **([Window](../WindowControls/Window.md))** - The
    window control with the event happened

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

`Event`

WindowKeyReturn
---------------

### Params

-   **wndHandler** **([Window](../WindowControls/Window.md))** - The
    window that fires the event
-   **wndControl** **([Window](../WindowControls/Window.md))** - The
    window control with the event happened

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

`Event`

WindowKeyTab
------------

### Params

-   **wndHandler** **([Window](../WindowControls/Window.md))** - The
    window that fires the event
-   **wndControl** **([Window](../WindowControls/Window.md))** - The
    window control with the event happened

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

`Event`

WindowLoad
----------

### Params

-   **wndHandler** **([Window](../WindowControls/Window.md))** - The
    window that fires the event
-   **wndControl** **([Window](../WindowControls/Window.md))** - The
    window control with the event happened

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

`Event`

WindowLostFocus (Deprecated)
----------------------------

### Description

Fires when a window lost focus

### Params

-   **wndHandler** **([Window](../WindowControls/Window.md))** - The
    window that fires the event
-   **wndControl** **([Window](../WindowControls/Window.md))** - The
    window control with the event happened

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

`Event`

WindowMove
----------

### Description

When a window is moved

### Params

-   **wndHandler** **([Window](../WindowControls/Window.md))** - The
    window that fires the event
-   **wndControl** **([Window](../WindowControls/Window.md))** - The
    window control with the event happened
-   **nOldLeft** **(Integer)** - The left x position before the move
-   **nOldTop** **(Integer)** - The top y position before the move
-   **nOldRight** **(Integer)** - The right x position before the move
-   **nOldBottom** **(Integer)** - The bottome y position before the
    move

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

`Event`

WindowShow
----------

### Params

-   **wndHandler** **([Window](../WindowControls/Window.md))** - The
    window that fires the event
-   **wndControl** **([Window](../WindowControls/Window.md))** - The
    window control with the event happened

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

`Event`

WindowSizeChanged
-----------------

### Params

-   **wndHandler** **([Window](../WindowControls/Window.md))** - The
    window that fires the event
-   **wndControl** **([Window](../WindowControls/Window.md))** - The
    window control with the event happened

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

`Event`

WindowToFront
-------------

### Params

-   **wndHandler** **([Window](../WindowControls/Window.md))** - The
    window that fires the event
-   **wndControl** **([Window](../WindowControls/Window.md))** - The
    window control with the event happened
-   **bOkToBringToFront** **(Boolean)**

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

`Event`

WindowTransitionComplete
------------------------

### Params

-   **wndHandler** **([Window](../WindowControls/Window.md))** - The
    window that fires the event
-   **wndControl** **([Window](../WindowControls/Window.md))** - The
    window control with the event happened

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

`Function`

is()
----

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

`Method`

\_\_eq() (Deprecated)
---------------------

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

`Method`

\_\_gc() (Deprecated)
---------------------

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

`Method`

AddEventHandler()
-----------------

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

`Method`

AddPixie(iLayer, bLine, bRestart, strText, strFont, flagsText, fWidth, strSprite, fRotation, loc, cr, crText)
-------------------------------------------------------------------------------------------------------------

### Params

-   **iLayer** **(Integer)** - The pixie layer that the picie should be
    created at
-   **bLine** **(Boolean)** - Draws the pixie as a line
-   **bRestart** **(Boolean)**
-   **strText** **(String)** - The text to add to the pixie
-   **strFont** **(String)** - The font to use for the pixie
-   **flagsText** **(Table)** - The flags for the the text
-   **fWidth** **(Float)** - The width of the pixie. This is only used
    if the pixie is drawn as a line.
-   **strSprite** **(String)** - The name of the sprite used for the
    pixie. This is only used for pixies that aren't drawn as a line.
-   **fRotation** **(Float)** - The number of degrees the pixie is
    rotated. This is only used for pixies that are not drawn as a line.
-   **loc** **(Table)** - The boundaries of the pixie. This table
    contains the offsets and points for the boundary.
    -   **fPoints** **(Array of Float)** - The points at the edges of
        the pixie. Values are ordered as Left, Top, Right, Bottom.
    -   **nOffsets** **(Array of Integer)** - The offsets for the pixie.
        These are ordered as Left, Top, Right, Bottom.
-   **cr** **([CColor](../Classes/CColor.md))** - The color of the
    pixie
-   **crText** **([CColor](../Classes/CColor.md))** - The color of the
    text in the pixie

### Return Value

-   **Integer** - The pixie's ID number

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

`Method`

AddStyle(strStyle)
------------------

### Params

-   **strStyle** **(String)**

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

`Method`

AddStyleEx(strStyle)
--------------------

### Params

-   **strStyle** **(String)**

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

`Method`

ArrangeChildrenHorz(nOrigin)
----------------------------

### Params

-   **nOrigin** **(Integer)**

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

`Method`

ArrangeChildrenTiles(nOrigin)
-----------------------------

### Params

-   **nOrigin** **(Integer)**

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

`Method`

ArrangeChildrenVert(nOrigin)
----------------------------

### Params

-   **nOrigin** **(Integer)**

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

`Method`

AttachAnim(strAnimDataId)
-------------------------

### Params

-   **strAnimDataId** **(String)**

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

`Method`

BringChildToTop(wndChild)
-------------------------

### Params

-   **wndChild** **([Window](../WindowControls/Window.md))**

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

`Method`

ClearFocus()
------------

### Description

Runs the caller's ClearFous method.

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

`Method`

ClearInterrupt()
----------------

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

`Method`

ClientPointToWindowPoint(nPosX, nPosY)
--------------------------------------

### Params

-   **nPosX** **(Integer)**
-   **nPosY** **(Integer)**

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

`Method`

Close()
-------

### Description

Runs the caller's Close method.

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

`Method`

Contains(nPosX, nPosY)
----------------------

### Description

Does a lua\_pushboolean if the caller contains the point at iPosX and
iPosY.

### Params

-   **nPosX** **(Integer)**
-   **nPosY** **(Integer)**

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

`Method`

ContainsMouse()
---------------

### Description

Does a lua\_pushboolean if the caller contains the point at the current
mouse location.

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

`Method`

Destroy()
---------

### Description

Calls Destroy() on the caller.

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

`Method`

DestroyAllPixies()
------------------

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

`Method`

DestroyChildren()
-----------------

### Description

Calls Destroy() on the caller's children.

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

`Method`

DestroyPixie()
--------------

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

`Method`

DetachAnim()
------------

### Description

Runs the caller's release method on m\_pAnimPlayer.

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

`Method`

Enable(bEnable)
---------------

### Description

Sets the caller's m\_bEnabled boolean to bEnable.

### Params

-   **bEnable** **(Boolean)**

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

`Method`

EnsureChildVisible(wndChild)
----------------------------

### Params

-   **wndChild** **([Window](../WindowControls/Window.md))**

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

`Method`

FindChild(strName)
------------------

### Description

Returns the child of this window that has the specified name.

### Params

-   **strName** **(String)** - The name of the child window

### Return Value

-   **[Window](../WindowControls/Window.md)** - The child window with
    strName if found. Otherwise, this returns nil.

### Usage/Example

```lua
    self.wndMain = Apollo.LoadForm("WindowForms.xml", "MainWindow", nil, self)
    self.wndChild = self.wndMain:FindChild("ChildWindow")
    self.wndChild:Show(false)
```

### Remarks

This function will recursively search through all children of the
window.

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

`Method`

FindChildByUserData()
---------------------

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

`Method`

GetAnchorOffsets()
------------------

### Description

Does a lua\_pushinteger of the Offset Anchor's Left, Top, Right, then
Bottom.

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

`Method`

GetAnchorPoints()
-----------------

### Description

Does a lua\_pushnumber of the Anchor's Left, Top, Right, then Bottom.

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

`Method`

GetAnimElapsedTime()
--------------------

### Description

Does a lua\_pushnumber of the caller's ElapsedTime.

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

`Method`

GetBGColor()
------------

### Description

Runs the caller's GetBGColor method in a CColor\_new.

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

`Method`

GetBGOpacity()
--------------

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

`Method`

GetChildren()
-------------

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

`Method`

GetClientRect()
---------------

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

`Method`

GetData()
---------

### Description

Does a lua\_rawgeti on the caller's m\_iLuaDataRefId.

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

`Method`

GetFrame()
----------

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

`Method`

GetGlobalRadioSel(strRadio)
---------------------------

### Params

-   **strRadio** **(String)**

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

`Method`

GetGlobalRadioSelButton(strRadio)
---------------------------------

### Params

-   **strRadio** **(String)**

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

`Method`

GetHeight()
-----------

### Description

Return the height of the window

### Return Value

-   **Integer** - The height of the window in pixels

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

`Method`

GetHScrollPos()
---------------

### Description

Does a lua\_pushinteger of the caller's HScrollPos.

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

`Method`

GetHScrollRange()
-----------------

### Description

Does a lua\_pushinteger of the caller's m\_sbHorz range.

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

`Method`

GetId()
-------

### Description

Does a lua\_pushinteger on the caller's Id.

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

`Method`

GetLocation()
-------------

### Description

Returns a new WindowLocation specified by the current window location.

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

`Method`

GetMouse()
----------

### Description

Does a lua\_newtable with the x and y value of the mouse.

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

`Method`

GetName()
---------

### Description

Does a lua\_pushwstring of the caller's name, sending "" if null.

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

`Method`

GetNCOpacity()
--------------

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

`Method`

GetOpacity()
------------

### Description

Does a lua.PushDouble of the caller's opacity.

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

`Method`

GetOriginalLocation()
---------------------

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

`Method`

GetParent()
-----------

### Description

Returns the caller's parent, or does a lua\_pushnil if null.

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

`Method`

GetPixieInfo(iLayer)
--------------

### Description

Returns the caller's children pixie data, or does a lua\_pushnil if null. Keep in mind it does not return all values of a pixie.

### Params

-   **iLayer** **(Integer)** - The layer number of the pixie, `Pixie 1` from the form would be `iLayer = 1`

### Return Values

-   **cr** **[ApolloColor](../Classes/ApolloColor.md)** - The sprite color modifier
-   **fRotation** **Float** - Degree of rotation
-   **loc** **Table** - Relative position to parent
-   **strSprite** **String** - Name of the sprite

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

`Method`

GetPos()
--------

### Description

Does a lua\_pushinteger of the caller's min x and min y.

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

`Method`

GetRadioSel(strRadio)
---------------------

### Description

Does a lua\_pushinteger of the radio selection corresponding to sRadio.

### Params

-   **strRadio** **(String)**

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

`Method`

GetRadioSelButton(strRadio)
---------------------------

### Params

-   **strRadio** **(String)**

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

`Method`

GetRect()
---------

### Description

Get the rect of the window

### Usage/Example

```lua
    local nLeft, nTop, nRight, nBottom = self.wndMain:GetRect()
```

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

`Method`

GetRotation()
-------------

### Description

Does a lua\_pushnumber of the caller's rotation after a
RadiansToDegrees.

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

`Method`

GetScale()
----------

### Description

Does a lua\_pushnumber of the caller's scale.

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

`Method`

GetSizingMaximum()
------------------

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

`Method`

GetSizingMinimum()
------------------

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

`Method`

GetSprite()
-----------

### Description

Does a lua\_pushwstring of the SpriteInfo's name, or "" if it is null.

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

`Method`

GetText()
---------

### Description

Does a lua\_pushwstring of the caller's text.

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

`Method`

GetTextColor()
--------------

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

`Method`

GetTransLocation()
------------------

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

`Method`

GetVScrollPos()
---------------

### Description

Does a lua\_pushinteger of the caller's VScrollPos.

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

`Method`

GetVScrollRange()
-----------------

### Description

Does a lua\_pushinteger of the caller's m\_sbVert range.

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

`Method`

GetWidth()
----------

### Description

Return the width of the window

### Return Value

-   **Integer** - The width of the window in pixels

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

`Method`

GetWindowSubclass()
-------------------

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

`Method`

HasTooltip()
------------

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

`Method`

HasTooltipSecondary()
---------------------

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

`Method`

Invoke()
--------

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

`Method`

IsAnimPlaying()
---------------

### Description

Does a lua\_pushboolean of the caller's IsPlaying boolean.

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

`Method`

IsChildOfMouseTarget()
----------------------

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

`Method`

IsEnabled()
-----------

### Description

Does a lua\_pushboolean of the caller's enable boolean.

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

`Method`

IsMouseTarget()
---------------

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

`Method`

IsParentOfMouseTarget()
-----------------------

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

`Method`

IsShown()
---------

### Description

Does a lua\_pushboolean of the caller's IsShown boolean.

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

`Method`

IsStyleExOn()
-------------

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

`Method`

IsStyleOn()
-----------

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

`Method`

IsValid()
---------

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

`Method`

IsVisible()
-----------

### Description

Does a lua\_pushboolean of the caller's IsVisible boolean.

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

`Method`

LoadTooltipForm(strFile, strForm, tTable)
-----------------------------------------

### Params

-   **strFile** **(String)**
-   **strForm** **(String)**
-   **tTable** **(LuaTable)** - (Optional)

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

`Method`

LoadTooltipFormSecondary(strFile, strForm, tTable)
--------------------------------------------------

### Params

-   **strFile** **(String)**
-   **strForm** **(String)**
-   **tTable** **(LuaTable)** - (Optional)

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

`Method`

Move(nLeft, nTop, nWidth, nHeight)
----------------------------------

### Description

Move and resize the window

### Params

-   **nLeft** **(Integer)**
-   **nTop** **(Integer)**
-   **nWidth** **(Integer)**
-   **nHeight** **(Integer)**

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

`Method`

MoveMethod() (Deprecated)
-------------------------

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

`Method`

MoveToLoc()
-----------

### Description

Should be deprecated

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

`Method`

MoveToLocation(wndLoc)
----------------------

### Params

-   **wndLoc**
    **([WindowLocation](../WindowControls/WindowLocation.md))**

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

`Method`

PauseAnim()
-----------

### Description

Runs the caller's pause method on m\_pAnimPlayer.

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

`Method`

PlayAnim(fDelay)
----------------

### Params

-   **fDelay** **(Float)**

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

`Method`

RecalculateContentExtents()
---------------------------

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

`Method`

RemoveEventHandler()
--------------------

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

`Method`

RemoveStyle(strStyle)
---------------------

### Params

-   **strStyle** **(String)**

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

`Method`

RemoveStyleEx(strStyle)
-----------------------

### Params

-   **strStyle** **(String)**

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

`Method`

Reposition()
------------

### Description

Runs the caller's Reposition method.

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

`Method`

ResetSubclass()
---------------

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

`Method`

RestartPixieSprite()
--------------------

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

`Method`

SendChildToBottom()
-------------------

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

`Method`

SetAnchorOffsets(nLeft, nTop, nRight, nBottom)
----------------------------------------------

### Params

-   **nLeft** **(Integer)**
-   **nTop** **(Integer)**
-   **nRight** **(Integer)**
-   **nBottom** **(Integer)**

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

`Method`

SetAnchorPoints(nLeft, nTop, nRight, nBottom)
---------------------------------------------

### Params

-   **nLeft** **(Integer)**
-   **nTop** **(Integer)**
-   **nRight** **(Integer)**
-   **nBottom** **(Integer)**

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

`Method`

SetAnimElapsedTime(fTime)
-------------------------

### Params

-   **fTime** **(Float)**

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

`Method`

SetAnimPlaybackRate(fRate)
--------------------------

### Params

-   **fRate** **(Float)**

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

`Method`

SetBGColor(clr)
---------------

### Params

-   **clr** **([CColor](../Classes/CColor.md))**

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

`Method`

SetBGOpacity()
--------------

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

`Method`

SetCanResize()
--------------

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

`Method`

SetClientSprite(wndB)
---------------------

### Description

Sets the caller's ClientSprite to wndB's ClientSprite.

### Params

-   **wndB** **([Window](../WindowControls/Window.md))**

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

`Method`

SetData(lData)
--------------

### Params

-   **lData** **(LuaData)**

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

`Method`

SetFocus()
----------

### Description

Runs the caller's SetFocus method.

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

`Method`

SetFont(strText)
----------------

### Description

Sets the font by alias on the caller after running a UTF8ToUCS2 on
strText.

### Params

-   **strText** **(String)**

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

`Method`

SetGlobalRadioSel(strRadio)
---------------------------

### Params

-   **strRadio** **(String)**

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

`Method`

SetHScrollInfo(nRange, nPageSize, nIncrement)
---------------------------------------------

### Params

-   **nRange** **(Integer)**
-   **nPageSize** **(Integer)**
-   **nIncrement** **(Integer)**

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

`Method`

SetHScrollPos(nNewPos)
----------------------

### Params

-   **nNewPos** **(Integer)**

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

`Method`

SetInterrupt()
--------------

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

`Method`

SetLoaded(bLoaded)
------------------

### Description

Sets the caller's m\_bLoaded boolean to bLoaded.

### Params

-   **bLoaded** **(Boolean)**

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

`Method`

SetName(strName)
----------------

### Description

Sets the caller's name to sName.

### Params

-   **strName** **(String)**

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

`Method`

SetNamedAnchor(fPoint, nOffset, bOverwrite)
-------------------------------------------

### Params

-   **fPoint** **(Float)**
-   **nOffset** **(Integer)**
-   **bOverwrite** **(Boolean)**

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

`Method`

SetNCOpacity()
--------------

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

`Method`

SetOpacity(fOpacity, fRate)
---------------------------

### Params

-   **fOpacity** **(Float)** - (Default value: 1.0)
-   **fRate** **(Float)** - (Default value: -1.0)

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

`Method`

SetRadioSel(strRadio, nSelection)
---------------------------------

### Params

-   **strRadio** **(String)**
-   **nSelection** **(Integer)** - (Default value: 0)

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

`Method`

SetRadioSelButton(strRadio, bButton)
------------------------------------

### Params

-   **strRadio** **(String)**
-   **bButton** **([Button](../WindowControls/Button.md))**

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

`Method`

SetRotation(fNewRotation)
-------------------------

### Description

Sets the caller's rotation to fNewRotation after a DegreesToRadians.

### Params

-   **fNewRotation** **(Float)**

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

`Method`

SetScale(fNewScale)
-------------------

### Description

Sets the caller's scale.

### Params

-   **fNewScale** **(Float)**

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

`Method`

SetSelfAnchor()
---------------

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

`Method`

SetSizingMaximum(nWidth, nHeight)
---------------------------------

### Description

Sets the caller's sizing maximum to iWidth and iHeight.

### Params

-   **nWidth** **(Integer)**
-   **nHeight** **(Integer)**

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

`Method`

SetSizingMinimum(nWidth, nHeight)
---------------------------------

### Description

Sets the caller's sizing minimum to iWidth and iHeight.

### Params

-   **nWidth** **(Integer)**
-   **nHeight** **(Integer)**

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

`Method`

SetSprite(strSprite)
--------------------

### Params

-   **strSprite** **(String)**

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

`Method`

SetSpriteProgress(fTime)
------------------------

### Params

-   **fTime** **(Float)**

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

`Method`

SetSpriteRate(fTime)
--------------------

### Params

-   **fTime** **(Float)**

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

`Method`

SetSpriteTargetDuration(fTime)
------------------------------

### Params

-   **fTime** **(Float)**

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

`Method`

SetSpriteTime(fTime)
--------------------

### Params

-   **fTime** **(Float)**

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

`Method`

SetStyle(strText, bOn)
----------------------

### Params

-   **strText** **(String)**
-   **bOn** **(Boolean)** - (Optional, Default to GetStyleBit on
    strText)

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

`Method`

SetStyleEx(strStyle)
--------------------

### Params

-   **strStyle** **(String)**

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

`Method`

SetText(strNewText)
-------------------

### Params

-   **strNewText** **(String)**

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

`Method`

SetTextColor(clr)
-----------------

### Params

-   **clr** **([CColor](../Classes/CColor.md))**

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

`Method`

SetTextFlags(strText, bOn)
--------------------------

### Params

-   **strText** **(String)**
-   **bOn** **(Boolean)** - (Optional, Skipped if strText does not
    yields a StyleBit)

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

`Method`

SetTextRaw()
------------

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

`Method`

SetTooltip(strTip)
------------------

### Description

Sets the tooltip on the caller after running a UTF8ToUCS2 on strTip.

### Params

-   **strTip** **(String)**

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

`Method`

SetTooltipDoc(pXml)
-------------------

### Params

-   **pXml** **(XmlDocumentRef)**

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

`Method`

SetTooltipDocSecondary(pXml)
----------------------------

### Params

-   **pXml** **(XmlDocumentRef)**

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

`Method`

SetTooltipForm()
----------------

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

`Method`

SetTooltipFormSecondary()
-------------------------

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

`Method`

SetTooltipToWindow(wndB)
------------------------

### Description

Sets the caller's tooltip doc and tooltip secondary doc to wndB's
values.

### Params

-   **wndB** **([Window](../WindowControls/Window.md))**

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

`Method`

SetTooltipType(nType)
---------------------

### Description

Sets the tooltip type on the caller after casting nType to a
ETooltipPositionType.

### Params

-   **nType** **(ETooltipPositionType)**

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

`Method`

SetVScrollInfo(nRange, nPageSize, nMinInc)
------------------------------------------

### Params

-   **nRange** **(Integer)**
-   **nPageSize** **(Integer)**
-   **nMinInc** **(Integer)**

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

`Method`

SetVScrollPos(nNewPos)
----------------------

### Params

-   **nNewPos** **(Integer)**

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

`Method`

SetWindowSubclass()
-------------------

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

`Method`

SetWindowTemplate()
-------------------

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

`Method`

Show(bShow, bImmediate)
-----------------------

### Description

Runs the caller's show method with bShow and bImmediate.

### Params

-   **bShow** **(Boolean)**
-   **bImmediate** **(Boolean)**

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

`Method`

ToFront()
---------

### Description

Runs the caller's BringWindowToFront method.

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

`Method`

TransitionMove(nMinX, nMinY, nOffX, nOffY, fRate, bContinuous)
--------------------------------------------------------------

### Description

Calls a transition move with pLocBegin null and pLocEnd specified by
dMinX, dMinY, dMinX+dOffX, dMinY+dOffY, fRate, and bContinuous.

### Params

-   **nMinX** **(Double)**
-   **nMinY** **(Double)**
-   **nOffX** **(Double)**
-   **nOffY** **(Double)**
-   **fRate** **(Float)**
-   **bContinuous** **(Boolean)**

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

`Method`

TransitionMoveFrom(nMinX, nMinY, nOffX, nOffY, fRate, bContinuous)
------------------------------------------------------------------

### Description

Calls a transition move with pLocEnd null and pLocBegin specified by
dMinX, dMinY, dMinX+dOffX, dMinY+dOffY, fRate, and bContinuous.

### Params

-   **nMinX** **(Double)**
-   **nMinY** **(Double)**
-   **nOffX** **(Double)**
-   **nOffY** **(Double)**
-   **fRate** **(Float)**
-   **bContinuous** **(Boolean)**

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

`Method`

TransitionPulse(fScale, fRate, bContinuous) (Deprecated)
--------------------------------------------------------

### Params

-   **fScale** **(Float)**
-   **fRate** **(Float)**
-   **bContinuous** **(Boolean)**

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

`Method`

UnpauseAnim()
-------------

### Description

Runs the caller's unpause method on m\_pAnimPlayer.

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

`Method`

UpdatePixie()
-------------

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

`Method`

WindowPointToClientPoint(nPosX, nPosY)
--------------------------------------

### Params

-   **nPosX** **(Integer)**
-   **nPosY** **(Integer)**


text:
tests = int(raw_input().strip())

for test in xrange(tests):

    N = int(raw_input().strip())

    a = 2

    #
    # Loop until sqrt(N) rather than N.
    # Ex: N = 22 ==> 2 x 11, Loop until sqrt(22) = 4 and then divide revursively over all factors. If in the end, N is equal to 1
    # All factors have been found. Else the remaining number is largest prime factor
    #
    while a*a <= N:

        if N%a == 0:
            N = N/a
        else:
            a += 1

    if N != 1:
    	a=N

    print a

redpajama_set_name: RedPajamaGithub


text:
class Location::Church < Location
  def connections
    [:courtyard, :church_library]
  end

  def describe
    if self.find :insects
      'Spiders and bugs bar my way! It seems libraries aren't that popular nowadays.'
    else
      'The church is cleansed of insects. A holy spirit fills the air.'
    end
  end

  def move_player_to(next_location)
    current_location = self

    insects = current_location.find :insects

    if next_location.is?(:church_library) && insects.present?
      if player.find :insect_hunters
        "Flesh-eating spiders are still in my way, but the insect_hunters are with me.."
      else
        hunters = game.find_in_tree :insect_hunters
        hunters.active = true
        "I'm very afraid of insects! Perhaps I need some help to advance."
      end
    else
      super
    end
  end
end


text:
#include "h2o.h"
#include "h2o/configurator.h"

struct errordoc_configurator_t {
    h2o_configurator_t super;
    h2o_mem_pool_t pool;
    H2O_VECTOR(h2o_errordoc_t) * vars, _vars_stack[H2O_CONFIGURATOR_NUM_LEVELS + 1];
};

static int register_errordoc(h2o_configurator_command_t *cmd, h2o_configurator_context_t *ctx, yoml_t *hash)
{
    struct errordoc_configurator_t *self = (void *)cmd->configurator;
    yoml_t **url_node, **status_nodes;
    size_t i, j, num_status;

    /* extract the nodes to handle */
    if (h2o_configurator_parse_mapping(cmd, hash, "url:s,status:*", NULL, &url_node, &status_nodes) != 0)
        return -1;
    switch ((*status_nodes)->type) {
    case YOML_TYPE_SCALAR:
        num_status = 1;
        break;
    case YOML_TYPE_SEQUENCE:
        if ((*status_nodes)->data.sequence.size == 0) {
            h2o_configurator_errprintf(cmd, *status_nodes, "status cannot be an empty sequence");
            return -1;
        }
        num_status = (*status_nodes)->data.sequence.size;
        status_nodes = (*status_nodes)->data.sequence.elements;
        break;
    default:
        h2o_configurator_errprintf(cmd, *status_nodes, "status must be a 3-digit scalar or a sequence of 3-digit scalars");
        return -1;
    }

    /* convert list of status_nodes (in string) to list of 3-digit codes */
    int *status_codes = alloca(sizeof(*status_codes) * num_status);
    for (i = 0; i != num_status; ++i) {
        if (h2o_configurator_scanf(cmd, status_nodes[i], "%d", &status_codes[i]) != 0)
            return -1;
        if (!(400 <= status_codes[i] && status_codes[i] <= 599)) {
            h2o_configurator_errprintf(cmd, status_nodes[i], "status must be within range of 400 to 599");
            return -1;
        }
        /* check the scanned status hasn't already appeared */
        for (j = 0; j != i; ++j) {
            if (status_codes[j] == status_codes[i]) {
                h2o_configurator_errprintf(cmd, status_nodes[i], "status %d appears multiple times", status_codes[i]);
                return -1;
            }
        }
    }

    h2o_iovec_t url = h2o_strdup(&self->pool, (*url_node)->data.scalar, SIZE_MAX);
    for (i = 0; i != num_status; ++i) {
        /* register */
        h2o_vector_reserve(&self->pool, self->vars, self->vars->size + 1);
        h2o_errordoc_t *errordoc = self->vars->entries + self->vars->size++;
        errordoc->status = status_codes[i];
        errordoc->url = url;
    }

    return 0;
}

static int on_config_errordoc(h2o_configurator_command_t *cmd, h2o_configurator_context_t *ctx, yoml_t *node)
{
    switch (node->type) {
    case YOML_TYPE_SEQUENCE: {
        size_t i;
        for (i = 0; i != node->data.sequence.size; ++i) {
            yoml_t *e = node->data.sequence.elements[i];
            if (e->type != YOML_TYPE_MAPPING) {
                h2o_configurator_errprintf(cmd, e, "element must be a mapping");
                return -1;
            }
            if (register_errordoc(cmd, ctx, e) != 0)
                return -1;
        }
        return 0;
    }
    case YOML_TYPE_MAPPING:
        return register_errordoc(cmd, ctx, node);
    default:
        break;
    }

    h2o_configurator_errprintf(cmd, node, "argument must be either of: sequence, mapping");
    return -1;
}

static int on_config_enter(h2o_configurator_t *_self, h2o_configurator_context_t *ctx, yoml_t *node)
{
    struct errordoc_configurator_t *self = (void *)_self;

    if (self->vars == self->_vars_stack) {
        /* entering global level */
        h2o_mem_init_pool(&self->pool);
    }

    /* copy vars */
    memset(&self->vars[1], 0, sizeof(self->vars[1]));
    h2o_vector_reserve(&self->pool, &self->vars[1], self->vars[0].size);
    h2o_memcpy(self->vars[1].entries, self->vars[0].entries, sizeof(self->vars[0].entries[0]) * self->vars[0].size);
    self->vars[1].size = self->vars[0].size;

    ++self->vars;
    return 0;
}

static int on_config_exit(h2o_configurator_t *_self, h2o_configurator_context_t *ctx, yoml_t *node)
{
    struct errordoc_configurator_t *self = (void *)_self;

    if (ctx->pathconf != NULL && self->vars->size != 0)
        h2o_errordoc_register(ctx->pathconf, self->vars->entries, self->vars->size);

    --self->vars;
    if (self->vars == self->_vars_stack) {
        /* exitting global level */
        h2o_mem_clear_pool(&self->pool);
    }

    return 0;
}

void h2o_errordoc_register_configurator(h2o_globalconf_t *conf)
{
    struct errordoc_configurator_t *c = (void *)h2o_configurator_create(conf, sizeof(*c));

    /* set default vars */
    c->vars = c->_vars_stack;

    /* setup handlers */
    c->super.enter = on_config_enter;
    c->super.exit = on_config_exit;

    /* reproxy: ON | OFF */
    h2o_configurator_define_command(&c->super, "error-doc", H2O_CONFIGURATOR_FLAG_ALL_LEVELS, on_config_errordoc);
}


text:
![OnePunchColor](https://github.com/OpenMarshall/OnePunchColor/raw/master/OnePunchColor.gif)

###What is This
Here are 22 different colors, which are compatible with white color, I got these from《One Punch Man》.

Now you can use these colors in your App, go get them from UIColor or just UIView.

You can download ZIP to see how this works (very simple), or just download file OnePunchColor.swift, and use it as follow.

我从《一拳超人》动画中吸取了22种和白色非常匹配的颜色,现在你可以通过 UIColor 或者 UIView 来调用这些颜色。

你可以下载整个项目来看一下,也可以只下载 OnePunchColor.swift 这个文件,然后按照下面所示的这种方法使用。

###How to Use
    // quick version
    self.view.punch()

    // slow version
    self.view.punchWithInterval(2)

    // complete version
    self.view.backgroundColor = UIColor.onePunchColor()


text:
import styled from "styled-components";

import { CHART_BACKGROUND_COLOR, FONT_STACK_DATA } from "style/styleVariables";
import { chartHeight } from "style/styleFunctions";

const LineChartDisplay = styled.div.attrs({
  tabIndex: 0
})`
  align-items: stretch;
  background-color: ${CHART_BACKGROUND_COLOR};
  border: 1px solid transparent;
  display: flex;
  flex: 1 1 100%;
  flex-direction: column;
  font-family: ${FONT_STACK_DATA};
  ${props => (props.height ? chartHeight(props.height) : "height:  100%")};
  width: 100%;
`;

export default LineChartDisplay;


text:
/* Initial inserts Institute Library*/

/* USERS */

INSERT INTO user VALUES (1, 'Birgit', 'Leiter', 'Birgit', md5('birgit'), 'Birgit.Leiter@sti2.at', 0, 1);
INSERT INTO user VALUES (1, 'Ruth', 'Tillian', 'Ruth', md5('ruth'), 'Ruth.Tillian@sti2.at', 0, 1);
INSERT INTO user VALUES (1, 'David', 'Peer', 'David', md5('david'), 'David.Peer@sti2.at', 0, 1);
INSERT INTO user VALUES (1, 'Florian', 'Lechner', 'Florian', md5('florian'), 'Florian.Lechner@sti2.at', 0, 1);
INSERT INTO user VALUES (1, 'Nathalie', 'Steinmetz', 'Nathalie', md5('nathalie'), 'Nathalie.Steinmetz@sti2.at', 0, 1);

/* ORGANISATION */

INSERT INTO organisation VALUES (28, 28);


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

namespace Azure.Search.Documents.Indexes.Models
{
    /// <summary>
    /// <para>
    /// Represents a field in an index definition, which describes the name, data type, and search behavior of a field.
    /// </para>
    /// <para>
    /// When creating an index, instead use the <see cref="SimpleField"/>, <see cref="SearchableField"/>, and <see cref="ComplexField"/> classes to help you more easily create a <see cref="SearchIndex"/>.
    /// </para>
    /// </summary>
    [CodeGenModel("Field")]
    public partial class SearchField
    {
        // TODO: Replace constructor and read-only properties when https://github.com/Azure/autorest.csharp/issues/554 is fixed.

        /// <summary>
        /// Initializes a new instance of the <see cref="SearchField"/> class.
        /// </summary>
        /// <param name="name">The name of the field, which must be unique within the index or parent field.</param>
        /// <param name="type">The data type of the field.</param>
        /// <exception cref="ArgumentException"><paramref name="name"/> is an empty string.</exception>
        /// <exception cref="ArgumentNullException"><paramref name="name"/> is null.</exception>
        public SearchField(string name, SearchFieldDataType type)
        {
            Argument.AssertNotNullOrEmpty(name, nameof(name));

            Name = name;
            Type = type;
        }

        /// <summary>
        /// Gets the name of the field.
        /// </summary>
        [CodeGenMember("name")]
        public string Name { get; }

        /// <summary>
        /// Ge the data type of the field.
        /// </summary>
        [CodeGenMember("type")]
        public SearchFieldDataType Type { get; }

        // TODO: Remove "overrides" for boolean properties when https://github.com/Azure/autorest.csharp/issues/558 is fixed.

        /// <summary>
        /// Gets or sets a value indicating whether the field is full-text searchable. The default is null.
        /// This means it will undergo analysis such as word-breaking during indexing.
        /// This property can be true only for <see cref="SearchFieldDataType.String"/> or "Collection(DataType.String)". It must be false for non-string simple fields, and null for complex fields.
        /// </summary>
        /// <remarks>
        /// <para>
        /// Full-text searches enable the field value "sunny day" to be split into individual terms "sunny" and "day". This will increase the size of your index.
        /// </para>
        /// <para>
        /// This field must be set according to constraints described in the summary, or the server may respond with an error.
        /// Instead, consider using the <see cref="SimpleField"/>, <see cref="SearchableField"/>, and <see cref="ComplexField"/> classes to help you more easily create a <see cref="SearchIndex"/>.
        /// </para>
        /// </remarks>
        [CodeGenMember("searchable")]
        public bool? IsSearchable { get; set; }

        /// <summary>
        /// Gets or sets a value indicating whether the field can be referenced in <c>$filter</c> queries. The default is null.
        /// This property must be null for complex fields, but can be set on simple fields within a complex field.
        /// </summary>
        /// <remarks>
        /// <para>
        /// Filterable differs from searchable in how strings are handled. Fields of type <see cref="SearchFieldDataType.String"/> or "Collection(DataType.String)" that are filterable do not undergo word-breaking, so comparisons are for exact matches only.
        /// For example, if you set such a field <c>f</c> to "sunny day", <c>$filter=f eq 'sunny'</c> will find no matches, but <c>$filter=f eq 'sunny day'</c> will.
        /// </para>
        /// <para>
        /// This field must be set according to constraints described in the summary, or the server may respond with an error.
        /// Instead, consider using the <see cref="SimpleField"/>, <see cref="SearchableField"/>, and <see cref="ComplexField"/> classes to help you more easily create a <see cref="SearchIndex"/>.
        /// </para>
        /// </remarks>
        [CodeGenMember("filterable")]
        public bool? IsFilterable { get; set; }

        /// <summary>
        /// Gets or sets a value indicating whether the field will be returned in a search result. The default is null.
        /// This property must be true for key fields, and must be null for complex fields.
        /// </summary>
        /// <remarks>
        /// <para>
        /// You can hide a field from search results if you want to use it only as a filter, for sorting, or for scoring.
        /// This property can also be changed on existing fields and enabling it does not cause an increase in index storage requirements.
        /// </para>
        /// <para>
        /// This field must be set according to constraints described in the summary, or the server may respond with an error.
        /// Instead, consider using the <see cref="SimpleField"/>, <see cref="SearchableField"/>, and <see cref="ComplexField"/> classes to help you more easily create a <see cref="SearchIndex"/>.
        /// </para>
        /// </remarks>
        public bool? IsHidden
        {
            get => IsRetrievable.HasValue ? !IsRetrievable : null;
            set => IsRetrievable = value.HasValue ? !value : null;
        }

        [CodeGenMember("retrievable")]
        private bool? IsRetrievable { get; set; }

        /// <summary>
        /// Gets or sets a value indicating whether the field can be referenced in a <c>$orderby</c> expression. The default is null.
        /// A simple field can be sortable only if it is a single-valued type such as <see cref="SearchFieldDataType.String"/> or <see cref="SearchFieldDataType.Int32"/>.
        /// </summary>
        /// <remarks>
        /// This field must be set according to constraints described in the summary, or the server may respond with an error.
        /// Instead, consider using the <see cref="SimpleField"/>, <see cref="SearchableField"/>, and <see cref="ComplexField"/> classes to help you more easily create a <see cref="SearchIndex"/>.
        /// </remarks>
        [CodeGenMember("sortable")]
        public bool? IsSortable { get; set; }

        /// <summary>
        /// Gets or sets a value indicating whether the field can be retrieved in facet queries. The default is null.
        /// This property must be null for complex fields, but can be set on simple fields within a complex field.
        /// </summary>
        /// <remarks>
        /// <para>
        /// Facets are used in presentation of search results that include hit counts by categories.
        /// For example, in a search for digital cameras, facets might include branch, megapixels, price, etc.
        /// </para>
        /// <para>
        /// This field must be set according to constraints described in the summary, or the server may respond with an error.
        /// Instead, consider using the <see cref="SimpleField"/>, <see cref="SearchableField"/>, and <see cref="ComplexField"/> classes to help you more easily create a <see cref="SearchIndex"/>.
        /// </para>
        /// </remarks>
        [CodeGenMember("facetable")]
        public bool? IsFacetable { get; set; }

        /// <summary>
        /// Gets or sets whether the field is the key field. The default is null.
        /// A <see cref="SearchIndex"/> must have exactly one key field of type <see cref="SearchFieldDataType.String"/>.
        /// </summary>
        /// <remarks>
        /// This field must be set according to constraints described in the summary, or the server may respond with an error.
        /// Instead, consider using the <see cref="SimpleField"/>, <see cref="SearchableField"/>, and <see cref="ComplexField"/> classes to help you more easily create a <see cref="SearchIndex"/>.
        /// </remarks>
        [CodeGenMember("key")]
        public bool? IsKey { get; set; }

        /// <summary>
        /// Gets or sets the name of the analyzer to use for the field.
        /// This option can be used only with searchable fields and it cannot be set together with either <see cref="SearchAnalyzerName"/> or <see cref="IndexAnalyzerName"/>.
        /// Once the analyzer is chosen, it cannot be changed for the field.
        /// Must be null for complex fields.
        /// </summary>
        [CodeGenMember("analyzer")]
        public LexicalAnalyzerName? AnalyzerName { get; set; }

        /// <summary>
        /// Gets or sets the name of the analyzer used at search time for the field.
        /// This option can be used only with searchable fields.
        /// It must be set together with <see cref="IndexAnalyzerName"/> and it cannot be set together with the <see cref="AnalyzerName"/> option.
        /// This property cannot be set to the name of a language analyzer; use the <see cref="AnalyzerName"/> property instead if you need a language analyzer.
        /// This analyzer can be updated on an existing field.
        /// Must be null for complex fields.
        /// </summary>
        [CodeGenMember("searchAnalyzer")]
        public LexicalAnalyzerName? SearchAnalyzerName { get; set; }

        /// <summary>
        /// Gets or sets the name of the analyzer used at indexing time for the field.
        /// This option can be used only with searchable fields.
        /// It must be set together with <see cref="SearchAnalyzerName"/> and it cannot be set together with the <see cref="AnalyzerName"/> option.
        /// This property cannot be set to the name of a language analyzer; use the <see cref="AnalyzerName"/> property instead if you need a language analyzer.
        /// Once the analyzer is chosen, it cannot be changed for the field.
        /// Must be null for complex fields. </summary>
        [CodeGenMember("indexAnalyzer")]
        public LexicalAnalyzerName? IndexAnalyzerName { get; set; }

        // TODO: Remove "overrides" for collection properties when https://github.com/Azure/autorest.csharp/issues/521 is fixed.

        /// <summary>
        /// Gets a list of names of synonym maps associated with this field. Only fields where <see cref="IsSearchable"/> is true can have associated synonym maps.
        /// </summary>
        [CodeGenMember("synonymMaps")]
        public IList<string> SynonymMapNames { get; internal set; }

        /// <summary>
        /// Gets a list of nested fields if this field is of type <see cref="SearchFieldDataType.Complex"/> or "Collection(DataType.Complex)".
        /// </summary>
        [CodeGenMember("fields")]
        public IList<SearchField> Fields { get; internal set; }

        /// <inheritdoc/>
        /// <remarks>
        /// This always returns "<see cref="Name"/> : <see cref="Type"/>" and is meant for debugging purposes.
        /// </remarks>
        public override string ToString() => $"{Name} : {Type}";
    }
}


text:
local K, C, L = select(2, ...):unpack()

local DataText = K.DataTexts
local NameColor = DataText.NameColor
local ValueColor = DataText.ValueColor

--Lua functions
local select = select
local format, join = string.format, string.join

--WoW API / Variables
local EasyMenu = EasyMenu
local GetActiveSpecGroup = GetActiveSpecGroup
local GetLootSpecialization = GetLootSpecialization
local GetNumSpecGroups = GetNumSpecGroups
local GetSpecialization = GetSpecialization
local GetSpecializationInfo = GetSpecializationInfo
local GetSpecializationInfoByID = GetSpecializationInfoByID
local HideUIPanel = HideUIPanel
local IsShiftKeyDown = IsShiftKeyDown
local SetLootSpecialization = SetLootSpecialization
local SetSpecialization = SetSpecialization
local ShowUIPanel = ShowUIPanel
local LOOT = LOOT
local SELECT_LOOT_SPECIALIZATION = SELECT_LOOT_SPECIALIZATION
local LOOT_SPECIALIZATION_DEFAULT = LOOT_SPECIALIZATION_DEFAULT

local displayString = ""
local activeString = join("", "|cff00FF00" , ACTIVE_PETS, "|r")
local inactiveString = join("", "|cffFF0000", FACTION_INACTIVE, "|r")
local menuFrame = CreateFrame("Frame", "KkthnxUILootSpecializationDatatextClickMenu", UIParent, "UIDropDownMenuTemplate")

local menuList = {
	{text = SELECT_LOOT_SPECIALIZATION, isTitle = true, notCheckable = true},
	{notCheckable = true, func = function() SetLootSpecialization(0) end},
	{notCheckable = true},
	{notCheckable = true},
	{notCheckable = true},
	{notCheckable = true}
}
local specList = {
	{text = SPECIALIZATION, isTitle = true, notCheckable = true},
	{notCheckable = true},
	{notCheckable = true},
	{notCheckable = true},
	{notCheckable = true}
}

local function Update(self)
	local specIndex = GetSpecialization()
	if not specIndex then
		self.Text:SetText("N/A")
		return
	end

	active = GetActiveSpecGroup()

	local talent, loot = "", ""
	local i = GetSpecialization(false, false, active)
	if i then
		i = select(4, GetSpecializationInfo(i))
		if(i) then
			talent = format("|T%s:14:14:0:0:64:64:4:60:4:60|t", i)
		end
	end

	local specialization = GetLootSpecialization()
	if specialization == 0 then
		local specIndex = GetSpecialization()

		if specIndex then
			local _, _, _, texture = GetSpecializationInfo(specIndex)
			if texture then
				loot = format("|T%s:14:14:0:0:64:64:4:60:4:60|t", texture)
			else
				loot = "N/A"
			end
		else
			loot = "N/A"
		end
	else
		local _, _, _, texture = GetSpecializationInfoByID(specialization)
		if texture then
			loot = format("|T%s:14:14:0:0:64:64:4:60:4:60|t", texture)
		else
			loot = "N/A"
		end
	end

	self.Text:SetFormattedText("%s: %s %s: %s", L.DataText.LootSpecSpec, talent, LOOT, loot) --Needs local
end

local OnEnter = function(self)
	if (InCombatLockdown()) then
		return
	end

	GameTooltip:SetOwner(self:GetTooltipAnchor())
	GameTooltip:ClearLines()

	for i = 1, GetNumSpecGroups() do
		if GetSpecialization(false, false, i) then
			GameTooltip:AddLine(join(" ", format(displayString, select(2, GetSpecializationInfo(GetSpecialization(false, false, i)))), (i == active and activeString or inactiveString)),1,1,1)
		end
	end

	GameTooltip:AddLine(" ")
	local specialization = GetLootSpecialization()
	if specialization == 0 then
		local specIndex = GetSpecialization()

		if specIndex then
			local _, name = GetSpecializationInfo(specIndex)
			GameTooltip:AddLine(format("|cffFFFFFF%s:|r %s", SELECT_LOOT_SPECIALIZATION, format(LOOT_SPECIALIZATION_DEFAULT, name)))
		end
	else
		local specID, name = GetSpecializationInfoByID(specialization)
		if specID then
			GameTooltip:AddLine(format("|cffFFFFFF%s:|r %s", SELECT_LOOT_SPECIALIZATION, name))
		end
	end

	GameTooltip:AddLine(" ")
	GameTooltip:AddLine(L.DataText.LootSpecTalent)
	GameTooltip:AddLine(L.DataText.LootSpecShow)
	GameTooltip:AddLine(L.DataText.LootSpecChange)

	GameTooltip:Show()
end

local OnMouseDown = function(self, button)
	local specIndex = GetSpecialization()
	if not specIndex then return end

	if button == "LeftButton" then
		GameTooltip:Hide()
		if not PlayerTalentFrame then
			LoadAddOn("Blizzard_TalentUI")
		end
		if IsShiftKeyDown() then
			if not PlayerTalentFrame:IsShown() then
				ShowUIPanel(PlayerTalentFrame)
			else
				HideUIPanel(PlayerTalentFrame)
			end
		else
			for index = 1, 4 do
				local id, name, _, texture = GetSpecializationInfo(index)
				if ( id ) then
					specList[index + 1].text = format("|T%s:14:14:0:0:64:64:4:60:4:60|t  %s", texture, name)
					specList[index + 1].func = function()
					if index and index == specIndex then
					UIErrorsFrame:AddMessage(L.ConfigButton.SpecError, 1.0, 0.0, 0.0, 53, 5)
					return
					end
					SetSpecialization(index) end
				else
					specList[index + 1] = nil
				end
			end
			Lib_EasyMenu(specList, menuFrame, "cursor", -15, -7, "MENU", 2)
		end
	else
		GameTooltip:Hide()
		local _, specName = GetSpecializationInfo(specIndex)
		menuList[2].text = format(LOOT_SPECIALIZATION_DEFAULT, specName)

		for index = 1, 4 do
			local id, name = GetSpecializationInfo(index)
			if ( id ) then
				menuList[index + 2].text = name
				menuList[index + 2].func = function() SetLootSpecialization(id) end
			else
				menuList[index + 2] = nil
			end
		end

		Lib_EasyMenu(menuList, menuFrame, "cursor", -15, -7, "MENU", 2)
	end
end

local Enable = function(self)
	if (not self.Text) then
		local Text = self:CreateFontString(nil, "OVERLAY")
		Text:SetFont(DataText.Font, DataText.Size, DataText.Flags)

		self.Text = Text
	end

	self:RegisterEvent("PLAYER_TALENT_UPDATE")
	self:RegisterEvent("PLAYER_LOOT_SPEC_UPDATED")
	self:RegisterEvent("PLAYER_ENTERING_WORLD")
	self:RegisterEvent("CHARACTER_POINTS_CHANGED")
	self:RegisterEvent("ACTIVE_TALENT_GROUP_CHANGED")

	self:SetScript("OnEvent", Update)
	self:SetScript("OnMouseDown", OnMouseDown)
	self:SetScript("OnEnter", OnEnter)
	self:SetScript("OnLeave", OnLeave)
	self:Update()
end

local Disable = function(self)
	self:UnregisterAllEvents()

	self:SetScript("OnEvent", nil)
	self:SetScript("OnMouseDown", nil)
	self:SetScript("OnEnter", nil)
	self:SetScript("OnLeave", nil)

	self.Text:SetText("")
end

DataText:Register("LootSpec", Enable, Disable, Update)


text:
<?php
namespace W3TC;

/**
 * W3 CDN Base class
 */
define( 'W3TC_CDN_RESULT_HALT', -1 );
define( 'W3TC_CDN_RESULT_ERROR', 0 );
define( 'W3TC_CDN_RESULT_OK', 1 );
define( 'W3TC_CDN_HEADER_NONE', 'none' );
define( 'W3TC_CDN_HEADER_UPLOADABLE', 'uploadable' );
define( 'W3TC_CDN_HEADER_MIRRORING', 'mirroring' );

/**
 * class CdnEngine_Base
 */
class CdnEngine_Base {
	/**
	 * Engine configuration
	 *
	 * @var array
	 */
	var $_config = array();

	/**
	 * Cache config
	 *
	 * @var array
	 */
	var $cache_config = array();

	/**
	 * gzip extension
	 *
	 * @var string
	 */
	var $_gzip_extension = '.gzip';

	/**
	 * Last error
	 *
	 * @var string
	 */
	var $_last_error = '';

	/**
	 * PHP5 Constructor
	 *
	 * @param array   $config
	 */
	function __construct( $config = array() ) {
		$this->_config = array_merge( array(
				'debug' => false,
				'ssl' => 'auto',
				'compression' => false
			), $config );
	}

	/**
	 * Upload files to CDN
	 *
	 * @param array   $files         takes array consisting of array(array('local_path'=>'', 'remote_path'=>''))
	 * @param array   $results
	 * @param boolean $force_rewrite
	 * @return boolean
	 */
	function upload( $files, &$results, $force_rewrite = false,
		$timeout_time = NULL ) {
		$results = $this->_get_results( $files, W3TC_CDN_RESULT_HALT,
			'Not implemented.' );

		return false;
	}

	/**
	 * Delete files from CDN
	 *
	 * @param array   $files
	 * @param array   $results
	 * @return boolean
	 */
	function delete( $files, &$results ) {
		$results = $this->_get_results( $files, W3TC_CDN_RESULT_HALT,
			'Not implemented.' );

		return false;
	}

	/**
	 * Purge files from CDN
	 *
	 * @param array   $files
	 * @param array   $results
	 * @return boolean
	 */
	function purge( $files, &$results ) {
		return $this->upload( $files, $results, true );
	}

	/**
	 * Purge CDN completely
	 *
	 * @param unknown $results
	 * @return bool
	 */
	function purge_all( &$results ) {
		$results = $this->_get_results( array(), W3TC_CDN_RESULT_HALT,
			'Not implemented.' );

		return false;
	}

	/**
	 * Test CDN server
	 *
	 * @param string  $error
	 * @return boolean
	 */
	function test( &$error ) {
		if ( !$this->_test_domains( $error ) ) {
			return false;
		}

		return true;
	}

	/**
	 * Create bucket / container for some CDN engines
	 *
	 * @param string  $container_id
	 * @param string  $error
	 * @return boolean
	 */
	function create_container( &$container_id, &$error ) {
		$error = 'Not implemented.';

		return false;
	}

	/**
	 * Returns first domain
	 *
	 * @param string  $path
	 * @return string
	 */
	function get_domain( $path = '' ) {
		$domains = $this->get_domains();
		$count = count( $domains );

		if ( $count ) {
			switch ( true ) {
				/**
				 * Reserved CSS
				 */
			case ( isset( $domains[0] ) && $this->_is_css( $path ) ):
				$domain = $domains[0];
				break;

				/**
				 * Reserved JS after body
				 */
			case ( isset( $domains[2] ) && $this->_is_js_body( $path ) ):
				$domain = $domains[2];
				break;

				/**
				 * Reserved JS before /body
				 */
			case ( isset( $domains[3] ) && $this->_is_js_footer( $path ) ):
				$domain = $domains[3];
				break;

				/**
				 * Reserved JS in head, moved here due to greedy regex
				 */
			case ( isset( $domains[1] ) && $this->_is_js( $path ) ):
				$domain = $domains[1];
				break;

			default:
				if ( !isset( $domains[0] ) ) {
					$scheme = $this->_get_scheme();
					if ( 'https' == $scheme && !empty( $domains['https_default'] ) ) {
						return $domains['https_default'];
					} else {
						return isset( $domains['http_default'] ) ? $domains['http_default'] :
							$domains['https_default'];
					}
				} elseif ( $count > 4 ) {
					$domain = $this->_get_domain( array_slice( $domains, 4 ),
						$path );
				} else {
					$domain = $this->_get_domain( $domains, $path );
				}
			}

			/**
			 * Custom host for SSL
			 */
			list( $domain_http, $domain_https ) = array_map( 'trim',
				explode( ',', $domain . ',' ) );

			$scheme = $this->_get_scheme();

			switch ( $scheme ) {
			case 'http':
				$domain = $domain_http;
				break;

			case 'https':
				$domain = ( $domain_https ? $domain_https : $domain_http );
				break;
			}

			return $domain;
		}

		return false;
	}

	/**
	 * Returns array of CDN domains
	 *
	 * @return array
	 */
	function get_domains() {
		return array();
	}

	/**
	 * Returns via string
	 *
	 * @return string
	 */
	function get_via() {
		$domain = $this->get_domain();

		if ( $domain ) {
			return $domain;
		}

		return 'N/A';
	}

	/**
	 * Formats URL
	 *
	 * @param string  $path
	 * @return string
	 */
	function format_url( $path ) {
		$url = $this->_format_url( $path );

		if ( $url && $this->_config['compression'] &&
			isset( $_SERVER['HTTP_ACCEPT_ENCODING'] ) &&
			stristr( $_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip' ) !== false &&
			$this->_may_gzip( $path ) ) {
			if ( ( $qpos = strpos( $url, '?' ) ) !== false ) {
				$url = substr_replace( $url, $this->_gzip_extension, $qpos, 0 );
			} else {
				$url .= $this->_gzip_extension;
			}
		}

		return $url;
	}

	/**
	 * Returns prepend path
	 *
	 * @param string  $path
	 * @return string
	 */
	function get_prepend_path( $path ) {
		$domain = $this->get_domain( $path );

		if ( $domain ) {
			$scheme = $this->_get_scheme();
			$url = sprintf( '%s://%s', $scheme, $domain );

			return $url;
		}

		return false;
	}

	/**
	 * Formats URL
	 *
	 * @param string  $path
	 * @return string
	 */
	function _format_url( $path ) {
		$domain = $this->get_domain( $path );

		if ( $domain ) {
			$scheme = $this->_get_scheme();
			$url = sprintf( '%s://%s/%s', $scheme, $domain, $path );

			return $url;
		}

		return false;
	}

	/**
	 * Returns results
	 *
	 * @param array   $files
	 * @param integer $result
	 * @param string  $error
	 * @return array
	 */
	function _get_results( $files, $result = W3TC_CDN_RESULT_OK,
		$error = 'OK' ) {
		$results = array();

		foreach ( $files as $key => $file ) {
			if ( is_array( $file ) ) {
				$local_path = $file['local_path'];
				$remote_path = $file['remote_path'];
			} else {
				$local_path = $key;
				$remote_path = $file;
			}

			$results[] = $this->_get_result( $local_path, $remote_path, $result,
				$error, $file );
		}

		return $results;
	}

	/**
	 * Returns file process result
	 *
	 * @param string  $local_path
	 * @param string  $remote_path
	 * @param integer $result
	 * @param string  $error
	 * @return array
	 */
	function _get_result( $local_path, $remote_path,
		$result = W3TC_CDN_RESULT_OK, $error = 'OK', $descriptor = null ) {
		if ( $this->_config['debug'] ) {
			$this->_log( $local_path, $remote_path, $error );
		}

		return array(
			'local_path' => $local_path,
			'remote_path' => $remote_path,
			'result' => $result,
			'error' => $error,
			'descriptor' => $descriptor
		);
	}

	/**
	 * Check for errors
	 *
	 * @param array   $results
	 * @return bool
	 */
	function _is_error( $results ) {
		foreach ( $results as $result ) {
			if ( $result['result'] != W3TC_CDN_RESULT_OK ) {
				return true;
			}
		}

		return false;
	}

	/**
	 * Returns headers for file
	 *
	 * @param array   $file CDN file array
	 * @return array
	 */
	function _get_headers( $file, $block_expires = false ) {

		$local_path = $file['local_path'];
		$mime_type = Util_Mime::get_mime_type( $local_path );
		$last_modified = time();

		$link = $file['original_url'];

		$headers = array(
			'Content-Type' => $mime_type,
			'Last-Modified' => Util_Content::http_date( $last_modified ),
			'Access-Control-Allow-Origin' => '*',
			'Link' => '<' . $link  .'>; rel="canonical"'
		);

		if ( isset( $this->cache_config[$mime_type] ) ) {
			if ( $this->cache_config[$mime_type]['etag'] ) {
				$headers['ETag'] = '"' . @md5_file( $local_path ) . '"';
			}

			if ( $this->cache_config[$mime_type]['w3tc'] ) {
				$headers['X-Powered-By'] =
					Util_Environment::w3tc_header();
			}

			$expires_set = false;
			if ( !$block_expires &&
				$this->cache_config[$mime_type]['expires'] ) {
				$headers['Expires'] = Util_Content::http_date( time() +
					$this->cache_config[$mime_type]['lifetime'] );
				$expires_set = true;
			}

			switch ( $this->cache_config[$mime_type]['cache_control'] ) {
			case 'cache':
				$headers = array_merge( $headers, array(
						'Pragma' => 'public',
						'Cache-Control' => 'public'
					) );
				break;

			case 'cache_public_maxage':
				$headers = array_merge( $headers, array(
						'Pragma' => 'public',
						'Cache-Control' => ( $expires_set ? '' : 'max-age=' .
							$this->cache_config[$mime_type]['lifetime'] .', ' ) .
						'public'
					) );
				break;

			case 'cache_validation':
				$headers = array_merge( $headers, array(
						'Pragma' => 'public',
						'Cache-Control' => 'public, must-revalidate, proxy-revalidate'
					) );
				break;

			case 'cache_noproxy':
				$headers = array_merge( $headers, array(
						'Pragma' => 'public',
						'Cache-Control' => 'private, must-revalidate'
					) );
				break;

			case 'cache_maxage':
				$headers = array_merge( $headers, array(
						'Pragma' => 'public',
						'Cache-Control' => ( $expires_set ? '' : 'max-age=' .
							$this->cache_config[$mime_type]['lifetime'] .', ' ) .
						'public, must-revalidate, proxy-revalidate'
					) );
				break;

			case 'no_cache':
				$headers = array_merge( $headers, array(
						'Pragma' => 'no-cache',
						'Cache-Control' => 'max-age=0, private, no-store, no-cache, must-revalidate'
					) );
				break;
			}
		}

		return $headers;
	}

	/**
	 * Use gzip compression only for text-based files
	 *
	 * @param string  $file
	 * @return boolean
	 */
	function _may_gzip( $file ) {
		/**
		 * Remove query string
		 */
		$file = preg_replace( '~\?.*$~', '', $file );

		/**
		 * Check by file extension
		 */
		if ( preg_match( '~\.(ico|js|css|xml|xsd|xsl|svg|htm|html|txt)$~i',
				$file ) ) {
			return true;
		}

		return false;
	}

	/**
	 * Test domains
	 *
	 * @param string  $error
	 * @return boolean
	 */
	function _test_domains( &$error ) {
		$domains = $this->get_domains();

		if ( !count( $domains ) ) {
			$error = 'Empty hostname / CNAME list.';

			return false;

		}

		foreach ( $domains as $domain ) {
			$_domains = array_map( 'trim', explode( ',', $domain ) );

			foreach ( $_domains as $_domain ) {
				$matches = null;

				if ( preg_match( '~^([a-z0-9\-\.]*)~i', $_domain, $matches ) ) {
					$hostname = $matches[1];
				} else {
					$hostname = $_domain;
				}

				if ( empty( $hostname ) ) {
					continue;
				}

				if ( gethostbyname( $hostname ) === $hostname ) {
					$error = sprintf( 'Unable to resolve hostname: %s.',
						$hostname );

					return false;
				}
			}
		}

		return true;
	}

	/**
	 * Check if css file
	 *
	 * @param string  $path
	 * @return boolean
	 */
	function _is_css( $path ) {
		return preg_match( '~[a-zA-Z0-9\-_]*(\.include\.[0-9]+)?\.css$~',
			$path );
	}

	/**
	 * Check if JS file in heeader
	 *
	 * @param string  $path
	 * @return boolean
	 */
	function _is_js( $path ) {
		return preg_match( '~([a-z0-9\-_]+(\.include\.[a-z0-9]+)\.js)$~',
			$path ) ||
			preg_match( '~[\w\d\-_]+\.js~', $path );
	}

	/**
	 * Check if JS file after body
	 *
	 * @param string  $path
	 * @return boolean
	 */
	function _is_js_body( $path ) {
		return preg_match( '~[a-z0-9\-_]+(\.include-body\.[a-z0-9]+)\.js$~',
			$path );
	}

	/**
	 * Check if JS file before /body
	 *
	 * @param string  $path
	 * @return boolean
	 */
	function _is_js_footer( $path ) {
		return preg_match( '~[a-z0-9\-_]+(\.include-footer\.[a-z0-9]+)\.js$~',
			$path );
	}

	/**
	 * Returns domain for path
	 *
	 * @param array   $domains
	 * @param string  $path
	 * @return string
	 */
	function _get_domain( $domains, $path ) {
		$count = count( $domains );
		if ( isset( $domains['http_default'] ) )
			$count--;
		if ( isset( $domains['https_default'] ) )
			$count--;

		if ( $count ) {
			/**
			 * Use for equal URLs same host to allow caching by browser
			 */
			$hash = $this->_get_hash( $path );
			$domain = $domains[$hash % $count];

			return $domain;
		}

		return false;
	}

	/**
	 * Returns integer hash for key
	 *
	 * @param string  $key
	 * @return integer
	 */
	function _get_hash( $key ) {
		$hash = abs( crc32( $key ) );

		return $hash;
	}

	/**
	 * Returns scheme
	 *
	 * @return string
	 */
	function _get_scheme() {
		switch ( $this->_config['ssl'] ) {
		default:
		case 'auto':
			$scheme = ( Util_Environment::is_https() ? 'https' : 'http' );
			break;

		case 'enabled':
			$scheme = 'https';
			break;

		case 'disabled':
			$scheme = 'http';
			break;
		case 'rejected':
			$scheme = 'http';
			break;
		}

		return $scheme;
	}

	/**
	 * Write log entry
	 *
	 * @param string  $local_path
	 * @param string  $remote_path
	 * @param string  $error
	 * @return bool|int
	 */
	function _log( $local_path, $remote_path, $error ) {
		$data = sprintf( "[%s] [%s => %s] %s\n", date( 'r' ), $local_path,
			$remote_path, $error );
		$data = strtr( $data, '<>', '..' );

		$filename = Util_Debug::log_filename( 'cdn' );

		return @file_put_contents( $filename, $data, FILE_APPEND );
	}

	/**
	 * Our error handler
	 *
	 * @param integer $errno
	 * @param string  $errstr
	 * @return boolean
	 */
	function _error_handler( $errno, $errstr ) {
		$this->_last_error = $errstr;

		return false;
	}

	/**
	 * Returns last error
	 *
	 * @return string
	 */
	function _get_last_error() {
		return $this->_last_error;
	}

	/**
	 * Set our error handler
	 *
	 * @return void
	 */
	function _set_error_handler() {
		set_error_handler( array(
				$this,
				'_error_handler'
			) );
	}

	/**
	 * Restore prev error handler
	 *
	 * @return void
	 */
	function _restore_error_handler() {
		restore_error_handler();
	}

	/**
	 * How and if headers should be set
	 *
	 * @return string W3TC_CDN_HEADER_NONE, W3TC_CDN_HEADER_UPLOADABLE,
	 * W3TC_CDN_HEADER_MIRRORING
	 */
	function headers_support() {
		return W3TC_CDN_HEADER_NONE;
	}
}


text:
namespace Merchello.Core.Gateways
{
    using System;

    using Umbraco.Core;

    /// <summary>
    /// The gateway method editor attribute.
    /// </summary>
    [AttributeUsage(AttributeTargets.Class, AllowMultiple = false)]
    public class GatewayMethodEditorAttribute : Attribute
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="GatewayMethodEditorAttribute"/> class.
        /// </summary>
        /// <param name="title">
        /// The title.
        /// </param>
        /// <param name="editorView">
        /// The editor view.
        /// </param>
        public GatewayMethodEditorAttribute(string title, string editorView)
        {
            Mandate.ParameterNotNullOrEmpty(title, "title");
            Mandate.ParameterNotNullOrEmpty(editorView, "editorView");

            Title = title;
            Description = string.Empty;
            EditorView = editorView;
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="GatewayMethodEditorAttribute"/> class.
        /// </summary>
        /// <param name="title">
        /// The title.
        /// </param>
        /// <param name="description">
        /// The description.
        /// </param>
        /// <param name="editorView">
        /// The editor view.
        /// </param>
        public GatewayMethodEditorAttribute(string title, string description, string editorView)
        {
            Mandate.ParameterNotNullOrEmpty(title, "title");
            Mandate.ParameterNotNullOrEmpty(description, "description");
            Mandate.ParameterNotNullOrEmpty(editorView, "editorView");

            Title = title;
            Description = description;
            EditorView = editorView;
        }

        /// <summary>
        /// Gets the name of the gateway provider editor title
        /// </summary>
        public string Title { get; private set; }

        /// <summary>
        /// Gets the description of the gateway provider editor
        /// </summary>
        public string Description { get; private set; }

        /// <summary>
        /// Gets the relative path to the editor view html
        /// </summary>
        public string EditorView { get; private set; }
    }
}


text:
layout: post
status: publish
published: true
title: Get More From Your Content with Reader Aware Design
author:
  display_name: Ian Littman
  login: Ian
  email: iansltx@gmail.com
  url: ''
author_login: Ian
author_email: iansltx@gmail.com
excerpt: ! "http://www.youtube.com/watch?v=4mAdp2EXgak\r\n\r\n"
wordpress_id: 619
wordpress_url: http://www.austintechvideos.com/?p=619
date: !binary |-
  MjAxMy0wNS0wOSAxOToyMToxMiAtMDUwMA==
date_gmt: !binary |-
  MjAxMy0wNS0wOSAxOToyMToxMiAtMDUwMA==
categories:
- Refresh Austin
tags:
- refresh
- austin-refresh
- responsive
- design
comments: []
videoid: 4mAdp2EXgak
---

Presentation by Ben Brown (CEO XOXCO, @benbrown)

What happens to your content when it falls off the front page? How can we as web publishers do a better
job of merchandising our content? Brown will explore methods for building more value for readers and publishers
by using reader aware design techniques, and by re-imagining content archives as a back catalog.

4.9.2013 (meetup)


text: powershell -ExecutionPolicy unrestricted -file package.ps1 %*


text:
package limitwriter

import (
	"reflect"
	"testing"
)

type recordingWriter struct {
	Wrote [][]byte
}

func (r *recordingWriter) Write(data []byte) (int, error) {
	r.Wrote = append(r.Wrote, data)
	return len(data), nil
}

func TestLimitWriter(t *testing.T) {
	testcases := map[string]struct {
		Limit  int64
		Writes [][]byte

		ExpectedRecordedWrites [][]byte
		ExpectedReportedWrites []int
		ExpectedReportedErrors []error
	}{
		"empty": {},

		"empty write": {
			Limit:                  1000,
			Writes:                 [][]byte{{}},
			ExpectedRecordedWrites: [][]byte{{}},
			ExpectedReportedWrites: []int{0},
			ExpectedReportedErrors: []error{nil},
		},

		"unlimited write": {
			Limit:                  1000,
			Writes:                 [][]byte{[]byte(`foo`)},
			ExpectedRecordedWrites: [][]byte{[]byte(`foo`)},
			ExpectedReportedWrites: []int{3},
			ExpectedReportedErrors: []error{nil},
		},

		"limited write": {
			Limit:                  5,
			Writes:                 [][]byte{[]byte(``), []byte(`1`), []byte(`23`), []byte(`456789`), []byte(`10`), []byte(``)},
			ExpectedRecordedWrites: [][]byte{[]byte(``), []byte(`1`), []byte(`23`), []byte(`45`)},
			ExpectedReportedWrites: []int{0, 1, 2, 2, 0, 0},
			ExpectedReportedErrors: []error{nil, nil, nil, ErrMaximumWrite, ErrMaximumWrite, ErrMaximumWrite},
		},
	}

	for k, tc := range testcases {
		var reportedWrites []int
		var reportedErrors []error

		recordingWriter := &recordingWriter{}

		limitwriter := New(recordingWriter, tc.Limit)

		for _, w := range tc.Writes {
			n, err := limitwriter.Write(w)
			reportedWrites = append(reportedWrites, n)
			reportedErrors = append(reportedErrors, err)
		}

		if !reflect.DeepEqual(recordingWriter.Wrote, tc.ExpectedRecordedWrites) {
			t.Errorf("%s: expected recorded writes %v, got %v", k, tc.ExpectedRecordedWrites, recordingWriter.Wrote)
		}
		if !reflect.DeepEqual(reportedWrites, tc.ExpectedReportedWrites) {
			t.Errorf("%s: expected reported writes %v, got %v", k, tc.ExpectedReportedWrites, reportedWrites)
		}
		if !reflect.DeepEqual(reportedErrors, tc.ExpectedReportedErrors) {
			t.Errorf("%s: expected reported errors %v, got %v", k, tc.ExpectedReportedErrors, reportedErrors)
		}
	}
}


text:
function punch()
{
	sfxPunch.play()

	if (melee.length > 0) // If we're within range of at at least one zombie...
	{
		melee[0].health -= meleeDamage

		setTimeout(function() // Add a timeout so the zombie doesn't groan instantly
    	{
    		sfxGroan.play()
    	}, 200)

    	turnZombies() // A punch counts as a turn for the player so advance the zombies toward him
	}

	canMelee = false

	setTimeout(function()
    {
    	canMelee = true
    }, timeMelee)
}

function fire()
{
	if (canShoot)
    {
	    if (player.magazine > 0) // Don't fire if we don't have ammo
	    {
	    	blank(flashColor) // Flash the screen
	        player.magazine-- // Remove a bullet
	        sfxFire.play()
	        canShoot = false

	        if (vision.length > 0) // If we're looking at at least one zombie...
			{
				vision[0].health -= shotDamage

				setTimeout(function() // Add a timeout so the zombie doesn't groan instantly
		    	{
		    		sfxGroan.play()
		    	}, 200)
			}
	    }
	    else
	    {
	        sfxEmpty.play()
	        canShoot = false
	    }

	    setTimeout(function()
        {
        	sfxCock.play()
        }, timeFire)

        setTimeout(function()
        {
            canShoot = true
        }, timeFire + timeCock)

        turnZombies() // Shooting also counts as a turn so advance the zombies
	}
}

function reload()
{
	if (canShoot) // Prevent reloading during the playback of sound effects
    {
	    if (player.magazine < gunCapacity && player.ammo > 0) // Don't reload if we already have a full player.magazine or if we don't have ammo to reload with
	    {
	        while (player.magazine < gunCapacity - 1 && player.ammo > 0) // Fill the player.magazine with our extra ammo
	        {
	        	player.magazine += 1
	        	player.ammo -= 1
	        }
	        sfxReload.play()
	        canShoot = false

	        setTimeout(function()
	        {
	        	sfxCock.play()
	        }, timeReload)

	        setTimeout(function()
	        {
	            canShoot = true
	        }, timeCock + timeReload)

	       	turnZombies() // Yup, reloading counts too
	    }
	}
}


text:
{{item.ten_kho}}

{{item.ma_kho}}


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

namespace DuckDuck.DAL.Interfaces
{
    public interface IStudentRepository
    {
        void AddNewStudent(Student studentNew);
        void EditStudent(Student studentEdit);
        Student GetSingleStudent(int id);
        IEnumerable<Student> GetAllStudents(int roomId);
        IEnumerable<Student> GetAllStudents();
        void DeleteSingleStudent(int id);
    }
}