text:
package javax.servlet;

/**
 * Defines an exception that a servlet or filter throws to indicate that it is
 * permanently or temporarily unavailable.
 *

 * When a servlet or filter is permanently unavailable, something is wrong with
 * it, and it cannot handle requests until some action is taken. For example, a
 * servlet might be configured incorrectly, or a filter's state may be
 * corrupted. The component should log both the error and the corrective action
 * that is needed.
 *

 * A servlet or filter is temporarily unavailable if it cannot handle requests
 * momentarily due to some system-wide problem. For example, a third-tier server
 * might not be accessible, or there may be insufficient memory or disk storage
 * to handle requests. A system administrator may need to take corrective
 * action.
 *

 * Servlet containers can safely treat both types of unavailable exceptions in
 * the same way. However, treating temporary unavailability effectively makes
 * the servlet container more robust. Specifically, the servlet container might
 * block requests to the servlet or filter for a period of time suggested by the
 * exception, rather than rejecting them until the servlet container restarts.
 *
 * @author Various
 */
public class UnavailableException extends ServletException {

    private static final long serialVersionUID = 1L;

    private final Servlet servlet; // what's unavailable
    private final boolean permanent; // needs admin action?
    private final int seconds; // unavailability estimate

    /**
     * @param servlet
     *            the Servlet instance that is unavailable
     * @param msg
     *            a String specifying the descriptive message
     * @deprecated As of Java Servlet API 2.2, use
     *             {@link #UnavailableException(String)} instead.
     */
    @SuppressWarnings("dep-ann")
    // Spec API does not use @Deprecated
    public UnavailableException(Servlet servlet, String msg) {
        super(msg);
        this.servlet = servlet;
        permanent = true;
        this.seconds = 0;
    }

    /**
     * @param seconds
     *            an integer specifying the number of seconds the servlet
     *            expects to be unavailable; if zero or negative, indicates that
     *            the servlet can't make an estimate
     * @param servlet
     *            the Servlet that is unavailable
     * @param msg
     *            a String specifying the descriptive message,
     *            which can be written to a log file or displayed for the user.
     * @deprecated As of Java Servlet API 2.2, use
     *             {@link #UnavailableException(String, int)} instead.
     */
    @SuppressWarnings("dep-ann")
    // Spec API does not use @Deprecated
    public UnavailableException(int seconds, Servlet servlet, String msg) {
        super(msg);
        this.servlet = servlet;
        if (seconds <= 0)
            this.seconds = -1;
        else
            this.seconds = seconds;
        permanent = false;
    }

    /**
     * Constructs a new exception with a descriptive message indicating that the
     * servlet is permanently unavailable.
     *
     * @param msg
     *            a String specifying the descriptive message
     */
    public UnavailableException(String msg) {
        super(msg);
        seconds = 0;
        servlet = null;
        permanent = true;
    }

    /**
     * Constructs a new exception with a descriptive message indicating that the
     * servlet is temporarily unavailable and giving an estimate of how long it
     * will be unavailable.
     *

     * In some cases, the servlet cannot make an estimate. For example, the
     * servlet might know that a server it needs is not running, but not be able
     * to report how long it will take to be restored to functionality. This can
     * be indicated with a negative or zero value for the seconds
     * argument.
     *
     * @param msg
     *            a String specifying the descriptive message,
     *            which can be written to a log file or displayed for the user.
     * @param seconds
     *            an integer specifying the number of seconds the servlet
     *            expects to be unavailable; if zero or negative, indicates that
     *            the servlet can't make an estimate
     */
    public UnavailableException(String msg, int seconds) {
        super(msg);

        if (seconds <= 0)
            this.seconds = -1;
        else
            this.seconds = seconds;
        servlet = null;
        permanent = false;
    }

    /**
     * Returns a boolean indicating whether the servlet is
     * permanently unavailable. If so, something is wrong with the servlet, and
     * the system administrator must take some corrective action.
     *
     * @return true if the servlet is permanently unavailable;
     *         false if the servlet is available or temporarily
     *         unavailable
     */
    public boolean isPermanent() {
        return permanent;
    }

    /**
     * Returns the servlet that is reporting its unavailability.
     *
     * @return the Servlet object that is throwing the
     *         UnavailableException
     * @deprecated As of Java Servlet API 2.2, with no replacement.
     */
    @SuppressWarnings("dep-ann")
    // Spec API does not use @Deprecated
    public Servlet getServlet() {
        return servlet;
    }

    /**
     * Returns the number of seconds the servlet expects to be temporarily
     * unavailable.
     *

     * If this method returns a negative number, the servlet is permanently
     * unavailable or cannot provide an estimate of how long it will be
     * unavailable. No effort is made to correct for the time elapsed since the
     * exception was first reported.
     *
     * @return an integer specifying the number of seconds the servlet will be
     *         temporarily unavailable, or a negative number if the servlet is
     *         permanently unavailable or cannot make an estimate
     */
    public int getUnavailableSeconds() {
        return permanent ? -1 : seconds;
    }
}


text:
set -eu

if [[ $# != 2 ]]; then
  echo "Usage: $(basename "$0") <source-directory> <binary-directory>"
  exit 1
fi

readonly SOURCE_DIR="$1"
readonly BINARY_DIR="$2"

# This script is supposed to run inside a Docker container, see
# ci/kokoro/cmake/installed-dependencies/build.sh for the expected setup.  The
# /v directory is a volume pointing to a (clean-ish) checkout of the project:
if [[ -z "${PROJECT_ROOT+x}" ]]; then
  readonly PROJECT_ROOT="/v"
fi
source "${PROJECT_ROOT}/ci/colors.sh"

echo
echo "${COLOR_YELLOW}Starting docker build $(date) with $(nproc)" \
    "cores${COLOR_RESET}"
echo

echo "================================================================"
echo "Verify formatting $(date)"
(cd "${PROJECT_ROOT}" ; ./ci/check-style.sh)
echo "================================================================"

echo "================================================================"
echo "Verify markdown $(date)"
(cd "${PROJECT_ROOT}" ; ./ci/check-markdown.sh)
echo "================================================================"

echo "================================================================"
echo "Compiling on $(date)"
echo "================================================================"
cd "${PROJECT_ROOT}"
cmake_flags=(
    # Configure the build type (Debug, Release, etc)
    "-DCMAKE_BUILD_TYPE=${BUILD_TYPE}"

    # To test installs without root privileges we cannot install in the default
    # directory (typically /usr/local)
    "-DCMAKE_INSTALL_PREFIX=$HOME/staging"
)
if [[ "${CLANG_TIDY:-}" = "yes" ]]; then
  cmake_flags+=("-DGOOGLE_CLOUD_CPP_CLANG_TIDY=yes")
fi
if [[ "${GOOGLE_CLOUD_CPP_CXX_STANDARD:-}" != "" ]]; then
  cmake_flags+=(
    "-DGOOGLE_CLOUD_CPP_CXX_STANDARD=${GOOGLE_CLOUD_CPP_CXX_STANDARD}")
fi
if [[ "${USE_NINJA:-}" == "yes" ]]; then
  cmake_flags+=( "-GNinja" )
fi
if [[ "${GOOGLE_CLOUD_CPP_COMMON_VERSION:-}" != "" ]]; then
  cmake_flags+=(
    "-DGOOGLE_CLOUD_CPP_COMMON_VERSION=${GOOGLE_CLOUD_CPP_COMMON_VERSION}")
fi

# We disable the shellcheck warning because we want ${CMAKE_FLAGS} to expand as
# separate arguments.
echo "================================================================"
echo "Running CMake configuration step $(date)."
echo "    cmake ${CMAKE_FLAGS:-} -H${SOURCE_DIR} -B${BINARY_DIR}" "${cmake_flags[@]}"
# shellcheck disable=SC2086
cmake ${CMAKE_FLAGS:-} "-H${SOURCE_DIR}" "-B${BINARY_DIR}" "${cmake_flags[@]}"

echo "================================================================"
echo "Running CMake build step $(date)."
echo "    cmake" --build "${BINARY_DIR}" -- -j "$(nproc)"
cmake --build "${BINARY_DIR}" -- -j "$(nproc)"

TEST_JOB_COUNT="$(nproc)"
if [[ "${BUILD_TYPE}" == "Coverage" ]]; then
  # The code coverage build cannot run the tests in parallel. Some of
  # the files where the code coverage is recorded are shared and not
  # protected by locks of any kind.
  TEST_JOB_COUNT=1
fi
readonly TEST_JOB_COUNT

ctest_args=("--output-on-failure" "-j" "${TEST_JOB_COUNT}")
if [[ -n "${RUNS_PER_TEST}" ]]; then
    ctest_args+=("--repeat-until-fail" "${RUNS_PER_TEST}")
fi

# When user a super-build the tests are hidden in a subdirectory. We can tell
# that ${BINARY_DIR} does not have the tests by checking for this file:
if [[ -r "${BINARY_DIR}/CTestTestfile.cmake" ]]; then
  echo "================================================================"
  # It is Okay to skip the tests in this case because the super build
  # automatically runs them.
  echo "Running the unit tests $(date)"
  env -C "${BINARY_DIR}" ctest \
      -LE integration-tests "${ctest_args[@]}"
  echo "================================================================"
fi

# yes: always try to run integration tests.
# auto: only try to run integration tests if the config file is executable.
readonly INTEGRATION_TESTS_CONFIG="/c/spanner-integration-tests-config.sh"
if [[ "${RUN_INTEGRATION_TESTS}" == "yes" || \
      ( "${RUN_INTEGRATION_TESTS}" == "auto" && \
        -r "${INTEGRATION_TESTS_CONFIG}" ) ]]; then
  echo "================================================================"
  echo "Running the integration tests $(date)"
  echo "================================================================"
  # shellcheck disable=SC1091
  source "${INTEGRATION_TESTS_CONFIG}"
  export GOOGLE_APPLICATION_CREDENTIALS=/c/spanner-credentials.json
  export GOOGLE_CLOUD_CPP_AUTO_RUN_EXAMPLES=yes

  # Run the integration tests too.
  env -C "${BINARY_DIR}" ctest \
      -L integration-tests "${ctest_args[@]}"
  echo "================================================================"
fi

if [[ "${GENERATE_DOCS:-}" = "yes" ]]; then
  echo "================================================================"
  echo "Validate Doxygen documentation $(date)"
  cmake --build "${BINARY_DIR}" --target doxygen-docs
  echo "================================================================"
fi

if [[ "${TEST_INSTALL:-}" = "yes" ]]; then
    echo "================================================================"
    echo "Running the test install $(date)"
    echo "================================================================"
    cmake --build "${BINARY_DIR}" --target install || echo "FAILED"

    # Verify only the expected directories are created in the install directory.
    echo
    echo "${COLOR_YELLOW}Verify installed headers created only expected" \
        "directories.${COLOR_RESET}"
    if comm -23 \
        <(find "$HOME/staging/include/google/cloud" -type d | sort) \
        <(echo "$HOME/staging/include/google/cloud" ; \
          echo "$HOME/staging/include/google/cloud/spanner" ; \
          echo "$HOME/staging/include/google/cloud/spanner/internal" ; \
          echo "$HOME/staging/include/google/cloud/spanner/mocks" ; \
          /bin/true) | grep -q "$HOME"; then
        echo "${COLOR_YELLOW}Installed directories do not match" \
            "expectation.${COLOR_RESET}"
        echo "${COLOR_RED}Found:"
        find "$HOME/staging/include/google/cloud" -type d | sort
        echo "${COLOR_RESET}"
        /bin/false
    fi

    # Checking the ABI requires installation, so this is the first opportunity
    # to run the check.
    env -C "${PROJECT_ROOT}" \
      PKG_CONFIG_PATH="${HOME}/staging/lib64/pkgconfig:/usr/local/lib64/pkgconfig:${PKG_CONFIG_PATH:-}" \
      ./ci/kokoro/docker/check-api.sh "${BINARY_DIR}"
fi

echo "================================================================"
echo "Build finished at $(date)"
echo "================================================================"

exit 0

redpajama_set_name: RedPajamaGithub


text:
package org.jboss.weld.environment.se.test.discovery.isolation;

import jakarta.enterprise.context.Dependent;

@FooBinding
@Dependent
public class Rorschach {

    void ping() {
    }

}


text:
set -e
autoreconf --force --install -I config || exit 1
rm -rf autom4te.cache


text:
package org.camunda.spin.impl.json.jackson;

import org.camunda.commons.logging.BaseLogger;
import org.camunda.spin.impl.logging.SpinLogger;
import org.camunda.spin.json.SpinJsonDataFormatException;
import org.camunda.spin.json.SpinJsonException;
import org.camunda.spin.json.SpinJsonNode;
import org.camunda.spin.json.SpinJsonPathException;
import org.camunda.spin.json.SpinJsonPropertyException;

import com.fasterxml.jackson.databind.JavaType;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.node.JsonNodeType;
import com.jayway.jsonpath.PathNotFoundException;

/**
 * @author Thorben Lindhauer
 * @author Stefan Hentschel
 */
public class JacksonJsonLogger extends SpinLogger {

  public static final String PROJECT_CODE = SpinLogger.PROJECT_CODE + "/JACKSON-JSON";
  public static final JacksonJsonLogger JSON_TREE_LOGGER = BaseLogger.createLogger(JacksonJsonLogger.class, PROJECT_CODE, "org.camunda.spin.json", "01");

  public SpinJsonDataFormatException unableToParseInput(Exception e) {
    return new SpinJsonDataFormatException(exceptionMessage("001", "Unable to parse input into json node"), e);
  }

  /**
   * Exception handler if we are unable to parse a json value into a java representation
   *
   * @param expectedType Name of the expected Type
   * @param type Type of the json node
   * @return SpinJsonDataFormatException
   */
  public SpinJsonDataFormatException unableToParseValue(String expectedType, JsonNodeType type) {
    return new SpinJsonDataFormatException(exceptionMessage("002", "Expected '{}', got '{}'", expectedType, type.toString()));
  }

  public SpinJsonDataFormatException unableToWriteJsonNode(Exception cause) {
    return new SpinJsonDataFormatException(exceptionMessage("003", "Unable to write json node"), cause);
  }

  public SpinJsonException unableToFindProperty(String propertyName) {
    return new SpinJsonPropertyException(exceptionMessage("004", "Unable to find '{}'", propertyName));
  }

  public SpinJsonException unableToCreateNode(String objectType) {
    return new SpinJsonPropertyException(exceptionMessage("005", "Unable to create node for object of type '{}'", objectType));
  }

  public SpinJsonException unableToDeserialize(JsonNode jsonNode, JavaType type, Exception cause) {
    return new SpinJsonException(
        exceptionMessage("006", "Cannot deserialize '{}...' to java type '{}'",
            jsonNode.toString().substring(0, 10), type), cause);
  }

  public SpinJsonDataFormatException unableToConstructJavaType(String fromString, Exception cause) {
    return new SpinJsonDataFormatException(
        exceptionMessage("007", "Cannot construct java type from string '{}'", fromString), cause);
  }

  public SpinJsonDataFormatException unableToDetectCanonicalType(Object parameter) {
    return new SpinJsonDataFormatException(exceptionMessage("008", "Cannot detect canonical data type for parameter '{}'", parameter));
  }

  public SpinJsonDataFormatException unableToMapInput(Object input, Exception cause) {
    return new SpinJsonDataFormatException(exceptionMessage("009", "Unable to map object '{}' to json node", input), cause);
  }

  public SpinJsonException unableToModifyNode(String nodeName) {
    return new SpinJsonException(exceptionMessage("010", "Unable to modify node of type '{}'. Node is not a list.", nodeName));
  }

  public SpinJsonException unableToGetIndex(String nodeName) {
    return new SpinJsonException(exceptionMessage("011", "Unable to get index from '{}'. Node is not a list.", nodeName));
  }

  public IndexOutOfBoundsException indexOutOfBounds(Integer index, Integer size) {
    return new IndexOutOfBoundsException(exceptionMessage("012", "Index is out of bound! Index: '{}', Size: '{}'", index, size));
  }

  public SpinJsonPathException unableToEvaluateJsonPathExpressionOnNode(SpinJsonNode node, Exception cause) {
    return new SpinJsonPathException(
      exceptionMessage("013", "Unable to evaluate JsonPath expression on element '{}'", node.getClass().getName()), cause);
  }

  public SpinJsonPathException unableToCompileJsonPathExpression(String expression, Exception cause) {
    return new SpinJsonPathException(
      exceptionMessage("014", "Unable to compile '{}'!", expression), cause);
  }

  public SpinJsonPathException unableToCastJsonPathResultTo(Class<?> castClass, Exception cause) {
    return new SpinJsonPathException(
      exceptionMessage("015", "Unable to cast JsonPath expression to '{}'", castClass.getName()), cause);
  }

  public SpinJsonPathException invalidJsonPath(Class<?> castClass, Exception cause) {
    return new SpinJsonPathException(
            exceptionMessage("017", "Invalid json path to '{}'", castClass.getName()), cause);
  }
}


text:
package com.mygdx.game.ui;

import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.scenes.scene2d.ui.Label;
import com.badlogic.gdx.scenes.scene2d.ui.Skin;
import com.badlogic.gdx.utils.StringBuilder;

/** A label continuously showing the most up-to-date value prefixed by a constant string.
 *
 * @param <T> the type of the value
 *
 * @author davebaol */
public abstract class ObjectValueLabel<T> extends Label {

	T oldValue;
	int appendIndex;

	public ObjectValueLabel (CharSequence text, T initialValue, Skin skin) {
		this(text, initialValue, skin.get(LabelStyle.class));
	}

	public ObjectValueLabel (CharSequence text, T initialValue, Skin skin, String styleName) {
		this(text, initialValue, skin.get(styleName, LabelStyle.class));
	}

	public ObjectValueLabel (CharSequence text, T initialValue, Skin skin, String fontName, Color color) {
		this(text, initialValue, new LabelStyle(skin.getFont(fontName), color));
	}

	public ObjectValueLabel (CharSequence text, T initialValue, Skin skin, String fontName, String colorName) {
		this(text, initialValue, new LabelStyle(skin.getFont(fontName), skin.getColor(colorName)));
	}

	public ObjectValueLabel (CharSequence text, T initialValue, LabelStyle style) {
		super(text.toString() + initialValue, style);
		this.oldValue = initialValue;
		this.appendIndex = text.length();
	}

	public abstract T getValue();

	public abstract void copyValue(T newValue, T oldValue);

	@Override
	public void act (float delta) {
		T newValue = getValue();
		if (!oldValue.equals(newValue)) {
			copyValue(newValue, oldValue);
			StringBuilder sb = getText();
			sb.setLength(appendIndex);
			sb.append(oldValue);
			invalidateHierarchy();
		}
		super.act(delta);
	}

}


text:
namespace graphics
{
  namespace gl
  {
    void convert(EDataType from, GLenum & to);
    void convert(GLenum from, EDataType & to);

    void convert(GLenum from, EDataType & to, size_t & cnt);

    void convert(EShaderType from, GLenum & to);
    void convert(EPrimitives from, GLenum & to);
  }
}


text:
package org.conqat.engine.html_presentation.chart;

import java.util.ArrayList;

import org.conqat.engine.commons.statistics.DateValueSeries;
import org.conqat.engine.core.core.AConQATAttribute;
import org.conqat.engine.core.core.AConQATParameter;
import org.conqat.engine.core.core.AConQATProcessor;
import org.jfree.chart.JFreeChart;
import org.jfree.chart.axis.NumberAxis;
import org.jfree.chart.plot.XYPlot;
import org.jfree.chart.renderer.xy.StandardXYItemRenderer;
import org.jfree.data.time.TimeSeriesCollection;
import org.jfree.data.xy.XYDataset;

/**
 * {@ConQAT.Doc}
 *
 * @author $Author: kinnen $
 * @version $Rev: 41751 $
 * @ConQAT.Rating GREEN Hash: F289526DC0060E207267B4A22374854F
 */
@AConQATProcessor(description = "This processor allows charting "
		+ "multiple value series with different ranges. "
		+ SeriesCreatorBase.SERIES_LAYOUTER_COMMENT)
public class MultiRangeSeriesCreator extends SeriesCreatorBase {

	/** The datasets to layout. */
	private final ArrayList<DatasetDescriptor> datasets = new ArrayList<DatasetDescriptor>();

	/** {@ConQAT.Doc} */
	@AConQATParameter(name = "series", minOccurrences = 1, description = "Value series to chart.")
	public void addValueSeries(
			@AConQATAttribute(name = "ref", description = "Reference to series generating processor.") DateValueSeries series,
			@AConQATAttribute(name = "description", description = "Series description.") String seriesDescription,
			@AConQATAttribute(name = "axis-label", description = "Range axis label.") String axisLabel,
			@AConQATAttribute(name = "include-zero", description = "Include 0 in range?", defaultValue = "true") boolean includeZero) {

		datasets.add(new DatasetDescriptor(series, seriesDescription,
				axisLabel, includeZero));
	}

	/** Create the chart. */
	@Override
	protected JFreeChart createChart() {

		XYDataset dataset = createDataset(0);

		// create first data set
		DatasetDescriptor initialDescriptor = datasets.get(0);
		JFreeChart chart = setupChart(dataset,
				initialDescriptor.getAxisLabel(), initialDescriptor
						.isIncludeZero());

		addAdditionalDatasets(chart);
		return chart;
	}

	/**
	 * Add additional data sets to chart.
	 */
	private void addAdditionalDatasets(JFreeChart chart) {

		// return if there are no further data sets.
		if (datasets.size() < 2) {
			return;
		}

		XYPlot xyplot = chart.getXYPlot();

		for (int i = 1; i < datasets.size(); i++) {

			DatasetDescriptor descriptor = datasets.get(i);

			NumberAxis axis = new NumberAxis(descriptor.getAxisLabel());
			axis.setAutoRangeIncludesZero(descriptor.isIncludeZero());
			xyplot.setRangeAxis(i, axis);

			XYDataset xydataset = createDataset(i);
			xyplot.setDataset(i, xydataset);
			xyplot.mapDatasetToRangeAxis(i, i);

			StandardXYItemRenderer renderer = new StandardXYItemRenderer();
			renderer.setBaseShapesVisible(true);
			renderer.setBaseShapesFilled(true);

			xyplot.setRenderer(i, renderer);
		}
	}

	/**
	 * Create ith dataset.
	 */
	private XYDataset createDataset(int i) {
		TimeSeriesCollection dataset = new TimeSeriesCollection();

		dataset.addSeries(createTimeSeries(datasets.get(i).getDescription(),
				datasets.get(i).getValueSeries()));

		return dataset;
	}

	/** {@inheritDoc} */
	@Override
	protected ArrayList<DateValueSeries> getSeries() {
		ArrayList<DateValueSeries> series = new ArrayList<DateValueSeries>();
		for (DatasetDescriptor dataset : datasets) {
			series.add(dataset.getValueSeries());
		}
		return series;
	}

}


text:
This is a fork of the [DDay.Update project hosted at SourceForge](http://sourceforge.net/projects/dday-update/).

It was forked from the most recent update (r134 by dougday on 2010-09-02).


text:
package jdbm.recman;

import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.Iterator;
import java.util.TreeSet;

import jdbm.helper.Serialization;

/**
 *  This class manages the transaction log that belongs to every
 *  {@link RecordFile}. The transaction log is either clean, or
 *  in progress. In the latter case, the transaction manager
 *  takes care of a roll forward.
 *

 *  Implementation note: this is a proof-of-concept implementation
 *  which hasn't been optimized for speed. For instance, all sorts
 *  of streams are created for every transaction.
 */
// TODO: Handle the case where we are recovering lg9 and lg0, were we
// should start with lg9 instead of lg0!

public final class TransactionManager {
    private RecordFile owner;

    // streams for transaction log.
    private FileOutputStream fos;
    private DataOutputStream oos;

    /**
     * By default, we keep 10 transactions in the log file before
     * synchronizing it with the main database file.
     */
    static final int DEFAULT_TXNS_IN_LOG = 1;

    /**
     * Maximum number of transactions before the log file is
     * synchronized with the main database file.
     */
    private int _maxTxns = DEFAULT_TXNS_IN_LOG;

    /**
     * In-core copy of transactions. We could read everything back from
     * the log file, but the RecordFile needs to keep the dirty blocks in
     * core anyway, so we might as well point to them and spare us a lot
     * of hassle.
     */
    private ArrayList<BlockIo>[] txns = new ArrayList[DEFAULT_TXNS_IN_LOG];
    private int curTxn = -1;

    /** Extension of a log file. */
    static final String extension = ".t";

    /**
     *  Instantiates a transaction manager instance. If recovery
     *  needs to be performed, it is done.
     *
     *  @param owner the RecordFile instance that owns this transaction mgr.
     */
    TransactionManager(RecordFile owner) throws IOException {
        this.owner = owner;
        recover();
        open();
    }

    /**
     * Synchronize log file data with the main database file.
     *

     * After this call, the main database file is guaranteed to be
     * consistent and guaranteed to be the only file needed for
     * backup purposes.
     */
    public void synchronizeLog()
        throws IOException
    {
        synchronizeLogFromMemory();
    }

    /**
     * Set the maximum number of transactions to record in
     * the log (and keep in memory) before the log is
     * synchronized with the main database file.
     *

     * This method must be called while there are no
     * pending transactions in the log.
     */
    public void setMaximumTransactionsInLog( int maxTxns )
        throws IOException
    {
        if ( maxTxns <= 0 ) {
            throw new IllegalArgumentException(
                "Argument 'maxTxns' must be greater than 0." );
        }
        if ( curTxn != -1 ) {
            throw new IllegalStateException(
                "Cannot change setting while transactions are pending in the log" );
        }
        _maxTxns = maxTxns;
        txns = new ArrayList[ maxTxns ];
    }

    /** Builds logfile name  */
    private String makeLogName() {
        return owner.getFileName() + extension;
    }

    /** Synchs in-core transactions to data file and opens a fresh log */
    private void synchronizeLogFromMemory() throws IOException {
        close();

        TreeSet<BlockIo> blockList = new TreeSet<BlockIo>( new BlockIoComparator() );

        int numBlocks = 0;
        int writtenBlocks = 0;
        for (int i = 0; i < _maxTxns; i++) {
            if (txns[i] == null)
                continue;
            // Add each block to the blockList, replacing the old copy of this
            // block if necessary, thus avoiding writing the same block twice
            for (Iterator<BlockIo> k = txns[i].iterator(); k.hasNext(); ) {
                BlockIo block = k.next();
                if ( blockList.contains( block ) ) {
                    block.decrementTransactionCount();
                }
                else {
                    writtenBlocks++;
                    boolean result = blockList.add( block );
                }
                numBlocks++;
            }

            txns[i] = null;
        }
        // Write the blocks from the blockList to disk
        synchronizeBlocks(blockList, true);

        owner.sync();
        open();
    }

    /** Opens the log file */
    private void open() throws IOException {
        fos = new FileOutputStream(makeLogName());
        oos = new DataOutputStream(new BufferedOutputStream(fos));
        oos.writeShort(Magic.LOGFILE_HEADER);
        oos.flush();
        curTxn = -1;
    }

    /** Startup recovery on all files */
    private void recover() throws IOException {
        String logName = makeLogName();
        File logFile = new File(logName);
        if (!logFile.exists())
            return;
        if (logFile.length() == 0) {
            logFile.delete();
            return;
        }

        FileInputStream fis = new FileInputStream(logFile);
        DataInputStream ois = new DataInputStream(new BufferedInputStream(fis));

        try {
            if (ois.readShort() != Magic.LOGFILE_HEADER)
                throw new Error("Bad magic on log file");
        } catch (IOException e) {
            // corrupted/empty logfile
            logFile.delete();
            return;
        }

        while (true) {
            ArrayList<BlockIo> blocks = null;
            try {
                blocks = (ArrayList<BlockIo>) Serialization.readObject(ois);
            } catch (ClassNotFoundException e) {
                throw new Error("Unexcepted exception: " + e);
            } catch (IOException e) {
                // corrupted logfile, ignore rest of transactions
                break;
            }
            synchronizeBlocks(blocks, false);

            // ObjectInputStream must match exactly each
            // ObjectOutputStream created during writes
//            try {
                ois = new DataInputStream(fis);
//            } catch (IOException e) {
//                // corrupted logfile, ignore rest of transactions
//                break;
//            }
        }
        owner.sync();
        logFile.delete();
    }

    /** Synchronizes the indicated blocks with the owner. */
    private void synchronizeBlocks(Iterable<BlockIo> blocks, boolean fromCore)
    throws IOException {
        // write block vector elements to the data file.
        for(BlockIo cur:blocks){
            owner.synch(cur);
            if (fromCore) {
                cur.decrementTransactionCount();
                if (!cur.isInTransaction()) {
                    owner.releaseFromTransaction(cur, true);
                }
            }
        }
    }

    /** Set clean flag on the blocks. */
    private void setClean(ArrayList<BlockIo> blocks)
    throws IOException {
        for (BlockIo cur : blocks) {
            cur.setClean();
        }
    }

    /** Discards the indicated blocks and notify the owner. */
    private void discardBlocks(ArrayList<BlockIo> blocks)
    throws IOException {
        for (BlockIo cur:blocks) {

            cur.decrementTransactionCount();
            if (!cur.isInTransaction()) {
                owner.releaseFromTransaction(cur, false);
            }
        }
    }

    /**
     *  Starts a transaction. This can block if all slots have been filled
     *  with full transactions, waiting for the synchronization thread to
     *  clean out slots.
     */
    void start() throws IOException {
        curTxn++;
        if (curTxn == _maxTxns) {
            synchronizeLogFromMemory();
            curTxn = 0;
        }
        txns[curTxn] = new ArrayList();
    }

    /**
     *  Indicates the block is part of the transaction.
     */
    void add(BlockIo block) throws IOException {
        block.incrementTransactionCount();
        txns[curTxn].add(block);
    }

    /**
     *  Commits the transaction to the log file.
     */
    void commit() throws IOException {
    	Serialization.writeObject(oos, txns[curTxn]);
        sync();

        // set clean flag to indicate blocks have been written to log
        setClean(txns[curTxn]);

        // open a new ObjectOutputStream in order to store
        // newer states of BlockIo
        oos = new DataOutputStream(new BufferedOutputStream(fos));
    }

    /** Flushes and syncs */
    private void sync() throws IOException {
        oos.flush();
        fos.flush();
        fos.getFD().sync();
    }

    /**
     *  Shutdowns the transaction manager. Resynchronizes outstanding
     *  logs.
     */
    void shutdown() throws IOException {
        synchronizeLogFromMemory();
        close();
    }

    /**
     *  Closes open files.
     */
    private void close() throws IOException {
        sync();
        oos.close();
        fos.close();
        oos = null;
        fos = null;
    }

    /**
     * Force closing the file without synchronizing pending transaction data.
     * Used for testing purposes only.
     */
    void forceClose() throws IOException {
        oos.close();
        fos.close();
        oos = null;
        fos = null;
    }

    /**
     * Use the disk-based transaction log to synchronize the data file.
     * Outstanding memory logs are discarded because they are believed
     * to be inconsistent.
     */
    void synchronizeLogFromDisk() throws IOException {
        close();

        for ( int i=0; i < _maxTxns; i++ ) {
            if (txns[i] == null)
                continue;
            discardBlocks(txns[i]);
            txns[i] = null;
        }

        recover();
        open();
    }

    /** INNER CLASS.
     *  Comparator class for use by the tree set used to store the blocks
     *  to write for this transaction.  The BlockIo objects are ordered by
     *  their blockIds.
     */
    public static class BlockIoComparator
        implements Comparator<BlockIo>
    {

        public int compare( BlockIo block1, BlockIo block2 ) {

            if ( block1.getBlockId() == block2.getBlockId() ) {
            	return 0;
            }
            else if ( block1.getBlockId() < block2.getBlockId() ) {
                return -1;
            }
            else {
                return 1;
            }
        }

        public boolean equals(Object obj) {
            return super.equals(obj);
        }
    } // class BlockIOComparator

}


text:
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <!-- From: file:/Users/hasudhakar/Documents/workspace2/zxing-android-embedded/zxing-android-embedded/build/intermediates/bundles/debug/res/values-ru/values.xml -->
    <eat-comment/>
    <string name="zxing_app_name">Сканер штрих-кодов</string>
    <string name="zxing_button_ok">OK</string>
    <string name="zxing_msg_camera_framework_bug">К сожалению, возникла ошибка камеры. Может потребоваться перезагрузить устройство.</string>
    <string name="zxing_msg_default_status">Чтобы сканировать штрих-код, поместите его в прямоугольник видоискателя.</string>
</resources>


text:
package di

import (
	"net/http"
	"reflect"
)

var requestType = reflect.TypeOf((**http.Request)(nil)).Elem()
var responseWriterType = reflect.TypeOf((*http.ResponseWriter)(nil)).Elem()


text:
define([
  'jquery'
], function($) {
  'use strict';

  /**
   * Events for scrolling past points in pages
   * @module  BeFF/scrollpoint
   */

  var percent = /(\d+)%/,
      $window = $(window),
      $document = $(document),
      registry = {};

  function isPercent(breakpoint) {
    return percent.test(breakpoint) || (breakpoint > 0 && breakpoint < 1);
  }

  function normalize(breakpoint) {
    if ($.isNumeric(breakpoint)) {
      return parseFloat(breakpoint);
    }

    var value = percent.exec(breakpoint);

    // Percentage breakpoint
    if (value) {
      return (value[1] / 100);
    }

    return parseInt(breakpoint, 10);
  }

  function elementHeight($context) {
    return $context.is($window) ?
           ($document.height() - (window.innerHeight || $window.height())) :
           $context.prop('scrollHeight');
  }

  function check(breakpoint, scrolled, $context) {
    return (scrolled >
            (isPercent(breakpoint) ?
             breakpoint * elementHeight($context) :
             parseInt(breakpoint, 10)
            )
           );
  }

  function scroll(context) {
    var $context = context === 'window' ? $window : $(context);

    return function() {
      var breakpoint, cb, cache,
      scrolled = $context.scrollTop();

      for (breakpoint in registry[context]) {
        cb = registry[context][breakpoint];
        cache = check(breakpoint, scrolled, $context);

        cb.cache = cb.cache || false;

        if (cb.cache !== cache) {
          cb.fire(cache);
          cb.cache = cache;
        }
      }
    };
  }

  function register(breakpoint, callback, context) {
    breakpoint = normalize(breakpoint);

    var cb = registry[context][breakpoint];

    if (!cb) {
      cb = registry[context][breakpoint] = new $.Callbacks();
    }

    cb.add(callback);
  }

  function unregister(breakpoint, callback, context) {
    context = context || 'window';

    var bp;

    if (callback) {
      if (breakpoint) {
        registry[context][breakpoint].remove(callback);
        return;
      }

      for (bp in registry[context]) {
        registry[context][bp].remove(callback);
      }
      return;
    }

    if (typeof breakpoint === 'string') {
      registry[context][breakpoint].empty();
      delete registry[context][breakpoint];
    }

    if (context) {
      delete registry[context];
    }
  }

  /**
   * @param breakpoint {Number|String} Number of pixels scrolled down
   * or percentage of context height e.g. '50%' or 0.5
   * @param callback {Function}
   * @param context {DOM|jQuery}
   */
  function scrollpoint(breakpoint, callback, context) {
    context = context || 'window';

    var $context = context === 'window' ? $window : $(context),
        point;

    if (!registry.hasOwnProperty(context)) {
      registry[context] = {};
      $context.on('scroll', scroll(context));
    }

    if (typeof breakpoint === 'object') {
      for (point in breakpoint) {
        register(point, breakpoint[point], context);
      }
      return;
    }

    return register(breakpoint, callback, context);
  }

  scrollpoint.on = scrollpoint;
  scrollpoint.off = unregister;

  return scrollpoint;
});


text:
package org.jetbrains.jps.incremental;

import com.intellij.openapi.util.UserDataHolderBase;
import com.intellij.openapi.util.io.FileUtil;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.io.File;
import java.io.IOException;

/**
 * @author Eugene Zhuravlev
 *         Date: 11/18/12
 */
public class CompiledClass extends UserDataHolderBase{
  @NotNull
  private final File myOutputFile;
  @NotNull
  private final File mySourceFile;
  @Nullable
  private final String myClassName;
  @NotNull
  private BinaryContent myContent;

  private boolean myIsDirty = false;

  public CompiledClass(@NotNull File outputFile, @NotNull File sourceFile, @Nullable String className, @NotNull BinaryContent content) {
    myOutputFile = outputFile;
    mySourceFile = sourceFile;
    myClassName = className;
    myContent = content;
  }

  public  void save() throws IOException {
    myContent.saveToFile(myOutputFile);
    myIsDirty = false;
  }

  @NotNull
  public File getOutputFile() {
    return myOutputFile;
  }

  @NotNull
  public File getSourceFile() {
    return mySourceFile;
  }

  @Nullable
  public String getClassName() {
    return myClassName;
  }

  @NotNull
  public BinaryContent getContent() {
    return myContent;
  }

  public void setContent(@NotNull BinaryContent content) {
    myContent = content;
    myIsDirty = true;
  }

  public boolean isDirty() {
    return myIsDirty;
  }

  @Override
  public boolean equals(Object o) {
    if (this == o) return true;
    if (o == null || getClass() != o.getClass()) return false;

    CompiledClass aClass = (CompiledClass)o;

    if (!FileUtil.filesEqual(myOutputFile, aClass.myOutputFile)) return false;

    return true;
  }

  @Override
  public int hashCode() {
    return FileUtil.fileHashCode(myOutputFile);
  }
}


text:
import type { TableUserConfig } from './types/api';
import type { Row, TableConfig } from './types/internal';
/**
 * Makes a new configuration object out of the userConfig object
 * using default values for the missing configuration properties.
 */
export declare const makeTableConfig: (rows: Row[], userConfig?: TableUserConfig) => TableConfig;


text:
layout: post
title: About Me
permalink: about
---

<img id="profile" src="profile/profile.jpg" alt="Sagang Wee">

Hey there, my name is Sagang Wee and I am a software engineer at Google. In my free time, I like to learn how to develop new things, read, try new food, hike, swim, play board and card games, and confer with the YouTube algorithm gods. I also have a mild obsession with socks.

### About This Site

This site is built using [Jekyll](https://jekyllrb.com/) and [Poole's](http://getpoole.com/) [Hyde](http://hyde.getpoole.com) theme. It is developed on GitHub using [GitHub Pages](https://pages.github.com).


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<TITLE
>CHECKPOINT</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
REV="MADE"
HREF="mailto:pgsql-docs@postgresql.org"><LINK
REL="HOME"
TITLE="PostgreSQL 9.6.2 Documentation"
HREF="index.html"><LINK
REL="UP"
TITLE="SQL Commands"
HREF="sql-commands.html"><LINK
REL="PREVIOUS"
TITLE="BEGIN"
HREF="sql-begin.html"><LINK
REL="NEXT"
TITLE="CLOSE"
HREF="sql-close.html"><LINK
REL="STYLESHEET"
TYPE="text/css"
HREF="stylesheet.css"><META
HTTP-EQUIV="Content-Type"
CONTENT="text/html; charset=ISO-8859-1"><META
NAME="creation"
CONTENT="2017-02-06T21:56:32">

PostgreSQL 9.6.2 Documentation

Prev	Up		Next

CHECKPOINT

Name
CHECKPOINT -- force a transaction log checkpoint

Synopsis

CHECKPOINT

Description

   A checkpoint is a point in the transaction log sequence at which
   all data files have been updated to reflect the information in the
   log.  All data files will be flushed to disk.  Refer to
   Section 30.4 for more details about what happens
   during a checkpoint.

   The <TT
CLASS="COMMAND"
>CHECKPOINT</TT
> command forces an immediate
   checkpoint when the command is issued, without waiting for a
   regular checkpoint scheduled by the system (controlled by the settings in
   Section 19.5.2).
   <TT
CLASS="COMMAND"
>CHECKPOINT</TT
> is not intended for use during normal
   operation.

   If executed during recovery, the <TT
CLASS="COMMAND"
>CHECKPOINT</TT
> command
   will force a restartpoint (see Section 30.4)
   rather than writing a new checkpoint.

   Only superusers can call <TT
CLASS="COMMAND"
>CHECKPOINT</TT
>.

Compatibility

   The <TT
CLASS="COMMAND"
>CHECKPOINT</TT
> command is a
   PostgreSQL language extension.

Prev	Home	Next

BEGIN	Up	CLOSE


text:
'use strict'

module.exports = function (text, width, char) {
	text = text || ''
	width = width || 15
	char = char || '-'
	var length = Math.ceil((width - text.length) / 2)
	var wrapper = char.repeat(length)
	return wrapper + text + wrapper
}


text:
package jsystem.extensions.report.sumextended;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.Properties;
import java.util.logging.Level;
import java.util.logging.Logger;

import jsystem.extensions.report.html.summary.Attribute;
import jsystem.extensions.report.html.summary.Chapter;
import jsystem.extensions.report.html.summary.HtmlSummaryReporter;
import jsystem.extensions.report.html.summary.Table;
import jsystem.extensions.report.html.summary.Tag;
import jsystem.framework.FrameworkOptions;
import jsystem.framework.JSystemProperties;
import jsystem.framework.report.TestReporter;
import jsystem.framework.sut.SutFactory;
import jsystem.utils.DateUtils;
import jsystem.utils.StringUtils;
import junit.framework.AssertionFailedError;
import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestListener;

public class HtmlSummaryReporterExtentsion implements TestReporter, TestListener {
	private static Logger log = Logger.getLogger(HtmlSummaryReporter.class.getName());

	private File summaryFile;

	private Tag html;

	private Tag main;

	private Table summary;

	private HashMap<String, Chapter> chapters;

	private long totalTime;

	private int numberOfTests = 0;

	private int numberOfFails = 0;

	private DataReader hpr;

	long startTestTime = 0;

	boolean status = true;

	public HtmlSummaryReporterExtentsion() {
		this(new File(System.getProperty("user.dir")));
		File f = new File("summaryExtendded.html");
		setSummaryFile(f);
	}

	public HtmlSummaryReporterExtentsion(File summaryFile) {
		chapters = new HashMap<String, Chapter>();
		// setCurrentDirectory(currentDir);
		// summaryFile = new File(currentDir,"summary.html");
		setSummaryFile(summaryFile);
		html = new Tag("html");
		Tag head = new Tag("head");
		head.add(new Tag("link", "rel=stylesheet type=text/css href=./styles.css"));
		Tag title = new Tag("title");
		title.add("JSystem summary report");
		head.add(title);
		html.add(head);

		Tag body = new Tag("body");
		body.add(new Tag("H1", null, "JSystem summary report"));
		body.add(new Tag("p", false));
		body.add(new Tag("a", "href=index.html", "Detailed report"));
		body.add(new Tag("p", false));
		String link = SutFactory.getInstance().getSutInstance().getSetupLink();
		if (link != null) {
			body.add(new Tag("a", "href=\"" + link + "\"", "Setup"));
			body.add(new Tag("p", false));
		}
		html.add(body);
		main = new Tag("div", "align=left");
		main.add(new Tag("p", false));
		body.add(main);
		summary = new Table(new Object[0][]);

		main.add(summary);
		main.add(new Tag("p", false));

		main.add(getPropertiesTable());
		try {
			saveFile();
		} catch (Exception e) {
			log.log(Level.WARNING, "Fail to write file: " + summaryFile.getPath(), e);
		}

		String srcPath = JSystemProperties.getInstance().getPreference(FrameworkOptions.TESTS_SOURCE_FOLDER);
		hpr = new HtmlPackageReader(srcPath);

	}

	public void init() {

	}

	public void endTest(String testName, String packageName, long runTime, String commant) {
		totalTime += runTime;
		updateSummaryTable(status);
		Chapter c = (Chapter) chapters.get(packageName);
		if (c == null) {
			String title = hpr.getTitle(packageName);
			if (title == null) {
				title = packageName;
			}
			String description = hpr.getDescription(packageName);
			Table t = new Table(new String[][] { { "Test name", "status", "Comment" } });
			c = new Chapter(title, description, t);
			chapters.put(packageName, c);
			main.add(c);
		}

		Table table = c.getTable();
		Tag row = new Tag("TR");
		Tag testCell = new Tag("TD");
		Tag statusCell = new Tag("TD", "ALIGN=center");
		Tag commantCell = new Tag("TD");
		// Tag link = new Tag("a", "href=" + file,testName);
		testCell.add(testName);
		row.add(testCell);
		if (status) {
			Attribute atrib = new Attribute("BGCOLOR", "");
			row.addAttribute(atrib);
			statusCell.add("pass");

		} else {
			Attribute atrib = new Attribute("BGCOLOR", "");
			row.addAttribute(atrib);
			statusCell.add("fail");
		}
		row.add(statusCell);
		if (commant == null) {
			commant = " ";
		}
		commantCell.add(commant);
		row.add(commantCell);
		table.add(row);

		try {
			saveFile();
		} catch (Exception e) {
			log.log(Level.WARNING, "fail to save summary file", e);
		}

	}

	/**
	 * @return Returns the summaryFile.
	 */
	public File getSummaryFile() {
		return summaryFile;
	}

	/**
	 * @param summaryFile
	 *            The summaryFile to set.
	 */
	public void setSummaryFile(File summaryFile) {
		this.summaryFile = summaryFile;
	}

	private void saveFile() throws Exception {

		FileWriter writer = new FileWriter(summaryFile);
		writer.write(html.toString());
		writer.flush();
		writer.close();
	}

	private void updateSummaryTable(boolean isPass) {
		numberOfTests++;
		if (!isPass) {
			numberOfFails++;
		}
		summary.clear();
		Tag tableRow = new Tag("TR");
		tableRow.add(new Tag("TH", null, "General statistics"));
		tableRow.add(new Tag("TH"));
		summary.add(tableRow);
		tableRow = new Tag("TR");
		tableRow.add(new Tag("TD", null, "Number of tests"));
		tableRow.add(new Tag("TD", null, Integer.toString(numberOfTests)));
		summary.add(tableRow);
		tableRow = new Tag("TR");
		tableRow.add(new Tag("TD", null, "Number of fails"));
		tableRow.add(new Tag("TD", null, Integer.toString(numberOfFails)));
		summary.add(tableRow);
		tableRow = new Tag("TR");
		tableRow.add(new Tag("TD", null, "Running time"));
		tableRow.add(new Tag("TD", null, Long.toString((totalTime / 1000)) + " sec."));
		summary.add(tableRow);

	}

	private Tag getPropertiesTable() {
		Tag table = new Table(new Object[0][]);
		;
		Tag tableHeader = new Tag("TR");
		tableHeader.add(new Tag("TH", null, "Run properties"));
		tableHeader.add(new Tag("TH"));
		table.add(tableHeader);
		Tag tableRow = new Tag("TR");
		tableRow.add(new Tag("TD", null, "Data"));
		tableRow.add(new Tag("TD", null, DateUtils.getDate()));
		table.add(tableRow);
		tableRow = new Tag("TR");
		tableRow.add(new Tag("TD", null, "User"));
		tableRow.add(new Tag("TD", null, System.getProperty("user.name")));
		table.add(tableRow);
		File summaryProperties = new File("summary.properties");
		if (summaryProperties.exists()) {
			Properties p = new Properties();
			try {
				p.load(new FileInputStream(summaryProperties));
			} catch (Exception e) {
				e.printStackTrace();
			}
			Enumeration<?> enum1 = p.keys();
			while (enum1.hasMoreElements()) {
				String key = (String) enum1.nextElement();
				tableRow = new Tag("TR");
				tableRow.add(new Tag("TD", null, key));
				tableRow.add(new Tag("TD", null, p.getProperty(key)));
				table.add(tableRow);
			}
		}
		return table;
	}

	/*
	 * (non-Javadoc)
	 *
	 * @see jsystem.framework.launcher.report.TestReporter#initReporterManager()
	 */
	public void initReporterManager() throws IOException {

	}

	/*
	 * (non-Javadoc)
	 *
	 * @see jsystem.framework.launcher.report.TestReporter#asUI()
	 */
	public boolean asUI() {
		return false;
	}

	/*
	 * (non-Javadoc)
	 *
	 * @see jsystem.framework.launcher.report.TestReporter#report(java.lang.String,
	 *      java.lang.String, boolean, boolean)
	 */
	public void report(String title, String message, boolean isPass, boolean bold) {
		// TODO Auto-generated method stub

	}

	/*
	 * (non-Javadoc)
	 *
	 * @see jsystem.framework.launcher.report.TestReporter#getName()
	 */
	public String getName() {
		// TODO Auto-generated method stub
		return null;
	}

	/*
	 * (non-Javadoc)
	 *
	 * @see junit.framework.TestListener#addError(junit.framework.Test,
	 *      java.lang.Throwable)
	 */
	public void addError(Test test, Throwable t) {
		status = false;

	}

	/*
	 * (non-Javadoc)
	 *
	 * @see junit.framework.TestListener#addFailure(junit.framework.Test,
	 *      junit.framework.AssertionFailedError)
	 */
	public void addFailure(Test test, AssertionFailedError t) {
		status = false;
	}

	/*
	 * (non-Javadoc)
	 *
	 * @see junit.framework.TestListener#endTest(junit.framework.Test)
	 */
	public void endTest(Test test) {
		String testName;
		String testClass = test.getClass().getName();
		String packageName = StringUtils.getPackageName(testClass);
		testName = StringUtils.getClassName(testClass);
		String methodName = null;
		if (test instanceof TestCase) {
			methodName = ((TestCase) test).getName();
		}
		endTest(testName + "." + methodName, packageName, System.currentTimeMillis() - startTestTime, null);
	}

	/*
	 * (non-Javadoc)
	 *
	 * @see junit.framework.TestListener#startTest(junit.framework.Test)
	 */
	public void startTest(Test test) {
		startTestTime = System.currentTimeMillis();
		status = true;
	}

	public void report(String title, String message, int status, boolean bold) {

	}

}


text:
package rs.in.staleksit.booksopenapi;

import android.app.ActivityManager;
import android.content.Context;

import com.android.volley.RequestQueue;
import com.android.volley.toolbox.ImageLoader;
import com.android.volley.toolbox.Volley;
import com.google.android.gms.analytics.GoogleAnalytics;
import com.google.android.gms.analytics.Tracker;

import java.util.HashMap;

import rs.in.staleksit.booksopenapi.toolbox.BitmapLruCache;

/**
 * Created by astoisavljevic on 13.11.14..
 */
public class BookAppVolley {

    private static final String GOOGLE_ANALYTICS_BOOKS_OPEN_API_TRACKING_CODE = "UA-56765445-1";

    private static RequestQueue mRequestQueue;
    private static ImageLoader mImageLoader;
    private static HashMap<TrackerName, Tracker> mTrackers;
    private static GoogleAnalytics googleAnalytics;

    private BookAppVolley() {

    }

    static void init(Context context) {
        mRequestQueue = Volley.newRequestQueue(context);

        int memClass = ((ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE))
                .getMemoryClass();
        // Use 1/8th of the available memory for this memory cache.
        int cacheSize = 1024 * 1024 * memClass / 8;
        mImageLoader = new ImageLoader(mRequestQueue, new BitmapLruCache(cacheSize));

        googleAnalytics = GoogleAnalytics.getInstance(context);
        mTrackers = new HashMap<TrackerName, Tracker>();
    }

    public static RequestQueue getRequestQueue() {
        RequestQueue result = null;
        if (mRequestQueue != null) {
            result = mRequestQueue;
        } else {
            throw new IllegalStateException("RequestQueue can't be initialized!");
        }
        return result;
    }

    /**
     * Returns instance of ImageLoader initialized with {@see FakeImageCache} which effectively means
     * that no memory caching is used. This is useful for images that you know that will be show
     * only once.
     *
     * @return
     */
    public static ImageLoader getImageLoader() {
        if (mImageLoader != null) {
            return mImageLoader;
        } else {
            throw new IllegalStateException("ImageLoader not initialized");
        }
    }

    public static synchronized Tracker getTracker(TrackerName trackerName) {
        if (!mTrackers.containsKey(trackerName)) {
            Tracker tracker = googleAnalytics.newTracker(GOOGLE_ANALYTICS_BOOKS_OPEN_API_TRACKING_CODE);
            mTrackers.put(trackerName, tracker);
        }
        return mTrackers.get(trackerName);
    }

    public enum TrackerName {
        APP_TRACKER
    }

}


text:
<?php

namespace member\models;

use Yii;

/**
 * This is the model class for table "{{%user_level}}".
 *
 * @property integer $user_level_id
 * @property string $level_name
 * @property string $description
 * @property integer $team_num
 * @property integer $income_requirement
 * @property integer $big_touch_copping
 * @property integer $small_touch_copping
 * @property integer $total_worth_income
 * @property integer $addition_rewards
 * @property integer $created_at
 * @property integer $updated_at
 */
class UserLevel extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return '{{%user_level}}';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['income_requirement', 'big_touch_copping', 'small_touch_copping', 'total_worth_income', 'created_at', 'updated_at'], 'integer'],
            [['created_at', 'updated_at', 'description'], 'required'],
            [['level_name', 'team_num'], 'string', 'max' => 24],
            ['level_name', 'unique'],
            [['description','addition_rewards'], 'string', 'max' => 128],
            ['addition_rewards', 'safe']
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'user_level_id' => Yii::t('app', 'User Level ID'),
            'description' => Yii::t('app', '描述'),
            'level_name' => Yii::t('app', '用户等级名'),
            'team_num' => Yii::t('app', '左/右团队人数'),
            'income_requirement' => Yii::t('app', '前三个月收入要求'),
            'big_touch_copping' => Yii::t('app', '大对碰周封顶'),
            'small_touch_copping' => Yii::t('app', '小对碰月封顶'),
            'total_worth_income' => Yii::t('app', '月总收入封顶'),
            'addition_rewards' => Yii::t('app', '额外奖励'),
            'created_at' => Yii::t('app', 'Created At'),
            'updated_at' => Yii::t('app', 'Updated At'),
        ];
    }
}


text:
#ifndef __mod_h2__h2_session__
#define __mod_h2__h2_session__

#include "h2_conn_io.h"

/**
 * A HTTP/2 connection, a session with a specific client.
 *
 * h2_session sits on top of a httpd conn_rec* instance and takes complete
 * control of the connection data. It receives protocol frames from the
 * client. For new HTTP/2 streams it creates h2_task(s) that are sent
 * via callback to a dispatcher (see h2_conn.c).
 * h2_session keeps h2_io's for each ongoing stream which buffer the
 * payload for that stream.
 *
 * New incoming HEADER frames are converted into a h2_stream+h2_task instance
 * that both represent a HTTP/2 stream, but may have separate lifetimes. This
 * allows h2_task to be scheduled in other threads without semaphores
 * all over the place. It allows task memory to be freed independent of
 * session lifetime and sessions may close down while tasks are still running.
 *
 *
 */

#include "h2.h"

struct apr_thread_mutext_t;
struct apr_thread_cond_t;
struct h2_ctx;
struct h2_config;
struct h2_filter_cin;
struct h2_ihash_t;
struct h2_mplx;
struct h2_priority;
struct h2_push;
struct h2_push_diary;
struct h2_session;
struct h2_stream;
struct h2_stream_monitor;
struct h2_task;
struct h2_workers;

struct nghttp2_session;

typedef enum {
    H2_SESSION_EV_INIT,             /* session was initialized */
    H2_SESSION_EV_LOCAL_GOAWAY,     /* we send a GOAWAY */
    H2_SESSION_EV_REMOTE_GOAWAY,    /* remote send us a GOAWAY */
    H2_SESSION_EV_CONN_ERROR,       /* connection error */
    H2_SESSION_EV_PROTO_ERROR,      /* protocol error */
    H2_SESSION_EV_CONN_TIMEOUT,     /* connection timeout */
    H2_SESSION_EV_NO_IO,            /* nothing has been read or written */
    H2_SESSION_EV_DATA_READ,        /* connection data has been read */
    H2_SESSION_EV_NGH2_DONE,        /* nghttp2 wants neither read nor write anything */
    H2_SESSION_EV_MPM_STOPPING,     /* the process is stopping */
    H2_SESSION_EV_PRE_CLOSE,        /* connection will close after this */
} h2_session_event_t;

typedef struct h2_session {
    long id;                        /* identifier of this session, unique
                                     * inside a httpd process */
    conn_rec *c;                    /* the connection this session serves */
    request_rec *r;                 /* the request that started this in case
                                     * of 'h2c', NULL otherwise */
    server_rec *s;                  /* server/vhost we're starting on */
    const struct h2_config *config; /* Relevant config for this session */
    apr_pool_t *pool;               /* pool to use in session */
    struct h2_mplx *mplx;           /* multiplexer for stream data */
    struct h2_workers *workers;     /* for executing stream tasks */
    struct h2_filter_cin *cin;      /* connection input filter context */
    h2_conn_io io;                  /* io on httpd conn filters */
    struct nghttp2_session *ngh2;   /* the nghttp2 session (internal use) */

    h2_session_state state;         /* state session is in */

    h2_session_props local;         /* properties of local session */
    h2_session_props remote;        /* properites of remote session */

    unsigned int reprioritize  : 1; /* scheduled streams priority changed */
    unsigned int flush         : 1; /* flushing output necessary */
    unsigned int have_read     : 1; /* session has read client data */
    unsigned int have_written  : 1; /* session did write data to client */
    apr_interval_time_t  wait_us;   /* timeout during BUSY_WAIT state, micro secs */

    struct h2_push_diary *push_diary; /* remember pushes, avoid duplicates */

    struct h2_stream_monitor *monitor;/* monitor callbacks for streams */
    int open_streams;               /* number of client streams open */
    int unsent_submits;             /* number of submitted, but not yet written responses. */
    int unsent_promises;            /* number of submitted, but not yet written push promises */

    int responses_submitted;        /* number of http/2 responses submitted */
    int streams_reset;              /* number of http/2 streams reset by client */
    int pushes_promised;            /* number of http/2 push promises submitted */
    int pushes_submitted;           /* number of http/2 pushed responses submitted */
    int pushes_reset;               /* number of http/2 pushed reset by client */

    apr_size_t frames_received;     /* number of http/2 frames received */
    apr_size_t frames_sent;         /* number of http/2 frames sent */

    apr_size_t max_stream_count;    /* max number of open streams */
    apr_size_t max_stream_mem;      /* max buffer memory for a single stream */

    apr_time_t idle_until;          /* Time we shut down due to sheer boredom */
    apr_time_t keep_sync_until;     /* Time we sync wait until passing to async mpm */

    apr_bucket_brigade *bbtmp;      /* brigade for keeping temporary data */
    struct apr_thread_cond_t *iowait; /* our cond when trywaiting for data */

    char status[64];                /* status message for scoreboard */
    int last_status_code;           /* the one already reported */
    const char *last_status_msg;    /* the one already reported */

    struct h2_iqueue *in_pending;   /* all streams with input pending */
    struct h2_iqueue *in_process;   /* all streams ready for processing on slave */

} h2_session;

const char *h2_session_state_str(h2_session_state state);

/**
 * Create a new h2_session for the given connection.
 * The session will apply the configured parameter.
 * @param psession pointer receiving the created session on success or NULL
 * @param c       the connection to work on
 * @param cfg     the module config to apply
 * @param workers the worker pool to use
 * @return the created session
 */
apr_status_t h2_session_create(h2_session **psession,
                               conn_rec *c, struct h2_ctx *ctx,
                               struct h2_workers *workers);

/**
 * Create a new h2_session for the given request.
 * The session will apply the configured parameter.
 * @param psession pointer receiving the created session on success or NULL
 * @param r       the request that was upgraded
 * @param cfg     the module config to apply
 * @param workers the worker pool to use
 * @return the created session
 */
apr_status_t h2_session_rcreate(h2_session **psession,
                                request_rec *r, struct h2_ctx *ctx,
                                struct h2_workers *workers);

void h2_session_event(h2_session *session, h2_session_event_t ev,
                             int err, const char *msg);

/**
 * Process the given HTTP/2 session until it is ended or a fatal
 * error occurred.
 *
 * @param session the sessionm to process
 */
apr_status_t h2_session_process(h2_session *session, int async);

/**
 * Last chance to do anything before the connection is closed.
 */
apr_status_t h2_session_pre_close(h2_session *session, int async);

/**
 * Called when a serious error occurred and the session needs to terminate
 * without further connection io.
 * @param session the session to abort
 * @param reason  the apache status that caused the abort
 */
void h2_session_abort(h2_session *session, apr_status_t reason);

/**
 * Close and deallocate the given session.
 */
void h2_session_close(h2_session *session);

/**
 * Returns if client settings have push enabled.
 * @param != 0 iff push is enabled in client settings
 */
int h2_session_push_enabled(h2_session *session);

/**
 * Submit a push promise on the stream and schedule the new steam for
 * processing..
 *
 * @param session the session to work in
 * @param is the stream initiating the push
 * @param push the push to promise
 * @return the new promised stream or NULL
 */
struct h2_stream *h2_session_push(h2_session *session,
                                  struct h2_stream *is, struct h2_push *push);

apr_status_t h2_session_set_prio(h2_session *session,
                                 struct h2_stream *stream,
                                 const struct h2_priority *prio);

#define H2_SSSN_MSG(s, msg)     \
    "h2_session(%ld,%s,%d): "msg, s->id, h2_session_state_str(s->state), \
                            s->open_streams

#define H2_SSSN_LOG(aplogno, s, msg)    aplogno H2_SSSN_MSG(s, msg)

#endif /* defined(__mod_h2__h2_session__) */


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

         Match Scouting Report Page

                <form action= "submitMatchReport.php" method= "POST">

 Autonomous:

                        Team Number:
                        <input type = "number" name = "teamNumber" required/>

                        Coming from which drive station?

                        <input type = "radio" name = "driveStation" value = "stationOne" checked = "checked"/> 1

                        <input type = "radio" name = "driveStation" value = "stationTwo"/> 2

                        <input type = "radio" name = "driveStation" value = "stationThree"/> 3

                        Autonomous hopper?

                        <input type = "radio" name = "autoHopper" value = "True" checked = "checked"/> Yes

                        <input type = "radio" name = "autoHopper" value = "False"/> No

                        Crossed the line?

                        <input type = "radio" name = "crossLine" value = "True" checked = "checked"/> Yes

                        <input type = "radio" name = "crossLine" value = "False"/> No

                        Gear?

                        <input type = "radio" name = "gearUse" value = "True" checked = "checked"/> Yes

                        <input type = "radio" name = "gearUse" value = "False"/> No

                        <input type = "radio" name = "gearUse" value = "attempted"/> Tried and failed

                        On a scale of 1 - 5, how good was the shooter? (1= mostly miss, 5=perfect shooter)
                        <input type = "number" name = "shooterRating">

                        Has shooter?

                        <input type = "radio" name = "engageHopper" value = "True" checked = "checked"/> Yes

                        <input type = "radio" name = "engageHopper" value = "False"/> No

  Teleop:

                        Needs to shoot from a particular place in the floor?

                        <input type = "radio" name = "shootingPlace" value = "True" checked = "checked"> Yes

                        <input type = "radio" name = "shootingPlace" value = "False"> No

                        If so, where do they shoot from?

                        <input type = "text" name = "whereShootingPlace" value = " ">

                        Susceptible to defense?

                        <input type = "radio" name = "susceptibleDefense" value = "True" checked = "checked"> Yes

                        <input type = "radio" name = "susceptibleDefense" value = "False"> No

                        Attempted high goal?

                        <input type = "radio" name = "highGoal" value = "True" checked = "checked"> Yes

                        <input type = "radio" name = "highGoal" value = "False"> No

                        Attempted low goal?

                        <input type = "radio" name = "lowGoal" value = "True" checked = "checked"> Yes

                        <input type = "radio" name = "lowGoal" value = "False"> No

                        Feeder Preference?

                        <input type = "checkbox" name = "feederPreference[]" value = "Opposite Left"> Opposite Left

                        <input type = "checkbox" name = "feederPreference[]" value = "Opposite Right"> Opposite right

                        <input type = "checkbox" name = "feederPreference[]" value = "Same side"> Same side

                        <input type = "checkbox" name = "feederPreference[]" value = "No Feeder"> None

                        Capable of picking up balls?

                        <input type = "radio" name = "pickUp" value = "True" checked = "checked"> Yes

                        <input type = "radio" name = "pickUp" value = "False"> No

                        Nuclear option? (This is the ability to dump all balls from hoppers at beginning of match, a defense tactic)

                        <input type = "radio" name = "nuclear" value = "True" checked = "checked"> Yes

                        <input type = "radio" name = "nuclear" value = "False"> No

                        Teleop hopper?

                        <input type = "radio" name = "teleopHopper" value = "True" checked = "checked"> Yes

                        <input type = "radio" name = "teleopHopper" value = "False"> No

                        Gears passed to airship?
                        <input type = "number" name = "gearsPassedInAirship" required value="0">

                        Peg preference?

                        <input type = "checkbox" name = "gearPegPreference[]" value = "Left peg"> Left

                        <input type = "checkbox" name = "gearPegPreference[]" value = "Right peg"> Right

                        <input type = "checkbox" name = "gearPegPreference[]" value = "Center peg"> Center

                        Climbing:

                        When did it head to rope (seconds)?

                        <input type = "number" name = "headingToRopeTime" value="" required>

                        How long did it take to grap the rope (seconds)?

                        <input type = "number" name = "timeToGrab" value="" required>

                        How long did it take to climb (seconds)?

                        <input type = "number" name = "timeToClimb" value="" required>

                        Did the light stay on past T=0?

                        <input type = "radio" name = "lightOn" value = "True" checked = "checked"> Yes

                        <input type = "radio" name = "lightOn" value = "False"> No

                        Climb rope?

                        <input type = "radio" name = "climbRope" value = "True" checked = "checked"> Yes

                        <input type = "radio" name = "climbRope" value = "False"> No

                        Comments?
                        <input type = "text" name = "comments">

                        Does the robot play defense?

                        <input type = "radio" name = "robotDefense" value = "True" checked = "checked"> Yes

                        <input type = "radio" name = "robotDefense" value = "False"> No

                        Rate the robot from 1-10 (1 being didn't move and 10 being awesome)

                        <input type = "number" name = "robotRating" value="" required>

                        Competition:

                        <input type = "radio" name = "competition" value = "Competition 1" checked = "checked"> San Francisco Regional

                        <input type = "radio" name = "competition" value = "Competition 2"> Sacramento Regional

                        <input type = "radio" name = "competition" value = "Competition 3"> Competition 3

                        Team score:
                        <input type = "number" name = "teamScore"  value="" required>

                        <button type = "submit" style="left:23%;">  Submit </button>

                </form>


text:
/*
 * Project Bluebox
 * 2015, University of Stuttgart, IPVS/AS
 *
 */

/*
 *	Project Bluebox
 *
 *	Copyright (C) <2015> <University of Stuttgart>
 *
 *	This software may be modified and distributed under the terms
 *	of the MIT license.  See the LICENSE file for details.
 */

/*
 * *********************************************************************
 * *********************************************************************
 * this gets called as soon as the browser has finished parsing the DOM
 * so this is the entry function
 *
 *
 */
$(document).ready(function() {
	buildContainerTable();
	$("#SuccessAlert").hide()
	$("#ErrorAlert").hide()
	uploadRequest();
	createRequest();
});

/*
 * *********************************************************************
 * *********************************************************************
 * clear the entire table
 *
 */
function clearSwiftTable(){
	$("#swiftList").children().remove();
}

/*
 * *********************************************************************
 * *********************************************************************
 * container table stuff
 *
 */
function buildContainerTable(){
	$("#backBtn").hide()
	$("#createContainerDiv").show()
	$("#createContainerForm").show()
	$("#uploadObjectDiv").hide()
	$("#uploadObjectForm").hide()
	$("#checkOldFilesBtn").hide()
	$("#deleteOldFilesBtn").hide()
	$("#SuccessAlert").hide()
	$("#ErrorAlert").hide()
	hideAllPopovers();
	clearSwiftTable();
	$("#SwiftTableHeading h3").html("List of containers");

	$(window).scroll(function() {
		if($(window).scrollTop() + $(window).height() == $(document).height()) {
			buildContainerTableContent(t);
		}
	})

	var t = $("#swiftList");
	buildContainerTableHeader(t);
	buildContainerTableContent(t);
}

function buildContainerTableHeader(table){
	//build header row
	var hr = $('
');
	hr.append($('').html("Name"));
	hr.append($('').html("Size"));
	hr.append($('').html("Objects"));
	hr.append($('').html("Enter"));
	table.append(hr);
}

function buildContainerTableContent(table){
	$.get("/swift/containers").success(function(data){

		for (var i = 0 ; i < data.length ; i++) {
			var row = $('
');
			row.append($('').html(data[i].name));
			row.append($('').html(fileSizeSI(data[i].bytes)));
			row.append($('').html(data[i].count));
			row.append($('')
				.html('<input type="button" class="btn btn-info" value=">>>"/>')
				.data("containerName", data[i].name)
				.click(function() {enterContainer($(this))}));

			table.append(row);
		}
	})
}
var containerName;
function enterContainer(d){
	containerName = d.data("containerName");
	buildObjectTable(containerName);

}

/*
 * *********************************************************************
 * *********************************************************************
 * object table stuff
 *
 */
function buildObjectTable(container){
	$("#backBtn").show()
	$("#createContainerDiv").hide()
	$("#createContainerForm").hide()
	$("#uploadObjectDiv").show()
	$("#uploadObjectForm").show()
	$("#checkOldFilesBtn").show()
	$("#deleteOldFilesBtn").show()
	$("#ErrorAlert").hide()
	clearSwiftTable();
	document.getElementById("containerTxtUp").defaultValue = container;
	$("#SwiftTableHeading h3").html("List of objects in container '" + container + "'");

	var t = $("#swiftList");
	buildObjectTableHeader(t);
	buildObjectTableContent(t, container);
}

function buildObjectTableHeader(table){
	//build header row
	var hr = $('
');
	hr.append($('').html("Name"));
	hr.append($('').html("Size"));
	hr.append($('').html("Type"));
	hr.append($('').html("Last Modification Date"));
	hr.append($('').html("Delete"));
	hr.append($('').html("Details"));
	table.append(hr);
}

var contName;
var objName;

function buildObjectTableContent(table, container){
	$.get("/swift/containers/" + container + "/objects").success(function(data){

		for (var i = 0 ; i < data.length ; i++) {
			var row = $('
');
			// this information form objects body
			row.append($('').html(data[i].name));
			row.append($('').html(fileSizeSI(data[i].bytes)));
			row.append($('').html(data[i].content_type));
			row.append($('').html(data[i].last_modified));
//			row.append($('')
//					.html('<input type="button" class="btn btn-success" value="GET"/>')
//
//					.click(function() {row.append($('')
//							           .html($(this).last_modified ;)})
//					);
			row.append($('')
				.html('<input type="button" class="btn btn-success" value="GET"/>')
				.data("containerName", container)
				.data("objectName", data[i].name)
				.click(function() {getObject($(this))})
				);
			row.append($('')
				.html('<input type="button" class="btn btn-danger" value="DELETE"/>')
				.data("containerName", container)
				.data("objectName", data[i].name)
				.click(function() {deleteObject($(this))})
				);
			row.append($('')
					.html('<input type="button" class="btn btn-info pop-show" data-toggle="popover" id="btnpopover" title="Popover Header" value="DETAILS"/>')
					.data("containerName", container)
					.data("objectName", data[i].name)
					.click(function()
                        {
                        var newdata = $(this);
                        contName = newdata.data("containerName");
                        objName = newdata.data("objectName");
                        $('.pop-show').popover
                        ({
                            html : true,
                            content : function() {
                                return getMetadataDetails(contName,objName)}
                        }).click(function(e) {
                            $(this).popover('toggle');
                            e.stopPropagation();
                        });
                        $('.pop-show').on('click', function (e) {
                               $('.pop-show').not(this).popover('hide');
                            });

                        }));
			table.append(row);
		}
	})

}

var convData;
function getMetadataDetails(containerName,objectName){
	var url = "/swift/containers/" + containerName + "/objects/" + encodeURIComponent(objectName) + "/details";
	$.get(url).success(function(data){
		var Datas = eval(data);
		jsData={};
		// this information coming from Response objects headers
		jsData['ownerName'] = Datas['x-object-meta-ownername'];
		jsData['content-type'] = Datas['content-type'];
		jsData['Date'] = Datas['date'];
		jsData['owner2'] = Datas['x-object-meta-owner1']; // new Header
		convData = JSON.stringify(jsData);
		return convData;
	});
	return convData;
}

function enterMetadataDetails(d){
	var containerName = d.data("containerName");
	buildObjectTable(containerName);

}

function getObject(d){
	var containerName = d.data("containerName");
	var objectName = d.data("objectName");
	var url = "/swift/containers/" + containerName + "/objects/" + encodeURIComponent(objectName);
	window.location.replace(url);
}

function deleteObject(d){
	var containerName = d.data("containerName");
	var objectName = d.data("objectName");
	var url = "/swift/containers/" + containerName + "/objects/" + encodeURIComponent(objectName);
	$.ajax({
	    url: url,
	    type: 'DELETE',
	    success: function(data) {

	    	 if (data.deletestatus === "done") {

	    		 $("#SuccessAlert").show();
	    		$("#SuccessAlert").html('Success! File is successfully deleted!');
	    		 buildObjectTable(containerName);
	    		} else {

	    			$("#ErrorAlert").show();
	    			$("#ErrorAlert").html('Error! The retention date is: '+ data.retention+"\n"+"\n The following time has been left for deletion: \n"+ " weeks: "+data.weeks+"\n days: "+data.days+"\n hours: "+data.hours+"\n minutes: "+data.minutes+"\n seconds: "+data.seconds);
	    		}

	        // Do something with the result
	    }
	});
}

/*
 * *********************************************************************
 * *********************************************************************
 * utility functions
 *
 */

/*
 * from: http://stackoverflow.com/questions/10420352/converting-file-size-in-bytes-to-human-readable
 * divides an integer by factors of 1000 (or 1024) to match the closest SI unit.
 * --> this function converts "bits/bytes" to kilo/mega/giga/...
 */
function fileSizeIEC(a,b,c,d,e){
 return (b=Math,c=b.log,d=1024,e=c(a)/c(d)|0,a/b.pow(d,e)).toFixed(2)
 +' '+(e?'KMGTPEZY'[--e]+'iB':'Bytes')
}
function fileSizeSI(a,b,c,d,e){
 return (b=Math,c=b.log,d=1e3,e=c(a)/c(d)|0,a/b.pow(d,e)).toFixed(2)
 +' '+(e?'kMGTPEZY'[--e]+'B':'Bytes')
}

/*
 * *********************************************************************
 * *********************************************************************
 * Checking Old files and deleting old files
 *
 */
function CheckOldFiles()
{
		var url = "/swift/containers/" + containerName + "/CheckOldFiles/";
		$.ajax({
	    url: url,
	    type: 'GET',
	    success: function(data) {
	    	filelist = data["list"]
	    	alert(JSON.stringify(filelist))
	    	}

		});
}

function DeleteOldFiles()
{
		var url = "/swift/containers/" + containerName + "/DeleteOldFiles/";
		$.ajax({
	    url: url,
	    type: 'Delete',
	    success: function(data) {
	    	filelist = data["list"]
	    	alert(JSON.stringify(filelist))
	    	buildObjectTable(containerName);
	    		}

		});
}

/*
 * *********************************************************************
 * *********************************************************************
 * Creating folders and uploading files
 *
 */
function createRequest(){
	$('#createContainerForm').submit(function(e){
	    $.ajax({
	        url:'/create',
	        type:'post',
	        data:$('#createContainerForm').serialize(),
	        success:function(){
	            alert("success");
	            buildContainerTable();
	        }
	    });
	    e.preventDefault();
	});

}

function uploadRequest(){
	$('#uploadObjectForm').submit(function(e){

	    $.ajax({
	        url:'/upload',
	        type:'post',
	        data:new FormData($(this)[0]),
	        processData:false,
	        contentType:false,
	        success:function(){
	            alert("success");
	            buildObjectTable(containerName);
	        }
	    });
	    e.preventDefault();
	});
}

function hideAllPopovers(){
    $('.pop-show').each(function() {
         $(this).popover('hide');
     });
 };


text:
/*
	This file is part of cpp-ethereum.

	cpp-ethereum is free software: you can redistribute it and/or modify
	it under the terms of the GNU General Public License as published by
	the Free Software Foundation, either version 3 of the License, or
	(at your option) any later version.

	cpp-ethereum is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
	GNU General Public License for more details.

	You should have received a copy of the GNU General Public License
	along with cpp-ethereum.  If not, see <http://www.gnu.org/licenses/>.
*/
/** @file CanonBlockChain.h
 * @author Gav Wood <i@gavwood.com>
 * @date 2014
 */

#pragma once

#pragma warning(push)
#pragma warning(disable: 4100 4267)
#include <leveldb/db.h>
#pragma warning(pop)

#include <mutex>
#include <libdevcore/Log.h>
#include <libdevcore/Exceptions.h>
#include <libethcore/Common.h>
#include <libethcore/BlockInfo.h>
#include <libdevcore/Guards.h>
#include "BlockDetails.h"
#include "Account.h"
#include "BlockQueue.h"
#include "BlockChain.h"
namespace ldb = leveldb;

namespace dev
{

namespace eth
{

// TODO: Move all this Genesis stuff into Genesis.h/.cpp
std::map<Address, Account> const& genesisState();

/**
 * @brief Implements the blockchain database. All data this gives is disk-backed.
 * @threadsafe
 * @todo Make not memory hog (should actually act as a cache and deallocate old entries).
 */
class CanonBlockChain: public BlockChain
{
public:
		CanonBlockChain(WithExisting _we = WithExisting::Trust, ProgressCallback const& _pc = ProgressCallback()): CanonBlockChain(std::string(), _we, _pc) {}
		CanonBlockChain(std::string const& _path, WithExisting _we = WithExisting::Trust, ProgressCallback const& _pc = ProgressCallback());
		~CanonBlockChain() {}

		/// @returns the genesis block header.
		static BlockInfo const& genesis() { UpgradableGuard l(x_genesis); if (!s_genesis) { auto gb = createGenesisBlock(); UpgradeGuard ul(l); s_genesis.reset(new BlockInfo); s_genesis->populate(&gb); } return *s_genesis; }

		/// @returns the genesis block as its RLP-encoded byte array.
		/// @note This is slow as it's constructed anew each call. Consider genesis() instead.
		static bytes createGenesisBlock();

private:
		/// Static genesis info and its lock.
		static boost::shared_mutex x_genesis;
		static std::unique_ptr<BlockInfo> s_genesis;
};

}
}


text:
package protocols

import models.TimeBased
import play.api.http._
import play.api.mvc._

import scala.concurrent._

/**
 * See RFC 7234
 *
 * @author zepeng.li@gmail.com
 */
object HttpCaching {

  def async[T <: TimeBased](block: T => Future[Result])(
    implicit req: RequestHeader, ec: ExecutionContext
  ): T => Future[Result] = { entity =>
    val updated_at = entity.updated_at.withMillisOfSecond(0)
    req.headers.get(HeaderNames.IF_MODIFIED_SINCE)
      .map(dateFormat.parseDateTime) match {
      case Some(d) if !d.isBefore(updated_at) =>
        Future.successful(Results.NotModified)
      case _                                  =>
        block(entity).map(
          _.withHeaders(
            HeaderNames.LAST_MODIFIED -> dateFormat.print(updated_at)
          )
        )
    }
  }

  def apply[T <: TimeBased](block: T => Result)(
    implicit req: RequestHeader, ec: ExecutionContext
  ): T => Future[Result] = async[T](t => Future.successful(block(t)))
}


text:
using System;

namespace GitHub.Unity
{
    sealed class Credential : ICredential
    {
        public Credential(UriString host)
        {
            this.Host = host;
        }

        public Credential(UriString host, string username, string token)
        {
            this.Host = host;
            this.Username = username;
            this.Token = token;
        }

        public void Update(string token, string username)
        {
            this.Token = token;
            this.Username = username;
        }

        public UriString Host { get; private set; }
        public string Username { get; private set; }
        public string Token { get; private set; }

        private bool disposed = false;
        void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (!disposed)
                {
                    disposed = true;
                    Token = null;
                }
            }
        }

        public void Dispose()
        {
            Dispose(true);
        }
    }
}


text:
.. Licensed to the Apache Software Foundation (ASF) under one
   or more contributor license agreements.  See the NOTICE file
   distributed with this work for additional information#
   regarding copyright ownership.  The ASF licenses this file
   to you 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.

Getting Help
============

Need some help getting started? Feel free to ask on the `mailing list
<http://cloudstack.apache.org/mailing-lists.html>`_:

-  `users@ <http://mail-archives.apache.org/mod_mbox/cloudstack-users/>`_: This
   list is for users of CloudStack to seek and provide support. This is a
   moderately high volume list.
-  `dev@ <http://mail-archives.apache.org/mod_mbox/cloudstack-dev/>`_: Where
   discussions about development and the project itself happen. This is a high
   volume list.

Or on one of the following IRC channels on irc.freenode.net:

-  #cloudstack - General Apache CloudStack conversation and end user support
-  #cloudstack-dev - Development discussions
-  #cloudstack-meeting - Weekly and ad-hoc meeting room for the Apache CloudStack community

Documentation Available
-----------------------

The following guides are available:

-  `CloudStack Installation Guide`_ - Covers initial installation of CloudStack. It aims to cover in full detail all the
   steps and requirements to obtain a functioning cloud deployment.
   At times, this guide mentions additional topics in the context of installation tasks, but does not
   give full details on every topic. Additional details on many of these topics can be found in the
   Administration Guide. For example, security groups, firewall and load balancing
   rules, IP address allocation, and virtual routers are covered in more detail in the Administration
   Guide.

-  `CloudStack Administrator's Guide`_ - Discusses how to set up services for the end users of your cloud. Also
   covers ongoing runtime management and maintenance. This guide discusses topics like domains,
   accounts, service offerings, projects, guest networks, administrator alerts, virtual machines, storage,
   and measuring resource usage.

-  `Developer's Guide <dev.html>`_ - How to use the API to interact with CloudStack programmatically. Includes
   links to the complete API Reference.

-  `CloudStack Apidocs`_ - API documentation reference.

-  `Release Notes`_ - release specific documentation, including upgrade
   instructions from prior releases, new features added to CloudStack, API changes, and fixed issues.

Books
-----

|60recipe| |acs-packt| |jp1| |jp2|

Commercial support
------------------

Some companies offer commercial support for Apache CloudStack or their own
product based on CloudStack.

.. include:: _global.rst

.. |60recipe| image:: _static/images/60recipe.gif
   :alt: O'Reilly 60 Recipes for Apache CloudStack
   :target: http://shop.oreilly.com/product/0636920034377.do
.. |acs-packt| image:: _static/images/packt.png
   :alt: Apache CloudStack Cloud Computing
   :target: https://www.packtpub.com/virtualization-and-cloud/apache-cloudstack-cloud-computing
.. |jp1| image:: _static/images/jp1.jpg
   :alt: CloudStack徹底入門 大型本
   :target: http://www.amazon.co.jp/gp/product/4798130583/ref=as_li_ss_tl?ie=UTF8&camp=247&creative=7399&creativeASIN=4798130583&linkCode=as2&tag=aaaaaaaeaeaea-22
.. |jp2| image:: _static/images/jp2.jpg
   :alt: CloudStack実践ガイド[前編]
   :target: http://www.amazon.co.jp/CloudStack%E5%AE%9F%E8%B7%B5%E3%82%AC%E3%82%A4%E3%83%89-%E5%89%8D%E7%B7%A8-NextPublishing-%E5%A4%A7%E5%89%8A-%E7%B7%91/dp/4844395920/ref=pd_bxgy_b_img_y


text:
A test repo for a ton of things

Added a line to test `fetch`


text:
package com.thoughtworks.go.agent;

import java.io.*;

public class AgentConsoleLogThread extends Thread {
    private final InputStream inputStream;
    private final AgentOutputAppender agentOutputAppender;

    private volatile boolean keepRunning;
    private volatile boolean flushedAfterStop;

    public AgentConsoleLogThread(InputStream inputStream, AgentOutputAppender agentOutputAppender) {
        this.inputStream = inputStream;
        this.agentOutputAppender = agentOutputAppender;

        setDaemon(true);
        keepRunning = true;
        flushedAfterStop = false;
    }

    @Override
    public void run() {
        try (BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream))) {
            try {
                pipeLogs(reader);
            } finally {
                agentOutputAppender.close();
            }
        } catch (IOException e) {
            throw new UncheckedIOException(e);
        }
    }

    private void pipeLogs(BufferedReader reader) {
        while (true) {
            if (!keepRunning && flushedAfterStop) {
                break;
            }
            try {
                logConsoleError(reader);
                Thread.sleep(100);
            } catch (Exception e) {
                System.err.println("Error occured while capturing console output from agent process: ");
                e.printStackTrace();
                break;
            }
        }
    }

    private void logConsoleError(final BufferedReader reader) {
        flushedAfterStop = !keepRunning;
        try {
            reader.lines().forEach(agentOutputAppender::write);
        } catch (Exception ignore) {
            // we failed to log, mostly because we're shutting down
        }
    }

    void stopAndJoin() throws InterruptedException {
        keepRunning = false;
        Thread.sleep(1000); // give some time to allow any logs to be flushed out.
        agentOutputAppender.close();
        join();
    }
}