content
stringlengths 4
1.04M
| lang
stringclasses 358
values | score
int64 0
5
| repo_name
stringlengths 5
114
| repo_path
stringlengths 4
229
| repo_licenses
sequencelengths 1
8
|
---|---|---|---|---|---|
class RedirectRecord {
RedirectRecord(this.statusCode, this.method, this.location);
/// Returns the status code used for the redirect.
final int statusCode;
/// Returns the method used for the redirect.
final String method;
///Returns the location for the redirect.
final Uri location;
}
| Dart | 4 | safarmer/dio | dio/lib/src/redirect_record.dart | [
"MIT"
] |
<div>
<div class="note">
<p>Values added to the global scope of a content script with</p>
</div>
<h2 id="Loading_content_scripts">Loading content scripts</h2>
<p>You can load a content script into a web page in one of three ways:</p>
</div> | HTML | 3 | asahiocean/joplin | packages/app-cli/tests/enex_to_md/heading.html | [
"MIT"
] |
#ifdef __VULCAN__
USING System.Runtime.InteropServices
#endif
/// <include file="Gui.xml" path="doc/DataBrowser/*" />
CLASS DataBrowser INHERIT Control
PROTECT iBufferGranularity AS INT
PROTECT iBufferMaximum AS INT
PROTECT iFTHeight AS INT
PROTECT iSelectionStyle AS INT
PROTECT iBufferSize AS INT
PROTECT iDeferPaintCount AS INT
PROTECT iDeferNotifyCount AS INT
PROTECT iRecordSize AS INT
PROTECT nOldRecordNum AS INT
PROTECT dwDeferredStyle AS DWORD
PROTECT lCaptionSet AS LOGIC
PROTECT lColumnTitles AS LOGIC
PROTECT lIsReadOnly AS LOGIC
PROTECT lIsShown AS LOGIC
PROTECT lHasTop AS LOGIC
PROTECT lHasBottom AS LOGIC
PROTECT lUseDefCaption AS LOGIC
PROTECT lUseDefColCaption AS LOGIC
PROTECT lUseDefText AS LOGIC
PROTECT lUseDefButton AS LOGIC
PROTECT lUseDefColButton AS LOGIC
PROTECT lUseDefHiText AS LOGIC
PROTECT lUse3dLook AS LOGIC
PROTECT lLinked AS LOGIC
PROTECT aColumn AS ARRAY
PROTECT hNotifyWindow AS PTR
PROTECT ptrSelf AS PTR
EXPORT ptrControlDefaultProc AS PTR
PROTECT strucEditField AS PTR //_WinFieldInfo
PROTECT strucEditRecord AS PTR //_WinRecordCore
PROTECT strucFocusField AS PTR //_WinFieldInfo
PROTECT oDataServer AS DataServer
PROTECT oEditFont AS Font
PROTECT oFontText AS Font
PROTECT oBackgroundColCaption AS Brush
PROTECT oBackgroundHiText AS Brush
PROTECT oBackgroundText AS Brush
PROTECT oBackgroundCaption AS Brush
PROTECT oBackgroundButton AS Brush
PROTECT oBackgroundColButton AS Brush
PROTECT oTextColor AS Color
PROTECT oTextPointer AS Pointer
PROTECT oCellEdit AS Control
PROTECT dwLastChar AS DWORD
PROTECT ptrDataBuffer AS BYTE PTR
#ifdef __VULCAN__
HIDDEN CellEditProcDelegate AS __CellEditProcDelegate
HIDDEN WCGBChildProcDelegate AS __WCGBChildProcDelegate
#endif
//PP-030828 Strong typing
/// <exclude />
METHOD __AddColumn (oDataColumn AS DataColumn, iCol AS INT) AS LOGIC STRICT
//PP-030828 Strong typing
// iCol : 1-based index in aColumn, 0 means append to tail
LOCAL strucFI AS _WinFieldInfo
LOCAL cCaption AS STRING
LOCAL lRC AS LOGIC
LOCAL oDC AS DataColumn
LOCAL oTempCol AS DataColumn
LOCAL oFont AS Font
LOCAL oTempBrush AS Brush
LOCAL oTempColor AS Color
//PP-040410
IF oDataColumn == NULL_OBJECT
WCError{#AddColumn,#DataBrowser,__WCSTypeError,oDataColumn,1}:Throw()
ENDIF
oDC := oDataColumn
IF (oDC:Owner != NULL_OBJECT) //if DataColumn already assigned to Browser
RETURN FALSE
ENDIF
strucFI := oDC:__FieldInfo
PCALL(gpfnCntFldDataAlnSet, hWnd, strucFI, DWORD(oDC:__HorzAlignment))
//PP-041004
IF strucFI:cxWidth == DWORD(_CAST,-1)
strucFI:cxWidth := 16
ELSEIF (oDataColumn:FieldSpec != NULL_OBJECT) .AND. (oDataColumn:FieldSpec:ValType == "O")
strucFI:cxWidth := 32
ENDIF
cCaption := oDC:GetCaption()
IF (NULL_STRING != cCaption)
PCALL(gpfnCntAttribSet, hWnd, CA_FLDTTL3D)
IF lColumnTitles
IF (iFTHeight < INT(strucFI:wFTitleLines))
iFTHeight := INT(strucFI:wFTitleLines)
PCALL(gpfnCntFldTtlHtSet, hWnd, iFTHeight)
ENDIF
ENDIF
IF !lCaptionSet
lCaptionSet := TRUE
PCALL(gpfnCntFldTtlSepSet, hWnd)
ENDIF
PCALL(gpfnCntFldTtlSet, hWnd, strucFI, String2Psz(cCaption), SLen(cCaption)+1)
ENDIF
// Set the Visual attributes of the column
// Background Color of Title, Text, and Button
oTempBrush := oDC:__TtlBkgdBrsh
IF oTempBrush != NULL_OBJECT
oDC:__SetFldColor(SELF, oDC:__TtlBkgdLoc, __WCGetBrushColor(oTempBrush))
ENDIF
oTempBrush := oDC:__TxtBkgdBrsh
IF oTempBrush != NULL_OBJECT
oDC:__SetFldColor(SELF, oDC:__TxtBkgdLoc, __WCGetBrushColor(oTempBrush))
ENDIF
oTempBrush := oDC:__BtnBkgdBrsh
IF oTempBrush != NULL_OBJECT
oDC:__SetFldColor(SELF, oDC:__BtnBkgdLoc, __WCGetBrushColor(oTempBrush))
ENDIF
//Foreground Color of Title, Text, and Button
oTempColor := oDC:__TtlClr
IF (oTempColor != NULL_OBJECT)
oDC:__SetFldColor(SELF, oDC:__TtlClrLoc, oTempColor:ColorRef)
ENDIF
oTempColor := oDC:__TxtClr
IF (oTempColor != NULL_OBJECT)
oDC:__SetFldColor(SELF, oDC:__TxtClrLoc, oTempColor:ColorRef)
ENDIF
oTempColor:=oDC:__BtnClr
IF (oTempColor != NULL_OBJECT)
oDC:__SetFldColor(SELF, oDC:__BtnClrLoc, oTempColor:ColorRef)
ENDIF
// Text Font
oFont := oDC:__Font
IF (oFont != NULL_OBJECT)
PCALL(gpfnCntFontSet, hWnd, oFont:Handle(), DWORD(oDC:__FontLoc))
ENDIF
// if data server is present - write out and delete internal buffers
IF (oDataServer != NULL_OBJECT)
SELF:__ClearBuffers()
ENDIF
// Build Column descriptor
// oDC:__Type := strucFI.wColType
// oDC:__Size := strucFI.wDataBytes
// oDC:__Offset := strucFI.wOffStruct
oDC:__Owner := SELF
IF (iCol == 0)
lRC := PCALL(gpfnCntAddFldTail, hWnd, strucFI)
ELSE
oTempCol := SELF:GetColumn(iCol)
IF (oTempCol == NULL_OBJECT)
lRC := PCALL(gpfnCntAddFldTail, hWnd, strucFI)
ELSE
// strucFIHead := CntFldHeadGet(hWnd)
// strucFITemp := oTempCol:__FieldInfo
// if (ptr(_cast, strucFIHead) == oTempCol:__FieldInfo)
// CntAddFldHead(hwnd, strucFI)
// else
lRC := PCALL(gpfnCntInsFldBefore, hWnd, oTempCol:__FieldInfo, strucFI)
// endif
ENDIF
ENDIF
IF (lRC)
// Insert/Add Column to array
IF (iCol != 0)
ASize(aColumn, ALen(aColumn) + 1)
AIns(aColumn, DWORD(iCol))
aColumn[iCol] := oDC
ELSE
AAdd(aColumn, oDC)
ENDIF
ENDIF
RETURN lRC
/// <exclude />
METHOD __AutoLayout() AS VOID STRICT
//SE-081212 optimized
//PP-030828 Strong typing
LOCAL iFields, iStart, iBegin, iEnd AS INT
LOCAL iStep AS INT
LOCAL aNewColumns AS ARRAY
LOCAL oDataField AS DataField
LOCAL oNewColumn AS DataColumn
LOCAL oPropFS AS FieldSpec
LOCAL oPropHL AS HyperLabel
LOCAL oWindow AS Window
LOCAL oDatawin AS DataWindow
aNewColumns:={}
IF lLinked
iFields := oDataServer:FCount
IF IsBiDi()
iBegin := iFields
iEnd := 1
iStep := -1
ELSE
iBegin := 1
iEnd := iFields
iStep := 1
ENDIF
IF IsInstanceOf(oParent, #__FormFrame)
oWindow := oParent:Owner
ENDIF
IF IsInstanceOf(oWindow, #DataWindow) //vor die Loop gesetzt, da sich das Ergebnis in der Loop nicht �ndert
oDatawin := OBJECT(oWindow)
ELSE
oDatawin := NULL_OBJECT
ENDIF
FOR iStart := iBegin TO iEnd STEP iStep
oDataField := oDataServer:DataField(iStart)
IF oDataField == NULL_OBJECT
LOOP
ENDIF
// If there are explicit properties in the DataWindow view
// propagate them, else use the DataField Properties
IF oDatawin == NULL_OBJECT
oPropHL := oDataField:HyperLabel
oPropFS := oDataField:FieldSpec
ELSE
IF (oPropHL := oDatawin:__FindHyperLabel(oDataField:NameSym)) == NULL_OBJECT
oPropHL := oDataField:HyperLabel
ENDIF
IF (oPropFS := oDatawin:__FindFieldSpec(oDataField:NameSym)) == NULL_OBJECT
oPropFS := oDataField:FieldSpec
ENDIF
ENDIF
oNewColumn := DataColumn{oPropFS, oPropHL}
oNewColumn:Caption := __GetDFCaption(oDataField,{})
oNewColumn:LinkDF(oDataServer, iStart)
AAdd(aNewColumns,oNewColumn)
NEXT
IF ALen(aNewColumns) > 0
SELF:AddColumn(aNewColumns)
ENDIF
ENDIF
RETURN
/// <exclude />
METHOD __AutoResize() AS VOID STRICT
IF SELF:ValidateControl()
WCMoveWindow(SELF, Point{0,0}, oParent:CanvasArea:Size, TRUE)
ENDIF
RETURN
/// <exclude />
METHOD __BeginEditField(hWin AS PTR, dwChar AS DWORD) AS VOID STRICT
//PP-030828 Strong typing
LOCAL dw AS DWORD
LOCAL oPoint AS Point
LOCAL oDim AS Dimension
LOCAL oCol AS DataColumn
LOCAL oEdit AS OBJECT
LOCAL hControl AS PTR
LOCAL cType := "C" AS STRING
LOCAL oDBStg AS USUAL
// Save pointers to the focus cell.
strucEditField := PTR(_CAST, PCALL(gpfnCntFocusFldGet, hWnd))
StrucEditRecord := PTR(_CAST, PCALL(gpfnCntFocusRecGet, hWnd))
SELF:__EndEditField(0)
SELF:__RefreshData()
IF (strucEditRecord != NULL_PTR) .AND. (strucEditField != NULL_PTR)
dw := PCALL(gpfnCntFocusExtGet, hWin)
oDim := Dimension{LoWord(dw), HiWord(dw)}
dw := PCALL(gpfnCntFocusOrgGet, hWin, FALSE)
oPoint := __WCConvertPoint(SELF,Point{LoWord(dw),HiWord(dw)})
IF WCGetCoordinateSystem() // Cartesian Coordinate System
oPoint:Y := oPoint:Y - oDim:Height
ENDIF
oCol := SELF:__GetColumn(strucEditField)
IF (oCol:FieldSpec != NULL_OBJECT)
cType := oCol:FieldSpec:ValType
ENDIF
IF (cType == "O")
IF !IsInstanceOf(oCellEdit, #OleObject)
#ifdef USE_OLEOBJECT
oEdit := OleObject{ oParent, 101, Point{0,0}, Dimension{0,0}, TRUE}
#else
oEdit := NULL_OBJECT
#endif
IF oEdit != NULL_OBJECT
oCellEdit := oEdit
oEdit:AllowInPlace := FALSE
oDBStg := oDataServer:FIELDGET(oCol:NameSym)
IF IsInstanceOfUsual(oDBStg, #OLEDBStorage)
oEdit:CreateFromDBStorage(oDBStg)
oEdit:Activate()
oEdit:SetHostNames( ResourceString{__WCSHostVOApp}:AsString(),;
ResourceString{__WCSHostDataBrowser}:AsString())
ENDIF
ENDIF
ELSE
oCellEdit:Activate()
ENDIF
ELSE
oEdit := oCol:GetEditObject(SELF, 101, oPoint, oDim)
IF IsInstanceOf(oEdit,#Control)
oCellEdit := oEdit
hControl := oCellEdit:Handle()
oCellEdit:Show()
oCellEdit:SetFocus()
IF (hControl != NULL_PTR)
ptrControlDefaultProc := GetWindowLong(hControl, GWL_WNDPROC)
#ifdef __VULCAN__
IF CellEditProcDelegate == NULL
CellEditProcDelegate := __CellEditProcDelegate{ NULL, @__CellEditProc() }
ENDIF
SetWindowLong( hControl, GWL_WNDPROC, (INT) System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate( (System.Delegate) CellEditProcDelegate ) )
#else
SetWindowLong(hControl, GWL_WNDPROC, LONGINT(_CAST, @__CellEditProc()))
#endif
IF (dwChar != 0)
//PP-040317 Issue 12644 SendMessage changed to PostMessage
PostMessage(hControl, EM_SETSEL, 0, -1)
PostMessage(hControl, WM_CHAR, dwChar, 0L) //lParam) //Riz is lParam valid?
//SendMessage(hControl, EM_SETSEL, 0, 0)
ENDIF
PCALL(gpfnCntFocusFldLock, hWnd)
ENDIF
WCAppSetDialogWindow(NULL_PTR)
ENDIF
ENDIF
ELSE
strucEditField := NULL_PTR //make sure both structures are cleared
StrucEditRecord := NULL_PTR
ENDIF
RETURN
/// <exclude />
METHOD __BuildBuffer() AS VOID STRICT
//PP-030828 Strong typing
LOCAL oOldPointer AS Pointer
LOCAL strucRecord AS _WINRecordCore
LOCAL iRecNo AS INT
IF oDataServer != NULL_OBJECT .AND. oDataServer:FCount > 0
oOldPointer := oParent:Pointer
oParent:Pointer:=Pointer{PointerHourGlass}
SELF:SuspendUpdate()
SELF:__DeferNotify()
SELF:__ClearBuffers()
IF !SELF:__IsDataServerEmpty()
iRecNo := oDataServer:RecNo
SELF:__BuildNewBuffer(iRecNo)
strucRecord := SELF:__GetRecordAtRecNo(iRecNo)
IF strucRecord != NULL_PTR
PCALL(gpfnCntFocusSet, hWnd, strucRecord, PCALL(gpfnCntFocusFldGet, hwnd))
PCALL(gpfnCntFocusRecLock, hWnd)
IF !SELF:__IsFocusRecordInView()
PCALL(gpfnCntTopRecSet, hWnd, strucRecord)
ENDIF
ELSE
PCALL(gpfnCntFocusSet, hWnd, NULL_PTR, NULL_PTR)
ENDIF
oDataServer:GoTo(iRecNo)
ENDIF
SELF:__EnableNotify()
SELF:RestoreUpdate()
oParent:Pointer:=oOldPointer
ENDIF
RETURN
/// <exclude />
METHOD __BuildNewBuffer(iRecNo AS INT) AS VOID STRICT
//PP-030828 Strong typing
LOCAL strucRecord AS _WINRecordCore
LOCAL strucTopRec AS _WINRecordCore
LOCAL iDeltaPos, iCurrentPos, iRangeMax, iToBottom AS INT
//PP-041004
strucTopRec := NULL_PTR
IF oDataServer != NULL_OBJECT
SELF:SuspendUpdate()
SELF:__DeferNotify()
oDataServer:GoTo(iRecNo)
lHasTop := FALSE
lHasBottom := FALSE
lHasTop := SELF:__TestForTop()
iBufferSize := 0
DO WHILE (iBufferSize <= iBufferGranularity)
IF oDataServer:EOF
EXIT
ENDIF
SELF:__RefreshData()
strucRecord := SELF:__BuildRecord()
IF (strucRecord == NULL_PTR)
EXIT
ENDIF
PCALL(gpfnCntAddRecTail, hWnd, strucRecord)
iBufferSize := iBufferSize + 1
IF (strucTopRec == NULL_PTR)
strucTopRec := strucRecord
ENDIF
// MSM:2012-03-21 Suggestion from Dirk Herijgers
IF iBufferSize<=iBufferGranularity
oDataServer:Skip(1)
ENDIF
ENDDO
lHasBottom := SELF:__TestForBottom()
IF (iBufferSize <= iBufferGranularity)
iToBottom := iBufferSize
oDataServer:GoTo(iRecNo)
oDataServer:Skip(-1)
DO WHILE (iBufferSize <= iBufferGranularity)
IF oDataServer:Bof
EXIT
ENDIF
SELF:__RefreshData()
strucRecord := SELF:__BuildRecord()
IF (strucRecord == NULL_PTR)
EXIT
ENDIF
PCALL(gpfnCntAddRecHead, hWnd, strucRecord)
iBufferSize := iBufferSize + 1
strucTopRec := strucRecord
oDataServer:Skip(-1)
ENDDO
lHasTop := SELF:__TestForTop()
ENDIF
IF (lHasTop .AND. lHasBottom)
PCALL(gpfnCntDeltaExSet, hWnd, 0)
PCALL(gpfnCntRangeExSet, hWnd, 0, iBufferSize)
ELSE
iRangeMax := iBufferSize
IF (!lHasTop .AND. !lHasBottom)
// middle
iRangeMax := iBufferSize + (2 * iBufferGranularity)
iDeltaPos := iRangeMax - iBufferSize - iBufferGranularity
iCurrentPos := iDeltaPos
ELSEIF lHasTop
// top
iRangeMax := iBufferSize + iBufferGranularity
iDeltaPos := 0
iCurrentPos := iDeltaPos
ELSE
// bottom
iRangeMax := iBufferSize + iBufferGranularity
iDeltaPos := iRangeMax - iBufferSize
// this will force the bottom
// iCurrentPos := (iRangeMax - CntRecsDispGet(hWnd)) + 1 // wrong !?
iCurrentPos := iRangeMax - iToBottom
ENDIF
/* DebOut("strucTopRec",strucTopRec)
DebOut("strucTopRec.lpRecData",strucTopRec.lpRecData)
DebOut("strucTopRec.lpNext",strucTopRec.lpNext)
DebOut("strucTopRec.lpPrev",strucTopRec.lpPrev)
DebOut("strucTopRec.lpSelFldHead",strucTopRec.lpSelFldHead)
DebOut("strucTopRec.lpSelFldTail",strucTopRec.lpSelFldTail)
DebOut("strucTopRec.dwRecSize",strucTopRec.dwRecSize)
DebOut("IbufferSize",iBufferSize)
DebOut("iDeltaPos",iDeltaPos)
DebOut("iCurrentPos",iCurrentPos)
DebOut("iRangeMax",iRangeMax)
DebOut("gpfnCntTopRecSet",gpfnCntTopRecSet)
*/ PCALL(gpfnCntTopRecSet, hWnd, strucTopRec)
PCALL(gpfnCntDeltaExSet, hWnd, iBufferSize)
PCALL(gpfnCntDeltaPosExSet, hWnd, iDeltaPos)
PCALL(gpfnCntVScrollPosExSet, hWnd, iCurrentPos)
PCALL(gpfnCntRangeExSet, hWnd, 0, iRangeMax)
ENDIF
SELF:__EnableNotify()
SELF:RestoreUpdate()
ENDIF
RETURN
/// <exclude />
METHOD __BuildRecord() AS _WinRecordCore STRICT
//PP-030828 Strong typing
LOCAL strucRecCore AS _WinRecordCore
LOCAL i AS INT
IF (oDataServer != NULL_OBJECT)
strucRecCore := PCALL(gpfnCntNewRecCore, DWORD(iRecordSize))
IF (strucRecCore != NULL_PTR)
i := oDataServer:RecNo
PCALL(gpfnCntRecUserSet, strucRecCore, @i, _SIZEOF(INT))
SELF:__FillRecord(strucRecCore)
IF lIsReadOnly
PCALL(gpfnCntRecAttrSet, strucRecCore, CRA_RECREADONLY)
ENDIF
ENDIF
ENDIF
RETURN strucRecCore
/// <exclude />
METHOD __BuildRecordDescription() AS LOGIC STRICT
//PP-030828 Strong typing
LOCAL i AS DWORD
LOCAL iLen AS DWORD
LOCAL oColumn AS DataColumn
LOCAL strucFI AS _WinFieldInfo
LOCAL dwOldRecSize AS DWORD
LOCAL dwRecordSize AS DWORD
IF ptrDataBuffer != NULL_PTR
MemFree(ptrDataBuffer)
ptrDataBuffer := NULL_PTR
ENDIF
dwOldRecSize := DWORD(iRecordSize)
dwRecordSize := _SIZEOF(INT)
iLen := ALen(aColumn)
FOR i:=1 UPTO iLen
oColumn := aColumn[i]
strucFI := oColumn:__FieldInfo
strucFI:wOffStruct := dwRecordSize
dwRecordSize += oColumn:__Size + 1
NEXT
ptrDataBuffer := MemAlloc(dwRecordSize)
iRecordSize := INT(dwRecordSize)
// return true if we need to refresh browser
RETURN (dwRecordSize > dwOldRecSize)
/// <exclude />
METHOD __ClearBuffers() AS VOID STRICT
//PP-030828 Strong typing
IF oCellEdit != NULL_OBJECT
SELF:__EndEditField(0)
ENDIF
PCALL(gpfnCntKillRecList, hWnd)
PCALL(gpfnCntDeltaExSet, hWnd, 0)
PCALL(gpfnCntRangeExSet, hWnd, 0, 0)
lHasTop := FALSE
lHasBottom := FALSE
iBufferSize := 0
RETURN
/// <exclude />
ACCESS __ContainerChildWnd AS PTR STRICT
//PP-030828 Strong typing
LOCAL hChild AS PTR
hChild := PCALL(gpfnCntCNChildWndGet, hwnd, 0)
IF (hChild == NULL_PTR)
hChild := GetWindow(hwnd, GW_CHILD)
ENDIF
RETURN hChild
/// <exclude />
METHOD __DeferNotify() AS VOID STRICT
//PP-030828 Strong typing
IF iDeferNotifyCount==0 .AND. oDataServer != NULL_OBJECT
oDataServer:SuspendNotification()
ENDIF
iDeferNotifyCount := iDeferNotifyCount + 1
RETURN
/// <exclude />
METHOD __DeltaBuildBuffer() AS VOID STRICT
//PP-030828 Strong typing
LOCAL oOldPointer AS Pointer
LOCAL iCurrentRecNo AS INT
LOCAL iInc AS INT
LOCAL strucRC AS _WinRecordCore
IF oDataServer != NULL_OBJECT
oOldPointer:=oParent:Pointer
oParent:Pointer := Pointer{PointerHourGlass}
SELF:SuspendUpdate()
SELF:__DeferNotify()
iCurrentRecNo := oDataServer:RecNo
iInc := PCALL(gpfnCntCNIncExGet, hWnd, 0)
IF iBufferSize + iBufferGranularity <= iBufferMaximum
IF !lHasTop .AND. !lHasBottom
// middle
IF iInc < 0
SELF:__DeltaBuildBufferUp()
ELSE
SELF:__DeltaBuildBufferDown()
ENDIF
ELSEIF lHasTop
// top
IF iInc > 0
SELF:__DeltaBuildBufferDown()
ENDIF
ELSE
// bottom
IF iInc < 0
SELF:__DeltaBuildBufferUp()
ENDIF
ENDIF
ELSE
strucRC := SELF:__GetRecordAtRecNo(iCurrentRecNo)
IF !lHasTop .AND. !lHasBottom
// middle
IF iInc < 0
SELF:__DeltaReBuildBufferUp()
ELSE
SELF:__DeltaReBuildBufferDown()
ENDIF
ELSEIF lHasTop
// top
IF iInc > 0
SELF:__DeltaReBuildBufferDown()
ENDIF
ELSE
// bottom
IF iInc < 0
SELF:__DeltaReBuildBufferUp()
ENDIF
ENDIF
IF strucRC == NULL_PTR
// see if focus was paged in
strucRC := SELF:__GetRecordAtRecNo(iCurrentRecNo)
IF strucRC != NULL_PTR
PCALL(gpfnCntSelectRec, hWnd, strucRC)
ENDIF
ENDIF
ENDIF
oDataServer:GoTo(iCurrentRecNo)
SELF:__EnableNotify()
SELF:RestoreUpdate()
oParent:Pointer := oOldPointer
ENDIF
RETURN
/// <exclude />
METHOD __DeltaBuildBufferDown() AS VOID STRICT
//PP-030828 Strong typing
LOCAL i AS INT
LOCAL iRangeMax AS INT
LOCAL strucRC AS _WinRecordCore
SELF:SuspendUpdate()
SELF:__DeferNotify()
oDataServer:GoTo(SELF:__GetRecordNo(PCALL(gpfnCntRecTailGet, hWnd)))
// MSM:2012-03-21 next moved inside the as suggested by Dirk Heijers
// oDataServer:Skip(1)
// 2.0a-1, changed borders
FOR i:=0 UPTO iBufferGranularity-1
oDataServer:Skip(1) // MSM:2012-03-21 suggested by Dirk Heijers
IF oDataServer:EOF
EXIT
ENDIF
SELF:__RefreshData()
IF (strucRC := SELF:__BuildRecord()) == NULL_PTR
EXIT
ENDIF
PCALL(gpfnCntAddRecTail, hWnd, strucRC)
// MSM:2012-03-21 next removed as suggested by Dirk Heijers
// oDataServer:Skip(1)
NEXT
lHasBottom := SELF:__TestForBottom()
iBufferSize += i
iRangeMax := iBufferSize
IF lHasTop .AND. lHasBottom
PCALL(gpfnCntDeltaExSet, hWnd, 0)
PCALL(gpfnCntRangeExSet, hWnd, 0, iRangeMax)
ELSE
IF !lHasTop
iRangeMax += iBufferGranularity
ENDIF
IF !lHasBottom
iRangeMax += iBufferGranularity
ENDIF
PCALL(gpfnCntRangeExSet, hWnd, 0, iRangeMax)
PCALL(gpfnCntDeltaExSet, hWnd, iBufferSize)
ENDIF
SELF:__EnableNotify()
SELF:RestoreUpdate()
RETURN
/// <exclude />
METHOD __DeltaBuildBufferUp() AS VOID STRICT
//PP-030828 Strong typing
LOCAL iRecNo AS INT
LOCAL i AS INT
LOCAL iRangeMax AS INT
LOCAL strucRC AS _WinRecordCore
SELF:SuspendUpdate()
SELF:__DeferNotify()
iRecNo := SELF:__GetRecordNo(PCALL(gpfnCntRecHeadGet, hWnd))
oDataServer:GoTo(iRecNo)
// MSM:2012-03-21 next moved inside the as suggested by Dirk Heijers
// oDataServer:Skip(-1)
// 2.0a-1, changed borders
FOR i:=0 UPTO iBufferGranularity-1
// MSM:2012-03-21 next moved inside the as suggested by Dirk Heijers
oDataServer:Skip(-1)
IF oDataServer:BOF
EXIT
ENDIF
SELF:__RefreshData()
IF (strucRC := SELF:__BuildRecord()) == NULL_PTR
EXIT
ENDIF
PCALL(gpfnCntAddRecHead, hWnd, strucRC)
// MSM:2012-03-21 next removed by Dirk Heijers
// oDataServer:Skip(-1)
NEXT
lHasTop := SELF:__TestForTop()
iBufferSize += i
iRangeMax := iBufferSize
IF (lHasTop .AND. lHasBottom)
PCALL(gpfnCntDeltaExSet, hWnd, 0)
PCALL(gpfnCntDeltaPosExSet, hWnd, 0)
PCALL(gpfnCntVScrollPosExSet, hWnd, i)
PCALL(gpfnCntRangeExSet, hWnd, 0, iRangeMax)
ELSE
IF !lHasTop
iRangeMax += iBufferGranularity
ENDIF
IF !lHasBottom
iRangeMax += iBufferGranularity
ENDIF
IF !lHasTop
i := PCALL(gpfnCntDeltaPosExGet, hWnd)
PCALL(gpfnCntDeltaExSet, hWnd, iBufferSize)
PCALL(gpfnCntVScrollPosExSet, hWnd, i + iBufferGranularity)
PCALL(gpfnCntRangeExSet, hWnd, 0, iRangeMax)
ELSE
// 2.5b
// i := pcall(gpfnCntCurrentPosExGet, hWnd)
PCALL(gpfnCntDeltaExSet, hWnd, iBufferSize)
PCALL(gpfnCntDeltaPosExSet, hWnd, 0)
PCALL(gpfnCntVScrollPosExSet, hWnd, i)
PCALL(gpfnCntRangeExSet, hWnd, 0L, iRangeMax)
ENDIF
ENDIF
SELF:__EnableNotify()
SELF:RestoreUpdate()
RETURN
/// <exclude />
METHOD __DeltaRebuildBufferDown() AS VOID STRICT
//PP-030828 Strong typing
LOCAL i AS INT
LOCAL iShift AS INT
LOCAL iRangeMax AS INT
LOCAL iCurrentPos AS INT
LOCAL lLostTop AS LOGIC
LOCAL strucRC AS _WinRecordCore
LOCAL strucTopRec AS _WinRecordCore
SELF:SuspendUpdate()
SELF:__DeferNotify()
strucTopRec := PCALL(gpfnCntTopRecGet, hwnd)
oDataServer:GoTo(SELF:__GetRecordNo(PCALL(gpfnCntRecTailGet, hwnd)))
// MSM:2012-03-21 next line moved inside loop as suggested by Dirk Herijgers
// oDataServer:Skip(1)
// 2.0a-1, changed borders
FOR i:=0 UPTO iBufferGranularity-1
// MSM:2012-03-21 next line moved inside loop as suggested by Dirk Herijgers
oDataServer:Skip(1)
IF oDataServer:Eof
EXIT
ENDIF
SELF:__RefreshData()
strucRC := SELF:__BuildRecord()
IF (strucRC == NULL_PTR)
EXIT
ENDIF
PCALL(gpfnCntAddRecTail, hwnd, strucRC)
// MSM:2012-03-21 next line removed as suggested by Dirk Herijgers
// oDataServer:Skip(1)
NEXT
lHasBottom := SELF:__TestForBottom()
iShift := i
// 2.0a-1, changed borders
FOR i:=0 UPTO iShift-1
strucRC := PCALL(gpfnCntRemoveRecHead, hwnd)
IF (strucRC == NULL_PTR)
EXIT
ENDIF
PCALL(gpfnCntFreeRecCore, strucRC)
NEXT
// this assumes that records were removed and top is lost
lLostTop := lHasTop
lHasTop := FALSE
iRangeMax := iBufferSize
IF !lHasTop
iRangeMax += iBufferGranularity
ENDIF
IF !lHasBottom
iRangeMax += iBufferGranularity
ENDIF
IF lLostTop
iCurrentPos := PCALL(gpfnCntCurrentPosExGet, hwnd)
PCALL(gpfnCntTopRecSet, hwnd, strucTopRec)
PCALL(gpfnCntDeltaExSet, hwnd, iBufferSize)
PCALL(gpfnCntDeltaPosExSet, hwnd, ibufferGranularity)
PCALL(gpfnCntVScrollPosExSet, hwnd, iCurrentPos)
PCALL(gpfnCntRangeExSet, hwnd, 0, iRangeMax)
ELSE
iCurrentPos := PCALL(gpfnCntCurrentPosExGet, hwnd)
PCALL(gpfnCntTopRecSet, hwnd, strucTopRec)
PCALL(gpfnCntDeltaExSet, hwnd, iBufferSize)
PCALL(gpfnCntDeltaPosExSet, hwnd, iBufferGranularity)
PCALL(gpfnCntVScrollPosExSet, hwnd, iCurrentPos - iShift)
PCALL(gpfnCntRangeExSet, hwnd, 0, iRangeMax)
ENDIF
SELF:__EnableNotify()
SELF:RestoreUpdate()
RETURN
/// <exclude />
METHOD __DeltaRebuildBufferUp() AS VOID STRICT
//PP-030828 Strong typing
LOCAL i AS INT
LOCAL iShift AS INT
LOCAL iRangeMax AS INT
LOCAL iCurrentPos AS INT
LOCAL lGainTop AS LOGIC
LOCAL strucTopRec AS _WinRecordCore
LOCAL strucRC AS _WinRecordCore
SELF:SuspendUpdate()
SELF:__DeferNotify()
strucTopRec := PCALL(gpfnCntTopRecGet, hwnd)
oDataServer:GoTo(SELF:__GetRecordNo(PCALL(gpfnCntRecHeadGet, hwnd)))
// MSM:2012-03-21 next line moved into the loop as suggested by Dirk Herijgers
// oDataServer:Skip(-1)
// 2.0a-1, changed borders
FOR i:=0 UPTO iBufferGranularity-1
// MSM:2012-03-21 next line moved into the loop as suggested by Dirk Herijgers
oDataServer:Skip(-1)
IF oDataServer:Bof
EXIT
ENDIF
SELF:__RefreshData()
IF (strucRC := SELF:__BuildRecord()) == NULL_PTR
EXIT
ENDIF
PCALL(gpfnCntAddRecHead, hwnd, strucRC)
// MSM:2012-03-21 next line removed as suggested by Dirk Herijgers
// oDataServer:Skip(-1)
NEXT
lGainTop := lHasTop := SELF:__TestForTop()
iShift := i
// 2.0a-1, changed borders
FOR i:=0 UPTO iShift-1
IF (strucRC := PCALL(gpfnCntRemoveRecTail, hwnd)) == NULL_PTR
EXIT
ENDIF
PCALL(gpfnCntFreeRecCore, strucRC)
NEXT
// this assumes that records were removed and bottom is lost
lHasBottom := FALSE
iRangeMax := iBufferSize
IF !lHasTop
iRangeMax += iBufferGranularity
ENDIF
IF !lHasBottom
iRangeMax += iBufferGranularity
ENDIF
IF lGainTop
PCALL(gpfnCntTopRecSet, hwnd, strucTopRec)
PCALL(gpfnCntDeltaExSet, hwnd, iBufferSize)
PCALL(gpfnCntDeltaPosExSet, hwnd, 0)
PCALL(gpfnCntVScrollPosExSet, hwnd, iShift)
PCALL(gpfnCntRangeExSet, hwnd, 0, iRangeMax)
ELSE
icurrentPos := PCALL(gpfnCntCurrentPosExGet, hwnd)
PCALL(gpfnCntTopRecSet, hwnd, strucTopRec)
PCALL(gpfnCntDeltaExSet, hwnd, iBufferSize)
PCALL(gpfnCntDeltaPosExSet, hwnd, iBufferGranularity)
PCALL(gpfnCntVScrollPosExSet, hwnd, iCurrentPos + iShift)
PCALL(gpfnCntRangeExSet, hwnd, 0, iRangeMax)
ENDIF
SELF:__EnableNotify()
SELF:RestoreUpdate()
RETURN
/// <exclude />
METHOD __DestroyEditField() AS VOID STRICT
//PP-030828 Strong typing
IF (oCellEdit != NULL_OBJECT)
oCellEdit:Destroy()
oCellEdit := NULL_OBJECT
ptrControlDefaultProc := NULL_PTR
ENDIF
RETURN
/// <exclude />
METHOD __EditDispatch(uMsg AS DWORD, wParam AS DWORD, lParam AS LONGINT) AS LOGIC STRICT
//PP-030828 Strong typing
IF uMsg==WM_KeyDown
IF wParam==VK_TAB .OR.;
wParam==VK_ESCAPE .OR.;
wParam==VK_RETURN .OR.;
wParam==VK_UP .OR.;
wParam==VK_DOWN .OR.;
wParam==VK_PRIOR .OR.;
wParam==VK_NEXT
PCALL(gpfnCntNotifyAssoc, hwnd, DWORD(_CAST, CN_ENDFLDEDIT), wParam, StrucEditRecord, StrucEditField,;
_AND(LONGINT(lParam), 0x0000ffff), (GetAsyncKeyState(VK_SHIFT)<0), (GetAsyncKeyState(VK_CONTROL)<0), NULL_PTR)
RETURN TRUE
ENDIF
ELSEIF uMsg==WM_Char
IF wParam==VK_TAB .OR.;
wParam==VK_ESCAPE .OR.;
wParam==VK_RETURN
RETURN TRUE
ENDIF
ENDIF
RETURN FALSE
/// <exclude />
METHOD __EnableNotify() AS VOID STRICT
//PP-030828 Strong typing
IF iDeferNotifyCount>0
--iDeferNotifyCount
ENDIF
IF iDeferNotifyCount==0 .AND. oDataServer!=NULL_OBJECT
oDataServer:ResetNotification()
ENDIF
RETURN
/// <exclude />
METHOD __EnableSelection(kStyle AS INT) AS VOID STRICT
//PP-030828 Strong typing
LOCAL strucRC AS _WinRecordCore
// if no change do nothing
IF iSelectionStyle == kStyle
RETURN
ENDIF
// Turn off old mode
DO CASE
CASE iSelectionStyle == ssSingleSelection
// Turn off single selections if any
strucRC := PCALL(gpfnCntSelRecGet, hwnd)
IF strucRC != NULL_PTR
PCALL(gpfnCntUnSelectRec, hwnd, strucRC)
ENDIF
PCALL(gpfnCntStyleClear, hwnd, CTS_SINGLESEL)
CASE iSelectionStyle == ssExtendedSelection
// Turn off multiple selections if any
strucRC := PCALL(gpfnCntRecHeadGet, hwnd)
WHILE strucRC != NULL_PTR
IF PCALL(gpfnCntIsRecSelected, hwnd, strucRC)
PCALL(gpfnCntUnSelectRec, hwnd, strucRC)
ENDIF
strucRC := PCALL(gpfnCntNextRec, strucRC)
ENDDO
PCALL(gpfnCntStyleClear, hwnd, CTS_EXTENDEDSEL)
CASE iSelectionStyle == ssBlockSelection
strucRC := PCALL(gpfnCntRecHeadGet, hwnd)
WHILE strucRC != NULL_PTR
IF PCALL(gpfnCntIsRecSelected, hwnd, strucRC)
PCALL(gpfnCntUnSelectRec, hwnd, strucRC)
ENDIF
PCALL(gpfnCntRecAttrClear, strucRC, CRA_SELECTED)
PCALL(gpfnCntRecAttrClear, strucRC, CRA_FLDSELECTED)
strucRC := PCALL(gpfnCntNextRec, strucRC)
ENDDO
PCALL(gpfnCntStyleClear, hwnd, CTS_BLOCKSEL)
ENDCASE
DO CASE
//case kStyle==ssNoSelection
//Do nothing
CASE kStyle==ssSingleSelection
PCALL(gpfnCntStyleSet, hwnd, CTS_SINGLESEL)
CASE kStyle==ssExtendedSelection
PCALL(gpfnCntStyleSet, hwnd, CTS_EXTENDEDSEL)
CASE kStyle==ssBlockSelection
PCALL(gpfnCntStyleSet, hwnd, CTS_BLOCKSEL)
ENDCASE
iSelectionStyle := kStyle
RETURN
/// <exclude />
METHOD __EndEditField(dwChar AS DWORD) AS VOID STRICT
//PP-030828 Strong typing
LOCAL oDCol AS DataColumn
LOCAL c AS STRING
// local strucEF AS _WinFieldInfo
// local strucER AS _WinRecordCore
IF (oCellEdit != NULL_OBJECT)
oDCol := SELF:__GetColumn(strucEditField)
// If the record numbers do not match then the dataServer has
// moved (changed?). Therefore lose the edit!
IF (dwChar != VK_ESCAPE) .AND. !IsInstanceOf(oCellEdit, #OLEObject) .AND.;
SELF:__GetRecordNo(strucEditRecord) == oDataServer:RECNO .AND.;
oCellEdit:Modified
// strucER:=strucEditRecord
// ptrFldBuf := strucER.lpRecData
// strucEF:=strucEditField
// ptrFldBuf := PTR(_CAST,DWORD(_CAST,ptrFldBuf)+strucEF.wOffStruct)
oCellEdit:__Update()
c := oCellEdit:TextValue
//must destroy the edit cell before calling SetValue to avoid looping
SELF:__DestroyEditField()
oDCol:SetValue(c)
SELF:ColumnFocusChange(oDCol, TRUE)
ELSE
SELF:__DestroyEditField()
ENDIF
PCALL(gpfnCntFocusFldUnlck, hwnd)
ENDIF
RETURN
/// <exclude />
METHOD __FieldChange() AS VOID STRICT
//PP-030828 Strong typing
LOCAL iRecNo AS INT
LOCAL strucRecord AS _WinRecordCore
IF oDataServer != NULL_OBJECT
iRecNo := oDataServer:RecNo
strucRecord := SELF:__GetRecordAtRecNo(iRecNo)
IF strucRecord != NULL_PTR
SELF:SuspendUpdate()
SELF:__DeferNotify()
SELF:__FillRecord(strucRecord)
PCALL(gpfnCntEndRecEdit, hwnd, strucRecord, PCALL(gpfnCntFocusFldGet, hwnd))
SELF:__EnableNotify()
SELF:RestoreUpdate()
ENDIF
ENDIF
RETURN
/// <exclude />
METHOD __FillRecord(RecCore AS _WINRecordCore) AS VOID STRICT
//PP-030828 Strong typing
LOCAL ptrDest AS BYTE PTR
LOCAL cValue AS STRING
LOCAL iLen AS INT
LOCAL i AS INT
LOCAL dwOff AS DWORD
LOCAL dwSize AS DWORD
LOCAL dwLen AS DWORD
LOCAL strucRecCore AS _winRECORDCORE
LOCAL oColumn AS DataColumn
strucRecCore := RecCore
IF ptrDataBuffer == NULL_PTR
SELF:__BuildRecordDescription()
ENDIF
IF ptrDataBuffer != NULL_PTR
MemSet(ptrDataBuffer, 0, DWORD(iRecordSize))
iLen := INT(ALen(aColumn))
FOR i:=1 UPTO iLen
oColumn := aColumn[i]
cValue := oColumn:GetValue()
dwOff := oColumn:__Offset
ptrDest := ptrDataBuffer + dwOff
dwSize := oColumn:__Size // Width // wrong ??
IF (NULL_STRING != cValue)
dwLen := SLen(cValue)
IF (dwLen < dwSize)
dwSize := dwLen
ENDIF
MemCopy(ptrDest, String2Psz(cValue), dwSize)
ENDIF
_NPut(ptrDest, dwSize, 0)
//ASSERT dword(_cast, (ptrDest+dwsize)) <= dword(_cast, (ptrDataBuffer+iRecordSize))
NEXT
PCALL(gpfnCntRecDataSet, strucRecCore, ptrDataBuffer)
ENDIF
RETURN
/// <exclude />
METHOD __FindColumn(nIndex AS USUAL) AS DWORD STRICT
//PP-030828 Strong typing
// returns Index into array
LOCAL sIndex AS SYMBOL
LOCAL dwType AS DWORD
LOCAL dwI, dwCount AS DWORD
LOCAL oDCol AS DataColumn
dwType := UsualType(nIndex)
DO CASE
CASE dwType == LONGINT
IF nIndex > 0 .AND. nIndex <= ALen(aColumn)
RETURN nIndex
ENDIF
RETURN 0
//SE-060526
CASE dwType == SYMBOL .OR. dwType == STRING
sIndex := IIF(dwType == SYMBOL, nIndex, String2Symbol(nIndex))
dwCount := ALen(aColumn)
FOR dwI := 1 UPTO dwCount
oDCol := aColumn[dwI]
IF oDCol:NameSym == sIndex
RETURN dwI
ENDIF
NEXT //dwI
RETURN 0
//SE-060526
CASE IsInstanceOfUsual(nIndex, #DataColumn)
oDCol := nIndex
dwCount := ALen(aColumn)
FOR dwI := 1 UPTO dwCount
IF oDCol = aColumn[dwI]
RETURN dwI
ENDIF
NEXT //dwI
RETURN 0
CASE (dwType == VOID)
RETURN 0
OTHERWISE
WCError{#__FindColumn,#DataBrowser,__WCSTypeError,nIndex,1}:Throw()
ENDCASE
RETURN 0
/// <exclude />
METHOD __GetColumn(strucFI AS _WINFieldInfo) AS OBJECT STRICT
//PP-030828 Strong typing
LOCAL p AS SelfPtr
LOCAL strucFITemp AS _WinFieldInfo
LOCAL oRet := NULL_OBJECT AS USUAL
strucFITemp := strucFI
IF (strucFITemp != NULL_PTR)
// Note lpUserData contains a pointer to a buffer of 4 bytes with the self pointer!
p := strucFITemp:lpUserData // pCall(gpfnCntFldUserGet(strucFI)
p := p:ptrSelf
oRet := __WCSelfPtr2Object(p)
ENDIF
RETURN oRet
/// <exclude />
METHOD __GetRecordAtRecNo(iRecNo AS INT) AS _WINRecordCore STRICT
//PP-030828 Strong typing
LOCAL strucRecord AS _WINRecordCore
strucRecord := PCALL(gpfnCntRecHeadGet, hwnd)
DO WHILE strucRecord != NULL_PTR
IF SELF:__GetRecordNo(strucRecord) == iRecNo
EXIT
ENDIF
strucRecord := PCALL(gpfnCntNextRec, strucRecord)
ENDDO
RETURN strucRecord
/// <exclude />
METHOD __GetRecordNo(strucRC AS _winRECORDCORE) AS LONGINT STRICT
//PP-030828 Strong typing
LOCAL p AS LONGINT PTR
LOCAL strucRCTemp AS _WinRecordCore
strucRCTemp := strucRC
IF (strucRCTemp == NULL_PTR)
RETURN 0
ENDIF
p := strucRCTemp:lpUserData //pCall(gpfnCntRecUserGet(strucRC)
IF (p == NULL_PTR)
RETURN 0
ENDIF
RETURN LONGINT(p)
/// <exclude />
METHOD __IsDataServerEmpty() AS LOGIC STRICT
//PP-030828 Strong typing
RETURN oDataServer:BOF .AND. oDataServer:EOF
/// <exclude />
METHOD __IsFocusRecordInView() AS LOGIC STRICT
//PP-030828 Strong typing
LOCAL strucFocusRecord AS _WinRecordCore
LOCAL strucRecord AS _WinRecordCore
LOCAL iDisplaySize AS INT
IF (strucFocusRecord := PCALL(gpfnCntFocusRecGet, hwnd)) == NULL_PTR
RETURN FALSE
ENDIF
iDisplaySize := PCALL(gpfnCntRecsDispGet, hwnd)
strucRecord := PCALL(gpfnCntTopRecGet, hwnd)
DO WHILE iDisplaySize > 1
IF strucRecord == NULL_PTR
EXIT
ELSEIF strucRecord == strucFocusRecord
EXIT
ENDIF
strucRecord := PCALL(gpfnCntNextRec, strucRecord)
iDisplaySize--
ENDDO
RETURN (strucRecord == strucFocusRecord)
/// <exclude />
ASSIGN __LastChar(dwNewLastChar AS DWORD) STRICT
//PP-030828 Strong typing
RETURN (dwLastChar := dwNewLastChar)
/// <exclude />
METHOD __NewFocusField(strucFI AS _WINFieldInfo) AS VOID STRICT
//PP-030828 Strong typing
IF strucFocusField != NULL_PTR
SELF:ColumnFocusChange(SELF:__GetColumn(strucFocusField), FALSE)
ENDIF
IF StrucFI != NULL_PTR
SELF:ColumnFocusChange(SELF:__GetColumn(StrucFI), TRUE)
ENDIF
strucFocusField := strucFI
RETURN
/// <exclude />
METHOD __NewFocusRecord(strucRC AS _WINRecordCore, strucFI AS _WINFieldInfo) AS VOID STRICT
//PP-030828 Strong typing
LOCAL iRecNo AS INT
LOCAL strucOldFI AS _WinFieldInfo
iRecNo := SELF:__GetRecordNo(strucRC)
IF oDataServer:RecNo == 0
oDataServer:Update()
oDataServer:GoTo(iRecNo - 1)
ELSE
iDeferNotifyCount := iDeferNotifyCount + 1
// self:__DeferNotify()
IF oDataServer:GoTo(iRecNo)
strucOldFI := PCALL(gpfnCntFocusFldGet, hwnd)
PCALL(gpfnCntFocusSet, hwnd, strucRC, strucFI)
PCALL(gpfnCntFocusRecLock, hwnd)
IF strucOldFI != strucFI
SELF:__NewFocusField(strucFI)
ENDIF
ELSE
PCALL(gpfnCntFocusRecLock, hwnd)
ENDIF
iDeferNotifyCount := iDeferNotifyCount - 1
// self:__EnableNotify()
ENDIF
RETURN
/// <exclude />
METHOD __NotifyChanges(kNotify AS DWORD) AS USUAL STRICT
//PP-030828 Strong typing
IF iDeferNotifyCount == 0
// if in the middle of an edit - end it
IF (oCellEdit != NULL_OBJECT)
SELF:__EndEditField(0)
ENDIF
SWITCH kNotify
CASE GBNFY_INTENTTOMOVE
RETURN SELF:Validate()
CASE GBNFY_RECORDCHANGE
SELF:__RecordChange()
CASE GBNFY_DOGOTOP
CASE GBNFY_DOGOEND
SELF:__RecordChange()
SELF:__RefreshBuffer()
CASE GBNFY_FIELDCHANGE
SELF:__FieldChange()
CASE GBNFY_FILECHANGE
SELF:__RefreshBuffer()
CASE GBNFY_DONEWROW
SELF:__RefreshBuffer()
CASE GBNFY_DODELETE
SELF:__RecordDelete()
END SWITCH
ELSE
IF kNotify == GBNFY_INTENTTOMOVE
RETURN TRUE
ELSE
RETURN NIL
ENDIF
ENDIF
RETURN NIL
/// <exclude />
ACCESS __NotifyWindow AS PTR STRICT
//PP-030828 Strong typing
RETURN hNotifyWindow
/// <exclude />
METHOD __RecordChange() AS VOID STRICT
//PP-030828 Strong typing
LOCAL iRecNo AS INT
LOCAL iCount AS INT
LOCAL strucRecord AS _WinRecordCore
//local i as int
IF oDataServer != NULL_OBJECT
iRecNo := oDataServer:RecNo
// check if record is already focused
strucRecord := PCALL(gpfnCntFocusRecGet, hwnd)
IF strucRecord != NULL_PTR .AND.;
SELF:__GetRecordNo(strucRecord) == iRecNo
// make sure that it is selected
PCALL(gpfnCntSelectRec, hwnd, strucRecord)
ELSE
// check if record is in the buffer
strucRecord := PCALL(gpfnCntRecHeadGet, hwnd)
DO WHILE strucRecord != NULL_PTR
IF SELF:__GetRecordNo(strucRecord) == iRecNo
EXIT
ENDIF
strucRecord := PCALL(gpfnCntNextRec, strucRecord)
iCount++
ENDDO
// record is in the buffer so focus it
IF strucRecord != NULL_PTR
PCALL(gpfnCntFocusSet, hwnd, strucRecord, PCALL(gpfnCntFocusFldGet, hwnd))
PCALL(gpfnCntFocusRecLock, hwnd)
IF !SELF:__IsFocusRecordInView()
IF !lHasTop
//i := pCall(gpfnCntDeltaPosExGet, hwnd)
iCount += iBufferGranularity //iBufferGranularity
ENDIF
IF !lHasBottom
PCALL(gpfnCntCurrentPosExSet, hwnd, iCount)
ELSE
// !not clean! need better solution
SELF:__RefreshBuffer()
ENDIF
ENDIF
ELSE
SELF:__RefreshBuffer()
ENDIF
ENDIF
ENDIF
RETURN
/// <exclude />
METHOD __RecordDelete() AS VOID STRICT
//PP-030828 Strong typing
LOCAL strucRecord AS _WinRecordCore
LOCAL iRecno AS INT
LOCAL iTopRecno AS INT
iRecNo := oDataServer:RecNo
SELF:SuspendUpdate()
SELF:__DeferNotify()
strucRecord := PCALL(gpfnCntTopRecGet, hwnd)
IF strucRecord != NULL_PTR
oDataServer:Skip(1)
IF oDataServer:EOF
oDataServer:Skip(-1)
ENDIF
ELSE
iTopRecNo := SELF:__GetRecordNo(strucRecord)
IF iTopRecNo != iRecNo
oDataServer:GoTo(iTopRecNo)
ELSE
oDataServer:Skip(1)
IF oDataServer:EOF
oDataServer:Skip(-1)
ENDIF
ENDIF
ENDIF
SELF:__ClearBuffers()
IF !SELF:__IsDataServerEmpty()
SELF:__BuildNewBuffer(oDataServer:RecNo)
ENDIF
oDataServer:GoTo(iRecNo)
SELF:__EnableNotify()
SELF:RestoreUpdate()
RETURN
/// <exclude />
METHOD __RefreshBuffer() AS VOID STRICT
//PP-030828 Strong typing
SELF:SuspendUpdate()
SELF:__BuildBuffer()
SELF:RestoreUpdate()
RETURN
PRIVATE METHOD __ScatterColumns() AS VOID
FOREACH oCol AS DataColumn IN SELF:aColumn
oCol:__Scatter()
NEXT
/// <exclude />
METHOD __RefreshData() AS VOID STRICT
//PP-030828 Strong typing
SELF:__ScatterColumns()
//ASend(aColumn, #__Scatter)
RETURN
/// <exclude />
METHOD __RefreshField(uFieldName AS USUAL) AS DWORD
//PP-030828 Strong typing
LOCAL i, iLen AS DWORD
LOCAL symFieldName AS SYMBOL
LOCAL oDF AS DataField
LOCAL oCol AS DataColumn
IF IsSymbol(uFieldName)
symFieldName:=uFieldName
iLen := ALen(aColumn)
FOR i := 1 TO iLen
oCol :=aColumn[i]
oDF := oCol:__DataField
IF (oDF != NULL_OBJECT) .AND. (oDF:NameSym == symFieldName)
oCol:__Scatter()
ENDIF
NEXT
ENDIF
RETURN i
/// <exclude />
METHOD __RegisterFieldLinks(oDS AS DataServer) AS LOGIC STRICT
//PP-030828 Strong typing
LOCAL oDC AS DataColumn
LOCAL i, iDF, iColumns AS INT
// Link in columns depending on two conditions.
// If we already have columns registered with the browser then assume
// auto layout is not desired.
// If no columns have been registered with the form then we
// assume auto layout is desired.
iColumns := INT(Len(aColumn))
IF (iColumns > 0)
FOR i:=1 UPTO iColumns
oDC := aColumn[i]
iDF := oDS:FieldPos(oDC:NameSym)
IF iDF>0 .AND. IsNil(oDC:Server) // Only one datafield per column
oDC:LinkDF(oDS, iDF) // Exit here, only one column per
lLinked := TRUE
ENDIF
NEXT
ELSE
// We need to do an auto layout for the form
lLinked := .T.
SELF:__AutoLayout()
ENDIF
// Register the form as a client of the Server
IF lLinked
oDS:RegisterClient(SELF)
ENDIF
RETURN lLinked
/// <exclude />
METHOD __SetMaxFTHeight(iLines AS INT) AS VOID STRICT
//PP-030828 Strong typing
IF lColumnTitles
IF iFTHeight < ilines
iFTHeight := ilines
ENDIF
ELSE
iFTHeight := 0
ENDIF
PCALL(gpfnCntFldTtlHtSet, hwnd, iFTHeight)
RETURN
/// <exclude />
METHOD __StatusOK() AS DataColumn STRICT
//PP-030828 Strong typing
//SE-060526
LOCAL oDCInvalidColumn AS DataColumn
LOCAL dwI, dwCount AS DWORD
dwCount := ALen(aColumn)
FOR dwI := 1 UPTO dwCount
oDCInvalidColumn := aColumn[dwI]
IF oDCInvalidColumn:Status != NIL
RETURN oDCInvalidColumn
ENDIF
NEXT //dwI
oDCInvalidColumn:= NULL_OBJECT
RETURN oDCInvalidColumn
/// <exclude />
METHOD __TestForBottom() AS LOGIC STRICT
//PP-030828 Strong typing
LOCAL lRetCode AS LOGIC
LOCAL iRecNo AS INT
IF oDataServer:EOF
RETURN TRUE
ENDIF
iRecNo := oDataServer:RecNo
oDataServer:Skip(1)
lRetCode := oDataServer:EOF
oDataServer:GoTo(iRecNo)
RETURN lRetCode
/// <exclude />
METHOD __TestForTop() AS LOGIC STRICT
//PP-030828 Strong typing
LOCAL lRetCode AS LOGIC
LOCAL iRecNo AS INT
IF oDataServer:Bof
RETURN TRUE
ENDIF
iRecNo := oDataServer:RecNo
oDataServer:Skip(-1)
lRetCode := oDataServer:BOF
oDataServer:GoTo(iRecno)
RETURN lRetCode
/// <exclude />
METHOD __Unlink(oDS := NIL AS USUAL) AS Control STRICT
//PP-030828 Strong typing
ASend(aColumn, #__UnLink, oDataServer)
IF oDataServer != NULL_OBJECT
oDataServer:UnRegisterClient(SELF)
oDataServer := NULL_OBJECT
ENDIF
RETURN SELF
/// <include file="Gui.xml" path="doc/DataBrowser.AddColumn/*" />
METHOD AddColumn(oGColumn, nIndex)
LOCAL i AS INT
LOCAL iLen AS INT
LOCAL dwPosition AS DWORD
LOCAL lRetCode AS LOGIC
SELF:SuspendUpdate()
IF !IsLong(nIndex) .OR. (nIndex == 0) .OR. (nIndex > ALen(aColumn))
dwPosition := 0 // append to tail
ELSE
dwPosition := SELF:__FindColumn(nIndex)
ENDIF
// add array of columns if parameter is array
IF IsArray(oGColumn)
iLen := INT(ALen(oGColumn))
FOR i := 1 UPTO iLen
lRetCode := SELF:__AddColumn(oGColumn[i], INT(dwPosition))
IF !lRetcode
EXIT
ENDIF
// iPosition++
NEXT
ELSE
lRetCode := SELF:__AddColumn(oGColumn, INT(dwPosition))
ENDIF
// if data server connection - refresh columns
IF (oDataServer != NULL_OBJECT)
SELF:__BuildRecordDescription()
SELF:__RefreshBuffer()
ENDIF
SELF:RestoreUpdate()
RETURN lRetCode
/// <include file="Gui.xml" path="doc/DataBrowser.AsString/*" />
METHOD AsString
// Used for ? oDB style syntax
// Dummy value for now
RETURN ResourceString{__WCSDBrowserObject}:value
/// <include file="Gui.xml" path="doc/DataBrowser.Background/*" />
ACCESS Background
RETURN oBackgroundText
/// <include file="Gui.xml" path="doc/DataBrowser.Background/*" />
ASSIGN Background(oBrush)
SELF:ChangeBackground(oBrush, gblText)
RETURN
/// <include file="Gui.xml" path="doc/DataBrowser.CanUndo/*" />
METHOD CanUndo()
IF IsInstanceOf(oCellEdit,#Edit)
RETURN Send(oCellEdit,#CanUndo)
ENDIF
RETURN FALSE
/// <include file="Gui.xml" path="doc/DataBrowser.Caption/*" />
ASSIGN Caption(sCaption)
SELF:SetCaption(sCaption)
RETURN
/// <include file="Gui.xml" path="doc/DataBrowser.CellEdit/*" />
ACCESS CellEdit
// DHer: 18/12/2008
RETURN SELF:oCellEdit
/// <include file="Gui.xml" path="doc/DataBrowser.ChangeBackground/*" />
METHOD ChangeBackground ( oBrush, kWhere )
LOCAL iCntLoc AS DWORD
LOCAL dwNewColor AS DWORD
IF !IsInstanceOfUsual(oBrush,#Brush)
WCError{#ChangeBackground,#DataBrowser,__WCSTypeError,oBrush,1}:Throw()
ENDIF
IF !IsNil(kWhere)
IF !IsLong(kWhere)
WCError{#ChangeBackground,#DataBrowser,__WCSTypeError,kWhere,2}:Throw()
ENDIF
ENDIF
DO CASE
CASE kWhere==gblCaption
iCntLoc := CNTCOLOR_TTLBKGD
oBackgroundCaption := oBrush
IF oBackgroundCaption==NULL_OBJECT
dwNewColor := GetSysColor(COLOR_BTNFACE)
ENDIF
CASE kWhere==gblText
iCntLoc := CNTCOLOR_FLDBKGD
oBackgroundText := oBrush
IF oBackgroundText==NULL_OBJECT
dwnewColor := GetSysColor(COLOR_WINDOW)
ENDIF
CASE kWhere==gblColCaption
iCntLoc := CNTCOLOR_FLDTTLBKGD
oBackgroundColCaption := oBrush
IF oBackgroundColCaption==NULL_OBJECT
dwNewColor := GetSysColor(COLOR_BTNFACE)
ENDIF
CASE kWhere==gblButton
iCntLoc := CNTCOLOR_TTLBTNBKGD
oBackgroundButton := oBrush
IF oBackgroundButton==NULL_OBJECT
dwNewColor := GetSysColor(COLOR_BTNFACE)
ENDIF
CASE kWhere==gblColButton
iCntLoc := CNTCOLOR_FLDBTNBKGD
oBackgroundColButton := oBrush
IF oBackgroundColButton==NULL_OBJECT
dwNewColor := GetSysColor(COLOR_BTNFACE)
ENDIF
CASE kWhere==gblHiText
iCntLoc := CNTCOLOR_HIGHLIGHT
oBackgroundHiText := oBrush
IF oBackgroundHiText==NULL_OBJECT
dwNewColor := GetSysColor(COLOR_HIGHLIGHT)
ENDIF
ENDCASE
IF oBrush != NULL_OBJECT
dwNewColor := __WCGetBrushColor(oBrush)
ENDIF
PCALL(gpfnCntColorSet, hwnd, iCntLoc, dwNewColor)
IF kWhere == gblText
PCALL(gpfnCntColorSet, hwnd, CNTCOLOR_CNTBKGD, dwNewColor)
ENDIF
RETURN SELF
/// <include file="Gui.xml" path="doc/DataBrowser.ChangeFont/*" />
METHOD ChangeFont(oFont, kWhere)
LOCAL iCntLoc AS DWORD
LOCAL oOldFont AS Font
LOCAL hFont AS PTR
IF !IsInstanceOfUsual(oFont,#Font)
WCError{#ChangeFont,#DataBrowser,__WCSTypeError,oFont,1}:Throw()
ENDIF
IF !IsNil(kWhere)
IF !IsLong(kWhere)
WCError{#ChangeFont,#DataBrowser,__WCSTypeError,kWhere,2}:Throw()
ENDIF
ENDIF
SWITCH (INT) kWhere
CASE gblCaption
iCntLoc := CF_TITLE
CASE gblText
iCntLoc := CF_GENERAL
oFontText := oFont
CASE gblColCaption
iCntLoc := CF_FLDTITLE
CASE gblButton
CASE gblColButton
CASE gblHiText
iCntLoc := CF_GENERAL
END SWITCH
hFont := oFont:Handle()
IF (hFont == NULL_PTR)
oOldFont := oParent:Font
oParent:Font := oFont
oParent:SizeText("Hello")
oParent:Font := oOldFont
ELSE
PCALL(gpfnCntFontSet, hwnd, hFont, iCntLoc)
IF (iCntLoc == CF_GENERAL)
oEditFont := oFont
ENDIF
ENDIF
RETURN SELF
/// <include file="Gui.xml" path="doc/DataBrowser.ChangeTextColor/*" />
METHOD ChangeTextColor(oColor, kWhere)
LOCAL iCntLoc AS DWORD
LOCAL ptrColor AS BYTE PTR
LOCAL dwRGB AS DWORD
IF IsNumeric(oColor)
oColor := Color{oColor}
ELSEIF !IsInstanceOfUsual(oColor,#Color)
WCError{#ChangeTextColor,#DataBrowser,__WCSTypeError,oColor,1}:Throw()
ENDIF
IF !IsNil(kWhere)
IF !IsLong(kWhere)
WCError{#ChangeTextColor,#DataBrowser,__WCSTypeError,kWhere,2}:Throw()
ENDIF
ENDIF
iCntLoc := CNTCOLOR_TEXT
DO CASE
CASE kWhere==gblCaption
lUseDefCaption := FALSE
iCntLoc := CNTCOLOR_TITLE
CASE kWhere==gblColCaption
lUseDefColCaption := FALSE
iCntLoc := CNTCOLOR_FLDTITLES
CASE kWhere==gblText
lUseDefText := FALSE
iCntLoc := CNTCOLOR_TEXT
oTextColor := oColor
CASE kWhere==gblButton
lUseDefButton := FALSE
iCntLoc := CNTCOLOR_TTLBTNTXT
CASE kWhere==gblColButton
lUseDefColButton := FALSE
iCntLoc := CNTCOLOR_FLDBTNTXT
CASE kWhere==gblHiText
lUseDefHiText := FALSE
iCntLoc := CNTCOLOR_HITEXT
ENDCASE
dwRGB := PCALL(gpfnCntColorGet, hwnd, iCntLoc)
#ifdef __VULCAN__
ptrColor := (BYTE PTR) @dwRGB
#else
ptrColor := @dwRGB
#endif
PCALL(gpfnCntColorSet, hwnd, iCntLoc, oColor:ColorRef)
RETURN Color{ptrColor[1], ptrColor[3], ptrColor[2]}
/// <include file="Gui.xml" path="doc/DataBrowser.Clear/*" />
METHOD Clear()
IF IsInstanceOf(oCellEdit,#Edit)
Send(oCellEdit,#Clear)
ENDIF
RETURN SELF
/// <include file="Gui.xml" path="doc/DataBrowser.ColPos/*" />
METHOD ColPos()
LOCAL i, iLen AS INT
LOCAL oDC AS DataColumn
oDC := SELF:CurrentColumn
IF oDC==NULL_OBJECT
RETURN 0
ENDIF
iLen := INT(ALen(aColumn))
FOR i:=1 UPTO iLen
IF aColumn[i] == oDC
RETURN i
ENDIF
NEXT
RETURN 0
/// <include file="Gui.xml" path="doc/DataBrowser.ColumnCount/*" />
ACCESS ColumnCount
RETURN ALen(aColumn)
/// <include file="Gui.xml" path="doc/DataBrowser.ColumnFocusChange/*" />
METHOD ColumnFocusChange(oDataColumn, lHasFocus)
LOCAL oHL AS HyperLabel
oHL := oDataColumn:Status
IF (oHL != NULL_OBJECT)
SELF:Owner:StatusMessage(oHL:Description, MESSAGEERROR)
ELSEIF lHasFocus .AND. (oDataColumn:HyperLabel != NULL_OBJECT)
SELF:Owner:StatusMessage(oDataColumn:HyperLabel:Description, MESSAGECONTROL)
ENDIF
RETURN SELF
/// <include file="Gui.xml" path="doc/DataBrowser.ColumnMoved/*" />
METHOD ColumnMoved(oColumn)
SELF:__EndEditField(0)
RETURN SELF
/// <include file="Gui.xml" path="doc/DataBrowser.ColumnReSize/*" />
METHOD ColumnReSize(oColumn)
SELF:__EndEditField(0)
// self:__BuildRecordDescription()
// self:__RefreshBuffer()
RETURN SELF
/// <include file="Gui.xml" path="doc/DataBrowser.Copy/*" />
METHOD Copy()
IF IsInstanceOf(oCellEdit,#Edit)
Send(oCellEdit,#Copy)
ENDIF
RETURN SELF
/// <include file="Gui.xml" path="doc/DataBrowser.CurrentColumn/*" />
ACCESS CurrentColumn
LOCAL strucFI AS _WinFieldInfo
StrucFI := PCALL(gpfnCntFocusFldGet, hwnd)
IF strucFI != NULL_PTR
RETURN SELF:__GetColumn(strucFI)
ENDIF
RETURN NULL_OBJECT
/// <include file="Gui.xml" path="doc/DataBrowser.Cut/*" />
METHOD Cut()
IF IsInstanceOf(oCellEdit,#Edit)
Send(oCellEdit,#Cut)
ENDIF
RETURN SELF
/// <include file="Gui.xml" path="doc/DataBrowser.Default/*" />
METHOD DEFAULT(oEvent)
LOCAL oEvt := oEvent AS @@event
SELF:EventReturnValue := DefWindowProc(oEvt:hWnd, oEvt:uMsg, oEvt:wParam, oEvt:lParam)
RETURN SELF
/// <include file="Gui.xml" path="doc/DataBrowser.Destroy/*" />
METHOD Destroy() AS USUAL CLIPPER
LOCAL i AS DWORD
LOCAL oCol AS DataColumn
SELF:__Unlink()
IF oCellEdit != NULL_OBJECT
oCellEdit:Destroy()
ENDIF
IF IsWindow(hNotifyWindow) .AND. IsWindow(hwnd)
PCALL(gpfnCntAssociateSet, hwnd, NULL_PTR)
DestroyWindow(hNotifyWindow)
ENDIF
__WCSelfPtrFree(ptrSelf)
ptrSelf := NULL_PTR
IF (ptrDataBuffer != NULL_PTR)
MemFree(ptrDataBuffer)
ENDIF
//PP-040418 Issue 12768
//SE-050730
FOR i := 1 TO ALen(aColumn)
oCol := aColumn[i]
oCol:destroy()
NEXT
IF !InCollect()
ptrDataBuffer := NULL_PTR
strucEditField := NULL_PTR
strucEditRecord := NULL_PTR
strucFocusField := NULL_PTR
hNotifyWindow := NULL_PTR
oCellEdit := NULL_OBJECT
ptrControlDefaultProc := NULL_PTR
oDataServer := NULL_OBJECT
oEditFont := NULL_OBJECT
//SE-050730
// //PP-040418 Issue 12768
// FOR i := 1 TO ALen(aColumn)
// aColumn[i]:destroy()
// NEXT
aColumn := NULL_ARRAY
oFontText := NULL_OBJECT
oBackgroundColCaption := NULL_OBJECT
oBackgroundHiText := NULL_OBJECT
oBackgroundText := NULL_OBJECT
oBackgroundCaption := NULL_OBJECT
oBackgroundButton := NULL_OBJECT
oBackgroundColButton := NULL_OBJECT
oTextColor := NULL_OBJECT
oTextPointer := NULL_OBJECT
ENDIF
SUPER:Destroy()
RETURN SELF
/// <include file="Gui.xml" path="doc/DataBrowser.Dispatch/*" />
METHOD Dispatch(oEvent)
//PP-040519 Update from S Ebert
LOCAL oEvt := oEvent AS @@event
LOCAL uMsg AS DWORD
LOCAL lParam AS LONGINT
LOCAL dwCode AS DWORD
LOCAL dwChar AS DWORD
LOCAL iMove AS DWORD
LOCAL wFlag AS WORD
LOCAL oDC AS DataColumn
LOCAL strucRC AS _WinRecordCore
LOCAL strucFI AS _WinFieldInfo
//This method handles the messages of two windows
//1.) CONTAINER_CLASS ("Ca_Container32")
//2.) GBNotifyWindow
uMsg := oEvt:uMsg
SELF:EventReturnValue := 0L
IF oEvt:hWnd = hNotifyWindow
//Dispatcher for GBNotifyWindow
IF uMsg == WM_COMMAND
dwCode := HiWord(oEvt:wParam)
SWITCH dwCode
CASE CN_QUERYFOCUS
SELF:__BuildBuffer()
CASE CN_QUERYDELTA
SELF:__DeltaBuildBuffer()
CASE CN_NEWFOCUS
CASE CN_NEWFOCUSREC
strucRC := PCALL(gpfnCntCNRecGet, hwnd, oEvt:lParam)
strucFI := PCALL(gpfnCntFocusFldGet, hwnd)
// if self:Validate() .and. oDataServer:Notify(NotifyIntentToMove)
SELF:__NewFocusRecord(strucRC, strucFI)
// endif
CASE CN_TAB
IF !PCALL(gpfnCntCNShiftKeyGet, hwnd, lParam)
iMove := CFM_RIGHT
ENDIF
IF IsBiDi()
IF (iMove == CFM_LEFT)
iMove := CFM_RIGHT
ELSE
iMove := CFM_LEFT
ENDIF
ENDIF
IF !PCALL(gpfnCntFocusMove, hwnd, iMove)
IF (iMove == CFM_RIGHT)
PCALL(gpfnCntFocusMove, hwnd, CFM_DOWN)
ELSE
PCALL(gpfnCntFocusMove, hwnd, CFM_UP)
ENDIF
IF (!IsBiDi() .AND. iMove == CFM_RIGHT) .OR. (IsBiDi() .AND. iMove == CFM_LEFT)
PCALL(gpfnCntFocusMove, hwnd, CFM_HOME)
ELSE
PCALL(gpfnCntFocusMove, hwnd, CFM_END)
ENDIF
ENDIF
CASE CN_BEGFLDEDIT
CASE CN_ROFLDDBLCLK
IF IsMethod(SELF, #CellDoubleClick)
Send(SELF, #CellDoubleClick)
ELSEIF !PCALL(gpfnCntIsFocusCellRO, hwnd)
SELF:__BeginEditField(PCALL(gpfnCntCNChildWndGet, hwnd, 0), 0)
ENDIF
CASE CN_CHARHIT
IF !PCALL(gpfnCntIsFocusCellRO, hwnd)
//lParam := oEvt:lParam
//ci := CntInfoGet(hwnd)
//dw := CntCNCharGet(hWnd, lParam)
//self:__BeginEditField(CntCNChildWndGet(hWnd, lParam), dw, lParam)
SELF:__BeginEditField(PCALL(gpfnCntCNChildWndGet, hwnd, lParam), dwLastChar)
ENDIF
CASE CN_ENTER
IF !PCALL(gpfnCntIsFocusCellRO, hwnd)
SELF:__BeginEditField(PCALL(gpfnCntCNChildWndGet, hwnd, lParam), 0)
ENDIF
CASE CN_ENDFLDEDIT
lParam:=oEvt:lParam
dwChar := PCALL(gpfnCntCNCharGet, hwnd, lParam)
SELF:__EndEditField(dwChar)
SWITCH dwChar
CASE KeyTab
IF !PCALL(gpfnCntCNShiftKeyGet, hwnd, lParam)
iMove := CFM_RIGHT
ENDIF
PCALL(gpfnCntFocusMove, hWnd, iMove)
CASE KeyArrowUp
// if self:Validate() .and. oDataServer:Notify(NotifyIntentToMove)
PCALL(gpfnCntFocusMove, hwnd, CFM_UP)
// endif
CASE KeyArrowDown
//if self:Validate() .and. oDataServer:Notify(NotifyIntentToMove)
PCALL(gpfnCntFocusMove, hwnd, CFM_DOWN)
//endif
CASE KeyArrowLeft
PCALL(gpfnCntFocusMove, hwnd, CFM_LEFT)
CASE KeyArrowRight
PCALL(gpfnCntFocusMove, hwnd, CFM_RIGHT)
CASE KeyPageUp
IF SELF:Validate() .AND. oDataServer:Notify(NotifyIntentToMove)
PCALL(gpfnCntFocusMove, hwnd, CFM_PAGEUP)
ENDIF
CASE KeyPageDown
IF SELF:Validate() .AND. oDataServer:Notify(NotifyIntentToMove)
PCALL(gpfnCntFocusMove, hwnd, CFM_PAGEDOWN)
ENDIF
END SWITCH
CASE CN_FLDSIZED
oDC := SELF:__GetColumn(PCALL(gpfnCntCNFldGet, hwnd, lParam))
IF oDC!=NULL_OBJECT
SELF:ColumnReSize(oDC)
ENDIF
CASE CN_FLDMOVED
oDC := SELF:__GetColumn(PCALL(gpfnCntCNFldGet, hwnd, lParam))
IF oDC!=NULL_OBJECT
SELF:ColumnMoved(oDC)
ENDIF
CASE CN_LK_HOME
PCALL(gpfnCntFocusSet, hwnd, PCALL(gpfnCntFocusRecGet, hwnd), NULL_PTR)
CASE CN_LK_END
PCALL(gpfnCntFocusSet, hwnd, PCALL(gpfnCntFocusRecGet, hwnd), PCALL(gpfnCntFldTailGet, hwnd))
CASE CN_LK_PAGEUP
IF SELF:Validate() .AND. oDataServer:Notify(NotifyIntentToMove)
PCALL(gpfnCntFocusRecUnlck, hwnd)
PCALL(gpfnCntFocusMove, hwnd, CFM_PAGEUP)
ENDIF
CASE CN_LK_PAGEDOWN
IF SELF:Validate() .AND. oDataServer:Notify(NotifyIntentToMove)
PCALL(gpfnCntFocusRecUnlck, hwnd)
PCALL(gpfnCntFocusMove, hwnd, CFM_PAGEDOWN)
ENDIF
CASE CN_LK_ARROW_UP
IF SELF:Validate() .AND. oDataServer:Notify(NotifyIntentToMove)
PCALL(gpfnCntFocusRecUnlck, hwnd)
PCALL(gpfnCntFocusMove, hwnd, CFM_UP)
ENDIF
CASE CN_LK_ARROW_DOWN
IF SELF:Validate() .AND. oDataServer:Notify(NotifyIntentToMove)
PCALL(gpfnCntFocusRecUnlck, hwnd)
PCALL(gpfnCntFocusMove, hwnd, CFM_DOWN)
ENDIF
CASE CN_LK_ARROW_LEFT
PCALL(gpfnCntFocusRecUnlck, hwnd)
PCALL(gpfnCntFocusMove, hwnd, CFM_LEFT)
CASE CN_LK_ARROW_RIGHT
PCALL(gpfnCntFocusRecUnlck, hwnd)
PCALL(gpfnCntFocusMove, hwnd, CFM_RIGHT)
CASE CN_LK_VS_TOP
CASE CN_LK_VS_BOTTOM
CASE CN_LK_VS_PAGEUP
CASE CN_LK_VS_PAGEDOWN
CASE CN_LK_VS_LINEUP
CASE CN_LK_VS_LINEDOWN
CASE CN_LK_VS_THUMBPOS
PCALL(gpfnCntScrollRecAreaEx, hwnd, PCALL(gpfnCntCNIncExGet, hwnd, lParam))
CASE CN_LK_HS_PAGEUP
CASE CN_LK_HS_PAGEDOWN
CASE CN_LK_HS_LINEUP
CASE CN_LK_HS_LINEDOWN
CASE CN_LK_HS_THUMBPOS
PCALL(gpfnCntScrollFldArea, hwnd, PCALL(gpfnCntCNIncExGet, hwnd, lParam))
CASE CN_LK_NEWFOCUS
CASE CN_LK_NEWFOCUSREC
strucRC := PCALL(gpfnCntCNRecGet, hwnd, lParam)
strucFI := PCALL(gpfnCntCNFldGet, hwnd, lParam)
IF SELF:Validate() .AND. oDataServer:Notify(NotifyIntentToMove)
PCALL(gpfnCntFocusRecUnlck, hwnd)
SELF:__NewFocusRecord(strucRC, strucFI)
ENDIF
CASE CN_LK_NEWFOCUSFLD
SELF:__EndEditField(0)
PCALL(gpfnCntFocusSet, hwnd, PCALL(gpfnCntCNRecGet, hwnd, lParam), PCALL(gpfnCntCNFldGet, hwnd, lParam))
CASE CN_NEWFOCUSFLD
SELF:__NewFocusField(PCALL(gpfnCntCNFldGet, hwnd, lParam))
END SWITCH
ELSE
SELF:Default(oEvt)
ENDIF
RETURN SELF:EventReturnValue
ENDIF
//Dispatcher for CONTAINER_CLASS ("Ca_Container32")
IF uMsg == WM_PARENTNOTIFY
wFlag := LoWord(oEvt:wParam)
IF (wFlag == WM_LBUTTONDOWN) .OR. (wFlag == WM_RBUTTONDOWN) .OR. (wFlag == WM_MBUTTONDOWN) .OR. ;
wFlag == WM_XBUTTONDOWN
//PP-030904 XButton
SELF:MouseButtonDown(MouseEvent{oEvt:hwnd, wFlag, 0, oEvt:lParam})
ENDIF
ELSEIF uMsg == WM_SIZE
SELF:__EndEditField(0)
ENDIF
RETURN SUPER:Dispatch(oEvt)
/// <include file="Gui.xml" path="doc/DataBrowser.EditFont/*" />
ACCESS EditFont
RETURN oEditFont
/// <include file="Gui.xml" path="doc/DataBrowser.EnableBorder/*" />
METHOD EnableBorder(kBorderType)
IF !IsNil(kBorderType)
IF !IsLong(kBorderType)
WCError{#EnableBorder,#DataBrowser,__WCSTypeError,kBorderType,1}:Throw()
ENDIF
ENDIF
SWITCH (INT) kBorderType
CASE BTSIZINGBORDER
PCALL(gpfnCntStyleSet, hwnd, WS_THICKFRAME)
CASE BTNONSIZINGBORDER
PCALL(gpfnCntStyleClear, hwnd, WS_THICKFRAME)
PCALL(gpfnCntStyleSet, hwnd, WS_BORDER)
CASE BTNOBORDER
PCALL(gpfnCntStyleClear, hwnd, _OR(WS_THICKFRAME,WS_BORDER))
OTHERWISE
PCALL(gpfnCntStyleSet, hwnd, WS_THICKFRAME)
END SWITCH
RETURN NIL
/// <include file="Gui.xml" path="doc/DataBrowser.EnableColumnMove/*" />
METHOD EnableColumnMove(lAllowMove)
DEFAULT(@lAllowMove, TRUE)
IF !IsNil(lAllowMove)
IF !IsLogic(lAllowMove)
WCError{#EnableColumnMove,#DataBrowser,__WCSTypeError,lAllowMove,1}:Throw()
ENDIF
ENDIF
IF lAllowMove
PCALL(gpfnCntAttribSet, hwnd, CA_MOVEABLEFLDS)
ELSE
PCALL(gpfnCntAttribClear, hwnd, CA_MOVEABLEFLDS)
ENDIF
RETURN SELF
/// <include file="Gui.xml" path="doc/DataBrowser.EnableColumnReSize/*" />
METHOD EnableColumnReSize(lAllowResize)
DEFAULT(@lAllowResize, TRUE)
IF !IsNil(lAllowResize)
IF !IsLogic(lAllowResize)
WCError{#EnableColumnReSize,#DataBrowser,__WCSTypeError,lAllowResize,1}:Throw()
ENDIF
ENDIF
IF lAllowResize
PCALL(gpfnCntAttribSet, hwnd, CA_SIZEABLEFLDS)
ELSE
PCALL(gpfnCntAttribClear, hwnd, CA_SIZEABLEFLDS)
ENDIF
RETURN SELF
/// <include file="Gui.xml" path="doc/DataBrowser.EnableColumnTitles/*" />
METHOD EnableColumnTitles(lEnable)
LOCAL iLen, i AS DWORD
LOCAL strucFI AS _WinFieldInfo
LOCAL oColumn AS DataColumn
IF !IsNil(lEnable)
IF !IsLogic(lEnable)
WCError{#EnableColumnTitles,#DataBrowser,__WCSTypeError,lEnable,1}:Throw()
ENDIF
ELSE
lEnable:=TRUE
ENDIF
IF lColumnTitles == lEnable
RETURN FALSE
ENDIF
SELF:SuspendUpdate()
lColumnTitles := lEnable
iFTHeight:=0
IF lEnable
iLen := ALen(aColumn)
FOR i:=1 UPTO iLen
oColumn := aColumn[i]
strucFI:= oColumn:__FieldInfo
IF iFTHeight < INT(strucFI:wFTitleLines)
iFTHeight := INT(strucFI:wFTitleLines)
ENDIF
NEXT
ENDIF
PCALL(gpfnCntFldTtlHtSet, hwnd, iFTHeight)
SELF:RestoreUpdate()
RETURN TRUE
/// <include file="Gui.xml" path="doc/DataBrowser.EnableGrid/*" />
METHOD EnableGrid ( lShowGrid )
IF !IsNil(lShowGrid)
IF !IsLogic(lShowGrid)
WCError{#EnableGrid,#DataBrowser,__WCSTypeError,lShowGrid,1}:Throw()
ENDIF
ELSE
lShowGrid:=TRUE
ENDIF
IF lShowGrid
PCALL(gpfnCntAttribSet, hwnd, _OR(CA_RECSEPARATOR,CA_VERTFLDSEP))
ELSE
PCALL(gpfnCntAttribClear, hwnd, _OR(CA_RECSEPARATOR,CA_VERTFLDSEP))
ENDIF
RETURN SELF
/// <include file="Gui.xml" path="doc/DataBrowser.EnableHorizontalScroll/*" />
METHOD EnableHorizontalScroll ( lAllowScroll )
IF !IsNil(lAllowScroll)
IF !IsLogic(lAllowScroll)
WCError{#EnableHorizontalScroll,#DataBrowser,__WCSTypeError,lAllowScroll,1}:Throw()
ENDIF
ELSE
lAllowScroll:=TRUE
ENDIF
IF !lIsShown
IF lAllowScroll
dwDeferredStyle := _OR(dwDeferredStyle,DWORD(CTS_HORZSCROLL))
ELSE
dwDeferredStyle := _AND(dwDeferredStyle,_NOT(DWORD(CTS_HORZSCROLL)))
ENDIF
ELSE
IF lAllowScroll
PCALL(gpfnCntStyleSet, hwnd, CTS_HORZSCROLL)
ELSE
PCALL(gpfnCntStyleClear, hwnd, CTS_HORZSCROLL)
ENDIF
ENDIF
RETURN SELF
/// <include file="Gui.xml" path="doc/DataBrowser.EnableHorizontalSplit/*" />
METHOD EnableHorizontalSplit ( lShowSplit )
IF !IsNil(lShowSplit)
IF !IsLogic(lShowSplit)
WCError{#EnableHorizontalSplit,#DataBrowser,__WCSTypeError,lShowSplit,1}:Throw()
ENDIF
ELSE
lShowSplit:=TRUE
ENDIF
//Riz This was never implemented
RETURN SELF
/// <include file="Gui.xml" path="doc/DataBrowser.EnableVerticalScroll/*" />
METHOD EnableVerticalScroll ( lAllowScroll )
IF !IsNil(lAllowScroll)
IF !IsLogic(lAllowScroll)
WCError{#EnableVerticalScroll,#DataBrowser,__WCSTypeError,lAllowScroll,1}:Throw()
ENDIF
ELSE
lAllowScroll:=TRUE
ENDIF
IF !lIsShown
IF lAllowScroll
dwDeferredStyle := _OR(dwDeferredStyle,DWORD(CTS_VERTSCROLL))
ELSE
dwDeferredStyle := _AND(dwDeferredStyle,_NOT(DWORD(CTS_VERTSCROLL)))
ENDIF
ELSE
IF lAllowScroll
PCALL(gpfnCntStyleSet, hwnd, CTS_VERTSCROLL)
ELSE
PCALL(gpfnCntStyleClear, hwnd, CTS_VERTSCROLL)
ENDIF
ENDIF
RETURN SELF
/// <include file="Gui.xml" path="doc/DataBrowser.EnableVerticalSplit/*" />
METHOD EnableVerticalSplit(lShowSplit, nMode)
IF !IsNil(lShowSplit)
IF !IsLogic(lShowSplit)
WCError{#EnableVerticalSplit,#DataBrowser,__WCSTypeError,lShowSplit,1}:Throw()
ENDIF
ELSE
lShowSplit := TRUE
ENDIF
IF !IsNil(nMode)
IF !IsLong(nMode)
WCError{#EnableVerticalSplit,#DataBrowser,__WCSTypeError,nMode,2}:Throw()
ENDIF
ELSE
nMode := GBSSBMIDDLE
ENDIF
IF lShowSplit
PCALL(gpfnCntStyleSet, hwnd, CTS_SPLITBAR)
PCALL(gpfnCntSpltBarCreate, hwnd, nMode, 0)
ELSE
PCALL(gpfnCntSpltBarDelete, hwnd, 0, 0)
PCALL(gpfnCntStyleClear, hwnd, CTS_SPLITBAR)
ENDIF
RETURN SELF
/// <include file="Gui.xml" path="doc/DataBrowser.Error/*" />
METHOD Error(oErrorObj)
RETURN SELF
/// <include file="Gui.xml" path="doc/DataBrowser.Font/*" />
ACCESS Font
RETURN oFontText
/// <include file="Gui.xml" path="doc/DataBrowser.Font/*" />
ASSIGN Font(oFont)
SELF:ChangeFont(oFont, gblText)
RETURN
/// <include file="Gui.xml" path="doc/DataBrowser.GetColumn/*" />
METHOD GetColumn(xColumnID)
LOCAL dwPosition AS DWORD
IF !IsLong(xColumnID) .AND. !IsSymbol(xColumnID) .AND. !IsString(xColumnID)
WCError{#GetColumn,#DataBrowser,__WCSTypeError,xColumnID,1}:Throw()
ENDIF
dwPosition := SELF:__FindColumn(xColumnID)
IF dwPosition != 0
RETURN aColumn[dwPosition]
ENDIF
RETURN NULL_OBJECT
/// <include file="Gui.xml" path="doc/DataBrowser.HiBackground/*" />
ACCESS HiBackground
// DHer: 18/12/2008
RETURN SELF:oBackgroundHiText
/// <include file="Gui.xml" path="doc/DataBrowser.ctor/*" />
CONSTRUCTOR(oOwner, xID, oPoint, oDimension)
LOCAL oBB AS BoundingBox
LOCAL oWin AS Window
LOCAL hChild AS PTR
LOCAL oDataWin AS DataWindow
__LoadContainerDLL()
IF !IsInstanceOfUsual(oOwner,#Window)
WCError{#Init,#DataBrowser,__WCSTypeError,oOwner,1}:Throw()
ENDIF
oWin := oOwner
// Automatically generate id if none is supplied
DEFAULT(@xID, 1000)
IF (IsInstanceOfUsual(oOwner, #DataWindow))
oBB := oOwner:CanvasArea
oPoint := Point{0,0}
oDimension := Dimension{obb:Width,obb:Height}
ENDIF
IF IsInstanceOf(oWin, #DataWindow)
oDataWin := (DataWindow) oWin
oWin := oDataWin:__FormWindow
ENDIF
SUPER(oWin, xID, oPoint, oDimension, CONTAINER_CLASS, CTS_SPLITBAR)
iBufferGranularity := INT(_CAST, QueryRTRegInt("Browser", "Granularity"))
IF (iBufferGranularity == 0)
iBufferGranularity := 64
ENDIF
iBufferGranularity := Max(16, iBufferGranularity)
iBufferMaximum := INT(_CAST, QueryRTRegInt("Browser", "Maximum"))
IF (iBufferMaximum == 0)
iBufferMaximum := 1024
ENDIF
iBufferMaximum := Max(2 * iBufferGranularity, iBufferMaximum)
lColumnTitles := TRUE
lUseDefCaption := TRUE
lUseDefColCaption := TRUE
lUseDefText := TRUE
lUseDefButton := TRUE
lUseDefColButton := TRUE
lUseDefHiText := TRUE
aColumn := {}
SELF:SetFocus() // Force Handle to be created
IF __WCRegisterGBNotifyWindow(_GetInst())
//Create ptr to pass for WM_Create and to be used for message processing
ptrSelf := __WCSelfPtrAlloc(SELF)
hNotifyWindow := CreateWindowEx(0, String2Psz(__WCGBNotifyWindowClass), NULL_PSZ, 0,;
CW_USEDEFAULT, 0, CW_USEDEFAULT, 0,;
0, 0, _GetInst(), ptrSelf)
IF (hNotifyWindow != NULL_PTR)
PCALL(gpfnCntAssociateSet, hwnd, hNotifyWindow)
ENDIF
ENDIF
PCALL(gpfnCntViewSet, hwnd, CV_DETAIL)
lUse3dLook := TRUE
// Set up default colors so that they respond to Control Panel
// This appears to affect over all container
PCALL(gpfnCntColorSet, hwnd, CNTCOLOR_CNTBKGD, GetSysColor(COLOR_WINDOW))
PCALL(gpfnCntColorSet, hwnd, CNTCOLOR_FLDBKGD, GetSysColor(COLOR_WINDOW))
PCALL(gpfnCntColorSet, hwnd, CNTCOLOR_TEXT, GetSysColor(COLOR_WINDOWTEXT))
PCALL(gpfnCntColorSet, hwnd, CNTCOLOR_GRID, GetSysColor(COLOR_WINDOWFRAME))
PCALL(gpfnCntColorSet, hwnd, CNTCOLOR_3DHIGH, GetSysColor(COLOR_BTNHIGHLIGHT))
PCALL(gpfnCntColorSet, hwnd, CNTCOLOR_3DSHADOW, GetSysColor(COLOR_BTNSHADOW))
PCALL(gpfnCntColorSet, hwnd, CNTCOLOR_HIGHLIGHT, GetSysColor(COLOR_HIGHLIGHT))
PCALL(gpfnCntColorSet, hwnd, CNTCOLOR_HITEXT, GetSysColor(COLOR_HIGHLIGHTTEXT))
//Set title defaults for 3D appearance
PCALL(gpfnCntColorSet, hwnd, CNTCOLOR_TITLE, GetSysColor(COLOR_BTNTEXT))
PCALL(gpfnCntColorSet, hwnd, CNTCOLOR_FLDTITLES, GetSysColor(COLOR_BTNTEXT))
PCALL(gpfnCntColorSet, hwnd, CNTCOLOR_TTLBKGD, GetSysColor(COLOR_BTNFACE))
PCALL(gpfnCntColorSet, hwnd, CNTCOLOR_FLDTTLBKGD, GetSysColor(COLOR_BTNFACE))
// Colors for buttons
PCALL(gpfnCntColorSet, hwnd, CNTCOLOR_TTLBTNTXT, GetSysColor(COLOR_BTNTEXT))
PCALL(gpfnCntColorSet, hwnd, CNTCOLOR_TTLBTNBKGD, GetSysColor(COLOR_BTNFACE))
PCALL(gpfnCntColorSet, hwnd, CNTCOLOR_FLDBTNTXT, GetSysColor(COLOR_BTNTEXT))
PCALL(gpfnCntColorSet, hwnd, CNTCOLOR_FLDBTNBKGD, GetSysColor(COLOR_BTNFACE))
// Default line spacing - Quarter Line
PCALL(gpfnCntRowHtSet, hwnd, 1, CA_LS_MEDIUM)
// Set default font
PCALL(gpfnCntFontSet, hwnd, GetStockObject(DEFAULT_GUI_FONT), CF_GENERAL)
PCALL(gpfnCntAttribSet, hwnd, CA_APPSPLITABLE)
PCALL(gpfnCntRangeExSet, hwnd, 0, 0)
SELF:__EnableSelection(ssSingleSelection)
SELF:EnableColumnMove()
SELF:EnableColumnReSize()
SELF:EnableGrid()
SELF:EnableHorizontalScroll()
SELF:EnableVerticalScroll()
IF (IsInstanceOfUsual(oOwner, #DataWindow))
SELF:__AutoResize()
ENDIF
hChild := GetWindow(hwnd, GW_CHILD)
pfGBChildProcOrg := PTR(_CAST, GetWindowLong(hChild, GWL_WNDPROC))
#ifdef __VULCAN__
IF WCGBChildProcDelegate == NULL
WCGBChildProcDelegate := __WCGBChildProcDelegate{ NULL, @__WCGBChildProc() }
ENDIF
SetWindowLong(hChild, GWL_WNDPROC, (INT) System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate( (System.Delegate) WCGBChildProcDelegate ) )
#else
SetWindowLong(hChild, GWL_WNDPROC, LONGINT(_CAST, @__WCGBChildProc()))
#endif
RETURN
/// <include file="Gui.xml" path="doc/DataBrowser.NewRow/*" />
METHOD NewRow()
RETURN FALSE
/// <include file="Gui.xml" path="doc/DataBrowser.Notify/*" />
METHOD Notify(kNotification, uDescription)
SWITCH (INT) kNotification
CASE NOTIFYCOMPLETION
SELF:__NotifyChanges(GBNFY_COMPLETION)
nOldRecordNum := oDataServer:Recno
CASE NOTIFYINTENTTOMOVE
RETURN SELF:__NotifyChanges(GBNFY_INTENTTOMOVE)
CASE NOTIFYFILECHANGE
//ASend(aColumn, #__Scatter)
SELF:__ScatterColumns()
SELF:__NotifyChanges(GBNFY_FILECHANGE)
//ASend(aColumn, #__Scatter)
SELF:__ScatterColumns()
nOldRecordNum := oDataServer:Recno
CASE NOTIFYFIELDCHANGE
SELF:__RefreshField(uDescription)
SELF:__NotifyChanges(GBNFY_FIELDCHANGE)
CASE NOTIFYCLOSE
SELF:__Unlink()
CASE NOTIFYRECORDCHANGE
//ASend(aColumn, #__Scatter)
SELF:__ScatterColumns()
IF nOldRecordNum != oDataServer:Recno
SELF:__NotifyChanges(GBNFY_RECORDCHANGE)
//ASend(aColumn, #__Scatter)
SELF:__ScatterColumns()
ELSE
SELF:__NotifyChanges(GBNFY_FIELDCHANGE)
ENDIF
nOldRecordNum := oDataServer:Recno
CASE NOTIFYGOBOTTOM
//ASend(aColumn, #__Scatter)
SELF:__ScatterColumns()
SELF:__NotifyChanges(GBNFY_DOGOEND)
//ASend(aColumn, #__Scatter)
SELF:__ScatterColumns()
nOldRecordNum := oDataServer:Recno
CASE NOTIFYGOTOP
//ASend(aColumn, #__Scatter)
SELF:__ScatterColumns()
SELF:__NotifyChanges(GBNFY_DOGOTOP)
//ASend(aColumn, #__Scatter)
SELF:__ScatterColumns()
nOldRecordNum := oDataServer:Recno
CASE NOTIFYDELETE
//ASend(aColumn, #__Scatter)
SELF:__ScatterColumns()
SELF:__NotifyChanges(GBNFY_DODELETE)
//ASend(aColumn, #__Scatter)
SELF:__ScatterColumns()
nOldRecordNum := oDataServer:Recno
CASE NOTIFYAPPEND
//ASend(aColumn, #__Scatter)
SELF:__ScatterColumns()
SELF:__NotifyChanges(GBNFY_DONEWROW)
//ASend(aColumn, #__Scatter)
SELF:__ScatterColumns()
ASend(aColumn, #PerformValidations)
nOldRecordNum := oDataServer:Recno
END SWITCH
RETURN NIL
/// <include file="Gui.xml" path="doc/DataBrowser.Owner/*" />
ACCESS Owner
//return oParent
IF !IsInstanceOf(oParent, #__FormFrame)
RETURN oParent
ENDIF
RETURN IVarGet(oParent, #DataWindow)
/// <include file="Gui.xml" path="doc/DataBrowser.Paste/*" />
METHOD Paste ( )
IF IsInstanceOf(oCellEdit,#Edit)
Send(oCellEdit,#Paste)
ENDIF
RETURN SELF
/// <include file="Gui.xml" path="doc/DataBrowser.Pointer/*" />
ACCESS Pointer
RETURN oTextPointer
/// <include file="Gui.xml" path="doc/DataBrowser.Pointer/*" />
ASSIGN Pointer(oPointer)
SELF:SetPointer(oPointer, gblText)
RETURN
/// <include file="Gui.xml" path="doc/DataBrowser.Refresh/*" />
METHOD Refresh()
IF oDataServer!=NULL_OBJECT .AND. IsInstanceOf(oDataServer,#DBServer)
oDataServer:Goto(oDataServer:Recno) //Forces refresh if DBF was empty
ENDIF
SELF:__RefreshBuffer()
ASend(aColumn, #__Scatter)
RETURN SELF
/// <include file="Gui.xml" path="doc/DataBrowser.RemoveColumn/*" />
METHOD RemoveColumn(uColumnOrIndex)
LOCAL i AS DWORD
LOCAL oDC AS DataColumn
i := SELF:__FindColumn(uColumnOrIndex)
IF (i != 0)
SELF:SuspendUpdate()
IF oDataServer!=NULL_OBJECT
SELF:__ClearBuffers()
ENDIF
oDC := aColumn[i]
ADel(aColumn, i)
ASize(aColumn, ALen(aColumn)-1)
PCALL(gpfnCntRemoveFld, hwnd, oDC:__FieldInfo)
oDC:__Owner := NULL_OBJECT
// if data server connection - refresh columns
IF oDataServer!=NULL_OBJECT
SELF:__BuildRecordDescription()
SELF:__RefreshBuffer()
ENDIF
SELF:RestoreUpdate()
strucFocusField := PCALL(gpfnCntFocusFldGet, hwnd)
ENDIF
RETURN oDC
/// <include file="Gui.xml" path="doc/DataBrowser.RestoreUpdate/*" />
METHOD RestoreUpdate()
IF iDeferPaintCount!=0
--iDeferPaintCount
ENDIF
IF iDeferPaintCount == 0
PCALL(gpfnCntEndDeferPaint, hwnd, TRUE)
ENDIF
RETURN SELF
/// <include file="Gui.xml" path="doc/DataBrowser.RowCount/*" />
ACCESS RowCount
RETURN PCALL(gpfnCntRecsDispGet, hwnd)
/// <include file="Gui.xml" path="doc/DataBrowser.SetCaption/*" />
METHOD SetCaption(cText)
LOCAL iLines AS INT
IF IsSymbol(cText)
cCaption := Symbol2String(cText)
ELSEIF IsString(cText)
cCaption := cText
ELSEIF !IsNil(cText)
WCError{#SetCaption,#DataBrowser,__WCSTypeError,cText,1}:Throw()
ENDIF
SELF:SuspendUpdate()
IF NULL_STRING != cCaption
PCALL(gpfnCntAttribSet, hwnd, CA_TITLE)
IF lUse3dLook
PCALL(gpfnCntAttribSet, hwnd, CA_TITLE3D)
ENDIF
PCALL(gpfnCntTtlSet, hWnd, String2Psz(cCaption))
iLines := INT(Occurs(Chr(10),cCaption)) + 1
IF iLines == 1
PCALL(gpfnCntTtlAlignSet, hwnd, _OR(CA_TA_HCENTER, CA_TA_VCENTER))
ELSE
PCALL(gpfnCntTtlAlignSet, hwnd, _OR(CA_TA_HCENTER, CA_TA_TOP))
ENDIF
PCALL(gpfnCntTtlHtSet, hwnd, ilines)
PCALL(gpfnCntTtlSepSet, hwnd)
ELSE
PCALL(gpfnCntTtlHtSet, hwnd, 0)
IF NULL_STRING != cCaption
cCaption := NULL_STRING
PCALL(gpfnCntTtlSet, hWnd, String2Psz(cCaption))
ENDIF
PCALL(gpfnCntAttribClear, hwnd, CA_TITLE)
ENDIF
SELF:RestoreUpdate()
RETURN SELF
/// <include file="Gui.xml" path="doc/DataBrowser.SetColumn/*" />
METHOD SetColumn(oDataColumn, nColumnNumber)
LOCAL oDC AS DataColumn
IF !IsInstanceOfUsual(oDataColumn,#DataColumn)
WCError{#SetColumn,#DataBrowser,__WCSTypeError,oDataColumn,1}:Throw()
ENDIF
IF !IsNil(nColumnNumber)
IF !IsLong(nColumnNumber)
WCError{#SetColumn,#DataBrowser,__WCSTypeError,nColumnNumber,2}:Throw()
ENDIF
ENDIF
oDC := SELF:GetColumn(nColumnNumber)
IF oDC!=NULL_OBJECT
SELF:SuspendUpdate()
SELF:RemoveColumn(oDC)
SELF:AddColumn(oDataColumn, nColumnNumber)
SELF:RestoreUpdate()
ENDIF
RETURN oDC
/// <include file="Gui.xml" path="doc/DataBrowser.SetColumnFocus/*" />
METHOD SetColumnFocus(oColumn)
LOCAL oDC AS DataColumn
IF !IsInstanceOfUsual(oColumn,#DataColumn)
WCError{#SetColumnFocus,#DataBrowser,__WCSTypeError,oColumn,1}:Throw()
ENDIF
// Cpc 2010-03-25 strongly typed to workaround bug #852
oDC := oColumn
IF PCALL(gpfnCntFocusSet, hwnd, PCALL(gpfnCntFocusRecGet, hwnd), oDC:__FieldInfo)
SELF:SetFocus()
RETURN TRUE
ENDIF
RETURN FALSE
/// <include file="Gui.xml" path="doc/DataBrowser.SetPointer/*" />
METHOD SetPointer(oPointer, kWhere)
LOCAL iLoc AS DWORD
DEFAULT(@oPointer, Pointer{PointerArrow})
IF !IsInstanceOfUsual(oPointer,#Pointer)
WCError{#SetPointer,#Pointer,__WCSTypeError,oPointer,1}:Throw()
ENDIF
IF !IsNil(kWhere)
IF !IsLong(kWhere)
WCError{#SetPointer,#DataBrowser,__WCSTypeError,kWhere,2}:Throw()
ENDIF
ENDIF
iLoc := CC_GENERAL
DO CASE
CASE (kWhere == GBLCAPTION)
iLoc := CC_TITLE
CASE (kWhere == GBLCOLCAPTION)
iLoc := CC_FLDTITLE
CASE (kWhere == GBLTEXT)
iLoc := CC_GENERAL
oTextPointer := oPointer
ENDCASE
PCALL(gpfnCntCursorSet, hwnd, oPointer:Handle(), iLoc)
RETURN NIL
/// <include file="Gui.xml" path="doc/DataBrowser.SetStandardStyle/*" />
METHOD SetStandardStyle(kStyle)
IF !IsNil(kStyle)
IF !IsLong(kStyle)
WCError{#SetStandardStyle,#DataBrowser,__WCSTypeError,kStyle,1}:Throw()
ENDIF
ENDIF
SELF:SuspendUpdate()
IF IsNil(kStyle)
PCALL(gpfnCntStyleClear, hwnd, CTS_READONLY)
kStyle:=gbsControl3d
ENDIF
SWITCH (INT) kStyle
CASE GBSREADONLY
PCALL(gpfnCntStyleSet, hwnd, CTS_READONLY)
CASE GBSEDIT
PCALL(gpfnCntStyleClear, hwnd, CTS_READONLY)
CASE GBSCONTROL3D
PCALL(gpfnCntAttribSet, hwnd, CA_TITLE3D)
PCALL(gpfnCntAttribSet, hwnd, CA_FLDTTL3D)
lUse3dLook := TRUE
IF lUseDefCaption
PCALL(gpfnCntColorSet, hwnd, CNTCOLOR_TITLE, GetSysColor(COLOR_BTNTEXT))
ENDIF
IF lUseDefColCaption
PCALL(gpfnCntColorSet, hwnd, CNTCOLOR_FLDTITLES, GetSysColor(COLOR_BTNTEXT))
ENDIF
IF (oBackgroundCaption == NULL_OBJECT)
PCALL(gpfnCntColorSet, hwnd, CNTCOLOR_TTLBKGD, GetSysColor(COLOR_BTNFACE))
ENDIF
IF (oBackgroundColCaption == NULL_OBJECT)
PCALL(gpfnCntColorSet, hwnd, CNTCOLOR_FLDTTLBKGD, GetSysColor(COLOR_BTNFACE))
ENDIF
CASE GBSCONTROL2D
PCALL(gpfnCntAttribClear, hwnd, CA_TITLE3D)
PCALL(gpfnCntAttribClear, hwnd, CA_FLDTTL3D)
lUse3dLook := FALSE
IF lUseDefCaption
PCALL(gpfnCntColorSet, hwnd, CNTCOLOR_TITLE, GetSysColor(COLOR_CAPTIONTEXT))
ENDIF
IF lUseDefColCaption
PCALL(gpfnCntColorSet, hwnd, CNTCOLOR_FLDTITLES, GetSysColor(COLOR_CAPTIONTEXT))
ENDIF
IF oBackgroundCaption == NULL_OBJECT
PCALL(gpfnCntColorSet, hwnd, CNTCOLOR_TTLBKGD, GetSysColor(COLOR_ACTIVECAPTION))
ENDIF
IF oBackgroundColCaption == NULL_OBJECT
PCALL(gpfnCntColorSet, hwnd, CNTCOLOR_FLDTTLBKGD, GetSysColor(COLOR_ACTIVECAPTION))
ENDIF
END SWITCH
SELF:RestoreUpdate()
RETURN SELF
/// <include file="Gui.xml" path="doc/DataBrowser.Show/*" />
METHOD Show()
IF dwDeferredStyle != 0
PCALL(gpfnCntStyleSet, hwnd, dwDeferredStyle)
dwDeferredStyle := 0
ENDIF
IF oDataServer != NULL_OBJECT
IF !lIsShown
SELF:__BuildBuffer()
ENDIF
ENDIF
lIsShown := TRUE
SUPER:Show()
SELF:SetFocus()
RETURN SELF
/// <include file="Gui.xml" path="doc/DataBrowser.SuspendUpdate/*" />
METHOD SuspendUpdate()
IF iDeferPaintCount == 0
PCALL(gpfnCntDeferPaint, hwnd)
ENDIF
iDeferPaintCount := iDeferPaintCount + 1
RETURN NIL
/// <include file="Gui.xml" path="doc/DataBrowser.TextColor/*" />
ACCESS TextColor
RETURN oTextColor
/// <include file="Gui.xml" path="doc/DataBrowser.TextColor/*" />
ASSIGN TextColor(oColor)
SELF:ChangeTextColor(oColor, gblText)
RETURN
/// <include file="Gui.xml" path="doc/DataBrowser.Undo/*" />
METHOD Undo()
IF IsInstanceOf(oCellEdit,#Edit)
Send(oCellEdit,#Undo)
ENDIF
RETURN SELF
/// <include file="Gui.xml" path="doc/DataBrowser.Use/*" />
METHOD Use(oServer)
IF !IsNil(oServer)
IF !IsInstanceOfUsual(oServer,#DataServer)
WCError{#Use,#DataBrowser,__WCSTypeError,oServer,1}:Throw()
ENDIF
IF oDataServer != oServer
IF oDataServer != NULL_OBJECT
SELF:__Unlink()
ENDIF
oDataServer := oServer
SELF:__RegisterFieldLinks(oServer)
ASend(aColumn, #__Scatter)
IF lLinked
SELF:SuspendUpdate()
SELF:__ClearBuffers()
SELF:__BuildRecordDescription()
IF lIsShown
SELF:__BuildBuffer()
ENDIF
SELF:__NewFocusField(PCALL(gpfnCntFldHeadGet, hwnd))
SELF:RestoreUpdate()
nOldRecordNum := oServer:Recno
ENDIF
ENDIF
ELSE
SELF:__Unlink()
ENDIF
RETURN lLinked
/// <include file="Gui.xml" path="doc/DataBrowser.Validate/*" />
METHOD Validate()
IF IsInstanceOf(SELF:Owner, #DataWindow)
RETURN Send(SELF:Owner, #__CheckRecordStatus)
ENDIF
/*
IF IsInstanceOf(oParent, #__FormFrame)
oWindow:=oParent:Owner
if IsInstanceOfUsual(oWindow, #DataWindow)
return Send(oWindow,#__CheckRecordStatus)
endif
endif
*/
RETURN FALSE
// DataColumn
END CLASS
/// <include file="Gui.xml" path="doc/DataColumn/*" />
CLASS DataColumn INHERIT VObject
PROTECT strucFI AS _WinFieldInfo
PROTECT strucSelf AS SelfPtr
PROTECT iTtlBkgdLoc AS INT
PROTECT iTxtBkgdLoc AS INT
PROTECT iBtnBkgdLoc AS INT
PROTECT iTtlClrLoc AS INT
PROTECT iTxtClrLoc AS INT
PROTECT iBtnClrLoc AS INT
PROTECT iHorzAlignment AS INT
PROTECT iFontLoc AS INT
PROTECT iDataField AS INT
PROTECT lModified AS LOGIC
PROTECT lDefaultWidth AS LOGIC
PROTECT lUsingDrawProc AS LOGIC
PROTECT lBaseServer AS LOGIC
PROTECT lExplicitFS AS LOGIC
PROTECT lExplicitHL AS LOGIC
PROTECT lChanged AS LOGIC
PROTECT cPicture AS STRING
PROTECT cCaption AS STRING
PROTECT cTextValue AS STRING
PROTECT symUserDrawMethod AS SYMBOL
PROTECT symDataField AS SYMBOL
PROTECT oTtlBkgdBrsh AS Brush
PROTECT oTxtBkgdBrsh AS Brush
PROTECT oBtnBkgdBrsh AS Brush
PROTECT oTtlClr AS Color
PROTECT oTxtClr AS Color
PROTECT oBtnClr AS Color
PROTECT oFont AS Font
PROTECT oParent AS DataBrowser
PROTECT oFieldSpec AS FieldSpec
PROTECT oDataField AS DataField
PROTECT oCellTextColor AS Color
PROTECT oCellBackground AS Brush
PROTECT oServer AS DataServer
PROTECT oHyperLabel AS HyperLabel
PROTECT oHlStatus AS HyperLabel
PROTECT cbGetSetBlock AS USUAL
PROTECT uGetSetOwner AS USUAL
PROTECT uValue AS USUAL
#ifdef __VULCAN__
HIDDEN DrawFldDataDelegate AS __DrawFldDataDelegate
#endif
//PP-030828 Strong typing
/// <exclude />
ACCESS __BtnBkgdBrsh AS Brush STRICT
//PP-030828 Strong typing
RETURN oBtnBkgdBrsh
/// <exclude />
ACCESS __BtnBkgdLoc AS INT STRICT
//PP-030828 Strong typing
RETURN iBtnBkgdLoc
/// <exclude />
ACCESS __BtnClr AS Color STRICT
//PP-030828 Strong typing
RETURN oBtnClr
/// <exclude />
ACCESS __BtnClrLoc AS INT STRICT
//PP-030828 Strong typing
RETURN iBtnClrLoc
/// <exclude />
ACCESS __DataField AS DataField STRICT
//PP-030828 Strong typing
RETURN oDataField
/// <exclude />
METHOD __DrawCellData(hDC AS PTR, iX AS INT, iY AS INT, dwOptions AS DWORD, ptrRect AS PTR, ;
pszData AS PSZ, dwLength AS DWORD) AS VOID STRICT
LOCAL uValue AS USUAL
LOCAL hBackgroundBrush AS PTR
LOCAL ptrLogBrush IS _WINLOGBRUSH
LOCAL dwOldCellTextColor, dwOldCellBackground AS DWORD
LOCAL lRestoreTextColor, lRestoreBackground AS LOGIC
IF (oFieldSpec != NULL_OBJECT)
uValue := oFieldSpec:Val(pszData)
ELSE
uValue := Send(oServer:FieldSpec(SELF:NameSym), #Val, Psz2String(pszData))
ENDIF
IF (symUserDrawMethod != NULL_SYMBOL)
Send(SELF, symUserDrawMethod, uValue)
ELSE
SELF:DrawCellData(uValue)
ENDIF
IF (oCellTextColor != NULL_OBJECT)
dwOldCellTextColor := SetTextColor(hDC, oCellTextColor:ColorRef)
lRestoreTextColor := TRUE
ENDIF
IF (oCellBackground != NULL_OBJECT)
hBackgroundBrush := oCellBackground:Handle()
GetObject(hBackgroundBrush, _SIZEOF(_WINLOGBRUSH), @ptrLogBrush)
dwOldCellBackground := SetBkColor(hDC, ptrLogBrush:lbColor)
lRestoreBackground := TRUE
IF (hBackgroundBrush != NULL_PTR)
FillRect(hDC, ptrRect, hBackgroundBrush)
ENDIF
ENDIF
ExtTextOut(hDC, iX, iY, dwOptions, ptrRect, pszData, dwLength, NULL_PTR)
IF lRestoreTextColor
SetTextColor(hDC, dwOldCellTextColor)
ENDIF
IF lRestoreBackground
SetBkColor(hDC, dwOldCellBackground)
ENDIF
oCellTextColor := NULL_OBJECT
oCellBackground := NULL_OBJECT
RETURN
/// <exclude />
ACCESS __FieldInfo AS _WINFieldInfo STRICT
//PP-030828 Strong typing
RETURN strucFI
/// <exclude />
ACCESS __Font AS Font STRICT
//PP-030828 Strong typing
RETURN oFont
/// <exclude />
ACCESS __FontLoc AS INT STRICT
//PP-030828 Strong typing
RETURN iFontLoc
/// <exclude />
METHOD __Gather() AS DataColumn STRICT
//PP-030828 Strong typing
LOCAL oHL AS HyperLabel
LOCAL oWin AS window
SELF:__Update()
IF lChanged
IF (oServer != NULL_OBJECT)
IF lBaseServer // if not subclassing
oServer:FIELDPUT(iDataField,SELF:Value) //use FieldPut
ELSEIF symDataField!=NULL_SYMBOL
IVarPut(oServer, symDataField ,SELF:Value)
ELSE
IVarPut(oServer, SELF:NameSym ,SELF:Value)
ENDIF
oHL := oServer:Status
IF (oHL != NULL_OBJECT) .AND. (oParent != NULL_OBJECT)
oWin := oParent:Owner
IF IsInstanceOf(oWin,#AppWindow)
oWin:StatusMessage((ResourceString{__WCSError2}:value)+oHL:Description,MESSAGEERROR)
ENDIF
ENDIF
ELSEIF !IsNil(cbGetSetBlock) .AND. IsCodeBlock(cbGetSetBlock)
Eval(cbGetSetBlock, uGetSetOwner, SELF:Value)
ENDIF
ENDIF
RETURN SELF
/// <exclude />
ACCESS __HorzAlignment AS INT STRICT
//PP-030828 Strong typing
RETURN iHorzAlignment
/// <exclude />
ACCESS __Offset AS DWORD STRICT
//PP-030828 Strong typing
RETURN strucFI:wOffStruct
/// <exclude />
ASSIGN __Owner(oDB AS DataBrowser) STRICT
//PP-030828 Strong typing
IF oDB!=NULL_OBJECT
IF oParent==NULL_OBJECT
oParent:=oDB
ENDIF
ELSE
oParent:=NULL_OBJECT
ENDIF
RETURN
/// <exclude />
ACCESS __Picture AS STRING STRICT
//PP-030828 Strong typing
RETURN cPicture
/// <exclude />
METHOD __Scatter() AS VOID STRICT
//PP-030828 Strong typing
IF IsInstanceOf(oServer, #DataServer)
IF lBaseServer // if not subclassing
SELF:Value := oServer:FIELDGET(symDataField) //use fieldget
ELSEIF symDataField != NULL_SYMBOL
SELF:Value:=IVarGet(oServer, symDataField)
ELSE
SELF:Value:=IVarGet(oServer, SELF:NameSym)
ENDIF
ELSEIF !IsNil(cbGetSetBlock) .AND. IsCodeBlock(cbGetSetBlock)
SELF:Value := Eval(cbGetSetBlock, uGetSetOwner)
ENDIF
RETURN
/// <exclude />
METHOD __SetFldColor(oDataBrowser AS DataBrowser, iLoc AS INT, dwClr AS DWORD) AS VOID STRICT
//PP-030828 Strong typing
IF oDataBrowser!=NULL_OBJECT // set color for specified Browse Control
PCALL(gpfnCntFldColorSet, oDataBrowser:Handle(), strucFI, DWORD(iLoc), dwClr)
ELSEIF oParent!=NULL_OBJECT // set color for Browser
PCALL(gpfnCntFldColorSet, oParent:Handle(), strucFI, DWORD(iLoc), dwClr)
ENDIF
RETURN
/// <exclude />
ACCESS __Size AS DWORD STRICT
//PP-030828 Strong typing
RETURN strucFI:wDataBytes
/*assign __Size(dw) class DataColumn
return dwSize:=dw */
/// <exclude />
ACCESS __TtlBkgdBrsh AS Brush STRICT
//PP-030828 Strong typing
RETURN oTtlBkgdBrsh
/// <exclude />
ACCESS __TtlBkgdLoc AS INT STRICT
//PP-030828 Strong typing
RETURN iTtlBkgdLoc
/// <exclude />
ACCESS __TtlClr AS Color STRICT
//PP-030828 Strong typing
RETURN oTtlClr
/// <exclude />
ACCESS __TtlClrLoc AS INT STRICT
//PP-030828 Strong typing
RETURN iTtlClrLoc
/// <exclude />
ACCESS __TxtBkgdBrsh AS Brush STRICT
//PP-030828 Strong typing
RETURN oTxtBkgdBrsh
/// <exclude />
ACCESS __TxtBkgdLoc AS INT STRICT
//PP-030828 Strong typing
RETURN iTxtBkgdLoc
/// <exclude />
ACCESS __TxtClr AS Color STRICT
//PP-030828 Strong typing
RETURN oTxtClr
/// <exclude />
ACCESS __TxtClrLoc AS INT STRICT
//PP-030828 Strong typing
RETURN iTxtClrLoc
/// <exclude />
ACCESS __Type AS DWORD STRICT
//PP-030828 Strong typing
RETURN strucFI:wColType
/*assign __Type(dw) class DataColumn
return dwType:=dw */
/// <exclude />
METHOD __UnLink(oDS := NIL AS USUAL) AS VOID STRICT
//PP-030828 Strong typing
// Do actual unlinking
IF IsNil(oDS)
uGetSetOwner := NIL
cbGetSetBlock := NIL
oDataField:= NULL_OBJECT
oServer:= NULL_OBJECT
ELSE
IF (oDS == oServer)
oDataField:= NULL_OBJECT
oServer:= NULL_OBJECT
ENDIF
ENDIF
RETURN
/// <exclude />
METHOD __Update() AS VOID STRICT
// force update to container
LOCAL cText AS STRING
LOCAL uOldValue AS USUAL
IF lModified
cText := SELF:TextValue
uOldValue := uValue
IF (oFieldSpec != NULL_OBJECT)
uValue := oFieldSpec:Val(cText)
SELF:TextValue := oFieldSpec:Transform(uValue)
ELSE
uValue := cText
ENDIF
SELF:Modified := FALSE
IF !(uOldValue == uValue) // dont change to !=, might be STRING !!!
SELF:lChanged := TRUE
ENDIF
ENDIF
RETURN
/// <include file="Gui.xml" path="doc/DataColumn.Alignment/*" />
ACCESS Alignment
RETURN strucFI:flFDataAlign
/// <include file="Gui.xml" path="doc/DataColumn.Alignment/*" />
ASSIGN Alignment (nNewAlign)
LOCAL iAlign AS INT
IF !IsLong(nNewAlign)
WCError{#Alignment,#DataColumn,__WCSTypeError,nNewAlign,1}:Throw()
ENDIF
iAlign := nNewAlign
DO CASE
CASE iAlign==gbaAlignCenter
iHorzAlignment := CA_TA_HCENTER
CASE iAlign==gbaAlignLeft
iHorzAlignment := CA_TA_LEFT
CASE iAlign==gbaAlignRight
iHorzAlignment := CA_TA_RIGHT
ENDCASE
IF oParent!=NULL_OBJECT
PCALL(gpfnCntFldDataAlnSet, oParent:Handle(), strucFI, DWORD(iHorzAlignment))
ENDIF
RETURN
/// <include file="Gui.xml" path="doc/DataColumn.AsString/*" />
METHOD AsString(uParam)
LOCAL cString AS STRING
LOCAL uVal2Print AS USUAL
LOCAL lHasPic AS LOGIC
//RvdH 060608 optimized
//lHasPic := (oFieldSpec != NULL_OBJECT) .and. !Empty(oFieldSpec:Picture)
lHasPic := (oFieldSpec != NULL_OBJECT) .AND. SLen(oFieldSpec:Picture) > 0
IF IsNil(uParam)
uVal2Print := uValue
ELSE
uVal2Print := uParam
ENDIF
IF IsNil(uVal2Print)
RETURN NULL_STRING
ENDIF
IF lHasPic
cString := oFieldSpec:Transform(uVal2Print)
ELSEIF (oFieldSpec != NULL_OBJECT) .AND. (oFieldSpec:ValType == "N")
cString := Str(uVal2Print, oFieldSpec:Length, oFieldSpec:Decimals)
ELSE
cString := _AsString(uVal2Print)
ENDIF
RETURN cString
/// <include file="Gui.xml" path="doc/DataColumn.Background/*" />
ACCESS Background
RETURN oTxtBkgdBrsh
/// <include file="Gui.xml" path="doc/DataColumn.Background/*" />
ASSIGN Background(oBrush)
SELF:ChangeBackground(oBrush, gblText)
RETURN
/// <include file="Gui.xml" path="doc/DataColumn.Block/*" />
ACCESS Block
RETURN cbGetSetBlock
/// <include file="Gui.xml" path="doc/DataColumn.Block/*" />
ASSIGN Block(aCb)
IF !Empty(aCB) .AND. IsCodeBlock(aCB)
cbGetSetBlock := aCb
// reset data server connection
oDataField:= NULL_OBJECT
oServer:= NULL_OBJECT
iDataField := 0
ELSE
cbGetSetBlock := NULL_CODEBLOCK
ENDIF
RETURN
/// <include file="Gui.xml" path="doc/DataColumn.BlockOwner/*" />
ACCESS BlockOwner
RETURN uGetSetOwner
/// <include file="Gui.xml" path="doc/DataColumn.BlockOwner/*" />
ASSIGN BlockOwner(xOwner)
IF !IsNil(xOwner)
uGetSetOwner := xOwner
ELSE
uGetSetOwner := NIL
ENDIF
RETURN
/// <include file="Gui.xml" path="doc/DataColumn.Caption/*" />
ACCESS Caption
RETURN cCaption
/// <include file="Gui.xml" path="doc/DataColumn.Caption/*" />
ASSIGN Caption(cNewCaption)
IF IsSymbol(cNewCaption)
SELF:SetCaption(Symbol2String(cNewCaption))
ELSEIF IsString(cNewCaption)
SELF:SetCaption(cNewCaption)
ELSE
SELF:SetCaption()
ENDIF
RETURN
/// <include file="Gui.xml" path="doc/DataColumn.CellBackground/*" />
ACCESS CellBackground
RETURN oCellBackground
/// <include file="Gui.xml" path="doc/DataColumn.CellBackground/*" />
ASSIGN CellBackground(oBrush)
RETURN oCellBackground := oBrush
/// <include file="Gui.xml" path="doc/DataColumn.CellTextColor/*" />
ACCESS CellTextColor
RETURN oCellTextColor
/// <include file="Gui.xml" path="doc/DataColumn.CellTextColor/*" />
ASSIGN CellTextColor(oColor)
RETURN oCellTextColor := oColor
/// <include file="Gui.xml" path="doc/DataColumn.ChangeBackground/*" />
METHOD ChangeBackground(oBrush, kWhere)
LOCAL oOldBrush AS Brush
LOCAL iLoc AS INT
IF !IsInstanceOfUsual(oBrush,#Brush)
WCError{#ChangeBackground,#DataColumn,__WCSTypeError,oBrush,1}:Throw()
ENDIF
IF !IsNil(kWhere)
IF !IsLong(kWhere)
WCError{#ChangeBackground,#DataColumn,__WCSTypeError,kWhere,1}:Throw()
ENDIF
ENDIF
DO CASE
CASE kWhere==gblCaption .OR.;
kWhere==gblColCaption
oOldBrush := oTtlBkgdBrsh
oTtlBkgdBrsh := oBrush
iTtlBkgdLoc := iLoc := CNTCOLOR_FLDTTLBKGD
CASE kWhere==gblText
oOldBrush := oTxtBkgdBrsh
oTxtBkgdBrsh := oBrush
iTxtBkgdLoc := iLoc := CNTCOLOR_FLDBKGD
CASE kWhere==gblButton .OR.;
kWhere==gblColButton
oOldBrush := oBtnBkgdBrsh
oBtnBkgdBrsh := oBrush
iBtnBkgdLoc := iLoc := CNTCOLOR_FLDBTNBKGD
ENDCASE
SELF:__SetFldColor(NULL_OBJECT, iLoc, __WCGetBrushColor(oBrush))
RETURN oOldBrush
/// <include file="Gui.xml" path="doc/DataColumn.ChangeTextColor/*" />
METHOD ChangeTextColor(oColor, kWhere)
LOCAL oOldColor AS Color
LOCAL iLoc AS INT
LOCAL oNewColor AS color
IF IsNumeric(oColor)
oNewColor := Color{oColor}
ELSEIF IsInstanceOfUsual(oColor,#Color)
oNewColor := oColor
ELSE
WCError{#ChangeTextColor,#DataColumn,__WCSTypeError,oColor,1}:Throw()
ENDIF
IF !IsNil(kWhere)
IF !IsLong(kWhere)
WCError{#ChangeTextColor,#DataColumn,__WCSTypeError,kWhere,2}:Throw()
ENDIF
ENDIF
DO CASE
CASE kWhere==gblCaption .OR.;
kWhere==gblColCaption
oOldColor := oTtlClr
oTtlClr := oNewColor
iTtlClrLoc := iLoc := CNTCOLOR_FLDTITLES
CASE kWhere==gblText
oOldColor := oTxtClr
oTxtClr := oNewColor
iTxtClrLoc := iLoc := CNTCOLOR_TEXT
CASE kWhere==gblButton .OR.;
kWhere==gblColButton
oOldColor := oBtnClr
oBtnClr := oNewColor
iBtnClrLoc := iLoc := CNTCOLOR_FLDBTNTXT
ENDCASE
SELF:__SetFldColor(NULL_OBJECT, iLoc, oNewColor:ColorRef)
RETURN oOldColor
/// <include file="Gui.xml" path="doc/DataColumn.ClearStatus/*" />
METHOD ClearStatus()
// DHer: 18/12/2008
SELF:oHlStatus := NULL_OBJECT
RETURN NIL
/// <include file="Gui.xml" path="doc/DataColumn.DataField/*" />
ACCESS DataField
// DHer: 18/12/2008
RETURN SELF:symDataField
/// <include file="Gui.xml" path="doc/DataColumn.Destroy/*" />
METHOD Destroy() AS USUAL CLIPPER
__WcSelfPtrFree(strucSelf)
IF !InCollect()
strucSelf := NULL_PTR
UnregisterAxit(SELF)
cPicture := NULL_STRING
cCaption := NULL_STRING
strucFI := NULL_PTR
oTtlBkgdBrsh := NULL_OBJECT
oTxtBkgdBrsh := NULL_OBJECT
oBtnBkgdBrsh := NULL_OBJECT
oTtlClr := NULL_OBJECT
oTxtClr := NULL_OBJECT
oBtnClr := NULL_OBJECT
oFont := NULL_OBJECT
ENDIF
SUPER:Destroy()
RETURN SELF
/// <include file="Gui.xml" path="doc/DataColumn.DisableCellDraw/*" />
METHOD DisableCellDraw()
PCALL(gpfnCntFldAttrClear, strucFI, CFA_OWNERDRAW)
lUsingDrawProc:=FALSE
RETURN SELF
/// <include file="Gui.xml" path="doc/DataColumn.DrawCellData/*" />
METHOD DrawCellData(uValue)
RETURN SELF
/// <include file="Gui.xml" path="doc/DataColumn.EnableCellDraw/*" />
METHOD EnableCellDraw(symMethodName)
IF !IsNil(symMethodName)
IF !IsSymbol(symMethodName)
WCError{#EnableCellDraw,#DataColumn,__WCSTypeError,symMethodName,1}:Throw()
ENDIF
symUserDrawMethod := symMethodName
ELSE
symUserDrawMethod := NULL_SYMBOL
ENDIF
IF !lUsingDrawProc
lUsingDrawProc := TRUE
PCALL(gpfnCntFldAttrSet, strucFI, CFA_OWNERDRAW)
#ifdef __VULCAN__
IF DrawFldDataDelegate == NULL
DrawFldDataDelegate := __DrawFldDataDelegate{ NULL, @__DrawFldData() }
ENDIF
PCALL(gpfnCntFldDrwProcSet, strucFI, System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate( (System.Delegate) DrawFldDataDelegate ) )
#else
PCALL(gpfnCntFldDrwProcSet, strucFI, @__DrawFldData())
#endif
ENDIF
IF (oParent != NULL_OBJECT)
oParent:Refresh()
ENDIF
RETURN SELF
/// <include file="Gui.xml" path="doc/DataColumn.EnableColumnMove/*" />
METHOD EnableColumnMove(lAllowMove)
DEFAULT(@lAllowMove, TRUE)
IF !IsLogic(lAllowMove)
WCError{#EnableColumnMove,#DataColumn,__WCSTypeError,lAllowMove,1}:Throw()
ENDIF
IF lAllowMove
PCALL(gpfnCntFldAttrClear, strucFI, CFA_NONMOVEABLEFLD)
PCALL(gpfnCntFldAttrSet, strucFI, CFA_MOVEABLEFLD)
ELSE
PCALL(gpfnCntFldAttrClear, strucFI, CFA_MOVEABLEFLD)
PCALL(gpfnCntFldAttrSet, strucFI, CFA_NONMOVEABLEFLD)
ENDIF
RETURN SELF
/// <include file="Gui.xml" path="doc/DataColumn.EnableColumnReSize/*" />
METHOD EnableColumnReSize(lAllowResize)
DEFAULT(@lAllowResize, TRUE)
IF !IsLogic(lAllowResize)
WCError{#EnableColumnReSize,#DataColumn,__WCSTypeError,lAllowResize,1}:Throw()
ENDIF
IF lAllowResize
PCALL(gpfnCntFldAttrClear, strucFI, CFA_NONSIZEABLEFLD)
PCALL(gpfnCntFldAttrSet, strucFI, CFA_SIZEABLEFLD)
ELSE
PCALL(gpfnCntFldAttrClear, strucFI, CFA_SIZEABLEFLD)
PCALL(gpfnCntFldAttrSet, strucFI, CFA_NONSIZEABLEFLD)
ENDIF
RETURN SELF
/// <include file="Gui.xml" path="doc/DataColumn.FieldSpec/*" />
ACCESS FieldSpec
RETURN oFieldSpec
/// <include file="Gui.xml" path="doc/DataColumn.FieldSpec/*" />
ASSIGN FieldSpec(oFS)
IF !IsInstanceOfUsual(oFS,#FieldSpec)
WCError{#FieldSpec,#DataColumn,__WCSTypeError,oFS,1}:Throw()
ENDIF
oFieldSpec := oFS
lExplicitFS := TRUE
cPicture := oFieldSpec:Picture
// nType := oFieldSpec:UsualType
// DO CASE
// CASE nType == FLOAT
// iPictureType := PICTYPE_NUMERIC
// CASE nType == DATE
// cPicture := "@D"
// iPictureType := PICTYPE_DATE
// ENDCASE
IF oFieldSpec:ValType == "N"
IF SubStr(cPicture, 1, 2) == "@B"
SELF:Alignment := GBAALIGNLEFT
ELSE
SELF:Alignment := GBAALIGNRIGHT
ENDIF
ENDIF
// We need to update the column if is visible and
// connected to the server
IF oServer!=NULL_OBJECT .AND. oDataField!=NULL_OBJECT .OR. !IsNil(cbGetSetBlock)
SELF:__Scatter()
ENDIF
RETURN
/// <include file="Gui.xml" path="doc/DataColumn.GetCaption/*" />
METHOD GetCaption()
RETURN cCaption
/// <include file="Gui.xml" path="doc/DataColumn.GetEditObject/*" />
METHOD GetEditObject(oOwner, iID, oPoint, oDim)
LOCAL oControl AS TextControl
oControl := SingleLineEdit{oOwner, iID, oPoint, oDim, ES_AUTOHSCROLL}
IF (oFieldSpec != NULL_OBJECT)
oControl:FieldSpec := oFieldSpec
ENDIF
IVarPut(oControl, #Overwrite, OVERWRITE_ONKEY)
oControl:SetExStyle(WS_EX_CLIENTEDGE, FALSE)
oControl:Font(oOwner:EditFont, FALSE)
oControl:TextValue := RTrim(SELF:TextValue)
//SendMessage(oControl:Handle(), EM_SETSEL, 0, -1)
RETURN oControl
/// <include file="Gui.xml" path="doc/DataColumn.GetModified/*" />
METHOD GetModified()
RETURN lModified
/// <include file="Gui.xml" path="doc/DataColumn.GetValue/*" />
METHOD GetValue()
RETURN cTextValue
/// <include file="Gui.xml" path="doc/DataColumn.HyperLabel/*" />
ACCESS HyperLabel
RETURN oHyperLabel
/// <include file="Gui.xml" path="doc/DataColumn.HyperLabel/*" />
ASSIGN HyperLabel(oNewHL)
IF IsInstanceOfUsual(oNewHL, #HyperLabel)
oHyperLabel := oNewHL
lExplicitHL := TRUE
SELF:Caption := oNewHL:Caption
ELSEIF IsString(oNewHL)
oHyperLabel := HyperLabel{String2Symbol(oNewHL)}
lExplicitHL := TRUE
SELF:Caption := oNewHL:Caption
ELSEIF IsSymbol(oNewHL)
oHyperLabel := HyperLabel{oNewHL}
lExplicitHL := TRUE
SELF:Caption := oNewHL:Caption
ELSEIF IsNil(oNewHL)
oHyperLabel := NULL_OBJECT
lExplicitHL := FALSE
// Should we reset the caption ??
ELSE
WCError{#HyperLabel,#DataColumn,__WCSTypeError,oNewHL,1}:Throw()
ENDIF
RETURN
/// <include file="Gui.xml" path="doc/DataColumn.ctor/*" />
CONSTRUCTOR(nWidth, xColumnID)
LOCAL p AS SelfPtr
LOCAL iSize AS INT
IF IsNil(nWidth)
iSize := 16
ELSEIF IsInstanceOfUsual(nWidth, #FieldSpec)
iSize := __GetFSDefaultLength(nWidth)
SELF:FieldSpec := nWidth
ELSEIF !IsLong(nWidth)
WCError{#Init,#DataColumn,__WCSTypeError,nWidth,1}:Throw()
ELSE
iSize := nWidth
ENDIF
SUPER()
strucFI := PCALL(gpfnCntNewFldInfo) // Alloc a new field struct
cTextValue := "N/A"
IF IsInstanceOfUsual(xColumnID, #HyperLabel)
SELF:HyperLabel := xColumnID
ELSEIF IsString(xColumnID)
SELF:HyperLabel := HyperLabel{String2Symbol(xColumnID),xColumnID}
ELSEIF IsSymbol(xColumnID)
SELF:HyperLabel := HyperLabel{xColumnID,Symbol2String(xColumnID)}
ENDIF
p := __WCSelfPtrAlloc(SELF)
#ifdef __VULCAN__
// the following line is correct, since CntFldUserSet copies 4 bytes
// from @p into its own buffer
PCallNative<LOGIC>(gpfnCntFldUserSet, strucFI, @p, 4)
#else
// the following line is correct, since CntFldUserSet copies 4 bytes
// from @p into its own buffer
PCALL(gpfnCntFldUserSet, strucFI, @p, 4)
#endif
StrucSelf := p
strucFI:wFTitleLines := 1 // nbr of lines in field title
strucFI:flFTitleAlign := _OR(CA_TA_HCENTER, CA_TA_VCENTER)
// Set up default width
lDefaultWidth := TRUE
IF iSize != -1
strucFI:cxWidth := DWORD(iSize + 2)
ELSE
strucFI:cxWidth := 0xFFFFFFFF
ENDIF
strucFI:flFDataAlign := _OR(CA_TA_LEFT, CA_TA_VCENTER)
strucFI:wColType := CFT_STRING
strucFI:wOffStruct := 2
strucFI:wDataBytes := DWORD(iSize + 1)
// variables for ChangeBackground
iTtlBkgdLoc := -1
iTxtBkgdLoc := -1
iBtnBkgdLoc := -1
// variables for ChangeTextColor
iTtlClrLoc := -1
iTxtClrLoc := -1
iBtnClrLoc := -1
// variables for ChangeFont
iFontLoc := -1
RETURN
/// <include file="Gui.xml" path="doc/DataColumn.LinkDF/*" />
METHOD LinkDF(oDataServer, nFieldData)
LOCAL tmpDF AS OBJECT
LOCAL symClassName AS SYMBOL
IF !IsInstanceOfUsual(oDataServer,#DataServer)
WCError{#LinkDF,#DataColumn,__WCSTypeError,oDataServer,1}:Throw()
ENDIF
IF !IsNil(oServer) .AND. oDataServer!=oServer
SELF:__Unlink()
ENDIF
oServer := oDataServer
iDataField := nFieldData
symDataField := oServer:FieldSym(iDataField)
IF IsMethod(oServer, #IsBaseField)
lBaseServer := Send(oServer, #IsBaseField, symDataField)
ELSE
symClassName := ClassName(oServer)
lBaseServer := symClassName==#DBServer .OR. symClassName==#SQLSelect .OR. symClassName==#SQLTable .OR. symClassName==#JDataServer
ENDIF
// Propogate data field if no explicit one
tmpDF:=oServer:DataField(iDataField)
IF IsInstanceOfUsual(tmpDF, #DataField)
oDataField := tmpDF
IF !lExplicitFS
// propogate field spec if no explicit one
oFieldSpec := oDataField:FieldSpec
// propogate field spec
IF !lExplicitHL
// CHECK IF NameSym and hyperlabel are same
IF !IsNil(oDataField:HyperLabel) .AND. (oDataField:NameSym == oDataField:HyperLabel:NameSym)
oHyperLabel := oDataField:HyperLabel
ELSE
IF cCaption==NULL_STRING
oHyperLabel := HyperLabel {oDataField:NameSym}
ELSE
oHyperLabel := HyperLabel {oDataField:NameSym,cCaption}
ENDIF
ENDIF
ENDIF
ENDIF
ENDIF
uGetSetOwner:= NIL
cbGetSetBlock:= NIL
// Get initial value
SELF:__Scatter()
RETURN NIL
/// <include file="Gui.xml" path="doc/DataColumn.Modified/*" />
ACCESS Modified
RETURN lModified
/// <include file="Gui.xml" path="doc/DataColumn.Modified/*" />
ASSIGN Modified(lChangedFlag)
IF IsLogic(lChangedFlag)
lModified := lChangedFlag
ENDIF
RETURN
/// <include file="Gui.xml" path="doc/DataColumn.Name/*" />
ACCESS Name
IF oHyperLabel!=NULL_OBJECT
RETURN oHyperLabel:Name
ENDIF
RETURN NULL_STRING
/// <include file="Gui.xml" path="doc/DataColumn.NameSym/*" />
ACCESS NameSym
IF oHyperLabel!=NULL_OBJECT
RETURN oHyperLabel:NameSym
ENDIF
RETURN NULL_SYMBOL
/// <include file="Gui.xml" path="doc/DataColumn.Owner/*" />
ACCESS Owner
RETURN oParent
/// <include file="Gui.xml" path="doc/DataColumn.PerformValidations/*" />
METHOD PerformValidations()
// Perform validations for DataColumn against supplied parameter
// if it has a data spec, otherwise just return TRUE
IF (oFieldSpec != NULL_OBJECT)
IF !oFieldSpec:PerformValidations(uValue,SELF)
oHLStatus := oFieldSpec:Status
RETURN FALSE
ENDIF
ENDIF
oHLStatus:= NULL_OBJECT
RETURN TRUE
/// <include file="Gui.xml" path="doc/DataColumn.PixelWidth/*" />
ACCESS PixelWidth
// DHer: 18/12/2008
RETURN SELF:strucFI:cxPxlWidth
/// <include file="Gui.xml" path="doc/DataColumn.Server/*" />
ACCESS Server
RETURN oServer
/// <include file="Gui.xml" path="doc/DataColumn.SetCaption/*" />
METHOD SetCaption(cText, kAlignment)
LOCAL iAlign AS INT
LOCAL iLines AS INT
LOCAL i AS INT
LOCAL iMaxWidth AS INT
LOCAL cTemp AS STRING
IF !IsNil(cText)
IF !IsString(cText)
WCError{#SetCaption,#DataColumn,__WCSTypeError,cText,1}:Throw()
ENDIF
ENDIF
IF !IsNil(kAlignment)
IF !IsLong(kAlignment)
WCError{#SetCaption,#DataColumn,__WCSTypeError,kAlignment,2}:Throw()
ENDIF
ELSE
kAlignment:=gbaAlignCenter
ENDIF
SWITCH (INT) kAlignment
CASE GBAALIGNCENTER
iAlign := CA_TA_HCENTER
CASE GBAALIGNLEFT
iAlign := CA_TA_LEFT
CASE GBAALIGNRIGHT
iAlign := CA_TA_RIGHT
END SWITCH
// calculate width based on caption
IF (NULL_STRING != cText)
iLines := INT(Occurs(_CHR(10), cText)) + 1
IF (iLines > 1) //If multiple lines
cTemp := cText //Find the longest line
DO WHILE TRUE
i := INT(_CAST, At(_CHR(10), cTemp))
IF (i > 0)
iMaxWidth := Max(i-1, iMaxWidth)
cTemp := SubStr(cTemp, i+1)
ELSE
iMaxWidth := Max(SLen(cTemp), iMaxWidth)
EXIT
ENDIF
ENDDO
ELSE
iMaxWidth := INT(_CAST, SLen(cText))
ENDIF
strucFI:wFTitleLines := DWORD(iLines)
IF (oParent != NULL_OBJECT)
oParent:__SetMaxFTHeight(iLines)
ENDIF
// multi line titles are vertically aligned on the Top of the control by default
IF (ilines > 1)
strucFI:flFTitleAlign := _OR(iAlign,CA_TA_TOP)
ELSE
strucFI:flFTitleAlign := _OR(iAlign,CA_TA_VCENTER)
ENDIF
cCaption := cText
IF (oParent != NULL_OBJECT)
PCALL(gpfnCntFldTtlSet, oParent:Handle(), strucFI, String2Psz(cCaption), SLen(cCaption)+1)
ENDIF
// default width if necessary
IF lDefaultWidth .AND. (INT(_CAST, strucFI:cxWidth) < (iMaxWidth + 2))
strucFI:cxWidth := DWORD(iMaxWidth + 2)
ENDIF
ELSE
cCaption := NULL_STRING
strucFI:wFTitleLines := 0
ENDIF
RETURN SELF
/// <include file="Gui.xml" path="doc/DataColumn.SetModified/*" />
METHOD SetModified(lModified)
IF !IsLogic(lModified)
WCError{#SetModified,#DataColumn,__WCSTypeError,lModified,1}:Throw()
ENDIF
SELF:lModified:=lModified
RETURN SELF
/// <include file="Gui.xml" path="doc/DataColumn.SetStandardStyle/*" />
METHOD SetStandardStyle(kStyle)
IF !IsLong(kStyle)
WCError{#SetStandardStyle,#DataColumn,__WCSTypeError,kStyle,1}:Throw()
ENDIF
DO CASE
CASE (kStyle == GBSREADONLY)
PCALL(gpfnCntFldAttrSet, strucFI, CFA_FLDREADONLY)
CASE (kStyle == GBSEDIT)
PCALL(gpfnCntFldAttrClear, strucFI, CFA_FLDREADONLY)
CASE (kStyle == GBSCONTROL3D)
PCALL(gpfnCntFldAttrSet, strucFI, CFA_FLDTTL3D)
CASE (kStyle == GBSCONTROL2D)
PCALL(gpfnCntFldAttrClear, strucFI, CA_FLDTTL3D)
ENDCASE
RETURN SELF
/// <include file="Gui.xml" path="doc/DataColumn.SetValue/*" />
METHOD SetValue(cNewValue)
IF !IsString(cNewValue)
WCError{#SetValue,#DataColumn,__WCSTypeError,cNewValue,1}:Throw()
ENDIF
IF !(cNewValue == cTextValue)
//cTextValue := cNewValue
SELF:TextValue := cNewValue
SELF:Modified := TRUE
SELF:__Update()
ENDIF
IF SELF:ValueChanged
IF !SELF:PerformValidations()
oHLStatus := SELF:Status
oParent:__FieldChange()
ELSE
SELF:__Gather()
ENDIF
ENDIF
RETURN cTextValue
/// <include file="Gui.xml" path="doc/DataColumn.Status/*" />
ACCESS Status
RETURN oHLStatus
/// <include file="Gui.xml" path="doc/DataColumn.TextColor/*" />
ACCESS TextColor
RETURN oTxtClr
/// <include file="Gui.xml" path="doc/DataColumn.TextColor/*" />
ASSIGN TextColor(oColor)
SELF:ChangeTextColor(oColor, gblText)
RETURN
/// <include file="Gui.xml" path="doc/DataColumn.TextValue/*" />
ACCESS TextValue
RETURN cTextValue
/// <include file="Gui.xml" path="doc/DataColumn.TextValue/*" />
ASSIGN TextValue(sNewText)
IF !IsString(sNewText)
WCError{#TextValue,#DataColumn,__WCSTypeError,sNewText,1}:Throw()
ENDIF
cTextValue := sNewText
IF (oFieldSpec != NULL_OBJECT)
uValue := oFieldSpec:Val(cTextValue)
ELSE
uValue := cTextValue
ENDIF
RETURN
/// <include file="Gui.xml" path="doc/DataColumn.Value/*" />
ACCESS Value
RETURN uValue
/// <include file="Gui.xml" path="doc/DataColumn.Value/*" />
ASSIGN Value(uParm)
LOCAL cTemp AS STRING
IF IsNil(uParm)
uValue:= NIL
SELF:TextValue := NULL_STRING
oHlStatus := NULL_OBJECT
SELF:Modified := FALSE
SELF:lChanged := TRUE
ELSE
IF (oFieldSpec != NULL_OBJECT)
cTemp := oFieldSpec:Transform(uParm)
ELSE
cTemp := AsString(uParm)
ENDIF
uValue := uParm
SELF:TextValue := cTemp
oHLStatus := NULL_OBJECT
SELF:Modified := FALSE
SELF:lChanged := TRUE
ENDIF
RETURN
/// <include file="Gui.xml" path="doc/DataColumn.ValueChanged/*" />
ACCESS ValueChanged
RETURN lChanged
/// <include file="Gui.xml" path="doc/DataColumn.ValueChanged/*" />
ASSIGN ValueChanged(lNewFlag)
IF !IsLogic(lNewFlag)
WCError{#ValueChanged,#DataColumn,__WCSTypeError,lNewFlag,1}:Throw()
ENDIF
RETURN lChanged := lNewFlag
/// <include file="Gui.xml" path="doc/DataColumn.VisualPos/*" />
ACCESS VisualPos
LOCAL iCount AS INT
LOCAL strucFieldInfo AS _WinFieldInfo
LOCAL p AS SelfPtr
IF (oParent == NULL_OBJECT)
RETURN 0
ENDIF
strucFieldInfo := PCALL(gpfnCntFldHeadGet, oParent:Handle())
DO WHILE strucFieldInfo != NULL_PTR
iCount++
// Note lpUserData contains a pointer to a buffer of 4 bytes with the self pointer!
p := strucFieldInfo:lpUserData
p := p:ptrSelf
IF __WCSelfPtr2Object(p) == SELF
RETURN iCount
ENDIF
strucFieldInfo := strucFieldInfo:lpNext
ENDDO
RETURN 0
/// <include file="Gui.xml" path="doc/DataColumn.Width/*" />
ACCESS Width
RETURN strucFI:cxWidth
/// <include file="Gui.xml" path="doc/DataColumn.Width/*" />
ASSIGN Width(nNewWidth)
IF !IsLong(nNewWidth)
WCError{#Width,#DataColumn,__WCSTypeError,nNewWidth,1}:Throw()
ENDIF
StrucFI:cxWidth := nNewWidth
lDefaultWidth := FALSE
IF (oParent != NULL_OBJECT)
PCALL(gpfnCntFldWidthSet, oParent:Handle(), strucFI, nNewWidth)
ENDIF
//if (oParent != NULL_OBJECT)
// oParent:__BuildRecordDescription()
//endif
RETURN
END CLASS
STATIC GLOBAL glContainerDllLoaded := FALSE AS LOGIC
STATIC GLOBAL ghContainerDLL AS PTR
//function declarations
STATIC GLOBAL gpfnCntAddFldTail AS TCntAddFldTail PTR
STATIC GLOBAL gpfnCntAddRecHead AS TCntAddRecHead PTR
STATIC GLOBAL gpfnCntAddRecTail AS TCntAddRecTail PTR
STATIC GLOBAL gpfnCntAssociateSet AS TCntAssociateSet PTR
STATIC GLOBAL gpfnCntAttribClear AS TCntAttribClear PTR
STATIC GLOBAL gpfnCntAttribSet AS TCntAttribSet PTR
STATIC GLOBAL gpfnCntCNCharGet AS TCntCNCharGet PTR
STATIC GLOBAL gpfnCntCNChildWndGet AS TCntCNChildWndGet PTR
STATIC GLOBAL gpfnCntCNFldGet AS TCntCNFldGet PTR
STATIC GLOBAL gpfnCntCNIncExGet AS TCntCNIncExGet PTR
STATIC GLOBAL gpfnCntCNRecGet AS TCntCNRecGet PTR
STATIC GLOBAL gpfnCntCNShiftKeyGet AS TCntCNShiftKeyGet PTR
STATIC GLOBAL gpfnCntColorGet AS TCntColorGet PTR
STATIC GLOBAL gpfnCntColorSet AS TCntColorSet PTR
STATIC GLOBAL gpfnCntCurrentPosExGet AS TCntCurrentPosExGet PTR
STATIC GLOBAL gpfnCntCurrentPosExSet AS TCntCurrentPosExSet PTR
STATIC GLOBAL gpfnCntCursorSet AS TCntCursorSet PTR
STATIC GLOBAL gpfnCntDeferPaint AS TCntDeferPaint PTR
STATIC GLOBAL gpfnCntDeltaExSet AS TCntDeltaExSet PTR
STATIC GLOBAL gpfnCntDeltaPosExGet AS TCntDeltaPosExGet PTR
STATIC GLOBAL gpfnCntDeltaPosExSet AS TCntDeltaPosExSet PTR
STATIC GLOBAL gpfnCntEndDeferPaint AS TCntEndDeferPaint PTR
STATIC GLOBAL gpfnCntEndRecEdit AS TCntEndRecEdit PTR
STATIC GLOBAL gpfnCntFldAttrClear AS TCntFldAttrClear PTR
STATIC GLOBAL gpfnCntFldAttrSet AS TCntFldAttrSet PTR
STATIC GLOBAL gpfnCntFldColorSet AS TCntFldColorSet PTR
STATIC GLOBAL gpfnCntFldDataAlnSet AS TCntFldDataAlnSet PTR
STATIC GLOBAL gpfnCntFldDrwProcSet AS TCntFldDrwProcSet PTR
STATIC GLOBAL gpfnCntFldHeadGet AS TCntFldHeadGet PTR
STATIC GLOBAL gpfnCntFldTailGet AS TCntFldTailGet PTR
STATIC GLOBAL gpfnCntFldTtlHtSet AS TCntFldTtlHtSet PTR
STATIC GLOBAL gpfnCntFldTtlSepSet AS TCntFldTtlSepSet PTR
STATIC GLOBAL gpfnCntFldTtlSet AS TCntFldTtlSet PTR
STATIC GLOBAL gpfnCntFldUserSet AS TCntFldUserSet PTR
STATIC GLOBAL gpfnCntFldWidthSet AS TCntFldWidthSet PTR
STATIC GLOBAL gpfnCntFocusExtGet AS TCntFocusExtGet PTR
STATIC GLOBAL gpfnCntFocusFldGet AS TCntFocusFldGet PTR
STATIC GLOBAL gpfnCntFocusFldLock AS TCntFocusFldLock PTR
STATIC GLOBAL gpfnCntFocusFldUnlck AS TCntFocusFldUnlck PTR
STATIC GLOBAL gpfnCntFocusMove AS TCntFocusMove PTR
STATIC GLOBAL gpfnCntFocusOrgGet AS TCntFocusOrgGet PTR
STATIC GLOBAL gpfnCntFocusRecGet AS TCntFocusRecGet PTR
STATIC GLOBAL gpfnCntFocusRecLock AS TCntFocusRecLock PTR
STATIC GLOBAL gpfnCntFocusRecUnlck AS TCntFocusRecUnlck PTR
STATIC GLOBAL gpfnCntFocusSet AS TCntFocusSet PTR
STATIC GLOBAL gpfnCntFontSet AS TCntFontSet PTR
STATIC GLOBAL gpfnCntFreeRecCore AS TCntFreeRecCore PTR
STATIC GLOBAL gpfnCntInsFldBefore AS TCntInsFldBefore PTR
STATIC GLOBAL gpfnCntIsFocusCellRO AS TCntIsFocusCellRO PTR
STATIC GLOBAL gpfnCntIsRecSelected AS TCntIsRecSelected PTR
STATIC GLOBAL gpfnCntKillRecList AS TCntKillRecList PTR
STATIC GLOBAL gpfnCntNewFldInfo AS TCntNewFldInfo PTR
STATIC GLOBAL gpfnCntNewRecCore AS TCntNewRecCore PTR
STATIC GLOBAL gpfnCntNextRec AS TCntNextRec PTR
STATIC GLOBAL gpfnCntNotifyAssoc AS TCntNotifyAssoc PTR
STATIC GLOBAL gpfnCntRangeExSet AS TCntRangeExSet PTR
STATIC GLOBAL gpfnCntRecAttrClear AS TCntRecAttrClear PTR
STATIC GLOBAL gpfnCntRecAttrSet AS TCntRecAttrSet PTR
STATIC GLOBAL gpfnCntRecDataSet AS TCntRecDataSet PTR
STATIC GLOBAL gpfnCntRecHeadGet AS TCntRecHeadGet PTR
STATIC GLOBAL gpfnCntRecsDispGet AS TCntRecsDispGet PTR
STATIC GLOBAL gpfnCntRecTailGet AS TCntRecTailGet PTR
STATIC GLOBAL gpfnCntRecUserSet AS TCntRecUserSet PTR
STATIC GLOBAL gpfnCntRemoveFld AS TCntRemoveFld PTR
STATIC GLOBAL gpfnCntRemoveRecHead AS TCntRemoveRecHead PTR
STATIC GLOBAL gpfnCntRemoveRecTail AS TCntRemoveRecTail PTR
STATIC GLOBAL gpfnCntRowHtSet AS TCntRowHtSet PTR
STATIC GLOBAL gpfnCntScrollFldArea AS TCntScrollFldArea PTR
STATIC GLOBAL gpfnCntScrollRecAreaEx AS TCntScrollRecAreaEx PTR
STATIC GLOBAL gpfnCntSelectRec AS TCntSelectRec PTR
STATIC GLOBAL gpfnCntSelRecGet AS TCntSelRecGet PTR
STATIC GLOBAL gpfnCntSpltBarCreate AS TCntSpltBarCreate PTR
STATIC GLOBAL gpfnCntSpltBarDelete AS TCntSpltBarDelete PTR
STATIC GLOBAL gpfnCntStyleClear AS TCntStyleClear PTR
STATIC GLOBAL gpfnCntStyleSet AS TCntStyleSet PTR
STATIC GLOBAL gpfnCntTopRecGet AS TCntTopRecGet PTR
STATIC GLOBAL gpfnCntTopRecSet AS TCntTopRecSet PTR
STATIC GLOBAL gpfnCntTtlAlignSet AS TCntTtlAlignSet PTR
STATIC GLOBAL gpfnCntTtlHtSet AS TCntTtlHtSet PTR
STATIC GLOBAL gpfnCntTtlSepSet AS TCntTtlSepSet PTR
STATIC GLOBAL gpfnCntTtlSet AS TCntTtlSet PTR
STATIC GLOBAL gpfnCntUnSelectRec AS TCntUnSelectRec PTR
STATIC GLOBAL gpfnCntViewSet AS TCntViewSet PTR
STATIC GLOBAL gpfnCntVScrollPosExSet AS TCntVScrollPosExSet PTR
STATIC GLOBAL pfGBChildProcOrg AS PTR
STATIC FUNCTION TCntAddFldHead(hCntWnd AS PTR, lpFld AS _winFIELDINFO) AS LOGIC STRICT
//SYSTEM
RETURN FALSE
STATIC FUNCTION TCntAddFldTail(hCntWnd AS PTR, lpFld AS _winFIELDINFO) AS LOGIC STRICT
//SYSTEM
RETURN FALSE
STATIC FUNCTION TCntAddRecHead(hCntWnd AS PTR, lpNew AS _winRECORDCORE) AS LOGIC STRICT
//SYSTEM
RETURN FALSE
STATIC FUNCTION TCntAddRecTail(hCntWnd AS PTR, lpNew AS _winRECORDCORE) AS LOGIC STRICT
//SYSTEM
RETURN FALSE
STATIC FUNCTION TCntAssociateSet(hWnd AS PTR, hWndAssociate AS PTR) AS PTR STRICT
//SYSTEM
RETURN NULL_PTR
STATIC FUNCTION TCntAttribClear(hWnd AS PTR, dwAttrib AS DWORD) AS VOID STRICT
RETURN
STATIC FUNCTION TCntAttribSet(hWnd AS PTR, dwAttrib AS DWORD) AS VOID STRICT
RETURN
STATIC FUNCTION TCntCNCharGet(hCntWnd AS PTR, lParam AS LONGINT) AS DWORD STRICT
//SYSTEM
RETURN 0
STATIC FUNCTION TCntCNChildWndGet(hCntWnd AS PTR, lParam AS LONGINT) AS PTR STRICT
//SYSTEM
RETURN NULL_PTR
STATIC FUNCTION TCntCNFldGet(hCntWnd AS PTR, lParam AS LONGINT) AS _winFIELDINFO STRICT
//SYSTEM
RETURN NULL_PTR //PP-040410
STATIC FUNCTION TCntCNIncExGet(hCntWnd AS PTR, lParam AS LONGINT) AS LONGINT STRICT
//SYSTEM
RETURN 0
STATIC FUNCTION TCntCNRecGet(hCntWnd AS PTR, lParam AS LONGINT) AS _winRECORDCORE STRICT
//SYSTEM
RETURN NULL_PTR //PP-040410
STATIC FUNCTION TCntCNShiftKeyGet(hCntWnd AS PTR, lParam AS LONGINT) AS LOGIC STRICT
//SYSTEM
RETURN FALSE
STATIC FUNCTION TCntColorGet(hWnd AS PTR, iColor AS DWORD) AS DWORD STRICT
//SYSTEM
RETURN 0
STATIC FUNCTION TCntColorSet(hWnd AS PTR, iColor AS DWORD, cr AS DWORD) AS DWORD STRICT
//SYSTEM
RETURN 0
STATIC FUNCTION TCntCurrentPosExGet(hWnd AS PTR) AS LONGINT STRICT
//SYSTEM
RETURN 0
STATIC FUNCTION TCntCurrentPosExSet(hWnd AS PTR, lPos AS LONGINT) AS LONGINT STRICT
//SYSTEM
RETURN 0
STATIC FUNCTION TCntCursorSet(hWnd AS PTR, hCursor AS PTR, iArea AS DWORD) AS LOGIC STRICT
//SYSTEM
RETURN FALSE
STATIC FUNCTION TCntDeferPaint(hWnd AS PTR) AS VOID STRICT
RETURN
STATIC FUNCTION TCntDeltaExSet(hCntWnd AS PTR, lDelta AS LONGINT) AS VOID STRICT
RETURN
STATIC FUNCTION TCntDeltaPosExGet(hCntWnd AS PTR) AS LONGINT STRICT
//SYSTEM
RETURN 0
STATIC FUNCTION TCntDeltaPosExSet(hCntWnd AS PTR, lDeltaPos AS LONGINT) AS VOID STRICT
RETURN
STATIC FUNCTION TCntEndDeferPaint(hWnd AS PTR, bUpdate AS LOGIC) AS VOID STRICT
RETURN
STATIC FUNCTION TCntEndRecEdit(hCntWnd AS PTR, lpRec AS _winRECORDCORE, lpFld AS _winFIELDINFO) AS LOGIC STRICT
//SYSTEM
RETURN FALSE
STATIC FUNCTION TCntFldAttrClear(lpFld AS _winFIELDINFO, dwAttrib AS DWORD) AS VOID STRICT
RETURN
STATIC FUNCTION TCntFldAttrSet(lpFld AS _winFIELDINFO, dwAttrib AS DWORD) AS VOID STRICT
RETURN
STATIC FUNCTION TCntFldColorSet(hWnd AS PTR, lpFld AS _winFIELDINFO, iColor AS DWORD, cr AS DWORD) AS DWORD STRICT
//SYSTEM
RETURN 0
STATIC FUNCTION TCntFldDataAlnSet(hWnd AS PTR, lpFld AS _winFIELDINFO, dwAlign AS DWORD) AS VOID STRICT
RETURN
STATIC FUNCTION TCntFldDrwProcSet(lpFld AS _winFIELDINFO, lpfnDrawProc AS PTR) AS LOGIC STRICT
//SYSTEM
RETURN FALSE
STATIC FUNCTION TCntFldHeadGet(hCntWnd AS PTR) AS _winFIELDINFO STRICT
//SYSTEM
RETURN NULL_PTR //PP-040410
STATIC FUNCTION TCntFldTailGet(hCntWnd AS PTR) AS _winFIELDINFO STRICT
//SYSTEM
RETURN NULL_PTR //PP-040410
STATIC FUNCTION TCntFldTtlHtSet(hCntWnd AS PTR, nHeight AS INT) AS INT STRICT
//SYSTEM
RETURN 0
STATIC FUNCTION TCntFldTtlSepSet(hWnd AS PTR) AS VOID STRICT
RETURN
STATIC FUNCTION TCntFldTtlSet(hWnd AS PTR, lpFld AS _winFIELDINFO, lpszColTitle AS PSZ, wTitleLen AS DWORD) AS LOGIC STRICT
//SYSTEM
RETURN FALSE
STATIC FUNCTION TCntFldUserGet(lpFld AS _winFIELDINFO) AS PTR STRICT
//SYSTEM
RETURN NULL_PTR
STATIC FUNCTION TCntFldUserSet(lpFld AS _winFIELDINFO, lpUserData AS PTR, wUserBytes AS DWORD) AS LOGIC STRICT
//SYSTEM
RETURN FALSE
STATIC FUNCTION TCntFldWidthSet(hCntWnd AS PTR, lpFld AS _winFIELDINFO, nWidth AS DWORD) AS SHORTINT STRICT
//SYSTEM
RETURN 0
STATIC FUNCTION TCntFocusExtGet(hCntWnd AS PTR) AS DWORD STRICT
//SYSTEM
RETURN 0
STATIC FUNCTION TCntFocusFldGet(hCntWnd AS PTR) AS _winFIELDINFO STRICT
//SYSTEM
RETURN NULL_PTR //PP-040410
STATIC FUNCTION TCntFocusFldLock(hCntWnd AS PTR) AS INT STRICT
//SYSTEM
RETURN 0
STATIC FUNCTION TCntFocusFldUnlck(hCntWnd AS PTR) AS INT STRICT
//SYSTEM
RETURN 0
STATIC FUNCTION TCntFocusMove(hCntWnd AS PTR, wDir AS DWORD) AS LOGIC STRICT
//SYSTEM
RETURN FALSE
STATIC FUNCTION TCntFocusOrgGet(hCntWnd AS PTR, bScreen AS LOGIC) AS DWORD STRICT
//SYSTEM
RETURN 0
STATIC FUNCTION TCntFocusRecGet(hCntWnd AS PTR) AS _winRECORDCORE STRICT
//SYSTEM
RETURN NULL_PTR //PP-040410
STATIC FUNCTION TCntFocusRecLock(hCntWnd AS PTR) AS INT STRICT
//SYSTEM
RETURN 0
STATIC FUNCTION TCntFocusRecUnlck(hCntWnd AS PTR) AS INT STRICT
//SYSTEM
RETURN 0
STATIC FUNCTION TCntFocusSet(hCntWnd AS PTR, lpRec AS _winRECORDCORE, lpFld AS _winFIELDINFO) AS LOGIC STRICT
//SYSTEM
RETURN FALSE
STATIC FUNCTION TCntFontSet(hWnd AS PTR, hFont AS PTR, iFont AS DWORD) AS LOGIC STRICT
//SYSTEM
RETURN FALSE
STATIC FUNCTION TCntFreeRecCore(lpRec AS _winRECORDCORE) AS LOGIC STRICT
//SYSTEM
RETURN FALSE
STATIC FUNCTION TCntInsFldBefore(hCntWnd AS PTR, lpFld AS _winFIELDINFO, lpNew AS _winFIELDINFO) AS LOGIC STRICT
//SYSTEM
RETURN FALSE
STATIC FUNCTION TCntIsFocusCellRO(hCntWnd AS PTR) AS LOGIC STRICT
//SYSTEM
RETURN FALSE
STATIC FUNCTION TCntIsRecSelected(hCntWnd AS PTR, lpRec AS _winRECORDCORE) AS LOGIC STRICT
//SYSTEM
RETURN FALSE
STATIC FUNCTION TCntKillRecList(hCntWnd AS PTR) AS LOGIC STRICT
//SYSTEM
RETURN FALSE
STATIC FUNCTION TCntNewFldInfo() AS _winFIELDINFO STRICT
//SYSTEM
RETURN NULL_PTR //PP-040410
STATIC FUNCTION TCntNewRecCore(dwRecSize AS DWORD) AS _winRECORDCORE STRICT
//SYSTEM
RETURN NULL_PTR //PP-040410
STATIC FUNCTION TCntNextRec(lpRec AS _winRECORDCORE) AS _winRECORDCORE STRICT
//SYSTEM
RETURN NULL_PTR //PP-040410
STATIC FUNCTION TCntNotifyAssoc(hWnd AS PTR, wEvent AS DWORD, wOemCharVal AS DWORD, lpRec AS _winRECORDCORE, lpFld AS _WinFIELDINFO, nInc AS INT,;
bShiftKey AS LOGIC, bCtrlKey AS LOGIC, lpUserData AS PTR) AS VOID STRICT
RETURN
STATIC FUNCTION TCntRangeExSet(hWnd AS PTR, lMin AS LONGINT, lMax AS LONGINT) AS LOGIC STRICT
//SYSTEM
RETURN FALSE
STATIC FUNCTION TCntRangeSet(hWnd AS PTR, iMin AS DWORD, iMax AS DWORD) AS DWORD STRICT
//SYSTEM
RETURN 0
STATIC FUNCTION TCntRecAttrClear(lpRec AS _winRECORDCORE, dwAttrib AS DWORD) AS VOID STRICT
RETURN
STATIC FUNCTION TCntRecAttrSet(lpRec AS _winRECORDCORE, dwAttrib AS DWORD) AS VOID STRICT
RETURN
STATIC FUNCTION TCntRecDataSet(lpRec AS _winRECORDCORE, lpData AS PTR) AS LOGIC STRICT
//SYSTEM
RETURN FALSE
STATIC FUNCTION TCntRecHeadGet(hCntWnd AS PTR) AS _winRECORDCORE STRICT
//SYSTEM
RETURN NULL_PTR //PP-040410
STATIC FUNCTION TCntRecsDispGet(hCntWnd AS PTR) AS INT STRICT
//SYSTEM
RETURN 0
STATIC FUNCTION TCntRecTailGet(hCntWnd AS PTR) AS _winRECORDCORE STRICT
//SYSTEM
RETURN NULL_PTR //PP-040410
STATIC FUNCTION TCntRecUserGet(lpRec AS _winRECORDCORE) AS PTR STRICT
//SYSTEM
RETURN NULL_PTR
STATIC FUNCTION TCntRecUserSet(lpRec AS _winRECORDCORE, lpUserData AS PTR, wUserBytes AS DWORD) AS LOGIC STRICT
//SYSTEM
RETURN FALSE
STATIC FUNCTION TCntRemoveFld(hCntWnd AS PTR, lpFld AS _winFIELDINFO) AS _winFIELDINFO STRICT
//SYSTEM
RETURN NULL_PTR //PP-040410
STATIC FUNCTION TCntRemoveRec(hCntWnd AS PTR, lpRec AS _winRECORDCORE) AS _winRECORDCORE STRICT
//SYSTEM
RETURN NULL_PTR //PP-040410
STATIC FUNCTION TCntRemoveRecHead(hCntWnd AS PTR) AS _winRECORDCORE STRICT
//SYSTEM
RETURN NULL_PTR //PP-040410
STATIC FUNCTION TCntRemoveRecTail(hCntWnd AS PTR) AS _winRECORDCORE STRICT
//SYSTEM
RETURN NULL_PTR //PP-040410
STATIC FUNCTION TCntRowHtSet(hCntWnd AS PTR, nHeight AS INT, wLineSpace AS DWORD) AS INT STRICT
//SYSTEM
RETURN 0
STATIC FUNCTION TCntScrollFldArea(hCntWnd AS PTR, nIncrement AS INT) AS VOID STRICT
RETURN
STATIC FUNCTION TCntScrollRecArea(hCntWnd AS PTR, nIncrement AS INT) AS _winRECORDCORE STRICT
//SYSTEM
RETURN NULL_PTR //PP-040410
STATIC FUNCTION TCntScrollRecAreaEx(hCntWnd AS PTR, lIncrement AS LONGINT) AS _winRECORDCORE STRICT
//SYSTEM
RETURN NULL_PTR //PP-040410
STATIC FUNCTION TCntSelectRec(hCntWnd AS PTR, lpRec AS _winRECORDCORE) AS LOGIC STRICT
//SYSTEM
RETURN FALSE
STATIC FUNCTION TCntSelRecGet(hCntWnd AS PTR) AS _winRECORDCORE STRICT
//SYSTEM
RETURN NULL_PTR //PP-040410
STATIC FUNCTION TCntSpltBarCreate(hCntWnd AS PTR, wMode AS DWORD, xCoord AS INT) AS VOID STRICT
RETURN
STATIC FUNCTION TCntSpltBarDelete(hCntWnd AS PTR, wMode AS DWORD, xCoord AS INT) AS VOID STRICT
RETURN
STATIC FUNCTION TCntStyleClear(hWnd AS PTR, dwStyle AS DWORD) AS VOID STRICT
RETURN
STATIC FUNCTION TCntStyleSet(hWnd AS PTR, dwStyle AS DWORD) AS VOID STRICT
RETURN
STATIC FUNCTION TCntTopRecGet(hCntWnd AS PTR) AS _winRECORDCORE STRICT
//SYSTEM
RETURN NULL_PTR //PP-040410
STATIC FUNCTION TCntTopRecSet(hCntWnd AS PTR, lpRec AS _winRECORDCORE) AS LOGIC STRICT
//SYSTEM
RETURN FALSE
STATIC FUNCTION TCntTtlAlignSet(hWnd AS PTR, dwAlign AS DWORD) AS VOID STRICT
RETURN
STATIC FUNCTION TCntTtlHtSet(hCntWnd AS PTR, nHeight AS INT) AS INT STRICT
//SYSTEM
RETURN 0
STATIC FUNCTION TCntTtlSepSet(hWnd AS PTR) AS VOID STRICT
RETURN
STATIC FUNCTION TCntTtlSet(hWnd AS PTR, lpszTitle AS PSZ) AS LOGIC STRICT
//SYSTEM
RETURN FALSE
STATIC FUNCTION TCntUnSelectRec(hCntWnd AS PTR, lpRec AS _winRECORDCORE) AS LOGIC STRICT
//SYSTEM
RETURN FALSE
STATIC FUNCTION TCntViewSet(hWnd AS PTR, iView AS DWORD) AS DWORD STRICT
//SYSTEM
RETURN 0
STATIC FUNCTION TCntVScrollPosExSet(hCntWnd AS PTR, lPosition AS LONGINT) AS VOID STRICT
RETURN
STATIC FUNCTION TCntVScrollPosSet(hCntWnd AS PTR, nPosition AS SHORTINT) AS VOID STRICT
RETURN
/// <exclude />
FUNCTION __DrawFldData(hWnd AS PTR, strucFieldInfo AS _WinFieldInfo, strucRecordCore AS _WinRecordCore, ;
ptrData AS PTR, hDC AS PTR, iX AS INT, iY AS INT, dwOptions AS DWORD, ;
ptrRect AS _WINRECT, pszData AS /*PSZ*/ PTR, dwLength AS DWORD) AS INT /* CALLBACK */
// dcaton 080608
// Changed parameter 10 from PSZ to PTR. This function is used as a callback function via a delegate and
// Marshal.GetFunctionPointerForDelegate( (System.Delegate) ) and the CLR cannot marshal a PSZ since it is a managed structure.
// Since a PSZ is really just a byte* (as far as native code is concerned) changing the parameter to PTR
// keeps the CLR happy, and 'pszData' is cast to a PSZ in the call to __DrawCellData.
// This fixes defect id #350
LOCAL oColumn AS DataColumn
LOCAL p AS SelfPtr
// Note lpUserData contains a pointer to a buffer of 4 bytes with the self pointer!
p := strucFieldInfo:lpUserData
p := p:ptrSelf
oColumn := __WCSelfPtr2Object(p)
IF oColumn != NULL_OBJECT
oColumn:__DrawCellData(hDC, iX, iY, dwOptions, ptrRect, (PSZ) pszData, dwLength)
RETURN 0
ENDIF
RETURN 1
/// <exclude />
FUNCTION __LoadContainerDLL()
LOCAL hDll AS PTR
LOCAL rsFormat AS ResourceString
IF glContainerDllLoaded
RETURN TRUE
ENDIF
hDll := LoadLibrary(String2Psz( "CATO3CNT.DLL"))
IF (hDll == NULL_PTR)
rsFormat := ResourceString{__WCSLoadLibraryError}
WCError{#LoadContainerDLL, #DataBrowser, VO_Sprintf(rsFormat:value, "CATO3CNT.DLL"),,,FALSE}:Throw()
RETURN FALSE
ENDIF
ghContainerDLL := hDll
gpfnCntFocusFldUnlck := __GetProcAddress( "CntFocusFldUnlck")
gpfnCntTopRecGet := __GetProcAddress( "CntTopRecGet")
gpfnCntFocusRecGet := __GetProcAddress( "CntFocusRecGet")
gpfnCntSelectRec := __GetProcAddress( "CntSelectRec")
gpfnCntRecHeadGet := __GetProcAddress( "CntRecHeadGet")
gpfnCntNextRec := __GetProcAddress( "CntNextRec")
gpfnCntFocusFldGet := __GetProcAddress( "CntFocusFldGet")
gpfnCntFocusSet := __GetProcAddress( "CntFocusSet")
gpfnCntFocusRecLock := __GetProcAddress( "CntFocusRecLock")
gpfnCntCurrentPosExSet := __GetProcAddress( "CntCurrentPosExSet")
gpfnCntEndRecEdit := __GetProcAddress( "CntEndRecEdit")
gpfnCntAddRecHead := __GetProcAddress( "CntAddRecHead")
gpfnCntRemoveRecTail := __GetProcAddress( "CntRemoveRecTail")
gpfnCntFreeRecCore := __GetProcAddress( "CntFreeRecCore")
gpfnCntTopRecSet := __GetProcAddress( "CntTopRecSet")
gpfnCntDeltaExSet := __GetProcAddress( "CntDeltaExSet")
gpfnCntDeltaPosExSet := __GetProcAddress( "CntDeltaPosExSet")
gpfnCntVScrollPosExSet := __GetProcAddress( "CntVScrollPosExSet")
gpfnCntRangeExSet := __GetProcAddress( "CntRangeExSet")
gpfnCntCurrentPosExGet := __GetProcAddress( "CntCurrentPosExGet")
gpfnCntRecTailGet := __GetProcAddress( "CntRecTailGet")
gpfnCntAddRecTail := __GetProcAddress( "CntAddRecTail")
gpfnCntRemoveRecHead := __GetProcAddress( "CntRemoveRecHead")
gpfnCntDeltaPosExGet := __GetProcAddress( "CntDeltaPosExGet")
gpfnCntCNIncExGet := __GetProcAddress( "CntCNIncExGet")
gpfnCntNewRecCore := __GetProcAddress( "CntNewRecCore")
gpfnCntRecUserSet := __GetProcAddress( "CntRecUserSet")
gpfnCntRecAttrSet := __GetProcAddress( "CntRecAttrSet")
gpfnCntNewFldInfo := __GetProcAddress( "CntNewFldInfo")
gpfnCntFldUserSet := __GetProcAddress( "CntFldUserSet")
gpfnCntCNChildWndGet := __GetProcAddress( "CntCNChildWndGet")
gpfnCntKillRecList := __GetProcAddress( "CntKillRecList")
gpfnCntSelRecGet := __GetProcAddress( "CntSelRecGet")
gpfnCntUnSelectRec := __GetProcAddress( "CntUnSelectRec")
gpfnCntStyleClear := __GetProcAddress( "CntStyleClear")
gpfnCntIsRecSelected := __GetProcAddress( "CntIsRecSelected")
gpfnCntRecAttrClear := __GetProcAddress( "CntRecAttrClear")
gpfnCntStyleSet := __GetProcAddress( "CntStyleSet")
gpfnCntRecDataSet := __GetProcAddress( "CntRecDataSet")
gpfnCntRecsDispGet := __GetProcAddress( "CntRecsDispGet")
gpfnCntFldTtlHtSet := __GetProcAddress( "CntFldTtlHtSet")
gpfnCntColorSet := __GetProcAddress( "CntColorSet")
gpfnCntFontSet := __GetProcAddress( "CntFontSet")
gpfnCntColorGet := __GetProcAddress( "CntColorGet")
gpfnCntAttribSet := __GetProcAddress( "CntAttribSet")
gpfnCntAttribClear := __GetProcAddress( "CntAttribClear")
gpfnCntSpltBarCreate := __GetProcAddress( "CntSpltBarCreate")
gpfnCntSpltBarDelete := __GetProcAddress( "CntSpltBarDelete")
gpfnCntEndDeferPaint := __GetProcAddress( "CntEndDeferPaint")
gpfnCntTtlSet := __GetProcAddress( "CntTtlSet")
gpfnCntTtlAlignSet := __GetProcAddress( "CntTtlAlignSet")
gpfnCntTtlHtSet := __GetProcAddress( "CntTtlHtSet")
gpfnCntTtlSepSet := __GetProcAddress( "CntTtlSepSet")
gpfnCntCursorSet := __GetProcAddress( "CntCursorSet")
gpfnCntDeferPaint := __GetProcAddress( "CntDeferPaint")
gpfnCntFldHeadGet := __GetProcAddress( "CntFldHeadGet")
gpfnCntAssociateSet := __GetProcAddress( "CntAssociateSet")
gpfnCntViewSet := __GetProcAddress( "CntViewSet")
gpfnCntRowHtSet := __GetProcAddress( "CntRowHtSet")
gpfnCntNotifyAssoc := __GetProcAddress( "CntNotifyAssoc")
gpfnCntCNRecGet := __GetProcAddress( "CntCNRecGet")
gpfnCntCNShiftKeyGet := __GetProcAddress( "CntCNShiftKeyGet")
gpfnCntFocusMove := __GetProcAddress( "CntFocusMove")
gpfnCntIsFocusCellRO := __GetProcAddress( "CntIsFocusCellRO")
gpfnCntCNCharGet := __GetProcAddress( "CntCNCharGet")
gpfnCntCNFldGet := __GetProcAddress( "CntCNFldGet")
gpfnCntFldTailGet := __GetProcAddress( "CntFldTailGet")
gpfnCntFocusRecUnlck := __GetProcAddress( "CntFocusRecUnlck")
gpfnCntScrollRecAreaEx := __GetProcAddress( "CntScrollRecAreaEx")
gpfnCntScrollFldArea := __GetProcAddress( "CntScrollFldArea")
gpfnCntFldDataAlnSet := __GetProcAddress( "CntFldDataAlnSet")
gpfnCntFldTtlSepSet := __GetProcAddress( "CntFldTtlSepSet")
gpfnCntFldTtlSet := __GetProcAddress( "CntFldTtlSet")
gpfnCntAddFldTail := __GetProcAddress( "CntAddFldTail")
gpfnCntInsFldBefore := __GetProcAddress( "CntInsFldBefore")
gpfnCntRemoveFld := __GetProcAddress( "CntRemoveFld")
gpfnCntFocusExtGet := __GetProcAddress( "CntFocusExtGet")
gpfnCntFocusOrgGet := __GetProcAddress( "CntFocusOrgGet")
gpfnCntFocusFldLock := __GetProcAddress( "CntFocusFldLock")
gpfnCntFldColorSet := __GetProcAddress( "CntFldColorSet")
gpfnCntFldAttrClear := __GetProcAddress( "CntFldAttrClear")
gpfnCntFldAttrSet := __GetProcAddress( "CntFldAttrSet")
gpfnCntFldWidthSet := __GetProcAddress( "CntFldWidthSet")
gpfnCntFldDrwProcSet := __GetProcAddress( "CntFldDrwProcSet")
RETURN (glContainerDllLoaded := TRUE)
#ifdef __VULCAN__
/// <exclude />
DELEGATE __CellEditProcDelegate( hWnd AS PTR, uMsg AS DWORD, wParam AS DWORD, lParam AS LONGINT ) AS INT
/// <exclude />
DELEGATE __DrawFldDataDelegate( hWnd AS PTR, strucFieldInfo AS _WinFieldInfo, strucRecordCore AS _WinRecordCore, ptrData AS PTR, hDC AS PTR, iX AS INT, iY AS INT, dwOptions AS DWORD, ptrRect AS _WINRECT, pszData AS /*PSZ*/ PTR, dwLength AS DWORD ) AS INT
/// <exclude />
DELEGATE __WCGBChildProcDelegate( hWnd AS PTR, uMsg AS DWORD, wParam AS DWORD, lParam AS LONGINT ) AS LONGINT
#endif
/// <exclude />
FUNCTION __WCGBChildProc(hWnd AS PTR, uMsg AS DWORD, wParam AS DWORD, lParam AS LONGINT) AS LONGINT /* WINCALL */
LOCAL oBrowser AS OBJECT
LOCAL i AS INT
IF (uMsg == WM_CHAR)
oBrowser := __WCGetControlByHandle(GetParent(hWnd))
IF IsInstanceOf(oBrowser, #DataBrowser)
IVarPut(oBrowser, #__LastChar, wParam)
ENDIF
//PP-040410 This is better handled in control dispatch
// ELSEIF (uMsg == WM_CONTEXTMENU)
// oBrowser := __WCGetControlByHandle(GetParent(hWnd))
// IF (oBrowser:ContextMenu != NULL_OBJECT)
// oBrowser:ContextMenu:ShowAsPopUp(oBrowser)
// ELSEIF (oBrowser:Owner:ContextMenu != NULL_OBJECT)
// oBrowser:Owner:ContextMenu:ShowAsPopUp(oBrowser:Owner)
// ENDIF
ELSEIF (uMsg == 0x020A) //WM_MOUSEWHEEL
FOR i:=1 TO 5
IF (SHORTINT(_CAST, HiWord(wParam)) < 0)
PostMessage(hwnd, WM_VSCROLL, SB_LINEDOWN, 0)
ELSE
PostMessage(hwnd, WM_VSCROLL, SB_LINEUP, 0)
ENDIF
NEXT
ENDIF
RETURN CallWindowProc(pfGBChildProcOrg, hWnd, uMsg, wParam, lParam)
#ifdef __VULCAN__
/// <exclude/>
DELEGATE __WCGBNotifyProcDelegate( hWnd AS PTR, uMsg AS DWORD, wParam AS DWORD, lParam AS LONGINT ) AS LONGINT
#endif
/// <exclude />
FUNCTION __WCGBNotifyProc(hWnd AS PTR, uMsg AS DWORD, wParam AS DWORD, lParam AS LONGINT) AS LONGINT /* WINCALL */
LOCAL oControl AS Control
LOCAL strucCreateStruct AS _WinCreateStruct
LOCAL p AS SelfPtr
IF uMsg == WM_CREATE
strucCreateStruct := PTR(_CAST, lParam)
p := strucCreateStruct:lpCreateParams
oControl := __WCSelfPtr2Object(p)
SetWindowLong(hWnd, DWL_USER, LONGINT(_CAST, p))
ELSE
p := PTR(_CAST, GetWindowLong(hWnd, DWL_USER))
oControl := __WCSelfPtr2Object(p)
ENDIF
IF oControl != NULL_OBJECT
RETURN oControl:Dispatch(@@Event{ hWnd, uMsg, wParam, lParam, oControl})
ENDIF
RETURN DefWindowProc(hWnd, uMsg, wParam, lParam)
STATIC FUNCTION __WCRegisterGBNotifyWindow(hInst AS PTR) AS LOGIC
STATIC LOCAL lretVal AS LOGIC
LOCAL wc IS _WINWNDclass
IF !lretVal
wc:style := CS_GLOBALCLASS
#ifdef __VULCAN__
STATIC LOCAL WCGBNotifyProcDelegate AS __WCGBNotifyProcDelegate
IF WCGBNotifyProcDelegate == NULL
WCGBNotifyProcDelegate := __WCGBNotifyProcDelegate{ NULL, @__WCGBNotifyProc() }
ENDIF
wc:lpfnWndProc := System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate( (System.Delegate) WCGBNotifyProcDelegate )
#else
wc:lpfnWndProc := PTR(_CAST, @__WCGBNotifyProc())
#endif
wc:hInstance := hInst
wc:hbrBackground := (COLOR_WINDOW + 1)
wc:lpszClassName := String2Psz(__WCGBNotifyWindowClass)
wc:cbWndExtra := 12
lretVal := (RegisterClass(@wc) != 0)
ENDIF
RETURN lretVal
STATIC FUNCTION __GetProcAddress(cProcname AS STRING) AS PTR
LOCAL pAddr AS PTR
pAddr := GetProcAddress(ghContainerDLL, String2Psz(cProcname))
IF pAddr == NULL_PTR
WCError{#LoadContainerDLL, #DataBrowser, "Could not find address of function "+cProcname+" in CATO3CNT.DLL",,,FALSE}:Throw()
ENDIF
RETURN pAddr
// dcaton 070724
// This was incorrectly typed as LOGIC. It works in VO, but in Vulcan the CLR marshals logics as 1 or 0. This
// causes the return value of CallWindowProc() to be limited to 0 or 1, which causes all sorts of problems
// when an int is returned. There is no reason to type this callback as returning a logic, since CallWindowProc()
// really returns INT as documented in MSDN.
/// <exclude />
FUNCTION __CellEditProc(hWnd AS PTR, uMsg AS DWORD, wParam AS DWORD, lParam AS LONGINT) AS /* LOGIC */ INT //_WINCALL
LOCAL oControl AS Control
LOCAL oOwner AS OBJECT
LOCAL lpfnDefaultProc AS PTR
oControl := __WCGetControlByHandle(hWnd)
IF (oControl != NULL_OBJECT)
oOwner := oControl:Owner
IF IsInstanceOf(oOwner, #DataBrowser)
lpfnDefaultProc := oOwner:ptrControlDefaultProc
IF oOwner:__EditDispatch(uMsg, wParam, lParam)
RETURN 1 // TRUE
ENDIF
IF (lpfnDefaultProc != NULL_PTR)
// RETURN LOGIC(_CAST, CallWindowProc(lpfnDefaultProc, hWnd, umsg, wParam, lParam))
RETURN CallWindowProc(lpfnDefaultProc, hWnd, umsg, wParam, lParam)
ENDIF
ENDIF
ENDIF
RETURN 1 // TRUE
#region defines
DEFINE GBSSBLEFT := 1
DEFINE GBSSBMIDDLE := 2
DEFINE GBSSBRIGHT := 3
DEFINE ssBlockSelection := 3
DEFINE ssExtendedSelection := 2
DEFINE ssNoSelection := 0
DEFINE ssSingleSelection := 1
DEFINE __WCGBNotifyWindowClass := "GBNotifyContext"
#endregion
| xBase | 5 | orangesocks/XSharpPublic | Runtime/VOSDK/Source/VOSDK/GUI_Classes_SDK/DataBrowser.prg | [
"Apache-2.0"
] |
ARCHIVE_ENTRY_LINKIFY(3) manual page
== NAME ==
'''archive_entry_linkresolver''',
'''archive_entry_linkresolver_new''',
'''archive_entry_linkresolver_set_strategy''',
'''archive_entry_linkresolver_free''',
'''archive_entry_linkify'''
- hardlink resolver functions
== LIBRARY ==
Streaming Archive Library (libarchive, -larchive)
== SYNOPSIS ==
'''<nowiki>#include <archive_entry.h></nowiki>'''
<br>
''struct archive_entry_linkresolver *''
<br>
'''archive_entry_linkresolver_new'''(''void'');
<br>
''void''
<br>
'''archive_entry_linkresolver_set_strategy'''(''struct archive_entry_linkresolver *resolver'', ''int format'');
<br>
''void''
<br>
'''archive_entry_linkresolver_free'''(''struct archive_entry_linkresolver *resolver'');
<br>
''void''
<br>
'''archive_entry_linkify'''(''struct archive_entry_linkresolver *resolver'', ''struct archive_entry **entry'', ''struct archive_entry **sparse'');
== DESCRIPTION ==
Programs that want to create archives have to deal with hardlinks.
Hardlinks are handled in different ways by the archive formats.
The basic strategies are:
<ol>
<li>
Ignore hardlinks and store the body for each reference (old cpio, zip).
</li><li>
Store the body the first time an inode is seen (ustar, pax).
</li><li>
Store the body the last time an inode is seen (new cpio).
</li></ol>
The
'''archive_entry_linkresolver'''
functions help by providing a unified interface and handling the complexity
behind the scene.
The
'''archive_entry_linkresolver'''
functions assume that
''archive_entry''
instances have valid nlinks, inode and device values.
The inode and device value is used to match entries.
The nlinks value is used to determined if all references have been found and
if the internal references can be recycled.
The
'''archive_entry_linkresolver_new'''()
function allocates a new link resolver.
The instance can be freed using
'''archive_entry_linkresolver_free'''().
All deferred entries are flushed and the internal storage is freed.
The
'''archive_entry_linkresolver_set_strategy'''()
function selects the optimal hardlink strategy for the given format.
The format code can be obtained from
[[ManPagerchiveormat3]].
The function can be called more than once, but it is recommended to
flush all deferred entries first.
The
'''archive_entry_linkify'''()
function is the core of
'''archive_entry_linkresolver'''.
The
'''entry'''()
argument points to the
''archive_entry''
that should be written.
Depending on the strategy one of the following actions is taken:
<ol>
<li>
For the simple archive formats
''*entry''
is left unmodified and
''*sparse''
is set to
NULL.
</li><li>
For tar like archive formats,
''*sparse''
is set to
NULL.
If
''*entry''
is
NULL,
no action is taken.
If the hardlink count of
''*entry''
is larger than 1 and the file type is a regular file or symbolic link,
the internal list is searched for a matching inode.
If such an inode is found, the link count is decremented and the file size
of
''*entry''
is set to 0 to notify that no body should be written.
If no such inode is found, a copy of the entry is added to the internal cache
with a link count reduced by one.
</li><li>
For new cpio like archive formats a value for
''*entry''
of
NULL
is used to flush deferred entries.
In that case
''*entry''
is set to an arbitrary deferred entry and the entry itself is removed from the
internal list.
If the internal list is empty,
''*entry''
is set to
NULL.
In either case,
''*sparse''
is set to
NULL
and the function returns.
If the hardlink count of
''*entry''
is one or the file type is a directory or device,
''*sparse''
is set to
NULL
and no further action is taken.
Otherwise, the internal list is searched for a matching inode.
If such an inode is not found, the entry is added to the internal list,
both
''*entry''
and
''*sparse''
are set to
NULL
and the function returns.
If such an inode is found, the link count is decremented.
If it remains larger than one, the existing entry on the internal list
is swapped with
''*entry''
after retaining the link count.
The existing entry is returned in
''*entry''.
If the link count reached one, the new entry is also removed from the
internal list and returned in
''*sparse''.
Otherwise
''*sparse''
is set to
NULL.
</li></ol>
The general usage is therefore:
<ol>
<li>
For each new archive entry, call
'''archive_entry_linkify'''().
</li><li>
Keep in mind that the entries returned may have a size of 0 now.
</li><li>
If
''*entry''
is not
NULL,
archive it.
</li><li>
If
''*sparse''
is not
NULL,
archive it.
</li><li>
After all entries have been written to disk, call
'''archive_entry_linkify'''()
with
''*entry''
set to
NULL
and archive the returned entry as long as it is not
NULL.
</li></ol>
== RETURN VALUES ==
'''archive_entry_linkresolver_new'''()
returns
NULL
on
[[malloc(3)|http://www.freebsd.org/cgi/man.cgi?query=malloc&sektion=3]]
failures.
== SEE ALSO ==
[[ManPagerchiventry3]]
| MediaWiki | 4 | probonopd/imagewriter | dependencies/libarchive-3.4.2/doc/wiki/ManPageArchiveEntryLinkify3.wiki | [
"Apache-2.0"
] |
array levl 0 levl 1
| Dogescript | 0 | erinkeith/dogescript | test/spec/property-operators/levl/multi-expression/source.djs | [
"MIT"
] |
import torch
from torch.testing import FileCheck
from torch.testing._internal.jit_utils import JitTestCase
if __name__ == "__main__":
raise RuntimeError(
"This test file is not meant to be run directly, use:\n\n"
"\tpython test/test_jit.py TESTNAME\n\n"
"instead."
)
class TestBatchMM(JitTestCase):
@staticmethod
def _get_test_tensors(n: int):
return [
torch.tensor([[1 + x, 2 + x, 3 + x], [4 + x, 5 + x, 6 + x]])
if x % 2 == 0
else torch.tensor([[1 + x, 2 + x], [3 + x, 4 + x], [5 + x, 6 + x]])
for x in range(n)
]
def test_batch_mm_no_mutation(self):
def test_batch_mm(
T1: torch.Tensor,
T2: torch.Tensor,
T3: torch.Tensor,
T4: torch.Tensor,
T5: torch.Tensor,
T6: torch.Tensor,
T7: torch.Tensor,
T8: torch.Tensor,
):
return (
torch.mm(T1, T2)
+ torch.mm(T3, T4)
+ torch.mm(T5, T6)
+ torch.mm(T7, T8)
)
test_batch_mm_scripted = torch.jit.script(test_batch_mm)
tensors = TestBatchMM._get_test_tensors(8)
expected = test_batch_mm(*tensors)
FileCheck().check_count("aten::mm", 4, exactly=True).run(
test_batch_mm_scripted.graph
)
self.run_pass("batch_mm", test_batch_mm_scripted.graph)
FileCheck().check_count("prim::MMTreeReduce", 1, exactly=True).run(
test_batch_mm_scripted.graph
)
actual = test_batch_mm_scripted(*tensors)
self.assertEqual(expected, actual, atol=1e-9, rtol=1e-9)
def test_batch_mm_permitted_mutation(self):
def test_batch_mm(
T1: torch.Tensor,
T2: torch.Tensor,
T3: torch.Tensor,
T4: torch.Tensor,
T5: torch.Tensor,
T6: torch.Tensor,
T7: torch.Tensor,
T8: torch.Tensor,
):
result = {}
result["product"] = (
torch.mm(T1, T2)
+ torch.mm(T3, T4)
+ torch.mm(T5, T6)
+ torch.mm(T7, T8)
)
result["constant"] = torch.tensor([42.0])
return result
test_batch_mm_scripted = torch.jit.script(test_batch_mm)
tensors = TestBatchMM._get_test_tensors(8)
expected = test_batch_mm(*tensors)
FileCheck().check_count("aten::mm", 4, exactly=True).run(
test_batch_mm_scripted.graph
)
self.run_pass("batch_mm", test_batch_mm_scripted.graph)
FileCheck().check_count("prim::MMTreeReduce", 1, exactly=True).run(
test_batch_mm_scripted.graph
)
actual = test_batch_mm_scripted(*tensors)
self.assertEqual(expected, actual, atol=1e-9, rtol=1e-9)
def test_batch_mm_prohibited_mutation(self):
@torch.jit.script
def test_batch_mm(n: int):
T1 = torch.zeros((n, n))
T2 = torch.zeros((n, n))
T3 = torch.zeros((n, n))
T4 = torch.zeros((n, n))
T5 = torch.zeros((n, n))
T6 = torch.zeros((n, n))
T7 = torch.zeros((n, n))
T8 = torch.zeros((n, n))
torch.relu_(T1)
result = (
torch.mm(T1, T2)
+ torch.mm(T3, T4)
+ torch.mm(T5, T6)
+ torch.mm(T7, T8)
)
return result
FileCheck().check_count("aten::mm", 4, exactly=True).run(test_batch_mm.graph)
self.run_pass("batch_mm", test_batch_mm.graph)
FileCheck().check_count("aten::mm", 4, exactly=True).check_not(
"prim::MMTreeReduce"
).run(test_batch_mm.graph)
def test_batch_mm_prohibited_mutation_multiple_adds(self):
@torch.jit.script
def test_batch_mm(n: int):
T1 = torch.zeros((n, n))
T2 = torch.zeros((n, n))
T3 = torch.zeros((n, n))
T4 = torch.zeros((n, n))
T5 = torch.zeros((n, n))
T6 = torch.zeros((n, n))
T7 = torch.zeros((n, n))
T8 = torch.zeros((n, n))
T9 = torch.zeros((n, n))
T10 = torch.zeros((n, n))
torch.relu_(T1)
result = {}
result["no_mutated_parameters"] = (
torch.mm(T2, T3)
+ torch.mm(T4, T5)
+ torch.mm(T6, T7)
+ torch.mm(T8, T9)
)
result["all_parameters"] = (
torch.mm(T1, T2)
+ torch.mm(T3, T4)
+ torch.mm(T5, T6)
+ torch.mm(T7, T8)
+ torch.mm(T9, T10)
)
return result
self.run_pass("batch_mm", test_batch_mm.graph)
FileCheck().check_count("prim::MMTreeReduce", 1, exactly=True).check_count(
"aten::mm", 5, exactly=True
).run(test_batch_mm.graph)
def test_batch_mm_prohibited_mutation_if_node(self):
@torch.jit.script
def test_batch_mm(n: int, use_t1: bool):
T1 = torch.zeros((n, n))
T2 = torch.zeros((n, n))
T3 = torch.zeros((n, n))
T4 = torch.zeros((n, n))
T5 = torch.zeros((n, n))
T6 = torch.zeros((n, n))
T7 = torch.zeros((n, n))
T8 = torch.zeros((n, n))
T9 = torch.zeros((n, n))
T10 = torch.zeros((n, n))
if use_t1:
torch.relu_(T1)
return (
torch.mm(T1, T2)
+ torch.mm(T3, T4)
+ torch.mm(T5, T6)
+ torch.mm(T7, T8)
+ torch.mm(T9, T10)
)
else:
return (
torch.mm(T2, T3)
+ torch.mm(T4, T5)
+ torch.mm(T6, T7)
+ torch.mm(T8, T9)
)
self.run_pass("batch_mm", test_batch_mm.graph)
FileCheck().check_count("aten::mm", 5, exactly=True).check_count(
"prim::MMTreeReduce", 1, exactly=True
).run(test_batch_mm.graph)
def test_batch_mm_side_permitted_mutation(self):
@torch.jit.script
def test_batch_mm(n: int):
result = {}
A = torch.zeros((n, n))
T1 = torch.zeros((n, n))
T2 = torch.zeros((n, n))
T3 = torch.zeros((n, n))
T4 = torch.zeros((n, n))
T5 = torch.zeros((n, n))
T6 = torch.zeros((n, n))
T7 = torch.zeros((n, n))
T8 = torch.zeros((n, n))
result["T1"] = torch.mm(A, T1)
result["T2"] = torch.mm(A, T2)
result["T3"] = torch.mm(A, T3)
result["T4"] = torch.mm(A, T4)
result["T5"] = torch.mm(A, T5)
result["T6"] = torch.mm(A, T6)
result["T7"] = torch.mm(A, T7)
result["T8"] = torch.mm(A, T8)
return result
FileCheck().check_count("aten::mm", 8, exactly=True).run(test_batch_mm.graph)
self.run_pass("batch_mm", test_batch_mm.graph)
FileCheck().check_count("prim::MMBatchSide", 1, exactly=True).check_not(
"aten::mm"
).run(test_batch_mm.graph)
def test_batch_mm_side_prohibited_mutation_uncommon_side(self):
@torch.jit.script
def test_batch_mm(n: int):
A = torch.zeros((n, n))
T1 = torch.zeros((n, n))
T2 = torch.zeros((n, n))
T3 = torch.zeros((n, n))
T4 = torch.zeros((n, n))
T5 = torch.zeros((n, n))
T6 = torch.zeros((n, n))
T7 = torch.zeros((n, n))
T8 = torch.zeros((n, n))
T9 = torch.zeros((n, n))
T10 = torch.zeros((n, n))
torch.relu_(T1)
result = {}
result["T1"] = torch.mm(A, T1)
result["T2"] = torch.mm(A, T2)
result["T3"] = torch.mm(A, T3)
result["T4"] = torch.mm(A, T4)
result["T5"] = torch.mm(A, T5)
result["T6"] = torch.mm(A, T6)
result["T7"] = torch.mm(A, T7)
result["T8"] = torch.mm(A, T8)
result["T9"] = torch.mm(A, T9)
result["T10"] = torch.mm(A, T10)
return result
FileCheck().check_count("aten::mm", 10, exactly=True).run(test_batch_mm.graph)
self.run_pass("batch_mm", test_batch_mm.graph)
FileCheck().check_count("aten::mm", 1, exactly=True).run(test_batch_mm.graph)
FileCheck().check_count("prim::MMBatchSide", 1, exactly=True).run(
test_batch_mm.graph
)
def test_batch_mm_side_prohibited_mutation_common_side(self):
@torch.jit.script
def test_batch_mm(n: int):
A = torch.zeros((n, n))
T1 = torch.zeros((n, n))
T2 = torch.zeros((n, n))
T3 = torch.zeros((n, n))
T4 = torch.zeros((n, n))
T5 = torch.zeros((n, n))
T6 = torch.zeros((n, n))
T7 = torch.zeros((n, n))
T8 = torch.zeros((n, n))
T9 = torch.zeros((n, n))
T10 = torch.zeros((n, n))
torch.relu_(A)
result = {}
result["T1"] = torch.mm(A, T1)
result["T2"] = torch.mm(A, T2)
result["T3"] = torch.mm(A, T3)
result["T4"] = torch.mm(A, T4)
result["T5"] = torch.mm(A, T5)
result["T6"] = torch.mm(A, T6)
result["T7"] = torch.mm(A, T7)
result["T8"] = torch.mm(A, T8)
result["T9"] = torch.mm(A, T9)
result["T10"] = torch.mm(A, T10)
return result
FileCheck().check_count("aten::mm", 10, exactly=True).run(test_batch_mm.graph)
self.run_pass("batch_mm", test_batch_mm.graph)
FileCheck().check_count("aten::mm", 10, exactly=True).check_not(
"prim::MMBatchSide"
).run(test_batch_mm.graph)
| Python | 4 | sanchitintel/pytorch | test/jit/test_batch_mm.py | [
"Intel"
] |
"""Support for IHC devices."""
import voluptuous as vol
from homeassistant.core import HomeAssistant
import homeassistant.helpers.config_validation as cv
from .const import (
ATTR_CONTROLLER_ID,
ATTR_IHC_ID,
ATTR_VALUE,
DOMAIN,
IHC_CONTROLLER,
IHC_CONTROLLER_INDEX,
SERVICE_PULSE,
SERVICE_SET_RUNTIME_VALUE_BOOL,
SERVICE_SET_RUNTIME_VALUE_FLOAT,
SERVICE_SET_RUNTIME_VALUE_INT,
)
from .util import async_pulse, async_set_bool, async_set_float, async_set_int
SET_RUNTIME_VALUE_BOOL_SCHEMA = vol.Schema(
{
vol.Required(ATTR_IHC_ID): cv.positive_int,
vol.Required(ATTR_VALUE): cv.boolean,
vol.Optional(ATTR_CONTROLLER_ID, default=0): cv.positive_int,
}
)
SET_RUNTIME_VALUE_INT_SCHEMA = vol.Schema(
{
vol.Required(ATTR_IHC_ID): cv.positive_int,
vol.Required(ATTR_VALUE): vol.Coerce(int),
vol.Optional(ATTR_CONTROLLER_ID, default=0): cv.positive_int,
}
)
SET_RUNTIME_VALUE_FLOAT_SCHEMA = vol.Schema(
{
vol.Required(ATTR_IHC_ID): cv.positive_int,
vol.Required(ATTR_VALUE): vol.Coerce(float),
vol.Optional(ATTR_CONTROLLER_ID, default=0): cv.positive_int,
}
)
PULSE_SCHEMA = vol.Schema(
{
vol.Required(ATTR_IHC_ID): cv.positive_int,
vol.Optional(ATTR_CONTROLLER_ID, default=0): cv.positive_int,
}
)
def setup_service_functions(hass: HomeAssistant) -> None:
"""Set up the IHC service functions."""
def _get_controller(call):
controller_index = call.data[ATTR_CONTROLLER_ID]
for controller_id in hass.data[DOMAIN]:
controller_conf = hass.data[DOMAIN][controller_id]
if controller_conf[IHC_CONTROLLER_INDEX] == controller_index:
return controller_conf[IHC_CONTROLLER]
# if not found the controller_index is ouf of range
raise ValueError("The controller index is out of range")
async def async_set_runtime_value_bool(call):
"""Set a IHC runtime bool value service function."""
ihc_id = call.data[ATTR_IHC_ID]
value = call.data[ATTR_VALUE]
ihc_controller = _get_controller(call)
await async_set_bool(hass, ihc_controller, ihc_id, value)
async def async_set_runtime_value_int(call):
"""Set a IHC runtime integer value service function."""
ihc_id = call.data[ATTR_IHC_ID]
value = call.data[ATTR_VALUE]
ihc_controller = _get_controller(call)
await async_set_int(hass, ihc_controller, ihc_id, value)
async def async_set_runtime_value_float(call):
"""Set a IHC runtime float value service function."""
ihc_id = call.data[ATTR_IHC_ID]
value = call.data[ATTR_VALUE]
ihc_controller = _get_controller(call)
await async_set_float(hass, ihc_controller, ihc_id, value)
async def async_pulse_runtime_input(call):
"""Pulse a IHC controller input function."""
ihc_id = call.data[ATTR_IHC_ID]
ihc_controller = _get_controller(call)
await async_pulse(hass, ihc_controller, ihc_id)
hass.services.async_register(
DOMAIN,
SERVICE_SET_RUNTIME_VALUE_BOOL,
async_set_runtime_value_bool,
schema=SET_RUNTIME_VALUE_BOOL_SCHEMA,
)
hass.services.async_register(
DOMAIN,
SERVICE_SET_RUNTIME_VALUE_INT,
async_set_runtime_value_int,
schema=SET_RUNTIME_VALUE_INT_SCHEMA,
)
hass.services.async_register(
DOMAIN,
SERVICE_SET_RUNTIME_VALUE_FLOAT,
async_set_runtime_value_float,
schema=SET_RUNTIME_VALUE_FLOAT_SCHEMA,
)
hass.services.async_register(
DOMAIN, SERVICE_PULSE, async_pulse_runtime_input, schema=PULSE_SCHEMA
)
| Python | 4 | MrDelik/core | homeassistant/components/ihc/service_functions.py | [
"Apache-2.0"
] |
/*
* Copyright (c) 2020, Andreas Kling <[email protected]>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <AK/Forward.h>
#include <LibWeb/Forward.h>
#include <LibWeb/TreeNode.h>
namespace Web::DOM {
template<typename NodeType>
class NonDocumentTypeChildNode {
public:
Element* previous_element_sibling()
{
for (auto* sibling = static_cast<NodeType*>(this)->previous_sibling(); sibling; sibling = sibling->previous_sibling()) {
if (is<Element>(*sibling))
return verify_cast<Element>(sibling);
}
return nullptr;
}
Element* next_element_sibling()
{
for (auto* sibling = static_cast<NodeType*>(this)->next_sibling(); sibling; sibling = sibling->next_sibling()) {
if (is<Element>(*sibling))
return verify_cast<Element>(sibling);
}
return nullptr;
}
Element* next_element_in_pre_order()
{
for (auto* node = static_cast<NodeType*>(this)->next_in_pre_order(); node; node = node->next_in_pre_order()) {
if (is<Element>(*node))
return verify_cast<Element>(node);
}
return nullptr;
}
const Element* previous_element_sibling() const { return const_cast<NonDocumentTypeChildNode*>(this)->previous_element_sibling(); }
const Element* next_element_sibling() const { return const_cast<NonDocumentTypeChildNode*>(this)->next_element_sibling(); }
const Element* next_element_in_pre_order() const { return const_cast<NonDocumentTypeChildNode*>(this)->next_element_in_pre_order(); }
protected:
NonDocumentTypeChildNode() = default;
};
}
| C | 4 | r00ster91/serenity | Userland/Libraries/LibWeb/DOM/NonDocumentTypeChildNode.h | [
"BSD-2-Clause"
] |
@-webkit-keyframes fadeOut {
0% {
opacity: 1;
}
50% {
opacity: 0.8;
}
99% {
opacity: 0.01;
}
100% {
opacity: 0;
}
}
@keyframes fadeOut {
0% {
opacity: 1;
}
50% {
opacity: 0.8;
}
99% {
opacity: 0.01;
}
100% {
opacity: 0;
}
}
.copy-button-fadeout {
animation: fadeOut 2.5s;
animation-fill-mode: forwards;
}
.copy-button-copy-text {
opacity: 0;
margin-left: 7px;
color: #23ae89;
}
| CSS | 4 | GizMan/portainer | app/portainer/components/copy-button/copy-button.css | [
"Zlib"
] |
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
/**
* To create smaller locale files, we remove duplicated data.
* To make this work we store the data in arrays, where `undefined` indicates that the
* value is a duplicate of the previous value in the array.
* e.g. consider an array like: [x, y, undefined, z, undefined, undefined]
* The first `undefined` is equivalent to y, the second and third are equivalent to z
* Note that the first value in an array is always defined.
*
* Also since we need to know which data is assumed similar, it is important that we store those
* similar data in arrays to mark the delimitation between values that have different meanings
* (e.g. months and days).
*
* For further size improvements, "undefined" values will be replaced by a constant in the arrays
* as the last step of the file generation (in generateLocale and generateLocaleExtra).
* e.g.: [x, y, undefined, z, undefined, undefined] will be [x, y, u, z, u, u]
*/
export function removeDuplicates(data: unknown[]) {
const dedup = [data[0]];
for (let i = 1; i < data.length; i++) {
if (JSON.stringify(data[i]) !== JSON.stringify(data[i - 1])) {
dedup.push(data[i]);
} else {
dedup.push(undefined);
}
}
return dedup;
}
| TypeScript | 5 | yuchenghu/angular-cn | packages/common/locales/generate-locales-tool/array-deduplication.ts | [
"MIT"
] |
<?xml version="1.0" encoding="UTF-8"?>
<!-- ******************************************************************* -->
<!-- -->
<!-- Copyright IBM Corp. 2010, 2014 -->
<!-- -->
<!-- Licensed under the Apache License, Version 2.0 (the "License"); -->
<!-- you may not use this file except in compliance with the License. -->
<!-- You may obtain a copy of the License at: -->
<!-- -->
<!-- http://www.apache.org/licenses/LICENSE-2.0 -->
<!-- -->
<!-- Unless required by applicable law or agreed to in writing, software -->
<!-- distributed under the License is distributed on an "AS IS" BASIS, -->
<!-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or -->
<!-- implied. See the License for the specific language governing -->
<!-- permissions and limitations under the License. -->
<!-- -->
<!-- ******************************************************************* -->
<!-- DO NOT EDIT. THIS FILE IS GENERATED. -->
<faces-config>
<faces-config-extension>
<namespace-uri>http://www.ibm.com/xsp/coreex</namespace-uri>
<default-prefix>xe</default-prefix>
<designer-extension>
<control-subpackage-name>dynamicview</control-subpackage-name>
</designer-extension>
</faces-config-extension>
<component>
<description>%component.dynamicViewPanel.descr%</description>
<display-name>%component.dynamicViewPanel.name%</display-name>
<component-type>com.ibm.xsp.extlib.dynamicview.DynamicViewPanel</component-type>
<component-class>com.ibm.xsp.extlib.component.dynamicview.UIDynamicViewPanel</component-class>
<property>
<description>%/javax.faces.Data/rows/descr%</description>
<display-name>%/javax.faces.Data/rows/name%</display-name>
<property-name>rows</property-name>
<property-class>int</property-class>
<property-extension>
<designer-extension>
<category>data</category>
</designer-extension>
</property-extension>
</property>
<property>
<description>%property.customizerBean.descr%</description>
<display-name>%property.customizerBean.name%</display-name>
<property-name>customizerBean</property-name>
<property-class>java.lang.String</property-class>
<property-extension>
<localizable>false</localizable>
<designer-extension>
<category>basics</category>
<tags>
todo
</tags>
</designer-extension>
</property-extension>
</property>
<property>
<description>%property.onColumnClick.descr%</description>
<display-name>%property.onColumnClick.name%</display-name>
<property-name>onColumnClick</property-name>
<property-class>java.lang.String</property-class>
<property-extension>
<designer-extension>
<category>events</category>
<event>true</event>
<subcategory>mouse-event</subcategory>
</designer-extension>
</property-extension>
</property>
<property>
<description>%property.showCheckbox.descr%</description>
<display-name>%property.showCheckbox.name%</display-name>
<property-name>showCheckbox</property-name>
<property-class>boolean</property-class>
<property-extension>
<designer-extension>
<category>format</category>
</designer-extension>
</property-extension>
</property>
<property>
<description>%property.showHeaderCheckbox.descr%</description>
<display-name>%property.showHeaderCheckbox.name%</display-name>
<property-name>showHeaderCheckbox</property-name>
<property-class>boolean</property-class>
<property-extension>
<designer-extension>
<category>format</category>
</designer-extension>
</property-extension>
</property>
<component-extension>
<base-component-type>com.ibm.xsp.ViewPanel</base-component-type>
<component-family>javax.faces.Data</component-family>
<renderer-type>com.ibm.xsp.ViewPanel</renderer-type>
<tag-name>dynamicViewPanel</tag-name>
<designer-extension>
<in-palette>true</in-palette>
<category>Extension Library</category>
</designer-extension>
</component-extension>
</component>
</faces-config>
| XPages | 3 | jesse-gallagher/XPagesExtensionLibrary | extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.controls/src/com/ibm/xsp/extlib/config/extlib-dynamicview.xsp-config | [
"Apache-2.0"
] |
function pko --description 'copy inline content to the piknik clipboard'
echo $argv | piknik -copy;
end
| fish | 3 | Shark/piknik | fish-shell/functions/pko.fish | [
"BSD-2-Clause"
] |
@prefix eg: <http://example.org/eg#> .
eg:s eg:p [ =: _:o ; eg:name "o" ] .
| Turtle | 2 | joshrose/audacity | lib-src/lv2/serd/tests/bad/bad-ext-namedblank-op.ttl | [
"CC-BY-3.0"
] |
; Clean, simple and efficient code -- that's the power of Racket!
; http://racket-lang.org/
(define (bottles n more)
(printf "~a bottle~a of beer~a"
(case n [(0) "no more"] [(1) "1"] [else n])
(if (= n 1) "" "s")
more))
(for ([n (in-range 99 0 -1)])
(bottles n " on the wall, ")
(bottles n ".\n")
(printf "Take one down and pass it around, ")
(bottles (sub1 n) " on the wall.\n\n"))
(displayln "No more bottles of beer on the wall, no more bottles of beer.")
(displayln "Go to the store and buy some more, 99 bottles of beer on the wall.")
| Racket | 4 | JavascriptID/sourcerer-app | src/test/resources/samples/langs/Racket/99-bottles-of-beer.scrbl | [
"MIT"
] |
package flash.xml;
extern class XMLNode {
@:flash.property var attributes(get,set) : Dynamic;
@:flash.property var childNodes(get,never) : Array<Dynamic>;
var firstChild : XMLNode;
var lastChild : XMLNode;
@:flash.property var localName(get,never) : String;
@:flash.property var namespaceURI(get,never) : String;
var nextSibling : XMLNode;
var nodeName : String;
var nodeType : XMLNodeType;
var nodeValue : String;
var parentNode : XMLNode;
@:flash.property var prefix(get,never) : String;
var previousSibling : XMLNode;
function new(type : XMLNodeType, value : String) : Void;
function appendChild(node : XMLNode) : Void;
function cloneNode(deep : Bool) : XMLNode;
function getNamespaceForPrefix(prefix : String) : String;
function getPrefixForNamespace(ns : String) : String;
private function get_attributes() : Dynamic;
private function get_childNodes() : Array<Dynamic>;
private function get_localName() : String;
private function get_namespaceURI() : String;
private function get_prefix() : String;
function hasChildNodes() : Bool;
function insertBefore(node : XMLNode, before : XMLNode) : Void;
function removeNode() : Void;
private function set_attributes(value : Dynamic) : Dynamic;
function toString() : String;
}
| Haxe | 3 | Alan-love/haxe | std/flash/xml/XMLNode.hx | [
"MIT"
] |
--TEST--
Nop statement before namespace
--FILE--
<?php
;
namespace Foo;
?>
===DONE===
--EXPECT--
===DONE===
| PHP | 1 | NathanFreeman/php-src | Zend/tests/namespace_first_stmt_nop.phpt | [
"PHP-3.01"
] |
struct Foo {
1: optional string bar (go.tag = "json:\"bar\" db:\"id_text\"")
}
struct Baz {
1: optional string bar = "foobarbaz" (go.tag = "json:\"bar\" db:\"id_text\"")
}
| Thrift | 3 | JonnoFTW/thriftpy2 | tests/parser-cases/issue_252.thrift | [
"MIT"
] |
redo-ifchange bork
echo sub
echo sub >&2
printf y >>$1.log
| Stata | 0 | BlameJohnny/redo | t/351-deps-forget/sub.do | [
"Apache-2.0"
] |
MSTRINGIFY(
cbuffer ComputeBoundsCB : register( b0 )
{
int numNodes;
int numSoftBodies;
int padding1;
int padding2;
};
// Node indices for each link
StructuredBuffer<int> g_vertexClothIdentifier : register( t0 );
StructuredBuffer<float4> g_vertexPositions : register( t1 );
RWStructuredBuffer<uint4> g_clothMinBounds : register( u0 );
RWStructuredBuffer<uint4> g_clothMaxBounds : register( u1 );
groupshared uint4 clothMinBounds[256];
groupshared uint4 clothMaxBounds[256];
[numthreads(128, 1, 1)]
void
ComputeBoundsKernel( uint3 Gid : SV_GroupID, uint3 DTid : SV_DispatchThreadID, uint3 GTid : SV_GroupThreadID, uint GI : SV_GroupIndex )
{
const unsigned int UINT_MAX = 0xffffffff;
// Init min and max bounds arrays
if( GTid.x < numSoftBodies )
{
clothMinBounds[GTid.x] = uint4(UINT_MAX, UINT_MAX, UINT_MAX, UINT_MAX);
clothMaxBounds[GTid.x] = uint4(0,0,0,0);
}
AllMemoryBarrierWithGroupSync();
int nodeID = DTid.x;
if( nodeID < numNodes )
{
int clothIdentifier = g_vertexClothIdentifier[nodeID];
if( clothIdentifier >= 0 )
{
float3 position = g_vertexPositions[nodeID].xyz;
// Reinterpret position as uint
uint3 positionUInt = uint3(asuint(position.x), asuint(position.y), asuint(position.z));
// Invert sign bit of positives and whole of negatives to allow comparison as unsigned ints
//positionUInt.x ^= uint((-int(positionUInt.x >> 31) | 0x80000000));
//positionUInt.y ^= uint((-int(positionUInt.y >> 31) | 0x80000000));
//positionUInt.z ^= uint((-int(positionUInt.z >> 31) | 0x80000000));
positionUInt.x ^= (1+~(positionUInt.x >> 31) | 0x80000000);
positionUInt.y ^= (1+~(positionUInt.y >> 31) | 0x80000000);
positionUInt.z ^= (1+~(positionUInt.z >> 31) | 0x80000000);
// Min/max with the LDS values
InterlockedMin(clothMinBounds[clothIdentifier].x, positionUInt.x);
InterlockedMin(clothMinBounds[clothIdentifier].y, positionUInt.y);
InterlockedMin(clothMinBounds[clothIdentifier].z, positionUInt.z);
InterlockedMax(clothMaxBounds[clothIdentifier].x, positionUInt.x);
InterlockedMax(clothMaxBounds[clothIdentifier].y, positionUInt.y);
InterlockedMax(clothMaxBounds[clothIdentifier].z, positionUInt.z);
}
}
AllMemoryBarrierWithGroupSync();
// Use global atomics to update the global versions of the data
if( GTid.x < numSoftBodies )
{
InterlockedMin(g_clothMinBounds[GTid.x].x, clothMinBounds[GTid.x].x);
InterlockedMin(g_clothMinBounds[GTid.x].y, clothMinBounds[GTid.x].y);
InterlockedMin(g_clothMinBounds[GTid.x].z, clothMinBounds[GTid.x].z);
InterlockedMax(g_clothMaxBounds[GTid.x].x, clothMaxBounds[GTid.x].x);
InterlockedMax(g_clothMaxBounds[GTid.x].y, clothMaxBounds[GTid.x].y);
InterlockedMax(g_clothMaxBounds[GTid.x].z, clothMaxBounds[GTid.x].z);
}
}
); | HLSL | 3 | BonJovi1/Bullet-the-Blue-Sky | external/bullet-2.81-rev2613/src/BulletMultiThreaded/GpuSoftBodySolvers/DX11/HLSL/ComputeBounds.hlsl | [
"WTFPL"
] |
Sets
i generators / 1 * %subprob% /
k max num piecewise pts / 1 * 11 /
kk max piecewise pts for fut val func / 1 * %nPts% /
;
Scalar
numGens number of generators without buy and sell generators ;
numGens = %subprob% - 2 ;
Variables
u(i) generator on off decisions
v(i) turn on variable
y(i) piecewise linear cost
yy(i) piecewise linear cost for future value function
z(i) real power from generator i
g(i,kk) variables for piecewise linear cost
gb(k) pwl variable for buy generator
gs(k) pwl variable for sell generator
zc objective
;
Positive Variable y, z, g, gb, gs ;
Binary Variable u, v ;
$GDXin %probdata%
Set dynk(i,k) ;
Parameter
numPts(i) number of valid cost pts for each generator ;
$load numPts
dynk(i,k) = YES$(ord(k) le numPts(i));
Parameter
q(i,k) x coordinates quantity of piecewise function ;
$load q
Parameter
c(i,k) y coordinates cost of piecewise function ;
$load c
Parameter
c_bar(i) minimum generator turn on cost ;
$load c_bar
Parameter
h_bar(i) generator start up cost ;
$load h_bar
Parameter
Pow(kk,i) possible power levels for each generator ;
$load Pow
Parameter
Feval(kk,i) possible cost function vals for generator ;
$load Feval
Parameter
Ru(i) generator ramp up rate ;
$load Ru
Parameter
Rd(i) generator ramp down rate ;
$load Rd
Parameter
q_min(i) generator min power level ;
$load q_min
Parameter
q_max(i) generator max power level ;
$load q_max
$GDXin
$GDXIN ubdata.gdx
Parameter
u_prev(i) on off generator decisions ;
$load u_prev
Parameter
z_prev(i) previous power level to enforce ramping constraints ;
$load z_prev
Parameter
Voff(i) future cost incurred when generator off ;
$onUNDF
$load Voff
Parameter
Von(i,kk) future cost incurred when generator on ;
$onUNDF
$load Von
Parameter
u_l(i) on off generator decisions ;
$load u_l
Parameter
v_l(i) turn on generator decisions ;
$load v_l
Scalar
d observed demand that needs to be satisfied ;
$load d
$GDXIN
Scalar time keep track of total time ;
Equations
cost objective function
demEq demand satisfaction constraint
turnOn(i) equation to set turn on variable
rampUpEq(i) ramp up constraint
rampDownEq(i) ramp down constraint
PWLEq1(i) 1st set of PWL eq
PWLEq2(i) 2nd set of PWL eq
PWLEq3(i) 3rd set of PWL eq
PWLEq4(i) 4th set of PWL eq
PWLEq1b(i) 1st set of PWL eq for buy gen
PWLEq2b(i) 2nd set of PWL eq for buy gen
PWLEq3b(i) 3rd set of PWL eq for buy gen
PWLEq1s(i) 1st set of PWL eq for sell gen
PWLEq2s(i) 2nd set of PWL eq for sell gen
PWLEq3s(i) 3rd set of PWL eq for sell gen
;
cost .. zc=e=sum(i,y(i)+c_bar(i)*u(i)+h_bar(i)*v(i))+sum(i$(ord(i) le numGens),yy(i)+(1-u(i))*Voff(i)) ;
demEq .. sum(i$(ord(i) ne %subprob%),z(i))-z('%subprob%')=e=d;
turnOn(i) .. v(i)=g=u(i)-u_prev(i) ;
rampUpEq(i)$(ord(i) le numGens) .. z(i) =l= z_prev(i) + Ru(i) + v(i)*q_min(i);
rampDownEq(i)$(ord(i) le numGens) .. z_prev(i) - Rd(i) - (1-u(i))*q_min(i) =l= z(i);
PWLEq1(i)$(ord(i) le numGens) .. sum(kk,g(i,kk)) =e= u(i);
PWLEq2(i)$(ord(i) le numGens) .. z(i) =e= sum(kk,Pow(kk,i)*g(i,kk));
PWLEq3(i)$(ord(i) le numGens) .. y(i) =e= sum(kk,Feval(kk,i)*g(i,kk));
PWLEq4(i)$(ord(i) le numGens) .. yy(i) =e= sum(kk,Von(i,kk)*g(i,kk));
* for buy generator
PWLEq1b(i)$(ord(i) eq (numGens+1)) .. sum(dynk(i,k),gb(k)) =e= u(i);
PWLEq2b(i)$(ord(i) eq (numGens+1)) .. z(i) =e= sum(dynk(i,k),q(i,k)*gb(k));
PWLEq3b(i)$(ord(i) eq (numGens+1)) .. y(i) =e= sum(dynk(i,k),c(i,k)*gb(k));
* for sell generator
PWLEq1s(i)$(ord(i) eq (numGens+2)) .. sum(dynk(i,k),gs(k)) =e= u(i);
PWLEq2s(i)$(ord(i) eq (numGens+2)) .. z(i) =e= sum(dynk(i,k),q(i,k)*gs(k));
PWLEq3s(i)$(ord(i) eq (numGens+2)) .. y(i) =e= sum(dynk(i,k),c(i,k)*gs(k));
u.fx(i)$(ord(i) le numGens) = u_l(i) ;
u.fx(i)$(ord(i) gt numGens) = 1 ;
v.fx(i)$(ord(i) le numGens) = v_l(i) ;
v.fx(i)$(ord(i) gt numGens) = 1 ;
Model UC /all/ ;
*UC.optca = 0 ;
*UC.optcr = 0 ;
* 0.5% optimality gap
UC.optcr = 0.005 ;
time = timeelapsed;
Solve UC using mip minimizing zc ;
time = timeelapsed - time ;
scalars optca, optcr, modelstatus ;
optca = abs(UC.objest - UC.objval) ;
optcr = optca / max(abs(UC.objest),abs(UC.objval)) ;
modelstatus = UC.Modelstat ;
parameters z_lo(i), z_hi(i) ;
z_lo(i) = z_prev(i) - Rd(i) - (1-u.l(i))*q_min(i) ;
z_hi(i) = z_prev(i) + Ru(i) + v.l(i)*q_min(i) ;
scalars c_bar_cost, h_bar_cost, pw_cost, pw_gen_cost, tot_cost ;
c_bar_cost = sum(i,c_bar(i)*u.l(i));
h_bar_cost = sum(i,h_bar(i)*v.l(i));
pw_cost = sum(i,y.l(i));
pw_gen_cost = sum(i$(ord(i) le numGens),y.l(i));
tot_cost = pw_cost + c_bar_cost + h_bar_cost ;
parameter z_l(i) ;
z_l(i) = z.l(i) ;
execute_unloadIdx 'ubout.gdx', tot_cost, z_l, z_lo, z_hi, optca, optcr, time, modelstatus ;
| GAMS | 4 | brentian/dual-adp-suc | code/ub_fv.gms | [
"MIT"
] |
;;; app/taskrunner/autoload.el -*- lexical-binding: t; -*-
;;;###autoload
(defun +taskrunner/project-tasks ()
"Invokes `ivy-taskrunner' or `helm-tasksrunner', depending on which is
available."
(interactive)
(cond ((featurep! :completion ivy) (ivy-taskrunner))
((featurep! :completion helm) (helm-taskrunner))))
| Emacs Lisp | 4 | leezu/doom-emacs | modules/tools/taskrunner/autoload.el | [
"MIT"
] |
canvas {
width = 800
height = 700
}
Colors {
-- Keenan palette
black = rgba(0.0, 0.0, 0.0, 1.0)
darkpurple = rgba(0.549,0.565,0.757, 1.0)
purple2 = rgba(0.106, 0.122, 0.54, 0.2)
lightpurple = rgba(0.816,0.824, 0.902, 1.0)
verylightpurple = rgba(0.953, 0.957, 0.977, 1.0)
purple3 = rgba(0.557, 0.627, 0.769, 1.0)
midnightblue = rgba(0.14, 0.16, 0.52, 1.0)
lightslategray = rgba(0.50, 0.51, 0.69, 1.0)
silver = rgba(0.71, 0.72, 0.79, 1.0)
gainsboro = rgba(0.87, 0.87, 0.87, 1.0)
darkgray = rgba(0.1, 0.1, 0.1, 1.0)
mediumgray = rgba(0.5, 0.5, 0.5, 1.0)
gray = rgba(0.8, 0.8, 0.8, 1.0)
red = rgba(1.0, 0.0, 0.0, 1.0)
pink = rgba(1.0, 0.4, 0.7, 1.0)
yellow = rgba(1.0, 1.0, 0.0, 1.0)
orange = rgba(1.0, 0.6, 0.0, 1.0)
lightorange = rgba(1.0, 0.6, 0.0, 0.25)
green = rgba(0.0, 1.0, 0.0, 1.0)
blue = rgba(0.0, 0.0, 1.0, 1.0)
sky = rgba(0.325, 0.718, 0.769, 1.0)
lightsky = rgba(0.325, 0.718, 0.769, 0.25)
lightblue = rgba(0.0, 0.0, 1.0, 0.25)
cyan = rgba(0.0, 1.0, 1.0, 1.0)
purple = rgba(0.5, 0.0, 0.5, 1.0)
white = rgba(1.0, 1.0, 1.0, 1.0)
none = none()
bluegreen = rgba(0.44, 0.68, 0.60, 1.0)
}
const {
pi = 3.14159
arrowheadSize = 0.65
strokeWidth = 1.75
textPadding = 7.0
textPadding2 = 25.0
repelWeight = 0.7 -- TODO: Reverted from 0.0
repelWeight2 = 0.5
fontSize = "18pt"
containPadding = 50.0
rayLength = 100.0
pointSize = 4.0
pointStroke = 0.0
thetaRadius = 30.0
bigThetaRadius = 40.0
circleRadius = 150.0
}
--Plane
Plane p {
dim = 700.0
p.text = Text {
center : ((dim / 2.0) - const.textPadding2, (dim / 2.0) - const.textPadding2)
string : p.label
fontSize : const.fontSize
}
-- inner: #f3f4f9, outer: #8e93c4
p.icon = Rectangle {
-- angle : 0.0
-- color : Colors.purple2
color : Colors.none -- TODO: arrange angle markers so plane can be opaque
strokeColor : Colors.purple3
strokeWidth : 2.0
center : (0.0, 0.0)
w : dim
h : dim
}
p.text above p.icon
}
--Point
Point p {
p.x = ?
p.y = ?
p.vec = (p.x, p.y)
p.color = Colors.black
p.icon = Circle {
center: p.vec
r : const.pointSize
color : Colors.black
strokeWidth : 0.0
strokeColor : Colors.black
}
p.text = Text {
string : p.label
rotation : 0.0
color : Colors.black
fontSize : const.fontSize
}
ensure atDist(p.icon, p.text, const.textPadding)
}
Point p
with Plane P
where In(p, P) {
-- TODO: the problem is that this ensures the padding is const? Or is > padding okay?
-- There's a choice of whether to put padding on the point or the text for containment
ensure contains(P.icon, p.icon, const.containPadding)
ensure contains(P.icon, p.text, 0.0)
p.icon above P.icon
p.text above P.icon
}
Point p, q, r
where Collinear(p, q, r) {
ensure collinear(p.icon.center, q.icon.center, r.icon.center)
encourage repel(p.icon, q.icon, const.repelWeight)
encourage repel(q.icon, r.icon, const.repelWeight)
}
--Linelike
Linelike l {
l.color = Colors.black
l.icon = Line {
start : (?, ?)
end : (?, ?)
color : l.color
thickness : const.strokeWidth
stroke : "none"
style : "solid"
}
}
Ray r
where r := MkRay(base, direction)
with Point base; Point direction {
r.start = base.vec
r.end = direction.vec
r.vec = direction.vec - base.vec
override r.icon = Line {
start : base.icon.center
end : ptOnLine(base.vec, direction.vec, norm(r.vec) + 40.)
color : r.color
thickness : const.strokeWidth
stroke : "none"
style : "solid"
arrowheadStyle: "arrowhead-2"
rightArrowhead : true
leftArrowhead : false
arrowheadSize: const.arrowheadSize
}
}
Line l
where l := MkLine(p, q)
with Point p; Point q {
l.start = p.vec
l.end = q.vec
l.vec = (q.x - p.x, q.y - p.y)
override l.icon = Line {
start : ptOnLine(p.vec,q.vec, -40.)
end : ptOnLine(p.vec, q.vec, norm(l.vec) + 40.)
color : l.color
thickness : const.strokeWidth
stroke : "none"
style : "solid"
arrowheadStyle: "arrowhead-2"
rightArrowhead : true
leftArrowhead : true
arrowheadSize: const.arrowheadSize
}
}
Linelike l1, l2 -- should this work with rays and lines?
where ParallelMarker1(l1, l2) {
l1.tick1 = Path {
pathData : pathFromPoints("open", chevron(l1.icon, 20., 6))
strokeWidth : 2.0
color : Colors.black
fill : Colors.none
}
l2.tick1 = Path {
pathData : pathFromPoints("open", chevron(l2.icon, 20., 5))
strokeWidth : 2.0
color : Colors.black
fill : Colors.none
}
}
Linelike l1, l2
where Parallel(l1, l2) {
-- make slopes
l1s = (l1.icon.end[1]-l1.icon.start[1])/(l1.icon.end[0]-l1.icon.start[0]) * 10000
l2s = (l2.icon.end[1]-l2.icon.start[1])/(l2.icon.end[0]-l2.icon.start[0]) * 10000
-- ensure equal(normalize(l1.vec) * 10000, normalize(l2.vec) * 10000)
ensure equal(l1s, l2s)
}
--Segment
Segment e
where e := MkSegment(p, q)
with Point p; Point q {
override e.vec = [q.x - p.x, q.y - p.y]
e.start = p.vec
e.end = q.vec
override e.icon = Line {
start : p.icon.center
end : q.icon.center
color : e.color
thickness : const.strokeWidth
stroke : "none"
style : "solid"
}
p.icon above e.icon
q.icon above e.icon
encourage pointLineDist(p.text.center, e.icon, 30.)
encourage pointLineDist(q.text.center, e.icon, 30.)
}
Segment e; Plane p {
e.icon above p.icon
}
Linelike s, t
where EqualLength(s, t) {
encourage equal(vdist(s.icon.start, s.icon.end), vdist(t.icon.start, t.icon.end))
}
--TODO eventually this should also provide an equal length marker since it is bisecting the segment
Segment s
where s := PerpendicularBisector(s2, p)
with Segment s2; Point p {
override s.icon = Line {
start : p.icon.center
end : midpoint(s2.icon.start, s2.icon.end)
color : s.color
thickness : const.strokeWidth
stroke : "none"
style : "solid"
}
startA = ptOnLine(s.icon.end, s.icon.start, const.thetaRadius)
endA = ptOnLine(s.icon.end, s2.icon.end, const.thetaRadius)
sweepA = arcSweepFlag(s.icon.end, startA, endA)
s.mark = Path {
pathData : pathFromPoints("open", [ptOnLine(s.icon.end, s.icon.start, 20.), innerPointOffset(s.icon.end, s.icon.start, s2.icon.end, 20.), ptOnLine(s.icon.end, s2.icon.end, 20.)])
strokeWidth : 2.0
color : Colors.black
fill : Colors.none
}
ensure perpendicular(s.icon.start, s.icon.end, s2.icon.end)
}
Segment s
where s := PerpendicularBisectorLabelPts(s2, p1, p2)
with Segment s2; Point p1, p2 {
override p2.vec = midpoint(s2.icon.start, s2.icon.end)
override s.icon = Line {
start : p1.icon.center
end : p2.vec
color : s.color
thickness : const.strokeWidth
stroke : "none"
style : "solid"
}
startA = ptOnLine(s.icon.end, s.icon.start, const.thetaRadius)
endA = ptOnLine(s.icon.end, s2.icon.end, const.thetaRadius)
sweepA = arcSweepFlag(s.icon.end, startA, endA)
s.mark = Path {
pathData : pathFromPoints("open", [ptOnLine(s.icon.end, s.icon.start, 20.), innerPointOffset(s.icon.end, s.icon.start, s2.icon.end, 20.), ptOnLine(s.icon.end, s2.icon.end, 20.)])
strokeWidth : 2.0
color : Colors.black
fill : Colors.none
}
ensure perpendicular(s.icon.start, s.icon.end, s2.icon.end)
}
-- NOTE: Get rid of repetition
Linelike s, t
where EqualLengthMarker1(s, t) {
override s.tick = Path {
pathData : ticksOnLine(s.icon.start, s.icon.end, 15., 1, 10.)
strokeWidth : 2.0
color : Colors.black
fill: Colors.none
}
override t.tick = Path {
pathData : ticksOnLine(t.icon.start, t.icon.end, 15., 1, 10.)
strokeWidth : 2.0
color : Colors.black
fill: Colors.none
}
s.tick above s.icon
t.tick above t.icon
}
-- NOTE: Get rid of repetition
Linelike s, t
where EqualLengthMarker2(s, t) {
--need slope of line, then need to equally distribute the tick marks
override s.tick = Path {
pathData : ticksOnLine(s.icon.start, s.icon.end, 15., 2., 10.)
strokeWidth : 2.0
color : Colors.black
fill: Colors.none
}
override t.tick = Path {
pathData : ticksOnLine(t.icon.start, t.icon.end, 15., 2., 10.)
strokeWidth : 2.0
color : Colors.black
fill: Colors.none
}
s.tick above s.icon
t.tick above t.icon
}
-- NOTE: Get rid of repetition
Linelike s, t
where EqualLengthMarker3(s, t) {
--need slope of line, then need to equally distribute the tick marks
override s.tick = Path {
pathData : ticksOnLine(s.icon.start, s.icon.end, 15., 3, 10.)
strokeWidth : 2.0
color : Colors.black
fill: Colors.none
}
override t.tick = Path {
pathData : ticksOnLine(t.icon.start, t.icon.end, 15., 3, 10.)
strokeWidth : 2.0
color : Colors.black
fill: Colors.none
}
s.tick above s.icon
t.tick above t.icon
}
--Angle
Angle theta
where theta := InteriorAngle(p, q, r)
with Point p; Point q; Point r {
theta.p = p.vec
theta.q = q.vec
theta.r = r.vec
theta.color = setOpacity(Colors.darkpurple, 0.4)
theta.side1 = Line {
start : p.icon.center
end : q.icon.center
color : theta.color
thickness : const.strokeWidth
stroke : 2.
style : "solid"
}
theta.side2 = Line {
start : q.icon.center
end : r.icon.center
color : theta.color
thickness : const.strokeWidth
stroke : 2.
style : "solid"
}
theta.radius = const.thetaRadius
encourage nonDegenerateAngle(p.icon, q.icon, r.icon)
}
-- NOTE: Get rid of repetition
Angle a, b
where EqualAngleMarker1(a, b) {
--find points from p->q, then q->r for each vector. draw vectors for each
startA = ptOnLine(a.q, a.p, a.radius)
endA = ptOnLine(a.q, a.r, a.radius)
sweepA = arcSweepFlag(a.q, startA, endA)
startB = ptOnLine(b.q, b.p, b.radius)
endB = ptOnLine(b.q, b.r, b.radius)
sweepB = arcSweepFlag(b.q, startB, endB)
override a.mark = Path {
pathData : arc("open", startA, endA, (a.radius, a.radius), 0, 0, sweepA)
strokeWidth : 2.0
color : Colors.black
fill: Colors.none
}
override b.mark = Path {
pathData : arc("open", startB, endB, (b.radius, b.radius), 0, 0, sweepB)
strokeWidth : 2.0
color : Colors.black
fill: Colors.none
}
}
-- NOTE: Get rid of repetition
Angle a, b
where EqualAngleMarker2(a, b) {
startA = ptOnLine(a.q, a.p, a.radius)
endA = ptOnLine(a.q, a.r, a.radius)
sweepA = arcSweepFlag(a.q, startA, endA)
startB = ptOnLine(b.q, b.p, b.radius)
endB = ptOnLine(b.q, b.r, b.radius)
sweepB = arcSweepFlag(b.q, startB, endB)
override a.mark = Path {
pathData : arc("open", startA, endA, (a.radius, a.radius), 0, 0, sweepA)
strokeWidth : 2.0
color : Colors.black
fill: Colors.none
}
override b.mark = Path {
pathData : arc("open", startB, endB, (b.radius, b.radius), 0, 0, sweepB)
strokeWidth : 2.0
color : Colors.black
fill: Colors.none
}
bigR = const.bigThetaRadius
startAbig = ptOnLine(a.q, a.p, bigR)
endAbig = ptOnLine(a.q, a.r, bigR)
startBbig = ptOnLine(b.q, b.p, bigR)
endBbig = ptOnLine(b.q, b.r, bigR)
override a.mark2 = Path {
pathData : arc("open", startAbig, endAbig, (bigR, bigR), 0, 0, sweepA)
strokeWidth : 2.0
color : Colors.black
fill: Colors.none
}
override b.mark2 = Path {
pathData : arc("open", startBbig, endBbig, (bigR, bigR), 0, 0, sweepB)
strokeWidth : 2.0
color : Colors.black
fill: Colors.none
}
}
-- NOTE: Get rid of repetition
Angle a, b
where EqualAngleMarker3(a, b) {
startA = ptOnLine(a.q, a.p, a.radius)
endA = ptOnLine(a.q, a.r, a.radius)
sweepA = arcSweepFlag(a.q, startA, endA)
startB = ptOnLine(b.q, b.p, b.radius)
endB = ptOnLine(b.q, b.r, b.radius)
sweepB = arcSweepFlag(b.q, startB, endB)
override a.mark = Path {
pathData : arc("open", startA, endA, (a.radius, a.radius), 0, 0, sweepA)
strokeWidth : 2.0
color : Colors.black
fill: Colors.none
}
override b.mark = Path {
pathData : arc("open", startB, endB, (b.radius, b.radius), 0, 0, sweepB)
strokeWidth : 2.0
color : Colors.black
fill: Colors.none
}
midR = const.bigThetaRadius
startAmid = ptOnLine(a.q, a.p, midR)
endAmid = ptOnLine(a.q, a.r, midR)
startBmid = ptOnLine(b.q, b.p, midR)
endBmid = ptOnLine(b.q, b.r, midR)
override a.mark2 = Path {
pathData : arc("open", startAmid, endAmid, (midR, midR), 0, 0, sweepA)
strokeWidth : 2.0
color : Colors.black
fill: Colors.none
}
override b.mark2 = Path {
pathData : arc("open", startBmid, endBmid, (midR, midR), 0, 0, sweepB)
strokeWidth : 2.0
color : Colors.black
fill: Colors.none
}
bigR = const.bigThetaRadius + 10.
startAbig = ptOnLine(a.q, a.p, bigR)
endAbig = ptOnLine(a.q, a.r, bigR)
startBbig = ptOnLine(b.q, b.p, bigR)
endBbig = ptOnLine(b.q, b.r, bigR)
override a.mark3 = Path {
pathData : arc("open", startAbig, endAbig, (bigR, bigR), 0, 0, sweepA)
strokeWidth : 2.0
color : Colors.black
fill: Colors.none
}
override b.mark3 = Path {
pathData : arc("open", startBbig, endBbig, (bigR, bigR), 0, 0, sweepB)
strokeWidth : 2.0
color : Colors.black
fill: Colors.none
}
}
Angle a, b
where EqualAngle(a, b) {
-- make sure angle a is equal to angle b
dotA = dot(normalize(a.p - a.q), normalize(a.r - a.q))
dotB = dot(normalize(b.p - b.q), normalize(b.r - b.q))
ensure equal(dotA, dotB)
}
Angle a
where RightUnmarked(a) {
ensure perpendicular(a.p, a.q, a.r)
}
Angle a
where RightMarked(a) {
--render half square path of size a.radius
override a.mark = Path {
pathData : pathFromPoints("open", [ptOnLine(a.q, a.p, 20.), innerPointOffset(a.q, a.p, a.r, 20.), ptOnLine(a.q, a.r, 20.)])
strokeWidth : 2.0
color : Colors.black
fill : Colors.none
}
ensure perpendicular(a.p, a.q, a.r)
}
-- TODO inRange NaN's
Angle a
where Supplementary(a) {
ensure inRange(dot(a.p - a.q, a.r - a.q), 0, 1)
}
Triangle t; Plane P
where t := MkTriangle(p, q, r)
with Point p; Point q; Point r {
t.PQ above P.icon
t.QR above P.icon
t.RP above P.icon
}
Triangle t
where t := MkTriangle(p, q, r)
with Point p; Point q; Point r {
t.color = Colors.black
t.PQ = Line {
start : p.icon.center
end : q.icon.center
color : t.color
thickness : const.strokeWidth
stroke : "none"
style : "solid"
}
t.QR = Line {
start : q.icon.center
end : r.icon.center
color : t.color
thickness : const.strokeWidth
stroke : "none"
style : "solid"
}
t.RP = Line {
start : r.icon.center
end : p.icon.center
color : t.color
thickness : const.strokeWidth
stroke : "none"
style : "solid"
}
}
Point p
where Incenter(p, T)
with Triangle T {
s1 = T.PQ.start
s2 = T.QR.start
s3 = T.RP.start
a = vdist(s2, s3)
b = vdist(s3, s1)
c = vdist(s1, s2)
denom = a + b + c
vec = vmul(a, s1) + vmul(b, s2) + vmul(c, s3)
-- override p.vec = (275 / 42, 156 / 42)
override p.vec = vmul(1/denom, vec)
semip = (a + b + c) / 2
clr = setOpacity(Colors.darkpurple, 0.6)
override T.icon = Circle {
center : p.vec
r : sqrt(((semip - a) * (semip - b) * (semip - c))/ semip)
strokeWidth : const.strokeWidth
strokeColor : clr
color : Colors.none
}
}
Point p
where Circumcenter(p, T)
with Triangle T {
clr = setOpacity(Colors.darkpurple, 0.6)
override p.icon = Circle {
center : p.vec
r : const.pointSize
strokeWidth : const.strokeWidth
strokeColor : clr
color : clr
}
T.icon = Circle {
center : p.vec
r : ?
strokeWidth : const.strokeWidth
strokeColor : clr
color : Colors.none
}
ensure ptCircleIntersect(T.PQ.start, T.icon)
ensure ptCircleIntersect(T.QR.start, T.icon)
ensure ptCircleIntersect(T.RP.start, T.icon)
encourage repelPt(const.repelWeight, T.PQ.start, T.QR.start)
encourage repelPt(const.repelWeight, T.QR.start, T.RP.start)
}
Point p
where Centroid(p, T)
with Triangle T {
clr = setOpacity(Colors.darkpurple, 0.6)
override p.vec = vmul(1/3, T.PQ.start + T.QR.start + T.RP.start)
override p.icon = Circle {
center : p.vec
r : const.pointSize
strokeWidth : const.strokeWidth
strokeColor : clr
color : clr
}
override T.icon = Line {
start : T.PQ.start
end : midpoint(T.QR.start, T.QR.end)
color : clr
thickness : const.strokeWidth
stroke : "none"
style : "solid"
}
override T.line2 = Line {
start : T.QR.start
end : midpoint(T.RP.start, T.RP.end)
color : clr
thickness : const.strokeWidth
stroke : "none"
style : "solid"
}
override T.icon3 = Line {
start : T.RP.start
end : midpoint(T.PQ.start, T.PQ.end)
color : clr
thickness : const.strokeWidth
stroke : "none"
style : "solid"
}
}
Point p
where Orthocenter(p, T)
with Triangle T {
clr = setOpacity(Colors.darkpurple, 0.6)
T.icon = Line {
start : (?, ?)
end : p.vec
color : clr
thickness : const.strokeWidth
stroke : "none"
style : "solid"
}
T.icon2 = Line {
start : (?, ?)
end : p.vec
color : clr
thickness : const.strokeWidth
stroke : "none"
style : "solid"
}
T.icon3 = Line {
start : (?, ?)
end : p.vec
color : clr
thickness : const.strokeWidth
stroke : "none"
style : "solid"
}
-- TODO make it so that predicates can reference other predicates. 3/4 of these are copy-pasted from the Collinear predicate
ensure collinear(T.PQ.start, T.icon.start, T.PQ.end)
ensure collinear(T.QR.start, T.icon2.start, T.QR.end)
ensure collinear(T.RP.start, T.icon3.start, T.RP.end)
ensure perpendicular(T.PQ.start, T.icon.start, p.vec)
ensure perpendicular(T.QR.start, T.icon2.start, p.vec)
ensure perpendicular(T.RP.start, T.icon3.start, p.vec)
encourage repelPt(const.repelWeight, T.PQ.start, T.icon.start)
encourage repelPt(const.repelWeight, T.PQ.end, T.icon.start)
encourage repelPt(const.repelWeight, T.QR.start, T.icon2.start)
encourage repelPt(const.repelWeight, T.QR.end, T.icon2.start)
encourage repelPt(const.repelWeight, T.RP.start, T.icon3.start)
encourage repelPt(const.repelWeight, T.RP.end, T.icon3.start)
}
--Rectangle
-- -- Should the rectangle be constructed from the points, or vice versa?
Rectangle R
where R := MkRectangle(p, q, r, s)
with Point p; Point q; Point r; Point s {
override R.color = Colors.none
override R.icon = Path {
pathData : pathFromPoints("closed", [p.icon.center, q.icon.center, r.icon.center, s.icon.center])
strokeWidth : const.strokeWidth
fill : R.color
color : Colors.black
}
ensure equal(vdist(p.icon.center, q.icon.center), vdist(r.icon.center, s.icon.center))
ensure equal(vdist(p.icon.center, s.icon.center), vdist(q.icon.center, r.icon.center))
ensure perpendicular(p.icon.center, q.icon.center, r.icon.center)
ensure perpendicular(q.icon.center, s.icon.center, r.icon.center)
-- R.icon above P.icon
}
Quadrilateral Q
where Q := MkQuadrilateral(p, q, r, s)
with Point p; Point q; Point r; Point s {
Q.p = p.icon.center
Q.q = q.icon.center
Q.r = r.icon.center
Q.s = s.icon.center
override Q.color = Colors.black
Q.side1 = Line {
start : Q.p
end : Q.q
color : Q.color
thickness : const.strokeWidth
stroke : "none"
style : "solid"
}
Q.side2 = Line {
start : Q.r
end : Q.q
color : Q.color
thickness : const.strokeWidth
stroke : "none"
style : "solid"
}
Q.side3 = Line {
start : Q.s
end : Q.r
color : Q.color
thickness : const.strokeWidth
stroke : "none"
style : "solid"
}
Q.side4 = Line {
start : Q.p
end : Q.s
color : Q.color
thickness : const.strokeWidth
stroke : "none"
style : "solid"
}
}
--TODO corner case shoves points far off canvas
Quadrilateral Q
where Parallelogram(Q) {
pq = (Q.q[1]-Q.p[1])/(Q.q[0]-Q.p[0]) * 10000
rs = (Q.r[1]-Q.s[1])/(Q.r[0]-Q.s[0]) * 10000
qr = (Q.q[1]-Q.r[1])/(Q.q[0]-Q.r[0]) * 10000
ps = (Q.s[1]-Q.p[1])/(Q.s[0]-Q.p[0]) * 10000
-- make opposite sides same length
ensure equal(vdist(Q.p, Q.q), vdist(Q.r, Q.s))
ensure equal(vdist(Q.p, Q.s), vdist(Q.q, Q.r))
-- make opposite sides have parallel
ensure equal(pq, rs)
ensure equal(qr, ps)
-- area must be at least a certain size
v1 = Q.p - Q.q
v2 = Q.r - Q.q
ensure lessThan(10000, (v1[0]*v2[1])-(v1[1]*v2[0])) -- 2D cross product
}
--FUNCTIONS
Segment s
where s := MidSegment(T, p, q)
with Triangle T; Point p; Point q {
override p.vec = midpoint(T.PQ.start, T.PQ.end)
override q.vec = midpoint(T.RP.start, T.RP.end)
override s.icon = Line {
start : p.icon.center
end : q.icon.center
color : s.color
thickness : const.strokeWidth
stroke : "none"
style : "solid"
}
}
Point p
where p := MkMidpoint(l)
with Linelike l {
override p.vec = midpoint(l.icon.start, l.icon.end)
}
Point p
where Midpoint(l, p)
with Linelike l {
override p.vec = midpoint(l.icon.start, l.icon.end)
}
-- TODO sometimes bisector becomes a scaled version of either side length PQ or QR of angle PQR
Linelike s
where AngleBisector(a, s)
with Angle a; Point p {
-- first angle = p, q, end
-- second angle = end, q, r
dotA = dot(normalize(a.p - a.q), normalize(s.end - a.q)) * 100
dotB = dot(normalize(s.end - a.q), normalize(a.r - a.q)) * 100
ensure equal(dotA, dotB)
}
Circle c {
c.radius = const.circleRadius
c.vec = (?, ?)
c.icon = Circle {
center : c.vec
r : c.radius
strokeWidth : const.strokeWidth
strokeColor : Colors.black
color : Colors.none
}
}
Circle c
where c := MkCircleR(p, q)
with Point p, q {
override c.radius = vdist(p.vec, q.vec)
override c.vec = p.icon.center
override c.icon = Circle {
center : c.vec
r : c.radius
strokeWidth : const.strokeWidth
strokeColor : Colors.black
color : Colors.none
}
}
-- TODO this can be reimplemented when issue #621 is resolved
-- Circle c
-- where c := MkCircleD(p, q)
-- with Point p, q {
-- override c.radius = vdist(p.vec, q.vec) / 2
-- }
Segment s
where s := Chord(c, p, q)
with Circle c; Point p, q {
override s.vec = q.vec - p.vec
override s.icon = Line {
start : p.icon.center
end : q.icon.center
color : s.color
thickness : const.strokeWidth
stroke : "none"
style : "solid"
}
p.icon above c.icon
q.icon above c.icon
ensure ptCircleIntersect(p.vec, c.icon)
ensure ptCircleIntersect(q.vec, c.icon)
}
Segment s
where s := Radius(c, p)
with Circle c; Point p {
override s.vec = p.vec - c.vec
override s.icon = Line {
start : c.vec
end : p.icon.center
color : Colors.black
thickness : const.strokeWidth
stroke : "none"
style : "solid"
}
p.icon above c.icon
ensure ptCircleIntersect(p.vec, c.icon)
}
Segment s
where s := Diameter(c, p, q)
with Circle c; Point p, q {
override s.vec = q.vec - p.vec
override s.icon = Line {
start : p.icon.center
end : q.icon.center
thickness : const.strokeWidth
stroke : "none"
style : "solid"
color : Colors.black
}
p.icon above c.icon
q.icon above c.icon
ensure collinear(p.icon.center, c.icon.center, q.icon.center)
ensure ptCircleIntersect(p.vec, c.icon)
ensure ptCircleIntersect(q.vec, c.icon)
}
Point p
where OnCircle(c, p)
with Circle c {
ensure ptCircleIntersect(p.vec, c.icon)
}
Point p
where CircleCenter(c, p)
with Circle c {
override p.vec = c.vec
} | TeX | 4 | meeki-ai/penrose | examples/geometry-domain/euclidean.sty | [
"MIT"
] |
/*
* Copyright (c) 2020-2021 Alex Spataru <https://github.com/alex-spataru>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
import QtQuick
import QtQuick.Window
import QtQuick.Layouts
import QtQuick.Controls
import Qt.labs.settings
import "../JsonEditor"
import "../Widgets" as Widgets
ApplicationWindow {
id: root
//
// Window options
//
minimumWidth: 910
minimumHeight: 720
title: qsTr("JSON Editor - %1").arg(Cpp_JSON_Editor.jsonFileName)
//
// Ensure that current JSON file is shown
//
onVisibleChanged: {
if (visible)
Cpp_JSON_Editor.openJsonFile(Cpp_JSON_Generator.jsonMapFilepath)
}
//
// Ask user to save changes before closing the window
//
onClosing: (close) => close.accepted = Cpp_JSON_Editor.askSave()
//
// Dummy string to increase width of buttons
//
readonly property string _btSpacer: " "
//
// Save window size
//
Settings {
category: "JSONEditor"
property alias windowX: root.x
property alias windowY: root.y
property alias windowWidth: root.width
property alias windowHeight: root.height
}
//
// Use page item to set application palette
//
Page {
anchors.margins: 0
anchors.fill: parent
palette.text: Cpp_ThemeManager.text
palette.buttonText: Cpp_ThemeManager.text
palette.windowText: Cpp_ThemeManager.text
palette.window: Cpp_ThemeManager.dialogBackground
background: Rectangle {
color: Cpp_ThemeManager.windowBackground
}
//
// Shadows
//
Widgets.Shadow {
source: header
horizontalOffset: 0
anchors.fill: header
} Widgets.Shadow {
source: footer
verticalOffset: -3
horizontalOffset: 0
anchors.fill: footer
}
//
// Header (project properties)
//
Header {
id: header
anchors {
margins: 0
top: parent.top
left: parent.left
right: parent.right
}
}
//
// Footer background
//
Footer {
id: footer
onCloseWindow: root.close()
onScrollToBottom: groupEditor.scrollToBottom()
anchors {
margins: 0
left: parent.left
right: parent.right
bottom: parent.bottom
}
}
//
// Window controls
//
RowLayout {
clip: true
anchors.fill: parent
spacing: app.spacing
anchors.topMargin: header.height
anchors.bottomMargin: footer.height
//
// Horizontal spacer
//
Item {
Layout.fillHeight: true
Layout.minimumWidth: app.spacing
Layout.maximumWidth: app.spacing
}
//
// JSON structure tree
//
Item {
Layout.fillHeight: true
Layout.minimumWidth: 240
Layout.maximumWidth: 240
Layout.topMargin: app.spacing * 2
Layout.bottomMargin: app.spacing * 2
visible: Cpp_JSON_Editor.groupCount !== 0
Widgets.Shadow {
source: jsonTree
anchors.fill: jsonTree
}
TreeView {
id: jsonTree
anchors.fill: parent
}
}
//
// Group editor
//
GroupEditor {
id: groupEditor
Layout.fillWidth: true
Layout.fillHeight: true
visible: Cpp_JSON_Editor.groupCount !== 0
}
//
// Empty project text & icon
//
Item {
Layout.fillWidth: true
Layout.fillHeight: true
visible: Cpp_JSON_Editor.groupCount === 0
ColumnLayout {
spacing: app.spacing
anchors.centerIn: parent
Widgets.Icon {
width: 128
height: 128
color: Cpp_ThemeManager.text
Layout.alignment: Qt.AlignHCenter
source: "qrc:/icons/developer-board.svg"
}
Label {
font.bold: true
font.pixelSize: 24
Layout.alignment: Qt.AlignHCenter
text: qsTr("Start something awesome")
}
Label {
opacity: 0.8
font.pixelSize: 18
Layout.alignment: Qt.AlignHCenter
text: qsTr("Click on the \"Add group\" button to begin")
}
}
}
//
// Horizontal spacer
//
Item {
Layout.fillHeight: true
Layout.minimumWidth: app.spacing
Layout.maximumWidth: app.spacing
}
}
}
}
| QML | 4 | Serial-Studio/Serial-Studio | assets/qml/Windows/JsonEditor.qml | [
"MIT"
] |
export default "other3";
| JavaScript | 0 | 1shenxi/webpack | test/configCases/parsing/import-ignore/other3.js | [
"MIT"
] |
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
#
# Translators:
# Erwann Mest <[email protected]>, 2019
# Etienne Desgagné <[email protected]>, 2015
# Martin Maillard <[email protected]>, 2015
# Martin Maillard <[email protected]>, 2015
# Stéphane Raimbault <[email protected]>, 2019
# Xavier Ordoquy <[email protected]>, 2015-2016
msgid ""
msgstr ""
"Project-Id-Version: Django REST framework\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-10-13 21:45+0200\n"
"PO-Revision-Date: 2020-10-13 19:45+0000\n"
"Last-Translator: Xavier Ordoquy <[email protected]>\n"
"Language-Team: French (http://www.transifex.com/django-rest-framework-1/django-rest-framework/language/fr/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: fr\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
#: authentication.py:70
msgid "Invalid basic header. No credentials provided."
msgstr "En-tête « basic » non valide. Informations d'identification non fournies."
#: authentication.py:73
msgid "Invalid basic header. Credentials string should not contain spaces."
msgstr "En-tête « basic » non valide. Les informations d'identification ne doivent pas contenir d'espaces."
#: authentication.py:83
msgid "Invalid basic header. Credentials not correctly base64 encoded."
msgstr "En-tête « basic » non valide. Encodage base64 des informations d'identification incorrect."
#: authentication.py:101
msgid "Invalid username/password."
msgstr "Nom d'utilisateur et/ou mot de passe non valide(s)."
#: authentication.py:104 authentication.py:206
msgid "User inactive or deleted."
msgstr "Utilisateur inactif ou supprimé."
#: authentication.py:184
msgid "Invalid token header. No credentials provided."
msgstr "En-tête « token » non valide. Informations d'identification non fournies."
#: authentication.py:187
msgid "Invalid token header. Token string should not contain spaces."
msgstr "En-tête « token » non valide. Un token ne doit pas contenir d'espaces."
#: authentication.py:193
msgid ""
"Invalid token header. Token string should not contain invalid characters."
msgstr "En-tête « token » non valide. Un token ne doit pas contenir de caractères invalides."
#: authentication.py:203
msgid "Invalid token."
msgstr "Token non valide."
#: authtoken/apps.py:7
msgid "Auth Token"
msgstr "Jeton d'authentification"
#: authtoken/models.py:13
msgid "Key"
msgstr "Clef"
#: authtoken/models.py:16
msgid "User"
msgstr "Utilisateur"
#: authtoken/models.py:18
msgid "Created"
msgstr "Création"
#: authtoken/models.py:27 authtoken/serializers.py:19
msgid "Token"
msgstr "Jeton"
#: authtoken/models.py:28
msgid "Tokens"
msgstr "Jetons"
#: authtoken/serializers.py:9
msgid "Username"
msgstr "Nom de l'utilisateur"
#: authtoken/serializers.py:13
msgid "Password"
msgstr "Mot de passe"
#: authtoken/serializers.py:35
msgid "Unable to log in with provided credentials."
msgstr "Impossible de se connecter avec les informations d'identification fournies."
#: authtoken/serializers.py:38
msgid "Must include \"username\" and \"password\"."
msgstr "« username » et « password » doivent être inclus."
#: exceptions.py:102
msgid "A server error occurred."
msgstr "Une erreur du serveur est survenue."
#: exceptions.py:142
msgid "Invalid input."
msgstr ""
#: exceptions.py:161
msgid "Malformed request."
msgstr "Requête malformée"
#: exceptions.py:167
msgid "Incorrect authentication credentials."
msgstr "Informations d'authentification incorrectes."
#: exceptions.py:173
msgid "Authentication credentials were not provided."
msgstr "Informations d'authentification non fournies."
#: exceptions.py:179
msgid "You do not have permission to perform this action."
msgstr "Vous n'avez pas la permission d'effectuer cette action."
#: exceptions.py:185
msgid "Not found."
msgstr "Pas trouvé."
#: exceptions.py:191
#, python-brace-format
msgid "Method \"{method}\" not allowed."
msgstr "Méthode « {method} » non autorisée."
#: exceptions.py:202
msgid "Could not satisfy the request Accept header."
msgstr "L'en-tête « Accept » n'a pas pu être satisfaite."
#: exceptions.py:212
#, python-brace-format
msgid "Unsupported media type \"{media_type}\" in request."
msgstr "Type de média « {media_type} » non supporté."
#: exceptions.py:223
msgid "Request was throttled."
msgstr "Requête ralentie."
#: exceptions.py:224
#, python-brace-format
msgid "Expected available in {wait} second."
msgstr ""
#: exceptions.py:225
#, python-brace-format
msgid "Expected available in {wait} seconds."
msgstr ""
#: fields.py:316 relations.py:245 relations.py:279 validators.py:90
#: validators.py:183
msgid "This field is required."
msgstr "Ce champ est obligatoire."
#: fields.py:317
msgid "This field may not be null."
msgstr "Ce champ ne peut être nul."
#: fields.py:701
msgid "Must be a valid boolean."
msgstr ""
#: fields.py:766
msgid "Not a valid string."
msgstr ""
#: fields.py:767
msgid "This field may not be blank."
msgstr "Ce champ ne peut être vide."
#: fields.py:768 fields.py:1881
#, python-brace-format
msgid "Ensure this field has no more than {max_length} characters."
msgstr "Assurez-vous que ce champ comporte au plus {max_length} caractères."
#: fields.py:769
#, python-brace-format
msgid "Ensure this field has at least {min_length} characters."
msgstr "Assurez-vous que ce champ comporte au moins {min_length} caractères."
#: fields.py:816
msgid "Enter a valid email address."
msgstr "Saisissez une adresse e-mail valide."
#: fields.py:827
msgid "This value does not match the required pattern."
msgstr "Cette valeur ne satisfait pas le motif imposé."
#: fields.py:838
msgid ""
"Enter a valid \"slug\" consisting of letters, numbers, underscores or "
"hyphens."
msgstr "Ce champ ne doit contenir que des lettres, des nombres, des tirets bas _ et des traits d'union."
#: fields.py:839
msgid ""
"Enter a valid \"slug\" consisting of Unicode letters, numbers, underscores, "
"or hyphens."
msgstr ""
#: fields.py:854
msgid "Enter a valid URL."
msgstr "Saisissez une URL valide."
#: fields.py:867
msgid "Must be a valid UUID."
msgstr ""
#: fields.py:903
msgid "Enter a valid IPv4 or IPv6 address."
msgstr "Saisissez une adresse IPv4 ou IPv6 valide."
#: fields.py:931
msgid "A valid integer is required."
msgstr "Un nombre entier valide est requis."
#: fields.py:932 fields.py:969 fields.py:1005 fields.py:1366
#, python-brace-format
msgid "Ensure this value is less than or equal to {max_value}."
msgstr "Assurez-vous que cette valeur est inférieure ou égale à {max_value}."
#: fields.py:933 fields.py:970 fields.py:1006 fields.py:1367
#, python-brace-format
msgid "Ensure this value is greater than or equal to {min_value}."
msgstr "Assurez-vous que cette valeur est supérieure ou égale à {min_value}."
#: fields.py:934 fields.py:971 fields.py:1010
msgid "String value too large."
msgstr "Chaîne de caractères trop longue."
#: fields.py:968 fields.py:1004
msgid "A valid number is required."
msgstr "Un nombre valide est requis."
#: fields.py:1007
#, python-brace-format
msgid "Ensure that there are no more than {max_digits} digits in total."
msgstr "Assurez-vous qu'il n'y a pas plus de {max_digits} chiffres au total."
#: fields.py:1008
#, python-brace-format
msgid ""
"Ensure that there are no more than {max_decimal_places} decimal places."
msgstr "Assurez-vous qu'il n'y a pas plus de {max_decimal_places} chiffres après la virgule."
#: fields.py:1009
#, python-brace-format
msgid ""
"Ensure that there are no more than {max_whole_digits} digits before the "
"decimal point."
msgstr "Assurez-vous qu'il n'y a pas plus de {max_whole_digits} chiffres avant la virgule."
#: fields.py:1148
#, python-brace-format
msgid "Datetime has wrong format. Use one of these formats instead: {format}."
msgstr "La date + heure n'a pas le bon format. Utilisez un des formats suivants : {format}."
#: fields.py:1149
msgid "Expected a datetime but got a date."
msgstr "Attendait une date + heure mais a reçu une date."
#: fields.py:1150
#, python-brace-format
msgid "Invalid datetime for the timezone \"{timezone}\"."
msgstr ""
#: fields.py:1151
msgid "Datetime value out of range."
msgstr ""
#: fields.py:1236
#, python-brace-format
msgid "Date has wrong format. Use one of these formats instead: {format}."
msgstr "La date n'a pas le bon format. Utilisez un des formats suivants : {format}."
#: fields.py:1237
msgid "Expected a date but got a datetime."
msgstr "Attendait une date mais a reçu une date + heure."
#: fields.py:1303
#, python-brace-format
msgid "Time has wrong format. Use one of these formats instead: {format}."
msgstr "L'heure n'a pas le bon format. Utilisez un des formats suivants : {format}."
#: fields.py:1365
#, python-brace-format
msgid "Duration has wrong format. Use one of these formats instead: {format}."
msgstr "La durée n'a pas le bon format. Utilisez l'un des formats suivants : {format}."
#: fields.py:1399 fields.py:1456
#, python-brace-format
msgid "\"{input}\" is not a valid choice."
msgstr "« {input} » n'est pas un choix valide."
#: fields.py:1402
#, python-brace-format
msgid "More than {count} items..."
msgstr "Plus de {count} éléments..."
#: fields.py:1457 fields.py:1603 relations.py:485 serializers.py:570
#, python-brace-format
msgid "Expected a list of items but got type \"{input_type}\"."
msgstr "Attendait une liste d'éléments mais a reçu « {input_type} »."
#: fields.py:1458
msgid "This selection may not be empty."
msgstr "Cette sélection ne peut être vide."
#: fields.py:1495
#, python-brace-format
msgid "\"{input}\" is not a valid path choice."
msgstr "« {input} » n'est pas un choix de chemin valide."
#: fields.py:1514
msgid "No file was submitted."
msgstr "Aucun fichier n'a été soumis."
#: fields.py:1515
msgid ""
"The submitted data was not a file. Check the encoding type on the form."
msgstr "La donnée soumise n'est pas un fichier. Vérifiez le type d'encodage du formulaire."
#: fields.py:1516
msgid "No filename could be determined."
msgstr "Le nom de fichier n'a pu être déterminé."
#: fields.py:1517
msgid "The submitted file is empty."
msgstr "Le fichier soumis est vide."
#: fields.py:1518
#, python-brace-format
msgid ""
"Ensure this filename has at most {max_length} characters (it has {length})."
msgstr "Assurez-vous que le nom de fichier comporte au plus {max_length} caractères (il en comporte {length})."
#: fields.py:1566
msgid ""
"Upload a valid image. The file you uploaded was either not an image or a "
"corrupted image."
msgstr "Transférez une image valide. Le fichier que vous avez transféré n'est pas une image, ou il est corrompu."
#: fields.py:1604 relations.py:486 serializers.py:571
msgid "This list may not be empty."
msgstr "Cette liste ne peut pas être vide."
#: fields.py:1605
#, python-brace-format
msgid "Ensure this field has at least {min_length} elements."
msgstr ""
#: fields.py:1606
#, python-brace-format
msgid "Ensure this field has no more than {max_length} elements."
msgstr ""
#: fields.py:1682
#, python-brace-format
msgid "Expected a dictionary of items but got type \"{input_type}\"."
msgstr "Attendait un dictionnaire d'éléments mais a reçu « {input_type} »."
#: fields.py:1683
msgid "This dictionary may not be empty."
msgstr ""
#: fields.py:1755
msgid "Value must be valid JSON."
msgstr "La valeur doit être un JSON valide."
#: filters.py:49 templates/rest_framework/filters/search.html:2
msgid "Search"
msgstr "Recherche"
#: filters.py:50
msgid "A search term."
msgstr ""
#: filters.py:180 templates/rest_framework/filters/ordering.html:3
msgid "Ordering"
msgstr "Ordre"
#: filters.py:181
msgid "Which field to use when ordering the results."
msgstr ""
#: filters.py:287
msgid "ascending"
msgstr "croissant"
#: filters.py:288
msgid "descending"
msgstr "décroissant"
#: pagination.py:174
msgid "A page number within the paginated result set."
msgstr ""
#: pagination.py:179 pagination.py:372 pagination.py:590
msgid "Number of results to return per page."
msgstr ""
#: pagination.py:189
msgid "Invalid page."
msgstr "Page non valide."
#: pagination.py:374
msgid "The initial index from which to return the results."
msgstr ""
#: pagination.py:581
msgid "The pagination cursor value."
msgstr ""
#: pagination.py:583
msgid "Invalid cursor"
msgstr "Curseur non valide"
#: relations.py:246
#, python-brace-format
msgid "Invalid pk \"{pk_value}\" - object does not exist."
msgstr "Clé primaire « {pk_value} » non valide - l'objet n'existe pas."
#: relations.py:247
#, python-brace-format
msgid "Incorrect type. Expected pk value, received {data_type}."
msgstr "Type incorrect. Attendait une clé primaire, a reçu {data_type}."
#: relations.py:280
msgid "Invalid hyperlink - No URL match."
msgstr "Lien non valide : pas d'URL correspondante."
#: relations.py:281
msgid "Invalid hyperlink - Incorrect URL match."
msgstr "Lien non valide : URL correspondante incorrecte."
#: relations.py:282
msgid "Invalid hyperlink - Object does not exist."
msgstr "Lien non valide : l'objet n'existe pas."
#: relations.py:283
#, python-brace-format
msgid "Incorrect type. Expected URL string, received {data_type}."
msgstr "Type incorrect. Attendait une URL, a reçu {data_type}."
#: relations.py:448
#, python-brace-format
msgid "Object with {slug_name}={value} does not exist."
msgstr "L'object avec {slug_name}={value} n'existe pas."
#: relations.py:449
msgid "Invalid value."
msgstr "Valeur non valide."
#: schemas/utils.py:32
msgid "unique integer value"
msgstr ""
#: schemas/utils.py:34
msgid "UUID string"
msgstr ""
#: schemas/utils.py:36
msgid "unique value"
msgstr ""
#: schemas/utils.py:38
#, python-brace-format
msgid "A {value_type} identifying this {name}."
msgstr ""
#: serializers.py:337
#, python-brace-format
msgid "Invalid data. Expected a dictionary, but got {datatype}."
msgstr "Donnée non valide. Attendait un dictionnaire, a reçu {datatype}."
#: templates/rest_framework/admin.html:116
#: templates/rest_framework/base.html:136
msgid "Extra Actions"
msgstr ""
#: templates/rest_framework/admin.html:130
#: templates/rest_framework/base.html:150
msgid "Filters"
msgstr "Filtres"
#: templates/rest_framework/base.html:37
msgid "navbar"
msgstr ""
#: templates/rest_framework/base.html:75
msgid "content"
msgstr ""
#: templates/rest_framework/base.html:78
msgid "request form"
msgstr ""
#: templates/rest_framework/base.html:157
msgid "main content"
msgstr ""
#: templates/rest_framework/base.html:173
msgid "request info"
msgstr ""
#: templates/rest_framework/base.html:177
msgid "response info"
msgstr ""
#: templates/rest_framework/horizontal/radio.html:4
#: templates/rest_framework/inline/radio.html:3
#: templates/rest_framework/vertical/radio.html:3
msgid "None"
msgstr "Aucune"
#: templates/rest_framework/horizontal/select_multiple.html:4
#: templates/rest_framework/inline/select_multiple.html:3
#: templates/rest_framework/vertical/select_multiple.html:3
msgid "No items to select."
msgstr "Aucun élément à sélectionner."
#: validators.py:39
msgid "This field must be unique."
msgstr "Ce champ doit être unique."
#: validators.py:89
#, python-brace-format
msgid "The fields {field_names} must make a unique set."
msgstr "Les champs {field_names} doivent former un ensemble unique."
#: validators.py:171
#, python-brace-format
msgid "Surrogate characters are not allowed: U+{code_point:X}."
msgstr ""
#: validators.py:243
#, python-brace-format
msgid "This field must be unique for the \"{date_field}\" date."
msgstr "Ce champ doit être unique pour la date « {date_field} »."
#: validators.py:258
#, python-brace-format
msgid "This field must be unique for the \"{date_field}\" month."
msgstr "Ce champ doit être unique pour le mois « {date_field} »."
#: validators.py:271
#, python-brace-format
msgid "This field must be unique for the \"{date_field}\" year."
msgstr "Ce champ doit être unique pour l'année « {date_field} »."
#: versioning.py:40
msgid "Invalid version in \"Accept\" header."
msgstr "Version non valide dans l'en-tête « Accept »."
#: versioning.py:71
msgid "Invalid version in URL path."
msgstr "Version non valide dans l'URL."
#: versioning.py:116
msgid "Invalid version in URL path. Does not match any version namespace."
msgstr "Version invalide dans l'URL. Ne correspond à aucune version de l'espace de nommage."
#: versioning.py:148
msgid "Invalid version in hostname."
msgstr "Version non valide dans le nom d'hôte."
#: versioning.py:170
msgid "Invalid version in query parameter."
msgstr "Version non valide dans le paramètre de requête."
| Gettext Catalog | 2 | scratchmex/django-rest-framework | rest_framework/locale/fr/LC_MESSAGES/django.po | [
"BSD-3-Clause"
] |
/*
* Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.jvm.compiler.ir;
import com.intellij.testFramework.TestDataPath;
import org.jetbrains.kotlin.test.JUnit3RunnerWithInners;
import org.jetbrains.kotlin.test.KotlinTestUtils;
import org.jetbrains.kotlin.test.util.KtTestUtil;
import org.jetbrains.kotlin.test.TargetBackend;
import org.jetbrains.kotlin.test.TestMetadata;
import org.junit.runner.RunWith;
import java.io.File;
import java.util.regex.Pattern;
/** This class is generated by {@link org.jetbrains.kotlin.generators.tests.TestsPackage}. DO NOT MODIFY MANUALLY */
@SuppressWarnings("all")
@RunWith(JUnit3RunnerWithInners.class)
public class IrCompileJavaAgainstKotlinTestGenerated extends AbstractIrCompileJavaAgainstKotlinTest {
@TestMetadata("compiler/testData/compileJavaAgainstKotlin")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class WithoutJavac extends AbstractIrCompileJavaAgainstKotlinTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTestWithoutJavac, TargetBackend.JVM_IR, testDataFilePath);
}
public void testAllFilesPresentInWithoutJavac() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/compileJavaAgainstKotlin"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true);
}
@TestMetadata("compiler/testData/compileJavaAgainstKotlin/annotation")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class Annotation extends AbstractIrCompileJavaAgainstKotlinTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTestWithoutJavac, TargetBackend.JVM_IR, testDataFilePath);
}
public void testAllFilesPresentInAnnotation() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/compileJavaAgainstKotlin/annotation"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true);
}
@TestMetadata("retention.kt")
public void testRetention() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/annotation/retention.kt");
}
}
@TestMetadata("compiler/testData/compileJavaAgainstKotlin/callableReference")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class CallableReference extends AbstractIrCompileJavaAgainstKotlinTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTestWithoutJavac, TargetBackend.JVM_IR, testDataFilePath);
}
public void testAllFilesPresentInCallableReference() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/compileJavaAgainstKotlin/callableReference"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true);
}
@TestMetadata("GenericSignature.kt")
public void testGenericSignature() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/callableReference/GenericSignature.kt");
}
}
@TestMetadata("compiler/testData/compileJavaAgainstKotlin/class")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class Class extends AbstractIrCompileJavaAgainstKotlinTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTestWithoutJavac, TargetBackend.JVM_IR, testDataFilePath);
}
public void testAllFilesPresentInClass() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/compileJavaAgainstKotlin/class"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true);
}
@TestMetadata("ClassObject.kt")
public void testClassObject() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/class/ClassObject.kt");
}
@TestMetadata("DefaultConstructor.kt")
public void testDefaultConstructor() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/class/DefaultConstructor.kt");
}
@TestMetadata("DefaultConstructorWithTwoArgs.kt")
public void testDefaultConstructorWithTwoArgs() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/class/DefaultConstructorWithTwoArgs.kt");
}
@TestMetadata("ExtendsAbstractListT.kt")
public void testExtendsAbstractListT() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/class/ExtendsAbstractListT.kt");
}
@TestMetadata("ImplementsListString.kt")
public void testImplementsListString() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/class/ImplementsListString.kt");
}
@TestMetadata("ImplementsMapPP.kt")
public void testImplementsMapPP() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/class/ImplementsMapPP.kt");
}
@TestMetadata("InnerClass.kt")
public void testInnerClass() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/class/InnerClass.kt");
}
@TestMetadata("InnerClassConstructors.kt")
public void testInnerClassConstructors() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/class/InnerClassConstructors.kt");
}
@TestMetadata("InnerClassOfGeneric.kt")
public void testInnerClassOfGeneric() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/class/InnerClassOfGeneric.kt");
}
@TestMetadata("kt3561.kt")
public void testKt3561() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/class/kt3561.kt");
}
@TestMetadata("kt4050.kt")
public void testKt4050() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/class/kt4050.kt");
}
@TestMetadata("MapImpl.kt")
public void testMapImpl() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/class/MapImpl.kt");
}
@TestMetadata("Simple.kt")
public void testSimple() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/class/Simple.kt");
}
@TestMetadata("StarProjection.kt")
public void testStarProjection() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/class/StarProjection.kt");
}
}
@TestMetadata("compiler/testData/compileJavaAgainstKotlin/enum")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class Enum extends AbstractIrCompileJavaAgainstKotlinTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTestWithoutJavac, TargetBackend.JVM_IR, testDataFilePath);
}
public void testAllFilesPresentInEnum() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/compileJavaAgainstKotlin/enum"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true);
}
@TestMetadata("DefaultArgumentInEnumConstructor.kt")
public void testDefaultArgumentInEnumConstructor() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/enum/DefaultArgumentInEnumConstructor.kt");
}
}
@TestMetadata("compiler/testData/compileJavaAgainstKotlin/jvmStatic")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class JvmStatic extends AbstractIrCompileJavaAgainstKotlinTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTestWithoutJavac, TargetBackend.JVM_IR, testDataFilePath);
}
public void testAllFilesPresentInJvmStatic() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/compileJavaAgainstKotlin/jvmStatic"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true);
}
@TestMetadata("simpleCompanionObject.kt")
public void testSimpleCompanionObject() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/jvmStatic/simpleCompanionObject.kt");
}
@TestMetadata("simpleCompanionObjectProperty.kt")
public void testSimpleCompanionObjectProperty() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/jvmStatic/simpleCompanionObjectProperty.kt");
}
@TestMetadata("simpleObject.kt")
public void testSimpleObject() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/jvmStatic/simpleObject.kt");
}
@TestMetadata("simpleObjectProperty.kt")
public void testSimpleObjectProperty() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/jvmStatic/simpleObjectProperty.kt");
}
}
@TestMetadata("compiler/testData/compileJavaAgainstKotlin/method")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class Method extends AbstractIrCompileJavaAgainstKotlinTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTestWithoutJavac, TargetBackend.JVM_IR, testDataFilePath);
}
@TestMetadata("AccessorGenericSignature.kt")
public void testAccessorGenericSignature() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/method/AccessorGenericSignature.kt");
}
public void testAllFilesPresentInMethod() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/compileJavaAgainstKotlin/method"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true);
}
@TestMetadata("Any.kt")
public void testAny() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/method/Any.kt");
}
@TestMetadata("ArrayOfIntArray.kt")
public void testArrayOfIntArray() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/method/ArrayOfIntArray.kt");
}
@TestMetadata("ArrayOfIntegerArray.kt")
public void testArrayOfIntegerArray() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/method/ArrayOfIntegerArray.kt");
}
@TestMetadata("ClashingSignaturesWithoutReturnType.kt")
public void testClashingSignaturesWithoutReturnType() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/method/ClashingSignaturesWithoutReturnType.kt");
}
@TestMetadata("Delegation.kt")
public void testDelegation() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/method/Delegation.kt");
}
@TestMetadata("Extensions.kt")
public void testExtensions() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/method/Extensions.kt");
}
@TestMetadata("GenericArray.kt")
public void testGenericArray() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/method/GenericArray.kt");
}
@TestMetadata("Hello.kt")
public void testHello() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/method/Hello.kt");
}
@TestMetadata("Int.kt")
public void testInt() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/method/Int.kt");
}
@TestMetadata("IntArray.kt")
public void testIntArray() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/method/IntArray.kt");
}
@TestMetadata("IntWithDefault.kt")
public void testIntWithDefault() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/method/IntWithDefault.kt");
}
@TestMetadata("IntegerArray.kt")
public void testIntegerArray() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/method/IntegerArray.kt");
}
@TestMetadata("ListOfInt.kt")
public void testListOfInt() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/method/ListOfInt.kt");
}
@TestMetadata("ListOfString.kt")
public void testListOfString() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/method/ListOfString.kt");
}
@TestMetadata("ListOfT.kt")
public void testListOfT() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/method/ListOfT.kt");
}
@TestMetadata("MapOfKString.kt")
public void testMapOfKString() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/method/MapOfKString.kt");
}
@TestMetadata("MapOfStringIntQ.kt")
public void testMapOfStringIntQ() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/method/MapOfStringIntQ.kt");
}
@TestMetadata("QExtendsListString.kt")
public void testQExtendsListString() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/method/QExtendsListString.kt");
}
@TestMetadata("QExtendsString.kt")
public void testQExtendsString() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/method/QExtendsString.kt");
}
@TestMetadata("TraitImpl.kt")
public void testTraitImpl() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/method/TraitImpl.kt");
}
@TestMetadata("TypeParamInInner.kt")
public void testTypeParamInInner() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/method/TypeParamInInner.kt");
}
@TestMetadata("TypeParamInInner2.kt")
public void testTypeParamInInner2() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/method/TypeParamInInner2.kt");
}
@TestMetadata("Vararg.kt")
public void testVararg() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/method/Vararg.kt");
}
@TestMetadata("Void.kt")
public void testVoid() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/method/Void.kt");
}
@TestMetadata("compiler/testData/compileJavaAgainstKotlin/method/platformName")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class PlatformName extends AbstractIrCompileJavaAgainstKotlinTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTestWithoutJavac, TargetBackend.JVM_IR, testDataFilePath);
}
public void testAllFilesPresentInPlatformName() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/compileJavaAgainstKotlin/method/platformName"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true);
}
@TestMetadata("PlatformName.kt")
public void testPlatformName() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/method/platformName/PlatformName.kt");
}
}
@TestMetadata("compiler/testData/compileJavaAgainstKotlin/method/primitiveOverride")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class PrimitiveOverride extends AbstractIrCompileJavaAgainstKotlinTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTestWithoutJavac, TargetBackend.JVM_IR, testDataFilePath);
}
public void testAllFilesPresentInPrimitiveOverride() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/compileJavaAgainstKotlin/method/primitiveOverride"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true);
}
@TestMetadata("ByteOverridesObject.kt")
public void testByteOverridesObject() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/method/primitiveOverride/ByteOverridesObject.kt");
}
@TestMetadata("CallFinalNotInSubclass.kt")
public void testCallFinalNotInSubclass() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/method/primitiveOverride/CallFinalNotInSubclass.kt");
}
@TestMetadata("CallNotInSubclass.kt")
public void testCallNotInSubclass() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/method/primitiveOverride/CallNotInSubclass.kt");
}
@TestMetadata("CovariantReturnTypeOverride.kt")
public void testCovariantReturnTypeOverride() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/method/primitiveOverride/CovariantReturnTypeOverride.kt");
}
@TestMetadata("FinalOverride.kt")
public void testFinalOverride() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/method/primitiveOverride/FinalOverride.kt");
}
@TestMetadata("IntOverridesComparable.kt")
public void testIntOverridesComparable() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/method/primitiveOverride/IntOverridesComparable.kt");
}
@TestMetadata("IntOverridesNumber.kt")
public void testIntOverridesNumber() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/method/primitiveOverride/IntOverridesNumber.kt");
}
@TestMetadata("IntOverridesObject.kt")
public void testIntOverridesObject() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/method/primitiveOverride/IntOverridesObject.kt");
}
@TestMetadata("ManyClassesHierarchy.kt")
public void testManyClassesHierarchy() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/method/primitiveOverride/ManyClassesHierarchy.kt");
}
@TestMetadata("NullableIntOverridesObject.kt")
public void testNullableIntOverridesObject() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/method/primitiveOverride/NullableIntOverridesObject.kt");
}
@TestMetadata("OverrideInJava.kt")
public void testOverrideInJava() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/method/primitiveOverride/OverrideInJava.kt");
}
}
@TestMetadata("compiler/testData/compileJavaAgainstKotlin/method/primitiveOverrideWithInlineClass")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class PrimitiveOverrideWithInlineClass extends AbstractIrCompileJavaAgainstKotlinTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTestWithoutJavac, TargetBackend.JVM_IR, testDataFilePath);
}
public void testAllFilesPresentInPrimitiveOverrideWithInlineClass() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/compileJavaAgainstKotlin/method/primitiveOverrideWithInlineClass"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true);
}
@TestMetadata("InlineIntOverridesObject.kt")
public void testInlineIntOverridesObject() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/method/primitiveOverrideWithInlineClass/InlineIntOverridesObject.kt");
}
}
@TestMetadata("compiler/testData/compileJavaAgainstKotlin/method/throws")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class Throws extends AbstractIrCompileJavaAgainstKotlinTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTestWithoutJavac, TargetBackend.JVM_IR, testDataFilePath);
}
public void testAllFilesPresentInThrows() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/compileJavaAgainstKotlin/method/throws"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true);
}
@TestMetadata("ClassMembers.kt")
public void testClassMembers() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/method/throws/ClassMembers.kt");
}
@TestMetadata("Constructor.kt")
public void testConstructor() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/method/throws/Constructor.kt");
}
@TestMetadata("DefaultArgs.kt")
public void testDefaultArgs() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/method/throws/DefaultArgs.kt");
}
@TestMetadata("Delegation.kt")
public void testDelegation() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/method/throws/Delegation.kt");
}
@TestMetadata("GenericSubstitution.kt")
public void testGenericSubstitution() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/method/throws/GenericSubstitution.kt");
}
@TestMetadata("KotlinThrows.kt")
public void testKotlinThrows() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/method/throws/KotlinThrows.kt");
}
@TestMetadata("TopLevel.kt")
public void testTopLevel() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/method/throws/TopLevel.kt");
}
@TestMetadata("TraitMembers.kt")
public void testTraitMembers() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/method/throws/TraitMembers.kt");
}
}
}
@TestMetadata("compiler/testData/compileJavaAgainstKotlin/property")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class Property extends AbstractIrCompileJavaAgainstKotlinTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTestWithoutJavac, TargetBackend.JVM_IR, testDataFilePath);
}
public void testAllFilesPresentInProperty() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/compileJavaAgainstKotlin/property"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true);
}
@TestMetadata("ConstVal.kt")
public void testConstVal() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/property/ConstVal.kt");
}
@TestMetadata("Extensions.kt")
public void testExtensions() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/property/Extensions.kt");
}
@TestMetadata("GenericProperty.kt")
public void testGenericProperty() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/property/GenericProperty.kt");
}
@TestMetadata("compiler/testData/compileJavaAgainstKotlin/property/platformName")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class PlatformName extends AbstractIrCompileJavaAgainstKotlinTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTestWithoutJavac, TargetBackend.JVM_IR, testDataFilePath);
}
public void testAllFilesPresentInPlatformName() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/compileJavaAgainstKotlin/property/platformName"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true);
}
@TestMetadata("PlatformName.kt")
public void testPlatformName() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/property/platformName/PlatformName.kt");
}
}
}
@TestMetadata("compiler/testData/compileJavaAgainstKotlin/sealed")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class Sealed extends AbstractIrCompileJavaAgainstKotlinTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTestWithoutJavac, TargetBackend.JVM_IR, testDataFilePath);
}
public void testAllFilesPresentInSealed() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/compileJavaAgainstKotlin/sealed"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true);
}
@TestMetadata("Derived.kt")
public void testDerived() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/sealed/Derived.kt");
}
@TestMetadata("Instance.kt")
public void testInstance() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/sealed/Instance.kt");
}
}
@TestMetadata("compiler/testData/compileJavaAgainstKotlin/staticFields")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class StaticFields extends AbstractIrCompileJavaAgainstKotlinTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTestWithoutJavac, TargetBackend.JVM_IR, testDataFilePath);
}
public void testAllFilesPresentInStaticFields() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/compileJavaAgainstKotlin/staticFields"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true);
}
@TestMetadata("AnnotationClass.kt")
public void testAnnotationClass() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/staticFields/AnnotationClass.kt");
}
@TestMetadata("AnnotationTrait.kt")
public void testAnnotationTrait() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/staticFields/AnnotationTrait.kt");
}
@TestMetadata("kt3698.kt")
public void testKt3698() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/staticFields/kt3698.kt");
}
@TestMetadata("staticClassProperty.kt")
public void testStaticClassProperty() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/staticFields/staticClassProperty.kt");
}
@TestMetadata("staticTraitProperty.kt")
public void testStaticTraitProperty() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/staticFields/staticTraitProperty.kt");
}
}
@TestMetadata("compiler/testData/compileJavaAgainstKotlin/targets")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class Targets extends AbstractIrCompileJavaAgainstKotlinTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTestWithoutJavac, TargetBackend.JVM_IR, testDataFilePath);
}
public void testAllFilesPresentInTargets() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/compileJavaAgainstKotlin/targets"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true);
}
@TestMetadata("annotation.kt")
public void testAnnotation() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/targets/annotation.kt");
}
@TestMetadata("base.kt")
public void testBase() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/targets/base.kt");
}
@TestMetadata("classifier.kt")
public void testClassifier() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/targets/classifier.kt");
}
@TestMetadata("constructor.kt")
public void testConstructor() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/targets/constructor.kt");
}
@TestMetadata("empty.kt")
public void testEmpty() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/targets/empty.kt");
}
@TestMetadata("field.kt")
public void testField() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/targets/field.kt");
}
@TestMetadata("function.kt")
public void testFunction() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/targets/function.kt");
}
@TestMetadata("getter.kt")
public void testGetter() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/targets/getter.kt");
}
@TestMetadata("local.kt")
public void testLocal() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/targets/local.kt");
}
@TestMetadata("multiple.kt")
public void testMultiple() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/targets/multiple.kt");
}
@TestMetadata("parameter.kt")
public void testParameter() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/targets/parameter.kt");
}
@TestMetadata("property.kt")
public void testProperty() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/targets/property.kt");
}
@TestMetadata("setter.kt")
public void testSetter() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/targets/setter.kt");
}
}
}
@TestMetadata("compiler/testData/compileJavaAgainstKotlin")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class WithJavac extends AbstractIrCompileJavaAgainstKotlinTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTestWithJavac, TargetBackend.JVM_IR, testDataFilePath);
}
public void testAllFilesPresentInWithJavac() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/compileJavaAgainstKotlin"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true);
}
@TestMetadata("compiler/testData/compileJavaAgainstKotlin/annotation")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class Annotation extends AbstractIrCompileJavaAgainstKotlinTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTestWithJavac, TargetBackend.JVM_IR, testDataFilePath);
}
public void testAllFilesPresentInAnnotation() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/compileJavaAgainstKotlin/annotation"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true);
}
@TestMetadata("retention.kt")
public void testRetention() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/annotation/retention.kt");
}
}
@TestMetadata("compiler/testData/compileJavaAgainstKotlin/callableReference")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class CallableReference extends AbstractIrCompileJavaAgainstKotlinTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTestWithJavac, TargetBackend.JVM_IR, testDataFilePath);
}
public void testAllFilesPresentInCallableReference() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/compileJavaAgainstKotlin/callableReference"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true);
}
@TestMetadata("GenericSignature.kt")
public void testGenericSignature() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/callableReference/GenericSignature.kt");
}
}
@TestMetadata("compiler/testData/compileJavaAgainstKotlin/class")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class Class extends AbstractIrCompileJavaAgainstKotlinTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTestWithJavac, TargetBackend.JVM_IR, testDataFilePath);
}
public void testAllFilesPresentInClass() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/compileJavaAgainstKotlin/class"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true);
}
@TestMetadata("ClassObject.kt")
public void testClassObject() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/class/ClassObject.kt");
}
@TestMetadata("DefaultConstructor.kt")
public void testDefaultConstructor() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/class/DefaultConstructor.kt");
}
@TestMetadata("DefaultConstructorWithTwoArgs.kt")
public void testDefaultConstructorWithTwoArgs() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/class/DefaultConstructorWithTwoArgs.kt");
}
@TestMetadata("ExtendsAbstractListT.kt")
public void testExtendsAbstractListT() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/class/ExtendsAbstractListT.kt");
}
@TestMetadata("ImplementsListString.kt")
public void testImplementsListString() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/class/ImplementsListString.kt");
}
@TestMetadata("ImplementsMapPP.kt")
public void testImplementsMapPP() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/class/ImplementsMapPP.kt");
}
@TestMetadata("InnerClass.kt")
public void testInnerClass() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/class/InnerClass.kt");
}
@TestMetadata("InnerClassConstructors.kt")
public void testInnerClassConstructors() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/class/InnerClassConstructors.kt");
}
@TestMetadata("InnerClassOfGeneric.kt")
public void testInnerClassOfGeneric() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/class/InnerClassOfGeneric.kt");
}
@TestMetadata("kt3561.kt")
public void testKt3561() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/class/kt3561.kt");
}
@TestMetadata("kt4050.kt")
public void testKt4050() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/class/kt4050.kt");
}
@TestMetadata("MapImpl.kt")
public void testMapImpl() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/class/MapImpl.kt");
}
@TestMetadata("Simple.kt")
public void testSimple() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/class/Simple.kt");
}
@TestMetadata("StarProjection.kt")
public void testStarProjection() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/class/StarProjection.kt");
}
}
@TestMetadata("compiler/testData/compileJavaAgainstKotlin/enum")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class Enum extends AbstractIrCompileJavaAgainstKotlinTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTestWithJavac, TargetBackend.JVM_IR, testDataFilePath);
}
public void testAllFilesPresentInEnum() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/compileJavaAgainstKotlin/enum"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true);
}
@TestMetadata("DefaultArgumentInEnumConstructor.kt")
public void testDefaultArgumentInEnumConstructor() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/enum/DefaultArgumentInEnumConstructor.kt");
}
}
@TestMetadata("compiler/testData/compileJavaAgainstKotlin/jvmStatic")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class JvmStatic extends AbstractIrCompileJavaAgainstKotlinTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTestWithJavac, TargetBackend.JVM_IR, testDataFilePath);
}
public void testAllFilesPresentInJvmStatic() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/compileJavaAgainstKotlin/jvmStatic"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true);
}
@TestMetadata("simpleCompanionObject.kt")
public void testSimpleCompanionObject() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/jvmStatic/simpleCompanionObject.kt");
}
@TestMetadata("simpleCompanionObjectProperty.kt")
public void testSimpleCompanionObjectProperty() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/jvmStatic/simpleCompanionObjectProperty.kt");
}
@TestMetadata("simpleObject.kt")
public void testSimpleObject() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/jvmStatic/simpleObject.kt");
}
@TestMetadata("simpleObjectProperty.kt")
public void testSimpleObjectProperty() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/jvmStatic/simpleObjectProperty.kt");
}
}
@TestMetadata("compiler/testData/compileJavaAgainstKotlin/method")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class Method extends AbstractIrCompileJavaAgainstKotlinTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTestWithJavac, TargetBackend.JVM_IR, testDataFilePath);
}
@TestMetadata("AccessorGenericSignature.kt")
public void testAccessorGenericSignature() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/method/AccessorGenericSignature.kt");
}
public void testAllFilesPresentInMethod() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/compileJavaAgainstKotlin/method"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true);
}
@TestMetadata("Any.kt")
public void testAny() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/method/Any.kt");
}
@TestMetadata("ArrayOfIntArray.kt")
public void testArrayOfIntArray() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/method/ArrayOfIntArray.kt");
}
@TestMetadata("ArrayOfIntegerArray.kt")
public void testArrayOfIntegerArray() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/method/ArrayOfIntegerArray.kt");
}
@TestMetadata("ClashingSignaturesWithoutReturnType.kt")
public void testClashingSignaturesWithoutReturnType() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/method/ClashingSignaturesWithoutReturnType.kt");
}
@TestMetadata("Delegation.kt")
public void testDelegation() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/method/Delegation.kt");
}
@TestMetadata("Extensions.kt")
public void testExtensions() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/method/Extensions.kt");
}
@TestMetadata("GenericArray.kt")
public void testGenericArray() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/method/GenericArray.kt");
}
@TestMetadata("Hello.kt")
public void testHello() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/method/Hello.kt");
}
@TestMetadata("Int.kt")
public void testInt() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/method/Int.kt");
}
@TestMetadata("IntArray.kt")
public void testIntArray() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/method/IntArray.kt");
}
@TestMetadata("IntWithDefault.kt")
public void testIntWithDefault() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/method/IntWithDefault.kt");
}
@TestMetadata("IntegerArray.kt")
public void testIntegerArray() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/method/IntegerArray.kt");
}
@TestMetadata("ListOfInt.kt")
public void testListOfInt() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/method/ListOfInt.kt");
}
@TestMetadata("ListOfString.kt")
public void testListOfString() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/method/ListOfString.kt");
}
@TestMetadata("ListOfT.kt")
public void testListOfT() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/method/ListOfT.kt");
}
@TestMetadata("MapOfKString.kt")
public void testMapOfKString() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/method/MapOfKString.kt");
}
@TestMetadata("MapOfStringIntQ.kt")
public void testMapOfStringIntQ() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/method/MapOfStringIntQ.kt");
}
@TestMetadata("QExtendsListString.kt")
public void testQExtendsListString() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/method/QExtendsListString.kt");
}
@TestMetadata("QExtendsString.kt")
public void testQExtendsString() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/method/QExtendsString.kt");
}
@TestMetadata("TraitImpl.kt")
public void testTraitImpl() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/method/TraitImpl.kt");
}
@TestMetadata("TypeParamInInner.kt")
public void testTypeParamInInner() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/method/TypeParamInInner.kt");
}
@TestMetadata("TypeParamInInner2.kt")
public void testTypeParamInInner2() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/method/TypeParamInInner2.kt");
}
@TestMetadata("Vararg.kt")
public void testVararg() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/method/Vararg.kt");
}
@TestMetadata("Void.kt")
public void testVoid() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/method/Void.kt");
}
@TestMetadata("compiler/testData/compileJavaAgainstKotlin/method/platformName")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class PlatformName extends AbstractIrCompileJavaAgainstKotlinTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTestWithJavac, TargetBackend.JVM_IR, testDataFilePath);
}
public void testAllFilesPresentInPlatformName() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/compileJavaAgainstKotlin/method/platformName"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true);
}
@TestMetadata("PlatformName.kt")
public void testPlatformName() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/method/platformName/PlatformName.kt");
}
}
@TestMetadata("compiler/testData/compileJavaAgainstKotlin/method/primitiveOverride")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class PrimitiveOverride extends AbstractIrCompileJavaAgainstKotlinTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTestWithJavac, TargetBackend.JVM_IR, testDataFilePath);
}
public void testAllFilesPresentInPrimitiveOverride() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/compileJavaAgainstKotlin/method/primitiveOverride"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true);
}
@TestMetadata("ByteOverridesObject.kt")
public void testByteOverridesObject() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/method/primitiveOverride/ByteOverridesObject.kt");
}
@TestMetadata("CallFinalNotInSubclass.kt")
public void testCallFinalNotInSubclass() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/method/primitiveOverride/CallFinalNotInSubclass.kt");
}
@TestMetadata("CallNotInSubclass.kt")
public void testCallNotInSubclass() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/method/primitiveOverride/CallNotInSubclass.kt");
}
@TestMetadata("CovariantReturnTypeOverride.kt")
public void testCovariantReturnTypeOverride() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/method/primitiveOverride/CovariantReturnTypeOverride.kt");
}
@TestMetadata("FinalOverride.kt")
public void testFinalOverride() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/method/primitiveOverride/FinalOverride.kt");
}
@TestMetadata("IntOverridesComparable.kt")
public void testIntOverridesComparable() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/method/primitiveOverride/IntOverridesComparable.kt");
}
@TestMetadata("IntOverridesNumber.kt")
public void testIntOverridesNumber() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/method/primitiveOverride/IntOverridesNumber.kt");
}
@TestMetadata("IntOverridesObject.kt")
public void testIntOverridesObject() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/method/primitiveOverride/IntOverridesObject.kt");
}
@TestMetadata("ManyClassesHierarchy.kt")
public void testManyClassesHierarchy() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/method/primitiveOverride/ManyClassesHierarchy.kt");
}
@TestMetadata("NullableIntOverridesObject.kt")
public void testNullableIntOverridesObject() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/method/primitiveOverride/NullableIntOverridesObject.kt");
}
@TestMetadata("OverrideInJava.kt")
public void testOverrideInJava() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/method/primitiveOverride/OverrideInJava.kt");
}
}
@TestMetadata("compiler/testData/compileJavaAgainstKotlin/method/primitiveOverrideWithInlineClass")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class PrimitiveOverrideWithInlineClass extends AbstractIrCompileJavaAgainstKotlinTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTestWithJavac, TargetBackend.JVM_IR, testDataFilePath);
}
public void testAllFilesPresentInPrimitiveOverrideWithInlineClass() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/compileJavaAgainstKotlin/method/primitiveOverrideWithInlineClass"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true);
}
@TestMetadata("InlineIntOverridesObject.kt")
public void testInlineIntOverridesObject() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/method/primitiveOverrideWithInlineClass/InlineIntOverridesObject.kt");
}
}
@TestMetadata("compiler/testData/compileJavaAgainstKotlin/method/throws")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class Throws extends AbstractIrCompileJavaAgainstKotlinTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTestWithJavac, TargetBackend.JVM_IR, testDataFilePath);
}
public void testAllFilesPresentInThrows() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/compileJavaAgainstKotlin/method/throws"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true);
}
@TestMetadata("ClassMembers.kt")
public void testClassMembers() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/method/throws/ClassMembers.kt");
}
@TestMetadata("Constructor.kt")
public void testConstructor() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/method/throws/Constructor.kt");
}
@TestMetadata("DefaultArgs.kt")
public void testDefaultArgs() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/method/throws/DefaultArgs.kt");
}
@TestMetadata("Delegation.kt")
public void testDelegation() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/method/throws/Delegation.kt");
}
@TestMetadata("GenericSubstitution.kt")
public void testGenericSubstitution() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/method/throws/GenericSubstitution.kt");
}
@TestMetadata("KotlinThrows.kt")
public void testKotlinThrows() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/method/throws/KotlinThrows.kt");
}
@TestMetadata("TopLevel.kt")
public void testTopLevel() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/method/throws/TopLevel.kt");
}
@TestMetadata("TraitMembers.kt")
public void testTraitMembers() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/method/throws/TraitMembers.kt");
}
}
}
@TestMetadata("compiler/testData/compileJavaAgainstKotlin/property")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class Property extends AbstractIrCompileJavaAgainstKotlinTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTestWithJavac, TargetBackend.JVM_IR, testDataFilePath);
}
public void testAllFilesPresentInProperty() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/compileJavaAgainstKotlin/property"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true);
}
@TestMetadata("ConstVal.kt")
public void testConstVal() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/property/ConstVal.kt");
}
@TestMetadata("Extensions.kt")
public void testExtensions() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/property/Extensions.kt");
}
@TestMetadata("GenericProperty.kt")
public void testGenericProperty() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/property/GenericProperty.kt");
}
@TestMetadata("compiler/testData/compileJavaAgainstKotlin/property/platformName")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class PlatformName extends AbstractIrCompileJavaAgainstKotlinTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTestWithJavac, TargetBackend.JVM_IR, testDataFilePath);
}
public void testAllFilesPresentInPlatformName() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/compileJavaAgainstKotlin/property/platformName"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true);
}
@TestMetadata("PlatformName.kt")
public void testPlatformName() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/property/platformName/PlatformName.kt");
}
}
}
@TestMetadata("compiler/testData/compileJavaAgainstKotlin/sealed")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class Sealed extends AbstractIrCompileJavaAgainstKotlinTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTestWithJavac, TargetBackend.JVM_IR, testDataFilePath);
}
public void testAllFilesPresentInSealed() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/compileJavaAgainstKotlin/sealed"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true);
}
@TestMetadata("Derived.kt")
public void testDerived() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/sealed/Derived.kt");
}
@TestMetadata("Instance.kt")
public void testInstance() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/sealed/Instance.kt");
}
}
@TestMetadata("compiler/testData/compileJavaAgainstKotlin/staticFields")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class StaticFields extends AbstractIrCompileJavaAgainstKotlinTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTestWithJavac, TargetBackend.JVM_IR, testDataFilePath);
}
public void testAllFilesPresentInStaticFields() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/compileJavaAgainstKotlin/staticFields"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true);
}
@TestMetadata("AnnotationClass.kt")
public void testAnnotationClass() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/staticFields/AnnotationClass.kt");
}
@TestMetadata("AnnotationTrait.kt")
public void testAnnotationTrait() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/staticFields/AnnotationTrait.kt");
}
@TestMetadata("kt3698.kt")
public void testKt3698() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/staticFields/kt3698.kt");
}
@TestMetadata("staticClassProperty.kt")
public void testStaticClassProperty() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/staticFields/staticClassProperty.kt");
}
@TestMetadata("staticTraitProperty.kt")
public void testStaticTraitProperty() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/staticFields/staticTraitProperty.kt");
}
}
@TestMetadata("compiler/testData/compileJavaAgainstKotlin/targets")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class Targets extends AbstractIrCompileJavaAgainstKotlinTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTestWithJavac, TargetBackend.JVM_IR, testDataFilePath);
}
public void testAllFilesPresentInTargets() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/compileJavaAgainstKotlin/targets"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true);
}
@TestMetadata("annotation.kt")
public void testAnnotation() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/targets/annotation.kt");
}
@TestMetadata("base.kt")
public void testBase() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/targets/base.kt");
}
@TestMetadata("classifier.kt")
public void testClassifier() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/targets/classifier.kt");
}
@TestMetadata("constructor.kt")
public void testConstructor() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/targets/constructor.kt");
}
@TestMetadata("empty.kt")
public void testEmpty() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/targets/empty.kt");
}
@TestMetadata("field.kt")
public void testField() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/targets/field.kt");
}
@TestMetadata("function.kt")
public void testFunction() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/targets/function.kt");
}
@TestMetadata("getter.kt")
public void testGetter() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/targets/getter.kt");
}
@TestMetadata("local.kt")
public void testLocal() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/targets/local.kt");
}
@TestMetadata("multiple.kt")
public void testMultiple() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/targets/multiple.kt");
}
@TestMetadata("parameter.kt")
public void testParameter() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/targets/parameter.kt");
}
@TestMetadata("property.kt")
public void testProperty() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/targets/property.kt");
}
@TestMetadata("setter.kt")
public void testSetter() throws Exception {
runTest("compiler/testData/compileJavaAgainstKotlin/targets/setter.kt");
}
}
}
}
| Java | 4 | jiqimaogou/kotlin | compiler/tests-gen/org/jetbrains/kotlin/jvm/compiler/ir/IrCompileJavaAgainstKotlinTestGenerated.java | [
"ECL-2.0",
"Apache-2.0"
] |
<!doctype html>
<html>
<head>
<title>5947</title>
</head>
<body>
<h1 id="result"></h1>
<script>
var url = localStorage.getItem('url');
document.getElementById("result").innerHTML = "URL is: " + url;
</script>
</body>
</html> | HTML | 3 | frank-dspeed/nw.js | test/sanity/issue5947-localStorage_getItem_url_crash/index.html | [
"MIT"
] |
submodule openconfig-qos-mem-mgmt {
belongs-to openconfig-qos {
prefix "oc-qos";
}
import openconfig-extensions { prefix oc-ext; }
import openconfig-types { prefix oc-types; }
include openconfig-qos-elements;
organization
"OpenConfig working group";
contact
"OpenConfig working group
www.openconfig.net";
description
"This submodule defines configuration and operational state
data associated related to queue management features of QoS
particularly:
- buffer-allocation-profiles: these profiles are applied on
a per-interface basis, and determine how memory is to be managed
across the queues that are instantiated on the system.
- queue-management-profiles: these profiles are applied on a per-interface
per-queue basis, and determine how packets are marked/dropped within
the queue instantiation.";
oc-ext:openconfig-version "0.5.0";
revision "2021-08-28" {
description
"Revision updating memory management profile WRED and RED configuration.";
reference "0.5.0";
}
revision "2021-06-28" {
description
"Adding buffer carving policies per interface per queue.";
reference "0.4.0";
}
revision "2021-04-28" {
description
"Revision updating buffer management and queue management
configuration.";
reference "0.3.0";
}
identity SHARED_BUFFER_LIMIT_TYPE {
description
"Base identity for supported shared buffer limit types.";
}
identity STATIC {
base SHARED_BUFFER_LIMIT_TYPE;
description
"The maximum buffer space that the queue is allowed to use from the shared
buffer is specified as a static-limit which is expressed in bytes.";
}
identity DYNAMIC_BASED_ON_SCALING_FACTOR {
base SHARED_BUFFER_LIMIT_TYPE;
description
"The maximum buffer space that the queue is allowed to use from the shared
buffer is dynamically determined based on the current usage pattern of the
shared buffer and a dynamic-limit which is expressed as a scaling factor
on the free space in the shared buffer.";
}
grouping qos-buffer-profile-top {
description
"Grouping containing buffer-allocation-profile structural definition";
container buffer-allocation-profiles {
description
"Surrounding container for buffer allocation profiles.";
list buffer-allocation-profile {
key "name";
description
"A buffer allocation profile describes a mapping between the queues
that are instantiated on an interface and the memory that is allocated
to them on the forwarding complex that they are instantiated. Profiles
(like queues) are defined in the abstract and instantiated by being
configured on a particular interface. Separate allocation profiles may
be used for ingress and egress traffic, with the profile being specified
within the /qos/interfaces/interface list.";
leaf name {
type leafref {
path "../config/name";
}
description
"Reference to the unique name used as a key for each buffer profile.";
}
container config {
description
"Configuration parameters for a buffer-allocation-profile.";
uses buffer-allocation-profile-config;
}
container state {
config false;
description
"Operational state parameters relating to a buffer-allocation-profile.";
uses buffer-allocation-profile-config;
}
container queues {
description
"Surrounding container for the queues that are referenced under a
buffer-allocation-policy.";
list queue {
key "name";
description
"Buffer allocation profile for a specific queue on the interface.";
leaf name {
type leafref {
path "../config/name";
}
description
"Reference to the name of the queue being referenced under the buffer
allocation profile.";
}
container config {
description
"Configuration parameters relating to a queue within a buffer allocation
profile.";
uses buffer-allocation-profile-q-config;
}
container state {
config false;
description
"Operational state parameters relating to a queue wtihin a buffer allocation
profile.";
uses buffer-allocation-profile-q-config;
}
}
}
}
}
}
grouping buffer-allocation-profile-config {
description
"Configuration parameters relating to a buffer-allocation-profile.";
leaf name {
type string;
description
"Unique string identifying the buffer allocation profile, used to
reference to the profile on interfaces.";
}
// TODO(openconfig-ops): add any parameters that relate to overall allocation
// profile.
}
grouping buffer-allocation-profile-q-config {
description
"Configuration parameters relating to a queue within a buffer-allocation-profile.";
leaf name {
type leafref {
// @ /qos/buffer-allocation-profiles/buffer-allocation-profile/queues/queue/config/name
path "../../../../../../queues/queue/config/name";
}
description
"Reference to the queue being referenced within the buffer allocation profile.";
}
leaf dedicated-buffer {
type uint64;
units bytes;
description
"This is the dedicated buffer that is carved for the queue, this is the minimum
number of bytes reserved for this queue.";
}
leaf use-shared-buffer {
type boolean;
description
"If the flag is true, then the queue is allowed to use buffers from shared pool
in additional to the dedicated buffers assigned for this queue.";
}
leaf shared-buffer-limit-type {
type identityref {
base SHARED_BUFFER_LIMIT_TYPE;
}
description
"The type of limit used to specify the amount of buffer space that the queue
is allowed to use from the shared pool.";
}
leaf static-shared-buffer-limit {
type uint32;
units bytes;
description
"If the shared-buffer-limit-type is STATIC, then static-shared-buffer-limit is
the maximum number of bytes that the queue is allowed to use from the shared
pool.";
}
leaf dynamic-limit-scaling-factor {
type int32;
description
"If shared-buffer-limit-type is DYNAMIC_BASED_ON_SCALING_FACTOR, the scaling
factor and the current free space in the shared pool is used to determine the
maximum buffer sapce from the shared pool that the queue is allowed to use.
Example: If a queue is using 79MB and the other queues are using 11MB, the
free buffer is 10MB. If the configured scaling factor is 3 for the queue, the
maximum buffer space from the shared pool that the queue is allowed to use is
calculated as (free buffer * 2^scaling factor) ie. 10MB*2^3 = 80MB. Since the
current usage is 79MB which is < 80MB, the packet is queued.";
}
}
grouping qos-queue-management-profile-config {
description
"Configuration parameters for queue management profiles.";
leaf name {
type string;
description
"Unique string name used for the queue management profile.";
}
}
grouping qos-queue-management-profile-red-wred-common-config {
description
"Common configuration parameters for red and wred.";
leaf min-threshold {
type uint64;
units bytes;
description
"The mininum threshold parameter for a RED-managed queue. When the
average queue length is less than minth, all packets are admitted
to the queue.";
}
leaf max-threshold {
type uint64;
units bytes;
description
"The maximum threshold parameter for a RED-managed queue. When the
average queue length exceeds the maxth value, all packets are
dropped (or marked if ECN is enabled).";
}
leaf enable-ecn {
type boolean;
default false;
description
"When this leaf is true and the number of packets in the queue
is between the minimum threshold and the maximum threshold, if
the ECN field on the packet indicates that the endpoints are ECN
capable (that is, the ECT bit is set to 1 and the CE bit is set
to 0, or the ECT bit is set to 0 and the CE bit is set to 1) and
the WRED algorithm determines that the packet should have been
dropped based on the drop probability, the ECT and CE bits for
the packet are changed to 1, and the packet is transmitted.";
}
leaf drop {
type boolean;
default false;
description
"When this leaf is true and the packet and if the ECN field in
the packet indicates that the endpoints are not ECN capable and
the and the WRED algorithm determines that the packet should
have been dropped based on the drop probability, the packet
is dropped.";
}
}
grouping qos-queue-management-profile-wred-config {
description
"Configuration parameters for wred buffer allocation.";
leaf weight {
type uint32;
description
"The average queue size depends on the previous average as well as
the current size of the queue.
average queue size = (previous average queue size)*(1-2^{-n})+
(current queue size)*(2^{-n})
where n is the user-configurable exponential weight factor.
The previous average is more important for high values of n. Peaks
and lows in queue size are smoothed by a high value. For low values
of n, the average queue size is close to the current queue size.";
}
leaf max-drop-probability-percent {
type oc-types:percentage;
description
"If the queue depth is between min and max threshold then this
the probability with which packets are dropped or marked.";
}
}
grouping qos-queue-mgmt-profile-top {
description
"Grouping containing queue management profiles for queues.";
container queue-management-profiles {
description
"Surrounding container for the list of configured
queue management profiles.";
list queue-management-profile {
key "name";
description
"A queue management profile within the OpenConfig QoS model
specifies how packets are ECN marked/dropped for a particular
instance of a queue on a particular interface. for example,
whether RED, or WRED is applied to manage the queue's occupancy.";
leaf name {
type leafref {
path "../config/name";
}
description
"Reference to the unique name used to reference the queue
management profile";
}
container config {
description
"Configuration parameters relating to the queue
management profile.";
uses qos-queue-management-profile-config;
}
container state {
config false;
description
"Operational state parameters relating to the queue
management profile.";
uses qos-queue-management-profile-config;
}
container wred {
description
"Configuration and operational state parameters relating to
Weighted Random Early Detection (WRED).";
container uniform {
description
"Uniform WRED parameters. These parameters are applied to all the
traffic coming into system.";
container config {
description
"Configuration parameters relating to the WRED.";
uses qos-queue-management-profile-red-wred-common-config;
uses qos-queue-management-profile-wred-config;
}
container state {
config false;
description
"Operational state parameters relating to the WRED.";
uses qos-queue-management-profile-red-wred-common-config;
uses qos-queue-management-profile-wred-config;
}
}
}
container red {
description
"Configuration and operational state parameters
relating to Random Early Detection (RED).";
container uniform {
description
"Uniform RED parameters. These parameters are applied to all
the traffic coming into system.";
container config {
description
"Configuration parameters relating to the RED.";
uses qos-queue-management-profile-red-wred-common-config;
}
container state {
config false;
description
"Operational state parameters relating to the RED.";
uses qos-queue-management-profile-red-wred-common-config;
}
}
}
}
}
}
}
| YANG | 5 | wenovus/public | release/models/qos/openconfig-qos-mem-mgmt.yang | [
"Apache-2.0"
] |
submodule openconfig-rib-bgp-attributes {
belongs-to openconfig-rib-bgp {
prefix "oc-rib-bgp";
}
// import some basic types
import ietf-inet-types { prefix inet; }
import openconfig-bgp-types { prefix oc-bgpt; }
import openconfig-extensions { prefix oc-ext; }
// meta
organization "OpenConfig working group";
contact
"OpenConfig working group
www.openconfig.net";
description
"This submodule contains common data definitions for BGP
attributes for use in BGP RIB tables.";
oc-ext:openconfig-version "0.3.0";
revision "2016-10-17" {
description
"OpenConfig BGP RIB refactor";
reference "0.3.0";
}
grouping bgp-as-path-attr-state {
description
"Data for representing BGP AS-PATH attribute";
leaf type {
type oc-bgpt:as-path-segment-type;
description
"The type of AS-PATH segment";
}
leaf-list member {
type inet:as-number;
description
"List of the AS numbers in the AS-PATH segment";
}
}
grouping bgp-as-path-attr-top {
description
"Top-level grouping for AS-PATH attribute data";
container as-path {
description
"Enclosing container for the list of AS path segments.
In the Adj-RIB-In or Adj-RIB-Out, this list should show
the received or sent AS_PATH, respectively. For
example, if the local router is not 4-byte capable, this
value should consist of 2-octet ASNs or the AS_TRANS
(AS 23456) values received or sent in route updates.
In the Loc-RIB, this list should reflect the effective
AS path for the route, e.g., a 4-octet value if the
local router is 4-octet capable.";
reference
"RFC 4271 - A Border Gateway Protocol 4 (BGP-4)
RFC 6793 - BGP Support for Four-octet AS Number Space
RFC 5065 - Autonomous System Confederations for BGP";
list segment {
description
"Unkeyed list of AS PATH segments";
container state {
config false;
description
"Opstate data for AS-PATH segments";
uses bgp-as-path-attr-state;
}
}
}
}
grouping bgp-as4-path-attr-top {
description
"Top-level grouping for AS4-PATH attribute data";
container as4-path {
description
"This is the path encoded with 4-octet
AS numbers in the optional transitive AS4_PATH attribute.
This value is populated with the received or sent attribute
in Adj-RIB-In or Adj-RIB-Out, respectively. It should not
be populated in Loc-RIB since the Loc-RIB is expected to
store the effective AS-Path in the as-path leaf regardless
of being 4-octet or 2-octet.";
reference
"RFC 6793 - BGP Support for Four-octet AS Number Space";
list segment {
description
"Unkeyed list of AS PATH segments";
container state {
config false;
description
"Opstate data for AS-PATH segments";
uses bgp-as-path-attr-state;
}
}
}
}
grouping bgp-community-attr-state {
description
"Common definition of BGP community attributes";
leaf-list community {
type union {
type oc-bgpt:bgp-well-known-community-type;
type oc-bgpt:bgp-std-community-type;
}
description
"List of standard or well-known BGP community
attributes.";
}
}
grouping bgp-extended-community-attr-state {
description
"Common definition of BGP extended community attribute";
leaf-list ext-community {
type oc-bgpt:bgp-ext-community-recv-type;
description
"List of BGP extended community attributes. The received
extended community may be an explicitly modeled
type or unknown, represented by an 8-octet value
formatted according to RFC 4360.";
reference
"RFC 4360 - BGP Extended Communities Attribute";
}
}
grouping bgp-aggregator-attr-state {
description
"Operational state data for the BGP aggregator
attribute";
leaf as {
type inet:as-number;
description
"AS number of the autnonomous system that performed the
aggregation.";
}
leaf as4 {
type inet:as-number;
description
"AS number of the autnonomous system that performed the
aggregation (4-octet representation). This value is
populated if an upstream router is not 4-octet capable.
Its semantics are similar to the AS4_PATH optional
transitive attribute";
reference
"RFC 6793 - BGP Support for Four-octet AS Number Space";
}
leaf address {
type inet:ipv4-address;
description
"IP address of the router that performed the
aggregation.";
}
}
grouping bgp-aggregator-attr-top {
description
"Common definition of the BGP aggregator attribute";
container aggregator {
description
"BGP attribute indicating the prefix has been aggregated by
the specified AS and router.";
container state {
config false;
description
"Operational state data for BGP aggregator attribute";
uses bgp-aggregator-attr-state;
}
}
}
grouping bgp-shared-common-attr-state {
description
"Route attributes shared across route table entries,
common to both LOC-Rib and Adj-RIB";
leaf origin {
type oc-bgpt:bgp-origin-attr-type;
description
"BGP attribute defining the origin of the path information.";
}
leaf atomic-aggregate {
type boolean;
description
"BGP attribute indicating that the prefix is an atomic
aggregate, i.e., the peer selected a less specific
route without selecting a more specific route that is
included in it.";
}
leaf next-hop {
type inet:ip-address;
description
"BGP next hop attribute defining the IP address of the router
that should be used as the next hop to the destination";
}
leaf med {
type uint32;
description
"BGP multi-exit discriminator attribute used in BGP route
selection process";
}
leaf local-pref {
type uint32;
description
"BGP local preference attribute sent to internal peers to
indicate the degree of preference for externally learned
routes. The route with the highest local preference value
is preferred.";
}
leaf originator-id {
type inet:ipv4-address;
description
"BGP attribute that provides the id as an IPv4 address
of the originator of the announcement.";
reference
"RFC 4456 - BGP Route Reflection: An Alternative to Full
Mesh Internal BGP (IBGP)";
}
leaf-list cluster-list {
type inet:ipv4-address;
description
"Represents the reflection path that the route has passed.";
reference
"RFC 4456 - BGP Route Reflection: An Alternative to Full
Mesh Internal BGP (IBGP)";
}
leaf aigp {
type uint64;
description
"BGP path attribute representing the accumulated IGP metric
for the path";
reference
"RFC 7311 - The Accumulated IGP Metric Attribute for BGP";
}
}
grouping bgp-unknown-attr-flags-state {
description
"Operational state data for path attribute flags";
leaf optional {
type boolean;
description
"Defines whether the attribute is optional (if
set to true) or well-known (if set to false).
Set in the high-order bit of the BGP attribute
flags octet.";
reference
"RFC 4271 - A Border Gateway Protocol 4 (BGP-4)";
}
leaf transitive {
type boolean;
description
"Defines whether an optional attribute is transitive
(if set to true) or non-transitive (if set to false). For
well-known attributes, the transitive flag MUST be set to
true. Set in the second high-order bit of the BGP attribute
flags octet.";
reference
"RFC 4271 - A Border Gateway Protocol 4 (BGP-4)";
}
leaf partial {
type boolean;
description
"Defines whether the information contained in the optional
transitive attribute is partial (if set to true) or complete
(if set to false). For well-known attributes and for
optional non-transitive attributes, the partial flag
must be set to false. Set in the third high-order bit of
the BGP attribute flags octet.";
reference
"RFC 4271 - A Border Gateway Protocol 4 (BGP-4)";
}
leaf extended {
type boolean;
description
"Defines whether the attribute length is one octet
(if set to false) or two octets (if set to true). Set in
the fourth high-order bit of the BGP attribute flags
octet.";
reference
"RFC 4271 - A Border Gateway Protocol 4 (BGP-4)";
}
}
grouping bgp-unknown-attr-state {
description
"Operational state data for path attributes not shared
across route entries, common to LOC-RIB and Adj-RIB";
leaf attr-type {
type uint8;
description
"1-octet value encoding the attribute type code";
reference
"RFC 4271 - A Border Gateway Protocol 4 (BGP-4)";
}
leaf attr-len {
type uint16;
description
"One or two octet attribute length field indicating the
length of the attribute data in octets. If the Extended
Length attribute flag is set, the length field is 2 octets,
otherwise it is 1 octet";
reference
"RFC 4271 - A Border Gateway Protocol 4 (BGP-4)";
}
leaf attr-value {
type binary {
length 1..65535;
}
description
"Raw attribute value, not including the attribute
flags, type, or length. The maximum length
of the attribute value data is 2^16-1 per the max value
of the attr-len field (2 octets).";
reference
"RFC 4271 - A Border Gateway Protocol 4 (BGP-4)";
}
}
grouping bgp-unknown-attr-top {
description
"Unknown path attributes that are not expected to be shared
across route entries, common to LOC-RIB and Adj-RIB";
container unknown-attributes {
description
"Unknown path attributes that were received in the UPDATE
message which contained the prefix.";
list unknown-attribute {
key "attr-type";
description
"This list contains received attributes that are unrecognized
or unsupported by the local router. The list may be empty.";
leaf attr-type {
type leafref {
path "../state/attr-type";
}
description
"Reference to the list key";
}
container state {
description
"Operational state for unknown route attributes";
uses bgp-unknown-attr-flags-state;
uses bgp-unknown-attr-state;
}
}
}
}
grouping bgp-loc-rib-attr-state {
description
"Path attributes that are not expected to be shared across
route entries, specific to LOC-RIB";
}
grouping bgp-adj-rib-attr-state {
description
"Path attributes that are not expected to be shared across
route entries, specific to Adj-RIB";
leaf path-id {
type uint32;
description
"When the BGP speaker supports advertisement of multiple
paths for a prefix, the path identifier is used to
uniquely identify a route based on the combination of the
prefix and path id. In the Adj-RIB-In, the path-id value is
the value received in the update message. In the Loc-RIB,
if used, it should represent a locally generated path-id
value for the corresponding route. In Adj-RIB-Out, it
should be the value sent to a neighbor when add-paths is
used, i.e., the capability has been negotiated.";
reference
"draft-ietf-idr-add-paths - Advertisement of Multiple Paths
in BGP";
}
}
}
| YANG | 5 | meodaiduoi/onos | models/openconfig/src/main/yang/rib/[email protected] | [
"Apache-2.0"
] |
#! /bin/sh -e
dir=
if [ $# -eq 3 -a "$2" = '-d' ]; then
pdir="-d $3"
dir="$3/"
elif [ $# -ne 1 ]; then
echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
exit 1
fi
case "$1" in
-patch)
patch $pdir -f --no-backup-if-mismatch -p0 < $0
#cd ${dir}gcc && autoconf
;;
-unpatch)
patch $pdir -f --no-backup-if-mismatch -R -p0 < $0
#rm ${dir}gcc/configure
;;
*)
echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
exit 1
esac
exit 0
# DP: 2003-05-15 Philip Blundell <[email protected]>
# DP:
# DP: PR target/10730
# DP: * config/arm/arm.c (adjacent_mem_locations): Reject offsets
# DP: involving invalid constants.
Index: arm.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/arm/arm.c,v
retrieving revision 1.271
diff -u -p -r1.271 arm.c
--- gcc/config/arm/arm.c 10 May 2003 13:10:46 -0000 1.271
+++ gcc/config/arm/arm.c 14 May 2003 21:26:26 -0000
@@ -4567,6 +4571,12 @@ adjacent_mem_locations (a, b)
else
reg1 = REGNO (XEXP (b, 0));
+ /* Don't accept any offset that will require multiple instructions to handle,
+ since this would cause the arith_adjacentmem pattern to output an overlong
+ sequence. */
+ if (!const_ok_for_op (PLUS, val0) || !const_ok_for_op (PLUS, val1))
+ return 0;
+
return (reg0 == reg1) && ((val1 - val0) == 4 || (val0 - val1) == 4);
}
return 0;
| Darcs Patch | 4 | JrCs/opendreambox | recipes/gcc/gcc-3.3.3/arm-10730.dpatch | [
"MIT"
] |
-module(erl_tar_table).
%% OTP-14860, PR 1670.
-export([t/0, v/0, x/0]).
t() ->
{ok, ["file"]} = erl_tar:table("table.tar").
v() ->
{ok, [{_,_,_,_,_,_,_}]} = erl_tar:table("table.tar", [verbose]).
x() ->
{ok, ["file"]} = erl_tar:table("table.tar", []).
| Erlang | 4 | jjhoo/otp | lib/dialyzer/test/small_SUITE_data/src/erl_tar_table.erl | [
"Apache-2.0"
] |
copy node_modules\webpack5\lib\hmr\HotModuleReplacement.runtime.js packages\next\bundles\webpack\packages\
copy node_modules\webpack5\lib\hmr\JavascriptHotModuleReplacement.runtime.js packages\next\bundles\webpack\packages\
copy node_modules\webpack5\hot\lazy-compilation-node.js packages\next\bundles\webpack\packages\
copy node_modules\webpack5\hot\lazy-compilation-web.js packages\next\bundles\webpack\packages\
yarn --cwd packages/next ncc-compiled
rem Make sure to exit with 1 if there are changes after running ncc-compiled
rem step to ensure we get any changes committed
| Batchfile | 1 | blomqma/next.js | scripts/check-pre-compiled.bat | [
"MIT"
] |
-module(yes_23).
-export([?MODULE/0]).
?MODULE() ->
ok = return_before_receive(ok),
ok = return_before_receive(ok),
{error, whatever} = return_before_receive(error),
ok.
return_before_receive(Cmd) ->
RecvRef = make_ref(),
case value(Cmd, RecvRef) of
ok ->
ok;
{error, eagain} ->
receive
{abort, {RecvRef, Reason}} ->
{error, Reason}
end
end.
value(error, Ref) ->
self() ! {abort, {Ref, whatever}},
{error, eagain};
value(ok, _Ref) ->
ok.
| Erlang | 4 | jjhoo/otp | lib/compiler/test/receive_SUITE_data/ref_opt/yes_23.erl | [
"Apache-2.0"
] |
(* ****** ****** *)
#include
"share/atspre_staload.hats"
#include
"share/atspre_staload_libats_ML.hats"
(* ****** ****** *)
#include
"$PATSHOMELOCS\
/atscntrb-hx-libjson-c/mylibies.hats"
#include
"$PATSHOMELOCS\
/atscntrb-hx-libjson-c/mylibies_link.hats"
#staload $JSON_ML
fun
jsonval_int
(x: int) = JSONint(g0i2i(x))
(* ****** ****** *)
//
#staload UN = $UNSAFE
//
(* ****** ****** *)
//
#include
"$PATSHOMELOCS\
/atscntrb-hx-teaching-bucs/mylibies.hats"
//
(* ****** ****** *)
//
abst@ype state_t0ype
abst@ype input_t0ype
//
typedef state = state_t0ype
typedef input = input_t0ype
//
(* ****** ****** *)
datatype
status =
| STATUSsolved of ()
| STATUStimeup of ()
| STATUSasking of ()
(* ****** ****** *)
//
extern
fun
state_check
(&state): status
extern
fun
state_update
(&state >> _, input): int
extern
fun
state_initize
( state: &state? >> _
, ntime: int, word0: string): int
(* ****** ****** *)
//
extern
fun
GameLoop
(&state >> _, stream_vt(input)): int
and
GameLoop_solved
(&state >> _, stream_vt(input)): int
and
GameLoop_timeup
(&state >> _, stream_vt(input)): int
and
GameLoop_asking
(&state >> _, stream_vt(input)): int
//
(* ****** ****** *)
fun
is_solved
( w0: string
, guess: list0(char)
) : bool =
(w0).forall()
(lam(c0) => is_guessed(c0, guess))
and
is_guessed
( c0: char
, guess: list0(char)
) : bool =
(guess).exists()(lam(c1) => c0=c1)
and
is_contained
( c0: char
, word0: string
) : bool =
(word0).exists()(lam(c1) => c0=c1)
(* ****** ****** *)
fun
word_choose
(
// argless
) : string = let
//
val lines =
streamize_fileref_line
(stdin_ref)
//
in
//
case+ !lines of
| ~stream_vt_nil
((*void*)) => "camouflage"
| ~stream_vt_cons
(w0, lines) =>
let val () = free(lines) in w0 end
//
end // end of [word_choose]
(* ****** ****** *)
fun
word_display
( word0: string
, guess: list0(char)
) : void =
(
(word0).foreach()
(lam(c0) =>
print_char
(if is_guessed(c0, guess) then c0 else '_')
)
) (* end of [word_display] *)
(* ****** ****** *)
implement
GameLoop
(state, xs) = let
//
val
status = state_check(state)
//
in
case+ status of
| STATUSsolved() => GameLoop_solved(state, xs)
| STATUStimeup() => GameLoop_timeup(state, xs)
| STATUSasking() => GameLoop_asking(state, xs)
end // end of [GameLoop]
(* ****** ****** *)
#define
Channel01Insert
"http://cs320.herokuapp.com/api/channel01/insert"
(* ****** ****** *)
#define
Channel00Readall
"http://cs320.herokuapp.com/api/channel00/readall"
#define
Channel00Clearall
"http://cs320.herokuapp.com/api/channel00/clearall"
#define
Channel01Clearall
"http://cs320.herokuapp.com/api/channel01/clearall"
(* ****** ****** *)
//
fun
channel01_insert_msg
(msg: string): void = let
val opt =
$BUCS520.streamopt_url_char<>
(string_append3
(Channel01Insert, "/", msg))
in
case+ opt of
| ~None_vt() => ()
| ~Some_vt(cs) => free(stream2list_vt(cs))
end // end of [channel01_insert_msg]
//
(* ****** ****** *)
fun
channel00_clearall
((*void*)): void = let
val opt =
$BUCS520.streamopt_url_char<>
(Channel00Clearall)
in
case+ opt of
| ~None_vt() => ()
| ~Some_vt(cs) => free(stream2list_vt(cs))
end // end of [channel00_clearall]
fun
channel01_clearall
((*void*)): void = let
val opt =
$BUCS520.streamopt_url_char<>
(Channel01Clearall)
in
case+ opt of
| ~None_vt() => ()
| ~Some_vt(cs) => free(stream2list_vt(cs))
end // end of [channel01_clearall]
(* ****** ****** *)
local
assume
state_t0ype = @{
ntime= int
,
word0= string
,
guess= list0(char)
}
assume input_t0ype = char
in (* in-of-local *)
implement
state_check
(state) = let
//
val word0 = state.word0
val guess = state.guess
//
in
//
(
ifcase
| is_solved
(word0, guess) => STATUSsolved()
| state.ntime = 0 => STATUStimeup()
| _ (*otherwise*) => STATUSasking()
)
//
end // end of [state_check]
implement
state_update
(state, input) = let
//
val c0 = input
val nt = state.ntime
val w0 = state.word0
val cs = state.guess
//
val ns =
auxlst(0, xs) where
{
fun
auxlst
(
i: int
,
xs: stream_vt(char)
) : List0_vt(int) =
(
case+ !xs of
| ~stream_vt_nil
() => list_vt_nil()
| ~stream_vt_cons
(x0, xs) =>
(
if x0 != c0
then auxlst(i+1, xs)
else list_vt_cons(i, auxlst(i+1, xs))
) (* end of [stream_vt_cons] *)
)
val xs = streamize_string_char(w0)
} (* end of [val] *)
//
val ns = list_vt_reverse(ns)
val ns = list_vt_mapfree_cloptr<int><jsonval>(ns, lam(n)=>jsonval_int(n))
val ns = JSONarray(list_vt2t(ns))
val ns = jsonval_tostring(ns)
val () = channel01_insert_msg($UN.strptr2string(ns))
val ((*freed*)) = strptr_free(ns)
//
in
//
ifcase
| is_guessed
(c0, cs) => (0)
| is_contained
(c0, w0) =>
(state.guess := list0_cons(c0, cs); 0)
| _ (* otherwise *) =>
(state.ntime := nt-1;
state.guess := list0_cons(c0, cs); 1)
//
end // end of [state_update]
implement
state_initize
( state
, ntime, word0) = (0) where
{
//
val () = (state.ntime := ntime)
val () = (state.word0 := word0)
val () = (state.guess := list0_nil())
//
} // end of [state_initize]
implement
GameLoop_solved
(state, xs) =
state.ntime where
{
val () = free(xs)
val () = println! ("You solved it: ", state.word0)
}
implement
GameLoop_timeup
(state, xs) =
state.ntime where
{
val () = free(xs)
val () = channel01_insert_msg(state.word0)
val () = println! ("Sorry, you have no more chances.")
}
implement
GameLoop_asking
(state, xs) = let
//
val () =
println!
("Chances: ", state.ntime)
val () =
println!
("Guessed: ", state.guess)
val () =
word_display
(state.word0, state.guess)
//
val () = println!((*void*))
//
in
//
case+ !xs of
| ~stream_vt_nil() => (~1) where
{
val () =
println!
("ERROR: no input from the player!!!")
}
| ~stream_vt_cons(x0, xs) =>
let
val err =
state_update(state, x0) in GameLoop(state, xs)
end
//
end // end of [GameLoop_asking]
end // end of [local]
(* ****** ****** *)
local
#staload
"./Hangman3_channel.dats"
in (* in-of-local *)
fun
streamize_channel00
(
// argless
) : stream_vt(string) = let
//
val
CH0 = $UN.cast{channel}(0)
//
implement
channel_readall<>(ch) = let
val opt =
$BUCS520.streamopt_url_char<>
(Channel00Readall)
in
case+ opt of
| ~None_vt() =>
None_vt()
| ~Some_vt(xs) =>
Some_vt
(strptr2string
(string_make_stream_vt($UN.castvwtp0(xs)))
) (* end of [Some_vt] *)
end // end of [channel_readall]
//
in
streamize_channel<>(CH0)
end // end of [streamize_channel00]
end // end of [local]
(* ****** ****** *)
//
extern
fun
GameMain(): void
//
implement
GameMain((*void*)) =
{
//
val nt = 6
//
val () =
println!
("Choose a word:")
val w0 =
word_choose((*void*))
//
val () =
channel00_clearall()
val () =
channel01_clearall()
//
val () =
channel01_insert_msg
(strptr2string
(jsonval_tostring
(jsonval_int(nw)))) where
{
val nw = sz2i(length(w0))
}
//
var
state: state
val err =
state_initize(state, nt, w0)
//
val lines =
streamize_channel00()
val lines =
stream_vt_map<string><string>
(lines) where
{
//
implement
stream_vt_map$fopr<string><string>
(line) =
trunc
(string2ptr(line)) where
{
//
fun
trunc(p0: ptr): string = let
//
val c0 = $UN.ptr0_get<char>(p0)
//
in
//
if
iseqz(c0)
then "" else
(
if
(c0 != ':')
then
trunc(ptr_succ<char>(p0))
else
$UN.cast{string}(ptr_succ<char>(p0))
)
//
end // end of [trunc]
} (* end of [stream_vt_map$fopr] *)
}
//
val
cs = auxmain(lines) where
{
//
fun
auxmain
(
xs:
stream_vt(string)
) : stream_vt(char) = $ldelay
(
(
case+ !xs of
| ~stream_vt_nil() =>
stream_vt_nil()
| ~stream_vt_cons(x0, xs) => let
val x0 = g1ofg0(x0)
in
if
iseqz(x0)
then !(auxmain(xs))
else stream_vt_cons(x0[0], auxmain(xs))
end // end of [stream_vt_cons]
)
, (lazy_vt_free(xs))
)
}
//
val
ntime =
GameLoop(state, cs)
where
{ reassume input_t0ype }
//
val ((*void*)) = println! ("Game Over: ", ntime)
//
} (* end of [GameMain] *)
(* ****** ****** *)
implement main0() = GameMain()
(* ****** ****** *)
(* end of [Hangman3_player0.dats] *)
| ATS | 3 | ats-lang/ATS-CodeBook | RECIPE/Hangman3/Hangman3_player0.dats | [
"MIT"
] |
module functions01;
wire t;
wire [5:2]x;
wire [3:0]y[2:7];
wire [3:0]z[7:2][2:9];
//wire [$size(x)-1:0]x_size;
//wire [$size({x, x})-1:0]xx_size;
//wire [$size(y)-1:0]y_size;
//wire [$size(z)-1:0]z_size;
assert property ($size(t) == 1);
assert property ($size(x) == 4);
assert property ($size({3{x}}) == 3*4);
assert property ($size(y) == 6);
assert property ($size(y, 1) == 6);
assert property ($size(y, (1+1)) == 4);
// This is unsupported at the moment
//assert property ($size(y[2], 1) == 4);
//assert property ($size(y[2][1], 1) == 1);
assert property ($size(z) == 6);
assert property ($size(z, 1) == 6);
assert property ($size(z, 2) == 8);
assert property ($size(z, 3) == 4);
// This is unsupported at the moment
assert property ($size(z[3], 1) == 8);
assert property ($size(z[3][3], 1) == 4);
//assert property ($size(z[3][3][3], 1) == 1);
// This should trigger an error if enabled (it does).
//assert property ($size(z, 4) == 4);
//wire [$bits(x)-1:0]x_bits;
//wire [$bits({x, x})-1:0]xx_bits;
assert property ($bits(t) == 1);
assert property ($bits(x) == 4);
assert property ($bits(y) == 4*6);
assert property ($bits(z) == 4*6*8);
assert property ($high(x) == 5);
assert property ($high(y) == 7);
assert property ($high(y, 1) == 7);
assert property ($high(y, (1+1)) == 3);
assert property ($high(z) == 7);
assert property ($high(z, 1) == 7);
assert property ($high(z, 2) == 9);
assert property ($high(z, 3) == 3);
assert property ($high(z[3]) == 9);
assert property ($high(z[3][3]) == 3);
assert property ($high(z[3], 2) == 3);
assert property ($low(x) == 2);
assert property ($low(y) == 2);
assert property ($low(y, 1) == 2);
assert property ($low(y, (1+1)) == 0);
assert property ($low(z) == 2);
assert property ($low(z, 1) == 2);
assert property ($low(z, 2) == 2);
assert property ($low(z, 3) == 0);
assert property ($low(z[3]) == 2);
assert property ($low(z[3][3]) == 0);
assert property ($low(z[3], 2) == 0);
assert property ($left(x) == 5);
assert property ($left(y) == 2);
assert property ($left(y, 1) == 2);
assert property ($left(y, (1+1)) == 3);
assert property ($left(z) == 7);
assert property ($left(z, 1) == 7);
assert property ($left(z, 2) == 2);
assert property ($left(z, 3) == 3);
assert property ($left(z[3]) == 2);
assert property ($left(z[3][3]) == 3);
assert property ($left(z[3], 2) == 3);
assert property ($right(x) == 2);
assert property ($right(y) == 7);
assert property ($right(y, 1) == 7);
assert property ($right(y, (1+1)) == 0);
assert property ($right(z) == 2);
assert property ($right(z, 1) == 2);
assert property ($right(z, 2) == 9);
assert property ($right(z, 3) == 0);
assert property ($right(z[3]) == 9);
assert property ($right(z[3][3]) == 0);
assert property ($right(z[3], 2) == 0);
endmodule
| SystemVerilog | 3 | gudeh/yosys | tests/sat/sizebits.sv | [
"ISC"
] |
html {
head {
title('Parrot parser')
link[href='/content/site.css' rel='stylesheet' type='text/css']
}
body {
form[action='/' method='post'] {
table[style='width:100%;'] {
tr {
td[style='width:50%'] {
h3('Model')
textarea[
name='model'
style='width:100%; height:300px;'
](Item2)
}
td[style='width:50%'] {
h3('Template')
textarea[name='template' style='width:100%; height:300px;'](Item1)
}
}
}
input[type='submit' value='Parse']
}
table[style='width:100%;'] {
tr {
td[style='width:50%; vertical-align:top;'] {
h3('Output')
pre {
:Item3
}
}
td[style='width:50%; vertical-align:top;'] {
h3('Render')
=Item3
}
}
}
}
} | Parrot | 3 | ParrotFx/Parrot | src/Backup/Parrot.SampleSite/Views/Home/Index.parrot | [
"MIT"
] |
; CLW file contains information for the MFC ClassWizard
[General Info]
Version=1
LastClass=CMFCDialogDlg
LastTemplate=CDialog
NewFileInclude1=#include "stdafx.h"
NewFileInclude2=#include "MFCDialog.h"
ClassCount=4
Class1=CMFCDialogApp
Class2=CMFCDialogDlg
Class3=CAboutDlg
ResourceCount=3
Resource1=IDD_ABOUTBOX
Resource2=IDR_MAINFRAME
Resource3=IDD_MFCDIALOG_DIALOG
[CLS:CMFCDialogApp]
Type=0
HeaderFile=MFCDialog.h
ImplementationFile=MFCDialog.cpp
Filter=N
[CLS:CMFCDialogDlg]
Type=0
HeaderFile=MFCDialogDlg.h
ImplementationFile=MFCDialogDlg.cpp
Filter=D
[CLS:CAboutDlg]
Type=0
HeaderFile=MFCDialogDlg.h
ImplementationFile=MFCDialogDlg.cpp
Filter=D
[DLG:IDD_ABOUTBOX]
Type=1
Class=CAboutDlg
ControlCount=4
Control1=IDC_STATIC,static,1342177283
Control2=IDC_STATIC,static,1342308480
Control3=IDC_STATIC,static,1342308352
Control4=IDOK,button,1342373889
[DLG:IDD_MFCDIALOG_DIALOG]
Type=1
Class=CMFCDialogDlg
ControlCount=3
Control1=IDOK,button,1342242817
Control2=IDCANCEL,button,1342242816
Control3=IDC_STATIC,static,1342308352
| Clarion | 0 | youngqqcn/WindowsNotes | MFC/day01/MFCDialog/MFCDialog.clw | [
"MIT"
] |
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { CharCode } from 'vs/base/common/charCode';
import * as strings from 'vs/base/common/strings';
/**
* A column in a position is the gap between two adjacent characters. The methods here
* work with a concept called "visible column". A visible column is a very rough approximation
* of the horizontal screen position of a column. For example, using a tab size of 4:
* ```txt
* |<TAB>|<TAB>|T|ext
* | | | \---- column = 4, visible column = 9
* | | \------ column = 3, visible column = 8
* | \------------ column = 2, visible column = 4
* \------------------ column = 1, visible column = 0
* ```
*
* **NOTE**: Visual columns do not work well for RTL text or variable-width fonts or characters.
*
* **NOTE**: These methods work and make sense both on the model and on the view model.
*/
export class CursorColumns {
private static _nextVisibleColumn(codePoint: number, visibleColumn: number, tabSize: number): number {
if (codePoint === CharCode.Tab) {
return CursorColumns.nextRenderTabStop(visibleColumn, tabSize);
}
if (strings.isFullWidthCharacter(codePoint) || strings.isEmojiImprecise(codePoint)) {
return visibleColumn + 2;
}
return visibleColumn + 1;
}
/**
* Returns a visible column from a column.
* @see {@link CursorColumns}
*/
public static visibleColumnFromColumn(lineContent: string, column: number, tabSize: number): number {
const textLen = Math.min(column - 1, lineContent.length);
const text = lineContent.substring(0, textLen);
const iterator = new strings.GraphemeIterator(text);
let result = 0;
while (!iterator.eol()) {
const codePoint = strings.getNextCodePoint(text, textLen, iterator.offset);
iterator.nextGraphemeLength();
result = this._nextVisibleColumn(codePoint, result, tabSize);
}
return result;
}
/**
* Returns the value to display as "Col" in the status bar.
* @see {@link CursorColumns}
*/
public static toStatusbarColumn(lineContent: string, column: number, tabSize: number): number {
const text = lineContent.substring(0, Math.min(column - 1, lineContent.length));
const iterator = new strings.CodePointIterator(text);
let result = 0;
while (!iterator.eol()) {
const codePoint = iterator.nextCodePoint();
if (codePoint === CharCode.Tab) {
result = CursorColumns.nextRenderTabStop(result, tabSize);
} else {
result = result + 1;
}
}
return result + 1;
}
/**
* Returns a column from a visible column.
* @see {@link CursorColumns}
*/
public static columnFromVisibleColumn(lineContent: string, visibleColumn: number, tabSize: number): number {
if (visibleColumn <= 0) {
return 1;
}
const lineContentLength = lineContent.length;
const iterator = new strings.GraphemeIterator(lineContent);
let beforeVisibleColumn = 0;
let beforeColumn = 1;
while (!iterator.eol()) {
const codePoint = strings.getNextCodePoint(lineContent, lineContentLength, iterator.offset);
iterator.nextGraphemeLength();
const afterVisibleColumn = this._nextVisibleColumn(codePoint, beforeVisibleColumn, tabSize);
const afterColumn = iterator.offset + 1;
if (afterVisibleColumn >= visibleColumn) {
const beforeDelta = visibleColumn - beforeVisibleColumn;
const afterDelta = afterVisibleColumn - visibleColumn;
if (afterDelta < beforeDelta) {
return afterColumn;
} else {
return beforeColumn;
}
}
beforeVisibleColumn = afterVisibleColumn;
beforeColumn = afterColumn;
}
// walked the entire string
return lineContentLength + 1;
}
/**
* ATTENTION: This works with 0-based columns (as oposed to the regular 1-based columns)
* @see {@link CursorColumns}
*/
public static nextRenderTabStop(visibleColumn: number, tabSize: number): number {
return visibleColumn + tabSize - visibleColumn % tabSize;
}
/**
* ATTENTION: This works with 0-based columns (as oposed to the regular 1-based columns)
* @see {@link CursorColumns}
*/
public static nextIndentTabStop(visibleColumn: number, indentSize: number): number {
return visibleColumn + indentSize - visibleColumn % indentSize;
}
/**
* ATTENTION: This works with 0-based columns (as opposed to the regular 1-based columns)
* @see {@link CursorColumns}
*/
public static prevRenderTabStop(column: number, tabSize: number): number {
return Math.max(0, column - 1 - (column - 1) % tabSize);
}
/**
* ATTENTION: This works with 0-based columns (as opposed to the regular 1-based columns)
* @see {@link CursorColumns}
*/
public static prevIndentTabStop(column: number, indentSize: number): number {
return Math.max(0, column - 1 - (column - 1) % indentSize);
}
}
| TypeScript | 5 | sbj42/vscode | src/vs/editor/common/core/cursorColumns.ts | [
"MIT"
] |
acl:relcl
flat:name
nmod:poss
nmod:obl
nmod:agent
nmod:nsubj
nmod:obj
nmod:ccomp
case:pred
aux:pass
obl:agent
nsubj:pass
| Cycript | 0 | mlej8/MultilangStructureKD | EUD/data/deprel.cy | [
"MIT"
] |
{
key.results: [
{
key.typename: "S<T>",
key.typeusr: "$s20typecontext_generics1SVyxGD",
key.implicitmembers: [
{
key.name: "instance",
key.sourcetext: "instance",
key.description: "instance"
}
]
}
]
}
| Groff | 0 | lwhsu/swift | test/SourceKit/TypeContextInfo/typecontext_generics.swift.response.3 | [
"Apache-2.0"
] |
*** Setting ***
Resource 02_resource.robot
*** Test Case ***
Test 1.1
Keyword From 02 Resource
Log ${var_from_02_resource}
| RobotFramework | 3 | phil-davis/robotframework | atest/testdata/parsing/resource_parsing/01_tests.robot | [
"ECL-2.0",
"Apache-2.0"
] |
.SUBCKT BUF A Y
.model buffer1 d_buffer
Abuf A Y buffer1
.ENDS NOT
.SUBCKT NOT A Y
.model not1 d_inverter
Anot A Y not1
.ENDS NOT
.SUBCKT NAND A B Y
.model nand1 d_nand
Anand [A B] Y nand1
.ENDS NAND
.SUBCKT NOR A B Y
.model nor1 d_nor
Anand [A B] Y nor1
.ENDS NOR
.SUBCKT DLATCH E D Q
.model latch1 d_latch
Alatch D E null null Q nQ latch1
.ENDS DLATCH
.SUBCKT DFF C D Q
.model dff1 d_dff
Adff D C null null Q nQ dff1
.ENDS DFF
| SourcePawn | 4 | kallisti5/yosys | examples/cmos/cmos_cells_digital.sp | [
"ISC"
] |
(ns wisp.string
(:require [wisp.runtime :refer [str subs re-matches nil? string?]]
[wisp.sequence :refer [vec empty?]]))
(defn split
"Splits string on a regular expression. Optional argument limit is
the maximum number of splits. Not lazy. Returns vector of the splits."
[string pattern limit]
(.split string pattern limit))
(defn join
"Returns a string of all elements in coll, as returned by (seq coll),
separated by an optional separator."
([coll]
(apply str (vec coll)))
([separator coll]
(.join (vec coll) separator)))
(defn upper-case
"Converts string to all upper-case."
[string]
(.toUpperCase string))
(defn upper-case
"Converts string to all upper-case."
[string]
(.toUpperCase string))
(defn lower-case
"Converts string to all lower-case."
[string]
(.toLowerCase string))
(defn ^String capitalize
"Converts first character of the string to upper-case, all other
characters to lower-case."
[string]
(if (< (count string) 2)
(upper-case string)
(str (upper-case (subs s 0 1))
(lower-case (subs s 1)))))
(defn replace
"Replaces all instance of match with replacement in s.
match/replacement can be:
string / string
char / char
pattern / (string or function of match).
See also replace-first."
[string match replacement]
(.replace string match replacement))
;(def **WHITESPACE** (str "[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000"
; "\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008"
; "\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]"))
;(def **LEFT-SPACES** (re-pattern (str "^" **WHITESPACE** **WHITESPACE** "*")))
;(def **RIGHT-SPACES** (re-pattern (str **WHITESPACE** **WHITESPACE** "*$")))
;(def **SPACES** (re-pattern (str "^" **WHITESPACE** "*$")))
(def **LEFT-SPACES** #"^\s\s*")
(def **RIGHT-SPACES** #"\s\s*$")
(def **SPACES** #"^\s\s*$")
(def
^{:tag string
:doc "Removes whitespace from the left side of string."}
triml
(if (nil? (.-trimLeft ""))
(fn [string] (.replace string **LEFT-SPACES** ""))
(fn [string] (.trimLeft string))))
(def
^{:tag string
:doc "Removes whitespace from the right side of string."}
trimr
(if (nil? (.-trimRight ""))
(fn [string] (.replace string **RIGHT-SPACES** ""))
(fn [string] (.trimRight string))))
(def
^{:tag string
:doc "Removes whitespace from both ends of string."}
trim
(if (nil? (.-trim ""))
(fn [string] (.replace (.replace string **LEFT-SPACES**) **RIGHT-SPACES**))
(fn [string] (.trim string))))
(defn blank?
"True if s is nil, empty, or contains only whitespace."
[string]
(or (nil? string)
(empty? string)
(re-matches **SPACES** string)))
| wisp | 5 | bamboo/wisp | src/string.wisp | [
"BSD-3-Clause"
] |
$$ MODE TUSCRIPT
condition="c"
IF (condition=="a") THEN
---> do something
ELSEIF (condition=="b") THEN
---> do something
ELSE
---> do something
ENDIF
| Turing | 3 | LaudateCorpus1/RosettaCodeData | Task/Conditional-structures/TUSCRIPT/conditional-structures-1.tu | [
"Info-ZIP"
] |
Two songs: {{song}} {{song}} | Volt | 1 | tidytrax/cphalcon | tests/_data/fixtures/views/extends/other.volt | [
"BSD-3-Clause"
] |
bst-unpersist(1) "bst" "Bestie"
# NAME
bst-unpersist - release persisted namespace files
# SYNOPSIS
bst-unpersist [options] <path> [path...]
# DESCRIPTION
Releases persisted specified namespace files, or all known namespace files
in the specified directories.
*bst*(1) can persist created namespaces on entry via the _--persist_ option.
A typical way to release these persisted namespaces is through the unmounting
of these files, but this requires the user to be privileged.
*bst-unpersist* gives unprivilged users a way to release these persisted
namespaces without privilege escalation.
A user is allowed to release an arbitrary namespace file only if:
. It is an nsfs mount,
. The user has write permissions over the containing directory, or has
CAP_DAC_OVERRIDE.
# OPTIONS
\--no-unlink
Do not remove namespace file mountpoints after they get unmounted. This
use-case is atypical, but is useful if you plan to layer multiple nsfs
mounts on top of each other, and don't want the removal to fail with EBUSY.
# SEE ALSO
*bst*(1)
| SuperCollider | 3 | wwade/bst | man/bst-unpersist.1.scd | [
"MIT"
] |
SELECT tupleHammingDistance(tuple(1), tuple(1));
SELECT tupleHammingDistance(tuple(1), tuple(2));
SELECT tupleHammingDistance(tuple(1), tuple(Null));
SELECT tupleHammingDistance(tuple(Null), tuple(Null));
SELECT tupleHammingDistance((1, 2), (3, 4));
SELECT tupleHammingDistance((1, 2), (1, 4));
SELECT tupleHammingDistance(materialize((1, 2)), (1, 4));
SELECT tupleHammingDistance(materialize((1, 2)),materialize ((1, 4)));
SELECT tupleHammingDistance((1, 2), (1, 2));
SELECT tupleHammingDistance((1, 2), (1, 257));
SELECT tupleHammingDistance((1, 2, 3), (1, 257, 65537));
SELECT tupleHammingDistance((1, 2), (1, Null));
SELECT tupleHammingDistance((1, Null), (1, Null));
SELECT tupleHammingDistance((Null, Null), (Null, Null));
SELECT tupleHammingDistance(('abc', 2), ('abc', 257));
SELECT tupleHammingDistance(('abc', (1, 2)), ('abc', (1, 2)));
SELECT tupleHammingDistance(('abc', (1, 2)), ('def', (1, 2)));
SELECT tupleHammingDistance(('abc', (1, 2)), ('def', (1, 3)));
SELECT tupleHammingDistance(tuple(1), tuple(1, 1)); --{serverError 43}
SELECT tupleHammingDistance(tuple(1), tuple('a')); --{serverError 386}
SELECT tupleHammingDistance((1, 3), (3, 'a')); --{serverError 386}
| SQL | 4 | pdv-ru/ClickHouse | tests/queries/0_stateless/01653_tuple_hamming_distance_2.sql | [
"Apache-2.0"
] |
# Generate go.capnp.out with:
# capnp compile -o- go.capnp > go.capnp.out
# Must run inside this directory to preserve paths.
@0xd12a1c51fedd6c88;
annotation package(file) :Text;
annotation import(file) :Text;
annotation doc(struct, field, enum) :Text;
annotation tag(enumerant) :Text;
annotation notag(enumerant) :Void;
annotation customtype(field) :Text;
annotation name(struct, field, union, enum, enumerant, interface, method, param, annotation, const, group) :Text;
$package("capnp");
| Cap'n Proto | 4 | tsuna/go-capnproto2 | capnpc-go/testdata/go.capnp | [
"MIT"
] |
<html>
<head>
<title>Hover test!</title>
<style>
a:hover {
color: red;
}
</style>
</head>
<body>
<a href="hover.html">this is a link</a>
</body>
</html>
| HTML | 4 | r00ster91/serenity | Base/res/html/misc/hover.html | [
"BSD-2-Clause"
] |
/*
* Copyright 2014 The Sculptor Project Team, including the original
* author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License")
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.sculptor.generator.configuration
import com.google.inject.AbstractModule
import static com.google.inject.name.Names.*
/**
* Technical properties to customize the code generation are defined in
* <code>default-sculptor-generator.properties</code> and may be overridden in
* <code>common-sculptor-generator.properties</code>,
* <code>sculptor-generator.properties</code> or in Java system properties (in this order).
* These properties are available via this class.
* <p>
* The locations of these property files can be defined with the following
* system properties.
* <ul>
* <li><code>sculptor.generatorPropertiesLocation</code> - default
* <code>generator/sculptor-generator.properties</code></li>
* <li><code>sculptor.commonGeneratorPropertiesLocation</code> - common
* <code>common-sculptor-generator.properties</code></li>
* <li><code>sculptor.defaultGeneratorPropertiesLocation</code> - default
* <code>default-sculptor-generator.properties</code></li>
* </ul>
*
* <strong>These property files are retrieved as classpath resources from the
* current threads context classloader.</strong>.
*/
class ConfigurationProviderModule extends AbstractModule implements Configuration {
/**
* Prepares the binding for
*/
override protected configure() {
// Prepare configuration providers
val mutableDefaultProperties = new MutablePropertiesConfigurationProvider(
System.getProperty(DEFAULT_PROPERTIES_LOCATION_PROPERTY, DEFAULT_DEFAULT_PROPERTIES_LOCATION))
val optionalCommonProperties = new PropertiesConfigurationProvider(
System.getProperty(COMMON_PROPERTIES_LOCATION_PROPERTY, DEFAULT_COMMON_PROPERTIES_LOCATION), true)
val optionalProperties = new PropertiesConfigurationProvider(
System.getProperty(PROPERTIES_LOCATION_PROPERTY, DEFAULT_PROPERTIES_LOCATION), true)
val compositeConfiguration = new CompositeConfigurationProvider(new SystemPropertiesConfigurationProvider,
optionalProperties, optionalCommonProperties, mutableDefaultProperties)
// Prepare bindings
binder.bind(typeof(ConfigurationProvider)).toInstance(compositeConfiguration)
binder.bind(typeof(MutableConfigurationProvider)).annotatedWith(named("Mutable Defaults")).toInstance(
mutableDefaultProperties)
}
}
| Xtend | 5 | sculptor/sculptor | sculptor-generator/sculptor-generator-configuration/src/main/java/org/sculptor/generator/configuration/ConfigurationProviderModule.xtend | [
"Apache-2.0"
] |
-- This is an empty migration. | SQL | 0 | Alex4386/meiling | prisma/migrations/20210222021851_/migration.sql | [
"MIT"
] |
"""Demo platform that offers fake meteorological data."""
from __future__ import annotations
from datetime import timedelta
from homeassistant.components.weather import (
ATTR_CONDITION_CLOUDY,
ATTR_CONDITION_EXCEPTIONAL,
ATTR_CONDITION_FOG,
ATTR_CONDITION_HAIL,
ATTR_CONDITION_LIGHTNING,
ATTR_CONDITION_LIGHTNING_RAINY,
ATTR_CONDITION_PARTLYCLOUDY,
ATTR_CONDITION_POURING,
ATTR_CONDITION_RAINY,
ATTR_CONDITION_SNOWY,
ATTR_CONDITION_SNOWY_RAINY,
ATTR_CONDITION_SUNNY,
ATTR_CONDITION_WINDY,
ATTR_CONDITION_WINDY_VARIANT,
ATTR_FORECAST_CONDITION,
ATTR_FORECAST_PRECIPITATION,
ATTR_FORECAST_PRECIPITATION_PROBABILITY,
ATTR_FORECAST_TEMP,
ATTR_FORECAST_TEMP_LOW,
ATTR_FORECAST_TIME,
WeatherEntity,
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import TEMP_CELSIUS, TEMP_FAHRENHEIT
from homeassistant.core import HomeAssistant
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType
import homeassistant.util.dt as dt_util
CONDITION_CLASSES = {
ATTR_CONDITION_CLOUDY: [],
ATTR_CONDITION_FOG: [],
ATTR_CONDITION_HAIL: [],
ATTR_CONDITION_LIGHTNING: [],
ATTR_CONDITION_LIGHTNING_RAINY: [],
ATTR_CONDITION_PARTLYCLOUDY: [],
ATTR_CONDITION_POURING: [],
ATTR_CONDITION_RAINY: ["shower rain"],
ATTR_CONDITION_SNOWY: [],
ATTR_CONDITION_SNOWY_RAINY: [],
ATTR_CONDITION_SUNNY: ["sunshine"],
ATTR_CONDITION_WINDY: [],
ATTR_CONDITION_WINDY_VARIANT: [],
ATTR_CONDITION_EXCEPTIONAL: [],
}
async def async_setup_entry(
hass: HomeAssistant,
config_entry: ConfigEntry,
async_add_entities: AddEntitiesCallback,
) -> None:
"""Set up the Demo config entry."""
setup_platform(hass, {}, async_add_entities)
def setup_platform(
hass: HomeAssistant,
config: ConfigType,
add_entities: AddEntitiesCallback,
discovery_info: DiscoveryInfoType | None = None,
) -> None:
"""Set up the Demo weather."""
add_entities(
[
DemoWeather(
"South",
"Sunshine",
21.6414,
92,
1099,
0.5,
TEMP_CELSIUS,
[
[ATTR_CONDITION_RAINY, 1, 22, 15, 60],
[ATTR_CONDITION_RAINY, 5, 19, 8, 30],
[ATTR_CONDITION_CLOUDY, 0, 15, 9, 10],
[ATTR_CONDITION_SUNNY, 0, 12, 6, 0],
[ATTR_CONDITION_PARTLYCLOUDY, 2, 14, 7, 20],
[ATTR_CONDITION_RAINY, 15, 18, 7, 0],
[ATTR_CONDITION_FOG, 0.2, 21, 12, 100],
],
),
DemoWeather(
"North",
"Shower rain",
-12,
54,
987,
4.8,
TEMP_FAHRENHEIT,
[
[ATTR_CONDITION_SNOWY, 2, -10, -15, 60],
[ATTR_CONDITION_PARTLYCLOUDY, 1, -13, -14, 25],
[ATTR_CONDITION_SUNNY, 0, -18, -22, 70],
[ATTR_CONDITION_SUNNY, 0.1, -23, -23, 90],
[ATTR_CONDITION_SNOWY, 4, -19, -20, 40],
[ATTR_CONDITION_SUNNY, 0.3, -14, -19, 0],
[ATTR_CONDITION_SUNNY, 0, -9, -12, 0],
],
),
]
)
class DemoWeather(WeatherEntity):
"""Representation of a weather condition."""
def __init__(
self,
name,
condition,
temperature,
humidity,
pressure,
wind_speed,
temperature_unit,
forecast,
):
"""Initialize the Demo weather."""
self._name = name
self._condition = condition
self._temperature = temperature
self._temperature_unit = temperature_unit
self._humidity = humidity
self._pressure = pressure
self._wind_speed = wind_speed
self._forecast = forecast
@property
def name(self):
"""Return the name of the sensor."""
return f"Demo Weather {self._name}"
@property
def should_poll(self):
"""No polling needed for a demo weather condition."""
return False
@property
def temperature(self):
"""Return the temperature."""
return self._temperature
@property
def temperature_unit(self):
"""Return the unit of measurement."""
return self._temperature_unit
@property
def humidity(self):
"""Return the humidity."""
return self._humidity
@property
def wind_speed(self):
"""Return the wind speed."""
return self._wind_speed
@property
def pressure(self):
"""Return the pressure."""
return self._pressure
@property
def condition(self):
"""Return the weather condition."""
return [
k for k, v in CONDITION_CLASSES.items() if self._condition.lower() in v
][0]
@property
def attribution(self):
"""Return the attribution."""
return "Powered by Home Assistant"
@property
def forecast(self):
"""Return the forecast."""
reftime = dt_util.now().replace(hour=16, minute=00)
forecast_data = []
for entry in self._forecast:
data_dict = {
ATTR_FORECAST_TIME: reftime.isoformat(),
ATTR_FORECAST_CONDITION: entry[0],
ATTR_FORECAST_PRECIPITATION: entry[1],
ATTR_FORECAST_TEMP: entry[2],
ATTR_FORECAST_TEMP_LOW: entry[3],
ATTR_FORECAST_PRECIPITATION_PROBABILITY: entry[4],
}
reftime = reftime + timedelta(hours=4)
forecast_data.append(data_dict)
return forecast_data
| Python | 5 | MrDelik/core | homeassistant/components/demo/weather.py | [
"Apache-2.0"
] |
cdef bint c_is_list_like(object, bint) except -1
| Cython | 0 | CJL89/pandas | pandas/_libs/lib.pxd | [
"BSD-3-Clause"
] |
/*
* Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
* Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
*/
function main() {
println(typeOf(42));
println(typeOf(42000000000000000000000000000000000000000));
println(typeOf("42"));
println(typeOf(42 == 42));
println(typeOf(new()));
println(typeOf(main));
println(typeOf(null()));
}
function null() {
}
| Slash | 4 | CAFxX/simplelanguage | language/tests/TypeOf.sl | [
"UPL-1.0"
] |
' Licensed to the .NET Foundation under one or more agreements.
' The .NET Foundation licenses this file to you under the MIT license.
' See the LICENSE file in the project root for more information.
Imports System.Runtime.CompilerServices
Imports Microsoft.CodeAnalysis.VisualBasic.Symbols
Namespace Microsoft.CodeAnalysis.VisualBasic.ExpressionEvaluator
Friend Module TypeSubstitutionExtensions
<Extension>
Friend Function SubstituteType(typeMap As TypeSubstitution, type As TypeSymbol) As TypeSymbol
Return type.InternalSubstituteTypeParameters(typeMap).Type
End Function
<Extension>
Friend Function SubstituteNamedType(typeMap As TypeSubstitution, type As NamedTypeSymbol) As NamedTypeSymbol
Return DirectCast(type.InternalSubstituteTypeParameters(typeMap).AsTypeSymbolOnly(), NamedTypeSymbol)
End Function
End Module
End Namespace
| Visual Basic | 4 | ffMathy/roslyn | src/ExpressionEvaluator/VisualBasic/Source/ExpressionCompiler/Symbols/TypeSubstitutionExtensions.vb | [
"MIT"
] |
'use strict';
/**
* {{id}} service.
*/
module.exports = () => ({});
| Handlebars | 1 | Mithenks/strapi | packages/generators/generators/lib/templates/service.js.hbs | [
"MIT"
] |
const DefaultDirectoryProvider = require('../src/default-directory-provider');
const path = require('path');
const fs = require('fs-plus');
const temp = require('temp').track();
describe('DefaultDirectoryProvider', function() {
let tmp = null;
beforeEach(() => (tmp = temp.mkdirSync('atom-spec-default-dir-provider')));
afterEach(function() {
try {
temp.cleanupSync();
} catch (error) {}
});
describe('.directoryForURISync(uri)', function() {
it('returns a Directory with a path that matches the uri', function() {
const provider = new DefaultDirectoryProvider();
const directory = provider.directoryForURISync(tmp);
expect(directory.getPath()).toEqual(tmp);
});
it('normalizes its input before creating a Directory for it', function() {
const provider = new DefaultDirectoryProvider();
const nonNormalizedPath =
tmp + path.sep + '..' + path.sep + path.basename(tmp);
expect(tmp.includes('..')).toBe(false);
expect(nonNormalizedPath.includes('..')).toBe(true);
const directory = provider.directoryForURISync(nonNormalizedPath);
expect(directory.getPath()).toEqual(tmp);
});
it('normalizes disk drive letter in path on #win32', function() {
const provider = new DefaultDirectoryProvider();
const nonNormalizedPath = tmp[0].toLowerCase() + tmp.slice(1);
expect(tmp).not.toMatch(/^[a-z]:/);
expect(nonNormalizedPath).toMatch(/^[a-z]:/);
const directory = provider.directoryForURISync(nonNormalizedPath);
expect(directory.getPath()).toEqual(tmp);
});
it('creates a Directory for its parent dir when passed a file', function() {
const provider = new DefaultDirectoryProvider();
const file = path.join(tmp, 'example.txt');
fs.writeFileSync(file, 'data');
const directory = provider.directoryForURISync(file);
expect(directory.getPath()).toEqual(tmp);
});
it('creates a Directory with a path as a uri when passed a uri', function() {
const provider = new DefaultDirectoryProvider();
const uri = 'remote://server:6792/path/to/a/dir';
const directory = provider.directoryForURISync(uri);
expect(directory.getPath()).toEqual(uri);
});
});
describe('.directoryForURI(uri)', () =>
it('returns a Promise that resolves to a Directory with a path that matches the uri', function() {
const provider = new DefaultDirectoryProvider();
waitsForPromise(() =>
provider
.directoryForURI(tmp)
.then(directory => expect(directory.getPath()).toEqual(tmp))
);
}));
});
| JavaScript | 4 | Embodimentgeniuslm3/BDB11A0E2DE062D2E39E4C5301B2FE5E | spec/default-directory-provider-spec.js | [
"MIT"
] |
// check-pass
// Regression test of #77475, this used to be ICE.
#![feature(decl_macro)]
use crate as _;
pub macro ice(){}
fn main() {}
| Rust | 3 | Eric-Arellano/rust | src/test/ui/macros/issue-77475.rs | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] |
/* Catchall baseclass */
.glyphicon {
}
| CSS | 1 | tumido/prettier | tests/format/css/comments/bug.css | [
"MIT"
] |
%
% PostScript header for NASM documentation
%
% Avoid barfing on old PS implementations
/pdfmark where
{pop} {userdict /pdfmark /cleartomark load put} ifelse
/setpagedevice where
{pop} {userdict /setpagedevice /pop load put} ifelse
% Useful definition
/space 32 def
%
% This asks the PostScript interpreter for the proper size paper
%
/setpagesize {
1 dict dup /PageSize [pagewidth pageheight] put setpagedevice
} def
%
% Code to handle links
%
/min { 2 copy gt { exch } if pop } def
/max { 2 copy lt { exch } if pop } def
/lkbegun 0 def
/lktype null def
/lkury 0 def
/lkurx 0 def
/lklly 0 def
/lkllx 0 def
/lkxmarg 1 def % Extra space for link in x dir
/lkymarg 1 def % Extra space for link in y dir
/lktarget () def
% target type --
/linkbegin {
userdict begin
/lkbegun 1 def
/lktype exch def
/lktarget exch def
colorlinks { 0 0 0.4 setrgbcolor } if
end
} def
% target --
/linkbegindest {
/Dest linkbegin
} def
% uristring --
/linkbeginuri {
/URI linkbegin
} def
% pageno --
/linkbeginpage {
/Page linkbegin
} def
% string spacepadding --
/linkshow {
userdict begin
/lspad exch def /lss exch def
lkbegun 0 ne {
gsave lss true charpath flattenpath pathbbox grestore
lkbegun 1 eq {
/lkury exch def
lss spacecount lspad mul add /lkurx exch def
/lklly exch def
/lkllx exch def
/lkbegun 2 def
} {
lkury max /lkury exch def
lss spacecount lspad mul add lkurx max /lkurx exch def
lklly min /lklly exch def
lkllx min /lkllx exch def
} ifelse
} if
lspad 0 space lss widthshow
end
} def
% --
/linkend {
userdict begin
[ lktype /URI eq {
/Action 2 dict dup /Subtype /URI put dup /URI lktarget put
} {
/Dest lktarget
} ifelse
/Border [0 0 0]
/Rect [ lkllx lkxmarg sub
lklly lkymarg sub
lkurx lkxmarg add
lkury lkymarg add ]
/Subtype /Link
/ANN pdfmark
/lkbegun 0 def
colorlinks { 0 setgray } if
end
} def
% targetname --
/linkdest {
[ /Dest 3 -1 roll
/View [ /XYZ currentpoint null ]
/DEST pdfmark
} def
% A "fontset" is an array of fonts; a "stream" is an array of strings
% and numbers or procedures:
% [ 0 (Foo) ( ) (mani) ( ) 1 (padme) 0 ( ) (hum.) ]
% A number choses a font from the current fontset.
% A procedure is invoked as-is when printing the stream.
%
% When printing justified, an equal amount of space is added in
% between each string.
% string -- spacecount
% Count space characters in a string
/spacecount {
0 exch {
space eq { 1 add } if
} forall
} def
% stream fontset -- spacecount width
% Get the width of a stream in the given fontset, and the
% number of space characters in the stream
/streamwidth {
gsave
6 dict begin
/f exch def
/w 0 def
/s 0 def
f 0 get setfont
/integertype {
f exch get setfont
} def
/stringtype {
dup stringwidth pop w add /w exch def
spacecount s add /s exch def
} def
/arraytype { pop } def
% The input stream is on the top of the stack now
{
dup type exec
} forall
s w
end
grestore
} def
% stream fontset spacer --
% Show the stream in the given fontset, but add a certain amount
% of space to each space character
/showstreamspc {
5 dict begin
/spc exch def
/f exch def
f 0 get setfont
/integertype {
f exch get setfont
} def
/stringtype {
spc linkshow
} def
/arraytype {
exec
} def
% Now stream is on the top of the stack
{
dup type exec
} forall
end
} def
% stream fontset --
% Show the stream in the given fontset, with no extra spacing
/showstream {
0 showstreamspc
} def
% stream fontset totalspace --
% Show the stream justified to fit into a certain number of pixels
/showstreamjust {
userdict begin
/ts exch def /fs exch def /st exch def
st fs
st fs streamwidth ts exch sub exch
dup 0 gt { div } { pop } ifelse
showstreamspc
end
} def
/bullmarg lmarg bulladj add def
/lwidth pagewidth lmarg sub rmarg sub def
/bwidth lwidth bulladj sub def
%
% The various paragraph types
% The number at the end indicates start (1) of para, end (2) of para
%
/chapline {
currentpoint exch pop 10 sub lmarg exch moveto
0 setlinecap 3 setlinewidth
lwidth 0 rlineto stroke
} def
/chap0 { lmarg exch moveto cfont lwidth showstreamjust } def
/chap1 { lmarg exch moveto cfont lwidth showstreamjust } def
/chap2 { lmarg exch moveto cfont showstream chapline } def
/chap3 { lmarg exch moveto cfont showstream chapline } def
/appn0 {chap0} def
/appn1 {chap1} def
/appn2 {chap2} def
/appn3 {chap3} def
% lbl ypos fontset -- ypos
/headlbl {
3 -1 roll [exch ( )] exch % ypos strm fontset
2 copy % ypos strm fontset strm fontset
streamwidth % ypos strm fontset spccount width
lmarg exch sub % ypos strm fontset spccount xpos
4 index % ypos strm fontset spccount xpos ypos
moveto % ypos strm fontset spccount
pop % ypos strm fontset spccount
showstream % ypos
} def
/head0 { lmarg exch moveto hfont lwidth showstreamjust } def
/head1 { hfont headlbl lmarg exch moveto hfont lwidth showstreamjust } def
/head2 { lmarg exch moveto hfont showstream } def
/head3 { hfont headlbl lmarg exch moveto hfont showstream } def
/subh0 { lmarg exch moveto sfont lwidth showstreamjust } def
/subh1 { sfont headlbl lmarg exch moveto sfont lwidth showstreamjust } def
/subh2 { lmarg exch moveto sfont showstream } def
/subh3 { sfont headlbl lmarg exch moveto sfont showstream } def
/norm0 { lmarg exch moveto bfont lwidth showstreamjust } def
/norm1 { lmarg exch moveto bfont lwidth showstreamjust } def
/norm2 { lmarg exch moveto bfont showstream } def
/norm3 { lmarg exch moveto bfont showstream } def
/code0 { lmarg exch moveto xfont showstream } def
/code1 { lmarg exch moveto xfont showstream } def
/code2 { lmarg exch moveto xfont showstream } def
/code3 { lmarg exch moveto xfont showstream } def
/bull0 { bullmarg exch moveto bfont bwidth showstreamjust } def
/bull1 { dup lmarg exch moveto bullet bfont showstream
bullmarg exch moveto bfont bwidth showstreamjust } def
/bull2 { bullmarg exch moveto bfont showstream } def
/bull3 { dup lmarg exch moveto bullet bfont showstream
bullmarg exch moveto bfont showstream } def
/indt0 { bullmarg exch moveto bfont bwidth showstreamjust } def
/indt1 { bullmarg exch moveto bfont bwidth showstreamjust } def
/indt2 { bullmarg exch moveto bfont showstream } def
/indt3 { bullmarg exch moveto bfont showstream } def
/bquo0 { bullmarg exch moveto qfont bwidth showstreamjust } def
/bquo1 { bullmarg exch moveto qfont bwidth showstreamjust } def
/bquo2 { bullmarg exch moveto qfont showstream } def
/bquo3 { bullmarg exch moveto qfont showstream } def
/tocw0 lwidth tocpnz sub def
/tocw1 tocw0 tocind sub def
/tocw2 tocw1 tocind sub def
/tocx0 lmarg def
/tocx1 tocx0 tocind add def
/tocx2 tocx1 tocind add def
/tocpn {
bfont0 setfont
3 dict begin
/s exch def
/x s stringwidth pop pagewidth rmarg sub exch sub def
currentpoint /y exch def
lmarg sub tocdots div ceiling tocdots mul lmarg add
tocdots x {
y moveto (.) 0 linkshow
} for
x y moveto s 0 linkshow
end
linkend
} def
/toc00 { tocx0 exch moveto 0 rmoveto bfont showstream } def
/toc01 { tocx0 exch moveto
linkbegindest bfont0 setfont 0 linkshow bfont showstream } def
/toc02 { tocx0 exch moveto 3 1 roll
0 rmoveto bfont showstream tocpn } def
/toc03 { tocx0 exch moveto 4 1 roll
linkbegindest bfont0 setfont 0 linkshow bfont showstream tocpn } def
/toc10 { tocx1 exch moveto 0 rmoveto bfont showstream } def
/toc11 { tocx1 exch moveto
linkbegindest bfont0 setfont 0 linkshow bfont showstream } def
/toc12 { tocx1 exch moveto 3 1 roll
0 rmoveto bfont showstream tocpn } def
/toc13 { tocx1 exch moveto 4 1 roll
linkbegindest bfont0 setfont 0 linkshow bfont showstream tocpn } def
/toc20 { tocx2 exch moveto 0 rmoveto bfont showstream } def
/toc21 { tocx2 exch moveto
linkbegindest bfont0 setfont 0 linkshow bfont showstream } def
/toc22 { tocx2 exch moveto 3 1 roll
0 rmoveto bfont showstream tocpn } def
/toc23 { tocx2 exch moveto 4 1 roll
linkbegindest bfont0 setfont 0 linkshow bfont showstream tocpn } def
% Spacing between index columns
/indexcolumn pagewidth lmarg sub rmarg sub idxgutter add idxcolumns div def
% Width of an individual index column
/indexcolwid indexcolumn idxgutter sub def
/idx03 {
2 dict begin
indexcolumn mul lmarg add
/x exch def /y exch def x y moveto
exch bfont showstream
dup bfont streamwidth
x indexcolwid add exch sub exch pop y moveto
bfont showstream
end
} def
/idx00 {idx03} def
/idx01 {idx03} def
/idx02 {idx03} def
/idx13 {
2 dict begin
indexcolumn mul lmarg add idxindent add
/x exch def /y exch def x y moveto
exch bfont showstream
dup bfont streamwidth
x indexcolwid idxindent sub add exch sub exch pop y moveto
bfont showstream
end
} def
/idx10 {idx13} def
/idx11 {idx13} def
/idx12 {idx13} def
%
% Page numbers
%
/pagey botmarg pymarg sub def
/pagel lmarg plmarg sub def
/pager pagewidth rmarg sub prmarg add def
/pageeven { pagel pagey moveto bfont1 setfont show } def
/pageodd { bfont1 setfont dup stringwidth pop pager exch sub
pagey moveto show } def
%
% Functions invoked during parsing
%
/xa { linkdest } def
/pa { 0 pageheight moveto linkdest } def
/xl { linkbegindest } def
/wl { linkbeginuri } def
/pl { linkbeginpage } def
/el { linkend } def
%
% PDF viewer options
%
[/PageMode /UseOutlines /DOCVIEW pdfmark % Display bookmarks
%
% Functions to include EPS
%
/BeginEPSF {
/Before_EPSF_State save def
/dict_count countdictstack def
/op_count count 1 sub def
userdict begin
/showpage {} def
0 setgray 0 setlinecap
1 setlinewidth 0 setlinejoin
10 setmiterlimit [ ] 0 setdash newpath
/languagelevel where
{
pop languagelevel
1 ne {
false setstrokeadjust false setoverprint
} if
} if
} bind def
/EndEPSF {
count op_count sub {pop} repeat
countdictstack dict_count sub {end} repeat
Before_EPSF_State restore
} bind def
| PostScript | 5 | Mr-Sheep/naiveproxy | src/third_party/nasm/doc/head.ps | [
"BSD-3-Clause"
] |
for i in {1..104}; do
echo "The file is now $i" >> README.md
git commit -am "commit $i"; done | Shell | 3 | testtas9812/desktop | app/test/fixtures/repository-with-105-commits/script.sh | [
"MIT"
] |
fn putnumln(n: int) -> void =
do
putnum(n);
putchar('\n');
end
in
fn fact(n: int) -> int =
let acc: int = 1 in
do
while n != 0 do
acc = acc * n;
n = n - 1;
end;
acc;
end
end
in
fn fib(n: int) -> void =
let a: int = 0 in
let b: int = 1 in
let c: int = 0 in
while n != 0 do
putnumln(b);
c = a;
a = b;
b = c + b;
n = n - 1;
end
end
end
end
in
fn test(n: int) -> int =
let a: int = 10 in
do
let b: int = 1 in
b
end;
a + n;
end
end
in
do
putchar('$');
putchar(' ');
putnumln(fact(getnum()));
let a: &int = alloc(10, int) in
let ptr: &int = a in
do
*a = 10;
putnumln(*ptr);
free(a);
putnumln(*ptr);
end
end
end;
end | Harbour | 3 | adam-mcdaniel/harbor | examples/test.hb | [
"Apache-2.0"
] |
$! File: Build_GNV_curl_release_notes.com
$!
$! $Id$
$!
$! Build the release note file from the four components:
$! 1. The curl_release_note_start.txt
$! 2. The hp_ssl_release_info.txt
$! 3. [--]readme. file from the Curl distribution.
$! 4. The Curl_gnv-build_steps.txt.
$!
$! Set the name of the release notes from the GNV_PCSI_FILENAME_BASE
$! logical name.
$!
$! Copyright 2009 - 2020, John Malmberg
$!
$! Permission to use, copy, modify, and/or distribute this software for any
$! purpose with or without fee is hereby granted, provided that the above
$! copyright notice and this permission notice appear in all copies.
$!
$! THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
$! WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
$! MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
$! ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
$! WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
$! ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
$! OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
$!
$! 14-Jun-2009 J. Malmberg
$!
$!===========================================================================
$!
$ base_file = f$trnlnm("GNV_PCSI_FILENAME_BASE")
$ if base_file .eqs. ""
$ then
$ write sys$output "@MAKE_PCSI_CURL_KIT_NAME.COM has not been run."
$ goto all_exit
$ endif
$!
$!
$ curl_readme = f$search("sys$disk:[--]readme.")
$ if curl_readme .eqs. ""
$ then
$ curl_readme = f$search("sys$disk:[--]$README.")
$ endif
$ if curl_readme .eqs. ""
$ then
$ write sys$output "Can not find Curl readme file."
$ goto all_exit
$ endif
$!
$ curl_copying = f$search("sys$disk:[--]copying.")
$ if curl_copying .eqs. ""
$ then
$ curl_copying = f$search("sys$disk:[--]$COPYING.")
$ endif
$ if curl_copying .eqs. ""
$ then
$ write sys$output "Can not find Curl copying file."
$ goto all_exit
$ endif
$!
$ vms_readme = f$search("sys$disk:[]readme.")
$ if vms_readme .eqs. ""
$ then
$ vms_readme = f$search("sys$disk:[]$README.")
$ endif
$ if vms_readme .eqs. ""
$ then
$ write sys$output "Can not find VMS specific Curl readme file."
$ goto all_exit
$ endif
$!
$ curl_release_notes = f$search("sys$disk:[--]release-notes.")
$ if curl_release_notes .eqs. ""
$ then
$ curl_release_notes = f$search("sys$disk:[--]$RELEASE-NOTES.")
$ endif
$ if curl_release_notes .eqs. ""
$ then
$ write sys$output "Can not find Curl release-notes file."
$ goto all_exit
$ endif
$!
$ if f$search("sys$disk:[]hp_ssl_release_info.txt") .eqs. ""
$ then
$ write sys$output "GNV_LINK_CURL.COM has not been run!"
$ goto all_exit
$ endif
$!
$ type/noheader 'curl_readme', 'vms_readme', -
'curl_release_notes', -
sys$disk:[]curl_release_note_start.txt, -
sys$disk:[]hp_ssl_release_info.txt, -
'curl_copying', -
sys$disk:[]curl_gnv_build_steps.txt -
/out='base_file'.release_notes
$!
$ purge 'base_file'.release_notes
$ rename 'base_file.release_notes ;1
$!
$all_exit:
$ exit
| DIGITAL Command Language | 4 | jjatria/curl | packages/vms/build_gnv_curl_release_notes.com | [
"curl"
] |
(import [nose.tools [eq_]])
(import [processor [run_pipeline sources outputs]])
(defn test_source_as_a_list []
(setv results [])
(run_pipeline [1 2 3 4]
results.append)
(eq_ [1 2 3 4] results))
(defn test_source_as_a_function []
(setv items [1 2 3])
(setv results [])
(defn source []
(if items
(items.pop)))
(run_pipeline source
results.append)
(eq_ [3 2 1] results))
(defn test_two_outputs []
(setv source [{"message" "blah"
"level" "WARN"}
{"message" "minor"
"level" "INFO"}])
(defn trigger [msg]
(if (= (msg.get "level") "WARN")
msg))
(setv warnings [])
(run_pipeline source
[trigger warnings.append])
(eq_ 1 (len warnings)))
(defn test_source_can_return_lists_of_items_instead_of_dicts []
"Source can return not a dicionaries, but iterable objects
then each item in it is processed separately in the rest of the pipeline."
(setv source [1 [2 3] 4])
(setv results [])
(run_pipeline source results.append)
(eq_ [1 2 3 4] results))
(defn test_any_step_can_return_list_of_items_instead_of_dict []
"If some pipeline step returns not a dicionary, but iterable object
then each item in it is processed separately in the rest of the pipeline."
(setv source [1 2 4])
(setv results [])
(defn list_if_two [item]
(if (= item 2)
[2 3]
item))
(run_pipeline source [list_if_two results.append])
(eq_ [1 2 3 4] results))
| Hy | 5 | svetlyak40wt/python-processor | tests/pipeline.hy | [
"BSD-2-Clause"
] |
/******************************************************************************
* Copyright 2020 The Apollo Authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*****************************************************************************/
/**
* @file
**/
#include "modules/planning/tasks/learning_model/learning_model_inference_trajectory_task.h"
#include <string>
#include <vector>
namespace apollo {
namespace planning {
using apollo::common::ErrorCode;
using apollo::common::Status;
using apollo::common::TrajectoryPoint;
LearningModelInferenceTrajectoryTask::LearningModelInferenceTrajectoryTask(
const TaskConfig &config,
const std::shared_ptr<DependencyInjector> &injector)
: Task(config, injector) {
ACHECK(config.has_learning_model_inference_trajectory_task_config());
}
Status LearningModelInferenceTrajectoryTask::Execute(
Frame *frame, ReferenceLineInfo *reference_line_info) {
CHECK_NOTNULL(frame);
CHECK_NOTNULL(reference_line_info);
Task::Execute(frame, reference_line_info);
return Process(frame, reference_line_info);
}
Status LearningModelInferenceTrajectoryTask::Process(
Frame *frame, ReferenceLineInfo *reference_line_info) {
CHECK_NOTNULL(frame);
CHECK_NOTNULL(reference_line_info);
const auto &config =
config_.learning_model_inference_trajectory_task_config();
const std::vector<TrajectoryPoint> adc_future_trajectory_points
= injector_->learning_based_data()
->learning_data_adc_future_trajectory_points();
const double first_point_relative_time =
adc_future_trajectory_points.front().relative_time();
const double last_point_relative_time =
adc_future_trajectory_points.back().relative_time();
const auto learning_data_frame = injector_->learning_based_data()
->GetLatestLearningDataFrame();
const int frame_num =
learning_data_frame ? learning_data_frame->frame_num() : -1;
ADEBUG << "LearningModelInferenceTrajectoryTask: frame_num[" << frame_num
<< "] adc_future_trajectory_points_size["
<< adc_future_trajectory_points.size()
<< "] first_point_relative_time[" << first_point_relative_time
<< "] last_point_relative_time[" << last_point_relative_time << "]";
if (adc_future_trajectory_points.size() < 0 ||
first_point_relative_time < 0.0 ||
last_point_relative_time <
config.min_adc_future_trajectory_time_length()) {
const std::string msg =
absl::StrCat("adc_future_trajectory_point issue. size[",
adc_future_trajectory_points.size(),
"] first_point_relative_time[", first_point_relative_time,
"] last_point_relative_time[", last_point_relative_time);
AERROR << msg;
return Status(ErrorCode::PLANNING_ERROR, msg);
}
reference_line_info->SetTrajectory(
DiscretizedTrajectory(adc_future_trajectory_points));
return Status::OK();
}
} // namespace planning
} // namespace apollo
| C++ | 4 | jzjonah/apollo | modules/planning/tasks/learning_model/learning_model_inference_trajectory_task.cc | [
"Apache-2.0"
] |
"""
p
Foo.Bar
"""
import System
import System.Xml.Serialization from System.Xml
[XmlRoot("p", Namespace: "Foo.Bar")]
class Person:
pass
xmlroot as XmlRootAttribute = Attribute.GetCustomAttribute(Person, XmlRootAttribute)
print(xmlroot.ElementName)
print(xmlroot.Namespace)
| Boo | 3 | popcatalin81/boo | tests/testcases/integration/attributes/attributes-2.boo | [
"BSD-3-Clause"
] |
do
print "hello"
print "world"
x = do
print "hello"
print "world"
y = do
things = "shhh"
-> "hello: " .. things
-> if something then do "yeah"
t = {
y: do
number = 100
(x) -> x + number
}
(y=(do
x = 10 + 2
x), k=do
"nothing") -> do
"uhhh"
| MoonScript | 0 | Shados/moonscript | spec/inputs/do.moon | [
"MIT",
"Unlicense"
] |
// ResourceMenu.prg
USING System.Collections.Generic
#define M_GRAYED 0x0001 // 'GRAYED' keyword
#define M_INACTIVE 0x0002 // 'INACTIVE' keyword
#define M_BITMAP 0x0004 // 'BITMAP' keyword
#define M_OWNERDRAW 0x0100 // 'OWNERDRAW' keyword
#define M_CHECKED 0x0008 // 'CHECKED' keyword
#define M_POPUP 0x0010 // Used internally
#define M_MENUBARBREAK 0x0020 // 'MENUBARBREAK' keyword
#define M_MENUBREAK 0x0040 // 'MENUBREAK' keyword
#define M_ENDMENU 0x0080 // Used internally
USING System.Diagnostics
CLASS ResourceMenu INHERIT ResourceReader
PROPERTY MenuItems AS List<ResourceMenuItem> AUTO
PROPERTY IsValid AS LOGIC AUTO
PROPERTY HelpID AS DWORD AUTO
PROTECT nLevel AS DWORD
METHOD __LoadFromResource(hDLL as IntPtr, hResInfo as IntPtr) as LOGIC
LOCAL lpBuffer AS IntPtr
LOCAL uiResSize AS DWORD
LOCAL hResource AS IntPtr
MenuItems :=List<ResourceMenuItem>{}
SELF:IsValid := FALSE
IF hResInfo != NULL
uiResSize := GuiWin32.SizeOfResource(hDLL, hResInfo)
IF uiResSize != 0
hResource := GuiWin32.LoadResource(hDLL, hResInfo)
IF hResource != NULL
lpBuffer := GuiWin32.LockResource(hResource)
SELF:ReadData(lpBuffer)
SELF:IsValid := TRUE
GuiWin32.FreeResource(hResource)
ENDIF
ENDIF
ENDIF
RETURN SELF:IsValid
CONSTRUCTOR(hDLL AS IntPtr, cName AS STRING)
LOCAL hResInfo AS IntPtr
SUPER()
hResInfo := GuiWin32.FindResource(hDLL, cName, 4)
SELF:__LoadFromResource(hDLL, hResInfo)
RETURN
METHOD ReadData(lpBuffer AS IntPtr) AS VOID
LOCAL pMenuEx AS MENUEX_TEMPLATE_HEADER
pMenuEx := (MENUEX_TEMPLATE_HEADER PTR) lpBuffer
IF pMenuEx:wVersion == 01
// this is indeed a DialogEx
SELF:ReadMenuEx(pMenuEx)
ELSE
SELF:ReadMenu( (PTR) lpBuffer)
ENDIF
RETURN
INTERNAL METHOD ReadMenuEx(pMenuEx as MENUEX_TEMPLATE_HEADER) as VOID
LOCAL pWord as WORD PTR
SELF:HelpID := pMenuEx:dwHelpID
pWord := (WORD PTR) pMenuEx
pWord += pMenuEx:wOffSet/2
nLevel := 1
DO WHILE nLevel > 0
//if ((Int) pWord % 4) != 0
// pWord += 1
//ENDIF
pWord:= SELF:ReadMenuItemEx(pWord)
ENDDO
RETURN
INTERNAL METHOD ReadMenu(pMenu as MENU_TEMPLATE_HEADER) AS VOID
LOCAL pWord as WORD PTR
SELF:HelpID := 0
pWord := (WORD PTR) pMenu
pWord += sizeof(MENU_TEMPLATE_HEADER) / sizeof(WORD)
pWord += pMenu:wOffSet/2
nLevel := 1
DO WHILE nLevel > 0
//if ((Int) pWord % 4) != 0
// pWord += 1
//ENDIF
pWord := SELF:ReadMenuItem(pWord)
ENDDO
RETURN
METHOD ReadMenuItem(pWord as WORD PTR) as WORD PTR
LOCAL pItem as NormalMenuItem
LOCAL oItem as ResourceMenuItem
oItem := ResourceMenuItem{}
pItem := (NormalMenuItem PTR) pWord
oItem:Flags := pItem:fItemFlags
IF oItem:IsPopup
pWord += 1
nLevel+=1
ELSE
oItem:ItemID := pItem:wMenuID
pWord += 2
ENDIF
IF oItem:IsLast
nLevel -=1
ENDIF
oItem:Caption := ReadText(pWord)
pWord += oItem:Caption:Length+1
SELF:MenuItems:Add(oItem)
RETURN pWord
METHOD ReadMenuItemEx(pWord as WORD PTR) as WORD PTR
LOCAL pItem as MENUEX_TEMPLATE_ITEM
LOCAL oItem as ResourceMenuItem
oItem := ResourceMenuItem{}
pItem := (MENUEX_TEMPLATE_ITEM PTR) pWord
oItem:Type := pItem:dwType
oItem:ItemID := pItem:uID
oItem:Flags := pItem:bResInfo
IF oItem:IsPopup
nLevel+=1
ENDIF
IF oItem:IsLast
nLevel -=1
ENDIF
pWord += 7
oItem:Caption := ReadText(pWord)
pWord += oItem:Caption:Length+1
oItem:HelpID := pWord[1] << 16 + pWord[2]
pWord += 2
SELF:MenuItems:Add(oItem)
RETURN pWord
METHOD AsString() AS STRING STRICT
LOCAL cResult as STRING
LOCAL cPrefix as STRING
FOREACH oItem as ResourceMenuItem in SELF:MenuItems
IF String.IsNullOrEmpty(oItem:Caption)
cResult += cPrefix+"-"+CRLF
ELSE
cResult += cPrefix+oItem:Caption
IF oItem:ItemID != 0
cResult += e"\t( "+NTrim(oItem:ItemID)+")"+CRLF
ELSE
cResult += CRLF
ENDIF
ENDIF
if oItem:IsPopup
cPrefix += " "
ENDIF
IF oItem:IsLast
cPrefix := Left(cPrefix, SLen(cPrefix)-4)
ENDIF
NEXT
RETURN cResult
METHOD AddItemsTo(oMenu as Menu) AS VOID
LOCAL aStack as List<System.Windows.Forms.Menu>
LOCAL oCurrent as System.Windows.Forms.Menu
LOCAL oNew as VOMenuItem
aStack := List<System.Windows.Forms.Menu>{}
oCurrent := oMenu:__Menu
FOREACH oItem as ResourceMenuItem in MenuItems
oNew := oMenu:__CreateMenuItem(oItem:Caption, oItem:ItemID)
oCurrent:MenuItems:Add(oNew)
oNew:Enabled := !oItem:IsDisabled
oNew:Checked := oItem:IsChecked
if oItem:IsPopup
aStack:Add(oCurrent)
oCurrent := oNew
elseif oItem:IsLast
if aStack:Count > 0
oCurrent := aStack[aStack:Count-1]
aStack:RemoveAt(aStack:Count-1)
endif
endif
NEXT
RETURN
END CLASS
INTERNAL VOSTRUCT MENUEX_TEMPLATE_HEADER ALIGN 2
MEMBER wVersion AS WORD
MEMBER wOffSet as WORD
MEMBER dwHelpID as DWORD
INTERNAL VOSTRUCT MENU_TEMPLATE_HEADER ALIGN 2
MEMBER wVersion AS WORD
MEMBER wOffSet as WORD
INTERNAL VOSTRUCT MENUEX_TEMPLATE_ITEM ALIGN 2
MEMBER dwType as DWORD
MEMBER dwState as DWORD
MEMBER uID as LONG
MEMBER bResInfo as WORD
// MEMBER szText as WCHAR[]
// MEMBER dwHelpID AS DWORD
// Offset of item = DWORD aligned
INTERNAL VOSTRUCT NormalMenuItem ALIGN 2
MEMBER fItemFlags as WORD
MEMBER wMenuID as WORD
// MEMBER szItemText as WCHAR[]
// Seperator has fItemFlags = 0 and wMenuID = 0 and an empty string
//INTERNAL VOSTRUCT PopupMenuItem
// MEMBER fItemFlags AS WORD
// MEMBER szItemText AS WCHAR[]
[DebuggerDisplay("ID: {ItemID}, Caption: {Caption}, Flags {Flags}")];
CLASS ResourceMenuItem INHERIT ResourceReader
PROPERTY Caption AS STRING AUTO
PROPERTY HelpID AS DWORD AUTO
PROPERTY ItemID AS LONG AUTO
PROPERTY Flags AS LONG AUTO
PROPERTY Type AS DWORD AUTO
PROPERTY IsPopup as LOGIC GET _AND(Flags, M_POPUP) == M_POPUP
PROPERTY IsLast as LOGIC GET _AND(Flags, M_ENDMENU) == M_ENDMENU
PROPERTY IsChecked as LOGIC GET _AND(Flags, M_CHECKED) == M_CHECKED
PROPERTY IsDisabled as LOGIC GET _AND(Flags, M_GRAYED) == M_GRAYED
END CLASS
| xBase | 5 | orangesocks/XSharpPublic | Runtime/VOSdkTyped/Source/VOSdk/GUI_Classes_SDK/ResourceReader/ResourceMenu.prg | [
"Apache-2.0"
] |
functions {
real psi_max(vector u_psi, int[] subj, vector RT) {
real psi_max;
psi_max = positive_infinity();
for (i in 1:num_elements(RT))
psi_max = fmin(psi_max, log(RT[i]) - u_psi[subj[i]]);
return (psi_max);
}
real da(int winner, real RT, vector beta, real P_b, real mu_da,
real mu_b, real sigma, real psi){
// theta = softmax(beta)
// log(P(w = 1 | theta, P_b)):
real log_P_w1;
// Prob of direct access given winner = 1
real log_P_da_gw1;
// Prob of backtracking given winner = 1
real log_P_b_gw1;
// Equation (10) in log:
log_P_w1 = log_sum_exp(categorical_logit_lpmf(1 | beta),
log(P_b)+ log1m_exp(categorical_logit_lpmf(1|beta)));
// Equation (14) in log:
log_P_da_gw1 = categorical_logit_lpmf(1 | beta) - log_P_w1;
// Equation (15) in log:
log_P_b_gw1 = log(P_b) + log1m_exp(categorical_logit_lpmf(1 | beta)) -
log_P_w1;
if(winner==1) {
return (log_P_w1 + // Increment on likelihood due to winner=1
// Increment on likelihood due to RT:
log_sum_exp(log_P_da_gw1 + lognormal_lpdf(RT - psi| mu_da, sigma),
log_P_b_gw1 + lognormal_lpdf(RT - psi | mu_da + mu_b, sigma) ));
} else {
return (log1m(P_b) + categorical_logit_lpmf(winner | beta) +
// Increment on likelihood due to RT:
lognormal_lpdf(RT - psi | mu_da, sigma));
}
}
vector da_rng(vector theta, real P_b, real mu_da, real mu_b, real sigma,
real psi) {
int orig_choice;
int backtracking;
vector[2] gen;
orig_choice = categorical_rng(theta);
backtracking = 0;
if (orig_choice!=1) backtracking = bernoulli_rng(P_b);
# Change the answer to 1 if there was backtracking:
gen[1] = backtracking ? 1 : orig_choice;
{ real mu; # it adds the mu_b if there is backtracking:
mu = mu_da + (backtracking ? mu_b : 0);
gen[2] = psi + lognormal_rng(mu, sigma);
}
return(gen);
}
}
data {
int<lower=0> N_obs;
int<lower=1> N_choices;
vector<lower=0>[N_obs] RT;
int<lower=1,upper=N_choices> winner[N_obs];
int<lower = 1> subj[N_obs];
int<lower = 1> N_subj;
int<lower = 1> item[N_obs];
int<lower = 1> N_item;
vector[N_obs] holdout;
}
transformed data {
real<lower=0> min_RT;
real logmean_RT;
min_RT = min(RT);
logmean_RT = log(mean(RT));
}
parameters{
real<lower=0> sigma;
real<lower=0> mu_da_0raw;
real<lower=0> mu_b_0;
vector[N_choices-2] beta_incorrect;
real<lower=0> beta_added;
vector<lower = 0> [N_choices - 1] tau_u;
cholesky_factor_corr[N_choices - 1] L_u;
matrix[N_choices - 1, N_subj] z_u;
vector<lower = 0> [2] tau_u_RT;
cholesky_factor_corr[2] L_u_RT;
matrix[2, N_subj] z_u_RT;
vector<lower = 0> [N_choices - 1] tau_w;
cholesky_factor_corr[N_choices - 1] L_w;
matrix[N_choices - 1, N_item] z_w;
vector<lower = 0> [2] tau_w_RT;
cholesky_factor_corr[2] L_w_RT;
matrix[2, N_item] z_w_RT;
real<lower=0,upper=1> P_b;
vector[N_subj] u_psi;
real<lower = 0> tau_psi;
real<upper = psi_max(u_psi, subj, RT) / logmean_RT> psi_0raw;
}
transformed parameters{
real<lower=0> mu_da_0;
vector[N_choices] beta_0;
matrix[2, N_subj] u_RT;
matrix[N_choices, N_subj] u;
matrix[2, N_item] w_RT;
matrix[N_choices, N_item] w;
real psi_0;
u_RT = diag_pre_multiply(tau_u_RT, L_u_RT) * z_u_RT;
u[1:N_choices-1] = diag_pre_multiply(tau_u, L_u) * z_u;
u[N_choices] = rep_row_vector(0,N_subj);
w_RT = diag_pre_multiply(tau_w_RT, L_w_RT) * z_w_RT;
w[1:N_choices-1] = diag_pre_multiply(tau_w, L_w) * z_w;
w[N_choices] = rep_row_vector(0,N_item);
beta_0[1] = beta_added + fmax(max(beta_incorrect),0);
beta_0[2:N_choices-1] = beta_incorrect;
beta_0[N_choices] = 0;
mu_da_0 = mu_da_0raw * logmean_RT;
psi_0 = psi_0raw * logmean_RT;
}
model {
sigma ~ normal(0,2);
beta_added ~ normal(0,2);
beta_incorrect ~ normal(0,2);
psi_0raw ~ normal(0, 1);
tau_psi ~ normal(0, 1);
u_psi ~ normal(0, tau_psi);
to_vector(z_u_RT) ~ normal(0, 1);
to_vector(z_u) ~ normal(0, 1);
tau_u_RT ~ normal(0, 1);
tau_u ~ normal(0, 1);
L_u_RT ~ lkj_corr_cholesky(2.0);
L_u ~ lkj_corr_cholesky(2.0);
to_vector(z_w_RT) ~ normal(0, 1);
to_vector(z_w) ~ normal(0, 1);
tau_w_RT ~ normal(0, 1);
tau_w ~ normal(0, 1);
L_w_RT ~ lkj_corr_cholesky(2.0);
L_w ~ lkj_corr_cholesky(2.0);
P_b ~ beta(1,1);
mu_da_0raw ~ normal(0,1);
mu_b_0 ~ normal(0,2);
for (n in 1:N_obs) {
if(holdout[n]==0){
real mu_da;
real mu_b;
vector[N_choices] beta;
real psi;
mu_da = mu_da_0 + u_RT[1,subj[n]] + w_RT[1,item[n]];
mu_b = mu_b_0 + u_RT[2,subj[n]] + w_RT[2,item[n]];
beta = beta_0 + u[,subj[n]] + w[,item[n]];
psi = exp(psi_0 + u_psi[subj[n]]);
target += da(winner[n], RT[n], beta, P_b, mu_da, mu_b, sigma, psi);
}
}
}
generated quantities {
vector[N_choices] theta_0;
matrix[N_choices-1, N_choices-1] Cor_u;
matrix[N_choices-1, N_choices-1] Cor_w;
matrix[2, 2] Cor_u_RT;
matrix[2, 2] Cor_w_RT;
vector[N_obs] log_lik;
theta_0 = softmax(beta_0);
Cor_u = tcrossprod(L_u);
Cor_w = tcrossprod(L_w);
Cor_u_RT = tcrossprod(L_u_RT);
Cor_w_RT = tcrossprod(L_w_RT);
for (n in 1:N_obs) {
real mu_da;
real mu_b;
vector[N_choices] beta;
real psi;
mu_da = mu_da_0 + u_RT[1,subj[n]] + w_RT[1,item[n]];
mu_b = mu_b_0 + u_RT[2,subj[n]] + w_RT[2,item[n]];
beta = beta_0 + u[,subj[n]] + w[,item[n]];
psi = exp(psi_0 + u_psi[subj[n]]);
log_lik[n] = da(winner[n], RT[n], beta, P_b, mu_da, mu_b, sigma, psi);
}
}
| Stan | 5 | simeond/stancon_talks | 2017/Contributed-Talks/07_nicenboim/direct_access_h_Kfold.stan | [
"CC-BY-4.0",
"BSD-3-Clause"
] |
; Setup script for use with Inno Setup.
[Setup]
AppName=Open Asset Import Library - Viewer
AppVerName=Open Asset Import Library - Viewer (v2.0)
DefaultDirName={pf}\AssimpView
DefaultGroupName=AssimpView
UninstallDisplayIcon={app}\bin\x86\assimp.exe
OutputDir=out_vieweronly
AppCopyright=Assimp Development Team
SetupIconFile=..\..\tools\shared\assimp_tools_icon.ico
WizardImageFile=compiler:WizModernImage-IS.BMP
WizardSmallImageFile=compiler:WizModernSmallImage-IS.BMP
LicenseFile=License.rtf
OutputBaseFileName=assimp-view-2.0-setup
VersionInfoVersion=2.0.0.0
VersionInfoTextVersion=2.0
VersionInfoCompany=Assimp Development Team
ArchitecturesInstallIn64BitMode=x64
[Run]
Filename: "{app}\stub\vcredist_x86.exe"; Parameters: "/qb"; StatusMsg: "Installing VS2008 SP1 redistributable package (32 Bit)"; Check: not IsWin64
Filename: "{app}\stub\vcredist_x64.exe"; Parameters: "/qb"; StatusMsg: "Installing VS2008 SP1 redistributable package (64 Bit)"; Check: IsWin64
[Files]
Source: "readme_installer_vieweronly.txt"; DestDir: "{app}"; Flags: isreadme
; Installer stub
Source: "vcredist_x86.exe"; DestDir: "{app}\stub\"; Check: not IsWin64
Source: "vcredist_x64.exe"; DestDir: "{app}\stub\"; Check: IsWin64
; Common stuff
Source: "..\..\CREDITS"; DestDir: "{app}"
Source: "..\..\LICENSE"; DestDir: "{app}"
Source: "..\..\README"; DestDir: "{app}"
Source: "WEB"; DestDir: "{app}"
; x86 binaries
Source: "..\..\bin\assimp_release-dll_Win32\Assimp32.dll"; DestDir: "{app}\bin\x86"
Source: "..\..\bin\assimpview_release-dll_Win32\assimp_view.exe"; DestDir: "{app}\bin\x86"
Source: "D3DCompiler_42.dll"; DestDir: "{app}\bin\x86"
Source: "D3DX9_42.dll"; DestDir: "{app}\bin\x86"
Source: "..\..\bin\assimpcmd_release-dll_Win32\assimp.exe"; DestDir: "{app}\bin\x86"
; x64 binaries
Source: "..\..\bin\assimp_release-dll_x64\Assimp64.dll"; DestDir: "{app}\bin\x64"
Source: "..\..\bin\assimpview_release-dll_x64\assimp_view.exe"; DestDir: "{app}\bin\x64"
Source: "D3DCompiler_42_x64.dll"; DestDir: "{app}\bin\x64"; DestName: "D3DCompiler_42.dll"
Source: "D3DX9_42_x64.dll"; DestDir: "{app}\bin\x64"; DestName: "D3DX9_42.dll"
Source: "..\..\bin\assimpcmd_release-dll_x64\assimp.exe"; DestDir: "{app}\bin\x64"
; Documentation
Source: "..\..\doc\AssimpCmdDoc_Html\AssimpCmdDoc.chm"; DestDir: "{app}\doc"
[Icons]
Name: "{group}\Assimp Command Line Manual"; Filename: "{app}\doc\AssimpCmdDoc.chm"
Name: "{group}\AssimpView"; Filename: "{app}\bin\x64\assimp_view.exe"; Check: IsWin64
Name: "{group}\AssimpView"; Filename: "{app}\bin\x86\assimp_view.exe"; Check: not IsWin64
| Inno Setup | 4 | sercand/assimp | packaging/windows-innosetup/script_vieweronly.iss | [
"BSD-3-Clause"
] |
1 --DiffieHellman key exchange
%handles:
IntTerm =
Get
Put
Close
%cohandles:
Console =
Get
Put
Close
%processes:
alice (agreedKey1,agreedKey2 | secretA,messageA => cipher) =
get secretA ;store skey
call power (agreedKey2,skey);store val1
call modulus (val1,agreedKey1);store val2
load val2
put cipher
get cipher ; store bkey
get messageA ; store msg
call power (bkey,skey) ; store val3
call modulus (val1,agreedKey1) ; store val4
call encode (msg,val4) ; store val5
load val5
put cipher
hput messageA Console.Close
close messageA
hput secretA Console.Close
close secretA
halt cipher
bob (agreedKey1,agreedKey2 | cipher => secretB, messageB) =
get secretB ; store skey1
get cipher ; store bkey1
call power (agreedKey2,skey1);store val6
call modulus (val6,agreedKey1);store val7
load val7
put cipher
get cipher; store enmsg
call power (bkey1,skey1) ; store val8
call modulus (val8,agreedKey1) ; store val9
call decode (enmsg,val9) ;store val10
load val10
put messageB
hput secretB IntTerm.Close
close secretB
hput messageB IntTerm.Close
close messageB
halt cipher
aliceBob (agreedKey1,agreedKey2|secretA, messageA => secretB, messageB) =
plug cipher as
with [secretA,messageA] :
run alice(agreedKey1, agreedKey2 | secretA, messageA => cipher)
with [secretB,messageB] :
run bob(agreedKey1, agreedKey2 | cipher => secretB, messageB)
%functions :
power (x,y) =
load x
load y
add
ret
modulus(x,y) =
load y
load x
rem
ret
encode(m,k) =
load m
load k
add
ret
decode(m,k) =
load m
load k
add
ret
%run (| console => intTerm1):
| AMPL | 5 | prashant007/AMPL | myAMPL/src/DiffHellman.ampl | [
"MIT"
] |
#ifndef mingw32_HOST_OS
import System.Posix.Signals
#endif
| Haskell | 2 | matsubara0507/semantic | test/fixtures/haskell/corpus/cpp-directives.A.hs | [
"MIT"
] |
#![feature(trait_alias)]
#![crate_name = "foo"]
use std::fmt::Debug;
// @has foo/all.html '//a[@href="traitalias.CopyAlias.html"]' 'CopyAlias'
// @has foo/all.html '//a[@href="traitalias.Alias2.html"]' 'Alias2'
// @has foo/all.html '//a[@href="traitalias.Foo.html"]' 'Foo'
// @has foo/index.html '//h2[@id="trait-aliases"]' 'Trait aliases'
// @has foo/index.html '//a[@class="traitalias"]' 'CopyAlias'
// @has foo/index.html '//a[@class="traitalias"]' 'Alias2'
// @has foo/index.html '//a[@class="traitalias"]' 'Foo'
// @has foo/traitalias.CopyAlias.html
// @has - '//section[@id="main-content"]/div[@class="docblock item-decl"]/pre' 'trait CopyAlias = Copy;'
pub trait CopyAlias = Copy;
// @has foo/traitalias.Alias2.html
// @has - '//section[@id="main-content"]/div[@class="docblock item-decl"]/pre' 'trait Alias2 = Copy + Debug;'
pub trait Alias2 = Copy + Debug;
// @has foo/traitalias.Foo.html
// @has - '//section[@id="main-content"]/div[@class="docblock item-decl"]/pre' 'trait Foo<T> = Into<T> + Debug;'
pub trait Foo<T> = Into<T> + Debug;
// @has foo/fn.bar.html '//a[@href="traitalias.Alias2.html"]' 'Alias2'
pub fn bar<T>() where T: Alias2 {}
| Rust | 5 | david-perez/rust | src/test/rustdoc/trait_alias.rs | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] |
encryptedv2.property=ENC(dQWokHUXXFe+OqXRZYWu22BpXoRZ0Drt)
| INI | 0 | zeesh49/tutorials | spring-boot-jasypt/src/main/resources/encryptedv2.properties | [
"MIT"
] |
Feature: hub push
Background:
Given I am in "git://github.com/mislav/coral.git" git repo
Scenario: Normal push
When I successfully run `hub push`
Then the git command should be unchanged
Scenario: Push current branch to multiple remotes
Given I am on the "cool-feature" branch
When I successfully run `hub push origin,staging`
Then "git push origin cool-feature" should be run
Then "git push staging cool-feature" should be run
Scenario: Push explicit branch to multiple remotes
When I successfully run `hub push origin,staging,qa cool-feature`
Then "git push origin cool-feature" should be run
Then "git push staging cool-feature" should be run
Then "git push qa cool-feature" should be run
Scenario: Push multiple refs to multiple remotes
When I successfully run `hub push origin,staging master new-feature`
Then "git push origin master new-feature" should be run
Then "git push staging master new-feature" should be run
| Cucumber | 3 | JLLeitschuh/hub | features/push.feature | [
"MIT"
] |
# fix broken locale
if not python -c 'import locale; locale.getdefaultlocale();' >/dev/null ^&1
set -gx LANG en_US.UTF-8
set -gx LC_ALL en_US.UTF-8
end
# set paths
set DIR (dirname (status -f))
set -gx PATH $PATH $DIR/../bin $DIR/../app
set -gx PYTHONPATH $PYTHONPATH $DIR/../app
| fish | 4 | boringusername99/cabot | bin/activate.fish | [
"MIT"
] |
/*
* Copyright 2010-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef RUNTIME_MUTEX_H
#define RUNTIME_MUTEX_H
#include <atomic>
#include <thread>
#include "KAssert.h"
#include "Memory.h"
#include "Utils.hpp"
namespace kotlin {
enum class MutexThreadStateHandling {
kIgnore, kSwitchIfRegistered
};
template <MutexThreadStateHandling threadStateHandling>
class SpinLock;
template <>
class SpinLock<MutexThreadStateHandling::kIgnore> : private Pinned {
public:
void lock() noexcept {
while(flag_.test_and_set(std::memory_order_acquire)) {
std::this_thread::yield();
}
}
void unlock() noexcept {
flag_.clear(std::memory_order_release);
}
private:
std::atomic_flag flag_ = ATOMIC_FLAG_INIT;
};
template <>
class SpinLock<MutexThreadStateHandling::kSwitchIfRegistered> : private Pinned {
public:
void lock() noexcept {
// Fast path without thread state switching.
if (!flag_.test_and_set(std::memory_order_acquire)) {
return;
}
kotlin::NativeOrUnregisteredThreadGuard guard(/* reentrant = */ true);
while (flag_.test_and_set(std::memory_order_acquire)) {
std::this_thread::yield();
}
}
void unlock() noexcept {
flag_.clear(std::memory_order_release);
}
private:
std::atomic_flag flag_ = ATOMIC_FLAG_INIT;
};
} // namespace kotlin
#endif // RUNTIME_MUTEX_H
| C++ | 4 | Mu-L/kotlin | kotlin-native/runtime/src/main/cpp/Mutex.hpp | [
"ECL-2.0",
"Apache-2.0"
] |
Red [
Title: "Red comparison tests"
Author: "Peter W A Wood"
File: %comparison-test.red
Tabs: 4
Rights: "Copyright (C) 2011-2016 Red Foundation. All rights reserved."
License: "BSD-3 - https://github.com/red/red/blob/origin/BSD-3-License.txt"
]
#include %../../../quick-test/quick-test.red
~~~start-file~~~ "comparison tests"
===start-group=== "prefix equal same datatype"
--test-- "prefix-equal-same-datatype-1" --assert equal? 0 0
--test-- "prefix-equal-same-datatype-2" --assert equal? 1 1
--test-- "prefix-equal-same-datatype-3" --assert equal? FFFFFFFFh -1
--test-- "prefix-equal-same-datatype-4" --assert equal? [] []
--test-- "prefix-equal-same-datatype-5" --assert equal? [a] [a]
--test-- "prefix-equal-same-datatype-6" --assert equal? [A] [a]
--test-- "prefix-equal-same-datatype-7" --assert equal? ['a] [a]
--test-- "prefix-equal-same-datatype-8" --assert equal? [a:] [a]
--test-- "prefix-equal-same-datatype-9" --assert equal? [:a] [a]
--test-- "prefix-equal-same-datatype-10" --assert equal? [:a] [a:]
--test-- "prefix-equal-same-datatype-11" --assert equal? [abcde] [abcde]
--test-- "prefix-equal-same-datatype-12" --assert equal? [a b c d] [a b c d]
--test-- "prefix-equal-same-datatype-13" --assert equal? [b c d] next [a b c d]
--test-- "prefix-equal-same-datatype-14" --assert equal? [b c d] (next [a b c d])
--test-- "prefix-equal-same-datatype-15" --assert equal? "a" "a"
--test-- "prefix-equal-same-datatype-16" --assert equal? "a" "A"
--test-- "prefix-equal-same-datatype-17" --assert equal? "abcdeè" "abcdeè"
--test-- "prefix-equal-same-datatype-18" --assert equal? (next "abcdeè") next "abcdeè"
--test-- "prefix-equal-same-datatype-19" --assert equal? (first "abcdeè") first "abcdeè"
--test-- "prefix-equal-same-datatype-20" --assert equal? (last "abcdeè") last "abcdeè"
--test-- "prefix-equal-same-datatype-21"
--assert equal? "abcde^(2710)é^(010000)" "abcde^(2710)é^(010000)"
--test-- "prefix-equal-same-datatype-22" --assert equal? [d] back tail [a b c d]
--test-- "prefix-equal-same-datatype-23" --assert equal? "2345" next "12345"
--test-- "prefix-equal-same-datatype-24" --assert equal? #"z" #"z"
--test-- "prefix-equal-same-datatype-25" --assert not equal? #"z" #"Z"
--test-- "prefix-equal-same-datatype-26" --assert not equal? #"e" #"è"
--test-- "prefix-equal-same-datatype-27" --assert equal? #"^(010000)" #"^(010000)"
--test-- "prefix-equal-same-datatype-28" --assert equal? true true
--test-- "prefix-equal-same-datatype-29" --assert equal? false false
--test-- "prefix-equal-same-datatype-30" --assert not equal? false true
--test-- "prefix-equal-same-datatype-31" --assert not equal? true false
--test-- "prefix-equal-same-datatype-32" --assert equal? none none
--test-- "prefix-equal-same-datatype-33" --assert equal? 'a 'a
--test-- "prefix-equal-same-datatype-34" --assert equal? 'a 'A
--test-- "prefix-equal-same-datatype-35" --assert equal? (first [a]) first [a]
--test-- "prefix-equal-same-datatype-36" --assert equal? 'a first [A]
--test-- "prefix-equal-same-datatype-37" --assert equal? 'a first ['a]
--test-- "prefix-equal-same-datatype-38" --assert equal? 'a first [:a]
--test-- "prefix-equal-same-datatype-39" --assert equal? 'a first [a:]
--test-- "prefix-equal-same-datatype-40" --assert equal? (first [a:]) first [a:]
--test-- "prefix-equal-same-datatype-41" --assert equal? (first [:a]) first [:a]
--test-- "prefix-equal-same-datatype-42" --assert equal? [a b c d e] first [[a b c d e]]
--test-- "prefix-equal-same-datatype-43"
ea-result: 1 = 1
--assert ea-result = true
--test-- "prefix-equal-same-datatype-44"
ea-result: 1 = 0
--assert ea-result = false
--test-- "prefix-equal-same-datatype-45"
ea-result: equal? 1 1
--assert ea-result = true
--test-- "prefix-equal-same-datatype-46"
ea-result: equal? 1 0
--assert ea-result = false
===end-group===
===start-group=== "prefix equal implcit cast"
--test-- "prefix-equal-implcit-cast-1" --assert equal? #"0" 48
--test-- "prefix-equal-implcit-cast-2" --assert equal? 48 #"0"
--test-- "prefix-equal-implcit-cast-3" --assert equal? #"^(2710)" 10000
--test-- "prefix-equal-implcit-cast-4" --assert equal? #"^(010000)" 65536
--test-- "prefix-equal-implcit-cast-5"
ea-result: #"1" = 49
--assert ea-result = true
--test-- "prefix-equal-implcit-cast-6"
ea-result: equal? #"^(010000)" 10000
--assert ea-result = false
===end-group===
===start-group=== "= same datatype"
--test-- "infix-equal-same-datatype-1" --assert 0 = 0
--test-- "infix-equal-same-datatype-2" --assert 1 = 1
--test-- "infix-equal-same-datatype-3" --assert FFFFFFFFh = -1
--test-- "infix-equal-same-datatype-4" --assert [] = []
--test-- "infix-equal-same-datatype-5" --assert [a] = [a]
--test-- "infix-equal-same-datatype-6" --assert [A] = [a]
--test-- "infix-equal-same-datatype-7" --assert ['a] = [a]
--test-- "infix-equal-same-datatype-8" --assert [a:] = [a]
--test-- "infix-equal-same-datatype-9" --assert [:a] = [a]
--test-- "infix-equal-same-datatype-10" --assert [:a] = [a:]
--test-- "infix-equal-same-datatype-11" --assert [abcde] = [abcde]
--test-- "infix-equal-same-datatype-12" --assert [a b c d] = [a b c d]
--test-- "infix-equal-same-datatype-13" --assert [b c d] = next [a b c d]
--test-- "infix-equal-same-datatype-14" --assert [b c d] = (next [a b c d])
--test-- "infix-equal-same-datatype-15" --assert "a" = "a"
--test-- "infix-equal-same-datatype-16" --assert "a" = "A"
--test-- "infix-equal-same-datatype-17" --assert "abcdeè" = "abcdeè"
--test-- "infix-equal-same-datatype-18" --assert (next "abcdeè") = next "abcdeè"
--test-- "infix-equal-same-datatype-19" --assert (first "abcdeè") = first "abcdeè"
--test-- "infix-equal-same-datatype-20" --assert (last "abcdeè") = last "abcdeè"
--test-- "infix-equal-same-datatype-21"
--assert "abcde^(2710)é^(010000)" = "abcde^(2710)é^(010000)"
--test-- "infix-equal-same-datatype-22" --assert [d] = back tail [a b c d]
--test-- "infix-equal-same-datatype-23" --assert "2345" = next "12345"
--test-- "infix-equal-same-datatype-24" --assert #"z" = #"z"
--test-- "infix-equal-same-datatype-25" --assert not #"z" = #"Z"
--test-- "infix-equal-same-datatype-26" --assert not #"e" = #"è"
--test-- "infix-equal-same-datatype-27" --assert #"^(010000)" = #"^(010000)"
--test-- "infix-equal-same-datatype-28" --assert true = true
--test-- "infix-equal-same-datatype-29" --assert false = false
--test-- "infix-equal-same-datatype-30" --assert not false = true
--test-- "infix-equal-same-datatype-31" --assert not true = false
--test-- "infix-equal-same-datatype-32" --assert none = none
--test-- "infix-equal-same-datatype-33" --assert 'a = 'a
--test-- "infix-equal-same-datatype-34" --assert 'a = 'A
--test-- "infix-equal-same-datatype-35" --assert (first [a]) = first [a]
--test-- "infix-equal-same-datatype-36" --assert 'a = first [A]
--test-- "infix-equal-same-datatype-37" --assert 'a = first ['a]
--test-- "infix-equal-same-datatype-38" --assert 'a = first [:a]
--test-- "infix-equal-same-datatype-39" --assert 'a = first [a:]
--test-- "infix-equal-same-datatype-40" --assert (first [a:]) = first [a:]
--test-- "infix-equal-same-datatype-41" --assert (first [:a]) = first [:a]
--test-- "infix-equal-same-datatype-42" --assert [a b c d e] = first [[a b c d e]]
--test-- "infix-equal-same-datatype-43"
ea-result: 1 = 1
--assert ea-result = true
--test-- "infix-equal-same-datatype-44"
ea-result: 1 = 0
--assert ea-result = false
--test-- "infix-equal-same-datatype-45"
ea-result: equal? 1 1
--assert ea-result = true
--test-- "infix-equal-same-datatype-46"
ea-result: equal? 1 0
--assert ea-result = false
===end-group===
===start-group=== "= implcit cast"
--test-- "infix-equal-implcit-cast-1" --assert #"0" = 48
--test-- "infix-equal-implcit-cast-2" --assert 48 = #"0"
--test-- "infix-equal-implcit-cast-3" --assert #"^(2710)" = 10000
--test-- "infix-equal-implcit-cast-4" --assert #"^(010000)" = 65536
--test-- "infix-equal-implcit-cast-5"
ea-result: #"1" = 49
--assert ea-result = true
--test-- "infix-equal-implcit-cast-6"
ea-result: equal? #"^(010000)" 10000
--assert ea-result = false
===end-group===
===start-group=== "prefix-greater-same-datatype"
--test-- "prefix-greater-same-datatype-1" --assert not greater? 0 0
--test-- "prefix-greater-same-datatype-2" --assert greater? 1 0
--test-- "prefix-greater-same-datatype-3" --assert not greater? 1 1
--test-- "prefix-greater-same-datatype-4" --assert not greater? FFFFFFFFh -1
--test-- "prefix-greater-same-datatype-5" --assert greater? -1 FFFFFFFEh
--test-- "prefix-greater-same-datatype-6" --assert not greater? -2 FFFFFFFFh
--test-- "prefix-greater-same-datatype-7" --assert not greater? "a" "a"
--test-- "prefix-greater-same-datatype-8" --assert greater? "b" "a"
--test-- "prefix-greater-same-datatype-9" --assert greater? "è" "f"
--test-- "prefix-greater-same-datatype-10" --assert not greater? "A" "a"
--test-- "prefix-greater-same-datatype-11" --assert not greater? "a" "A"
--test-- "prefix-greater-same-datatype-12" --assert not greater? "abcdeè" "abcdeè"
--test-- "prefix-greater-same-datatype-13" --assert not greater? (next "abcdeè") next "abcdeè"
--test-- "prefix-greater-same-datatype-14" --assert not greater? (first "abcdeè") first "abcdeè"
--test-- "prefix-greater-same-datatype-15" --assert not greater? (last "abcdeè") last "abcdeè"
--test-- "prefix-greater-same-datatype-16" --assert not greater? "abcde^(2710)é^(010000)" "abcde^(2710)é^(010000)"
--test-- "prefix-greater-same-datatype-17" --assert not greater? "2345" next "12345"
--test-- "prefix-greater-same-datatype-18" --assert not greater? #"z" #"z"
--test-- "prefix-greater-same-datatype-19" --assert greater? #"z" #"Z"
--test-- "prefix-greater-same-datatype-20" --assert greater? #"è" #"e"
--test-- "prefix-greater-same-datatype-21" --assert not greater? #"^(010000)" #"^(010000)"
===end-group===
===start-group=== "prefix-greater-implcit-cast"
--test-- "prefix-greater-implcit-cast-1" --assert not greater? #"0" 48
--test-- "prefix-greater-implcit-cast-2" --assert not greater? 48 #"0"
--test-- "prefix-greater-implcit-cast-3" --assert not greater? #"^(2710)" 10000
--test-- "prefix-greater-implcit-cast-4" --assert not greater? #"^(010000)" 65536
===end-group===
===start-group=== "prefix-greater-equal-same-datatype"
--test-- "prefix-greater-equal-same-datatype-1" --assert greater-or-equal? 0 0
--test-- "prefix-greater-equal-same-datatype-2" --assert greater-or-equal? 1 0
--test-- "prefix-greater-equal-same-datatype-3" --assert greater-or-equal? 1 1
--test-- "prefix-greater-equal-same-datatype-4" --assert greater-or-equal? FFFFFFFFh -1
--test-- "prefix-greater-equal-same-datatype-5" --assert greater-or-equal? -1 FFFFFFFEh
--test-- "prefix-greater-equal-same-datatype-6" --assert not greater-or-equal? -2 FFFFFFFFh
--test-- "prefix-greater-equal-same-datatype-7" --assert greater-or-equal? "a" "a"
--test-- "prefix-greater-equal-same-datatype-8" --assert greater-or-equal? "b" "a"
--test-- "prefix-greater-equal-same-datatype-9" --assert greater-or-equal? "è" "f"
--test-- "prefix-greater-equal-same-datatype-10" --assert greater-or-equal? "A" "a"
--test-- "prefix-greater-equal-same-datatype-11" --assert greater-or-equal? "a" "A"
--test-- "prefix-greater-equal-same-datatype-12" --assert greater-or-equal? "abcdeè" "abcdeè"
--test-- "prefix-greater-equal-same-datatype-13" --assert greater-or-equal? (next "abcdeè") next "abcdeè"
--test-- "prefix-greater-equal-same-datatype-14" --assert greater-or-equal? (first "abcdeè") first "abcdeè"
--test-- "prefix-greater-equal-same-datatype-15" --assert greater-or-equal? (last "abcdeè") last "abcdeè"
--test-- "prefix-greater-equal-same-datatype-16" --assert greater-or-equal? "abcde^(2710)é^(010000)" "abcde^(2710)é^(010000)"
--test-- "prefix-greater-equal-same-datatype-17" --assert greater-or-equal? "2345" next "12345"
--test-- "prefix-greater-equal-same-datatype-18" --assert greater-or-equal? #"z" #"z"
--test-- "prefix-greater-equal-same-datatype-19" --assert greater-or-equal? #"z" #"Z"
--test-- "prefix-greater-equal-same-datatype-20" --assert greater-or-equal? #"è" #"e"
--test-- "prefix-greater-equal-same-datatype-21" --assert greater-or-equal? #"^(010000)" #"^(010000)"
===end-group===
===start-group=== "prefix-greater-implcit-cast"
--test-- "prefix-greater-equal-implcit-cast-1" --assert greater-or-equal? #"0" 48
--test-- "prefix-greater-equal-implcit-cast-2" --assert greater-or-equal? 48 #"0"
--test-- "prefix-greater-equal-implcit-cast-3" --assert greater-or-equal? #"^(2710)" 10000
--test-- "prefix-greater-equal-implcit-cast-4" --assert greater-or-equal? #"^(010000)" 65536
===end-group===
===start-group=== "infix-greater-same-datatype"
--test-- "infix-greater-same-datatype-1" --assert not 0 > 0
--test-- "infix-greater-same-datatype-2" --assert 1 > 0
--test-- "infix-greater-same-datatype-3" --assert not 1 > 1
--test-- "infix-greater-same-datatype-4" --assert not FFFFFFFFh > -1
--test-- "infix-greater-same-datatype-5" --assert -1 > FFFFFFFEh
--test-- "infix-greater-same-datatype-6" --assert not -2 > FFFFFFFFh
--test-- "infix-greater-same-datatype-7" --assert not "a" > "a"
--test-- "infix-greater-same-datatype-8" --assert "b" > "a"
--test-- "infix-greater-same-datatype-9" --assert "è" > "f"
--test-- "infix-greater-same-datatype-10" --assert not "A" > "a"
--test-- "infix-greater-same-datatype-11" --assert not "a" > "A"
--test-- "infix-greater-same-datatype-12" --assert not "abcdeè" > "abcdeè"
--test-- "infix-greater-same-datatype-13" --assert not (next "abcdeè") > next "abcdeè"
--test-- "infix-greater-same-datatype-14" --assert not (first "abcdeè") > first "abcdeè"
--test-- "infix-greater-same-datatype-15" --assert not (last "abcdeè") > last "abcdeè"
--test-- "infix-greater-same-datatype-16" --assert not "abcde^(2710)é^(010000)" > "abcde^(2710)é^(010000)"
--test-- "infix-greater-same-datatype-17" --assert not "2345" > next "12345"
--test-- "infix-greater-same-datatype-18" --assert not #"z" > #"z"
--test-- "infix-greater-same-datatype-19" --assert #"z" > #"Z"
--test-- "infix-greater-same-datatype-20" --assert #"è" > #"e"
--test-- "infix-greater-same-datatype-21" --assert not #"^(010000)" > #"^(010000)"
===end-group===
===start-group=== "infix-greater-implcit-cast"
--test-- "infix-greater-implcit-cast-1" --assert not #"0" > 48
--test-- "infix-greater-implcit-cast-2" --assert not 48 > #"0"
--test-- "infix-greater-implcit-cast-3" --assert not #"^(2710)" > 10000
--test-- "infix-greater-implcit-cast-4" --assert not #"^(010000)" > 65536
===end-group===
===start-group=== "infix-greater-equal-same-datatype"
--test-- "infix-greater-equal-same-datatype-1" --assert 0 >= 0
--test-- "infix-greater-equal-same-datatype-2" --assert 1 >= 0
--test-- "infix-greater-equal-same-datatype-3" --assert 1 >= 1
--test-- "infix-greater-equal-same-datatype-4" --assert FFFFFFFFh >= -1
--test-- "infix-greater-equal-same-datatype-5" --assert -1 >= FFFFFFFEh
--test-- "infix-greater-equal-same-datatype-6" --assert not -2 >= FFFFFFFFh
--test-- "infix-greater-equal-same-datatype-7" --assert "a" >= "a"
--test-- "infix-greater-equal-same-datatype-8" --assert "b" >= "a"
--test-- "infix-greater-equal-same-datatype-9" --assert "è" >= "f"
--test-- "infix-greater-equal-same-datatype-10" --assert "A" >= "a"
--test-- "infix-greater-equal-same-datatype-11" --assert "a" >= "A"
--test-- "infix-greater-equal-same-datatype-12" --assert "abcdeè" >= "abcdeè"
--test-- "infix-greater-equal-same-datatype-13" --assert (next "abcdeè") >= next "abcdeè"
--test-- "infix-greater-equal-same-datatype-14" --assert (first "abcdeè") >= first "abcdeè"
--test-- "infix-greater-equal-same-datatype-15" --assert (last "abcdeè") >= last "abcdeè"
--test-- "infix-greater-equal-same-datatype-16" --assert "abcde^(2710)é^(010000)" >= "abcde^(2710)é^(010000)"
--test-- "infix-greater-equal-same-datatype-17" --assert "2345" >= next "12345"
--test-- "infix-greater-equal-same-datatype-18" --assert #"z" >= #"z"
--test-- "infix-greater-equal-same-datatype-19" --assert #"z" >= #"Z"
--test-- "infix-greater-equal-same-datatype-20" --assert #"è" >= #"e"
--test-- "infix-greater-equal-same-datatype-21" --assert #"^(010000)" >= #"^(010000)"
===end-group===
===start-group=== "infix-greater-equal-implcit-cast"
--test-- "infix-greater-equal-implcit-cast-1" --assert #"0" >= 48
--test-- "infix-greater-equal-implcit-cast-2" --assert 48 >= #"0"
--test-- "infix-greater-equal-implcit-cast-3" --assert #"^(2710)" >= 10000
--test-- "infix-greater-equal-implcit-cast-4" --assert #"^(010000)" >= 65536
===end-group===
===start-group=== "infix-lesser-same-datatype"
--test-- "infix-lesser-same-datatype-1" --assert not 0 < 0
--test-- "infix-lesser-same-datatype-2" --assert 0 < 1
--test-- "infix-lesser-same-datatype-3" --assert not 1 < 1
--test-- "infix-lesser-same-datatype-4" --assert not FFFFFFFFh < -1
--test-- "infix-lesser-same-datatype-5" --assert FFFFFFFEh < -1
--test-- "infix-lesser-same-datatype-6" --assert not FFFFFFFFh < -2
--test-- "infix-lesser-same-datatype-7" --assert not "a" < "a"
--test-- "infix-lesser-same-datatype-8" --assert "a" < "b"
--test-- "infix-lesser-same-datatype-9" --assert "f" < "è"
--test-- "infix-lesser-same-datatype-10" --assert not "A" < "a"
--test-- "infix-lesser-same-datatype-11" --assert not "a" < "A"
--test-- "infix-lesser-same-datatype-12" --assert not "abcdeè" < "abcdeè"
--test-- "infix-lesser-same-datatype-13" --assert not (next "abcdeè") < next "abcdeè"
--test-- "infix-lesser-same-datatype-14" --assert not (first "abcdeè") < first "abcdeè"
--test-- "infix-lesser-same-datatype-15" --assert not (last "abcdeè") < last "abcdeè"
--test-- "infix-lesser-same-datatype-16" --assert not "abcde^(2710)é^(010000)" < "abcde^(2710)é^(010000)"
--test-- "infix-lesser-same-datatype-17" --assert not "2345" < next "12345"
--test-- "infix-lesser-same-datatype-18" --assert not #"z" < #"z"
--test-- "infix-lesser-same-datatype-19" --assert #"Z" < #"z"
--test-- "infix-lesser-same-datatype-20" --assert #"e" < #"è"
--test-- "infix-lesser-same-datatype-21" --assert not #"^(010000)" < #"^(010000)"
===end-group===
===start-group=== "infix-lesser-implcit-cast"
--test-- "infix-lesser-implcit-cast-1" --assert not #"0" < 48
--test-- "infix-lesser-implcit-cast-2" --assert not 48 < #"0"
--test-- "infix-lesser-implcit-cast-3" --assert not #"^(2710)" < 10000
--test-- "infix-lesser-implcit-cast-4" --assert not #"^(010000)" < 65536
===end-group===
===start-group=== "infix-lesser-equal-same-datatype"
--test-- "infix-lesser-equal-same-datatype-1" --assert 0 <= 0
--test-- "infix-lesser-equal-same-datatype-2" --assert 0 <= 1
--test-- "infix-lesser-equal-same-datatype-3" --assert 1 <= 1
--test-- "infix-lesser-equal-same-datatype-4" --assert FFFFFFFFh <= -1
--test-- "infix-lesser-equal-same-datatype-5" --assert FFFFFFFEh <= -1
--test-- "infix-lesser-equal-same-datatype-6" --assert not FFFFFFFFh <= -2
--test-- "infix-lesser-equal-same-datatype-7" --assert "a" <= "a"
--test-- "infix-lesser-equal-same-datatype-8" --assert "a" <= "b"
--test-- "infix-lesser-equal-same-datatype-9" --assert "f" <= "è"
--test-- "infix-lesser-equal-same-datatype-10" --assert "A" <= "a"
--test-- "infix-lesser-equal-same-datatype-11" --assert "a" <= "A"
--test-- "infix-lesser-equal-same-datatype-12" --assert "abcdeè" <= "abcdeè"
--test-- "infix-lesser-equal-same-datatype-13" --assert (next "abcdeè") <= next "abcdeè"
--test-- "infix-lesser-equal-same-datatype-14" --assert (first "abcdeè") <= first "abcdeè"
--test-- "infix-lesser-equal-same-datatype-15" --assert (last "abcdeè") <= last "abcdeè"
--test-- "infix-lesser-equal-same-datatype-16" --assert "abcde^(2710)é^(010000)" <= "abcde^(2710)é^(010000)"
--test-- "infix-lesser-equal-same-datatype-17" --assert "2345" <= next "12345"
--test-- "infix-lesser-equal-same-datatype-18" --assert #"z" <= #"z"
--test-- "infix-lesser-equal-same-datatype-19" --assert #"Z" <= #"z"
--test-- "infix-lesser-equal-same-datatype-20" --assert #"e" <= #"è"
--test-- "infix-lesser-equal-same-datatype-21" --assert #"^(010000)" <= #"^(010000)"
===end-group===
===start-group=== "infix-lesser-equal-implcit-cast"
--test-- "infix-lesser-equal-implcit-cast-1" --assert #"0" <= 48
--test-- "infix-lesser-equal-implcit-cast-2" --assert 48 <= #"0"
--test-- "infix-lesser-equal-implcit-cast-3" --assert #"^(2710)" <= 10000
--test-- "infix-lesser-equal-implcit-cast-4" --assert #"^(010000)" <= 65536
===end-group===
===start-group=== "prefix-lesser-same-datatype"
--test-- "prefix-lesser-same-datatype-1" --assert not lesser? 0 0
--test-- "prefix-lesser-same-datatype-2" --assert lesser? 0 1
--test-- "prefix-lesser-same-datatype-3" --assert not lesser? 1 1
--test-- "prefix-lesser-same-datatype-4" --assert not lesser? FFFFFFFFh -1
--test-- "prefix-lesser-same-datatype-5" --assert lesser? FFFFFFFEh -1
--test-- "prefix-lesser-same-datatype-6" --assert not lesser? FFFFFFFFh -2
--test-- "prefix-lesser-same-datatype-7" --assert not lesser? "a" "a"
--test-- "prefix-lesser-same-datatype-8" --assert lesser? "a" "b"
--test-- "prefix-lesser-same-datatype-9" --assert lesser? "f" "è"
--test-- "prefix-lesser-same-datatype-10" --assert not lesser? "A" "a"
--test-- "prefix-lesser-same-datatype-11" --assert not lesser? "a" "A"
--test-- "prefix-lesser-same-datatype-12" --assert not lesser? "abcdeè" "abcdeè"
--test-- "prefix-lesser-same-datatype-13" --assert not lesser? (next "abcdeè") next "abcdeè"
--test-- "prefix-lesser-same-datatype-14" --assert not lesser? (first "abcdeè") first "abcdeè"
--test-- "prefix-lesser-same-datatype-15" --assert not lesser? (last "abcdeè") last "abcdeè"
--test-- "prefix-lesser-same-datatype-16" --assert not lesser? "abcde^(2710)é^(010000)" "abcde^(2710)é^(010000)"
--test-- "prefix-lesser-same-datatype-17" --assert not lesser? "2345" next "12345"
--test-- "prefix-lesser-same-datatype-18" --assert not lesser? #"z" #"z"
--test-- "prefix-lesser-same-datatype-19" --assert lesser? #"Z" #"z"
--test-- "prefix-lesser-same-datatype-20" --assert lesser? #"e" #"è"
--test-- "prefix-lesser-same-datatype-21" --assert not lesser? #"^(010000)" #"^(010000)"
===end-group===
===start-group=== "prefix-lesser-implcit-cast"
--test-- "prefix-lesser-implcit-cast-1" --assert not lesser? #"0" 48
--test-- "prefix-lesser-implcit-cast-2" --assert not lesser? 48 #"0"
--test-- "prefix-lesser-implcit-cast-3" --assert not lesser? #"^(2710)" 10000
--test-- "prefix-lesser-implcit-cast-4" --assert not lesser? #"^(010000)" 65536
===end-group===
===start-group=== "prefix-lesser-same-datatype"
--test-- "prefix-lesser-equal-same-datatype-1" --assert lesser-or-equal? 0 0
--test-- "prefix-lesser-equal-same-datatype-2" --assert lesser-or-equal? 0 1
--test-- "prefix-lesser-equal-same-datatype-3" --assert lesser-or-equal? 1 1
--test-- "prefix-lesser-equal-same-datatype-4" --assert lesser-or-equal? FFFFFFFFh -1
--test-- "prefix-lesser-equal-same-datatype-5" --assert lesser-or-equal? FFFFFFFEh -1
--test-- "prefix-lesser-equal-same-datatype-6" --assert not lesser-or-equal? FFFFFFFFh -2
--test-- "prefix-lesser-equal-same-datatype-7" --assert lesser-or-equal? "a" "a"
--test-- "prefix-lesser-equal-same-datatype-8" --assert lesser-or-equal? "a" "b"
--test-- "prefix-lesser-equal-same-datatype-9" --assert lesser-or-equal? "f" "è"
--test-- "prefix-lesser-equal-same-datatype-10" --assert lesser-or-equal? "A" "a"
--test-- "prefix-lesser-equal-same-datatype-11" --assert lesser-or-equal? "a" "A"
--test-- "prefix-lesser-equal-same-datatype-12" --assert lesser-or-equal? "abcdeè" "abcdeè"
--test-- "prefix-lesser-equal-same-datatype-13" --assert lesser-or-equal? (next "abcdeè") next "abcdeè"
--test-- "prefix-lesser-equal-same-datatype-14" --assert lesser-or-equal? (first "abcdeè") first "abcdeè"
--test-- "prefix-lesser-equal-same-datatype-15" --assert lesser-or-equal? (last "abcdeè") last "abcdeè"
--test-- "prefix-lesser-equal-same-datatype-16" --assert lesser-or-equal? "abcde^(2710)é^(010000)" "abcde^(2710)é^(010000)"
--test-- "prefix-lesser-equal-same-datatype-17" --assert lesser-or-equal? "2345" next "12345"
--test-- "prefix-lesser-equal-same-datatype-18" --assert lesser-or-equal? #"z" #"z"
--test-- "prefix-lesser-equal-same-datatype-19" --assert lesser-or-equal? #"Z" #"z"
--test-- "prefix-lesser-equal-same-datatype-20" --assert lesser-or-equal? #"e" #"è"
--test-- "prefix-lesser-equal-same-datatype-21" --assert lesser-or-equal? #"^(010000)" #"^(010000)"
===end-group===
===start-group=== "prefix-lesser-implcit-cast"
--test-- "prefix-lesser-equal-implcit-cast-1" --assert lesser-or-equal? #"0" 48
--test-- "prefix-lesser-equal-implcit-cast-2" --assert lesser-or-equal? 48 #"0"
--test-- "prefix-lesser-equal-implcit-cast-3" --assert lesser-or-equal? #"^(2710)" 10000
--test-- "prefix-lesser-equal-implcit-cast-4" --assert lesser-or-equal? #"^(010000)" 65536
===end-group===
===start-group=== "prefix-not-equal-same-datatype"
--test-- "prefix-not-equal-same-datatype-1" --assert not-equal? 0 1
--test-- "prefix-not-equal-same-datatype-2" --assert not-equal? 1 0
--test-- "prefix-not-equal-same-datatype-3" --assert not-equal? FFFFFFFEh -1
--test-- "prefix-not-equal-same-datatype-4" --assert not-equal? [] [[]]
--test-- "prefix-not-equal-same-datatype-5" --assert not-equal? [a] [b]
--test-- "prefix-not-equal-same-datatype-6" --assert not-equal? [A] [b]
--test-- "prefix-not-equal-same-datatype-7" --assert not-equal? ['a] ['b]
--test-- "prefix-not-equal-same-datatype-8" --assert not-equal? [a:] [b:]
--test-- "prefix-not-equal-same-datatype-9" --assert not-equal? [:a] [b:]
--test-- "prefix-not-equal-same-datatype-10" --assert not-equal? [abcde] [abcdef]
--test-- "prefix-not-equal-same-datatype-11" --assert not-equal? [a b c d] [a c d]
--test-- "prefix-not-equal-same-datatype-12" --assert not-equal? [b c d] next [a b c d e]
--test-- "prefix-not-equal-same-datatype-13" --assert not-equal? [b c d] (next [a b c d e])
--test-- "prefix-not-equal-same-datatype-14" --assert not-equal? "a" "b"
--test-- "prefix-not-equal-same-datatype-15" --assert not-equal? "a" "B"
--test-- "prefix-not-equal-same-datatype-16" --assert not-equal? "abcdeè" "abcdeèf"
--test-- "prefix-not-equal-same-datatype-17" --assert not-equal? (next "abcdeè") next "abcdeèf"
--test-- "prefix-not-equal-same-datatype-18" --assert not-equal? (first "abcdeè") first "bcdeè"
--test-- "prefix-not-equal-same-datatype-19" --assert not-equal? (last "abcdeè") last "abcdeèf"
--test-- "prefix-not-equal-same-datatype-20" --assert not-equal? "abcde^(2710)é^(010000)" "abcde^(2711)é^(010000)"
--test-- "prefix-not-equal-same-datatype-21" --assert not-equal? [d] back tail [a b c d e]
--test-- "prefix-not-equal-same-datatype-22" --assert not-equal? "2345" next "123456"
--test-- "prefix-not-equal-same-datatype-23" --assert not-equal? #"z" #"Z"
--test-- "prefix-not-equal-same-datatype-24" --assert not not-equal? #"z" #"z"
--test-- "prefix-not-equal-same-datatype-25" --assert not not-equal? #"e" #"e"
--test-- "prefix-not-equal-same-datatype-26" --assert not-equal? #"^(010000)" #"^(010001)"
--test-- "prefix-not-equal-same-datatype-27" --assert not-equal? true false
--test-- "prefix-not-equal-same-datatype-28" --assert not-equal? false true
--test-- "prefix-not-equal-same-datatype-29" --assert not not-equal? false false
--test-- "prefix-not-equal-same-datatype-30" --assert not not-equal? true true
--test-- "prefix-not-equal-same-datatype-31" --assert not-equal? none "a"
--test-- "prefix-not-equal-same-datatype-32" --assert not-equal? 'a 'b
--test-- "prefix-not-equal-same-datatype-33" --assert not-equal? 'a 'B
--test-- "prefix-not-equal-same-datatype-34" --assert not-equal? (first [a]) first [b]
--test-- "prefix-not-equal-same-datatype-35" --assert not-equal? 'a first [B]
--test-- "prefix-not-equal-same-datatype-36" --assert not-equal? 'a first ['b]
--test-- "prefix-not-equal-same-datatype-37" --assert not-equal? 'a first [:b]
--test-- "prefix-not-equal-same-datatype-38" --assert not-equal? 'a first [b:]
--test-- "prefix-not-equal-same-datatype-39" --assert not-equal? (first [a:]) first [z:]
--test-- "prefix-not-equal-same-datatype-40" --assert not-equal? (first [:a]) first [:z]
--test-- "prefix-not-equal-same-datatype-41" --assert not-equal? [a b c d e] first [[b c d e]]
--test-- "prefix-not-equal-same-datatype-42"
ea-result: 1 <> 1
--assert ea-result = false
--test-- "prefix-not-equal-same-datatype-43"
ea-result: 1 <> 0
--assert ea-result = true
--test-- "prefix-not-equal-same-datatype-44"
ea-result: not-equal? 1 1
--assert ea-result = false
--test-- "prefix-not-equal-same-datatype-45"
ea-result: not-equal? 1 0
--assert ea-result = true
===end-group===
===start-group=== "prefix-not-equal-implcit-cast"
--test-- "prefix-not-equal-implcit-cast-1" --assert not-equal? #"0" 49
--test-- "prefix-not-equal-implcit-cast-2" --assert not-equal? 48 #"1"
--test-- "prefix-not-equal-implcit-cast-3" --assert not-equal? #"^(2711)" 10000
--test-- "prefix-not-equal-implcit-cast-4" --assert not-equal? #"^(010001)" 65536
--test-- "prefix-not-equal-implcit-cast-5"
ea-result: #"1" <> 49
--assert ea-result = false
--test-- "prefix-not-equal-implcit-cast-6"
ea-result: not-equal? #"^(01000)" 10000
--assert ea-result = true
===end-group===
===start-group=== "infix-not-equal-same-datatype"
--test-- "infix-not-equal-same-datatype-1" --assert 0 <> 1
--test-- "infix-not-equal-same-datatype-2" --assert 1 <> 0
--test-- "infix-not-equal-same-datatype-3" --assert FFFFFFFEh <> -1
--test-- "infix-not-equal-same-datatype-4" --assert [] <> [[]]
--test-- "infix-not-equal-same-datatype-5" --assert [a] <> [b]
--test-- "infix-not-equal-same-datatype-6" --assert [A] <> [b]
--test-- "infix-not-equal-same-datatype-7" --assert ['a] <> ['b]
--test-- "infix-not-equal-same-datatype-8" --assert [a:] <> [b:]
--test-- "infix-not-equal-same-datatype-9" --assert [:a] <> [b:]
--test-- "infix-not-equal-same-datatype-10" --assert [abcde] <> [abcdef]
--test-- "infix-not-equal-same-datatype-11" --assert [a b c d] <> [a c d]
--test-- "infix-not-equal-same-datatype-12" --assert [b c d] <> next [a b c d e]
--test-- "infix-not-equal-same-datatype-13" --assert [b c d] <> (next [a b c d e])
--test-- "infix-not-equal-same-datatype-14" --assert "a" <> "b"
--test-- "infix-not-equal-same-datatype-15" --assert "a" <> "B"
--test-- "infix-not-equal-same-datatype-16" --assert "abcdeè" <> "abcdeèf"
--test-- "infix-not-equal-same-datatype-17" --assert (next "abcdeè") <> next "abcdeèf"
--test-- "infix-not-equal-same-datatype-18" --assert (first "abcdeè") <> first "bcdeè"
--test-- "infix-not-equal-same-datatype-19" --assert (last "abcdeè") <> last "abcdeèf"
--test-- "infix-not-equal-same-datatype-20" --assert "abcde^(2710)é^(010000)" <> "abcde^(2711)é^(010000)"
--test-- "infix-not-equal-same-datatype-21" --assert [d] <> back tail [a b c d e]
--test-- "infix-not-equal-same-datatype-22" --assert "2345" <> next "123456"
--test-- "infix-not-equal-same-datatype-23" --assert #"z" <> #"Z"
--test-- "infix-not-equal-same-datatype-24" --assert not #"z" <> #"z"
--test-- "infix-not-equal-same-datatype-25" --assert not #"e" <> #"e"
--test-- "infix-not-equal-same-datatype-26" --assert #"^(010000)" <> #"^(010001)"
--test-- "infix-not-equal-same-datatype-27" --assert true <> false
--test-- "infix-not-equal-same-datatype-28" --assert false <> true
--test-- "infix-not-equal-same-datatype-29" --assert not false <> false
--test-- "infix-not-equal-same-datatype-30" --assert not true <> true
--test-- "infix-not-equal-same-datatype-31" --assert none <> "a"
--test-- "infix-not-equal-same-datatype-32" --assert 'a <> 'b
--test-- "infix-not-equal-same-datatype-33" --assert 'a <> 'B
--test-- "infix-not-equal-same-datatype-34" --assert (first [a]) <> first [b]
--test-- "infix-not-equal-same-datatype-35" --assert 'a <> first [B]
--test-- "infix-not-equal-same-datatype-36" --assert 'a <> first ['b]
--test-- "infix-not-equal-same-datatype-37" --assert 'a <> first [:b]
--test-- "infix-not-equal-same-datatype-38" --assert 'a <> first [b:]
--test-- "infix-not-equal-same-datatype-39" --assert (first [a:]) <> first [z:]
--test-- "infix-not-equal-same-datatype-40" --assert (first [:a]) <> first [:z]
--test-- "infix-not-equal-same-datatype-41" --assert [a b c d e] <> first [[b c d e]]
--test-- "infix-not-equal-same-datatype-42"
ea-result: 1 <> 1
--assert ea-result = false
--test-- "infix-not-equal-same-datatype-43"
ea-result: 1 <> 0
--assert ea-result = true
--test-- "infix-not-equal-same-datatype-44"
ea-result: not-equal? 1 1
--assert ea-result = false
--test-- "infix-not-equal-same-datatype-45"
ea-result: not-equal? 1 0
--assert ea-result = true
===end-group===
===start-group=== "infix-not-equal-implcit-cast"
--test-- "infix-not-equal-implcit-cast-1" --assert #"0" <> 49
--test-- "infix-not-equal-implcit-cast-2" --assert 48 <> #"1"
--test-- "infix-not-equal-implcit-cast-3" --assert #"^(2711)" <> 10000
--test-- "infix-not-equal-implcit-cast-4" --assert #"^(010001)" <> 65536
--test-- "infix-not-equal-implcit-cast-5"
ea-result: #"1" <> 49
--assert ea-result = false
--test-- "infix-not-equal-implcit-cast-6"
ea-result: not-equal? #"^(01000)" 10000
--assert ea-result = true
===end-group===
===start-group=== "same-datatype"
--test-- "same-datatype-1" --assert same? 0 0
--test-- "same-datatype-2" --assert same? 1 1
--test-- "same-datatype-3" --assert same? FFFFFFFFh -1
--test-- "same-datatype-4" --assert not same? [] []
--test-- "same-datatype-5" --assert not same? [a] [a]
--test-- "same-datatype-6" --assert not same? [A] [a]
--test-- "same-datatype-7" --assert not same? ['a] [a]
--test-- "same-datatype-8" --assert not same? [a:] [a]
--test-- "same-datatype-9" --assert not same? [:a] [a]
--test-- "same-datatype-10" --assert not same? [:a] [a:]
--test-- "same-datatype-11" --assert not same? [abcde] [abcde]
--test-- "same-datatype-12" --assert not same? [a b c d] [a b c d]
--test-- "same-datatype-13" --assert not same? [b c d] next [a b c d]
--test-- "same-datatype-14" --assert not same? [b c d] (next [a b c d])
--test-- "same-datatype-15" --assert not same? "a" "a"
--test-- "same-datatype-16" --assert not same? "a" "A"
--test-- "same-datatype-17" --assert not same? "abcdeè" "abcdeè"
--test-- "same-datatype-18" --assert not same? (next "abcdeè") next "abcdeè"
--test-- "same-datatype-19" --assert same? (first "abcdeè") first "abcdeè"
--test-- "same-datatype-20" --assert same? (last "abcdeè") last "abcdeè"
--test-- "same-datatype-21" --assert not same? "abcde^(2710)é^(010000)" "abcde^(2710)é^(010000)"
--test-- "same-datatype-22" --assert not same? [d] back tail [a b c d]
--test-- "same-datatype-23" --assert not same? "2345" next "12345"
--test-- "same-datatype-24" --assert same? #"z" #"z"
--test-- "same-datatype-25" --assert not same? #"z" #"Z"
--test-- "same-datatype-26" --assert not same? #"e" #"è"
--test-- "same-datatype-27" --assert same? #"^(010000)" #"^(010000)"
--test-- "same-datatype-28" --assert same? true true
--test-- "same-datatype-29" --assert same? true #[true]
--test-- "same-datatype-30" --assert same? none #[none]
--test-- "same-datatype-31" --assert same? none none
--test-- "same-datatype-32" --assert same? 'true first [true]
--test-- "same-datatype-33" --assert same? first [#[true]] #[true]
--test-- "same-datatype-34" --assert same? false false
--test-- "same-datatype-35" --assert not same? false true
--test-- "same-datatype-36" --assert not same? true false
--test-- "same-datatype-37" --assert same? 'a 'a
--test-- "same-datatype-38" --assert not same? 'a 'A
--test-- "same-datatype-39" --assert not same? [a b c d e] first [[a b c d e]]
--test-- "same-datatype-40" --assert not same? 0.0 -0.0
--test-- "same-datatype-41"
ea-result: same? 1 1
--assert ea-result = true
--test-- "same-datatype-42"
ea-result: same? 1 0
--assert ea-result = false
===end-group===
===start-group=== "same-implcit-cast"
--test-- "same-implcit-cast-1" --assert not same? #"0" 48
--test-- "same-implcit-cast-2" --assert not same? 48 #"0"
--test-- "same-implcit-cast-3" --assert not same? #"^(2710)" 10000
--test-- "same-implcit-cast-4" --assert not same? #"^(010000)" 65536
--test-- "same-implcit-cast-5"
ea-result: #"1" == 49
--assert ea-result = false
--test-- "same-implcit-cast-6"
ea-result: same? #"^(010000)" 10000
--assert ea-result = false
--test-- "same-implcit-cast-7"
a: b: 1
--assert same? a b
--test-- "same-implcit-cast-8"
a: b: "abcde"
--assert same? a b
===end-group===
===start-group=== "infix-strict-equal-same-datatype"
--test-- "infix-strict-equal-same-datatype-1" --assert 0 == 0
--test-- "infix-strict-equal-same-datatype-2" --assert 1 == 1
--test-- "infix-strict-equal-same-datatype-3" --assert FFFFFFFFh == -1
--test-- "infix-strict-equal-same-datatype-4" --assert [] == []
--test-- "infix-strict-equal-same-datatype-5" --assert [a] == [a]
--test-- "infix-strict-equal-same-datatype-6" --assert not [A] == [a]
--test-- "infix-strict-equal-same-datatype-7" --assert not ['a] == [a]
--test-- "infix-strict-equal-same-datatype-8" --assert not [a:] == [a]
--test-- "infix-strict-equal-same-datatype-9" --assert not [:a] == [a]
--test-- "infix-strict-equal-same-datatype-10" --assert not [:a] == [a:]
--test-- "infix-strict-equal-same-datatype-11" --assert [abcde] == [abcde]
--test-- "infix-strict-equal-same-datatype-12" --assert [a b c d] == [a b c d]
--test-- "infix-strict-equal-same-datatype-13" --assert [b c d] == next [a b c d]
--test-- "infix-strict-equal-same-datatype-14" --assert [b c d] == (next [a b c d])
--test-- "infix-strict-equal-same-datatype-15" --assert "a" == "a"
--test-- "infix-strict-equal-same-datatype-16" --assert not "a" == "A"
--test-- "infix-strict-equal-same-datatype-17" --assert "abcdeè" == "abcdeè"
--test-- "infix-strict-equal-same-datatype-18" --assert (next "abcdeè") == next "abcdeè"
--test-- "infix-strict-equal-same-datatype-19" --assert (first "abcdeè") == first "abcdeè"
--test-- "infix-strict-equal-same-datatype-20" --assert (last "abcdeè") == last "abcdeè"
--test-- "infix-strict-equal-same-datatype-21" --assert "abcde^(2710)é^(010000)" == "abcde^(2710)é^(010000)"
--test-- "infix-strict-equal-same-datatype-22" --assert [d] == back tail [a b c d]
--test-- "infix-strict-equal-same-datatype-23" --assert "2345" == next "12345"
--test-- "infix-strict-equal-same-datatype-24" --assert #"z" == #"z"
--test-- "infix-strict-equal-same-datatype-25" --assert not #"z" == #"Z"
--test-- "infix-strict-equal-same-datatype-26" --assert not #"e" == #"è"
--test-- "infix-strict-equal-same-datatype-27" --assert #"^(010000)" == #"^(010000)"
--test-- "infix-strict-equal-same-datatype-28" --assert true == true
--test-- "infix-strict-equal-same-datatype-29" --assert false == false
--test-- "infix-strict-equal-same-datatype-30" --assert not false == true
--test-- "infix-strict-equal-same-datatype-31" --assert not true == false
--test-- "infix-strict-equal-same-datatype-32" --assert none == none
--test-- "infix-strict-equal-same-datatype-33" --assert 'a == 'a
--test-- "infix-strict-equal-same-datatype-34" --assert [a b c d e] == first [[a b c d e]]
--test-- "infix-strict-equal-same-datatype-35"
ea-result: 1 == 1
--assert ea-result = true
--test-- "infix-strict-equal-same-datatype-36"
ea-result: 1 == 0
--assert ea-result = false
--test-- "infix-strict-equal-same-datatype-37"
ea-result: strict-equal? 1 1
--assert ea-result = true
--test-- "infix-strict-equal-same-datatype-38"
ea-result: strict-equal? 1 0
--assert ea-result = false
--test-- "infix-strict-equal-same-datatype-39" --assert 0.0 == -0.0
--test-- "infix-strict-equal-same-datatype-40" --assert not 1 == 1.0
===end-group===
===start-group=== "infix-strict-equal-implcit-cast"
--test-- "infix-strict-equal-implcit-cast-1" --assert not #"0" == 48
--test-- "infix-strict-equal-implcit-cast-2" --assert not 48 == #"0"
--test-- "infix-strict-equal-implcit-cast-3" --assert not #"^(2710)" == 10000
--test-- "infix-strict-equal-implcit-cast-4" --assert not #"^(010000)" == 65536
--test-- "infix-strict-equal-implcit-cast-5"
ea-result: #"1" == 49
--assert ea-result = false
--test-- "infix-strict-equal-implcit-cast-6"
ea-result: strict-equal? #"^(010000)" 10000
--assert ea-result = false
--test-- "infix-strict-equal-implcit-cast-7"
a: b: 1
--assert a == b
--test-- "infix-strict-equal-implcit-cast-8"
a: b: "abcde"
--assert a == b
===end-group===
===start-group=== "prefix-strict-equal-same-datatype"
--test-- "prefix-strict-equal-same-datatype-1" --assert strict-equal? 0 0
--test-- "prefix-strict-equal-same-datatype-2" --assert strict-equal? 1 1
--test-- "prefix-strict-equal-same-datatype-3" --assert strict-equal? FFFFFFFFh -1
--test-- "prefix-strict-equal-same-datatype-4" --assert strict-equal? [] []
--test-- "prefix-strict-equal-same-datatype-5" --assert strict-equal? [a] [a]
--test-- "prefix-strict-equal-same-datatype-6" --assert not strict-equal? [A] [a]
--test-- "prefix-strict-equal-same-datatype-7" --assert not strict-equal? ['a] [a]
--test-- "prefix-strict-equal-same-datatype-8" --assert not strict-equal? [a:] [a]
--test-- "prefix-strict-equal-same-datatype-9" --assert not strict-equal? [:a] [a]
--test-- "prefix-strict-equal-same-datatype-10" --assert not strict-equal? [:a] [a:]
--test-- "prefix-strict-equal-same-datatype-11" --assert strict-equal? [abcde] [abcde]
--test-- "prefix-strict-equal-same-datatype-12" --assert strict-equal? [a b c d] [a b c d]
--test-- "prefix-strict-equal-same-datatype-13" --assert strict-equal? [b c d] next [a b c d]
--test-- "prefix-strict-equal-same-datatype-14" --assert strict-equal? [b c d] (next [a b c d])
--test-- "prefix-strict-equal-same-datatype-15" --assert strict-equal? "a" "a"
--test-- "prefix-strict-equal-same-datatype-16" --assert not strict-equal? "a" "A"
--test-- "prefix-strict-equal-same-datatype-17" --assert strict-equal? "abcdeè" "abcdeè"
--test-- "prefix-strict-equal-same-datatype-18" --assert strict-equal? (next "abcdeè") next "abcdeè"
--test-- "prefix-strict-equal-same-datatype-19" --assert strict-equal? (first "abcdeè") first "abcdeè"
--test-- "prefix-strict-equal-same-datatype-20" --assert strict-equal? (last "abcdeè") last "abcdeè"
--test-- "prefix-strict-equal-same-datatype-21" --assert strict-equal? "abcde^(2710)é^(010000)" "abcde^(2710)é^(010000)"
--test-- "prefix-strict-equal-same-datatype-22" --assert strict-equal? [d] back tail [a b c d]
--test-- "prefix-strict-equal-same-datatype-23" --assert strict-equal? "2345" next "12345"
--test-- "prefix-strict-equal-same-datatype-24" --assert strict-equal? #"z" #"z"
--test-- "prefix-strict-equal-same-datatype-25" --assert not strict-equal? #"z" #"Z"
--test-- "prefix-strict-equal-same-datatype-26" --assert not strict-equal? #"e" #"è"
--test-- "prefix-strict-equal-same-datatype-27" --assert strict-equal? #"^(010000)" #"^(010000)"
--test-- "prefix-strict-equal-same-datatype-28" --assert strict-equal? true true
--test-- "prefix-strict-equal-same-datatype-29" --assert strict-equal? false false
--test-- "prefix-strict-equal-same-datatype-30" --assert not strict-equal? false true
--test-- "prefix-strict-equal-same-datatype-31" --assert not strict-equal? true false
--test-- "prefix-strict-equal-same-datatype-32" --assert strict-equal? none none
--test-- "prefix-strict-equal-same-datatype-33" --assert strict-equal? 'a 'a
--test-- "prefix-strict-equal-same-datatype-34" --assert strict-equal? [a b c d e] first [[a b c d e]]
--test-- "prefix-strict-equal-same-datatype-35"
ea-result: 1 == 1
--assert ea-result = true
--test-- "prefix-strict-equal-same-datatype-36"
ea-result: 1 == 0
--assert ea-result = false
--test-- "prefix-strict-equal-same-datatype-37"
ea-result: strict-equal? 1 1
--assert ea-result = true
--test-- "prefix-strict-equal-same-datatype-38"
ea-result: strict-equal? 1 0
--assert ea-result = false
--test-- "prefix-strict-equal-same-datatype-39" --assert strict-equal? 0.0 -0.0
--test-- "prefix-strict-equal-same-datatype-40" --assert not strict-equal? 1 1.0
===end-group===
===start-group=== "prefix-strict-equal-implcit-cast"
--test-- "prefix-strict-equal-implcit-cast-1" --assert not strict-equal? #"0" 48
--test-- "prefix-strict-equal-implcit-cast-2" --assert not strict-equal? 48 #"0"
--test-- "prefix-strict-equal-implcit-cast-3" --assert not strict-equal? #"^(2710)" 10000
--test-- "prefix-strict-equal-implcit-cast-4" --assert not strict-equal? #"^(010000)" 65536
--test-- "prefix-strict-equal-implcit-cast-5"
ea-result: #"1" == 49
--assert ea-result = false
--test-- "prefix-strict-equal-implcit-cast-6"
ea-result: strict-equal? #"^(010000)" 10000
--assert ea-result = false
--test-- "prefix-strict-equal-implcit-cast-7"
a: b: 1
--assert strict-equal? a b
--test-- "prefix-strict-equal-implcit-cast-8"
a: b: "abcde"
--assert strict-equal? a b
===end-group===
===start-group=== "cycles"
--test-- "cycle-blk-1"
blk1: [1]
append/only blk1 blk1
blk2: [1]
append/only blk2 blk2
--assert blk1 = blk2
--test-- "cycle-blk-2"
blk1: [1]
append/only blk1 blk1
blk2: [1]
append/only blk2 blk1
--assert blk1 = blk2
--test-- "cycle-blk-3"
blk1: [1]
append/only blk1 blk1
blk2: [1 [1 2]]
--assert blk1 <> blk2
--test-- "cycle-blk-4"
blk1: [1]
append/only blk1 blk1
append blk1 1
blk2: [1]
append/only blk2 blk2
append blk2 2
--assert blk1 <> blk2
===end-group===
~~~end-file~~~
| Red | 5 | 0xflotus/red | tests/source/units/comparison-test.red | [
"BSL-1.0",
"BSD-3-Clause"
] |
package {
/**
* @author Maeiky
*/
public class Test {
public var sName : String;
public function Test():Void {
}
}
}
| Redcode | 2 | VLiance/GZE | UnitTest/String/src_(Demo)/Test.cw | [
"Apache-2.0"
] |
-include ../tools.mk
# Checks that all the targets returned by `rustc --print target-list` are valid
# target specifications
all:
for target in $(shell $(BARE_RUSTC) --print target-list); do \
$(BARE_RUSTC) --target $$target --print sysroot; \
done
| Makefile | 4 | Eric-Arellano/rust | src/test/run-make-fulldeps/print-target-list/Makefile | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] |
# This file is distributed under the same license as the Django package.
#
# Translators:
# Michael Wolf <[email protected]>, 2016
msgid ""
msgstr ""
"Project-Id-Version: django\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-01-17 11:07+0100\n"
"PO-Revision-Date: 2017-09-23 00:02+0000\n"
"Last-Translator: Michael Wolf <[email protected]>\n"
"Language-Team: Lower Sorbian (http://www.transifex.com/django/django/"
"language/dsb/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: dsb\n"
"Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n"
"%100==4 ? 2 : 3);\n"
msgid "Sites"
msgstr "Sedła"
msgid "The domain name cannot contain any spaces or tabs."
msgstr "Domenowe mě njamóžo prozne znamjenja abo tabulatory wopśimowaś."
msgid "domain name"
msgstr "domenowe mě"
msgid "display name"
msgstr "zwobraznjeńske mě"
msgid "site"
msgstr "sedło"
msgid "sites"
msgstr "sedła"
| Gettext Catalog | 3 | jpmallarino/django | django/contrib/sites/locale/dsb/LC_MESSAGES/django.po | [
"BSD-3-Clause",
"0BSD"
] |
---
layout: post
title: 基础
next: basics2.textile
---
课程内容:
* "关于这节课":#overview
* "表达式":#expressions
* "值":#val
* "函数":#functions
* "类":#class
* "继承":#extends
* "特质":#trait
* "类型":#types
h2(#overview). 关于这节课
最初的几个星期将涵盖基本语法和概念,然后我们将通过更多的练习展开这些内容。
有一些例子是以解释器交互的形式给出的,另一些则是以源文件的形式给出的。
安装一个解释器,可以使探索问题空间变得更容易。
h3. 为什么选择 Scala?
* 表达能力
** 函数是一等公民
** 闭包
* 简洁
** 类型推断
** 函数创建的文法支持
* Java互操作性
** 可重用Java库
** 可重用Java工具
** 没有性能惩罚
h3. Scala 如何工作?
* 编译成Java字节码
* 可在任何标准JVM上运行
** 甚至是一些不规范的JVM上,如Dalvik
** Scala编译器是Java编译器的作者写的
h3. 用 Scala 思考
Scala不仅仅是更好的Java。你应该用全新的头脑来学习它,你会从这些课程中认识到这一点的。
h3. 启动解释器
使用自带的<code>sbt console</code>启动。
<pre>
$ sbt console
[...]
Welcome to Scala version 2.8.0.final (Java HotSpot(TM) 64-Bit Server VM, Java 1.6.0_20).
Type in expressions to have them evaluated.
Type :help for more information.
scala>
</pre>
h2(#expressions). 表达式
<pre>
scala> 1 + 1
res0: Int = 2
</pre>
res0是解释器自动创建的变量名称,用来指代表达式的计算结果。它是Int类型,值为2。
Scala中(几乎)一切都是表达式。
h2(#val). 值
你可以给一个表达式的结果起个名字赋成一个不变量(val)。
<pre>
scala> val two = 1 + 1
two: Int = 2
</pre>
你不能改变这个不变量的值.
h3. 变量
如果你需要修改这个名称和结果的绑定,可以选择使用<code>var</code>。
<pre>
scala> var name = "steve"
name: java.lang.String = steve
scala> name = "marius"
name: java.lang.String = marius
</pre>
h2(#functions). 函数
你可以使用def创建函数.
<pre>
scala> def addOne(m: Int): Int = m + 1
addOne: (m: Int)Int
</pre>
在Scala中,你需要为函数参数指定类型签名。
<pre>
scala> val three = addOne(2)
three: Int = 3
</pre>
如果函数不带参数,你可以不写括号。
<pre>
scala> def three() = 1 + 2
three: ()Int
scala> three()
res2: Int = 3
scala> three
res3: Int = 3
</pre>
h3. 匿名函数
你可以创建匿名函数。
<pre>
scala> (x: Int) => x + 1
res2: (Int) => Int = <function1>
</pre>
这个函数为名为x的Int变量加1。
<pre>
scala> res2(1)
res3: Int = 2
</pre>
你可以传递匿名函数,或将其保存成不变量。
<pre>
scala> val addOne = (x: Int) => x + 1
addOne: (Int) => Int = <function1>
scala> addOne(1)
res4: Int = 2
</pre>
如果你的函数有很多表达式,可以使用{}来格式化代码,使之易读。
<pre>
def timesTwo(i: Int): Int = {
println("hello world")
i * 2
}
</pre>
对匿名函数也是这样的。
<pre>
scala> { i: Int =>
println("hello world")
i * 2
}
res0: (Int) => Int = <function1>
</pre>
在将一个匿名函数作为参数进行传递时,这个语法会经常被用到。
h3. 部分应用(Partial application)
你可以使用下划线“_”部分应用一个函数,结果将得到另一个函数。Scala使用下划线表示不同上下文中的不同事物,你通常可以把它看作是一个没有命名的神奇通配符。在<code>{ _ + 2 }</code>的上下文中,它代表一个匿名参数。你可以这样使用它:
<pre>
scala> def adder(m: Int, n: Int) = m + n
adder: (m: Int,n: Int)Int
</pre>
<pre>
scala> val add2 = adder(2, _:Int)
add2: (Int) => Int = <function1>
scala> add2(3)
res50: Int = 5
</pre>
你可以部分应用参数列表中的任意参数,而不仅仅是最后一个。
h3. 柯里化函数
有时会有这样的需求:允许别人一会在你的函数上应用一些参数,然后又应用另外的一些参数。
例如一个乘法函数,在一个场景需要选择乘数,而另一个场景需要选择被乘数。
<pre>
scala> def multiply(m: Int)(n: Int): Int = m * n
multiply: (m: Int)(n: Int)Int
</pre>
你可以直接传入两个参数。
<pre>
scala> multiply(2)(3)
res0: Int = 6
</pre>
你可以填上第一个参数并且部分应用第二个参数。
<pre>
scala> val timesTwo = multiply(2) _
timesTwo: (Int) => Int = <function1>
scala> timesTwo(3)
res1: Int = 6
</pre>
你可以对任何多参数函数执行柯里化。例如之前的<code>adder</code>函数
<pre>
scala> (adder _).curried
res1: (Int) => (Int) => Int = <function1>
</pre>
h3. 可变长度参数
这是一个特殊的语法,可以向方法传入任意多个同类型的参数。例如要在多个字符串上执行String的<code>capitalize</code>函数,可以这样写:
<pre>
def capitalizeAll(args: String*) = {
args.map { arg =>
arg.capitalize
}
}
scala> capitalizeAll("rarity", "applejack")
res2: Seq[String] = ArrayBuffer(Rarity, Applejack)
</pre>
h2(#class). 类
<pre>
scala> class Calculator {
| val brand: String = "HP"
| def add(m: Int, n: Int): Int = m + n
| }
defined class Calculator
scala> val calc = new Calculator
calc: Calculator = Calculator@e75a11
scala> calc.add(1, 2)
res1: Int = 3
scala> calc.brand
res2: String = "HP"
</pre>
上面的例子展示了如何在类中用def定义方法和用val定义字段值。方法就是可以访问类的状态的函数。
h3. 构造函数
构造函数不是特殊的方法,他们是除了类的方法定义之外的代码。让我们扩展计算器的例子,增加一个构造函数参数,并用它来初始化内部状态。
<pre>
class Calculator(brand: String) {
/**
* A constructor.
*/
val color: String = if (brand == "TI") {
"blue"
} else if (brand == "HP") {
"black"
} else {
"white"
}
// An instance method.
def add(m: Int, n: Int): Int = m + n
}
</pre>
注意两种不同风格的注释。
你可以使用构造函数来构造一个实例:
<pre>
scala> val calc = new Calculator("HP")
calc: Calculator = Calculator@1e64cc4d
scala> calc.color
res0: String = black
</pre>
h3. 表达式
上文的Calculator例子说明了Scala是如何面向表达式的。颜色的值就是绑定在一个if/else表达式上的。Scala是高度面向表达式的:大多数东西都是表达式而非指令。
h3. 旁白: 函数 vs 方法
函数和方法在很大程度上是可以互换的。由于函数和方法是如此的相似,你可能都不知道你调用的<em>东西</em>是一个函数还是一个方法。而当真正碰到的方法和函数之间的差异的时候,你可能会感到困惑。
<pre>
scala> class C {
| var acc = 0
| def minc = { acc += 1 }
| val finc = { () => acc += 1 }
| }
defined class C
scala> val c = new C
c: C = C@1af1bd6
scala> c.minc // calls c.minc()
scala> c.finc // returns the function as a value:
res2: () => Unit = <function0>
</pre>
当你可以调用一个不带括号的“函数”,但是对另一个却必须加上括号的时候,你可能会想<em>哎呀,我还以为自己知道Scala是怎么工作的呢。也许他们有时需要括号?</em>你可能以为自己用的是函数,但实际使用的是方法。
在实践中,即使不理解方法和函数上的区别,你也可以用Scala做伟大的事情。如果你是Scala新手,而且在读<a href="https://www.google.com/search?q=difference+scala+function+method">两者的差异解释</a>,你可能会跟不上。不过这并不意味着你在使用Scala上有麻烦。它只是意味着函数和方法之间的差异是很微妙的,只有深入语言内部才能清楚理解它。
h2(#extends). 继承
<pre>
class ScientificCalculator(brand: String) extends Calculator(brand) {
def log(m: Double, base: Double) = math.log(m) / math.log(base)
}
</pre>
*参考* Effective Scala 指出如果子类与父类实际上没有区别,<a href="https://twitter.github.com/effectivescala/#Types%20and%20Generics-Type%20aliases">类型别名</a>是优于<code>继承</code>的。A Tour of Scala 详细介绍了<a href="https://www.scala-lang.org/node/125">子类化</a>。
h3. 重载方法
<pre>
class EvenMoreScientificCalculator(brand: String) extends ScientificCalculator(brand) {
def log(m: Int): Double = log(m, math.exp(1))
}
</pre>
h3. 抽象类
你可以定义一个<em>抽象类</em>,它定义了一些方法但没有实现它们。取而代之是由扩展抽象类的子类定义这些方法。你不能创建抽象类的实例。
<pre>
scala> abstract class Shape {
| def getArea():Int // subclass should define this
| }
defined class Shape
scala> class Circle(r: Int) extends Shape {
| def getArea():Int = { r * r * 3 }
| }
defined class Circle
scala> val s = new Shape
<console>:8: error: class Shape is abstract; cannot be instantiated
val s = new Shape
^
scala> val c = new Circle(2)
c: Circle = Circle@65c0035b
</pre>
h2(#trait). 特质(Traits)
<code>特质</code>是一些字段和行为的集合,可以扩展或混入(mixin)你的类中。
<pre>
trait Car {
val brand: String
}
trait Shiny {
val shineRefraction: Int
}
</pre>
<pre>
class BMW extends Car {
val brand = "BMW"
}
</pre>
通过<code>with</code>关键字,一个类可以扩展多个特质:
<pre>
class BMW extends Car with Shiny {
val brand = "BMW"
val shineRefraction = 12
}
</pre>
*参考* Effective Scala 对<a href="https://twitter.github.com/effectivescala/#Object oriented programming-Traits">特质的观点</a>。
*什么时候应该使用特质而不是抽象类?* 如果你想定义一个类似接口的类型,你可能会在特质和抽象类之间难以取舍。这两种形式都可以让你定义一个类型的一些行为,并要求继承者定义一些其他行为。一些经验法则:
<ul>
<li>优先使用特质。一个类扩展多个特质是很方便的,但却只能扩展一个抽象类。
<li>如果你需要构造函数参数,使用抽象类。因为抽象类可以定义带参数的构造函数,而特质不行。例如,你不能说<code>trait t(i: Int) {}</code>,参数<code>i</code>是非法的。
</ul>
你不是问这个问题的第一人。可以查看更全面的答案: "stackoverflow: Scala特质 vs 抽象类":https://stackoverflow.com/questions/1991042/scala-traits-vs-abstract-classes , "抽象类和特质的区别":https://stackoverflow.com/questions/2005681/difference-between-abstract-class-and-trait, and "Scala编程: 用特质,还是不用特质?":https://www.artima.com/pins1ed/traits.html#12.7
h2(#types). 类型
此前,我们定义了一个函数的参数为<code>Int</code>,表示输入是一个数字类型。其实函数也可以是泛型的,来适用于所有类型。当这种情况发生时,你会看到用方括号语法引入的类型参数。下面的例子展示了一个使用泛型键和值的缓存。
<pre>
trait Cache[K, V] {
def get(key: K): V
def put(key: K, value: V)
def delete(key: K)
}
</pre>
方法也可以引入类型参数。
<pre>
def remove[K](key: K)
</pre>
| Textile | 5 | AstronomiaDev/scala_school | web/zh_cn/basics.textile | [
"Apache-2.0"
] |
<http://a.example/s> <http://a.example/p> "chat"@en-us .
| Turtle | 0 | joshrose/audacity | lib-src/lv2/serd/tests/TurtleTests/lantag_with_subtag.ttl | [
"CC-BY-3.0"
] |
@program quellwarn.muf
1 1000 d
i
( quellwarn.muf by Natasha@HLM
Warns wizards that they're unquelled.
Thrust into the public domain this First of November, 2002.
)
$iflib $lib/dotcom $include $lib/dotcom $endif
$def val_delay 300 (five minutes)
: main ( -- )
background
{ #-1 begin #-1 "" "pw" findnext dup ok? while
dup
repeat pop }list var! wizards
0 array_make var! warned
1 var! delay
begin 1 while
delay @ sleep
0 array_make warned !
wizards @ foreach swap pop
dup awake? over "wizard" flag? and if ( db )
( Warn. )
dup "You are unquelled." .notifywarn ( db )
warned @ array_appenditem warned ! ( )
else pop then ( )
repeat ( )
( Did we warn during this round? )
warned @ if
( Yes. Delay the next scan. )
val_delay delay !
$iflib $lib/dotcom
warned @ ( arr )
dup array_count 1 = if
0 array_getitem "\[[1m%D is unquelled." fmtstring
else
{ swap foreach swap pop name repeat }list
" and " array_join
"\[[1m%s are unquelled." fmtstring
then
"WizChat" dotcom-say ( )
$endif
else
1 delay !
then ( )
repeat ( )
;
.
c
q
@set quellw=a
@chown quellw=hlm
| MUF | 5 | natmeox/hlm-suite | quellwarn.muf | [
"MIT"
] |
graph {
a--b
}
| Graphviz (DOT) | 0 | JesseVermeulen123/bat | tests/syntax-tests/source/Graphviz DOT/test_graph.dot | [
"Apache-2.0",
"MIT"
] |
h1. Textile document
h2. Heading Two
h3. A two-line
header
h2. Another two-line
header
Paragraph:
one, two,
thee lines!
p(classone two three). This is a paragraph with classes
p(#id). (one with an id)
p(one two three#my_id). ..classes + id
* Unordered list
** sublist
* back again!
** sublist again..
# ordered
bg. Blockquote!
This is a two-list blockquote..! | Textile | 2 | websharks/ace-builds | demo/kitchen-sink/docs/textile.textile | [
"BSD-3-Clause"
] |
package main
import (
"fmt"
)
type Baggins interface {
WearRing() bool
}
type Gollum interface {
Scowl() int
}
type hobbit struct {
hasRing bool
}
func (h *hobbit) WearRing() bool {
h.hasRing = !h.hasRing
return h.hasRing
}
type Wolf struct {
Claw int
HasRing bool
}
func (w *Wolf) Scowl() int {
w.Claw++
return w.Claw
}
func battle(g Gollum, b Baggins) (int, bool) {
return g.Scowl(), b.WearRing()
}
func tryTheTypeSwitch(i interface{}) int {
switch x := i.(type) {
case Gollum:
return x.Scowl()
case Baggins:
if x.WearRing() {
return 1
}
}
return 0
}
//func main() {
w := &Wolf{}
bilbo := &hobbit{}
i0, b0 := battle(w, bilbo)
i1, b1 := battle(w, bilbo)
fmt.Printf("i0=%v, b0=%v\n", i0, b0)
fmt.Printf("i1=%v, b1=%v\n", i1, b1)
fmt.Printf("tried wolf=%v\n", tryTheTypeSwitch(w))
fmt.Printf("tried bilbo=%v\n", tryTheTypeSwitch(bilbo))
//}
/*
i0=1, b0=true
i1=2, b1=false
tried wolf=3
tried bilbo=1
*/
| GAP | 5 | gijit/gi-minimal | pkg/compiler/attic/bilbo.gi | [
"MIT"
] |
# Copywrite (C) 2015 Jan Vaillant <[email protected]>
# Licensed under the MIT licence
# LP implementation of TMR problem
# For simplicity we assume one cow in each group
# The concentrate fill value (FVC) has been estimated with dairy.js (dairy.intake.FV_cs_diet)
# and is corrected by 0.05 (the average overestimation we find when calculating diets
# using dairy.js forage database)
# solved with scip 3.1.0 (64bit)
# build with gcc 4.7.2 including Ipopt 3.11.9 and coinhsl 2014.01.10
#
# solution status: optimal solution found
# objective value: -0.105761941317059
# surplus#1$P 0.0860620000740139 (obj:-1)
# surplus#2$P 0.019699941243044 (obj:-1)
# kg#1$GS 11.3069132606174 (obj:0)
# kg#1$MS 2.5 (obj:0)
# kg#1$WH 0.905509307086318 (obj:0)
# kg#2$GS 11.6612109662645 (obj:0)
# kg#2$WH 4.60677801244548 (obj:0)
set Feeds := { "GS", "MS", "SY", "WH" };
set Nutrients := { "E", "P"};
set FeedAttributes := Nutrients + { "RNB", "FV", "isCC" };
set Groups := { 1, 2 }; # one 'focus cow' in each group
set CowAttributes := { "PLPOT", "IC", "E", "P", "parity", "BWC", "FVC"};
param feed_data[Feeds * FeedAttributes] :=
|"E" , "P" , "RNB", "FV" , "isCC"|
|"GS"| 6.10, 135.0, 3 , 1.061, 0 |
|"MS"| 7.20, 138.0, -11 , 0.911, 0 |
|"SY"| 9.90, 250.0, 24 , 0 , 1 |
|"WH"| 8.50, 170.0, -5 , 0 , 1 |;
# (NEL) (uCP) (N) (UEL) (bool)
param cow_data[Groups * CowAttributes] :=
|"PLPOT", "IC" , "E" , "P" , "parity", "BWC" , "FVC" |
|1|15.899 , 14.676, 94.669 , 1864.875, 1 , 0.201, (0.4938-0.05)|
|2|25.346 , 14.517, 110.291, 2311.872, 2 , -0.347, (0.5155-0.05)|;
# (kg) (UEL) (NEL) (uCP) (#) (kg) (UEL)
param max_c[Groups] := <1> 0.4, <2> 0.4; # max. fraction of concentrate in diet [DM DM-1]
param weight_n[Groups * Nutrients] := <1,"E"> 10, <1,"P"> 1, <2,"E"> 10, <2,"P"> 1;
set Concentrates := { <f> in Feeds with feed_data[f, "isCC"] > 0 };
set Forages := { Feeds \ Concentrates };
var surplus[Groups * Nutrients] real;
var deficit[Groups * Nutrients] real;
var kg[Groups * Feeds] real;
maximize satisfaction: sum <c,n> in Groups * Nutrients:
weight_n[c, n] * -(surplus[c,n] + deficit[c,n]);
subto need: forall <c,n> in Groups * Nutrients do
sum <f> in Feeds: feed_data[f,n] / cow_data[c,n] * kg[c,f] - surplus[c,n] + deficit[c,n] == 1;
subto intake: forall <c> in Groups do
sum <fr> in Forages:
feed_data[fr, "FV"] * kg[c,fr] +
sum <k> in Concentrates:
cow_data[c, "FVC"] * kg[c,k]
== cow_data[c,"IC"];
subto rnb: forall <c> in Groups do
0 <= sum <f> in Feeds: feed_data[f, "RNB"] * kg[c,f] <= 50;
subto conc_max: forall <c> in Groups do
sum <k> in Concentrates:
(1 - max_c[c]) / max_c[c] * kg[c,k] -
sum <fr> in Forages:
kg[c,fr]
<= 0;
subto max_ms: sum <c> in Groups:
kg[c,"MS"] <= 2.5;
| Zimpl | 5 | jvail/diet | tmr_lp_two_groups.zpl | [
"MIT"
] |
Rebol [
Title: "Transaction-based HTTP(S) Protocol"
Author: "Christopher Ross-Gill"
Date: 5-Jun-2017
Home: http://ross-gill.com/page/REST_Protocol
File: %rest.reb
Version: 0.0.2
Purpose: {Minimal HTTP(S) scheme with elemental Request/Response model}
Rights: http://opensource.org/licenses/Apache-2.0
Type: module
Name: rgchris.rest
Needs: [
<webform> ; %../ren-c/altwebform.reb
<curl> ; %../experimental/curl.reb
]
Usage: [
read [
scheme: rest
url: http://www.ross-gill.com/
]
write [
scheme: rest
method: post
type: text/html
url: http://somewhere-to-write/target
][
some data
]
]
]
use [prepare fetch transcribe][
prepare: use [
request-prototype header-prototype
oauth-credentials oauth-prototype
sign
][
request-prototype: make object! [
version: 1.1
action: headers: query: _
oauth: target: content: length: timeout: _
type: 'application/x-www-form-urlencoded
]
header-prototype: make object! [
Accept: "*/*"
Connection: "close"
User-Agent: rejoin ["Rebol/" system/product " " system/version]
Content-Length: Content-Type: Authorization: Range: _
]
oauth-credentials: make object! [
consumer-key: consumer-secret:
oauth-token: oauth-token-secret:
oauth-callback: _
]
oauth-prototype: make object! [
oauth_callback: _
oauth_consumer_key: _
oauth_token: oauth_nonce: _
oauth_signature_method: "HMAC-SHA1"
oauth_timestamp: _
oauth_version: 1.0
oauth_verifier: oauth_signature: _
]
sign: func [request [object!] /local header params timestamp out][
out: make string! 0
timestamp: now/precise
header: make oauth-prototype [
oauth_consumer_key: request/oauth/consumer-key
oauth_token: request/oauth/oauth-token
oauth_callback: request/oauth/oauth-callback
oauth_nonce: enbase/base checksum/secure to binary! unspaced [now/precise oauth_consumer_key] 64
oauth_timestamp: form any [
attempt [to integer! difference timestamp 1-Jan-1970/0:0:0]
timestamp - 1-Jan-1970/0:0:0 * 86400.0
]
clear find/last oauth_timestamp "."
]
params: make header any [request/content []]
params: sort/skip body-of params 2
header/oauth_signature: enbase/base checksum/secure/key to binary! unspaced [
uppercase form request/action "&" url-encode form request/url "&"
url-encode replace/all to-webform params "+" "%20"
] to binary! unspaced [
request/oauth/consumer-secret "&" any [request/oauth/oauth-token-secret ""]
] 64
foreach [name value] body-of header [
if value [
repend out [", " spelling-of name {="} url-encode form value {"}]
]
]
switch request/action [
"GET" [
if request/content [
request/url: join-of request/url to-webform/prefix request/content
request/content: _
]
]
"POST" "PUT" [
request/content: to-webform any [request/content []]
request/headers/Content-Type: "application/x-www-form-urlencoded"
]
]
request/headers/Authorization: join-of "OAuth" next out
]
prepare: func [port [port!] /with content /local request url][
port/locals/request: request: make request-prototype compose port/locals/request
request/content: any [:content _]
request/action: uppercase form any [
get in request 'action
either request/content ["POST"]["GET"]
]
request/headers: make header-prototype any [request/headers []]
either request/oauth [
request/oauth: make oauth-credentials request/oauth
sign request
][
request/headers/Authorization: any [
request/headers/authorization
if all [port/spec/user port/spec/pass][
join-of "Basic " enbase join-of port/spec/user [#":" port/spec/pass]
]
]
]
; if port/state/index > 0 [
; request/version: 1.1
; request/headers/Range: rejoin ["bytes=" port/state/index "-"]
; ]
case/all [
block? request/content [
request/content: to-webform request/content
request/headers/Content-Type: "application/x-www-form-urlencoded"
]
string? request/content [
request/length: length? request/content
request/headers/Content-Length: length? request/content
request/headers/Content-Type: request/type
]
]
port
]
]
fetch: func [port [port!]][
port/locals/request
curl/full/method/header/send/timeout/into ; url action headers content response
port/locals/request/url
port/locals/request/action
port/locals/request/headers
port/locals/request/content
port/locals/request/timeout
port/locals/response
]
transcribe: use [
response-code space header-feed header-name header-part
response-prototype header-prototype
][
response-code: use [digit][
digit: charset "0123456789"
[3 digit]
]
header-feed: [newline | crlf]
header-part: use [chars][
chars: complement charset [#"^(00)" - #"^(1F)"]
[some chars any [header-feed some " " some chars]]
]
header-name: use [chars][
chars: charset ["_-0123456789" #"a" - #"z" #"A" - #"Z"]
[some chars]
]
space: use [space][
space: charset " ^-"
[some space]
]
response-prototype: context [
status: message: http-headers: headers: content: binary: type: length: _
]
header-prototype: context [
Date: Server: Last-Modified: Accept-Ranges: Content-Encoding: Content-Type:
Content-Length: Location: Expires: Referer: Connection: Authorization: _
]
transcribe: func [port [port!] /local response name value pos][
port/locals/response: response: make response-prototype [
unless parse port/locals/response [
"HTTP/" [
"1." ["0" | "1"] space copy status response-code
space copy message header-part
|
"2" space copy status response-code (message: _)
opt [space opt [copy message header-part]]
] header-feed
(
status: load status
headers: make block! []
message: either empty? any [message ""][_][
to string! message
]
)
some [
copy name header-name #":" any #" "
copy value header-part header-feed
(repend headers [to set-word! to string! name to string! value])
]
header-feed content: to end (
content: to string! binary: copy content
)
| pos: fail
][
do make error! "Could Not Parse Response"
]
headers: make header-prototype http-headers: new-line/skip headers true 2
type: all [
path? type: attempt [load headers/Content-Type]
type
]
length: any [attempt [headers/Content-Length: to integer! headers/Content-Length] 0]
]
]
]
sys/make-scheme [
Title: "Service-oriented HTTP Protocol"
Name: 'rest
Spec: make object! [title: url: ref: user: pass: _]
Init: func [port [port!] /local url][
port/locals: make object! [
request: case/all [
url? port/spec/ref [
port/spec/ref: compose [
url: (to url! replace form port/spec/ref rest:// https://)
]
]
block? port/spec/ref [
unless url: case/all [
get-word? url: pick find compose port/spec/ref quote url: 2 [
url: get :url
]
url? url [url]
][
return make error! "REST spec needs a URL"
]
unless parse url ["http" opt "s" "://" to end] [
return make error! "REST only supports HTTP(S) URLs"
]
port/spec/ref
]
]
response: make binary! 0
]
; do make error! "Not Finished Yet."
]
Actor: [
read: func [port [port!]][
prepare port
fetch port
transcribe port
]
write: func [port [port!] content [any-value!]][
probe content
prepare/with port :content
fetch port
transcribe port
]
]
]
]
| Rebol | 4 | hostilefork/rgchris-scripts | experimental/rest.reb | [
"Apache-2.0"
] |
0 reg32_t "dword"
1 code_t "proc*"
2 num32_t "int"
3 uint32_t "size_t"
4 ptr(struct(0:num32_t,4:ptr(num8_t),8:ptr(num8_t),12:ptr(num8_t),16:ptr(num8_t),20:ptr(num8_t),24:ptr(num8_t),28:ptr(num8_t),32:ptr(num8_t),36:ptr(num8_t),40:ptr(num8_t),44:ptr(num8_t),48:ptr(struct(0:ptr(TOP),4:ptr(struct(0:num32_t,4:ptr(reg8_t),8:ptr(reg8_t),12:ptr(reg8_t),16:ptr(reg8_t),20:ptr(reg8_t),24:ptr(reg8_t),28:ptr(reg8_t),32:ptr(reg8_t),36:ptr(reg8_t),40:ptr(reg8_t),44:ptr(reg8_t),48:ptr(TOP),52:ptr(TOP),56:num32_t,60:num32_t,64:num32_t,68:uint16_t,70:int8_t,71:array(num8_t,1),72:ptr(TOP),76:num64_t,84:ptr(TOP),88:ptr(TOP),92:ptr(TOP),96:ptr(TOP),100:uint32_t,104:num32_t,108:array(num8_t,40))),8:num32_t)),52:ptr(struct(0:num32_t,4:ptr(num8_t),8:ptr(num8_t),12:ptr(num8_t),16:ptr(num8_t),20:ptr(num8_t),24:ptr(num8_t),28:ptr(num8_t),32:ptr(num8_t),36:ptr(num8_t),40:ptr(num8_t),44:ptr(num8_t),48:ptr(struct(0:ptr(TOP),4:ptr(TOP),8:num32_t)),52:ptr(TOP),56:num32_t,60:num32_t,64:num32_t,68:uint16_t,70:int8_t,71:array(num8_t,1),72:ptr(TOP),76:num64_t,84:ptr(TOP),88:ptr(TOP),92:ptr(TOP),96:ptr(TOP),100:uint32_t,104:num32_t,108:array(num8_t,40))),56:num32_t,60:num32_t,64:num32_t,68:uint16_t,70:int8_t,71:array(num8_t,1),72:ptr(TOP),76:num64_t,84:ptr(TOP),88:ptr(TOP),92:ptr(TOP),96:ptr(TOP),100:uint32_t,104:num32_t,108:array(num8_t,40))) "FILE*"
5 ptr(num8_t) "char*"
6 ptr(TOP) "void*"
7 num8_t "char"
3 uint32_t "unsigned int"
8 union(ptr(num8_t),uint32_t) "Union_1"
9 ptr(ptr(num8_t)) "char**"
10 ptr(array(reg8_t,16)) "unknown_128*"
11 ptr(array(reg8_t,56)) "unknown_448*"
12 ptr(array(reg8_t,119)) "unknown_952*"
13 ptr(reg64_t) "qword*"
14 ptr(struct(0:reg64_t,8:reg32_t)) "StructFrag_16*"
15 ptr(array(reg8_t,42)) "unknown_336*"
16 reg16_t "word"
17 int32_t "signed int"
18 ptr(reg32_t) "dword*"
19 ptr(num32_t) "int*"
20 union(ptr(num8_t),ptr(struct(0:reg16_t,2:num8_t))) "Union_0"
18 ptr(reg32_t) "dword[]"
21 reg64_t "qword"
22 num64_t "long long"
23 array(reg8_t,10) "unknown_80"
24 float80_t "long double"
5 ptr(num8_t) "char[]"
25 ptr(struct(0:num32_t,4:ptr(ptr(num8_t)),4294967292:reg32_t)) "Struct_3*"
26 ptr(struct(0:ptr(num8_t),4:num32_t,8:ptr(num32_t),12:num32_t)) "option*"
27 ptr(struct(0:reg32_t,40:ptr(num8_t),44:ptr(num8_t))) "Struct_1*"
28 ptr(uint32_t) "size_t*"
29 ptr(struct(0:reg32_t,4:ptr(TOP))) "Struct_0*"
30 ptr(struct(0:num32_t,4:reg32_t,40:ptr(num8_t),44:ptr(num8_t))) "Struct_9*"
31 ptr(struct(0:array(reg8_t,18),18:num8_t)) "StructFrag_3*"
32 ptr(struct(0:array(reg8_t,3),3:num8_t)) "StructFrag_13*"
28 ptr(uint32_t) "unsigned int*"
33 uint64_t "unsigned long long"
19 ptr(num32_t) "int[]"
2 num32_t "__ssize_t"
34 ptr(struct(0:ptr(num8_t),4:ptr(num8_t),8:ptr(num8_t),12:ptr(num8_t),16:ptr(num8_t),20:ptr(num8_t),24:ptr(num8_t),28:ptr(num8_t),32:ptr(num8_t),36:ptr(num8_t),40:num8_t,41:num8_t,42:num8_t,43:num8_t,44:num8_t,45:num8_t,46:num8_t,47:num8_t,48:num8_t,49:num8_t,50:num8_t,51:num8_t,52:num8_t,53:num8_t)) "lconv*"
35 ptr(ptr(uint16_t)) "unsigned short**"
36 ptr(struct(0:reg64_t,8:num8_t)) "StructFrag_11*"
37 ptr(ptr(TOP)) "void**"
38 ptr(struct(0:num32_t,4:uint32_t,40:ptr(num8_t),44:ptr(num8_t))) "Struct_12*"
39 ptr(struct(0:num32_t,40:ptr(num8_t),44:ptr(num8_t))) "Struct_11*"
40 ptr(reg16_t) "word[]"
41 ptr(uint16_t) "unsigned short*"
42 ptr(struct(0:array(reg8_t,75306),75306:reg32_t)) "StructFrag_6*"
43 ptr(struct(0:array(reg8_t,536870908),4294967292:reg32_t)) "StructFrag_7*"
44 ptr(struct(0:array(reg8_t,35676),35676:reg32_t)) "StructFrag_9*"
45 ptr(struct(0:array(reg8_t,584),584:reg32_t)) "StructFrag_10*"
46 ptr(array(reg8_t,46)) "unknown_368*"
47 ptr(struct(0:uint32_t,4:ptr(TOP))) "Struct_10*"
48 ptr(struct(0:reg64_t,8:uint32_t)) "StructFrag_12*"
49 array(reg8_t,4096) "unknown_32768"
50 array(reg8_t,135168) "unknown_1081344"
51 array(reg8_t,30) "unknown_240"
52 array(reg8_t,5) "unknown_40"
53 array(reg8_t,29) "unknown_232"
54 array(reg8_t,16) "unknown_128"
55 array(reg8_t,119) "unknown_952"
56 array(reg8_t,56) "unknown_448"
57 array(reg8_t,7) "unknown_56"
58 array(reg8_t,57) "unknown_456"
59 array(reg8_t,21) "unknown_168"
60 array(reg8_t,23) "unknown_184"
61 array(reg8_t,9) "unknown_72"
62 array(reg8_t,18) "unknown_144"
63 array(reg8_t,47) "unknown_376"
64 array(reg8_t,41) "unknown_328"
65 array(reg8_t,51) "unknown_408"
66 array(reg8_t,13) "unknown_104"
67 array(reg8_t,32) "unknown_256"
68 array(reg8_t,46) "unknown_368"
69 array(reg8_t,33) "unknown_264"
70 array(reg8_t,39) "unknown_312"
71 array(reg8_t,27) "unknown_216"
72 array(reg8_t,80) "unknown_640"
73 array(reg8_t,24) "unknown_192"
74 array(reg8_t,17) "unknown_136"
75 array(reg8_t,35) "unknown_280"
76 array(reg8_t,11) "unknown_88"
77 array(reg8_t,64) "unknown_512"
78 array(reg8_t,77) "unknown_616"
79 array(reg8_t,31) "unknown_248"
80 array(reg8_t,42) "unknown_336"
81 array(reg8_t,40) "unknown_320"
82 array(reg8_t,52) "unknown_416"
83 array(reg8_t,15) "unknown_120"
84 array(reg8_t,12) "unknown_96"
85 array(reg8_t,236) "unknown_1888"
86 array(reg8_t,53) "unknown_424"
87 array(reg8_t,50) "unknown_400"
88 array(reg8_t,66) "unknown_528"
89 array(reg8_t,14) "unknown_112"
90 array(reg8_t,20) "unknown_160"
91 array(reg8_t,43) "unknown_344"
92 array(reg8_t,258) "unknown_2064"
93 array(reg8_t,26) "unknown_208"
94 array(reg8_t,28) "unknown_224"
95 array(reg8_t,96) "unknown_768"
96 array(reg8_t,19) "unknown_152"
97 array(reg8_t,203) "unknown_1624"
98 array(reg8_t,81) "unknown_648"
99 array(reg8_t,22) "unknown_176"
100 array(reg8_t,44) "unknown_352"
101 array(reg8_t,123) "unknown_984"
102 array(reg8_t,37) "unknown_296"
103 array(reg8_t,104) "unknown_832"
104 array(reg8_t,110) "unknown_880"
105 array(reg8_t,84) "unknown_672"
106 array(reg8_t,48) "unknown_384"
107 array(reg8_t,34) "unknown_272"
108 array(reg8_t,147) "unknown_1176"
109 array(reg8_t,112) "unknown_896"
110 array(reg8_t,109) "unknown_872"
111 array(reg8_t,45) "unknown_360"
112 array(reg8_t,62) "unknown_496"
113 array(reg8_t,74) "unknown_592"
114 array(reg8_t,25) "unknown_200"
115 array(reg8_t,3) "unknown_24"
116 array(reg8_t,38) "unknown_304"
117 array(reg8_t,90) "unknown_720"
118 array(reg8_t,6) "unknown_48"
119 array(reg8_t,87) "unknown_696"
120 array(reg8_t,162) "unknown_1296"
121 array(reg8_t,176) "unknown_1408"
122 array(reg8_t,160) "unknown_1280"
123 array(reg8_t,61) "unknown_488"
124 array(reg8_t,83) "unknown_664"
125 array(reg8_t,60) "unknown_480"
126 array(reg8_t,65) "unknown_520"
127 array(reg8_t,36) "unknown_288"
128 array(reg8_t,58) "unknown_464"
129 array(reg8_t,86) "unknown_688"
130 array(reg8_t,54) "unknown_432"
131 array(reg8_t,49) "unknown_392"
132 array(reg8_t,108) "unknown_864"
133 array(reg8_t,71) "unknown_568"
134 array(reg8_t,72) "unknown_576"
135 array(reg8_t,111) "unknown_888"
136 array(num8_t,6) "char[6]"
137 array(num8_t,9) "char[9]"
138 array(num8_t,23) "char[23]"
139 array(num8_t,10) "char[10]"
140 array(num8_t,4) "char[4]"
141 array(num8_t,16) "char[16]"
142 array(num8_t,18) "char[18]"
143 array(num8_t,3) "char[3]"
144 array(num8_t,39) "char[39]"
145 array(num8_t,33) "char[33]"
146 array(num8_t,171) "char[171]"
147 array(num8_t,45) "char[45]"
148 array(num8_t,54) "char[54]"
149 array(num8_t,56) "char[56]"
150 array(num8_t,69) "char[69]"
151 array(num8_t,65) "char[65]"
152 array(num8_t,87) "char[87]"
153 struct(0:ptr(num8_t),4:num32_t,8:ptr(num32_t),12:num32_t) "option"
154 array(num8_t,12) "char[12]"
155 array(num8_t,7) "char[7]"
156 array(num8_t,11) "char[11]"
157 float32_t "float"
158 float16_t "short float"
159 array(num8_t,8) "char[8]"
160 array(num8_t,2) "char[2]"
161 array(reg32_t,9) "dword[9]"
162 array(reg32_t,127) "dword[127]"
163 array(reg32_t,34) "dword[34]"
164 array(num8_t,28) "char[28]"
165 array(num8_t,21) "char[21]"
166 array(num8_t,22) "char[22]"
167 array(num8_t,20) "char[20]"
168 array(num8_t,203) "char[203]"
169 array(num8_t,32) "char[32]"
170 array(num8_t,36) "char[36]"
171 array(num8_t,40) "char[40]"
172 array(num8_t,44) "char[44]"
173 array(num8_t,48) "char[48]"
174 array(num8_t,52) "char[52]"
175 array(num8_t,60) "char[60]"
176 array(num8_t,64) "char[64]"
177 array(ptr(TOP),10) "void*[10]"
178 array(num8_t,47) "char[47]"
179 array(num8_t,17) "char[17]"
180 array(num8_t,14) "char[14]"
181 array(num8_t,38) "char[38]"
182 array(ptr(TOP),54) "void*[54]"
183 array(num8_t,27) "char[27]"
184 array(num8_t,29) "char[29]"
185 array(num8_t,5) "char[5]"
186 array(num8_t,78) "char[78]"
187 array(reg8_t,708) "unknown_5664"
188 array(reg8_t,7188) "unknown_57504"
189 array(reg8_t,5956) "unknown_47648"
1 code_t "(void -?-> dword)*"
190 array(reg8_t,232) "unknown_1856"
191 ptr(struct(0:reg16_t,2:num8_t)) "StructFrag_0*"
192 array(reg8_t,256) "unknown_2048"
| BlitzBasic | 1 | matt-noonan/retypd-data | data/sum.decls | [
"MIT"
] |
*** Settings ***
Suite Setup Run Tests ${EMPTY} keywords/wrapping_decorators.robot
Resource atest_resource.robot
*** Test Cases ***
Wrapped functions
Check Test Case ${TESTNAME}
Wrapped function with wrong number of arguments
Check Test Case ${TESTNAME}
Wrapped methods
Check Test Case ${TESTNAME}
Wrapped method with wrong number of arguments
Check Test Case ${TESTNAME}
| RobotFramework | 2 | rdagum/robotframework | atest/robot/keywords/wrapping_decorators.robot | [
"ECL-2.0",
"Apache-2.0"
] |
@app
dep-warn
@http
get /deps-in-lambda
get /deps-in-root
get /deps-in-shared
get /deps-found
get /deps-missing
| Arc | 3 | copperinc/sandbox | test/mock/dep-warn/basic/app.arc | [
"Apache-2.0"
] |
size: 2048px 1024px;
dpi: 240;
limit-y: -4 5;
limit-x: 0 1000;
points {
data-x: list(100 200 300 400 500 600 700 800 900);
data-y: list(-1.2 -1.8 -1.3 -1.6 -1.5 -1.3 -1.8 -1.9 -2.0);
shape: pentagon;
size: 8pt;
}
points {
data-x: list(100 200 300 400 500 600 700 800 900);
data-y: list(1.2 1.8 1.3 0.6 1.5 1.3 1.8 1.7 1.9);
shape: square-bullet;
size: 8pt;
}
| CLIPS | 2 | paulasmuth/fnordmetric | test/plot-points/markers_unicode.clp | [
"Apache-2.0"
] |
<?python
from textile import textile
from cgi import escape
?>
<div xmlns:py="http://purl.org/kid/ns#" id="recent-comments">
<ol>
<div py:strip="" py:for="comment in recent_comments">
<li>
<small class="commentmetadata">
<a href="/${site.name}/blog/post/${comment.post.permalink}#comment_${comment.id}">
${escape(comment.name)}
</a>said
${ XML(textile(escape(comment.short_text).encode('utf-8'), encoding='utf-8', output='utf-8')) }
</small>
</li>
</div>
</ol>
</div> | Genshi | 2 | CarlosGabaldon/calabro | calabro/widgets/templates/recent_comments.kid | [
"MIT"
] |
// MIR for `main` before ElaborateDrops
fn main() -> () {
let mut _0: (); // return place in scope 0 at $DIR/box_expr.rs:6:11: 6:11
let _1: std::boxed::Box<S>; // in scope 0 at $DIR/box_expr.rs:7:9: 7:10
let mut _2: usize; // in scope 0 at $DIR/box_expr.rs:7:13: 7:25
let mut _3: usize; // in scope 0 at $DIR/box_expr.rs:7:13: 7:25
let mut _4: *mut u8; // in scope 0 at $DIR/box_expr.rs:7:13: 7:25
let mut _5: std::boxed::Box<S>; // in scope 0 at $DIR/box_expr.rs:7:13: 7:25
let _6: (); // in scope 0 at $DIR/box_expr.rs:8:5: 8:12
let mut _7: std::boxed::Box<S>; // in scope 0 at $DIR/box_expr.rs:8:10: 8:11
scope 1 {
debug x => _1; // in scope 1 at $DIR/box_expr.rs:7:9: 7:10
}
scope 2 {
}
bb0: {
StorageLive(_1); // scope 0 at $DIR/box_expr.rs:7:9: 7:10
_2 = SizeOf(S); // scope 2 at $DIR/box_expr.rs:7:13: 7:25
_3 = AlignOf(S); // scope 2 at $DIR/box_expr.rs:7:13: 7:25
_4 = alloc::alloc::exchange_malloc(move _2, move _3) -> bb1; // scope 2 at $DIR/box_expr.rs:7:13: 7:25
// mir::Constant
// + span: $DIR/box_expr.rs:7:13: 7:25
// + literal: Const { ty: unsafe fn(usize, usize) -> *mut u8 {alloc::alloc::exchange_malloc}, val: Value(Scalar(<ZST>)) }
}
bb1: {
StorageLive(_5); // scope 0 at $DIR/box_expr.rs:7:13: 7:25
_5 = ShallowInitBox(move _4, S); // scope 0 at $DIR/box_expr.rs:7:13: 7:25
(*_5) = S::new() -> [return: bb2, unwind: bb8]; // scope 0 at $DIR/box_expr.rs:7:17: 7:25
// mir::Constant
// + span: $DIR/box_expr.rs:7:17: 7:23
// + literal: Const { ty: fn() -> S {S::new}, val: Value(Scalar(<ZST>)) }
}
bb2: {
_1 = move _5; // scope 0 at $DIR/box_expr.rs:7:13: 7:25
drop(_5) -> bb3; // scope 0 at $DIR/box_expr.rs:7:24: 7:25
}
bb3: {
StorageDead(_5); // scope 0 at $DIR/box_expr.rs:7:24: 7:25
StorageLive(_6); // scope 1 at $DIR/box_expr.rs:8:5: 8:12
StorageLive(_7); // scope 1 at $DIR/box_expr.rs:8:10: 8:11
_7 = move _1; // scope 1 at $DIR/box_expr.rs:8:10: 8:11
_6 = std::mem::drop::<Box<S>>(move _7) -> [return: bb4, unwind: bb6]; // scope 1 at $DIR/box_expr.rs:8:5: 8:12
// mir::Constant
// + span: $DIR/box_expr.rs:8:5: 8:9
// + literal: Const { ty: fn(std::boxed::Box<S>) {std::mem::drop::<std::boxed::Box<S>>}, val: Value(Scalar(<ZST>)) }
}
bb4: {
StorageDead(_7); // scope 1 at $DIR/box_expr.rs:8:11: 8:12
StorageDead(_6); // scope 1 at $DIR/box_expr.rs:8:12: 8:13
_0 = const (); // scope 0 at $DIR/box_expr.rs:6:11: 9:2
drop(_1) -> bb5; // scope 0 at $DIR/box_expr.rs:9:1: 9:2
}
bb5: {
StorageDead(_1); // scope 0 at $DIR/box_expr.rs:9:1: 9:2
return; // scope 0 at $DIR/box_expr.rs:9:2: 9:2
}
bb6 (cleanup): {
drop(_7) -> bb7; // scope 1 at $DIR/box_expr.rs:8:11: 8:12
}
bb7 (cleanup): {
drop(_1) -> bb9; // scope 0 at $DIR/box_expr.rs:9:1: 9:2
}
bb8 (cleanup): {
drop(_5) -> bb9; // scope 0 at $DIR/box_expr.rs:7:24: 7:25
}
bb9 (cleanup): {
resume; // scope 0 at $DIR/box_expr.rs:6:1: 9:2
}
}
| Mirah | 3 | david-perez/rust | src/test/mir-opt/box_expr.main.ElaborateDrops.before.mir | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] |
// @allowJs: true
// @checkJs: true
// @noEmit: true
// @strict: true
// @target: es6
// @filename: lateBoundAssignmentDeclarationSupport1.js
// currently unsupported
const _sym = Symbol();
const _str = "my-fake-sym";
exports[_sym] = "ok";
exports[_str] = "ok";
exports.S = _sym;
// @filename: usage.js
const x = require("./lateBoundAssignmentDeclarationSupport1.js");
const y = x["my-fake-sym"];
const z = x[x.S];
| TypeScript | 3 | monciego/TypeScript | tests/cases/conformance/salsa/lateBoundAssignmentDeclarationSupport1.ts | [
"Apache-2.0"
] |
AstraMagnetostatic 40
-3.0000000e-01 0.0000000e+00
-2.9800000e-01 2.9075045e-05
-2.9600000e-01 5.9367702e-05
-2.9400000e-01 9.0866460e-05
-2.9200000e-01 1.2374798e-04
-2.9000000e-01 1.5799850e-04
-2.8800000e-01 1.9377892e-04
-2.8600000e-01 2.3112877e-04
-2.8400000e-01 2.7014139e-04
-2.8200000e-01 3.1088083e-04
-2.8000000e-01 3.5359608e-04
-2.7800000e-01 3.9822382e-04
-2.7600000e-01 4.4500253e-04
-2.7400000e-01 4.9403154e-04
-2.7200000e-01 5.4545474e-04
-2.7000000e-01 5.9939124e-04
-2.6800000e-01 6.5610326e-04
-2.6600000e-01 7.1566965e-04
-2.6400000e-01 7.7835938e-04
-2.6200000e-01 8.4438516e-04
-2.6000000e-01 9.1389663e-04
-2.5800000e-01 9.8718554e-04
-2.5600000e-01 1.0645379e-03
-2.5400000e-01 1.1461817e-03
-2.5200000e-01 1.2325443e-03
-2.5000000e-01 1.3238477e-03
-2.4800000e-01 1.4205625e-03
-2.4600000e-01 1.5230723e-03
-2.4400000e-01 1.6318053e-03
-2.4200000e-01 1.7472857e-03
-2.4000000e-01 1.8699953e-03
-2.3800000e-01 2.0006220e-03
-2.3600000e-01 2.1397290e-03
-2.3400000e-01 2.2880970e-03
-2.3200000e-01 2.4464516e-03
-2.3000000e-01 2.6157186e-03
-2.2800000e-01 2.7967889e-03
-2.2600000e-01 2.9907735e-03
-2.2400000e-01 3.1987634e-03
-2.2200000e-01 3.4221574e-03
-2.2000000e-01 3.6621965e-03
-2.1800000e-01 3.9208202e-03
-2.1600000e-01 4.1994821e-03
-2.1400000e-01 4.5003818e-03
-2.1200000e-01 4.8255562e-03
-2.1000000e-01 5.1775876e-03
-2.0800000e-01 5.5592660e-03
-2.0600000e-01 5.9731564e-03
-2.0400000e-01 6.4241407e-03
-2.0200000e-01 6.9147611e-03
-2.0000000e-01 7.4506679e-03
-1.9800000e-01 8.0372709e-03
-1.9600000e-01 8.6796199e-03
-1.9400000e-01 9.3837728e-03
-1.9200000e-01 1.0157004e-02
-1.9000000e-01 1.1007598e-02
-1.8800000e-01 1.1944901e-02
-1.8600000e-01 1.2979796e-02
-1.8400000e-01 1.4124258e-02
-1.8200000e-01 1.5392354e-02
-1.8000000e-01 1.6799658e-02
-1.7800000e-01 1.8364302e-02
-1.7600000e-01 2.0106835e-02
-1.7400000e-01 2.2050575e-02
-1.7200000e-01 2.4222728e-02
-1.7000000e-01 2.6653397e-02
-1.6800000e-01 2.9377860e-02
-1.6600000e-01 3.2435001e-02
-1.6400000e-01 3.5869987e-02
-1.6200000e-01 3.9733289e-02
-1.6000000e-01 4.4081609e-02
-1.5800000e-01 4.8979881e-02
-1.5600000e-01 5.4498620e-02
-1.5400000e-01 6.0717798e-02
-1.5200000e-01 6.7722743e-02
-1.5000000e-01 7.5608367e-02
-1.4800000e-01 8.4475638e-02
-1.4600000e-01 9.4430877e-02
-1.4400000e-01 1.0558751e-01
-1.4200000e-01 1.1805725e-01
-1.4000000e-01 1.3195441e-01
-1.3800000e-01 1.4738415e-01
-1.3600000e-01 1.6444547e-01
-1.3400000e-01 1.8322284e-01
-1.3200000e-01 2.0377516e-01
-1.3000000e-01 2.2614368e-01
-1.2800000e-01 2.5032656e-01
-1.2600000e-01 2.7629226e-01
-1.2400000e-01 3.0395627e-01
-1.2200000e-01 3.3319071e-01
-1.2000000e-01 3.6382243e-01
-1.1800000e-01 3.9563322e-01
-1.1600000e-01 4.2835885e-01
-1.1400000e-01 4.6170079e-01
-1.1200000e-01 4.9533800e-01
-1.1000000e-01 5.2893668e-01
-1.0800000e-01 5.6216526e-01
-1.0600000e-01 5.9470847e-01
-1.0400000e-01 6.2627730e-01
-1.0200000e-01 6.5662400e-01
-1.0000000e-01 6.8554240e-01
-9.8000000e-02 7.1288086e-01
-9.6000000e-02 7.3853303e-01
-9.4000000e-02 7.6244261e-01
-9.2000000e-02 7.8459008e-01
-9.0000000e-02 8.0499772e-01
-8.8000000e-02 8.2371555e-01
-8.6000000e-02 8.4081291e-01
-8.4000000e-02 8.5638088e-01
-8.2000000e-02 8.7051628e-01
-8.0000000e-02 8.8332348e-01
-7.8000000e-02 8.9490355e-01
-7.6000000e-02 9.0536585e-01
-7.4000000e-02 9.1480522e-01
-7.2000000e-02 9.2331899e-01
-7.0000000e-02 9.3099525e-01
-6.8000000e-02 9.3791682e-01
-6.6000000e-02 9.4415727e-01
-6.4000000e-02 9.4978641e-01
-6.2000000e-02 9.5486654e-01
-6.0000000e-02 9.5945273e-01
-5.8000000e-02 9.6359676e-01
-5.6000000e-02 9.6734318e-01
-5.4000000e-02 9.7073303e-01
-5.2000000e-02 9.7380108e-01
-5.0000000e-02 9.7658087e-01
-4.8000000e-02 9.7910017e-01
-4.6000000e-02 9.8138475e-01
-4.4000000e-02 9.8345740e-01
-4.2000000e-02 9.8533836e-01
-4.0000000e-02 9.8704517e-01
-3.8000000e-02 9.8859409e-01
-3.6000000e-02 9.8999912e-01
-3.4000000e-02 9.9127278e-01
-3.2000000e-02 9.9242659e-01
-3.0000000e-02 9.9347029e-01
-2.8000000e-02 9.9441265e-01
-2.6000000e-02 9.9526142e-01
-2.4000000e-02 9.9602362e-01
-2.2000000e-02 9.9670499e-01
-2.0000000e-02 9.9731105e-01
-1.8000000e-02 9.9784678e-01
-1.6000000e-02 9.9831596e-01
-1.4000000e-02 9.9872233e-01
-1.2000000e-02 9.9906840e-01
-1.0000000e-02 9.9935741e-01
-8.0000000e-03 9.9959088e-01
-6.0000000e-03 9.9977079e-01
-4.0000000e-03 9.9989841e-01
-2.0000000e-03 9.9997448e-01
-0.0000000e+00 1.0000000e+00
0.0000000e+00 1.0000000e+00
2.0000000e-03 9.9997448e-01
4.0000000e-03 9.9989841e-01
6.0000000e-03 9.9977079e-01
8.0000000e-03 9.9959088e-01
1.0000000e-02 9.9935741e-01
1.2000000e-02 9.9906840e-01
1.4000000e-02 9.9872233e-01
1.6000000e-02 9.9831596e-01
1.8000000e-02 9.9784678e-01
2.0000000e-02 9.9731105e-01
2.2000000e-02 9.9670499e-01
2.4000000e-02 9.9602362e-01
2.6000000e-02 9.9526142e-01
2.8000000e-02 9.9441265e-01
3.0000000e-02 9.9347029e-01
3.2000000e-02 9.9242659e-01
3.4000000e-02 9.9127278e-01
3.6000000e-02 9.8999912e-01
3.8000000e-02 9.8859409e-01
4.0000000e-02 9.8704517e-01
4.2000000e-02 9.8533836e-01
4.4000000e-02 9.8345740e-01
4.6000000e-02 9.8138475e-01
4.8000000e-02 9.7910017e-01
5.0000000e-02 9.7658087e-01
5.2000000e-02 9.7380108e-01
5.4000000e-02 9.7073303e-01
5.6000000e-02 9.6734318e-01
5.8000000e-02 9.6359676e-01
6.0000000e-02 9.5945273e-01
6.2000000e-02 9.5486654e-01
6.4000000e-02 9.4978641e-01
6.6000000e-02 9.4415727e-01
6.8000000e-02 9.3791682e-01
7.0000000e-02 9.3099525e-01
7.2000000e-02 9.2331899e-01
7.4000000e-02 9.1480522e-01
7.6000000e-02 9.0536585e-01
7.8000000e-02 8.9490355e-01
8.0000000e-02 8.8332348e-01
8.2000000e-02 8.7051628e-01
8.4000000e-02 8.5638088e-01
8.6000000e-02 8.4081291e-01
8.8000000e-02 8.2371555e-01
9.0000000e-02 8.0499772e-01
9.2000000e-02 7.8459008e-01
9.4000000e-02 7.6244261e-01
9.6000000e-02 7.3853303e-01
9.8000000e-02 7.1288086e-01
1.0000000e-01 6.8554240e-01
1.0200000e-01 6.5662400e-01
1.0400000e-01 6.2627730e-01
1.0600000e-01 5.9470847e-01
1.0800000e-01 5.6216526e-01
1.1000000e-01 5.2893668e-01
1.1200000e-01 4.9533800e-01
1.1400000e-01 4.6170079e-01
1.1600000e-01 4.2835885e-01
1.1800000e-01 3.9563322e-01
1.2000000e-01 3.6382243e-01
1.2200000e-01 3.3319071e-01
1.2400000e-01 3.0395627e-01
1.2600000e-01 2.7629226e-01
1.2800000e-01 2.5032656e-01
1.3000000e-01 2.2614368e-01
1.3200000e-01 2.0377516e-01
1.3400000e-01 1.8322284e-01
1.3600000e-01 1.6444547e-01
1.3800000e-01 1.4738415e-01
1.4000000e-01 1.3195441e-01
1.4200000e-01 1.1805725e-01
1.4400000e-01 1.0558751e-01
1.4600000e-01 9.4430877e-02
1.4800000e-01 8.4475638e-02
1.5000000e-01 7.5608367e-02
1.5200000e-01 6.7722743e-02
1.5400000e-01 6.0717798e-02
1.5600000e-01 5.4498620e-02
1.5800000e-01 4.8979881e-02
1.6000000e-01 4.4081609e-02
1.6200000e-01 3.9733289e-02
1.6400000e-01 3.5869987e-02
1.6600000e-01 3.2435001e-02
1.6800000e-01 2.9377860e-02
1.7000000e-01 2.6653397e-02
1.7200000e-01 2.4222728e-02
1.7400000e-01 2.2050575e-02
1.7600000e-01 2.0106835e-02
1.7800000e-01 1.8364302e-02
1.8000000e-01 1.6799658e-02
1.8200000e-01 1.5392354e-02
1.8400000e-01 1.4124258e-02
1.8600000e-01 1.2979796e-02
1.8800000e-01 1.1944901e-02
1.9000000e-01 1.1007598e-02
1.9200000e-01 1.0157004e-02
1.9400000e-01 9.3837728e-03
1.9600000e-01 8.6796199e-03
1.9800000e-01 8.0372709e-03
2.0000000e-01 7.4506679e-03
2.0200000e-01 6.9147611e-03
2.0400000e-01 6.4241407e-03
2.0600000e-01 5.9731564e-03
2.0800000e-01 5.5592660e-03
2.1000000e-01 5.1775876e-03
2.1200000e-01 4.8255562e-03
2.1400000e-01 4.5003818e-03
2.1600000e-01 4.1994821e-03
2.1800000e-01 3.9208202e-03
2.2000000e-01 3.6621965e-03
2.2200000e-01 3.4221574e-03
2.2400000e-01 3.1987634e-03
2.2600000e-01 2.9907735e-03
2.2800000e-01 2.7967889e-03
2.3000000e-01 2.6157186e-03
2.3200000e-01 2.4464516e-03
2.3400000e-01 2.2880970e-03
2.3600000e-01 2.1397290e-03
2.3800000e-01 2.0006220e-03
2.4000000e-01 1.8699953e-03
2.4200000e-01 1.7472857e-03
2.4400000e-01 1.6318053e-03
2.4600000e-01 1.5230723e-03
2.4800000e-01 1.4205625e-03
2.5000000e-01 1.3238477e-03
2.5200000e-01 1.2325443e-03
2.5400000e-01 1.1461817e-03
2.5600000e-01 1.0645379e-03
2.5800000e-01 9.8718554e-04
2.6000000e-01 9.1389663e-04
2.6200000e-01 8.4438516e-04
2.6400000e-01 7.7835938e-04
2.6600000e-01 7.1566965e-04
2.6800000e-01 6.5610326e-04
2.7000000e-01 5.9939124e-04
2.7200000e-01 5.4545474e-04
2.7400000e-01 4.9403154e-04
2.7600000e-01 4.4500253e-04
2.7800000e-01 3.9822382e-04
2.8000000e-01 3.5359608e-04
2.8200000e-01 3.1088083e-04
2.8400000e-01 2.7014139e-04
2.8600000e-01 2.3112877e-04
2.8800000e-01 1.9377892e-04
2.9000000e-01 1.5799850e-04
2.9200000e-01 1.2374798e-04
2.9400000e-01 9.0866460e-05
2.9600000e-01 5.9367702e-05
2.9800000e-01 2.9075045e-05
3.0000000e-01 0.0000000e+00
| Opal | 0 | mkeilman/sirepo | sirepo/package_data/template/opal/lib/SOLENOID-fmapfn.NEW_SINGLE_SOL_NOFRINGE_ASTRA.opal | [
"Apache-2.0"
] |
#include <lighttpd/base.h>
#include <lighttpd/url_parser.h>
#include <stdlib.h>
%%{
machine url_parser;
action mark { mark = fpc; }
action mark_host { host_mark = fpc; }
action save_host {
g_string_truncate(uri->host, 0);
g_string_append_len(uri->host, host_mark, fpc - host_mark);
g_string_ascii_down(uri->host);
}
action save_authority {
g_string_truncate(uri->authority, 0);
g_string_append_len(uri->authority, mark, fpc - mark);
g_string_ascii_down(uri->authority);
}
action save_path {
g_string_append_len(uri->path, mark, fpc - mark);
g_string_append_len(uri->raw_path, mark, fpc - mark);
}
action save_query {
g_string_append_len(uri->query, mark, fpc - mark);
g_string_append_len(uri->raw_path, mark-1, fpc - mark+1); /* include '?' in append */
}
action save_scheme {
g_string_append_len(uri->scheme, mark, fpc - mark);
}
pct_encoded = "%" xdigit xdigit;
gen_delims = ":" | "/" | "?" | "#" | "[" | "]" | "@";
sub_delims = "!" | "$" | "&" | "'" | "(" | ")"
| "*" | "+" | "," | ";" | "=";
reserved = gen_delims | sub_delims;
unreserved = alpha | digit | "-" | "." | "_" | "~";
# many clients don't encode these, e.g. curl, wget, ...
delims = "<" | ">" | "#" | "%" | '"';
unwise = " " | "{" | "}" | "|" | "\\" | "^" | "[" | "]" | "`";
pchar = unreserved | pct_encoded | sub_delims | ":" | "@" | delims | unwise;
path = ("/" ( "/" | pchar)*) >mark %save_path;
# scheme = alpha *( alpha | digit | "+" | "-" | "." );
scheme = "http" | "https";
#simple ipv4 address
dec_octet = digit{1,3};
IPv4address = dec_octet "." dec_octet "." dec_octet "." dec_octet;
IPvFuture = "v" xdigit+ "." ( unreserved | sub_delims | ":" )+;
# simple ipv6 address
IPv6address = (":" | xdigit)+ IPv4address?;
IP_literal = "[" ( IPv6address | IPvFuture ) "]";
reg_name = ( unreserved | pct_encoded | sub_delims )+;
userinfo = ( unreserved | pct_encoded | sub_delims | ":" )*;
host = IP_literal | IPv4address | reg_name;
port = digit+;
authority = ( userinfo "@" )? (host >mark_host %save_host) ( ":" port )?;
query = ( pchar | "/" | "?" )* >mark %save_query;
fragment = ( pchar | "/" | "?" )*;
URI_path = (path ( "?" query )?) ( "#" fragment )?;
URI = (scheme >mark %save_scheme) "://" (authority >mark %save_authority) URI_path;
parse_URI := URI | ("*" >mark %save_path) | URI_path;
parse_URI_path := URI_path;
parse_Hostname := (host >mark_host %save_host) ( ":" port )?;
write data noerror;
}%%
gboolean li_parse_raw_url(liRequestUri *uri) {
const char *p, *pe, *eof;
const char *mark = NULL, *host_mark = NULL;
int cs;
p = uri->raw->str;
eof = pe = uri->raw->str + uri->raw->len;
(void) url_parser_start;
%% write init nocs;
cs = url_parser_en_parse_URI;
%% write exec;
return (cs >= url_parser_first_final);
}
gboolean li_parse_raw_path(liRequestUri *uri, GString *input) {
const char *p, *pe, *eof;
const char *mark = NULL, *host_mark = NULL;
int cs;
p = input->str;
eof = pe = input->str + input->len;
g_string_truncate(uri->path, 0);
g_string_truncate(uri->raw_path, 0);
g_string_truncate(uri->query, 0);
(void) url_parser_start;
%% write init nocs;
cs = url_parser_en_parse_URI_path;
%% write exec;
if (cs >= url_parser_first_final) {
li_url_decode(uri->path);
li_path_simplify(uri->path);
}
return (cs >= url_parser_first_final);
}
gboolean li_parse_hostname(liRequestUri *uri) {
const char *p, *pe, *eof;
const char *mark = NULL, *host_mark = NULL;
int cs;
g_string_ascii_down(uri->authority);
p = uri->authority->str;
eof = pe = uri->authority->str + uri->authority->len;
(void) url_parser_start;
%% write init nocs;
cs = url_parser_en_parse_Hostname;
%% write exec;
return (cs >= url_parser_first_final);
}
| Ragel in Ruby Host | 4 | kurtace72/lighttpd2 | src/main/url_parser.rl | [
"Apache-2.0"
] |
<mt:SetVarBlock name="__website_sort_option__" note="項目並び替え: ウェブサイト">
name,description,
c:ecwebsitecommontitle,
c:ecwebsiteindexcomponent,
c:ecwebsitehometitle,
c:ecwebsitehomedescription,
c:ecwebsitemainimage1,
c:ecwebsitemainimage2,
c:ecwebsitemainimage3,
c:ecwebsitemainimage4,
c:ecwebsitemainimage5,
c:ecwebsiteogimage,
c:ecwebsitetwitter,
c:ecwebsitefbpage,
c:ecwebsitefbappid,
c:ecwebsitehtmlhead
</mt:SetVarBlock>
<mt:SetVarBlock name="__blog_sort_option__" note="項目並び替え: ブログ">
name,description,
c:ecblogcommontitle,
c:ecblogindexcomponent,
c:ecbloghometitle,
c:ecbloghomedescription,
c:ecblogmainimage1,
c:ecblogmainimage2,
c:ecblogmainimage3,
c:ecblogmainimage4,
c:ecblogmainimage5,
c:ecblogogimage,
c:ecblogtwitter,
c:ecblogfbpage,
c:ecblogfbappid,
c:ecbloghtmlhead
</mt:SetVarBlock>
<mt:SetVarBlock name="__entry_sort_option__" note="項目並び替え: 記事">
title,
permalink,
text,
tags,
c:ecentrypickup,
c:ecentrymetanoindex,
c:ecentryeyecatch,
c:ecentrythumbnail,
c:ecentrylinkurl,
c:ecentrymetatitle,
excerpt,
c:ecentryhtmlhead
</mt:SetVarBlock>
<mt:SetVarBlock name="__page_sort_option__" note="項目並び替え: ページ">
title,
permalink,
text,
tags,
c:ecpagemetanoindex,
c:ecpageeyecatch,
c:ecpagelayout,
c:ecpagemetatitle,
excerpt,
c:ecpagehtmlhead
</mt:SetVarBlock>
(function($){
//$.MTAppDebug();
$.MTAppFullscreen();
//並び替えを禁止する
if(mtappVars.screen_id == 'edit-entry'){
$('div.sort-enabled').removeClass('sort-enabled');
}
if(mtappVars.screen_id == 'edit-page'){
$('div.sort-enabled').removeClass('sort-enabled');
}
if(( mtappVars.blog_id == '<mt:WebsiteID />' )||( mtappVars.blog_id == '<mt:BlogID />' )) {
//使用しない左メニューを隠す
var Menu = $('#menu');
$('#menu-feedback', Menu).css({ display: 'none' });
//ウェブサイトカスタムフィールドの並び替え
if(mtappVars.screen_id == 'edit-blog') {
<mt:IfWebsite>
$.MTAppFieldSort({
sort: '<mt:Var name="__website_sort_option__" regex_replace="/\s*\n+/g","" />',
insertID: 'blog-settings'
});
<mt:Else>
$.MTAppFieldSort({
sort: '<mt:Var name="__blog_sort_option__" regex_replace="/\s*\n+/g","" />',
insertID: 'blog-settings'
});
</mt:IfWebsite>
}
//記事カスタムフィールドの並び替え
if(mtappVars.screen_id == 'edit-entry') {
$.MTAppFieldSort({sort: '<mt:Var name="__entry_sort_option__" regex_replace="/\s*\n+/g","" />'});
}
//ページカスタムフィールドの並び替え
if(mtappVars.screen_id == 'edit-page') {
$.MTAppFieldSort({sort: '<mt:Var name="__page_sort_option__" regex_replace="/\s*\n+/g","" />'});
}
}
})(jQuery); | MTML | 4 | webbingstudio/mt_theme_echo_bootstrap | dist/themes/echo_bootstrap/templates/mtappjquery_user_js.mtml | [
"MIT"
] |
#####################################################
# solver.ampl : solver name and its options
#####################################################
option solver bonmin; # ... path/binary of the AMPLsolver binary
option bonmin_options "bonmin.algorithm=B-BB outlev=1 bonmin.time_limit=259200 max_cpu_time=259200"; # ... solver options
solve;
| AMPL | 3 | JuliaInv/ConvDiffMIPDECO | examples/ampl/solver.ampl | [
"MIT"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.