text:
package nxt;

import nxt.db.DbClause;
import nxt.db.DbIterator;
import nxt.db.DbKey;
import nxt.db.VersionedEntityDbTable;
import nxt.util.Convert;
import nxt.util.Listener;
import nxt.util.Listeners;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;

@SuppressWarnings("UnusedDeclaration")
public final class Currency {

    public static enum Event {
        BEFORE_DISTRIBUTE_CROWDFUNDING, BEFORE_UNDO_CROWDFUNDING, BEFORE_DELETE
    }

    private static final DbKey.LongKeyFactory<Currency> currencyDbKeyFactory = new DbKey.LongKeyFactory<Currency>("id") {

        @Override
        public DbKey newKey(Currency currency) {
            return currency.dbKey;
        }

    };

    private static final VersionedEntityDbTable<Currency> currencyTable = new VersionedEntityDbTable<Currency>("currency", currencyDbKeyFactory) {

        @Override
        protected Currency load(Connection con, ResultSet rs) throws SQLException {
            return new Currency(rs);
        }

        @Override
        protected void save(Connection con, Currency currency) throws SQLException {
            currency.save(con);
        }

        @Override
        public String defaultSort() {
            return " ORDER BY creation_height DESC ";
        }

    };

    private static class CurrencySupply {

        private final DbKey dbKey;
        private long currencyId;
        private long currentSupply;
        private long currentReservePerUnitNQT;

        private CurrencySupply(Currency currency) {
            this.currencyId = currency.currencyId;
            this.dbKey = currencySupplyDbKeyFactory.newKey(this.currencyId);
        }

        private CurrencySupply(ResultSet rs) throws SQLException {
            this.currencyId = rs.getLong("id");
            this.dbKey = currencySupplyDbKeyFactory.newKey(this.currencyId);
            this.currentSupply = rs.getLong("current_supply");
            this.currentReservePerUnitNQT = rs.getLong("current_reserve_per_unit_nqt");
        }

        private void save(Connection con) throws SQLException {
            try (PreparedStatement pstmt = con.prepareStatement("MERGE INTO currency_supply (id, current_supply, "
                    + "current_reserve_per_unit_nqt, height, latest) "
                    + "KEY (id, height) VALUES (?, ?, ?, ?, TRUE)")) {
                int i = 0;
                pstmt.setLong(++i, this.currencyId);
                pstmt.setLong(++i, this.currentSupply);
                pstmt.setLong(++i, this.currentReservePerUnitNQT);
                pstmt.setInt(++i, Nxt.getBlockchain().getHeight());
                pstmt.executeUpdate();
            }
        }
    }

    private static final DbKey.LongKeyFactory<CurrencySupply> currencySupplyDbKeyFactory = new DbKey.LongKeyFactory<CurrencySupply>("id") {

        @Override
        public DbKey newKey(CurrencySupply currencySupply) {
            return currencySupply.dbKey;
        }

    };

    private static final VersionedEntityDbTable<CurrencySupply> currencySupplyTable = new VersionedEntityDbTable<CurrencySupply>("currency_supply", currencySupplyDbKeyFactory) {

        @Override
        protected CurrencySupply load(Connection con, ResultSet rs) throws SQLException {
            return new CurrencySupply(rs);
        }

        @Override
        protected void save(Connection con, CurrencySupply currencySupply) throws SQLException {
            currencySupply.save(con);
        }

    };

    private static final Listeners<Currency,Event> listeners = new Listeners<>();

    public static boolean addListener(Listener<Currency> listener, Event eventType) {
        return listeners.addListener(listener, eventType);
    }

    public static boolean removeListener(Listener<Currency> listener, Event eventType) {
        return listeners.removeListener(listener, eventType);
    }

    public static DbIterator<Currency> getAllCurrencies(int from, int to) {
        return currencyTable.getAll(from, to);
    }

    public static int getCount() {
        return currencyTable.getCount();
    }

    public static Currency getCurrency(long id) {
        return currencyTable.get(currencyDbKeyFactory.newKey(id));
    }

    public static Currency getCurrencyByName(String name) {
        return currencyTable.getBy(new DbClause.StringClause("name_lower", name.toLowerCase()));
    }

    public static Currency getCurrencyByCode(String code) {
        return currencyTable.getBy(new DbClause.StringClause("code", code));
    }

    public static DbIterator<Currency> getCurrencyIssuedBy(long accountId, int from, int to) {
        return currencyTable.getManyBy(new DbClause.LongClause("account_id", accountId), from, to);
    }

    public static DbIterator<Currency> searchCurrencies(String query, int from, int to) {
        return currencyTable.search(query, DbClause.EMPTY_CLAUSE, from, to, " ORDER BY ft.score DESC, currency.creation_height DESC ");
    }

    static void addCurrency(Transaction transaction, Attachment.MonetarySystemCurrencyIssuance attachment) {
        Currency oldCurrency;
        if ((oldCurrency = Currency.getCurrencyByCode(attachment.getCode())) != null) {
            oldCurrency.delete(transaction.getSenderId());
        }
        if ((oldCurrency = Currency.getCurrencyByCode(attachment.getName().toUpperCase())) != null) {
            oldCurrency.delete(transaction.getSenderId());
        }
        if ((oldCurrency = Currency.getCurrencyByName(attachment.getName())) != null) {
            oldCurrency.delete(transaction.getSenderId());
        }
        if ((oldCurrency = Currency.getCurrencyByName(attachment.getCode())) != null) {
            oldCurrency.delete(transaction.getSenderId());
        }
        Currency currency = new Currency(transaction, attachment);
        currencyTable.insert(currency);
        if (currency.is(CurrencyType.MINTABLE) || currency.is(CurrencyType.RESERVABLE)) {
            CurrencySupply currencySupply = currency.getSupplyData();
            currencySupply.currentSupply = attachment.getInitialSupply();
            currencySupplyTable.insert(currencySupply);
        }

    }

    static {
        Nxt.getBlockchainProcessor().addListener(new CrowdFundingListener(), BlockchainProcessor.Event.AFTER_BLOCK_APPLY);
    }

    static void init() {}

    private final long currencyId;

    private final DbKey dbKey;
    private final long accountId;
    private final String name;
    private final String code;
    private final String description;
    private final int type;
    private final long maxSupply;
    private final long reserveSupply;
    private final int creationHeight;
    private final int issuanceHeight;
    private final long minReservePerUnitNQT;
    private final int minDifficulty;
    private final int maxDifficulty;
    private final byte ruleset;
    private final byte algorithm;
    private final byte decimals;
    private final long initialSupply;
    private CurrencySupply currencySupply;

    private Currency(Transaction transaction, Attachment.MonetarySystemCurrencyIssuance attachment) {
        this.currencyId = transaction.getId();
        this.dbKey = currencyDbKeyFactory.newKey(this.currencyId);
        this.accountId = transaction.getSenderId();
        this.name = attachment.getName();
        this.code = attachment.getCode();
        this.description = attachment.getDescription();
        this.type = attachment.getType();
        this.initialSupply = attachment.getInitialSupply();
        this.reserveSupply = attachment.getReserveSupply();
        this.maxSupply = attachment.getMaxSupply();
        this.creationHeight = transaction.getHeight();
        this.issuanceHeight = attachment.getIssuanceHeight();
        this.minReservePerUnitNQT = attachment.getMinReservePerUnitNQT();
        this.minDifficulty = attachment.getMinDifficulty();
        this.maxDifficulty = attachment.getMaxDifficulty();
        this.ruleset = attachment.getRuleset();
        this.algorithm = attachment.getAlgorithm();
        this.decimals = attachment.getDecimals();
    }

    private Currency(ResultSet rs) throws SQLException {
        this.currencyId = rs.getLong("id");
        this.dbKey = currencyDbKeyFactory.newKey(this.currencyId);
        this.accountId = rs.getLong("account_id");
        this.name = rs.getString("name");
        this.code = rs.getString("code");
        this.description = rs.getString("description");
        this.type = rs.getInt("type");
        this.initialSupply = rs.getLong("initial_supply");
        this.reserveSupply = rs.getLong("reserve_supply");
        this.maxSupply = rs.getLong("max_supply");
        this.creationHeight = rs.getInt("creation_height");
        this.issuanceHeight = rs.getInt("issuance_height");
        this.minReservePerUnitNQT = rs.getLong("min_reserve_per_unit_nqt");
        this.minDifficulty = rs.getByte("min_difficulty") & 0xFF;
        this.maxDifficulty = rs.getByte("max_difficulty") & 0xFF;
        this.ruleset = rs.getByte("ruleset");
        this.algorithm = rs.getByte("algorithm");
        this.decimals = rs.getByte("decimals");
    }

    private void save(Connection con) throws SQLException {
        try (PreparedStatement pstmt = con.prepareStatement("MERGE INTO currency (id, account_id, name, code, "
                + "description, type, initial_supply, reserve_supply, max_supply, creation_height, issuance_height, min_reserve_per_unit_nqt, "
                + "min_difficulty, max_difficulty, ruleset, algorithm, decimals, height, latest) "
                + "KEY (id, height) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, TRUE)")) {
            int i = 0;
            pstmt.setLong(++i, this.getId());
            pstmt.setLong(++i, this.getAccountId());
            pstmt.setString(++i, this.getName());
            pstmt.setString(++i, this.getCode());
            pstmt.setString(++i, this.getDescription());
            pstmt.setInt(++i, this.getType());
            pstmt.setLong(++i, this.getInitialSupply());
            pstmt.setLong(++i, this.getReserveSupply());
            pstmt.setLong(++i, this.getMaxSupply());
            pstmt.setInt(++i, this.getCreationHeight());
            pstmt.setInt(++i, this.getIssuanceHeight());
            pstmt.setLong(++i, this.getMinReservePerUnitNQT());
            pstmt.setByte(++i, (byte)this.getMinDifficulty());
            pstmt.setByte(++i, (byte)this.getMaxDifficulty());
            pstmt.setByte(++i, this.getRuleset());
            pstmt.setByte(++i, this.getAlgorithm());
            pstmt.setByte(++i, this.getDecimals());
            pstmt.setInt(++i, Nxt.getBlockchain().getHeight());
            pstmt.executeUpdate();
        }
    }

    public long getId() {
        return currencyId;
    }

    public long getAccountId() {
        return accountId;
    }

    public String getName() {
        return name;
    }

    public String getCode() {
        return code;
    }

    public String getDescription() {
        return description;
    }

    public int getType() {
        return type;
    }

    public long getInitialSupply() {
        return initialSupply;
    }

    public long getCurrentSupply() {
        if (!is(CurrencyType.RESERVABLE) && !is(CurrencyType.MINTABLE)) {
            return initialSupply;
        }
        if (getSupplyData() == null) {
            return 0;
        }
        return currencySupply.currentSupply;
    }

    public long getReserveSupply() {
        return reserveSupply;
    }

    public long getMaxSupply() {
        return maxSupply;
    }

    public int getCreationHeight() {
        return creationHeight;
    }

    public int getIssuanceHeight() {
        return issuanceHeight;
    }

    public long getMinReservePerUnitNQT() {
        return minReservePerUnitNQT;
    }

    public int getMinDifficulty() {
        return minDifficulty;
    }

    public int getMaxDifficulty() {
        return maxDifficulty;
    }

    public byte getRuleset() {
        return ruleset;
    }

    public byte getAlgorithm() {
        return algorithm;
    }

    public byte getDecimals() {
        return decimals;
    }

    public long getCurrentReservePerUnitNQT() {
        if (!is(CurrencyType.RESERVABLE) || getSupplyData() == null) {
            return 0;
        }
        return currencySupply.currentReservePerUnitNQT;
    }

    public boolean isActive() {
        return issuanceHeight <= BlockchainImpl.getInstance().getHeight();
    }

    private CurrencySupply getSupplyData() {
        if (!is(CurrencyType.RESERVABLE) && !is(CurrencyType.MINTABLE)) {
            return null;
        }
        if (currencySupply == null) {
            currencySupply = currencySupplyTable.get(currencySupplyDbKeyFactory.newKey(currencyId));
            if (currencySupply == null) {
                currencySupply = new CurrencySupply(this);
            }
        }
        return currencySupply;
    }

    static void increaseReserve(Account account, long currencyId, long amountPerUnitNQT) {
        Currency currency = Currency.getCurrency(currencyId);
        account.addToBalanceNQT(-Convert.safeMultiply(currency.getReserveSupply(), amountPerUnitNQT));
        CurrencySupply currencySupply = currency.getSupplyData();
        currencySupply.currentReservePerUnitNQT += amountPerUnitNQT;
        currencySupplyTable.insert(currencySupply);
        CurrencyFounder.addOrUpdateFounder(currencyId, account.getId(), amountPerUnitNQT);
    }

    static void claimReserve(Account account, long currencyId, long units) {
        account.addToCurrencyUnits(currencyId, -units);
        Currency currency = Currency.getCurrency(currencyId);
        currency.increaseSupply(- units);
        account.addToBalanceAndUnconfirmedBalanceNQT(Convert.safeMultiply(units, currency.getCurrentReservePerUnitNQT()));
    }

    static void transferCurrency(Account senderAccount, Account recipientAccount, long currencyId, long units) {
        senderAccount.addToCurrencyUnits(currencyId, -units);
        recipientAccount.addToCurrencyAndUnconfirmedCurrencyUnits(currencyId, units);
    }

    void increaseSupply(long units) {
        getSupplyData();
        currencySupply.currentSupply += units;
        if (currencySupply.currentSupply > maxSupply || currencySupply.currentSupply < 0) {
            currencySupply.currentSupply -= units;
            throw new IllegalArgumentException("Cannot add " + units + " to current supply of " + currencySupply.currentSupply);
        }
        currencySupplyTable.insert(currencySupply);
    }

    public DbIterator<Account.AccountCurrency> getAccounts(int from, int to) {
        return Account.getCurrencyAccounts(this.currencyId, from, to);
    }

    public DbIterator<Account.AccountCurrency> getAccounts(int height, int from, int to) {
        if (height < 0) {
            return getAccounts(from, to);
        }
        return Account.getCurrencyAccounts(this.currencyId, height, from, to);
    }

    public DbIterator<Exchange> getExchanges(int from, int to) {
        return Exchange.getCurrencyExchanges(this.currencyId, from, to);
    }

    public DbIterator<CurrencyTransfer> getTransfers(int from, int to) {
        return CurrencyTransfer.getCurrencyTransfers(this.currencyId, from, to);
    }

    public boolean is(CurrencyType type) {
        return (this.type & type.getCode()) != 0;
    }

    public boolean canBeDeletedBy(long ownerAccountId) {
        if (!isActive()) {
            return ownerAccountId == accountId;
        }
        if (is(CurrencyType.MINTABLE) && getCurrentSupply() < maxSupply && ownerAccountId != accountId) {
            return false;
        }
        try (DbIterator<Account.AccountCurrency> accountCurrencies = Account.getCurrencyAccounts(this.currencyId, 0, -1)) {
            return ! accountCurrencies.hasNext() || accountCurrencies.next().getAccountId() == ownerAccountId && ! accountCurrencies.hasNext();
        }
    }

    void delete(long ownerAccountId) {
        if (!canBeDeletedBy(ownerAccountId)) {
            // shouldn't happen as ownership has already been checked in validate, but as a safety check
            throw new IllegalStateException("Currency " + Convert.toUnsignedLong(currencyId) + " not entirely owned by " + Convert.toUnsignedLong(ownerAccountId));
        }
        listeners.notify(this, Event.BEFORE_DELETE);
        Account ownerAccount = Account.getAccount(ownerAccountId);
        if (is(CurrencyType.RESERVABLE)) {
            if (is(CurrencyType.CLAIMABLE) && isActive()) {
                ownerAccount.addToUnconfirmedCurrencyUnits(currencyId, -ownerAccount.getCurrencyUnits(currencyId));
                Currency.claimReserve(ownerAccount, currencyId, ownerAccount.getCurrencyUnits(currencyId));
            }
            if (!isActive()) {
                try (DbIterator<CurrencyFounder> founders = CurrencyFounder.getCurrencyFounders(currencyId, 0, Integer.MAX_VALUE)) {
                    for (CurrencyFounder founder : founders) {
                        Account.getAccount(founder.getAccountId()).addToBalanceAndUnconfirmedBalanceNQT(Convert.safeMultiply(reserveSupply, founder.getAmountPerUnitNQT()));
                    }
                }
            }
            CurrencyFounder.remove(currencyId);
        }
        if (is(CurrencyType.EXCHANGEABLE)) {
            List<CurrencyBuyOffer> buyOffers = new ArrayList<>();
            try (DbIterator<CurrencyBuyOffer> offers = CurrencyBuyOffer.getOffers(this, 0, -1)) {
                while (offers.hasNext()) {
                    buyOffers.add(offers.next());
                }
            }
            for (CurrencyBuyOffer offer : buyOffers) {
                CurrencyExchangeOffer.removeOffer(offer);
            }
        }
        if (is(CurrencyType.MINTABLE)) {
            CurrencyMint.deleteCurrency(this);
        }
        ownerAccount.addToUnconfirmedCurrencyUnits(currencyId, -ownerAccount.getUnconfirmedCurrencyUnits(currencyId));
        ownerAccount.addToCurrencyUnits(currencyId, -ownerAccount.getCurrencyUnits(currencyId));
        currencyTable.delete(this);
    }

    private static final class CrowdFundingListener implements Listener<Block> {

        @Override
        public void notify(Block block) {
            if (block.getHeight() <= Constants.MONETARY_SYSTEM_BLOCK) {
                return;
            }
            try (DbIterator<Currency> issuedCurrencies = currencyTable.getManyBy(new DbClause.IntClause("issuance_height", block.getHeight()), 0, -1)) {
                for (Currency currency : issuedCurrencies) {
                    if (currency.getCurrentReservePerUnitNQT() < currency.getMinReservePerUnitNQT()) {
                        listeners.notify(currency, Event.BEFORE_UNDO_CROWDFUNDING);
                        undoCrowdFunding(currency);
                    } else {
                        listeners.notify(currency, Event.BEFORE_DISTRIBUTE_CROWDFUNDING);
                        distributeCurrency(currency);
                    }
                }
            }
        }

        private void undoCrowdFunding(Currency currency) {
            try (DbIterator<CurrencyFounder> founders = CurrencyFounder.getCurrencyFounders(currency.getId(), 0, Integer.MAX_VALUE)) {
                for (CurrencyFounder founder : founders) {
                    Account.getAccount(founder.getAccountId()).addToBalanceAndUnconfirmedBalanceNQT(Convert.safeMultiply(currency.getReserveSupply(), founder.getAmountPerUnitNQT()));
                }
            }
            Account.getAccount(currency.getAccountId()).addToCurrencyAndUnconfirmedCurrencyUnits(currency.getId(), - currency.getInitialSupply());
            currencyTable.delete(currency);
            CurrencyFounder.remove(currency.getId());
        }

        private void distributeCurrency(Currency currency) {
            long totalAmountPerUnit = 0;
            final long remainingSupply = currency.getReserveSupply() - currency.getInitialSupply();
            List<CurrencyFounder> currencyFounders = new ArrayList<>();
            try (DbIterator<CurrencyFounder> founders = CurrencyFounder.getCurrencyFounders(currency.getId(), 0, Integer.MAX_VALUE)) {
                for (CurrencyFounder founder : founders) {
                    totalAmountPerUnit += founder.getAmountPerUnitNQT();
                    currencyFounders.add(founder);
                }
            }
            CurrencySupply currencySupply = currency.getSupplyData();
            for (CurrencyFounder founder : currencyFounders) {
                long units = Convert.safeDivide(Convert.safeMultiply(remainingSupply, founder.getAmountPerUnitNQT()), totalAmountPerUnit);
                currencySupply.currentSupply += units;
                Account.getAccount(founder.getAccountId()).addToCurrencyAndUnconfirmedCurrencyUnits(currency.getId(), units);
            }
            Account issuerAccount = Account.getAccount(currency.getAccountId());
            issuerAccount.addToCurrencyAndUnconfirmedCurrencyUnits(currency.getId(), currency.getReserveSupply() - currency.getCurrentSupply());
            if (!currency.is(CurrencyType.CLAIMABLE)) {
                issuerAccount.addToBalanceAndUnconfirmedBalanceNQT(Convert.safeMultiply(totalAmountPerUnit, currency.getReserveSupply()));
            }
            currencySupply.currentSupply = currency.getReserveSupply();
            currencySupplyTable.insert(currencySupply);
        }
    }
}


text:
<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>tv.floe.metronome</groupId>
	<artifactId>Metronome</artifactId>
	<version>1.0-SNAPSHOT</version>
	<packaging>jar</packaging>

	<name>Metronome</name>
	<url>http://maven.apache.org</url>

	<properties>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<hadoop.version>2.0.0-cdh4.6.0</hadoop.version>
		<mahout.version>0.7-cdh4.6.0</mahout.version>
	</properties>

	<build>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>2.1</version>
				<configuration>
					<source>1.6</source>
					<target>1.6</target>
				</configuration>
			</plugin>

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-dependency-plugin</artifactId>
				<executions>
					<execution>
						<id>copy-dependencies</id>
						<phase>prepare-package</phase>
						<goals>
							<goal>copy-dependencies</goal>
						</goals>
						<configuration>
							<outputDirectory>${project.build.directory}/lib</outputDirectory>
							<overWriteReleases>false</overWriteReleases>
							<overWriteSnapshots>false</overWriteSnapshots>
							<overWriteIfNewer>true</overWriteIfNewer>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<artifactId>maven-assembly-plugin</artifactId>
				<version>2.2.1</version>
				<configuration>
					<descriptorRefs>
						<descriptorRef>jar-with-dependencies</descriptorRef>
					</descriptorRefs>
					<archive>
						<manifest>
							<mainClass>tv.floe.metronome.yarn.client.Client</mainClass>
						</manifest>
					</archive>

				</configuration>
				<executions>
					<execution>
						<phase>package</phase>
						<goals>
							<goal>single</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-jar-plugin</artifactId>
				<executions>
					<execution>
						<id>create-test-jar</id>
						<phase>package</phase>
						<goals>
							<goal>test-jar</goal>
						</goals>
					</execution>
				</executions>
				<configuration>
					<archive>
						<manifest>
							<addClasspath>false</addClasspath>
							<classpathPrefix>lib/</classpathPrefix>
							<mainClass>tv.floe.metronome.yarn.client.Client</mainClass>
						</manifest>
					</archive>
					<excludes>
						<exclude>**/*.properties</exclude>
						<exclude>**/*.xml</exclude>
					</excludes>
				</configuration>
			</plugin>
			<!-- <plugin> <groupId>org.apache.avro</groupId> <artifactId>avro-maven-plugin</artifactId>
				<version>1.7.1</version> <executions> <execution> <id>schemas</id> <phase>generate-sources</phase>
				<goals> <goal>schema</goal> <goal>protocol</goal> <goal>idl-protocol</goal>
				</goals> <configuration> <sourceDirectory>${project.basedir}/src/main/avro/</sourceDirectory>
				<outputDirectory>${project.basedir}/src/main/java/</outputDirectory> <testSourceDirectory>${project.basedir}/src/test/avro/</testSourceDirectory>
				<testOutputDirectory>${project.basedir}/src/test/java/</testOutputDirectory>
				</configuration> </execution> </executions> </plugin> -->
<!--
      <plugin>
        <groupId>org.apache.avro</groupId>
        <artifactId>avro-maven-plugin</artifactId>
        <version>1.7.1</version>
        <executions>
          <execution>
            <id>schemas</id>
            <phase>generate-sources</phase>
            <goals>
              <goal>schema</goal>
              <goal>protocol</goal>
              <goal>idl-protocol</goal>
            </goals>
            <configuration>
              <sourceDirectory>${project.basedir}/src/main/avro/</sourceDirectory>
              <outputDirectory>${project.basedir}/src/main/java/</outputDirectory>
              <testSourceDirectory>${project.basedir}/src/test/avro/</testSourceDirectory>
              <testOutputDirectory>${project.basedir}/src/test/java/</testOutputDirectory>
            </configuration>
          </execution>
        </executions>
      </plugin>
-->
		</plugins>
		<pluginManagement>
			<plugins>
				<!--This plugin's configuration is used to store Eclipse m2e settings
					only. It has no influence on the Maven build itself. -->
				<plugin>
					<groupId>org.eclipse.m2e</groupId>
					<artifactId>lifecycle-mapping</artifactId>
					<version>1.0.0</version>
					<configuration>
						<lifecycleMappingMetadata>
							<pluginExecutions>
								<pluginExecution>
									<pluginExecutionFilter>
										<groupId>
											org.apache.maven.plugins
										</groupId>
										<artifactId>
											maven-dependency-plugin
										</artifactId>
										<versionRange>[2.1,)</versionRange>
										<goals>
											<goal>copy-dependencies</goal>
										</goals>
									</pluginExecutionFilter>
									<action>
										<ignore></ignore>
									</action>
								</pluginExecution>
							</pluginExecutions>
						</lifecycleMappingMetadata>
					</configuration>
				</plugin>
			</plugins>
		</pluginManagement>
	</build>

	<repositories>
		<repository>
			<id>org.apache.hadoop</id>
			<url>https://repository.cloudera.com/artifactory/cloudera-repos/</url>
		</repository>

		<repository>
			<id>org.apache.mahout</id>
			<url>https://repository.cloudera.com/artifactory/cloudera-repos/</url>
		</repository>
	</repositories>

	<dependencyManagement>
		<dependencies>
		</dependencies>
	</dependencyManagement>

	<dependencies>
		<!-- <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId>
			<version>3.8.1</version> <scope>test</scope> </dependency> -->

		<dependency>
			<groupId>org.apache.hadoop</groupId>
			<artifactId>hadoop-common</artifactId>
			<version>${hadoop.version}</version>
			<scope>provided</scope>
		</dependency>

		<dependency>
			<groupId>org.apache.mahout</groupId>
			<artifactId>mahout-core</artifactId>
			<version>${mahout.version}</version>
		</dependency>

		<dependency>
			<groupId>org.apache.mahout</groupId>
			<artifactId>mahout-examples</artifactId>
			<version>${mahout.version}</version>
			<exclusions>
				<exclusion>
					<groupId>org.apache.cassandra.deps</groupId>
					<artifactId>avro</artifactId>
				</exclusion>
			</exclusions>
		</dependency>

		<dependency>
			<groupId>org.apache.mahout</groupId>
			<artifactId>mahout-math</artifactId>
			<version>${mahout.version}</version>
			<exclusions>
				<exclusion>
					<groupId>com.google.guava</groupId>
					<artifactId>guava</artifactId>
				</exclusion>

          <exclusion>
            <groupId>jfree</groupId>
            <artifactId>jfreechart</artifactId>
          </exclusion>

			</exclusions>
		</dependency>

		<dependency>
			<groupId>com.google.guava</groupId>
			<artifactId>guava</artifactId>
			<version>11.0.2</version>
		</dependency>

		<dependency>
			<groupId>log4j</groupId>
			<artifactId>log4j</artifactId>
			<version>1.2.16</version>
			<scope>provided</scope>
			<exclusions>
				<exclusion>
					<groupId>com.sun.jdmk</groupId>
					<artifactId>jmxtools</artifactId>
				</exclusion>
				<exclusion>
					<groupId>com.sun.jmx</groupId>
					<artifactId>jmxri</artifactId>
				</exclusion>
			</exclusions>
		</dependency>

		<dependency>
			<groupId>org.apache.hadoop</groupId>
			<artifactId>hadoop-yarn-api</artifactId>
			<version>${hadoop.version}</version>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>org.apache.hadoop</groupId>
			<artifactId>hadoop-yarn-common</artifactId>
			<version>${hadoop.version}</version>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>org.apache.hadoop</groupId>
			<artifactId>hadoop-yarn-server-common</artifactId>
			<version>${hadoop.version}</version>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>org.apache.hadoop</groupId>
			<artifactId>hadoop-yarn-server-nodemanager</artifactId>
			<version>${hadoop.version}</version>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>org.apache.hadoop</groupId>
			<artifactId>hadoop-yarn-server-resourcemanager</artifactId>
			<version>${hadoop.version}</version>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>org.apache.avro</groupId>
			<artifactId>avro</artifactId>
			<version>1.7.1</version>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>org.apache.avro</groupId>
			<artifactId>avro-ipc</artifactId>
			<version>1.7.1</version>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>org.apache.hadoop</groupId>
			<artifactId>hadoop-hdfs</artifactId>
			<version>${hadoop.version}</version>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>org.apache.hadoop</groupId>
			<artifactId>hadoop-hdfs</artifactId>
			<version>${hadoop.version}</version>
			<classifier>tests</classifier>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.apache.hadoop</groupId>
			<artifactId>hadoop-common</artifactId>
			<version>${hadoop.version}</version>
			<classifier>tests</classifier>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.apache.hadoop</groupId>
			<artifactId>hadoop-yarn-server-tests</artifactId>
			<version>${hadoop.version}</version>
			<type>test-jar</type>
			<scope>test</scope>
		</dependency>

		<dependency>
			<groupId>org.apache.commons</groupId>
			<artifactId>commons-math3</artifactId>
			<version>3.2</version>
		</dependency>

		<dependency>
			<groupId>com.cloudera</groupId>
			<artifactId>iterativereduce</artifactId>
			<version>0.1-SNAPSHOT</version>
		</dependency>

		<dependency>
			<groupId>cc.mallet</groupId>
			<artifactId>mallet</artifactId>
			<version>2.0.7</version>
		</dependency>

		<dependency>
			<groupId>org.apache.commons</groupId>
			<artifactId>commons-lang3</artifactId>
			<version>3.1</version>
		</dependency>

	</dependencies>
</project>

redpajama_set_name: RedPajamaGithub


text:
export interface ArmedHero{
  id: number,
  heroId: number,
  weaponId: number
}


text:
package net.bluewizardhat.yubiauth;

import javax.xml.bind.ValidationException;

import com.yubico.client.v2.VerificationResponse;
import com.yubico.client.v2.exceptions.YubicoValidationFailure;
import com.yubico.client.v2.exceptions.YubicoVerificationException;

import lombok.Builder;
import lombok.Value;

/**
 * Response object
 *
 * @author bluewizardhat
 */
@Value
@Builder
public class YubiVerifyResponse {
	public enum VerifyStatus {
		/**
		 * The OTP verifies
		 */
		OK,
		/**
		 * The OTP failed verification
		 */
		FAILED,
		/**
		 * The OTP is not valid
		 */
		BAD_OTP,
		/**
		 * An error occured trying to communicate with Yubico servers (YubicoValidationException)
		 */
		ERROR,
		/**
		 * An error occured trying to communicate with Yubico servers (YubicoValidationFailure)
		 * Possible man-in-the-middle attack
		 */
		VALIDATION_ERROR;
	}

	/**
	 * Status of a verify
	 */
	private VerifyStatus verifyStatus;

	/**
	 * Response status object from the YubicoClient if available
	 */
	private VerificationResponse yubicoResponse;

	/**
	 * Cause of error
	 */
	private Exception errorCause;

	static YubiVerifyResponse ok(VerificationResponse yubicoResponse) {
		return builder().verifyStatus(VerifyStatus.OK).yubicoResponse(yubicoResponse).build();
	}

	static YubiVerifyResponse failed(VerificationResponse status) {
		return builder().verifyStatus(VerifyStatus.FAILED).yubicoResponse(status).build();
	}

	static YubiVerifyResponse error(ValidationException errorCause) {
		return builder().verifyStatus(VerifyStatus.ERROR).errorCause(errorCause).build();
	}

	static YubiVerifyResponse error(YubicoVerificationException errorCause) {
		return builder().verifyStatus(VerifyStatus.ERROR).errorCause(errorCause).build();
	}

	static YubiVerifyResponse error(YubicoValidationFailure errorCause) {
		return builder().verifyStatus(VerifyStatus.VALIDATION_ERROR).errorCause(errorCause).build();
	}

	static YubiVerifyResponse badOtp() {
		return builder().verifyStatus(VerifyStatus.BAD_OTP).build();
	}
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<!--

    Licensed to Jasig under one or more contributor license
    agreements. See the NOTICE file distributed with this work
    for additional information regarding copyright ownership.
    Jasig licenses this file to you under the Apache License,
    Version 2.0 (the "License"); you may not use this file
    except in compliance with the License. You may obtain a
    copy of the License at:

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

    Unless required by applicable law or agreed to in writing,
    software distributed under the License is distributed on
    an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    KIND, either express or implied. See the License for the
    specific language governing permissions and limitations
    under the License.

-->
<fragment-definition xmlns:dlm="http://org.jasig.portal.layout.dlm.config"
    script="classpath://org/jasig/portal/io/import-fragment-definition_v3-1.crn">
    <!-- The underscore prefix on the fragment name is intended to draw attention to the fact that this is
    *not* defining a traditional type=regular tab in the layout and instead is defining a special fragment,
    here for use of the Favorites portlet. -->
    <dlm:fragment name="_news_favorite_collection-lo" ownerID="news_favorite_collection-lo" precedence="80">
        <dlm:audience evaluatorFactory="org.jasig.portal.layout.dlm.providers.GroupMembershipEvaluatorFactory">
            <paren mode="OR">
                <attribute mode="deepMemberOf" name="Everyone"/>
            </paren>
        </dlm:audience>
    </dlm:fragment>
</fragment-definition>


text:
package strings;
//: strings/ArrayListDisplay.java
import generics.coffee.*;
import java.util.*;

public class ArrayListDisplay {
  public static void main(String[] args) {
    ArrayList<Coffee> coffees = new ArrayList<Coffee>();
    for(Coffee c : new CoffeeGenerator(10))
      coffees.add(c);
    System.out.println(coffees);
  }
} /* Output:
[Americano 0, Latte 1, Americano 2, Mocha 3, Mocha 4, Breve 5, Americano 6, Latte 7, Cappuccino 8, Cappuccino 9]
*///:~


text:
They can be of different types and colors.

<button>Button</button>
<button class='success'>Success</button>
<button class='warning'>Warning</button>
<button class='error'>Error</button>
<button class='dull'>Dull</button>

## Installation

It is already included in every build from Picnic CSS.

## Colors

The default color is dark blue. There are 5 colors:

<button>Normal</button>
<button class="success">Success</button>
<button class="warning">Warning</button>
<button class="error">Error</button>
<button class="dull">Dull</button>

    <button>Normal</button>
    <button class="success">Success</button>
    <button class="warning">Warning</button>
    <button class="error">Error</button>
    <button class="dull">Dull</button>

## Types

There are different button types for different situations. These are.

<button>Button</button>
Link
<input value="Submit" type="submit">

<input class="toggle" type="checkbox">
Toggle

    <button>Button</button>
    Link
    <input value="Submit" type="submit">

      <input type="checkbox">
      Toggle

## Pseudo buttons

Note: added in Picnic 3.1

Allows for seemingly links to behave as buttons:

<button class="pseudo">Button</button>
Link

<input type="checkbox">
Toggle

    <button class="pseudo">Button</button>
    Link

        <input type="checkbox">
        Toggle

## Hack it

You only have to define a single color base for new colors. The `:hover` and `:active` status are handled as overlays for consistency and simplicity

<button class="myCoolButton">
    My Cool Button
</button>

    .myCoolButton {
        background: #85144b;
    }

    <button class="myCoolButton">
        My Cool Button
    </button>

To create a larger button you only need to make the font inside it larger. The paddings are set in *em* so the whole button stays in great shape:

<button class="mainButton">
    Large button
</button>
<button>
    Normal button
</button>
<button class="shyButton">
    Small button
</button>

    .mainButton {
        font-size: 1.5em;
    }
    .shyButton {
        font-size: .75em;
    }

    <button class="mainButton">
        Large button
    </button>
    <button class="shyButton">
        Small button
    </button>

To change the color of the pseudo-color on hover:

<button class="pseudo pseudoCool">
    Pseudo personal
</button>

    .pseudoCool:hover,
    .pseudoCool:active,
    .pseudoCool:focus {
        background: #cff;
    }

    <button class="pseudo pseudoCool">
        Pseudo personal
    </button>


text:
<?php

final class PhabricatorDashboardListController
  extends PhabricatorDashboardController
  implements PhabricatorApplicationSearchResultsControllerInterface {

  private $queryKey;
  public function willProcessRequest(array $data) {
    $this->queryKey = idx($data, 'queryKey');
  }

  public function processRequest() {
    $request = $this->getRequest();
    $controller = id(new PhabricatorApplicationSearchController($request))
      ->setQueryKey($this->queryKey)
      ->setSearchEngine(new PhabricatorDashboardSearchEngine())
      ->setNavigation($this->buildSideNavView());
    return $this->delegateToController($controller);
  }

  public function buildSideNavView() {
    $user = $this->getRequest()->getUser();

    $nav = new AphrontSideNavFilterView();
    $nav->setBaseURI(new PhutilURI($this->getApplicationURI()));

    id(new PhabricatorDashboardSearchEngine())
      ->setViewer($user)
      ->addNavigationItems($nav->getMenu());

    $nav->addLabel(pht('Panels'));
    $nav->addFilter('panel/', pht('Manage Panels'));

    $nav->selectFilter(null);

    return $nav;
  }

  public function buildApplicationCrumbs() {
    $crumbs = parent::buildApplicationCrumbs();

    $crumbs->addAction(
      id(new PHUIListItemView())
        ->setIcon('create')
        ->setName(pht('Create Dashboard'))
        ->setHref($this->getApplicationURI().'create/'));

    return $crumbs;
  }

  public function renderResultsList(
    array $dashboards,
    PhabricatorSavedQuery $query) {
    $viewer = $this->getRequest()->getUser();

    $list = new PHUIObjectItemListView();
    $list->setUser($viewer);
    foreach ($dashboards as $dashboard) {
      $id = $dashboard->getID();

      $item = id(new PHUIObjectItemView())
        ->setObjectName(pht('Dashboard %d', $id))
        ->setHeader($dashboard->getName())
        ->setHref($this->getApplicationURI("view/{$id}/"))
        ->setObject($dashboard);

      $list->addItem($item);
    }

    return $list;
  }

}


text:
var expect = require('chai').expect;
var robot = require('../../robot');

describe('Robot', function(){

	describe('method', function(){

		it('constructor is a function', function(){
			expect(robot.method).be.a.function;
		});

		it('options number is 8', function(){
			expect(robot.method.all).to.be.lengthOf(8);
		});
	});
});


text:
<button ng-click="collapse(data)" ng-show="(data.nodes.length > 0)&&(data.expanded)">-</button>
<button ng-click="expand(data)" ng-show="(data.nodes.length > 0)&&(!data.expanded)">+</button>

{{data.name}}

</script>


text:
title: Call for Application MEU Iasi 2018
excerpt: Apply for 2nd edition of MEU Iasi!
link: 'http://asd-uaic.ro/reminder-call-application-meu-iasi-2018/'
categories: network
tags:
  - meu-iasi
  - modeleu
  - iasi
date: '2017-12-27 12:35:38'
comments: false
share: true
published: true
edit: true
---
Applications for MEU Iasi 2018 are now open. Apply until 15th January 2018 and secure your participation!


text:
package org.dasein.cloud.admin;

import java.util.Locale;

import javax.annotation.Nonnull;

import org.dasein.cloud.Capabilities;
import org.dasein.cloud.CloudException;
import org.dasein.cloud.InternalException;
import org.dasein.cloud.Requirement;

/**
 * Describes the capabilities for accounts and account hierarchies within a
 * cloud.
 *
 * @author David R Young (david.young@centurylink.com)
 */
public interface AccountCapabilities extends Capabilities {

    /**
     * Indicates whether or not sub accounts can be created for this cloud using
     * a {@link AccountSupport#create(Account)} call.
     *
     * @return true if sub accounts can be created, false if otherwise
     * @throws CloudException
     *             the cloud provider encountered an error while processing the
     *             request
     * @throws InternalException
     *             a Dasein Cloud error occurred while processing the request
     */
    public boolean canCreate() throws InternalException, CloudException;

    /**
     * Indicates whether or not the cloud allows the input of a user-defined
     * account identifier to be used during the account creation process.
     * {@link org.dasein.cloud.Requirement#REQUIRED} means that an account id
     * must be created by the caller and supplied;
     * {@link org.dasein.cloud.Requirement#OPTIONAL} means that it may or may
     * not be provided; {@link org.dasein.cloud.Requirement#NONE} means that no
     * account id may be provided.
     *
     * @return the requirement associated with a supplied user-defined account
     *         identifier
     * @throws org.dasein.cloud.InternalException
     *             an error occurred within the Dasein Cloud implementation
     * @throws org.dasein.cloud.CloudException
     *             an error occurred with the cloud provide
     */
    public @Nonnull
    Requirement identifyAccountIdRequirement() throws InternalException, CloudException;

    /**
     * Indicates whether or not sub accounts can be deleted for this cloud using
     * a {@link AccountSupport#delete(String)} call.
     *
     * @return true if sub accounts can be deleted, false if otherwise
     * @throws CloudException
     *             the cloud provider encountered an error while processing the
     *             request
     * @throws InternalException
     *             a Dasein Cloud error occurred while processing the request
     */
    public boolean canDelete() throws InternalException, CloudException;

    /**
     * Indicates whether or not details on an account can be updated for this
     * cloud using an {@link AccountSupport#update(Account)} call.
     *
     * @return true if account details can be updated, false if otherwise
     * @throws InternalException
     *             an error occurred within the Dasein Cloud API implementation
     * @throws CloudException
     *             an error occurred within the cloud provider
     */
    public boolean canUpdate() throws InternalException, CloudException;

    /**
     * Indicates whether or not an account in the specified state can be the
     * target of an {@link AccountSupport#enable(String)} call.
     *
     * @param fromState
     *            the state in which the theoretical account exists
     * @return true if an account can be enabled, false if otherwise
     * @throws InternalException
     *             an error occurred within the Dasein Cloud API implementation
     * @throws CloudException
     *             an error occurred within the cloud provider
     */
    public boolean canEnable(AccountState fromState) throws InternalException, CloudException;

    /**
     * Indicates whether or not an account in the specified state can be the
     * target of an {@link AccountSupport#suspend(String)} call.
     *
     * @param fromState
     *            the state in which the theoretical account exists
     * @return true if an account can be suspended, false if otherwise
     * @throws InternalException
     *             an error occurred within the Dasein Cloud API implementation
     * @throws CloudException
     *             an error occurred within the cloud provider
     */
    public boolean canSuspend(AccountState fromState) throws InternalException, CloudException;

    /**
     * Assists UIs by providing the cloud-specific term for an account in the
     * cloud.
     *
     * @param locale
     *            the locale for which the term should be translated
     * @return the provider-specific term for an account
     */
    public @Nonnull
    String getProviderTermForAccount(Locale locale);
}


text:
package api_test

import (
	"math/rand"
	"reflect"
	"sort"
	"testing"

	fuzz "github.com/google/gofuzz"

	apiv1 "k8s.io/api/core/v1"
	extensionsv1beta1 "k8s.io/api/extensions/v1beta1"
	roundtrip "k8s.io/apimachinery/pkg/api/testing/roundtrip"
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
	"k8s.io/apimachinery/pkg/runtime"
	"k8s.io/apimachinery/pkg/runtime/schema"
	"k8s.io/apimachinery/pkg/util/diff"
	"k8s.io/kubernetes/pkg/api"
)

type orderedGroupVersionKinds []schema.GroupVersionKind

func (o orderedGroupVersionKinds) Len() int      { return len(o) }
func (o orderedGroupVersionKinds) Swap(i, j int) { o[i], o[j] = o[j], o[i] }
func (o orderedGroupVersionKinds) Less(i, j int) bool {
	return o[i].String() < o[j].String()
}

// TODO: add a reflexive test that verifies that all SetDefaults functions are registered
func TestDefaulting(t *testing.T) {
	// these are the known types with defaulters - you must add to this list if you add a top level defaulter
	typesWithDefaulting := map[schema.GroupVersionKind]struct{}{
		{Group: "", Version: "v1", Kind: "ConfigMap"}:                                             {},
		{Group: "", Version: "v1", Kind: "ConfigMapList"}:                                         {},
		{Group: "", Version: "v1", Kind: "Endpoints"}:                                             {},
		{Group: "", Version: "v1", Kind: "EndpointsList"}:                                         {},
		{Group: "", Version: "v1", Kind: "Namespace"}:                                             {},
		{Group: "", Version: "v1", Kind: "NamespaceList"}:                                         {},
		{Group: "", Version: "v1", Kind: "Node"}:                                                  {},
		{Group: "", Version: "v1", Kind: "NodeList"}:                                              {},
		{Group: "", Version: "v1", Kind: "PersistentVolume"}:                                      {},
		{Group: "", Version: "v1", Kind: "PersistentVolumeList"}:                                  {},
		{Group: "", Version: "v1", Kind: "PersistentVolumeClaim"}:                                 {},
		{Group: "", Version: "v1", Kind: "PersistentVolumeClaimList"}:                             {},
		{Group: "", Version: "v1", Kind: "PodAttachOptions"}:                                      {},
		{Group: "", Version: "v1", Kind: "PodExecOptions"}:                                        {},
		{Group: "", Version: "v1", Kind: "Pod"}:                                                   {},
		{Group: "", Version: "v1", Kind: "PodList"}:                                               {},
		{Group: "", Version: "v1", Kind: "PodTemplate"}:                                           {},
		{Group: "", Version: "v1", Kind: "PodTemplateList"}:                                       {},
		{Group: "", Version: "v1", Kind: "ReplicationController"}:                                 {},
		{Group: "", Version: "v1", Kind: "ReplicationControllerList"}:                             {},
		{Group: "", Version: "v1", Kind: "Secret"}:                                                {},
		{Group: "", Version: "v1", Kind: "SecretList"}:                                            {},
		{Group: "", Version: "v1", Kind: "Service"}:                                               {},
		{Group: "", Version: "v1", Kind: "ServiceList"}:                                           {},
		{Group: "apps", Version: "v1beta1", Kind: "StatefulSet"}:                                  {},
		{Group: "apps", Version: "v1beta1", Kind: "StatefulSetList"}:                              {},
		{Group: "apps", Version: "v1beta2", Kind: "StatefulSet"}:                                  {},
		{Group: "apps", Version: "v1beta2", Kind: "StatefulSetList"}:                              {},
		{Group: "autoscaling", Version: "v1", Kind: "HorizontalPodAutoscaler"}:                    {},
		{Group: "autoscaling", Version: "v1", Kind: "HorizontalPodAutoscalerList"}:                {},
		{Group: "autoscaling", Version: "v2beta1", Kind: "HorizontalPodAutoscaler"}:               {},
		{Group: "autoscaling", Version: "v2beta1", Kind: "HorizontalPodAutoscalerList"}:           {},
		{Group: "batch", Version: "v1", Kind: "Job"}:                                              {},
		{Group: "batch", Version: "v1", Kind: "JobList"}:                                          {},
		{Group: "batch", Version: "v1beta1", Kind: "CronJob"}:                                     {},
		{Group: "batch", Version: "v1beta1", Kind: "CronJobList"}:                                 {},
		{Group: "batch", Version: "v1beta1", Kind: "JobTemplate"}:                                 {},
		{Group: "batch", Version: "v2alpha1", Kind: "CronJob"}:                                    {},
		{Group: "batch", Version: "v2alpha1", Kind: "CronJobList"}:                                {},
		{Group: "batch", Version: "v2alpha1", Kind: "JobTemplate"}:                                {},
		{Group: "certificates.k8s.io", Version: "v1beta1", Kind: "CertificateSigningRequest"}:     {},
		{Group: "certificates.k8s.io", Version: "v1beta1", Kind: "CertificateSigningRequestList"}: {},
		{Group: "componentconfig", Version: "v1alpha1", Kind: "KubeProxyConfiguration"}:           {},
		{Group: "componentconfig", Version: "v1alpha1", Kind: "KubeSchedulerConfiguration"}:       {},
		{Group: "componentconfig", Version: "v1alpha1", Kind: "KubeletConfiguration"}:             {},
		{Group: "kubeadm.k8s.io", Version: "v1alpha1", Kind: "MasterConfiguration"}:               {},
		// This object contains only int fields which currently breaks the defaulting test because
		// it's pretty stupid. Once we add non integer fields, we should uncomment this.
		// {Group: "kubeadm.k8s.io", Version: "v1alpha1", Kind: "NodeConfiguration"}:                 {},
		{Group: "extensions", Version: "v1beta1", Kind: "DaemonSet"}:                                                 {},
		{Group: "extensions", Version: "v1beta1", Kind: "DaemonSetList"}:                                             {},
		{Group: "apps", Version: "v1beta2", Kind: "DaemonSet"}:                                                       {},
		{Group: "apps", Version: "v1beta2", Kind: "DaemonSetList"}:                                                   {},
		{Group: "extensions", Version: "v1beta1", Kind: "Deployment"}:                                                {},
		{Group: "extensions", Version: "v1beta1", Kind: "DeploymentList"}:                                            {},
		{Group: "apps", Version: "v1beta1", Kind: "Deployment"}:                                                      {},
		{Group: "apps", Version: "v1beta1", Kind: "DeploymentList"}:                                                  {},
		{Group: "apps", Version: "v1beta2", Kind: "Deployment"}:                                                      {},
		{Group: "apps", Version: "v1beta2", Kind: "DeploymentList"}:                                                  {},
		{Group: "apps", Version: "v1beta2", Kind: "ReplicaSet"}:                                                      {},
		{Group: "apps", Version: "v1beta2", Kind: "ReplicaSetList"}:                                                  {},
		{Group: "extensions", Version: "v1beta1", Kind: "ReplicaSet"}:                                                {},
		{Group: "extensions", Version: "v1beta1", Kind: "ReplicaSetList"}:                                            {},
		{Group: "extensions", Version: "v1beta1", Kind: "NetworkPolicy"}:                                             {},
		{Group: "extensions", Version: "v1beta1", Kind: "NetworkPolicyList"}:                                         {},
		{Group: "rbac.authorization.k8s.io", Version: "v1alpha1", Kind: "ClusterRoleBinding"}:                        {},
		{Group: "rbac.authorization.k8s.io", Version: "v1alpha1", Kind: "ClusterRoleBindingList"}:                    {},
		{Group: "rbac.authorization.k8s.io", Version: "v1alpha1", Kind: "RoleBinding"}:                               {},
		{Group: "rbac.authorization.k8s.io", Version: "v1alpha1", Kind: "RoleBindingList"}:                           {},
		{Group: "rbac.authorization.k8s.io", Version: "v1beta1", Kind: "ClusterRoleBinding"}:                         {},
		{Group: "rbac.authorization.k8s.io", Version: "v1beta1", Kind: "ClusterRoleBindingList"}:                     {},
		{Group: "rbac.authorization.k8s.io", Version: "v1beta1", Kind: "RoleBinding"}:                                {},
		{Group: "rbac.authorization.k8s.io", Version: "v1beta1", Kind: "RoleBindingList"}:                            {},
		{Group: "rbac.authorization.k8s.io", Version: "v1", Kind: "ClusterRoleBinding"}:                              {},
		{Group: "rbac.authorization.k8s.io", Version: "v1", Kind: "ClusterRoleBindingList"}:                          {},
		{Group: "rbac.authorization.k8s.io", Version: "v1", Kind: "RoleBinding"}:                                     {},
		{Group: "rbac.authorization.k8s.io", Version: "v1", Kind: "RoleBindingList"}:                                 {},
		{Group: "settings.k8s.io", Version: "v1alpha1", Kind: "PodPreset"}:                                           {},
		{Group: "settings.k8s.io", Version: "v1alpha1", Kind: "PodPresetList"}:                                       {},
		{Group: "admissionregistration.k8s.io", Version: "v1alpha1", Kind: "ExternalAdmissionHookConfiguration"}:     {},
		{Group: "admissionregistration.k8s.io", Version: "v1alpha1", Kind: "ExternalAdmissionHookConfigurationList"}: {},
		{Group: "networking.k8s.io", Version: "v1", Kind: "NetworkPolicy"}:                                           {},
		{Group: "networking.k8s.io", Version: "v1", Kind: "NetworkPolicyList"}:                                       {},
		{Group: "storage.k8s.io", Version: "v1beta1", Kind: "StorageClass"}:                                          {},
		{Group: "storage.k8s.io", Version: "v1beta1", Kind: "StorageClassList"}:                                      {},
		{Group: "storage.k8s.io", Version: "v1", Kind: "StorageClass"}:                                               {},
		{Group: "storage.k8s.io", Version: "v1", Kind: "StorageClassList"}:                                           {},
	}

	f := fuzz.New().NilChance(.5).NumElements(1, 1).RandSource(rand.NewSource(1))
	f.Funcs(
		func(s *runtime.RawExtension, c fuzz.Continue) {},
		func(s *metav1.LabelSelector, c fuzz.Continue) {
			c.FuzzNoCustom(s)
			s.MatchExpressions = nil // need to fuzz this specially
		},
		func(s *apiv1.ListOptions, c fuzz.Continue) {
			c.FuzzNoCustom(s)
			s.LabelSelector = "" // need to fuzz requirement strings specially
			s.FieldSelector = "" // need to fuzz requirement strings specially
		},
		func(s *extensionsv1beta1.ScaleStatus, c fuzz.Continue) {
			c.FuzzNoCustom(s)
			s.TargetSelector = "" // need to fuzz requirement strings specially
		},
	)

	scheme := api.Scheme
	var testTypes orderedGroupVersionKinds
	for gvk := range scheme.AllKnownTypes() {
		if gvk.Version == runtime.APIVersionInternal {
			continue
		}
		testTypes = append(testTypes, gvk)
	}
	sort.Sort(testTypes)

	for _, gvk := range testTypes {
		_, expectedChanged := typesWithDefaulting[gvk]
		iter := 0
		changedOnce := false
		for {
			if iter > *roundtrip.FuzzIters {
				if !expectedChanged || changedOnce {
					break
				}
				if iter > 300 {
					t.Errorf("expected %s to trigger defaulting due to fuzzing", gvk)
					break
				}
				// if we expected defaulting, continue looping until the fuzzer gives us one
				// at worst, we will timeout
			}
			iter++

			src, err := scheme.New(gvk)
			if err != nil {
				t.Fatal(err)
			}
			f.Fuzz(src)

			src.GetObjectKind().SetGroupVersionKind(schema.GroupVersionKind{})

			original := src.DeepCopyObject()

			// get internal
			withDefaults := src.DeepCopyObject()
			scheme.Default(withDefaults.(runtime.Object))

			if !reflect.DeepEqual(original, withDefaults) {
				changedOnce = true
				if !expectedChanged {
					t.Errorf("{Group: \"%s\", Version: \"%s\", Kind: \"%s\"} did not expect defaults to be set - update expected or check defaulter registering: %s", gvk.Group, gvk.Version, gvk.Kind, diff.ObjectReflectDiff(original, withDefaults))
				}
			}
		}
	}
}

func BenchmarkPodDefaulting(b *testing.B) {
	f := fuzz.New().NilChance(.5).NumElements(1, 1).RandSource(rand.NewSource(1))
	items := make([]apiv1.Pod, 100)
	for i := range items {
		f.Fuzz(&items[i])
	}

	scheme := api.Scheme
	b.ResetTimer()
	for i := 0; i < b.N; i++ {
		pod := &items[i%len(items)]

		scheme.Default(pod)
	}
	b.StopTimer()
}


text:
import unittest
from blog_test_case import BlogTestCase
from parser.news_parser import NewsParser, SchwedtParser
import time
import datetime
import urllib2

class TestSchwedt(BlogTestCase):

    def test_article_urls_parsing(self):
        schwedt_parser = SchwedtParser()
        page = urllib2.urlopen(SchwedtParser.ARTICLES_URL + "1", timeout=NewsParser.TIMEOUT).read()
        self.assertEqual(len(schwedt_parser.parse_initial_articles(page)), 4)

    def test_url_parsing_with_text(self):
        article = SchwedtParser.parse_article_from_article_url("http://gewichtheben.blauweiss65-schwedt.de/?p=7312")
        self.assertEqual(article["url"], "http://gewichtheben.blauweiss65-schwedt.de/?p=7312")
        self.assertEqual(article["heading"], "39. Treffen zwischen den Jugendauswahlmannschaften der Region Csongrad (Ungarn) und des Landes Brandenburg")
        self.assertEqual(article["date"], str(time.mktime(datetime.date(2016, 6, 24).timetuple())))
        self.assertEqual(article["image"], "http://gewichtheben.blauweiss65-schwedt.de/wp-content/uploads/2016/06/Mannschaft-des-BGFV-300x225.jpg")
        self.assert_starts_with("Die Abteilung Gewichtheben des TSV Blau-Weiß 65 Schwedt bildete bei der 39. Auflage dieses Vergleiches mit", article["content"])
        self.assert_ends_with("der Gewichtheber des TSV Blau-Weiß 65 Schwedt.\nR. Taubert", article["content"])

    def test_url_parsing_without_text(self):
        article = SchwedtParser.parse_article_from_article_url("http://gewichtheben.blauweiss65-schwedt.de/?p=7195")
        self.assertEqual(article["url"], "http://gewichtheben.blauweiss65-schwedt.de/?p=7195")
        self.assertEqual(article["heading"], "Bundesliga OST Gewichtheber vs. TSC Berlin")
        self.assertEqual(article["date"], str(time.mktime(datetime.date(2016, 2, 23).timetuple())))
        self.assertEqual(article["image"], "http://gewichtheben.blauweiss65-schwedt.de/wp-content/uploads/2016/02/Plakat-05_03_2016-212x300.jpg")
        self.assert_starts_with(article["content"], "")

if __name__ == '__main__':
    unittest.main()


text:
Super Resume World ( My resume is a video game)
-------------------------------------------------------------------------------

Play as Tux.
- collect linux coins
- avoid infected windoze computers
- collect 20,000 points and my resume will apear.

Instructions
- use the arrow keys to move left and right
- press x to jump
- jump on an enemy to detroy them
- follow to the end of screen to go to the next level

Using MelonJS javascript game library.
produced the music track ( it was a quick edit. I can do way better haha)

-------------------------------------------------------------------------------
feel Free to play the game. And if you are hiring feel free to send me a message


text:
<component name="ArtifactManager">
  <artifact type="exploded-ear" name="GUI:ear exploded">
    <output-path>$PROJECT_DIR$/out/artifacts/GUI_ear_exploded</output-path>
    <root id="root">
      <element id="javaee-facet-resources" facet="GUI/javaeeApplication/javaEEApplication" />
    </root>
  </artifact>
</component>


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

import java.io.IOException;
import java.io.OutputStream;
import java.security.AccessController;
import java.security.PrivilegedAction;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;

import com.sun.org.apache.xml.internal.security.c14n.CanonicalizationException;
import com.sun.org.apache.xml.internal.security.c14n.Canonicalizer;
import com.sun.org.apache.xml.internal.security.c14n.InvalidCanonicalizerException;
import org.w3c.dom.Attr;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.w3c.dom.Text;

/**
 * DOM and XML accessibility and comfort functions.
 *
 * @author Christian Geuer-Pollmann
 */
public class XMLUtils {

   private static boolean ignoreLineBreaks =
      AccessController.doPrivileged(new PrivilegedAction<Boolean>() {
         public Boolean run() {
            return Boolean.getBoolean
               ("com.sun.org.apache.xml.internal.security.ignoreLineBreaks");
         }
      });

   /**
    * Constructor XMLUtils
    *
    */
   private XMLUtils() {

      // we don't allow instantiation
   }
   public static Element getNextElement(Node el) {
           while ((el!=null) && (el.getNodeType()!=Node.ELEMENT_NODE)) {
                   el=el.getNextSibling();
           }
           return (Element)el;

   }

   /**
    * @param rootNode
    * @param result
    * @param exclude
    * @param com wheather comments or not
    */
   public static void getSet(Node rootNode,Set result,Node exclude ,boolean com) {
          if ((exclude!=null) && isDescendantOrSelf(exclude,rootNode)){
                return;
      }
      getSetRec(rootNode,result,exclude,com);
   }
   static final void getSetRec(final Node rootNode,final Set result,
        final Node exclude ,final boolean com) {
           //Set result = new HashSet();
       if (rootNode==exclude) {
          return;
       }
           switch (rootNode.getNodeType()) {
                case Node.ELEMENT_NODE:
                                result.add(rootNode);
                        Element el=(Element)rootNode;
                if (el.hasAttributes()) {
                                NamedNodeMap nl = ((Element)rootNode).getAttributes();
                                for (int i=0;i<nl.getLength();i++) {
                                        result.add(nl.item(i));
                                }
                }
                //no return keep working
                case Node.DOCUMENT_NODE:
                                for (Node r=rootNode.getFirstChild();r!=null;r=r.getNextSibling()){
                                        if (r.getNodeType()==Node.TEXT_NODE) {
                                                result.add(r);
                                                while ((r!=null) && (r.getNodeType()==Node.TEXT_NODE)) {
                                                        r=r.getNextSibling();
                                                }
                                                if (r==null)
                                                        return;
                                        }
                                        getSetRec(r,result,exclude,com);
                                }
                                return;
                        case Node.COMMENT_NODE:
                                if (com) {
                                        result.add(rootNode);
                                }
                            return;
                        case Node.DOCUMENT_TYPE_NODE:
                                return;
                        default:
                                result.add(rootNode);
           }
           return;
   }

   /**
    * Outputs a DOM tree to an {@link OutputStream}.
    *
    * @param contextNode root node of the DOM tree
    * @param os the {@link OutputStream}
    */
   public static void outputDOM(Node contextNode, OutputStream os) {
      XMLUtils.outputDOM(contextNode, os, false);
   }

   /**
    * Outputs a DOM tree to an {@link OutputStream}. If an Exception is
    * thrown during execution, it's StackTrace is output to System.out, but the
    * Exception is not re-thrown.
    *
    * @param contextNode root node of the DOM tree
    * @param os the {@link OutputStream}
    * @param addPreamble
    */
   public static void outputDOM(Node contextNode, OutputStream os,
                                boolean addPreamble) {

      try {
         if (addPreamble) {
            os.write("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n".getBytes());
         }

         os.write(
            Canonicalizer.getInstance(
               Canonicalizer.ALGO_ID_C14N_WITH_COMMENTS).canonicalizeSubtree(
               contextNode));
      } catch (IOException ex) {}
      catch (InvalidCanonicalizerException ex) {
         ex.printStackTrace();
      } catch (CanonicalizationException ex) {
         ex.printStackTrace();
      }
   }

   /**
    * Serializes the contextNode into the OutputStream, but
    * supresses all Exceptions.
    *

    * NOTE: This should only be used for debugging purposes,
    * NOT in a production environment; this method ignores all exceptions,
    * so you won't notice if something goes wrong. If you're asking what is to
    * be used in a production environment, simply use the code inside the
    * try{} statement, but handle the Exceptions appropriately.
    *
    * @param contextNode
    * @param os
    */
   public static void outputDOMc14nWithComments(Node contextNode,
           OutputStream os) {

      try {
         os.write(
            Canonicalizer.getInstance(
               Canonicalizer.ALGO_ID_C14N_WITH_COMMENTS).canonicalizeSubtree(
               contextNode));
      } catch (IOException ex) {

         // throw new RuntimeException(ex.getMessage());
      } catch (InvalidCanonicalizerException ex) {

         // throw new RuntimeException(ex.getMessage());
      } catch (CanonicalizationException ex) {

         // throw new RuntimeException(ex.getMessage());
      }
   }

   /**
    * Method getFullTextChildrenFromElement
    *
    * @param element
    * @return the string of chi;ds
    */
   public static String getFullTextChildrenFromElement(Element element) {

      StringBuffer sb = new StringBuffer();
      NodeList children = element.getChildNodes();
      int iMax = children.getLength();

      for (int i = 0; i < iMax; i++) {
         Node curr = children.item(i);

         if (curr.getNodeType() == Node.TEXT_NODE) {
            sb.append(((Text) curr).getData());
         }
      }

      return sb.toString();
   }

   static  String dsPrefix=null;
   static Map namePrefixes=new HashMap();
   /**
    * Creates an Element in the XML Signature specification namespace.
    *
    * @param doc the factory Document
    * @param elementName the local name of the Element
    * @return the Element
    */
   public static Element createElementInSignatureSpace(Document doc,
           String elementName) {

      if (doc == null) {
         throw new RuntimeException("Document is null");
      }

      if ((dsPrefix == null) || (dsPrefix.length() == 0)) {
         return doc.createElementNS(Constants.SignatureSpecNS, elementName);
      }
      String namePrefix=(String) namePrefixes.get(elementName);
      if (namePrefix==null) {
          StringBuffer tag=new StringBuffer(dsPrefix);
          tag.append(':');
          tag.append(elementName);
          namePrefix=tag.toString();
          namePrefixes.put(elementName,namePrefix);
      }
      return doc.createElementNS(Constants.SignatureSpecNS, namePrefix);
   }

   /**
    * Returns true if the element is in XML Signature namespace and the local
    * name equals the supplied one.
    *
    * @param element
    * @param localName
    * @return true if the element is in XML Signature namespace and the local name equals the supplied one
    */
   public static boolean elementIsInSignatureSpace(Element element,
           String localName) {
      return ElementProxy.checker.isNamespaceElement(element, localName, Constants.SignatureSpecNS);
   }

   /**
    * Returns true if the element is in XML Encryption namespace and the local
    * name equals the supplied one.
    *
    * @param element
    * @param localName
    * @return true if the element is in XML Encryption namespace and the local name equals the supplied one
    */
   public static boolean elementIsInEncryptionSpace(Element element,
           String localName) {
           return ElementProxy.checker.isNamespaceElement(element, localName, EncryptionConstants.EncryptionSpecNS);
   }

   /**
    * This method returns the owner document of a particular node.
    * This method is necessary because it always returns a
    * {@link Document}. {@link Node#getOwnerDocument} returns null
    * if the {@link Node} is a {@link Document}.
    *
    * @param node
    * @return the owner document of the node
    */
   public static Document getOwnerDocument(Node node) {

      if (node.getNodeType() == Node.DOCUMENT_NODE) {
         return (Document) node;
      }
         try {
            return node.getOwnerDocument();
         } catch (NullPointerException npe) {
            throw new NullPointerException(I18n.translate("endorsed.jdk1.4.0")
                                           + " Original message was \""
                                           + npe.getMessage() + "\"");
         }

   }

    /**
     * This method returns the first non-null owner document of the Node's in this Set.
     * This method is necessary because it always returns a
     * {@link Document}. {@link Node#getOwnerDocument} returns null
     * if the {@link Node} is a {@link Document}.
     *
     * @param xpathNodeSet
     * @return the owner document
     */
    public static Document getOwnerDocument(Set xpathNodeSet) {
       NullPointerException npe = null;
       Iterator iterator = xpathNodeSet.iterator();
       while(iterator.hasNext()) {
           Node node = (Node) iterator.next();
           int nodeType =node.getNodeType();
           if (nodeType == Node.DOCUMENT_NODE) {
              return (Document) node;
           }
              try {
                 if (nodeType==Node.ATTRIBUTE_NODE) {
                    return ((Attr)node).getOwnerElement().getOwnerDocument();
                 }
                 return node.getOwnerDocument();
              } catch (NullPointerException e) {
                  npe = e;
              }

       }
       throw new NullPointerException(I18n.translate("endorsed.jdk1.4.0")
                                       + " Original message was \""
                                       + (npe == null ? "" : npe.getMessage()) + "\"");
    }

    /**
     * Method createDSctx
     *
     * @param doc
     * @param prefix
     * @param namespace
     * @return the element.
     */
    public static Element createDSctx(Document doc, String prefix,
                                      String namespace) {

       if ((prefix == null) || (prefix.trim().length() == 0)) {
          throw new IllegalArgumentException("You must supply a prefix");
       }

       Element ctx = doc.createElementNS(null, "namespaceContext");

       ctx.setAttributeNS(Constants.NamespaceSpecNS, "xmlns:" + prefix.trim(),
                          namespace);

       return ctx;
    }

   /**
    * Method addReturnToElement
    *
    * @param e
    */
   public static void addReturnToElement(Element e) {

      if (!ignoreLineBreaks) {
         Document doc = e.getOwnerDocument();
         e.appendChild(doc.createTextNode("\n"));
      }
   }

   public static void addReturnToElement(Document doc, HelperNodeList nl) {
      if (!ignoreLineBreaks) {
         nl.appendChild(doc.createTextNode("\n"));
      }
   }

   public static void addReturnBeforeChild(Element e, Node child) {
      if (!ignoreLineBreaks) {
         Document doc = e.getOwnerDocument();
         e.insertBefore(doc.createTextNode("\n"), child);
      }
   }

   /**
    * Method convertNodelistToSet
    *
    * @param xpathNodeSet
    * @return the set with the nodelist
    */
   public static Set convertNodelistToSet(NodeList xpathNodeSet) {

      if (xpathNodeSet == null) {
         return new HashSet();
      }

      int length = xpathNodeSet.getLength();
      Set set = new HashSet(length);

      for (int i = 0; i < length; i++) {
         set.add(xpathNodeSet.item(i));
      }

      return set;
   }

   /**
    * This method spreads all namespace attributes in a DOM document to their
    * children. This is needed because the XML Signature XPath transform
    * must evaluate the XPath against all nodes in the input, even against
    * XPath namespace nodes. Through a bug in XalanJ2, the namespace nodes are
    * not fully visible in the Xalan XPath model, so we have to do this by
    * hand in DOM spaces so that the nodes become visible in XPath space.
    *
    * @param doc
    * @see Namespace axis resolution is not XPath compliant
    */
   public static void circumventBug2650(Document doc) {

      Element documentElement = doc.getDocumentElement();

      // if the document element has no xmlns definition, we add xmlns=""
      Attr xmlnsAttr =
         documentElement.getAttributeNodeNS(Constants.NamespaceSpecNS, "xmlns");

      if (xmlnsAttr == null) {
         documentElement.setAttributeNS(Constants.NamespaceSpecNS, "xmlns", "");
      }

      XMLUtils.circumventBug2650internal(doc);
   }

   /**
    * This is the work horse for {@link #circumventBug2650}.
    *
    * @param node
    * @see Namespace axis resolution is not XPath compliant
    */
   private static void circumventBug2650internal(Node node) {
           Node parent=null;
           Node sibling=null;
           final String namespaceNs=Constants.NamespaceSpecNS;
           do {
         switch (node.getNodeType()) {
         case Node.ELEMENT_NODE :
                 Element element = (Element) node;
             if (!element.hasChildNodes())
                 break;
             if (element.hasAttributes()) {
             NamedNodeMap attributes = element.getAttributes();
             int attributesLength = attributes.getLength();

             for (Node child = element.getFirstChild(); child!=null;
                child=child.getNextSibling()) {

                if (child.getNodeType() != Node.ELEMENT_NODE) {
                        continue;
                }
                Element childElement = (Element) child;

                for (int i = 0; i < attributesLength; i++) {
                        Attr currentAttr = (Attr) attributes.item(i);
                        if (namespaceNs!=currentAttr.getNamespaceURI())
                                continue;
                        if (childElement.hasAttributeNS(namespaceNs,
                                                        currentAttr.getLocalName())) {
                                        continue;
                        }
                        childElement.setAttributeNS(namespaceNs,
                                                currentAttr.getName(),
                                                currentAttr.getNodeValue());

                }
             }
             }
         case Node.ENTITY_REFERENCE_NODE :
         case Node.DOCUMENT_NODE :
                 parent=node;
                 sibling=node.getFirstChild();
             break;
         }
         while ((sibling==null) && (parent!=null)) {
                         sibling=parent.getNextSibling();
                         parent=parent.getParentNode();
                 };
       if (sibling==null) {
                         return;
                 }

         node=sibling;
         sibling=node.getNextSibling();
           } while (true);
   }

   /**
    * @param sibling
    * @param nodeName
    * @param number
    * @return nodes with the constrain
    */
   public static Element selectDsNode(Node sibling, String nodeName, int number) {
        while (sibling!=null) {
                if (ElementProxy.checker.isNamespaceElement(sibling, nodeName, Constants.SignatureSpecNS )) {
                        if (number==0){
                                return (Element)sibling;
                        }
                        number--;
                }
                sibling=sibling.getNextSibling();
        }
        return null;
   }

   /**
    * @param sibling
    * @param nodeName
    * @param number
    * @return nodes with the constrain
    */

   public static Element selectXencNode(Node sibling, String nodeName, int number) {
        while (sibling!=null) {
                if (ElementProxy.checker.isNamespaceElement(sibling, nodeName, EncryptionConstants.EncryptionSpecNS )) {
                        if (number==0){
                                return (Element)sibling;
                        }
                        number--;
                }
                sibling=sibling.getNextSibling();
        }
        return null;
   }

   /**
    * @param sibling
    * @param nodeName
    * @param number
    * @return nodes with the constrain
    */
   public static Text selectDsNodeText(Node sibling, String nodeName, int number) {
            Node n=selectDsNode(sibling,nodeName,number);
        if (n==null) {
                return null;
        }
        n=n.getFirstChild();
        while (n!=null && n.getNodeType()!=Node.TEXT_NODE) {
                n=n.getNextSibling();
        }
        return (Text)n;
   }

   /**
    * @param sibling
    * @param uri
    * @param nodeName
    * @param number
    * @return nodes with the constrain
    */
   public static Text selectNodeText(Node sibling, String uri, String nodeName, int number) {
        Node n=selectNode(sibling,uri,nodeName,number);
    if (n==null) {
        return null;
    }
    n=n.getFirstChild();
    while (n!=null && n.getNodeType()!=Node.TEXT_NODE) {
        n=n.getNextSibling();
    }
    return (Text)n;
   }

   /**
    * @param sibling
    * @param uri
    * @param nodeName
    * @param number
    * @return nodes with the constrain
    */
   public static Element selectNode(Node sibling, String uri,String nodeName, int number) {
        while (sibling!=null) {
                if (ElementProxy.checker.isNamespaceElement(sibling, nodeName, uri)) {
                        if (number==0){
                                return (Element)sibling;
                        }
                        number--;
                }
                sibling=sibling.getNextSibling();
        }
        return null;
   }

   /**
    * @param sibling
    * @param nodeName
    * @return nodes with the constrain
    */
   public static Element[] selectDsNodes(Node sibling,String nodeName) {
     return selectNodes(sibling,Constants.SignatureSpecNS,nodeName);
   }
   /**
    * @param sibling
    * @param uri
    * @param nodeName
    * @return nodes with the constrain
    */
    public static Element[] selectNodes(Node sibling,String uri,String nodeName) {
        int size=20;
        Element[] a= new Element[size];
        int curr=0;
        //List list=new ArrayList();
        while (sibling!=null) {
                if (ElementProxy.checker.isNamespaceElement(sibling, nodeName, uri)) {
                        a[curr++]=(Element)sibling;
                        if (size<=curr) {
                                int cursize= size<<2;
                                Element []cp=new Element[cursize];
                                System.arraycopy(a,0,cp,0,size);
                                a=cp;
                                size=cursize;
                        }
                }
                sibling=sibling.getNextSibling();
        }
        Element []af=new Element[curr];
        System.arraycopy(a,0,af,0,curr);
        return af;
   }

   /**
    * @param signatureElement
    * @param inputSet
    * @return nodes with the constrain
    */
    public static Set excludeNodeFromSet(Node signatureElement, Set inputSet) {
          Set resultSet = new HashSet();
          Iterator iterator = inputSet.iterator();

          while (iterator.hasNext()) {
            Node inputNode = (Node) iterator.next();

            if (!XMLUtils
                    .isDescendantOrSelf(signatureElement, inputNode)) {
               resultSet.add(inputNode);
            }
         }
         return resultSet;
     }

   /**
    * Returns true if the descendantOrSelf is on the descendant-or-self axis
    * of the context node.
    *
    * @param ctx
    * @param descendantOrSelf
    * @return true if the node is descendant
    */
   static public boolean isDescendantOrSelf(Node ctx, Node descendantOrSelf) {

      if (ctx == descendantOrSelf) {
         return true;
      }

      Node parent = descendantOrSelf;

      while (true) {
         if (parent == null) {
            return false;
         }

         if (parent == ctx) {
            return true;
         }

         if (parent.getNodeType() == Node.ATTRIBUTE_NODE) {
            parent = ((Attr) parent).getOwnerElement();
         } else {
            parent = parent.getParentNode();
         }
      }
   }

    public static boolean ignoreLineBreaks() {
        return ignoreLineBreaks;
    }
}


text:
SYNONYM

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
null

#### Original name
Parmelia diademata Taylor

### Remarks
null


text:
package org.olat.presentation.course.wizard.create;

import org.olat.data.repository.RepositoryEntry;
import org.olat.lms.course.CourseFactory;
import org.olat.lms.course.ICourse;
import org.olat.lms.course.wizard.create.CourseCreationConfiguration;
import org.olat.lms.course.wizard.create.CourseCreationHelper;
import org.olat.lms.repository.RepositoryServiceImpl;
import org.olat.presentation.framework.core.UserRequest;
import org.olat.presentation.framework.core.components.form.flexible.FormItem;
import org.olat.presentation.framework.core.components.form.flexible.FormItemContainer;
import org.olat.presentation.framework.core.components.form.flexible.impl.Form;
import org.olat.presentation.framework.core.components.form.flexible.impl.FormEvent;
import org.olat.presentation.framework.core.components.form.flexible.impl.FormLayoutContainer;
import org.olat.presentation.framework.core.control.Controller;
import org.olat.presentation.framework.core.control.WindowControl;
import org.olat.presentation.framework.core.control.generic.wizard.BasicStep;
import org.olat.presentation.framework.core.control.generic.wizard.PrevNextFinishConfig;
import org.olat.presentation.framework.core.control.generic.wizard.StepFormBasicController;
import org.olat.presentation.framework.core.control.generic.wizard.StepFormController;
import org.olat.presentation.framework.core.control.generic.wizard.StepsEvent;
import org.olat.presentation.framework.core.control.generic.wizard.StepsRunContext;
import org.olat.presentation.framework.core.translator.PackageUtil;
import org.olat.presentation.framework.core.translator.Translator;
import org.olat.system.event.Event;

/**
 * Description:

 * Second step of course creation wizard:

 * - choose catalog path
 *

 *
 * @author Marcel Karras (toka@freebits.de)
 * @author Norbert Englisch (norbert.englisch@informatik.tu-chemnitz.de)
 * @author Sebastian Fritzsche (seb.fritzsche@googlemail.com)
 * @author skoeber
 */
class CcStep01 extends BasicStep {

    private final PrevNextFinishConfig prevNextConfig;
    private final RepositoryEntry repoEntry;
    private final CourseCreationConfiguration courseConfig;

    /**
     * Second step of the course creation wizard
     *
     * @param ureq
     * @param courseConfig
     * @param repoEntry
     */
    public CcStep01(final UserRequest ureq, final CourseCreationConfiguration courseConfig, final RepositoryEntry repoEntry) {
        super(ureq);
        this.repoEntry = repoEntry;
        this.courseConfig = courseConfig;

        setI18nTitleAndDescr("coursecreation.catalog.title", "coursecreation.catalog.description");
        setNextStep(new CcStep02(ureq, courseConfig));
        prevNextConfig = PrevNextFinishConfig.BACK_NEXT;
    }

    @Override
    public PrevNextFinishConfig getInitialPrevNextFinishConfig() {
        return prevNextConfig;
    }

    @Override
    public StepFormController getStepController(final UserRequest ureq, final WindowControl windowControl, final StepsRunContext stepsRunContext, final Form form) {
        final StepFormController stepP = new CcStep01Form(ureq, windowControl, form, stepsRunContext, null);
        return stepP;
    }

    public CourseCreationConfiguration getCourseConfig() {
        return courseConfig;
    }

    public RepositoryEntry getRepoEntry() {
        return repoEntry;
    }

    class CcStep01Form extends StepFormBasicController {

        private final Translator translator;
        private FormLayoutContainer fic;
        private CatalogInsertController cic;

        public CcStep01Form(final UserRequest ureq, final WindowControl wControl, final Form rootForm, final StepsRunContext runContext, final String customLayoutPageName) {
            super(ureq, wControl, rootForm, runContext, LAYOUT_VERTICAL, customLayoutPageName);
            translator = PackageUtil.createPackageTranslator(CourseCreationHelper.class, ureq.getLocale());
            super.setTranslator(translator);
            initForm(ureq);
        }

        @Override
        protected void formInnerEvent(final UserRequest ureq, final FormItem source, final FormEvent event) {
            super.formInnerEvent(ureq, source, event);
            if (source.getName().equals(Event.BACK_EVENT.getCommand())) {
                cic.init();
            } else {
                // save item
                finishWorkflowItem(ureq);
            }
        }

        @Override
        protected void doDispose() {
            // nothing to do here
        }

        @Override
        protected boolean validateFormLogic(final UserRequest ureq) {
            return true;
        }

        @Override
        protected void formOK(final UserRequest ureq) {
            fireEvent(ureq, StepsEvent.ACTIVATE_NEXT);
        }

        @Override
        protected void initForm(final FormItemContainer formLayout, final Controller listener, final UserRequest ureq) {
            fic = FormLayoutContainer.createCustomFormLayout("cc01", this.getTranslator(), this.velocity_root + "/CcStep01_form.html");
            formLayout.add(fic);

            // load course
            final ICourse course = CourseFactory.loadCourse(getRepoEntry().getOlatResource());

            // show catalog selection tree
            if (course != null) {
                cic = new CatalogInsertController(ureq, getWindowControl(), RepositoryServiceImpl.getInstance().lookupRepositoryEntry(course, false), getCourseConfig());
                cic.addControllerListener(this);
                fic.put("cc", cic.getInitialComponent());
            }
            cic.init();
        }

        public void finishWorkflowItem(final UserRequest ureq) {
            if (cic != null) {
                // close selection tree and remember selection
                getCourseConfig().setSelectedCatalogEntry(cic.getSelectedParent());
            }
        }

        public boolean isValid(final UserRequest ureq) {
            return validateFormLogic(ureq);
        }
    }
}


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

<title>XmlMimeType (Java Platform SE 8 )</title>
<meta name="date" content="2014-12-17">
<meta name="keywords" content="javax.xml.bind.annotation.XmlMimeType class">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Java™ Platform
Standard Ed. 8

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Field |

Required |

Optional

Detail:

Field |

Element

javax.xml.bind.annotation

Annotation Type XmlMimeType

@Retention(value=RUNTIME)
 @Target(value={FIELD,METHOD,PARAMETER})
public @interface XmlMimeType

Associates the MIME type that controls the XML representation of the property.

 This annotation is used in conjunction with datatypes such as
 Image or Source that are bound to base64-encoded binary in XML.

 If a property that has this annotation has a sibling property bound to
 the xmime:contentType attribute, and if in the instance the property has a value,
 the value of the attribute takes precedence and that will control the marshalling.

Since:

JAXB2.0

Required Element Summary

Required Elements

Modifier and Type
Required Element and Description

String
value

The textual representation of the MIME type,
 such as "image/jpeg" "image/*", "text/xml; charset=iso-8859-1" and so on.

Element Detail

value

public abstract String value

The textual representation of the MIME type,
 such as "image/jpeg" "image/*", "text/xml; charset=iso-8859-1" and so on.

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Java™ Platform
Standard Ed. 8

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Field |

Required |

Optional

Detail:

Field |

Element

 Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
 Copyright © 1993, 2015, Oracle and/or its affiliates.  All rights reserved.


text:
from typing import Any
from typing import Callable
from typing import Dict
from typing import List

# third party
import pytest

# syft absolute
from syft import deserialize
from syft import serialize
from syft.core.io.address import Address

# from syft.core.node.common.node_service.dataset_manager.dataset_manager_messages import (
#     GetDatasetsResponse,
# )
from syft.core.node.common.node_service.dataset_manager.dataset_manager_messages import (
    CreateDatasetMessage,
)
from syft.core.node.common.node_service.dataset_manager.dataset_manager_messages import (
    DeleteDatasetMessage,
)
from syft.core.node.common.node_service.dataset_manager.dataset_manager_messages import (
    GetDatasetMessage,
)
from syft.core.node.common.node_service.dataset_manager.dataset_manager_messages import (
    GetDatasetResponse,
)
from syft.core.node.common.node_service.dataset_manager.dataset_manager_messages import (
    GetDatasetsMessage,
)
from syft.core.node.common.node_service.dataset_manager.dataset_manager_messages import (
    UpdateDatasetMessage,
)

metadata = {"name": "Dataset", "fields": "age, height, weight"}

test_suite = [
    (
        CreateDatasetMessage,
        {
            "address": Address(),
            "dataset": b"MyBinaryDataset",
            "reply_to": Address(),
            "platform": "syft",
            "metadata": metadata,
        },
        ["address", "dataset", "reply_to", "metadata"],
    ),
    (
        GetDatasetMessage,
        {"address": Address(), "dataset_id": 3, "reply_to": Address()},
        ["address", "dataset_id", "reply_to"],
    ),
    (
        GetDatasetResponse,
        {"address": Address(), "metadata": metadata},
        ["address", "metadata"],
    ),
    (
        GetDatasetsMessage,
        {"address": Address(), "reply_to": Address()},
        ["address", "reply_to"],
    ),
    # (
    #     GetDatasetsResponse,
    #     {
    #         "address": Address(),
    #         "metadatas": [metadata, metadata, metadata],
    #     },
    #     ["address", "metadatas"],
    # ),
    (
        UpdateDatasetMessage,
        {
            "address": Address(),
            "dataset_id": 3,
            "metadata": metadata,
            "reply_to": Address(),
        },
        ["address", "dataset_id", "metadata", "reply_to"],
    ),
    (
        DeleteDatasetMessage,
        {
            "address": Address(),
            "dataset_id": "8f2c411b-fcb7-4059-a0ee-aa370ed03e0c",
            "reply_to": Address(),
        },
        ["address", "dataset_id", "reply_to"],
    ),
]

@pytest.mark.parametrize("msg_constructor, kwargs, test_fields", test_suite)
def test_create(
    msg_constructor: Callable, kwargs: Dict[str, Any], test_fields: List[str]
) -> None:
    msg = msg_constructor(**kwargs)
    regenerated_message = deserialize(serialize(msg))

    for field in test_fields:
        assert getattr(msg, field) == getattr(regenerated_message, field)


text:
package org.apache.camel.openapi.model;

public class XOfFormB implements OneOfForm {
    String code = "b-456";

    int x;
    String y;

    public String getCode() {
        return this.code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public int getX() {
        return this.x;
    }

    public void setX(int x) {
        this.x = x;
    }

    public String getY() {
        return this.y;
    }

    public void setY(String y) {
        this.y = y;
    }

}


text:
layout: post
title: "Takeaways from a Spontaneous Trip to NYC"
date: 2012-12-18 00:46
comments: true
categories:
---

{% img /images/real/private-jet.jpg %}

### The Context

A little more than a week ago, I reached out to a local entrepreneur and Duke alumnus for some feedback on
business ideas and general advice. In response, he invited me and my two friends to fly with him and
his wife (also an entrepreneur and Duke alumnus) to NYC for the weekend. In spite of the fact that finals
were just around the corner and we had a lot of work to do, we agreed to go with little hesitation. We
couldn't pass up the opportunity to chat intimately with two phenomenal entrepreneurs!

My [hometown](http://en.wikipedia.org/wiki/Sneads_Ferry,_North_Carolina)
has around 2,500 residents. Durham isn't really a big city, and I spend most of my
time isolated on campus. Even though I visited New York when I was (much) younger, I forgot a
lot of the details and didn't understand certain things back then anyways. Needless to say, while we were
hanging out in The Big Apple, I noticed a few things.

### New York is Big

This one is obvious. I knew this before our visit. But it didn't really hit me until I saw the height of
the buildlings, the amount of traffic, and the sheer number of people with my own eyes.

{% codeblock lang:java %}
String appropriate_adjective = "";
for (int i=0; i < Integer.MAX_VALUE; i++) {
	appropriate_adjective += "very ";
}
System.out.println("This city is " + appropriate_adjective + "big!");
{% endcodeblock %}

There are so many people in New York, that traffic laws are pretty much unenforceable. Pedestrians
completely dominate any vehicles, and people continue walking long after the lights change to
"don't walk." At one time, we were walking around time square in the middle of the road (my two
friends and I). there wasn't a single car in sight. Aloud, I wondered why they
had closed down the road. They hadn't; the cars just ***could not*** get through.

### Southern Hospitality is a Myth

Or at the very least, it isn't a rule. During our stay, I
found that everyone we interacted with would go out of their way to be polite. We crashed at a
friend's apartment for free. We had no
problem asking for directions, people held doors for us, strangers were open to casual
conversation, waiters and clerks would chat with us, and people said "excuse me," if we bumped
into each other on the street.

Now, I'm sure there are places we could go where that might not
be the case. Wall Street execs, for example, might not have the time to put effort into these
sort of pleasantries. But overall, I was suprised by the general niceness of the city.

### Duke has a Great Alumni Network

While we were in New York, we went to a fundraiser lunch for alumni. Afterwards we took a bus to
see a Duke basketball game in NJ and sat in the alumni section. I got an opportunity to speak to
former Blue Devils from wide range of ages, occupations, and backgrounds. I got the sense that
the network was really tight, which is already something I gleaned from our trip to Silicon
Valley. It was nice to see that the same was true in New York. I was pleasantly surprised at how
many alumni were involved in entrepreneurship as well.

### We Should be Building Modular Cities

There's a lot of infastructure in New York. As I was gazing up at the skyline like an obvious
tourist, I wondered to myself, "What will happen when the city becomes outdated or needs to
expand?" My best guess is that we'll continue building up, on top of the existing skyscrapers,
furthering the eerie contrast between the dirty streets and the sheen of the massive towers
that rise above them. But that only works to a certain extent. What happens when the foundations
aren't strong enough to support the growing world above? What happens when there's not enough
water pressure in the pipes to pump water all the way up to the top floor? What happens when
metal wires become too slow and most of the world is switching to fiber optics?

What would a more modular city look like? Maybe I'll talk about that in a future post.

{% img /images/real/nyc.jpg %}