text:
<!--
  Copyright 2012 Yuriy Lagodiuk

  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at

    https://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
			xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
	<modelVersion>4.0.0</modelVersion>

	<groupId>com.lagodiuk</groupId>
	<artifactId>gp</artifactId>
	<version>1.2.0</version>
	<packaging>jar</packaging>
	<name>gp</name>
	<properties>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<java-version>1.6</java-version>
	</properties>

	<dependencies>
		<dependency>
			<groupId>com.lagodiuk</groupId>
			<artifactId>ga</artifactId>
			<version>1.2.0</version>
			<scope>compile</scope>
		</dependency>

		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<version>4.12</version>
			<scope>test</scope>
		</dependency>
	</dependencies>

	<build>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>3.5.1</version>
				<configuration>
					<source>1.8</source>
					<target>1.8</target>
				</configuration>
			</plugin>
			<plugin>
				<artifactId>maven-assembly-plugin</artifactId>
				<version>2.6</version>
				<configuration>
					<descriptorRefs>
						<descriptorRef>jar-with-dependencies</descriptorRef>
					</descriptorRefs>
					<archive>
						<manifest>
							<mainClass>com.lagodiuk.gp.symbolic.example.Main</mainClass>
						</manifest>
					</archive>
					<outputDirectory>${project.basedir}/bin</outputDirectory>
					<appendAssemblyId>false</appendAssemblyId>
					<finalName>symbolic_regression_${project.version}</finalName>
				</configuration>
				<executions>
					<execution>
						<id>make-assembly</id>
						<phase>package</phase>
						<goals>
							<goal>single</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
		</plugins>
	</build>
</project>


text:
use strict;

use ExecuteAndTrace;

# Purpose: Creates a base image via kickstart configuration.

# TODO Make base image name configurable.
# TODO Make image and ks.cfg configurable.
# TODO Make size configurable?
# TODO Make the file type configurable qcows/lvm

Log("III Create the baseimage: baseks\n");
DieIfExecuteFails("virt-install --name baseks --memory 768 --disk \"pool=qcows,bus=virtio,size=10\" --vcpus 1 --location http://10.1.233.3/images/linux/releases/20/Fedora/x86_64/os --graphics none --extra-args=\"acpi=on console=tty0 console=ttyS0,115200 ks=http://10.1.233.3/configs/ks_fedora-20-x86_64_http_kvm_guest.cfg\" --network bridge:virbr0");
Log("III Done\n");

redpajama_set_name: RedPajamaGithub


text:
package com.microsoft.partnercatalyst.fortis.spark.sinks.cassandra

import java.text.Collator
import java.util.{Date, Locale}

import com.microsoft.partnercatalyst.fortis.spark.analyzer.timeseries.{Period, PeriodType}
import com.microsoft.partnercatalyst.fortis.spark.dto.FortisEvent
import com.microsoft.partnercatalyst.fortis.spark.sinks.cassandra.dto._
import com.microsoft.partnercatalyst.fortis.spark.sinks.cassandra.udfs.FortisUdfFunctions
import com.microsoft.partnercatalyst.fortis.spark.transforms.locations.TileUtils.DETAIL_ZOOM_DELTA
import com.microsoft.partnercatalyst.fortis.spark.transforms.locations._

object CassandraEventSchema {
  def apply(item: FortisEvent, batchid: String): Event = {
    Event(
      pipelinekey = item.details.pipelinekey,
      externalsourceid = item.details.externalsourceid,
      computedfeatures = Utils.getFeatures(item),
      eventtime = item.details.eventtime,
      batchid = batchid,
      topics = item.analysis.keywords.map(_.name.toLowerCase),
      fulltext = s"[${Option(item.details.title).getOrElse("")}] - ${item.details.body}",
      placeids = item.analysis.locations.map(_.wofId),
      eventlangcode = item.analysis.language.orNull,
      eventid = item.details.eventid,
      sourceeventid = item.details.sourceeventid,
      insertiontime = new Date().getTime,
      body = item.details.body,
      imageurl = item.details.imageurl,
      summary = item.analysis.summary.getOrElse(""),
      sourceurl = item.details.sourceurl,
      title = item.details.title)
  }
}

object CassandraPopularPlaces {
  def apply(item: Event, minZoom: Int): Seq[PopularPlace] = {
    for {
      kw <- Utils.getConjunctiveTopics(Option(item.computedfeatures.keywords))
      location <- item.computedfeatures.places
      periodType <- Utils.getCassandraPeriodTypes
      zoom <- TileUtils.maxZoom(minZoom) to minZoom by -1
      tileid = TileUtils.tile_id_from_lat_long(location.centroidlat, location.centroidlon, zoom)
    } yield PopularPlace(
      pipelinekey = item.pipelinekey,
      placeid = location.placeid,
      tilez = tileid.zoom,
      tileid = tileid.tileId,
      perioddate = Period(item.eventtime, periodType).startTime(),
      periodtype = periodType.periodTypeName,
      externalsourceid = item.externalsourceid,
      mentioncount = item.computedfeatures.mentions,
      conjunctiontopic1 = kw._1,
      conjunctiontopic2 = kw._2,
      conjunctiontopic3 = kw._3,
      avgsentimentnumerator = (item.computedfeatures.sentiment.neg_avg * FortisUdfFunctions.DoubleToLongConversionFactor).toLong
    )
  }
}

object CassandraConjunctiveTopics {

  def flatMapKeywords(item: Event): Seq[(String, String)] = {
    val keywords = item.computedfeatures.keywords.toSet.toSeq
    if (keywords.isEmpty) Seq() else keywords.map(k=>(k, "")) ++ keywords.combinations(2).flatMap(combination => Seq(
      (combination.head, combination(1)),
      (combination(1), combination.head
      )))
  }

  def apply(item: Event, minZoom: Int): Seq[ConjunctiveTopic] = {
    val keywords = item.computedfeatures.keywords
    val keywordPairs = flatMapKeywords(item)

    val tiles = TileUtils.tile_seq_from_places(item.computedfeatures.places, minZoom)

    for {
      kwPair <- keywordPairs
      tileid <- tiles
      periodType <- Utils.getCassandraPeriodTypes
    } yield ConjunctiveTopic(
      topic = kwPair._1,
      conjunctivetopic = kwPair._2,
      externalsourceid = item.externalsourceid,
      mentioncount = item.computedfeatures.mentions,
      perioddate = Period(item.eventtime, periodType).startTime(),
      periodtype = periodType.periodTypeName,
      pipelinekey = item.pipelinekey,
      tileid = tileid.tileId,
      tilez = tileid.zoom
    )
  }
}

object CassandraTileBucket {
  def apply(item: HeatmapTile): ComputedTile = {
    ComputedTile(
      pipelinekey = item.pipelinekey,
      mentioncount = item.mentioncount,
      avgsentimentnumerator = item.avgsentimentnumerator,
      externalsourceid = item.externalsourceid,
      perioddate = item.perioddate,
      conjunctiontopic1 = item.conjunctiontopic1,
      conjunctiontopic2 = item.conjunctiontopic2,
      conjunctiontopic3 = item.conjunctiontopic3,
      tilez = item.tilez,
      tileid = item.tileid,
      periodtype = item.periodtype
    )
  }
}

object CassandraHeatmapTiles {
  def apply(item: Event, minZoom: Int): Seq[HeatmapTile] = {
    for {
      ct <- Utils.getConjunctiveTopics(Option(item.computedfeatures.keywords))
      place <- item.computedfeatures.places
      periodType <- Utils.getCassandraPeriodTypes
      zoom <- TileUtils.maxZoom(minZoom) to minZoom by -1
      tileId = TileUtils.tile_id_from_lat_long(place.centroidlat, place.centroidlon, zoom)
    } yield HeatmapTile(
        pipelinekey = item.pipelinekey,
        perioddate = Period(item.eventtime, periodType).startTime(),
        periodtype = periodType.periodTypeName,
        tileid = tileId.tileId,
        tilez = tileId.zoom,
        heatmaptileid = TileUtils.tile_id_from_lat_long(place.centroidlat, place.centroidlon, zoom + DETAIL_ZOOM_DELTA).tileId,
        conjunctiontopic1 = ct._1,
        conjunctiontopic2 = ct._2,
        conjunctiontopic3 = ct._3,
        externalsourceid = item.externalsourceid,
        mentioncount = item.computedfeatures.mentions,
        avgsentimentnumerator = (item.computedfeatures.sentiment.neg_avg * FortisUdfFunctions.DoubleToLongConversionFactor).toLong
    )
  }
}

object CassandraEventPlacesSchema {
  def apply(item: Event, minZoom: Int): Seq[EventPlaces] = {
    for {
      ct <- Utils.getConjunctiveTopics(Option(item.computedfeatures.keywords))
      location <- item.computedfeatures.places
      zoom <- TileUtils.maxZoom(minZoom) to minZoom by -1
      tileid = TileUtils.tile_id_from_lat_long(location.centroidlat, location.centroidlon, zoom)
    } yield EventPlaces(
      pipelinekey = item.pipelinekey,
      centroidlat = location.centroidlat,
      centroidlon = location.centroidlon,
      eventid = item.eventid,
      eventtime = item.eventtime,
      tileid = tileid.tileId,
      tilez = tileid.zoom,
      conjunctiontopic1 = ct._1,
      conjunctiontopic2 = ct._2,
      conjunctiontopic3 = ct._3,
      insertiontime = new Date().getTime,
      externalsourceid = item.externalsourceid,
      placeid = location.placeid
    )
  }
}

object Utils {
  private val ConjunctiveTopicComboSize = 3
  private val DefaultPrimaryLanguage = "en"//TODO thread the site settings primary language to getConjunctiveTopics

  def getCassandraPeriodTypes: Seq[PeriodType] = {
    Seq(PeriodType.Day, PeriodType.Hour, PeriodType.Month, PeriodType.Week, PeriodType.Year)
  }

  def getConjunctiveTopics(topicSeq: Option[Seq[String]], langcode: Option[String] = None): Seq[(String, String, String)] = {
    topicSeq match {
      case Some(topics) =>
        (topics ++ Seq("", "")).toList.combinations(ConjunctiveTopicComboSize).toList.map(combo => {
          val sortedCombo = combo.sortWith{(a, b) =>
            Ordering.comparatorToOrdering(Collator.getInstance(new Locale(langcode.getOrElse(langcode.getOrElse(DefaultPrimaryLanguage))))).compare(a,b) < 0 && a != ""
          }

          (sortedCombo.head, sortedCombo(1), sortedCombo(2))
        })
      case None => Seq()
    }
  }

  def getSentimentScore(sentiments: List[Double]): Double = {
    Option(sentiments) match {
      case None => 0F
      case Some(_) if sentiments.isEmpty => 0f
      case Some(sentimentList) => sentimentList.head.toFloat
    }
  }

  def getFeatures(item: FortisEvent): Features = {
    //todo val genderCounts = item.analysis.genders.map(_.name).groupBy(identity).mapValues(t=>t.size.toLong)
    val entityCounts = item.analysis.entities.map(_.name).groupBy(identity).mapValues(t=>t.size.toLong)
    Features(
      mentions = 1,
      places = item.analysis.locations.map(place => Place(placeid = place.wofId, centroidlat = place.latitude, centroidlon = place.longitude)),
      keywords = item.analysis.keywords.map(_.name),
      sentiment = Sentiment(neg_avg = getSentimentScore(item.analysis.sentiments)),
      entities = entityCounts.map(kv => Entities(
        name = kv._1,
        count = kv._2,
        externalsource = "", // todo
        externalrefid = "" // todo
      )).toList)
  }
}


text:
package uk.nhs.ciao.docs.parser.extractor;

import static uk.nhs.ciao.logging.CiaoLogMessage.logMsg;

import java.util.Map;
import java.util.Set;

import org.w3c.dom.Document;
import org.w3c.dom.NodeList;

import uk.nhs.ciao.docs.parser.UnsupportedDocumentTypeException;
import uk.nhs.ciao.logging.CiaoLogger;

import com.google.common.base.MoreObjects;
import com.google.common.base.Strings;
import com.google.common.collect.Maps;
import com.google.common.collect.Sets;

/**
 * {@link PropertiesExtractor} which uses regular expressions to extract properties
 * from a DOM.
 *

 * The extraction of each property/regex pair is handled by instances of {@link RegexPropertyFinder}.
 */
public class RegexPropertiesExtractor implements PropertiesExtractor<Document> {
	private static final CiaoLogger LOGGER = CiaoLogger.getLogger(RegexPropertiesExtractor.class);

	private final Set<RegexPropertyFinder> propertyFinders;
	private String fromNodeText;
	private String toNodeText;

	/**
	 * Creates a new (empty) extractor instance
	 */
	public RegexPropertiesExtractor() {
		propertyFinders = Sets.newLinkedHashSet();
	}

	/**
	 * Creates a new extractor instance backed by the specified property finders
	 */
	public RegexPropertiesExtractor(final RegexPropertyFinder... propertyFinders) {
		this();

		addPropertyFinders(propertyFinders);
	}

	/**
	 * Adds the specified property finder to this extractor
	 */
	public final void addPropertyFinder(final RegexPropertyFinder propertyFinder) {
		if (propertyFinder != null) {
			propertyFinders.add(propertyFinder);
		}
	}

	/**
	 * Adds the specified property finders to this extractor
	 */
	public final void addPropertyFinders(final RegexPropertyFinder... propertyFinders) {
		for (final RegexPropertyFinder propertyFinder: propertyFinders) {
			addPropertyFinder(propertyFinder);
		}
	}

	/**
	 * Adds the specified property finders to this extractor
	 */
	public final void addPropertyFinders(final Iterable<? extends RegexPropertyFinder> propertyFinders) {
		for (final RegexPropertyFinder propertyFinder: propertyFinders) {
			addPropertyFinder(propertyFinder);
		}
	}

	/**
	 * {@inheritDoc}
	 *

	 * The text content to match is first extracted from the document, then properties are
	 * extracted from the text by calling each registered property finder.
	 *
	 * @throws UnsupportedDocumentTypeException If no matching properties could be found in the document
	 * @see #getTextContent(Document)
	 */
	@Override
	public Map<String, Object> extractProperties(final Document document)
			throws UnsupportedDocumentTypeException {
		final Map<String, Object> properties = Maps.newLinkedHashMap();
		final String textContent = getTextContent(document);

		for (final RegexPropertyFinder propertyFinder: propertyFinders) {
			final String value = propertyFinder.findValue(textContent);
			if (!value.isEmpty()) {
				properties.put(propertyFinder.getName(), value);
			}
		}

		if (properties.isEmpty()) {
			throw new UnsupportedDocumentTypeException("No matching properties could be found");
		}

		LOGGER.debug(logMsg("Extracted document properties from DOM using regular expressions")
				.documentProperties(properties));

		return properties;
	}

	/**
	 * Enables text filtering of the document before property extraction.
	 *

	 * This can be useful if property matching has to occur against a section
	 * of the document which always varies - but is terminated instead by the
	 * end of an XML element. Default extraction flattens the whole document
	 * removing the start/end of XML documents, with the text filter enabled
	 * just a sub-set of document text is searched for matching patterns.
	 *
	 * @param fromNodeText The start text of the initial node to match or null
	 * @param toNodeText The start text of the final node to match or null
	 */
	public void setTextFilter(final String fromNodeText, final String toNodeText) {
		this.fromNodeText = fromNodeText;
		this.toNodeText = toNodeText;
	}

	/**
	 * Returns the text content of the document, possibly filtered if from/to node
	 * filtering has been enabled.
	 *

	 * Only text contained in 'p' tags is used when determining the content to return.
	 *
	 * @see #setTextFilter(String, String)
	 */
	protected String getTextContent(final Document document) {
		if (Strings.isNullOrEmpty(fromNodeText) || Strings.isNullOrEmpty(toNodeText)) {
			return document.getDocumentElement().getTextContent();
		}

		final StringBuilder text = new StringBuilder();
		final NodeList nodes = document.getElementsByTagName("p");

		for (int index = 0; index < nodes.getLength(); index++) {
			final String nodeText = nodes.item(index).getTextContent();
			if (nodeText.trim().startsWith(fromNodeText)) {
				text.append(nodeText);
			} else if (text.length() > 0) {
				text.append(nodeText);
				if (nodeText.trim().startsWith(toNodeText)) {
					break;
				}
			}
		}

		return text.toString();
	}

	@Override
	public String toString() {
		return MoreObjects.toStringHelper(this)
				.add("propertyFinders", propertyFinders)
				.toString();
	}
}


text:
import { test } from 'qunit';
import { initModule } from '../test-config';

export default function() {
	initModule( 'methods/findContainer.js' );

	test( '.findContainer() finds container component', t => {
		const ractive = new Ractive({
			template: '<Outer><Mid><Inner/></Mid></Outer>',
			components: {
				Outer: Ractive.extend({ template: '{{yield}}' }),
				Mid: Ractive.extend({ template: '{{yield}}' }),
				Inner: Ractive.extend()
			}
		});

		t.strictEqual( ractive.findComponent( 'Inner' ).findContainer( 'Mid' ), ractive.findComponent( 'Mid' ) );
		t.strictEqual( ractive.findComponent( 'Inner' ).findContainer( 'Outer' ), ractive.findComponent( 'Outer' ) );
		t.strictEqual( ractive.findComponent( 'Inner' ).findContainer( 'nope' ), null );
	});
}


text:
/* $Id: dtoa_conv.h 1175 2007-01-14 15:18:18Z dmix $ */

#ifndef	_DTOA_CONV_H
#define	_DTOA_CONV_H

#include <stdio.h>

int dtoa_prf (double val, char *s, unsigned char width, unsigned char prec,
              unsigned char flags);
int dtoa_lim (double val, char *s, unsigned char width, unsigned char prec,
              unsigned char flags);
int dtoa_cln (double val, char *s, unsigned char ndigs, unsigned char flags);

void d2stream (double val, FILE *stream,
               unsigned char width, unsigned char prec, unsigned char flags);

#define	DTOA_SPACE  0x01	/* put space for positives	*/
#define	DTOA_PLUS   0x02	/* put '+' for positives	*/
#define	DTOA_UPPER  0x04	/* use uppercase letters	*/
#define	DTOA_ZFILL  0x08	/* fill zeroes			*/
#define	DTOA_LEFT   0x10	/* adjust to left		*/
#define	DTOA_NOFILL 0x20	/* do not fill to width		*/
#define	DTOA_EXP    0x40	/* d2stream: 'e(E)' format	*/
#define	DTOA_FIX    0x80	/* d2stream: 'f(F)' format	*/

#define	DTOA_EWIDTH     (-1)	/* Width too small	*/
#define	DTOA_NONFINITE  (-2)	/* Value is NaN or Inf	*/

#endif	/* !_DTOA_CONV_H */


text:
var SourceMapConsumer = require('source-map').SourceMapConsumer;

var fs = require('fs');
var path = require('path');
var http = require('http');
var https = require('https');
var url = require('url');

var override = require('../utils/object.js').override;

var MAP_MARKER = /\/\*# sourceMappingURL=(\S+) \*\//;

function InputSourceMapStore(outerContext) {
  this.options = outerContext.options;
  this.errors = outerContext.errors;
  this.sourceTracker = outerContext.sourceTracker;
  this.timeout = this.options.inliner.timeout;
  this.requestOptions = this.options.inliner.request;

  this.maps = {};
}

function fromString(self, data, whenDone) {
  self.maps[undefined] = new SourceMapConsumer(self.options.sourceMap);
  return whenDone();
}

function fromSource(self, data, whenDone, context) {
  var nextAt = 0;

  function proceedToNext() {
    context.cursor += nextAt + 1;
    fromSource(self, data, whenDone, context);
  }

  while (context.cursor < data.length) {
    var fragment = data.substring(context.cursor);

    var markerStartMatch = self.sourceTracker.nextStart(fragment) || { index: -1 };
    var markerEndMatch = self.sourceTracker.nextEnd(fragment) || { index: -1 };
    var mapMatch = MAP_MARKER.exec(fragment) || { index: -1 };
    var sourceMapFile = mapMatch[1];

    nextAt = data.length;
    if (markerStartMatch.index > -1)
      nextAt = markerStartMatch.index;
    if (markerEndMatch.index > -1 && markerEndMatch.index < nextAt)
      nextAt = markerEndMatch.index;
    if (mapMatch.index > -1 && mapMatch.index < nextAt)
      nextAt = mapMatch.index;

    if (nextAt == data.length)
      break;

    if (nextAt == markerStartMatch.index) {
      context.files.push(markerStartMatch.filename);
    } else if (nextAt == markerEndMatch.index) {
      context.files.pop();
    } else if (nextAt == mapMatch.index) {
      var isRemote = /^https?:\/\//.test(sourceMapFile) || /^\/\//.test(sourceMapFile);
      if (isRemote) {
        return fetchMapFile(self, sourceMapFile, context, proceedToNext);
      } else {
        var sourceFile = context.files[context.files.length - 1];
        var sourceDir = sourceFile ? path.dirname(sourceFile) : self.options.relativeTo;

        var inputMapData = fs.readFileSync(path.join(sourceDir || '', sourceMapFile), 'utf-8');
        self.maps[sourceFile || undefined] = new SourceMapConsumer(inputMapData);
      }
    }

    context.cursor += nextAt + 1;
  }

  return whenDone();
}

function fetchMapFile(self, mapSource, context, done) {
  function handleError(status) {
    context.errors.push('Broken source map at "' + mapSource + '" - ' + status);
    return done();
  }

  var method = mapSource.indexOf('https') === 0 ? https : http;
  var requestOptions = override(url.parse(mapSource), self.requestOptions);

  method
    .get(requestOptions, function (res) {
      if (res.statusCode < 200 || res.statusCode > 299)
        return handleError(res.statusCode);

      var chunks = [];
      res.on('data', function (chunk) {
        chunks.push(chunk.toString());
      });
      res.on('end', function () {
        self.maps[context.files[context.files.length - 1] || undefined] = new SourceMapConsumer(chunks.join(''));
        done();
      });
    })
    .on('error', function(res) {
      handleError(res.message);
    })
    .on('timeout', function() {
      handleError('timeout');
    })
    .setTimeout(self.timeout);
}

function originalPositionIn(trackedSource, sourceInfo, token) {
  // FIXME: we should rather track original positions in tokenizer
  // here it is a bit too late do do it reliably hance the hack
  var originalPosition;
  var maxRange = token.replace(/[>\+~]/g, ' $1 ').length;
  var position = {
    line: sourceInfo.line,
    column: sourceInfo.column + maxRange
  };

  while (maxRange-- > 0) {
    position.column--;
    originalPosition = trackedSource.originalPositionFor(position);

    if (originalPosition)
      break;
  }

  return originalPosition;
}

InputSourceMapStore.prototype.track = function (data, whenDone) {
  return typeof this.options.sourceMap == 'string' ?
    fromString(this, data, whenDone) :
    fromSource(this, data, whenDone, { files: [], cursor: 0, errors: this.errors });
};

InputSourceMapStore.prototype.isTracking = function (sourceInfo) {
  return !!this.maps[sourceInfo.source];
};

InputSourceMapStore.prototype.originalPositionFor = function (sourceInfo, token) {
  return originalPositionIn(this.maps[sourceInfo.source], sourceInfo, token);
};

module.exports = InputSourceMapStore;


text:
namespace autoboost { namespace numeric { namespace operators
{
    // So that the stats compile when Sample type is std::complex
    template<typename T, typename U>
    typename
        disable_if<
            mpl::or_<is_same<T, U>, is_same<std::complex<T>, U> >
          , std::complex<T>
        >::type
    operator *(std::complex<T> ri, U const &u)
    {
        // BUGBUG promote result to typeof(T()*u) ?
        return ri *= static_cast<T>(u);
    }

    template<typename T, typename U>
    typename
        disable_if<
            mpl::or_<is_same<T, U>, is_same<std::complex<T>, U> >
          , std::complex<T>
        >::type
    operator /(std::complex<T> ri, U const &u)
    {
        // BUGBUG promote result to typeof(T()*u) ?
        return ri /= static_cast<T>(u);
    }

}}} // namespace autoboost::numeric::operators

namespace autoboost { namespace numeric
{
    namespace detail
    {
        template<typename T>
        struct one_complex
        {
            static std::complex<T> const value;
        };

        template<typename T>
        std::complex<T> const one_complex<T>::value
          = std::complex<T>(numeric::one<T>::value, numeric::one<T>::value);
    }

    /// INTERNAL ONLY
    ///
    template<typename T>
    struct one<std::complex<T> >
      : detail::one_complex<T>
    {
        typedef one type;
        typedef std::complex<T> value_type;
        operator value_type const & () const
        {
            return detail::one_complex<T>::value;
        }
    };

}} // namespace autoboost::numeric

#endif


text:
<com.tle.beans.mime.MimeEntry>
  <id>18352</id>
  <institution>
    <id>18208</id>
    <uniqueId>0</uniqueId>
    <quota>0.0</quota>
    <enabled>true</enabled>
  </institution>
  <extensions class="list">
    <string>docx</string>
  </extensions>
  <type>application/vnd.openxmlformats-officedocument.wordprocessingml.document</type>
  <attributes>
    <entry>
      <string>PluginIconPath</string>
      <string>icons/binary.png</string>
    </entry>
  </attributes>
</com.tle.beans.mime.MimeEntry>


text:
module ActiveMerchant #:nodoc:
  module Billing #:nodoc:
    class BraintreeQueryGateway < Gateway
      def api_url
        'https://secure.braintreepaymentgateway.com/api/query.php'
      end

      self.homepage_url = 'http://www.braintreepaymentsolutions.com'
      self.display_name = 'Braintree Query'

      def initialize(options = {})
        requires!(options, :login, :password)
        @options = options
        super
      end

      def customer_vault(customer_vault_id)
        post = {:customer_vault_id => customer_vault_id,
                :report_type => 'customer_vault'}
        commit(post)
      end

      def commit(parameters)
        response = parse( ssl_post(api_url, post_data(parameters)) )
        Response.new(!response[:error_response], response[:error_response] || 'SUCCESS', response,
          :test => test?
        )
      end

      def post_data(parameters = {})
        post = {}
        post[:username]      = @options[:login]
        post[:password]   = @options[:password]

        request = post.merge(parameters).map {|key,value| "#{key}=#{CGI.escape(value.to_s)}"}.join("&")
        request
      end

      def parse(xml)
        response = {}

        xml = REXML::Document.new(xml)
        xml.elements.each('//nm_response/customer_vault/customer/*') do |node|
          response[node.name.downcase.to_sym] = normalize(node.text)
        end unless xml.root.nil?
        xml.elements.each('//nm_response/error_response') do |node|
          response[node.name.downcase.to_sym] = normalize(node.text)
        end unless xml.root.nil?

        response
      end

      # Make a ruby type out of the response string
      def normalize(field)
        case field
        when "true"   then true
        when "false"  then false
        when ""       then nil
        when "null"   then nil
        else field
        end
      end

   end
  end
end


text:
package etcdserver

import (
	"fmt"
	"io"
	"os"
	"path"

	pb "github.com/coreos/etcd/etcdserver/etcdserverpb"
	"github.com/coreos/etcd/pkg/pbutil"
	"github.com/coreos/etcd/pkg/testutil"
	"github.com/coreos/etcd/pkg/types"
	"github.com/coreos/etcd/raft"
	"github.com/coreos/etcd/raft/raftpb"
	"github.com/coreos/etcd/snap"
	"github.com/coreos/etcd/version"
	"github.com/coreos/etcd/wal"
	"github.com/coreos/etcd/wal/walpb"
)

type Storage interface {
	// Save function saves ents and state to the underlying stable storage.
	// Save MUST block until st and ents are on stable storage.
	Save(st raftpb.HardState, ents []raftpb.Entry) error
	// SaveSnap function saves snapshot to the underlying stable storage.
	SaveSnap(snap raftpb.Snapshot) error
	// DBFilePath returns the file path of database snapshot saved with given
	// id.
	DBFilePath(id uint64) (string, error)
	// Close closes the Storage and performs finalization.
	Close() error
}

type storage struct {
	*wal.WAL
	*snap.Snapshotter
}

func NewStorage(w *wal.WAL, s *snap.Snapshotter) Storage {
	return &storage{w, s}
}

// SaveSnap saves the snapshot to disk and release the locked
// wal files since they will not be used.
func (st *storage) SaveSnap(snap raftpb.Snapshot) error {
	walsnap := walpb.Snapshot{
		Index: snap.Metadata.Index,
		Term:  snap.Metadata.Term,
	}
	err := st.WAL.SaveSnapshot(walsnap)
	if err != nil {
		return err
	}
	err = st.Snapshotter.SaveSnap(snap)
	if err != nil {
		return err
	}
	err = st.WAL.ReleaseLockTo(snap.Metadata.Index)
	if err != nil {
		return err
	}
	return nil
}

func readWAL(waldir string, snap walpb.Snapshot) (w *wal.WAL, id, cid types.ID, st raftpb.HardState, ents []raftpb.Entry) {
	var (
		err       error
		wmetadata []byte
	)

	repaired := false
	for {
		if w, err = wal.Open(waldir, snap); err != nil {
			plog.Fatalf("open wal error: %v", err)
		}
		if wmetadata, st, ents, err = w.ReadAll(); err != nil {
			w.Close()
			// we can only repair ErrUnexpectedEOF and we never repair twice.
			if repaired || err != io.ErrUnexpectedEOF {
				plog.Fatalf("read wal error (%v) and cannot be repaired", err)
			}
			if !wal.Repair(waldir) {
				plog.Fatalf("WAL error (%v) cannot be repaired", err)
			} else {
				plog.Infof("repaired WAL error (%v)", err)
				repaired = true
			}
			continue
		}
		break
	}
	var metadata pb.Metadata
	pbutil.MustUnmarshal(&metadata, wmetadata)
	id = types.ID(metadata.NodeID)
	cid = types.ID(metadata.ClusterID)
	return
}

// upgradeDataDir converts an older version of the etcdServer data to the newest version.
// It must ensure that, after upgrading, the most recent version is present.
func upgradeDataDir(baseDataDir string, name string, ver version.DataDirVersion) error {
	switch ver {
	case version.DataDir2_0:
		err := makeMemberDir(baseDataDir)
		if err != nil {
			return err
		}
		fallthrough
	case version.DataDir2_0_1:
		fallthrough
	default:
	}
	return nil
}

func makeMemberDir(dir string) error {
	membdir := path.Join(dir, "member")
	_, err := os.Stat(membdir)
	switch {
	case err == nil:
		return nil
	case !os.IsNotExist(err):
		return err
	}
	if err := os.MkdirAll(membdir, 0700); err != nil {
		return err
	}
	names := []string{"snap", "wal"}
	for _, name := range names {
		if err := os.Rename(path.Join(dir, name), path.Join(membdir, name)); err != nil {
			return err
		}
	}
	return nil
}

type storageRecorder struct {
	testutil.Recorder
	dbPath string // must have '/' suffix if set
}

func newStorageRecorder(db string) *storageRecorder {
	return &storageRecorder{&testutil.RecorderBuffered{}, db}
}

func newStorageRecorderStream(db string) *storageRecorder {
	return &storageRecorder{testutil.NewRecorderStream(), db}
}

func (p *storageRecorder) Save(st raftpb.HardState, ents []raftpb.Entry) error {
	p.Record(testutil.Action{Name: "Save"})
	return nil
}

func (p *storageRecorder) SaveSnap(st raftpb.Snapshot) error {
	if !raft.IsEmptySnap(st) {
		p.Record(testutil.Action{Name: "SaveSnap"})
	}
	return nil
}

func (p *storageRecorder) DBFilePath(id uint64) (string, error) {
	p.Record(testutil.Action{Name: "DBFilePath"})
	path := p.dbPath
	if path != "" {
		path = path + "/"
	}
	return fmt.Sprintf("%s%016x.snap.db", path, id), nil
}

func (p *storageRecorder) Close() error { return nil }


text:
<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: The Web Standards Documentary Project</title>
	<atom:link href="http://www.webstandards.org/2007/04/20/the-web-standards-documentary-project/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.webstandards.org/2007/04/20/the-web-standards-documentary-project/</link>
	<description>Working together for standards</description>
	<lastBuildDate>Wed, 27 Mar 2013 12:19:03 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Aarron Walter</title>
		<link>http://www.webstandards.org/2007/04/20/the-web-standards-documentary-project/comment-page-1/#comment-57859</link>
		<dc:creator>Aarron Walter</dc:creator>
		<pubDate>Tue, 01 May 2007 13:21:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.webstandards.org/2007/04/20/the-web-standards-documentary-project/#comment-57859</guid>
		<description>FYI: I've recently added transcripts of each audio interview and an RSS feed so you can subscribe to the text and audio content as a podcast.</description>
		<content:encoded><![CDATA[
FYI: I’ve recently added transcripts of each audio interview and an RSS feed so you can subscribe to the text and audio content as a podcast.

]]></content:encoded>
	</item>
	<item>
		<title>By: Aarron Walter</title>
		<link>http://www.webstandards.org/2007/04/20/the-web-standards-documentary-project/comment-page-1/#comment-57769</link>
		<dc:creator>Aarron Walter</dc:creator>
		<pubDate>Fri, 27 Apr 2007 12:10:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.webstandards.org/2007/04/20/the-web-standards-documentary-project/#comment-57769</guid>
		<description>From what I've seen the issue is beyond favor for IE (though it is sometimes the case). I've heard many businesses say that they are aware of Web Standards, but the reason they have not taken the time to learn and adopt them is that they don't feel there is any pay off for their time/money investment. I've also heard companies report that building sites without tables is less reliable cross-browser so they feel it will take more time to resolve simple issues. The reality is they just haven't taken the time to learn the basic concepts of CSS so everything seems more time consuming.

There are also those who just have no idea what Web Standards are. These folks tend to be easier to persuade as they have not already made the case to themselves why they shouldn't learn about Web Standards.</description>
		<content:encoded><![CDATA[
From what I’ve seen the issue is beyond favor for IE (though it is sometimes the case). I’ve heard many businesses say that they are aware of Web Standards, but the reason they have not taken the time to learn and adopt them is that they don’t feel there is any pay off for their time/money investment. I’ve also heard companies report that building sites without tables is less reliable cross-browser so they feel it will take more time to resolve simple issues. The reality is they just haven’t taken the time to learn the basic concepts of CSS so everything seems more time consuming.

There are also those who just have no idea what Web Standards are. These folks tend to be easier to persuade as they have not already made the case to themselves why they shouldn’t learn about Web Standards.

]]></content:encoded>
	</item>
	<item>
		<title>By: dewde</title>
		<link>http://www.webstandards.org/2007/04/20/the-web-standards-documentary-project/comment-page-1/#comment-57764</link>
		<dc:creator>dewde</dc:creator>
		<pubDate>Thu, 26 Apr 2007 16:29:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.webstandards.org/2007/04/20/the-web-standards-documentary-project/#comment-57764</guid>
		<description><blockquote>so we might learn what is really preventing businesses from changing</blockquote>

Don't we know this answer already? I thought we always knew this answer. While we still have browser companies arbitrarily implementing partial standards, businesses are going to publish websites that utilize the most efficient (cost-to-benefit) features.

Businesses don't want to spend the money to write multiple versions of the same site or web app to accommodate multiple browsers. They also don't want to spend <b>just as much</b> time and money to write a single version of a site or web app to be multi-browser.

Most businesses decide to spend half the time and money to write one version which satisfies the majority of the web consumers. And I don't blame them.

Thanks to the popularity of FireFox, however, the benefit of writing for one browser (cough IE cough) and ignoring the rest is much less appealing these days. With Dell shipping Ubunto and MacBook users growing phenomenally I hope those days are finally behind us.

The time is certainly ripe for businesses to start putting pressure on browser developers to keep making progress towards standards compliance. It will save them time and money in the end.

But here I am preaching to the choir. Think I'll shut it now.

peace|dewde</description>
		<content:encoded><![CDATA[

so we might learn what is really preventing businesses from changing

Don’t we know this answer already? I thought we always knew this answer. While we still have browser companies arbitrarily implementing partial standards, businesses are going to publish websites that utilize the most efficient (cost-to-benefit) features.

Businesses don’t want to spend the money to write multiple versions of the same site or web app to accommodate multiple browsers. They also don’t want to spend just as much time and money to write a single version of a site or web app to be multi-browser.

Most businesses decide to spend half the time and money to write one version which satisfies the majority of the web consumers. And I don’t blame them.

Thanks to the popularity of FireFox, however, the benefit of writing for one browser (cough IE cough) and ignoring the rest is much less appealing these days. With Dell shipping Ubunto and MacBook users growing phenomenally I hope those days are finally behind us.

The time is certainly ripe for businesses to start putting pressure on browser developers to keep making progress towards standards compliance. It will save them time and money in the end.

But here I am preaching to the choir. Think I’ll shut it now.

peace|dewde

]]></content:encoded>
	</item>
	<item>
		<title>By: Aarron Walter</title>
		<link>http://www.webstandards.org/2007/04/20/the-web-standards-documentary-project/comment-page-1/#comment-57762</link>
		<dc:creator>Aarron Walter</dc:creator>
		<pubDate>Thu, 26 Apr 2007 00:48:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.webstandards.org/2007/04/20/the-web-standards-documentary-project/#comment-57762</guid>
		<description>If you are trying to make a change at your place of employment or at your school, I've written a list of compelling arguments and links to sites who have done so perhaps more eloquently that could help you convince the folks in charge that making the switch to Web Standards is a worth while endeavor. Read it at http://aarronwalter.com/2007/04/24/how-to-convince-your-employer-or-teacher-to-adopt-web-standards/</description>
		<content:encoded><![CDATA[
If you are trying to make a change at your place of employment or at your school, I’ve written a list of compelling arguments and links to sites who have done so perhaps more eloquently that could help you convince the folks in charge that making the switch to Web Standards is a worth while endeavor. Read it at http://aarronwalter.com/2007/04/24/how-to-convince-your-employer-or-teacher-to-adopt-web-standards/

]]></content:encoded>
	</item>
	<item>
		<title>By: Selena Jackson » Blog Archive » The Web Standards Documentary Project</title>
		<link>http://www.webstandards.org/2007/04/20/the-web-standards-documentary-project/comment-page-1/#comment-57761</link>
		<dc:creator>Selena Jackson » Blog Archive » The Web Standards Documentary Project</dc:creator>
		<pubDate>Thu, 26 Apr 2007 00:03:08 +0000</pubDate>
		<guid isPermaLink="false">http://www.webstandards.org/2007/04/20/the-web-standards-documentary-project/#comment-57761</guid>
		<description>[...] The Web Standards Documentary Project [...]</description>
		<content:encoded><![CDATA[
[...] The Web Standards Documentary Project [...]

]]></content:encoded>
	</item>
	<item>
		<title>By: rdickerson</title>
		<link>http://www.webstandards.org/2007/04/20/the-web-standards-documentary-project/comment-page-1/#comment-57760</link>
		<dc:creator>rdickerson</dc:creator>
		<pubDate>Wed, 25 Apr 2007 23:57:28 +0000</pubDate>
		<guid isPermaLink="false">http://www.webstandards.org/2007/04/20/the-web-standards-documentary-project/#comment-57760</guid>
		<description><p>Gill, check out the <a href="/learn/reference/books/" rel="nofollow">Recommended Reading</a> section of this site for a list of good books.</p></description>
		<content:encoded><![CDATA[
Gill, check out the Recommended Reading section of this site for a list of good books.

]]></content:encoded>
	</item>
	<item>
		<title>By: gill</title>
		<link>http://www.webstandards.org/2007/04/20/the-web-standards-documentary-project/comment-page-1/#comment-57759</link>
		<dc:creator>gill</dc:creator>
		<pubDate>Tue, 24 Apr 2007 13:47:08 +0000</pubDate>
		<guid isPermaLink="false">http://www.webstandards.org/2007/04/20/the-web-standards-documentary-project/#comment-57759</guid>
		<description>I've just been reading with interest some of the interviews, and coming to grips with the whole web standards project being a newbie to webdesign having been previously in marketing - can anyone welcome some beginners reading material for someone starting off who is up skilling themselves.</description>
		<content:encoded><![CDATA[
I’ve just been reading with interest some of the interviews, and coming to grips with the whole web standards project being a newbie to webdesign having been previously in marketing – can anyone welcome some beginners reading material for someone starting off who is up skilling themselves.

]]></content:encoded>
	</item>
	<item>
		<title>By: Aarron Walter</title>
		<link>http://www.webstandards.org/2007/04/20/the-web-standards-documentary-project/comment-page-1/#comment-57757</link>
		<dc:creator>Aarron Walter</dc:creator>
		<pubDate>Mon, 23 Apr 2007 18:14:31 +0000</pubDate>
		<guid isPermaLink="false">http://www.webstandards.org/2007/04/20/the-web-standards-documentary-project/#comment-57757</guid>
		<description>Thanks for the kind words, Adam. Hope to see yo uagain at SXSW next year.

I have just added quite a few more interviews to the Web Standards Documentary Project. In the new interviews students talk about interviewing for jobs that are looking for employees with WS skills,  how WS is talked about with clients in freelance projects, and  standards inconsistencies inside major agencies.</description>
		<content:encoded><![CDATA[
Thanks for the kind words, Adam. Hope to see yo uagain at SXSW next year.

I have just added quite a few more interviews to the Web Standards Documentary Project. In the new interviews students talk about interviewing for jobs that are looking for employees with WS skills,  how WS is talked about with clients in freelance projects, and  standards inconsistencies inside major agencies.

]]></content:encoded>
	</item>
	<item>
		<title>By: Adam Darowski</title>
		<link>http://www.webstandards.org/2007/04/20/the-web-standards-documentary-project/comment-page-1/#comment-57752</link>
		<dc:creator>Adam Darowski</dc:creator>
		<pubDate>Sat, 21 Apr 2007 03:11:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.webstandards.org/2007/04/20/the-web-standards-documentary-project/#comment-57752</guid>
		<description>I had the pleasure of meeting Aarron at SXSW and hanging out a bit. He is full of great ideas and I can't wait to check this out.</description>
		<content:encoded><![CDATA[
I had the pleasure of meeting Aarron at SXSW and hanging out a bit. He is full of great ideas and I can’t wait to check this out.

]]></content:encoded>
	</item>
</channel>
</rss>


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">

    <title>How I Studied Abroad</title>
    <meta name="description" content="">

    <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Merriweather:300,300italic,400,400italic,700italic,700">
    <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Lato:300,400,700">
    <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Source+Code+Pro:300,400,700">
    <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css">

    <link rel="stylesheet" href="/assets/css/vendors/slidebars.min.css">
    <link rel="stylesheet" href="/assets/css/vendors/rrssb.css">
    <link rel="stylesheet" href="/assets/css/main.css">

    <link rel="icon" type="image/x-icon" href="/assets/images/favicon.ico">

    <link rel="apple-touch-icon-precomposed" href="/assets/images/apple-touch-icon.png" />
    <link rel="apple-touch-icon-precomposed" sizes="57x57" href="/assets/images/apple-touch-icon-57x57.png" />
    <link rel="apple-touch-icon-precomposed" sizes="72x72" href="/assets/images/apple-touch-icon-72x72.png" />
    <link rel="apple-touch-icon-precomposed" sizes="114x114" href="/assets/images/apple-touch-icon-114x114.png" />
    <link rel="apple-touch-icon-precomposed" sizes="120x120" href="/assets/images/apple-touch-icon-120x120.png" />
    <link rel="apple-touch-icon-precomposed" sizes="144x144" href="/assets/images/apple-touch-icon-144x144.png" />
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="/assets/images/apple-touch-icon-152x152.png" />

    <link rel="canonical" href="http://kadie16.github.io/story/">
    <link rel="alternate" type="application/rss+xml" title="Kadie Jaffe" href="http://kadie16.github.io/feed.xml" />

    <svg version="1.1" id="loader-1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="32px" height="32px" viewBox="0 0 50 50" style="enable-background:new 0 0 50 50;" xml:space="preserve">
        <filter id="dropshadow" height="130%">
            <feGaussianBlur in="SourceAlpha" stdDeviation="10"/>
            <feOffset dx="0" dy="0" result="offsetblur"/>
            <feMerge>
                <feMergeNode/>
                <feMergeNode in="SourceGraphic"/>
            </feMerge>
        </filter>
        <path d="M43.935,25.145c0-10.318-8.364-18.683-18.683-18.683c-10.318,0-18.683,8.365-18.683,18.683h4.068c0-8.071,6.543-14.615,14.615-14.615c8.072,0,14.615,6.543,14.615,14.615H43.935z">
            <animateTransform attributeType="xml" attributeName="transform" type="rotate" from="0 25 25" to="360 25 25" dur="0.5s" repeatCount="indefinite"/>
        </path>
    </svg>

How I Studied Abroad

Growing up, I always dreamed of living abroad. I visited Italy when I was 13 and fell in love with travelling. I rember sitting on the spanish steps in rome, and thinking to myself "I have to study abroad someday".

As time went on, I got busier and began to lose my fervor for studying abroad. I decided I wanted to study Chemical Engineering, and I threw all of my energy into transferring from Santa Barbara City College (SBCC) to a four year university.

Three years later I was admitted to UC Berkeley. That summer, my friend Taylor from UC Santa   Barbara kept a blog about her travels in Madrid. Every weekend I was so excited to read her new entry. I smiled and laughed and gasped as I read about her exploring Madrid, adventuring in Paris, and running with the Bulls in Barcelona. As I read each of Taylor's new entries, my determination to study abroad was renewed.

Still, I had doubts about pulling it off. As an engineering transfer student, I felt this summer was the only time I could study abroad without delaying graduation. However, I thought if I traveled over summer I woulnd't be able to participate in an internship, which was another priority to me. I knew it would be expensive, and I was apprehensive about taking out more loans.

Then I found out about an opportunity to participate in a research internship in Singapore. I realized I didn't have to choose between the gaining professional experience I'm seeking and travelling! I ended up being given a project specifically so I can learn about computer graphics, which is what I think I want to do in my career. This was really exciting, but I still had to figure out how to pay for it.

I found out there were a lot of scholarships available to help students study abroad, especially for students who are considered to be underrepresented in study abroad programs.  Some of the categories were:

- engineering majors

- transfer students

- disabled students

- students who recieve the pell grant.

- students participating in programs that are considered to be in "non traditonal" locations (mostly anywhere that isn't in europe).

I went to workshops and got feedback on my scholarship applications, and I ended up recieveing the Benjamin A. Gilman International Scholarship, the University of California Education Abroad Program Promise award, the Singapore International Pre Graduate Award, and another UCEAP scholarship. The best advice I got when I was applying was to "make them an offer they can't refuse", or otherwise be explicit about how participating in my program is important to my career and worldview. Now my trip is almost fully funded.

My point is, there were several things that I thought might keep me from fulfilling my dream to study abroad. But I ended up finding a program that was ideal for me, and a bunch of resources to help me make it happen.

I feel insanely fortuate to experience this life changing trip. Hopefully by sharing this, I can show others that it is possible to embark on their own adventure :two_hearts:

Date

            June 1, 2015

    Menu

Menu

Kadie Jaffe

                    Projects

                    About Me

                    KD at S.E.A.

                By Kadie Jaffe

                 Download Resume

                 LinkedIn

                 GitHub

            Copyright © 2016


text:
package com.adamkowalewski.opw.entity;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author Adam Kowalewski
 */
@Entity
@Table(name = "opw_obwodowa_komisja", catalog = "opw", schema = "")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "OpwObwodowaKomisja.findAll", query = "SELECT o FROM OpwObwodowaKomisja o"),
    @NamedQuery(name = "OpwObwodowaKomisja.findById", query = "SELECT o FROM OpwObwodowaKomisja o WHERE o.id = :id"),
    @NamedQuery(name = "OpwObwodowaKomisja.findByPkwId", query = "SELECT o FROM OpwObwodowaKomisja o WHERE o.pkwId = :pkwId"),
    @NamedQuery(name = "OpwObwodowaKomisja.findByName", query = "SELECT o FROM OpwObwodowaKomisja o WHERE o.name = :name"),
    @NamedQuery(name = "OpwObwodowaKomisja.findByAddress", query = "SELECT o FROM OpwObwodowaKomisja o WHERE o.address = :address"),
    @NamedQuery(name = "OpwObwodowaKomisja.findByType", query = "SELECT o FROM OpwObwodowaKomisja o WHERE o.type = :type"),
    @NamedQuery(name = "OpwObwodowaKomisja.findByAllowedToVote", query = "SELECT o FROM OpwObwodowaKomisja o WHERE o.allowedToVote = :allowedToVote")})
public class OpwObwodowaKomisja implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id", nullable = false)
    private Integer id;
    @Size(max = 64)
    @Column(name = "pkwId", length = 64)
    private String pkwId;
    @Size(max = 128)
    @Column(name = "name", length = 128)
    private String name;
    @Size(max = 128)
    @Column(name = "address", length = 128)
    private String address;
    @Size(max = 4)
    @Column(name = "type", length = 4)
    private String type;
    @Column(name = "allowedToVote")
    private Integer allowedToVote;
    @JoinTable(name = "opw_user_has_opw_obwodowa_komisja", joinColumns = {
        @JoinColumn(name = "opw_obwodowa_komisja_id", referencedColumnName = "id", nullable = false)}, inverseJoinColumns = {
        @JoinColumn(name = "opw_user_id", referencedColumnName = "id", nullable = false)})
    @ManyToMany
    private List<OpwUser> opwUserList;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "opwObwodowaKomisjaId")
    private List<OpwWynik> opwWynikList;
    @JoinColumn(name = "opw_okregowa_komisja_id", referencedColumnName = "id", nullable = false)
    @ManyToOne(optional = false)
    private OpwOkregowaKomisja opwOkregowaKomisjaId;

    public OpwObwodowaKomisja() {
    }

    public OpwObwodowaKomisja(Integer id) {
        this.id = id;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getPkwId() {
        return pkwId;
    }

    public void setPkwId(String pkwId) {
        this.pkwId = pkwId;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public Integer getAllowedToVote() {
        return allowedToVote;
    }

    public void setAllowedToVote(Integer allowedToVote) {
        this.allowedToVote = allowedToVote;
    }

    @XmlTransient
    public List<OpwUser> getOpwUserList() {
        return opwUserList;
    }

    public void setOpwUserList(List<OpwUser> opwUserList) {
        this.opwUserList = opwUserList;
    }

    @XmlTransient
    public List<OpwWynik> getOpwWynikList() {
        return opwWynikList;
    }

    public void setOpwWynikList(List<OpwWynik> opwWynikList) {
        this.opwWynikList = opwWynikList;
    }

    public OpwOkregowaKomisja getOpwOkregowaKomisjaId() {
        return opwOkregowaKomisjaId;
    }

    public void setOpwOkregowaKomisjaId(OpwOkregowaKomisja opwOkregowaKomisjaId) {
        this.opwOkregowaKomisjaId = opwOkregowaKomisjaId;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof OpwObwodowaKomisja)) {
            return false;
        }
        OpwObwodowaKomisja other = (OpwObwodowaKomisja) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.adamkowalewski.opw.entity.OpwObwodowaKomisja[ id=" + id + " ]";
    }

}


text:
<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/
Route::group(['middleware'=> 'web'], function(){

      Route::post('adminn','AdministradorController@login');
      Route::get('adminn','AdministradorController@showLoginForm');
      Route::resource('admin', 'AdministradorController');

});

      Route::get('/', function () {
      return view('welcome');
        });

        Route::auth();

  //Rutas de administradores ---------------------------------------------------

    Route::get('adminprincipal', function(){
      return view('administradores/principal');
    });

  // Rutas de Prueba -----------------------------------------------------------

    Route::get('home', 'HomeController@index');

  // Rutas de Alumnos -----------------------------------------------------------
  Route::get('alumnos_registro', 'PaginasController@getAlumnosRegistro');

  // Rutas de Paises -----------------------------------------------------------

  Route::get('pais_registrar', 'PaisController@create');
  Route::post('pais_registrar', 'PaisController@store');

  // Rutas de Prueba -----------------------------------------------------------

  Route::get('hola', function(){
  return view('otros/provincia/hola');
  });

  // Rutas de las Provincias ---------------------------------------------------
  Route::resource('provincia',   'ProvinciaController');

  //Padres
  Route::get('padresprincipal', function(){
  return view('padres/home');
  });


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Excipula strigosa De Not.

### Remarks
null


text:
{{<unbranded}}

{{$pageTitle}}
	Fleet operator summary
{{/pageTitle}}

{{$content}}
{{#vars}}
	<input type="hidden" name="username" value="{{username}}">
{{/vars}}
{{>includes/fleets_head}}

Confirm

Please check that details are correct before you continue

		<form action="/fleet-add" method="get" class="form">
			<input type="hidden" name="nextlink" value="fleet-add-number-success">

				<input type="hidden" name="fleetnumber1" value="{{fleetnumber1}}">
				<input type="hidden" name="fleetnumber2" value="{{fleetnumber2}}">
				<input type="hidden" name="fleetnumber3" value="{{fleetnumber3}}">
				<input type="hidden" name="fleetnumber4" value="{{fleetnumber4}}">
				<input type="hidden" name="fleetnumber5" value="{{fleetnumber5}}">
				<input type="hidden" name="fleetnumber6" value="{{fleetnumber6}}">
				<input type="hidden" name="fleetnumber7" value="{{fleetnumber7}}">
				<input type="hidden" name="fleetnumber8" value="{{fleetnumber8}}">
				<input type="hidden" name="fleetnumber9" value="{{fleetnumber9}}">
				<input type="hidden" name="fleetnumber10" value="{{fleetnumber10}}">
				<input type="hidden" name="fleetnumber11" value="{{fleetnumber11}}">
				<input type="hidden" name="fleetnumber12" value="{{fleetnumber12}}">
				<input type="hidden" name="fleetnumber13" value="{{fleetnumber13}}">
				<input type="hidden" name="fleetnumber14" value="{{fleetnumber14}}">
				<input type="hidden" name="fleetnumber15" value="{{fleetnumber15}}">
				<input type="hidden" name="fleetemail" value="{{fleetemail}}">

Fleet number

{{fleetnumber1}}
{{fleetnumber2}}
{{fleetnumber3}}

					{{fleetnumber4}}
{{fleetnumber5}}
{{fleetnumber6}}

					{{fleetnumber7}}
{{fleetnumber8}}
{{fleetnumber9}}

					{{fleetnumber10}}
{{fleetnumber11}}
{{fleetnumber12}}

					{{fleetnumber13}}
{{fleetnumber14}}
{{fleetnumber15}}

Email address

{{fleetemail}}

			<input class="button" type="submit" value="Confirm">
		</form>

		Back

{{/content}}

{{/unbranded}}


text:
package net.recommenders.rival.split.splitter;

import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import net.recommenders.rival.core.DataModelFactory;
import net.recommenders.rival.core.DataModelIF;
import net.recommenders.rival.core.TemporalDataModel;
import net.recommenders.rival.core.TemporalDataModelIF;

/**
 * Splitter that takes into account the timestamps in the data (older
 * interactions are kept only in the training set).
 *
 * @author Alejandro
 */
public class TemporalSplitter implements Splitter {

    /**
     * The percentage of training to be used by the splitter.
     */
    private float percentageTraining;
    /**
     * The flag that indicates if the split should be done in a per user basis.
     */
    private boolean perUser;
    /**
     * The flag that indicates if the split should consider all the items
     * independently.
     */
    private boolean doSplitPerItems;

    /**
     * Constructor.
     *
     * @param percentageTrainingRatio percentage of training data to be split
     * @param perUserFlag flag to do the split in a per user basis
     * @param doSplitPerItemsFlag if true, every interaction between a user and
     * an item will be kept in the test set if at least one interaction belongs
     * to the corresponding timestamp (according to the rest of the parameters)
     */
    public TemporalSplitter(final float percentageTrainingRatio, final boolean perUserFlag, final boolean doSplitPerItemsFlag) {
        this.percentageTraining = percentageTrainingRatio;
        this.perUser = perUserFlag;
        this.doSplitPerItems = doSplitPerItemsFlag;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public DataModelIF[] split(final DataModelIF data) {
        throw new IllegalArgumentException("Method not available");
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public TemporalDataModelIF[] split(final TemporalDataModelIF data) {
        @SuppressWarnings("unchecked")
        final TemporalDataModelIF[] splits = new TemporalDataModel[2];
        splits[0] = DataModelFactory.getDefaultTemporalModel(); // training
        splits[1] = DataModelFactory.getDefaultTemporalModel(); // test
        if (perUser) {
            for (U user : data.getUsers()) {
                Set<Long> userTimestamps = new HashSet<>();
                for (I i : data.getUserItems(user)) {
                    for (Long t : data.getUserItemTimestamps(user, i)) {
                        userTimestamps.add(t);
                    }
                }
                if (userTimestamps.isEmpty()) {
                    continue;
                }
                List<Long> listTimestamps = new ArrayList<>(userTimestamps);
                Collections.sort(listTimestamps);
                int splitPoint = Math.round(percentageTraining * listTimestamps.size());
                Set<Long> testTimestamps = new HashSet<>();
                int n = 0;
                for (Long t : listTimestamps) {
                    if (n > splitPoint) {
                        testTimestamps.add(t);
                    }
                    n++;
                }
                if (doSplitPerItems) {
                    for (I item : data.getUserItems(user)) {
                        Double pref = data.getUserItemPreference(user, item);
                        boolean inTest = false;
                        for (Long time : data.getUserItemTimestamps(user, item)) {
                            if (testTimestamps.contains(time)) {
                                inTest = true;
                                break;
                            }
                        }
                        TemporalDataModelIF datamodel = splits[0]; // training
                        if (inTest) {
                            datamodel = splits[1]; // test
                        }
                        if (pref != null) {
                            datamodel.addPreference(user, item, pref);
                        }
                        for (Long time : data.getUserItemTimestamps(user, item)) {
                            datamodel.addTimestamp(user, item, time);
                        }
                    }
                } else {
                    for (I item : data.getUserItems(user)) {
                        Double pref = data.getUserItemPreference(user, item);
                        for (Long time : data.getUserItemTimestamps(user, item)) {
                            TemporalDataModelIF datamodel = splits[0]; // training
                            if (testTimestamps.contains(time)) {
                                datamodel = splits[1]; // test
                            }
                            if (pref != null) {
                                datamodel.addPreference(user, item, pref);
                            }
                            datamodel.addTimestamp(user, item, time);
                        }
                    }
                }
            }
        } else {
            // global temporal splitting
            Set<Long> allTimestamps = new HashSet<>();
            for (U user : data.getUsers()) {
                for (I i : data.getUserItems(user)) {
                    for (Long t : data.getUserItemTimestamps(user, i)) {
                        allTimestamps.add(t);
                    }
                }
            }
            List<Long> listTimestamps = new ArrayList<>(allTimestamps);
            Collections.sort(listTimestamps);
            int splitPoint = Math.round(percentageTraining * listTimestamps.size());
            Set<Long> testTimestamps = new HashSet<>();
            int n = 0;
            for (Long t : listTimestamps) {
                if (n > splitPoint) {
                    testTimestamps.add(t);
                }
                n++;
            }
            for (U user : data.getUsers()) {
                for (I item : data.getUserItems(user)) {
                    Double pref = data.getUserItemPreference(user, item);
                    Iterable<Long> time = data.getUserItemTimestamps(user, item);
                    if (time == null) {
                        continue;
                    }
                    if (doSplitPerItems) {
                        boolean inTest = false;
                        for (Long t : time) {
                            if (testTimestamps.contains(t)) {
                                inTest = true;
                                break;
                            }
                        }
                        TemporalDataModelIF datamodel = splits[0]; // training
                        if (inTest) {
                            datamodel = splits[1]; // test
                        }
                        if (pref != null) {
                            datamodel.addPreference(user, item, pref);
                        }
                        for (Long t : time) {
                            datamodel.addTimestamp(user, item, t);
                        }
                    } else {
                        for (Long t : time) {
                            TemporalDataModelIF datamodel = splits[0]; // training
                            if (testTimestamps.contains(t)) {
                                datamodel = splits[1]; // test
                            }
                            if (pref != null) {
                                datamodel.addPreference(user, item, pref);
                            }
                            datamodel.addTimestamp(user, item, t);
                        }
                    }
                }
            }
        }
        return splits;
    }
}


text:
/*
 * *
 * @author Agustin Rivero
 * @version $Rev: 1 $
 * @date $Date: 2007-12-07 $
 */

package com.gcalsync.component;

import com.gcalsync.cal.CommitEngine;
import com.gcalsync.cal.SyncEngine;
import com.gcalsync.cal.gcal.GCalClient;
import com.gcalsync.cal.gcal.GCalEvent;
import com.gcalsync.cal.gcal.GCalFeed;
import com.gcalsync.log.ErrorHandler;
import com.gcalsync.log.GCalException;
import com.gcalsync.store.Store;
import java.util.Timer;
import java.util.TimerTask;
import javax.microedition.lcdui.Command;
import javax.microedition.lcdui.Displayable;
import javax.microedition.lcdui.Font;
import javax.microedition.lcdui.Form;
import javax.microedition.lcdui.StringItem;

/**
 * Component that implements the autosync functionality
 * This class uses the MVCComponent base class to retrieve, draw, and update
 * component screen
 *
 * @author Agustin
 * @author Yusuf Abdi
 * @version $Rev: 1 $
 * @date $Date: 2007-12-30 03:22:30 -0500 (Sat, 30 Dec 2007) $
 */
public class AutoSyncComponent extends MVCComponent {

    private final Command CMD_STOP = new Command("Stop", Command.STOP, 2);
    private final Command CMD_HIDE = new Command("Hide", "Hide", Command.ITEM, 1);

    private Form form;
    private GCalClient gCalClient;
    private GCalFeed[] feeds;

    private Timer timer = null;
    private int secondsToNextSync = 5; //how many seconds to the next autosync
    private String lastError = null; //contains any possible error from the previouse autosync

    private Font labelFont = null;
    private StringItem lblTimeInfo = null; //the item with the timer
    private boolean showingTimer = false; //tells if the timer is being shown on the screen
    private boolean running = true; //tells if the autosync should be running

    //here the statistics are stored
    int[] uploadStatistics = new int[] {0, 0, 0};
    int[] downloadStatistics = new int[] {0, 0, 0};
    int conflictStatistics = 0;

    public AutoSyncComponent(GCalClient gCalClient, GCalFeed[] feeds) {
        this.feeds = feeds;
        this.gCalClient = gCalClient;
        this.gCalClient.setForceFullSync(true);

        labelFont = Font.getFont(Font.FACE_PROPORTIONAL, Font.STYLE_BOLD, Font.SIZE_SMALL);
        lblTimeInfo = new StringItem("Sync in: ", null);
        lblTimeInfo.setFont(labelFont);
    }

   /**
    * Gets the form for this component
    *
    * @returns form
    */
    public Displayable getDisplayable() {return this.form;}

   /**
    * Updates the view after it is created
    */
    protected void updateView() {}

   /**
    * Initializes the model before creating the view
    */
    protected void initModel() {}

   /**
    * Creates the view
    */
    protected void createView() {
        this.form = new Form("Auto Synchronization");
        this.form.addCommand(CMD_STOP);
        this.form.addCommand(CMD_HIDE);
        this.form.setCommandListener(this);
    }

    public void handle() throws Exception {
        try {
            showScreen();
            setupTimer();
        }catch(Exception e) {
            throw new GCalException(this.getClass(), "handle", e);
        }
    }

   /**
    * Processes menu commands
    * When user clicks the "Stop" button, autosync and timer are stopped,
    * and login screen is displayed.

    *
    * @param c command to execute
    * @param displayable the form from which command
    *                    originates
	*/
    public void commandAction(Command c, Displayable displayable) {
        try {
            if (c.getCommandType() == Command.STOP) {
                running = false;
                if(timer != null) {
                    timer.cancel();
                }
                Components.login.showScreen();
            } else if(c == CMD_HIDE) {
                this.display.setCurrent(null);
            }
        }catch(Exception e) {
            ErrorHandler.showError(e);
        }
    }

    /**
     * Starts the timer and updates the screen
     */
    private void setupTimer() {
        if(!running) {
            return;
        }

        updateScreenTimer();

        if(timer != null) {
            timer.cancel();
        }

        timer = new Timer();
        timer.schedule(new TimerTask() {
            public void run() {
                timerTaskRun();
            }
        }, 1 * 1000, 1 * 1000);
    }

    /**
     * Executes the auto sync
     * @throws Exception If there is any error
     */
    private void doAutoSync() throws Exception {
        //clean the screen
        this.form.deleteAll();
        showingTimer = false;

        //show the synchronizing message
        StringItem lblSomeText = new StringItem("Synchronizing...", null);
        lblSomeText.setFont(labelFont);
        this.form.append(lblSomeText);

        //login
        String loginResult = this.gCalClient.login();
        if(loginResult != null) {
            this.lastError = loginResult;
            return;
        }

        //get the events to sync
        SyncEngine syncEngine = new SyncEngine();
        GCalEvent[][] eventForSync = new GCalEvent[2][];
        this.conflictStatistics = syncEngine.getEventForAutoSync(this.form, this.gCalClient, this.feeds, eventForSync);

        //sync the events
        CommitEngine commitEngine = new CommitEngine();

        int[] commitStatistics = commitEngine.commitSync(eventForSync[0], eventForSync[1], this.gCalClient, this.form);

        //update the statistics
        this.uploadStatistics[0] += this.gCalClient.createdCount;
        this.uploadStatistics[1] += this.gCalClient.updatedCount;
        this.uploadStatistics[2] += this.gCalClient.removedCount;

        this.downloadStatistics[0] += commitStatistics[0];
        this.downloadStatistics[1] += commitStatistics[1];
        this.downloadStatistics[2] += commitStatistics[2];

        this.gCalClient.createdCount = 0;
        this.gCalClient.updatedCount = 0;
        this.gCalClient.removedCount = 0;
    }

    /**
     * Executes every one second to update the screen and start the autosync when necessary
     */
    private void timerTaskRun() {
        try {
            if(!running) {
                //if autosync should not be running then stop
                timer.cancel();
            }

            //update the timer
            secondsToNextSync--;
            updateScreenTimer();

            if(secondsToNextSync <= 0) {
                //if it is time to sync

                //stop the timer
                timer.cancel();
                timer = null;

                //reset the last error
                lastError = null;

                //sync
                try {
                    doAutoSync();
                }catch(Exception e) {
                    lastError = e.getMessage();
                }

                //restart the timer
                secondsToNextSync = Store.getOptions().autosyncTime * 60;
                setupTimer();
            }
        }catch(Exception e) {
            ErrorHandler.showError(e);
        }
    }

    /**
     * Updates the screen timer
     */
    private void updateScreenTimer() {

        if(!showingTimer) {
            //if the timer is not being shown, then show it

            //clean the screen and add the timer item
            this.form.deleteAll();
            this.form.append(lblTimeInfo);

            //add the statistics
            String gcalInfo = uploadStatistics[0] + " new, " + uploadStatistics[1] + " updated, " + uploadStatistics[2] + " removed events";
            String phoneInfo = downloadStatistics[0] + " new, " + downloadStatistics[1] + " updated, " + downloadStatistics[2] + " removed events";
            String conflictInfo = Integer.toString(conflictStatistics) + (conflictStatistics > 0 ? " - sync manually" : "");

            addInfo("GCal: ", gcalInfo);
            addInfo("Phone: ", phoneInfo);
            addInfo("Conflicts: ", conflictInfo);

            //if there has been an error then show it
            if(lastError != null) {
                addInfo("Error: ", lastError);
            }

            showingTimer = true;
        }

        //update the timer with the new time to sync
        int minutes = secondsToNextSync / 60;
        int seconds = secondsToNextSync % 60;

        lblTimeInfo.setText(
                com.gcalsync.util.DateUtil.twoDigit(minutes) + ":" +
                com.gcalsync.util.DateUtil.twoDigit(seconds));
    }

    /**
     * Adds information to the screen
     * @param title The title of the information
     * @param info The information text
     */
    private void addInfo(String title, String info) {
        StringItem lblInfo = new StringItem(title , null);
        lblInfo.setText(info);
        lblInfo.setFont(labelFont);
        this.form.append(lblInfo);
    }
}


text:
// Copyright 2016 Yahoo Inc.
// Licensed under the terms of the Apache license. Please see LICENSE.md file distributed with this work for terms.
package com.yahoo.bard.webservice.config;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * A class to provide a system configuration instance.
 */
public class SystemConfigProvider {

    private static final Logger LOG = LoggerFactory.getLogger(SystemConfigProvider.class);

    private static final String SYSTEM_CONFIG_IMPL_KEY = "fili__system_config_impl";

    private static final String DEFAULT_SYSTEM_CONFIG_IMPL = LayeredFileSystemConfig.class.getCanonicalName();

    /**
     *  The instance of the System Config available in this system.
     */
    private static final SystemConfig SYSTEM_CONFIG = getInstance();

    /**
     * Get an instance of SystemConfiguration.
     *
     * @return an instance of SystemConfiguration
     */
    public static synchronized SystemConfig getInstance() {
        if (SYSTEM_CONFIG == null) {
            String systemConfigImplementation = System.getenv(SYSTEM_CONFIG_IMPL_KEY);
            try {
                if (systemConfigImplementation == null) {
                    systemConfigImplementation = System.getProperty(SYSTEM_CONFIG_IMPL_KEY, DEFAULT_SYSTEM_CONFIG_IMPL);
                }
                return Class.forName(systemConfigImplementation).asSubclass(SystemConfig.class).newInstance();
            } catch (Exception e) {
                LOG.error("Exception while loading System configuration: {}", e.getMessage(), e);
                throw new IllegalStateException(e);
            }
        }
        return SYSTEM_CONFIG;
    }
}


text:
class StringListTest : public CppUnit::TestFixture
{
public:
	void setUp();
	void tearDown();

	void testAppend();
	void testEmpty();
	void testPop();
	void testContainerConstructor();
	void testContainerConcat();
	void testIteratorConstructor();
	void testIteratorConcat();

	static CppUnit::Test* suite();
};

inline CppUnit::Test* StringListTest::suite()
{
	CPPUNIT_DEFINE_SUITE(suite, StringListTest);

	CPPUNIT_ADD_TEST(suite, testAppend);
	CPPUNIT_ADD_TEST(suite, testEmpty);
	CPPUNIT_ADD_TEST(suite, testPop);
	CPPUNIT_ADD_TEST(suite, testContainerConstructor);
	CPPUNIT_ADD_TEST(suite, testContainerConcat);
	CPPUNIT_ADD_TEST(suite, testIteratorConstructor);
	CPPUNIT_ADD_TEST(suite, testIteratorConcat);

	return suite;
}


text:
class	Interface
{
	private:
		ULONG			ContentColour,
						ContentColourBr,
						HiliteColour,
						LoliteColour,
						ActiveColour,
						InactiveColour,
						WhiteColour,
						GreyColour,
						YellowColour,
						RedColour,
						GreenColour,
						BlueColour,
						TextColour,
						SelectColour;
		UBYTE				InterfacePalette[768];
		UBYTE			*interface_sprite_data;
		BSprite			*interface_sprites;

	public:
						Interface();
						~Interface();
		void			SetupInterfaceDefaults(void);
		inline ULONG	GetContentColour(void)			{	return	ContentColour;			};
		inline ULONG	GetContentColourBr(void)		{	return	ContentColourBr;		};
		inline ULONG	GetHiliteColour(void)			{	return	HiliteColour;			};
		inline ULONG	GetWhiteColour(void)			{	return	WhiteColour;			};
		inline ULONG	GetGreyColour(void)				{	return	GreyColour;				};
		inline ULONG	GetYellowColour(void)			{	return	YellowColour;			};
		inline ULONG	GetRedColour(void)				{	return	RedColour;				};
		inline ULONG	GetGreenColour(void)			{	return	GreenColour;			};
		inline ULONG	GetBlueColour(void)				{	return	BlueColour;				};
		inline ULONG	GetLoliteColour(void)			{	return	LoliteColour;			};
		inline ULONG	GetActiveColour(void)			{	return	ActiveColour;			};
		inline ULONG	GetInactiveColour(void)			{	return	InactiveColour;			};
		inline ULONG	GetTextColour(void)				{	return	TextColour;				};
		inline ULONG	GetSelectColour(void)			{	return	SelectColour;			};
		inline UBYTE	*GetPalette(void)				{	return	InterfacePalette;		};
		inline BSprite*	GetInterfaceSprite(UWORD id)	{	return	&interface_sprites[id];	};
//		inline BSprite*	GetInterfacePointer(UWORD id)	{	return	&interface_pointers[id];};
};

extern Interface				*InterfaceDefaults;
#define	CONTENT_COL_BR			InterfaceDefaults->GetContentColourBr()
#define	CONTENT_COL				InterfaceDefaults->GetContentColour()
#define	HILITE_COL  			InterfaceDefaults->GetHiliteColour()
#define	LOLITE_COL		  		InterfaceDefaults->GetLoliteColour()
#define	ACTIVE_COL				InterfaceDefaults->GetActiveColour()
#define	INACTIVE_COL			InterfaceDefaults->GetInactiveColour()
#define	TEXT_COL				InterfaceDefaults->GetTextColour()
#define	SELECT_COL	  			InterfaceDefaults->GetSelectColour()
#define	WHITE_COL  				InterfaceDefaults->GetWhiteColour()
#define	GREY_COL  				InterfaceDefaults->GetGreyColour()
#define	YELLOW_COL  				InterfaceDefaults->GetYellowColour()
#define	RED_COL  				InterfaceDefaults->GetRedColour()
#define	GREEN_COL  				InterfaceDefaults->GetGreenColour()
#define	BLUE_COL  				InterfaceDefaults->GetBlueColour()

#define	INTERFACE_SPRITE(ID)	InterfaceDefaults->GetInterfaceSprite(ID)
#define	INTERFACE_POINTER(ID)	InterfaceDefaults->GetInterfacePointer(ID)

#define	PALETTE					InterfaceDefaults->GetPalette()

#define	DEFAULTS_DIRECTORY		"EditDefs"

#define	GROW_ICON				1

#define	UP_ICON					6
#define	DOWN_ICON				7
#define	LEFT_ICON				8
#define	RIGHT_ICON				9
#define	CHECK_ICON				10
#define	RADIO_ICON1				11
#define	RADIO_ICON2				12
#define	RADIO_ICON3				13
#define	RADIO_ICON4				14
#define MENU_ICON				15

#define	NO_CLICK				0
#define	LEFT_CLICK				1
#define	RIGHT_CLICK				2
#define	MIDDLE_CLICK			3

#endif


text:
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.jetbrains.python.run;

import com.intellij.openapi.module.Module;
import com.intellij.openapi.module.ModuleManager;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.projectRoots.Sdk;
import com.intellij.openapi.vfs.LocalFileSystem;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.remote.PathMappingProvider;
import com.intellij.util.PathMappingSettings;
import com.jetbrains.python.remote.PyRemoteSdkAdditionalDataBase;
import com.jetbrains.python.sdk.PySdkUtil;
import com.jetbrains.python.sdk.PythonSdkType;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

/**
 * @author traff
 */
public class PyRemoteAnalyzeStacktraceFilter extends PythonTracebackFilter {
  public PyRemoteAnalyzeStacktraceFilter(Project project) {
    super(project);
  }

  @Override
  @Nullable
  protected VirtualFile findFileByName(@NotNull String fileName) {
    VirtualFile vFile = super.findFileByName(fileName);
    if (vFile != null) {
      return vFile;
    }
    for (Module m: ModuleManager.getInstance(getProject()).getModules()) {
      Sdk s = PythonSdkType.findPythonSdk(m);
      if (PySdkUtil.isRemote(s)) {
        PyRemoteSdkAdditionalDataBase data = (PyRemoteSdkAdditionalDataBase) s.getSdkAdditionalData();

        if (data != null) {
          for (PathMappingProvider provider: PathMappingProvider.getSuitableMappingProviders(data)) {
            PathMappingSettings mappingSettings = provider.getPathMappingSettings(getProject(), data);
            String localFile = mappingSettings.convertToLocal(fileName);
            VirtualFile file = LocalFileSystem.getInstance().findFileByPath(localFile);
            if (file != null && file.exists()) {
              return file;
            }
          }

        }
      }
    }

    return null;
  }
}


text:
package org.apereo.cas.configuration.model.support.cassandra.authentication;

/**
 * This is {@link BaseCassandraProperties}.
 *
 * @author Misagh Moayyed
 * @since 5.2.0
 */
public abstract class BaseCassandraProperties {
    private String username;
    private String password;

    private String protocolVersion = "V3";
    private String keyspace;
    private String contactPoints = "localhost";
    private String localDc;
    private boolean shuffleReplicas = true;
    private String retryPolicy = "DEFAULT_RETRY_POLICY";
    private String compression = "LZ4";
    private String consistencyLevel = "LOCAL_QUORUM";
    private String serialConsistencyLevel = "LOCAL_SERIAL";

    private int maxConnections = 10;
    private int coreConnections = 1;
    private int maxRequestsPerConnection = 1024;
    private int connectTimeoutMillis = 5000;
    private int readTimeoutMillis = 5000;

    private int port = 9042;

    public String getUsername() {
        return username;
    }

    public void setUsername(final String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(final String password) {
        this.password = password;
    }

    public String getProtocolVersion() {
        return protocolVersion;
    }

    public void setProtocolVersion(final String protocolVersion) {
        this.protocolVersion = protocolVersion;
    }

    public String getKeyspace() {
        return keyspace;
    }

    public void setKeyspace(final String keyspace) {
        this.keyspace = keyspace;
    }

    public String getContactPoints() {
        return contactPoints;
    }

    public void setContactPoints(final String contactPoints) {
        this.contactPoints = contactPoints;
    }

    public String getLocalDc() {
        return localDc;
    }

    public void setLocalDc(final String localDc) {
        this.localDc = localDc;
    }

    public boolean isShuffleReplicas() {
        return shuffleReplicas;
    }

    public void setShuffleReplicas(final boolean shuffleReplicas) {
        this.shuffleReplicas = shuffleReplicas;
    }

    public String getRetryPolicy() {
        return retryPolicy;
    }

    public void setRetryPolicy(final String retryPolicy) {
        this.retryPolicy = retryPolicy;
    }

    public String getCompression() {
        return compression;
    }

    public void setCompression(final String compression) {
        this.compression = compression;
    }

    public String getConsistencyLevel() {
        return consistencyLevel;
    }

    public void setConsistencyLevel(final String consistencyLevel) {
        this.consistencyLevel = consistencyLevel;
    }

    public String getSerialConsistencyLevel() {
        return serialConsistencyLevel;
    }

    public void setSerialConsistencyLevel(final String serialConsistencyLevel) {
        this.serialConsistencyLevel = serialConsistencyLevel;
    }

    public int getMaxConnections() {
        return maxConnections;
    }

    public void setMaxConnections(final int maxConnections) {
        this.maxConnections = maxConnections;
    }

    public int getCoreConnections() {
        return coreConnections;
    }

    public void setCoreConnections(final int coreConnections) {
        this.coreConnections = coreConnections;
    }

    public int getMaxRequestsPerConnection() {
        return maxRequestsPerConnection;
    }

    public void setMaxRequestsPerConnection(final int maxRequestsPerConnection) {
        this.maxRequestsPerConnection = maxRequestsPerConnection;
    }

    public int getConnectTimeoutMillis() {
        return connectTimeoutMillis;
    }

    public void setConnectTimeoutMillis(final int connectTimeoutMillis) {
        this.connectTimeoutMillis = connectTimeoutMillis;
    }

    public int getReadTimeoutMillis() {
        return readTimeoutMillis;
    }

    public void setReadTimeoutMillis(final int readTimeoutMillis) {
        this.readTimeoutMillis = readTimeoutMillis;
    }

    public int getPort() {
        return port;
    }

    public void setPort(final int port) {
        this.port = port;
    }
}


text:
package org.apache.flink.api.scala.runtime

import org.apache.flink.api.common.ExecutionConfig
import org.apache.flink.api.common.typeutils.SerializerTestInstance
import org.apache.flink.api.java.typeutils.GenericTypeInfo

import com.esotericsoftware.kryo.io.{Input, Output}
import com.esotericsoftware.kryo.{Kryo, Serializer}

import org.joda.time.LocalDate

import org.junit.Test

import scala.reflect._

class KryoGenericTypeSerializerTest {

  @Test
  def testTraitSerialization(): Unit = {
    trait SimpleTrait {
      def contains(x: String): Boolean
    }
    class SimpleClass1 extends SimpleTrait {
      def contains(x: String) = true

      override def equals(other: Any): Boolean = other match {
        case other: SimpleClass1 => true
        case _ => false
      }
    }
    class SimpleClass2 extends SimpleTrait {
      def contains(x: String) = true

      override def equals(other: Any): Boolean = other match {
        case other: SimpleClass2 => true
        case _ => false
      }
    }

    val testData = Array(new SimpleClass1, new SimpleClass1, new SimpleClass2)
    runTests(testData)
  }

  @Test
  def testAbstractSerialization(): Unit = {
    abstract class SimpleAbstractBase {
      def contains(x: String): Boolean
    }
    class SimpleClass1 extends SimpleAbstractBase {
      def contains(x: String) = true

      override def equals(other: Any): Boolean = other match {
        case other: SimpleClass1 => true
        case _ => false
      }
    }
    class SimpleClass2 extends SimpleAbstractBase {
      def contains(x: String) = true

      override def equals(other: Any): Boolean = other match {
        case other: SimpleClass2 => true
        case _ => false
      }
    }

    val testData = Array(new SimpleClass1, new SimpleClass1, new SimpleClass2)
    runTests(testData)
  }

  @Test
  def testThrowableSerialization(): Unit = {
    val a = List(new RuntimeException("Hello"), new RuntimeException("there"))

    runTests(a)
  }

  @Test
  def jodaSerialization(): Unit = {
    val a = List(new LocalDate(1), new LocalDate(2))

    runTests(a)
  }

  @Test
  def testScalaListSerialization(): Unit = {
    val a = List(42,1,49,1337)

    runTests(Seq(a))
  }

  @Test
  def testScalaMutablelistSerialization(): Unit = {
    val a = scala.collection.mutable.ListBuffer(42,1,49,1337)

    runTests(Seq(a))
  }

  @Test
  def testScalaMapSerialization(): Unit = {
    val a = Map(("1" -> 1), ("2" -> 2), ("42" -> 42), ("1337" -> 1337))

    runTests(Seq(a))
  }

  @Test
  def testMutableMapSerialization(): Unit ={
    val a = scala.collection.mutable.Map((1 -> "1"), (2 -> "2"), (3 -> "3"))

    runTests(Seq(a))
  }

  @Test
  def testScalaListComplexTypeSerialization(): Unit = {
    val a = ComplexType("1234", 42, List(1,2,3,4))
    val b = ComplexType("4321", 24, List(4,3,2,1))
    val c = ComplexType("1337", 1, List(1))
    val list = List(a, b, c)

    runTests(Seq(list))
  }

  @Test
  def testHeterogenousScalaList(): Unit = {
    val a = new DerivedType("foo", "bar")
    val b = new BaseType("foobar")
    val c = new DerivedType2("bar", "foo")
    val list = List(a,b,c)

    runTests(Seq(list))
  }

  case class ComplexType(id: String, number: Int, values: List[Int]){
    override def equals(obj: Any): Boolean ={
      if(obj != null && obj.isInstanceOf[ComplexType]){
        val complexType = obj.asInstanceOf[ComplexType]
        id.equals(complexType.id) && number.equals(complexType.number) && values.equals(
          complexType.values)
      }else{
        false
      }
    }
  }

  class BaseType(val name: String){
    override def equals(obj: Any): Boolean = {
      if(obj != null && obj.isInstanceOf[BaseType]){
        obj.asInstanceOf[BaseType].name.equals(name)
      }else{
        false
      }
    }
  }

  class DerivedType(name: String, val sub: String) extends BaseType(name){
    override def equals(obj: Any): Boolean = {
      if(obj != null && obj.isInstanceOf[DerivedType]){
        super.equals(obj) && obj.asInstanceOf[DerivedType].sub.equals(sub)
      }else{
        false
      }
    }
  }

  class DerivedType2(name: String, val sub: String) extends BaseType(name){
    override def equals(obj: Any): Boolean = {
      if(obj != null && obj.isInstanceOf[DerivedType2]){
        super.equals(obj) && obj.asInstanceOf[DerivedType2].sub.equals(sub)
      }else{
        false
      }
    }
  }

  def runTests[T : ClassTag](objects: Seq[T]): Unit ={
    val clsTag = classTag[T]

    // Register the custom Kryo Serializer
    val conf = new ExecutionConfig
    conf.registerTypeWithKryoSerializer(classOf[LocalDate], classOf[LocalDateSerializer])
    val typeInfo = new GenericTypeInfo[T](clsTag.runtimeClass.asInstanceOf[Class[T]])
    val serializer = typeInfo.createSerializer(conf)
    val typeClass = typeInfo.getTypeClass

    val instance = new SerializerTestInstance[T](serializer, typeClass, -1, objects: _*)

    instance.testAll()
  }
}

class LocalDateSerializer extends Serializer[LocalDate] with java.io.Serializable {

  override def write(kryo: Kryo, output: Output, obj: LocalDate) {
    output.writeInt(obj.getYear())
    output.writeInt(obj.getMonthOfYear())
    output.writeInt(obj.getDayOfMonth())
  }

  override def read(kryo: Kryo, input: Input, typeClass: Class[LocalDate]) : LocalDate = {
    new LocalDate(input.readInt(), input.readInt(), input.readInt())
  }
}


text:
package org.apache.causeway.testing.specsupport.applib.integration;

import java.lang.reflect.Constructor;
import java.util.Map;

import org.apache.causeway.applib.services.inject.ServiceInjector;
import org.apache.causeway.commons.internal.collections._Maps;

import io.cucumber.core.backend.ObjectFactory;
import io.cucumber.core.exception.CucumberException;
import lombok.RequiredArgsConstructor;

/**
 * @since 2.0 {@index}
 */
@RequiredArgsConstructor
public class ObjectFactoryForIntegration implements ObjectFactory {

    private final ServiceInjector serviceInjector;
    private final Map<Class<?>, Object> instances = _Maps.newHashMap();

    @Override
    public void start() { }

    @Override
    public void stop() {
        this.instances.clear();
    }

    @Override
    public boolean addClass(final Class<?> clazz) {
        return true;
    }

    @Override
    public <T> T getInstance(final Class<T> type) {
        T instance = type.cast(this.instances.get(type));
        if (instance == null) {
            instance = this.newInstance(type);

            if(serviceInjector != null) {
                instance = this.cacheInstance(type, instance);
                serviceInjector.injectServicesInto(instance);
            } else {
                // don't cache
            }
        }
        return instance;
    }

    private <T> T cacheInstance(final Class<T> type, final T instance) {
        this.instances.put(type, instance);
        return instance;
    }

    private <T> T newInstance(final Class<T> type) {
        try {
            Constructor<T> constructor = type.getConstructor();
            return constructor.newInstance();
        } catch (NoSuchMethodException var4) {
            throw new CucumberException(String.format("%s doesn't have an empty constructor.", type), var4);
        } catch (Exception var5) {
            throw new CucumberException(String.format("Failed to instantiate %s", type), var5);
        }
    }
}


text:
package hooks

import (
	"context"
	"fmt"
	"io"
	"strings"
	"sync"

	"github.com/GoogleContainerTools/skaffold/pkg/skaffold/output"
	"github.com/GoogleContainerTools/skaffold/pkg/skaffold/schema/latest"
)

// for testing
var (
	NewRenderRunner = newRenderRunner
)

func newRenderRunner(r latest.RenderHooks, namespaces *[]string, opts RenderEnvOpts) Runner {
	return renderRunner{r, namespaces, opts, new(sync.Map)}
}

func NewRenderEnvOpts(kubeContext string, namespaces []string) RenderEnvOpts {
	return RenderEnvOpts{
		KubeContext: kubeContext,
		Namespaces:  strings.Join(namespaces, ","),
	}
}

type renderRunner struct {
	latest.RenderHooks
	namespaces        *[]string
	opts              RenderEnvOpts
	visitedContainers *sync.Map // maintain a list of previous iteration containers, so that they can be skipped
}

func (r renderRunner) RunPreHooks(ctx context.Context, out io.Writer) error {
	return r.run(ctx, out, r.PreHooks, phases.PreRender)
}

func (r renderRunner) RunPostHooks(ctx context.Context, out io.Writer) error {
	return r.run(ctx, out, r.PostHooks, phases.PostRender)
}

func (r renderRunner) getEnv() []string {
	common := getEnv(staticEnvOpts)
	render := getEnv(r.opts)
	return append(common, render...)
}

func (r renderRunner) run(ctx context.Context, out io.Writer, hooks []latest.RenderHookItem, phase phase) error {
	if len(hooks) > 0 {
		output.Default.Fprintln(out, fmt.Sprintf("Starting %s hooks...", phase))
	}
	env := r.getEnv()
	for _, h := range hooks {
		if h.HostHook != nil {
			hook := hostHook{*h.HostHook, env}
			if err := hook.run(ctx, out); err != nil {
				return err
			}
		}
	}
	if len(hooks) > 0 {
		output.Default.Fprintln(out, fmt.Sprintf("Completed %s hooks", phase))
	}
	return nil
}


text:
<!DOCTYPE html>

    <meta charset="UTF-8">
    <title>Example 09.12 - Bones manually</title>


text:
package pki

import "encoding/base64"

func getKubeConfigX509(kubernetesURL string, clusterName string, componentName string, caPath string, crtPath string, keyPath string) string {
	return `apiVersion: v1
kind: Config
clusters:
- cluster:
    api-version: v1
    certificate-authority: ` + caPath + `
    server: "` + kubernetesURL + `"
  name: "` + clusterName + `"
contexts:
- context:
    cluster: "` + clusterName + `"
    user: "` + componentName + `-` + clusterName + `"
  name: "` + clusterName + `"
current-context: "` + clusterName + `"
users:
- name: "` + componentName + `-` + clusterName + `"
  user:
    client-certificate: ` + crtPath + `
    client-key: ` + keyPath + ``
}

func GetKubeConfigX509WithData(kubernetesURL string, clusterName string, componentName string, cacrt string, crt string, key string) string {
	return `apiVersion: v1
kind: Config
clusters:
- cluster:
    api-version: v1
    certificate-authority-data: ` + base64.StdEncoding.EncodeToString([]byte(cacrt)) + `
    server: "` + kubernetesURL + `"
  name: "` + clusterName + `"
contexts:
- context:
    cluster: "` + clusterName + `"
    user: "` + componentName + `-` + clusterName + `"
  name: "` + clusterName + `"
current-context: "` + clusterName + `"
users:
- name: "` + componentName + `-` + clusterName + `"
  user:
    client-certificate-data: ` + base64.StdEncoding.EncodeToString([]byte(crt)) + `
    client-key-data: ` + base64.StdEncoding.EncodeToString([]byte(key)) + ``
}