text:
MKDIR := mkdir -p
ECHO := echo
SPACE := $(empty) $(empty)

#------------------------------------------------------------------------------
#                         The adjust-path macro
#
# If COMSPEC is defined, Make is launched from Windows through
# Cygwin.  This adjust-path macro will call 'cygpath -u' on all
# paths to ensure they are readable by Make.
#
# If COMSPEC is not defined, Make is launched from *nix, and no adjustment
# is necessary
#------------------------------------------------------------------------------

ifndef COMSPEC
ifdef ComSpec
COMSPEC = $(ComSpec)
endif # ComSpec
endif # !COMSPEC

ifdef COMSPEC
	adjust-path = $(subst $(SPACE),\$(SPACE),$(shell cygpath -u "$1"))
	adjust-path-mixed = $(subst $(SPACE),\$(SPACE),$(shell cygpath -m "$1"))
else
	adjust-path = $(subst $(SPACE),\$(SPACE),$1)
	adjust-path-mixed = $(subst $(SPACE),\$(SPACE),$1)
endif

#------------------------------------------------------------------------------
#                               DEFAULT TARGET
#
# The default target, "all", must appear before any other target in the
# Makefile. Note that extra prerequisites are added to the "all" rule later.
#------------------------------------------------------------------------------
.PHONY: all
all:
	@$(ECHO) [BSP build complete]

#------------------------------------------------------------------------------
#                           PATHS & DIRECTORY NAMES
#
# Explicitly locate absolute path of the BSP root
#------------------------------------------------------------------------------

BSP_ROOT_DIR := .

# Define absolute path to the root of the BSP.
ABS_BSP_ROOT := $(call adjust-path-mixed,$(shell pwd))

# Stash all BSP object files here
OBJ_DIR := ./obj

#------------------------------------------------------------------------------
#                              MANAGED CONTENT
#
# All content between the lines "START MANAGED" and "END MANAGED" below is
# generated based on variables in the BSP settings file when the
# nios2-bsp-generate-files command is invoked. If you wish to persist any
# information pertaining to the build process, it is recomended that you
# utilize the BSP settings mechanism to do so.
#
# Note that most variable assignments in this section have a corresponding BSP
# setting that can be changed by using the nios2-bsp-create-settings or
# nios2-bsp-update-settings command before nios2-bsp-generate-files; if you
# want any variable set to a specific value when this Makefile is re-generated
# (to prevent hand-edits from being over-written), use the BSP settings
# facilities above.
#------------------------------------------------------------------------------

#START MANAGED

# The following TYPE comment allows tools to identify the 'type' of target this
# makefile is associated with.
# TYPE: BSP_PRIVATE_MAKEFILE

# This following VERSION comment indicates the version of the tool used to
# generate this makefile. A makefile variable is provided for VERSION as well.
# ACDS_VERSION: 15.0
ACDS_VERSION := 15.0

# This following BUILD_NUMBER comment indicates the build number of the tool
# used to generate this makefile.
# BUILD_NUMBER: 145

SETTINGS_FILE := settings.bsp
SOPC_FILE := ../../ni2.sopcinfo

#-------------------------------------------------------------------------------
#                             TOOL & COMMAND DEFINITIONS
#
# The base command for each build operation are expressed here. Additional
# switches may be expressed here. They will run for all instances of the
# utility.
#-------------------------------------------------------------------------------

# Archiver command. Creates library files.
AR = nios2-elf-ar

# Assembler command. Note that CC is used for .S files.
AS = nios2-elf-gcc

# Custom flags only passed to the archiver. This content of this variable is
# directly passed to the archiver rather than the more standard "ARFLAGS". The
# reason for this is that GNU Make assumes some default content in ARFLAGS.
# This setting defines the value of BSP_ARFLAGS in Makefile.
BSP_ARFLAGS = -src

# Custom flags only passed to the assembler. This setting defines the value of
# BSP_ASFLAGS in Makefile.
BSP_ASFLAGS = -Wa,-gdwarf2

# C/C++ compiler debug level. '-g' provides the default set of debug symbols
# typically required to debug a typical application. Omitting '-g' removes
# debug symbols from the ELF. This setting defines the value of
# BSP_CFLAGS_DEBUG in Makefile.
BSP_CFLAGS_DEBUG = -g

# C/C++ compiler optimization level. "-O0" = no optimization,"-O2" = "normal"
# optimization, etc. "-O0" is recommended for code that you want to debug since
# compiler optimization can remove variables and produce non-sequential
# execution of code while debugging. This setting defines the value of
# BSP_CFLAGS_OPTIMIZATION in Makefile.
BSP_CFLAGS_OPTIMIZATION = -O0

# C/C++ compiler warning level. "-Wall" is commonly used.This setting defines
# the value of BSP_CFLAGS_WARNINGS in Makefile.
BSP_CFLAGS_WARNINGS = -Wall

# C compiler command.
CC = nios2-elf-gcc -xc

# C++ compiler command.
CXX = nios2-elf-gcc -xc++

# Command used to remove files during 'clean' target.
RM = rm -f

#-------------------------------------------------------------------------------
#                         BUILD PRE & POST PROCESS COMMANDS
#
# The following variables are treated as shell commands in the rule
# definitions for each file-type associated with the BSP build, as well as
# commands run at the beginning and end of the entire BSP build operation.
# Pre-process commands are executed before the relevant command (for example,
# a command defined in the "CC_PRE_PROCESS" variable executes before the C
# compiler for building .c files), while post-process commands are executed
# immediately afterwards.
#
# You can view each pre/post-process command in the "Build Rules: All &
# Clean", "Pattern Rules to Build Objects", and "Library Rules" sections of
# this Makefile.
#-------------------------------------------------------------------------------

#-------------------------------------------------------------------------------
#                     BSP SOURCE BUILD SETTINGS (FLAG GENERATION)
#
# Software build settings such as compiler optimization, debug level, warning
# flags, etc., may be defined in the following variables. The variables below
# are concatenated together in the 'Flags' section of this Makefile to form
# final variables of flags passed to the build tools.
#
# These settings are considered private to the BSP and apply to all library &
# driver files in it; they do NOT automatically propagate to, for example, the
# build settings for an application.
# # For additional detail and syntax requirements, please refer to GCC help
# (example: "nios2-elf-gcc --help --verbose").
#
# Unless indicated otherwise, multiple entries in each variable should be
# space-separated.
#-------------------------------------------------------------------------------

# Altera HAL alt_sys_init.c generated source file
GENERATED_C_FILES := $(ABS_BSP_ROOT)/alt_sys_init.c
GENERATED_C_LIB_SRCS += alt_sys_init.c

#-------------------------------------------------------------------------------
#                            BSP SOURCE FILE LISTING
#
# All source files that comprise the BSP are listed here, along with path
# information to each file expressed relative to the BSP root. The precise
# list and location of each file is derived from the driver, operating system,
# or software package source file declarations.
#
# Following specification of the source files for each component, driver, etc.,
# each source file type (C, assembly, etc.) is concatenated together and used
# to construct a list of objects. Pattern rules to build each object are then
# used to build each file.
#-------------------------------------------------------------------------------

# altera_avalon_jtag_uart_driver sources root
altera_avalon_jtag_uart_driver_SRCS_ROOT := drivers

# altera_avalon_jtag_uart_driver sources
altera_avalon_jtag_uart_driver_C_LIB_SRCS := \
	$(altera_avalon_jtag_uart_driver_SRCS_ROOT)/src/altera_avalon_jtag_uart_init.c \
	$(altera_avalon_jtag_uart_driver_SRCS_ROOT)/src/altera_avalon_jtag_uart_read.c \
	$(altera_avalon_jtag_uart_driver_SRCS_ROOT)/src/altera_avalon_jtag_uart_write.c \
	$(altera_avalon_jtag_uart_driver_SRCS_ROOT)/src/altera_avalon_jtag_uart_ioctl.c \
	$(altera_avalon_jtag_uart_driver_SRCS_ROOT)/src/altera_avalon_jtag_uart_fd.c

# altera_avalon_timer_driver sources root
altera_avalon_timer_driver_SRCS_ROOT := drivers

# altera_avalon_timer_driver sources
altera_avalon_timer_driver_C_LIB_SRCS := \
	$(altera_avalon_timer_driver_SRCS_ROOT)/src/altera_avalon_timer_sc.c \
	$(altera_avalon_timer_driver_SRCS_ROOT)/src/altera_avalon_timer_ts.c \
	$(altera_avalon_timer_driver_SRCS_ROOT)/src/altera_avalon_timer_vars.c

# altera_nios2_gen2_hal_driver sources root
altera_nios2_gen2_hal_driver_SRCS_ROOT := HAL

# altera_nios2_gen2_hal_driver sources
altera_nios2_gen2_hal_driver_C_LIB_SRCS := \
	$(altera_nios2_gen2_hal_driver_SRCS_ROOT)/src/altera_nios2_gen2_irq.c \
	$(altera_nios2_gen2_hal_driver_SRCS_ROOT)/src/alt_usleep.c \
	$(altera_nios2_gen2_hal_driver_SRCS_ROOT)/src/alt_busy_sleep.c \
	$(altera_nios2_gen2_hal_driver_SRCS_ROOT)/src/alt_irq_vars.c \
	$(altera_nios2_gen2_hal_driver_SRCS_ROOT)/src/alt_icache_flush.c \
	$(altera_nios2_gen2_hal_driver_SRCS_ROOT)/src/alt_icache_flush_all.c \
	$(altera_nios2_gen2_hal_driver_SRCS_ROOT)/src/alt_dcache_flush.c \
	$(altera_nios2_gen2_hal_driver_SRCS_ROOT)/src/alt_dcache_flush_all.c \
	$(altera_nios2_gen2_hal_driver_SRCS_ROOT)/src/alt_dcache_flush_no_writeback.c \
	$(altera_nios2_gen2_hal_driver_SRCS_ROOT)/src/alt_ecc_fatal_exception.c \
	$(altera_nios2_gen2_hal_driver_SRCS_ROOT)/src/alt_instruction_exception_entry.c \
	$(altera_nios2_gen2_hal_driver_SRCS_ROOT)/src/alt_irq_register.c \
	$(altera_nios2_gen2_hal_driver_SRCS_ROOT)/src/alt_iic.c \
	$(altera_nios2_gen2_hal_driver_SRCS_ROOT)/src/alt_remap_cached.c \
	$(altera_nios2_gen2_hal_driver_SRCS_ROOT)/src/alt_remap_uncached.c \
	$(altera_nios2_gen2_hal_driver_SRCS_ROOT)/src/alt_uncached_free.c \
	$(altera_nios2_gen2_hal_driver_SRCS_ROOT)/src/alt_uncached_malloc.c \
	$(altera_nios2_gen2_hal_driver_SRCS_ROOT)/src/alt_do_ctors.c \
	$(altera_nios2_gen2_hal_driver_SRCS_ROOT)/src/alt_do_dtors.c \
	$(altera_nios2_gen2_hal_driver_SRCS_ROOT)/src/alt_gmon.c

altera_nios2_gen2_hal_driver_ASM_LIB_SRCS := \
	$(altera_nios2_gen2_hal_driver_SRCS_ROOT)/src/alt_ecc_fatal_entry.S \
	$(altera_nios2_gen2_hal_driver_SRCS_ROOT)/src/alt_exception_entry.S \
	$(altera_nios2_gen2_hal_driver_SRCS_ROOT)/src/alt_exception_trap.S \
	$(altera_nios2_gen2_hal_driver_SRCS_ROOT)/src/alt_exception_muldiv.S \
	$(altera_nios2_gen2_hal_driver_SRCS_ROOT)/src/alt_irq_entry.S \
	$(altera_nios2_gen2_hal_driver_SRCS_ROOT)/src/alt_software_exception.S \
	$(altera_nios2_gen2_hal_driver_SRCS_ROOT)/src/alt_mcount.S \
	$(altera_nios2_gen2_hal_driver_SRCS_ROOT)/src/alt_log_macro.S \
	$(altera_nios2_gen2_hal_driver_SRCS_ROOT)/src/crt0.S

# hal sources root
hal_SRCS_ROOT := HAL

# hal sources
hal_C_LIB_SRCS := \
	$(hal_SRCS_ROOT)/src/alt_alarm_start.c \
	$(hal_SRCS_ROOT)/src/alt_close.c \
	$(hal_SRCS_ROOT)/src/alt_dev.c \
	$(hal_SRCS_ROOT)/src/alt_dev_llist_insert.c \
	$(hal_SRCS_ROOT)/src/alt_dma_rxchan_open.c \
	$(hal_SRCS_ROOT)/src/alt_dma_txchan_open.c \
	$(hal_SRCS_ROOT)/src/alt_environ.c \
	$(hal_SRCS_ROOT)/src/alt_env_lock.c \
	$(hal_SRCS_ROOT)/src/alt_errno.c \
	$(hal_SRCS_ROOT)/src/alt_execve.c \
	$(hal_SRCS_ROOT)/src/alt_exit.c \
	$(hal_SRCS_ROOT)/src/alt_fcntl.c \
	$(hal_SRCS_ROOT)/src/alt_fd_lock.c \
	$(hal_SRCS_ROOT)/src/alt_fd_unlock.c \
	$(hal_SRCS_ROOT)/src/alt_find_dev.c \
	$(hal_SRCS_ROOT)/src/alt_find_file.c \
	$(hal_SRCS_ROOT)/src/alt_flash_dev.c \
	$(hal_SRCS_ROOT)/src/alt_fork.c \
	$(hal_SRCS_ROOT)/src/alt_fs_reg.c \
	$(hal_SRCS_ROOT)/src/alt_fstat.c \
	$(hal_SRCS_ROOT)/src/alt_get_fd.c \
	$(hal_SRCS_ROOT)/src/alt_getchar.c \
	$(hal_SRCS_ROOT)/src/alt_getpid.c \
	$(hal_SRCS_ROOT)/src/alt_gettod.c \
	$(hal_SRCS_ROOT)/src/alt_iic_isr_register.c \
	$(hal_SRCS_ROOT)/src/alt_instruction_exception_register.c \
	$(hal_SRCS_ROOT)/src/alt_ioctl.c \
	$(hal_SRCS_ROOT)/src/alt_io_redirect.c \
	$(hal_SRCS_ROOT)/src/alt_irq_handler.c \
	$(hal_SRCS_ROOT)/src/alt_isatty.c \
	$(hal_SRCS_ROOT)/src/alt_kill.c \
	$(hal_SRCS_ROOT)/src/alt_link.c \
	$(hal_SRCS_ROOT)/src/alt_load.c \
	$(hal_SRCS_ROOT)/src/alt_log_printf.c \
	$(hal_SRCS_ROOT)/src/alt_lseek.c \
	$(hal_SRCS_ROOT)/src/alt_main.c \
	$(hal_SRCS_ROOT)/src/alt_malloc_lock.c \
	$(hal_SRCS_ROOT)/src/alt_open.c \
	$(hal_SRCS_ROOT)/src/alt_printf.c \
	$(hal_SRCS_ROOT)/src/alt_putchar.c \
	$(hal_SRCS_ROOT)/src/alt_putstr.c \
	$(hal_SRCS_ROOT)/src/alt_read.c \
	$(hal_SRCS_ROOT)/src/alt_release_fd.c \
	$(hal_SRCS_ROOT)/src/alt_rename.c \
	$(hal_SRCS_ROOT)/src/alt_sbrk.c \
	$(hal_SRCS_ROOT)/src/alt_settod.c \
	$(hal_SRCS_ROOT)/src/alt_stat.c \
	$(hal_SRCS_ROOT)/src/alt_tick.c \
	$(hal_SRCS_ROOT)/src/alt_times.c \
	$(hal_SRCS_ROOT)/src/alt_unlink.c \
	$(hal_SRCS_ROOT)/src/alt_wait.c \
	$(hal_SRCS_ROOT)/src/alt_write.c

# Assemble all component C source files
COMPONENT_C_LIB_SRCS += \
	$(altera_avalon_jtag_uart_driver_C_LIB_SRCS) \
	$(altera_avalon_timer_driver_C_LIB_SRCS) \
	$(altera_nios2_gen2_hal_driver_C_LIB_SRCS) \
	$(hal_C_LIB_SRCS)

# Assemble all component assembly source files
COMPONENT_ASM_LIB_SRCS += \
	$(altera_nios2_gen2_hal_driver_ASM_LIB_SRCS)

# Assemble all component C++ source files
COMPONENT_CPP_LIB_SRCS += \

#END MANAGED

#------------------------------------------------------------------------------
#                                 PUBLIC.MK
#
# The generated public.mk file contains BSP information that is shared with
# other external makefiles, such as a Nios II application makefile. System-
# dependent information such as hardware-specific compiler flags and
# simulation file generation are stored here.
#
# In addition, public.mk contains include paths that various software,
# such as a device driver, may need for the C compiler. These paths are
# written to public.mk with respect to the BSP root. In public.mk, each
# path is prefixed with a special variable, $(ALT_LIBRARY_ROOT_DIR). The
# purpose of this variable is to allow an external Makefile to append on
# path information to precisely locate paths expressed in public.mk
# Since this is the BSP Makefile, we set ALT_LIBRARY_ROOT_DIR to point right
# here ("."), at the BSP root.
#
# ALT_LIBRARY_ROOT_DIR must always be set before public.mk is included.
#------------------------------------------------------------------------------
ALT_LIBRARY_ROOT_DIR := .
include public.mk

#------------------------------------------------------------------------------
#                                FLAGS
#
# Include paths for BSP files are written into the public.mk file and must
# be added to the existing list of pre-processor flags. In addition, "hooks"
# for standard flags left intentionally empty (CFLAGS, CPPFLAGS, ASFLAGS,
# and CXXFLAGS) are provided for conveniently adding to the relevant flags
# on the command-line or via script that calls make.
#------------------------------------------------------------------------------
# Assemble final list of compiler flags from generated content
BSP_CFLAGS += \
  $(BSP_CFLAGS_DEFINED_SYMBOLS) \
  $(BSP_CFLAGS_UNDEFINED_SYMBOLS) \
  $(BSP_CFLAGS_OPTIMIZATION) \
  $(BSP_CFLAGS_DEBUG) \
  $(BSP_CFLAGS_WARNINGS) \
  $(BSP_CFLAGS_USER_FLAGS) \
  $(ALT_CFLAGS) \
  $(CFLAGS)

# Make ready the final list of include directories and other C pre-processor
# flags. Each include path is made ready by prefixing it with "-I".
BSP_CPPFLAGS += \
  $(addprefix -I, $(BSP_INC_DIRS)) \
  $(addprefix -I, $(ALT_INCLUDE_DIRS)) \
  $(ALT_CPPFLAGS) \
  $(CPPFLAGS)

# Finish off assembler flags with any user-provided flags
BSP_ASFLAGS += $(ASFLAGS)

# Finish off C++ flags with any user-provided flags
BSP_CXXFLAGS += $(CXXFLAGS)

# And finally, the ordered list
C_SRCS += $(GENERATED_C_LIB_SRCS) \
          $(COMPONENT_C_LIB_SRCS)

CXX_SRCS += $(GENERATED_CPP_LIB_SRCS) \
          $(COMPONENT_CPP_LIB_SRCS)

ASM_SRCS += $(GENERATED_ASM_LIB_SRCS) \
            $(COMPONENT_ASM_LIB_SRCS)

#------------------------------------------------------------------------------
#                         LIST OF GENERATED FILES
#
# A Nios II BSP relies on the generation of several source files used
# by both the BSP and any applications referencing the BSP.
#------------------------------------------------------------------------------

GENERATED_H_FILES := $(ABS_BSP_ROOT)/system.h

GENERATED_LINKER_SCRIPT := $(ABS_BSP_ROOT)/linker.x

GENERATED_FILES += $(GENERATED_H_FILES) \
                   $(GENERATED_LINKER_SCRIPT)

#------------------------------------------------------------------------------
#                        SETUP TO BUILD OBJECTS
#
# List of object files which are to be built. This is constructed from the input
# list of C source files (C_SRCS), C++ source files (CXX_SRCS), and assembler
# source file (ASM_SRCS). The permitted file extensions are:
#
# .c .C                       - for C files
# .cxx .cc .cpp .CXX .CC .CPP - for C++ files
# .S .s                       - for assembly files
#
# Extended description: The list of objects is a sorted list (duplicates
# removed) of all possible objects, placed beneath the ./obj directory,
# including any path information stored in the "*_SRCS" variable. The
# "patsubst" commands are used to concatenate together multiple file suffix
# types for common files (i.e. c++ as .cxx, .cc, .cpp).
#
# File extensions are case-insensitive in build rules with the exception of
# assembly sources. Nios II assembly sources with the ".S" extension are first
# run through the C preprocessor. Sources with the ".s" extension are not.
#------------------------------------------------------------------------------
OBJS = $(sort $(addprefix $(OBJ_DIR)/,                                        \
               $(patsubst %.c, %.o,   $(patsubst %.C, %.o, $(C_SRCS)))        \
               $(patsubst %.cxx, %.o, $(patsubst %.CXX, %.o,                  \
               $(patsubst %.cc, %.o,  $(patsubst %.CC, %.o,                   \
               $(patsubst %.cpp, %.o, $(patsubst %.CPP, %.o,                  \
                 $(CXX_SRCS) ))))))                                           \
               $(patsubst %.S, %.o, $(patsubst %.s, %.o, $(ASM_SRCS))) ))

# List of dependancy files for each object file.
DEPS = $(OBJS:.o=.d)

# Rules to force your project to rebuild or relink
# .force_relink file will cause any application that depends on this project to relink
# .force_rebuild file will cause this project to rebuild object files
# .force_rebuild_all file will cause this project and any project that depends on this project to rebuild object files

FORCE_RELINK_DEP  := .force_relink
FORCE_REBUILD_DEP := .force_rebuild
FORCE_REBUILD_ALL_DEP := .force_rebuild_all
FORCE_REBUILD_DEP_LIST := $(FORCE_RELINK_DEP) $(FORCE_REBUILD_DEP) $(FORCE_REBUILD_ALL_DEP)

$(FORCE_REBUILD_DEP_LIST):

$(OBJS): $(wildcard $(FORCE_REBUILD_DEP)) $(wildcard $(FORCE_REBUILD_ALL_DEP))

#------------------------------------------------------------------------------
#                          BUILD RULES: ALL & CLEAN
#------------------------------------------------------------------------------
.DELETE_ON_ERROR:

.PHONY: all
all: build_pre_process
all: Makefile $(GENERATED_FILES) $(BSP_LIB) $(NEWLIB_DIR)
all: build_post_process

# clean: remove .o/.a/.d
.PHONY: clean
clean:
	@$(RM) -r $(BSP_LIB) $(OBJ_DIR) $(FORCE_REBUILD_DEP_LIST)
ifneq ($(wildcard $(NEWLIB_DIR)),)
	@$(RM) -r $(NEWLIB_DIR)
endif
	@$(ECHO) [BSP clean complete]

#------------------------------------------------------------------------------
#                           BUILD PRE/POST PROCESS
#------------------------------------------------------------------------------
build_pre_process :
	$(BUILD_PRE_PROCESS)

build_post_process :
	$(BUILD_POST_PROCESS)

.PHONY: build_pre_process build_post_process

#------------------------------------------------------------------------------
#                             MAKEFILE UP TO DATE?
#
# Is this very Makefile up to date? Someone may have changed the BSP settings
# file or the associated target hardware.
#------------------------------------------------------------------------------
# Skip this check when clean is the only target
ifneq ($(MAKECMDGOALS),clean)

ifneq ($(wildcard $(SETTINGS_FILE)),$(SETTINGS_FILE))
$(warning Warning: BSP Settings File $(SETTINGS_FILE) could not be found.)
endif

Makefile: $(wildcard $(SETTINGS_FILE))
	@$(ECHO) Makefile not up to date.
	@$(ECHO) $(SETTINGS_FILE) has been modified since the BSP Makefile was generated.
	@$(ECHO)
	@$(ECHO) Generate the BSP to update the Makefile, and then build again.
	@$(ECHO)
	@$(ECHO) To generate from Eclipse:
	@$(ECHO) " 1. Right-click the BSP project."
	@$(ECHO) " 2. In the Nios II Menu, click Generate BSP."
	@$(ECHO)
	@$(ECHO) To generate from the command line:
	@$(ECHO) " nios2-bsp-generate-files --settings=<settings file> --bsp-dir=<target bsp files directory>"
	@$(ECHO)
	@exit 1

ifneq ($(wildcard $(SOPC_FILE)),$(SOPC_FILE))
$(warning Warning: SOPC File $(SOPC_FILE) could not be found.)
endif

public.mk: $(wildcard $(SOPC_FILE))
	@$(ECHO) Makefile not up to date.
	@$(ECHO) $(SOPC_FILE) has been modified since the BSP was generated.
	@$(ECHO)
	@$(ECHO) Generate the BSP to update the Makefile, and then build again.
	@$(ECHO)
	@$(ECHO) To generate from Eclipse:
	@$(ECHO) " 1. Right-click the BSP project."
	@$(ECHO) " 2. In the Nios II Menu, click Generate BSP."
	@$(ECHO)
	@$(ECHO) To generate from the command line:
	@$(ECHO) " nios2-bsp-generate-files --settings=<settings file> --bsp-dir=<target bsp files directory>"
	@$(ECHO)
	@exit 1

endif # $(MAKECMDGOALS) != clean

#------------------------------------------------------------------------------
#                     PATTERN RULES TO BUILD OBJECTS
#------------------------------------------------------------------------------
$(OBJ_DIR)/%.o: %.c
	@$(ECHO) Compiling $(<F)...
	@$(MKDIR) $(@D)
	$(CC_PRE_PROCESS)
	$(CC) -MP -MMD -c $(BSP_CPPFLAGS) $(BSP_CFLAGS) -o $@ $<
	$(CC_POST_PROCESS)

$(OBJ_DIR)/%.o: %.C
	@$(ECHO) Compiling $(<F)...
	@$(MKDIR) $(@D)
	$(CC_PRE_PROCESS)
	$(CC) -MP -MMD -c $(BSP_CPPFLAGS) $(BSP_CFLAGS) -o $@ $<
	$(CC_POST_PROCESS)

$(OBJ_DIR)/%.o: %.cpp
	@$(ECHO) Compiling $(<F)...
	@$(MKDIR) $(@D)
	$(CXX_PRE_PROCESS)
	$(CXX) -MP -MMD -c $(BSP_CPPFLAGS) $(BSP_CXXFLAGS) $(BSP_CFLAGS) -o $@ $<
	$(CXX_POST_PROCESS)

$(OBJ_DIR)/%.o: %.CPP
	@$(ECHO) Compiling $(<F)...
	@$(MKDIR) $(@D)
	$(CXX_PRE_PROCESS)
	$(CXX) -MP -MMD -c $(BSP_CPPFLAGS) $(BSP_CXXFLAGS) $(BSP_CFLAGS) -o $@ $<
	$(CXX_POST_PROCESS)

$(OBJ_DIR)/%.o: %.cc
	@$(ECHO) Compiling $(<F)...
	@$(MKDIR) $(@D)
	$(CXX_PRE_PROCESS)
	$(CXX) -MP -MMD -c $(BSP_CPPFLAGS) $(BSP_CXXFLAGS) $(BSP_CFLAGS) -o $@ $<
	$(CXX_POST_PROCESS)

$(OBJ_DIR)/%.o: %.CC
	@$(ECHO) Compiling $(<F)...
	@$(MKDIR) $(@D)
	$(CXX_PRE_PROCESS)
	$(CXX) -MP -MMD -c $(BSP_CPPFLAGS) $(BSP_CXXFLAGS) $(BSP_CFLAGS) -o $@ $<
	$(CXX_POST_PROCESS)

$(OBJ_DIR)/%.o: %.cxx
	@$(ECHO) Compiling $(<F)...
	@$(MKDIR) $(@D)
	$(CXX_PRE_PROCESS)
	$(CXX) -MP -MMD -c $(BSP_CPPFLAGS) $(BSP_CXXFLAGS) $(BSP_CFLAGS) -o $@ $<
	$(CXX_POST_PROCESS)

$(OBJ_DIR)/%.o: %.CXX
	@$(ECHO) Compiling $(<F)...
	@$(MKDIR) $(@D)
	$(CXX_PRE_PROCESS)
	$(CXX) -MP -MMD -c $(BSP_CPPFLAGS) $(BSP_CXXFLAGS) $(BSP_CFLAGS) -o $@ $<
	$(CXX_POST_PROCESS)

$(OBJ_DIR)/%.o: %.S
	@$(ECHO) Compiling $(<F)...
	@$(MKDIR) $(@D)
	$(AS_PRE_PROCESS)
	$(AS) -MP -MMD -c $(BSP_CFLAGS) $(BSP_CPPFLAGS) $(BSP_ASFLAGS) -o $@ $<
	$(AS_POST_PROCESS)

$(OBJ_DIR)/%.o: %.s
	@$(ECHO) Compiling $(<F)...
	@$(MKDIR) $(@D)
	$(AS_PRE_PROCESS)
	$(AS) -MP -MMD -c $(BSP_ASFLAGS) $(BSP_CFLAGS) -o $@ $<
	$(AS_POST_PROCESS)

# Pattern rules for making useful intermediate files
$(OBJ_DIR)/%.s: %.c
	@$(ECHO) Compiling $(<F) to assembler...
	@$(MKDIR) $(@D)
	$(CC_PRE_PROCESS)
	$(CC) -MP -MMD -c $(BSP_CPPFLAGS) $(BSP_CFLAGS) -o $@ $<
	$(CC_POST_PROCESS)

$(OBJ_DIR)/%.s: %.cpp
	@$(ECHO) Compiling $(<F) to assembler...
	@$(MKDIR) $(@D)
	$(CXX_PRE_PROCESS)
	$(CXX) -MP -MMD -c $(BSP_CPPFLAGS) $(BSP_CXXFLAGS) $(BSP_CFLAGS) -o $@ $<
	$(CXX_PRE_PROCESS)

$(OBJ_DIR)/%.s: %.cc
	@$(ECHO) Compiling $(<F) to assembler...
	@$(MKDIR) $(@D)
	$(CXX_PRE_PROCESS)
	$(CXX) -MP -MMD -c $(BSP_CPPFLAGS) $(BSP_CXXFLAGS) $(BSP_CFLAGS) -o $@ $<
	$(CXX_PRE_PROCESS)

$(OBJ_DIR)/%.s: %.cxx
	@$(ECHO) Compiling $(<F) to assembler...
	@$(MKDIR) $(@D)
	$(CXX_PRE_PROCESS)
	$(CXX) -MP -MMD -c $(BSP_CPPFLAGS) $(BSP_CXXFLAGS) $(BSP_CFLAGS) -o $@ $<
	$(CXX_PRE_PROCESS)

$(OBJ_DIR)/%.i: %.c
	@$(ECHO) Compiling $(<F) to assembler...
	@$(MKDIR) $(@D)
	$(CC_PRE_PROCESS)
	$(CC) -E $(CPPFLAGS) $(ALT_CFLAGS) $(CFLAGS) -o $@ $<
	$(CC_PRE_PROCESS)

$(OBJ_DIR)/%.i: %.cpp
	@$(ECHO) Compiling $(<F) to assembler...
	@$(MKDIR) $(@D)
	$(CXX_PRE_PROCESS)
	$(CXX) -MP -MMD -c $(BSP_CPPFLAGS) $(BSP_CXXFLAGS) $(BSP_CFLAGS) -o $@ $<
	$(CXX_PRE_PROCESS)

$(OBJ_DIR)/%.i: %.cc
	@$(ECHO) Compiling $(<F) to assembler...
	@$(MKDIR) $(@D)
	$(CXX_PRE_PROCESS)
	$(CXX) -MP -MMD -c $(BSP_CPPFLAGS) $(BSP_CXXFLAGS) $(BSP_CFLAGS) -o $@ $<
	$(CXX_PRE_PROCESS)

$(OBJ_DIR)/%.i: %.cxx
	@$(ECHO) Compiling $(<F) to assembler...
	@$(MKDIR) $(@D)
	$(CXX_PRE_PROCESS)
	$(CXX) -MP -MMD -c $(BSP_CPPFLAGS) $(BSP_CXXFLAGS) $(BSP_CFLAGS) -o $@ $<
	$(CXX_PRE_PROCESS)

# Pattern rules for building other object files.
%.o: %.c
	@$(ECHO) Compiling $(<F)...
	@$(MKDIR) $(@D)
	$(CC_PRE_PROCESS)
	$(CC) -MP -MMD -c $(CPPFLAGS) $(ALT_CFLAGS) $(CFLAGS) -o $@ $<
	$(CC_POST_PROCESS)

%.o: %.cpp
	@$(ECHO) Compiling $(<F)...
	@$(MKDIR) $(@D)
	$(CXX_POST_PROCESS)
	$(CXX) -MP -MMD -c $(BSP_CPPFLAGS) $(BSP_CXXFLAGS) $(BSP_CFLAGS) -o $@ $<
	$(CXX_POST_PROCESS)

%.o: %.cc
	@$(ECHO) Compiling $(<F)...
	@$(MKDIR) $(@D)
	$(CXX_POST_PROCESS)
	$(CXX) -MP -MMD -c $(BSP_CPPFLAGS) $(BSP_CXXFLAGS) $(BSP_CFLAGS) -o $@ $<
	$(CXX_POST_PROCESS)

%.o: %.cxx
	@$(ECHO) Compiling $(<F)...
	@$(MKDIR) $(@D)
	$(CXX_PRE_PROCESS)
	$(CXX) -MP -MMD -c $(BSP_CPPFLAGS) $(BSP_CXXFLAGS) $(BSP_CFLAGS) -o $@ $<
	$(CXX_POST_PROCESS)

%.o: %.S
	@$(ECHO) Compiling $(<F)...
	@$(MKDIR) $(@D)
	$(AS_PRE_PROCESS)
	$(AS) -MP -MMD -c $(BSP_CFLAGS) $(BSP_CPPFLAGS) $(BSP_ASFLAGS) -o $@ $<
	$(AS_POST_PROCESS)

%.o: %.s
	@$(ECHO) Compiling $(<F)...
	@$(MKDIR) $(@D)
	$(AS_PRE_PROCESS)
	$(AS) -MP -MMD -c $(BSP_ASFLAGS) $(BSP_CFLAGS) -o $@ $<
	$(AS_POST_PROCESS)

#------------------------------------------------------------------------------
#                               NEWLIB RULES
#------------------------------------------------------------------------------

ifneq ($(COMPILE_NEWLIB),)
NEWLIB_FLAGS += $(BSP_CFLAGS)
endif

ifneq ($(NEWLIB_DIR),)
$(NEWLIB_DIR):
	@$(ECHO) Creating $(NEWLIB_DIR)...
	nios2-newlib-gen --no-multilib $(NEWLIB_DIR)-build-tmp $(NEWLIB_DIR) --custom "$(NEWLIB_FLAGS)"
	@$(ECHO) Removing $(NEWLIB_DIR)-build-tmp...
	@$(RM) -rf $(NEWLIB_DIR)-build-tmp
endif

#------------------------------------------------------------------------------
#                               LIBRARY RULES
#------------------------------------------------------------------------------
$(BSP_LIB): $(OBJS)
	@$(ECHO) Creating $@...
	$(AR_PRE_PROCESS)
	$(RM) -f $@
	$(AR) $(BSP_ARFLAGS) $@ $^
	$(AR_POST_PROCESS)

#------------------------------------------------------------------------------
#                                DEPENDENCY FILES
#------------------------------------------------------------------------------
ifneq ($(findstring clean, $(MAKECMDGOALS)),clean)
-include $(DEPS)
endif

# End of Makefile


text:
classdef SupportExtensionHorizontalTypeII < matlab.System  %#codegen
    %SUPPORTEXTENSIONHORIZONTALTYPEII Type-II horizontal support extension
    %
    % SVN identifier:
    % $Id: SupportExtensionHorizontalTypeII.m 683 2015-05-29 08:22:13Z sho $
    %
    % Requirements: MATLAB R2015b
    %
    % Copyright (c) 2014-2015, Shogo MURAMATSU
    %
    % All rights reserved.
    %
    % Contact address: Shogo MURAMATSU,
    %                Faculty of Engineering, Niigata University,
    %                8050 2-no-cho Ikarashi, Nishi-ku,
    %                Niigata, 950-2181, JAPAN
    %
    % http://msiplab.eng.niigata-u.ac.jp/
    %

    properties (Access=protected,Nontunable)
        hLen
    end

    methods
        function obj = SupportExtensionHorizontalTypeII(varargin)
            setProperties(obj,nargin,varargin{:});
        end
    end

    methods ( Access = protected )

        function validateInputsImpl(~,~,~,~,paramMtx1,paramMtx2,~)
            if all(size(paramMtx1) == size(paramMtx2))
                error('ps and pa must be differnt from each other.')
            end
        end

         function setupImpl(obj,~,~,~,paramMtx1,paramMtx2,~)
             obj.hLen = [ size(paramMtx1,1) size(paramMtx2,1) ];
         end

        function arrayCoefs = stepImpl(obj,arrayCoefs,nRows,nCols,paramMtx1,paramMtx2,isPeriodicExt)
            %obj.hLen = [ size(paramMtx1,1) size(paramMtx2,1) ];
            % Phase 1 for horizontal symtif.Direction
            Ux = paramMtx2;
            I = eye(size(Ux));
            arrayCoefs = blockButterfly_(obj,arrayCoefs);
            arrayCoefs = rightShiftLowerCoefs_(obj,arrayCoefs,nRows,nCols);
            arrayCoefs = blockButterfly_(obj,arrayCoefs);
            arrayCoefs = arrayCoefs/2.0;
            for iRow = 1:nRows
                for iCol = 1:nCols
                    if iCol == 1 && ~isPeriodicExt
                        U = -I;
                    else
                        U = Ux;
                    end
                    arrayCoefs = lowerBlockRot_(obj,arrayCoefs,nRows,iRow,iCol,U);
                end
            end

            % Phase 2 for horizontal symtif.Direction
            Wx = paramMtx1;
            arrayCoefs = blockButterfly_(obj,arrayCoefs);
            arrayCoefs = leftShiftUpperCoefs_(obj,arrayCoefs,nRows,nCols);
            arrayCoefs = blockButterfly_(obj,arrayCoefs);
            arrayCoefs = arrayCoefs/2.0;
            for iRow = 1:nRows
                for iCol = 1:nCols
                    arrayCoefs = upperBlockRot_(obj,arrayCoefs,nRows,iRow,iCol,Wx);
                end
            end
        end

        function numIn = getNumInputsImpl(~)
            numIn = 6;
        end

        function numOut = getNumOutputsImpl(~)
            numOut = 1;
        end

    end

    methods ( Access = private )

        function arrayCoefs = rightShiftLowerCoefs_(obj,arrayCoefs,nRows,nCols)
            for iRow = 1:nRows
                indexCol1 = iRow;
                colData0 = arrayCoefs(:,indexCol1);
                lowerCoefsPre = colData0(obj.hLen(1)+1:end);
                for iCol = 2:nCols
                    indexCol = (iCol-1)*nRows+iRow;
                    colData = arrayCoefs(:,indexCol);
                    lowerCoefsCur = colData(obj.hLen(1)+1:end);
                    colData(obj.hLen(1)+1:end) = lowerCoefsPre;
                    arrayCoefs(:,indexCol) = colData;
                    lowerCoefsPre = lowerCoefsCur;
                end
                colData0(obj.hLen(1)+1:end) = lowerCoefsPre;
                arrayCoefs(:,indexCol1) = colData0;
            end
        end

        function arrayCoefs = leftShiftUpperCoefs_(obj,arrayCoefs,nRows,nCols)
            for iRow = 1:nRows
                indexCol1 = iRow;
                colData0 = arrayCoefs(:,indexCol1);
                upperCoefsPost = colData0(1:obj.hLen(2));
                for iCol = nCols:-1:2
                    indexCol = (iCol-1)*nRows+iRow;
                    colData = arrayCoefs(:,indexCol);
                    upperCoefsCur = colData(1:obj.hLen(2));
                    colData(1:obj.hLen(2)) = upperCoefsPost;
                    arrayCoefs(:,indexCol) = colData;
                    upperCoefsPost = upperCoefsCur;
                end
                colData0(1:obj.hLen(2)) = upperCoefsPost;
                arrayCoefs(:,indexCol1) = colData0;
            end
        end

        function arrayCoefs = blockButterfly_(obj,arrayCoefs)
            nChMx = max(obj.hLen);
            nChMn = min(obj.hLen);
            upper = arrayCoefs(1:nChMn,:);
            middle = arrayCoefs(nChMn+1:nChMx,:);
            lower = arrayCoefs(nChMx+1:end,:);
            arrayCoefs = [
                upper + lower;
                1.414213562373095*middle;
                upper - lower ];
        end

        function arrayCoefs = lowerBlockRot_(obj,arrayCoefs,nRows,iRow,iCol,U)
            indexCol = (iCol-1)*nRows+iRow;
            colData = arrayCoefs(:,indexCol);
            colData(obj.hLen(1)+1:end) = U*colData(obj.hLen(1)+1:end);
            arrayCoefs(:,indexCol) = colData;
        end

        function arrayCoefs = upperBlockRot_(obj,arrayCoefs,nRows,iRow,iCol,W)
            indexCol = (iCol-1)*nRows+iRow;
            colData = arrayCoefs(:,indexCol);
            colData(1:obj.hLen(1)) = W*colData(1:obj.hLen(1));
            arrayCoefs(:,indexCol) = colData;
        end

    end

end

redpajama_set_name: RedPajamaGithub


text:
"""Setup module for the GRPC Python package's optional reflection."""

import os
import sys

import setuptools

# Ensure we're in the proper directory whether or not we're being used by pip.
os.chdir(os.path.dirname(os.path.abspath(__file__)))

# Break import-style to ensure we can actually find our commands module.
import reflection_commands
import grpc_version

PACKAGE_DIRECTORIES = {
    '': '.',
}

SETUP_REQUIRES = (
    'grpcio-tools>={version}'.format(version=grpc_version.VERSION),)

INSTALL_REQUIRES = ('protobuf>=3.3.0',
                    'grpcio>={version}'.format(version=grpc_version.VERSION),)

COMMAND_CLASS = {
    # Run preprocess from the repository *before* doing any packaging!
    'preprocess': reflection_commands.CopyProtoModules,
    'build_package_protos': reflection_commands.BuildPackageProtos,
}

setuptools.setup(
    name='grpcio-reflection',
    version=grpc_version.VERSION,
    license='Apache License 2.0',
    description='Standard Protobuf Reflection Service for gRPC',
    author='The gRPC Authors',
    author_email='grpc-io@googlegroups.com',
    url='https://grpc.io',
    package_dir=PACKAGE_DIRECTORIES,
    packages=setuptools.find_packages('.'),
    install_requires=INSTALL_REQUIRES,
    setup_requires=SETUP_REQUIRES,
    cmdclass=COMMAND_CLASS)


text:
@interface XHGradientView : UIView

@end

@implementation XHGradientView

+ (Class)layerClass {
    return [CAGradientLayer class];
}

- (instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        self.backgroundColor = [UIColor clearColor];
        CAGradientLayer *gradientLayer = (CAGradientLayer *)self.layer;
        gradientLayer.colors = @[
                                 (id)[[UIColor colorWithWhite:0 alpha:1] CGColor],
                                 (id)[[UIColor colorWithWhite:0 alpha:0.5] CGColor],
                                 ];
    }
    return self;
}

@end

@interface XHRealTimeBlur ()

@property (nonatomic, strong) XHGradientView *gradientBackgroundView;
@property (nonatomic, strong) UIToolbar *blurBackgroundView;
@property (nonatomic, strong) UIView *blackTranslucentBackgroundView;
@property (nonatomic, strong) UIView *whiteBackgroundView;

@end

@implementation XHRealTimeBlur

- (void)showBlurViewAtView:(UIView *)currentView {
    [self showAnimationAtContainerView:currentView];
}

- (void)showBlurViewAtViewController:(UIViewController *)currentViewContrller {
    [self showAnimationAtContainerView:currentViewContrller.view];
}

- (void)disMiss {
    [self hiddenAnimation];
}

#pragma mark - Private

- (void)showAnimationAtContainerView:(UIView *)containerView {
    if (self.showed) {
        [self disMiss];
        return;
    } else {
        if (self.willShowBlurViewcomplted) {
            self.willShowBlurViewcomplted();
        }
    }
    self.alpha = 0.0;
    [containerView insertSubview:self atIndex:0];
    [UIView animateWithDuration:self.showDuration delay:0 options:UIViewAnimationOptionCurveEaseInOut animations:^{
        self.alpha = 1.0;
    } completion:^(BOOL finished) {
        self.showed = YES;
        if (self.didShowBlurViewcompleted) {
            self.didShowBlurViewcompleted(finished);
        }
    }];
}

- (void)hiddenAnimation {
    [self hiddenAnimationCompletion:^(BOOL finished) {

    }];
}

- (void)hiddenAnimationCompletion:(void (^)(BOOL finished))completion {
    if (self.willDismissBlurViewCompleted) {
        self.willDismissBlurViewCompleted();
    }

    [UIView animateWithDuration:self.disMissDuration delay:0 options:UIViewAnimationOptionCurveEaseInOut animations:^{
        self.alpha = 0.0;
    } completion:^(BOOL finished) {
        if (completion) {
            completion(finished);
        }
        if (self.didDismissBlurViewCompleted) {
            self.didDismissBlurViewCompleted(finished);
        }
        self.showed = NO;
        [self removeFromSuperview];
    }];
}

- (void)handleTapGestureRecognizer:(UITapGestureRecognizer *)tapGestureRecognizer {
    [self hiddenAnimationCompletion:^(BOOL finished) {

    }];
}

#pragma mark - Propertys

- (void)setHasTapGestureEnable:(BOOL)hasTapGestureEnable {
    _hasTapGestureEnable = hasTapGestureEnable;
    [self setupTapGesture];
}

- (XHGradientView *)gradientBackgroundView {
    if (!_gradientBackgroundView) {
        _gradientBackgroundView = [[XHGradientView alloc] initWithFrame:self.bounds];
    }
    return _gradientBackgroundView;
}

- (UIToolbar *)blurBackgroundView {
    if (!_blurBackgroundView) {
        _blurBackgroundView = [[UIToolbar alloc] initWithFrame:self.bounds];
        [_blurBackgroundView setBarStyle:UIBarStyleBlackTranslucent];
    }
    return _blurBackgroundView;
}

- (UIView *)blackTranslucentBackgroundView {
    if (!_blackTranslucentBackgroundView) {
        _blackTranslucentBackgroundView = [[UIView alloc] initWithFrame:self.bounds];
        _blackTranslucentBackgroundView.backgroundColor = [UIColor colorWithWhite:0.000 alpha:0.500];
    }
    return _blackTranslucentBackgroundView;
}

- (UIView *)whiteBackgroundView {
    if (!_whiteBackgroundView) {
        _whiteBackgroundView = [[UIView alloc] initWithFrame:self.bounds];
        _whiteBackgroundView.backgroundColor = [UIColor clearColor];
        _whiteBackgroundView.tintColor = [UIColor colorWithWhite:0.2 alpha:1.0];
    }
    return _whiteBackgroundView;
}

- (UIView *)backgroundView {
    switch (self.blurStyle) {
        case XHBlurStyleBlackGradient:
            return self.gradientBackgroundView;
            break;
        case XHBlurStyleTranslucent:
            return self.blurBackgroundView;
        case XHBlurStyleBlackTranslucent:
            return self.blackTranslucentBackgroundView;
            break;
        case XHBlurStyleWhite:
            return self.whiteBackgroundView;
            break;
        default:
            break;
    }
}

#pragma mark - Life Cycle

- (void)setup {
    self.showDuration = self.disMissDuration = 0.3;
    self.blurStyle = XHBlurStyleWhite;
    self.backgroundColor = [UIColor clearColor];

    _hasTapGestureEnable = NO;
}

- (void)setupTapGesture {
    if (self.hasTapGestureEnable) {
        UITapGestureRecognizer *tapGestureRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleTapGestureRecognizer:)];
        [self addGestureRecognizer:tapGestureRecognizer];
    }
}

- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        // Initialization code
        [self setup];
    }
    return self;
}

- (id)initWithCoder:(NSCoder *)aDecoder {
    self = [super initWithCoder:aDecoder];
    if (self) {
        [self setup];
    }
    return self;
}

- (void)willMoveToSuperview:(UIView *)newSuperview {
    if (newSuperview) {
        UIView *backgroundView = [self backgroundView];
        backgroundView.userInteractionEnabled = NO;
        [self addSubview:backgroundView];
    }
}

@end

#pragma mark - UIView XHRealTimeBlur分类的实现

@implementation UIView (XHRealTimeBlur)

#pragma mark - Show Block

- (WillShowBlurViewBlcok)willShowBlurViewcomplted {
    return objc_getAssociatedObject(self, &XHRealTimeWillShowBlurViewBlcokBlcokKey);
}

- (void)setWillShowBlurViewcomplted:(WillShowBlurViewBlcok)willShowBlurViewcomplted {
    objc_setAssociatedObject(self, &XHRealTimeWillShowBlurViewBlcokBlcokKey, willShowBlurViewcomplted, OBJC_ASSOCIATION_COPY_NONATOMIC);
}

- (DidShowBlurViewBlcok)didShowBlurViewcompleted {
    return objc_getAssociatedObject(self, &XHRealTimeDidShowBlurViewBlcokBlcokKey);
}

- (void)setDidShowBlurViewcompleted:(DidShowBlurViewBlcok)didShowBlurViewcompleted {
    objc_setAssociatedObject(self, &XHRealTimeDidShowBlurViewBlcokBlcokKey, didShowBlurViewcompleted, OBJC_ASSOCIATION_COPY_NONATOMIC);
}

#pragma mark - dismiss block

- (WillDismissBlurViewBlcok)willDismissBlurViewCompleted {
    return objc_getAssociatedObject(self, &XHRealTimeWillDismissBlurViewBlcokKey);
}

- (void)setWillDismissBlurViewCompleted:(WillDismissBlurViewBlcok)willDismissBlurViewCompleted {
    objc_setAssociatedObject(self, &XHRealTimeWillDismissBlurViewBlcokKey, willDismissBlurViewCompleted, OBJC_ASSOCIATION_COPY_NONATOMIC);
}

- (DidDismissBlurViewBlcok)didDismissBlurViewCompleted {
    return objc_getAssociatedObject(self, &XHRealTimeDidDismissBlurViewBlcokKey);
}

- (void)setDidDismissBlurViewCompleted:(DidDismissBlurViewBlcok)didDismissBlurViewCompleted {
    objc_setAssociatedObject(self, &XHRealTimeDidDismissBlurViewBlcokKey, didDismissBlurViewCompleted, OBJC_ASSOCIATION_COPY_NONATOMIC);
}

#pragma mark - RealTimeBlur HUD

- (XHRealTimeBlur *)realTimeBlur {
    return objc_getAssociatedObject(self, &XHRealTimeBlurKey);
}

- (void)setRealTimeBlur:(XHRealTimeBlur *)realTimeBlur {
    objc_setAssociatedObject(self, &XHRealTimeBlurKey, realTimeBlur, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
}

#pragma mark - 分类 公开方法

- (void)showRealTimeBlurWithBlurStyle:(XHBlurStyle)blurStyle {
    [self showRealTimeBlurWithBlurStyle:blurStyle hasTapGestureEnable:NO];
}

- (void)showRealTimeBlurWithBlurStyle:(XHBlurStyle)blurStyle hasTapGestureEnable:(BOOL)hasTapGestureEnable {
    XHRealTimeBlur *realTimeBlur = [self realTimeBlur];
    if (!realTimeBlur) {
        realTimeBlur = [[XHRealTimeBlur alloc] initWithFrame:self.bounds];
        realTimeBlur.blurStyle = blurStyle;
        [self setRealTimeBlur:realTimeBlur];
    }
    realTimeBlur.hasTapGestureEnable = hasTapGestureEnable;

    realTimeBlur.willShowBlurViewcomplted = self.willShowBlurViewcomplted;
    realTimeBlur.didShowBlurViewcompleted = self.didShowBlurViewcompleted;

    realTimeBlur.willDismissBlurViewCompleted = self.willDismissBlurViewCompleted;
    realTimeBlur.didDismissBlurViewCompleted = self.didDismissBlurViewCompleted;

    [realTimeBlur showBlurViewAtView:self];
}

- (void)disMissRealTimeBlur {
    [[self realTimeBlur] disMiss];
}

@end


text:
+++
Title = "judy johnson"
Twitter = "miz_j"
image = "judy-johnson.png"
type = "speaker"
linktitle = "judy-johnson"

+++

Judy has been a software engineer for [many] years, and has been at Onyx Point since 2015. She has also functioned as a System Engineer, Project Manager, ScrumMaster, and a record store clerk. She was lucky enough to have started programming in the 19XXes when her Dad brought home a PDP-8. When not at work, Judy can be found baking treats, attending hockey games and rock concerts, or trying to finish a good book. Judy also loves to volunteer, especially in events that promote diversity in tech. Proof of her dedication to this cause is the fact that both of her awesome daughters are engineers.


text:
package fr.ydelouis.selfoss.config.ui;

import android.annotation.TargetApi;
import android.content.Context;
import android.os.Build;
import android.util.AttributeSet;
import android.widget.EditText;
import android.widget.LinearLayout;

import org.androidannotations.annotations.EViewGroup;
import org.androidannotations.annotations.TextChange;
import org.androidannotations.annotations.ViewById;
import org.springframework.http.HttpStatus;
import org.springframework.web.client.HttpClientErrorException;

import fr.ydelouis.selfoss.R;

@EViewGroup(R.layout.view_config_url)
public class ConfigUrlView extends LinearLayout {

	@ViewById(R.id.url) protected EditText urlEditText;

	public ConfigUrlView(Context context) {
		super(context);
	}

	public ConfigUrlView(Context context, AttributeSet attrs) {
		super(context, attrs);
	}

	public ConfigUrlView(Context context, AttributeSet attrs, int defStyleAttr) {
		super(context, attrs, defStyleAttr);
	}

	@TargetApi(Build.VERSION_CODES.LOLLIPOP)
	public ConfigUrlView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
		super(context, attrs, defStyleAttr, defStyleRes);
	}

	public void setUrl(String url) {
		urlEditText.setText(url);
	}

	public String getUrl() {
		return urlEditText.getText().toString();
	}

	public void showError(Exception exception) {
		String error = exception.getLocalizedMessage();
		if (exception instanceof HttpClientErrorException) {
			HttpStatus status = ((HttpClientErrorException) exception).getStatusCode();
			error = String.format("(%d) %s", status.value(), status.getReasonPhrase());
		}
		urlEditText.setError(error);
	}

	@TextChange(R.id.url)
	protected void onUrlChanged() {
		urlEditText.setError(null);
	}
}


text:
var express = require("express");
var runtime;
var settings;
var needsPermission = require("../../auth").needsPermission;

module.exports = {
    init: function(_runtime) {
        runtime = _runtime;
        settings = runtime.settings;
    },
    app: function() {
        var app = express();

        app.use(function(req,res,next) {
            if (!runtime.storage.projects) {
                res.status(404).end();
            } else {
                next();
            }
        });

        // Projects

        // List all projects
        app.get("/", needsPermission("projects.read"), function(req,res) {
            runtime.storage.projects.listProjects(req.user, req.user).then(function(list) {
                var active = runtime.storage.projects.getActiveProject(req.user);
                var response = {
                    projects: list
                };
                if (active) {
                    response.active = active.name;
                }
                res.json(response);
            }).catch(function(err) {
                console.log(err.stack);
                if (err.code) {
                    res.status(400).json({error:err.code, message: err.message});
                } else {
                    res.status(400).json({error:"unexpected_error", message:err.toString()});
                }
            })
        });

        // Create project
        app.post("/", needsPermission("projects.write"), function(req,res) {
            runtime.storage.projects.createProject(req.user, req.body).then(function(data) {
                res.json(data);
            }).catch(function(err) {
                console.log(err.stack);
                if (err.code) {
                    res.status(400).json({error:err.code, message: err.message});
                } else {
                    res.status(400).json({error:"unexpected_error", message:err.toString()});
                }
            })
        });

        // Update a project
        app.put("/:id", needsPermission("projects.write"), function(req,res) {
            //TODO: validate the payload properly
            if (req.body.active) {
                var currentProject = runtime.storage.projects.getActiveProject(req.user);
                if (!currentProject || req.params.id !== currentProject.name) {
                    runtime.storage.projects.setActiveProject(req.user, req.params.id).then(function() {
                        res.redirect(303,req.baseUrl + '/');
                    }).catch(function(err) {
                        if (err.code) {
                            res.status(400).json({error:err.code, message: err.message});
                        } else {
                            res.status(400).json({error:"unexpected_error", message:err.toString()});
                        }
                    })
                } else {
                    res.redirect(303,req.baseUrl + '/'+ req.params.id);
                }
            } else if (req.body.initialise) {
                // Initialised set when creating default files for an empty repo
                runtime.storage.projects.initialiseProject(req.user, req.params.id, req.body).then(function() {
                    res.redirect(303,req.baseUrl + '/'+ req.params.id);
                }).catch(function(err) {
                    if (err.code) {
                        res.status(400).json({error:err.code, message: err.message});
                    } else {
                        res.status(400).json({error:"unexpected_error", message:err.toString()});
                    }
                })
            } else if (req.body.hasOwnProperty('credentialSecret') ||
                       req.body.hasOwnProperty('description') ||
                       req.body.hasOwnProperty('dependencies')||
                       req.body.hasOwnProperty('summary') ||
                       req.body.hasOwnProperty('files') ||
                        req.body.hasOwnProperty('git')) {
                runtime.storage.projects.updateProject(req.user, req.params.id, req.body).then(function() {
                    res.redirect(303,req.baseUrl + '/'+ req.params.id);
                }).catch(function(err) {
                    if (err.code) {
                        res.status(400).json({error:err.code, message: err.message});
                    } else {
                        res.status(400).json({error:"unexpected_error", message:err.toString()});
                    }
                })
            } else {
                res.status(400).json({error:"unexpected_error", message:"invalid_request"});
            }
        });

        // Get project metadata
        app.get("/:id", needsPermission("projects.read"), function(req,res) {
            runtime.storage.projects.getProject(req.user, req.params.id).then(function(data) {
                if (data) {
                    res.json(data);
                } else {
                    res.status(404).end();
                }
            }).catch(function(err) {
                console.log(err.stack);
                res.status(400).json({error:"unexpected_error", message:err.toString()});
            })
        });

        // Delete project
        app.delete("/:id", needsPermission("projects.write"), function(req,res) {
            runtime.storage.projects.deleteProject(req.user, req.params.id).then(function() {
                res.status(204).end();
            })
            .catch(function(err) {
                console.log(err.stack);
                res.status(400).json({error:"unexpected_error", message:err.toString()})
            });
        });

        // Get project status - files, commit counts, branch info
        app.get("/:id/status", needsPermission("projects.read"), function(req,res) {
            var includeRemote = req.query.remote;

            runtime.storage.projects.getStatus(req.user, req.params.id, includeRemote).then(function(data) {
                if (data) {
                    res.json(data);
                } else {
                    res.status(404).end();
                }
            }).catch(function(err) {
                if (err.code) {
                    res.status(400).json({error:err.code, message: err.message});
                } else {
                    res.status(400).json({error:"unexpected_error", message:err.toString()});
                }
            })
        });

        // Project file listing
        app.get("/:id/files", needsPermission("projects.read"), function(req,res) {
            runtime.storage.projects.getFiles(req.user, req.params.id).then(function(data) {
                // console.log("TODO: REMOVE /:id/files as /:id/status is better!")
                res.json(data);
            })
            .catch(function(err) {
                if (err.code) {
                    res.status(400).json({error:err.code, message: err.message});
                } else {
                    res.status(400).json({error:"unexpected_error", message:err.toString()});
                }
            })
        });

        // Get file content in a given tree (index/stage)
        app.get("/:id/files/:treeish/*", needsPermission("projects.read"), function(req,res) {
            var projectId = req.params.id;
            var treeish = req.params.treeish;
            var filePath = req.params[0];

            runtime.storage.projects.getFile(req.user, projectId,filePath,treeish).then(function(data) {
                res.json({content:data});
            })
            .catch(function(err) {
                console.log(err.stack);
                res.status(400).json({error:"unexpected_error", message:err.toString()});
            })
        });

        // Revert a file
        app.delete("/:id/files/_/*", needsPermission("projects.write"), function(req,res) {
            var projectId = req.params.id;
            var filePath = req.params[0];

            runtime.storage.projects.revertFile(req.user, projectId,filePath).then(function() {
                res.status(204).end();
            })
            .catch(function(err) {
                console.log(err.stack);
                res.status(400).json({error:"unexpected_error", message:err.toString()});
            })
        });

        // Stage a file
        app.post("/:id/stage/*", needsPermission("projects.write"), function(req,res) {
            var projectName = req.params.id;
            var file = req.params[0];

            runtime.storage.projects.stageFile(req.user, projectName,file).then(function(data) {
                res.redirect(303,req.baseUrl+"/"+projectName+"/status");
            })
            .catch(function(err) {
                console.log(err.stack);
                res.status(400).json({error:"unexpected_error", message:err.toString()});
            })
        });

        // Stage multiple files
        app.post("/:id/stage", needsPermission("projects.write"), function(req,res) {
            var projectName = req.params.id;
            var files = req.body.files;

            runtime.storage.projects.stageFile(req.user, projectName,files).then(function(data) {
                res.redirect(303,req.baseUrl+"/"+projectName+"/status");
            })
            .catch(function(err) {
                console.log(err.stack);
                res.status(400).json({error:"unexpected_error", message:err.toString()});
            })
        });

        // Commit changes
        app.post("/:id/commit", needsPermission("projects.write"), function(req,res) {
            var projectName = req.params.id;

            runtime.storage.projects.commit(req.user, projectName,req.body).then(function(data) {
                res.redirect(303,req.baseUrl+"/"+projectName+"/status");
            })
            .catch(function(err) {
                if (err.code) {
                    res.status(400).json({error:err.code, message: err.message});
                } else {
                    res.status(400).json({error:"unexpected_error", message:err.toString()});
                }
            })
        });

        // Unstage a file
        app.delete("/:id/stage/*", needsPermission("projects.write"), function(req,res) {
            var projectName = req.params.id;
            var file = req.params[0];

            runtime.storage.projects.unstageFile(req.user, projectName,file).then(function(data) {
                res.redirect(303,req.baseUrl+"/"+projectName+"/status");
            })
            .catch(function(err) {
                console.log(err.stack);
                res.status(400).json({error:"unexpected_error", message:err.toString()});
            })
        });

        // Unstage multiple files
        app.delete("/:id/stage", needsPermission("projects.write"), function(req, res) {
            var projectName = req.params.id;
            runtime.storage.projects.unstageFile(req.user, projectName).then(function(data) {
                res.redirect(303,req.baseUrl+"/"+projectName+"/status");
            })
            .catch(function(err) {
                console.log(err.stack);
                res.status(400).json({error:"unexpected_error", message:err.toString()});
            })
        });

        // Get a file diff
        app.get("/:id/diff/:type/*", needsPermission("projects.read"), function(req,res) {
            var projectName = req.params.id;
            var type = req.params.type;
            var file = req.params[0];
            runtime.storage.projects.getFileDiff(req.user, projectName,file,type).then(function(data) {
                res.json({
                    diff: data
                })
            })
            .catch(function(err) {
                console.log(err.stack);
                res.status(400).json({error:"unexpected_error", message:err.toString()});
            })
        });

        // Get a list of commits
        app.get("/:id/commits", needsPermission("projects.read"), function(req, res) {
            var projectName = req.params.id;
            var options = {
                limit: req.query.limit||20,
                before: req.query.before
            };
            runtime.storage.projects.getCommits(req.user, projectName,options).then(function(data) {
                res.json(data);
            })
            .catch(function(err) {
                console.log(err.stack);
                if (err.code) {
                    res.status(400).json({error:err.code, message: err.message});
                } else {
                    res.status(400).json({error:"unexpected_error", message:err.toString()});
                }
            })
        });

        // Get an individual commit details
        app.get("/:id/commits/:sha", needsPermission("projects.read"), function(req, res) {
            var projectName = req.params.id;
            var sha = req.params.sha;

            runtime.storage.projects.getCommit(req.user, projectName,sha).then(function(data) {
                res.json({commit:data});
            })
            .catch(function(err) {
                console.log(err.stack);
                res.status(400).json({error:"unexpected_error", message:err.toString()});
            })
        });

        // Push local commits to remote
        app.post("/:id/push/?*", needsPermission("projects.write"), function(req,res) {
            var projectName = req.params.id;
            var remoteBranchName = req.params[0]
            var setRemote = req.query.u;
            runtime.storage.projects.push(req.user, projectName,remoteBranchName,setRemote).then(function(data) {
                res.status(204).end();
            })
            .catch(function(err) {
                if (err.code) {
                    res.status(400).json({error:err.code, message: err.message});
                } else {
                    res.status(400).json({error:"unexpected_error", message:err.toString()});
                }
            })
        });

        // Pull remote commits
        app.post("/:id/pull/?*", needsPermission("projects.write"), function(req,res) {
            var projectName = req.params.id;
            var remoteBranchName = req.params[0];
            var setUpstream = req.query.setUpstream;
            var allowUnrelatedHistories = req.query.allowUnrelatedHistories;
            runtime.storage.projects.pull(req.user, projectName,remoteBranchName,setUpstream,allowUnrelatedHistories).then(function(data) {
                res.status(204).end();
            })
            .catch(function(err) {
                console.log(err.stack);
                if (err.code) {
                    res.status(400).json({error:err.code, message: err.message});
                } else {
                    res.status(400).json({error:"unexpected_error", message:err.toString()});
                }
            })
        });

        // Abort an ongoing merge
        app.delete("/:id/merge", needsPermission("projects.write"), function(req, res) {
            var projectName = req.params.id;
            runtime.storage.projects.abortMerge(req.user, projectName).then(function(data) {
                res.status(204).end();
            })
            .catch(function(err) {
                console.log(err.stack);
                if (err.code) {
                    res.status(400).json({error:err.code, message: err.message});
                } else {
                    res.status(400).json({error:"unexpected_error", message:err.toString()});
                }
            })
        });

        // Resolve a merge
        app.post("/:id/resolve/*", needsPermission("projects.write"), function(req, res) {
            var projectName = req.params.id;
            var file = req.params[0];
            var resolution = req.body.resolutions;
            runtime.storage.projects.resolveMerge(req.user, projectName,file,resolution).then(function(data) {
                res.status(204).end();
            })
            .catch(function(err) {
                console.log(err.stack);
                if (err.code) {
                    res.status(400).json({error:err.code, message: err.message});
                } else {
                    res.status(400).json({error:"unexpected_error", message:err.toString()});
                }
            })
        });

        // Get a list of local branches
        app.get("/:id/branches", needsPermission("projects.read"), function(req, res) {
            var projectName = req.params.id;
            runtime.storage.projects.getBranches(req.user, projectName,false).then(function(data) {
                res.json(data);
            })
            .catch(function(err) {
                console.log(err.stack);
                if (err.code) {
                    res.status(400).json({error:err.code, message: err.message});
                } else {
                    res.status(400).json({error:"unexpected_error", message:err.toString()});
                }
            })
        });

        // Delete a local branch - ?force=true
        app.delete("/:id/branches/:branchName", needsPermission("projects.write"), function(req, res) {
            var projectName = req.params.id;
            var branchName = req.params.branchName;
            var force = !!req.query.force;
            runtime.storage.projects.deleteBranch(req.user, projectName, branchName, false, force).then(function(data) {
                res.status(204).end();
            })
            .catch(function(err) {
                if (err.code) {
                    res.status(400).json({error:err.code, message: err.message});
                } else {
                    res.status(400).json({error:"unexpected_error", message:err.toString()});
                }
            });
        });

        // Get a list of remote branches
        app.get("/:id/branches/remote", needsPermission("projects.read"), function(req, res) {
            var projectName = req.params.id;
            runtime.storage.projects.getBranches(req.user, projectName,true).then(function(data) {
                res.json(data);
            })
            .catch(function(err) {
                console.log(err);
                if (err.code) {
                    res.status(400).json({error:err.code, message: err.message, remote: err.remote});
                } else {
                    res.status(400).json({error:"unexpected_error", message:err.toString()});
                }
            })
        });

        // Get branch status - commit counts/ahead/behind
        app.get("/:id/branches/remote/*/status", needsPermission("projects.read"), function(req, res) {
            var projectName = req.params.id;
            var branch = req.params[0];
            runtime.storage.projects.getBranchStatus(req.user, projectName,branch).then(function(data) {
                res.json(data);
            })
            .catch(function(err) {
                console.log(err.stack);
                if (err.code) {
                    res.status(400).json({error:err.code, message: err.message});
                } else {
                    res.status(400).json({error:"unexpected_error", message:err.toString()});
                }
            })
        });

        // Set the active local branch
        app.post("/:id/branches", needsPermission("projects.write"), function(req, res) {
            var projectName = req.params.id;
            var branchName = req.body.name;
            var isCreate = req.body.create;
            runtime.storage.projects.setBranch(req.user, projectName,branchName,isCreate).then(function(data) {
                res.json(data);
            })
            .catch(function(err) {
                console.log(err.stack);
                if (err.code) {
                    res.status(400).json({error:err.code, message: err.message});
                } else {
                    res.status(400).json({error:"unexpected_error", message:err.toString()});
                }
            })
        });

        // Get a list of remotes
        app.get("/:id/remotes", needsPermission("projects.read"), function(req, res) {
            var projectName = req.params.id;
            runtime.storage.projects.getRemotes(req.user, projectName).then(function(data) {
                res.json(data);
            })
            .catch(function(err) {
                console.log(err.stack);
                if (err.code) {
                    res.status(400).json({error:err.code, message: err.message});
                } else {
                    res.status(400).json({error:"unexpected_error", message:err.toString()});
                }
            })
        });

        // Add a remote
        app.post("/:id/remotes", needsPermission("projects.write"), function(req,res) {
            var projectName = req.params.id;
            if (/^https?:\/\/[^/]+@/i.test(req.body.url)) {
                res.status(400).json({error:"unexpected_error", message:"Git http url must not include username/password"});
                return;
            }
            runtime.storage.projects.addRemote(req.user, projectName, req.body).then(function() {
                res.redirect(303,req.baseUrl+"/"+projectName+"/remotes");
            }).catch(function(err) {
                console.log(err.stack);
                if (err.code) {
                    res.status(400).json({error:err.code, message: err.message});
                } else {
                    res.status(400).json({error:"unexpected_error", message:err.toString()});
                }
            })
        });

        // Delete a remote
        app.delete("/:id/remotes/:remoteName", needsPermission("projects.write"), function(req, res) {
            var projectName = req.params.id;
            var remoteName = req.params.remoteName;
            runtime.storage.projects.removeRemote(req.user, projectName, remoteName).then(function(data) {
                res.redirect(303,req.baseUrl+"/"+projectName+"/remotes");
            })
            .catch(function(err) {
                if (err.code) {
                    res.status(400).json({error:err.code, message: err.message});
                } else {
                    res.status(400).json({error:"unexpected_error", message:err.toString()});
                }
            });
        });

        // Update a remote
        app.put("/:id/remotes/:remoteName", needsPermission("projects.write"), function(req,res) {
            var projectName = req.params.id;
            var remoteName = req.params.remoteName;
            runtime.storage.projects.updateRemote(req.user, projectName, remoteName, req.body).then(function(data) {
                res.status(204).end();
            })
            .catch(function(err) {
                if (err.code) {
                    res.status(400).json({error:err.code, message: err.message});
                } else {
                    res.status(400).json({error:"unexpected_error", message:err.toString()});
                }
            });

        });

        return app;
    }
}


text:
package akkaguiceutils;

import akka.actor.Actor;
import akka.actor.ActorSystem;
import akka.actor.Props;
import akka.event.Logging;
import akka.event.LoggingAdapter;

import java.util.function.Function;

public interface GuiceUtils extends Actor {
    default LoggingAdapter logger() {
        return Logging.getLogger(this.system(), this);
    }

    default ActorSystem system() {
        return context().system();
    }

    default <T extends Actor> Props props(Class<T> actorClass) {
        return GuiceExtension.get(system()).props(actorClass);
    }

    default <A extends Actor, F> Props props(
            Class<A> actorClass, Class<F> factoryClass,
            Function<F, A> factoryFunction) {
        return GuiceExtension.get(system()).props(actorClass, factoryClass, factoryFunction);
    }
}


text:
package com.noyan.util;

public class CompareUtil {
	public static boolean equal(Object object01, Object object02) {
		if (NullUtil.isAllNull(object01, object02)) {
			return true;
		}

		if (NullUtil.isAnyNull(object01, object02)) {
			return false;
		}

		return object01.equals(object02);
	}

	public static boolean equalsIgnoreCase(Object object01, Object object02) {
		if (!(object01 instanceof String) || !(object02 instanceof String)) {
			return equal(object01, object02);
		}

		String string01 = (String) object01;
		String string02 = (String) object02;

		return string01.equalsIgnoreCase(string02);
	}

	public static boolean test() {
		return true;
	}
}


text:
require 'coveralls'
Coveralls.wear!

require 'smslist'
require 'rspec'
require 'webmock/rspec'

RSpec.configure do |config|
  config.expect_with :rspec do |c|
    c.syntax = :expect
  end
end

def stub_post(path)
  WebMock::stub_request(:post, smslist_url(path))
end

def fixture_path
  File.expand_path("../fixtures", __FILE__)
end

def fixture(file)
  File.new(fixture_path + '/' + file)
end

def xml_response(file)
  {
    body: fixture(file),
    headers: {
      content_type: 'text/xml; charset=utf-8'
    }
  }
end

def smslist_url(url)
  if url =~ /^http/
    url
  else
    "#{Smslist::Configuration::DEFAULT_API_ENDPOINT}#{url}"
  end
end


text:
package com.facebook.buck.rules.coercer;

import static com.facebook.buck.core.cell.TestCellBuilder.createCellRoots;
import static org.hamcrest.MatcherAssert.assertThat;

import com.facebook.buck.core.filesystems.ForwardRelPath;
import com.facebook.buck.core.model.BaseName;
import com.facebook.buck.core.model.ConstantHostTargetConfigurationResolver;
import com.facebook.buck.core.model.UnconfiguredTargetConfiguration;
import com.facebook.buck.io.filesystem.ProjectFilesystem;
import com.facebook.buck.io.filesystem.impl.FakeProjectFilesystem;
import com.facebook.buck.rules.macros.QueryMacro;
import com.facebook.buck.rules.macros.UnconfiguredQueryMacro;
import com.facebook.buck.rules.macros.UnconfiguredQueryOutputsMacro;
import com.facebook.buck.rules.query.Query;
import com.google.common.collect.ImmutableList;
import org.hamcrest.Matchers;
import org.junit.Test;

public class QueryMacroTypeCoercerTest {

  @Test
  public void coerceQueryMacroFromStringArg() throws CoerceFailedException {
    ForwardRelPath basePath = ForwardRelPath.of("java/com/facebook/buck/example");
    ProjectFilesystem filesystem = new FakeProjectFilesystem();
    QueryMacroTypeCoercer<UnconfiguredQueryMacro, QueryMacro> coercer =
        new QueryMacroTypeCoercer<>(
            new QueryCoercer(),
            UnconfiguredQueryMacro.class,
            QueryMacro.class,
            UnconfiguredQueryOutputsMacro::of);
    QueryMacro queryMacro =
        coercer.coerceBoth(
            createCellRoots(filesystem).getCellNameResolver(),
            filesystem,
            basePath,
            UnconfiguredTargetConfiguration.INSTANCE,
            new ConstantHostTargetConfigurationResolver(UnconfiguredTargetConfiguration.INSTANCE),
            ImmutableList.of("some query"));
    assertThat(
        queryMacro.getQuery(),
        Matchers.equalTo(
            Query.of(
                "some query",
                UnconfiguredTargetConfiguration.INSTANCE,
                BaseName.ofPath(basePath))));
  }
}


text:
<!DOCTYPE HTML>

        <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
        <meta http-equiv="refresh" content="1;URL='blank_page_green.html'" />
        <title>Redirect Placeholder</title>

Placeholder


text:
#include <rte_log.h>
#include <rte_common.h>

#include "lthread_diag.h"
#include "lthread_queue.h"
#include "lthread_pool.h"
#include "lthread_objcache.h"
#include "lthread_sched.h"
#include "lthread_diag_api.h"

/* dummy ref value of default diagnostic callback */
static uint64_t dummy_ref;

#define DIAG_SCHED_STATS_FORMAT \
"core %d\n%33s %12s %12s %12s %12s\n"

#define DIAG_CACHE_STATS_FORMAT \
"%20s %12lu %12lu %12lu %12lu %12lu\n"

#define DIAG_QUEUE_STATS_FORMAT \
"%20s %12lu %12lu %12lu\n"

/*
 * texts used in diagnostic events,
 * corresponding diagnostic mask bit positions are given as comment
 */
const char *diag_event_text[] = {
	"LTHREAD_CREATE     ",	/* 00 */
	"LTHREAD_EXIT       ",	/* 01 */
	"LTHREAD_JOIN       ",	/* 02 */
	"LTHREAD_CANCEL     ",	/* 03 */
	"LTHREAD_DETACH     ",	/* 04 */
	"LTHREAD_FREE       ",	/* 05 */
	"LTHREAD_SUSPENDED  ",	/* 06 */
	"LTHREAD_YIELD      ",	/* 07 */
	"LTHREAD_RESCHEDULED",	/* 08 */
	"LTHREAD_SLEEP      ",	/* 09 */
	"LTHREAD_RESUMED    ",	/* 10 */
	"LTHREAD_AFFINITY   ",	/* 11 */
	"LTHREAD_TMR_START  ",	/* 12 */
	"LTHREAD_TMR_DELETE ",	/* 13 */
	"LTHREAD_TMR_EXPIRED",	/* 14 */
	"COND_CREATE        ",	/* 15 */
	"COND_DESTROY       ",	/* 16 */
	"COND_WAIT          ",	/* 17 */
	"COND_SIGNAL        ",	/* 18 */
	"COND_BROADCAST     ",	/* 19 */
	"MUTEX_CREATE       ",	/* 20 */
	"MUTEX_DESTROY      ",	/* 21 */
	"MUTEX_LOCK         ",	/* 22 */
	"MUTEX_TRYLOCK      ",	/* 23 */
	"MUTEX_BLOCKED      ",	/* 24 */
	"MUTEX_UNLOCKED     ",	/* 25 */
	"SCHED_CREATE       ",	/* 26 */
	"SCHED_SHUTDOWN     "	/* 27 */
};

/*
 * set diagnostic ,ask
 */
void lthread_diagnostic_set_mask(DIAG_USED uint64_t mask)
{
#if LTHREAD_DIAG
	diag_mask = mask;
#else
	RTE_LOG(INFO, LTHREAD,
		"LTHREAD_DIAG is not set, see lthread_diag_api.h\n");
#endif
}

/*
 * Check consistency of the scheduler stats
 * Only sensible run after the schedulers are stopped
 * Count the number of objects lying in caches and queues
 * and available in the qnode pool.
 * This should be equal to the total capacity of all
 * qnode pools.
 */
void
_sched_stats_consistency_check(void);
void
_sched_stats_consistency_check(void)
{
#if LTHREAD_DIAG
	int i;
	struct lthread_sched *sched;
	uint64_t count = 0;
	uint64_t capacity = 0;

	for (i = 0; i < LTHREAD_MAX_LCORES; i++) {
		sched = schedcore[i];
		if (sched == NULL)
			continue;

		/* each of these queues consumes a stub node */
		count += 8;
		count += DIAG_COUNT(sched->ready, size);
		count += DIAG_COUNT(sched->pready, size);
		count += DIAG_COUNT(sched->lthread_cache, available);
		count += DIAG_COUNT(sched->stack_cache, available);
		count += DIAG_COUNT(sched->tls_cache, available);
		count += DIAG_COUNT(sched->per_lthread_cache, available);
		count += DIAG_COUNT(sched->cond_cache, available);
		count += DIAG_COUNT(sched->mutex_cache, available);

		/* the node pool does not consume a stub node */
		if (sched->qnode_pool->fast_alloc != NULL)
			count++;
		count += DIAG_COUNT(sched->qnode_pool, available);

		capacity += DIAG_COUNT(sched->qnode_pool, capacity);
	}
	if (count != capacity) {
		RTE_LOG(CRIT, LTHREAD,
			"Scheduler caches are inconsistent\n");
	} else {
		RTE_LOG(INFO, LTHREAD,
			"Scheduler caches are ok\n");
	}
#endif
}

#if LTHREAD_DIAG
/*
 * Display node pool stats
 */
static inline void
_qnode_pool_display(DIAG_USED struct qnode_pool *p)
{

	printf(DIAG_CACHE_STATS_FORMAT,
			p->name,
			DIAG_COUNT(p, rd),
			DIAG_COUNT(p, wr),
			DIAG_COUNT(p, available),
			DIAG_COUNT(p, prealloc),
			DIAG_COUNT(p, capacity));
	fflush(stdout);
}
#endif

#if LTHREAD_DIAG
/*
 * Display queue stats
 */
static inline void
_lthread_queue_display(DIAG_USED struct lthread_queue *q)
{
#if DISPLAY_OBJCACHE_QUEUES
	printf(DIAG_QUEUE_STATS_FORMAT,
			q->name,
			DIAG_COUNT(q, rd),
			DIAG_COUNT(q, wr),
			DIAG_COUNT(q, size));
	fflush(stdout);
#else
	printf("%s: queue stats disabled\n",
			q->name);

#endif
}
#endif

#if LTHREAD_DIAG
/*
 * Display objcache stats
 */
static inline void
_objcache_display(DIAG_USED struct lthread_objcache *c)
{

	printf(DIAG_CACHE_STATS_FORMAT,
			c->name,
			DIAG_COUNT(c, rd),
			DIAG_COUNT(c, wr),
			DIAG_COUNT(c, available),
			DIAG_COUNT(c, prealloc),
			DIAG_COUNT(c, capacity));
	_lthread_queue_display(c->q);
	fflush(stdout);
}
#endif

/*
 * Display sched stats
 */
void
lthread_sched_stats_display(void)
{
#if LTHREAD_DIAG
	int i;
	struct lthread_sched *sched;

	for (i = 0; i < LTHREAD_MAX_LCORES; i++) {
		sched = schedcore[i];
		if (sched != NULL) {
			printf(DIAG_SCHED_STATS_FORMAT,
					sched->lcore_id,
					"rd",
					"wr",
					"present",
					"nb preallocs",
					"capacity");
			_lthread_queue_display(sched->ready);
			_lthread_queue_display(sched->pready);
			_qnode_pool_display(sched->qnode_pool);
			_objcache_display(sched->lthread_cache);
			_objcache_display(sched->stack_cache);
			_objcache_display(sched->tls_cache);
			_objcache_display(sched->per_lthread_cache);
			_objcache_display(sched->cond_cache);
			_objcache_display(sched->mutex_cache);
		fflush(stdout);
		}
	}
	_sched_stats_consistency_check();
#else
	RTE_LOG(INFO, LTHREAD,
		"lthread diagnostics disabled\n"
		"hint - set LTHREAD_DIAG in lthread_diag_api.h\n");
#endif
}

/*
 * Defafult diagnostic callback
 */
static uint64_t
_lthread_diag_default_cb(uint64_t time, struct lthread *lt, int diag_event,
		uint64_t diag_ref, const char *text, uint64_t p1, uint64_t p2)
{
	uint64_t _p2;
	int lcore = (int) rte_lcore_id();

	switch (diag_event) {
	case LT_DIAG_LTHREAD_CREATE:
	case LT_DIAG_MUTEX_CREATE:
	case LT_DIAG_COND_CREATE:
		_p2 = dummy_ref;
		break;
	default:
		_p2 = p2;
		break;
	}

	printf("%"PRIu64" %d %8.8lx %8.8lx %s %8.8lx %8.8lx\n",
		time,
		lcore,
		(uint64_t) lt,
		diag_ref,
		text,
		p1,
		_p2);

	return dummy_ref++;
}

/*
 * plug in default diag callback with mask off
 */
void _lthread_diag_ctor(void)__attribute__((constructor));
void _lthread_diag_ctor(void)
{
	diag_cb = _lthread_diag_default_cb;
	diag_mask = 0;
}

/*
 * enable diagnostics
 */
void lthread_diagnostic_enable(DIAG_USED diag_callback cb,
				DIAG_USED uint64_t mask)
{
#if LTHREAD_DIAG
	if (cb == NULL)
		diag_cb = _lthread_diag_default_cb;
	else
		diag_cb = cb;
	diag_mask = mask;
#else
	RTE_LOG(INFO, LTHREAD,
		"LTHREAD_DIAG is not set, see lthread_diag_api.h\n");
#endif
}


text:
<?php
/**
 * W3 NewRelicAdmin plugin
 */
if (!defined('W3TC')) {
    die();
}

w3_require_once(W3TC_LIB_W3_DIR . '/Plugin.php');
w3_require_once(W3TC_INC_DIR . '/functions/rule.php');

/**
 * Class W3_Plugin_NewRelicAdmin
 */
class W3_Plugin_NewRelicAdmin extends W3_Plugin {

    /**
     * Called on plugin instantiation
     */
    function run() {
        add_filter('w3tc_compatibility_test', array($this, 'verify_compatibility'));
        if (is_admin()) {
            add_action('wp_ajax_admin_w3tc_verify_newrelic_api_key', array($this, 'verify_newrelic_api_key'));
            add_action('wp_ajax_w3tc_verify_newrelic_api_key', array($this, 'verify_newrelic_api_key'));
            add_action('wp_ajax_admin_w3tc_get_newrelic_applications', array($this, 'get_newrelic_applications'));
            add_action('wp_ajax_w3tc_get_newrelic_applications', array($this, 'get_newrelic_applications'));
        }
    }

    /**
     * Activate plugin action (called by W3_Plugins)
     */
    function activate() {}

    /**
     * Deactivate plugin action (called by W3_Plugins)
     */
    function deactivate() {}

    /**
     * Returns a list of the verification status of the the new relic requirements. To be used on the compability page
     * @param $verified_list
     * @return array
     */
    function verify_compatibility($verified_list) {
        $nerser = w3_instance('W3_NewRelicService');
        $nr_verified = $nerser->verify_compatibility();
        $verified_list[] = 'New Relic';
        foreach($nr_verified as $criteria => $result)
            $verified_list[] = sprintf("$criteria: %s", $result);
        return $verified_list;
    }

    /**
     * Retrieve the new relic account id. Used in AJAX requests.
     * Requires request param api_key with the API key
     */
    function verify_newrelic_api_key() {
        $api_key = W3_Request::get_string('api_key');
        /**
         * @var $nerser W3_NewRelicService
         */
        $nerser = w3_instance('W3_NewRelicService');
        $account_id = $nerser->get_account_id($api_key);
        if ($account_id) {
            $this->_config->set('newrelic.account_id', $account_id);
            $this->_config->save();
            echo $account_id;
        }
        die();
    }

    /**
     * Retrieves applications. Used in AJAX requests.
     * Requires request param api_key with the API key and account_id with the Account id.
     */
    function get_newrelic_applications() {
        w3_require_once(W3TC_LIB_W3_DIR . '/NewRelicService.php');
        $api_key = W3_Request::get_string('api_key');
        $account_id = W3_Request::get_string('account_id');
        if ($api_key == '0') {
            $config_master = new W3_Config(true);
            $api_key = $config_master->get_string('newrelic.api_key');
        }
        $nerser = new W3_NewRelicService($api_key);
        if(empty($account_id) || $account_id == '')
            $account_id = $nerser->get_account_id();
        $newrelic_applications = array();
        try {
            $newrelic_applications = $nerser->get_applications($account_id);
        }catch(Exception $ex) {}
        echo json_encode($newrelic_applications);
        die();
    }

    /**
     * Writes rules to file cache .htaccess
     *
     * @return boolean
     */
    function write_rules_core() {
        $path = w3_get_new_relic_rules_core_path();

        if (file_exists($path)) {
            $data = @file_get_contents($path);
        } else {
            $data = '';
        }

        $replace_start = strpos($data, W3TC_MARKER_BEGIN_NEW_RELIC_CORE);
        $replace_end = strpos($data, W3TC_MARKER_END_NEW_RELIC_CORE);

        if ($replace_start !== false && $replace_end !== false && $replace_start < $replace_end) {
            $replace_length = $replace_end - $replace_start + strlen(W3TC_MARKER_END_MINIFY_CORE) + 1;
        } else {
            $replace_start = false;
            $replace_length = 0;

            $search = array(
                W3TC_MARKER_BEGIN_PGCACHE_CORE => 0,
                W3TC_MARKER_BEGIN_BROWSERCACHE_NO404WP => 0,
                W3TC_MARKER_BEGIN_WORDPRESS => 0,
                W3TC_MARKER_END_BROWSERCACHE_CACHE => strlen(W3TC_MARKER_END_BROWSERCACHE_CACHE) + 1,
                W3TC_MARKER_END_PGCACHE_CACHE => strlen(W3TC_MARKER_END_PGCACHE_CACHE) + 1,
                W3TC_MARKER_END_MINIFY_CACHE => strlen(W3TC_MARKER_END_MINIFY_CACHE) + 1
            );

            foreach ($search as $string => $length) {
                $replace_start = strpos($data, $string);

                if ($replace_start !== false) {
                    $replace_start += $length;
                    break;
                }
            }
        }

        $rules = $this->generate_rules_core();

        if (!$rules)
            return;

        if ($replace_start !== false) {
            $data = w3_trim_rules(substr_replace($data, $rules, $replace_start, $replace_length));
        } else {
            $data = w3_trim_rules($data . $rules);
        }

        w3_require_once(W3TC_INC_DIR . '/functions/activation.php');
        w3_write_to_file($path, $data);
    }

    /**
     * Erases Minify core directives
     *
     * @param string $data
     * @return string
     */
    function erase_rules_core($data) {
        $data = w3_erase_rules($data, W3TC_MARKER_BEGIN_NEW_RELIC_CORE, W3TC_MARKER_END_NEW_RELIC_CORE);

        return $data;
    }

    /**
     * Removes NewRelic core directives
     *
     * @return boolean
     */
    function remove_rules_core() {
        $path = w3_get_minify_rules_core_path();

        if (file_exists($path)) {
            if (($data = @file_get_contents($path)) !== false) {
                $data = $this->erase_rules_core($data);

                return @file_put_contents($path, $data);
            }
            return false;
        }
        return true;
    }

    /**
     * Generates rules
     *
     * @return string
     */
    function generate_rules_core() {
        switch (true) {
            case w3_is_apache():
            case w3_is_litespeed():
                return $this->generate_rules_core_apache();
        }

        return false;
    }

    /**
     * Generates rules
     *
     * @return string
     */
    function generate_rules_core_apache() {
        $new_relic_app_name = $this->_config->get_string('newrelic.appname');

        $rules = '';
        if ($new_relic_app_name) {
            $rules .= W3TC_MARKER_BEGIN_NEW_RELIC_CORE . "\n";
            $rules .= sprintf('php_value newrelic.appname \'%s\'', $new_relic_app_name) . "\n";
            $rules .= W3TC_MARKER_END_NEW_RELIC_CORE . "\n";
        }
        return $rules;
    }

    /**
     * @return array
     */
    function get_required_rules() {
        $rewrite_rules = array();
        $newrelic_core_path = w3_get_minify_rules_core_path();
        $rewrite_rules[] = array('filename' => $newrelic_core_path, 'content'  => $this->generate_rules_core());

        return $rewrite_rules;
    }

    /**
     * Check if core rules exists
     *
     * @return boolean
     */
    function check_rules_has_core() {
        $path = w3_get_new_relic_rules_core_path();

        return (($data = @file_get_contents($path)) && w3_has_rules(w3_clean_rules($data), W3TC_MARKER_BEGIN_NEW_RELIC_CORE, W3TC_MARKER_END_NEW_RELIC_CORE));
    }
}


text:
export const leafCountDocs = {
  name: 'leafCount',
  category: 'Algebra',
  syntax: ['leafCount(expr)'],
  description: 'Computes the number of leaves in the parse tree of the given expression',
  examples: [
    'leafCount("e^(i*pi)-1")',
    'leafCount(parse("{a: 22/7, b: 10^(1/2)}"))'
  ],
  seealso: ['simplify']
}


text:
from os.path import exists

from django.test import TestCase
from django.core.files.base import ContentFile

from devilry.project.develop.testhelpers.corebuilder import PeriodBuilder
from devilry.project.develop.testhelpers.corebuilder import DeliveryBuilder
from devilry.project.develop.testhelpers.corebuilder import UserBuilder
from devilry.devilry_student.models import UploadedDeliveryFile

class TestUploadedDeliveryFile(TestCase):
    def setUp(self):
        self.testuser = UserBuilder('testuser').user
        DeliveryBuilder.set_memory_deliverystore()

    def test_convert_to_delivery(self):
        deadline = PeriodBuilder.quickadd_ducku_duck1010_active()\
            .add_assignment('week1')\
            .add_group(students=[self.testuser])\
            .add_deadline_x_weeks_ago(weeks=1).deadline
        UploadedDeliveryFile.objects.create_with_file(
            user=self.testuser,
            deadline=deadline,
            filename='testing.txt',
            filecontent=ContentFile('Hello world')
        )
        delivery, files = UploadedDeliveryFile.objects.convert_to_delivery(deadline, self.testuser)
        self.assertIsNotNone(delivery.id)
        self.assertEqual(delivery.deadline, deadline)
        self.assertEqual(delivery.delivered_by, deadline.assignment_group.candidates.all()[0])
        self.assertEqual(delivery.delivered_by.relatedstudent.user, self.testuser)
        self.assertEqual(delivery.filemetas.count(), 1)
        filemeta = delivery.filemetas.all()[0]
        self.assertEqual(filemeta.filename, 'testing.txt')
        self.assertEqual(filemeta.get_all_data_as_string(), 'Hello world')

    def test_convert_multiple_to_delivery(self):
        deadline = PeriodBuilder.quickadd_ducku_duck1010_active()\
            .add_assignment('week1')\
            .add_group(students=[self.testuser])\
            .add_deadline_x_weeks_ago(weeks=1).deadline
        UploadedDeliveryFile.objects.create_with_file(
            user=self.testuser,
            deadline=deadline,
            filename='testing.txt',
            filecontent=ContentFile('Hello world')
        )
        UploadedDeliveryFile.objects.create_with_file(
            user=self.testuser,
            deadline=deadline,
            filename='testing2.txt',
            filecontent=ContentFile('Hello world 2')
        )
        delivery, files = UploadedDeliveryFile.objects.convert_to_delivery(deadline, self.testuser)
        self.assertEqual(delivery.filemetas.count(), 2)
        self.assertEqual(
            set([f.filename for f in delivery.filemetas.all()]),
            set(['testing.txt', 'testing2.txt']))
        self.assertEqual(
            set([f.get_all_data_as_string() for f in delivery.filemetas.all()]),
            set(['Hello world', 'Hello world 2']))

    def test_delete(self):
        deadline = PeriodBuilder.quickadd_ducku_duck1010_active()\
            .add_assignment('week1')\
            .add_group(students=[self.testuser])\
            .add_deadline_x_weeks_ago(weeks=1).deadline
        uploadedfile = UploadedDeliveryFile.objects.create_with_file(
            user=self.testuser,
            deadline=deadline,
            filename='testing2.txt',
            filecontent=ContentFile('Hello world 2')
        )
        path = uploadedfile.uploaded_file.file.name
        self.assertTrue(exists(path))
        UploadedDeliveryFile.objects.get_queryset().all().delete_objects_and_files()
        self.assertEqual(UploadedDeliveryFile.objects.count(), 0)
        self.assertFalse(exists(path))

    def test_prepare_filename(self):
        self.assertEqual(UploadedDeliveryFile.prepare_filename('test.txt'), 'test.txt')
        self.assertEqual(255,
            len(UploadedDeliveryFile.prepare_filename('x'*300)))
        self.assertEqual(
            UploadedDeliveryFile.prepare_filename('{}yy.txt'.format('x'*251)),
            '{}.txt'.format('x'*251))


text:
layout: base
title:  'Statistics of AUX in UD_Abaza-ATB'
udver: '2'
---

## Treebank Statistics: UD_Abaza-ATB: POS Tags: `AUX`

There are 2 `AUX` lemmas (1%), 3 `AUX` types (1%) and 4 `AUX` tokens (1%).
Out of 13 observed tags, the rank of `AUX` is: 10 in number of lemmas, 10 in number of types and 11 in number of tokens.

The 10 most frequent `AUX` lemmas: _, чпара

The 10 most frequent `AUX` types:  акIвапI, йсчпатI, ракIвапI

The 10 most frequent ambiguous lemmas: _ (<tt>VERB</tt> 7, <tt>AUX</tt> 3), чпара (<tt>VERB</tt> 18, <tt>AUX</tt> 1)

The 10 most frequent ambiguous types:

## Morphology

The form / lemma ratio of `AUX` is 1.500000 (the average of all parts of speech is 1.578778).

The 1st highest number of forms (2) was observed with the lemma "_": акIвапI, ракIвапI.

The 2nd highest number of forms (1) was observed with the lemma "чпара": йсчпатI.

`AUX` occurs with 8 features: <tt>Tense</tt> (4; 100% instances), <tt>VerbForm</tt> (4; 100% instances), <tt>Number[abs]</tt> (1; 25% instances), <tt>Number[erg]</tt> (1; 25% instances), <tt>Number[io]</tt> (1; 25% instances), <tt>Person[abs]</tt> (1; 25% instances), <tt>Person[erg]</tt> (1; 25% instances), <tt>Person[io]</tt> (1; 25% instances)

`AUX` occurs with 9 feature-value pairs: `Number[abs]=Plur`, `Number[erg]=Sing`, `Number[io]=Plur`, `Person[abs]=3`, `Person[erg]=1`, `Person[io]=3`, `Tense=Aor`, `Tense=Pres`, `VerbForm=Fin`

`AUX` occurs with 3 feature combinations.
The most frequent feature combination is `Tense=Pres|VerbForm=Fin` (2 tokens).
Examples: акIвапI

## Relations

`AUX` nodes are attached to their parents using 2 different relations: <tt>cop</tt> (3; 75% instances), <tt>conj</tt> (1; 25% instances)

Parents of `AUX` nodes belong to 3 different parts of speech: <tt>VERB</tt> (2; 50% instances), <tt>NOUN</tt> (1; 25% instances), <tt>PRON</tt> (1; 25% instances)

3 (75%) `AUX` nodes are leaves.

1 (25%) `AUX` nodes have one child.

The highest child degree of a `AUX` node is 1.

Children of `AUX` nodes are attached using 1 different relations: <tt>xcomp</tt> (1; 100% instances)

Children of `AUX` nodes belong to 1 different parts of speech: <tt>VERB</tt> (1; 100% instances)


text:
//
// example-1.js - a simple example of using opt.
//
// @author: R. S. Doiel, <rsdoiel@gmail.com>
// copyright (c) 2012 all rights reserved
//
// Released under New the BSD License.
// See: http://opensource.org/licenses/bsd-license.php
//
/*jslint devel: true, node: true, maxerr: 50, indent: 4,  vars: true, sloppy: true */
"use strict";

var util = require("util"),
	path = require("path"),
	opt = require("../opt").create(),
	program_name = path.basename(process.argv[1]),
	message,
	args;

opt.optionHelp("USAGE node " + program_name,
	"SYNOPSIS: Demonstrate how opt works.\n\n\t\t node " +
		program_name +
		" --help",
	"OPTIONS:",
	" copyright (c) 2012 all rights reserved\n" +
	" Released under New the BSD License.\n" +
	" See: http://opensource.org/licenses/bsd-license.php\n");

opt.option(["-m", "--message"], function (param) {
	message = param;
	opt.consume(param);
}, "message to display");
opt.option(["-h", "--help"], function () {
    opt.usage();
}, "This help document.");

// Parse the command line options
args = opt.optionWith(process.argv);
if (message) {
	console.log(message);
} else {
	opt.usage("Try using a command line option for demo:\n", 1);
}


text:
package command

import (
	"encoding/json"
	"testing"

	"gotest.tools/v3/assert"
)

func TestDockerContextMetadataKeepAdditionalFields(t *testing.T) {
	c := DockerContext{
		Description: "test",
		AdditionalFields: map[string]interface{}{
			"foo": "bar",
		},
	}
	jsonBytes, err := json.Marshal(c)
	assert.NilError(t, err)
	const expected = `{"Description":"test","foo":"bar"}`
	assert.Equal(t, string(jsonBytes), expected)

	var c2 DockerContext
	assert.NilError(t, json.Unmarshal(jsonBytes, &c2))
	assert.Equal(t, c2.AdditionalFields["foo"], "bar")
	assert.Equal(t, c2.Description, "test")
}