text:
var __extends = this.__extends || function (d, b) {
    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
    function __() { this.constructor = d; }
    __.prototype = b.prototype;
    d.prototype = new __();
};
define(["require", "exports", 'dojo/dom-class', 'dojo/dom-construct', 'dojo/_base/lang', './SingleNodeWidget', '../../util'], function (require, exports, domClass, domConstruct, lang, SingleNodeWidget, util) {
    function proxyAttachmentState(widget, properties, value) {
        for (var i = 0, j = properties.length; i < j; ++i) {
            var child = widget.get(properties[i]);
            if (child) {
                child.set('isAttached', value);
            }
        }
    }
    function contains(maybeParent, candidate) {
        do {
            if (maybeParent === candidate) {
                return true;
            }
        } while ((candidate = candidate.get('parent')));
        return false;
    }
    var DropDown = (function (_super) {
        __extends(DropDown, _super);
        function DropDown(kwArgs) {
            util.deferSetters(this, ['label', 'dropDown'], '_render');
            _super.call(this, kwArgs);
        }
        DropDown.prototype._childrenGetter = function () {
            return [this.get('label'), this.get('dropDown')];
        };
        DropDown.prototype._childrenSetter = function (children) {
            if (children) {
                this.set('label', children[0]);
                this.set('dropDown', children[1]);
            }
            else {
                this.set('label', null);
                this.set('dropDown', null);
            }
        };
        DropDown.prototype._dropDownGetter = function () {
            return this._dropDown;
        };
        DropDown.prototype._dropDownSetter = function (value) {
            if (this._dropDown) {
                this._dropDown.detach();
                this._dropDown.set({ isAttached: false, parent: null });
            }
            this._dropDown = value;
            if (value) {
                this._dropDownNode.appendChild(value.detach());
                value.set({ isAttached: this.get('isAttached'), parent: this });
            }
        };
        DropDown.prototype._isAttachedGetter = function () {
            return this._isAttached;
        };
        DropDown.prototype._isAttachedSetter = function (value) {
            proxyAttachmentState(this, ['label', 'dropDown'], value);
            this._isAttached = value;
        };
        DropDown.prototype._isOpenGetter = function () {
            return this._isOpen;
        };
        DropDown.prototype._isOpenSetter = function (value) {
            this._isOpen = value;
            domClass.toggle(this._node, 'open', value);
        };
        DropDown.prototype._labelGetter = function () {
            return this._label;
        };
        DropDown.prototype._labelSetter = function (value) {
            this._labelHandle && this._labelHandle.remove();
            if (this._label) {
                this._label.detach();
                this._label.set({ isAttached: false, parent: null });
            }
            this._label = value;
            if (value) {
                var self = this;
                this._labelHandle = util.createCompositeHandle(value.on('activate', lang.hitch(this, '_toggle')), value.observe('parent', function (newParent) {
                    if (newParent !== self) {
                        self.set('label', null);
                    }
                }));
                this._labelNode.appendChild(value.detach());
                value.set({ isAttached: this.get('isAttached'), parent: this });
            }
        };
        DropDown.prototype.destroy = function () {
            _super.prototype.destroy.call(this);
            this._label && this._label.destroy();
            this._dropDown && this._dropDown.destroy();
            this._globalHandle.remove();
        };
        DropDown.prototype._render = function () {
            this._node = domConstruct.create('div', { className: 'DropDown' });
            this._labelNode = domConstruct.create('div', { className: 'LabelContainer' }, this._node);
            this._dropDownNode = domConstruct.create('div', { className: 'DropDownContainer' }, this._node);
            var self = this;
            this._globalHandle = this.get('app').get('ui').on('pointerdown', function (event) {
                if (self.get('isOpen') && !contains(self.get('dropDown'), event.target)) {
                    self.set('isOpen', false);
                    event.stopPropagation();
                    event.preventDefault();
                }
            });
        };
        DropDown.prototype._toggle = function (event) {
            if (!this.get('isOpen')) {
                this.set('isOpen', true);
                event.stopPropagation();
                event.preventDefault();
            }
        };
        return DropDown;
    })(SingleNodeWidget);
    return DropDown;
});
//# sourceMappingURL=../../_debug/ui/dom/DropDown.js.map


text:
#ifndef itkFFTWRealToHalfHermitianForwardFFTImageFilter_h
#define itkFFTWRealToHalfHermitianForwardFFTImageFilter_h

#include "itkRealToHalfHermitianForwardFFTImageFilter.h"

#include "itkFFTWCommon.h"

namespace itk
{
/** \class FFTWRealToHalfHermitianForwardFFTImageFilter
 *
 * \brief FFTW-based forward Fast Fourier Transform.
 *
 * This filter computes the forward Fourier transform of an image. The
 * implementation is based on the FFTW library.
 *
 * This filter is multithreaded and supports input images of any size.
 *
 * In order to use this class, ITK_USE_FFTWF must be set to ON in the CMake
 * configuration to support float images, and ITK_USE_FFTWD must set to ON to
 * support double images.
 *
 * This implementation was taken from the Insight Journal paper:
 * https://hdl.handle.net/10380/3154
 * or http://insight-journal.com/browse/publication/717
 *
 * \author Gaetan Lehmann. Biologie du Developpement et de la Reproduction, INRA de Jouy-en-Josas, France.
 *
 * \ingroup FourierTransform
 * \ingroup MultiThreaded
 * \ingroup ITKFFT
 *
 * \sa FFTWGlobalConfiguration
 * \sa RealToHalfHermitianForwardFFTImageFilter
 */
template< typename TInputImage, typename TOutputImage=Image< std::complex<typename TInputImage::PixelType>, TInputImage::ImageDimension> >
class FFTWRealToHalfHermitianForwardFFTImageFilter:
  public RealToHalfHermitianForwardFFTImageFilter< TInputImage, TOutputImage >
{
public:
  /** Standard class typedefs. */
  typedef TInputImage                          InputImageType;
  typedef typename InputImageType::PixelType   InputPixelType;
  typedef typename InputImageType::SizeType    InputSizeType;
  typedef TOutputImage                         OutputImageType;
  typedef typename OutputImageType::PixelType  OutputPixelType;
  typedef typename OutputImageType::SizeType   OutputSizeType;

  typedef FFTWRealToHalfHermitianForwardFFTImageFilter                          Self;
  typedef RealToHalfHermitianForwardFFTImageFilter< TInputImage, TOutputImage > Superclass;
  typedef SmartPointer< Self >                                                Pointer;
  typedef SmartPointer< const Self >                                          ConstPointer;

  /** The proxy type is a wrapper for the FFTW API. Because the proxy
   * is defined only for double and float, trying to use any other
   * pixel type is unsupported, as is trying to use double if only the
   * float FFTW version is configured in, or float if only double is
   * configured. */
  typedef typename fftw::Proxy< InputPixelType > FFTWProxyType;

  /** Method for creation through the object factory. */
  itkNewMacro(Self);

  /** Run-time type information (and related methods). */
  itkTypeMacro(FFTWRealToHalfHermitianForwardFFTImageFilter,
               RealToHalfHermitianForwardFFTImageFilter);

  /** Define the image dimension. */
  itkStaticConstMacro(ImageDimension, unsigned int, InputImageType::ImageDimension);

  /** Set/Get the behavior of wisdom plan creation. The default is
   * provided by FFTWGlobalConfiguration::GetPlanRigor().
   *
   * The parameter is one of the FFTW planner rigor flags FFTW_ESTIMATE, FFTW_MEASURE,
   * FFTW_PATIENT, FFTW_EXHAUSTIVE provided by FFTWGlobalConfiguration.
   *
   * /sa FFTWGlobalConfiguration
   */
  virtual void SetPlanRigor( const int & value )
  {
    // Use that method to check the value
    FFTWGlobalConfiguration::GetPlanRigorName( value );
    if( m_PlanRigor != value )
      {
      m_PlanRigor = value;
      this->Modified();
      }
  }
  itkGetConstReferenceMacro( PlanRigor, int );

  SizeValueType GetSizeGreatestPrimeFactor() const ITK_OVERRIDE;

protected:
  FFTWRealToHalfHermitianForwardFFTImageFilter();
  ~FFTWRealToHalfHermitianForwardFFTImageFilter() {}

  virtual void GenerateData() ITK_OVERRIDE;

  virtual void UpdateOutputData(DataObject *output) ITK_OVERRIDE;

  void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;

private:
  ITK_DISALLOW_COPY_AND_ASSIGN(FFTWRealToHalfHermitianForwardFFTImageFilter);

  bool m_CanUseDestructiveAlgorithm;

  int m_PlanRigor;
};
} // namespace itk

#ifndef ITK_MANUAL_INSTANTIATION
#include "itkFFTWRealToHalfHermitianForwardFFTImageFilter.hxx"
#endif

#endif //itkFFTWRealToHalfHermitianForwardFFTImageFilter_h

redpajama_set_name: RedPajamaGithub


text:
This project is an assignment for CSCI 3200 (XML Processing) course at APSU. Being this is an educational project for a grade, collaboration isn't exactly the goal here. But if you feel that you can benefit from perusing my code, go for it!

For reference, I have included the original assignment instructions. Additionally, I have included the sample text files and the resulting XML documents.

##What it Does
The purpose of the project is to extract specialized information from a text file (data is separated by whitespace) and create a well-formed XML document based on the specifications of the project assignment. It works by reading and extracting information from the input file, storing that information in a couple structs, and then writing it to the output file. It allows the user to specify the input and output files, quits if the input file is not found, and ensures that the output file contains the `.xml` file extension. Read the included project assignment instructions for more details.

##Compiling
This project was compiled with the g++ compiler on an Arch linux machine. It *should* work with other Linux environments. Windows developers should be aware some changes to the program as well as system configuration may be necessary for it to function correctly on your system.

To compile the project, use the following command:

`g++ main.cpp`

##Dependencies

This project does not use features outside of the STL, so no worries about dependencies here.

##Academic Honesty
Please, just keep in mind that academic dishonesty is probably (definitely) not tolerated by your educational institution, so come up with your own solutions. Besides, I sincerely doubt that your assignment has the same requirements as mine, so you will probably look like an idiot if you try to turn this in.

##Credits
I didn't find that I needed assistance on this project, and all of the code is mine.

##Questions/Comments/Concerns
If you have any questions regarding this project, send me a message and I'd be more than happy to explain my code.


text:
package bibliography

// An Entry contains the common BibTeX field types.
//
// See https://en.wikipedia.org/wiki/BibTeX#Field_types for a list of the common field types used in BibTeX.
type Entry struct {

	// Address is the partial or full address of the publisher.
	// Often, this refers just to the city the publisher is located in.
	Address string

	// Author is the list of author(s) associated with the cited material.
	Author []string

	// BookTitle is the title of the book and is used when only part of of the book is being cited.
	BookTitle string

	// Chapter is the chapter number from which the citation is being made
	Chapter string

	// Edition is the edition of a book.
	// It is good practice to express this in long form such as "First" or "Second"
	Edition string

	// Editor is the list of editor(s) associated with the cited material
	Editor []string

	// HowPublished is used to describe the publishing method of the cited material when it was not a standard method.
	HowPublished string

	// Institution is used to name of the institution who were involved in the cited material.
	// This typically is used when the institution is not the actual publisher.
	Institution string

	// Journal is the name for the journal or magazine that the citation was taken from.
	Journal string

	// Key is used specifying or overriding the alphabetical order of entries
	Key string

	// Month is the month of publication.
	// For unpublished material, the month of creation can be used instead.
	Month string

	// Note is any addition information that is needed to describe the cited material.
	Note string

	// Number is the "(issue) number" of a journal, magazine, or tech-report.
	Number string

	// Organization is used to identify the conference sponsor accociated with the cited material.
	Organization string

	// Pages is used to describe the pages from which the citation has been made.
	// Typically, the page numbers will be separated either by commas or by double-hyphens.
	Pages string

	// Publisher is the name of the publisher.
	Publisher string

	// School is used when the cited material is a thesis to indicate the the school where the thesis was written.
	School string

	// Series is used when the cited material was publushed as part of series of books.
	Series string

	// Title is the title of the cited material.
	Title string

	// Type is used to provide additional categorisation to the type of publication.
	Type string

	// Volume is the description of the volume that the cited material, typically a journal or multi-volume book, came from.
	Volume string

	// Year is the month of publication.
	// For unpublished material, the year of creation can be used instead.
	Year string
}


text:
package org.pmw.tinylog.hamcrest;

import java.util.Arrays;
import java.util.Collection;
import java.util.Iterator;

import org.hamcrest.Description;
import org.hamcrest.Matcher;
import org.hamcrest.TypeSafeMatcher;

/**
 * Additional array matchers.
 */
public final class ArrayMatchers {

	private ArrayMatchers() {
	}

	/**
	 * Test if an array has an equal content.
	 *
	 * @param objects
	 *            Expected objects
	 * @return A matcher that matches the arrays
	 *
	 * @param <E>
	 *            Type of array elements
	 */
	@SafeVarargs
	public static <E> Matcher<E[]> equalContentInArray(final Object... objects) {
		return new ContentMatcher<>(Arrays.asList(objects), false);
	}

	/**
	 * Test if an array has exactly the same content.
	 *
	 * @param objects
	 *            Expected objects
	 * @return A matcher that matches the arrays
	 *
	 * @param <E>
	 *            Type of array elements
	 */
	@SafeVarargs
	public static <E> Matcher<E[]> sameContentInArray(final Object... objects) {
		return new ContentMatcher<>(Arrays.asList(objects), true);
	}

	/**
	 * Test if an array doesn't contain any element more than once.
	 *
	 * @return A matcher that matches the arrays
	 *
	 * @param <E>
	 *            Type of array elements
	 */
	public static <E> Matcher<E[]> distinctContentInArray() {
		return new DistinctMatcher<>();
	}

	/**
	 * Test if an array consists of collections with the defined sizes in the defined order.
	 *
	 * @param sizes
	 *            Sizes for collections(null is allowed to mark null references)
	 * @return A matcher that matches the arrays
	 *
	 * @param <E>
	 *            Type of array elements
	 */
	public static <E> Matcher<E[]> containsCollectionWithSizes(final Integer... sizes) {
		return new SizeMatcher<>(Arrays.asList(sizes));
	}

	/**
	 * Test if the items of an array are from the expected classes.
	 *
	 * @param classes
	 *            Expected classes
	 * @return A matcher that matches the arrays
	 *
	 * @param <E>
	 *            Type of array elements
	 */
	@SafeVarargs
	public static <E> Matcher<E[]> typesInArray(final Class<?>... classes) {
		return new ClassMatcher<>(Arrays.asList(classes));
	}

	private static final class ContentMatcher<E> extends TypeSafeMatcher<E[]> {

		private final Collection<?> collection;
		private final boolean strict;

		private ContentMatcher(final Collection<?> collection, final boolean strict) {
			this.collection = collection;
			this.strict = strict;
		}

		@Override
		public boolean matchesSafely(final E[] array) {
			if (collection == null || array == null) {
				return false;
			} else if (collection.size() != array.length) {
				return false;
			} else {
				Iterator<?> iterator1 = collection.iterator();
				Iterator<?> iterator2 = Arrays.asList(array).iterator();
				while (iterator1.hasNext()) {
					Object object1 = iterator1.next();
					Object object2 = iterator2.next();
					if (object1 != object2 && (strict || (object1 != null && !object1.equals(object2)))) {
						return false;
					}
				}
				return true;
			}
		}

		@Override
		public void describeTo(final Description description) {
			if (strict) {
				description.appendText("contains exactly ");
			} else {
				description.appendText("contains ");
			}
			if (collection == null) {
				description.appendValue(null);
			} else {
				description.appendValue(collection);
			}
		}
	}

	private static final class DistinctMatcher<E> extends TypeSafeMatcher<E[]> {

		private DistinctMatcher() {
		}

		@Override
		public boolean matchesSafely(final E[] array) {
			if (array == null) {
				return false;
			} else {
				for (int i = 0; i < array.length; ++i) {
					Object obj = array[i];
					if (obj != null) {
						for (int j = 0; j < array.length; ++j) {
							if (i != j && obj.equals(array[j])) {
								return false;
							}
						}
					}
				}
				return true;
			}
		}

		@Override
		public void describeTo(final Description description) {
			description.appendText("contains distinct elements");

		}
	}

	private static final class SizeMatcher<E> extends TypeSafeMatcher<E[]> {

		private final Collection<Integer> sizes;

		private SizeMatcher(final Collection<Integer> sizes) {
			this.sizes = sizes;
		}

		@Override
		public boolean matchesSafely(final E[] array) {
			if (sizes.size() != array.length) {
				return false;
			} else {
				Iterator<Integer> sizeIterator = sizes.iterator();
				Iterator<?> objectIterator = Arrays.asList(array).iterator();
				while (sizeIterator.hasNext()) {
					Integer size = sizeIterator.next();
					Object object = objectIterator.next();
					if (size == null) {
						if (object != null) {
							return false;
						}
					} else {
						if (!(object instanceof Collection) || ((Collection<?>) object).size() != size) {
							return false;
						}
					}
				}
				return true;
			}
		}

		@Override
		public void describeTo(final Description description) {
			description.appendText("contains collections of the sizes ");
			description.appendValue(sizes);
		}
	}

	private static final class ClassMatcher<E> extends TypeSafeMatcher<E[]> {

		private final Collection<Class<?>> classes;

		private ClassMatcher(final Collection<Class<?>> classes) {
			this.classes = classes;
		}

		@Override
		public boolean matchesSafely(final E[] array) {
			if (classes.size() != array.length) {
				return false;
			} else {
				Iterator<Class<?>> classIterator = classes.iterator();
				Iterator<?> objectIterator = Arrays.asList(array).iterator();
				while (classIterator.hasNext()) {
					Class<?> clazz = classIterator.next();
					Object object = objectIterator.next();
					if (clazz == null || object == null) {
						return false;
					} else if (!clazz.equals(object.getClass())) {
						return false;
					}
				}
				return true;
			}
		}

		@Override
		public void describeTo(final Description description) {
			description.appendText("contains exactly the types ");
			description.appendValue(classes);
		}
	}

}


text:
package org.steamflake.core.infrastructure.utilities.revisions;

import java.util.concurrent.atomic.AtomicInteger;

/**
 * Main program tests Transaction usage and garbage collection.
 */
public class TransactionGarbageCollectionTest {

    public static void main( String... args ) {

        new Thread( new MetricThread() ).start();

        for ( int i = 0; i < 5; i += 1 ) {
            new Thread( new WorkerThread() ).start();
        }

        new Thread( new GarbageCollectionThread() ).start();

    }

    static class GarbageCollectionThread
        implements Runnable {

        @Override
        public void run() {

            while ( Value.count.get() <= 10 ) {
                Thread.yield();
            }

            while ( Value.count.get() > 10 ) {
                try {
                    Thread.sleep( 5000L );
                    System.gc();
                }
                catch ( InterruptedException e ) {
                    e.printStackTrace();
                }
            }

        }
    }

    static class MetricThread
        implements Runnable {

        @Override
        public void run() {
            int priorCount = -1;
            int count = Value.count.get();
            while ( count > 10 || priorCount < 10 ) {
                if ( count != priorCount ) {
                    System.out.println( count );
                    priorCount = count;
                }
                count = Value.count.get();
            }
            System.out.println( count );
        }

    }

    static class Value {

        Value() {
            this.myCount = count.incrementAndGet();
        }

        @Override
        protected void finalize() throws Throwable {
            count.decrementAndGet();
            super.finalize();
        }

        static AtomicInteger count = new AtomicInteger( 0 );

        int myCount;

    }

    static class WorkerThread
        implements Runnable {

        @Override
        public void run() {
            try {
                Runnable task1 = () -> {
                    this.myValue = new V<>( new Value() );
                };
                StmTransactionContext.doInReadWriteTransaction( 2, task1 );
                for ( int i = 0; i < 50000; i += 1 ) {
                    Runnable task = () -> {
                        this.myValue.set( new Value() );
                    };
                    StmTransactionContext.doInReadWriteTransaction( 5, task );
                    if ( i % 100 == 0 ) {
                        Thread.yield();
                    }
                }
            }
            catch ( Exception e ) {
                e.printStackTrace();
            }
        }

        private V<Value> myValue;

    }

}


text:
#include <boost/test/minimal.hpp>
#include <boost/graph/adjacency_list.hpp>
#include <boost/graph/random.hpp>
#include <boost/graph/graph_utility.hpp>
#include <boost/graph/graph_archetypes.hpp>
#include <boost/graph/breadth_first_search.hpp>

#include <boost/random/mersenne_twister.hpp>

#ifdef BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP
using namespace boost;
#endif

template <typename DistanceMap, typename ParentMap,
          typename Graph, typename ColorMap>
class bfs_testing_visitor
{
  typedef typename boost::graph_traits<Graph>::vertex_descriptor Vertex;
  typedef typename boost::graph_traits<Graph>::edge_descriptor Edge;
  typedef typename boost::color_traits<
    typename boost::property_traits<ColorMap>::value_type
  > Color;
public:

  bfs_testing_visitor(Vertex s, DistanceMap d, ParentMap p, ColorMap c)
    : current_distance(0), distance(d), parent(p), color(c), src(s) { }

  void initialize_vertex(const Vertex& u, const Graph& ) const {
    BOOST_CHECK(get(color, u) == Color::white());
  }
  void examine_vertex(const Vertex& u, const Graph& ) const {
    current_vertex = u;
    // Ensure that the distances monotonically increase.
    BOOST_CHECK( distance[u] == current_distance
                       || distance[u] == current_distance + 1 );
    if (distance[u] == current_distance + 1) // new level
      ++current_distance;
  }
  void discover_vertex(const Vertex& u, const Graph& ) const {
    BOOST_CHECK( get(color, u) == Color::gray() );
    if (u == src) {
      current_vertex = src;
    } else {
      BOOST_CHECK( parent[u] == current_vertex );
      BOOST_CHECK( distance[u] == current_distance + 1 );
      BOOST_CHECK( distance[u] == distance[parent[u]] + 1 );
    }
  }
  void examine_edge(const Edge& e, const Graph& g) const {
    BOOST_CHECK( source(e, g) == current_vertex );
  }
  void tree_edge(const Edge& e, const Graph& g) const {
    BOOST_CHECK( get(color, target(e, g)) == Color::white() );
    Vertex u = source(e, g), v = target(e, g);
    BOOST_CHECK( distance[u] == current_distance );
    parent[v] = u;
    distance[v] = distance[u] + 1;
  }
  void non_tree_edge(const Edge& e, const Graph& g) const {
    BOOST_CHECK( color[target(e, g)] != Color::white() );

    if (boost::is_directed(g))
      // cross or back edge
      BOOST_CHECK(distance[target(e, g)] <= distance[source(e, g)] + 1);
    else {
      // cross edge (or going backwards on a tree edge)
      BOOST_CHECK(distance[target(e, g)] == distance[source(e, g)]
                        || distance[target(e, g)] == distance[source(e, g)] + 1
                        || distance[target(e, g)] == distance[source(e, g)] - 1
                        );
    }
  }

  void gray_target(const Edge& e, const Graph& g) const {
    BOOST_CHECK( color[target(e, g)] == Color::gray() );
  }

  void black_target(const Edge& e, const Graph& g) const {
    BOOST_CHECK( color[target(e, g)] == Color::black() );

    // All vertices adjacent to a black vertex must already be discovered
    typename boost::graph_traits<Graph>::adjacency_iterator ai, ai_end;
    for (boost::tie(ai, ai_end) = adjacent_vertices(target(e, g), g);
         ai != ai_end; ++ai)
      BOOST_CHECK( color[*ai] != Color::white() );
  }
  void finish_vertex(const Vertex& u, const Graph& ) const {
    BOOST_CHECK( color[u] == Color::black() );

  }
private:
  mutable Vertex current_vertex;
  mutable typename boost::property_traits<DistanceMap>::value_type
    current_distance;
  DistanceMap distance;
  ParentMap parent;
  ColorMap color;
  Vertex src;
};

template <class Graph>
struct bfs_test
{
  typedef boost::graph_traits<Graph> Traits;
  typedef typename Traits::vertices_size_type
    vertices_size_type;
  static void go(vertices_size_type max_V) {
    typedef typename Traits::vertex_descriptor vertex_descriptor;
    typedef boost::color_traits<boost::default_color_type> Color;

    vertices_size_type i;
    typename Traits::edges_size_type j;
    typename Traits::vertex_iterator ui, ui_end;

    boost::mt19937 gen;

    for (i = 0; i < max_V; ++i)
      for (j = 0; j < i*i; ++j) {
        Graph g;
        boost::generate_random_graph(g, i, j, gen);

        // declare the "start" variable
        vertex_descriptor start = boost::random_vertex(g, gen);

        // vertex properties
        std::vector<int> distance(i, (std::numeric_limits<int>::max)());
        distance[start] = 0;
        std::vector<vertex_descriptor> parent(i);
        for (boost::tie(ui, ui_end) = vertices(g); ui != ui_end; ++ui)
          parent[*ui] = *ui;
        std::vector<boost::default_color_type> color(i);

        // Get vertex index map
        typedef typename boost::property_map<Graph, boost::vertex_index_t>::const_type idx_type;
        idx_type idx = get(boost::vertex_index, g);

        // Make property maps from vectors
        typedef
          boost::iterator_property_map<std::vector<int>::iterator, idx_type>
          distance_pm_type;
        distance_pm_type distance_pm(distance.begin(), idx);
        typedef
          boost::iterator_property_map<typename std::vector<vertex_descriptor>::iterator, idx_type>
          parent_pm_type;
        parent_pm_type parent_pm(parent.begin(), idx);
        typedef
          boost::iterator_property_map<std::vector<boost::default_color_type>::iterator, idx_type>
          color_pm_type;
        color_pm_type color_pm(color.begin(), idx);

        // Create the testing visitor.
        bfs_testing_visitor<distance_pm_type, parent_pm_type, Graph,
          color_pm_type>
          vis(start, distance_pm, parent_pm, color_pm);

        boost::breadth_first_search(g, start,
                                    visitor(vis).
                                    color_map(color_pm));

        // All white vertices should be unreachable from the source.
        for (boost::tie(ui, ui_end) = vertices(g); ui != ui_end; ++ui)
          if (color[*ui] == Color::white()) {
            std::vector<boost::default_color_type> color2(i, Color::white());
            BOOST_CHECK(!boost::is_reachable(start, *ui, g, color_pm_type(color2.begin(), idx)));
          }

        // The shortest path to a child should be one longer than
        // shortest path to the parent.
        for (boost::tie(ui, ui_end) = vertices(g); ui != ui_end; ++ui)
          if (parent[*ui] != *ui) // *ui not the root of the bfs tree
            BOOST_CHECK(distance[*ui] == distance[parent[*ui]] + 1);
      }
  }
};

int test_main(int argc, char* argv[])
{
  using namespace boost;
  int max_V = 7;
  if (argc > 1)
    max_V = atoi(argv[1]);

  bfs_test< adjacency_list<vecS, vecS, directedS> >::go(max_V);
  bfs_test< adjacency_list<vecS, vecS, undirectedS> >::go(max_V);
  return 0;
}


text:
package org.nognog.freeSquare.square2d.object.types.eatable;

import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.Assert.fail;
import mockit.Mocked;
import mockit.NonStrictExpectations;
import mockit.Verifications;

import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.nognog.GdxTestRunner;
import org.nognog.freeSquare.model.life.Family;
import org.nognog.freeSquare.model.life.Life;
import org.nognog.freeSquare.model.life.status.Status;
import org.nognog.freeSquare.model.life.status.influence.StatusInfluence;
import org.nognog.freeSquare.model.square.SquareEvent;
import org.nognog.freeSquare.persist.PersistManager;
import org.nognog.freeSquare.square2d.Direction;
import org.nognog.freeSquare.square2d.SimpleSquare2d;
import org.nognog.freeSquare.square2d.Square2d;
import org.nognog.freeSquare.square2d.Square2dUtils;
import org.nognog.freeSquare.square2d.event.ChangeStatusEvent;
import org.nognog.freeSquare.square2d.object.Square2dObject;
import org.nognog.freeSquare.square2d.object.types.life.LifeObject;
import org.nognog.freeSquare.square2d.type.Square2dType;

import com.badlogic.gdx.math.Vector2;
import com.badlogic.gdx.utils.Json;

/**
 * @author goshi 2015/02/14
 */
@SuppressWarnings({ "static-method", "javadoc" })
@RunWith(GdxTestRunner.class)
public class EatableObjectTest {

	@BeforeClass
	public static void beforeClass() {
		PersistManager.getUseJson().setSerializer(EatableObject.class, EatableObjectSerializer.getInstance());
	}

	@AfterClass
	public static void afterClass() {
		PersistManager.getUseJson().setSerializer(EatableObject.class, null);
	}

	@SuppressWarnings("boxing")
	@Test
	public final void testReadWrite() {
		Json json = PersistManager.getUseJson();
		SimpleSquare2d square = Square2dType.GRASSY_SQUARE1_MEDIUM.create();
		for (EatableObjectType type : EatableObjectTypeManager.getInstance().getAllTypes()) {
			EatableObject object = type.create();
			object.setSquare(square);
			Vector2 randomPoint = Square2dUtils.getRandomPointOn(square);
			object.setPosition(randomPoint.x, randomPoint.y);
			LifeObject eater = LifeObject.create(new Life(Family.Prepared.RIKI));
			eater.setSquare(square);
			final int baseAmount = object.getAmount();
			final int amount1 = 5, amount2 = 10, amount3 = 15, amount4 = 20;
			object.eatenBy(eater, amount1, Direction.DOWN);
			object.eatenBy(eater, amount2, Direction.RIGHT);
			object.eatenBy(eater, amount3, Direction.UP);
			object.eatenBy(eater, amount4, Direction.LEFT);
			assertThat(object.getAmount(), is(Math.max(0, baseAmount - (amount1 + amount2 + amount3 + amount4))));
			Status expectedStatus = new Status();
			StatusInfluence<?> statusInfluence = type.getStatusInfluence();

			statusInfluence.applyTo(expectedStatus, 5);
			statusInfluence.applyTo(expectedStatus, 10);
			statusInfluence.applyTo(expectedStatus, 15);
			statusInfluence.applyTo(expectedStatus, 20);

			assertThat(eater.getLife().getStatus(), is(expectedStatus));
			String jsonString = json.toJson(object);
			Square2dObject deserializedObject = json.fromJson(object.getClass(), jsonString);
			assertThat(object, is(deserializedObject));
		}
	}

	@SuppressWarnings("boxing")
	@Test
	public final void testResurrection(@Mocked final Square2d square) {
		for (EatableObjectType type : EatableObjectTypeManager.getInstance().getAllTypes()) {
			EatableObject object = type.create();
			object.setSquare(square);
			LifeObject eater = LifeObject.create(new Life(Family.Prepared.RIKI));
			eater.setSquare(square);
			final int baseAmount = object.getAmount();
			final int amount1 = 5, amount2 = 10, amount3 = 15, amount4 = 20;
			object.eatenBy(eater, amount1, Direction.DOWN);
			object.eatenBy(eater, amount2, Direction.RIGHT);
			object.eatenBy(eater, amount3, Direction.UP);
			object.eatenBy(eater, amount4, Direction.LEFT);
			assertThat(object.getAmount(), is(Math.max(0, baseAmount - (amount1 + amount2 + amount3 + amount4))));
			object.resurrection();
			assertThat(object.getAmount(), is(baseAmount));
		}
	}

	@SuppressWarnings({ "boxing", "unused" })
	@Test
	public final void testEatenBy(@Mocked("notifyEventListeners(SquareEvent)") final Square2d square) {
		for (EatableObjectType type : EatableObjectTypeManager.getInstance().getAllTypes()) {
			final EatableObject object = type.create();
			final LifeObject eater = LifeObject.create(new Life(Family.Prepared.RIKI));
			new NonStrictExpectations(eater) {
				{
					eater.handleEvent((ChangeStatusEvent) any);
				}
			};
			try {
				object.eatenBy(eater, 0, Direction.DOWN);
				fail();
			} catch (IllegalStateException e) {
				// pass
			}
			object.setSquare(square);
			try {
				object.eatenBy(eater, 0, Direction.DOWN);
				fail();
			} catch (IllegalStateException e) {
				// pass
			}
			eater.setSquare(square);
			object.eatenBy(eater, 0, Direction.DOWN);
			assertThat(object.isBeingEaten(), is(false));
			object.eatenBy(eater, 1, Direction.DOWN);
			assertThat(object.isBeingEaten(), is(true));
			object.eatenBy(eater, -1, Direction.DOWN);
			assertThat(object.isBeingEaten(), is(true));
			object.resurrection();
			assertThat(object.isBeingEaten(), is(false));
			new Verifications() {
				{
					square.notifyEventListeners((SquareEvent) any);
					times = 0;
					eater.handleEvent((ChangeStatusEvent) any);
					times = 1;
				}
			};
		}
	}
}


text:
"""Analytic approximation for European option prices using SABR model."""

import enum

import tensorflow.compat.v2 as tf

@enum.unique
class SabrApproximationType(enum.Enum):
  """Approximation to the SABR model.

  * `HAGAN`: Using the Hagan approximation [1].

  #### References
  [1] Hagan et al, Managing Smile Risk, Wilmott (2002), 1:84-108
  """
  HAGAN = 1

@enum.unique
class SabrImpliedVolatilityType(enum.Enum):
  """The implied volality arising from the SABR approximate solution.

  * `NORMAL`: The volatility for the normal model, i.e. the `sigma_n` for a
    stochastic model of the underlying `F` behaving like:

    ```
    dF = sigma_n dW
    ```

  * `LOGNORMAL`: The volatility for the lognomal (aka Black) model, i.e. the
    `sigma_B` for a stochastic model of the underlying `F` behaving like:

    ```
    dF = sigma_b F dW
    ```

  """
  NORMAL = 1
  LOGNORMAL = 2

def implied_volatility(*,
                       strikes,
                       expiries,
                       forwards,
                       alpha,
                       beta,
                       volvol,
                       rho,
                       shift=0.0,
                       volatility_type=SabrImpliedVolatilityType.LOGNORMAL,
                       approximation_type=SabrApproximationType.HAGAN,
                       dtype=None,
                       name=None):
  """Computes the implied volatility under the SABR model.

  The SABR model specifies the risk neutral dynamics of the underlying as the
  following set of stochastic differential equations:

  ```
    dF = sigma F^beta dW_1
    dsigma = volvol sigma dW_2
    dW1 dW2 = rho dt

    F(0) = f
    sigma(0) = alpha
  ```
  where F(t) represents the value of the forward price as a function of time,
  and sigma(t) is the volatility.

  Here, we implement an approximate solution as proposed by Hagan [1], and back
  out the equivalent implied volatility that would've been obtained under either
  the normal model or the Black model.

  #### Example
  ```python
  import tf_quant_finance as tff
  import tensorflow.compat.v2 as tf

  equiv_vol = tff.models.sabr.approximations.implied_volatility(
      strikes=np.array([106.0, 11.0]),
      expiries=np.array([17.0 / 365.0, 400.0 / 365.0]),
      forwards=np.array([120.0, 20.0]),
      alpha=1.63,
      beta=0.6,
      rho=0.00002,
      volvol=3.3,
      dtype=tf.float64)
  # Expected: [0.33284656705268817, 1.9828728139982792]

  # Running this inside a unit test passes:
  # equiv_vol = self.evaluate(equiv_vol)
  # self.assertAllClose(equiv_vol, 0.33284656705268817)
  ```
  #### References
  [1] Hagan et al, Managing Smile Risk, Wilmott (2002), 1:84-108

  Args:
    strikes: Real `Tensor` of arbitrary shape, specifying the strike prices.
      Values must be strictly positive.
    expiries: Real `Tensor` of shape compatible with that of `strikes`,
      specifying the corresponding time-to-expiries of the options. Values must
      be strictly positive.
    forwards: Real `Tensor` of shape compatible with that of `strikes`,
      specifying the observed forward prices of the underlying. Values must be
      strictly positive.
    alpha: Real `Tensor` of shape compatible with that of `strikes`, specifying
      the initial values of the stochastic volatility. Values must be strictly
      positive.
    beta: Real `Tensor` of shape compatible with that of `strikes`, specifying
      the model exponent `beta`. Values must satisfy 0 <= `beta` <= 1.
    volvol: Real `Tensor` of shape compatible with that of `strikes`,
      specifying the model vol-vol multipliers. Values of `volvol` must be
      non-negative.
    rho: Real `Tensor` of shape compatible with that of `strikes`, specifying
      the correlation factors between the Wiener processes modeling the forward
      and the volatility. Values must satisfy -1 < `rho` < 1.
    shift: Optional `Tensor` of shape compatible with that of `strkies`,
      specifying the shift parameter(s). In the shifted model, the process
      modeling the forward is modified as: dF = sigma * (F + shift) ^ beta * dW.
      With this modification, negative forward rates are valid as long as
      F > -shift.
      Default value: 0.0
    volatility_type: Either SabrImpliedVolatility.NORMAL or LOGNORMAL.
      Default value: `LOGNORMAL`.
    approximation_type: Instance of `SabrApproxmationScheme`.
      Default value: `HAGAN`.
    dtype: Optional: `tf.DType`. If supplied, the dtype to be used for
      converting values to `Tensor`s.
      Default value: `None`, which means that the default dtypes inferred from
        `strikes` is used.
    name: str. The name for the ops created by this function.
      Default value: 'sabr_approx_implied_volatility'.

  Returns:
    A real `Tensor` of the same shape as `strikes`, containing the
    corresponding equivalent implied volatilities.
  """
  name = name or 'sabr_approx_implied_volatility'
  del approximation_type  # Currently, only HAGAN approximation is supported.

  with tf.name_scope(name):
    strikes = tf.convert_to_tensor(strikes, dtype=dtype, name='strikes')
    dtype = dtype or strikes.dtype

    expiries = tf.convert_to_tensor(expiries, dtype=dtype, name='expiries')
    forwards = tf.convert_to_tensor(forwards, dtype=dtype, name='forwards')
    alpha = tf.convert_to_tensor(alpha, dtype=dtype, name='alpha')
    beta = tf.convert_to_tensor(beta, dtype=dtype, name='beta')
    rho = tf.convert_to_tensor(rho, dtype=dtype, name='rho')
    volvol = tf.convert_to_tensor(volvol, dtype=dtype, name='volvol')

    # Apply the shift.
    strikes += shift
    forwards += shift

    moneyness = forwards / strikes
    log_moneyness = tf.math.log(moneyness)
    adj_moneyness = tf.math.pow(moneyness, 1.0 - beta)
    sqrt_adj_moneyness = tf.math.sqrt(adj_moneyness)

    # adjusted alpha = alpha * K^(beta - 1)
    adj_alpha = alpha * tf.math.pow(strikes, beta - 1.0)

    # Zeta, as defined in (eq. A.69b in [1])
    zeta = (volvol / adj_alpha) * sqrt_adj_moneyness * log_moneyness
    # Zeta / xhat(zeta), as defined in (eq. A.69b in [1])
    zeta_by_xhat = _zeta_by_xhat(zeta, rho, dtype)

    # This is the denominator term occurring in the ((1 + ...) / (1 + ...)) of
    # (eq. A.69a) in [1].
    denom = _denom(beta, log_moneyness)

    # The correction terms occurring in (1 + {...}) of (eq. A.69a) of [1], where
    # we have multiplied in the "t_ex" to make the quantities dimensionless.
    correction_2 = ((rho * beta / 4.0) * (1.0 / sqrt_adj_moneyness) *
                    (adj_alpha * volvol * expiries))

    correction_3 = ((2.0 - 3.0 * rho * rho) / 24.0
                    * (volvol * volvol * expiries))

    if volatility_type == SabrImpliedVolatilityType.NORMAL:
      correction_1 = ((-beta * (2.0 - beta) / 24.0) * (1.0 / adj_moneyness) *
                      (adj_alpha * adj_alpha * expiries))

      # This is the denominator term occurring in the ((1 + ...) / (1 + ...)) of
      # (eq. A.69a) in [1], and is effectively the same as setting beta = 0.0
      number = _denom(0.0, log_moneyness)

      return (adj_alpha * strikes * tf.math.pow(moneyness, beta / 2.0) *
              (number / denom) * zeta_by_xhat *
              (1 + correction_1 + correction_2 + correction_3))

    elif volatility_type == SabrImpliedVolatilityType.LOGNORMAL:
      correction_1 = (((1.0 - beta) *
                       (1.0 - beta) / 24.0) * (1.0 / adj_moneyness) *
                      (adj_alpha * adj_alpha * expiries))

      return (adj_alpha * (1.0 / sqrt_adj_moneyness) * (1.0 / denom) *
              zeta_by_xhat * (1.0 + correction_1 + correction_2 + correction_3))
    else:
      raise ValueError('Invalid value of `volatility_type`')

def _epsilon(dtype):
  dtype = tf.as_dtype(dtype).as_numpy_dtype
  eps = 1e-6 if dtype == tf.float32.as_numpy_dtype else 1e-10
  return eps

def _zeta_by_xhat(zeta, rho, dtype):
  zbxh = tf.math.divide_no_nan(
      zeta,
      tf.math.log(
          (tf.math.sqrt(1 - 2 * rho * zeta + zeta * zeta) - rho + zeta) /
          (1.0 - rho)))
  eps = _epsilon(dtype)

  # When zeta -> 0, the limit of zeta / x_hat(zeta) reduces to 1.0
  return tf.where(tf.abs(zeta) > eps, zbxh, 1.0)

def _denom(beta, log_f_by_k):
  s = (1.0 - beta) * log_f_by_k
  s_squared = s * s
  return 1.0 + s_squared / 24.0 + (s_squared * s_squared) / 1920.0


text:
package org.apache.nifi.registry.db.migration;

import org.springframework.jdbc.core.JdbcTemplate;

import javax.sql.DataSource;
import java.util.List;

/**
 * Service used to load data from original database used in the 0.1.0 release.
 */
public class LegacyDatabaseService {

    private final JdbcTemplate jdbcTemplate;

    public LegacyDatabaseService(final DataSource dataSource) {
        this.jdbcTemplate = new JdbcTemplate(dataSource);
    }

    public List<BucketEntityV1> getAllBuckets() {
        final String sql = "SELECT * FROM bucket ORDER BY name ASC";

        return jdbcTemplate.query(sql, (rs, i) -> {
            final BucketEntityV1 b = new BucketEntityV1();
            b.setId(rs.getString("ID"));
            b.setName(rs.getString("NAME"));
            b.setDescription(rs.getString("DESCRIPTION"));
            b.setCreated(rs.getTimestamp("CREATED"));
            return b;
        });
    }

    public List<FlowEntityV1> getAllFlows() {
        final String sql = "SELECT * FROM flow f, bucket_item item WHERE item.id = f.id";

        return jdbcTemplate.query(sql, (rs, i) -> {
            final FlowEntityV1 flowEntity = new FlowEntityV1();
            flowEntity.setId(rs.getString("ID"));
            flowEntity.setName(rs.getString("NAME"));
            flowEntity.setDescription(rs.getString("DESCRIPTION"));
            flowEntity.setCreated(rs.getTimestamp("CREATED"));
            flowEntity.setModified(rs.getTimestamp("MODIFIED"));
            flowEntity.setBucketId(rs.getString("BUCKET_ID"));
            return flowEntity;
        });
    }

    public List<FlowSnapshotEntityV1> getAllFlowSnapshots() {
        final String sql = "SELECT * FROM flow_snapshot fs";

        return jdbcTemplate.query(sql, (rs, i) -> {
            final FlowSnapshotEntityV1 fs = new FlowSnapshotEntityV1();
            fs.setFlowId(rs.getString("FLOW_ID"));
            fs.setVersion(rs.getInt("VERSION"));
            fs.setCreated(rs.getTimestamp("CREATED"));
            fs.setCreatedBy(rs.getString("CREATED_BY"));
            fs.setComments(rs.getString("COMMENTS"));
            return fs;
        });
    }

}


text:
package com.kakao.http;

import java.net.URI;
import java.util.Map;

/**
 * @author kkung
 */
public class Response {

    private final int statusCode;
    private String statusText;
    private final Map<String, String> headers;
    private final String responseBody;
    private final URI uri;

    public Response(URI uri, int statusCode, String statusText, Map<String, String> headers, String responseBody) {
        this.uri = uri;
        this.statusCode = statusCode;
        this.statusText = statusText;
        this.headers = headers;
        this.responseBody = responseBody;
    }

    public URI getUri() {
        return uri;
    }

    public int getStatusCode() {
        return statusCode;
    }

    public String getStatusText() {
        return statusText;
    }

    public Map<String, String> getHeaders() {
        return headers;
    }

    public String getResponseBody() {
        return responseBody;
    }

    public boolean hasResponseStatus() {
        return true;
    }

    public boolean hasResponseBody() {
        return responseBody != null && responseBody.length() > 0;
    }
}


text:
/*****************************************************************************/
/* Instructor: Event Handlers */
/*****************************************************************************/
Template.Instructor.events({
	'click #removeCourse': function() {
		// store the course code and course ID in session
		Session.set('remove_course_code', this.code)
		Session.set('remove_course_id', this._id)
		$('#confirm-remove-course').openModal()
	},
	'click #confirm-remove': function() {
		var code = Session.get('remove_course_code')
		console.log("Removing course " + code)
		var course = Courses.findOne({'code':code})
		if (course) {
			Courses.update(Session.get('remove_course_id') , {
				$set: {
					'status':'inactive'
				}
			}, function(error) {
				if (error) {
					console.log(error)
				} else {
					$('#confirm-remove-course').closeModal()
					Materialize.toast('Course ' + Session.get('remove_course_code') + ' has been removed', 4000)
				}
			})
		}
	},
	'click #confirm-cancel':function() {
		$('#confirm-remove-course').closeModal();
	}
});

/*****************************************************************************/
/* Instructor: Helpers */
/*****************************************************************************/
Template.Instructor.helpers({
	coursesAvailable: function() {
		var courses = Courses.find({
			'students': { $not : Meteor.userId() },
			'status': 'active'
		}, {sort: {'code':1}})
		return courses.count() > 0
	},
	courses: function() {
		// search through Courses, if search_code is given
		var search_code = Session.get('search_code')
		// not case sensative
		var regex = new RegExp(search_code, 'i')
		if (search_code == "") {
			return Courses.find({'status': 'active'}, {sort: {'code':1}})
		} else {
			return Courses.find({
				'code': {$regex: regex},
				'status': 'active'
			}, {sort: {'code':1}})
		}
	},
	remove_course_code: function() {
		return Session.get('remove_course_code')
	}
});

/*****************************************************************************/
/* Instructor: Lifecycle Hooks */
/*****************************************************************************/
Template.Instructor.onCreated(function () {
});

Template.Instructor.onRendered(function () {
	// initialize tooltip
	$('#class-size-tooltip').tooltip({delay: 50})
});

Template.Instructor.onDestroyed(function () {
});


text:
<?php

include_once realpath('../../../../Bootstrap.php');

/**
 * Managing Files using Aspose Cloud Pdf
 *
 * The primary goal of the Zend Framework Aspose Cloud Pdf component is to convert pdf file into different formats.
 *
 * In this demo application, Pdf file is converted to image by size.
 *

 */

use ZendService\Aspose\Cloud\Pdf\Converter;
use Zend\Http\Client as HttpClient;

$httpClient = new HttpClient();
$httpClient->setAdapter('\Zend\Http\Client\Adapter\Curl');

$converter = new Converter(array(
            'appKey'=>'8356c76c7412f32bb85ae7472e842da4',
            'appSid'=>'8EB6E644-4A40-4B50-8012-135D1F8F7513',
            'productUri'=>'http://test.aspose.com/v1.1',
            'httpClient' => $httpClient,
            'outputPath' => __DIR__ . '\\_files\\outputFolder\\',

        ));

$converter->setFileName('test_file_on_storage.pdf');

var_dump($converter->convertToImagebySize('1','gif','400','500'));


text:
package com.github.ulisesbocchio.spring.boot.security.saml.configurer.builder;

import com.github.ulisesbocchio.spring.boot.security.saml.configurer.ServiceProviderBuilder;
import org.springframework.security.config.annotation.SecurityConfigurerAdapter;
import org.springframework.security.saml.websso.WebSSOProfileHoKImpl;

/**
 * Builder configurer that takes care of configuring/customizing the {@link WebSSOProfileHoKImpl} bean.
 * <p>
 * Common strategy across most internal configurers is to first give priority to a Spring Bean if present in the
 * Context.
 * So if not {@link WebSSOProfileHoKImpl} bean is defined, priority goes to a custom WebSSOProfileHoKImpl provided
 * explicitly to this configurer through the constructor. And if not provided through the constructor, a default
 * implementation is instantiated.
 * </p>
 *
 * @author Ulises Bocchio
 */
public class WebSSOProfileHoKConfigurer extends SecurityConfigurerAdapter<Void, ServiceProviderBuilder> {
    private WebSSOProfileHoKImpl hokProfile;
    private WebSSOProfileHoKImpl hokProfileBean;

    public WebSSOProfileHoKConfigurer() {

    }

    public WebSSOProfileHoKConfigurer(WebSSOProfileHoKImpl hokProfile) {
        this.hokProfile = hokProfile;
    }

    @Override
    public void init(ServiceProviderBuilder builder) throws Exception {
        hokProfileBean = builder.getSharedObject(WebSSOProfileHoKImpl.class);
    }

    @Override
    public void configure(ServiceProviderBuilder builder) throws Exception {
        if (hokProfileBean == null) {
            if (hokProfile == null) {
                hokProfile = createDefaultWebSSOProfileHoK();
            }
            builder.setSharedObject(WebSSOProfileHoKImpl.class, hokProfile);
        }
    }

    protected WebSSOProfileHoKImpl createDefaultWebSSOProfileHoK() {
        return new WebSSOProfileHoKImpl();
    }
}


text:
const N: i32 = 10;

pub struct Territory {
    territory: [[u32; N as usize]; N as usize],
    islands_count: i32,
    id: u32
}

const OFFSETS: [(i32, i32); 4] = [
    (0, 1),
    (0, -1),
    (1, 0),
    (-1, 0)
];

const SEA: u32 = 0;

impl Territory {

    pub fn new() -> Territory {
        return Territory {
            islands_count: 0,
            id: 0,
            territory: [[0; N as usize]; N as usize]
        };
    }

    pub fn add_land(& mut self, r: i32, c: i32) -> i32 {
        let mut different_neighbours: i32 = 0;

        for offset in OFFSETS.iter() {
            // relies on undeflow
            let new_coordinates = ((r + offset.0) as usize, (c + offset.1) as usize);
            let upper_bound = (N - 1) as usize;
            let are_coordinates_valid = new_coordinates.0 < upper_bound && new_coordinates.1 < upper_bound;
            if are_coordinates_valid && self.territory[new_coordinates.0][new_coordinates.1] != SEA {
                different_neighbours += 1;
            }
        }
        let islands_difference = -1 * (different_neighbours - 1);
        self.islands_count += islands_difference;

        // always give the new indexed ground a new id
        self.id += 1;
        self.reindex_islands(r, c, true);

        return self.islands_count;
    }

    fn reindex_islands(&mut self, r: i32, c: i32, initial: bool) {
        let current_el = self.territory[r as usize][c as usize];
        if (current_el == SEA || current_el == self.id) && !initial {
            return;
        }

        self.territory[r as usize][c as usize] = self.id;

        // TODO: make some sort of iterator to avoid code duplication
        for offset in OFFSETS.iter() {
            let new_coordinates = ((r + offset.0) as usize, (c + offset.1) as usize);
            let upper_bound = (N - 1) as usize;
            let are_coordinates_valid = new_coordinates.0 < upper_bound && new_coordinates.1 < upper_bound;
            if are_coordinates_valid {
                self.reindex_islands(new_coordinates.0 as i32, new_coordinates.1 as i32, false);
            }
        }
    }
}


text:
:orphan:

{{ fullname | escape | underline}}

.. currentmodule:: {{ module }}

member

.. auto{{ objtype }}:: {{ objname }}


text:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />
<meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible" />
<meta content="width=device-width; initial-scale=1.0; maximum-scale=1.0;" name="viewport" />
<link rel="shortcut icon" href="/themes/BSU/images/favicon.ico" />
<link rel="apple-touch-icon" href="/themes/BSU/images/apple-touch-icon.png" />
<meta name="Generator" content="DSpace 5.5-SNAPSHOT" />
<link type="text/css" rel="stylesheet" media="screen" href="/themes/BSU/lib/css/reset.css" />
<link type="text/css" rel="stylesheet" media="screen" href="/themes/BSU/lib/css/base.css" />
<link type="text/css" rel="stylesheet" media="screen" href="/themes/BSU/lib/css/helper.css" />
<link type="text/css" rel="stylesheet" media="screen" href="/themes/BSU/lib/css/jquery-ui-1.8.15.custom.css" />
<link type="text/css" rel="stylesheet" media="screen" href="/themes/BSU/lib/css/style.css" />
<link type="text/css" rel="stylesheet" media="screen" href="/themes/BSU/lib/css/authority-control.css" />
<link type="text/css" rel="stylesheet" media="screen" href="/themes/BSU/lib/css/BSU.css" />
<link type="text/css" rel="stylesheet" media="screen" href="/themes/BSU/lib/css/jquery.bxslider.css" />
<link type="text/css" rel="stylesheet" media="handheld" href="/themes/BSU/lib/css/handheld.css" />
<link type="text/css" rel="stylesheet" media="print" href="/themes/BSU/lib/css/print.css" />
<link type="text/css" rel="stylesheet" media="all" href="/themes/BSU/lib/css/media.css" />
<link type="application/opensearchdescription+xml" rel="search" href="https://cardinalscholar.bsu.edu:443/open-search/description.xml" title="DSpace" />

<title>Jeepers, creepers! how 'bout them Beezers? : the history of the Beezer Brothers architecture firm, 1892-1932</title>
<link rel="schema.DCTERMS" href="http://purl.org/dc/terms/" />
<link rel="schema.DC" href="http://purl.org/dc/elements/1.1/" />
<meta name="DC.contributor" content="Flores, Carol A. Hrvol, 1944-" xml:lang="en_US" />
<meta name="DC.creator" content="Wilcox, Ralph S." xml:lang="en_US" />
<meta name="DCTERMS.spatial" content="n-us---" xml:lang="en_US" />
<meta name="DCTERMS.dateAccepted" content="2011-06-03T19:37:59Z" scheme="DCTERMS.W3CDTF" />
<meta name="DCTERMS.available" content="2011-06-03T19:37:59Z" scheme="DCTERMS.W3CDTF" />
<meta name="DCTERMS.created" content="1997" xml:lang="en_US" scheme="DCTERMS.W3CDTF" />
<meta name="DCTERMS.issued" content="1997" scheme="DCTERMS.W3CDTF" />
<meta name="DC.identifier" content="LD2489.Z78 1997 .W55" xml:lang="en_US" />
<meta name="DC.identifier" content="http://cardinalscholar.bsu.edu/handle/handle/185977" scheme="DCTERMS.URI" />
<meta name="DCTERMS.abstract" content="The architectural practice of Michael and Louis Beezer, identical twin brothers, lasted from 1892 until 1932. They practiced in Altoona, Pennsylvania, from 1892 until 1899; Pittsburgh, Pennsylvania, from 1900 until 1906; and in Seattle, Washington, from 1907 until 1932. During their practice, they produced a wide variety of designs including homes, banks, churches, rectories, schools, and hospitals. Today, seventy-two confirmed designs still exist around the country in Pennsylvania, Washington, Oregon, California, Montana, and Alaska. This creative project documents the Beezer Brothers' surviving buildings through current and historic photographs and a short amount of text with information on the history, style, and features of each building. A history of the firm, supplemented with biographical information, is also included." />
<meta name="DC.description" content="Department of Architecture" />
<meta name="DCTERMS.extent" content="viii, 193 leaves : ill., maps ; 28 cm." xml:lang="en_US" />
<meta name="DC.source" content="Virtual Press" xml:lang="en_US" />
<meta name="DC.subject" content="Architectural firms -- United States." xml:lang="en_US" scheme="DCTERMS.LCSH" />
<meta name="DC.subject" content="Architecture -- United States -- History -- 19th century." xml:lang="en_US" scheme="DCTERMS.LCSH" />
<meta name="DC.subject" content="Architecture -- United States -- History -- 20th century." xml:lang="en_US" scheme="DCTERMS.LCSH" />
<meta name="DC.subject" content="Beezer Brothers (Firm) -- History." xml:lang="en_US" />
<meta name="DC.title" content="Jeepers, creepers! how 'bout them Beezers? : the history of the Beezer Brothers architecture firm, 1892-1932" xml:lang="en_US" />
<meta name="DCTERMS.alternative" content="Jeepers, creepers, how about them Beezers?" xml:lang="en_US" />
<meta name="DCTERMS.alternative" content="History of the Beezer Brothers architecture firm, 1892-1932" xml:lang="en_US" />
<meta name="DC.description" content="Thesis (M.S.H.P.)" />
<meta name="DC.identifier" content="http://liblink.bsu.edu/catkey/1041908" xml:lang="en_US" />

<meta content="Jeepers, creepers! how 'bout them Beezers? : the history of the Beezer Brothers architecture firm, 1892-1932" name="citation_title" />
<meta content="Wilcox, Ralph S." name="citation_author" />
<meta content="1997" name="citation_date" />
<meta content="http://cardinalscholar.bsu.edu/handle/handle/185977" name="citation_abstract_html_url" />

Jeepers, creepers! how 'bout them Beezers? : the history of the Beezer Brothers architecture firm, 1892-1932

Login

Cardinal Scholar

Back

Cardinal Scholar Home

→

Ball State Theses and Dissertations

→

Master's Theses

→

View Item

JavaScript is disabled for your browser. Some features of this site may not work without it.

Jeepers, creepers! how 'bout them Beezers? : the history of the Beezer Brothers architecture firm, 1892-1932

Wilcox, Ralph S.

Advisor:
Flores, Carol A. Hrvol, 1944-

Date:
1997

Other Identifiers:
LD2489.Z78 1997 .W55

CardCat URL:

http://liblink.bsu.edu/catkey/1041908

Degree:
Thesis (M.S.H.P.)

Department:
Department of Architecture

Abstract:

The architectural practice of Michael and Louis Beezer, identical twin brothers, lasted from 1892 until 1932. They practiced in Altoona, Pennsylvania, from 1892 until 1899; Pittsburgh, Pennsylvania, from 1900 until 1906; and in Seattle, Washington, from 1907 until 1932. During their practice, they produced a wide variety of designs including homes, banks, churches, rectories, schools, and hospitals. Today, seventy-two confirmed designs still exist around the country in Pennsylvania, Washington, Oregon, California, Montana, and Alaska. This creative project documents the Beezer Brothers' surviving buildings through current and historic photographs and a short amount of text with information on the history, style, and features of each building. A history of the firm, supplemented with biographical information, is also included.

Show full item record

Files in this item

Files
Size
Format
View

There are no files associated with this item.

This item appears in the following Collection(s)

Master's Theses [5052]
Master's theses submitted to the Graduate School by Ball State University master's degree candidates in partial fulfillment of degree requirements.

Search Cardinal Scholar

<form method="post" id="ds-search-form" action="/discover">
<fieldset>
<input type="text" class="ds-text-field " name="query" />
<input xmlns:i18n="http://apache.org/cocoon/i18n/2.1" value="Go" type="submit" name="submit" class="ds-button-field " onclick="
                                        var radio = document.getElementById("ds-search-form-scope-container");
                                        if (radio != undefined && radio.checked)
                                        {
                                        var form = document.getElementById("ds-search-form");
                                        form.action=
                                    "/handle/" + radio.value + "/discover" ;
                                        }
                                    " />

<input checked="checked" value="" name="scope" type="radio" id="ds-search-form-scope-all" />Search Cardinal Scholar

<input name="scope" type="radio" id="ds-search-form-scope-container" value="123456789/10" />This Collection
</fieldset>
</form>

Browse

All of Cardinal Scholar

Communities & Collections

Dates

Authors

Titles

Subjects

Advisors

Departments

This Collection

Dates

Authors

Titles

Subjects

Advisors

Departments

My Account

Login

DSpace software copyright © 2002-2015  DuraSpace

Cardinal Scholar FAQ and Guidelines | Ask A Librarian | Contact Us |

                    Send Feedback


text:
require './app'

configure_basics

Bugsnag.configure do |conf|
  conf.delivery_method = :thread_queue
end

Bugsnag.notify("handled string") do |report|
  report.add_tab(:config, {
    :delivery_method => "thread_queue",
    :forked => true
  })
end

# Added to stop Process deadlock
sleep(0.01)
Process.fork do
  Bugsnag.notify("handled string number 2") do |report|
    report.add_tab(:config, {
      :delivery_method => "thread_queue",
      :forked => true
    })
  end
end

Process.wait


text:
int main(int argc, char *argv[]) {
	int fd = open("/tmp/stringfile.txt", O_RDONLY);

	if (fd == -1) {
		fprintf(stderr, "can't open file. Error %d (%s)\n",
				errno, strerror(errno));
		return EXIT_FAILURE;
	}

	uint32_t stringLength;
	ssize_t result = read(fd, &stringLength, sizeof(stringLength));

	if (result == -1) {
		fprintf(stderr, "can't read file. Error %d (%s)\n",
				errno, strerror(errno));
		return EXIT_FAILURE;
	}

	// +1 accounts for the trailing zero byte we'll be adding to terminate
	// the string
	char *buffer = malloc(stringLength + 1);

	result = read(fd, buffer, stringLength);

	if (result == -1) {
		fprintf(stderr, "can't read file. Error %d (%s)\n",
				errno, strerror(errno));
		return EXIT_FAILURE;
	}

	buffer[stringLength] = '\0';

	close(fd);

	printf("the string is '%s'\n", buffer);

	free(buffer);	// clean up our mess

	return EXIT_SUCCESS;
} // main


text:
package multiplesofn;

import java.util.Scanner;

public class MultiplesofN {

    /**
     * this program lists the first 10 multiples of the input value
     */
    public static void main(String[] args) {
        int maxMultiples = 10;
        Scanner input = new Scanner(System.in);
        System.out.print("Enter the number you want multiples of : ");
        int multiplesOf = input.nextInt();
        for (int i=1; i<=maxMultiples;i++) {
            int answer = i *multiplesOf;
            System.out.printf("%d * %d == %d\n", i, multiplesOf, answer);
        }
    }
}


text:
function asyncN(n, callback){
  setTimeout(callback, n);
};

function async100(callback){
  asyncN(100, callback);
};

function async300(callback){
  asyncN(300, callback);
};

module.exports = {
  asyncN: asyncN,
  async100: async100,
  async300: async300
};


text:
'use strict';

// dependencies
const gulp = require('gulp');
const sass = require('gulp-sass');
const postcss = require('gulp-postcss');
const concat = require('gulp-concat');
const autoprefixer = require('autoprefixer');
const cleanCSS = require('gulp-clean-css');
const babelify = require('babelify');
const browserify = require('browserify');
const buffer = require('vinyl-buffer');
const source = require('vinyl-source-stream');
const sourcemaps = require('gulp-sourcemaps');

// Scripts (ES6)
gulp.task('babelify', function () {
    let bundler = browserify('./src/script/main.js', {debug: true}).transform(babelify);

    bundler.bundle()
        .on('error', function (err) {
            console.error(err);
            this.emit('end');
        })
        .pipe(source('app.js')) //fichier de destination
        .pipe(buffer())
        .pipe(sourcemaps.init({loadMaps: true}))
        .pipe(sourcemaps.write('./'))
        .pipe(gulp.dest('./dist/script'));
});

// Images (move)
gulp.task('images', function () {
    return gulp.src('./src/images/**/*.svg')
        .pipe(gulp.dest('./dist/images'));
});

// Style (sass)
gulp.task('style', function () {
    return gulp.src('./src/style/main.scss')
        .pipe(sourcemaps.init())
        .pipe(sass())
        .on('error', function (err) {
            console.error(err);
            this.emit('end');
        })
        .pipe(postcss([ autoprefixer() ]))
        .pipe(concat('app.css'))
        .pipe(cleanCSS())
        .pipe(sourcemaps.write('./'))
        .pipe(gulp.dest('./dist/style'));
});

// Fonts (move)
gulp.task('fonts', function () {
    return gulp.src('./src/fonts/**/*.*')
        .pipe(gulp.dest('./dist/fonts'));
});

// Watches
gulp.task('watch', function () {
    gulp.watch('./src/script/*.js', ['babelify']);
    gulp.watch('./src/images/**/*.*', ['images']);
    gulp.watch('./src/style/*.scss', ['style']);
    gulp.watch('./src/fonts/**/*.*', ['fonts']);
});

// Default
gulp.task('default', ['deploy', 'watch']);

// Deploy only (without watch task)
gulp.task('deploy', ['babelify', 'images', 'style', 'fonts']);


text:
#include <Python.h>

#include <stdio.h>
#include "gps.h"
#include "gpsdclient.h"
#include "compiler.h"	/* for UNUSED */

/*
 * Client utility functions
 */

static PyObject *
gpsclient_deg_to_str(PyObject *self UNUSED, PyObject *args)
{
    int fmt;
    double degrees;

    if (!PyArg_ParseTuple(args, "id", &fmt, &degrees))
	return NULL;
    return Py_BuildValue("s", deg_to_str((enum deg_str_type)fmt, degrees));
}

static PyObject *
gpsclient_gpsd_units(PyObject *self UNUSED, PyObject *args)
{
    if (!PyArg_ParseTuple(args, ""))
	return NULL;
    return Py_BuildValue("i", (int)gpsd_units());
}

/*
 * Miscellanea
 */

static PyObject *
gpsclient_wgs84_separation(PyObject *self UNUSED, PyObject *args)
{
    const double lat, lon;
    double sep;

    if (!PyArg_ParseTuple(args, "dd", &lat, &lon))
	return NULL;
    sep = wgs84_separation(lat, lon);
    return Py_BuildValue("d", sep);
}

static PyObject *
gpsclient_maidenhead(PyObject *self UNUSED, PyObject *args)
{
    const double lat, lon;
    char *gs;

    if (!PyArg_ParseTuple(args, "dd", &lat, &lon))
	return NULL;
    gs = maidenhead(lat, lon);
    return Py_BuildValue("s", gs);
}

/* List of functions defined in the module */

static PyMethodDef gpsclient_methods[] = {
    {"wgs84_separation",	gpsclient_wgs84_separation,	METH_VARARGS,
     PyDoc_STR("Return WGS84 geodetic separation in meters.")},
    {"deg_to_str",      	gpsclient_deg_to_str,      	METH_VARARGS,
     PyDoc_STR("String-format a latitude/longitude.")},
    {"gpsd_units",      	gpsclient_gpsd_units,      	METH_VARARGS,
     PyDoc_STR("Deduce a set of units from locale and environment.")},
    {"maidenhead",      	gpsclient_maidenhead,  	METH_VARARGS,
     PyDoc_STR("Maidenhead grid-square locator from lat/lon.")},
    {NULL,		NULL}		/* sentinel */
};

PyDoc_STRVAR(module_doc,
"Python wrapper for selected libgps library routines.\n\
");

/* banishes a pointless compiler warning */
extern PyMODINIT_FUNC initclienthelpers(void);

PyMODINIT_FUNC
// cppcheck-suppress unusedFunction
initclienthelpers(void)
{
    PyObject *m;

    m = Py_InitModule3("gps.clienthelpers", gpsclient_methods, module_doc);

    PyModule_AddIntConstant(m, "deg_dd", deg_dd);
    PyModule_AddIntConstant(m, "deg_ddmm", deg_ddmm);
    PyModule_AddIntConstant(m, "deg_ddmmss", deg_ddmmss);

    PyModule_AddIntConstant(m, "unspecified", unspecified);
    PyModule_AddIntConstant(m, "imperial", imperial);
    PyModule_AddIntConstant(m, "nautical", nautical);
    PyModule_AddIntConstant(m, "metric", metric);
}


text:
package abstractfactory.product;

public class RedStarburstColor implements ColorInterface {
	private String color = "red starburst";
	public String getColor() {
		return color;
	}
}


text:
<?php namespace Modulework\Modules\Http;
/*
 * (c) Christian Gärtner <christiangaertner.film@googlemail.com>
 * This file is part of the Modulework Framework
 * License: View distributed LICENSE file
 */

use Modulework\Modules\Http\Utilities\FileCase;
use Modulework\Modules\Http\Utilities\ArrayCase;
use Modulework\Modules\Http\Utilities\HeaderCase;
use Modulework\Modules\Http\Utilities\ServerCase;

/**
* Request
* This class represents the current HTTP request.
* It exposes 6 public vars (objects) for getting information
* For some there are methods for convience.
*/
class Request
{

	/**
	 * The ArrayCase for the QueryString (_GET)
	 * @var \Modulework\Modules\Http\ArrayCase
	 */
	public $query;

	/**
	 * The ArrayCase for the POST request (_POST)
	 * @var \Modulework\Modules\Http\ArrayCase
	 */
	public $request;

	/**
	 * The ArrayCase for the server varibales (_SERVER)
	 * @var \Modulework\Modules\Http\ServerCase
	 */
	public $server;

	/**
	 * The ArrayCase for the files attached to the request (_FILES)
	 * @var \Modulework\Modules\Http\FileCase
	 */
	public $files;

	/**
	 * The ArrayCase for the cookies (_COOKIE)
	 * @var \Modulework\Modules\Http\ArrayCase
	 */
	public $cookies;

	/**
	 * The ArrayCase for the HTTP headers
	 * @var \Modulework\Modules\Http\HeaderCase
	 */
	public $headers;

	/**
	 * The URI of this request
	 * @var string
	 */
	protected $uri;

	/**
	 * The path information of this request
	 * @var string
	 */
	protected $path;

	/**
	 * The base URL of this request
	 * @var string
	 */
	protected $baseUrl;

	/**
	 * The base path of this request
	 * @var string
	 */
	protected $basePath;

	/**
	 * The HTTP verb (GET/POST/PUT/DELETE)
	 * @var string
	 */
	protected $method;

	/**
	 * Create the Request object from PHP _ENV (or superglobals)
	 * @return \Modulework\Modules\Http\Request The new Request object
	 */
	public static function makeFromGlobals()
	{
		return new static($_GET, $_POST, $_COOKIE, $_FILES, $_SERVER);
	}

	/**
	 * Constructor
	 * @param  array  $query   GET
	 * @param  array  $request POST
	 * @param  array  $cookies COOKIE
	 * @param  array  $files   FILES
	 * @param  array  $server  SERVER
	 */
	public function __construct(array $query = array(), array $request = array(), array $cookies = array(), array $files = array(), array $server = array())
	{
		$this->init($query, $request, $cookies, $files, $server);
	}

	/**
	 * Displays the Request in the following format:
	 * PROTOCOLL VERB >> BASEURI
	 * @return string [description]
	 */
	public function __toString()
	{
		return sprintf('%s %s >> %s', $this->server->get('SERVER_PROTOCOL'), $this->getMethod(), $this->getBaseUri());
	}

	/**
	 * Initialize all parameters
	 * @param  array  $query   GET
	 * @param  array  $request POST
	 * @param  array  $cookies COOKIE
	 * @param  array  $files   FILES
	 * @param  array  $server  SERVER
	 */
	public function init(array $query = array(), array $request = array(), array $cookies = array(), array $files = array(), array $server = array())
	{
		$this->query = new ArrayCase($query);
		$this->request = new ArrayCase($request);
		$this->cookies = new ArrayCase($cookies);
		$this->files = new FileCase($files);
		$this->server = new ServerCase($server);
		$this->headers = new HeaderCase($this->server->getHeaders());

		// Reset propertys
		$this->uri = null;
		$this->path = null;
		$this->baseUrl = null;
		$this->basePath = null;
		$this->method = null;
	}

	/**
	 * Write changes to the Request to the globals
	 */
	public function applyChanges()
	{
		$_GET = $this->query->all();
		$_POST = $this->request->all();
        $_SERVER = $this->server->all();
        $_COOKIE = $this->cookies->all();
	}

	/**
	 * Mock an request by providing a URI only, to feed more info is still possible
	 * @param  string $uri     The URI
	 * @param  string $method  The HTTP request method
	 * @param  array  $request The _POST values
	 * @param  array  $cookies The _COOKIES
	 * @param  array  $files   The _FILES
	 * @param  array  $server  The _SERVER values
	 *
	 * @return \Modulework\Modules\Http\Request          A new instance based on the info provided
	 */
	public static function mock($uri, $method = 'GET', array $request = array(), array $cookies = array(), array $files = array(), array $server = array())
	{
		$server = array_replace(array(
								'SERVER_PROTOCOL' => 'HTTP/1.1',
								'SERVER_NAME' => 'localhost',
								'SERVER_PORT' => 80,
								'SCRIPT_NAME' => '',
								'SCRIPT_FILENAME' => '',
								'HTTP_HOST' => 'localhost',
								'HTTP_ACCEPT' => 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
								'HTTP_USER_AGENT' => 'Modulework/Release',
								'HTTP_ACCEPT_LANGUAGE' => 'en-us,en;q=0.5',
								'REQUEST_TIME' => time(),
		), $server);

		$server['REQUEST_METHOD'] = strtoupper($method);

		$parsed = parse_url($uri);

		if (isset($parsed['host'])) {
			$server['SERVER_NAME'] = $parsed['host'];
			$server['HTTP_HOST'] = $parsed['host'];
		}

		if (isset($parsed['scheme'])) {
			if ($parsed['scheme'] === 'https') {
				$server['SERVER_PORT'] = 443;
				$server['HTTPS'] = 'on';
			} else {
				$server['SERVER_PORT'] = 80;
				unset($server['HTTPS']);
			}
		}

		if (isset($parsed['port'])) {
			$server['SERVER_PORT'] = $parsed['port'];
			$server['HTTP_HOST'] .= ':' . $parsed['port'];
		}

		if (!isset($parsed['path'])) {
			$parsed['path'] = '/';
		}

		$query = array();
		if (isset($parsed['query'])) {
			parse_str(html_entity_decode($parsed['query']), $query);
		}

		$queryString = http_build_query($query, '', '&');
		$server['QUERY_STRING'] = $queryString;

		$server['REQUEST_URI'] = $parsed['path'] . ('' == $queryString ? '' : '?' . $queryString);

		return new static($query, $request, $cookies, $files, $server);
	}

	/**
	 * Normalize a query string
	 * @param  string $query Query String
	 * @return string        The normalized version of $query
	 */
	public static function normalizeQuery($query)
	{
		if ('' == $query) {
			return '';
		}

		$parts = array();
		$sort = array();

		$split = explode('&', $query);

		foreach ($split as $value) {
			if ('' == $value || '=' === $value[0]) continue;

			$pair = explode('=', $value, 2);

			if (isset($pair[1])) {
				$parts[] = rawurlencode(urldecode($pair[0])) . '=' . rawurlencode(urldecode($pair[1]));
			} else {
				$parts[] = rawurlencode(urldecode($pair[0]));
			}

			$sort[] = urldecode($pair[0]);
		}

		array_multisort($sort, SORT_ASC, $parts);

		return implode('&', $parts);
	}

	/**
	 * Returns the request method
	 * @return string The request method
	 */
	public function getMethod()
	{
		if ($this->method === null) {
			$this->method = strtoupper($this->server->get('REQUEST_METHOD', 'GET'));
		}
		return $this->method;
	}

	/**
	 * Mock the request method
	 * @param string $method The request method
	 */
	public function setMethod($method)
	{
		$this->$method = null; //Reset, so it' s getting regenerated properly.
		$this->server->set('REQUEST_METHOD', strtoupper($method), true);
	}

	/**
	 * Returns either http or https
	 * calls isSecure()
	 * @return string The scheme (http | https)
	 */
	public function getScheme()
	{
		return $this->isSecure() ? 'https' : 'http';
	}

	/**
	 * Returns the HTTP Host (with port if not default)
	 *
	 * For example:
	 *	localhost
	 * or
	 * 	localhost:4000
	 *
	 * @return string The host
	 */
	public function getHttpHost()
	{
		$port = $this->getPort();
		$scheme = $this->getScheme();

		if (('https' == $scheme && $port == 443) || ('http' == $scheme && $port == 80)) {
			// if standard ports then don' t add em
			return $this->getHost();
		}

		return $this->getHost() . ':' . $port;

	}

	/**
	 * Returns the host of the server
	 * @return string The host of this server
	 */
	public function getHost()
	{
		if (!$host = $this->headers->get('HOST')) {
			if (!$host = $this->server->get('SERVER_ADDR')) {
				$host = $this->server->get('SERVER_NAME', '');
			}
		}

		$host = strtolower(preg_replace('/:\d+$/', '', trim($host)));

		return $host;
	}

	/**
	 * Set the host in the header
	 * @param string $host The new host
	 */
	public function setHost($host)
	{
		$this->headers->set('HOST', $host, true);
	}

	/**
	 * Port for the Request
	 * @return string the port
	 */
	public function getPort()
	{
		return $this->server->get('SERVER_PORT');
	}

	/**
	 * Retrieve the accepted encoding types from the HTTP headers
	 * @return array The accepted encodings
	 */
	public function getAcceptedEncodings()
	{
		return explode(',', $this->headers->get('ACCEPT_ENCODING'));
	}

	/**
	 * Get the BaseUri
	 * Calls once: generateBaseUri()
	 * @return string The base uri for the request
	 */
	public function getBaseUri()
	{
		if ($this->uri === null) {
			$this->uri = $this->generateBaseUri();
		}
		return $this->uri;
	}

	/**
	 * The base URL
	 * @return string The base URL
	 */
	public function getBaseUrl()
	{
		if ($this->baseUrl === null) {
			$this->baseUrl = $this->generateBaseUrl();
		}
		return $this->baseUrl;
	}

	/**
	 * Returns the path.
	 * Examples (this class was initalized at /dev on localhost):
	 *
	 * * http://localhost/dev			->	''
	 * * http://localhost/dev/more		->	'/more'
	 * * http://localhost/dev/more?foo	->	'/more'
	 * @return string The path
	 */
	public function getPath()
	{
		if ($this->path === null) {
			$this->path = $this->generatePath();
		}

		return $this->path;
	}

	/**
	 * Returns the base path from the root,
	 * for example if this class was constructed in the subfolder
	 * 'foo' this method would return 'foo' for this uri:
	 * http://localhost/foo/index.php
	 * @return string The raw path
	 */
	public function getBasePath()
	{
		if ($this->basePath === null) {
			$this->basePath = $this->generateBasePath();
		}

		return $this->basePath;
	}

	/**
	 * Returns the root URL
	 * @return string The root URL
	 */
	public function root()
	{
		return rtrim($this->getScheme() . '://' . $this->getHost() .  $this->getPath(), '/');
	}

	/**
	 * Returns the URL (without query string)
	 * @return string The URL
	 */
	public function url()
	{
		return rtrim(preg_replace('/\?.*/', '', $this->getBaseUri()), '/');
	}

	/**
	 * Returns all URI segments
	 * (or empty array if path = '/')
	 * @return array The URI segments
	 */
	public function segments()
	{
		$path = $this->getPath();

		$array = $path == '/' ? array() : explode('/', $path);
		return array_filter($array, function($val) {
			return $val != '';
		});
	}

	/**
	 * Get a URI segment
	 * 1 based index
	 * @param  int    $index   The index
	 * @param  mixed  $default If the segement does not exists this will get returned
	 * @return mixed           The URI segment | $default
	 */
	public function segment($index, $default = null)
	{
		if ('/' === $path = $this->getPath()) {
			return '/';
		}

		$segments = explode('/', rtrim($path, '/'));

		$segments = array_filter($segments, function($val) {
			return $val != '';
		});

		return (isset($segments[$index])) ? $segments[$index] : $default;
	}

	/**
	 * Check if the request method equals the given
	 * @param  string  $method The method to test
	 * @return boolean         TRUE if match
	 */
	public function isMethod($method)
	{
		return ($this->getMethod() === strtoupper($method));
	}

	/**
	 * Wrapper for isXmlHttpRequest
	 * @return boolean TRUE if it is a XMLHttpRequest
	 */
	public function isAjax()
	{
		return $this->isXmlHttpRequest();
	}

	/**
	 * Is the request of type XMLHttpRequest
	 * @return boolean TRUE if it is a XMLHttpRequest
	 */
	public function isXmlHttpRequest()
	{
		return ('XMLHttpRequest' == $this->headers->get('X-Requested-With'));
	}

	/**
	 * Check for HTTPS connection
	 * @return boolean TRUE if it is a HTTPS connection
	 */
	public function isSecure()
	{
		return (1 == $this->server->get('HTTPS') || strtolower($this->server->get('HTTPS') == 'on'));
	}

	/**
	 * Returns the client' s IP address
	 * @return string The IP
	 */
	public function getClientIp()
	{
		return $this->server->get('REMOTE_ADDR');
	}

	/**
	 * Returns the current script name
	 * @return string  The script name
	 */
	public function getScript()
	{
		return $this->server->get('SCRIPT_NAME');
	}

	/**
	 * Generate the BaseUri
	 * @return string The base uri
	 */
	protected function generateBaseUri()
	{
		$uri = '';

		/*
		 * The first check is obvious, all these headers after REQUEST_URI are taken from the Zend Framework,
		 * they are for IIS and the like setups.
		 */
		if ($this->server->has('REQUEST_URI')) {
			$uri = $this->server->get('REQUEST_URI');
			// this will be with scheme and host maybe....
			// We' ll need to cut these out
			$schemeHost = $this->getScheme() . '://' . $this->getHttpHost();
			if (strpos($uri, $schemeHost) === 0) {
				$uri = substr($uri, strlen($schemeHost));
			}

		} elseif ($this->server->has('ORIG_PATH_INFO')) {
			$uri = $this->server->get('ORIG_PATH_INFO');
			if ('' == $this->server->get('QUERY_STRING')) {
				$uri .= '?' . $this->server->get('QUERY_STRING');
			}

		} elseif ($this->headers->has('X_ORIGINAL_URL')) {
			$uri = $this->headers->get('X_ORIGINAL_URL');

		} elseif ($this->headers->has('X_REWRITE_URL')) {
			$this->headers->has('X_REWRITE_URL');

		} elseif ($this->server->has('IIS_WasUrlRewritten') == '1' && ('' !== $this->server->get('UNENCODED_URL'))) {
			$uri = $this->server->get('UNENCODED_URL');

		} elseif ($this->server->has('IIS_WasUrlRewritten') == '1' && ('' !== $this->server->get('UNENCODED_URL'))) {
			$uri = $this->server->get('UNENCODED_URL');

		}

		$this->server->set('REQUEST_URI', $uri);

		return $uri;
	}

	/**
	 * Generate the BaseUrl
	 * @return string The base url
	 */
	protected function generateBaseUrl()
	{
		$filename = basename($this->server->get('SCRIPT_FILENAME'));

		if (basename($this->server->get('SCRIPT_NAME')) === $filename) {
			$baseUrl = $this->server->get('SCRIPT_NAME');
		} elseif (basename($this->server->get('PHP_SELF')) === $filename) {
			$baseUrl = $this->server->get('PHP_SELF');
		} elseif (basename($this->server->get('ORIG_SCRIPT_NAME')) === $filename) {
			$baseUrl = $this->server->get('ORIG_SCRIPT_NAME');
        } else {
        	$path = $this->server->get('PHP_SELF', '');
        	$file = $this->server->get('SCRIPT_FILENAME', '');

        	$parts = array_reverse(explode('/', trim($file, '/')));

        	$i = 0;

        	$prev = count($parts);

        	$baseUrl = '';

        	do {
        		$part = $parts[$i];
        		$baseUrl = '/' . $part . $baseUrl;
        		$i++;
        	} while (($prev > $i) && (($pos = strpos($path, $baseUrl)) !== false) && (0 !== $pos));
		}

		$uri = $this->getBaseUri();

		if ($baseUrl && false !== $pre = self::getPrefixUrlEncoded($uri, $baseUrl)) return $pre;

		if ($baseUrl && false !== $pre = self::getPrefixUrlEncoded($uri, dirname($baseUrl))) return rtrim($prefix, '/');

		if (($pos = strpos($uri, '?')) !== false) {
			$queryLessUri = substr($uri, 0, $pos);
		} else {
			$queryLessUri = $uri;
		}

		$base = basename($baseUrl);

		if (empty($base) || !strpos(rawurldecode($queryLessUri), $base)) return '';

		return rtrim($baseUrl, '/');

	}

	protected function generateBasePath()
	{
		$filename = basename($this->server->get('SCRIPT_FILENAME'));
		$baseUrl = $this->getBaseUrl();

		if (empty($baseUrl)) return '';

		$basePath = (basename($baseUrl) === $filename) ? dirname($baseUrl) : $baseUrl;

		if ('\\' === DIRECTORY_SEPARATOR) { // We are on Windows
            $basePath = str_replace('\\', '/', $basePath);
        }

        return rtrim($basePath, '/');
	}

	protected function generatePath()
	{
		$baseUrl = $this->getBaseUrl();

		if (($baseUri = $this->getBaseUri()) === null) return '/';

		$path = '/';

		if ($pos = strpos($baseUri, '?')) $baseUri = substr($baseUri, 0, $pos);

		if ((null !== $baseUrl) && (false === ($path = substr($baseUri, strlen($baseUrl))))) {
			return '/';
		} elseif ($baseUrl === null) {
			return $baseUri;
		}

		return $path;
	}

	/**
	 * Returns the string prefix if it' s the string' s prefix (URL Encoded)
	 * false otherwise
	 * @param  string $str 		The urlencoded string
	 * @param  string $pre 		The NOT encoeded prefix
	 * @return string|false		The prefix as it is encoded in $str or false
	 */
	protected static function getPrefixUrlEncoded($str, $pre)
	{
		if (strpos(rawurldecode($str), $pre) !== 0) return false;

		$length = strlen($pre);

		/*
		NOTE! THIS REGEX is COPIED from the ZEND Framework (BSD License)
		 */
		if (preg_match("#^(%[[:xdigit:]]{2}|.){{$length}}#", $str, $match)) return $match[0];

		return false;
	}

}


text:
package com.heroku.myapp.myorchestrator.consumers.request;

import com.heroku.myapp.commons.config.enumerate.Kind;
import com.heroku.myapp.commons.config.enumerate.KindOption;
import com.heroku.myapp.commons.consumers.QueueConsumer;
import java.util.stream.Stream;
import org.springframework.stereotype.Component;

@Component
public class TimerRequester extends QueueConsumer {

    @Override
    public void configure() {

        Stream.of(Kind.values())
                .filter((Kind k) -> k.isEnable(KindOption.polling))
                .forEach((Kind k) -> {
                    from(k.timerUri())
                            .routeId(util().timer().kind(k).id())
                            .setBody().constant(k.preMessage())
                            .to(util().snapshot().ironmqPostUri());
                });
    }
}


text:
package com.crashinvaders.common.scene2d.lml.attributes;

import com.badlogic.gdx.scenes.scene2d.ui.VerticalGroup;
import com.github.czyzby.lml.parser.LmlParser;
import com.github.czyzby.lml.parser.tag.LmlAttribute;
import com.github.czyzby.lml.parser.tag.LmlTag;

/** See {@link VerticalGroup#expand(boolean)}. Mapped to "groupExpand".
 *
 * @author metaphore */
public class VerticalGroupExpandLmlAttribute implements LmlAttribute<VerticalGroup> {
    @Override
    public Class<VerticalGroup> getHandledType() {
        return VerticalGroup.class;
    }

    @Override
    public void process(final LmlParser parser, final LmlTag tag, final VerticalGroup actor,
            final String rawAttributeData) {
        actor.expand(parser.parseBoolean(rawAttributeData, actor));
    }
}


text:
define(['angular'], function(angular) {
  var DefinitionCtrl = [ '$scope', '$routeParams', 'camundaService', 'Views', 'page', 'search', 'breadcrumbTrails', 'dataDepend',
      function($scope, $routeParams, camundaService, Views, page, search, breadcrumbTrails, dataDepend) {
        'use strict';

        // create data depend item & store for sub-scopes
        var caseData = $scope.caseData = dataDepend.create($scope);

        /*
         * Single definition display
         */
        // only load if case definition id is selected.
        if ($routeParams.caseDefinitionId) {

          /*
           * Providers
           */
          caseData.provide('definition', [ function() {
            // load the case definition
            return camundaService.caseDefinition($routeParams.caseDefinitionId);
          } ]);

          caseData.provide('instances', [ 'definition', function(definition) {
            // load the case definition
            return camundaService.caseInstances(definition.key, definition.id);
          } ]);

          caseData.provide('definitionsByKey', [ 'definition', function(definition) {
            return camundaService.caseDefinitions(false, definition.key);
          } ]);

          caseData.provide('instances.all', [ 'definition', function(definition) {
            return camundaService.caseInstanceCountByKey(definition.key);
          } ]);

          caseData.provide('instances.current', [ 'definition', function(definition) {
            return camundaService.caseInstanceCount(definition.id);
          } ]);

          caseData.provide('definitionDiagram', ['definition', function(definition) {
            return camundaService.caseDiagram(definition.id);
          } ]);

          /*
           * Observers
           */
          caseData.observe([ 'definition', function(definition) {
            $scope.selectedCase = definition;
          } ]);

          caseData.observe([ 'definitionDiagram', 'definition', function(definitionDiagram) {
            $scope.selectedCase.src = definitionDiagram;
          } ]);

          caseData.observe([ 'definitionsByKey', function(definitions) {
            $scope.caseVersions = definitions;
          } ]);

          /*
           * Bread Crumbs & Title
           */
          caseData.observe([ 'definition', function(definition) {
            page.breadcrumbsClear();

            page.breadcrumbsAdd({
              type : 'caseDefinition',
              label : definition.name || definition.key || definition.id,
              href : '#/case-definition/' + definition.id,
              caseDefinition : definition
            });
            page.titleSet([ 'camunda Cockpit', definition.name || definition.key || definition.id, 'Case Definition View' ].join(' | '));
          } ]);
        }

        /*
         * Collect statistics
         */
        $scope.instanceStatistics = caseData.observe([ 'instances.all', 'instances.current' ], function(all, current) {
            $scope.instanceStatistics.all = all.count;
            $scope.instanceStatistics.current = current.count;
        });

        $scope.caseDefinitionVars = { read: [ 'definition', 'instances', 'caseData' ] };

        $scope.caseDefinitionActions = Views.getProviders({ component : 'cockpit.caseDefinition.runtime.action'});
        $scope.caseDefinitionTabs = Views.getProviders({ component : 'cockpit.caseDefinition.runtime.tab' });

        function setDefaultTab(tabs) {
          var selectedTabId = search().detailsTab;
          if (!tabs || !tabs.length) {
            return;
          }
          if (selectedTabId) {
            var provider = Views.getProvider({ component : 'cockpit.caseInstance.runtime.tab', id : selectedTabId });
            if (provider && tabs.indexOf(provider) != -1) {
              $scope.selectedTab = provider;
              return;
            }
          }
          search.updateSilently({
            detailsTab : null
          });
          $scope.selectedTab = tabs[0];
        }

        /*
         * Tabs handling
         */
        $scope.selectTab = function(tabProvider) {
          $scope.selectedTab = tabProvider;
          search.updateSilently({
            detailsTab : tabProvider.id
          });
        };
        setDefaultTab($scope.caseDefinitionTabs);

      } ];

//use views module
  var module = angular.module('cockpit.plugin.acm-plugin.views');
  // register routing for case definitions
  module.config([ '$routeProvider', function($routeProvider) {

    $routeProvider.when('/case-definition/:caseDefinitionId', {
      templateUrl : require.toUrl('../../../api/cockpit/plugin/acm-plugin/static/app/views/definition/definition.html'),
//      templateUrl : Uri.appUri('plugin://acm-plugin/static/app/views/definition/definition.html'),
      controller : DefinitionCtrl,
      authentication : 'required'
    });
  } ]);

  return module;
});


text:
class ChangeTimesToSeconds < ActiveRecord::Migration
  def change
    Task.update_all( 'original_estimate = original_estimate * 3600, remaining_estimate = remaining_estimate * 3600' )
    WorkLog.update_all( 'worked = worked * 3600')
    ProjectSnapshot.update_all( 'original_estimate = original_estimate * 3600, remaining_estimate = remaining_estimate * 3600, work_logged = work_logged * 3600' )
  end
end


text:
package com.structurizr.example.annotations.componentA;

import com.structurizr.annotation.Component;

@Component(description = "A component that does something")
public interface ComponentA {

    void doSomething();

}