text:
$(shell mkdir -p build/test build/test src/lib/osx/build)

pwd=$(shell pwd)
uname=$(shell uname)
architecture=$(shell uname -m)
timestamp=$(shell date "+%Y-%m-%d-%H-%M-%S")

pocodir=third_party/poco
openssldir=third_party/openssl
jsoncppdir=third_party/jsoncpp/dist

GTEST_ROOT=third_party/googletest-read-only

source_dirs=src/*.cc src/*.h src/test/*.cc src/test/*.h \
	src/ui/linux/TogglDesktop/toggl.h src/ui/linux/TogglDesktop/toggl.cpp \
	src/ui/linux/TogglDesktop/aboutdialog.h src/ui/linux/TogglDesktop/aboutdialog.cpp \
	src/ui/linux/TogglDesktop/autocompleteview.h src/ui/linux/TogglDesktop/autocompleteview.cpp \
	src/ui/linux/TogglDesktop/errorviewcontroller.h src/ui/linux/TogglDesktop/errorviewcontroller.cpp \
	src/ui/linux/TogglDesktop/feedbackdialog.h src/ui/linux/TogglDesktop/feedbackdialog.cpp \
	src/ui/linux/TogglDesktop/genericview.h src/ui/linux/TogglDesktop/genericview.cpp \
	src/ui/linux/TogglDesktop/idlenotificationdialog.h src/ui/linux/TogglDesktop/idlenotificationdialog.cpp \
	src/ui/linux/TogglDesktop/loginwidget.h src/ui/linux/TogglDesktop/loginwidget.cpp \
	src/ui/linux/TogglDesktop/main.cpp \
	src/ui/linux/TogglDesktop/mainwindowcontroller.h src/ui/linux/TogglDesktop/mainwindowcontroller.cpp \
	src/ui/linux/TogglDesktop/preferencesdialog.h src/ui/linux/TogglDesktop/preferencesdialog.cpp \
	src/ui/linux/TogglDesktop/settingsview.h src/ui/linux/TogglDesktop/settingsview.cpp \
	src/ui/linux/TogglDesktop/timeentrycellwidget.h src/ui/linux/TogglDesktop/timeentrycellwidget.cpp \
	src/ui/linux/TogglDesktop/timeentryeditorwidget.h src/ui/linux/TogglDesktop/timeentryeditorwidget.cpp \
	src/ui/linux/TogglDesktop/timeentryview.h src/ui/linux/TogglDesktop/timeentryview.cpp \
	src/ui/linux/TogglDesktop/timerwidget.h src/ui/linux/TogglDesktop/timerwidget.cpp \
	src/ui/linux/TogglDesktop/clickablelabel.h src/ui/linux/TogglDesktop/clickablelabel.cpp

ifndef QMAKE
QMAKE=qmake
endif

ifndef MSBUILD
MSBUILD=/cygdrive/c/Program\ Files/MSBuild/12.0/Bin/MSBuild.exe
endif

ifeq ($(uname), Darwin)
executable=./src/ui/osx/TogglDesktop/build/Release/TogglDesktop.app/Contents/MacOS/TogglDesktop
pocolib=$(pocodir)/lib/Darwin/x86_64/
osname=mac
endif

ifeq ($(uname), Linux)
executable=./src/ui/linux/TogglDesktop/build/release/TogglDesktop
pocolib=$(pocodir)/lib/Linux/$(architecture)
osname=linux
endif

ifneq (, $(findstring CYGWIN, $(uname) ))
executable=./src/ui/windows/TogglDesktop/TogglDesktop/bin/release/TogglDesktop.exe
pocolib=$(pocodir)/lib/CYGWIN/i686
osname=windows
endif

ifeq ($(osname), mac)
cflags=-g -Wall -Wextra -Wno-deprecated -Wno-unused-parameter -Wunreachable-code -DLUA_USE_MACOSX \
	-I$(openssldir)/include \
	-I$(GTEST_ROOT)/include \
	-I$(GTEST_ROOT) \
	-I$(pocodir)/Foundation/include \
	-I$(pocodir)/Util/include \
	-I$(pocodir)/Data/include \
	-I$(pocodir)/Data/SQLite/include \
	-I$(pocodir)/Crypto/include \
	-I$(pocodir)/Net/include \
	-I$(pocodir)/NetSSL_OpenSSL/include \
	-I$(jsoncppdir) \
	-Ithird_party/lua/install/include \
	-DNDEBUG
endif

ifeq ($(osname), linux)
cflags=-g -Wall -Wextra -Wno-deprecated -Wno-unused-parameter -static \
	-I$(openssldir)/include \
	-I$(GTEST_ROOT)/include \
	-I$(GTEST_ROOT) \
	-I$(pocodir)/Foundation/include \
	-I$(pocodir)/Util/include \
	-I$(pocodir)/Data/include \
	-I$(pocodir)/Data/SQLite/src \
	-I$(pocodir)/Data/SQLite/include \
	-I$(pocodir)/Crypto/include \
	-I$(pocodir)/Net/include \
	-I$(pocodir)/NetSSL_OpenSSL/include \
	-I$(jsoncppdir) \
	-Ithird_party/lua/install/include \
	-DNDEBUG
endif

ifeq ($(osname), windows)
cflags=-g -Wall -Wextra -Wno-deprecated -Wno-unused-parameter -static \
	-I$(openssldir)/inc32 \
	-I$(GTEST_ROOT)/include \
	-I$(GTEST_ROOT) \
	-I$(pocodir)/Foundation/include \
	-I$(pocodir)/Util/include \
	-I$(pocodir)/Data/include \
	-I$(pocodir)/Data/SQLite/src \
	-I$(pocodir)/Data/SQLite/include \
	-I$(pocodir)/Crypto/include \
	-I$(pocodir)/Net/include \
	-I$(pocodir)/NetSSL_OpenSSL/include \
	-I$(jsoncppdir) \
	-Ithird_party/lua/install/include \
	-DNDEBUG
endif

ifeq ($(osname), mac)
libs=-framework Carbon \
	-L$(pocolib) \
	-lPocoDataSQLite \
	-lPocoData \
	-lPocoNet \
	-lPocoNetSSL \
	-lPocoCrypto \
	-lPocoUtil \
	-lPocoXML \
	-lPocoJSON \
	-lPocoFoundation \
	-lpthread \
	-L$(openssldir) \
	-lssl \
	-lcrypto \
        -Lthird_party/lua/install/lib \
	-llua \
	-ldl
endif

ifeq ($(osname), linux)
libs=-lX11 \
	-L$(pocolib) \
	-lPocoDataSQLite \
	-lPocoData \
	-lPocoNet \
	-lPocoNetSSL \
	-lPocoCrypto \
	-lPocoUtil \
	-lPocoXML \
	-lPocoJSON \
	-lPocoFoundation \
	-lpthread \
	-L$(openssldir) \
	-lssl \
	-lcrypto \
	-lrt \
        -Lthird_party/lua/install/lib \
	-llua \
	-ldl
endif

ifeq ($(osname), windows)
libs= -L$(pocolib) \
	-lPocoDataSQLite \
	-lPocoData \
	-lPocoNet \
	-lPocoNetSSL \
	-lPocoCrypto \
	-lPocoUtil \
	-lPocoXML \
	-lPocoJSON \
	-lPocoFoundation \
	-lpthread \
	-L$(openssldir) \
	-lrt \
	-lpsapi \
        -Lthird_party/lua/install/lib \
	-llua
endif

cxx=g++ -fprofile-arcs -ftest-coverage -std=gnu++0x

ifeq ($(osname), windows)
default: fmt app
endif

default: fmt app

csapi:
	go run src/script/generate_cs_api.go
	mcs src/ui/windows/TogglDesktop/TogglDesktop/Toggl.cs src/ui/windows/TogglDesktop/TogglDesktop/TogglApi.cs /target:library

clean: clean_ui clean_lib clean_test
	rm -rf build coverage

ifeq ($(osname), linux)
clean_lib:
	rm -rf src/lib/linux/TogglDesktopLibrary/build && \
	(cd src/lib/linux/TogglDesktopLibrary && $(QMAKE) && make clean)
endif

ifeq ($(osname), mac)
clean_lib:
	rm -rf src/lib/osx/build
endif

ifeq ($(osname), windows)
clean_lib:
	$(MSBUILD) src/lib/windows/TogglDesktopDLL/TogglDesktopDLL.vcxproj /p:Configuration=Release /target:Clean
endif

ifeq ($(osname), linux)
clean_ui: clean-bugsnag-qt
	(cd src/ui/linux/TogglDesktop && $(QMAKE) && make clean) && \
	rm -rf src/ui/linux/TogglDesktop/build
endif

ifeq ($(osname), mac)
clean_ui:
	rm -rf src/ui/osx/TogglDesktop/build third_party/TFDatePicker/TFDatePicker/build TogglDesktop*.dmg TogglDesktop*.tar.gz
endif

ifeq ($(osname), windows)
clean_ui:
	$(MSBUILD) src/ui/windows/TogglDesktop/TogglDesktop.sln /p:Configuration=Release /t:TogglDesktop:Clean
endif

clean_test:
	rm -rf test/*
	mkdir -p test

lint:
	./third_party/cpplint/cpplint.py $(source_dirs)

cppclean:
	./third_party/cppclean/cppclean -q --include-path=src/lib/include --include-path=third_party/poco/Crypto/include --include-path=third_party/poco/Net/include --include-path=third_party/poco/NetSSL_OpenSSL/include --include-path=third_party/poco/Foundation/include --include-path=third_party/poco/Util/include --include-path=third_party/poco/Data/include --include-path=third_party/poco/Data/SQLite/include --include-path=third_party/poco/Data/SQLite/src --include-path=third_party/lua/install/include src/*.*

qa: lint fmt cppclean test

fmt: fmt_lib fmt_ui

app: lib ui

ifeq ($(osname), mac)
lib:
	xcodebuild -project src/lib/osx/TogglDesktopLibrary.xcodeproj
endif

ifeq ($(osname), linux)
lib:
	cd src/lib/linux/TogglDesktopLibrary && $(QMAKE) && make && \
	cd ../../../../ && \
	cp $(openssldir)/*so* src/lib/linux/TogglDesktopLibrary/build/release
	cp $(pocodir)/lib/Linux/$(architecture)/libPocoCrypto.so.31 src/lib/linux/TogglDesktopLibrary/build/release
	cp $(pocodir)/lib/Linux/$(architecture)/libPocoData.so.31 src/lib/linux/TogglDesktopLibrary/build/release && \
	cp $(pocodir)/lib/Linux/$(architecture)/libPocoDataSQLite.so.31 src/lib/linux/TogglDesktopLibrary/build/release && \
	cp $(pocodir)/lib/Linux/$(architecture)/libPocoFoundation.so.31 src/lib/linux/TogglDesktopLibrary/build/release && \
	cp $(pocodir)/lib/Linux/$(architecture)/libPocoNet.so.31 src/lib/linux/TogglDesktopLibrary/build/release && \
	cp $(pocodir)/lib/Linux/$(architecture)/libPocoNetSSL.so.31 src/lib/linux/TogglDesktopLibrary/build/release && \
	cp $(pocodir)/lib/Linux/$(architecture)/libPocoUtil.so.31 src/lib/linux/TogglDesktopLibrary/build/release && \
	cp $(pocodir)/lib/Linux/$(architecture)/libPocoXML.so.31 src/lib/linux/TogglDesktopLibrary/build/release && \
	cp $(pocodir)/lib/Linux/$(architecture)/libPocoJSON.so.31 src/lib/linux/TogglDesktopLibrary/build/release
endif

ifeq ($(osname), windows)
lib:
	$(MSBUILD) src/ui/windows/TogglDesktop/TogglDesktop.sln /p:Configuration=Release /t:TogglDesktopDLL
endif

ifeq ($(osname), mac)
ui:
	xcodebuild -project src/ui/osx/TogglDesktop/TogglDesktop.xcodeproj && \
	!(otool -L $(executable) | grep "Users" && echo "Executable should not contain hardcoded paths!")
endif

ifeq ($(osname), linux)
ui: bugsnag-qt
	cd src/ui/linux/TogglDesktop && $(QMAKE) && make && \
	cd ../../../../ && \
	cp src/ssl/cacert.pem src/ui/linux/TogglDesktop/build/release
endif

ifeq ($(osname), windows)
ui:
	$(MSBUILD) src/ui/windows/TogglDesktop/TogglDesktop.sln /p:Configuration=Release
endif

clean-bugsnag-qt:
	rm -rf third_party/bugsnag-qt/build && \
	cd third_party/bugsnag-qt && $(QMAKE) && make clean

bugsnag-qt: clean-bugsnag-qt
	cd third_party/bugsnag-qt && $(QMAKE) && make

run: app
	$(executable)

clean_deps:
	cd $(pocodir) && (make clean || true)
	rm -rf $(pocodir)/**/.dep
	cd $(openssldir) && (make clean || true)
	cd third_party/lua && make clean

deps: clean_deps openssl poco lua

ifeq ($(osname), linux)
lua:
	cd third_party/lua && make linux && make local
endif

ifeq ($(osname), mac)
lua:
	cd third_party/lua && make macosx && make local
endif

ifeq ($(osname), windows)
lua:
	cd third_party/lua && make generic && make local
endif

ifeq ($(osname), mac)
openssl:
	cd $(openssldir) && ./config -fPIC no-shared no-dso && ./Configure darwin64-x86_64-cc && make
endif

ifeq ($(osname), linux)
openssl:
	cd $(openssldir) && ./config -fPIC shared no-dso && make
endif

ifeq ($(osname), windows)
openssl:
	cd $(openssldir) && ./config shared no-dso && ./Configure Cygwin && make
endif

poco:
ifeq ($(osname), windows)
	cd $(pocodir) && \
	./configure --omit=Data/ODBC,Data/MySQL,Zip,JSON,MongoDB,PageCompiler,PageCompiler/File2Page,CppUnit --no-tests --no-samples \
	--sqlite-thread-safe=0 \
	--include-path=$(pwd)/$(openssldir)/inc32 --library-path=$(pwd)/$(openssldir) && \
	make clean && \
	make
else
	cd $(pocodir) && \
	./configure --omit=Data/ODBC,Data/MySQL,Zip,JSON,MongoDB,PageCompiler,PageCompiler/File2Page,CppUnit --no-tests --no-samples --cflags=-fPIC \
	--sqlite-thread-safe=1 \
	--include-path=$(pwd)/$(openssldir)/include --library-path=$(pwd)/$(openssldir) && \
	make clean && \
	make
endif

third_party/google-astyle/build/google-astyle:
	cd third_party/google-astyle && mkdir -p build && g++ *.cpp -o build/google-astyle

fmt_lib: third_party/google-astyle/build/google-astyle
	third_party/google-astyle/build/google-astyle -n $(source_dirs)
	third_party/google-astyle/build/google-astyle -n src/ui/windows/TogglDesktop/TogglDesktopDLLInteropTest//*.cs

fmt_ui:
	./third_party/Xcode-formatter/CodeFormatter/scripts/formatAllSources.sh src/ui/osx/
	third_party/google-astyle/build/google-astyle -n src/ui/windows/TogglDesktop/TogglDesktop/*.cs
	third_party/google-astyle/build/google-astyle -n src/ui/windows/TogglDesktop/TogglDesktop/TogglApi.cs

build/jsoncpp.o: $(jsoncppdir)/jsoncpp.cpp
	$(cxx) $(cflags) -c $(jsoncppdir)/jsoncpp.cpp -o build/jsoncpp.o

build/proxy.o: src/proxy.cc
	$(cxx) $(cflags) -c src/proxy.cc -o build/proxy.o

build/netconf.o: src/netconf.cc
	$(cxx) $(cflags) -c src/netconf.cc -o build/netconf.o

build/https_client.o: src/https_client.cc
	$(cxx) $(cflags) -c src/https_client.cc -o build/https_client.o

build/websocket_client.o: src/websocket_client.cc
	$(cxx) $(cflags) -c src/websocket_client.cc -o build/websocket_client.o

build/base_model.o: src/base_model.cc
	$(cxx) $(cflags) -c src/base_model.cc -o build/base_model.o

build/user.o: src/user.cc
	$(cxx) $(cflags) -c src/user.cc -o build/user.o

build/workspace.o: src/workspace.cc
	$(cxx) $(cflags) -c src/workspace.cc -o build/workspace.o

build/client.o: src/client.cc
	$(cxx) $(cflags) -c src/client.cc -o build/client.o

build/project.o: src/project.cc
	$(cxx) $(cflags) -c src/project.cc -o build/project.o

build/task.o: src/task.cc
	$(cxx) $(cflags) -c src/task.cc -o build/task.o

build/time_entry.o: src/time_entry.cc
	$(cxx) $(cflags) -c src/time_entry.cc -o build/time_entry.o

build/tag.o: src/tag.cc
	$(cxx) $(cflags) -c src/tag.cc -o build/tag.o

build/related_data.o: src/related_data.cc
	$(cxx) $(cflags) -c src/related_data.cc -o build/related_data.o

build/batch_update_result.o: src/batch_update_result.cc
	$(cxx) $(cflags) -c src/batch_update_result.cc -o build/batch_update_result.o

build/formatter.o: src/formatter.cc
	$(cxx) $(cflags) -c src/formatter.cc -o build/formatter.o

build/model_change.o: src/model_change.cc
	$(cxx) $(cflags) -c src/model_change.cc -o build/model_change.o

build/migrations.o: src/migrations.cc
	$(cxx) $(cflags) -c src/migrations.cc -o build/migrations.o

build/database.o: src/database.cc
	$(cxx) $(cflags) -c src/database.cc -o build/database.o

build/feedback.o: src/feedback.cc
	$(cxx) $(cflags) -c src/feedback.cc -o build/feedback.o

build/gui.o: src/gui.cc
	$(cxx) $(cflags) -c src/gui.cc -o build/gui.o

build/error.o: src/error.cc
	$(cxx) $(cflags) -c src/error.cc -o build/error.o

build/idle.o: src/idle.cc
	$(cxx) $(cflags) -c src/idle.cc -o build/idle.o

build/analytics.o: src/analytics.cc
	$(cxx) $(cflags) -c src/analytics.cc -o build/analytics.o

build/urls.o: src/urls.cc
	$(cxx) $(cflags) -c src/urls.cc -o build/urls.o

build/timeline_event.o: src/timeline_event.cc
	$(cxx) $(cflags) -c src/timeline_event.cc -o build/timeline_event.o

build/context.o: src/context.cc
	$(cxx) $(cflags) -c src/context.cc -o build/context.o

build/settings.o: src/settings.cc
	$(cxx) $(cflags) -c src/settings.cc -o build/settings.o

build/autotracker.o: src/autotracker.cc
	$(cxx) $(cflags) -c src/autotracker.cc -o build/autotracker.o

build/toggl_api_private.o: src/toggl_api_private.cc
	$(cxx) $(cflags) -c src/toggl_api_private.cc -o build/toggl_api_private.o

build/toggl_api.o: src/toggl_api.cc
	$(cxx) $(cflags) -c src/toggl_api.cc -o build/toggl_api.o

build/test/test_data.o: src/test/test_data.cc
	$(cxx) $(cflags) -c src/test/test_data.cc -o build/test/test_data.o

build/test/toggl_api_test.o: src/test/toggl_api_test.cc
	$(cxx) $(cflags) -c src/test/toggl_api_test.cc -o build/test/toggl_api_test.o

build/test/app_test.o: src/test/app_test.cc
	$(cxx) $(cflags) -c src/test/app_test.cc -o build/test/app_test.o

build/get_focused_window_$(osname).o: src/get_focused_window_$(osname).cc
	$(cxx) $(cflags) -c src/get_focused_window_$(osname).cc -o build/get_focused_window_$(osname).o

build/timeline_uploader.o: src/timeline_uploader.cc
	$(cxx) $(cflags) -c src/timeline_uploader.cc -o build/timeline_uploader.o

build/window_change_recorder.o: src/window_change_recorder.cc
	$(cxx) $(cflags) -c src/window_change_recorder.cc -o build/window_change_recorder.o

build/test/gtest-all.o: $(GTEST_ROOT)/src/gtest-all.cc
	$(cxx) $(cflags) -c $(GTEST_ROOT)/src/gtest-all.cc -o build/test/gtest-all.o

objects: build/jsoncpp.o \
	build/related_data.o \
	build/proxy.o \
	build/netconf.o \
	build/https_client.o \
	build/websocket_client.o \
	build/base_model.o \
	build/user.o \
	build/workspace.o \
	build/client.o \
	build/project.o \
	build/task.o \
	build/time_entry.o \
	build/tag.o \
	build/batch_update_result.o \
	build/formatter.o \
	build/model_change.o \
	build/database.o \
	build/feedback.o \
	build/error.o \
	build/gui.o \
	build/idle.o \
	build/analytics.o \
	build/autotracker.o \
	build/settings.o \
	build/urls.o \
	build/timeline_event.o \
	build/migrations.o \
	build/context.o \
	build/toggl_api_private.o \
	build/toggl_api.o \
	build/get_focused_window_$(osname).o \
	build/timeline_uploader.o \
	build/window_change_recorder.o

test_objects: build/test/gtest-all.o \
	build/test/test_data.o \
	build/test/app_test.o \
	build/test/toggl_api_test.o

uitest: clean_test
ifeq ($(osname), windows)
	$(executable) \
		--script-path src/test/uitest.lua \
		--log-path test/uitest.log \
		--db-path test/uitest.db \
		--environment test
else
	$(executable) \
		--script-path $(pwd)/src/test/uitest.lua \
		--log-path $(pwd)/test/uitest.log \
		--db-path $(pwd)/test/uitest.db
endif

toggl_test: clean_test objects test_objects
	mkdir -p test
	$(cxx) -coverage -o test/toggl_test build/*.o build/test/*.o $(libs)

test_lib: lua toggl_test
	cp src/ssl/cacert.pem test/.
ifeq ($(osname), linux)
	cp -r $(pocodir)/lib/Linux/$(architecture)/* test/.
	cp -r $(openssldir)/*so* test/.
	cd test && LD_LIBRARY_PATH=.:$LD_LIBRARY_PATH ./toggl_test --gtest_shuffle
endif
ifeq ($(osname), mac)
	cp -r $(pocolib)/* test/.
	install_name_tool -change /usr/local/lib/libPocoCrypto.31.dylib @loader_path/libPocoCrypto.31.dylib test/libPocoNetSSL.31.dylib
	install_name_tool -change /usr/local/lib/libPocoCrypto.31.dylib @loader_path/libPocoCrypto.31.dylib test/toggl_test
	install_name_tool -change /usr/local/lib/libPocoData.31.dylib @loader_path/libPocoData.31.dylib test/libPocoDataSQLite.31.dylib
	install_name_tool -change /usr/local/lib/libPocoData.31.dylib @loader_path/libPocoData.31.dylib test/toggl_test
	install_name_tool -change /usr/local/lib/libPocoData.31.dylib @loader_path/libPocoData.31.dylib test/toggl_test
	install_name_tool -change /usr/local/lib/libPocoDataSQLite.31.dylib @loader_path/libPocoDataSQLite.31.dylib test/toggl_test
	install_name_tool -change /usr/local/lib/libPocoFoundation.31.dylib @loader_path/libPocoFoundation.31.dylib test/libPocoCrypto.31.dylib
	install_name_tool -change /usr/local/lib/libPocoFoundation.31.dylib @loader_path/libPocoFoundation.31.dylib test/libPocoData.31.dylib
	install_name_tool -change /usr/local/lib/libPocoFoundation.31.dylib @loader_path/libPocoFoundation.31.dylib test/libPocoDataSQLite.31.dylib
	install_name_tool -change /usr/local/lib/libPocoFoundation.31.dylib @loader_path/libPocoFoundation.31.dylib test/libPocoNet.31.dylib
	install_name_tool -change /usr/local/lib/libPocoFoundation.31.dylib @loader_path/libPocoFoundation.31.dylib test/libPocoNetSSL.31.dylib
	install_name_tool -change /usr/local/lib/libPocoFoundation.31.dylib @loader_path/libPocoFoundation.31.dylib test/toggl_test
	install_name_tool -change /usr/local/lib/libPocoFoundation.31.dylib @loader_path/libPocoFoundation.31.dylib test/libPocoUtil.31.dylib
	install_name_tool -change /usr/local/lib/libPocoFoundation.31.dylib @loader_path/libPocoFoundation.31.dylib test/libPocoXML.31.dylib
	install_name_tool -change /usr/local/lib/libPocoFoundation.31.dylib @loader_path/libPocoFoundation.31.dylib test/libPocoJSON.31.dylib
	install_name_tool -change /usr/local/lib/libPocoJSON.31.dylib @loader_path/libPocoJSON.31.dylib test/toggl_test
	install_name_tool -change /usr/local/lib/libPocoNet.31.dylib @loader_path/libPocoNet.31.dylib test/libPocoNetSSL.31.dylib
	install_name_tool -change /usr/local/lib/libPocoNet.31.dylib @loader_path/libPocoNet.31.dylib test/toggl_test
	install_name_tool -change /usr/local/lib/libPocoNetSSL.31.dylib @loader_path/libPocoNetSSL.31.dylib test/toggl_test
	install_name_tool -change /usr/local/lib/libPocoUtil.31.dylib @loader_path/libPocoUtil.31.dylib test/libPocoNetSSL.31.dylib
	install_name_tool -change /usr/local/lib/libPocoUtil.31.dylib @loader_path/libPocoUtil.31.dylib test/toggl_test
	install_name_tool -change /usr/local/lib/libPocoXML.31.dylib @loader_path/libPocoXML.31.dylib test/toggl_test
	install_name_tool -change /usr/local/lib/libPocoXML.31.dylib @loader_path/libPocoXML.31.dylib test/libPocoUtil.31.dylib
	install_name_tool -change /usr/local/lib/libPocoJSON.31.dylib @loader_path/libPocoJSON.31.dylib test/libPocoUtil.31.dylib
	cd test && ./toggl_test --gtest_shuffle
endif
ifeq ($(osname), windows)
	cp -r $(pocolib)/* test/.
	cd test && ./toggl_test --gtest_shuffle
endif

test: test_lib

lcov: test
	lcov -q -d . -c -o app.info
	genhtml -q -o coverage app.info

coverage: lcov
	@echo "open coverage/index.html to view coverage report"

loco:
ifeq ($(osname), mac)
	xcodebuild -exportLocalizations -localizationPath src/ui/osx/localization -project src/ui/osx/TogglDesktop/TogglDesktop.xcodeproj -exportLanguage et
endif

package:
	./src/ui/linux/package.sh


text:
<  返回列表

        进口订单列表 > 进口订单维护

单据主信息({{importDetailOrderStateDec}})

        <button class="red-btn" style="position: absolute; right: 150px;" ng-click="examImportOrder()" ng-show="isAdmin">审核</button>

        <button class="red-btn" style="position: absolute; right: 62px;">整票跟踪</button>

        <button class="blue-btn" tabindex="14" style="position: absolute; right: 0;" ng-click="saveImportOrder()">暂存</button>

        <form id="importDetailOrderForm" class="form-horizontal" style="padding: 20px;">

                        *
                        提单号:
                        <input id="_detailLadingBillNum" tabindex="1" class="list-input required" ng-model="importDetailOrderBillNo" data-valid="isNonEmpty" data-error="   " style="width: 68%; left: 70px;" onkeyup="this.value = this.value.toUpperCase();"/>

                        *
                        总箱量:
                        <input id="_detailTotalNum" tabindex="2" class="list-input required" style="width: 68%; left: 70px;" data-valid="isNonEmpty" data-error="   " ng-model="importDetailOrderTotalCase">

                        箱主:
                        <input id="_iDetailOwner" tabindex="3" class="list-input exportOwnerInfo" ownerCode="" data-valid="isNonEmpty" data-error="   " ng-model="importDetailOwner" style="width: 78%; left: 50px; padding-left: 0;" onfocus="getImportOrderOwner(this)" onkeyup="getImportOrderOwner(this)"/>

                        系统订单号:
                        <input id="_systemOrderNum" class="sys-input" ng-model="importDetailOrderSystemNo" style="width: 62%;" readonly/>

                        下发公司:

                            <input id="importOrderCompany" type="text" ng-model="importDetailOrderCompany" readonly>

裕雄(XMZZ)

裕国(FZZZ)

                        船代:
                        <input id="_detailBoatAgent" tabindex="4" ng-model="importDetailOrderShipAgency" style="width: 78%; position: absolute; top: 0; height: 33px; left: 50px; padding-left: 0;" readonly/>

外代

中外运

联代

中远

中海

联骏

海丰

港城

协通

华联通

外运船代

福州外代

嘉航船代

协通船代

港城船代

                        船名:
                        <input id="_detailBoatName" tabindex="5" class="list-input importBoatEnName" boatCode="" ng-model="importDetailOrderShipName" style="width: 78%; left: 50px; padding-left: 0;" onfocus="getImportOrderBoat(this)" onkeyup="getImportOrderBoat(this)"/>

                        航次:
                        <input id="_detailVoyage" tabindex="6" class="list-input" sailCode="" ng-model="importDetailOrderSailing" style="width: 78%; left: 50px; padding-left: 0;" onfocus="getImportOrderSail(this)" onkeyup="getImportOrderSail(this)"/>

                        码头:
                        <input id="_detailWharf" tabindex="7" wharfCode="" ng-model="importDetailOrderWharf" style="width: 78%; position: absolute; top: 0; height: 33px; left: 50px; padding-left: 0;" readonly/>

                                ZY
                                海盈码头

                                QZ
                                青洲港区

                                JYG
                                福清新港

                                HTD
                                海天码头

                                HLT
                                海润

                                MZGJ
                                国际货柜

                                SYT
                                嵩屿

                                YHMT
                                远海码头

                        抵港日期:
                        <input id="_detailArriveTime" tabindex="8" class="detail-date" style="width: 98%;" ng-model="importDetailOrderArrivalDate" ng-show="importDetailOrderState==2?true:false" onfocus="laydate()"/>
                        {{importDetailOrderArrivalDate}}

                                货主:
                                <input id="_detailGoodOwner" tabindex="9" class="list-input exportOwnerInfo" ownerCode="" ng-model="importDetailOrderGoodOwner"  style="width: 78%; left: 50px; padding-left: 0;" onfocus="getAdminImportOrderOwner(this)" onkeyup="getAdminImportOrderOwner(this)"/>

                                *
                                联系人:
                                <input id="_detailContact" tabindex="10" class="list-input required" ng-model="importDetailOrderContact" data-valid="isNonEmpty" data-error="   " style="width: 68%; left: 70px;"/>

                                *
                                联系电话:
                                <input id="_detailContactPhone" tabindex="11" class="list-input required" ng-model="importDetailOrderContactPhone" data-valid="isNonEmpty" data-error="   " style="width: 65%; left: 80px;" onblur="checkTel(this)"/>

                                *
                                联系邮箱:
                                <input id="_detailContactEmail" tabindex="12" class="list-input required" ng-model="importDetailOrderContactEmail" data-valid="isNonEmpty" data-error="   " style="width: 65%; left: 80px;" onblur="isEmail(this);"/>

{{importDetailOrderState}}

                        备注:
                        <textarea id="_detailRemark" tabindex="13" rows="4" maxlength="2000" style="position: absolute; top: 0; left: 50px; width: 89%; border: none; background: transparent;" ng-model="importDetailRemark"></textarea>

                拒绝理由:

        </form>

                    <button ng-click="addImportBox()" class="second-table-top-operate" style="left: 0;">新增</button>

                    <button class="second-table-top-operate" style="left: 70px;" ng-click="delImportBoxes()">删除</button>

                    <button class="second-table-top-operate" style="left: 140px;" data-toggle="modal" data-target="#addNumsModal">批量新增</button>

                    <button class="second-table-top-operate" style="left: 210px;" ng-click="saveImportContainer()">保存</button>

                                <input ng-click="selectAll1()" id="import-select-all1" type="checkbox"/>

                                序号

                                id

                                状态

                                箱主

                                箱号

                                装箱件数

                                铅封号

                                箱型尺寸

                                提箱点

                                返箱点

                                品名

                                货重(KG)

                                带电机

                                冻柜温度

                                多地卸

                                运费

                                操作

                                <input class="checkbox-first" type="checkbox" name="box">

                                {{container.index}}

                                <input class="table-input importContainerId" type="text" value="{{container.containerId}}">

                                {{container.containerStateDesc}}

                                <input class="table-input importOwnerInfo" type="text" ownerCode="{{container.containerOwnerCode}}" ng-model = "container.containerOwner" onfocus="getIContainerOwnerInfo(this)" onkeyup="getIContainerOwnerInfo(this)" onblur="setOwnerListHide(this)">

{{container.containerOwner}}

                                <input class="table-input" type="text" ng-model="container.containerCaseNo" onkeyup="this.value = this.value.toUpperCase();" onblur="chkcntrno(this,0);">

{{container.containerCaseNo}}

                                <input class="table-input" type="text" ng-model="container.containerCount">

{{container.containerCount}}

                                <input class="table-input" type="text" ng-model="container.containerSealNo" onkeyup="this.value = this.value.toUpperCase();">

{{container.containerSealNo}}

                                <select ng-model="container.containerType" ng-options="x.typeCode as x.typeCode for x in containerCaseType">
                                    <option value=""></option>

                                </select>

                                <select ng-model="container.containerCartonSize" ng-options="x.typeCode as x.typeCode for x in containerSize">
                                    <option value=""></option>

                                </select>

                                <input class="table-input importOwnerInfo" type="text" containerAddressCode="{{container.containerDrayageDepotCode}}" ng-model = "container.containerDrayageDepot" onclick="getImportContainerAddress(this)" onkeyup="getImportContainerAddress(this)" onblur="setOwnerListHide(this)">

{{container.containerDrayageDepot}}

                                <input class="table-input importOwnerInfo" type="text" containerAddressCode="{{container.containerReturnDepotCode}}" ng-model = "container.containerReturnDepot" onclick="getImportContainerAddress(this)" onkeyup="getImportContainerAddress(this)" onblur="setOwnerListHide(this)">

{{container.containerReturnDepot}}

                                <input class="table-input" type="text" ng-model="container.containerTradeName">

{{container.containerTradeName}}

                                <input class="table-input" type="text" ng-model="container.containerGrossWeight" onblur="checkNum(this)">

{{container.containerGrossWeight}}

                                <input type="checkbox" ng-model="container.containerDynamo" ng-checked="container.containerDynamo=='是'?true:false">

                                <input class="table-input" type="text" ng-model="container.containerRfTemp" ng-show="container.containerDynamo=='是'?true:false">

                                <select ng-model="container.containerTemperUnit" ng-show="container.containerDynamo=='是'?true:false">
                                    <option value="0">℉</option>
                                    <option value="1">℃</option>
                                </select>

                                <input type="checkbox" ng-model="container.containerIsMoreUnload" ng-checked="container.containerIsMoreUnload=='是'?true:false">

                                <input class="table-input" type="text" ng-model="container.containerCost">

{{container.containerCost}}

                                <button class="red-btn" ng-click="endImportBoxTrans(container.containerId)">结束</button>

                                <input ng-click="selectAll3()" id="import-select-all3" type="checkbox"/>

                                序号

                                id

                                状态

                                箱主

                                箱号

                                装箱件数

                                铅封号

                                箱型尺寸

                                提箱点

                                返箱点

                                品名

                                货重(KG)

                                带电机

                                冻柜温度

                                多地卸

                                运费

                                操作

                                <input class="checkbox-first" type="checkbox" name="box">

                                {{container.index}}

                                <input class="table-input importContainerId" type="text" value="{{container.containerId}}">

                                {{container.containerStateDesc}}

                                {{container.containerOwner}}

                                {{container.containerCaseNo}}

                                {{container.containerCount}}

                                {{container.containerSealNo}}

                                <select ng-model="container.containerType" ng-options="x.typeCode as x.typeCode for x in containerCaseType" disabled>
                                    <option value=""></option>

                                </select>

                                <select ng-model="container.containerCartonSize" ng-options="x.typeCode as x.typeCode for x in containerSize" disabled>
                                    <option value=""></option>

                                </select>

                                {{container.containerDrayageDepot}}

                                {{container.containerReturnDepot}}

                                {{container.containerTradeName}}

                                {{container.containerGrossWeight}}

                                <input type="checkbox" ng-model="container.containerDynamo" ng-checked="container.containerDynamo=='是'?true:false" disabled>

                                <input type="checkbox" ng-model="container.containerIsMoreUnload" ng-checked="container.containerIsMoreUnload=='是'?true:false" disabled>

                                {{container.containerRfTemp}}

                                {{container.containerTemperUnit==0?'℉':'℃'}}

                                {{container.containerCost}}

                                <button class="red-btn" ng-click="endImportBoxTrans(container.containerId)">结束</button>

                            <button ng-click="addImportBoxInfo()" class="second-table-top-operate" style="left: 0;">新增</button>

                            <button class="second-table-top-operate" style="left: 70px;" ng-click="delImportBoxInfo()">删除</button>

                            <button ng-click="saveImportAddress()" class="second-table-top-operate" style="left: 140px;">保存</button>

                                        <input ng-click="selectAll2()" id="import-select-all2" type="checkbox"/>

                                        序号

                                        id

                                        交货地

                                        送达时间

                                        工厂联系人

                                        联系电话

                                        省

                                        市

                                        区

                                        <input class="checkbox-second" type="checkbox" name="boxInfo"/>

                                        {{address.index}}

                                        <input class="table-input importAddressId" type="text" value="{{address.addressId}}">

                                        <input class="table-input" type="text" value="{{address.addressPlace}}">

                                        <input class="table-input" type="text" value="{{address.addressDeliveryTime}}" onclick="laydate({istime: true, format: 'YYYY-MM-DD hh'})">

                                        <input class="table-input" type="text" value="{{address.addressContacts}}">

                                        <input class="table-input" type="text" value="{{address.addressTel}}" onkeyup="checkTel(this)">

                                        <select required="" ng-model="address.addressProvince" ng-options="key as key for (key,value) in division"
                                                ng-change="address.addressCity='';address.addressDistrict='';">
                                            <option value=""></option>
                                        </select>

                                        <select ng-model="address.addressCity" ng-options="key as key for (key,value) in division[address.addressProvince]"
                                                ng-change="address.addressDistrict='';">
                                            <option value=""></option>
                                        </select>

                                        <select ng-model="address.addressDistrict" ng-options="value as value for value in division[address.addressProvince][address.addressCity]">
                                            <option value=""></option>
                                        </select>

                                        <input ng-click="selectAll4()" id="import-select-all4" type="checkbox"/>

                                        序号

                                        id

                                        交货地

                                        送达时间

                                        工厂联系人

                                        联系电话

                                        省

                                        市

                                        区

                                        <input class="checkbox-second" type="checkbox" name="boxInfo"/>

                                        {{address.index}}

                                        <input class="table-input importAddressId" type="text" value="{{address.addressId}}">

                                        {{address.addressPlace}}

                                        {{address.addressDeliveryTime}}

                                        {{address.addressContacts}}

                                        {{address.addressTel}}

                                        {{address.addressProvince}}

                                        {{address.addressCity}}

                                        {{address.addressDistrict}}

                        <button type="button" class="close"
                                data-dismiss="modal" aria-hidden="true">
                            ×
                        </button>

                            批量新增

                        <form class="form-horizontal" role="form">

                                箱号:

                                    <input id="_iBoxNos" type="text" class="form-control" ng-model="importMultiContainerCaseNo" style="border: 1px solid #ccc;" onblur="chkcntrno(this,0);">

                                铅封号:

                                    <input id="_iSealNums" type="text" class="form-control" ng-model="importMultiContainerSealNo" style="border: 1px solid #ccc;">

                                箱型:

                                    <select id="_iBoxTypes" class="form-control" ng-model="importMultiContainerType" style="border: 1px solid #ccc;">
                                        <option ng-repeat="x in containerCaseType">{{x.typeCode}}</option>
                                    </select>

                                尺寸:

                                    <select id="_iBoxSizes" class="form-control" ng-model="importMultiContainerSize" style="border: 1px solid #ccc;">
                                        <option ng-repeat="x in containerSize">{{x.typeCode}}</option>
                                    </select>

                                提箱点:

                                    <input id="_iBoxDrayages" containerAddressCode ="" type="text" class="form-control importDepot" style="border: 1px solid #ccc;" ng-model="importMultiContainerOwner" onclick="getImportMultiOrderDepot(this)" onkeyup="getImportMultiOrderDepot(this)">

                                返箱点:

                                    <input id="_iBoxReturns" containerAddressCode ="" type="text" class="form-control importDepot" style="border: 1px solid #ccc;" ng-model="importMultiContainerOwner" onclick="getImportMultiOrderDepot(this)" onkeyup="getImportMultiOrderDepot(this)">

                                品名:

                                    <input id="_iProductNames" type="text" class="form-control" ng-model="importMultiContainerTradeName" style="border: 1px solid #ccc;">

                                货重(KG):

                                    <input id="_iRoughWeight" type="text" class="form-control" ng-model="importMultiContainerGrossWeight" style="border: 1px solid #ccc;">

                                是否带电机:

                                    <select id="_iIsTakes" class="form-control" ng-model="importMultiContainerDynamo" style="border: 1px solid #ccc;">
                                        <option value="是">是</option>
                                        <option value="否">否</option>
                                    </select>

                                是否多地卸:

                                    <select id="_iIsMultis" class="form-control" ng-model="importMultiContainerIsMoreUnload" style="border: 1px solid #ccc;">
                                        <option value="是">是</option>
                                        <option value="否">否</option>
                                    </select>

                                数量:

                                    <input id="_iNumbers" type="text" class="form-control" ng-model="importMultiAdd.numbers" style="border: 1px solid #ccc;">

                        </form>

                        <button type="button" class="btn btn-default"
                                data-dismiss="modal">关闭
                        </button>
                        <button type="button" class="btn btn-primary" data-dismiss="modal" ng-click="addImportBoxes()">
                            新增
                        </button>

redpajama_set_name: RedPajamaGithub


text:
package main

import "encoding/xml"

type misc struct {
	Grade int `xml:"grade"`
	JLPT  int `xml:"jlpt"`
}
type character struct {
	XMLName xml.Name `xml:"character"`
	Literal string   `xml:"literal"`
	Misc    misc     `xml:"misc"`
}
type kanjidic struct {
	XMLName   xml.Name    `xml:"kanjidic2"`
	Character []character `xml:"character"`
}


text:
import json
from datetime import datetime
import random

def make_dates():
    year = random.randint(2000,2017)
    month = random.randint(1, 12)
    day = random.randint(1, 28)
    if day < 10:
        if month < 10:
            start = str(year) + '-0' + str(month) + '-0' + str(day)
            end = str(year) + '-0' + str(month) + '-0' + str(day + 1)
        else:
            start = str(year) + '-' + str(month) + '-0' + str(day)
            end = str(year) + '-' + str(month) + '-0' + str(day + 1)

    else:
        if month < 10:
            start = str(year) + '-0' + str(month) + '-' + str(day)
            end = str(year) + '-0' + str(month) + '-' + str(day + 1)
        else:
            start = str(year) + '-' + str(month) + '-' + str(day)
            end = str(year) + '-' + str(month) + '-' + str(day + 1)
    return(start,end)

datum1 = make_dates()
a1 = {"imeAkcija" : "Izlet v Ljubljano",
    "porocilo" : "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa." \
                 " Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec qu",
    "zacetek" : datum1[0],
    "konec" : datum1[1],
      "organizator" : 101,
      "udelezenci": random.sample(range(1, 150), random.randint(10,50))}

datum2 = make_dates()
a2 = {"imeAkcija" : "Izlet v Maribor",
    "porocilo" : "Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam" \
                 " rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta.",
    "zacetek" : datum2[0],
    "konec" : datum2[1],
      "organizator" : 102,
      "udelezenci": random.sample(range(1, 150), random.randint(10,50))}

datum3 = make_dates()
a3 = {"imeAkcija" : "Izlet v London",
    "porocilo" : "But I must explain to you how all this mistaken idea of denouncing pleasure and praising pain was born" \
                 " and I will give you a complete account of the system, and expound the actual teachings of the gre",
    "zacetek" : datum3[0],
    "konec" : datum3[1],
      "organizator" : 103,
      "udelezenci": random.sample(range(1, 150), random.randint(10,50))}

datum4 = make_dates()
a4 = {"imeAkcija" : "Izlet v Moskvo",
    "porocilo" : "Li Europan lingues es membres del sam familie. Lor separat existentie es un myth. Por scientie, musica," \
                 " sport etc, litot Europa usa li sam vocabular. Li lingues differe solmen in li grammatica, li pro",
    "zacetek" : datum4[0],
    "konec" : datum4[1],
      "organizator" : 104,
      "udelezenci": random.sample(range(1, 150), random.randint(10,50))}

datum5 = make_dates()
a5 = {"imeAkcija" : "Izlet v Divačo",
    "porocilo" : "Far far away, behind the word mountains, far from the countries Vokalia and Consonantia, there live the" \
                 " blind texts. Separated they live in Bookmarksgrove right at the coast of the Semantics, a large.",
    "zacetek" : datum5[0],
    "konec" : datum5[1],
      "organizator" : 105,
      "udelezenci": random.sample(range(1, 150), random.randint(10,50))}

datum6 = make_dates()
a6 = {"imeAkcija" : "Izlet v Komen",
    "porocilo" : "A wonderful serenity has taken possession of my entire soul, like these sweet mornings of spring which" \
                 " I enjoy with my whole heart. I am alone, and feel the charm of existence in this spot, which was.",
    "zacetek" : datum6[0],
    "konec" : datum6[1],
      "organizator" : 106,
      "udelezenci": random.sample(range(1, 150), random.randint(10,50))}

datum7 = make_dates()
a7 = {"imeAkcija" : "Izlet v Honolulu",
    "porocilo" : "One morning, when Gregor Samsa woke from troubled dreams, he found himself transformed in his bed into" \
                 " a horrible vermin. He lay on his armour-like back, and if he lifted his head a little he could se",
    "zacetek" : datum7[0],
    "konec" : datum7[1],
      "organizator" : 107,
      "udelezenci": random.sample(range(1, 150), random.randint(10,50))}

polne_akcije = [a1,a2,a3,a4,a5,a6,a7]

st=1
sez = []
for akcija in polne_akcije:
    trenutni = dict()
    trenutni['model'] = "taborniki.Akcija"
    trenutni['pk']=st
    trenutni['fields']=akcija

    sez.append(trenutni)
    st += 1

with open('akcije.json', 'w') as f:
    json.dump(sez, f)


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.17"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>CANopenNode: Data Fields</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>

<link href="navtree.css" rel="stylesheet" type="text/css"/>

<link href="search/search.css" rel="stylesheet" type="text/css"/>

<link href="doxygen.css" rel="stylesheet" type="text/css" />

CANopenNode

          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)"
               onblur="searchBox.OnSearchFieldFocus(false)"
               onkeyup="searchBox.OnSearchFieldChange(event)"/>

Here is a list of all documented struct and union fields with links to the struct/union documentation for each field:

- i -

ident
: CO_CANrx_t
, CO_CANtx_t

ifName
: CO_CANinterfaceErrorhandler_t

index
: CO_SDOclient_t
, CO_SDOserver_t
, OD_entry_t
, OD_subEntry_t

informationDirection
: CO_SRDOCommPar_t

inhibitEmTime_us
: CO_EM_t

inhibitTime
: CO_TPDOCommPar_t

inhibitTimer
: CO_TPDO_t

internalCommand
: CO_NMT_t

isConsumer
: CO_TIME_t

isProducer
: CO_SYNC_t
, CO_TIME_t

Generated on Thu Dec 24 2020 14:30:50 for CANopenNode by

     1.8.17


text:
namespace Unosquare.Labs.LiteLib.Tests
{
    using Database;
    using Helpers;
    using NUnit.Framework;
    using System.Linq;
#if !NET461
    using Microsoft.Data.Sqlite;
#endif

    public partial class DbContextFixture
    {
        public class Insert : DbContextFixture
        {
            [Test]
            public void InsertData()
            {
                using (var context = new TestDbContext(nameof(InsertData)))
                {
                    var entity = TestHelper.DataSource.First();
                    context.Orders.Insert(entity);

                    Assert.AreNotEqual(0, entity.RowId, "Has a RowId value");
                }
            }

            [Test]
            public void InsertUsingUnique_ThrowsSqliteException()
            {
                using (var context = new TestDbContext(nameof(InsertUsingUnique_ThrowsSqliteException)))
                {
                    foreach (var item in TestHelper.DataSource)
                    {
                        context.Orders.Insert(item);
                    }

#if NET461
                    Assert.Throws<Mono.Data.Sqlite.SqliteException>(() =>
#else
                    Assert.Throws<SqliteException>(() =>
#endif
                    {
                        var newOrder = new Order
                        {
                            CustomerName = "John",
                            Amount = 2,
                            ShipperCity = "Atlanta",
                            UniqueId = "1"
                        };
                        context.Orders.Insert(newOrder);
                    });
                }
            }

            [Test]
            public void InsertingWithOutOfRangeString_ThrowsSqliteException()
            {
                using (var context = new TestDbContext(nameof(InsertingWithOutOfRangeString_ThrowsSqliteException)))
                {
#if NET461
                    Assert.Throws<Mono.Data.Sqlite.SqliteException>(() =>
#else
                    Assert.Throws<SqliteException>(() =>
#endif
                    {
                        context.Orders.Insert(new Order
                        {
                            CustomerName = "John",
                            Amount = 2,
                            ShipperCity = "StringStringStringStringStringStringStringString"
                        });
                    });
                }
            }
        }
    }
}


text:
#include <QtDebug>

#include "qaxisstep_p.h"
#include "qcommonsequencetypes_p.h"
#include "qcommonvalues_p.h"
#include "qitemmappingiterator_p.h"
#include "qsequencemappingiterator_p.h"
#include "qpatternistlocale_p.h"

#include "qapplytemplate_p.h"

QT_BEGIN_NAMESPACE

using namespace QPatternist;

ApplyTemplate::ApplyTemplate(const TemplateMode::Ptr &mode,
                             const WithParam::Hash &withParams,
                             const TemplateMode::Ptr &defaultMode) : TemplateInvoker(withParams)
                                                                   , m_mode(mode)
                                                                   , m_defaultMode(defaultMode)
{
    Q_ASSERT_X(m_mode || m_defaultMode, Q_FUNC_INFO,
               "Either a mode, or the default mode must be supplied.");
}

Item ApplyTemplate::mapToItem(const QXmlNodeModelIndex &node,
                              const DynamicContext::Ptr &) const
{
    return Item(node);
}

Item::Iterator::Ptr ApplyTemplate::mapToSequence(const Item &item,
                                                 const DynamicContext::Ptr &context) const
{
    Q_UNUSED(item);
    return evaluateSequence(context);
}

TemplateMode::Ptr ApplyTemplate::effectiveMode(const DynamicContext::Ptr &context) const
{
    if(m_mode)
        return m_mode;
    else
    {
        const TemplateMode::Ptr currentMode(context->currentTemplateMode());

        if(currentMode)
            return currentMode;
        else
            return m_defaultMode;
    }
}

Template::Ptr ApplyTemplate::findTemplate(const DynamicContext::Ptr &context,
                                          const TemplateMode::Ptr &templateMode) const
{
    const int count = templateMode->templatePatterns.count();
    Template::Ptr result;
    /* It's redundant to initialize these values, but it suppresses false
     * positives with GCC. */
    PatternPriority priority = 0;
    TemplatePattern::ID id = -1;

    /* Possible optimization: detecting ambiguous rule matches could be forked off to a
     * low prioirity thread. */
    for(int i = 0; i < count; ++i)
    {
        const TemplatePattern::Ptr &candidate = templateMode->templatePatterns.at(i);
        if(candidate->matchPattern()->evaluateEBV(context))
        {
            if(result)
            {
                if(   candidate->id() != id
                   && candidate->priority() == priority
                   && candidate->templateTarget()->importPrecedence ==
                                                        result->importPrecedence)
                {
                    context->error(QtXmlPatterns::tr("Ambiguous rule match."),
                                   ReportContext::XTRE0540, this);
                }
                else
                    break;
            }
            else
            {
                result = candidate->templateTarget();
                priority = candidate->priority();
                id = candidate->id();
            }
        }
    }

    return result;
}

Item::Iterator::Ptr ApplyTemplate::evaluateSequence(const DynamicContext::Ptr &context) const
{
    const TemplateMode::Ptr templateMode(effectiveMode(context));
    const Template::Ptr &templateMatch = findTemplate(context, templateMode);

    if(templateMatch)
        return templateMatch->body->evaluateSequence(templateMatch->createContext(this, context, false));
    else
    {
        /* None of our templates matched. Proceed with a built-in. */
        const Item current(context->contextItem());
        // TODO it can be an atomic value?
        const QXmlNodeModelIndex::NodeKind kind(current.asNode().kind());

        if(kind == QXmlNodeModelIndex::Element || kind == QXmlNodeModelIndex::Document)
        {
            pDebug() << "No template match, using builtin template for element() | document-node()";

            const Item::Iterator::Ptr focusIterator(makeItemMappingIterator<Item>(ConstPtr(this),
                                                                                current.asNode().iterate(QXmlNodeModelIndex::AxisChild),
                                                                                context));

            const DynamicContext::Ptr focus(context->createFocus());
            focus->setFocusIterator(focusIterator);
            return makeSequenceMappingIterator<Item>(ConstPtr(this), focusIterator, focus);
        }
        return CommonValues::emptyIterator;
    }
}

Expression::Ptr ApplyTemplate::compress(const StaticContext::Ptr &context)
{
    /* If we have a mode, we will never need the default mode. */
    if(m_mode)
        m_defaultMode.reset();

    return TemplateInvoker::compress(context);
}

SequenceType::Ptr ApplyTemplate::staticType() const
{
    return CommonSequenceTypes::ZeroOrMoreItems;
}

ExpressionVisitorResult::Ptr ApplyTemplate::accept(const ExpressionVisitor::Ptr &visitor) const
{
    return visitor->visit(this);
}

Expression::Properties ApplyTemplate::properties() const
{
    return RequiresFocus | DisableElimination;
}

bool ApplyTemplate::configureRecursion(const CallTargetDescription::Ptr &sign)
{
    Q_ASSERT_X(false, Q_FUNC_INFO, "We're not expected to be called.");
    Q_UNUSED(sign);
    return false;
}

Expression::Ptr ApplyTemplate::body() const
{
    Q_ASSERT_X(false, Q_FUNC_INFO, "We're not expected to be called.");
    return Expression::Ptr();
}

CallTargetDescription::Ptr ApplyTemplate::callTargetDescription() const
{
    Q_ASSERT_X(false, Q_FUNC_INFO, "We're not expected to be called.");
    return CallTargetDescription::Ptr();
}

QT_END_NAMESPACE


text:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

<systemConfiguration oid="00000000-0000-0000-0000-000000000001" version="0"
	xmlns="http://midpoint.evolveum.com/xml/ns/public/common/common-3"
	xmlns:c="http://midpoint.evolveum.com/xml/ns/public/common/common-3"
	xmlns:q="http://prism.evolveum.com/xml/ns/public/query-3">
    <name>SystemConfiguration</name>
    <globalSecurityPolicyRef oid="28bf845a-b107-11e3-85bc-001e8c717e5b"/>
    <logging>
    	<rootLoggerAppender>File Appender</rootLoggerAppender>
    	<rootLoggerLevel>INFO</rootLoggerLevel>
        <classLogger>
	        <level>TRACE</level>
	        <package>com.evolveum.midpoint.common.LoggingConfigurationManager</package>
      	</classLogger>
        <c:classLogger>
            <c:level>TRACE</c:level>
            <c:package>com.evolveum.midpoint.notifications</c:package>
        </c:classLogger>
        <appender xsi:type="c:FileAppenderConfigurationType" name="File Appender" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <pattern>%date [%thread] %-5level \(%logger{46}\): %message%n</pattern>
            <fileName>target/test.log</fileName>
            <append>true</append>
        </appender>
    </logging>

    <defaultObjectPolicyConfiguration>
    	<type>UserType</type>
    	<subtype>employee</subtype>
   		<lifecycleStateModel>
   			<state>
   				<name>proposed</name>

   				<forcedAssignment>
	            	<targetType>RoleType</targetType>
	            	<filter>
	            		<q:equal>
			            	<q:matching>polyStringNorm</q:matching>
			                <q:path>name</q:path>
			                <q:value>pit boss</q:value>
			            </q:equal>
	            	</filter>
	           	</forcedAssignment>
   			</state>
   			<state>
   				<name>active</name>
   				<transition>
   					<name>archival</name>
   					<targetState>archived</targetState>
   					<condition>

   					</condition>
   				</transition>
   				<forcedAssignment>
	            	<targetType>RoleType</targetType>
	            	<filter>
	            		<q:equal>
			            	<q:matching>polyStringOrig</q:matching>
			                <q:path>name</q:path>
			                <q:value>Pirate Green</q:value>
			            </q:equal>
	            	</filter>
	           	</forcedAssignment>
   			</state>
   			<state>
   				<name>archived</name>
   				<forcedActivationStatus>archived</forcedActivationStatus>
   				<entryAction>
   					<name>archival-data-reduction</name>
   					<dataReduction>
   						<purgeItem>telephoneNumber</purgeItem>
   					</dataReduction>
   				</entryAction>
   			</state>
   		</lifecycleStateModel>
    </defaultObjectPolicyConfiguration>

    <notificationConfiguration>
		<handler>
			<simplePolicyRuleNotifier>
				<recipientExpression>
					<value>recipient@evolveum.com</value>
				</recipientExpression>
				<transport>dummy:policyRuleNotifier</transport>
			</simplePolicyRuleNotifier>
		</handler>
		<handler>
            <accountActivationNotifier>
                <recipientExpression>

				</recipientExpression>
                <transport>dummy:accountActivationNotifier</transport>
                <confirmationMethod>link</confirmationMethod>
            </accountActivationNotifier>
        </handler>
        <handler>
            <accountPasswordNotifier>
                <recipientExpression>
                    <value>recipient@evolveum.com</value>
                </recipientExpression>
                <transport>dummy:accountPasswordNotifier</transport>
            </accountPasswordNotifier>
        </handler>
        <handler>
            <userPasswordNotifier>
                <recipientExpression>
                    <value>recipient@evolveum.com</value>
                </recipientExpression>
                <transport>dummy:userPasswordNotifier</transport>
            </userPasswordNotifier>
        </handler>
        <handler>
            <status>success</status>
            <simpleResourceObjectNotifier>
                <recipientExpression>
                    <value>recipient@evolveum.com</value>
                </recipientExpression>
                <transport>dummy:simpleAccountNotifier-SUCCESS</transport>
            </simpleResourceObjectNotifier>
        </handler>
        <handler>
            <status>failure</status>
            <simpleResourceObjectNotifier>
                <recipientExpression>
                    <value>recipient@evolveum.com</value>
                </recipientExpression>
                <transport>dummy:simpleAccountNotifier-FAILURE</transport>
            </simpleResourceObjectNotifier>
        </handler>
        <handler>
            <operation>add</operation>
            <status>success</status>
            <simpleResourceObjectNotifier>
                <recipientExpression>
                    <value>recipient@evolveum.com</value>
                </recipientExpression>
                <transport>dummy:simpleAccountNotifier-ADD-SUCCESS</transport>
            </simpleResourceObjectNotifier>
        </handler>
        <handler>
            <operation>delete</operation>
            <status>success</status>
            <simpleResourceObjectNotifier>
                <recipientExpression>
                    <value>recipient@evolveum.com</value>
                </recipientExpression>
                <transport>dummy:simpleAccountNotifier-DELETE-SUCCESS</transport>
            </simpleResourceObjectNotifier>
        </handler>
        <handler>
            <simpleUserNotifier>
                <recipientExpression>
                    <value>recipient@evolveum.com</value>
                </recipientExpression>
                <transport>dummy:simpleUserNotifier</transport>
            </simpleUserNotifier>
        </handler>
        <handler>
            <chained>
                <operation>add</operation>
            </chained>
            <chained>
                <simpleUserNotifier>
                    <recipientExpression>
                        <value>recipient@evolveum.com</value>
                    </recipientExpression>
                    <transport>dummy:simpleUserNotifier-ADD</transport>
                </simpleUserNotifier>
            </chained>
        </handler>
        <handler>
            <chained>
                <operation>delete</operation>
            </chained>
            <chained>
                <simpleUserNotifier>
                    <recipientExpression>
                        <value>recipient@evolveum.com</value>
                    </recipientExpression>
                    <transport>dummy:simpleUserNotifier-DELETE</transport>
                </simpleUserNotifier>
            </chained>
        </handler>
        <handler>
            <status>failure</status>
            <simpleUserNotifier>
                <recipientExpression>
                    <value>recipient@evolveum.com</value>
                </recipientExpression>
                <transport>dummy:simpleUserNotifier-FAILURE</transport>
            </simpleUserNotifier>
        </handler>
        <handler>
            <category>customEvent</category>
            <operation>delete</operation>
            <status>failure</status>
            <expressionFilter>

            </expressionFilter>
            <generalNotifier>
                <recipientExpression>
                    <value>recipient@evolveum.com</value>
                </recipientExpression>
                <subjectExpression>
                    <value>Failure notification of type 2</value>
                </subjectExpression>
                <bodyExpression>

                </bodyExpression>
                <transport>dummy:CustomType2</transport>
            </generalNotifier>
        </handler>
        <mail>
            <redirectToFile>target/mail-notifications.log</redirectToFile>
        </mail>
    </notificationConfiguration>

    <internals>
        <maxModelClicks>30</maxModelClicks>
    </internals>

</systemConfiguration>


text:
package client

import (
	"testing"
	"time"

	"github.com/allegro/bigcache/v2"
	"github.com/stretchr/testify/assert"
)

func TestNewCacheFromOptions(t *testing.T) {
	c, err := newCacheFromOptions(makeOptions([]Option{WithCacheTTL(time.Minute)}))
	assert.NoError(t, err)
	assert.NotZero(t, c)

	c, err = newCacheFromOptions(defaults)
	assert.NoError(t, err)
	assert.Zero(t, c)
}

func TestAdjustCacheConfig(t *testing.T) {
	cfg := bigcache.DefaultConfig(15 * time.Minute)
	cfg = adjustCacheConfig(cfg)
	assert.Equal(t, 1024, cfg.Shards)
	assert.Equal(t, 536870, cfg.MaxEntriesInWindow)

	cfg = bigcache.DefaultConfig(15 * time.Minute)
	cfg.HardMaxCacheSize = 128
	cfg.MaxEntrySize = 10240
	cfg = adjustCacheConfig(cfg)
	assert.Equal(t, 256, cfg.Shards)
	assert.Equal(t, 16384, cfg.MaxEntriesInWindow)
}


text:
cmake .
make -j8 -l8 $1

echo Running search
bin/$1 > sandbox/searches/$1.json

echo Running visualization
# rosbag record -a --output-name=sandbox/bags/$1.bag &
# bagpid=$!
python scripts/run_ros_animator.py sandbox/searches/$1.json
# kill -9 $bagpid


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ArcGIS.Desktop.Framework;
using ArcGIS.Desktop.Framework.Contracts;

namespace Layout_HelpExamples
{
  // cref: CIMGraphic;ArcGIS.Desktop.Layouts.GraphicElement
  // cref: CIMGraphic;ArcGIS.Desktop.Layouts.LayoutProjectItem
  // cref: CIMGraphic;ArcGIS.Desktop.Layouts.LayoutProjectItem.GetLayout
  // cref: ArcGIS.Desktop.Layouts.GraphicElement.GetGraphic
  // cref: ARCGIS.DESKTOP.LAYOUTS.GRAPHICELEMENT.SETGRAPHIC
  // cref: ArcGIS.Desktop.Layouts.Layout.FindElement
  // cref: ARCGIS.CORE.CIM.CIMGRAPHIC.TRANSPARENCY
  #region CIMGraphic
  //This example references a graphic element on a layout and sets its Transparency property (which is not available in the managed API)
  //by accessing the element's CIMGraphic.

  //Added references
  using ArcGIS.Core.CIM;                             //CIM
  using ArcGIS.Desktop.Core;                         //Project
  using ArcGIS.Desktop.Layouts;                      //Layout class
  using ArcGIS.Desktop.Framework.Threading.Tasks;    //QueuedTask

  public class GraphicElementExample1
  {
    public static Task<bool> UpdateElementTransparencyAsync(string LayoutName, string ElementName, int TransValue)
    {
      //Reference a layoutitem in a project by name
      LayoutProjectItem layoutItem = Project.Current.GetItems<LayoutProjectItem>().FirstOrDefault(item => item.Name.Equals(LayoutName));
      if (layoutItem == null)
        return Task.FromResult(false);

      return QueuedTask.Run<bool>(() =>
      {
        //Reference and load the layout associated with the layout item
        Layout lyt = layoutItem.GetLayout();

        //Reference a element by name
        GraphicElement graElm = lyt.FindElement(ElementName) as GraphicElement;
        if (graElm == null)
          return false;

        //Modify the Transparency property that exists only in the CIMGraphic class.
        CIMGraphic CIMGra = graElm.GetGraphic() as CIMGraphic;
        CIMGra.Transparency = TransValue;             //e.g., TransValue = 50
        graElm.SetGraphic(CIMGra);

        return true;
      });
    }
  }
  #endregion CIMGraphic
}

namespace Layout_HelpExamples
{
  // cref: ARCGIS.DESKTOP.LAYOUTS.GRAPHICELEMENT
  // cref: ARCGIS.DESKTOP.LAYOUTS.GRAPHICELEMENT.CLONE
  // cref: ArcGIS.Desktop.Layouts.Element.SETX
  // cref: ArcGIS.Desktop.Layouts.Element.SETY
  #region CloneGraphic
  //This example finds a layout element by name and clones it a specified number of times and applies an accumlative offset for each
  //cloned element.

  //Added references
  using ArcGIS.Core.CIM;                             //CIM
  using ArcGIS.Desktop.Core;                         //Project
  using ArcGIS.Desktop.Layouts;                      //Layout class
  using ArcGIS.Desktop.Framework.Threading.Tasks;    //QueuedTask

  public class GraphicElementExample2
  {
    public static Task<bool> CloneElementAsync(string LayoutName, string ElementName, double offset, int numCopies)
    {
      //Reference a layoutitem in a project by name
      LayoutProjectItem layoutItem = Project.Current.GetItems<LayoutProjectItem>().FirstOrDefault(item => item.Name.Equals(LayoutName));
      if (layoutItem == null)
        return Task.FromResult(false);

      return QueuedTask.Run<bool>(() =>
      {
        //Reference and load the layout associated with the layout item
        Layout lyt = layoutItem.GetLayout();

        //Reference a element by name
        GraphicElement graElm = lyt.FindElement(ElementName) as GraphicElement;
        if (graElm == null)
          return false;

        //Loop through the number of copies, clone, and set the offsets for each new element
        double orig_offset = offset;
        while (numCopies != 0)
        {
          GraphicElement cloneElm = graElm.Clone("Clone");
          cloneElm.SetX(cloneElm.GetX() + offset);
          cloneElm.SetY(cloneElm.GetY() - offset);
          offset = offset + orig_offset;
          numCopies = numCopies - 1;
        }

        return true;
      });
    }
  }
  #endregion CloneGraphic
}

namespace Layout_HelpExamples
{
  internal class GraphicElementClass : Button
  {
    async protected override void OnClick()
    {
      //Set Transparency
      bool b1 = await GraphicElementExample1.UpdateElementTransparencyAsync("Layout Name", "Rectangle", 50);
      if (b1)
        System.Windows.MessageBox.Show("Successfully Changed Transparency ");
      else
        System.Windows.MessageBox.Show("Could Not Change Transparency");

      //Clone Element
      bool b2 = await GraphicElementExample2.CloneElementAsync("Layout Name", "Rectangle", 0.25, 5);
      if (b2)
        System.Windows.MessageBox.Show("Successfully Cloned Element ");
      else
        System.Windows.MessageBox.Show("Could Not Clone Element");

    }
  }
}


text:
import express from 'express';
import bodyParser from 'body-parser';
import cookieParser from 'cookie-parser';
import indexRoute from './routes/index';
import adminRoute from './routes/admin';
import authRoute from './routes/auth';

const app = express();

app.use(cookieParser());
app.use(bodyParser.json());

app.use('/auth', authRoute);
app.use('/admin', adminRoute);
app.use(indexRoute);

// Error
app.use((err, _req, res, _next) => {
  if (err.name === 'UnauthorizedError') {
    return res.sendStatus(401);
  }
  console.error('api route error', err);
  res.sendStatus(err.statusCode || 500);
});

module.exports = {
  path: '/api',
  handler: app
};


text:
```
npm i react-tweet-embed
```

## Quickstart [![Edit react-tweet-embed](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/74rn3r9k0?fontsize=14)

```tsx
import React from 'react'
import TweetEmbed from 'react-tweet-embed'

export const App = () => {
  return <TweetEmbed tweetId="692527862369357824" />
}
```

You don't have to put `//platform.twitter.com/widgets.js` script in your index.html as this lib will put it there if `twttr` is not found on window.

## Using Options

```tsx
<TweetEmbed tweetId='783943172057694208' options={{cards: 'hidden' }}/>
<TweetEmbed tweetId='771763270273294336' options={{theme: 'dark' }}/>
```

Embedded-Tweet Options Reference:
https://developer.twitter.com/en/docs/twitter-for-websites/embedded-tweets/guides/embedded-tweet-parameter-reference


text:
package nanocad.minimize.mm3;

import java.lang.Math;
import java.util.Vector;

import nanocad.*;

public class lterm extends nanocad.term
{
  public static final String rcsid =
	"$Id: lterm.java,v 1.2 2005/05/14 23:51:02 xli16 Exp $";
  private double ks, r0;
  /* I've been hacking a bit with acceptable forms for the length-energy term.
   * _Nanosystems_ lists one simple expression with a square and cubic term
   * for close distances, and various kinds of exponential expressions for
   * farther away. But these depend on numbers called De and beta and I don't
   * have tables for those (just the few examples in _Nanosystems_). So after
   * some puttering and graphing and algebra, I came up with the following.
   * Energies are in attojoules (10^-18 joules), distances are in angstroms
   * (10^-10 m), forces are in attojoules per angstrom (10^-8 N), and
   * spring constants are in attojoules per angstrom-squared (100 N/m). This
   * is consistent with the units in _Nanosystems_, and also the units used
   * in the 'mm2.prm' parameter file I found on Jay Ponder's ftp site.
   * Expressions for energy and force, where ks and r0 are a function of
   * the two atoms involved:
   *
   *   dr = r - r0;
   *
   * Energy (r) :=
   *   if (dr < rthresh)
   *     { return 0.5 * ks * dr * dr * (1 - kc * dr) - z * ks; }
   *   else
   *     { return (-a * ks / beta) * exp (-beta * dr); }
   *
   * Force (r) :=
   *   if (dr < rthresh)
   *     { return -(ks * dr * (1 - 1.5 * kc * dr)); }
   *   else
   *     { return -a * ks * exp (-beta * dr); }
   *
   *
   * A, beta, z, kcubic, and rthresh are defined below. Notice my use of
   * 'beta' differs from the use in _Nanosystems_, but plays a similar role.
   *
   * These follow Drexler's quadratic-cubic form for dr < rthresh, and for
   * dr > rthresh, they follow an exponential drop-off which is pretty
   * continuous for both energy and force. The only point that I think would
   * be worth quibbling over would be the value of beta, which I picked so
   * that it would look "reasonable" on a graph.
   */
  private static final double kcubic = 2.0;            /* (0.5 angstrom)^-1 */
  private static final double rthresh = 1 / (3 * kcubic);
  private static final double beta = 3.0;
  private static final double a = rthresh * (1 - 1.5 * kcubic * rthresh) *
	Math.exp (beta * rthresh);
  private static final double z = (a / beta) * Math.exp(-beta * rthresh) +
	0.5 * rthresh * rthresh * (1 - kcubic * rthresh);
	public final static double B = 2.0;
	public final static double C = .583333;
/**
 * Insert the method's description here.
 * Creation date: (6/19/00 4:09:33 PM)
 */
public lterm() {}
public lterm(atom a1, atom a2) {
	myAtoms = new atom[2];
	myAtoms[0] = a1;
	myAtoms[1] = a2;
	setCalculationValues();
}
  protected void buildTerm (Vector v, Vector termList)
    {
	int atom1 = ((atom)v.elementAt(0)).getMM3TypeNum();
	int atom2 = ((atom)v.elementAt(1)).getMM3TypeNum();

	if (atom1 < atom2)
	{
	    lterm t = new lterm ((atom) v.elementAt(0), (atom) v.elementAt(1));
	    termList.addElement(t);
	}
	else if(atom1 == atom2)
	{
	    if ( ((atom)v.elementAt(0)).x[0] < ((atom)v.elementAt(1)).x[0] )
	    {
		lterm t = new lterm ((atom) v.elementAt(0), (atom) v.elementAt(1));
		termList.addElement (t);
	    }
	}

    }
public double computeForces() {
	int i;

	// compute forces on each atom, add it to the atom's force vector
	double[] diff = new double[3];
	double r, m;
	for (i = 0, r = 0.0; i < 3; i++) {
		diff[i] = myAtoms[0].x[i] - myAtoms[1].x[i];
		r += diff[i] * diff[i];
	}

	if(r <= 0) r = mm3MinimizeAlgorythm.TINY;
	r = Math.sqrt(r);
	//System.out.println("r:"+r);
	//System.out.println("r0:"+r0);
	double rdiff = (r - r0);
	if(rdiff == 0.0){
		potential = 0.0;
		return 0.0;
	}
	potential = computePotential(rdiff);
	// changed from m = 5* computePotentialDerivative(rdiff);
	m = computePotentialDerivative(rdiff);

	// at this point, m is du/dr
	m /= r;
	// m > 0 attract, m < 0 repel
	for (i = 0; i < 3; i++) {
		myAtoms[0].f[i] -= m * diff[i];
		myAtoms[1].f[i] += m * diff[i];
	}
	double jtemp1 = diff[0] * diff[0] + diff[1] * diff[1] + diff[2] * diff[2];
	if(jtemp1 <= 0) jtemp1 = mm3MinimizeAlgorythm.TINY;
	return m * Math.sqrt(jtemp1);
	//return m*r;
}
/**
 * Insert the method's description here.
 * Creation date: (6/15/00 1:22:01 PM)
 * @return double
 * @param lengthDifference double
 */
protected double computePotentialDerivative(double lengthDifference) {
	// Changed from 4*B*B*C*lengthDifference*lengthDifference;
	double bcTerm = 4*B*C*lengthDifference*lengthDifference;
	double force = .5*ks * lengthDifference * (2 - 3*B * lengthDifference + bcTerm);
	return force;
}

  protected double computePotential(double lD){
	return 0.5*ks*lD*lD*(1-B*lD*(1-C*lD));
  }

  protected String repr2()
	{
	  return " length " +
	(new Double(ks)).toString() + " " +
	(new Double(r0)).toString();
	}
/**
 * Insert the method's description here.
 * Creation date: (6/15/00 1:36:02 PM)
 */
protected void setCalculationValues() {
	int atomOneType = myAtoms[0].getMM3TypeNum();
	int atomTwoType = myAtoms[1].getMM3TypeNum();
	if (atomOneType < 0 || atomTwoType < 0) {
		setDefaultCalculationValues();
		return;
	}

	try {
		AtomDataFile dataFile = new AtomDataFile(newNanocad.txtDir +
				newNanocad.fileSeparator + "mm3ldata.txt");
		//AtomDataFile dataFile = new AtomDataFile("mm3ldata.txt");
		if (dataFile.findData(atomOneType, atomTwoType, 0, 1)) {
			ks = dataFile.parseDouble(2);
			r0 = dataFile.parseDouble(3);
		} else {
			setDefaultCalculationValues();
			return;
		}
	} catch (java.io.IOException e) {
		System.err.println("Length data lookup error");
		e.printStackTrace();
	}
}
/**
 * Insert the method's description here.
 * Creation date: (6/19/00 1:50:46 PM)
 */
protected void setDefaultCalculationValues()
{
	defaultsUsed = true;
	ks = 2.0;
	r0 = 1.2;
	//System.out.println("No data for " + myAtoms[0].getMM3TypeNum() + " " + myAtoms[1].getMM3TypeNum() + " bond");
}
  public int termLength()
	{
	  return 2;
	}
  public String name()
  {
	return "Length";
  }
}


text:
package au.com.scds.chats.dom.general.names;

import javax.jdo.annotations.*;

import org.apache.isis.applib.annotation.MemberOrder;
import org.apache.isis.applib.annotation.PropertyLayout;

@PersistenceCapable(identityType = IdentityType.APPLICATION)
@Queries({
	@Query(name = "findActivityTypeByName", language = "JDOQL", value = "SELECT "
			+ "FROM au.com.scds.chats.dom.general.names.ActivityType "
			+ "WHERE name == :name"),
	@Query(name = "findAllActivityTypes", language = "JDOQL", value = "SELECT "
			+ "FROM  au.com.scds.chats.dom.general.names.ActivityType "
			+ "ORDER BY name")})
public class ActivityType extends ClassificationValue{

	public ActivityType() {
		super();
	}

	//use for testing only
	public ActivityType(String name) {
		super(name);
	}

	@PropertyLayout(named="Activity Type")
	@MemberOrder(sequence = "1")
	@Override
	public String getName() {
		return super.getName();
	}
}


text:
/*! HTML5 Boilerplate v5.3.0 | MIT License | https://html5boilerplate.com/ */

/*
 * What follows is the result of much research on cross-browser styling.
 * Credit left inline and big thanks to Nicolas Gallagher, Jonathan Neal,
 * Kroc Camen, and the H5BP dev community and team.
 */

/* ==========================================================================
   Base styles: opinionated defaults
   ========================================================================== */

html {
    color: #222;
    font-size: 1em;
    line-height: 1.4;
}

/*
 * Remove text-shadow in selection highlight:
 * https://twitter.com/miketaylr/status/12228805301
 *
 * These selection rule sets have to be separate.
 * Customize the background color to match your design.
 */

::-moz-selection {
    background: #b3d4fc;
    text-shadow: none;
}

::selection {
    background: #b3d4fc;
    text-shadow: none;
}

/*
 * A better looking default horizontal rule
 */

hr {
    display: block;
    height: 1px;
    border: 0;
    border-top: 1px solid #ccc;
    margin: 1em 0;
    padding: 0;
}

/*
 * Remove the gap between audio, canvas, iframes,
 * images, videos and the bottom of their containers:
 * https://github.com/h5bp/html5-boilerplate/issues/440
 */

audio,
canvas,
iframe,
img,
svg,
video {
    vertical-align: middle;
}

/*
 * Remove default fieldset styles.
 */

fieldset {
    border: 0;
    margin: 0;
    padding: 0;
}

/*
 * Allow only vertical resizing of textareas.
 */

textarea {
    resize: vertical;
}

/* ==========================================================================
   Browser Upgrade Prompt
   ========================================================================== */

.browserupgrade {
    margin: 0.2em 0;
    background: #ccc;
    color: #000;
    padding: 0.2em 0;
}

/* ==========================================================================
   Author's custom styles
   ========================================================================== */

@keyframes fadein {
    0%{opacity:0}
    75%{opacity:0}
    100%{opacity:1}
}

/* Firefox < 16 */
@-moz-keyframes fadein {
    0%{opacity:0}
    80%{opacity:0}
    100%{opacity:1}
}

/* Safari, Chrome and Opera > 12.1 */
@-webkit-keyframes fadein {
    0%{opacity:0}
    80%{opacity:0}
    100%{opacity:1}
}

/* Internet Explorer */
@-ms-keyframes fadein {
    0%{opacity:0}
    80%{opacity:0}
    100%{opacity:1}
}

/* Opera < 12.1 */
@-o-keyframes fadein {
    0%{opacity:0}
    80%{opacity:0}
    100%{opacity:1}
}

@keyframes opening {
  0% {
    background-color: #1565c0;
  }
  100% {
    background-color: #ffffff;
  }
}

@font-face {
    font-family: "Roboto Light";
    src: url("../fonts/roboto/Roboto-Light.woff");
}

body {
  animation: opening 2s 1;
  display: flex;
  min-height: 100vh;
  flex-direction: column;
}

.main {
    flex: 1 0 auto;
    margin-left: 50px;
    margin-right: 50px;
    margin-bottom: 30px;
}

@media only screen and (min-width: 768px) {
  .main {
    margin-left: 100px;
    margin-right: 300px;
    margin-bottom: 50px;
  }
}

.menu {
    background-color: #1565c0;
    margin: 0px;
}

.menu_inner {
    margin-right: 30px;
    padding-top: 20px;
    padding-bottom: 10px;
}

p {
    font-family: "Roboto";
    font-size: 17px;
}

a {
    text-decoration: none;
    font-family: "Roboto";
    font-size: 17px;
}

@media only screen and (min-width: 768px) {
    a {
        font-size: 20px;
    }
}

#name {
    -webkit-animation-delay: 1s; /* Safari 4.0 - 8.0 */
    animation-delay: 1s;

    font-size: 40px;
    letter-spacing: 6px;
    text-transform: uppercase;
    margin-top: 50px;
    margin-bottom: 30px;
}

.m_ele {
    animation-play-state: paused;
    font-size: 12px;
    font-family: "Roboto Light";
    display: inline-block;
    line-height: 0px;
    color: #ffffff;
    text-align: right;
    margin-right: 10px;
    margin-bottom: 20px;
}

@media only screen and (min-width: 768px) {
  .m_ele {
      font-size: 20px;
      margin-right: 40px;
      margin-top: 20px;
  }
}

.m_ele:hover {
    animation-play-state: running;
}

.lowercs {
    display: none;
}

.lowermath {
    display: none;
}

.physics {
    display: none;
}

.uppercs {
    display: none;
}

.info {
    font-family: "Roboto Light";
    font-size: 17px;
    animation: 2s ease 0s normal forwards 1 fadein;
    -webkit-animation: 2s ease 0s normal forwards 1 fadein;
    opacity: 1;
    margin-bottom: 20px;
}

@media only screen and (min-width: 768px) {
  .info {
    font-size: 20px;
  }
}

.info_undelayed {
    animation: 1s ease 0s normal forwards 1 fadein;
    -webkit-animation: 1s ease 0s normal forwards 1 fadein;
    opacity: 1;
}

#copyright_name {
    font-size: 15px;
    font-family: "Roboto Light";
    color: #ffffff;
    margin-top: 20px;
    margin-bottom: 10px;
}
/* ==========================================================================
   Helper classes
   ========================================================================== */

/*
 * Hide visually and from screen readers
 */

.hidden {
    display: none !important;
}

/*
 * Hide only visually, but have it available for screen readers:
 * http://snook.ca/archives/html_and_css/hiding-content-for-accessibility
 */

.visuallyhidden {
    border: 0;
    clip: rect(0 0 0 0);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
}

/*
 * Extends the .visuallyhidden class to allow the element
 * to be focusable when navigated to via the keyboard:
 * https://www.drupal.org/node/897638
 */

.visuallyhidden.focusable:active,
.visuallyhidden.focusable:focus {
    clip: auto;
    height: auto;
    margin: 0;
    overflow: visible;
    position: static;
    width: auto;
}

/*
 * Hide visually and from screen readers, but maintain layout
 */

.invisible {
    visibility: hidden;
}

/*
 * Clearfix: contain floats
 *
 * For modern browsers
 * 1. The space content is one way to avoid an Opera bug when the
 *    `contenteditable` attribute is included anywhere else in the document.
 *    Otherwise it causes space to appear at the top and bottom of elements
 *    that receive the `clearfix` class.
 * 2. The use of `table` rather than `block` is only necessary if using
 *    `:before` to contain the top-margins of child elements.
 */

.clearfix:before,
.clearfix:after {
    content: " "; /* 1 */
    display: table; /* 2 */
}

.clearfix:after {
    clear: both;
}

/* ==========================================================================
   EXAMPLE Media Queries for Responsive Design.
   These examples override the primary ('mobile first') styles.
   Modify as content requires.
   ========================================================================== */

@media only screen and (min-width: 35em) {
    /* Style adjustments for viewports that meet the condition */
}

@media print,
       (-webkit-min-device-pixel-ratio: 1.25),
       (min-resolution: 1.25dppx),
       (min-resolution: 120dpi) {
    /* Style adjustments for high resolution devices */
}

/* ==========================================================================
   Print styles.
   Inlined to avoid the additional HTTP request:
   http://www.phpied.com/delay-loading-your-print-css/
   ========================================================================== */

@media print {
    *,
    *:before,
    *:after,
    *:first-letter,
    *:first-line {
        background: transparent !important;
        color: #000 !important; /* Black prints faster:
                                   http://www.sanbeiji.com/archives/953 */
        box-shadow: none !important;
        text-shadow: none !important;
    }

    a,
    a:visited {
        text-decoration: underline;
    }

    a[href]:after {
        content: " (" attr(href) ")";
    }

    abbr[title]:after {
        content: " (" attr(title) ")";
    }

    /*
     * Don't show links that are fragment identifiers,
     * or use the `javascript:` pseudo protocol
     */

    a[href^="#"]:after,
    a[href^="javascript:"]:after {
        content: "";
    }

    pre,
    blockquote {
        border: 1px solid #999;
        page-break-inside: avoid;
    }

    /*
     * Printing Tables:
     * http://css-discuss.incutio.com/wiki/Printing_Tables
     */

    thead {
        display: table-header-group;
    }

    tr,
    img {
        page-break-inside: avoid;
    }

    img {
        max-width: 100% !important;
    }

    p,
    h2,
    h3 {
        orphans: 3;
        widows: 3;
    }

    h2,
    h3 {
        page-break-after: avoid;
    }
}


text:
/*

 * This file is released under terms of BSD license
 * See LICENSE file for more information
 */
package claw.tatsu.xcodeml.xnode.common;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;

import java.nio.file.Files;
import java.util.List;

import org.junit.Test;

import claw.tatsu.common.Context;
import claw.tatsu.xcodeml.xnode.fortran.FfunctionDefinition;
import claw.tatsu.xcodeml.xnode.fortran.FmoduleDefinition;
import claw.tatsu.xcodeml.xnode.fortran.FortranType;
import helper.TestConstant;
import helper.Utils.TestContext;
import helper.XmlHelper;

/**
 * Test the features of the XdeclTable class.
 *
 * @author clementval
 */
public class XdeclTableTest
{

    private static final String DECL1 = "<declarations>" + "<varDecl lineno=\"4730\" file=\"dummy.f90\">"
            + "<name type=\"I1241bd0\">name1</name></varDecl>\n" + "<varDecl lineno=\"4731\" file=\"dummy.f90\">"
            + "<name type=\"I1241c70\">name2</name></varDecl>" + "</declarations>";

    @Test
    public void emptyTest()
    {
        XdeclTable decl = XmlHelper.createXdeclTable("<declarations></declarations>");
        assertNotNull(decl);
        assertEquals(0, decl.count());
        assertTrue(decl.uses().isEmpty());
        assertTrue(decl.values().isEmpty());
        assertFalse(decl.contains("name1"));
        assertNull(decl.get("name1"));
    }

    @Test
    public void simpleDeclTableTest()
    {
        XdeclTable decl = XmlHelper.createXdeclTable(DECL1);
        assertNotNull(decl);
        assertEquals(2, decl.count());

        Xnode var1 = decl.get("name1");
        assertNotNull(var1);
        assertEquals(4730, var1.lineNo());
        assertEquals("dummy.f90", var1.filename());
        assertEquals("name1", var1.matchSeq(Xcode.NAME).value());
        assertEquals("I1241bd0", var1.getType());

        Xnode var2 = decl.get("name2");
        assertNotNull(var2);
        assertEquals(4731, var2.lineNo());
        assertEquals("dummy.f90", var2.filename());
        assertEquals("name2", var2.matchSeq(Xcode.NAME).value());
        assertEquals("I1241c70", var2.getType());
    }

    private XcodeProgram createFromFile(Context context)
    {
        assertTrue(Files.exists(TestConstant.TEST_DECLARATIONS));
        XcodeProgram xcodeml = XcodeProgram.createFromFile(TestConstant.TEST_DECLARATIONS, context);
        assertNotNull(xcodeml);
        return xcodeml;
    }

    @Test
    public void allKindOfDeclTest()
    {
        Context context = new TestContext();
        XcodeProgram xcodeml = createFromFile(context);

        XglobalDeclTable global = xcodeml.getGlobalDeclarationsTable();
        assertNotNull(global);
        assertNull(global.getFunctionDefinition("unknown"));
        assertNull(global.getModuleDefinition("unknown"));

        List<Xnode> modules = xcodeml.matchAll(Xcode.F_MODULE_DEFINITION);
        assertEquals(1, modules.size());

        FmoduleDefinition mod = new FmoduleDefinition(modules.get(0));
        XdeclTable modDecl = mod.getDeclarationTable();
        assertNotNull(modDecl);
        List<Xnode> modDeclarations = modDecl.values();
        assertEquals(2, modDeclarations.size());
        assertEquals(Xcode.F_STRUCT_DECL, modDeclarations.get(0).opcode());
        assertEquals(Xcode.F_INTERFACE_DECL, modDeclarations.get(1).opcode());

        Xnode interface1 = modDecl.get("dummy");
        assertNotNull(interface1);
        assertEquals(Xcode.F_INTERFACE_DECL, interface1.opcode());

        assertEquals(1, modDecl.values(Xcode.F_INTERFACE_DECL).size());

        List<Xnode> functions = xcodeml.matchAll(Xcode.F_FUNCTION_DEFINITION);
        assertEquals(1, functions.size());

        FfunctionDefinition fctDef = new FfunctionDefinition(functions.get(0));
        XdeclTable fctDecl = fctDef.getDeclarationTable();
        assertNotNull(fctDecl);
        List<Xnode> fctDeclarations = fctDecl.values();
        assertEquals(10, fctDeclarations.size());
        assertEquals(Xcode.VAR_DECL, fctDeclarations.get(0).opcode());
        assertEquals(Xcode.VAR_DECL, fctDeclarations.get(1).opcode());
        assertEquals(Xcode.F_NAMELIST_DECL, fctDeclarations.get(2).opcode());
        assertEquals(Xcode.VAR_DECL, fctDeclarations.get(3).opcode());
        assertEquals(Xcode.VAR_DECL, fctDeclarations.get(4).opcode());
        assertEquals(Xcode.F_COMMON_DECL, fctDeclarations.get(5).opcode());
        assertEquals(Xcode.F_USE_DECL, fctDeclarations.get(6).opcode());
        assertEquals(Xcode.F_USE_ONLY_DECL, fctDeclarations.get(7).opcode());
        assertEquals(Xcode.F_EQUIVALENCE_DECL, fctDeclarations.get(8).opcode());
        assertEquals(Xcode.EXTERN_DECL, fctDeclarations.get(9).opcode());

        Xnode varDecl1 = fctDecl.get("sub1");
        assertNotNull(varDecl1);
        assertEquals(Xcode.VAR_DECL, varDecl1.opcode());

        Xnode namelist = fctDecl.get("case");
        assertNotNull(namelist);
        assertEquals(Xcode.F_NAMELIST_DECL, namelist.opcode());

        Xnode useDecl = fctDecl.get("mod4");
        assertNotNull(useDecl);
        assertEquals(Xcode.F_USE_DECL, useDecl.opcode());

        Xnode useOnlyDecl = fctDecl.get("mod5");
        assertNotNull(useOnlyDecl);
        assertEquals(Xcode.F_USE_ONLY_DECL, useOnlyDecl.opcode());

        Xnode externDecl = fctDecl.get("interface_sub");
        assertNotNull(externDecl);
        assertEquals(Xcode.EXTERN_DECL, externDecl.opcode());

        assertEquals(4, fctDecl.values(Xcode.VAR_DECL).size());
        assertEquals(1, fctDecl.values(Xcode.F_USE_DECL).size());
        assertEquals(1, fctDecl.values(Xcode.F_USE_ONLY_DECL).size());
        assertEquals(1, fctDecl.values(Xcode.F_NAMELIST_DECL).size());
        assertEquals(1, fctDecl.values(Xcode.F_EQUIVALENCE_DECL).size());
        assertEquals(1, fctDecl.values(Xcode.EXTERN_DECL).size());
    }

    @Test
    public void addRemoveTest()
    {
        Context context = new TestContext();
        XcodeProgram xcodeml = createFromFile(context);

        List<Xnode> functions = xcodeml.matchAll(Xcode.F_FUNCTION_DEFINITION);
        assertEquals(1, functions.size());
        FfunctionDefinition fctDef = new FfunctionDefinition(functions.get(0));
        assertNotNull(fctDef);

        XdeclTable fctDecl = fctDef.getDeclarationTable();
        assertNotNull(fctDecl);

        String key1 = "key1";
        String key2 = "key2";
        String key3 = "key3";

        // Add
        Xnode varDecl1 = xcodeml.createVarDecl(xcodeml.getTypeTable().generateHash(FortranType.INTEGER), key1);
        fctDecl.add(varDecl1);
        assertNotNull(fctDecl.get(key1));

        // Replace existing one
        Xnode varDecl2 = xcodeml.createVarDecl(xcodeml.getTypeTable().generateHash(FortranType.INTEGER), key1);
        fctDecl.replace(varDecl2, key1);
        assertNotNull(fctDecl.get(key1));
        assertEquals(varDecl2.getType(), fctDecl.get(key1).getType());

        // Replace non-existing - like add
        Xnode varDecl3 = xcodeml.createVarDecl(xcodeml.getTypeTable().generateHash(FortranType.INTEGER), key2);
        fctDecl.replace(varDecl3, key2);
        assertNotNull(fctDecl.get(key2));
        assertEquals(varDecl3.getType(), fctDecl.get(key2).getType());

        // Add at the beginning of the table
        Xnode varDecl4 = xcodeml.createVarDecl(xcodeml.getTypeTable().generateHash(FortranType.INTEGER), key3);
        fctDecl.addFirst(varDecl4);
        assertEquals(varDecl4.getType(), fctDecl.firstChild().getType());

    }

}


text:
steal.plugins('jquery/controller','jquery/view').then(function($){
/**
 * Show a list of paragraphs
 * @tag controllers, home
 */
$.Controller.extend('Core.BlogRoll',
/* @Static */
{
	defaults: {}
},
/* @Prototype */
{

	/**
	 * Initializes a new instance of Paragrapher.
	 * @codestart
	 * $(selector).srchr_search_result({
	 *	modelType : Srchr.Models.Google,
	 *  listenTo : $('#searchBox')
	 * })
	 * @codeend
	 */
	init: function(element, options){
		options.modelType.findAll({}, this.callback('list_all'));
	},

	 /**
 	* Displays a list of paragraphers and the submit form.
	 * @param {Array} paragraphers An array of Core.Models.Paragrapher objects.
	 */
 	list_all: function( blogrolls ){
		this.element.html('blogroll_tmpl',{blogrolls:blogrolls})
 	}
});

});


text:
<?xml version="1.0" encoding="utf-8"?>
<ApplicationManifest xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ApplicationTypeName="CQRSMicroservices.ServiceFabric.ApplicationType" ApplicationTypeVersion="1.0.0" xmlns="http://schemas.microsoft.com/2011/01/fabric">
   <Parameters>
      <Parameter Name="AggregateRootActorService_PartitionCount" DefaultValue="10" />
      <Parameter Name="WebService_InstanceCount" DefaultValue="-1" />
      <Parameter Name="QueryModelBuilderService_MinReplicaSetSize" DefaultValue="2" />
      <Parameter Name="QueryModelBuilderService_PartitionCount" DefaultValue="1" />
      <Parameter Name="QueryModelBuilderService_TargetReplicaSetSize" DefaultValue="3" />
      <Parameter Name="EventBusService_MinReplicaSetSize" DefaultValue="2" />
      <Parameter Name="EventBusService_PartitionCount" DefaultValue="1" />
      <Parameter Name="EventBusService_TargetReplicaSetSize" DefaultValue="3" />
   </Parameters>
   <ServiceManifestImport>
      <ServiceManifestRef ServiceManifestName="CQRSMicroservices.ServiceFabric.AggregateRootActorPkg" ServiceManifestVersion="1.0.0" />
   </ServiceManifestImport>
   <ServiceManifestImport>
      <ServiceManifestRef ServiceManifestName="CQRSMicroservices.ServiceFabric.WebServicePkg" ServiceManifestVersion="1.0.0" />
      <ConfigOverrides />
   </ServiceManifestImport>
   <ServiceManifestImport>
      <ServiceManifestRef ServiceManifestName="CQRSMicroservices.ServiceFabric.QueryModelBuilderServicePkg" ServiceManifestVersion="1.0.0" />
      <ConfigOverrides />
   </ServiceManifestImport>
   <ServiceManifestImport>
      <ServiceManifestRef ServiceManifestName="CQRSMicroservices.ServiceFabric.EventBusServicePkg" ServiceManifestVersion="1.0.0" />
      <ConfigOverrides />
   </ServiceManifestImport>
   <DefaultServices>
      <Service Name="AggregateRootActorService" GeneratedIdRef="ccec184a-598a-45a2-a98b-bec765f87210">
         <StatelessService ServiceTypeName="AggregateRootActorServiceType">
            <UniformInt64Partition PartitionCount="[AggregateRootActorService_PartitionCount]" LowKey="-9223372036854775808" HighKey="9223372036854775807" />
         </StatelessService>
      </Service>
      <Service Name="WebService">
         <StatelessService ServiceTypeName="WebServiceType" InstanceCount="[WebService_InstanceCount]">
            <SingletonPartition />
         </StatelessService>
      </Service>
      <Service Name="QueryModelBuilderService">
         <StatefulService ServiceTypeName="QueryModelBuilderServiceType" TargetReplicaSetSize="[QueryModelBuilderService_TargetReplicaSetSize]" MinReplicaSetSize="[QueryModelBuilderService_MinReplicaSetSize]">
            <NamedPartition>
               <Partition Name="CQRSMicroservices.Articles.ArticleQueryModelBuilder, CQRSMicroservices.Application" />
               <Partition Name="CQRSMicroservices.Customers.CustomerQueryModelBuilder, CQRSMicroservices.Application" />
            </NamedPartition>
         </StatefulService>
      </Service>
      <Service Name="EventBusService">
         <StatefulService ServiceTypeName="EventBusServiceType" TargetReplicaSetSize="[EventBusService_TargetReplicaSetSize]" MinReplicaSetSize="[EventBusService_MinReplicaSetSize]">
            <SingletonPartition />
         </StatefulService>
      </Service>
   </DefaultServices>
</ApplicationManifest>


text:
<?php
defined('BASEPATH') OR exit('No direct script access allowed');

/**
 * @author Adriaan Knapen <a.d.knapen@protonmail.com>
 * @date 26-2-2017
 */

class InsufficientRightsPage extends PageFrame
{

    public function getViews(): array
    {
        return [
            '../../error/insufficientRights',
        ];
    }

    public function hasAccess(): bool
    {
        return true;
    }

    protected function getFormValidationRules()
    {
        return false;
    }

    /**
     * Function which is called after construction and before the views are rendered.
     */
    public function beforeView()
    {
    }

    /**
     * Defines which models should be loaded.
     *
     * @return array;
     */
    protected function getModels(): array
    {
        return [];
    }

    /**
     * Defines which libraries should be loaded.
     *
     * @return array;
     */
    protected function getLibraries(): array
    {
        return [];
    }

    /**
     * Defines which helpers should be loaded.
     *
     * @return array;
     */
    protected function getHelpers(): array
    {
        return [];
    }
}