text:
echo                               --------
echo    This script will copy the wxMSW release files into \wxmsw_dist
echo                               --------
echo

md \wxmsw_dist
md \wxmsw_dist\wxMSW

echo Base dir..

cd ..\..

echo Lib..

cd lib
md \wxmsw_dist\wxMSW\lib
copy dummy \wxmsw_dist\wxMSW\lib
cd ..

echo Locale..

cd locale
md \wxmsw_dist\wxMSW\locale
copy *.?? \wxmsw_dist\wxMSW\locale
cd ..

echo Docs..

cd docs\wine
copy COPYING.LIB \wxmsw_dist\wxMSW
copy licence.txt \wxmsw_dist\wxMSW\LICENCE.txt
cd ..\msw
copy install.txt \wxmsw_dist\wxMSW\INSTALL.txt
copy readme.txt \wxmsw_dist\wxMSW\README.txt
copy todo.txt \wxmsw_dist\wxMSW\TODO.txt
cd ..
copy symbols.txt \wxmsw_dist\wxMSW\SYMBOLS.txt
cd ..
echo Include dir..

md \wxmsw_dist\wxMSW\include
cd include
copy wx_*.* \wxmsw_dist\wxMSW\include

md \wxmsw_dist\wxMSW\include\wx
cd wx
copy *.h \wxmsw_dist\wxMSW\include\wx
copy *.cpp \wxmsw_dist\wxMSW\include\wx

md \wxmsw_dist\wxMSW\include\wx\generic
cd generic
copy *.h \wxmsw_dist\wxMSW\include\wx\generic
cd ..

md \wxmsw_dist\wxMSW\include\wx\html
cd html
copy *.h \wxmsw_dist\wxMSW\include\wx\html
md \wxmsw_dist\wxMSW\include\wx\html\msw
cd msw
copy *.* \wxmsw_dist\wxMSW\include\wx\html\msw
cd ..\..

md \wxmsw_dist\wxMSW\include\wx\msw
cd msw
copy *.* \wxmsw_dist\wxMSW\include\wx\msw
rem del \wxmsw_dist\wxMSW\include\wx\msw\setup.h
del \wxmsw_dist\wxMSW\include\wx\msw\Makefile.am
del \wxmsw_dist\wxMSW\include\wx\msw\Makefile.in
md \wxmsw_dist\wxMSW\include\wx\msw\gnuwin32
cd gnuwin32
copy *.h \wxmsw_dist\wxMSW\include\wx\msw\gnuwin32
cd ..
md \wxmsw_dist\wxMSW\include\wx\msw\ole
cd ole
copy *.h \wxmsw_dist\wxMSW\include\wx\msw\ole
cd ..
cd ctl3d
copy *.h \wxmsw_dist\wxMSW\include\wx\msw\ctl3d
cd ..
cd ..

md \wxmsw_dist\wxMSW\include\wx\protocol
cd protocol
copy *.h \wxmsw_dist\wxMSW\include\wx\protocol
cd ..

cd ..\..

echo Src dir..

cd src
md \wxmsw_dist\wxMSW\src
copy *.* \wxmsw_dist\wxMSW\src
del Makefile.am \wxmsw_dist\wxMSW\src\Makefile.am
del Makefile.in \wxmsw_dist\wxMSW\src\Makefile.in

cd msw
md \wxmsw_dist\wxMSW\src\msw
md \wxmsw_dist\wxMSW\src\msw\ole
copy ole\*.cpp \wxmsw_dist\wxMSW\src\msw\ole
copy *.cpp \wxmsw_dist\wxMSW\src\msw
copy *.c \wxmsw_dist\wxMSW\src\msw
copy *.def \wxmsw_dist\wxMSW\src\msw
copy makefile.* \wxmsw_dist\wxMSW\src\msw
del Makefile.am \wxmsw_dist\wxMSW\src\msw\Makefile.am
del Makefile.in \wxmsw_dist\wxMSW\src\msw\Makefile.in
cd ..

cd common
md \wxmsw_dist\wxMSW\src\common
copy glob.inc \wxmsw_dist\wxMSW\src\common
copy lexer.l \wxmsw_dist\wxMSW\src\common
copy parser.y \wxmsw_dist\wxMSW\src\common
copy *.c \wxmsw_dist\wxMSW\src\common
copy *.h \wxmsw_dist\wxMSW\src\common
copy *.cpp \wxmsw_dist\wxMSW\src\common
cd ..

cd html
md \wxmsw_dist\wxMSW\src\html
copy *.cpp \wxmsw_dist\wxMSW\src\html
copy *.h \wxmsw_dist\wxMSW\src\html
cd ..

cd generic
md \wxmsw_dist\wxMSW\src\generic
copy *.cpp \wxmsw_dist\wxMSW\src\generic
cd ..

cd zlib
md \wxmsw_dist\wxMSW\src\zlib
copy *.* \wxmsw_dist\wxMSW\src\zlib
cd ..

cd png
md \wxmsw_dist\wxMSW\src\png
copy *.* \wxmsw_dist\wxMSW\src\png
cd ..

cd jpeg
md \wxmsw_dist\wxMSW\src\jpeg
copy *.* \wxmsw_dist\wxMSW\src\jpeg
cd ..

cd xpm
md \wxmsw_dist\wxMSW\src\xpm
copy *.* \wxmsw_dist\wxMSW\src\xpm
cd ..

cd ..

echo Utils dir..

cd utils
md \wxmsw_dist\wxMSW\utils

echo wxGLCanvas..

cd glcanvas
md \wxmsw_dist\wxMSW\utils\glcanvas
copy .\docs\notes.txt \wxmsw_dist\wxMSW\utils\glcanvas\NOTES.txt

md \wxmsw_dist\wxMSW\utils\glcanvas\win
copy .\win\glcanvas.cpp \wxmsw_dist\wxMSW\utils\glcanvas\win
copy .\win\glcanvas.h \wxmsw_dist\wxMSW\utils\glcanvas\win
copy .\win\makefile.* \wxmsw_dist\wxMSW\utils\glcanvas\win

md \wxmsw_dist\wxMSW\utils\glcanvas\samples
md \wxmsw_dist\wxMSW\utils\glcanvas\samples\cube
md \wxmsw_dist\wxMSW\utils\glcanvas\samples\isosurf
md \wxmsw_dist\wxMSW\utils\glcanvas\samples\penguin

cd samples\cube
copy Makefile.* \wxmsw_dist\wxMSW\utils\glcanvas\samples\cube
copy cube.rc \wxmsw_dist\wxMSW\utils\glcanvas\samples\cube
copy cube.h \wxmsw_dist\wxMSW\utils\glcanvas\samples\cube
copy cube.cpp \wxmsw_dist\wxMSW\utils\glcanvas\samples\cube
copy mondrian.ico \wxmsw_dist\wxMSW\utils\glcanvas\samples\cube
cd ..

cd isosurf
copy Makefile.* \wxmsw_dist\wxMSW\utils\glcanvas\samples\isosurf
copy isosurf.h \wxmsw_dist\wxMSW\utils\glcanvas\samples\isosurf
copy isosurf.rc \wxmsw_dist\wxMSW\utils\glcanvas\samples\isosurf
copy isosurf.cpp \wxmsw_dist\wxMSW\utils\glcanvas\samples\isosurf
copy isosurf.dat.gz \wxmsw_dist\wxMSW\utils\glcanvas\samples\isosurf
copy mondrian.ico \wxmsw_dist\wxMSW\utils\glcanvas\samples\isosurf
cd ..

cd penguin
copy Makefile.* \wxmsw_dist\wxMSW\utils\glcanvas\samples\penguin
copy penguin.rc \wxmsw_dist\wxMSW\utils\glcanvas\samples\penguin
copy penguin.h \wxmsw_dist\wxMSW\utils\glcanvas\samples\penguin
copy penguin.cpp \wxmsw_dist\wxMSW\utils\glcanvas\samples\penguin
copy trackball.h \wxmsw_dist\wxMSW\utils\glcanvas\samples\penguin
copy trackball.c \wxmsw_dist\wxMSW\utils\glcanvas\samples\penguin
copy lw.h \wxmsw_dist\wxMSW\utils\glcanvas\samples\penguin
copy lw.cpp \wxmsw_dist\wxMSW\utils\glcanvas\samples\penguin
copy penguin.lwo \wxmsw_dist\wxMSW\utils\glcanvas\samples\penguin
copy mondrian.ico \wxmsw_dist\wxMSW\utils\glcanvas\samples\penguin
cd ..\..\..

cd ..

echo Samples dir..

cd samples
md \wxmsw_dist\wxMSW\samples
copy makefile.* \wxmsw_dist\wxMSW\samples

echo Minimal sample..

cd minimal
md \wxmsw_dist\wxMSW\samples\minimal
copy Makefile.* \wxmsw_dist\wxMSW\samples\minimal
copy *.def \wxmsw_dist\wxMSW\samples\minimal
copy *.rc \wxmsw_dist\wxMSW\samples\minimal
copy minimal.cpp \wxmsw_dist\wxMSW\samples\minimal
copy mondrian.ico \wxmsw_dist\wxMSW\samples\minimal
cd ..

echo Bombs sample..

cd bombs
md \wxmsw_dist\wxMSW\samples\bombs
copy Makefile.* \wxmsw_dist\wxMSW\samples\bombs
copy *.cpp \wxmsw_dist\wxMSW\samples\bombs
copy *.h \wxmsw_dist\wxMSW\samples\bombs
copy *.ico \wxmsw_dist\wxMSW\samples\bombs
copy *.def \wxmsw_dist\wxMSW\samples\bombs
copy *.rc \wxmsw_dist\wxMSW\samples\bombs
cd ..

echo Caret sample..

cd caret
md \wxmsw_dist\wxMSW\samples\caret
copy Makefile.* \wxmsw_dist\wxMSW\samples\caret
copy *.cpp \wxmsw_dist\wxMSW\samples\caret
copy *.h \wxmsw_dist\wxMSW\samples\caret
copy *.ico \wxmsw_dist\wxMSW\samples\caret
copy *.def \wxmsw_dist\wxMSW\samples\caret
copy *.rc \wxmsw_dist\wxMSW\samples\caret
cd ..

echo Checklst sample..

cd checklst
md \wxmsw_dist\wxMSW\samples\checklst
copy Makefile.* \wxmsw_dist\wxMSW\samples\checklst
copy *.h \wxmsw_dist\wxMSW\samples\checklst
copy *.cpp \wxmsw_dist\wxMSW\samples\checklst
copy *.ico \wxmsw_dist\wxMSW\samples\checklst
copy *.def \wxmsw_dist\wxMSW\samples\checklst
copy *.rc \wxmsw_dist\wxMSW\samples\checklst
cd ..

echo Config sample..

cd config
md \wxmsw_dist\wxMSW\samples\config
copy Makefile.* \wxmsw_dist\wxMSW\samples\config
copy *.h \wxmsw_dist\wxMSW\samples\config
copy *.cpp \wxmsw_dist\wxMSW\samples\config
copy *.ico \wxmsw_dist\wxMSW\samples\config
copy *.def \wxmsw_dist\wxMSW\samples\config
copy *.rc \wxmsw_dist\wxMSW\samples\config
cd ..

echo Controls sample..

cd controls
md \wxmsw_dist\wxMSW\samples\controls
copy Makefile.* \wxmsw_dist\wxMSW\samples\controls
copy *.cpp \wxmsw_dist\wxMSW\samples\controls
copy *.h \wxmsw_dist\wxMSW\samples\controls
copy *.rc \wxmsw_dist\wxMSW\samples\controls
copy *.def \wxmsw_dist\wxMSW\samples\controls
copy *.ico \wxmsw_dist\wxMSW\samples\controls
cd icons
md \wxmsw_dist\wxMSW\samples\controls\icons
copy *.* \wxmsw_dist\wxMSW\samples\controls\icons
cd ..\..

echo Dialogs sample..

cd dialogs
md \wxmsw_dist\wxMSW\samples\dialogs
copy Makefile.* \wxmsw_dist\wxMSW\samples\dialogs
copy *.cpp \wxmsw_dist\wxMSW\samples\dialogs
copy *.h \wxmsw_dist\wxMSW\samples\dialogs
copy *.def \wxmsw_dist\wxMSW\samples\dialogs
copy *.rc \wxmsw_dist\wxMSW\samples\dialogs
copy *.ico \wxmsw_dist\wxMSW\samples\dialogs
cd ..

echo DnD sample..

cd dnd
md \wxmsw_dist\wxMSW\samples\dnd
copy Makefile.* \wxmsw_dist\wxMSW\samples\dnd
copy *.cpp \wxmsw_dist\wxMSW\samples\dnd
copy *.h \wxmsw_dist\wxMSW\samples\dnd
copy *.def \wxmsw_dist\wxMSW\samples\dnd
copy *.rc \wxmsw_dist\wxMSW\samples\dnd
copy *.ico \wxmsw_dist\wxMSW\samples\dnd
cd ..

echo Docview sample..

cd docview
md \wxmsw_dist\wxMSW\samples\docview
copy Makefile.* \wxmsw_dist\wxMSW\samples\docview
copy *.cpp \wxmsw_dist\wxMSW\samples\docview
copy *.h \wxmsw_dist\wxMSW\samples\docview
copy *.def \wxmsw_dist\wxMSW\samples\docview
copy *.rc \wxmsw_dist\wxMSW\samples\docview
copy *.ico \wxmsw_dist\wxMSW\samples\docview
cd ..

echo DocvwMDI sample..

cd docvwmdi
md \wxmsw_dist\wxMSW\samples\docvwmdi
copy Makefile.* \wxmsw_dist\wxMSW\samples\docvwmdi
copy *.cpp \wxmsw_dist\wxMSW\samples\docvwmdi
copy *.h \wxmsw_dist\wxMSW\samples\docvwmdi
copy *.def \wxmsw_dist\wxMSW\samples\docvwmdi
copy *.rc \wxmsw_dist\wxMSW\samples\docvwmdi
copy *.ico \wxmsw_dist\wxMSW\samples\docvwmdi
cd ..

echo Dynamic sample..

cd dynamic
md \wxmsw_dist\wxMSW\samples\dynamic
copy Makefile.* \wxmsw_dist\wxMSW\samples\dynamic
copy *.cpp \wxmsw_dist\wxMSW\samples\dynamic
copy *.h \wxmsw_dist\wxMSW\samples\dynamic
copy *.def \wxmsw_dist\wxMSW\samples\dynamic
copy *.rc \wxmsw_dist\wxMSW\samples\dynamic
copy *.ico \wxmsw_dist\wxMSW\samples\dynamic
cd ..

echo Drawing sample..

cd drawing
md \wxmsw_dist\wxMSW\samples\drawing
copy Makefile.* \wxmsw_dist\wxMSW\samples\drawing
copy *.cpp \wxmsw_dist\wxMSW\samples\drawing
copy *.ico \wxmsw_dist\wxMSW\samples\drawing
copy *.h \wxmsw_dist\wxMSW\samples\drawing
copy *.rc \wxmsw_dist\wxMSW\samples\drawing
copy *.def \wxmsw_dist\wxMSW\samples\drawing
cd ..

echo Forty sample..

cd forty
md \wxmsw_dist\wxMSW\samples\forty
copy Makefile.* \wxmsw_dist\wxMSW\samples\forty
copy *.cpp \wxmsw_dist\wxMSW\samples\forty
copy *.h \wxmsw_dist\wxMSW\samples\forty
copy *.def \wxmsw_dist\wxMSW\samples\forty
copy *.rc \wxmsw_dist\wxMSW\samples\forty
copy *.ico \wxmsw_dist\wxMSW\samples\forty
copy *.bmp \wxmsw_dist\wxMSW\samples\forty
copy *.xpm \wxmsw_dist\wxMSW\samples\forty
copy *.xbm \wxmsw_dist\wxMSW\samples\forty
cd ..

echo Fractal sample..

cd fractal
md \wxmsw_dist\wxMSW\samples\fractal
copy Makefile.* \wxmsw_dist\wxMSW\samples\fractal
copy *.cpp \wxmsw_dist\wxMSW\samples\fractal
copy *.h \wxmsw_dist\wxMSW\samples\fractal
copy *.def \wxmsw_dist\wxMSW\samples\fractal
copy *.rc \wxmsw_dist\wxMSW\samples\fractal
copy *.ico \wxmsw_dist\wxMSW\samples\fractal
cd ..

echo Grid sample..

cd grid
md \wxmsw_dist\wxMSW\samples\grid
copy Makefile.* \wxmsw_dist\wxMSW\samples\grid
copy *.cpp \wxmsw_dist\wxMSW\samples\grid
copy *.h \wxmsw_dist\wxMSW\samples\grid
copy *.def \wxmsw_dist\wxMSW\samples\grid
copy *.rc \wxmsw_dist\wxMSW\samples\grid
copy *.ico \wxmsw_dist\wxMSW\samples\grid
cd ..

echo Help sample..

cd help
md \wxmsw_dist\wxMSW\samples\help
copy Makefile.* \wxmsw_dist\wxMSW\samples\help
copy *.cpp \wxmsw_dist\wxMSW\samples\help
copy *.def \wxmsw_dist\wxMSW\samples\help
copy *.rc \wxmsw_dist\wxMSW\samples\help
copy *.ico \wxmsw_dist\wxMSW\samples\help
copy *.xpm \wxmsw_dist\wxMSW\samples\help
cd doc
md \wxmsw_dist\wxMSW\samples\help\doc
copy *.* \wxmsw_dist\wxMSW\samples\help\doc
cd ..\..

echo Image sample..

cd image
md \wxmsw_dist\wxMSW\samples\image
copy Makefile.* \wxmsw_dist\wxMSW\samples\image
copy *.cpp \wxmsw_dist\wxMSW\samples\image
copy *.def \wxmsw_dist\wxMSW\samples\image
copy *.rc \wxmsw_dist\wxMSW\samples\image
copy *.ico \wxmsw_dist\wxMSW\samples\image
copy horse.png \wxmsw_dist\wxMSW\samples\image
copy horse.gif \wxmsw_dist\wxMSW\samples\image
copy horse.jpg \wxmsw_dist\wxMSW\samples\image
cd ..

echo Internat sample..

cd internat
md \wxmsw_dist\wxMSW\samples\internat
copy Makefile.* \wxmsw_dist\wxMSW\samples\internat
copy *.cpp \wxmsw_dist\wxMSW\samples\internat
copy *.def \wxmsw_dist\wxMSW\samples\internat
copy *.rc \wxmsw_dist\wxMSW\samples\internat
copy *.ico \wxmsw_dist\wxMSW\samples\internat
copy readme.txt \wxmsw_dist\wxMSW\samples\internat
copy wxstd.po \wxmsw_dist\wxMSW\samples\internat
cd fr
md \wxmsw_dist\wxMSW\samples\internat\fr
copy *.?o \wxmsw_dist\wxMSW\samples\internat\fr
cd ..\..

echo Layout sample..

cd layout
md \wxmsw_dist\wxMSW\samples\layout
copy Makefile.* \wxmsw_dist\wxMSW\samples\layout
copy *.cpp \wxmsw_dist\wxMSW\samples\layout
copy *.ico \wxmsw_dist\wxMSW\samples\layout
copy *.def \wxmsw_dist\wxMSW\samples\layout
copy *.rc \wxmsw_dist\wxMSW\samples\layout
copy *.h \wxmsw_dist\wxMSW\samples\layout
cd ..

echo Listctrl sample..

cd listctrl
md \wxmsw_dist\wxMSW\samples\listctrl
copy Makefile.* \wxmsw_dist\wxMSW\samples\listctrl
copy *.cpp \wxmsw_dist\wxMSW\samples\listctrl
copy *.h \wxmsw_dist\wxMSW\samples\listctrl
copy *.def \wxmsw_dist\wxMSW\samples\listctrl
copy *.rc \wxmsw_dist\wxMSW\samples\listctrl
copy *.ico \wxmsw_dist\wxMSW\samples\listctrl
cd bitmaps
md \wxmsw_dist\wxMSW\samples\listctrl\bitmaps
copy *.* \wxmsw_dist\wxMSW\samples\listctrl\bitmaps
cd ..\..

echo MDI sample..

cd mdi
md \wxmsw_dist\wxMSW\samples\mdi
copy Makefile.* \wxmsw_dist\wxMSW\samples\mdi
copy *.cpp \wxmsw_dist\wxMSW\samples\mdi
copy *.rc \wxmsw_dist\wxMSW\samples\mdi
copy *.def \wxmsw_dist\wxMSW\samples\mdi
copy *.h \wxmsw_dist\wxMSW\samples\mdi
copy *.ico \wxmsw_dist\wxMSW\samples\mdi
cd bitmaps
md \wxmsw_dist\wxMSW\samples\mdi\bitmaps
copy *.* \wxmsw_dist\wxMSW\samples\mdi\bitmaps
cd ..\..

echo Memcheck sample..

cd memcheck
md \wxmsw_dist\wxMSW\samples\memcheck
copy Makefile.* \wxmsw_dist\wxMSW\samples\memcheck
copy *.cpp \wxmsw_dist\wxMSW\samples\memcheck
copy *.ico \wxmsw_dist\wxMSW\samples\memcheck
copy *.rc \wxmsw_dist\wxMSW\samples\memcheck
copy *.def \wxmsw_dist\wxMSW\samples\memcheck
copy *.xpm \wxmsw_dist\wxMSW\samples\memcheck
cd ..

echo Minifram sample..

cd minifram
md \wxmsw_dist\wxMSW\samples\minifram
copy Makefile.* \wxmsw_dist\wxMSW\samples\minifram
copy *.cpp \wxmsw_dist\wxMSW\samples\minifram
copy *.h \wxmsw_dist\wxMSW\samples\minifram
copy *.xpm \wxmsw_dist\wxMSW\samples\minifram
copy *.ico \wxmsw_dist\wxMSW\samples\minifram
copy *.def \wxmsw_dist\wxMSW\samples\minifram
copy *.rc \wxmsw_dist\wxMSW\samples\minifram
cd bitmaps
md \wxmsw_dist\wxMSW\samples\minifram\bitmaps
copy *.* \wxmsw_dist\wxMSW\samples\minifram\bitmaps
cd ..\..

echo Notebook sample..

cd notebook
md \wxmsw_dist\wxMSW\samples\notebook
copy Makefile.* \wxmsw_dist\wxMSW\samples\notebook
copy *.cpp \wxmsw_dist\wxMSW\samples\notebook
copy *.ico \wxmsw_dist\wxMSW\samples\notebook
copy *.def \wxmsw_dist\wxMSW\samples\notebook
copy *.rc \wxmsw_dist\wxMSW\samples\notebook
copy *.h \wxmsw_dist\wxMSW\samples\notebook
cd ..

echo Printing sample..

cd printing
md \wxmsw_dist\wxMSW\samples\printing
copy Makefile.* \wxmsw_dist\wxMSW\samples\printing
copy *.cpp \wxmsw_dist\wxMSW\samples\printing
copy *.h \wxmsw_dist\wxMSW\samples\printing
copy *.rc \wxmsw_dist\wxMSW\samples\printing
copy *.ico \wxmsw_dist\wxMSW\samples\printing
copy *.def \wxmsw_dist\wxMSW\samples\printing
copy *.xpm \wxmsw_dist\wxMSW\samples\printing
cd ..

echo Proplist sample..

cd proplist
md \wxmsw_dist\wxMSW\samples\proplist
copy Makefile.* \wxmsw_dist\wxMSW\samples\proplist
copy *.rc \wxmsw_dist\wxMSW\samples\printing
copy *.def \wxmsw_dist\wxMSW\samples\printing
copy *.cpp \wxmsw_dist\wxMSW\samples\proplist
copy *.ico \wxmsw_dist\wxMSW\samples\printing
copy *.h \wxmsw_dist\wxMSW\samples\proplist
cd ..

echo Resource sample..

cd resource
md \wxmsw_dist\wxMSW\samples\resource
copy Makefile.* \wxmsw_dist\wxMSW\samples\resource
copy *.ico \wxmsw_dist\wxMSW\samples\resource
copy *.rc \wxmsw_dist\wxMSW\samples\resource
copy *.def \wxmsw_dist\wxMSW\samples\resource
copy *.cpp \wxmsw_dist\wxMSW\samples\resource
copy *.h \wxmsw_dist\wxMSW\samples\resource
copy *.wxr \wxmsw_dist\wxMSW\samples\resource
cd ..

echo Sashtest sample..

cd sashtest
md \wxmsw_dist\wxMSW\samples\sashtest
copy Makefile.* \wxmsw_dist\wxMSW\samples\sashtest
copy *.cpp \wxmsw_dist\wxMSW\samples\sashtest
copy *.rc \wxmsw_dist\wxMSW\samples\sashtest
copy *.h \wxmsw_dist\wxMSW\samples\sashtest
copy *.def \wxmsw_dist\wxMSW\samples\sashtest
copy *.ico \wxmsw_dist\wxMSW\samples\sashtest
cd ..

echo Scroll sample..

cd scroll
md \wxmsw_dist\wxMSW\samples\scroll
copy Makefile.* \wxmsw_dist\wxMSW\samples\scroll
copy *.cpp \wxmsw_dist\wxMSW\samples\scroll
copy *.def \wxmsw_dist\wxMSW\samples\scroll
copy *.rc \wxmsw_dist\wxMSW\samples\scroll
copy *.ico \wxmsw_dist\wxMSW\samples\scroll
copy *.h \wxmsw_dist\wxMSW\samples\scroll
cd ..

echo Splash sample..

cd splash
md \wxmsw_dist\wxMSW\samples\splash
copy Makefile.* \wxmsw_dist\wxMSW\samples\splash
copy *.cpp \wxmsw_dist\wxMSW\samples\splash
copy *.h \wxmsw_dist\wxMSW\samples\splash
copy *.def \wxmsw_dist\wxMSW\samples\splash
copy *.rc \wxmsw_dist\wxMSW\samples\splash
copy *.ico \wxmsw_dist\wxMSW\samples\splash
copy *.png \wxmsw_dist\wxMSW\samples\splash
copy *.mpg \wxmsw_dist\wxMSW\samples\splash
cd ..

echo Splitter sample..

cd splitter
md \wxmsw_dist\wxMSW\samples\splitter
copy Makefile.* \wxmsw_dist\wxMSW\samples\splitter
copy *.cpp \wxmsw_dist\wxMSW\samples\splitter
copy *.def \wxmsw_dist\wxMSW\samples\splitter
copy *.rc \wxmsw_dist\wxMSW\samples\splitter
copy *.ico \wxmsw_dist\wxMSW\samples\splitter
cd ..

echo Text sample..

cd text
md \wxmsw_dist\wxMSW\samples\text
copy Makefile.* \wxmsw_dist\wxMSW\samples\text
copy *.cpp \wxmsw_dist\wxMSW\samples\text
copy *.def \wxmsw_dist\wxMSW\samples\text
copy *.rc \wxmsw_dist\wxMSW\samples\text
copy *.ico \wxmsw_dist\wxMSW\samples\text
cd ..

echo Thread sample..

cd thread
md \wxmsw_dist\wxMSW\samples\thread
copy Makefile.* \wxmsw_dist\wxMSW\samples\thread
copy *.cpp \wxmsw_dist\wxMSW\samples\thread
copy *.def \wxmsw_dist\wxMSW\samples\thread
copy *.rc \wxmsw_dist\wxMSW\samples\thread
copy *.ico \wxmsw_dist\wxMSW\samples\thread
cd ..

echo Toolbar sample..

cd toolbar
md \wxmsw_dist\wxMSW\samples\toolbar
copy Makefile.* \wxmsw_dist\wxMSW\samples\toolbar
copy *.cpp \wxmsw_dist\wxMSW\samples\toolbar
copy *.h \wxmsw_dist\wxMSW\samples\toolbar
copy *.rc \wxmsw_dist\wxMSW\samples\toolbar
copy *.def \wxmsw_dist\wxMSW\samples\toolbar
copy *.xpm \wxmsw_dist\wxMSW\samples\toolbar
copy *.ico \wxmsw_dist\wxMSW\samples\toolbar
cd bitmaps
md \wxmsw_dist\wxMSW\samples\toolbar\bitmaps
copy *.* \wxmsw_dist\wxMSW\samples\toolbar\bitmaps
cd ..\..

echo TreeCtrl sample..

cd treectrl
md \wxmsw_dist\wxMSW\samples\treectrl
copy Makefile.* \wxmsw_dist\wxMSW\samples\treectrl
copy *.rc \wxmsw_dist\wxMSW\samples\treectrl
copy *.def \wxmsw_dist\wxMSW\samples\treectrl
copy *.cpp \wxmsw_dist\wxMSW\samples\treectrl
copy *.h \wxmsw_dist\wxMSW\samples\treectrl
copy *.xpm \wxmsw_dist\wxMSW\samples\treectrl
copy *.ico \wxmsw_dist\wxMSW\samples\treectrl
cd bitmaps
md \wxmsw_dist\wxMSW\samples\treectrl\bitmaps
copy *.* \wxmsw_dist\wxMSW\samples\treectrl\bitmaps
cd ..\..

echo typetest sample..

cd typetest
md \wxmsw_dist\wxMSW\samples\typetest
copy Makefile.* \wxmsw_dist\wxMSW\samples\typetest
copy *.cpp \wxmsw_dist\wxMSW\samples\typetest
copy *.h \wxmsw_dist\wxMSW\samples\typetest
copy *.ico \wxmsw_dist\wxMSW\samples\typetest
copy *.def \wxmsw_dist\wxMSW\samples\typetest
copy *.rc \wxmsw_dist\wxMSW\samples\typetest
cd ..

echo Validate sample..

cd validate
md \wxmsw_dist\wxMSW\samples\validate
copy Makefile.* \wxmsw_dist\wxMSW\samples\validate
copy *.cpp \wxmsw_dist\wxMSW\samples\validate
copy *.h \wxmsw_dist\wxMSW\samples\validate
copy *.xpm \wxmsw_dist\wxMSW\samples\validate
copy *.rc \wxmsw_dist\wxMSW\samples\validate
copy *.def \wxmsw_dist\wxMSW\samples\validate
cd ..

echo wxPoem sample..

cd wxpoem
md \wxmsw_dist\wxMSW\samples\wxpoem
copy Makefile.* \wxmsw_dist\wxMSW\samples\wxpoem
copy *.cpp \wxmsw_dist\wxMSW\samples\wxpoem
copy *.h \wxmsw_dist\wxMSW\samples\wxpoem
copy *.xpm \wxmsw_dist\wxMSW\samples\wxpoem
copy *.def \wxmsw_dist\wxMSW\samples\wxpoem
copy *.rc \wxmsw_dist\wxMSW\samples\wxpoem
copy wxpoem.dat \wxmsw_dist\wxMSW\samples\wxpoem
copy wxpoem.txt \wxmsw_dist\wxMSW\samples\wxpoem
copy wxpoem.idx \wxmsw_dist\wxMSW\samples\wxpoem
cd ..

echo wxSocket sample..

cd wxsocket
md \wxmsw_dist\wxMSW\samples\wxsocket
copy Makefile.* \wxmsw_dist\wxMSW\samples\wxsocket
copy *.cpp \wxmsw_dist\wxMSW\samples\wxsocket
copy *.h \wxmsw_dist\wxMSW\samples\wxsocket
copy *.rc \wxmsw_dist\wxMSW\samples\wxsocket
copy *.def \wxmsw_dist\wxMSW\samples\wxsocket
copy *.xpm \wxmsw_dist\wxMSW\samples\wxsocket
cd ..\..


text:
namespace Revit_Tools
{
    partial class PurgeForm
    {
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code

        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.library_path_label = new System.Windows.Forms.TextBox();
            this.button1 = new System.Windows.Forms.Button();
            this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
            this.report = new System.Windows.Forms.RichTextBox();
            this.button_run = new System.Windows.Forms.Button();
            this.tableLayoutPanel1.SuspendLayout();
            this.SuspendLayout();
            //
            // library_path_label
            //
            this.library_path_label.Dock = System.Windows.Forms.DockStyle.Fill;
            this.library_path_label.Location = new System.Drawing.Point(403, 3);
            this.library_path_label.Name = "library_path_label";
            this.library_path_label.Size = new System.Drawing.Size(1610, 38);
            this.library_path_label.TabIndex = 0;
            //
            // button1
            //
            this.button1.Dock = System.Windows.Forms.DockStyle.Fill;
            this.button1.Location = new System.Drawing.Point(3, 3);
            this.button1.Name = "button1";
            this.button1.Size = new System.Drawing.Size(394, 52);
            this.button1.TabIndex = 1;
            this.button1.Text = "Open Family Library";
            this.button1.UseVisualStyleBackColor = true;
            //
            // tableLayoutPanel1
            //
            this.tableLayoutPanel1.ColumnCount = 2;
            this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 400F));
            this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
            this.tableLayoutPanel1.Controls.Add(this.button1, 0, 0);
            this.tableLayoutPanel1.Controls.Add(this.library_path_label, 1, 0);
            this.tableLayoutPanel1.Controls.Add(this.report, 1, 1);
            this.tableLayoutPanel1.Controls.Add(this.button_run, 0, 2);
            this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
            this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0);
            this.tableLayoutPanel1.Name = "tableLayoutPanel1";
            this.tableLayoutPanel1.RowCount = 3;
            this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 58F));
            this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
            this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 58F));
            this.tableLayoutPanel1.Size = new System.Drawing.Size(2016, 936);
            this.tableLayoutPanel1.TabIndex = 2;
            //
            // report
            //
            this.report.Dock = System.Windows.Forms.DockStyle.Fill;
            this.report.Location = new System.Drawing.Point(403, 61);
            this.report.Name = "report";
            this.report.Size = new System.Drawing.Size(1610, 814);
            this.report.TabIndex = 2;
            this.report.Text = "";
            //
            // button_run
            //
            this.button_run.Dock = System.Windows.Forms.DockStyle.Fill;
            this.button_run.Location = new System.Drawing.Point(3, 881);
            this.button_run.Name = "button_run";
            this.button_run.Size = new System.Drawing.Size(394, 52);
            this.button_run.TabIndex = 3;
            this.button_run.Text = "Run";
            this.button_run.UseVisualStyleBackColor = true;
            this.button_run.Click += new System.EventHandler(this.ButtonRun_Click);
            //
            // PurgeForm
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(16F, 31F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(2016, 936);
            this.Controls.Add(this.tableLayoutPanel1);
            this.MinimumSize = new System.Drawing.Size(1010, 729);
            this.Name = "PurgeForm";
            this.Text = "PurgeForm";
            this.tableLayoutPanel1.ResumeLayout(false);
            this.tableLayoutPanel1.PerformLayout();
            this.ResumeLayout(false);

        }

        #endregion

        private System.Windows.Forms.TextBox library_path_label;
        private System.Windows.Forms.Button button1;
        private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
        private System.Windows.Forms.RichTextBox report;
        private System.Windows.Forms.Button button_run;
    }
}

redpajama_set_name: RedPajamaGithub


text:
      <button class="btn btn-outline-primary" ngbDropdownToggle>
        Category: {{ selectedCategory || "Select a Category" }}
      </button>

        <button
          class="dropdown-item"
          *ngFor="let cat of allCategories"
          (click)="setCategory(cat)"
        >
          {{ cat }}
        </button>

      <input
        formControlName="search"
        class="form-control"
        type="search"
        placeholder="search by description"
      />

    <button
      type="button"
      class="btn  btn-success col-2"
      (click)="openModal(null)"
    >
      Add New Item
    </button>

    <app-detail-card
      *ngFor="let item of filteredItems; index as i"
      [item]="item"
      [index]="i"
      (editEmitter)="openModal($event)"
    ></app-detail-card>


text:
<?php

/*
 * This file is part of the Active Collab Authentication project.
 *
 * (c) A51 doo <info@activecollab.com>. All rights reserved.
 */

namespace ActiveCollab\Authentication\Session;

use ActiveCollab\Authentication\AuthenticationResult\AuthenticationResultInterface;

/**
 * @package ActiveCollab\Authentication\Session
 */
interface SessionInterface extends AuthenticationResultInterface
{
    const SESSION_DURATION_SHORT = 'short';
    const SESSION_DURATION_LONG = 'long';
    const DEFAULT_SESSION_DURATION = self::SESSION_DURATION_SHORT;

    const SESSION_DURATIONS = [
        self::SESSION_DURATION_SHORT,
        self::SESSION_DURATION_LONG,
    ];

    /**
     * @return string
     */
    public function getSessionId();

    /**
     * @return int
     */
    public function getSessionTtl();

    /**
     * Extend session for the set TTL while using $timestamp as reference (defaults to time() when empty).
     *
     * @param int|null $reference_timestamp
     */
    public function extendSession($reference_timestamp = null);
}


text:
package fi.imberg.juhani.ernu.interpreter.nodes;

import fi.imberg.juhani.ernu.interpreter.Environment;
import fi.imberg.juhani.ernu.interpreter.exceptions.RuntimeException;
import fi.imberg.juhani.ernu.interpreter.interfaces.Node;

/**
 * If nodes are just your everyday if/else/end structure. To be replaced.
 */
public class IfNode implements Node {
    /**
     * The first branches conditional node, must resolve into a BooleanNode
     */
    private final Node conditional;
    /**
     * The trueBranch gets executed if the conditional is true
     */
    private final BlockNode trueBranch;
    /**
     * The falseBranch gets executed if the conditional is false
     */
    private final BlockNode falseBranch;

    /**
     * @param conditional The first branches conditional node, must resolve into a BooleanNode
     * @param trueBranch  The trueBranch gets executed if the conditional is true
     * @param falseBranch The falseBranch gets executed if the conditional is false
     */
    public IfNode(Node conditional, BlockNode trueBranch, BlockNode falseBranch) {
        this.conditional = conditional;
        this.trueBranch = trueBranch;
        this.falseBranch = falseBranch;
    }

    @Override
    public String toString() {
        return "(if " + conditional + " " + trueBranch + " " + falseBranch + ")";
    }

    @Override
    public Node getValue(Environment environment) throws RuntimeException {
        Node truth = conditional.getValue(environment);
        if (!(truth instanceof BooleanNode)) {
            throw new RuntimeException("Conditional is not a boolean");
        }

        if (((BooleanNode) truth).isTrue()) {
            return trueBranch.getValue(environment);
        } else {
            return falseBranch.getValue(environment);
        }
    }
}


text:
<?php

namespace Thonior\MasterBundle\Form;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;

class UniverseType extends AbstractType
{
        /**
     * @param FormBuilderInterface $builder
     * @param array $options
     */
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder
            ->add('name')
            ->add('description')
        ;
    }

    /**
     * @param OptionsResolverInterface $resolver
     */
    public function setDefaultOptions(OptionsResolverInterface $resolver)
    {
        $resolver->setDefaults(array(
            'data_class' => 'Thonior\MasterBundle\Entity\Universe'
        ));
    }

    /**
     * @return string
     */
    public function getName()
    {
        return 'thonior_masterbundle_universe';
    }
}


text:
import unittest
from asq.queryables import Queryable, Grouping

__author__ = "Robert Smallshire"

class TestToLookup(unittest.TestCase):

    def test_to_lookup(self):
        a = ['Agapanthus', 'Allium', 'Alpina', 'Alstroemeria', 'Amaranthus', 'Amarylis', 'Bouvardia', 'Carnations',
             'Cattleya', 'Celosia', 'Chincherinchee', 'Chrysanthemum']
        b = Queryable(a).to_lookup(lambda x: x[0])
        self.assertEqual(len(b), 3)
        g1 = b['A']
        g2 = b['B']
        g3 = b['C']
        self.assert_(isinstance(g1, Grouping))
        self.assert_(isinstance(g2, Grouping))
        self.assert_(isinstance(g3, Grouping))
        self.assertEqual(g1.to_list(), ['Agapanthus', 'Allium', 'Alpina', 'Alstroemeria', 'Amaranthus', 'Amarylis'])
        self.assertEqual(g2.to_list(), ['Bouvardia'])
        self.assertEqual(g3.to_list(), ['Carnations', 'Cattleya', 'Celosia', 'Chincherinchee', 'Chrysanthemum'])

    def test_to_lookup_key_selector(self):
        a = ['Aardvark', 'Balloon', 'Carrot', 'Daisy', 'Ecological']
        b = Queryable(a).to_lookup(lambda x: x[0])
        self.assertEqual(len(b), 5)
        g1 = b['A']
        g2 = b['B']
        g3 = b['C']
        g4 = b['D']
        g5 = b['E']
        self.assert_(isinstance(g1, Grouping))
        self.assert_(isinstance(g2, Grouping))
        self.assert_(isinstance(g3, Grouping))
        self.assert_(isinstance(g4, Grouping))
        self.assert_(isinstance(g5, Grouping))
        self.assertEqual(g1.to_list(), ['Aardvark'])
        self.assertEqual(g2.to_list(), ['Balloon'])
        self.assertEqual(g3.to_list(), ['Carrot'])
        self.assertEqual(g4.to_list(), ['Daisy'])
        self.assertEqual(g5.to_list(), ['Ecological'])

    def test_to_lookup_key_selector_not_callable(self):
        a = ['Aardvark', 'Balloon', 'Carrot', 'Daisy', 'Ecological']
        self.assertRaises(TypeError, lambda: Queryable(a).to_lookup("not callable"))

    def test_to_lookup_value_selector(self):
        a = ['Aardvark', 'Balloon', 'Carrot', 'Daisy', 'Ecological']
        b = Queryable(a).to_lookup(value_selector=len)
        self.assertEqual(len(b), 5)
        g1 = b['Aardvark']
        g2 = b['Balloon']
        g3 = b['Carrot']
        g4 = b['Daisy']
        g5 = b['Ecological']
        self.assert_(isinstance(g1, Grouping))
        self.assert_(isinstance(g2, Grouping))
        self.assert_(isinstance(g3, Grouping))
        self.assert_(isinstance(g4, Grouping))
        self.assert_(isinstance(g5, Grouping))
        self.assertEqual(g1.to_list(), [8])
        self.assertEqual(g2.to_list(), [7])
        self.assertEqual(g3.to_list(), [6])
        self.assertEqual(g4.to_list(), [5])
        self.assertEqual(g5.to_list(), [10])

    def test_to_lookup_value_selector_not_callable(self):
        a = ['Aardvark', 'Balloon', 'Carrot', 'Daisy', 'Ecological']
        self.assertRaises(TypeError, lambda: Queryable(a).to_lookup(value_selector="not callable"))

    def test_to_lookup_duplicate_keys(self):
        a = ['Aardvark', 'Balloon', 'Baboon', 'Carrot', 'Daisy', 'Ecological']
        b = Queryable(a).to_lookup(lambda x: x[0])
        self.assertEqual(len(b), 5)
        g1 = b['A']
        g2 = b['B']
        g3 = b['C']
        g4 = b['D']
        g5 = b['E']
        self.assert_(isinstance(g1, Grouping))
        self.assert_(isinstance(g2, Grouping))
        self.assert_(isinstance(g3, Grouping))
        self.assert_(isinstance(g4, Grouping))
        self.assert_(isinstance(g5, Grouping))
        self.assertEqual(g1.to_list(), ['Aardvark'])
        self.assertEqual(g2.to_list(), ['Balloon', 'Baboon'])
        self.assertEqual(g3.to_list(), ['Carrot'])
        self.assertEqual(g4.to_list(), ['Daisy'])
        self.assertEqual(g5.to_list(), ['Ecological'])

    def test_to_lookup_closed(self):
        a = ['Aardvark', 'Balloon', 'Carrot', 'Daisy', 'Ecological']
        b = Queryable(a)
        b.close()
        self.assertRaises(ValueError, lambda: b.to_lookup())


text:
import { Token } from '../api/credentials';
import { FirestoreError } from '../util/error';
/**
 * A connected RPC interface to a remote Datastore.
 *
 * Responsible for maintaining a connection to the backend (and informing when
 * that connection state changes via onConnectionStateChange) and sending RPCs
 * when possible.
 *
 * The Connection is not responsible for queueing RPCs to the backend when
 * the connection is down.
 *
 * RPC messages are expected to be JavaScript objects representing the JSON that
 * would be sent over the REST/JSON API to Datastore or used as input to
 * creating the equivalent protocol buffers for GRPC.
 */
export interface Connection {
    /**
     * Invokes an RPC by name, given a request message as a JavaScript object
     * representing the JSON to send.
     *
     * @param rpcName the name of the RPC to invoke
     * @param request the Raw JSON object encoding of the request message
     * @param token the Token to use for the RPC.
     * @return a Promise containing the JSON object encoding of the response
     */
    invokeRPC(rpcName: string, request: any, token: Token | null): Promise<any>;
    /**
     * Invokes a streaming RPC by name, given a request message as a JavaScript
     * object representing the JSON to send. The responses will be consumed to
     * completion and then returned as an array.
     *
     * @param rpcName the name of the RPC to invoke
     * @param request the Raw JSON object encoding of the request message
     * @param token the Token to use for the RPC.
     * @return a Promise containing an array with the JSON object encodings of the
     * responses
     */
    invokeStreamingRPC(rpcName: string, request: any, token: Token | null): Promise<any[]>;
    /**
     * Opens a stream to the given stream RPC endpoint. Returns a stream which
     * will try to open itself.
     * @param rpcName the name of the RPC to open the stream on
     * @param token the Token to use for the RPC.
     */
    openStream(rpcName: string, token: Token | null): Stream<any, any>;
}
/**
 * A bidirectional stream that can be used to send an receive messages.
 *
 * A stream can be closed locally with close() or can be closed remotely or
 * through network errors. onClose is guaranteed to be called. onOpen will only
 * be called if the stream successfully established a connection.
 */
export interface Stream<I, O> {
    onOpen(callback: () => void): void;
    onClose(callback: (err?: FirestoreError) => void): void;
    onMessage(callback: (msg: O) => void): void;
    send(msg: I): void;
    close(): void;
}


text:
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* vim:set ts=4 sts=4 sw=4 et cin: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#include "nsFTPChannel.h"
#include "nsFtpConnectionThread.h"  // defines nsFtpState

#include "nsIStreamListener.h"
#include "nsIServiceManager.h"
#include "nsThreadUtils.h"
#include "nsNetUtil.h"
#include "nsMimeTypes.h"
#include "nsReadableUtils.h"
#include "nsIPrefService.h"
#include "nsIPrefBranch.h"
#include "nsIStreamConverterService.h"
#include "nsISocketTransport.h"
#include "nsURLHelper.h"
#include "mozilla/Attributes.h"

#if defined(PR_LOGGING)
extern PRLogModuleInfo* gFTPLog;
#endif /* PR_LOGGING */

////////////// this needs to move to nspr
static inline uint32_t
PRTimeToSeconds(PRTime t_usec)
{
    return uint32_t(t_usec / PR_USEC_PER_SEC);
}

#define NowInSeconds() PRTimeToSeconds(PR_Now())
////////////// end

// There are two transport connections established for an
// ftp connection. One is used for the command channel , and
// the other for the data channel. The command channel is the first
// connection made and is used to negotiate the second, data, channel.
// The data channel is driven by the command channel and is either
// initiated by the server (PORT command) or by the client (PASV command).
// Client initiation is the most common case and is attempted first.

//-----------------------------------------------------------------------------

NS_IMPL_ISUPPORTS_INHERITED4(nsFtpChannel,
                             nsBaseChannel,
                             nsIUploadChannel,
                             nsIResumableChannel,
                             nsIFTPChannel,
                             nsIProxiedChannel)

//-----------------------------------------------------------------------------

NS_IMETHODIMP
nsFtpChannel::SetUploadStream(nsIInputStream *stream,
                              const nsACString &contentType,
                              int64_t contentLength)
{
    NS_ENSURE_TRUE(!IsPending(), NS_ERROR_IN_PROGRESS);

    mUploadStream = stream;

    // NOTE: contentLength is intentionally ignored here.

    return NS_OK;
}

NS_IMETHODIMP
nsFtpChannel::GetUploadStream(nsIInputStream **stream)
{
    NS_ENSURE_ARG_POINTER(stream);
    *stream = mUploadStream;
    NS_IF_ADDREF(*stream);
    return NS_OK;
}

//-----------------------------------------------------------------------------

NS_IMETHODIMP
nsFtpChannel::ResumeAt(uint64_t aStartPos, const nsACString& aEntityID)
{
    NS_ENSURE_TRUE(!IsPending(), NS_ERROR_IN_PROGRESS);
    mEntityID = aEntityID;
    mStartPos = aStartPos;
    mResumeRequested = (mStartPos || !mEntityID.IsEmpty());
    return NS_OK;
}

NS_IMETHODIMP
nsFtpChannel::GetEntityID(nsACString& entityID)
{
    if (mEntityID.IsEmpty())
      return NS_ERROR_NOT_RESUMABLE;

    entityID = mEntityID;
    return NS_OK;
}

//-----------------------------------------------------------------------------
NS_IMETHODIMP
nsFtpChannel::GetProxyInfo(nsIProxyInfo** aProxyInfo)
{
    *aProxyInfo = ProxyInfo();
    NS_IF_ADDREF(*aProxyInfo);
    return NS_OK;
}

//-----------------------------------------------------------------------------

nsresult
nsFtpChannel::OpenContentStream(bool async, nsIInputStream **result,
                                nsIChannel** channel)
{
    if (!async)
        return NS_ERROR_NOT_IMPLEMENTED;

    nsFtpState *state = new nsFtpState();
    if (!state)
        return NS_ERROR_OUT_OF_MEMORY;
    NS_ADDREF(state);

    nsresult rv = state->Init(this);
    if (NS_FAILED(rv)) {
        NS_RELEASE(state);
        return rv;
    }

    *result = state;
    return NS_OK;
}

bool
nsFtpChannel::GetStatusArg(nsresult status, nsString &statusArg)
{
    nsAutoCString host;
    URI()->GetHost(host);
    CopyUTF8toUTF16(host, statusArg);
    return true;
}

void
nsFtpChannel::OnCallbacksChanged()
{
    mFTPEventSink = nullptr;
}

//-----------------------------------------------------------------------------

namespace {

class FTPEventSinkProxy MOZ_FINAL : public nsIFTPEventSink
{
public:
    FTPEventSinkProxy(nsIFTPEventSink* aTarget)
        : mTarget(aTarget)
        , mTargetThread(do_GetCurrentThread())
    { }

    NS_DECL_ISUPPORTS
    NS_DECL_NSIFTPEVENTSINK

    class OnFTPControlLogRunnable : public nsRunnable
    {
    public:
        OnFTPControlLogRunnable(nsIFTPEventSink* aTarget,
                                bool aServer,
                                const char* aMessage)
            : mTarget(aTarget)
            , mServer(aServer)
            , mMessage(aMessage)
        { }

        NS_DECL_NSIRUNNABLE

    private:
        nsCOMPtr<nsIFTPEventSink> mTarget;
        bool mServer;
        nsCString mMessage;
    };

private:
    nsCOMPtr<nsIFTPEventSink> mTarget;
    nsCOMPtr<nsIThread> mTargetThread;
};

NS_IMPL_THREADSAFE_ISUPPORTS1(FTPEventSinkProxy, nsIFTPEventSink)

NS_IMETHODIMP
FTPEventSinkProxy::OnFTPControlLog(bool aServer, const char* aMsg)
{
    nsRefPtr<OnFTPControlLogRunnable> r =
        new OnFTPControlLogRunnable(mTarget, aServer, aMsg);
    return mTargetThread->Dispatch(r, NS_DISPATCH_NORMAL);
}

NS_IMETHODIMP
FTPEventSinkProxy::OnFTPControlLogRunnable::Run()
{
    mTarget->OnFTPControlLog(mServer, mMessage.get());
    return NS_OK;
}

} // anonymous namespace

void
nsFtpChannel::GetFTPEventSink(nsCOMPtr<nsIFTPEventSink> &aResult)
{
    if (!mFTPEventSink) {
        nsCOMPtr<nsIFTPEventSink> ftpSink;
        GetCallback(ftpSink);
        if (ftpSink) {
            mFTPEventSink = new FTPEventSinkProxy(ftpSink);
        }
    }
    aResult = mFTPEventSink;
}


text:
package android.game.guessmynumber;

import java.util.Random;

public class DisplayResult {

	public DisplayResult(){

	}
	public String returnbackgroundName(){
		return switchBackground();
	}

	private String switchBackground(){
		Random rand = new Random();
		int number = rand.nextInt(4);
		String num = null;
		switch(number){
		case 0:
			num =  "w1";
			break;
		case 1:
			num = "w2";
			break;
		case 2:
			num =  "w3";
			break;
		case 3:
			num = "w4";
			break;
		}
		return num;
	}
	private String switchResultBackground(){
		Random rand = new Random();
		int number = rand.nextInt(2);
		String num = null;
		switch(number){
		case 0:
			num =  "n1";
			break;
		case 1:
			num = "n2";
			break;
		}
		return num;
	}

	public String returnbackResultgroundName(){
		return switchResultBackground();
	}

}


text:
<!DOCTYPE html>

        <meta charset="utf-8" />
        <title>Atlantis.Framework.js - Demo</title>

        <link rel="icon" href="../web/favicon.png" />

Preferred Back Buffer Sizes

Width <input id="width" type="text" value="320" />

Height <input id="height" type="text" value="240" />

Scale Mode

            <select id="scaleMode">
                <option selected="selected" value="0">Scale To Fit</option>
                <option value="1">Conserve Aspect Ratio</option>
                <option value="2">No Scale</option>
            </select>
            <button id="validate">Apply changes</button>


text:
/**
 * Utility class containing methods which run in the context of the inspectedWindow
 */
Ext.define('AI.util.extjs.Profile', {
    singleton : true,

    /**
     * @returns {Array}
     */
    getOvernestedComponents : function () {
        var components = [];

        Ext.ComponentManager.each(function (id) {
            var c = Ext.getCmp(id);
            if (c.isContainer && !c.isHeader && !c.isXType('tablepanel') && !c.isXType('headercontainer') && !c.hasCls('x-fieldset-header') && c.items.items.length === 1) {
                components.push({
                    cmpId : c.id,
                    xtype : c.xtype
                });
            }
        });

        return components;
    },

    /**
     * @returns {Array}
     */
    getNestedBoxLayouts : function () {
        var components = [];

        var isContainer = function (c) {
            return (c.isContainer && !c.isHeader && !c.isXType('tablepanel') && !c.isXType('headercontainer') && !c.hasCls('x-fieldset-header') &&
                    c.items.items.length > 0);
        };

        var isBoxLayout = function (c) {
            return (c.getLayout().type === 'vbox' || c.getLayout().type === 'hbox');
        };

        Ext.ComponentManager.each(function (id) {
            var cmp = Ext.getCmp(id);

            if (isContainer(cmp) && isBoxLayout(cmp) && cmp.flex) {
                components.push({
                    cmpId : cmp.id,
                    xtype : cmp.xtype
                });
            }
        });

        return components;
    },

    /**
     *
     */
    stopLayouts : function () {
        if (Ext.ux.AppInspector.layoutCaptureFn) {
            Ext.layout.Context.prototype.runComplete = Ext.ux.AppInspector.layoutCaptureFn;

            Ext.ux.AppInspector.layoutRunTotal = null;
            Ext.ux.AppInspector.layoutCollection = null;
            Ext.ux.AppInspector.layoutCaptureFn = null;
        }
    },

    /**
     * @returns {Array}
     */
    recordLayouts : function () {
        if (Ext.ux.AppInspector.layoutRunTotal === null) {
            Ext.ux.AppInspector.layoutRunTotal = 0;
            Ext.ux.AppInspector.layoutCollection = [];

            //store a reference so we can reset it later
            Ext.ux.AppInspector.layoutCaptureFn = Ext.layout.Context.prototype.runComplete;

            //create an intercept function for our purposes
            var interceptFn = function () {
                Ext.ux.AppInspector.layoutRunTotal++;

                var items = [];

                Ext.Object.each(this.items, function (key, item) {
                    //TODO: is there any better way to do this?
                    // "item" is an Ext.layout.ContextItem and I don't see any way to access the original component
                    // item.target?
                    var comp = Ext.getCmp(key);

                    if (comp) {
                        items.push({
                            text     : comp.id + (comp.itemId ? ' (' + comp.itemId + ')' : ''),
                            cmpId    : comp.id || '',
                            itemId   : comp.itemId || '',
                            xtype    : comp.xtype,
                            children : []
                        });
                    }
                    else {
                        items.push({
                            text     : key,
                            cmpId    : '',
                            itemId   : '',
                            xtype    : '',
                            children : []
                        });
                    }
                });

                Ext.ux.AppInspector.layoutCollection.push({
                    text     : 'Layout run #' + Ext.ux.AppInspector.layoutRunTotal + ' ( ' + items.length + 'items)',
                    cmpId    : '',
                    itemId   : '',
                    xtype    : '',
                    children : items
                });
            };

            Ext.layout.Context.prototype.runComplete = function () {
                Ext.ux.AppInspector.layoutCaptureFn.apply(this, arguments);
                return interceptFn.apply(this, arguments);
            };
        }

        var layouts = Ext.ux.AppInspector.layoutCollection;

        //clear each time so we don't duplicate
        Ext.ux.AppInspector.layoutCollection = [];

        return layouts;
    }
});


text: export * from './SlugPreview'


text:
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
  <component name="Encoding" useUTFGuessing="true" native2AsciiForPropertiesFiles="false">
    <file url="file://$PROJECT_DIR$/gulpfile.js" charset="UTF-8" />
    <file url="file://$PROJECT_DIR$/index.html" charset="UTF-8" />
  </component>
</project>


text:
<?php

abstract class TumblrTestCase extends \PHPUnit\Framework\TestCase
{
    /**
     * @dataProvider providerCalls
     */
    public function testCalls($callable, $type, $path, $params, $which_mock = 'perfect')
    {
        // a good response
        $response = $this->getResponseMock($which_mock);

        // Create request mock and set it to check for the proper response
        $request = $this->createMock('Tumblr\API\RequestHandler', array('request'));
        $request->expects($this->once())
            ->method('request')
            ->with($this->equalTo($type), $this->equalTo($path), $this->equalTo($params))
            ->will($this->returnValue($response));

        // Create a new client and set it up to use that request handler
        $client = new Tumblr\API\Client(API_KEY);
        $ref = new ReflectionObject($client);
        $prop = $ref->getProperty('requestHandler');
        $prop->setAccessible(true);
        $prop->setValue($client, $request);

        // Give it tokens
        $client->setToken('t1', 't2');

        // And then run the callback to check the results
        $callable($client);
    }

    private function getResponseMock($which)
    {
        $response = new stdClass;
        if ($which == 'perfect') {
            $response->status = 200;
            $response->body = '{"response":[]}';
        } elseif ($which == 'redirect') {
            $response->status = 301;
            $response->headers = array('Location' => array('url'));
        } elseif ($which == 'not_found') {
            $response->status = 404;
            $response->body = '{}';
        }

        return $response;
    }

}


text:
from __future__ import unicode_literals

from django.db import migrations, models

class Migration(migrations.Migration):

    dependencies = [
        ('shows', '0010_show_autoslug'),
    ]

    operations = [
        migrations.AddField(
            model_name='showslot',
            name='week',
            field=models.IntegerField(blank=True, choices=[(1, 'Odd Weeks'), (2, 'Even Weeks')], default=None, null=True),
        ),
        migrations.AlterUniqueTogether(
            name='showslot',
            unique_together=set([('slate', 'week', 'day', 'start_time', 'end_time')]),
        ),
    ]


text:
layout: sidebar_links
title: Frontends
---

Csound is an audio library that provides users with an extensive arrays of audio
functions. As with most libraries, it can be accessed through so-called
**front-ends** that communicate with the core library. The classic front-end is
CLI(Command Line Interface) *csound*, which is present in all desktop
installations of Csound. If you use the Csound from the command line you can
edit your Csound code with any source code editor you like.

Learning to use Csound from the command line can be a bit daunting for most
beginners. Thankfully there exists a number of integrated solutions for using
Csound in a more user-friendly graphical environment. Listed below are some of
the more popular solutions. Each of these applications are supported, developed
and promoted by members of the Csound community.

### CsoundQT

[CsoundQT](http://qutecsound.sourceforge.net/) This is the default editor for
Csound and ships with most of the Csound installer. It has nice tools for
editing Csound files, comes with easy editable widgets and a huge example
collection.

### Blue

[Blue](http://blue.kunstmusik.com) is an amazingly comprehensive composition
tool for working with Csound.

### Cabbage and Cabbage Studio

[Cabbage](http://www.cabbageaudio.com/) is an IDE for developing audio plugins
and standalone software with Csound. The IDE includes a full patching
environment for testing and prototyping instruments, and provides an extensive
array of GUI widgets to help users to create unique and professional looking
audio software. It also ships with over 100 ready to use plugins. The Cabbage
installers include Csound, so there is no need for a separate Csound install.
**Cabbage Studio** goes further and transforms Cabbage into a DAW with patching
interface.

### WinXound

[WinXound](http://winxound.codeplex.com) is a simple but solid front-end for
Csound. Unlike the other front-ends listed here, WinXound does not embed Csound.
Therefore it will forever work with every single version of Csound from the very
first to the very last without any need to update or reinstall. You will need
to install Csound prior to use WinXound.

### Csound-x for Emacs
[Csound-x](http://www.zogotounga.net/comp/csoundx.html) is a set of editing
modes and libraries intended to compose music for Csound using the legendary
Emacs environment.

### RunloopSound

RunloopSound is a Csound frontend for iOS devices. It supports most cloud
providers, runs on iPads and iPhones alike, and features audio in, MIDI support,
as well as syntax highlighting and line numbers.


text:
package nats

import (
	"os"
	"testing"
	"time"

	"github.com/nats-io/nats-server/v2/server"
)

func TestNoRaceParseStateReconnectFunctionality(t *testing.T) {
	ts := RunServerOnPort(TEST_PORT)
	ch := make(chan bool)

	opts := reconnectOpts
	dch := make(chan bool)
	dErrCh := make(chan bool)
	opts.DisconnectedErrCB = func(_ *Conn, _ error) {
		dErrCh <- true
	}
	opts.DisconnectedCB = func(_ *Conn) {
		dch <- true
	}
	opts.NoCallbacksAfterClientClose = true

	nc, errc := opts.Connect()
	if errc != nil {
		t.Fatalf("Failed to create a connection: %v\n", errc)
	}
	ec, errec := NewEncodedConn(nc, DEFAULT_ENCODER)
	if errec != nil {
		nc.Close()
		t.Fatalf("Failed to create an encoded connection: %v\n", errec)
	}
	defer ec.Close()

	testString := "bar"
	ec.Subscribe("foo", func(s string) {
		if s != testString {
			t.Fatal("String doesn't match")
		}
		ch <- true
	})
	ec.Flush()

	// Simulate partialState, this needs to be cleared.
	nc.mu.Lock()
	nc.ps.state = OP_PON
	nc.mu.Unlock()

	ts.Shutdown()
	// server is stopped here...

	if err := Wait(dErrCh); err != nil {
		t.Fatal("Did not get the DisconnectedErrCB")
	}

	select {
	case <-dch:
		t.Fatal("Get the DEPRECATED DisconnectedCB while DisconnectedErrCB was set")
	default:
	}

	if err := ec.Publish("foo", testString); err != nil {
		t.Fatalf("Failed to publish message: %v\n", err)
	}

	ts = RunServerOnPort(TEST_PORT)
	defer ts.Shutdown()

	if err := ec.FlushTimeout(5 * time.Second); err != nil {
		t.Fatalf("Error on Flush: %v", err)
	}

	if err := Wait(ch); err != nil {
		t.Fatal("Did not receive our message")
	}

	expectedReconnectCount := uint64(1)
	reconnectedCount := ec.Conn.Stats().Reconnects

	if reconnectedCount != expectedReconnectCount {
		t.Fatalf("Reconnect count incorrect: %d vs %d\n",
			reconnectedCount, expectedReconnectCount)
	}
	nc.Close()
}

func TestNoRaceJetStreamConsumerSlowConsumer(t *testing.T) {
	// This test fails many times, need to look harder at the imbalance.
	t.SkipNow()

	s := RunServerOnPort(-1)
	defer s.Shutdown()

	if err := s.EnableJetStream(nil); err != nil {
		t.Fatalf("Expected no error, got %v", err)
	}
	defer os.RemoveAll(s.JetStreamConfig().StoreDir)

	str, err := s.GlobalAccount().AddStream(&server.StreamConfig{
		Name:     "PENDING_TEST",
		Subjects: []string{"js.p"},
		Storage:  server.MemoryStorage,
	})
	if err != nil {
		t.Fatalf("stream create failed: %v", err)
	}

	nc, _ := Connect(s.ClientURL())
	defer nc.Close()

	// Override default handler for test.
	nc.SetErrorHandler(func(_ *Conn, _ *Subscription, _ error) {})

	// Queue up 1M small messages.
	toSend := uint64(1_000_000)
	for i := uint64(0); i < toSend; i++ {
		nc.Publish("js.p", []byte("ok"))
	}
	nc.Flush()

	if nm := str.State().Msgs; nm != toSend {
		t.Fatalf("Expected to have stored all %d msgs, got only %d", toSend, nm)
	}

	js, err := nc.JetStream()
	if err != nil {
		t.Fatalf("Unexpected error: %v", err)
	}

	var received uint64
	done := make(chan bool, 1)

	js.Subscribe("js.p", func(m *Msg) {
		received++
		if received >= toSend {
			done <- true
		}
		meta, err := m.MetaData()
		if err != nil {
			t.Fatalf("could not get message metadata: %s", err)
		}
		if meta.Stream != received {
			t.Errorf("Missed a sequence, was expecting %d but got %d, last error: '%v'", received, meta.Stream, nc.LastError())
			nc.Close()
		}
		m.Ack()
	})

	select {
	case <-time.After(5 * time.Second):
		t.Fatalf("Failed to get all %d messages, only got %d", toSend, received)
	case <-done:
	}
}


text:
package org.apache.hadoop.hive.serde2.lazy;

import org.apache.hadoop.hive.serde2.lazy.objectinspector.primitive.LazyBooleanObjectInspector;
import org.apache.hadoop.io.BooleanWritable;

/**
 * LazyObject for storing a value of boolean.
 *
 *

 * Part of the code is adapted from Apache Harmony Project.
 *
 * As with the specification, this implementation relied on code laid out in Henry S. Warren, Jr.'s Hacker's
 * Delight, (Addison Wesley, 2002) as well as The Aggregate's Magic Algorithms.
 *

 *
 */
public class LazyBoolean extends
    LazyPrimitive<LazyBooleanObjectInspector, BooleanWritable> {

  public LazyBoolean(LazyBooleanObjectInspector oi) {
    super(oi);
    data = new BooleanWritable();
  }

  public LazyBoolean(LazyBoolean copy) {
    super(copy);
    data = new BooleanWritable(copy.data.get());
  }

  @Override
  public void init(ByteArrayRef bytes, int start, int length) {
    if (length == 4 && Character.toUpperCase(bytes.getData()[start]) == 'T'
        && Character.toUpperCase(bytes.getData()[start + 1]) == 'R'
        && Character.toUpperCase(bytes.getData()[start + 2]) == 'U'
        && Character.toUpperCase(bytes.getData()[start + 3]) == 'E') {
      data.set(true);
      isNull = false;
    } else if (length == 5
        && Character.toUpperCase(bytes.getData()[start]) == 'F'
        && Character.toUpperCase(bytes.getData()[start + 1]) == 'A'
        && Character.toUpperCase(bytes.getData()[start + 2]) == 'L'
        && Character.toUpperCase(bytes.getData()[start + 3]) == 'S'
        && Character.toUpperCase(bytes.getData()[start + 4]) == 'E') {
      data.set(false);
      isNull = false;
    } else {
      if (oi.isExtendedLiteral()) {
        if (length == 1) {
          byte c = bytes.getData()[start];
          if (c == '1' || c == 't' || c == 'T') {
            data.set(true);
            isNull = false;
          } else if (c == '0' || c == 'f' || c == 'F') {
            data.set(false);
            isNull = false;
          } else {
            isNull = true;
          }
        }
      } else {
        isNull = true;
        logExceptionMessage(bytes, start, length, "BOOLEAN");
      }
    }
  }

}


text:
package org.apache.gossip;

import java.io.File;
import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import java.security.NoSuchAlgorithmException;
import java.security.NoSuchProviderException;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.UUID;
import java.util.concurrent.TimeUnit;

import org.apache.gossip.manager.GossipManager;
import org.apache.gossip.manager.GossipManagerBuilder;
import org.apache.gossip.manager.PassiveGossipConstants;
import org.apache.gossip.secure.KeyTool;
import org.junit.Assert;
import org.junit.Test;

import io.teknek.tunit.TUnit;

public class SignedMessageTest extends AbstractIntegrationBase {

  private GossipSettings gossiperThatSigns(){
    GossipSettings settings = new GossipSettings();
    settings.setPersistRingState(false);
    settings.setPersistDataState(false);
    settings.setSignMessages(true);
    return settings;
  }

  private GossipSettings gossiperThatSigns(String keysDir){
    GossipSettings settings = gossiperThatSigns();
    settings.setPathToKeyStore(Objects.requireNonNull(keysDir));
    return settings;
  }

  @Test
  public void dataTest() throws InterruptedException, URISyntaxException, NoSuchAlgorithmException, NoSuchProviderException, IOException {
    final String keys = System.getProperty("java.io.tmpdir") + "/keys";
    GossipSettings settings = gossiperThatSigns(keys);
    setup(keys);
    String cluster = UUID.randomUUID().toString();
    List<Member> startupMembers = new ArrayList<>();
    for (int i = 1; i < 2; ++i) {
      URI uri = new URI("udp://" + "127.0.0.1" + ":" + (30000 + i));
      startupMembers.add(new RemoteMember(cluster, uri, i + ""));
    }
    final List<GossipManager> clients = new ArrayList<>();
    for (int i = 1; i < 3; ++i) {
      URI uri = new URI("udp://" + "127.0.0.1" + ":" + (30000 + i));
      GossipManager gossipService = GossipManagerBuilder.newBuilder()
              .cluster(cluster)
              .uri(uri)
              .id(i + "")
              .gossipMembers(startupMembers)
              .gossipSettings(settings)
              .build();
      gossipService.init();
      clients.add(gossipService);
    }
    assertTwoAlive(clients);
    assertOnlySignedMessages(clients);
    cleanup(keys, clients);
  }

  private void assertTwoAlive(List<GossipManager> clients){
    TUnit.assertThat(() -> {
      int total = 0;
      for (int i = 0; i < clients.size(); ++i) {
        total += clients.get(i).getLiveMembers().size();
      }
      return total;
    }).afterWaitingAtMost(20, TimeUnit.SECONDS).isEqualTo(2);
  }

  private void assertOnlySignedMessages(List<GossipManager> clients){
    Assert.assertEquals(0, clients.get(0).getRegistry()
            .meter(PassiveGossipConstants.UNSIGNED_MESSAGE).getCount());
    Assert.assertTrue(clients.get(0).getRegistry()
            .meter(PassiveGossipConstants.SIGNED_MESSAGE).getCount() > 0);
  }

  private void cleanup(String keys, List<GossipManager> clients){
    new File(keys, "1").delete();
    new File(keys, "2").delete();
    new File(keys).delete();
    for (int i = 0; i < clients.size(); ++i) {
      clients.get(i).shutdown();
    }
  }

  private void setup(String keys) throws NoSuchAlgorithmException, NoSuchProviderException, IOException {
    new File(keys).mkdir();
    KeyTool.generatePubandPrivateKeyFiles(keys, "1");
    KeyTool.generatePubandPrivateKeyFiles(keys, "2");
  }
}


text:
package org.elasticsearch.transport.nio.channel;

import org.elasticsearch.transport.nio.NetworkBytesReference;
import org.elasticsearch.transport.nio.ESSelector;
import org.elasticsearch.transport.nio.SocketSelector;

import java.io.IOException;
import java.net.InetSocketAddress;
import java.nio.ByteBuffer;
import java.nio.channels.ClosedChannelException;
import java.nio.channels.SocketChannel;
import java.util.Arrays;

public class NioSocketChannel extends AbstractNioChannel<SocketChannel> {

    private final InetSocketAddress remoteAddress;
    private final ConnectFuture connectFuture = new ConnectFuture();
    private volatile SocketSelector socketSelector;
    private WriteContext writeContext;
    private ReadContext readContext;

    public NioSocketChannel(String profile, SocketChannel socketChannel) throws IOException {
        super(profile, socketChannel);
        this.remoteAddress = (InetSocketAddress) socketChannel.getRemoteAddress();
    }

    @Override
    public CloseFuture closeAsync() {
        clearQueuedWrites();

        return super.closeAsync();
    }

    @Override
    public void closeFromSelector() {
        // Even if the channel has already been closed we will clear any pending write operations just in case
        clearQueuedWrites();

        super.closeFromSelector();
    }

    @Override
    public SocketSelector getSelector() {
        return socketSelector;
    }

    @Override
    boolean markRegistered(ESSelector selector) {
        this.socketSelector = (SocketSelector) selector;
        return super.markRegistered(selector);
    }

    public int write(NetworkBytesReference[] references) throws IOException {
        int written;
        if (references.length == 1) {
            written = socketChannel.write(references[0].getReadByteBuffer());
        } else {
            ByteBuffer[] buffers = new ByteBuffer[references.length];
            for (int i = 0; i < references.length; ++i) {
                buffers[i] = references[i].getReadByteBuffer();
            }
            written = (int) socketChannel.write(buffers);
        }
        if (written <= 0) {
            return written;
        }

        NetworkBytesReference.vectorizedIncrementReadIndexes(Arrays.asList(references), written);

        return written;
    }

    public int read(NetworkBytesReference reference) throws IOException {
        int bytesRead = socketChannel.read(reference.getWriteByteBuffer());

        if (bytesRead == -1) {
            return bytesRead;
        }

        reference.incrementWrite(bytesRead);
        return bytesRead;
    }

    public void setContexts(ReadContext readContext, WriteContext writeContext) {
        this.readContext = readContext;
        this.writeContext = writeContext;
    }

    public WriteContext getWriteContext() {
        return writeContext;
    }

    public ReadContext getReadContext() {
        return readContext;
    }

    public InetSocketAddress getRemoteAddress() {
        return remoteAddress;
    }

    public boolean isConnectComplete() {
        return connectFuture.isConnectComplete();
    }

    public boolean isWritable() {
        return state.get() == REGISTERED;
    }

    public boolean isReadable() {
        return state.get() == REGISTERED;
    }

    /**
     * This method will attempt to complete the connection process for this channel. It should be called for
     * new channels or for a channel that has produced a OP_CONNECT event. If this method returns true then
     * the connection is complete and the channel is ready for reads and writes. If it returns false, the
     * channel is not yet connected and this method should be called again when a OP_CONNECT event is
     * received.
     *
     * @return true if the connection process is complete
     * @throws IOException if an I/O error occurs
     */
    public boolean finishConnect() throws IOException {
        if (connectFuture.isConnectComplete()) {
            return true;
        } else if (connectFuture.connectFailed()) {
            Exception exception = connectFuture.getException();
            if (exception instanceof IOException) {
                throw (IOException) exception;
            } else {
                throw (RuntimeException) exception;
            }
        }

        boolean isConnected = socketChannel.isConnected();
        if (isConnected == false) {
            isConnected = internalFinish();
        }
        if (isConnected) {
            connectFuture.setConnectionComplete(this);
        }
        return isConnected;
    }

    public ConnectFuture getConnectFuture() {
        return connectFuture;
    }

    private boolean internalFinish() throws IOException {
        try {
            return socketChannel.finishConnect();
        } catch (IOException e) {
            connectFuture.setConnectionFailed(e);
            throw e;
        } catch (RuntimeException e) {
            connectFuture.setConnectionFailed(e);
            throw e;
        }
    }

    private void clearQueuedWrites() {
        // Even if the channel has already been closed we will clear any pending write operations just in case
        if (state.get() > UNREGISTERED) {
            SocketSelector selector = getSelector();
            if (selector != null && selector.isOnCurrentThread() && writeContext.hasQueuedWriteOps()) {
                writeContext.clearQueuedWriteOps(new ClosedChannelException());
            }
        }
    }
}


text:
import Cookie from 'js-cookie';
const TOKEN_STRING = 'feathers-jwt';

export const setToken = (token) => {
  if (!process.browser) return;
  window.localStorage.setItem(TOKEN_STRING, token);
  Cookie.set(TOKEN_STRING, token);
};

export const unsetToken = () => {
  if (!process.browser) return;
  window.localStorage.removeItem(TOKEN_STRING);
  Cookie.remove(TOKEN_STRING);
};

export const getTokenFromCookie = (req) => {
  if (!req.headers.cookie) return;
  const jwtCookie = req.headers.cookie.split(';').find(c => c.trim().startsWith(`${TOKEN_STRING}=`));
  if (!jwtCookie) return;
  const jwt = jwtCookie.split('=')[1];
  return jwt;
};

export const getTokenFromLocalStorage = () => {
  const json = window.localStorage.getItem(TOKEN_STRING);
  return json;
};

export const getToken = ({isServer, req}) => {
  return isServer ? getTokenFromCookie(req) : getTokenFromLocalStorage();
};


text:
cask 'butterflight-configurator' do
  version '10.4.2'
  sha256 'e5843174417970c483bddc2356acf6bd3e8cefd7791ac50882838615abcb41a2'

  url "https://github.com/ButterFlight/butterflight-configurator/releases/download/v#{version}/butterflight-configurator_#{version}_macOS.dmg"
  appcast 'https://github.com/ButterFlight/butterflight-configurator/releases.atom',
          checkpoint: 'ac5b1ae1d0d06dd4327a71dfac7cef6529f3f49fe9baa9b6c8a8336d0366496d'
  name 'ButterFlight Configurator'
  homepage 'https://github.com/ButterFlight/butterflight-configurator'

  app 'ButterFlight Configurator.app'
end


text:
// source:

package nl.uva.vlet.vrl;

import java.io.IOException;
import java.net.URL;
import java.net.URLConnection;
import java.net.URLStreamHandler;

/**
 * VRLStreamHandler which support VRL URIs (VRL).
 * It extends URLStreamHandler with the supported protocols
 * from the VRS Registry.
 *
 * @author P.T. de Boer
 */

public class VRLStreamHandler extends URLStreamHandler
{

    @Override
    protected URLConnection openConnection(URL u) throws IOException
    {
        return new VRLConnection(u);
    }

}


text:
package org.osgl.util;

import org.osgl.$;

import java.util.*;

/**
 * `StringTokenSet` implement {@link Set} based on a list of String tokens separated by
 *  {@link #SEPARATOR}.
 *
 *  Examples:
 *
 *  * `"foo,bar"` contains `"foo"` and `"bar"`
 *  * `",,x,,y"` contains three empty string and `"x"`, `"y"`
 *
 *  This data structure is better to be used in case the string token set are unlikely to
 *  change and the number of string tokens are not very big (no bigger than 20)
 *
 *  This data structure is not thread safe
 */
public class StringTokenSet implements Set<String> {

    private String data;
    private boolean sorted;
    private int size;
    private String[] array;

    /**
     * The default separator: `,`
     */
    public static final String SEPARATOR = ",";
    public static final char SEPARATOR_CHAR = ',';

    public StringTokenSet() {
    }

    /**
     * Construct a `StringTokenSet` with given string
     * @param data the string contains tokens separated by {@link #SEPARATOR}
     */
    public StringTokenSet(String data) {
        StringTokenSet set = StringTokenSet.of(data);
        $.copy(set).to(this);
    }

    @Override
    public int size() {
        return size;
    }

    @Override
    public boolean isEmpty() {
        return 0 == size;
    }

    @Override
    public boolean contains(Object o) {
        if (null == data || !String.class.isInstance(o)) {
            return false;
        }
        int loc = locate((String) o);
        return loc > -1;
    }

    @Override
    public Iterator<String> iterator() {
        if (null == data) {
            return Iterators.nil();
        }
        final List<String> list = S.fastSplit(data, SEPARATOR);
        return list.iterator();
    }

    @Override
    public Object[] toArray() {
        ensureArray();
        return $.cloneOf(array);
    }

    @Override
    public <T> T[] toArray(T[] a) {
        if (a.length < size) {
            return $.cast(toArray());
        }
        ensureArray();
        System.arraycopy(array, 0, a, 0, size);
        return a;
    }

    @Override
    public boolean add(String s) {
        if (contains(s)) {
            return false;
        }
        if (null == data) {
            data = s;
        } else {
            data += SEPARATOR + s;
        }
        size++;
        array = null;
        sorted = false;
        return true;
    }

    @Override
    public boolean remove(Object o) {
        if (null == data || !String.class.isInstance(o)) {
            return false;
        }
        String s = (String) o;
        int loc = locate(s);
        if (loc < 0) {
            return false;
        }
        if (1 == size) {
            size = 0;
            data = null;
        } else {
            int sz = s.length();
            if (loc + sz >= data.length()) {
                data = data.substring(0, loc - 1);
            } else if (loc == 0) {
                data = data.substring(sz + 1);
            } else {
                String prefix = data.substring(0, loc - 1);
                String suffix = data.substring(loc + sz);
                data = prefix + suffix;
            }
            size--;
        }
        array = null;
        return true;
    }

    @Override
    public boolean containsAll(Collection<?> c) {
        for (Object o : c) {
            if (!contains(o)) {
                return false;
            }
        }
        return true;
    }

    @Override
    public boolean addAll(Collection<? extends String> c) {
        boolean changed = false;
        Set<String> set = C.Set(c);
        for (String s : set) {
            boolean b = add(s);
            changed = changed || b;
        }
        return changed;
    }

    @Override
    public boolean retainAll(Collection<?> c) {
        Set<String> toBeRemoved = new HashSet<>();
        for (String s: this) {
            if (!c.contains(s)) {
                toBeRemoved.add(s);
            }
        }
        for (String s : toBeRemoved) {
            remove(s);
        }
        return !toBeRemoved.isEmpty();
    }

    @Override
    public boolean removeAll(Collection<?> c) {
        boolean changed = false;
        for (Object o : c) {
            boolean b = remove(o);
            changed = changed || b;
        }
        return changed;
    }

    @Override
    public void clear() {
        data = null;
        array = null;
        size = 0;
    }

    @Override
    public int hashCode() {
        sort();
        return $.hc(data);
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == this) {
            return true;
        }
        if (obj instanceof StringTokenSet) {
            StringTokenSet that = $.cast(obj);
            if ($.eq(that.data, this.data)) {
                return true;
            }
            sort();
            that.sort();
            return $.eq(data, that.data);
        }
        if (obj instanceof Set) {
            Set set = (Set) obj;
            return set.equals(this);
        }
        return false;
    }

    @Override
    public String toString() {
        return data;
    }

    public StringTokenSet sort() {
        if (!sorted) {
            ensureArray();
            Arrays.sort(array);
            data = S.join(C.listOf(array)).by(SEPARATOR).get();
            sorted = true;
        }
        return this;
    }

    private int locate(String s) {
        int sz = s.length();
        int loc = data.indexOf(s);
        while (loc != -1) {
            boolean beginInTheMiddle = loc > 0 && data.charAt(loc - 1) != SEPARATOR_CHAR;
            if (beginInTheMiddle) {
                loc = data.indexOf(s, loc + 1);
                continue;
            }
            int end = loc + sz;
            boolean endInTheMiddle = size > end && data.charAt(end + 1) != SEPARATOR_CHAR;
            if (endInTheMiddle) {
                loc = data.indexOf(s, loc + 1);
                continue;
            }
            return loc;
        }
        return -1;
    }

    private void ensureArray() {
        if (null != array) {
            return;
        }
        if (0 == size) {
            array = S.EMPTY_ARRAY;
            return;
        }
        array = new String[size];
        int cur = 0;
        int i = 0;
        int loc = data.indexOf((int) SEPARATOR_CHAR, cur);
        while (loc != -1) {
            array[i++] = data.substring(cur, loc);
            cur = loc + 1;
            loc = data.indexOf((int) SEPARATOR_CHAR, cur);
        }
        array[i] = data.substring(cur, data.length());
    }

    public static StringTokenSet of(String data) {
        StringTokenSet set = new StringTokenSet();
        if (null != data) {
            set.addAll(S.fastSplit(data, SEPARATOR));
        }
        return set;
    }

    public static String merge(String a, String b) {
        if (null == a) {
            if (null == b) {
                return null;
            }
            return of(b).toString();
        } else if (null == b) {
            return of(a).toString();
        }
        String s = S.concat(a, SEPARATOR, b);
        return of(s).toString();
    }

    public static String merge(String a, String ... others) {
        return of(S.concat(a, S.join(others).by(SEPARATOR))).toString();
    }

    public static String merge(String[] sa) {
        return of(S.join(sa).by(SEPARATOR).get()).toString();
    }

    public static String merge(Collection<String> sa) {
        return of(S.join(sa).by(SEPARATOR).get()).toString();
    }

}


text:
package net.bootsfaces.component.dataTable;

import java.util.ArrayList;
import javax.faces.event.AbortProcessingException;
import javax.faces.event.ComponentSystemEvent;
import javax.faces.event.ListenerFor;
import javax.faces.event.ListenersFor;
import javax.faces.event.PostAddToViewEvent;

import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import javax.el.ValueExpression;
import javax.faces.component.FacesComponent;
import javax.faces.component.UIComponent;
import javax.faces.component.UIComponentBase;
import javax.faces.component.UIViewRoot;
import javax.faces.component.behavior.ClientBehaviorHolder;
import javax.faces.context.FacesContext;
import javax.faces.event.FacesEvent;

import net.bootsfaces.C;
import net.bootsfaces.component.ajax.IAJAXComponent;
import net.bootsfaces.component.ajax.IAJAXComponent2;
import net.bootsfaces.listeners.AddResourcesListener;
import net.bootsfaces.render.IContentDisabled;
import net.bootsfaces.render.IResponsive;
import net.bootsfaces.render.Tooltip;
import net.bootsfaces.utils.BsfUtils;

/**
 * This class holds the attributes of .
 */
@ListenersFor({
	@ListenerFor(systemEventClass = PostAddToViewEvent.class)})
@FacesComponent(DataTable.COMPONENT_TYPE)
public class DataTable extends DataTableCore implements IAJAXComponent, IAJAXComponent2, ClientBehaviorHolder,
	net.bootsfaces.render.IHasTooltip, IResponsive, IContentDisabled {

	public static final String COMPONENT_TYPE = C.BSFCOMPONENT + ".dataTable.DataTable";

	public static final String COMPONENT_FAMILY = C.BSFCOMPONENT;

	public static final String DEFAULT_RENDERER = "net.bootsfaces.component.dataTable.DataTable";

	private static final Collection<String> EVENT_NAMES = Collections.unmodifiableCollection(Arrays.asList("click",
		"dblclick", "dragstart", "dragover", "drop", "mousedown", "mousemove", "mouseout", "mouseover", "mouseup"));

	/**
	 * This map is used to store the column sort information gathered during rendering.
	 */
	private Map<Integer, String> columnSortOrder;

	/**
	 * This array is used to store the columnDef property used to initialize the columns using the columns attribute
	 * of datatables.net
	 */
	private List<String> columnDefinition;

	/**
	 * internal attribute used for b:dataTableColumn selectionMode="multiple"
	 */
	private String selectionMode2;

	/**
	 * This array is used to store the column information bits that are used to initialize the columns using the
	 * columns attribute of datatables.net
	 */
	private List<String> columnInfo;

	public enum DataTablePropertyType {
		pageLength, searchTerm, currentPage
	}

	public DataTable() {
		setRendererType(DEFAULT_RENDERER);
		Tooltip.addResourceFiles();
		AddResourcesListener.addThemedCSSResource("core.css");
		// DataTables with almost all extensions except Flash export and KeyTable - version of 10.11.2019
		AddResourcesListener.addExtCSSResource("datatables.min.css");
		AddResourcesListener.addResourceToHeadButAfterJQuery(C.BSF_LIBRARY, "js/pdfmake.min.js");
		AddResourcesListener.addResourceToHeadButAfterJQuery(C.BSF_LIBRARY, "js/vfs_fonts.js");
		AddResourcesListener.addResourceToHeadButAfterJQuery(C.BSF_LIBRARY, "js/datatables.min.js");
	}

	@Override
	public void setValueExpression(String name, ValueExpression binding) {
		name = BsfUtils.snakeCaseToCamelCase(name);
		super.setValueExpression(name, binding);
	}

	@Override
	public boolean getRendersChildren() {
		return true;
	}

	/**
	 * returns the subset of AJAX requests that are implemented by jQuery callback or other non-standard means (such
	 * as the onclick event of b:tabView, which has to be implemented manually).
	 *
	 * @return
	 */
	@Override
	public Map<String, String> getJQueryEvents() {
		Map<String, String> result = new HashMap<>();
		result.put("order", "order.dt");
		result.put("page", "page.dt");
		result.put("search", "search.dt");
		result.put("select", "select.dt");
		result.put("deselect", "deselect.dt");
		return result;
	}

	/**
	 * Returns the parameter list of jQuery and other non-standard JS callbacks. If there's no parameter list for a
	 * certain event, the default is simply "event".
	 *
	 * @return A hash map containing the events. May be null.
	 */
	@Override
	public Map<String, String> getJQueryEventParameterLists() {
		Map<String, String> result = new HashMap<>();
		result.put("select", "event, datatable, typeOfSelection, indexes");
		result.put("deselect", "event, datatable, typeOfSelection, indexes");
		return result;
	}

	/**
	 * Returns the subset of the parameter list of jQuery and other non-standard JS callbacks which is sent to the
	 * server via AJAX. If there's no parameter list for a certain event, the default is simply null.
	 *
	 * @return A hash map containing the events. May be null.
	 */
	@Override
	public Map<String, String> getJQueryEventParameterListsForAjax() {
		Map<String, String> result = new HashMap<>();
		result.put("select", "'typeOfSelection':typeOfSelection,'indexes':indexes");
		result.put("deselect", "'typeOfSelection':typeOfSelection,'indexes':indexes");
		return result;
	}

	@Override
	public Collection<String> getEventNames() {
		return EVENT_NAMES;
	}

	@Override
	public String getDefaultEventName() {
		return "click";
	}

	@Override
	public void processEvent(ComponentSystemEvent event) throws AbortProcessingException {
		if (isAutoUpdate()) {
			if (FacesContext.getCurrentInstance().isPostback()) {
				FacesContext.getCurrentInstance().getPartialViewContext().getRenderIds().add(getClientId());
			}
			super.processEvent(event);
		}
		List<UIComponent> columns = getChildren();
		for (UIComponent column : columns) {
			if (column.getAttributes().get("selectionMode") != null) {
				String selectionMode = (String) column.getAttributes().get("selectionMode");
				if ("multiple".equals(selectionMode)) {
					importCheckboxColumnLib();
				}
			}
		}

	}

	@Override
	public String getFamily() {
		return COMPONENT_FAMILY;
	}

	/**
	 * This map contains all of the default sorting for each column. This map is used to store the column sort
	 * information gathered during rendering.
	 *
	 * @return The map containing the column / sort type pairs
	 */
	public Map<Integer, String> getColumnSortOrderMap() {
		return columnSortOrder;
	}

	/**
	 * Called in order to lazily initialize the map. This map is used to store the column sort information gathered
	 * during rendering.
	 */
	public void initColumnSortOrderMap() {
		this.columnSortOrder = new HashMap<>();
	}

	/**
	 * This array is used to store the columnDef attribute used to initialize the columns using the columns
	 * attribute of datatables.net
	 *
	 * @return
	 */
	public List<String> getColumnDefinition() {
		return columnDefinition;
	}

	/**
	 * This array is used to store the columnDef attribute used to initialize the columns using the columns
	 * attribute of datatables.net
	 *
	 * @param columnDefinition
	 */
	public void setColumnDefinition(List<String> columnDefinition) {
		this.columnDefinition = columnDefinition;
	}

	/**
	 * This array is used to store the column information bits that are used to initialize the columns using the
	 * columns attribute of datatables.net
	 *
	 * @return
	 */
	public List<String> getColumnInfo() {
		return columnInfo;
	}

	/**
	 * This array is used to store the column information bits that are used to initialize the columns using the
	 * columns attribute of datatables.net
	 *
	 * @param columnInfo
	 */
	public void setColumnInfo(List<String> columnInfo) {
		this.columnInfo = columnInfo;
	}

	/**
	 *

	 * Queue an event for broadcast at the end of the current request processing lifecycle phase. The default
	 * implementation in {@link UIComponentBase} must delegate this call to the queueEvent() method of
	 * the parent {@link UIComponent}.
	 *

	 *
	 * @param event {@link FacesEvent} to be queued
	 *
	 * @throws IllegalStateException if this component is not a descendant of a {@link UIViewRoot}
	 * @throws NullPointerException if event is null
	 */
	@Override
	public void queueEvent(FacesEvent event) {
		FacesContext context = FacesContext.getCurrentInstance();
		String indexes = (String) context.getExternalContext().getRequestParameterMap().get("indexes");
		context.getELContext().getELResolver().setValue(context.getELContext(), null, "indexes", indexes);
		String typeOfSelection = (String) context.getExternalContext().getRequestParameterMap().get("typeOfSelection");
		context.getELContext().getELResolver().setValue(context.getELContext(), null, "typeOfSelection", typeOfSelection);

		// https://datatables.net/reference/event/deselect#Description
		// split the array of indexes
		List<Integer> indexList = new ArrayList<>();
		if (null != indexes) {
			Matcher regexMatcher = Pattern.compile("(\\d+)").matcher(indexes);
			if (regexMatcher.find()) {
				indexList.add(Integer.valueOf(regexMatcher.group()));
			}
		}

		if (indexList.size() > 0) {
			// use the first index only
			int oldIndex = getRowIndex();
			setRowIndex(indexList.get(0));
			super.queueEvent(event);
			setRowIndex(oldIndex);
		} else {
			super.queueEvent(event);
		}
	}

	@Override
	public void setSelectedColumn(Object _selectedColumn) {
		super.setSelectedColumn(_selectedColumn);
		if (_selectedColumn != null) {
			setSelect(true);
			setSelectedItems("column");
		}
	}

	@Override
	public void setSelectedRow(Object _selectedRow) {
		super.setSelectedRow(_selectedRow);
		if (_selectedRow != null) {
			setSelect(true);
			setSelectedItems("row");
		}
	}

	@Override
	public void setSelectionMode(String _selectectionMode) {
		super.setSelectionMode(_selectectionMode);
		if (_selectectionMode != null) {
			setSelect(true);
		}
	}

	/**
	 * internal attribute used for b:dataTableColumn selectionMode="multiple"
	 * @return
	 */
	public String getSelectionMode2() {
		return selectionMode2;
	}

	/**
	 * internal attribute used for b:dataTableColumn selectionMode="multiple"
	 * @param selectionMode2
	 */
	public void setSelectionMode2(String selectionMode2) {
		this.selectionMode2 = selectionMode2;
	}

	@Override
	public void setSelectedItems(String _selectedItems) {
		super.setSelectedItems(_selectedItems);
		if (_selectedItems != null) {
			setSelect(true);
		}

	}

	/**
	 * If true, search results are marked yellow as you type. Based on mark.js (see
	 * https://datatables.net/blog/2017-01-19).
	 *

	 * Usually this method is called internally by the JSF engine.
	 * @param _markSearchResults
	 */
	@Override
	public void setMarkSearchResults(boolean _markSearchResults) {
		if (_markSearchResults) {
			AddResourcesListener.addBasicJSResource(C.BSF_LIBRARY, "js/datatables.mark.min.js");
			AddResourcesListener.addBasicJSResource(C.BSF_LIBRARY, "js/mark.js-jquery.mark.min.js");
			AddResourcesListener.addExtCSSResource("datatables.mark.min.css");
		}
		super.setMarkSearchResults(_markSearchResults);
	}

	void importCheckboxColumnLib() {
		AddResourcesListener.addBasicJSResource(C.BSF_LIBRARY, "js/dataTables.checkboxes.min.js");
		AddResourcesListener.addExtCSSResource("dataTables.checkboxes.css");
	}

}


text:
package pgtype

import (
	"fmt"
	"reflect"
)

// Record is the generic PostgreSQL record type such as is created with the
// "row" function. Record only implements BinaryEncoder and Value. The text
// format output format from PostgreSQL does not include type information and is
// therefore impossible to decode. No encoders are implemented because
// PostgreSQL does not support input of generic records.
type Record struct {
	Fields []Value
	Status Status
}

func (dst *Record) Set(src interface{}) error {
	if src == nil {
		*dst = Record{Status: Null}
		return nil
	}

	if value, ok := src.(interface{ Get() interface{} }); ok {
		value2 := value.Get()
		if value2 != value {
			return dst.Set(value2)
		}
	}

	switch value := src.(type) {
	case []Value:
		*dst = Record{Fields: value, Status: Present}
	default:
		return fmt.Errorf("cannot convert %v to Record", src)
	}

	return nil
}

func (dst Record) Get() interface{} {
	switch dst.Status {
	case Present:
		return dst.Fields
	case Null:
		return nil
	default:
		return dst.Status
	}
}

func (src *Record) AssignTo(dst interface{}) error {
	switch src.Status {
	case Present:
		switch v := dst.(type) {
		case *[]Value:
			*v = make([]Value, len(src.Fields))
			copy(*v, src.Fields)
			return nil
		case *[]interface{}:
			*v = make([]interface{}, len(src.Fields))
			for i := range *v {
				(*v)[i] = src.Fields[i].Get()
			}
			return nil
		default:
			if nextDst, retry := GetAssignToDstType(dst); retry {
				return src.AssignTo(nextDst)
			}
			return fmt.Errorf("unable to assign to %T", dst)
		}
	case Null:
		return NullAssignTo(dst)
	}

	return fmt.Errorf("cannot decode %#v into %T", src, dst)
}

func prepareNewBinaryDecoder(ci *ConnInfo, fieldOID uint32, v *Value) (BinaryDecoder, error) {
	var binaryDecoder BinaryDecoder

	if dt, ok := ci.DataTypeForOID(fieldOID); ok {
		binaryDecoder, _ = dt.Value.(BinaryDecoder)
	} else {
		return nil, fmt.Errorf("unknown oid while decoding record: %v", fieldOID)
	}

	if binaryDecoder == nil {
		return nil, fmt.Errorf("no binary decoder registered for: %v", fieldOID)
	}

	// Duplicate struct to scan into
	binaryDecoder = reflect.New(reflect.ValueOf(binaryDecoder).Elem().Type()).Interface().(BinaryDecoder)
	*v = binaryDecoder.(Value)
	return binaryDecoder, nil
}

func (dst *Record) DecodeBinary(ci *ConnInfo, src []byte) error {
	if src == nil {
		*dst = Record{Status: Null}
		return nil
	}

	scanner := NewCompositeBinaryScanner(ci, src)

	fields := make([]Value, scanner.FieldCount())

	for i := 0; scanner.Next(); i++ {
		binaryDecoder, err := prepareNewBinaryDecoder(ci, scanner.OID(), &fields[i])
		if err != nil {
			return err
		}

		if err = binaryDecoder.DecodeBinary(ci, scanner.Bytes()); err != nil {
			return err
		}
	}

	if scanner.Err() != nil {
		return scanner.Err()
	}

	*dst = Record{Fields: fields, Status: Present}

	return nil
}


text:
/**
 * This program and the accompanying materials
 * are made available under the terms of the License
 * which accompanies this distribution in the file LICENSE.txt
 */
package com.archimatetool.editor.ui.factory.elements;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.gef.EditPart;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.Image;

import com.archimatetool.editor.diagram.editparts.ArchimateElementEditPart;
import com.archimatetool.editor.diagram.figures.elements.DeviceFigure;
import com.archimatetool.editor.ui.IArchiImages;
import com.archimatetool.model.IArchimatePackage;

/**
 * Device UI Provider
 *
 * @author Phillip Beauvoir
 */
public class DeviceUIProvider extends AbstractArchimateElementUIProvider {

    @Override
    public EClass providerFor() {
        return IArchimatePackage.eINSTANCE.getDevice();
    }

    @Override
    public EditPart createEditPart() {
        return new ArchimateElementEditPart(DeviceFigure.class);
    }

    @Override
    public String getDefaultName() {
        return Messages.DeviceUIProvider_0;
    }

    @Override
    public Image getImage() {
        return IArchiImages.ImageFactory.getImage(IArchiImages.ICON_DEVICE);
    }

    @Override
    public ImageDescriptor getImageDescriptor() {
        return IArchiImages.ImageFactory.getImageDescriptor(IArchiImages.ICON_DEVICE);
    }

    @Override
    public Color getDefaultColor() {
        return defaultTechnologyColor;
    }
}


text:
(function(undefined){
	'use strict';
	QUnit.module('thruster.content.SoundManager');

	QUnit.test('load(), with valid URL', function(assert){
		var manager, config, done, onSuccess;

		manager = new thruster.content.SoundManager();
		config = [
	        new thruster.content.SoundConfig('sound', ['../../content/sound.mp3', '../../content/sound.ogg'], false, 0.9),
	        new thruster.content.SoundConfig('loopingsound', ['../../content/sound.ogg', '../../content/sound.mp3'], true, 0.5)
	    ];
		done = assert.async();

		onSuccess = function(){
			assert.ok(true, 'Success callback called when texture is loaded.');
			done();
		};

		manager.preload(config, onSuccess);
	});

	QUnit.test('load(), with invalid URL', function(assert){
		var manager, config, done, onError;

		manager = new thruster.content.SoundManager();
		config = [
	        new thruster.content.SoundConfig('sound', ['../../content/invalidsound.butts'], false, 0.9)
	    ];
		done = assert.async();

		onError = function(){
			assert.ok(true, 'Error callback called for invalid URL.');
			done();
		};

		manager.preload(config, undefined, onError);
	});
})();


text:
package de.otto.jsonhome.client;

/**
 * @author Guido Steinacker
 * @since 27.10.12
 */
public class HttpStatusException extends JsonHomeClientException {

    private final int httpStatusCode;

    public  HttpStatusException(final int httpStatusCode, final String message) {
        super(message);
        this.httpStatusCode = httpStatusCode;
    }

    public int getHttpStatusCode() {
        return httpStatusCode;
    }
}


text:
<?php

namespace RubtsovAV\YandexWordstatParser;

class YandexUser
{
	/**
	 * The Yandex user login
	 *
	 * @var string
	 */
	protected $login;

	/**
	 * The Yandex user password
	 *
	 * @var string
	 */
	protected $password;

	/**
	 * The path storage, where browser will be save all user data: cookies, local storage, etc.
	 *
	 * @var string
	 */
	protected $storagePath;

	/**
	 * @param string $login    The Yandex user login
	 * @param string $password The Yandex user password
	 * @param string|null $storagePath The storage path
	 */
	public function __construct(string $login, string $password, string $storagePath = null)
	{
		$this->login = $login;
		$this->password = $password;
		$this->storagePath = $storagePath;
	}

	/**
	 * Returns the Yandex user login
	 *
	 * @return string
	 */
	public function getLogin()
	{
		return $this->login;
	}

	/**
	 * Returns the Yandex user password
	 *
	 * @return string
	 */
	public function getPassword()
	{
		return $this->password;
	}

	/**
	 * Returns the storage path
	 *
	 * @return string|null
	 */
	public function getStoragePath()
	{
		return $this->storagePath;
	}

	/**
	 * Converting to an array
	 *
	 * @return array
	 */
	public function toArray()
	{
		return [
			'login' => $this->getLogin(),
			'password' => $this->getPassword(),
			'storagePath' => $this->getStoragePath(),
		];
	}
}