text:
<?php

/**
 * APIの基本クラス
 *
 * @package Api
 * @author LOCKON CO.,LTD.
 * @version $Id$
 */
require_once CLASS_REALDIR . 'api/operations/AddrFromZip.php';

class API_AddrFromZip_Ex extends API_AddrFromZip {

}

redpajama_set_name: RedPajamaGithub


text:
set -euo pipefail
set -o xtrace

yarn run test-ci
yarn run report
yarn run lint

npx typedoc --out typedoc --name Voxa --readme ./README.md --target ES5 --ignoreCompilerErrors ./src
NODE_VERSION=${TRAVIS_NODE_VERSION:-}
if [ ! -z "${NODE_VERSION}" ]; then
  docker pull "lambci/lambda:nodejs$TRAVIS_NODE_VERSION"
else
  NODE_VERSION=$(node --version | cut -d 'v' -f2 | cut -d'.' -f1,2)
  docker pull "lambci/lambda:nodejs$NODE_VERSION"
fi
(
  cd hello-world
  rm -rf node_modules
  yarn
  yarn mocha hello-world.spec.js
)

if [ "${CI}" = "true" ]; then
  cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js
fi


text:
package com.linkedin.metrowka;

public abstract class Harvestable {

  private final InstrumentType _type;
  private final MeasureUnit _unit;
  private final String _name;

  public Harvestable(InstrumentType type, MeasureUnit unit, String name) {
    super();
    _type = type;
    _name = name;
    _unit = unit;
  }

  abstract public void harvest(Harvester consumer);

  public InstrumentType getType() {
    return _type;
  }

  public String getName() {
    return _name;
  }

  public MeasureUnit getUnit() {
    return _unit;
  }
}


text:
package com.vangent.hieos.DocViewer.client.model.config;

import com.google.gwt.user.client.rpc.IsSerializable;

/**
 * Class holding the authDomain information obtain from xconfig.xml.
 *
 * @author Daniel Ng
 */
public class AuthenticationDomainConfigDTO implements IsSerializable {
	private String authHandlerLdapBaseDn;
	private String authHandlerLdapUrl;
	private String authHandlerLdapUsernameFormat;
	private String authDomainName;
	private String authDomainValue;

	/**
	 *
	 * @return
	 */
	public String getAuthHandlerLdapBaseDn() {
		return authHandlerLdapBaseDn;
	}

	/**
	 *
	 * @param authHandlerLdapBaseDn
	 */
	public void setAuthHandlerLdapBaseDn(String authHandlerLdapBaseDn) {
		this.authHandlerLdapBaseDn = authHandlerLdapBaseDn;
	}

	/**
	 *
	 * @return
	 */
	public String getAuthHandlerLdapUrl() {
		return authHandlerLdapUrl;
	}

	/**
	 *
	 * @param authHandlerLdapUrl
	 */
	public void setAuthHandlerLdapUrl(String authHandlerLdapUrl) {
		this.authHandlerLdapUrl = authHandlerLdapUrl;
	}

	/**
	 *
	 * @return
	 */
	public String getAuthHandlerLdapUsernameFormat() {
		return authHandlerLdapUsernameFormat;
	}

	/**
	 * @param authHandlerLdapUsernameFormat
	 */
	public void setAuthHandlerLdapUsernameFormat(
			String authHandlerLdapUsernameFormat) {
		this.authHandlerLdapUsernameFormat = authHandlerLdapUsernameFormat;
	}

	/**
	 *
	 * @return
	 */
	public String getAuthDomainName() {
		return authDomainName;
	}

	/**
	 *
	 * @param authDomainName
	 */
	public void setAuthDomainName(String authDomainName) {
		this.authDomainName = authDomainName;
	}

	/**
	 *
	 * @return
	 */
	public String getAuthDomainValue() {
		return authDomainValue;
	}

	/**
	 *
	 * @param authDomainValue
	 */
	public void setAuthDomainValue(String authDomainValue) {
		this.authDomainValue = authDomainValue;
	}
}


text:
package nato.ivct.commander;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.MessageProducer;

import org.slf4j.LoggerFactory;

import de.fraunhofer.iosb.messaginghelpers.PropertyBasedClientSetup;
import nato.ivct.commander.CmdQuitListener.OnQuitListener;
import nato.ivct.commander.CmdSetLogLevel.LogLevel;
import nato.ivct.commander.CmdStartTestResultListener.OnResultListener;
import nato.ivct.commander.CmdTcStatusListener.OnTcStatusListener;

/*
 * The Factory is used to create Command objects to be executed by a user interface.
 * Before any Command objects can be created, the factory object need to be initialized.
 * The Factory is also the container for all properties and JMS elements. The life cycle is managed by the
 * caller of the factory
 */
public class Factory {

	public static Properties props = null;
	public static final String IVCT_CONF = "IVCT_CONF";
	public static final String IVCT_TS_HOME_ID = "IVCT_TS_HOME_ID";
	public static final String IVCT_SUT_HOME_ID = "IVCT_SUT_HOME_ID";
	public static final String IVCT_BADGE_HOME_ID = "IVCT_BADGE_HOME_ID";
	public static final String RTI_ID = "RTI_ID";
	public static final String PROPERTY_IVCTCOMMANDER_QUEUE = "ivctcommander.queue";
	private static MessageProducer producer = null;
	private static int cmdCounter = 0;

	public static final org.slf4j.Logger LOGGER = LoggerFactory.getLogger(Factory.class);

	static public PropertyBasedClientSetup jmsHelper = null;

	/*
	 * Factory has to be initialized before any commands are being created.
	 */
	public static void initialize() {
		if (props == null) {
			String home = System.getenv(IVCT_CONF);
			props = new Properties();

			if (home == null) {
				LOGGER.error("Environment Variable <<IVCT_CONF>> not set");
				System.exit(-1);
			}
			try {
				props.load(new FileInputStream(home + "/IVCT.properties"));
			} catch (final Exception e) {
				LOGGER.warn("no properties file " + home + "/IVCT.properties found");
				props.setProperty(IVCT_TS_HOME_ID, "C:/MSG134/DemoFolders/IVCTtestSuites");
				props.setProperty(IVCT_SUT_HOME_ID, "C:/MSG134/DemoFolders/IVCTsut");
				props.setProperty(IVCT_BADGE_HOME_ID, "C:/MSG134/DemoFolders/Badges");
				props.setProperty(RTI_ID, "pRTI");
				props.setProperty("messaging.user", "admin");
				props.setProperty("messaging.password", "password");
				props.setProperty("messaging.host", "localhost");
				props.setProperty("messaging.port", "61616");
				props.setProperty("jmstestrunner.queue", "commands");
				try {
					props.store(new FileOutputStream(home + "/IVCT.properties"), "IVCT Properties File");
				} catch (IOException e1) {
					LOGGER.error("Unable to write " + home + "/IVCT.properties file. Please verify settings!");
					e1.printStackTrace();
				}
				LOGGER.warn("New IVCT.properties file has been created with default values. Please verify settings!");
				LOGGER.warn(props.toString());
			}
			jmsHelper = new PropertyBasedClientSetup(props);
			jmsHelper.parseProperties();
			jmsHelper.initConnection();
			jmsHelper.initSession();
			producer = jmsHelper.setupTopicProducer(props.getProperty(PROPERTY_IVCTCOMMANDER_QUEUE, "commands"));
		} // otherwise consider to be already initialized
	}

	public static String readWholeFile(final String filename) {
		BufferedReader br = null;
		String everything = null;

		File myFile = new File(filename);
		if (myFile.isFile() == false) {
			return everything;
		}

		try {
			br = new BufferedReader(new FileReader(filename));
			StringBuilder sb = new StringBuilder();
			String line = br.readLine();

			while (line != null) {
				sb.append(line);
				sb.append(System.lineSeparator());
				line = br.readLine();
			}
			everything = sb.toString();
		} catch (FileNotFoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} finally {
			if (br != null) {
				try {
					br.close();
				} catch (IOException e) {
				}
			}
		}

		return everything;
	}

	public static String replaceMacro(String inString) {
		StringBuilder env = new StringBuilder();
		StringBuilder out = new StringBuilder();
		int len;

		env.setLength(512);
		out.setLength(512);
		out.setLength(0);
		len = inString.length();

		// Loop through inString character by character
		for (int i = 0, l = 0; i < len; i++, l++) {
			boolean gotClosing = false;
			boolean gotEnv = false;
			if (i < len - 1) {
				// Check if we have "$(" in inString
				if (inString.charAt(i) == '$' && inString.charAt(i + 1) == '(') {
					gotClosing = false;
					for (int j = i + 2, k = 0; j < len; j++, k++) {
						if (inString.charAt(j) == ')') {
							String b = null;
							gotClosing = true;
							gotEnv = true;
							env.setLength(k);
							if (env.length() > 0) {
								b = Factory.props.getProperty(env.toString());
							} else {
								LOGGER.error("LineUtil:replaceMacro: Missing environment variable ");
							}
							if (b != null) {
								out.append(b);
								l += b.length() - 1;
								i = j;
							} else {
								LOGGER.error(
										"LineUtil:replaceMacro: Environment variable not found: " + env.toString());
								String s = inString.subSequence(i, i + k + 3).toString();
								out.append(s);
								l += j - i;
								i = j;
							}
							break;
						}
						env.setCharAt(k, inString.charAt(j));
					}
					if (gotClosing == false) {
						LOGGER.error("LineUtil:replaceMacro: Missing closing bracket");
					}
				}
			}
			if (gotEnv) {
				gotEnv = false;
				continue;
			}
			out.insert(l, inString.charAt(i));
			out.setLength(l + 1);
		}

		return out.toString();
	}

	public static void sendToJms(final String userCommand) {
		Message message = jmsHelper.createTextMessage(userCommand);
		try {
			producer.send(message);
		} catch (JMSException e) {
			LOGGER.error("could not send command: " + userCommand);
			e.printStackTrace();
		}
	}

	// factory methods for commands

	public static CmdListSuT createCmdListSut() {
		initialize();
		return new CmdListSuT();
	}

	public static CmdListBadges createCmdListBadges() {
		initialize();
		return new CmdListBadges();
	}

	public static CmdStartTc createCmdStartTc(String _sut, String _badge, String _tc, String _runFolder) {
		initialize();
		return new CmdStartTc(_sut, _badge, _tc, _runFolder);
	}

	public static CmdSetLogLevel createCmdSetLogLevel(LogLevel level) {
		initialize();
		return new CmdSetLogLevel(level);
	}

	public static CmdQuit createCmdQuit() {
		initialize();
		return new CmdQuit();
	}

	public static CmdQuitListener createCmdQuitListener(OnQuitListener listener) {
		initialize();
		return new CmdQuitListener(listener);
	}

	public static CmdStartTestResultListener createCmdStartTestResultListener(OnResultListener listener) {
		initialize();
		return new CmdStartTestResultListener(listener);
	}

	public static CmdTcStatusListener createCmdTcStatusListener(OnTcStatusListener listener) {
		initialize();
		return new CmdTcStatusListener(listener);
	}

	public static CmdSendTcStatus createCmdSendTcStatus() {
		initialize();
		return new CmdSendTcStatus();
	}

	public static int getCmdCounter() {
		return cmdCounter;
	}

	public static int newCmdCount() {
		return ++cmdCounter;
	}

}


text:
package info.novatec.testit.webtester.events.browser;

import lombok.Getter;

import info.novatec.testit.webtester.browser.operations.CurrentWindow;
import info.novatec.testit.webtester.events.AbstractEvent;
import info.novatec.testit.webtester.events.Event;
import info.novatec.testit.webtester.events.EventListener;
import info.novatec.testit.webtester.events.EventSystem;

/**
 * This {@link Event event} occurs whenever the size of a window was set.
 *
 * @see Event
 * @see EventListener
 * @see EventSystem
 * @see CurrentWindow#setSize(int, int)
 * @since 2.0
 */
@Getter
@SuppressWarnings("serial")
public class SetWindowSizeEvent extends AbstractEvent {

    private final int width;
    private final int height;

    public SetWindowSizeEvent(int width, int height) {
        this.width = width;
        this.height = height;
    }

    @Override
    public String describe() {
        return "set window size: width=" + width + ", height=" + height;
    }

}


text:
<?php

/* @Framework/Form/date_widget.html.php */
class __TwigTemplate_2de62455a51ceffb1abc63f0213d97034958476a38eb5a00cc229619ac83991c extends Twig_Template
{
    public function __construct(Twig_Environment $env)
    {
        parent::__construct($env);

        $this->parent = false;

        $this->blocks = array(
        );
    }

    protected function doDisplay(array $context, array $blocks = array())
    {
        $__internal_5b8d18ef52d18c306f7d7ebf17291f1637be0175e4ee13a6cdaef13ca4385a2a = $this->env->getExtension("Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension");
        $__internal_5b8d18ef52d18c306f7d7ebf17291f1637be0175e4ee13a6cdaef13ca4385a2a->enter($__internal_5b8d18ef52d18c306f7d7ebf17291f1637be0175e4ee13a6cdaef13ca4385a2a_prof = new Twig_Profiler_Profile($this->getTemplateName(), "template", "@Framework/Form/date_widget.html.php"));

        // line 1
        echo "<?php if (\$widget == 'single_text'): ?>
    <?php echo \$view['form']->block(\$form, 'form_widget_simple'); ?>
<?php else: ?>
    <div <?php echo \$view['form']->block(\$form, 'widget_container_attributes') ?>>
        <?php echo str_replace(array('";
        // line 5
        echo twig_escape_filter($this->env, (isset($context["year"]) ? $context["year"] : $this->getContext($context, "year")), "html", null, true);
        echo "', '";
        echo twig_escape_filter($this->env, (isset($context["month"]) ? $context["month"] : $this->getContext($context, "month")), "html", null, true);
        echo "', '";
        echo twig_escape_filter($this->env, (isset($context["day"]) ? $context["day"] : $this->getContext($context, "day")), "html", null, true);
        echo "'), array(
            \$view['form']->widget(\$form['year']),
            \$view['form']->widget(\$form['month']),
            \$view['form']->widget(\$form['day']),
        ), \$date_pattern) ?>
    </div>
<?php endif ?>
";

        $__internal_5b8d18ef52d18c306f7d7ebf17291f1637be0175e4ee13a6cdaef13ca4385a2a->leave($__internal_5b8d18ef52d18c306f7d7ebf17291f1637be0175e4ee13a6cdaef13ca4385a2a_prof);

    }

    public function getTemplateName()
    {
        return "@Framework/Form/date_widget.html.php";
    }

    public function isTraitable()
    {
        return false;
    }

    public function getDebugInfo()
    {
        return array (  28 => 5,  22 => 1,);
    }

    /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */
    public function getSource()
    {
        @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED);

        return $this->getSourceContext()->getCode();
    }

    public function getSourceContext()
    {
        return new Twig_Source("<?php if (\$widget == 'single_text'): ?>
    <?php echo \$view['form']->block(\$form, 'form_widget_simple'); ?>
<?php else: ?>
    <div <?php echo \$view['form']->block(\$form, 'widget_container_attributes') ?>>
        <?php echo str_replace(array('{{ year }}', '{{ month }}', '{{ day }}'), array(
            \$view['form']->widget(\$form['year']),
            \$view['form']->widget(\$form['month']),
            \$view['form']->widget(\$form['day']),
        ), \$date_pattern) ?>
    </div>
<?php endif ?>
", "@Framework/Form/date_widget.html.php", "/var/www/html/symfonyAdminPanel--/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/date_widget.html.php");
    }
}


text:
title: React Alert component
components: Alert, AlertTitle
---

# Alert

An alert displays a short, important message in a way that attracts the user's attention without interrupting the user's task.

**Note:** This component is not documented in the [Material Design guidelines](https://material.io/), but Material-UI supports it.

## Simple alerts

The alert offers four severity levels that set a distinctive icon and color.

{{"demo": "pages/components/alert/SimpleAlerts.js"}}

## Description

You can use the `AlertTitle` component to display a formatted title above the content.

{{"demo": "pages/components/alert/DescriptionAlerts.js"}}

## Actions

An alert can have an action, such as a close or undo button.
It is rendered after the message, at the end of the alert.

If an `onClose` callback is provided and no `action` prop is set, a close icon is displayed. The `action` prop can be used to provide an alternative action, for example using a Button or IconButton.

{{"demo": "pages/components/alert/ActionAlerts.js"}}

### Transition

You can use a [transition component](/components/transitions/) such as `Collapse` to transition the appearance of the alert.

{{"demo": "pages/components/alert/TransitionAlerts.js"}}

## Icons

The `icon` prop allows you to add an icon to the beginning of the alert component.
This will override the default icon for the specified severity.

You can change the default severity to icon mapping with the `iconMapping` prop. This can be defined globally using [theme customization](/customization/globals/#default-props).

Setting the icon prop to false will remove the icon altogether.

{{"demo": "pages/components/alert/IconAlerts.js"}}

## Variants

Two additional variants are available – outlined, and filled:

### Outlined

{{"demo": "pages/components/alert/OutlinedAlerts.js"}}

### Filled

{{"demo": "pages/components/alert/FilledAlerts.js"}}

## Toast

You can use the Snackbar to [display a toast](/components/snackbars/#customized-snackbars) with the Alert.

## Color

The `color` prop will override the default color for the specified severity.

{{"demo": "pages/components/alert/ColorAlerts.js"}}

## Accessibility

(WAI-ARIA: https://www.w3.org/TR/wai-aria-practices/#alert)

When the component is dynamically displayed, the content is automatically announced by most screen readers. At this time, screen readers do not inform users of alerts that are present when the page loads.

Using color to add meaning only provides a visual indication, which will not be conveyed to users of assistive technologies such as screen readers. Ensure that information denoted by the color is either obvious from the content itself (for example the visible text), or is included through alternative means, such as additional hidden text.

Actions must have a tab index of 0 so that they can be reached by keyboard-only users.


text:
package com.opengamma.sdk.common.auth;

import java.util.Map;
import java.util.NoSuchElementException;

import org.joda.beans.Bean;
import org.joda.beans.BeanBuilder;
import org.joda.beans.ImmutableBean;
import org.joda.beans.JodaBeanUtils;
import org.joda.beans.MetaBean;
import org.joda.beans.MetaProperty;
import org.joda.beans.gen.BeanDefinition;
import org.joda.beans.gen.PropertyDefinition;
import org.joda.beans.impl.direct.DirectMetaBean;
import org.joda.beans.impl.direct.DirectMetaProperty;
import org.joda.beans.impl.direct.DirectMetaPropertyMap;
import org.joda.beans.impl.direct.DirectPrivateBeanBuilder;

/**
 * The result returned to the client from an oauth2 request.
 *

 * OAuth2 Access Token Response per https://tools.ietf.org/html/rfc6749#section-4.4
 */
@BeanDefinition(builderScope = "private", metaScope = "private")
public final class AccessTokenResult implements ImmutableBean {

  /**
   * The 'bearer' token type.
   */
  public static final String BEARER = "bearer";

  /**
   * The access token.
   */
  @PropertyDefinition(validate = "notBlank", alias = "access_token")
  private final String accessToken;
  /**
   * The token type.
   */
  @PropertyDefinition(validate = "notBlank", alias = "token_type")
  private final String tokenType;
  /**
   * The lifetime of the token in seconds.
   */
  @PropertyDefinition(alias = "expires_in")
  private final long expiresIn;

  //-------------------------------------------------------------------------
  /**
   * Obtains an instance.
   *

   * It is intended that instances of {@code AccessTokenResult} are obtained
   * through the authentication process, not by calling this method.
   * The use case for this method is mocking authentication responses.
   *
   * @param accessToken  the access token
   * @param tokenType  the token type
   * @param expiresIn  the expires in
   * @return the instance
   */
  public static AccessTokenResult of(String accessToken, String tokenType, long expiresIn) {
    return new AccessTokenResult(accessToken, tokenType, expiresIn);
  }

  //------------------------- AUTOGENERATED START -------------------------
  /**
   * The meta-bean for {@code AccessTokenResult}.
   * @return the meta-bean, not null
   */
  public static MetaBean meta() {
    return AccessTokenResult.Meta.INSTANCE;
  }

  static {
    MetaBean.register(AccessTokenResult.Meta.INSTANCE);
  }

  private AccessTokenResult(
      String accessToken,
      String tokenType,
      long expiresIn) {
    JodaBeanUtils.notBlank(accessToken, "accessToken");
    JodaBeanUtils.notBlank(tokenType, "tokenType");
    this.accessToken = accessToken;
    this.tokenType = tokenType;
    this.expiresIn = expiresIn;
  }

  @Override
  public MetaBean metaBean() {
    return AccessTokenResult.Meta.INSTANCE;
  }

  //-----------------------------------------------------------------------
  /**
   * Gets the access token.
   * @return the value of the property, not blank
   */
  public String getAccessToken() {
    return accessToken;
  }

  //-----------------------------------------------------------------------
  /**
   * Gets the token type.
   * @return the value of the property, not blank
   */
  public String getTokenType() {
    return tokenType;
  }

  //-----------------------------------------------------------------------
  /**
   * Gets the lifetime of the token in seconds.
   * @return the value of the property
   */
  public long getExpiresIn() {
    return expiresIn;
  }

  //-----------------------------------------------------------------------
  @Override
  public boolean equals(Object obj) {
    if (obj == this) {
      return true;
    }
    if (obj != null && obj.getClass() == this.getClass()) {
      AccessTokenResult other = (AccessTokenResult) obj;
      return JodaBeanUtils.equal(accessToken, other.accessToken) &&
          JodaBeanUtils.equal(tokenType, other.tokenType) &&
          (expiresIn == other.expiresIn);
    }
    return false;
  }

  @Override
  public int hashCode() {
    int hash = getClass().hashCode();
    hash = hash * 31 + JodaBeanUtils.hashCode(accessToken);
    hash = hash * 31 + JodaBeanUtils.hashCode(tokenType);
    hash = hash * 31 + JodaBeanUtils.hashCode(expiresIn);
    return hash;
  }

  @Override
  public String toString() {
    StringBuilder buf = new StringBuilder(128);
    buf.append("AccessTokenResult{");
    buf.append("accessToken").append('=').append(JodaBeanUtils.toString(accessToken)).append(',').append(' ');
    buf.append("tokenType").append('=').append(JodaBeanUtils.toString(tokenType)).append(',').append(' ');
    buf.append("expiresIn").append('=').append(JodaBeanUtils.toString(expiresIn));
    buf.append('}');
    return buf.toString();
  }

  //-----------------------------------------------------------------------
  /**
   * The meta-bean for {@code AccessTokenResult}.
   */
  private static final class Meta extends DirectMetaBean {
    /**
     * The singleton instance of the meta-bean.
     */
    static final Meta INSTANCE = new Meta();

    /**
     * The meta-property for the {@code accessToken} property.
     */
    private final MetaProperty<String> accessToken = DirectMetaProperty.ofImmutable(
        this, "accessToken", AccessTokenResult.class, String.class);
    /**
     * The meta-property for the {@code tokenType} property.
     */
    private final MetaProperty<String> tokenType = DirectMetaProperty.ofImmutable(
        this, "tokenType", AccessTokenResult.class, String.class);
    /**
     * The meta-property for the {@code expiresIn} property.
     */
    private final MetaProperty<Long> expiresIn = DirectMetaProperty.ofImmutable(
        this, "expiresIn", AccessTokenResult.class, Long.TYPE);
    /**
     * The meta-properties.
     */
    private final Map<String, MetaProperty<?>> metaPropertyMap$ = new DirectMetaPropertyMap(
        this, null,
        "accessToken",
        "tokenType",
        "expiresIn");

    /**
     * Restricted constructor.
     */
    private Meta() {
    }

    @Override
    protected MetaProperty<?> metaPropertyGet(String propertyName) {
      switch (propertyName.hashCode()) {
        case -1042689291:  // accessToken
        case -1938933922:  // access_token (alias)
          return accessToken;
        case 141498579:  // tokenType
        case 101507520:  // token_type (alias)
          return tokenType;
        case 250196857:  // expiresIn
        case -833810928:  // expires_in (alias)
          return expiresIn;
      }
      return super.metaPropertyGet(propertyName);
    }

    @Override
    public BeanBuilder<? extends AccessTokenResult> builder() {
      return new AccessTokenResult.Builder();
    }

    @Override
    public Class<? extends AccessTokenResult> beanType() {
      return AccessTokenResult.class;
    }

    @Override
    public Map<String, MetaProperty<?>> metaPropertyMap() {
      return metaPropertyMap$;
    }

    //-----------------------------------------------------------------------
    @Override
    protected Object propertyGet(Bean bean, String propertyName, boolean quiet) {
      switch (propertyName.hashCode()) {
        case -1042689291:  // accessToken
        case -1938933922:  // access_token (alias)
          return ((AccessTokenResult) bean).getAccessToken();
        case 141498579:  // tokenType
        case 101507520:  // token_type (alias)
          return ((AccessTokenResult) bean).getTokenType();
        case 250196857:  // expiresIn
        case -833810928:  // expires_in (alias)
          return ((AccessTokenResult) bean).getExpiresIn();
      }
      return super.propertyGet(bean, propertyName, quiet);
    }

    @Override
    protected void propertySet(Bean bean, String propertyName, Object newValue, boolean quiet) {
      metaProperty(propertyName);
      if (quiet) {
        return;
      }
      throw new UnsupportedOperationException("Property cannot be written: " + propertyName);
    }

  }

  //-----------------------------------------------------------------------
  /**
   * The bean-builder for {@code AccessTokenResult}.
   */
  private static final class Builder extends DirectPrivateBeanBuilder<AccessTokenResult> {

    private String accessToken;
    private String tokenType;
    private long expiresIn;

    /**
     * Restricted constructor.
     */
    private Builder() {
    }

    //-----------------------------------------------------------------------
    @Override
    public Object get(String propertyName) {
      switch (propertyName.hashCode()) {
        case -1042689291:  // accessToken
        case -1938933922:  // access_token (alias)
          return accessToken;
        case 141498579:  // tokenType
        case 101507520:  // token_type (alias)
          return tokenType;
        case 250196857:  // expiresIn
        case -833810928:  // expires_in (alias)
          return expiresIn;
        default:
          throw new NoSuchElementException("Unknown property: " + propertyName);
      }
    }

    @Override
    public Builder set(String propertyName, Object newValue) {
      switch (propertyName.hashCode()) {
        case -1042689291:  // accessToken
        case -1938933922:  // access_token (alias)
          this.accessToken = (String) newValue;
          break;
        case 141498579:  // tokenType
        case 101507520:  // token_type (alias)
          this.tokenType = (String) newValue;
          break;
        case 250196857:  // expiresIn
        case -833810928:  // expires_in (alias)
          this.expiresIn = (Long) newValue;
          break;
        default:
          throw new NoSuchElementException("Unknown property: " + propertyName);
      }
      return this;
    }

    @Override
    public AccessTokenResult build() {
      return new AccessTokenResult(
          accessToken,
          tokenType,
          expiresIn);
    }

    //-----------------------------------------------------------------------
    @Override
    public String toString() {
      StringBuilder buf = new StringBuilder(128);
      buf.append("AccessTokenResult.Builder{");
      buf.append("accessToken").append('=').append(JodaBeanUtils.toString(accessToken)).append(',').append(' ');
      buf.append("tokenType").append('=').append(JodaBeanUtils.toString(tokenType)).append(',').append(' ');
      buf.append("expiresIn").append('=').append(JodaBeanUtils.toString(expiresIn));
      buf.append('}');
      return buf.toString();
    }

  }

  //-------------------------- AUTOGENERATED END --------------------------
}


text:
/*
 * Previously Copyright (c) 2001-2004 James House
 */
package org.quartz.simpl;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.quartz.SchedulerConfigException;
import org.quartz.spi.ThreadPool;

import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;

/**
 *

 * This is class is a simple implementation of a thread pool, based on the
 * {@link org.quartz.spi.ThreadPool} interface.
 *

 *
 *

 * Runnable objects are sent to the pool with the {@link #runInThread(Runnable)}
 * method, which blocks until a Thread becomes available.
 *

 *
 *

 * The pool has a fixed number of Threads, and does not grow or
 * shrink based on demand.
 *

 *
 * @author James House
 * @author Juergen Donnerstag
 */
public class SimpleThreadPool implements ThreadPool {

    /*
     * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     *
     * Data members.
     *
     * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     */

    private int count = -1;

    private int prio = Thread.NORM_PRIORITY;

    private boolean isShutdown = false;
    private boolean handoffPending = false;

    private boolean inheritLoader = false;

    private boolean inheritGroup = true;

    private boolean makeThreadsDaemons = false;

    private ThreadGroup threadGroup;

    private final Object nextRunnableLock = new Object();

    private List workers;
    private LinkedList availWorkers = new LinkedList();
    private LinkedList busyWorkers = new LinkedList();

    private String threadNamePrefix = "SimpleThreadPoolWorker";

    private final Log log = LogFactory.getLog(getClass());

    /*
     * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     *
     * Constructors.
     *
     * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     */

    /**
     *

     * Create a new (unconfigured) SimpleThreadPool.
     *

     *
     * @see #setThreadCount(int)
     * @see #setThreadPriority(int)
     */
    public SimpleThreadPool() {
    }

    /**
     *

     * Create a new SimpleThreadPool with the specified number
     * of Thread s that have the given priority.
     *

     *
     * @param threadCount
     *          the number of worker Threads in the pool, must
     *          be > 0.
     * @param threadPriority
     *          the thread priority for the worker threads.
     *
     * @see java.lang.Thread
     */
    public SimpleThreadPool(int threadCount, int threadPriority) {
        setThreadCount(threadCount);
        setThreadPriority(threadPriority);
    }

    /*
     * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     *
     * Interface.
     *
     * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     */

    public Log getLog() {
        return log;
    }

    public int getPoolSize() {
        return getThreadCount();
    }

    /**
     *

     * Set the number of worker threads in the pool - has no effect after
     * initialize() has been called.
     *

     */
    public void setThreadCount(int count) {
        this.count = count;
    }

    /**
     *

     * Get the number of worker threads in the pool.
     *

     */
    public int getThreadCount() {
        return count;
    }

    /**
     *

     * Set the thread priority of worker threads in the pool - has no effect
     * after initialize() has been called.
     *

     */
    public void setThreadPriority(int prio) {
        this.prio = prio;
    }

    /**
     *

     * Get the thread priority of worker threads in the pool.
     *

     */
    public int getThreadPriority() {
        return prio;
    }

    public void setThreadNamePrefix(String prfx) {
        this.threadNamePrefix = prfx;
    }

    public String getThreadNamePrefix() {
        return threadNamePrefix;
    }

    /**
     * @return Returns the
     *         threadsInheritContextClassLoaderOfInitializingThread.
     */
    public boolean isThreadsInheritContextClassLoaderOfInitializingThread() {
        return inheritLoader;
    }

    /**
     * @param inheritLoader
     *          The threadsInheritContextClassLoaderOfInitializingThread to
     *          set.
     */
    public void setThreadsInheritContextClassLoaderOfInitializingThread(
            boolean inheritLoader) {
        this.inheritLoader = inheritLoader;
    }

    public boolean isThreadsInheritGroupOfInitializingThread() {
        return inheritGroup;
    }

    public void setThreadsInheritGroupOfInitializingThread(
            boolean inheritGroup) {
        this.inheritGroup = inheritGroup;
    }

    /**
     * @return Returns the value of makeThreadsDaemons.
     */
    public boolean isMakeThreadsDaemons() {
        return makeThreadsDaemons;
    }

    /**
     * @param makeThreadsDaemons
     *          The value of makeThreadsDaemons to set.
     */
    public void setMakeThreadsDaemons(boolean makeThreadsDaemons) {
        this.makeThreadsDaemons = makeThreadsDaemons;
    }

    public void initialize() throws SchedulerConfigException {

        if (count <= 0) {
            throw new SchedulerConfigException(
                    "Thread count must be > 0");
        }
        if (prio <= 0 || prio > 9) {
            throw new SchedulerConfigException(
                    "Thread priority must be > 0 and <= 9");
        }

        if(isThreadsInheritGroupOfInitializingThread()) {
            threadGroup = Thread.currentThread().getThreadGroup();
        } else {
            // follow the threadGroup tree to the root thread group.
            threadGroup = Thread.currentThread().getThreadGroup();
            ThreadGroup parent = threadGroup;
            while ( !parent.getName().equals("main") ) {
                threadGroup = parent;
                parent = threadGroup.getParent();
            }
            threadGroup = new ThreadGroup(parent, "SimpleThreadPool");
            if (isMakeThreadsDaemons()) {
                threadGroup.setDaemon(true);
            }
        }

        if (isThreadsInheritContextClassLoaderOfInitializingThread()) {
            getLog().info(
                    "Job execution threads will use class loader of thread: "
                            + Thread.currentThread().getName());
        }

        // create the worker threads and start them
        Iterator workerThreads = createWorkerThreads(count).iterator();
        while(workerThreads.hasNext()) {
            WorkerThread wt = (WorkerThread) workerThreads.next();
            wt.start();
            availWorkers.add(wt);
        }
    }

    protected List createWorkerThreads(int count) {
        workers = new LinkedList();
        for (int i = 1; i<= count; ++i) {
            WorkerThread wt = new WorkerThread(this, threadGroup,
                getThreadNamePrefix() + "-" + i,
                getThreadPriority(),
                isMakeThreadsDaemons());
            if (isThreadsInheritContextClassLoaderOfInitializingThread()) {
                wt.setContextClassLoader(Thread.currentThread()
                        .getContextClassLoader());
            }
            workers.add(wt);
        }

        return workers;
    }

    /**
     *

     * Terminate any worker threads in this thread group.
     *

     *
     *

     * Jobs currently in progress will complete.
     *

     */
    public void shutdown() {
        shutdown(true);
    }

    /**
     *

     * Terminate any worker threads in this thread group.
     *

     *
     *

     * Jobs currently in progress will complete.
     *

     */
    public void shutdown(boolean waitForJobsToComplete) {

        synchronized (nextRunnableLock) {
            isShutdown = true;

            // signal each worker thread to shut down
            Iterator workerThreads = workers.iterator();
            while(workerThreads.hasNext()) {
                WorkerThread wt = (WorkerThread) workerThreads.next();
                wt.shutdown();
                availWorkers.remove(wt);
            }

            // Give waiting (wait(1000)) worker threads a chance to shut down.
            // Active worker threads will shut down after finishing their
            // current job.
            nextRunnableLock.notifyAll();

            if (waitForJobsToComplete == true) {

                // wait for hand-off in runInThread to complete...
                while(handoffPending) {
                    try { nextRunnableLock.wait(100); } catch(Throwable t) {}
                }

                // Wait until all worker threads are shut down
                while (busyWorkers.size() > 0) {
                    WorkerThread wt = (WorkerThread) busyWorkers.getFirst();
                    try {
                        getLog().debug(
                                "Waiting for thread " + wt.getName()
                                        + " to shut down");

                        // note: with waiting infinite time the
                        // application may appear to 'hang'.
                        nextRunnableLock.wait(2000);
                    } catch (InterruptedException ex) {
                    }
                }

                getLog().debug("shutdown complete");
            }
        }
    }

    /**
     *

     * Run the given Runnable object in the next available
     * Thread. If while waiting the thread pool is asked to
     * shut down, the Runnable is executed immediately within a new additional
     * thread.
     *

     *
     * @param runnable
     *          the Runnable to be added.
     */
    public boolean runInThread(Runnable runnable) {
        if (runnable == null) {
            return false;
        }

        synchronized (nextRunnableLock) {

            handoffPending = true;

            // Wait until a worker thread is available
            while ((availWorkers.size() < 1) && !isShutdown) {
                try {
                    nextRunnableLock.wait(500);
                } catch (InterruptedException ignore) {
                }
            }

            if (!isShutdown) {
                WorkerThread wt = (WorkerThread)availWorkers.removeFirst();
                busyWorkers.add(wt);
                wt.run(runnable);
            } else {
                // If the thread pool is going down, execute the Runnable
                // within a new additional worker thread (no thread from the pool).
                WorkerThread wt = new WorkerThread(this, threadGroup,
                        "WorkerThread-LastJob", prio, isMakeThreadsDaemons(), runnable);
                busyWorkers.add(wt);
                workers.add(wt);
                wt.start();
            }
            nextRunnableLock.notifyAll();
            handoffPending = false;
        }

        return true;
    }

    public int blockForAvailableThreads() {
        synchronized(nextRunnableLock) {

            while((availWorkers.size() < 1 || handoffPending) && !isShutdown) {
                try {
                    nextRunnableLock.wait(500);
                } catch (InterruptedException ignore) {
                }
            }

            return availWorkers.size();
        }
    }

    protected void makeAvailable(WorkerThread wt) {
        synchronized(nextRunnableLock) {
            if(!isShutdown) {
                availWorkers.add(wt);
            }
            busyWorkers.remove(wt);
            nextRunnableLock.notifyAll();
        }
    }

    /*
     * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     *
     * WorkerThread Class.
     *
     * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     */

    /**
     *

     * A Worker loops, waiting to execute tasks.
     *

     */
    class WorkerThread extends Thread {

        // A flag that signals the WorkerThread to terminate.
        private boolean run = true;

        private SimpleThreadPool tp;

        private Runnable runnable = null;

        /**
         *

         * Create a worker thread and start it. Waiting for the next Runnable,
         * executing it, and waiting for the next Runnable, until the shutdown
         * flag is set.
         *

         */
        WorkerThread(SimpleThreadPool tp, ThreadGroup threadGroup, String name,
                     int prio, boolean isDaemon) {

            this(tp, threadGroup, name, prio, isDaemon, null);
        }

        /**
         *

         * Create a worker thread, start it, execute the runnable and terminate
         * the thread (one time execution).
         *

         */
        WorkerThread(SimpleThreadPool tp, ThreadGroup threadGroup, String name,
                     int prio, boolean isDaemon, Runnable runnable) {

            super(threadGroup, name);
            this.tp = tp;
            this.runnable = runnable;
            setPriority(prio);
            setDaemon(isDaemon);
        }

        /**
         *

         * Signal the thread that it should terminate.
         *

         */
        void shutdown() {
        	synchronized (this) {
        		run = false;
        	}
        }

        public void run(Runnable newRunnable) {
            synchronized(this) {
                if(runnable != null) {
                    throw new IllegalStateException("Already running a Runnable!");
                }

                runnable = newRunnable;
                this.notifyAll();
            }
        }

        /**
         *

         * Loop, executing targets as they are received.
         *

         */
        public void run() {
            boolean ran = false;
        	boolean runOnce = false;
            boolean shouldRun = false;
            synchronized(this) {
            	runOnce = (runnable != null);
            	shouldRun = run;
            }

            while (shouldRun) {
                try {
                    synchronized(this) {
                        while (runnable == null && run) {
                            this.wait(500);
                        }
                    }

                    if (runnable != null) {
                        ran = true;
                        runnable.run();
                    }
                } catch (InterruptedException unblock) {
                    // do nothing (loop will terminate if shutdown() was called
                    try {
                        getLog().error("worker threat got 'interrupt'ed.", unblock);
                    } catch(Exception e) {
                        // ignore to help with a tomcat glitch
                    }
                } catch (Exception exceptionInRunnable) {
                    try {
                        getLog().error("Error while executing the Runnable: ",
                            exceptionInRunnable);
                    } catch(Exception e) {
                        // ignore to help with a tomcat glitch
                    }
                } finally {
                    synchronized(this) {
                    	runnable = null;
                    }
                    // repair the thread in case the runnable mucked it up...
                    if(getPriority() != tp.getThreadPriority()) {
                        setPriority(tp.getThreadPriority());
                    }

                    if (runOnce) {
                        synchronized(this) {
                        	run = false;
                        }
                    } else if(ran) {
                        ran = false;
                        makeAvailable(this);
                    }

                }

                // read value of run within synchronized block to be
                // sure of its value
                synchronized(this) {
                	shouldRun = run;
                }
            }

            //if (log.isDebugEnabled())
            try {
                getLog().debug("WorkerThread is shutting down");
            } catch(Exception e) {
                // ignore to help with a tomcat glitch
            }
        }
    }
}


text:
<!doctype html>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <link href="https://fonts.googleapis.com/css?family=Inconsolata&display=swap" rel="stylesheet">
    <link rel="stylesheet" href="__assets/styles.css">

Before Dawn

Screensaver Preview!

Here's a tool to preview the screensavers available in
          the application. Please note that some of them won't work
          quite right because they require data, libraries, etc.

If you like these, you can run them on your computer by
            installing
            Before Dawn.


text:
import React from 'react'
import { useStaticQuery, graphql } from 'gatsby'
import Img from 'gatsby-image'

const Banner = () => {
    return (

Learn... Think... Code.... Create...

    )
};

export default Banner;


text:
#include "pcl/impl/instantiate.hpp"
#include "pcl/point_types.h"
#include "pcl/search/brute_force.h"
#include "pcl/search/impl/brute_force.hpp"

// Instantiations of specific point types
PCL_INSTANTIATE (BruteForce, PCL_XYZ_POINT_TYPES)


text:
<md-toolbar class="md-accent md-whiteframe-3dp">

            Reset Password

</md-toolbar>

  <form name="resetPasswordForm" ng-submit="resetPassword.validateAndSave()" novalidate>

      <md-content layout="row">

            lock

      </md-content>
      <md-content layout="column" class="md-padding no-padding-bottom">
        <md-input-container class="no-margin">
          Current Password
          <input type="password" required md-no-asterisk name="password" ng-model="resetPassword.formData.password" />

This is required!

        </md-input-container>
        <md-input-container class="no-margin">
          New Password
          <input type="password" required md-no-asterisk name="newPassword" ng-model="resetPassword.formData.newPassword" />

This is required!

        </md-input-container>
        <md-input-container class="no-margin">
          Confirm Password
          <input type="password" required md-no-asterisk name="confirmPassword" ng-model="resetPassword.formData.confirmPassword" />

This is required!

        </md-input-container>

          <md-button class="md-raised md-primary bold md-cell-12" type="submit">Reset Password</md-button>

      </md-content>

  </form>


text: RIEMANN = Riemann::Client.new host: 'localhost', port: 5555, timeout: 5


text:
import { Component, Input, TemplateRef, ChangeDetectionStrategy } from '@angular/core';

@Component({
  // tslint:disable-next-line:component-selector
  selector: '[nglInternalOutlet]',
  template: `
    <ng-template [ngIf]="isTemplate()" [ngIfElse]="str">
      <ng-template [ngTemplateOutlet]="nglInternalOutlet" [ngTemplateOutletContext]="nglInternalOutletContext"></ng-template>
    </ng-template>
    <ng-template #str>{{nglInternalOutlet}}</ng-template>`,
  changeDetection: ChangeDetectionStrategy.OnPush,
})
export class NglInternalOutlet {
  @Input() nglInternalOutlet: string | TemplateRef<any>;

  @Input() nglInternalOutletContext: any ;

  isTemplate() {
    return this.nglInternalOutlet instanceof TemplateRef;
  }
}


text:
from setuptools import setup, find_packages
from os.path import join, dirname

with open(join(dirname(__file__), 'scrapyrt/VERSION'), 'rb') as f:
    version = f.read().decode('ascii').strip()

setup(
    name="scrapyrt",
    version=version,
    author='Scrapinghub',
    author_email='info@scrapinghub.com',
    url="https://github.com/scrapinghub/scrapyrt",
    maintainer='Scrapinghub',
    maintainer_email='info@scrapinghub.com',
    description='Put Scrapy spiders behind an HTTP API',
    long_description=open('README.rst').read(),
    license='BSD',
    packages=find_packages(),
    entry_points={
        'console_scripts': ['scrapyrt = scrapyrt.cmdline:execute']
    },
    zip_safe=False,
    classifiers=[
        'Programming Language :: Python',
        'Programming Language :: Python :: 2.7',
        'Operating System :: OS Independent',
        'Environment :: Console',
        'Environment :: No Input/Output (Daemon)',
        'Topic :: Internet :: WWW/HTTP',
        'License :: OSI Approved :: BSD License',
    ],
    install_requires=[
        'Twisted>=14.0.0',
        'Scrapy>=1.0.0',
        'demjson'
    ],
    package_data={
        'scrapyrt': [
            'VERSION',
        ]
    },
)


text:
#ifndef IEEE1394_ISO_H
#define IEEE1394_ISO_H

#include <linux/spinlock_types.h>
#include <linux/wait.h>
#include <asm/atomic.h>
#include <asm/types.h>

#include "dma.h"

struct hpsb_host;

/* high-level ISO interface */

/*
 * This API sends and receives isochronous packets on a large,
 * virtually-contiguous kernel memory buffer. The buffer may be mapped
 * into a user-space process for zero-copy transmission and reception.
 *
 * There are no explicit boundaries between packets in the buffer. A
 * packet may be transmitted or received at any location. However,
 * low-level drivers may impose certain restrictions on alignment or
 * size of packets. (e.g. in OHCI no packet may cross a page boundary,
 * and packets should be quadlet-aligned)
 */

/* Packet descriptor - the API maintains a ring buffer of these packet
 * descriptors in kernel memory (hpsb_iso.infos[]).  */
struct hpsb_iso_packet_info {
	/* offset of data payload relative to the first byte of the buffer */
	__u32 offset;

	/* length of the data payload, in bytes (not including the isochronous
	 * header) */
	__u16 len;

	/* (recv only) the cycle number (mod 8000) on which the packet was
	 * received */
	__u16 cycle;

	/* (recv only) channel on which the packet was received */
	__u8 channel;

	/* 2-bit 'tag' and 4-bit 'sy' fields of the isochronous header */
	__u8 tag;
	__u8 sy;

	/* length in bytes of the packet including header/trailer.
	 * MUST be at structure end, since the first part of this structure is
	 * also defined in raw1394.h (i.e. struct raw1394_iso_packet_info), is
	 * copied to userspace and is accessed there through libraw1394. */
	__u16 total_len;
};

enum hpsb_iso_type { HPSB_ISO_RECV = 0, HPSB_ISO_XMIT = 1 };

/* The mode of the dma when receiving iso data. Must be supported by chip */
enum raw1394_iso_dma_recv_mode {
	HPSB_ISO_DMA_DEFAULT = -1,
	HPSB_ISO_DMA_OLD_ABI = 0,
	HPSB_ISO_DMA_BUFFERFILL = 1,
	HPSB_ISO_DMA_PACKET_PER_BUFFER = 2
};

struct hpsb_iso {
	enum hpsb_iso_type type;

	/* pointer to low-level driver and its private data */
	struct hpsb_host *host;
	void *hostdata;

	/* a function to be called (from interrupt context) after
	 * outgoing packets have been sent, or incoming packets have
	 * arrived */
	void (*callback)(struct hpsb_iso*);

	/* wait for buffer space */
	wait_queue_head_t waitq;

	int speed; /* IEEE1394_SPEED_100, 200, or 400 */
	int channel; /* -1 if multichannel */
	int dma_mode; /* dma receive mode */

	/* greatest # of packets between interrupts - controls
	 * the maximum latency of the buffer */
	int irq_interval;

	/* the buffer for packet data payloads */
	struct dma_region data_buf;

	/* size of data_buf, in bytes (always a multiple of PAGE_SIZE) */
	unsigned int buf_size;

	/* # of packets in the ringbuffer */
	unsigned int buf_packets;

	/* protects packet cursors */
	spinlock_t lock;

	/* the index of the next packet that will be produced
	   or consumed by the user */
	int first_packet;

	/* the index of the next packet that will be transmitted
	   or received by the 1394 hardware */
	int pkt_dma;

	/* how many packets, starting at first_packet:
	 * (transmit) are ready to be filled with data
	 * (receive)  contain received data */
	int n_ready_packets;

	/* how many times the buffer has overflowed or underflowed */
	atomic_t overflows;
	/* how many cycles were skipped for a given context */
	atomic_t skips;

	/* Current number of bytes lost in discarded packets */
	int bytes_discarded;

	/* private flags to track initialization progress */
#define HPSB_ISO_DRIVER_INIT     (1<<0)
#define HPSB_ISO_DRIVER_STARTED  (1<<1)
	unsigned int flags;

	/* # of packets left to prebuffer (xmit only) */
	int prebuffer;

	/* starting cycle for DMA (xmit only) */
	int start_cycle;

	/* cycle at which next packet will be transmitted,
	 * -1 if not known */
	int xmit_cycle;

	/* ringbuffer of packet descriptors in regular kernel memory
	 * XXX Keep this last, since we use over-allocated memory from
	 * this entry to fill this field. */
	struct hpsb_iso_packet_info *infos;
};

/* functions available to high-level drivers (e.g. raw1394) */

struct hpsb_iso* hpsb_iso_xmit_init(struct hpsb_host *host,
				    unsigned int data_buf_size,
				    unsigned int buf_packets,
				    int channel,
				    int speed,
				    int irq_interval,
				    void (*callback)(struct hpsb_iso*));
struct hpsb_iso* hpsb_iso_recv_init(struct hpsb_host *host,
				    unsigned int data_buf_size,
				    unsigned int buf_packets,
				    int channel,
				    int dma_mode,
				    int irq_interval,
				    void (*callback)(struct hpsb_iso*));
int hpsb_iso_recv_listen_channel(struct hpsb_iso *iso, unsigned char channel);
int hpsb_iso_recv_unlisten_channel(struct hpsb_iso *iso, unsigned char channel);
int hpsb_iso_recv_set_channel_mask(struct hpsb_iso *iso, u64 mask);
int hpsb_iso_xmit_start(struct hpsb_iso *iso, int start_on_cycle,
			int prebuffer);
int hpsb_iso_recv_start(struct hpsb_iso *iso, int start_on_cycle,
			int tag_mask, int sync);
void hpsb_iso_stop(struct hpsb_iso *iso);
void hpsb_iso_shutdown(struct hpsb_iso *iso);
int hpsb_iso_xmit_queue_packet(struct hpsb_iso *iso, u32 offset, u16 len,
			       u8 tag, u8 sy);
int hpsb_iso_xmit_sync(struct hpsb_iso *iso);
int hpsb_iso_recv_release_packets(struct hpsb_iso *recv,
				  unsigned int n_packets);
int hpsb_iso_recv_flush(struct hpsb_iso *iso);
int hpsb_iso_n_ready(struct hpsb_iso *iso);

/* the following are callbacks available to low-level drivers */

void hpsb_iso_packet_sent(struct hpsb_iso *iso, int cycle, int error);
void hpsb_iso_packet_received(struct hpsb_iso *iso, u32 offset, u16 len,
			      u16 total_len, u16 cycle, u8 channel, u8 tag,
			      u8 sy);
void hpsb_iso_wake(struct hpsb_iso *iso);

#endif /* IEEE1394_ISO_H */


text:
<!DOCTYPE html>

    <meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>
  Class: Helium::Metadata

    — Documentation by YARD 0.9.5

</title>

  <link rel="stylesheet" href="../css/style.css" type="text/css" charset="utf-8" />

  <link rel="stylesheet" href="../css/common.css" type="text/css" charset="utf-8" />

    Index (M) »
    Helium
     »
    Metadata

        <svg width="24" height="24">
          <rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
          <rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
          <rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
        </svg>

Class: Helium::Metadata

Inherits:

      Object

Object

Helium::Metadata

        show all

Defined in:

lib/helium/metadata.rb

Overview

TODO make Metadata inherit from Resource and implement method_missing
for all resources to automatically generate methods for attributes
rather than whitelisting them with hardcoding

      Instance Method Summary
      collapse

      #id  ⇒ Object

      #initialize(opts = {})  ⇒ Metadata

    constructor

A new instance of Metadata.

      #inspect  ⇒ Object

      #method_missing(method_name, *arguments, &block)  ⇒ Object

      #properties  ⇒ Object

      #respond_to_missing?(method_name, include_private = false)  ⇒ Boolean

      #update(attributes = {})  ⇒ Object

Constructor Details

    #initialize(opts = {})  ⇒ <tt>Metadata</tt>

Returns a new instance of Metadata

6
7
8
9
10
11

# File 'lib/helium/metadata.rb', line 6

def initialize(opts = {})
  @client = opts.fetch(:client)
  @klass  = opts.fetch(:klass)

  @params = fetch_params
end

Dynamic Method Handling

    This class handles dynamic methods through the <tt>method_missing</tt> method

    #method_missing(method_name, *arguments, &block)  ⇒ <tt>Object</tt>

25
26
27

# File 'lib/helium/metadata.rb', line 25

def method_missing(method_name, *arguments, &block)
  properties[method_name.to_s] || super
end

Instance Method Details

    #id  ⇒ <tt>Object</tt>

13
14
15

# File 'lib/helium/metadata.rb', line 13

def id
  @klass.id
end

    #inspect  ⇒ <tt>Object</tt>

21
22
23

# File 'lib/helium/metadata.rb', line 21

def inspect
  "<Helium::Metadata properties=#{properties}>"
end

    #properties  ⇒ <tt>Object</tt>

17
18
19

# File 'lib/helium/metadata.rb', line 17

def properties
  @params["attributes"]
end

    #respond_to_missing?(method_name, include_private = false)  ⇒ <tt>Boolean</tt>

Returns:

        (<tt>Boolean</tt>)

29
30
31

# File 'lib/helium/metadata.rb', line 29

def respond_to_missing?(method_name, include_private = false)
  properties[method_name.to_s] || super
end

    #update(attributes = {})  ⇒ <tt>Object</tt>

33
34
35
36
37
38
39
40
41
42
43
44
45

# File 'lib/helium/metadata.rb', line 33

def update(attributes = {})
  body = {
    data: {
      attributes: attributes,
      id: id,
      type: "metadata"
    }
  }

  response = @client.patch(path, body: body)
  @params = JSON.parse(response.body)["data"]
  return self
end

  Generated on Wed Apr  5 13:55:54 2017 by
  yard
  0.9.5 (ruby-2.3.1).


text:
package dw.cli;

import java.net.MalformedURLException;

import dw.cli.commands.HelpPrinter;
import dw.xmlrpc.DokuJClient;
import dw.xmlrpc.DokuJClientConfig;
import dw.xmlrpc.exception.DokuException;

public class Program {
	public static void main(String[] args) {
		try {
			Output output = run(args);
			printOutput(output);
			System.exit(output.exitCode);
		} catch (Exception e){
			printException(e);
			System.exit(-1);
		}
	}

	public static Output run(String[] args) throws DokuException {
		OptionParser parser = new OptionParser(args);
		if ( parser.userAskForHelp() ){
			return new HelpPrinter(true).run(buildNullDokuJClient(), parser.getCommandArguments());
		}

		parser.parse();
		if ( ! parser.success() ){
			Output result = new Output();
			result.err = parser.getHelpMessage();
			result.exitCode = parser.success() ? 0 : -1;
			return result;
		}

		CliOptions options = parser.getCliOptions();
		DokuJClient dokuClient = buildDokuClient(options);
		Command command = new CommandFactory().build(options.command);
		return command.run(dokuClient, options.commandArguments);
	}

	private static void printOutput(Output output) {
		if ( output.err != null && !output.err.isEmpty() ){
			System.err.println(output.err);
		}
		if ( output.out != null && !output.out.isEmpty() ){
			System.out.println(output.out);
		}
	}

	private static void printException(Exception e) {
		System.err.println("Error: " + e.getMessage());
	}

	private static DokuJClient buildDokuClient(CliOptions options) throws DokuException{
		if ( ! options.url.toString().endsWith("lib/exe/xmlrpc.php") ){
			throw new RuntimeException("Url should look like http[s]://server/mywiki/lib/exe/xmlrpc.php");
		}
		DokuJClientConfig clientConfig = new DokuJClientConfig(options.url);
		if ( options.user != null ){
			clientConfig.setUser(options.user, options.password);
		}
		clientConfig.setDebug(options.debug);
		DokuJClient dokuClient = new DokuJClient(clientConfig);
		dokuClient.setLogger(null);
		return dokuClient;
	}

	private static DokuJClient buildNullDokuJClient() throws DokuException{
		try {
			return new DokuJClient("http://whatever");
		} catch (MalformedURLException e) {
			throw new RuntimeException(e);
		}
	}

}


text:
// @formatter:off

package com.microsoft.alm.teamfoundation.testmanagement.webapi;

import java.util.ArrayList;

/**
 */
public class TestResultsDetails {

    private String groupByField;
    private ArrayList<TestResultsDetailsForGroup> resultsForGroup;

    public String getGroupByField() {
        return groupByField;
    }

    public void setGroupByField(final String groupByField) {
        this.groupByField = groupByField;
    }

    public ArrayList<TestResultsDetailsForGroup> getResultsForGroup() {
        return resultsForGroup;
    }

    public void setResultsForGroup(final ArrayList<TestResultsDetailsForGroup> resultsForGroup) {
        this.resultsForGroup = resultsForGroup;
    }
}


text:
/*
 * Do not modify this file. This file is generated from the support-2013-04-15.normal.json service model.
 */
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using System.Text;
using System.IO;

using Amazon.Runtime;
using Amazon.Runtime.Internal;

namespace Amazon.AWSSupport.Model
{
    ///
    /// Information about the Trusted Advisor checks returned by the DescribeTrustedAdvisorChecks
    /// operation.
    ///
    public partial class DescribeTrustedAdvisorChecksResponse : AmazonWebServiceResponse
    {
        private List<TrustedAdvisorCheckDescription> _checks = new List<TrustedAdvisorCheckDescription>();

        ///
        /// Gets and sets the property Checks.
        /// <para>
        /// Information about all available Trusted Advisor checks.
        /// </para>
        ///
        public List<TrustedAdvisorCheckDescription> Checks
        {
            get { return this._checks; }
            set { this._checks = value; }
        }

        // Check to see if Checks property is set
        internal bool IsSetChecks()
        {
            return this._checks != null && this._checks.Count > 0;
        }

    }
}


text:
package org.elasticsearch.xpack.runtimefields.query;

import org.elasticsearch.script.Script;
import org.elasticsearch.xpack.runtimefields.mapper.BooleanFieldScript;

public class BooleanScriptFieldExistsQuery extends AbstractBooleanScriptFieldQuery {
    public BooleanScriptFieldExistsQuery(Script script, BooleanFieldScript.LeafFactory leafFactory, String fieldName) {
        super(script, leafFactory, fieldName);
    }

    @Override
    protected boolean matches(int trues, int falses) {
        return (trues | falses) != 0;
    }

    @Override
    public final String toString(String field) {
        if (fieldName().contentEquals(field)) {
            return getClass().getSimpleName();
        }
        return fieldName() + ":" + getClass().getSimpleName();
    }

    // Superclass's equals and hashCode are great for this class
}


text:
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Threading.Tasks;

namespace UniCorn.Http.Test
{
    public class MyHandler : IHttpRequestHandler
    {
        public async Task Handle(IHttpContext context, Func<Task> next)
        {
            //var model = new ModelBinder(new ObjectActivator()).Get<MyModel>(context.Request.QueryString);

            await next().ConfigureAwait(false);
        }
    }

    public class TimingHandler : IHttpRequestHandler
    {
        public async Task Handle(IHttpContext context, Func<Task> next)
        {
            Stopwatch stopWatch = Stopwatch.StartNew();

            await next().ConfigureAwait(false);

            Console.WriteLine($"request {context.Request.Uri} took {stopWatch.Elapsed}");
        }
    }

    public class ErrorHandler : IHttpRequestHandler
    {
        public Task Handle(IHttpContext context, System.Func<Task> next)
        {
            context.Response.ResponseCode = HttpResponseCode.NotFound;
            context.Response.Content = "These are not the droids you are looking for.";

            return Task.CompletedTask;
        }
    }

    public class ExceptionHandler : IHttpRequestHandler
    {
        public async Task Handle(IHttpContext context, Func<Task> next)
        {
            try
            {
                await next().ConfigureAwait(false);
            }
            catch (HttpException ex)
            {
                context.Response.ResponseCode = ex.ResponseCode;

                context.Response.Content = "Error while handling your request. " + ex.Message;
            }
            catch (Exception ex)
            {
                context.Response.ResponseCode = HttpResponseCode.InternalServerError;
                context.Response.Content = "Error while handling your request. " + ex;
            }
        }
    }

    public class FileHandler : IHttpRequestHandler
    {
        public static string DefaultMimeType { get; set; }
        public static string HttpRootDirectory { get; set; }
        public static IDictionary<string, string> MimeTypes { get; private set; }

        static FileHandler()
        {
            DefaultMimeType = "text/plain";

            #region MimeTypes

            MimeTypes = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase) {
            {".asf", "video/x-ms-asf"},
            {".asx", "video/x-ms-asf"},
            {".avi", "video/x-msvideo"},
            {".bin", "application/octet-stream"},
            {".cco", "application/x-cocoa"},
            {".crt", "application/x-x509-ca-cert"},
            {".css", "text/css"},
            {".deb", "application/octet-stream"},
            {".der", "application/x-x509-ca-cert"},
            {".dll", "application/octet-stream"},
            {".dmg", "application/octet-stream"},
            {".ear", "application/java-archive"},
            {".eot", "application/octet-stream"},
            {".exe", "application/octet-stream"},
            {".flv", "video/x-flv"},
            {".gif", "image/gif"},
            {".hqx", "application/mac-binhex40"},
            {".htc", "text/x-component"},
            {".htm", "text/html"},
            {".html", "text/html"},
            {".ico", "image/x-icon"},
            {".img", "application/octet-stream"},
            {".iso", "application/octet-stream"},
            {".jar", "application/java-archive"},
            {".jardiff", "application/x-java-archive-diff"},
            {".jng", "image/x-jng"},
            {".jnlp", "application/x-java-jnlp-file"},
            {".jpeg", "image/jpeg"},
            {".jpg", "image/jpeg"},
            {".js", "application/x-javascript"},
            {".mml", "text/mathml"},
            {".mng", "video/x-mng"},
            {".mov", "video/quicktime"},
            {".mp3", "audio/mpeg"},
            {".mpeg", "video/mpeg"},
            {".mpg", "video/mpeg"},
            {".msi", "application/octet-stream"},
            {".msm", "application/octet-stream"},
            {".msp", "application/octet-stream"},
            {".pdb", "application/x-pilot"},
            {".pdf", "application/pdf"},
            {".pem", "application/x-x509-ca-cert"},
            {".pl", "application/x-perl"},
            {".pm", "application/x-perl"},
            {".png", "image/png"},
            {".prc", "application/x-pilot"},
            {".ra", "audio/x-realaudio"},
            {".rar", "application/x-rar-compressed"},
            {".rpm", "application/x-redhat-package-manager"},
            {".rss", "text/xml"},
            {".run", "application/x-makeself"},
            {".sea", "application/x-sea"},
            {".shtml", "text/html"},
            {".sit", "application/x-stuffit"},
            {".swf", "application/x-shockwave-flash"},
            {".tcl", "application/x-tcl"},
            {".tk", "application/x-tcl"},
            {".txt", "text/plain"},
            {".war", "application/java-archive"},
            {".wbmp", "image/vnd.wap.wbmp"},
            {".wmv", "video/x-ms-wmv"},
            {".xml", "text/xml"},
            {".xpi", "application/x-xpinstall"},
            { ".zip", "application/zip"}};

            #endregion MimeTypes
        }

        private string GetContentType(string path)
        {
            var extension = Path.GetExtension(path) ?? string.Empty;
            if (MimeTypes.ContainsKey(extension))
                return MimeTypes[extension];
            return DefaultMimeType;
        }
        public async Task Handle(IHttpContext context, System.Func<Task> next)
        {
            var requestPath = context.Request.Uri.TrimStart('/');

            var httpRoot = Path.GetFullPath(HttpRootDirectory ?? ".");
            var path = Path.GetFullPath(Path.Combine(httpRoot, requestPath));

            if (!File.Exists(path))
            {
                await next().ConfigureAwait(false);
            }
            else
            {
                await File.OpenRead(path).CopyToAsync(context.Response.ContentStream).ConfigureAwait(false);
            }
        }
    }
}


text:
package com.eaw1805.data.dto.converters;

import com.eaw1805.data.dto.web.economy.GoodDTO;
import com.eaw1805.data.dto.web.economy.StoredGoodDTO;
import com.eaw1805.data.dto.web.economy.WarehouseDTO;
import com.eaw1805.data.managers.beans.GoodManagerBean;
import com.eaw1805.data.model.economy.Good;
import com.eaw1805.data.model.economy.Warehouse;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

/**
 * Convert Warehouse DB objects into WarehouseDTOs.
 */
public final class WarehouseConverter {

    /**
     * Cannot instantiate this class.
     */
    private WarehouseConverter() {
        // empty constructor
    }

    /**
     * Convert the DB object into a DTO.
     *
     * @param value       the DB object.
     * @param goodManager a bean for accessing DB entities of type Good.
     * @return the DTO object.
     */
    public static WarehouseDTO convert(final Warehouse value, final GoodManagerBean goodManager) {
        final WarehouseDTO empireWarehouseDTO = new WarehouseDTO();
        empireWarehouseDTO.setId(value.getId());
        empireWarehouseDTO.setNationId(value.getNation().getId());
        empireWarehouseDTO.setRegionId(value.getRegion().getId());
        empireWarehouseDTO.setGoodsDTO(generateGoodsMap(value, goodManager));
        empireWarehouseDTO.setOriginalGoodsDTO(generateGoodsMap(value, goodManager));
        return empireWarehouseDTO;
    }

    public static HashMap<Integer, StoredGoodDTO> generateGoodsMap(final Warehouse value, final GoodManagerBean goodManager) {
        final HashMap<Integer, StoredGoodDTO> goodsMap = new HashMap<Integer, StoredGoodDTO>();
        for (Integer key : value.getStoredGoodsQnt().keySet()) {
            final StoredGoodDTO goodsDTOmap = new StoredGoodDTO();
            goodsDTOmap.setTpe(key);
            goodsDTOmap.setQte(value.getStoredGoodsQnt().get(key));
            goodsDTOmap.setWarehouseId(value.getId());

            final Good good = goodManager.getByID(key);
            final GoodDTO thisDTO = new GoodDTO();
            thisDTO.setGoodId(key);
            thisDTO.setGoodFactor(good.getGoodFactor());
            thisDTO.setName(good.getName());
            thisDTO.setWeightOfGood(good.getWeightOfGood());
            goodsDTOmap.setGoodDTO(thisDTO);

            goodsMap.put(goodsDTOmap.getTpe(), goodsDTOmap);
        }
        return goodsMap;
    }

    /**
     * Convert the list of DB object into a list of DTO.
     *
     * @param list        the list of DB object.
     * @param goodManager a bean for accessing DB entities of type Good.
     * @return the list of DTO object.
     */
    public static List<WarehouseDTO> convert(final List<Warehouse> list, final GoodManagerBean goodManager) {
        final List<WarehouseDTO> listDTOs = new ArrayList<WarehouseDTO>();
        for (final Warehouse value : list) {
            listDTOs.add(convert(value, goodManager));
        }
        return listDTOs;
    }

}


text:
package org.apache.wicket.util.file;

import java.net.URL;

import javax.servlet.ServletContext;

import org.apache.wicket.util.resource.IResourceStream;
import org.junit.Assert;
import org.junit.Test;
import org.mockito.Mockito;

/**
 * @since 1.5.5
 */
public class WebApplicationPathTest extends Assert
{
	@Test
	public void doNotServeResourcesFromWebInf() throws Exception
	{
		URL webUrl = new URL("file://dummyFile");

		ServletContext context = Mockito.mock(ServletContext.class);
		Mockito.when(context.getResource(Mockito.any(String.class))).thenReturn(webUrl);

		WebApplicationPath path = new WebApplicationPath(context);
		IResourceStream resourceStream = path.find(String.class, "WEB-INF/web.xml");
		assertNull(resourceStream);

		IResourceStream otherResourceStream = path.find(String.class, "any/other/resource");
		assertNotNull(otherResourceStream);

	}
}


text:
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>W25735_extracted</title>
        <link rel="stylesheet" type="text/css" href="style.css" />

                «

    <p class="styleSans12000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">

    <p class="styleSans24.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">Notice of Availability and Appeal Rights
Enerplus: Two Exploratory Bakken and Three Forks Oil Wells Located on One Well PadSnow #149-93—7A-12H and Rain #149-93—7A-12H TF

    <p class="styleSans15.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">The Bureau of Indian Affairs (BIA) is planning to issue administrative approvals related to Two Bakken and Three Forks Oil Wells atop one well pads on the Berthold Reservation as shown
on the attached map. Construction by Enerplus Resources is expected to begin in 2012.

    <p class="styleSans15.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">An environmental assessment (EA) determined that proposed activities will not cause significant impacts to the human environment. An environmental impact statement is not required. Contact Earl Silk, Superintendent at 7 01-627 -657 0 for more
information and/or c0pies of the EA and the Finding of No Significant Impact (FONSI).

    <p class="styleSans15.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">The FONSI is only a finding on environmental impacts - it is not a decision to proceed with an action and cannot be appealed. BIA's decision to proceed with administrative actions can be appealed until August 23, 2012, by contacting:

    <p class="styleSans13.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">United States Department of the Interior
Office of Hearings and Appeals
Interior Board of Indian Appeals
801 N. Quincy Street, Suite 300, Arlington, Va 22203.

    <p class="styleSans14.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">Procedural details are available from the BIA Fort Berthold Agency at 701-627-6570.

    <p class="styleSans1.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">

    <p class="styleSans1.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">

    <p class="styleSans12000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">

    <p class="styleSans1.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">

    <p class="styleSans1.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">
waferi


text:
Desarrollo de gema Ruby: Gestión de Exámenes
=======================
[![Coverage Status](https://coveralls.io/repos/alu0100600810/LPP_T_03/badge.png?branch=desarrollo)](https://coveralls.io/r/alu0100600810/LPP_T_03?branch=master)

## Descripción del equipo

  * Nombre del equipo: **LPP_T_3**
  * Miembros del equipo:
    * Ayose Jesús Castillo Barroso
    * César Ravelo Martínez

## Descripción de la práctica

  La práctica propone implementar una gema Ruby para representar exámenes de preguntas simples con pruebas RSpec para seguir el modelo TDD y su correcto funcionamiento. La estructura del repositorio es la siguiente:

  * [Documentación](doc/)
    * [Documentación de la Práctica](doc/)
    * [Resultados de las Pruebas](doc/pruebas/index.html)
  * [Librerías](lib/)
    * [Gema Ruby](lib/examen/base.rb)
    * [Código fuente de la clase Examen](lib/examen/examen.rb)
    * [Código fuente de la clase Pregunta](lib/examen/pregunta.rb)
    * [Códido fuente de la clase Pregunta Verdadero y Falso](lib/examen/pregunta_verdadero_falso.rb)
  * [RSpec](spec/)
  * [Fichero Rake con las tareas necesarias definidas](Rakefile)
  * Fichero readme con esta documentación

# Examen

Gema Ruby para representar exámenes formados por preguntas de selección simple. La secuencia de preguntas que pueda formar un examen
viene definida como una lista enlazada simple definida en la misma clase Examen donde cada nodo representa una instancia de la clase Pregunta.

## Instalación

Añadir esta linea al Gemfile de su aplicación

```ruby
gem 'examen'
```

y ejecutar:

    $ bundle

O instálelo usted mismo:

    $ gem install examen

## Uso

Para instanciar un objeto Pregunta basta con indicarle:

* Una pregunta
* Una respuesta correcta
* Un conjunto de respuestas erróneas

Puede mostrar por pantalla la pregunta invocando el método [:to_s](lib/examen/pregunta.rb).

Para instanciar un objeto Examen basta con indicarle una instancia de la clase Pregunta.
Puede mostrar por pantalla la pregunta invocando el método [:to_s](lib/examen/examen.rb).


text:
package com.blp.nova.main;

import java.awt.Image;
import java.awt.Point;
import java.awt.Toolkit;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;

import javax.swing.JFrame;

import com.blp.nova.Game;
import com.blp.nova.libs.Reference;

/**
 * Project: CataclysmicBattles

 *
 * Class: Window
 *
 * @author  BossLetsPlays
 *
 */
public class Window {
    private static JFrame frame;

    public static void createWindow(Game game, String title){
        frame = new JFrame(title);
        Toolkit toolkit = Toolkit.getDefaultToolkit();
        Image icon = toolkit.getImage(Reference.RESOURCE_LOCATION + "icon.png");  //This is the image we will be using as our window's icon
        Image cursor = toolkit.getImage(Reference.RESOURCE_LOCATION + "cursor.gif");
        frame.add(game);
        frame.setIconImage(icon); //sets the icon we specified above
        frame.setCursor(toolkit.createCustomCursor(cursor, new Point(frame.getX(), frame.getY()), "cursor"));
        frame.setSize(Game.WIDTH, Game.HEIGHT); //sets the size of our window

        frame.addWindowListener(                                 //adds a listener that we can use to exit the game
                new WindowAdapter(){                             //annonomous inner class
                    public void windowClosing(WindowEvent e){    //annonomous inner method that is called when the red X is pressed
                        Game.exit();
                    }
                }
                );

        frame.setFocusable(true); //This way we are able to use keyboards and our mouse and all that good stuff
        frame.setLocationRelativeTo(null); //makes our frame start in the center of our screen
        frame.setResizable(false); //for now, if we resize our window, we will get a lot of bugs with the graphics
        frame.setVisible(true); //This actually shows the frame/window
        frame.pack(); //packs all our components and settings into one nice frame package (metaphorical of course)
    }

    /**
     * Sets the title of the game
     * @param title the title to be given to the game
     */
    public static void setTitle(String title){
        frame.setTitle(title);
    }

}


text:
import { IterableX } from '../iterable';

class ThrowIterable<TSource> extends IterableX<TSource> {
  private _error: any;

  constructor(error: any) {
    super();
    this._error = error;
  }

  *[Symbol.iterator](): Iterator<TSource> {
    throw this._error;
  }
}

export function _throw<TSource>(error: any): IterableX<TSource> {
  return new ThrowIterable<TSource>(error);
}


text:
SYNONYM

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

#### Published in
Ber. naturw. -lichen Ver. Schwaben und Neuburg 30: 30 (1890)

#### Original name
Hygrophorus persistens Britzelm., 1890

### Remarks
null


text:
function m = gpuGather(m)
%  m = gpuGather(m)
%---------------------------------------------------------------------------
% Gather values of fields for model <m> that exist on the GPU Card.
% Loops over fields and subfields of model fo find any gpuArray objects,
% then pulls the corresponding data to the workspace.
%---------------------------------------------------------------------------
% DES


text:
'use strict';

describe('Filter: ordinalDate', function () {

  // load the filter's module
  beforeEach(module('mementoMovieApp'));

  // initialize a new instance of the filter before each test
  var ordinalDate;
  beforeEach(inject(function ($filter) {
    ordinalDate = $filter('ordinalDate');
  }));

  it('should return the input prefixed with "ordinalDate filter:"', function () {
    var text = 'angularjs';
    expect(ordinalDate(text)).toBe('ordinalDate filter: ' + text);
  });

});


text:
var should = require("should"),
    Proteus = require("proteus"),
    nutil   = require("util")
;

suite("New style properties", function () {

    test("a", function () {
        var obj = Proteus.create(Object.prototype, {
                foo: Proteus.prop("foo"),

                baz: {
                    get: function () {

                    },
                    set: function () {

                    }
                },

                _baz: Proteus.prop("baz").hidden()
            }),
            spec
        ;

        spec = Object.getOwnPropertyDescriptor(obj, "foo");

        spec.value.should.eql("foo");
        spec.enumerable.should.eql(true);
        spec.configurable.should.eql(true);

        spec = Object.getOwnPropertyDescriptor(obj, "baz");

        spec.enumerable.should.eql(false);
        spec.configurable.should.eql(false);
        spec.get.should.be.a("function");
        spec.set.should.be.a("function");

        spec = Object.getOwnPropertyDescriptor(obj, "_baz");

        spec.value.should.eql("baz");
        spec.enumerable.should.eql(false);
        spec.configurable.should.eql(true);
    });
});


text:
package dollar.api;

import org.jetbrains.annotations.NotNull;

@FunctionalInterface
public interface Pipeable {
    @NotNull
    Value pipe(Value... in) throws Exception;
}


text:
package org.knowm.xchange.tradeogre.dto.account;

import java.math.BigDecimal;
import java.util.Map;
import lombok.Data;

@Data
public class TradeOgreBalances {
  private Map<String, BigDecimal> balances;
}


text:
module ::ConfigUpdate
  module TemplatesNode
    include ::ConfigUpdate::LoadConfig
    def node(cruise_config)
      cruise_config.getTemplates()
    end
  end
end


text:
from random import randint, random, sample

import numpy as np

class Obstacle_Tracks(object):
    """
    Class of Function need to Generate a Simple Track
    """

    def __init__(self, WINDOW_HEIGHT, WINDOW_WIDTH,
                 MAX_OBS_HEIGHT, MAX_OBS_WIDTH, N_OBSTABLE_GEN,
                 MIN_GAP, N_TRACKS_GEN):
        # set design parameters:
        self.WINDOW_HEIGHT = WINDOW_HEIGHT
        self.WINDOW_WIDTH = WINDOW_WIDTH
        self.MAX_OBS_HEIGHT = MAX_OBS_HEIGHT
        self.MAX_OBS_WIDTH = MAX_OBS_WIDTH
        self.N_OBSTABLE_GEN = N_OBSTABLE_GEN
        self.MIN_GAP = MIN_GAP
        self.N_TRACKS_GEN = N_TRACKS_GEN
        self.n = self.WINDOW_HEIGHT * self.WINDOW_WIDTH

    @staticmethod
    def user_function(x, y):
        """Various Functions for Controlling how the Wind is Plotted

            1 - (1-x/2+x**5+y**3)*np.exp(-x**2-y**2)

            2- (1-(x+y**3))*np.exp(-(x**2+y**2)/2)

            3- (x**2 + 2 * y**2)

        """
        return x ** 2 + 2 * y ** 2

    @property
    def generate_obstacles(self):
        """
        Given the set of input values generate Obstacles

        :return: List(np.array)
        """
        obstacles = self.get_obstable_metrics
        obstacle_arrays = []

        for nb_obstacle in obstacles:
            empty_array = np.zeros(shape=(self.WINDOW_HEIGHT,
                                          self.WINDOW_WIDTH))
            start_location = 0 if nb_obstacle[2] == 1 else self.WINDOW_HEIGHT
            y, x = start_location - 1, nb_obstacle[3]
            empty_array[y, x] = -1

            for w_value in range(nb_obstacle[0]):
                x_updated = x + w_value

                for h_value in range(nb_obstacle[1]):
                    if nb_obstacle[2] == 1:
                        y_updated = y + h_value
                    else:
                        y_updated = y - h_value
                    # Replace Value
                    empty_array[y_updated, x_updated] = -1

            new_array = self.trim_whitespace(empty_array,
                                             nb_obstacle[2],
                                             self.MIN_GAP)
            obstacle_arrays.append(new_array)

        return obstacle_arrays

    @property
    def get_obstable_metrics(self):
        """
        Randomly generates given input constraints Obstacle characteristics

        :return: list(tuple(int, int, int, int))
        """
        obstacle_details = []

        for nb_obstacle in range(self.N_OBSTABLE_GEN):
            # Width Random Size
            width_obs = randint(1, self.MAX_OBS_WIDTH)
            # Height Random Size
            height_obs = randint(1, self.MAX_OBS_HEIGHT)
            # Location Random Selection - 1 if Upper 0 Lower
            location_obs = 1 if random() > 0.5 else 0

            # Start Location
            location_st_obs = randint(0,
                                      self.WINDOW_WIDTH - width_obs)

            obstacle_details.append((width_obs,
                                     height_obs,
                                     location_obs,
                                     location_st_obs))

        return obstacle_details

    @staticmethod
    def trim_whitespace(matrix, details, min_gap):
        """
        Trims unwanted white space from either of the obstacle

        :param matrix: np.array
        :param details: int (obstacle on upper or lower)
        :param min_gap: int
        :return: np.array
        """
        if details == -1:
            row = matrix[0, ]
        else:
            row = matrix[matrix.shape[0] - 1, ]

        min_left = np.argmin(row)
        min_right = np.argmin(row[::-1])

        if min_left > min_gap:
            matrix = matrix[:, min_left - min_gap:]

        if min_right > min_gap:
            matrix = matrix[:, 0:len(row) - (min_right - min_gap)]

        return matrix

    @property
    def generate_tracks(self):
        """
        Generate the Track from all the Obstacles

        :return: List(np.array)
        """
        obstacles = self.generate_obstacles
        tracks = []

        for nb_track in range(self.N_TRACKS_GEN):
            # Get Subset of the Obstacles Lists
            new_obs = sample(obstacles, randint(int(self.N_OBSTABLE_GEN / 4),
                                                self.N_OBSTABLE_GEN))
            track = np.hstack(tuple(new_obs))
            x = np.linspace(1, track.shape[1], track.shape[1])
            y = np.linspace(1, track.shape[0] + 1, track.shape[0])
            X, Y = np.meshgrid(x, y)

            output = self.user_function(X, Y)
            shape = output.shape
            bins = np.linspace(output.min(),
                               output.max(),
                               6)  # Eight possible states of Wind

            output = np.digitize(output.flatten(), bins)
            output = output.reshape(shape)
            assert track.shape == output.shape

            for i in range(track.shape[1]):  # X

                for j in range(track.shape[0]):

                    if track[j][i] == -1:
                        output[j][i] = -1

            tracks.append(output)

        return tracks


text:
var cdb = require('cartodb.js');
var InfowindowSelectView = require('./infowindow-select-view');
var InfowindowItemsView = require('./infowindow-items-view');
var CarouselCollection = require('../../../../components/custom-carousel/custom-carousel-collection');
var _ = require('underscore');

/**
 * Select for an Infowindow select type.
 */
module.exports = cdb.core.View.extend({

  initialize: function (opts) {
    if (!opts.querySchemaModel) throw new Error('querySchemaModel is required');
    if (!opts.layerInfowindowModel) throw new Error('layerInfowindowModel is required');
    if (!opts.layerDefinitionModel) throw new Error('layerDefinitionModel is required');
    if (!opts.templates) throw new Error('templates is required');
    this._querySchemaModel = opts.querySchemaModel;
    this._layerInfowindowModel = opts.layerInfowindowModel;
    this._layerDefinitionModel = opts.layerDefinitionModel;
    this._templates = opts.templates;

    this._initCollection();
    this._initBinds();
  },

  render: function () {
    this.clearSubViews();
    this.$el.empty();

    this._initViews();
    return this;
  },

  _initCollection: function () {
    this._templatesCollection = new CarouselCollection(
      _.map(this._templates, function (template) {
        return {
          selected: this._layerInfowindowModel.get('template_name') === template.value,
          val: template.value,
          label: template.label,
          template: function () {
            return template.label;
          }
        };
      }, this)
    );
  },

  _initBinds: function () {
    this._layerInfowindowModel.bind('change:template_name', this._renderItems, this);
  },

  _initViews: function () {
    var selectView = new InfowindowSelectView({
      layerInfowindowModel: this._layerInfowindowModel,
      templatesCollection: this._templatesCollection
    });
    this.addView(selectView);
    this.$el.append(selectView.render().el);

    this._renderItems();
  },

  _renderItems: function () {
    if (this._itemsView) {
      this.removeView(this._itemsView);
      this._itemsView.clean();
    }

    this._itemsView = new InfowindowItemsView({
      querySchemaModel: this._querySchemaModel,
      layerInfowindowModel: this._layerInfowindowModel,
      layerDefinitionModel: this._layerDefinitionModel,
      hasValidTemplate: !!this._checkValidTemplate()
    });
    this.addView(this._itemsView);
    this.$el.append(this._itemsView.render().el);
  },

  _checkValidTemplate: function () {
    var template = this._templatesCollection.find(function (mdl) {
      return this._layerInfowindowModel.get('template_name') === mdl.get('val');
    }, this);

    return template && template.get('val') !== '';
  }

});


text:
using FluentAssertions;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Stripe.Client.Sdk.Clients;
using Stripe.Client.Sdk.Models.Arguments;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;

namespace Stripe.Client.Sdk.Tests.Models.Arguments
{
    [TestClass]
    public class AccountBankAccountCreateArgumentsTests
    {
        private AccountBankAccountCreateArguments _args;

        [TestInitialize]
        public void Init()
        {
            _args = GenFu.GenFu.New<AccountBankAccountCreateArguments>();
        }

        [TestMethod]
        public void AccountBankAccountCreateArguments_ExternalAccountIsRequired()
        {
            // Arrange
            _args.BankAccountToken = null;
            _args.BankAccountCreateArguments = null;

            // Act
            Func<IEnumerable<KeyValuePair<string, string>>> func = () => StripeClient.GetModelKeyValuePairs(_args);

            // Assert
            func.Enumerating().ShouldThrow<ValidationException>();
        }

        [TestMethod]
        public void AccountBankAccountCreateArguments_BankAccountTokenTrumpsBankAccountCreateArguments()
        {
            // Arrange
            _args.BankAccountCreateArguments = GenFu.GenFu.New<BankAccountCreateArguments>();

            // Act
            var keyValuePairs = StripeClient.GetModelKeyValuePairs(_args).ToList();

            // Assert
            keyValuePairs.Should().Contain(x => x.Key == "external_account" && x.Value == _args.BankAccountToken);
        }

        [TestMethod]
        public void AccountBankAccountCreateArguments_BankAccountCreateArguments()
        {
            // Arrange
            _args.BankAccountToken = null;
            _args.BankAccountCreateArguments = GenFu.GenFu.New<BankAccountCreateArguments>();

            // Act
            var keyValuePairs = StripeClient.GetModelKeyValuePairs(_args).ToList();

            // Assert
            keyValuePairs.Should().NotContain(x => x.Key == "external_account")
                .And.Contain(x => x.Key == "external_account[object]" && x.Value == "bank_account");
        }

        [TestMethod]
        public void AccountBankAccountCreateArguments_GetOtherKeys()
        {
            // Arrange
            _args.DefaultForCurrency = true;
            _args.Metadata = Data.Metadata;

            // Act
            var keyValuePairs = StripeClient.GetModelKeyValuePairs(_args).ToList();

            // Assert
            keyValuePairs.Should().HaveCount(4)
                .And.Contain(x => x.Key == "external_account")
                .And.Contain(x => x.Key == "default_for_currency")
                .And.Contain(x => x.Key == "metadata[key1]")
                .And.Contain(x => x.Key == "metadata[key2]");
        }
    }
}


text:
.select2-container .select2-selection--single {
    height: 43px !important;
    border-radius: 0 !important;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 43px !important;
    padding-left: 18px !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 43px !important;
}


text:
#ifndef GAME_HPP
#define GAME_HPP

#include <QObject>

class GameEvent;

class Game : public QObject {
	Q_OBJECT

	public:
		Game();

	public slots:
		virtual void manageGameEvent(GameEvent *event) = 0;
		virtual void update() = 0;
};

#endif


text:
using System;
using System.Globalization;
using System.Windows.Controls;
using Xamarin.Forms;
using Xamarin.Forms.Platform.WinPhone;
using IValueConverter = System.Windows.Data.IValueConverter;

namespace ExtendedCells.Forms.Plugin.WindowsPhone.ValueConverters
{
  public class ToNativeFontSizeConverter :  IValueConverter
  {
    public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
    {
      var xamarinFormsFont = (Font)value ;

      //Need a TextBlock so that I can call the extension method
      var tempTextBlock = new TextBlock();

      tempTextBlock.ApplyFont(xamarinFormsFont);

      return tempTextBlock.FontSize;
    }

    public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
    {
      throw new NotImplementedException();
    }
  }
}


text:
import React from 'react';
// import MobileTearSheet from '../../../MobileTearSheet';
import {List, ListItem} from 'material-ui/List';
import Divider from 'material-ui/Divider';
import CommunicationCall from 'material-ui/svg-icons/communication/call';
import CommunicationChatBubble from 'material-ui/svg-icons/communication/chat-bubble';
import {indigo500} from 'material-ui/styles/colors';
import CommunicationEmail from 'material-ui/svg-icons/communication/email';

const ListExampleSimple = () => (

Simple list

      <List>
        <ListItem
          leftIcon={<CommunicationCall color={indigo500} />}
          rightIcon={<CommunicationChatBubble />}
          primaryText="(650) 555 - 1234"
          secondaryText="Mobile"
        />
        <ListItem
          insetChildren
          rightIcon={<CommunicationChatBubble />}
          primaryText="(323) 555 - 6789"
          secondaryText="Work"
        />
      </List>
      <Divider inset />
      <List>
        <ListItem
          leftIcon={<CommunicationEmail color={indigo500} />}
          primaryText="aliconnors@example.com"
          secondaryText="Personal"
        />
        <ListItem
          insetChildren
          primaryText="ali_connors@example.com"
          secondaryText="Work"
        />
      </List>

);

export default ListExampleSimple;