text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

    <meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>Using getElementsByClassName</title>

<link rel="stylesheet" type="text/css" href="../../build/fonts/fonts-min.css" />

Using getElementsByClassName

Clicking the document will use Dom's getElementsByClassName method to collect all of the elements with the  class bar applied.

div class="bar"

div class="bar-baz"

div class="bar "

div class=" bar "

div class=" bar baz"

div class=" bar2 baz"

div class="foo"

div class="foo" id="bar"

div class="foo bar baz"

p class="bar"

<button id="demo-run">run</button>


text:
module Kairos

  module Configuration
    VALID_CONNECTION_KEYS  = [:app_id, :app_key].freeze
    VALID_OPTIONS_KEYS     = [:url, :subject_id, :gallery_name, :threshold, :max_num_results, :selector].freeze
    VALID_CONFIG_KEYS      = VALID_CONNECTION_KEYS + VALID_OPTIONS_KEYS

    DEFAULT_USER_AGENT     = "Kairos API Ruby Gem #{Kairos::VERSION}".freeze
    DEFAULT_APP_ID         = nil
    DEFAULT_APP_KEY        = nil

    ENROLL                 = 'https://api.kairos.com/enroll'
    RECOGNIZE              = 'https://api.kairos.com/recognize'
    DETECT                 = 'https://api.kairos.com/detect'
    GALLERY_LIST_ALL       = 'https://api.kairos.com/gallery/list_all'
    GALLERY_VIEW           = 'https://api.kairos.com/gallery/view'
    GALLERY_REMOVE_SUBJECT = 'https://api.kairos.com/gallery/remove_subject'

    # Build accessor methods for every config options so we can do this, for example:
    #   Kairos.format = :xml
    attr_accessor *VALID_CONFIG_KEYS

    # Make sure we have the default values set when we get 'extended'
    def self.extended(base)
      base.reset
    end

    def reset
      self.app_id  = DEFAULT_APP_ID
      self.app_key = DEFAULT_APP_KEY
    end

    def configure
      yield self
    end

    # Return the configuration values set in this module
    def options
      Hash[ * VALID_CONFIG_KEYS.map { |key| [key, send(key)] }.flatten ]
    end
  end

end

redpajama_set_name: RedPajamaGithub


text:
case "$OSTYPE" in
linux*) export SYSTEM=LINUX ;;
darwin*) export SYSTEM=OSX ;;
win*) export SYSTEM=Windows ;;
cygwin*) export SYSTEM=Cygwin ;;
msys*) export SYSTEM=MSYS ;;
bsd*) export SYSTEM=BSD ;;
solaris*) export SYSTEM=SOLARIS ;;
*) export SYSTEM=UNKNOWN ;;
esac
echo "SYSTEM : ${SYSTEM}"

if [ -f /etc/os-release ]; then
  # freedesktop.org and systemd
  . /etc/os-release
  OS=$NAME
  VER=$VERSION_ID
elif type lsb_release >/dev/null 2>&1; then
  # linuxbase.org
  OS=$(lsb_release -si)
  VER=$(lsb_release -sr)
elif [ -f /etc/lsb-release ]; then
  # For some versions of Debian/Ubuntu without lsb_release command
  . /etc/lsb-release
  OS=$DISTRIB_ID
  VER=$DISTRIB_RELEASE
elif [ -f /etc/debian_version ]; then
  # Older Debian/Ubuntu/etc.
  OS=Debian
  VER=$(cat /etc/debian_version)
elif [ -f /etc/SuSe-release ]; then
  # Older SuSE/etc.
  ...
elif [ -f /etc/redhat-release ]; then
  # Older Red Hat, CentOS, Docker etc.
  #less /etc/redhat-release
  OS=$(uname -s) # Linux
  VER=$(uname -r)
else
  # Fall back to uname, e.g. "Linux <version>", also works for BSD, etc.
  OS=$(uname -s)
  VER=$(uname -r)
fi
echo "OS : ${OS}"
echo "VER : ${VER}"


text:
package org.ovirt.engine.ui.webadmin.uicommon.model;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

import org.ovirt.engine.core.common.businessentities.Bookmark;
import org.ovirt.engine.ui.common.presenter.AbstractModelBoundPopupPresenterWidget;
import org.ovirt.engine.ui.common.presenter.popup.DefaultConfirmationPopupPresenterWidget;
import org.ovirt.engine.ui.common.presenter.popup.RemoveConfirmationPopupPresenterWidget;
import org.ovirt.engine.ui.common.uicommon.model.DataBoundTabModelProvider;
import org.ovirt.engine.ui.uicommonweb.UICommand;
import org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel;
import org.ovirt.engine.ui.uicommonweb.models.Model;
import org.ovirt.engine.ui.uicommonweb.models.bookmarks.BookmarkListModel;
import org.ovirt.engine.ui.uicompat.Event;
import org.ovirt.engine.ui.uicompat.EventArgs;
import org.ovirt.engine.ui.uicompat.IEventListener;
import org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs;
import org.ovirt.engine.ui.webadmin.section.main.presenter.popup.bookmark.BookmarkPopupPresenterWidget;

import com.google.gwt.event.shared.EventBus;
import com.google.gwt.view.client.HasData;
import com.google.gwt.view.client.SelectionChangeEvent;
import com.google.gwt.view.client.SelectionChangeEvent.Handler;
import com.google.gwt.view.client.SingleSelectionModel;
import com.google.inject.Inject;
import com.google.inject.Provider;

public class BookmarkModelProvider extends DataBoundTabModelProvider<Bookmark, BookmarkListModel> {

    private final SingleSelectionModel<Bookmark> selectionModel;

    private final Provider<BookmarkPopupPresenterWidget> popupProvider;
    private final Provider<RemoveConfirmationPopupPresenterWidget> removeConfirmPopupProvider;

    private final SystemTreeModelProvider treeModelProvider;
    private final TagModelProvider tagModelProvider;

    @Inject
    public BookmarkModelProvider(EventBus eventBus,
            Provider<DefaultConfirmationPopupPresenterWidget> defaultConfirmPopupProvider,
            Provider<BookmarkPopupPresenterWidget> bookmarkPopupPresenterWidgetProvider,
            Provider<RemoveConfirmationPopupPresenterWidget> removeConfirmPopupProvider,
            SystemTreeModelProvider treeModelProvider, TagModelProvider tagModelProvider) {
        super(eventBus, defaultConfirmPopupProvider);
        this.popupProvider = bookmarkPopupPresenterWidgetProvider;
        this.removeConfirmPopupProvider = removeConfirmPopupProvider;
        this.treeModelProvider = treeModelProvider;
        this.tagModelProvider = tagModelProvider;

        // Create selection model
        selectionModel = new SingleSelectionModel<Bookmark>();
        selectionModel.addSelectionChangeHandler(new Handler() {
            @Override
            public void onSelectionChange(SelectionChangeEvent event) {
                Bookmark selectedObject = selectionModel.getSelectedObject();
                List<Bookmark> selectedItems = selectedObject != null
                        ? new ArrayList<Bookmark>(Arrays.asList(selectedObject))
                        : new ArrayList<Bookmark>();
                BookmarkModelProvider.this.setSelectedItems(selectedItems);
            }
        });
    }

    @Override
    protected void onCommonModelChange() {
        super.onCommonModelChange();

        // Clear selection when a system tree node is selected
        treeModelProvider.getModel().getSelectedItemChangedEvent().addListener(new IEventListener() {
            @Override
            public void eventRaised(Event ev, Object sender, EventArgs args) {
                if (treeModelProvider.getModel().getSelectedItem() != null) {
                    clearSelection();
                }
            }
        });

        // Clear selection when a tag tree node is pinned
        tagModelProvider.getModel().getSelectedItemsChangedEvent().addListener(new IEventListener() {
            @Override
            public void eventRaised(Event ev, Object sender, EventArgs args) {
                if (tagModelProvider.getModel().getSelectedItems() != null
                        && !tagModelProvider.getModel().getSelectedItems().isEmpty()) {
                    clearSelection();
                }
            }
        });

        // Clear selection when a new tab is selected
        getCommonModel().getSelectedItemChangedEvent().addListener(new IEventListener() {
            @Override
            public void eventRaised(Event ev, Object sender, EventArgs args) {
                if (getCommonModel().getSelectedItem() != null) {
                    clearSelection();
                }
            }
        });

        // Clear selection when the search string is updated
        getCommonModel().getPropertyChangedEvent().addListener(new IEventListener() {
            @Override
            public void eventRaised(Event ev, Object sender, EventArgs args) {
                if ("SearchString".equals(((PropertyChangedEventArgs) args).propertyName)) { //$NON-NLS-1$
                    clearSelection();
                }
            }
        });

        // Clear tag selection when a tag is saved/edited/deleted
        getModel().getItemSavedEvent().addListener(new IEventListener() {
            @Override
            public void eventRaised(Event ev, Object sender, EventArgs args) {
                clearSelection();
            }
        });

    }

    void clearSelection() {
        if (selectionModel.getSelectedObject() != null && !getModel().getIsBookmarkInitiated()) {
            selectionModel.setSelected(selectionModel.getSelectedObject(), false);
        }
    }

    @Override
    protected void updateDataProvider(List<Bookmark> items) {
        super.updateDataProvider(items);
    }

    @Override
    public BookmarkListModel getModel() {
        return getCommonModel().getBookmarkList();
    }

    public SingleSelectionModel<Bookmark> getSelectionModel() {
        return selectionModel;
    }

    @Override
    public void addDataDisplay(HasData<Bookmark> display) {
        super.addDataDisplay(display);
        display.setSelectionModel(selectionModel);
    }

    @Override
    public AbstractModelBoundPopupPresenterWidget<? extends Model, ?> getModelPopup(BookmarkListModel source,
            UICommand lastExecutedCommand, Model windowModel) {
        if (lastExecutedCommand == getModel().getNewCommand()
                || lastExecutedCommand == getModel().getEditCommand()) {
            return popupProvider.get();
        } else {
            return super.getModelPopup(source, lastExecutedCommand, windowModel);
        }
    }

    @Override
    public AbstractModelBoundPopupPresenterWidget<? extends ConfirmationModel, ?> getConfirmModelPopup(BookmarkListModel source,
            UICommand lastExecutedCommand) {
        if (lastExecutedCommand == getModel().getRemoveCommand()) {
            return removeConfirmPopupProvider.get();
        } else {
            return super.getConfirmModelPopup(source, lastExecutedCommand);
        }
    }

}


text:
package org.apache.hadoop.hbase.snapshot;

import org.apache.hadoop.classification.InterfaceAudience;
import org.apache.hadoop.hbase.FullyQualifiedTableName;
import org.apache.hadoop.hbase.HTableDescriptor;
import org.apache.hadoop.hbase.protobuf.generated.HBaseProtos;
import org.apache.hadoop.hbase.util.Bytes;

/**
 * Class to help with dealing with a snapshot description on the client side.
 * There is a corresponding class on the server side.
 */
@InterfaceAudience.Private
public class ClientSnapshotDescriptionUtils {
  /**
   * Check to make sure that the description of the snapshot requested is valid
   * @param snapshot description of the snapshot
   * @throws IllegalArgumentException if the name of the snapshot or the name of the table to
   *           snapshot are not valid names.
   */
  public static void assertSnapshotRequestIsValid(HBaseProtos.SnapshotDescription snapshot)
      throws IllegalArgumentException {
    // FIXME these method names is really bad - trunk will probably change
    // .META. and -ROOT- snapshots are not allowed
    if (HTableDescriptor.isSystemTable(FullyQualifiedTableName.valueOf(snapshot.getTable()))) {
      throw new IllegalArgumentException("System table snapshots are not allowed");
    }
    // make sure the snapshot name is valid
    FullyQualifiedTableName.isLegalFullyQualifiedTableName(Bytes.toBytes(snapshot.getName()));
    // make sure the table name is valid
    FullyQualifiedTableName.isLegalFullyQualifiedTableName(Bytes.toBytes(snapshot.getTable()));
  }

  /**
   * Returns a single line (no \n) representation of snapshot metadata.  Use this instead of
   * {@link org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.SnapshotDescription#toString()}.  We don't replace SnapshotDescrpition's toString
   * because it is auto-generated by protoc.
   * @param ssd
   * @return Single line string with a summary of the snapshot parameters
   */
  public static String toString(HBaseProtos.SnapshotDescription ssd) {
    if (ssd == null) {
      return null;
    }
    return "{ ss=" + ssd.getName() + " table=" + ssd.getTable()
        + " type=" + ssd.getType() + " }";
  }
}


text:
#
# kbuild file for firmware/
#

# Create $(fwabs) from $(CONFIG_EXTRA_FIRMWARE_DIR) -- if it doesn't have a
# leading /, it's relative to $(srctree).
fwdir := $(subst ",,$(CONFIG_EXTRA_FIRMWARE_DIR))
fwabs := $(addprefix $(srctree)/,$(filter-out /%,$(fwdir)))$(filter /%,$(fwdir))

fw-external-y := $(subst ",,$(CONFIG_EXTRA_FIRMWARE))

# There are three cases to care about:
# 1. Building kernel with CONFIG_FIRMWARE_IN_KERNEL=y -- $(fw-shipped-y) should
#    include the firmware files to include, according to .config
# 2. 'make modules_install', which will install firmware for modules, and
#    _also_ for the in-kernel drivers when CONFIG_FIRMWARE_IN_KERNEL=n
# 3. 'make firmware_install', which installs all firmware, unconditionally.

# For the former two cases we want $(fw-shipped-y) and $(fw-shipped-m) to be
# accurate. In the latter case it doesn't matter -- it'll use $(fw-shipped-all).
# But be aware that the config file might not be included at all.

ifdef CONFIG_ACENIC_OMIT_TIGON_I
acenic-objs := acenic/tg2.bin
fw-shipped- += acenic/tg1.bin
else
acenic-objs := acenic/tg1.bin acenic/tg2.bin
endif
fw-shipped-$(CONFIG_ACENIC) += $(acenic-objs)
fw-shipped-$(CONFIG_ATARI_DSP56K) += dsp56k/bootstrap.bin
fw-shipped-$(CONFIG_BNX2X) += bnx2x/bnx2x-e1-7.2.51.0.fw \
			      bnx2x/bnx2x-e1h-7.2.51.0.fw \
			      bnx2x/bnx2x-e2-7.2.51.0.fw
fw-shipped-$(CONFIG_BNX2) += 	bnx2/bnx2-mips-09-6.2.1b.fw \
				bnx2/bnx2-rv2p-06-6.0.15.fw \
				bnx2/bnx2-mips-06-6.2.3.fw \
				bnx2/bnx2-rv2p-09-6.0.17.fw \
				bnx2/bnx2-rv2p-09ax-6.0.17.fw
fw-shipped-$(CONFIG_E100) += e100/d101m_ucode.bin e100/d101s_ucode.bin \
			     e100/d102e_ucode.bin
fw-shipped-$(CONFIG_PCMCIA_PCNET) +=

fw-shipped-$(CONFIG_PCMCIA_3C589) +=
fw-shipped-$(CONFIG_PCMCIA_3C574) +=
fw-shipped-$(CONFIG_SERIAL_8250_CS) +=

fw-shipped-$(CONFIG_SCSI_QLOGIC_1280) += qlogic/1040.bin qlogic/1280.bin \
					 qlogic/12160.bin
fw-shipped-$(CONFIG_SCSI_QLOGICPTI) += qlogic/isp1000.bin
fw-shipped-$(CONFIG_INFINIBAND_QIB) += qlogic/sd7220.fw
fw-shipped-$(CONFIG_SND_WAVEFRONT) += yamaha/yss225_registers.bin
fw-shipped-$(CONFIG_TIGON3) += tigon/tg3.bin tigon/tg3_tso.bin \
			       tigon/tg3_tso5.bin
fw-shipped-$(CONFIG_USB_DABUSB) += dabusb/firmware.fw dabusb/bitstream.bin
ifdef CONFIG_FIRMWARE_IN_KERNEL
fw-shipped-$(CONFIG_USB_SERIAL_KEYSPAN_MPR) += keyspan/mpr.fw
fw-shipped-$(CONFIG_USB_SERIAL_KEYSPAN_USA18X) += keyspan/usa18x.fw
fw-shipped-$(CONFIG_USB_SERIAL_KEYSPAN_USA19) += keyspan/usa19.fw
fw-shipped-$(CONFIG_USB_SERIAL_KEYSPAN_USA19QI) += keyspan/usa19qi.fw
fw-shipped-$(CONFIG_USB_SERIAL_KEYSPAN_USA19QW) += keyspan/usa19qw.fw
fw-shipped-$(CONFIG_USB_SERIAL_KEYSPAN_USA19W) += keyspan/usa19w.fw
fw-shipped-$(CONFIG_USB_SERIAL_KEYSPAN_USA28) += keyspan/usa28.fw
fw-shipped-$(CONFIG_USB_SERIAL_KEYSPAN_USA28XA) += keyspan/usa28xa.fw
fw-shipped-$(CONFIG_USB_SERIAL_KEYSPAN_USA28XB) += keyspan/usa28xb.fw
fw-shipped-$(CONFIG_USB_SERIAL_KEYSPAN_USA28X) += keyspan/usa28x.fw
fw-shipped-$(CONFIG_USB_SERIAL_KEYSPAN_USA49W) += keyspan/usa49w.fw
fw-shipped-$(CONFIG_USB_SERIAL_KEYSPAN_USA49WLC) += keyspan/usa49wlc.fw
else
fw-shipped- += keyspan/mpr.fw keyspan/usa18x.fw keyspan/usa19.fw	\
	keyspan/usa19qi.fw keyspan/usa19qw.fw keyspan/usa19w.fw		\
	keyspan/usa28.fw keyspan/usa28xa.fw keyspan/usa28xb.fw		\
	keyspan/usa28x.fw keyspan/usa49w.fw keyspan/usa49wlc.fw
endif
fw-shipped-$(CONFIG_USB_SERIAL_WHITEHEAT) += whiteheat_loader.fw whiteheat.fw \
					   # whiteheat_loader_debug.fw
fw-shipped-$(CONFIG_USB_VICAM) += vicam/firmware.fw
fw-shipped-$(CONFIG_YAM) += yam/1200.bin yam/9600.bin

fw-shipped-$(CONFIG_SCSI_QLA_FC) += \
	ql2300_fw.bin \
	ql2322_fw.bin \
	ql2400_fw.bin \
	ql2500_fw.bin

fw-shipped-$(CONFIG_DRM_RADEON) += radeon/ARUBA_me.bin
fw-shipped-$(CONFIG_DRM_RADEON) += radeon/ARUBA_pfp.bin
fw-shipped-$(CONFIG_DRM_RADEON) += radeon/ARUBA_rlc.bin
fw-shipped-$(CONFIG_DRM_RADEON) += radeon/PITCAIRN_ce.bin
fw-shipped-$(CONFIG_DRM_RADEON) += radeon/PITCAIRN_mc.bin
fw-shipped-$(CONFIG_DRM_RADEON) += radeon/PITCAIRN_me.bin
fw-shipped-$(CONFIG_DRM_RADEON) += radeon/PITCAIRN_pfp.bin
fw-shipped-$(CONFIG_DRM_RADEON) += radeon/PITCAIRN_rlc.bin
fw-shipped-$(CONFIG_DRM_RADEON) += radeon/TAHITI_ce.bin
fw-shipped-$(CONFIG_DRM_RADEON) += radeon/TAHITI_mc.bin
fw-shipped-$(CONFIG_DRM_RADEON) += radeon/TAHITI_me.bin
fw-shipped-$(CONFIG_DRM_RADEON) += radeon/TAHITI_pfp.bin
fw-shipped-$(CONFIG_DRM_RADEON) += radeon/TAHITI_rlc.bin
fw-shipped-$(CONFIG_DRM_RADEON) += radeon/VERDE_ce.bin
fw-shipped-$(CONFIG_DRM_RADEON) += radeon/VERDE_mc.bin
fw-shipped-$(CONFIG_DRM_RADEON) += radeon/VERDE_me.bin
fw-shipped-$(CONFIG_DRM_RADEON) += radeon/VERDE_pfp.bin
fw-shipped-$(CONFIG_DRM_RADEON) += radeon/VERDE_rlc.bin

fw-shipped-all := $(fw-shipped-y) $(fw-shipped-m) $(fw-shipped-)

# Directories which we _might_ need to create, so we have a rule for them.
firmware-dirs := $(sort $(addprefix $(objtree)/$(obj)/,$(dir $(fw-external-y) $(fw-shipped-all))))

quiet_cmd_mkdir = MKDIR   $(patsubst $(objtree)/%,%,$@)
      cmd_mkdir = mkdir -p $@

quiet_cmd_ihex  = IHEX    $@
      cmd_ihex  = $(OBJCOPY) -Iihex -Obinary $< $@

quiet_cmd_ihex2fw  = IHEX2FW $@
      cmd_ihex2fw  = $(objtree)/$(obj)/ihex2fw $< $@

quiet_cmd_h16tofw  = H16TOFW $@
      cmd_h16tofw  = $(objtree)/$(obj)/ihex2fw -w $< $@

quiet_cmd_fwbin = MK_FW   $@
      cmd_fwbin = FWNAME="$(patsubst firmware/%.gen.S,%,$@)";		     \
		  FWSTR="$(subst /,_,$(subst .,_,$(subst -,_,$(patsubst	     \
				firmware/%.gen.S,%,$@))))";		     \
		  ASM_WORD=$(if $(CONFIG_64BIT),.quad,.long);		     \
		  ASM_ALIGN=$(if $(CONFIG_64BIT),3,2);			     \
		  PROGBITS=$(if $(CONFIG_ARM),%,@)progbits;		     \
		  echo "/* Generated by firmware/Makefile */"		> $@;\
		  echo "    .section .rodata"				>>$@;\
		  echo "    .p2align $${ASM_ALIGN}"			>>$@;\
		  echo "_fw_$${FWSTR}_bin:"				>>$@;\
		  echo "    .incbin \"$(2)\""				>>$@;\
		  echo "_fw_end:"					>>$@;\
		  echo "   .section .rodata.str,\"aMS\",$${PROGBITS},1"	>>$@;\
		  echo "    .p2align $${ASM_ALIGN}"			>>$@;\
		  echo "_fw_$${FWSTR}_name:"				>>$@;\
		  echo "    .string \"$$FWNAME\""			>>$@;\
		  echo "    .section .builtin_fw,\"a\",$${PROGBITS}"	>>$@;\
		  echo "    .p2align $${ASM_ALIGN}"			>>$@;\
		  echo "    $${ASM_WORD} _fw_$${FWSTR}_name"		>>$@;\
		  echo "    $${ASM_WORD} _fw_$${FWSTR}_bin"		>>$@;\
		  echo "    $${ASM_WORD} _fw_end - _fw_$${FWSTR}_bin"	>>$@;

# One of these files will change, or come into existence, whenever
# the configuration changes between 32-bit and 64-bit. The .S files
# need to change when that happens.
wordsize_deps := $(wildcard include/config/64bit.h include/config/32bit.h \
		include/config/ppc32.h include/config/ppc64.h \
		include/config/superh32.h include/config/superh64.h \
		include/config/x86_32.h include/config/x86_64.h)

# Workaround for make < 3.81, where .SECONDEXPANSION doesn't work.
# It'll end up depending on these targets, so make them a PHONY rule which
# depends on _all_ the directories in $(firmware-dirs), and it'll work out OK.
PHONY += $(objtree)/$$(%) $(objtree)/$(obj)/$$(%)
$(objtree)/$$(%) $(objtree)/$(obj)/$$(%): $(firmware-dirs)
	@true

# For the $$(dir %) trick, where we need % to be expanded first.
.SECONDEXPANSION:

$(patsubst %,$(obj)/%.gen.S, $(fw-shipped-y)): %: $(wordsize_deps) \
		| $(objtree)/$$(dir %)
	$(call cmd,fwbin,$(patsubst %.gen.S,%,$@))
$(patsubst %,$(obj)/%.gen.S, $(fw-external-y)): %: $(wordsize_deps) \
		include/config/extra/firmware/dir.h | $(objtree)/$$(dir %)
	$(call cmd,fwbin,$(fwabs)/$(patsubst $(obj)/%.gen.S,%,$@))

# The .o files depend on the binaries directly; the .S files don't.
$(patsubst %,$(obj)/%.gen.o, $(fw-shipped-y)): %.gen.o: %
$(patsubst %,$(obj)/%.gen.o, $(fw-external-y)): $(obj)/%.gen.o: $(fwdir)/%

# .ihex is used just as a simple way to hold binary files in a source tree
# where binaries are frowned upon. They are directly converted with objcopy.
$(obj)/%: $(obj)/%.ihex | $(objtree)/$(obj)/$$(dir %)
	$(call cmd,ihex)

# Don't depend on ihex2fw if we're installing and it already exists.
# Putting it after | in the dependencies doesn't seem sufficient when
# we're installing after a cross-compile, because ihex2fw has dependencies
# on stuff like /usr/lib/gcc/ppc64-redhat-linux/4.3.0/include/stddef.h and
# thus wants to be rebuilt. Which it can't be, if the prebuilt kernel tree
# is exported read-only for someone to run 'make install'.
ifeq ($(INSTALL):$(wildcard $(obj)/ihex2fw),install:$(obj)/ihex2fw)
ihex2fw_dep :=
else
ihex2fw_dep := $(obj)/ihex2fw
endif

# .HEX is also Intel HEX, but where the offset and length in each record
# is actually meaningful, because the firmware has to be loaded in a certain
# order rather than as a single binary blob. Thus, we convert them into our
# more compact binary representation of ihex records (<linux/ihex.h>)
$(obj)/%.fw: $(obj)/%.HEX $(ihex2fw_dep) | $(objtree)/$(obj)/$$(dir %)
	$(call cmd,ihex2fw)

# .H16 is our own modified form of Intel HEX, with 16-bit length for records.
$(obj)/%.fw: $(obj)/%.H16 $(ihex2fw_dep) | $(objtree)/$(obj)/$$(dir %)
	$(call cmd,h16tofw)

$(firmware-dirs):
	$(call cmd,mkdir)

obj-y				 += $(patsubst %,%.gen.o, $(fw-external-y))
obj-$(CONFIG_FIRMWARE_IN_KERNEL) += $(patsubst %,%.gen.o, $(fw-shipped-y))

# Remove .S files and binaries created from ihex
# (during 'make clean' .config isn't included so they're all in $(fw-shipped-))
targets := $(fw-shipped-) $(patsubst $(obj)/%,%, \
				$(shell find $(obj) -name \*.gen.S 2>/dev/null))

# Without this, built-in.o won't be created when it's empty, and the
# final vmlinux link will fail.
obj-n := dummy

hostprogs-y := ihex2fw


text:
<div class="modal fade" id="plugin-settings-<?php echo $plugin->id; ?>" tabindex="-1" role="dialog" aria-labelledby="plugin-settings-<?php echo $plugin->id; ?>-label" aria-hidden="true">

                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                <h4 class="modal-title" id="plugin-settings-<?php echo $plugin->id; ?>-label"><?php echo lang('Plugin settings for') . ' ' . $plugin->pluginReadableName; ?>
                    by <a href="<?php echo $plugin->authorWebsite; ?>" target="_blank"><?php echo $plugin->authorName; ?>

<?php echo $plugin->pluginDescription; ?>

            <form class="ajax-settings-form" role="form" action="<?php echo base_url('settings/save'); ?>" method="post" name="save">

<a href="#plugin-common-<?php echo $plugin->id; ?>" data-toggle="tab"><?php echo lang('Settings'); ?>

<a href="#plugin-device-mapping-<?php echo $plugin->id; ?>" data-toggle="tab"><?php echo lang('Device mapping'); ?>

                        <div class="tab-pane fade in active" id="plugin-common-<?php echo $plugin->id; ?>">

                            <?php foreach ($plugin->settings as $setting) : ?>

                                    <?php echo $setting['readableName']; ?>
                                    <input name="<?php echo $setting['key']; ?>" value="<?php echo get_setting($setting['key']); ?>" class="form-control">

<?php echo $setting['helpText']; ?>

                            <?php endforeach; ?>

                        <div class="tab-pane fade" id="plugin-device-mapping-<?php echo $plugin->id; ?>">

                                        LiHoCoS <?php echo lang('Devices'); ?>
                                        <?php echo $plugin->pluginReadableName . ' ' . lang('Devices'); ?>

                                    <?php foreach ($devices as $device) : ?>

                                            <?php echo $device->get_display_name(); ?>

                                                <select name="plugin_reference-<?php echo get_class($device) . '-' . $device->id; ?>" data-selected="<?php echo $device->plugin_reference; ?>" class="form-control plugin-select">
                                                    <?php if ($pluginDevices) : ?>
                                                        <?php foreach ($pluginDevices as $pluginDevice) : ?>
                                                            <option value="<?php echo $pluginDevice[0]; ?>"><?php echo $pluginDevice[1]; ?></option>
                                                        <?php endforeach; ?>
                                                    <?php endif; ?>
                                                </select>

                                    <?php endforeach; ?>

                    <button type="button" class="btn btn-default" data-dismiss="modal"><?php echo lang('Close'); ?></button>
                    <button type="submit" class="btn btn-primary"><?php echo lang('Save'); ?></button>

            </form>


text:
function reverse(str) {
    return str.split('').reverse().join('');
}

module.exports = reverse;


text:
- [Introduction](#introduction)
- [Creating Migrations](#creating-migrations)
- [Running Migrations](#running-migrations)
- [Rolling Back Migrations](#rolling-back-migrations)
- [Database Seeding](#database-seeding)

## Introduction

Migrations are a type of version control for your database. They allow a team to modify the database schema and stay up to date on the current schema state. Migrations are typically paired with the [Schema Builder](/docs/4.2/schema) to easily manage your application's schema.

## Creating Migrations

To create a migration, you may use the `migrate:make` command on the Artisan CLI:

	php artisan migrate:make create_users_table

The migration will be placed in your `app/database/migrations` folder, and will contain a timestamp which allows the framework to determine the order of the migrations.

You may also specify a `--path` option when creating the migration. The path should be relative to the root directory of your installation:

	php artisan migrate:make foo --path=app/migrations

The `--table` and `--create` options may also be used to indicate the name of the table, and whether the migration will be creating a new table:

	php artisan migrate:make add_votes_to_user_table --table=users

	php artisan migrate:make create_users_table --create=users

## Running Migrations

#### Running All Outstanding Migrations

	php artisan migrate

#### Running All Outstanding Migrations For A Path

	php artisan migrate --path=app/foo/migrations

#### Running All Outstanding Migrations For A Package

	php artisan migrate --package=vendor/package

> **Note:** If you receive a "class not found" error when running migrations, try running the `composer dump-autoload` command.

### Forcing Migrations In Production

Some migration operations are destructive, meaning they may cause you to lose data. In order to protect you from running these commands against your production database, you will prompted for confirmation before these commands are executed. To force the commands to run without a prompt, use the `--force` flag:

	php artisan migrate --force

## Rolling Back Migrations

#### Rollback The Last Migration Operation

	php artisan migrate:rollback

#### Rollback all migrations

	php artisan migrate:reset

#### Rollback all migrations and run them all again

	php artisan migrate:refresh

	php artisan migrate:refresh --seed

## Database Seeding

Laravel also includes a simple way to seed your database with test data using seed classes. All seed classes are stored in `app/database/seeds`. Seed classes may have any name you wish, but probably should follow some sensible convention, such as `UserTableSeeder`, etc. By default, a `DatabaseSeeder` class is defined for you. From this class, you may use the `call` method to run other seed classes, allowing you to control the seeding order.

#### Example Database Seed Class

	class DatabaseSeeder extends Seeder {

		public function run()
		{
			$this->call('UserTableSeeder');

			$this->command->info('User table seeded!');
		}

	}

	class UserTableSeeder extends Seeder {

		public function run()
		{
			DB::table('users')->delete();

			User::create(array('email' => 'foo@bar.com'));
		}

	}

To seed your database, you may use the `db:seed` command on the Artisan CLI:

	php artisan db:seed

By default, the `db:seed` command runs the `DatabaseSeeder` class, which may be used to call other seed classes. However, you may use the `--class` option to specify a specific seeder class to run individually:

	php artisan db:seed --class=UserTableSeeder

You may also seed your database using the `migrate:refresh` command, which will also rollback and re-run all of your migrations:

	php artisan migrate:refresh --seed


text:
'use strict';

var slice = Array.prototype.slice;
var tap = require('tap');
var exclusive = false;
var started = false;
var tests = [];

function assertNotStarted() {
	if (started) {
		throw new Error('already started, use disableAutoStart() to delay start');
	}
}

function test() {
	assertNotStarted();
	if (!exclusive) {
		tests.push(slice.call(arguments));
	}
}

function only() {
	assertNotStarted();
	if (!exclusive) {
		exclusive = true;
		tests = [];
	}
	tests.push(slice.call(arguments));
}

function skip() {
	assertNotStarted();
}

function start() {
	if (started) {
		throw new Error('already started. Can\'t start again');
	}
	tests.forEach(function (args) {
		tap.test.apply(tap, args);
	});
}

var timeout = setTimeout(start);

function disableAutoStart() {
	if (started) {
		throw new Error('already started. It is to late to disable');
	}
	clearTimeout(timeout);
}

module.exports = test;
module.exports.only = only;
module.exports.start = start;
module.exports.skip = skip;
module.exports.disableAutoStart = disableAutoStart;


text:
import express from 'express';
import path from 'path';
import open from 'open';

import webpack from 'webpack';
import config from '../webpack.config.dev';

/* eslint-disable no-console */

// Wee can assume that here should be production API

const port = 3000;
const app = express();
const compile = webpack(config);

app.use(require('webpack-dev-middleware')(compile, {
	noInfo: true,
	publicPath: config.output.publicPath
}));

app.get('/users', function (req, res) {
	res.json([
		{ "id": 1, "firstName": "Mark", "lastName": "Smith", "email": "em1@mail.com" },
		{ "id": 2, "firstName": "Adam", "lastName": "Olivier", "email": "em2@mail.com" },
		{ "id": 3, "firstName": "Cory", "lastName": "Tylor", "email": "em3@mail.com" }
	])
});

app.get('/', function (req, res) {
	res.sendFile(path.join(__dirname, '../src/index.html'));
});

app.listen(port, function (err) {
	if(err) {
		console.log('error', err);
	} else {
		open('http://localhost:' + port);
	}
});


text:
FROM ubuntu:precise

# REPOS
RUN apt-get -y update && locale-gen en_GB.UTF-8
RUN echo "Europe/London" | tee /etc/timezone; dpkg-reconfigure --frontend noninteractive tzdata
RUN apt-get install -y -q python-software-properties
# RUN add-apt-repository -y "deb http://archive.ubuntu.com/ubuntu $(lsb_release -sc) universe"
RUN add-apt-repository -y "deb http://archive.ubuntu.com/ubuntu $(lsb_release -sc) multiverse"
RUN add-apt-repository -y "deb http://archive.ubuntu.com/ubuntu $(lsb_release -sc)-updates multiverse"

RUN apt-get -y update

# BASICS
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y -q vim nano curl git subversion make wget build-essential g++ sendmail unzip logrotate

## APACHE
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y -q\
  apache2-mpm-worker libapache2-mod-fastcgi libapache2-modsecurity

RUN echo apache2-mpm-worker hold | dpkg --set-selections

## PHP
RUN add-apt-repository -y ppa:ondrej/php5; apt-get -y update
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y -q\
  openssh-server supervisor\
  cron\
  php5-fpm php5 php5-cli php5-dev php-pear php5-common php5-apcu\
  php5-mcrypt php5-gd php5-mysql php5-curl php5-json php5-intl\
  memcached php5-memcached\
  imagemagick graphicsmagick graphicsmagick-libmagick-dev-compat php5-imagick trimage

RUN pecl install memcache;
ADD ./config/php5/mods-available/memcache.ini /etc/php5/mods-available/memcache.ini
RUN /usr/sbin/php5enmod memcache

## CONFIG
# USER
RUN useradd -d /var/www/app --no-create-home --shell /bin/bash -g www-data -G adm user

# Apache + PHP-FPM
RUN a2enmod actions fastcgi alias headers deflate rewrite; a2dismod autoindex
RUN wget -q https://dl-ssl.google.com/dl/linux/direct/mod-pagespeed-stable_current_amd64.deb; dpkg -i mod-pagespeed-*.deb; apt-get -f install; rm mod-pagespeed-*.deb
ADD ./config/apache2/apache2.conf /etc/apache2/apache2.conf
ADD ./config/apache2/envvars /etc/apache2/envvars
ADD ./config/apache2/mods-enabled/mod-security.conf /etc/apache2/mods-enabled/mod-security.conf
ADD ./config/apache2/sites-available/default /etc/apache2/sites-available/default
ADD ./config/modsecurity/modsecurity.conf /etc/modsecurity/modsecurity.conf
ADD ./config/apache2/mods-enabled/pagespeed.conf /etc/apache2/mods-enabled/pagespeed.conf
RUN mkdir -p /var/log/app; chmod 664 /var/log/app/; chown user:www-data /var/log/app/; chown www-data: -R /var/lib/apache2/fastcgi

ENV APACHE_RUN_USER www-data
ENV APACHE_RUN_GROUP www-data

ADD ./config/php5/fpm/php.ini /etc/php5/fpm/php.ini
ADD ./config/php5/fpm/php-fpm.conf /etc/php5/fpm/php-fpm.conf
ADD ./config/php5/fpm/pool.d/www.conf /etc/php5/fpm/pool.d/www.conf
ADD ./config/php5/mods-available/opcache.ini /etc/php5/mods-available/opcache.ini

# Supervisord
RUN mkdir -p /var/log/supervisor

# SSH
ADD ./config/ssh/sshd_config /etc/ssh/sshd_config

ENV DEBIAN_FRONTEND=newt


text:
"use strict";

import { getAddress } from "@ethersproject/address";
import { BigNumber, BigNumberish } from "@ethersproject/bignumber";
import { arrayify, BytesLike, concat, hexDataSlice, hexlify, hexZeroPad, isHexString } from "@ethersproject/bytes";
import { id } from "@ethersproject/hash";
import { keccak256 } from "@ethersproject/keccak256"
import { defineReadOnly, Description, getStatic } from "@ethersproject/properties";

import { AbiCoder, defaultAbiCoder } from "./abi-coder";
import { checkResultErrors, Result } from "./coders/abstract-coder";
import { ConstructorFragment, ErrorFragment, EventFragment, FormatTypes, Fragment, FunctionFragment, JsonFragment, ParamType } from "./fragments";

import { Logger } from "@ethersproject/logger";
import { version } from "./_version";
const logger = new Logger(version);

export { checkResultErrors, Result };

export class LogDescription extends Description<LogDescription> {
    readonly eventFragment: EventFragment;
    readonly name: string;
    readonly signature: string;
    readonly topic: string;
    readonly args: Result
}

export class TransactionDescription extends Description<TransactionDescription> {
    readonly functionFragment: FunctionFragment;
    readonly name: string;
    readonly args: Result;
    readonly signature: string;
    readonly sighash: string;
    readonly value: BigNumber;
}

export class ErrorDescription extends Description<ErrorDescription> {
    readonly errorFragment: ErrorFragment;
    readonly name: string;
    readonly args: Result;
    readonly signature: string;
    readonly sighash: string;
}

export class Indexed extends Description<Indexed> {
    readonly hash: string;
    readonly _isIndexed: boolean;

    static isIndexed(value: any): value is Indexed {
        return !!(value && value._isIndexed);
    }
}

const BuiltinErrors: Record<string, { signature: string, inputs: Array<string>, name: string, reason?: boolean }> = {
    "0x08c379a0": { signature: "Error(string)", name: "Error", inputs: [ "string" ], reason: true },
    "0x4e487b71": { signature: "Panic(uint256)", name: "Panic", inputs: [ "uint256" ] }
}

function wrapAccessError(property: string, error: Error): Error {
    const wrap = new Error(`deferred error during ABI decoding triggered accessing ${ property }`);
    (<any>wrap).error = error;
    return wrap;
}

/*
function checkNames(fragment: Fragment, type: "input" | "output", params: Array<ParamType>): void {
    params.reduce((accum, param) => {
        if (param.name) {
            if (accum[param.name]) {
                logger.throwArgumentError(`duplicate ${ type } parameter ${ JSON.stringify(param.name) } in ${ fragment.format("full") }`, "fragment", fragment);
            }
            accum[param.name] = true;
        }
        return accum;
    }, <{ [ name: string ]: boolean }>{ });
}
*/
export class Interface {
    readonly fragments: ReadonlyArray<Fragment>;

    readonly errors: { [ name: string ]: ErrorFragment };
    readonly events: { [ name: string ]: EventFragment };
    readonly functions: { [ name: string ]: FunctionFragment };
    readonly structs: { [ name: string ]: any };

    readonly deploy: ConstructorFragment;

    readonly _abiCoder: AbiCoder;

    readonly _isInterface: boolean;

    constructor(fragments: string | ReadonlyArray<Fragment | JsonFragment | string>) {
        let abi: ReadonlyArray<Fragment | JsonFragment | string> = [ ];
        if (typeof(fragments) === "string") {
            abi = JSON.parse(fragments);
        } else {
            abi = fragments;
        }

        defineReadOnly(this, "fragments", abi.map((fragment) => {
            return Fragment.from(fragment);
        }).filter((fragment) => (fragment != null)));

        defineReadOnly(this, "_abiCoder", getStatic<() => AbiCoder>(new.target, "getAbiCoder")());

        defineReadOnly(this, "functions", { });
        defineReadOnly(this, "errors", { });
        defineReadOnly(this, "events", { });
        defineReadOnly(this, "structs", { });

        // Add all fragments by their signature
        this.fragments.forEach((fragment) => {
            let bucket: { [ name: string ]: Fragment } = null;
            switch (fragment.type) {
                case "constructor":
                    if (this.deploy) {
                        logger.warn("duplicate definition - constructor");
                        return;
                    }
                    //checkNames(fragment, "input", fragment.inputs);
                    defineReadOnly(this, "deploy", <ConstructorFragment>fragment);
                    return;
                case "function":
                    //checkNames(fragment, "input", fragment.inputs);
                    //checkNames(fragment, "output", (<FunctionFragment>fragment).outputs);
                    bucket = this.functions;
                    break;
                case "event":
                    //checkNames(fragment, "input", fragment.inputs);
                    bucket = this.events;
                    break;
                case "error":
                    bucket = this.errors;
                    break;
                default:
                    return;
            }

            let signature = fragment.format();
            if (bucket[signature]) {
                logger.warn("duplicate definition - " + signature);
                return;
            }

            bucket[signature] = fragment;
        });

        // If we do not have a constructor add a default
        if (!this.deploy) {
            defineReadOnly(this, "deploy", ConstructorFragment.from({
                payable: false,
                type: "constructor"
            }));
        }

        defineReadOnly(this, "_isInterface", true);
    }

    format(format?: string): string | Array<string> {
        if (!format) { format = FormatTypes.full; }
        if (format === FormatTypes.sighash) {
            logger.throwArgumentError("interface does not support formatting sighash", "format", format);
        }

        const abi = this.fragments.map((fragment) => fragment.format(format));

        // We need to re-bundle the JSON fragments a bit
        if (format === FormatTypes.json) {
             return JSON.stringify(abi.map((j) => JSON.parse(j)));
        }

        return abi;
    }

    // Sub-classes can override these to handle other blockchains
    static getAbiCoder(): AbiCoder {
        return defaultAbiCoder;
    }

    static getAddress(address: string): string {
        return getAddress(address);
    }

    static getSighash(fragment: ErrorFragment | FunctionFragment): string {
        return hexDataSlice(id(fragment.format()), 0, 4);
    }

    static getEventTopic(eventFragment: EventFragment): string {
        return id(eventFragment.format());
    }

    // Find a function definition by any means necessary (unless it is ambiguous)
    getFunction(nameOrSignatureOrSighash: string): FunctionFragment {
        if (isHexString(nameOrSignatureOrSighash)) {
            for (const name in this.functions) {
                if (nameOrSignatureOrSighash === this.getSighash(name)) {
                    return this.functions[name];
                }
            }
            logger.throwArgumentError("no matching function", "sighash", nameOrSignatureOrSighash);
        }

        // It is a bare name, look up the function (will return null if ambiguous)
        if (nameOrSignatureOrSighash.indexOf("(") === -1) {
            const name = nameOrSignatureOrSighash.trim();
            const matching = Object.keys(this.functions).filter((f) => (f.split("("/* fix:) */)[0] === name));
            if (matching.length === 0) {
                logger.throwArgumentError("no matching function", "name", name);
            } else if (matching.length > 1) {
                logger.throwArgumentError("multiple matching functions", "name", name);
            }

            return this.functions[matching[0]];
        }

        // Normalize the signature and lookup the function
        const result = this.functions[FunctionFragment.fromString(nameOrSignatureOrSighash).format()];
        if (!result) {
            logger.throwArgumentError("no matching function", "signature", nameOrSignatureOrSighash);
        }
        return result;
    }

    // Find an event definition by any means necessary (unless it is ambiguous)
    getEvent(nameOrSignatureOrTopic: string): EventFragment {
        if (isHexString(nameOrSignatureOrTopic)) {
            const topichash = nameOrSignatureOrTopic.toLowerCase();
            for (const name in this.events) {
                if (topichash === this.getEventTopic(name)) {
                    return this.events[name];
                }
            }
            logger.throwArgumentError("no matching event", "topichash", topichash);
        }

        // It is a bare name, look up the function (will return null if ambiguous)
        if (nameOrSignatureOrTopic.indexOf("(") === -1) {
            const name = nameOrSignatureOrTopic.trim();
            const matching = Object.keys(this.events).filter((f) => (f.split("("/* fix:) */)[0] === name));
            if (matching.length === 0) {
                logger.throwArgumentError("no matching event", "name", name);
            } else if (matching.length > 1) {
                logger.throwArgumentError("multiple matching events", "name", name);
            }

            return this.events[matching[0]];
        }

        // Normalize the signature and lookup the function
        const result = this.events[EventFragment.fromString(nameOrSignatureOrTopic).format()];
        if (!result) {
            logger.throwArgumentError("no matching event", "signature", nameOrSignatureOrTopic);
        }
        return result;
    }

    // Find a function definition by any means necessary (unless it is ambiguous)
    getError(nameOrSignatureOrSighash: string): ErrorFragment {
        if (isHexString(nameOrSignatureOrSighash)) {
            const getSighash = getStatic<(f: ErrorFragment | FunctionFragment) => string>(this.constructor, "getSighash");
            for (const name in this.errors) {
                const error = this.errors[name];
                if (nameOrSignatureOrSighash === getSighash(error)) {
                    return this.errors[name];
                }
            }
            logger.throwArgumentError("no matching error", "sighash", nameOrSignatureOrSighash);
        }

        // It is a bare name, look up the function (will return null if ambiguous)
        if (nameOrSignatureOrSighash.indexOf("(") === -1) {
            const name = nameOrSignatureOrSighash.trim();
            const matching = Object.keys(this.errors).filter((f) => (f.split("("/* fix:) */)[0] === name));
            if (matching.length === 0) {
                logger.throwArgumentError("no matching error", "name", name);
            } else if (matching.length > 1) {
                logger.throwArgumentError("multiple matching errors", "name", name);
            }

            return this.errors[matching[0]];
        }

        // Normalize the signature and lookup the function
        const result = this.errors[FunctionFragment.fromString(nameOrSignatureOrSighash).format()];
        if (!result) {
            logger.throwArgumentError("no matching error", "signature", nameOrSignatureOrSighash);
        }
        return result;
    }

    // Get the sighash (the bytes4 selector) used by Solidity to identify a function
    getSighash(fragment: ErrorFragment | FunctionFragment | string): string {
        if (typeof(fragment) === "string") {
            try {
                fragment = this.getFunction(fragment);
            } catch (error) {
                try {
                    fragment = this.getError(<string>fragment);
                } catch (_) {
                    throw error;
                }
            }
        }

        return getStatic<(f: ErrorFragment | FunctionFragment) => string>(this.constructor, "getSighash")(fragment);
    }

    // Get the topic (the bytes32 hash) used by Solidity to identify an event
    getEventTopic(eventFragment: EventFragment | string): string {
        if (typeof(eventFragment) === "string") {
            eventFragment = this.getEvent(eventFragment);
        }

        return getStatic<(e: EventFragment) => string>(this.constructor, "getEventTopic")(eventFragment);
    }

    _decodeParams(params: ReadonlyArray<ParamType>, data: BytesLike): Result {
        return this._abiCoder.decode(params, data)
    }

    _encodeParams(params: ReadonlyArray<ParamType>, values: ReadonlyArray<any>): string {
        return this._abiCoder.encode(params, values)
    }

    encodeDeploy(values?: ReadonlyArray<any>): string {
        return this._encodeParams(this.deploy.inputs, values || [ ]);
    }

    decodeErrorResult(fragment: ErrorFragment | string, data: BytesLike): Result {
        if (typeof(fragment) === "string") {
            fragment = this.getError(fragment);
        }

        const bytes = arrayify(data);

        if (hexlify(bytes.slice(0, 4)) !== this.getSighash(fragment)) {
            logger.throwArgumentError(`data signature does not match error ${ fragment.name }.`, "data", hexlify(bytes));
        }

        return this._decodeParams(fragment.inputs, bytes.slice(4));
    }

    encodeErrorResult(fragment: ErrorFragment | string, values?: ReadonlyArray<any>): string {
        if (typeof(fragment) === "string") {
            fragment = this.getError(fragment);
        }

        return hexlify(concat([
            this.getSighash(fragment),
            this._encodeParams(fragment.inputs, values || [ ])
        ]));
    }

    // Decode the data for a function call (e.g. tx.data)
    decodeFunctionData(functionFragment: FunctionFragment | string, data: BytesLike): Result {
        if (typeof(functionFragment) === "string") {
            functionFragment = this.getFunction(functionFragment);
        }

        const bytes = arrayify(data);

        if (hexlify(bytes.slice(0, 4)) !== this.getSighash(functionFragment)) {
            logger.throwArgumentError(`data signature does not match function ${ functionFragment.name }.`, "data", hexlify(bytes));
        }

        return this._decodeParams(functionFragment.inputs, bytes.slice(4));
    }

    // Encode the data for a function call (e.g. tx.data)
    encodeFunctionData(functionFragment: FunctionFragment | string, values?: ReadonlyArray<any>): string {
        if (typeof(functionFragment) === "string") {
            functionFragment = this.getFunction(functionFragment);
        }

        return hexlify(concat([
            this.getSighash(functionFragment),
            this._encodeParams(functionFragment.inputs, values || [ ])
        ]));
    }

    // Decode the result from a function call (e.g. from eth_call)
    decodeFunctionResult(functionFragment: FunctionFragment | string, data: BytesLike): Result {
        if (typeof(functionFragment) === "string") {
            functionFragment = this.getFunction(functionFragment);
        }

        let bytes = arrayify(data);

        let reason: string = null;
        let message = "";
        let errorArgs: Result = null;
        let errorName: string = null;
        let errorSignature: string = null;
        switch (bytes.length % this._abiCoder._getWordSize()) {
            case 0:
                try {
                    return this._abiCoder.decode(functionFragment.outputs, bytes);
                } catch (error) { }
                break;

            case 4: {
                const selector = hexlify(bytes.slice(0, 4));
                const builtin = BuiltinErrors[selector];
                if (builtin) {
                    errorArgs = this._abiCoder.decode(builtin.inputs, bytes.slice(4));
                    errorName = builtin.name;
                    errorSignature = builtin.signature;
                    if (builtin.reason) { reason = errorArgs[0]; }
                    if (errorName === "Error") {
                        message = `; VM Exception while processing transaction: reverted with reason string ${ JSON.stringify(errorArgs[0]) }`;
                    } else if (errorName === "Panic") {
                        message = `; VM Exception while processing transaction: reverted with panic code ${ errorArgs[0] }`;
                    }
                } else {
                    try {
                        const error = this.getError(selector);
                        errorArgs = this._abiCoder.decode(error.inputs, bytes.slice(4));
                        errorName = error.name;
                        errorSignature = error.format();
                    } catch (error) { }
                }
                break;
            }
        }

        return logger.throwError("call revert exception" + message, Logger.errors.CALL_EXCEPTION, {
            method: functionFragment.format(),
            data: hexlify(data), errorArgs, errorName, errorSignature, reason
        });
    }

    // Encode the result for a function call (e.g. for eth_call)
    encodeFunctionResult(functionFragment: FunctionFragment | string, values?: ReadonlyArray<any>): string {
        if (typeof(functionFragment) === "string") {
            functionFragment = this.getFunction(functionFragment);
        }

        return hexlify(this._abiCoder.encode(functionFragment.outputs, values || [ ]));
    }

    // Create the filter for the event with search criteria (e.g. for eth_filterLog)
    encodeFilterTopics(eventFragment: EventFragment | string, values: ReadonlyArray<any>): Array<string | Array<string>> {
        if (typeof(eventFragment) === "string") {
            eventFragment = this.getEvent(eventFragment);
        }

        if (values.length > eventFragment.inputs.length) {
            logger.throwError("too many arguments for " + eventFragment.format(), Logger.errors.UNEXPECTED_ARGUMENT, {
                argument: "values",
                value: values
            })
        }

        let topics: Array<string | Array<string>> = [];
        if (!eventFragment.anonymous) { topics.push(this.getEventTopic(eventFragment)); }

        const encodeTopic = (param: ParamType, value: any): string => {
            if (param.type === "string") {
                 return id(value);
            } else if (param.type === "bytes") {
                 return keccak256(hexlify(value));
            }

            if (param.type === "bool" && typeof(value) === "boolean") {
                value = (value ? "0x01": "0x00");
            }

            if (param.type.match(/^u?int/)) {
                value = BigNumber.from(value).toHexString();
            }

            // Check addresses are valid
            if (param.type === "address") { this._abiCoder.encode( [ "address" ], [ value ]); }
            return hexZeroPad(hexlify(value), 32);
        };

        values.forEach((value, index) => {

            let param = (<EventFragment>eventFragment).inputs[index];

            if (!param.indexed) {
                if (value != null) {
                    logger.throwArgumentError("cannot filter non-indexed parameters; must be null", ("contract." + param.name), value);
                }
                return;
            }

            if (value == null) {
                topics.push(null);
            } else if (param.baseType === "array" || param.baseType === "tuple") {
                logger.throwArgumentError("filtering with tuples or arrays not supported", ("contract." + param.name), value);
            } else if (Array.isArray(value)) {
                topics.push(value.map((value) => encodeTopic(param, value)));
            } else {
                topics.push(encodeTopic(param, value));
            }
        });

        // Trim off trailing nulls
        while (topics.length && topics[topics.length - 1] === null) {
            topics.pop();
        }

        return topics;
    }

    encodeEventLog(eventFragment: EventFragment | string, values: ReadonlyArray<any>): { data: string, topics: Array<string> } {
        if (typeof(eventFragment) === "string") {
            eventFragment = this.getEvent(eventFragment);
        }

        const topics: Array<string> = [ ];

        const dataTypes: Array<ParamType> = [ ];
        const dataValues: Array<string> = [ ];

        if (!eventFragment.anonymous) {
            topics.push(this.getEventTopic(eventFragment));
        }

        if (values.length !== eventFragment.inputs.length) {
            logger.throwArgumentError("event arguments/values mismatch", "values", values);
        }

        eventFragment.inputs.forEach((param, index) => {
            const value = values[index];
            if (param.indexed) {
                if (param.type === "string") {
                    topics.push(id(value))
                } else if (param.type === "bytes") {
                    topics.push(keccak256(value))
                } else if (param.baseType === "tuple" || param.baseType === "array") {
                    // @TODO
                    throw new Error("not implemented");
                } else {
                    topics.push(this._abiCoder.encode([ param.type] , [ value ]));
                }
            } else {
                dataTypes.push(param);
                dataValues.push(value);
            }
        });

        return {
            data: this._abiCoder.encode(dataTypes , dataValues),
            topics: topics
        };
    }

    // Decode a filter for the event and the search criteria
    decodeEventLog(eventFragment: EventFragment | string, data: BytesLike, topics?: ReadonlyArray<string>): Result {
        if (typeof(eventFragment) === "string") {
            eventFragment = this.getEvent(eventFragment);
        }

        if (topics != null && !eventFragment.anonymous) {
            let topicHash = this.getEventTopic(eventFragment);
            if (!isHexString(topics[0], 32) || topics[0].toLowerCase() !== topicHash) {
                logger.throwError("fragment/topic mismatch", Logger.errors.INVALID_ARGUMENT, { argument: "topics[0]", expected: topicHash, value: topics[0] });
            }
            topics = topics.slice(1);
        }

        let indexed: Array<ParamType> = [];
        let nonIndexed: Array<ParamType> = [];
        let dynamic: Array<boolean> = [];

        eventFragment.inputs.forEach((param, index) => {
            if (param.indexed) {
                if (param.type === "string" || param.type === "bytes" || param.baseType === "tuple" || param.baseType === "array") {
                    indexed.push(ParamType.fromObject({ type: "bytes32", name: param.name }));
                    dynamic.push(true);
                } else {
                    indexed.push(param);
                    dynamic.push(false);
                }
            } else {
                nonIndexed.push(param);
                dynamic.push(false);
            }
        });

        let resultIndexed = (topics != null) ? this._abiCoder.decode(indexed, concat(topics)): null;
        let resultNonIndexed = this._abiCoder.decode(nonIndexed, data, true);

        let result: (Array<any> & { [ key: string ]: any }) = [ ];
        let nonIndexedIndex = 0, indexedIndex = 0;
        eventFragment.inputs.forEach((param, index) => {
            if (param.indexed) {
                if (resultIndexed == null) {
                    result[index] = new Indexed({ _isIndexed: true, hash: null });

                } else if (dynamic[index]) {
                    result[index] = new Indexed({ _isIndexed: true, hash: resultIndexed[indexedIndex++] });

                } else {
                    try {
                        result[index] = resultIndexed[indexedIndex++];
                    } catch (error) {
                        result[index] = error;
                    }
                }
            } else {
                try {
                    result[index] = resultNonIndexed[nonIndexedIndex++];
                } catch (error) {
                    result[index] = error;
                }
            }

            // Add the keyword argument if named and safe
            if (param.name && result[param.name] == null) {
                const value = result[index];

                // Make error named values throw on access
                if (value instanceof Error) {
                    Object.defineProperty(result, param.name, {
                        enumerable: true,
                        get: () => { throw wrapAccessError(`property ${ JSON.stringify(param.name) }`, value); }
                    });
                } else {
                    result[param.name] = value;
                }
            }
        });

        // Make all error indexed values throw on access
        for (let i = 0; i < result.length; i++) {
            const value = result[i];
            if (value instanceof Error) {
                Object.defineProperty(result, i, {
                    enumerable: true,
                    get: () => { throw wrapAccessError(`index ${ i }`, value); }
                });
            }
        }

        return Object.freeze(result);
    }

    // Given a transaction, find the matching function fragment (if any) and
    // determine all its properties and call parameters
    parseTransaction(tx: { data: string, value?: BigNumberish }): TransactionDescription {
        let fragment = this.getFunction(tx.data.substring(0, 10).toLowerCase())

        if (!fragment) { return null; }

        return new TransactionDescription({
            args: this._abiCoder.decode(fragment.inputs, "0x" + tx.data.substring(10)),
            functionFragment: fragment,
            name: fragment.name,
            signature: fragment.format(),
            sighash: this.getSighash(fragment),
            value: BigNumber.from(tx.value || "0"),
        });
    }

    // @TODO
    //parseCallResult(data: BytesLike): ??

    // Given an event log, find the matching event fragment (if any) and
    // determine all its properties and values
    parseLog(log: { topics: Array<string>, data: string}): LogDescription {
        let fragment = this.getEvent(log.topics[0]);

        if (!fragment || fragment.anonymous) { return null; }

        // @TODO: If anonymous, and the only method, and the input count matches, should we parse?
        //        Probably not, because just because it is the only event in the ABI does
        //        not mean we have the full ABI; maybe just a fragment?

       return new LogDescription({
            eventFragment: fragment,
            name: fragment.name,
            signature: fragment.format(),
            topic: this.getEventTopic(fragment),
            args: this.decodeEventLog(fragment, log.data, log.topics)
        });
    }

    parseError(data: BytesLike): ErrorDescription {
        const hexData = hexlify(data);
        let fragment = this.getError(hexData.substring(0, 10).toLowerCase())

        if (!fragment) { return null; }

        return new ErrorDescription({
            args: this._abiCoder.decode(fragment.inputs, "0x" + hexData.substring(10)),
            errorFragment: fragment,
            name: fragment.name,
            signature: fragment.format(),
            sighash: this.getSighash(fragment),
        });
    }

    /*
    static from(value: Array<Fragment | string | JsonAbi> | string | Interface) {
        if (Interface.isInterface(value)) {
            return value;
        }
        if (typeof(value) === "string") {
            return new Interface(JSON.parse(value));
        }
        return new Interface(value);
    }
    */

    static isInterface(value: any): value is Interface {
        return !!(value && value._isInterface);
    }
}


text:
<?php

namespace Application\Abstracts;
use \Zend\Mvc\Controller\AbstractActionController;

abstract class BaseController extends AbstractActionController{

    public function setService($name, $service){
        $this->{$name} = $service;
    }

}


text:
<settings>
    <servers>
        <server>
            <id>ossrh</id>
            <username>${env.JIRA_USERNAME}</username>
            <password>${env.JIRA_PASSWORD}</password>
        </server>
    </servers>

    <profiles>
        <profile>
            <id>ossrh</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <properties>
                <gpg.executable>gpg</gpg.executable>
                <gpg.passphrase>${env.GPG_PASSPHRASE}</gpg.passphrase>
            </properties>
        </profile>
    </profiles>
</settings>


text:
<html>
<head></head>
<body>
<script>
	var port = location.hash.substr(1);
	location.href = "http://localhost:" + port;
</script>
</body>
</html>


text:
package org.testcontainers;

import com.github.dockerjava.api.DockerClient;
import com.github.dockerjava.api.command.CreateContainerCmd;
import com.github.dockerjava.api.exception.InternalServerErrorException;
import com.github.dockerjava.api.exception.NotFoundException;
import com.github.dockerjava.api.model.Image;
import com.github.dockerjava.api.model.Info;
import com.github.dockerjava.api.model.Version;
import com.github.dockerjava.core.command.PullImageResultCallback;

import lombok.Synchronized;
import lombok.extern.slf4j.Slf4j;
import org.testcontainers.dockerclient.*;
import org.testcontainers.utility.TestcontainersConfiguration;

import java.util.List;
import java.util.Optional;
import java.util.function.BiFunction;
import java.util.function.Consumer;

import static java.util.Arrays.asList;

/**
 * Singleton class that provides initialized Docker clients.
 * <p>
 * The correct client configuration to use will be determined on first use, and cached thereafter.
 */
@Slf4j
public class DockerClientFactory {

    private static final String TINY_IMAGE = TestcontainersConfiguration.getInstance().getTinyImage();
    private static DockerClientFactory instance;

    // Cached client configuration
    private DockerClientProviderStrategy strategy;
    private boolean preconditionsChecked = false;

    private static final List<DockerClientProviderStrategy> CONFIGURATION_STRATEGIES =
            asList(new EnvironmentAndSystemPropertyClientProviderStrategy(),
                    new UnixSocketClientProviderStrategy(),
                    new ProxiedUnixSocketClientProviderStrategy(),
                    new DockerMachineClientProviderStrategy(),
                    new WindowsClientProviderStrategy());
    private String activeApiVersion;
    private String activeExecutionDriver;

    static {
        System.setProperty("org.testcontainers.shaded.io.netty.packagePrefix", "org.testcontainers.shaded.");
    }

    /**
     * Private constructor
     */
    private DockerClientFactory() {

    }

    /**
     * Obtain an instance of the DockerClientFactory.
     *
     * @return the singleton instance of DockerClientFactory
     */
    public synchronized static DockerClientFactory instance() {
        if (instance == null) {
            instance = new DockerClientFactory();
        }

        return instance;
    }

    /**
     *
     * @return a new initialized Docker client
     */
    @Synchronized
    public DockerClient client() {

        if (strategy != null) {
            return strategy.getClient();
        }

        strategy = DockerClientProviderStrategy.getFirstValidStrategy(CONFIGURATION_STRATEGIES);

        log.info("Docker host IP address is {}", strategy.getDockerHostIpAddress());
        DockerClient client = strategy.getClient();

        if (!preconditionsChecked) {
            Info dockerInfo = client.infoCmd().exec();
            Version version = client.versionCmd().exec();
            activeApiVersion = version.getApiVersion();
            activeExecutionDriver = dockerInfo.getExecutionDriver();
            log.info("Connected to docker: \n" +
                    "  Server Version: " + dockerInfo.getServerVersion() + "\n" +
                    "  API Version: " + activeApiVersion + "\n" +
                    "  Operating System: " + dockerInfo.getOperatingSystem() + "\n" +
                    "  Total Memory: " + dockerInfo.getMemTotal() / (1024 * 1024) + " MB");

            checkVersion(version.getVersion());
            checkDiskSpaceAndHandleExceptions(client);
            preconditionsChecked = true;
        }

        return client;
    }

  /**
   * Check whether the image is available locally and pull it otherwise
   */
    private void checkAndPullImage(DockerClient client, String image) {
        List<Image> images = client.listImagesCmd().withImageNameFilter(image).exec();
        if (images.isEmpty()) {
            client.pullImageCmd(image).exec(new PullImageResultCallback()).awaitSuccess();
        }
    }

    /**
     * @return the IP address of the host running Docker
     */
    public String dockerHostIpAddress() {
        return strategy.getDockerHostIpAddress();
    }

    private void checkVersion(String version) {
        String[] splitVersion = version.split("\\.");
        if (Integer.valueOf(splitVersion[0]) <= 1 && Integer.valueOf(splitVersion[1]) < 6) {
            throw new IllegalStateException("Docker version 1.6.0+ is required, but version " + version + " was found");
        }
    }

    private void checkDiskSpaceAndHandleExceptions(DockerClient client) {
        try {
            checkDiskSpace(client);
        } catch (NotEnoughDiskSpaceException e) {
            throw e;
        } catch (Exception e) {
            log.warn("Encountered and ignored error while checking disk space", e);
        }
    }

    /**
     * Check whether this docker installation is likely to have disk space problems
     * @param client an active Docker client
     */
    private void checkDiskSpace(DockerClient client) {
        DiskSpaceUsage df = runInsideDocker(client, cmd -> cmd.withCmd("df", "-P"), (dockerClient, id) -> {
                String logResults = dockerClient.logContainerCmd(id)
                    .withStdOut(true)
                    .exec(new LogToStringContainerCallback())
                    .toString();

                return parseAvailableDiskSpace(logResults);
        });

        log.info("Disk utilization in Docker environment is {} ({} )",
            df.usedPercent.map(x -> x + "%").orElse("unknown"),
            df.availableMB.map(x -> x + " MB available").orElse("unknown available"));

        if (df.availableMB.map(it -> it < 2048).orElse(false)) {
            log.error("Docker environment has less than 2GB free - execution is unlikely to succeed so will be aborted.");
            throw new NotEnoughDiskSpaceException("Not enough disk space in Docker environment");
        }
    }

    public <T> T runInsideDocker(Consumer<CreateContainerCmd> createContainerCmdConsumer, BiFunction<DockerClient, String, T> block) {
        if (strategy == null) {
            client();
        }
        // We can't use client() here because it might create an infinite loop
        return runInsideDocker(strategy.getClient(), createContainerCmdConsumer, block);
    }

    private <T> T runInsideDocker(DockerClient client, Consumer<CreateContainerCmd> createContainerCmdConsumer, BiFunction<DockerClient, String, T> block) {
        checkAndPullImage(client, TINY_IMAGE);
        CreateContainerCmd createContainerCmd = client.createContainerCmd(TINY_IMAGE);
        createContainerCmdConsumer.accept(createContainerCmd);
        String id = createContainerCmd.exec().getId();

        client.startContainerCmd(id).exec();

        try {
            return block.apply(client, id);
        } finally {
            try {
                client.removeContainerCmd(id).withRemoveVolumes(true).withForce(true).exec();
            } catch (NotFoundException | InternalServerErrorException ignored) {
                log.debug("", ignored);
            }
        }
    }

    private static class DiskSpaceUsage {
        Optional<Integer> availableMB = Optional.empty();
        Optional<Integer> usedPercent = Optional.empty();
    }

    private DiskSpaceUsage parseAvailableDiskSpace(String dfOutput) {
        DiskSpaceUsage df = new DiskSpaceUsage();
        String[] lines = dfOutput.split("\n");
        for (String line : lines) {
            String[] fields = line.split("\\s+");
            if (fields[5].equals("/")) {
                int availableKB = Integer.valueOf(fields[3]);
                df.availableMB = Optional.of(availableKB / 1024);
                df.usedPercent = Optional.of(Integer.valueOf(fields[4].replace("%", "")));
            }
        }
        return df;
    }

    /**
     * @return the docker API version of the daemon that we have connected to
     */
    public String getActiveApiVersion() {
        if (!preconditionsChecked) {
            client();
        }
        return activeApiVersion;
    }

    /**
     * @return the docker execution driver of the daemon that we have connected to
     */
    public String getActiveExecutionDriver() {
        if (!preconditionsChecked) {
            client();
        }
        return activeExecutionDriver;
    }

    /**
     * @param providerStrategyClass a class that extends {@link DockerMachineClientProviderStrategy}
     * @return whether or not the currently active strategy is of the provided type
     */
    public boolean isUsing(Class<? extends DockerClientProviderStrategy> providerStrategyClass) {
        return providerStrategyClass.isAssignableFrom(this.strategy.getClass());
    }

    private static class NotEnoughDiskSpaceException extends RuntimeException {
        NotEnoughDiskSpaceException(String message) {
            super(message);
        }
    }
}


text:
<!DOCTYPE html>

    <meta http-equiv="refresh" content="0;URL=type.U446.html">

Redirecting to type.U446.html...


text:
package com.facebook.buck.parser;

import static com.facebook.buck.util.concurrent.MoreFutures.propagateCauseIfInstanceOf;
import static com.google.common.base.Throwables.throwIfInstanceOf;

import com.facebook.buck.core.cell.Cell;
import com.facebook.buck.core.exceptions.DependencyStack;
import com.facebook.buck.core.model.BuildTarget;
import com.facebook.buck.core.model.UnconfiguredBuildTarget;
import com.facebook.buck.core.model.targetgraph.TargetNode;
import com.facebook.buck.parser.exceptions.BuildFileParseException;
import com.facebook.buck.parser.exceptions.BuildTargetException;
import com.google.common.util.concurrent.ListenableFuture;
import com.google.common.util.concurrent.UncheckedExecutionException;
import java.util.concurrent.ExecutionException;

/**
 * Abstract node parsing pipeline. Allows implementors to define their own logic for creating nodes
 * of type T.
 *
 * @param <T> The type of node this pipeline will produce (raw nodes, target nodes, etc)
 */
public interface BuildTargetParsePipeline<T> extends AutoCloseable {

  /**
   * Obtain a {@link TargetNode}. This may block if the node is not cached.
   *
   * @param cell the {@link Cell} that the {@link BuildTarget} belongs to.
   * @param buildTarget name of the node we're looking for. The build file path is derived from it.
   * @return the node
   * @throws BuildFileParseException for syntax errors in the build file.
   * @throws BuildTargetException if the buildTarget is malformed
   */
  default T getNode(Cell cell, UnconfiguredBuildTarget buildTarget, DependencyStack dependencyStack)
      throws BuildFileParseException, BuildTargetException {
    try {
      return getNodeJob(cell, buildTarget, dependencyStack).get();
    } catch (Exception e) {
      if (e.getCause() != null) {
        throwIfInstanceOf(e.getCause(), BuildFileParseException.class);
        throwIfInstanceOf(e.getCause(), BuildTargetException.class);
      }
      throwIfInstanceOf(e, BuildFileParseException.class);
      throwIfInstanceOf(e, BuildTargetException.class);
      propagateCauseIfInstanceOf(e, ExecutionException.class);
      propagateCauseIfInstanceOf(e, UncheckedExecutionException.class);
      throw new RuntimeException(e);
    }
  }

  /**
   * Asynchronously get the {@link TargetNode}. This leverages the cache.
   *
   * @param cell the {@link Cell} that the build file belongs to.
   * @param buildTarget name of the node we're looking for. The build file path is derived from it.
   * @return future.
   * @throws BuildTargetException when the buildTarget is malformed.
   */
  ListenableFuture<T> getNodeJob(
      Cell cell, UnconfiguredBuildTarget buildTarget, DependencyStack dependencyStack)
      throws BuildTargetException;
}


text:
namespace content {

// Lives on the UI thread.
class CONTENT_EXPORT PaymentAppProviderImpl
    : public PaymentAppProvider,
      public WebContentsUserData<PaymentAppProviderImpl> {
 public:
  ~PaymentAppProviderImpl() override;
  static PaymentAppProviderImpl* GetOrCreateForWebContents(
      WebContents* payment_request_web_contents);

  // Disallow copy and assign.
  PaymentAppProviderImpl(const PaymentAppProviderImpl& other) = delete;
  PaymentAppProviderImpl& operator=(const PaymentAppProviderImpl& other) =
      delete;

  // PaymentAppProvider implementation:
  void InvokePaymentApp(int64_t registration_id,
                        const url::Origin& sw_origin,
                        payments::mojom::PaymentRequestEventDataPtr event_data,
                        InvokePaymentAppCallback callback) override;
  void InstallAndInvokePaymentApp(
      payments::mojom::PaymentRequestEventDataPtr event_data,
      const std::string& app_name,
      const SkBitmap& app_icon,
      const GURL& sw_js_url,
      const GURL& sw_scope,
      bool sw_use_cache,
      const std::string& method,
      const SupportedDelegations& supported_delegations,
      RegistrationIdCallback registration_id_callback,
      InvokePaymentAppCallback callback) override;
  void UpdatePaymentAppIcon(int64_t registration_id,
                            const std::string& instrument_key,
                            const std::string& name,
                            const std::string& string_encoded_icon,
                            const std::string& method_name,
                            const SupportedDelegations& supported_delegations,
                            UpdatePaymentAppIconCallback callback) override;
  void CanMakePayment(int64_t registration_id,
                      const url::Origin& sw_origin,
                      const std::string& payment_request_id,
                      payments::mojom::CanMakePaymentEventDataPtr event_data,
                      CanMakePaymentCallback callback) override;
  void AbortPayment(int64_t registration_id,
                    const url::Origin& sw_origin,
                    const std::string& payment_request_id,
                    AbortCallback callback) override;
  void SetOpenedWindow(WebContents* payment_handler_web_contents) override;
  void CloseOpenedWindow() override;
  void OnClosingOpenedWindow(
      payments::mojom::PaymentEventResponseType reason) override;

 private:
  explicit PaymentAppProviderImpl(WebContents* payment_request_web_contents);
  friend class WebContentsUserData<PaymentAppProviderImpl>;
  WEB_CONTENTS_USER_DATA_KEY_DECL();

  scoped_refptr<DevToolsBackgroundServicesContextImpl> GetDevTools(
      const url::Origin& sw_origin);
  void StartServiceWorkerForDispatch(
      int64_t registration_id,
      PaymentEventDispatcher::ServiceWorkerStartCallback callback);
  void OnInstallPaymentApp(
      const url::Origin& sw_origin,
      payments::mojom::PaymentRequestEventDataPtr event_data,
      RegistrationIdCallback registration_id_callback,
      InvokePaymentAppCallback callback,
      int64_t registration_id);

  // The opened window's web contents.
  base::WeakPtr<WebContents> payment_handler_window_;

  // Owns this object.
  raw_ptr<WebContents> payment_request_web_contents_;

  std::unique_ptr<PaymentEventDispatcher> event_dispatcher_;

  base::WeakPtrFactory<PaymentAppProviderImpl> weak_ptr_factory_{this};
};

}  // namespace content

#endif  // CONTENT_BROWSER_PAYMENTS_PAYMENT_APP_PROVIDER_IMPL_H_


text:
<?php

namespace ZendGData\YouTube\Extension;

/**
 * Represents the yt:recorded element
 *
 * @category   Zend
 * @package    ZendGData
 * @subpackage YouTube
 */
class Recorded extends \ZendGData\Extension
{

    protected $_rootElement = 'recorded';
    protected $_rootNamespace = 'yt';

    public function __construct($text = null)
    {
        $this->registerAllNamespaces(\ZendGData\YouTube::$namespaces);
        parent::__construct();
        $this->_text = $text;
    }

}


text:
{tp:access action='add'}
 添加
{/tp:access}

{tp:access action='delete'}
 删除
{/tp:access}

{tp:access action='forbid'}
 批量导入
{/tp:access}

<form action="{:\\think\\Url::build(\'export\')}" target="_blank" method="post">
    <button class="btn btn-success ml-5" style="margin-left:280px;margin-top:-55px" type="submit">导出Excel</button>
</form>


text:
using FlaUI.Core.AutomationElements.Infrastructure;
using FlaUI.Core.Identifiers;
using FlaUI.UIA3.Identifiers;

namespace FlaUI.UIA3
{
    public class UIA3AutomationElementPropertyIds : IAutomationElementPropertyIds
    {
        public PropertyId AcceleratorKey => AutomationObjectIds.AcceleratorKeyProperty;
        public PropertyId AccessKey => AutomationObjectIds.AccessKeyProperty;
        public PropertyId AnnotationObjects => AutomationObjectIds.AnnotationObjectsProperty;
        public PropertyId AnnotationTypes => AutomationObjectIds.AnnotationTypesProperty;
        public PropertyId AriaProperties => AutomationObjectIds.AriaPropertiesProperty;
        public PropertyId AriaRole => AutomationObjectIds.AriaRoleProperty;
        public PropertyId AutomationId => AutomationObjectIds.AutomationIdProperty;
        public PropertyId BoundingRectangle => AutomationObjectIds.BoundingRectangleProperty;
        public PropertyId CenterPoint => AutomationObjectIds.CenterPointProperty;
        public PropertyId ClassName => AutomationObjectIds.ClassNameProperty;
        public PropertyId ClickablePoint => AutomationObjectIds.ClickablePointProperty;
        public PropertyId ControllerFor => AutomationObjectIds.ControllerForProperty;
        public PropertyId ControlType => AutomationObjectIds.ControlTypeProperty;
        public PropertyId Culture => AutomationObjectIds.CultureProperty;
        public PropertyId DescribedBy => AutomationObjectIds.DescribedByProperty;
        public PropertyId FillColor => AutomationObjectIds.FillColorProperty;
        public PropertyId FillType => AutomationObjectIds.FillTypeProperty;
        public PropertyId FlowsFrom => AutomationObjectIds.FlowsFromProperty;
        public PropertyId FlowsTo => AutomationObjectIds.FlowsToProperty;
        public PropertyId FrameworkId => AutomationObjectIds.FrameworkIdProperty;
        public PropertyId FullDescription => AutomationObjectIds.FullDescriptionProperty;
        public PropertyId HasKeyboardFocus => AutomationObjectIds.HasKeyboardFocusProperty;
        public PropertyId HeadingLevel => AutomationObjectIds.HeadingLevelProperty;
        public PropertyId HelpText => AutomationObjectIds.HelpTextProperty;
        public PropertyId IsContentElement => AutomationObjectIds.IsContentElementProperty;
        public PropertyId IsControlElement => AutomationObjectIds.IsControlElementProperty;
        public PropertyId IsDataValidForForm => AutomationObjectIds.IsDataValidForFormProperty;
        public PropertyId IsDialog => AutomationObjectIds.IsDialogProperty;
        public PropertyId IsEnabled => AutomationObjectIds.IsEnabledProperty;
        public PropertyId IsKeyboardFocusable => AutomationObjectIds.IsKeyboardFocusableProperty;
        public PropertyId IsOffscreen => AutomationObjectIds.IsOffscreenProperty;
        public PropertyId IsPassword => AutomationObjectIds.IsPasswordProperty;
        public PropertyId IsPeripheral => AutomationObjectIds.IsPeripheralProperty;
        public PropertyId IsRequiredForForm => AutomationObjectIds.IsRequiredForFormProperty;
        public PropertyId ItemStatus => AutomationObjectIds.ItemStatusProperty;
        public PropertyId ItemType => AutomationObjectIds.ItemTypeProperty;
        public PropertyId LabeledBy => AutomationObjectIds.LabeledByProperty;
        public PropertyId LandmarkType => AutomationObjectIds.LandmarkTypeProperty;
        public PropertyId Level => AutomationObjectIds.LevelProperty;
        public PropertyId LiveSetting => AutomationObjectIds.LiveSettingProperty;
        public PropertyId LocalizedControlType => AutomationObjectIds.LocalizedControlTypeProperty;
        public PropertyId LocalizedLandmarkType => AutomationObjectIds.LocalizedLandmarkTypeProperty;
        public PropertyId Name => AutomationObjectIds.NameProperty;
        public PropertyId NativeWindowHandle => AutomationObjectIds.NativeWindowHandleProperty;
        public PropertyId OptimizeForVisualContent => AutomationObjectIds.OptimizeForVisualContentProperty;
        public PropertyId Orientation => AutomationObjectIds.OrientationProperty;
        public PropertyId OutlineColor => AutomationObjectIds.OutlineColorProperty;
        public PropertyId OutlineThickness => AutomationObjectIds.OutlineThicknessProperty;
        public PropertyId PositionInSet => AutomationObjectIds.PositionInSetProperty;
        public PropertyId ProcessId => AutomationObjectIds.ProcessIdProperty;
        public PropertyId ProviderDescription => AutomationObjectIds.ProviderDescriptionProperty;
        public PropertyId Rotation => AutomationObjectIds.RotationProperty;
        public PropertyId RuntimeId => AutomationObjectIds.RuntimeIdProperty;
        public PropertyId Size => AutomationObjectIds.SizeProperty;
        public PropertyId SizeOfSet => AutomationObjectIds.SizeOfSetProperty;
        public PropertyId VisualEffects => AutomationObjectIds.VisualEffectsProperty;
    }
}


text:
const { watch } = require('fs');
const { dirname } = require('path');

watch(dirname(window.require.resolve('../widgets')), { recursive: true }, () => {
  window.location.reload();
});

watch(dirname(window.require.resolve('../source-providers')), { recursive: true }, () => {
  window.location.reload();
});


text:
from heronpy.api.stream import Grouping

from integration_test.src.python.integration_test.core import TestTopologyBuilder
from integration_test.src.python.integration_test.common.bolt import IdentityBolt
from integration_test.src.python.integration_test.common.spout import ABSpout

def multi_spouts_multi_tasks_builder(topology_name, http_server_url):
  builder = TestTopologyBuilder(topology_name, http_server_url)
  spout_1 = builder.add_spout("ab-spout-1", ABSpout, 3)
  spout_2 = builder.add_spout("ab-spout-2", ABSpout, 3)

  builder.add_bolt("identity-bolt", IdentityBolt,
                   inputs={spout_1: Grouping.SHUFFLE,
                           spout_2: Grouping.SHUFFLE},
                   par=1,
                   optional_outputs=['word'])

  return builder.create_topology()


text:
..
..
.. Licensed under the Apache License, Version 2.0 (the "License");
.. you may not use this file except in compliance with the License.
.. You may obtain a copy of the License at
..
..     http://www.apache.org/licenses/LICENSE-2.0
..
.. Unless required by applicable law or agreed to in writing, software
.. distributed under the License is distributed on an "AS IS" BASIS,
.. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
.. See the License for the specific language governing permissions and
.. limitations under the License.
..

.. _to-api-cdns-id:

***************
``cdns/{{ID}}``
***************

``PUT``
=======
Allows a user to edit a specific CDN

:Auth. Required: Yes
:Roles Required: "admin" or "operations"
:Response Type:  Object

Request Structure
-----------------
.. table:: Request Path Parameters

	+------+---------------------------------------------------+
	| Name |                Description                        |
	+======+===================================================+
	|  ID  | Integral, unique identifier for the CDN to update |
	+------+---------------------------------------------------+

:dnssecEnabled: If ``true``, this CDN will use DNSSEC, if ``false`` it will not
:domainName:    The top-level domain (TLD) belonging to the CDN
:name:          Name of the new CDN

.. code-block:: http
	:caption: Request Example

	PUT /api/4.0/cdns/3 HTTP/1.1
	Host: trafficops.infra.ciab.test
	User-Agent: curl/7.47.0
	Accept: */*
	Cookie: mojolicious=...
	Content-Length: 63
	Content-Type: application/json

	{"name": "quest", "domainName": "test", "dnssecEnabled": false}

Response Structure
------------------
:dnssecEnabled: ``true`` if the CDN uses DNSSEC, ``false`` otherwise
:domainName:    The top-level domain (TLD) assigned to the newly created CDN
:id:            An integral, unique identifier for the newly created CDN
:name:          The newly created CDN's name

.. code-block:: http
	:caption: Response Example

	HTTP/1.1 200 OK
	Access-Control-Allow-Credentials: true
	Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept, Set-Cookie, Cookie
	Access-Control-Allow-Methods: POST,GET,OPTIONS,PUT,DELETE
	Access-Control-Allow-Origin: *
	Content-Type: application/json
	Set-Cookie: mojolicious=...; Path=/; Expires=Mon, 18 Nov 2019 17:40:54 GMT; Max-Age=3600; HttpOnly
	Whole-Content-Sha512: sI1hzBwG+/VAzoFY20kqGFA2RgrUOThtMeeJqk0ZxH3TRxTWuA8BetACct/XICC3n7hPDLlRVpwckEyBdyJkXg==
	X-Server-Name: traffic_ops_golang/
	Date: Wed, 14 Nov 2018 20:54:33 GMT
	Content-Length: 174

	{ "alerts": [
		{
			"text": "cdn was updated.",
			"level": "success"
		}
	],
	"response": {
		"dnssecEnabled": false,
		"domainName": "test",
		"id": 4,
		"lastUpdated": "2018-11-14 20:54:33+00",
		"name": "quest"
	}}

``DELETE``
==========
Allows a user to delete a specific CDN

:Auth. Required: Yes
:Roles Required: "admin" or "operations"
:Response Type:  ``undefined``

Request Structure
-----------------
.. table:: Request Path Parameters

	+------+------------------------------------------------------+
	| Name |                Description                           |
	+======+======================================================+
	|  ID  | The integral, unique identifier of the CDN to delete |
	+------+------------------------------------------------------+

Response Structure
------------------
.. code-block:: http
	:caption: Response Example

	HTTP/1.1 200 OK
	Access-Control-Allow-Credentials: true
	Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept, Set-Cookie, Cookie
	Access-Control-Allow-Methods: POST,GET,OPTIONS,PUT,DELETE
	Access-Control-Allow-Origin: *
	Content-Type: application/json
	Set-Cookie: mojolicious=...; Path=/; Expires=Mon, 18 Nov 2019 17:40:54 GMT; Max-Age=3600; HttpOnly
	Whole-Content-Sha512: Zy4cJN6BEct4ltFLN4e296mM8XnzOs0EQ3/jp4TA3L+g8qtkI0WrL+ThcFq4xbJPU+KHVDSi+b0JBav3xsYPqQ==
	X-Server-Name: traffic_ops_golang/
	Date: Wed, 14 Nov 2018 20:51:23 GMT
	Content-Length: 58

	{ "alerts": [
		{
			"text": "cdn was deleted.",
			"level": "success"
		}
	]}


text:
<?php

namespace ChrisKonnertz\DeepLy\HttpClient;

/**
 * This class uses cURL to execute API calls.
 */
class CurlHttpClient implements HttpClientInterface
{
    /**
     * Default logfile name, will be placed in the dir where this class lives.
     * You can specify a different path though.
     */
    const DEFAULT_LOGFILE_NAME = 'curl_log.txt';

    /**
     * Set this to false if you do not want cURL to
     * try to verify the SSL certificate - it could fail
     *
     * @see https://snippets.webaware.com.au/howto/stop-turning-off-curlopt_ssl_verifypeer-and-fix-your-php-config/
     *
     * @var bool
     */
    protected bool $sslVerifyPeer = true;

    /**
     * Proxy IP (and port): "123.123.123.133:8888"
     *
     * @var string|null
     */
    private string|null $proxyIp = null;

    /**
     * Proxy credentials: "user:password"
     *
     * @var string|null
     */
    private string|null $proxyCredentials;

    /**
     * If true, log cURL request to a logfile (self:: LOGFILE_NAME).
     * To get even more info about the actual request, send it to requestcatcher.com!
     *
     * @var bool
     */
    private bool $logging;

    /**
     * Specifies the filename of the logfile
     *
     * @var string|null
     */
    protected string|null $logFilename = null;

    /**
     * CurlHttpClient constructor.
     *
     * @param bool $logging If true, log cURL request to a logfile (self:: LOGFILE_NAME)
     */
    public function __construct(bool $logging = false)
    {
        if (! $this->isCurlAvailable()) {
            throw new \LogicException(
                'Cannot create instance of DeepLy\'s CurlHttpClient class, because the cURL PHP extension is not loaded'
            );
        }

        $this->logging = $logging;
    }

    /**
     * Executes a low level API call (a request) and returns the raw response data
     *
     * @param  string  $url      The full URL of the API endpoint
     * @param  string  $apiKey   The DeepL.com API key
     * @param  array   $payload  The payload of the request. Will be encoded as JSON
     * @param  string  $method   The request method ('GET', 'POST', 'DELETE')
     * @param  ?string $filename The filename of a file that should be uploaded
     * @return string            The raw response data as string (usually contains stringified JSON)
     * @throws CallException     Throws a call exception if the call could not be executed
     */
    public function callApi(
        string $url,
        string $apiKey,
        array $payload = [],
        string $method = HttpClientInterface::METHOD_POST,
        string $filename = null) : string
    {
        $curl = curl_init($url);

        $headers = ['Authorization: DeepL-Auth-Key '.$apiKey];

        // If a filename is provided, send the file
        if ($filename) {
            $payload['file'] = curl_file_create($filename);
            curl_setopt($curl, CURLOPT_POST, true);

            $headers[] = 'Content-Type: multipart/form-data';
        }

        curl_setopt($curl, CURLOPT_CUSTOMREQUEST, $method);
        curl_setopt($curl, CURLOPT_POSTFIELDS, $filename ? $payload : http_build_query($payload));
        curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
        curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, $this->sslVerifyPeer);

        // Set up proxy
        if ($this->proxyIp) {
            curl_setopt($curl, CURLOPT_PROXY, $this->proxyIp);
            if ($this->proxyCredentials) {
                curl_setopt($curl, CURLOPT_PROXYUSERPWD, $this->proxyCredentials);
            }
        }

        // Set API key via header
        curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);

        // Log cURL request to a logfile
        if ($this->logging) {
            $logfileName = $this->logFilename ?? __DIR__.'/'.self::DEFAULT_LOGFILE_NAME;
            $logfile = fopen($logfileName, 'w');
            curl_setopt($curl, CURLOPT_VERBOSE, 1);
            curl_setopt($curl, CURLOPT_STDERR, $logfile);
        }

        $rawResponseData = curl_exec($curl);

        $this->handleError($curl, $rawResponseData);

        // Close files
        curl_close($curl);
        if ($this->logging) {
            fclose($logfile);
        }

        return $rawResponseData;
    }

    /**
     * Handle cURL errors / API errors (if there are any) by throwing an exception
     *
     * @param \CurlHandle $curl
     * @param bool|string $rawResponseData
     * @return void
     * @throws CallException
     */
    public function handleError(\CurlHandle $curl, bool|string $rawResponseData)
    {
        // Check if cURL had any error
        if ($rawResponseData === false) {
            throw new CallException('cURL error during DeepLy API call: '.curl_error($curl));
        }

        $code = curl_getinfo($curl, CURLINFO_HTTP_CODE);

        // Check if the API returned any error
        if ($code < 200 || $code >= 300) {
            $extraText = '';

            // Some errors make the API respond with an object that contains an error message
            if ($rawResponseData) {
                $decoded = json_decode($rawResponseData);
                if ($decoded) { // Note: $decoded will is null if the JSON cannot be decoded / if there is no valid JSON
                    $extraText .= ' Error message: "'.$decoded->message.'"';
                    if (isset($decoded->detail)) {
                        $extraText .= ' Error details: "'.$decoded->detail.'"';
                    }
                }
            }

            throw new CallException('Server side error during DeepLy API call: HTTP code '.$code
                .', description: "'.(self::ERRORS[$code] ?? 'Internal error').'"'.$extraText, $code);
        }
    }

    /**
     * Pings the API server. Returns the duration in seconds
     * or throws an exception if no valid response was received.
     *
     * @param string $url The URL of the API endpoint
     * @return float
     * @throws CallException
     */
    public function ping(string $url) : float
    {
        $curl = curl_init($url);

        // Do not "include the header in the output" (from the docs).
        // Should make the response a little smaller.
        curl_setopt($curl, CURLOPT_HEADER, 0);
        // Set this to true, because if it is set to false, curl will echo the result!
        curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);

        $startedAt = microtime(true);
        $result = curl_exec($curl);
        $duration = microtime(true) - $startedAt;

        curl_close($curl);

        if ($result === false) {
            throw new CallException('Did not get a valid response. API seems to be unreachable.');
        }

        return $duration;
    }

    /**
     * Getter for the sslVerifyPeer property
     *
     * @return bool
     */
    public function getSslVerifyPeer(): bool
    {
        return $this->sslVerifyPeer;
    }

    /**
     * Setter for the sslVerifyPeer property
     *
     * @param bool $sslVerifyPeer
     */
    public function setSslVerifyPeer(bool $sslVerifyPeer)
    {
        $this->sslVerifyPeer = $sslVerifyPeer;
    }

    /**
     * Set up a proxy to be used by cURL in all requests.
     * To reset the proxy settings to their defaults, simply call this method without any arguments.
     *
     * @param string|null $ip          Proxy IP (and port): "123.123.123.133:8888"
     * @param string|null $credentials Proxy credentials: "user:password"
     */
    public function setProxy(string $ip = null, string $credentials = null)
    {
        $this->proxyIp = $ip;
        $this->proxyCredentials = $credentials;
    }

    /**
     * Returns true if the cURL extension is available, false otherwise
     *
     * @return bool
     */
    public function isCurlAvailable(): bool
    {
        return (in_array('curl', get_loaded_extensions()));
    }

    /**
     * Enable or disable logging to a logfile (self::LOGFILE_NAME)
     *
     * @param bool        $enabled  Enable or disable logging?
     * @param string|null $filename Set the filename of the logfile
     * @return void
     */
    public function setLogging(bool $enabled, string $filename = null)
    {
        $this->logging = $enabled;
        $this->logFilename = $filename;
    }

}


text:
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <!-- From: file:/Users/vidsouza/Documents/work/AndroidWorkSpace/BT_Andriod/braintree_android/Drop-In/build/intermediates/bundles/debug/res/values-w500dp-v13/values.xml -->
    <eat-comment/>
    <dimen name="bt_full_width">@dimen/bt_landscape_max_width</dimen>
</resources>


text:
from keras.models import Sequential
from keras.layers import Dense
from keras.models import load_model
import numpy as np

def train_data_on_neural_network():
    # fix random seed for stochastic random based process
    np.random.seed(7)

    # loading dataset
    dataset = np.loadtxt("machine_learning_data_2017-06-14.csv", delimiter=",", dtype=float)
    # split into input (X) and output (Y) variables
    X = dataset[:,0:510]
    Y = dataset[:,510]
    model = Sequential()
    model.add(Dense(510, input_dim=510, activation='sigmoid'))
    model.add(Dense(255, input_dim=255, activation='sigmoid'))
    model.add(Dense(1, activation='sigmoid'))

    model.compile(loss='binary_crossentropy', optimizer='adam', metrics=['accuracy'])
    print("Fitting Model")
    model.fit(X, Y, epochs=25000, batch_size=100)
    scores = model.evaluate(X, Y)
    print("\n%s: %.2f%%" % (model.metrics_names[1], scores[1] * 100))
    model.save("C:\Projects\StartThink\model_weights\\start_think_weights_25000_100.h5")

train_data_on_neural_network()


text:
import Application from '@ember/application';

import { initialize } from 'my-app/initializers/foo';
import { module, test } from 'qunit';
import { setupTest } from 'ember-qunit';
import destroyApp from '../../helpers/destroy-app';

module('Unit | Initializer | foo', function(hooks) {
  setupTest(hooks);

  hooks.beforeEach(function() {
    this.TestApplication = Application.extend();
    this.TestApplication.initializer({
      name: 'initializer under test',
      initialize
    });

    this.application = this.TestApplication.create({ autoboot: false });
  });

  hooks.afterEach(function() {
    destroyApp(this.application);
  });

  // Replace this with your real tests.
  test('it works', async function(assert) {
    await this.application.boot();

    assert.ok(true);
  });
});