text:
django-proto
=======================

Features
---------

* For Django 1.7
* Twitter Bootstrap_ 3

.. _Bootstrap: https://github.com/twbs/bootstrap

Usage
--------------------------

Name your project first::

    mkvirtualenv project_name

Install Django::

    pip install django

To create the project, run the following command::

    django-admin.py startproject --template=https://github.com/privgrey/django-proto/archive/master.zip --extension=py,rst,html project_name

Set Environment Variable
--------------------------
Set Django settings file before bootstraping::

    export DJANGO_SETTINGS_MODULE=project_name.settings.dev

Add custom environment variables to your postactivate script
--------------------------

Edit your virtualenvs/hackaba/bin/postactivate::

    export DJANGO_SETTINGS_MODULE=hackaba.settings.dev

Install Python packages, Enter the 'requirements' folder::

    pip install -r base.txt

Setup the postgresql database
--------------------------

After Setting up settings/dev.py::

    sudo -u postgres psql
    create USER hackaba with password 'hackaba';
    create DATABASE hackaba with owner hackaba;


text:
package com.netsteadfast.base.model;

public interface OID<T> {
	public T getOid();
}

redpajama_set_name: RedPajamaGithub


text:
package org.assertj.core.internal.bigdecimals;

import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatNullPointerException;
import static org.assertj.core.api.BDDAssertions.then;

import java.math.BigDecimal;

import org.junit.jupiter.api.Test;

class BigDecimalAssert_scale_Test {

  @Test
  void should_be_able_to_use_scale_assertions_on_big_decimal_scale() throws Exception {
    // GIVEN
    BigDecimal threeDecimal = new BigDecimal("1.111");
    // THEN
    then(threeDecimal).scale()
                      .isLessThan(4)
                      .isGreaterThan(2)
                      .isPositive()
                      .returnToBigDecimal()
                      .hasScaleOf(3);
  }

  @Test
  void should_have_a_helpful_error_message_when_scale_assertion_is_used_on_a_null_big_decimal() {
    // GIVEN
    BigDecimal nullBigDecimal = null;
    // WHEN/THEN
    assertThatNullPointerException().isThrownBy(() -> assertThat(nullBigDecimal).scale().isBetween(2, 3))
                                    .withMessage("Can not perform assertions on the scale of a null BigDecimal");
  }

}


text:
package com.jkovacic.ssh2;

/**
 * An exception, thrown at unexpected events during a SSH session
 *
 * @author Jernej Kovacic
 *
 */
public class SshException extends Exception
{
	static final long serialVersionUID = 18L;

	/**
	 * Constructor with a description
	 *
	 * @param desc - description of the exception, later may be retrieved by getMessage
	 */
    SshException(String s)
    {
        super(s);
    }
}


text:
ACCEPTED

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

#### Published in
Annls mycol. 13(5/6): 520 (1915)

#### Original name
Phyllachora congregata Theiss. & Syd., 1915

### Remarks
null


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

import org.flowable.cmmn.api.runtime.CaseInstanceState;
import org.flowable.cmmn.engine.impl.persistence.entity.CaseInstanceEntity;
import org.flowable.cmmn.engine.impl.persistence.entity.PlanItemInstanceEntity;
import org.flowable.cmmn.engine.impl.util.CommandContextUtil;
import org.flowable.common.engine.impl.interceptor.CommandContext;

/**
 * @author Joram Barrez
 */
public class CompleteCaseInstanceOperation extends AbstractDeleteCaseInstanceOperation {

    public CompleteCaseInstanceOperation(CommandContext commandContext, String caseInstanceId) {
        super(commandContext, caseInstanceId);
    }

    public CompleteCaseInstanceOperation(CommandContext commandContext, CaseInstanceEntity caseInstanceEntity) {
        super(commandContext, caseInstanceEntity);
    }

    @Override
    public String getNewState() {
        return CaseInstanceState.COMPLETED;
    }

    @Override
    protected void changeStateForChildPlanItemInstance(PlanItemInstanceEntity planItemInstanceEntity) {
        CommandContextUtil.getAgenda(commandContext).planCompletePlanItemInstanceOperation(planItemInstanceEntity);
    }

    @Override
    public String getDeleteReason() {
        return "cmmn-state-transition-complete-case";
    }

    @Override
    public String toString() {
        StringBuilder strb = new StringBuilder();
        strb.append("[Complete case instance] case instance ");
        strb.append(caseInstanceEntity != null ? caseInstanceEntity.getId() : caseInstanceEntityId);
        return strb.toString();
    }

}


text:
<?xml version='1.0' encoding='UTF-8'?>
<iati-activities generated-datetime="2014-09-08T21:20:34.189315">
  <iati-activity xml:lang="en" hierarchy="1" default-currency="USD" last-updated-datetime="2013-07-09T10:34:11">
<reporting-org type="22" ref="NL-KVK-41198677">HIVOS</reporting-org>
<iati-identifier>NL-2-1006866</iati-identifier>
<title>Research to allow for the evaluation of transparency and accountability initiatives funded through the Africa Technology and Transparency Initiative. </title>
<description>
IPRE will carry out research that builds on an initial assessment that was carried out in first half of 2012.

This grant will allow IPRE to find out if there is evidence that partners' activities are associated with accountability outcomes of interest and what strategic and contextual factors make a transparency and accountability initiative (TAI) more or less likely to succeed.
</description>
<activity-status code="2">Implementation</activity-status>
<activity-date type="start-actual" iso-date="2013-06-30"/>
<activity-date type="end-actual" iso-date="2014-01-14"/>
<contact-info>
<organisation>The International Policy Research and Evaluation Group</organisation>
<telephone>+6503802385</telephone>
<mailing-address>2090 Pacific Avenue, San Francisco, 94109, United States of America</mailing-address>
</contact-info>
<participating-org xml:lang="en" role="Implementing">The International Policy Research and Evaluation Group</participating-org>
<recipient-country code="GH">Ghana</recipient-country>
<sector code="151" percentage="100" vocabulary="DAC-3">Government & Civil society</sector>
<policy-marker/>
<budget><value value-date="2013-06-20" currency="USD">70000</value></budget>
<transaction>
<transaction-type code="D">Disbursement</transaction-type>
<provider-org>Omidyar Network</provider-org>
<receiver-org>The International Policy Research and Evaluation Group</receiver-org>
<value value-date="2013-12-02" currency="USD">2000</value>
<transaction-date iso-date="2013-12-02"/>
</transaction>
<transaction>
<transaction-type code="D">Disbursement</transaction-type>
<provider-org>Omidyar Network</provider-org>
<receiver-org>The International Policy Research and Evaluation Group</receiver-org>
<value value-date="2013-07-10" currency="USD">68000</value>
<transaction-date iso-date="2013-07-10"/>
</transaction>
</iati-activity>
  <iati-activity xml:lang="en" hierarchy="1" default-currency="USD" last-updated-datetime="2013-04-02T15:49:25">
<reporting-org type="22" ref="NL-KVK-41198677">HIVOS</reporting-org>
<iati-identifier>NL-2-1006190</iati-identifier>
<title>iSpace, Ghana: Supporting an innovation space in Ghana</title>
<description>
iSpace is a new technology community hub created to support innovation in Ghana. The hub will act as the home to a community of technologist (developers, entrepreneurs, etc) to gather either individually or together to hack together ideas and build innovative solutions.

The project will create a space for tech enthusiasts in Ghana to meet, collaborate and network. iSpace will host events and training that improve the capabilities of the local tech community. The project will also host and provide labs that meet the needs of the local tech community and liaise between the local tech community and the global tech community.
</description>
<activity-status code="2">Implementation</activity-status>
<activity-date type="start-actual" iso-date="2013-03-29"/>
<activity-date type="end-actual" iso-date="2015-11-29"/>
<contact-info>
<organisation>ISPACE FOUNDATION</organisation>
<telephone>+447582222326</telephone>
<mailing-address>G51 Guava Crescent, Accra, , Ghana</mailing-address>
</contact-info>
<participating-org xml:lang="en" role="Implementing">ISPACE FOUNDATION</participating-org>
<recipient-country code="GH">Ghana</recipient-country>
<sector code="151" percentage="100" vocabulary="DAC-3">Government & Civil society</sector>
<policy-marker/>
<budget><value value-date="2013-02-05" currency="USD">70000</value></budget>
<transaction>
<transaction-type code="D">Disbursement</transaction-type>
<provider-org>Omidyar Network</provider-org>
<receiver-org>ISPACE FOUNDATION</receiver-org>
<value value-date="2014-04-10" currency="USD">30000</value>
<transaction-date iso-date="2014-04-10"/>
</transaction>
<transaction>
<transaction-type code="D">Disbursement</transaction-type>
<provider-org>Omidyar Network</provider-org>
<receiver-org>ISPACE FOUNDATION</receiver-org>
<value value-date="2013-04-17" currency="USD">40000</value>
<transaction-date iso-date="2013-04-17"/>
</transaction>
</iati-activity>
  <iati-activity xml:lang="en" hierarchy="1" default-currency="USD" last-updated-datetime="2014-02-11T10:26:58">
<reporting-org type="22" ref="NL-KVK-41198677">HIVOS</reporting-org>
<iati-identifier>NL-2-1008151</iati-identifier>
<title>Evaluation of transparency and accountability initiatives </title>
<description>
The IPRE will carry out research that builds on an initial assessment that was carried out in 2013. This is an impact evaluation assessment of ATTI grantee, ISODEC that is working in two districts in Ghana. This grant will allow IPRE to complete data analysis, prepare and submit a final report.
</description>
<activity-status code="2">Implementation</activity-status>
<activity-date type="start-actual" iso-date="2013-12-31"/>
<activity-date type="end-actual" iso-date="2014-08-30"/>
<contact-info>
<organisation>The International Policy Research and Evaluation Group</organisation>
<telephone>+6503802385</telephone>
<mailing-address>2090 Pacific Avenue, San Francisco, 94109, United States of America</mailing-address>
</contact-info>
<participating-org xml:lang="en" role="Implementing">The International Policy Research and Evaluation Group</participating-org>
<recipient-country code="GH">Ghana</recipient-country>
<sector code="151" percentage="100" vocabulary="DAC-3">Government & Civil society</sector>
<policy-marker/>
<budget><value value-date="2013-12-26" currency="USD">20000</value></budget>
<transaction>
<transaction-type code="D">Disbursement</transaction-type>
<provider-org>Omidyar Network</provider-org>
<receiver-org>The International Policy Research and Evaluation Group</receiver-org>
<value value-date="2014-01-22" currency="USD">19000</value>
<transaction-date iso-date="2014-01-22"/>
</transaction>
</iati-activity>
  <iati-activity xml:lang="en" hierarchy="1" default-currency="GBP" last-updated-datetime="2014-06-18T10:25:08">
<reporting-org type="22" ref="NL-KVK-41198677">HIVOS</reporting-org>
<iati-identifier>NL-2-1008564</iati-identifier>
<title>"Our City, Our Say". Increasing Women's Voice in Governance in Ghana</title>
<description>
Global Communities, in partnership with the Sekondi-Takoradi Metropolitan Assembly (STMA) would like to increase participation by poor residents in prioritizing and improving municipal service delivery.

This shall be done by making it easier for citizens to get information from and to STMA municipal employees using Citizen report card (CRC) and text messages. The project shall work with existing citizen report card teams to engage municipal workers on service delivery.

The project builds on a pilot project that developed citizen report cards which identified gaps in service delivery and also supported the development of a client service unit through which Municipal employees provide information to citizens through the use of a toll free line.

The Making All Voices Count grant would be used to integrate monthly interactive radio call-in program to report on progress on service delivery gaps for the citizen report cards. The grant would also provide automation of the process through which citizens raise issues through the hotline and client service unit and this automation would also allow for the tracking and analysis of issues from when they are raised to when they are/ are not resolved.
</description>
<activity-status code="2">Implementation</activity-status>
<activity-date type="start-actual" iso-date="2014-06-01"/>
<activity-date type="end-actual" iso-date="2016-01-31"/>
<contact-info>
<organisation>Cooperative Housing Foundation</organisation>
<telephone>+1 301 587 4700</telephone>
<mailing-address>8601 Georgia Avenue, Suite 800, Silver Spring, 20910, United States of America</mailing-address>
</contact-info>
<participating-org xml:lang="en" role="Implementing">Cooperative Housing Foundation</participating-org>
<recipient-country code="GH">Ghana</recipient-country>
<policy-marker/>
<budget><value value-date="2014-05-29" currency="GBP">94840</value></budget>
<transaction>
<transaction-type code="D">Disbursement</transaction-type>
<provider-org>Making All Voices Count</provider-org>
<receiver-org>Cooperative Housing Foundation</receiver-org>
<value value-date="2014-06-25" currency="GBP">80000</value>
<transaction-date iso-date="2014-06-25"/>
</transaction>
</iati-activity>
</iati-activities>


text:
@echo off
SET scriptdir=%~dp0
call powershell -NoProfile %scriptdir%\push-nugets.ps1
if %errorlevel% neq 0 exit /b %errorlevel%


text:
package Main;

import java.awt.Component;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import java.sql.ResultSet;
import java.sql.SQLException;

import javax.imageio.ImageIO;
import javax.swing.DefaultComboBoxModel;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JFileChooser;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JRadioButton;
import javax.swing.JTextArea;
import javax.swing.JTextField;
import javax.swing.border.EmptyBorder;

public class EditStudent extends JFrame {

	private JPanel contentPane;
	private JComboBox txtLevel;
	private JTextField txtPhoneNumber;
	private JTextField txtLocalGov;
	private JComboBox txtDepartment;
	private JTextField txtMatricNo;
	private JTextField txtLastName;
	private JTextField txtMiddleName;
	private JTextField txtFirstName;
	private JTextField txtDateOfBirth;
	private JTextArea txtAddress;
	private JTextField txtNextOfKin;
	private JTextField txtNitionality;
	JComboBox comReligion, comStatus, comState;
	JTextArea txtNextOfKinAddress;
	ResultSet rs;
	DatabaseManager database = new DatabaseManager();
	private JTextField txtNextOfKinNumber;
	BufferedImage myPicture;
	JLabel picLabel;
	JPanel panel;

	/**
	 * Create the frame.
	 */
	public EditStudent(int id) {
		setTitle("Insert New Student");
		this.setVisible(true);
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(100, 100, 949, 754);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		setContentPane(contentPane);
		contentPane.setLayout(null);

		JLabel lblMatricNumber = new JLabel("MATRIC NUMBER:");
		lblMatricNumber.setBounds(8, 164, 123, 15);
		contentPane.add(lblMatricNumber);

		JLabel lblSex = new JLabel("SEX:");
		lblSex.setBounds(534, 366, 70, 18);
		contentPane.add(lblSex);

		JTextArea textArea = new JTextArea();
		textArea.setBounds(202, 215, 1, 15);
		contentPane.add(textArea);

		JLabel lblDepartment = new JLabel("FACULTY");
		lblDepartment.setBounds(8, 215, 125, 15);
		contentPane.add(lblDepartment);

		JLabel lblLevel = new JLabel("LEVEL:");
		lblLevel.setBounds(0, 148, 70, -21);
		contentPane.add(lblLevel);

		JLabel lblPhoneNumber = new JLabel("PHONE NUMBER:");
		lblPhoneNumber.setBounds(8, 365, 134, 15);
		contentPane.add(lblPhoneNumber);

		JLabel lblStateOfOrigin = new JLabel("STATE OF ORIGIN:");
		lblStateOfOrigin.setBounds(0, 178, 149, -21);
		contentPane.add(lblStateOfOrigin);

		JLabel lblLocalGovtArea = new JLabel("LOCAL GOVT. AREA:");
		lblLocalGovtArea.setBounds(10, 408, 139, 15);
		contentPane.add(lblLocalGovtArea);

		JLabel lblDateOfBirth = new JLabel("DATE  OF BIRTH:");
		lblDateOfBirth.setBounds(530, 325, 111, 15);
		contentPane.add(lblDateOfBirth);

		JLabel lblFirstName = new JLabel("FIRST NAME:");
		lblFirstName.setBounds(8, 28, 123, 15);
		contentPane.add(lblFirstName);

		JLabel lblMiddleName = new JLabel("MIDDLE NAME:");
		lblMiddleName.setBounds(8, 73, 111, 19);
		contentPane.add(lblMiddleName);

		txtLevel = new JComboBox();
		txtLevel.setModel(new DefaultComboBoxModel(new String[] { "100", "200",
				"300", "400", "500", "600", "700" }));
		txtLevel.setBounds(158, 317, 254, 25);
		contentPane.add(txtLevel);

		JLabel lblLastName = new JLabel("LAST NAME:");
		lblLastName.setBounds(8, 111, 91, 25);
		contentPane.add(lblLastName);

		JLabel lblReligion = new JLabel("RELIGION:");
		lblReligion.setBounds(530, 267, 70, 18);
		contentPane.add(lblReligion);

		JButton btnComputeStudentsResult = new JButton("Update ");
		btnComputeStudentsResult.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
				int error = 0;
				/*
				 * for (Component C: this.getComponents()){ if (C instanceof
				 * JTextField || C instanceof JTextArea){ } }
				 */
				if (txtFirstName.getText() == "")
					error += 1;
				if (txtFirstName.getText() == "")
					error += 1;
				if (txtLastName.getText() == "")
					error += 1;
				if (txtMiddleName.getText() == "")
					error += 1;
				if (txtMatricNo.getText() == "")
					error += 1;
				if (txtDateOfBirth.getText() == "")
					error += 1;
				if (txtPhoneNumber.getText() == "")
					error += 1;
				if (txtNextOfKin.getText() == "")
					error += 1;
				if (txtNextOfKinNumber.getText() == "")
					error += 1;
				if (txtNextOfKinAddress.getText() == "")
					error += 1;
				if (txtAddress.getText() == "")
					error += 1;
				if (txtLocalGov.getText() == "")
					error += 1;
				if (txtNitionality.getText() == "")
					error += 1;
				if (error != 0) {
					JOptionPane.showMessageDialog(null, "Error", "Error",
							JOptionPane.ERROR_MESSAGE);
				} else {

					updateStudent();
					JOptionPane.showMessageDialog((Component) null,
							"Registration Completed,\n New Students Added",
							"Successful", JOptionPane.INFORMATION_MESSAGE);
					// database.closeConnection();
					EditStudent.this.setVisible(false);
					new Details();

				}

			}
		});
		btnComputeStudentsResult.setBounds(364, 678, 139, 25);
		contentPane.add(btnComputeStudentsResult);

		JButton btnBack = new JButton("Cancel");
		btnBack.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {

				new Details();
				EditStudent.this.setVisible(false);
				EditStudent.this.dispose();
			}
		});
		btnBack.setBounds(515, 678, 139, 25);
		contentPane.add(btnBack);

		JLabel lblLevel_1 = new JLabel("LEVEL:");
		lblLevel_1.setBounds(12, 322, 70, 15);
		contentPane.add(lblLevel_1);

		JLabel lblMaritalStatus = new JLabel("MARITAL STATUS:");
		lblMaritalStatus.setBounds(534, 218, 139, 15);
		contentPane.add(lblMaritalStatus);

		JButton btnUpload = new JButton("Upload");
		btnUpload.addActionListener(new ActionListener() {

			public void actionPerformed(ActionEvent arg0) {
				// Create a file chooser
				final JFileChooser fc = new JFileChooser();
				fc.addChoosableFileFilter(new ImageFilter());
				int returnVal = fc.showDialog(EditStudent.this,
						"Upload Picture");

				if (returnVal == JFileChooser.APPROVE_OPTION) {
					File profilePicture = fc.getSelectedFile();

					// This is where a real application would open the file.

					String path = profilePicture.getAbsolutePath();
					// JOptionPane.showMessageDialog((Component)null,
					// profilePicture.getAbsolutePath(),"Successful",
					// JOptionPane.INFORMATION_MESSAGE);

					try {
						myPicture = ImageIO.read(new File(profilePicture
								.getAbsolutePath()));
					} catch (IOException e1) {
						e1.printStackTrace();
					}

					picLabel = new JLabel(new ImageIcon(myPicture));
					panel.add(picLabel);
					panel = new JPanel();
					panel.setBounds(528, 62, 139, 118);
					contentPane.add(panel);

				}
			}
		});
		btnUpload.setBounds(695, 26, 117, 25);
		contentPane.add(btnUpload);

		txtPhoneNumber = new JTextField();
		txtPhoneNumber.setColumns(10);
		txtPhoneNumber.setBounds(158, 360, 254, 25);
		contentPane.add(txtPhoneNumber);

		txtLocalGov = new JTextField();
		txtLocalGov.setBounds(158, 408, 254, 25);
		contentPane.add(txtLocalGov);
		txtLocalGov.setColumns(10);

		JRadioButton rdbtnMale = new JRadioButton("Male");
		rdbtnMale.setBounds(663, 391, 149, 23);
		contentPane.add(rdbtnMale);

		JRadioButton rdbtnFemaile = new JRadioButton("Female");
		rdbtnFemaile.setBounds(664, 364, 149, 23);
		contentPane.add(rdbtnFemaile);

		comStatus = new JComboBox();
		comStatus.setModel(new DefaultComboBoxModel(new String[] { "Single",
				"Married" }));
		comStatus.setBounds(673, 213, 242, 24);
		contentPane.add(comStatus);

		comReligion = new JComboBox();
		comReligion.setModel(new DefaultComboBoxModel(new String[] {
				"Christianity", "Islam", "Others" }));
		comReligion.setBounds(673, 264, 242, 24);
		contentPane.add(comReligion);

		JLabel label = new JLabel("DEPARTMENT:");
		label.setBounds(10, 266, 125, 15);
		contentPane.add(label);

		txtDepartment = new JComboBox();
		txtDepartment.setBounds(158, 264, 254, 25);
		contentPane.add(txtDepartment);

		txtMatricNo = new JTextField();
		txtMatricNo.setColumns(10);
		txtMatricNo.setBounds(158, 162, 254, 25);
		contentPane.add(txtMatricNo);

		txtLastName = new JTextField();
		txtLastName.setColumns(10);
		txtLastName.setBounds(158, 114, 254, 25);
		contentPane.add(txtLastName);

		txtMiddleName = new JTextField();
		txtMiddleName.setColumns(10);
		txtMiddleName.setBounds(158, 70, 254, 25);
		contentPane.add(txtMiddleName);

		txtFirstName = new JTextField();
		txtFirstName.setColumns(10);
		txtFirstName.setBounds(158, 26, 254, 25);
		contentPane.add(txtFirstName);

		JComboBox comFaculty = new JComboBox();
		comFaculty.setModel(new DefaultComboBoxModel(new String[] { "Sciences",
				"Management Sciences", "Art", "Agricultural Sciences", "Law",
				"Education", "Social Sciences", "College Of Medicine",
				"Engineering" }));
		comFaculty.setBounds(158, 210, 254, 24);
		contentPane.add(comFaculty);

		txtDateOfBirth = new JTextField();
		txtDateOfBirth.setColumns(10);
		txtDateOfBirth.setBounds(673, 320, 242, 25);
		contentPane.add(txtDateOfBirth);

		JLabel lblStateOfOrigin_1 = new JLabel("STATE OF ORIGIN:");
		lblStateOfOrigin_1.setBounds(8, 461, 139, 15);
		contentPane.add(lblStateOfOrigin_1);

		comState = new JComboBox();
		comState.setModel(new DefaultComboBoxModel(new String[] { "Anambra",
				"Enugu", "Akwa Ibom", "Adamawa", "Abia", "Bauchi", "Bayelsa",
				"Benue", "Borno", "Cross River", "Delta", "Ebonyi", "Edo",
				"Ekiti", "Gombe", "Imo", "Jigawa", "Kaduna", "Kano", "Katsina",
				"Kebbi", "Kogi", "Kwara", "Lagos", "Nasarawa", "Niger", "Ogun",
				"Ondo", "Osun", "Oyo", "Plateau", "Rivers", "Sokoto", "Taraba",
				"Yobe", "Zamfara" }));
		comState.setBounds(158, 456, 254, 24);
		contentPane.add(comState);

		txtAddress = new JTextArea();
		txtAddress.setBounds(673, 433, 242, 67);
		contentPane.add(txtAddress);
		txtAddress.setColumns(10);

		JLabel lblAddress = new JLabel("ADDRESS:");
		lblAddress.setBounds(534, 433, 70, 15);
		contentPane.add(lblAddress);

		JLabel lblNextOfKin = new JLabel("NEXT OF KIN");
		lblNextOfKin.setBounds(100, 499, 119, 15);
		contentPane.add(lblNextOfKin);

		txtNextOfKin = new JTextField();
		txtNextOfKin.setColumns(10);
		txtNextOfKin.setBounds(158, 526, 254, 25);
		contentPane.add(txtNextOfKin);

		JLabel lblNewLabel = new JLabel("NAME:");
		lblNewLabel.setBounds(8, 515, 134, 47);
		contentPane.add(lblNewLabel);

		txtNextOfKinAddress = new JTextArea();
		txtNextOfKinAddress.setColumns(10);
		txtNextOfKinAddress.setBounds(158, 599, 254, 67);
		contentPane.add(txtNextOfKinAddress);

		JLabel label_1 = new JLabel("ADDRESS:");
		label_1.setBounds(8, 599, 70, 15);
		contentPane.add(label_1);

		JLabel lblNationality = new JLabel("NATIONALITY");
		lblNationality.setBounds(534, 520, 107, 15);
		contentPane.add(lblNationality);

		txtNitionality = new JTextField();
		txtNitionality.setColumns(10);
		txtNitionality.setBounds(673, 518, 242, 25);
		contentPane.add(txtNitionality);

		txtNextOfKinNumber = new JTextField();
		txtNextOfKinNumber.setColumns(10);
		txtNextOfKinNumber.setBounds(158, 562, 254, 25);
		contentPane.add(txtNextOfKinNumber);

		JLabel lblPhoneNumber_1 = new JLabel("Phone Number:");
		lblPhoneNumber_1.setBounds(8, 562, 111, 15);
		contentPane.add(lblPhoneNumber_1);

		fillDepartmentList();
		fillDetails(id);

	}

	public void updateStudent() {
		// create new student profile
		database.insertDetails(txtFirstName.getText(), txtLastName.getText(),
				txtMiddleName.getText(), txtMatricNo.getText(), txtDateOfBirth
						.getText(), comReligion.getSelectedItem().toString(),
				"male", comStatus.getSelectedItem().toString(), txtPhoneNumber
						.getText(), txtDepartment.getSelectedItem().toString(),
				txtNextOfKin.getText(), txtNextOfKinNumber.getText(),
				txtNextOfKinAddress.getText(), txtAddress.getText(),
				"Gaudian Name Here", txtLocalGov.getText(), comState
						.getSelectedItem().toString(), txtLevel
						.getSelectedItem().toString(), txtNitionality.getText());

		database.creatTableCourse(txtMatricNo.getText().trim());
	}

	public void fillDepartmentList() {

		txtDepartment.removeAllItems();
		try {
			rs = database.returnDepartmentList();
			while (rs.next()) {
				int idReturnDepartment = rs.getInt(DatabaseManager.KEY_ROWID);
				String departmentReturned = rs
						.getString(DatabaseManager.KEY_DEPARTMENT);
				DepartmentObject object1 = new DepartmentObject(
						idReturnDepartment, departmentReturned);
				txtDepartment.addItem(object1);
			}

		} catch (SQLException e) {
		}
   }

	public void fillDetails(int id){

		try {
			rs = database.searchQuerySingle(id);
			while(rs.next()){
				String firstName = rs.getString(DatabaseManager.KEY_FIRST_NAME);
				txtFirstName.setText(firstName);
				String lastName = rs.getString(DatabaseManager.KEY_LAST_NAME);
				txtLastName.setText(lastName);
				String middleName = rs.getString(DatabaseManager.KEY_MIDDLE_NAME);
				txtMiddleName.setText(middleName);
				String matric = rs.getString(DatabaseManager.KEY_MATRIC);
				txtMatricNo.setText(matric);
				String birth = rs.getString(DatabaseManager.KEY_DATE_OF_BIRTH);
				txtDateOfBirth.setText(birth);
				String phoneNumber =  rs.getString(DatabaseManager.KEY_PHONE);
				txtPhoneNumber.setText(phoneNumber);
				String nextOfKin =  rs.getString(DatabaseManager.KEY_NEXT_OF_KIN);
				txtNextOfKin.setText(nextOfKin);
				String nextOfKinNumber =  rs.getString(DatabaseManager.KEY_NEXT_OF_KIN_NUMBER);
				txtNextOfKinNumber.setText(nextOfKinNumber);
				String homeAddress =  rs.getString(DatabaseManager.KEY_HOME_ADDRESS);
				txtAddress.setText(homeAddress);
				String localGov =  rs.getString(DatabaseManager.KEY_LOCAL_GOV);
				txtLocalGov.setText(localGov);
				String guiadianName =  rs.getString(DatabaseManager.KEY_NEXT_OF_KIN_ADDRESS);
				String nationality =  rs.getString(DatabaseManager.KEY_NATIONALITY);
				txtNitionality.setText(nationality);

				// mo guidianName field
//				String state =  rs.getString(DatabaseManager.KEY_STATE);
//				String level =  rs.getString(DatabaseManager.KEY_LEVEL);
//				String religion =  rs.getString(DatabaseManager.KEY_RELIGION);
//				String sex =  rs.getString(DatabaseManager.KEY_SEX);
//				String maritalStatus = rs.getString(DatabaseManager.KEY_MARITAL_STATUS);
//				String department =  rs.getString(DatabaseManager.KEY_DEPARTMENT);
//				txtDepartment.se))co(department);
//
			}

		} catch (SQLException e) {
			JOptionPane.showMessageDialog(this,  e.getMessage() + id);
		}
	}

}


text:
"""Tests for launchpad.launch.worker_manager."""

import os
import signal
import threading
import time

from absl.testing import absltest

from launchpad.launch import worker_manager
import mock

class WorkerManagerTest(absltest.TestCase):

  def setUp(self):
    super().setUp()
    worker_manager._HAS_MAIN_MANAGER = False
    self._sigterm_patcher = mock.patch.object(
        signal, 'SIGTERM', new=signal.SIGUSR1)
    self._sigterm_patcher.start()
    self._sigint_patcher = mock.patch.object(
        signal, 'SIGINT', new=signal.SIGUSR2)
    self._sigint_patcher.start()
    self._manager = worker_manager.WorkerManager()
    self.addCleanup(self._manager.cleanup_after_test, self)

  def tearDown(self):
    self._sigterm_patcher.stop()
    self._sigint_patcher.stop()
    super().tearDown()

  def test_wait_for_stop(self):

    def waiter():
      self.assertTrue(self._manager.wait_for_stop())

    self._manager.thread_worker('worker', waiter)
    os.kill(os.getpid(), signal.SIGTERM)
    self.assertTrue(self._manager.wait_for_stop())

  def test_stop_event(self):

    def waiter():
      self.assertTrue(self._manager.stop_event().wait())

    self._manager.thread_worker('worker', waiter)
    os.kill(os.getpid(), signal.SIGTERM)
    self.assertTrue(self._manager.wait_for_stop())

  def test_wait_for_stop_timeout(self):
    checks_done = threading.Event()

    def waiter():
      self.assertFalse(self._manager.wait_for_stop(0))
      self.assertFalse(self._manager.wait_for_stop(0.1))
      checks_done.set()
      self.assertTrue(self._manager.wait_for_stop(10))

    self._manager.thread_worker('worker', waiter)
    self.assertTrue(checks_done.wait())
    os.kill(os.getpid(), signal.SIGTERM)
    self.assertTrue(self._manager.wait_for_stop())

  def test_slow_termination(self):
    def waiter():
      self.assertTrue(self._manager.wait_for_stop())
      time.sleep(1)

    self._manager.thread_worker('worker', waiter)
    os.kill(os.getpid(), signal.SIGTERM)
    self.assertTrue(self._manager.wait_for_stop())

  def test_system_exit(self):
    def waiter():
      self.assertTrue(self._manager.wait_for_stop(100.0))

    self._manager.thread_worker('worker', waiter)
    os.kill(os.getpid(), signal.SIGTERM)
    self.assertTrue(self._manager.wait_for_stop())

  def test_stop_and_wait(self):
    def waiter():
      self.assertTrue(self._manager.wait_for_stop())

    self._manager.thread_worker('worker1', waiter)
    self._manager.thread_worker('worker2', waiter)
    self._manager.thread_worker('worker3', waiter)
    self._manager.stop_and_wait()

  def test_failure_wait(self):
    def waiter():
      self.assertTrue(self._manager.wait_for_stop())

    def failure():
      raise Exception('Error')

    self._manager.thread_worker('waiter', waiter)
    self._manager.thread_worker('failure', failure)
    with self.assertRaisesRegexp(
        Exception, 'Error'):
      self._manager.wait(['waiter'])
    self._manager.wait()

  def test_return_on_first_completed(self):
    def waiter():
      self.assertTrue(self._manager.wait_for_stop())

    def worker():
      pass

    self._manager.thread_worker('waiter', waiter)
    self._manager.thread_worker('worker', worker)
    self._manager.wait(return_on_first_completed=True)

  def test_dont_raise_error(self):
    def failure():
      raise Exception('Error')

    self._manager.thread_worker('failure', failure)
    self._manager.wait(raise_error=False)
    with self.assertRaisesRegexp(
        Exception, 'Error'):
      self._manager.wait()

  def test_process_worker_stop(self):
    self._manager.process_worker('sleep', ['sleep', '3600'])
    self._manager.stop_and_wait()

  def test_process_worker_failure(self):
    self._manager.process_worker('failure', ['cat', 'missing_file'])
    with self.assertRaisesRegexp(
        RuntimeError, 'One of the workers exited'):
      self._manager.wait()

  def test_two_worker_managers(self):
    another_manager = worker_manager.WorkerManager()
    self.assertGreater(self._manager._termination_notice_secs, 0)
    # The other WM won't duplicate the "countdown-and-sigkill" logic.
    self.assertEqual(another_manager._termination_notice_secs, -1)
    self.assertIn(self._manager._stop_by_user,
                  worker_manager._SIGNAL_HANDLERS[signal.SIGINT])
    # The other WM will still be able to handle signal correctly.
    self.assertIn(another_manager._stop_by_user,
                  worker_manager._SIGNAL_HANDLERS[signal.SIGINT])

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


text:
import os

from IPython.utils.path import get_ipython_dir
import requests

ip_dir = get_ipython_dir()
nbext_dir = os.path.join(ip_dir, 'nbextensions')

def install_files(url, dir, files):
    base_url = url + '/' + dir
    base_path = os.path.join(nbext_dir, dir)
    try:
        os.makedirs(base_path)
    except OSError:
        pass
    for f in files:
        url = '/'.join([base_url]+f)
        path = os.path.join(base_path, *f)
        try:
            os.makedirs(os.path.split(path)[0])
        except OSError:
            pass
        r = requests.get(url)
        with open(path, 'wb') as f:
            print('installing: %s' % path)
            f.write(r.content)

leaflet_url = 'http://cdn.leafletjs.com'
leaflet_dir = 'leaflet-0.7.2'
leaflet_files = [
    ['leaflet.css',],
    ['leaflet.js',],
    ['images','layers.png'],
    ['images','layers-2x.png'],
]

install_files(leaflet_url, leaflet_dir, leaflet_files)

leaflet_draw_url = 'http://cdnjs.cloudflare.com/ajax/libs/'
leaflet_draw_dir = 'leaflet.draw/0.2.3'
leaflet_draw_files = [
    ['leaflet.draw.css',],
    ['leaflet.draw.js',],
    ['images','spritesheet.png'],
    ['images','spritesheet-2x.png']
]

install_files(leaflet_draw_url, leaflet_draw_dir, leaflet_draw_files)


text:
package io.cdap.mmds.spec;

import java.util.Map;

/**
 * A double Modeler parameter.
 */
public class DoubleParam extends Param<Double> {
  private final ParamSpec spec;

  public DoubleParam(String name, String label, String description, double defaultVal,
                     Range range, Map<String, String> params) {
    super(name, description, defaultVal, params);
    spec = new ParamSpec("double", name, label, description, String.valueOf(defaultVal), null, range);
  }

  @Override
  protected Double parseVal(String strVal) {
    try {
      return Double.parseDouble(strVal);
    } catch (NumberFormatException e) {
      throw new NumberFormatException(
        String.format("Invalid modeler parameter %s=%s. Must be a valid double.", name, strVal));
    }
  }

  @Override
  public ParamSpec getSpec() {
    return spec;
  }
}


text:
<!DOCTYPE html>

    <meta charset="UTF-8">
    <meta name="format-detection" content="telephone=no">
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"/>

打开标准页面

打开标准页面(显示Header
    More)

打开全屏页面

    打开Tab页面

开启pullRefresh

启动pullRefresh

pullRefresh刷新完成

禁用pullRefresh

    showDialog测试

showLoading测试

http get 请求

>>loadJavaScript#H5#end:'+new Date().getTime());
        var start = new Date().getTime();
        var str = JSON.stringify(response);
        console.log('>>>loadJavaScript#H5#stringify cost:'+ (new Date().getTime()-start)+'ms');
        console.log('>>>loadJavaScript#H5#response:' + str);
     })">http post 请求

getEnv同步调用


text:
package promptplugin

import (
	"encoding/json"
	"fmt"
	"log"
	"math/rand"
	"strings"

	"github.com/todd-beckman/mmmorty"
)

const (
	addPromptCommand = "add prompt"
	promptCommand    = "prompt"
	promptTemplate   = "```\n" +
		"%s\n" +
		"```"

	maxPromptCount = 500
	maxWordCount   = 150
)

// Prompt is a prompt
type Prompt struct {
	Prompt string `json:"prompt"`
}

// PromptPlugin is the save structure of this plugin
type PromptPlugin struct {
	Prompts map[string][]Prompt `json:"prompts"`
}

type handleFunc func(*mmmorty.Bot, mmmorty.Discord, mmmorty.DiscordMessage, string)

func (p *PromptPlugin) findHandler(service mmmorty.Discord, message mmmorty.DiscordMessage) handleFunc {
	handlers := map[string]handleFunc{
		addPromptCommand: p.handleAddPromptCommand,
		promptCommand:    p.handlePromptCommand,
	}
	for c, h := range handlers {
		if mmmorty.MatchesCommand(service, c, message) {
			return h
		}
	}
	return nil
}

// Help gets the usage for this plugin
func (p *PromptPlugin) Help(bot *mmmorty.Bot, service mmmorty.Discord, message mmmorty.DiscordMessage, detailed bool) []string {
	help := mmmorty.CommandHelp(service, addPromptCommand, "some prompt", "adds a prompt for Morty to remember")
	help = append(help, mmmorty.CommandHelp(service, promptCommand, "", "asks Morty for a prompt at random.")[0])
	return help
}

// Load sets the state of the plugin from the given data
func (p *PromptPlugin) Load(bot *mmmorty.Bot, service mmmorty.Discord, data []byte) error {
	if data != nil {
		if err := json.Unmarshal(data, p); err != nil {
			log.Println("Error loading data", err)
			return err
		}
	}

	return nil
}

// Message is the command handler for this plugin
func (p *PromptPlugin) Message(bot *mmmorty.Bot, service mmmorty.Discord, message mmmorty.DiscordMessage) {
	defer bot.MessageRecover(service, message.Channel())
	if service.IsMe(message) {
		return
	}

	handler := p.findHandler(service, message)
	if handler == nil {
		return
	}

	channelID := message.Channel()
	discordChannel, err := service.Channel(channelID)
	if err != nil {
		requester := fmt.Sprintf("<@%s>", message.UserID())
		reply := fmt.Sprintf("Uh, %s, something went figuring out your server.", requester)
		service.SendMessage(message.Channel(), reply)
		return
	}
	guildID := discordChannel.GuildID

	handler(bot, service, message, guildID)
}

func (p *PromptPlugin) handleAddPromptCommand(bot *mmmorty.Bot, service mmmorty.Discord, message mmmorty.DiscordMessage, guildID string) {
	requester := fmt.Sprintf("<@%s>", message.UserID())

	if len(p.Prompts[guildID]) >= maxPromptCount {
		reply := fmt.Sprintf("Uh, %s, I can't remember all these prompts. Rick might need to help get rid of some.", requester)
		service.SendMessage(message.Channel(), reply)
		return
	}

	if strings.Contains(message.Message(), "http") {
		reply := fmt.Sprintf("Uh, %s, I would rather not remember prompts with links.", requester)
		service.SendMessage(message.Channel(), reply)
		return
	}

	_, parts := mmmorty.ParseCommand(service, message)

	promptParts := []string{}
	for index, word := range parts[1:] {
		if index > maxWordCount {
			reply := fmt.Sprintf("Uh, %s, that prompt is kind of long. Is there any way you can shorten it?", requester)
			service.SendMessage(message.Channel(), reply)
			return
		}
		promptParts = append(promptParts, word)
	}

	if len(promptParts) == 0 {
		reply := fmt.Sprintf("Uh, %s, I didn't get that. Be sure to say the prompt you want me to remember.", requester)
		service.SendMessage(message.Channel(), reply)
		return
	}

	plotPrompt := strings.Join(promptParts, " ")

	newPrompt := Prompt{
		Prompt: plotPrompt,
	}

	if p.Prompts == nil {
		p.Prompts = map[string][]Prompt{
			guildID: {},
		}
	}
	if p.Prompts[guildID] == nil {
		p.Prompts[guildID] = []Prompt{}
	}

	p.Prompts[guildID] = append(p.Prompts[guildID], newPrompt)

	reply := fmt.Sprintf("Ok, %s, you got it! I will try to remember that one.", requester)
	service.SendMessage(message.Channel(), reply)
}

func (p *PromptPlugin) handlePromptCommand(bot *mmmorty.Bot, service mmmorty.Discord, message mmmorty.DiscordMessage, guildID string) {
	requester := fmt.Sprintf("<@%s>", message.UserID())

	promptCount := len(p.Prompts[guildID])
	if promptCount == 0 {
		reply := fmt.Sprintf("Uh, %s, I don't know any prompts yet. Maybe you could add them?", requester)
		service.SendMessage(message.Channel(), reply)
		return
	}

	index := rand.Intn(promptCount)
	prompt := p.Prompts[guildID][index]
	reply := fmt.Sprintf(promptTemplate, prompt.Prompt)
	service.SendMessage(message.Channel(), reply)
}

// Save saves this plugin
func (p *PromptPlugin) Save() ([]byte, error) {
	return json.Marshal(p)
}

// Name gets the name of the plugin for saving purposes
func (p *PromptPlugin) Name() string {
	return "Prompt"
}

// New creates a new instance of this plugin.
func New() mmmorty.Plugin {
	return &PromptPlugin{}
}


text:
"""HTTP resources for the hammock location entities."""

# Third-Party modules
from flask_restful import Resource
from flask_restful import reqparse
from flask_restful import fields
from flask_restful import marshal_with
from flask_restful import current_app

# Project specific modules
from api.models import db, Comment, HammockLocation
from api.utils import abort_not_exist, require_login

class LocationResource(Resource):
    """Class for handling HammockLocation model API interactions"""

    comment_fields = {
        'id': fields.String(attribute='uuid'),
        'text': fields.String,
        'user_id': fields.String(attribute='user_uuid'),
        'location_id': fields.String(attribute='location_uuid'),
        'date_created': fields.DateTime
    }

    loc_fields = {
        'id': fields.String(attribute='uuid'),
        'user_id': fields.String(attribute='user_uuid'),
        'title': fields.String,
        'capacity': fields.String,
        'description': fields.String,
        'latitude': fields.Float,
        'longitude': fields.Float,
        'date_created': fields.DateTime,
        'comments': fields.List(fields.Nested(comment_fields))
    }

    def __init__(self):
        self.put_parser = self.setup_put_parser()
        self.post_parser = self.setup_post_parser()

    def setup_post_parser(self):
        parser = reqparse.RequestParser()
        parser.add_argument('title', default=None, type=str)
        parser.add_argument('capacity', default=None, type=int)
        parser.add_argument('latitude', required=True, type=float)
        parser.add_argument('longitude', required=True, type=float)
        parser.add_argument('photo', required=True, type=str)
        parser.add_argument('description', default=None, type=str)
        return parser

    def setup_put_parser(self):
        parser = reqparse.RequestParser()
        parser.add_argument('title', default=None, type=str)
        parser.add_argument('capacity', default=None, type=int)
        parser.add_argument('latitude', default=None, type=float)
        parser.add_argument('image_url', default=None, type=str)
        parser.add_argument('longitude', default=None, type=float)
        parser.add_argument('description', default=None, type=str)
        return parser

    @marshal_with(loc_fields)
    @require_login
    def get(self, user, location_uuid=None):
        current_app.logger.debug(repr(user))

        location = HammockLocation.query.filter_by(uuid=location_uuid).first()
        if location is None:
            abort_not_exist(location_uuid, 'HammockLocation')

        return location

    @marshal_with(loc_fields)
    @require_login
    def post(self, user):
        current_app.logger.debug(repr(user))

        parsed_args = self.post_parser.parse_args()

        location = HammockLocation(title=parsed_args['title'],
                                   capacity=parsed_args['capacity'],
                                   latitude=parsed_args['latitude'],
                                   longitude=parsed_args['longitude'],
                                   description=parsed_args['description'],
                                   user_uuid=user.uuid,
                                   photo=parsed_args['photo'])

        db.session.add(location)
        db.session.commit()

        return location

    @marshal_with(loc_fields)
    @require_login
    def put(self, user, location_id=None):
        current_app.logger.debug(repr(user))

        parsed_args = self.put_parser.parse_args()

        location = HammockLocation.objects(uuid=location_id).first()

        if parsed_args['latitude'] is not None \
                and parsed_args['longitude'] is not None:
            location.loc.coordinates = \
                [parsed_args['latitude'], parsed_args['longitude']]

        if parsed_args['title'] is not None:
            location.title = parsed_args['title']
        if parsed_args['capacity'] is not None:
            location.capacity = parsed_args['capacity']
        if parsed_args['description'] is not None:
            location.description = parsed_args['description']
        if parsed_args['photo'] is not None:
            location.photo = parsed_args['photo']

        location.save()

        return location.to_json()


text:
package kodkod.engine.bool;

import java.util.ArrayList;
import java.util.Collection;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

import kodkod.ast.Expression;
import kodkod.ast.Variable;
import kodkod.ast.operator.Quantifier;
import kodkod.engine.fol2sat.Environment;

// [AM]

public class DefCond {

    /* ------------------------------------------------------------------------------------ */
    /*                         used during translation                                      */
    /* ------------------------------------------------------------------------------------ */

    private BooleanValue overflow = BooleanConstant.FALSE;
    private BooleanValue accumOverflow = BooleanConstant.FALSE;
    private Set<Variable> vars = new HashSet<Variable>();

    public BooleanValue getOverflow()             { return overflow; }
    public BooleanValue getAccumOverflow()        { return accumOverflow; }
    public void setOverflows(BooleanValue of, BooleanValue accumOF)  {
        this.overflow = of;
        this.accumOverflow = accumOF;
    }

    public void addVar(Variable v)                 { vars.add(v); }
    public void addVars(Collection<Variable> vars) { this.vars.addAll(vars); }
    public Set<Variable> vars()                    { return vars; }

    /**
     * ORs overflow circuits of this object (
     * this.mergedOverflow), a given other object (
     * other.mergedOverflow), and a given overflow circuit (
     * of)
     */
    public static BooleanValue merge(BooleanFactory factory, BooleanValue accum, DefCond ... conds) {
        BooleanValue ret = accum;
        for (DefCond dc : conds) {
            ret = factory.or(ret, dc.accumOverflow);
        }
        return ret;
    }

    public static BooleanValue merge(BooleanFactory factory, DefCond ... conds) {
        return merge(factory, BooleanConstant.FALSE, conds);
    }

    /**
     * If overflow checking is disabled returns value.  Otherwise,
     * returns a conjunction of value, lhs.accumOverflow,
     * and rhs.accumOverflow.
     *
     * ~~~ NOTE ~~~: Every time a BooleanValue is returned as a result of an operation
     *               over Ints, one of the ensureNoOverflow methods
     *               should be called.
     */
    public static BooleanValue ensureDef(BooleanFactory factory, Environment<?, ?> env,
            BooleanValue value, DefCond ... dcs) {
        if (!factory.noOverflow)
            return value;
        List<DefCond> univQuantInts = new ArrayList<DefCond>(dcs.length);
        List<DefCond> extQuantInts = new ArrayList<DefCond>(dcs.length);
        for (DefCond e : dcs) {
            if (isUnivQuant(env, e))
                univQuantInts.add(e);
            else
                extQuantInts.add(e);
        }
        BooleanValue ret = value;
        if (!env.isNegated()) {
        	for (DefCond e : univQuantInts) ret = factory.or(ret, e.getAccumOverflow());
            for (DefCond e : extQuantInts) ret = factory.and(ret, factory.not(e.getAccumOverflow()));
        } else {
            for (DefCond e : extQuantInts) ret = factory.or(ret, e.getAccumOverflow());
            for (DefCond e : univQuantInts) ret = factory.and(ret, factory.not(e.getAccumOverflow()));
        }
        return ret;
    }

    private static boolean isUnivQuant(Environment<?, ?> env, DefCond e) {
        if (env.isEmpty())
            return false;
        if (!isInt(env.type()))
            return isUnivQuant(env.parent(), e);
        if (e.vars().contains(env.variable())) {
            return env.envType() == Quantifier.ALL;
        } else {
            return isUnivQuant(env.parent(), e);
        }
    }

      /**
      * Returns if this expression represents the Int type.
      */
     private static boolean isInt(Object expression) {
         if (expression == null)
             return false;
         if (!(expression instanceof Expression))
             return false;
         // TODO: this is probably not complete
         return "ints".equals(expression.toString());
     }

    /* ------------------------------------------------------------------------------------ */
    /*                         used by the evaluator                                        */
    /* ------------------------------------------------------------------------------------ */

    private boolean isOverflowFlag = false;

    public void setOverflowFlag(boolean overflow) { this.isOverflowFlag = overflow; }
    public boolean isOverflowFlag()               { return this.isOverflowFlag; }

}


text:
using System;

namespace Music {
    /// <summary>
    /// Represents a group of musical notes forming a musical scale.
    /// </summary>
    public class Scale : Series {
        #region VARIABLES

        /// <summary>
        /// Represents many modes if their roots were C.
        /// </summary>
        private static readonly Bidictionary MODES = new Bidictionary() {
            { "Major", new Series(Note.ToNoteArray(new string[] { "C", "D", "E", "F", "G", "A", "B" })) },
            { "Melodic Minor", new Series(Note.ToNoteArray(new string[] { "C", "D", "D#/Eb", "F", "G", "A", "B", "C", "D", "D#/Eb", "F", "G", "G#/Ab", "A#/Bb" })) },
            { "Minor", new Series(Note.ToNoteArray(new string[] { "C", "D", "D#/Eb", "F", "G", "G#/Ab", "A#/Bb" })) },
            { "Dorian", new Series(Note.ToNoteArray(new string[] { "C", "D", "D#/Eb", "F", "G", "A", "A#/Bb" })) },
            { "Phrygian", new Series(Note.ToNoteArray(new string[] { "C", "C#/Db", "D#/Eb", "F", "G", "G#/Ab", "A#/Bb" })) },
            { "Lydian", new Series(Note.ToNoteArray(new string[] { "C", "D", "E", "F#/Gb", "G", "A", "B" })) },
            { "Mixolydian", new Series(Note.ToNoteArray(new string[] { "C", "D", "E", "F", "G", "A", "A#/Bb" })) },
            { "Locrian", new Series(Note.ToNoteArray(new string[] { "C", "C#/Db", "D#/Eb", "F", "F#/Gb", "G#/Ab", "A#/Bb" })) }
        };

        #endregion VARIABLES

        #region CONSTRUCTORS

        /// <summary>
        /// Initializes a new instance of <see cref="Scale"/> class that has a root with a name of <paramref name="root"/> and notes derived from <paramref name="mode"/> mode.
        /// </summary>
        /// <param name="root">The name of the root <see cref="Note"/> of the new instance of <see cref="Scale"/> class.</param>
        /// <param name="mode">The name of the mode of the new instance of <see cref="Scale"/> class.</param>
        public Scale(string root, string mode) : this(new Note(root), mode) { }

        /// <summary>
        /// Initializes a new instance of <see cref="Scale"/> class that has a root with an index of <paramref name="root"/> and notes derived from <paramref name="mode"/> mode.
        /// </summary>
        /// <param name="root">The index of the root <see cref="Note"/> of the new instance of <see cref="Scale"/> class.</param>
        /// <param name="mode">The name of the mode of the new instance of <see cref="Scale"/> class.</param>
        public Scale(int root, string mode) : this(new Note(root), mode) { }

        /// <summary>
        /// Initializes a new instance of <see cref="Scale"/> class that has a root with a name of <paramref name="root"/> in the <paramref name="octave"/>th octave and notes derived from <paramref name="mode"/> quality.
        /// </summary>
        /// <param name="root">The name of the root <see cref="Note"/> of the new instance of <see cref="Scale"/> class.</param>
        /// <param name="mode">The name of the mode of the new instance of <see cref="Scale"/> class.</param>
        /// <param name="octave">The octave number of the root <see cref="Note"/> of the new instance of <see cref="Scale"/> class.</param>
        public Scale(string root, int octave, string mode) : this(new Note(root, octave), mode) { }

        /// <summary>
        /// Initializes a new instance of <see cref="Scale"/> class that has a root with an index of <paramref name="root"/> in the <paramref name="octave"/>th octave and notes derived from <paramref name="mode"/> quality.
        /// </summary>
        /// <param name="root">The index of the root <see cref="Note"/> of the new instance of <see cref="Scale"/> class.</param>
        /// <param name="mode">The name of the mode of the new instance of <see cref="Scale"/> class.</param>
        /// <param name="octave">The octave number of the root <see cref="Note"/> of the new instance of <see cref="Scale"/> class.</param>
        public Scale(int root, int octave, string mode) : this(new Note(root, octave), mode) { }

        /// <summary>
        /// Initializes a new instance of <see cref="Scale"/> class that has <paramref name="root"/> as its root note and notes derived from <paramref name="mode"/> mode.
        /// </summary>
        /// <param name="root">The root <see cref="Note"/> of the new instance of <see cref="Scale"/> class.</param>
        /// <param name="mode">The name of the mode of the new instance of <see cref="Scale"/> class.</param>
        public Scale(Note root, string mode) : base(MODES[mode].TransposeTo(root).Notes) { }

        #endregion CONSTRUCTORS

        #region PROPERTIES

        /// <summary>
        /// Gets the <see cref="Scale"/> root <see cref="Note"/>.
        /// </summary>
        public Note Root => Notes[0];

        /// <summary>
        /// Gets a <see cref="Chord"/> array of the <see cref="Scale"/> triad <see cref="Chord"/>s.
        /// </summary>
        public Chord[] Chords => GetChords(3);

        /// <summary>
        /// Gets the triad <see cref="Chord"/> on the first scale degree.
        /// </summary>
        public Chord Tonic => GetTonic(3);

        /// <summary>
        /// Gets the triad <see cref="Chord"/> on the second scale degree.
        /// </summary>
        public Chord Supertonic => GetSupertonic(3);

        /// <summary>
        /// Gets the tritone substitution <see cref="Chord"/> of the dominant of the <see cref="Dominant"/>.
        /// </summary>
        public Chord GermanAugmentedSixthChord => new Chord(Supertonic.Root + Interval.TRITONE, "7");

        /// <summary>
        /// Gets the triad <see cref="Chord"/> on the third scale degree.
        /// </summary>
        public Chord Mediant => GetMediant(3);

        /// <summary>
        /// Gets the triad <see cref="Chord"/> on the fourth scale degree.
        /// </summary>
        public Chord Subdominant => GetSubdominant(3);

        /// <summary>
        /// Gets the <see cref="Scale"/> with the <see cref="Chord.Root"/> of the <see cref="Subdominant"/> and the melodic minor mode.
        /// </summary>
        public Scale MinorSubdominant => new Scale(Subdominant.Root, "Melodic Minor");

        /// <summary>
        /// Gets the triad <see cref="Chord"/> derived from the <see cref="Subdominant"/>.
        /// </summary>
        public Chord Neapolitan => new Chord(Tonic.Root + Interval.MINOR_SECOND, "maj");

        /// <summary>
        /// Gets the triad <see cref="Chord"/> on the fifth scale degree.
        /// </summary>
        public Chord Dominant => GetDominant(3);

        /// <summary>
        /// Gets the triad <see cref="Chord"/> on the sixth scale degree.
        /// </summary>
        public Chord Submediant => GetSubmediant(3);

        /// <summary>
        /// Gets the triad <see cref="Chord"/> a minor second below the <see cref="Root"/>.
        /// </summary>
        public Chord LeadingTone => GetLeadingTone(3);

        /// <summary>
        /// Gets the fully diminished seventh <see cref="Chord"/> a minor second below the <see cref="Root"/>.
        /// </summary>
        public Chord LeadingToneFullyDiminishedSeventh => new Chord(LeadingTone.Root, "dim7");

        /// <summary>
        /// Gets the triad <see cref="Chord"/> a major second below the <see cref="Root"/>.
        /// </summary>
        public Chord Subtonic => GetSubtonic(3);

        /// <summary>
        /// Gets the <see cref="Scale"/> mode.
        /// </summary>
        public string Mode => MODES[new Series(Notes)];

        /// <summary>
        /// Gets the <see cref="Scale"/> name.
        /// </summary>
        new public string Name => Root.Name + " " + Mode;

        /// <summary>
        /// Gets the <see cref="Scale"/> full name.
        /// </summary>
        new public string FullName => Root.FullName + " " + Mode;

        #endregion PROPERTIES

        #region METHODS

        /// <summary>
        /// Gets a <see cref="Chord"/> array of the <see cref="Scale"/> <see cref="Chords"/> with <see cref="Series.Length"/>s of <paramref name="length"/>.
        /// </summary>
        /// <param name="length">The number of <see cref="Note"/>s in each of the <see cref="Chord"/>s in the current <see cref="Scale"/>.</param>
        /// <returns>A <see cref="Chord"/> array of the <see cref="Scale"/> <see cref="Chords"/> with <see cref="Series.Length"/>s of <paramref name="length"/>.</returns>
        public Chord[] GetChords(int length) {
            // Creates an empty array of chords number of scale degrees long
            Chord[] chords = new Chord[Length];

            // Loops through the scale degrees
            for (int i = 0; i < Length; i++) {
                // Sets the current chord to the chord of the provided length built on the current scale degree
                chords[i] = GetChord(i, length);
            }

            // Returns the scale chords
            return chords;
        }

        /// <summary>
        /// Gets the <see cref="Chord"/> at the <paramref name="index"/> plus one scale degree of the current <see cref="Scale"/> with <see cref="Series.Length"/> of <paramref name="length"/>.
        /// </summary>
        /// <param name="index">The zero-based index of the scale degrees.</param>
        /// <param name="length">The number of <see cref="Note"/>s in the <see cref="Chord"/> at <paramref name="index"/> plus one scale degree.</param>
        /// <returns>A <see cref="Chord"/> at the <paramref name="index"/> plus one scale degree of the current <see cref="Scale"/> with <see cref="Series.Length"/> of <paramref name="length"/>.</returns>
        public Chord GetChord(int index, int length) {
            // Declares and initializes a note array with the length specified
            Note[] notes = new Note[length];

            // Loops to get the notes from the specified scale
            for (int i = 0; i < length; i++) {
                // Adds the note to note array
                notes[i] = Notes[(index + i * 2) % Length];
            }

            // Returns the chord initialized using the notes array
            return (Chord)(new Series(notes));
        }

        /// <summary>
        /// Gets the <see cref="Chord"/> on the <paramref name="index"/> plus one scale degree of the current <see cref="Scale"/> with <see cref="Series.Length"/> of three.
        /// </summary>
        /// <param name="index">The zero-based index of the scale degrees.</param>
        /// <returns>A <see cref="Chord"/> on the <paramref name="index"/> plus one scale degree of the current <see cref="Scale"/> with <see cref="Series.Length"/> of three.</returns>
        public Chord GetChord(int index) {
            // Returns the chord
            return GetChord(index, 3);
        }

        /// <summary>
        /// Gets the <see cref="Chord"/> on the first scale degree of the current <see cref="Scale"/> with <see cref="Series.Length"/> of <paramref name="length"/>.
        /// </summary>
        /// <param name="length">The number of <see cref="Note"/>s in the <see cref="Chord"/> on the first scale degree of the current <see cref="Scale"/>.</param>
        /// <returns>A <see cref="Chord"/> on the first scale degree of the current <see cref="Scale"/> with <see cref="Series.Length"/> of <paramref name="length"/>.</returns>
        public Chord GetTonic(int length) {
            // Gets the tonic
            return GetChord(0, length);
        }

        /// <summary>
        /// Gets the <see cref="Chord"/> on the second scale degree of the current <see cref="Scale"/> with <see cref="Series.Length"/> of <paramref name="length"/>.
        /// </summary>
        /// <param name="length">The number of <see cref="Note"/>s in the <see cref="Chord"/> on the second scale degree of the current <see cref="Scale"/>.</param>
        /// <returns>A <see cref="Chord"/> on the second scale degree of the current <see cref="Scale"/> with <see cref="Series.Length"/> of <paramref name="length"/>.</returns>
        public Chord GetSupertonic(int length) {
            // Gets the supertonic
            return GetChord(1, length);
        }

        /// <summary>
        /// Gets the <see cref="Chord"/> on the third scale degree of the current <see cref="Scale"/> with <see cref="Series.Length"/> of <paramref name="length"/>.
        /// </summary>
        /// <param name="length">The number of <see cref="Note"/>s in the <see cref="Chord"/> on the third scale degree of the current <see cref="Scale"/>.</param>
        /// <returns>A <see cref="Chord"/> on the third scale degree of the current <see cref="Scale"/> with <see cref="Series.Length"/> of <paramref name="length"/>.</returns>
        public Chord GetMediant(int length) {
            // Gets the mediant
            return GetChord(2, length);
        }

        /// <summary>
        /// Gets the <see cref="Chord"/> on the fourth scale degree of the current <see cref="Scale"/> with <see cref="Series.Length"/> of <paramref name="length"/>.
        /// </summary>
        /// <param name="length">The number of <see cref="Note"/>s in the <see cref="Chord"/> on the fourth scale degree of the current <see cref="Scale"/>.</param>
        /// <returns>A <see cref="Chord"/> on the fourth scale degree of the current <see cref="Scale"/> with <see cref="Series.Length"/> of <paramref name="length"/>.</returns>
        public Chord GetSubdominant(int length) {
            // Gets the subdominant
            return GetChord(3, length);
        }

        /// <summary>
        /// Gets the <see cref="Chord"/> on the fifth scale degree of the current <see cref="Scale"/> with <see cref="Series.Length"/> of <paramref name="length"/>.
        /// </summary>
        /// <param name="length">The number of <see cref="Note"/>s in the <see cref="Chord"/> on the fifth scale degree of the current <see cref="Scale"/>.</param>
        /// <returns>A <see cref="Chord"/> on the fifth scale degree of the current <see cref="Scale"/> with <see cref="Series.Length"/> of <paramref name="length"/>.</returns>
        public Chord GetDominant(int length) {
            // Gets the dominant
            return GetChord(4, length);
        }

        /// <summary>
        /// Gets the <see cref="Chord"/> on the sixth scale degree of the current <see cref="Scale"/> with <see cref="Series.Length"/> of <paramref name="length"/>.
        /// </summary>
        /// <param name="length">The number of <see cref="Note"/>s in the <see cref="Chord"/> on the sixth scale degree of the current <see cref="Scale"/>.</param>
        /// <returns>A <see cref="Chord"/> on the sixth scale degree of the current <see cref="Scale"/> with <see cref="Series.Length"/> of <paramref name="length"/>.</returns>
        public Chord GetSubmediant(int length) {
            // Gets the dominant
            return GetChord(5, length);
        }

        /// <summary>
        /// Gets the <see cref="Chord"/> a minor second below the <see cref="Root"/> of the current <see cref="Scale"/> with <see cref="Series.Length"/> of <paramref name="length"/>.
        /// </summary>
        /// <param name="length">The number of <see cref="Note"/>s in the <see cref="Chord"/> a minor second below the <see cref="Root"/> of the current <see cref="Scale"/>.</param>
        /// <returns>A <see cref="Chord"/> a minor second below the <see cref="Root"/> of the current <see cref="Scale"/> with <see cref="Series.Length"/> of <paramref name="length"/>.</returns>
        public Chord GetLeadingTone(int length) {
            // Gets the leading tone
            return (Contains(Root - Interval.MINOR_SECOND) ? GetChord(6, length) : new Chord(Root - Interval.MINOR_SECOND, "dim"));
        }

        /// <summary>
        /// Gets the <see cref="Chord"/> a major second below the <see cref="Root"/> of the current <see cref="Scale"/> with <see cref="Series.Length"/> of <paramref name="length"/>.
        /// </summary>
        /// <param name="length">The number of <see cref="Note"/>s in the <see cref="Chord"/> a major second below the <see cref="Root"/> of the current <see cref="Scale"/>.</param>
        /// <returns>A <see cref="Chord"/> a major second below the <see cref="Root"/> of the current <see cref="Scale"/> with <see cref="Series.Length"/> of <paramref name="length"/>.</returns>
        public Chord GetSubtonic(int length) {
            // Checks if the scale has a subtonic
            if (Contains(Root - Interval.MAJOR_SECOND)) {
                // Gets the subtonic
                return ((Length == 14) ? GetChord(13, length) : GetChord(6, length));
            } else {
                // Gets the subtonic
                return new Chord(Root - Interval.MAJOR_SECOND, "maj");
            }
        }

        /// <summary>
        /// Gets a <see cref="Scale"/> containing <paramref name="chords"/>.
        /// </summary>
        /// <param name="chords">The <see cref="Chord"/> array for which a <see cref="Scale"/> will be found.</param>
        /// <returns>A <see cref="Scale"/> containing <paramref name="chords"/>.</returns>
        public static Scale GetScaleFromChords(params Chord[] chords) {
            // Sets the default scale to none
            Scale scale = null;

            // Loops through the possible tonic notes of the scale
            for (int i = chords[0].Root.Index; i < chords[0].Root.Index + Interval.OCTAVE; i++) {
                // Loops through all of the possible scales to check if the chords fit
                foreach (string mode in MODES.GetStrings()) {
                    // Sets the current scale
                    scale = new Scale(Note.NOTES[i % Interval.OCTAVE], mode);

                    // Loops through the chords to check if they all fit in the current scale
                    foreach (Chord chord in chords) {
                        // Checks if the chord is not diatonic to the scale
                        if (!chord.IsDiatonic(scale)) {
                            // Sets the scale to none
                            scale = null;

                            break;
                        }
                    }

                    // Checks if the scale was successfully found
                    if ((object)scale != null) {
                        // Ends the loop
                        break;
                    }
                }

                // Checks if the scale was successfully found
                if ((object)scale != null) {
                    // Ends the loop
                    break;
                }
            }

            // Checks if the scale was not found
            if ((object)scale == null) {
                // Throws an exception
                throw new Exception("No scale was found containing " + chords);
            } else {
                // Returns the scale
                return scale;
            }
        }

        /// <summary>
        /// Gets the name of <paramref name="chord"/> in the context of the current <see cref="Scale"/>.
        /// </summary>
        /// <param name="chord">The <see cref="Chord"/> for which a name will be found relative to the current <see cref="Scale"/>.</param>
        /// <returns>A string representing the name of <paramref name="chord"/> in the context of the current <see cref="Scale"/>.</returns>
        public string GetScaleDegree(Chord chord) {
            // Loops through the scale degrees
            for (int i = 0; i < Length; i++) {
                // Checks if the triad of the chord is on the current scale degree
                if (chord.Triad == GetChord(i, 3)) {
                    // Gets the name
                    switch (i) {
                        case 0:
                            return "Tonic";
                        case 1:
                            return "Supertonic";
                        case 2:
                            return "Mediant";
                        case 3:
                            return "Subdominant";
                        case 4:
                            return "Dominant";
                        case 5:
                            return "Submediant";
                        case 6:
                            if (Contains(Root - Interval.MINOR_SECOND)) {
                                return "Leading Tone";
                            } else {
                                return "Subtonic";
                            }
                        case 12:
                            return "Raised Submediant";
                        case 13:
                            return "Subtonic";
                    }
                }
            }

            // Throws an exception
            throw new Exception("No name could be found for " + chord.Name + " in the context of " + Name);
        }

        #endregion METHODS
    }
}


text:
using UnityEngine;

public class BulletDestroy : MonoBehaviour
{
    private void OnCollisionEnter2D(Collision2D collision)
    {
        Destroy(gameObject);
    }
}


text:
var expect = require('expect.js');
var Promise = require('bluebird');
var fs = Promise.promisifyAll(require('fs'));
var path = require('path');
var stream = require('stream');
var appender = require('../src/index');
var exec = require('child_process').exec;

var dirPath = path.join(__dirname, "/files");
var files = [
  path.join(dirPath, "file1.txt"),
  path.join(dirPath, "file2.txt")
];

describe("When an array of valid files is passed", function () {

  var contents = "";

  before(function (done) {

    readFiles(files).then(function (contentsArr) {
      contents = contentsArr.join('');
      done();
    });

  });

  after(function (done) {

    removeOutputFile(done);

  });

  it("should create a transform stream", function (done) {

    var filesArr = [].slice.call(files);
    var transformStream = appender(filesArr);

    expect(transformStream instanceof stream.Transform).to.be(true);
    done();

  });

  it("should create a file with the contents of the files inside the dir path passed if piped to a write stream", function (done) {

    var transformStream = appender(dirPath);
    var output = fs.createWriteStream(path.join(dirPath, 'output.txt'));

    transformStream
      .pipe(output)
      .on('finish', function () {

        fs.readFileAsync(path.join(dirPath, 'output.txt')).then(function (text) {

          expect(contents).to.be(text.toString());
          done();

        }).catch(function (err) {

          done(err);

        });

      });

  });

});

describe("When an array of valid and non-valid files is passed", function () {

  var contents = "";

  before(function (done) {

    readFiles(files).then(function (contentsArr) {
      contents = contentsArr.join('');
      done();
    });

  });

  it("should create a file with the contents of the files inside the dir path passed if piped to a write stream", function (done) {

    var transformStream = appender(dirPath);
    var output = fs.createWriteStream(path.join(dirPath, 'output.txt'));

    transformStream
      .pipe(output)
      .on('finish', function () {

        fs.readFileAsync(path.join(dirPath, 'output.txt')).then(function (text) {

          expect(contents).to.be(text.toString());
          done();

        }).catch(function (err) {

          done(err);

        });

      });

  });

  after(function (done) {

    removeOutputFile(done);

  });

  it("should create a transform stream", function (done) {

    files.push('/foo/bar.txt')
    var filesArr = [].slice.call(files);
    var transformStream = appender(filesArr);

    expect(transformStream instanceof stream.Transform).to.be(true);
    files.pop();
    done();

  });

});

describe("When just a dir path is passed", function () {

  var contents = "";

  before(function (done) {

    readFiles(files).then(function (contentsArr) {
      contents = contentsArr.join('');
      done();
    });

  });

  after(function (done) {

    removeOutputFile(done);

  });

  it("should create a transform stream", function (done) {

    var filesArr = [].slice.call(files);
    var transformStream = appender(filesArr);

    expect(transformStream instanceof stream.Transform).to.be(true);
    done();

  });

  it("should create a file with the contents of the files passed if piped to a write stream", function (done) {

    var filesArr = [].slice.call(files);
    var transformStream = appender(filesArr);
    var output = fs.createWriteStream(path.join(dirPath, 'output.txt'));

    transformStream
      .pipe(output)
      .on('finish', function () {

        fs.readFileAsync(path.join(dirPath, 'output.txt')).then(function (text) {

          expect(contents).to.be(text.toString());
          done();

        }).catch(function (err) {

          done(err);

        });

      });

  });

});

describe("When just a file path is passed", function () {

  var contents = "";

  before(function (done) {

    files.pop();

    readFiles(files).then(function (contentsArr) {
      contents = contentsArr.join('');
      done();
    });

  });

  after(function (done) {

    removeOutputFile(done);

  });

  it("should create a transform stream", function (done) {

    var filePath = path.join(dirPath, "file1.txt");
    var transformStream = appender(filePath);

    expect(transformStream instanceof stream.Transform).to.be(true);
    done();

  });

  it("should create a file with the contents of the file passed if piped to a write stream", function (done) {

    var filePath = path.join(dirPath, "file1.txt");
    var transformStream = appender(filePath);
    var output = fs.createWriteStream(path.join(dirPath, 'output.txt'));

    transformStream
      .pipe(output)
      .on('finish', function () {

        fs.readFileAsync(path.join(dirPath, 'output.txt')).then(function (text) {

          expect(contents).to.be(text.toString());
          done();

        }).catch(function (err) {

          done(err);

        });

      });

  });

});

describe("When invalid stuff is passed", function () {

  it("should throw an error for null", function (done) {

    expect(appender).to.throwException();
    done();

  });

  it("should return undefined for empty string", function (done) {

    expect(appender("")).to.not.be.ok();
    done();

  });

  it("should return undefined for empty array", function (done) {

    expect(appender([])).to.not.be.ok();
    done();

  });

});

function readFiles (files) {

  var promises = [];

  files.forEach(function (file) {
    promises.push(fs.readFileAsync(file).then(function (text) {
      return text.toString();
    }));
  });

  return Promise.all(promises);

}

function removeOutputFile (done) {
  exec("rm ./test/files/output.txt", function (error, stdout, sdterr) {
    if (error) return done(error);
    done();
  });
}


text:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<resources>
  <resource name="sTorso" type="RESOURCE"/>
  <resource name="sLeg" type="RESOURCE"/>
  <resource name="sFoot" type="RESOURCE"/>
  <resource name="sArm" type="RESOURCE"/>
  <resource name="sForeArm" type="RESOURCE"/>
</resources>


text:
var fs    = require('fs');
var path  = require('path');
var spawn = require('child_process').spawn;

var exe = process.argv[0];
var cwd = process.cwd();

for (var dep in process.versions) {
  console.log('  %s@%s', dep, process.versions[dep]);
}

console.log('');

runScripts(fs.readdirSync(__dirname));

function runScripts(fileNames) {
  var fileName = fileNames.shift();

  if (!fileName) {
    return;
  }

  if (!/\.js$/i.test(fileName) || fileName.toLowerCase() === 'index.js') {
    runScripts(fileNames);
    return;
  }

  var fullPath = path.join(__dirname, fileName);

  console.log('> %s %s', exe, path.relative(cwd, fullPath));

  var proc = spawn(exe, [fullPath], {
    'stdio': 'inherit'
  });

  proc.on('exit', function () {
    runScripts(fileNames);
  });
}


text:
CC = gcc
CFLAGS = -std=c99 -g -Wall -O2
INCLUDES = -lncurses

# --- List program modules and associated object files ---
MODULES_LIST = \
	main \
	game_map \
	game_world \
	gameplay_screen \
	goodbye_screen \
	help_screen \
	inventory_screen \
	load_screen \
	map_tile \
	narrative_stack \
	ncwindow \
	player_character \
	save_screen \
	welcome_screen \

OBJECT_FILES = $(MODULES_LIST:%=obj/%.o)

# --- Define the build rules ---
PROGRAM_BINARY = bin/folly-mvp0

all: $(PROGRAM_BINARY)

$(PROGRAM_BINARY) : $(OBJECT_FILES)
	$(CC) $(CFLAGS) $(INCLUDES) $(OBJECT_FILES) -o $(PROGRAM_BINARY)

obj/%.o: src/%.c
	$(CC) $(CFLAGS) $< -o $@ -c

clean:
	rm -f $(PROGRAM_BINARY) $(OBJECT_FILES)


text:
<?php (defined('BASEPATH')) OR exit('No direct script access allowed');

/* load the MX_Loader class */
require APPPATH."third_party/MX/Loader.php";

class MY_Loader extends MX_Loader
{
    /** Load a module view **/
    public function view($view, $vars = array(), $return = FALSE)
    {
        list($path, $_view) = Modules::find($view, $this->_module, 'views/');

        if ($path != FALSE)
        {
            $this->_ci_view_paths = array($path => TRUE) + $this->_ci_view_paths;
            $view = $_view;
        }

        return $this->_ci_load(array('_ci_view' => $view, '_ci_vars' => ((method_exists($this,'_ci_object_to_array')) ? $this->_ci_object_to_array($vars) : $this->_ci_prepare_view_vars($vars)), '_ci_return' => $return));
    }
}


text:
package apple.spritekit.enums;

import org.moe.natj.general.ann.Generated;
import org.moe.natj.general.ann.NInt;

/**
 * Adjust the timing of an action
 * <p>
 * [@enum] SKActionTimingLinear Specifies linear pacing. Linear pacing causes an
 * animation to occur evenly over its duration.
 * [@enum] SKActionTimingEaseIn Specifies ease-in pacing. Ease-in pacing causes the
 * animation to begin slowly, and then speed up as it progresses.
 * [@enum] SKActionTimingEaseOut Specifies ease-out pacing. Ease-out pacing causes
 * the animation to begin quickly, and then slow as it completes.
 * [@enum] SKActionTimingEaseInEaseOut Specifies ease-in ease-out pacing. An
 * ease-in ease-out animation begins slowly, accelerates through the middle
 * of its duration, and then slows again before completing.
 */
@Generated
public final class SKActionTimingMode {
    @Generated @NInt public static final long Linear = 0x0000000000000000L;
    @Generated @NInt public static final long EaseIn = 0x0000000000000001L;
    @Generated @NInt public static final long EaseOut = 0x0000000000000002L;
    @Generated @NInt public static final long EaseInEaseOut = 0x0000000000000003L;

    @Generated
    private SKActionTimingMode() {
    }
}


text:
{-# LANGUAGE TypeFamilies, FlexibleContexts #-}
{-# OPTIONS_GHC -Wall #-}
{-# LANGUAGE Safe #-}

{- |
Module      :  Physics.Learn.Curve
Copyright   :  (c) Scott N. Walck 2012-2018
License     :  BSD3 (see LICENSE)
Maintainer  :  Scott N. Walck <walck@lvc.edu>
Stability   :  experimental

This module contains functions for working with 'Curve's
and line integrals along 'Curve's.
-}

module Physics.Learn.Curve
    (
    -- * Curves
      Curve(..)
    , normalizeCurve
    , concatCurves
    , concatenateCurves
    , reverseCurve
    , evalCurve
    , shiftCurve
    , straightLine
    -- * Line Integrals
    , simpleLineIntegral
    , dottedLineIntegral
    , crossedLineIntegral
    , compositeTrapezoidDottedLineIntegral
    , compositeTrapezoidCrossedLineIntegral
    , compositeSimpsonDottedLineIntegral
    , compositeSimpsonCrossedLineIntegral
    )
    where

import Data.VectorSpace
    ( VectorSpace
    , InnerSpace
    , Scalar
    )
import Physics.Learn.CarrotVec
    ( Vec
    , (><)
    , (<.>)
    , sumV
    , (^*)
    , (^/)
    , (^+^)
    , (^-^)
    , (*^)
    , magnitude
    , zeroV
    , negateV
    )
import Physics.Learn.Position
    ( Position
    , Displacement
    , displacement
    , Field
    , VectorField
    , shiftPosition
    )

-- | 'Curve' is a parametrized function into three-space, an initial limit, and a final limit.
data Curve = Curve { curveFunc          :: Double -> Position  -- ^ function from one parameter into space
                   , startingCurveParam :: Double              -- ^ starting value of the parameter
                   , endingCurveParam   :: Double              -- ^ ending value of the parameter
                   }

-- | A dotted line integral.
--   Convenience function for 'compositeSimpsonDottedLineIntegral'.
dottedLineIntegral
    :: Int          -- ^ number of half-intervals
                    --   (one less than the number of function evaluations)
    -> VectorField  -- ^ vector field
    -> Curve        -- ^ curve to integrate over
    -> Double       -- ^ scalar result
dottedLineIntegral = compositeSimpsonDottedLineIntegral

-- | Calculates integral vf x dl over curve.
--   Convenience function for 'compositeSimpsonCrossedLineIntegral'.
crossedLineIntegral
    :: Int          -- ^ number of half-intervals
                    --   (one less than the number of function evaluations)
    -> VectorField  -- ^ vector field
    -> Curve        -- ^ curve to integrate over
    -> Vec          -- ^ vector result
crossedLineIntegral = compositeSimpsonCrossedLineIntegral

-- | A dotted line integral, performed in an unsophisticated way.
compositeTrapezoidDottedLineIntegral
    :: Int          -- ^ number of intervals
    -> VectorField  -- ^ vector field
    -> Curve        -- ^ curve to integrate over
    -> Double       -- ^ scalar result
compositeTrapezoidDottedLineIntegral n vf (Curve f a b)
    = sum $ zipWith (<.>) aveVecs dls
      where
        dt = (b - a) / fromIntegral n
        pts = [f t | t <- [a,a+dt..b]]
        vecs = [vf pt | pt <- pts]
        aveVecs = zipWith average vecs (tail vecs)
        dls = zipWith displacement pts (tail pts)

-- | Calculates integral vf x dl over curve in an unsophisticated way.
compositeTrapezoidCrossedLineIntegral
    :: Int          -- ^ number of intervals
    -> VectorField  -- ^ vector field
    -> Curve        -- ^ curve to integrate over
    -> Vec          -- ^ vector result
compositeTrapezoidCrossedLineIntegral n vf (Curve f a b)
    = sumV $ zipWith (><) aveVecs dls
      where
        dt = (b - a) / fromIntegral n
        pts = [f t | t <- [a,a+dt..b]]
        vecs = [vf pt | pt <- pts]
        aveVecs = zipWith average vecs (tail vecs)
        dls = zipWith displacement pts (tail pts)

-- | Calculates integral f dl over curve, where dl is a scalar line element.
simpleLineIntegral
    :: (InnerSpace v, Scalar v ~ Double)
       => Int      -- ^ number of intervals
    -> Field v     -- ^ scalar or vector field
    -> Curve       -- ^ curve to integrate over
    -> v           -- ^ scalar or vector result
simpleLineIntegral n vf (Curve f a b)
    = sumV $ zipWith (^*) aveVecs (map magnitude dls)
      where
        dt = (b - a) / fromIntegral n
        pts = [f t | t <- [a,a+dt..b]]
        vecs = [vf pt | pt <- pts]
        aveVecs = zipWith average vecs (tail vecs)
        dls = zipWith displacement pts (tail pts)

-- | Reparametrize a curve from 0 to 1.
normalizeCurve :: Curve -> Curve
normalizeCurve (Curve f a b)
    = Curve (f . scl) 0 1
      where
        scl t = a + (b - a) * t

-- | Concatenate two curves.
concatCurves :: Curve  -- ^ go first along this curve
             -> Curve  -- ^ then along this curve
             -> Curve  -- ^ to produce this new curve
concatCurves c1 c2
    = normalizeCurve $ Curve f 0 2
      where
        (Curve f1 _ _) = normalizeCurve c1
        (Curve f2 _ _) = normalizeCurve c2
        f t | t <= 1     = f1 t
            | otherwise  = f2 (t-1)

-- | Concatenate a list of curves.
--   Parametrizes curves equally.
concatenateCurves :: [Curve] -> Curve
concatenateCurves []     = error "concatenateCurves:  cannot concatenate empty list"
concatenateCurves cs = normalizeCurve $ Curve f 0 (fromIntegral n)
    where
      n   = length cs
      ncs = map normalizeCurve cs
      f t = evalCurve (ncs !! m) (t - fromIntegral m)
          where m = min (n-1) (floor t)

-- | Reverse a curve.
reverseCurve :: Curve -> Curve
reverseCurve (Curve f a b)
    = Curve (f . rev) a b
      where
        rev t = a + b - t

-- | Evaluate the position of a curve at a parameter.
evalCurve :: Curve     -- ^ the curve
          -> Double    -- ^ the parameter
          -> Position  -- ^ position of the point on the curve at that parameter
evalCurve (Curve f _ _) t = f t

-- | Shift a curve by a displacement.
shiftCurve :: Displacement  -- ^ amount to shift
           -> Curve         -- ^ original curve
           -> Curve         -- ^ shifted curve
shiftCurve d (Curve f sl su)
    = Curve (shiftPosition d . f) sl su

-- | The straight-line curve from one position to another.
straightLine :: Position  -- ^ starting position
             -> Position  -- ^ ending position
             -> Curve     -- ^ straight-line curve
straightLine r1 r2 = Curve f 0 1
    where
      f t = shiftPosition (t *^ d) r1
      d = displacement r1 r2

-------------
-- Helpers --
-------------

average :: (VectorSpace v, Scalar v ~ Double) => v -> v -> v
average v1 v2 = (v1 ^+^ v2) ^/ 2

----------------------------------------
-- Quadratic (Simpson) Approximations --
----------------------------------------

dottedSimp :: (InnerSpace v, Fractional (Scalar v)) =>
              v  -- ^ vector field low
           -> v  -- ^ vector field mid
           -> v  -- ^ vector field high
           -> v  -- ^ dl low to mid
           -> v  -- ^ dl mid to high
           -> Scalar v  -- ^ quadratic approximation
dottedSimp f0 f1 f2 g10 g21
    = ((g21 ^+^ g10) ^/ 6) <.> (f0 ^+^ 4 *^ f1 ^+^ f2)
      + ((g21 ^-^ g10) ^/ 3) <.> (f2 ^-^ f0)

-- | Quadratic approximation to vector field.
--   Quadratic approximation to curve.
--   Composite strategy.
--   Dotted line integral.
compositeSimpsonDottedLineIntegral
    :: Int          -- ^ number of half-intervals
                    --   (one less than the number of function evaluations)
    -> VectorField  -- ^ vector field
    -> Curve        -- ^ curve to integrate over
    -> Double       -- ^ scalar result
compositeSimpsonDottedLineIntegral n vf (Curve c a b)
    = let nEven = 2 * div n 2
          dt = (b - a) / fromIntegral nEven
          ts = [a + fromIntegral m * dt | m <- [0..nEven]]
          pairs = [(ct,vf ct) | t <- ts, let ct = c t]
          combine [] = error "compositeSimpson: odd number of half-intervals" -- this should never happen
          combine [_] = zeroV
          combine (_:_:[]) = error "compositeSimpson: odd number of half-intervals" -- this should never happen
          combine ((c0,f0):(c1,f1):(c2,f2):ps)
              = dottedSimp f0 f1 f2 (displacement c0 c1) (displacement c1 c2)
                ^+^ combine ((c2,f2):ps)
      in combine pairs

crossedSimp :: Vec  -- ^ vector field low
            -> Vec  -- ^ vector field mid
            -> Vec  -- ^ vector field high
            -> Vec  -- ^ dl low to mid
            -> Vec  -- ^ dl mid to high
            -> Vec  -- ^ quadratic approximation
crossedSimp f0 f1 f2 g10 g21
    = negateV $
      ((g21 ^+^ g10) ^/ 6) >< (f0 ^+^ 4 *^ f1 ^+^ f2)
      ^+^ ((g21 ^-^ g10) ^/ 3) >< (f2 ^-^ f0)

-- | Quadratic approximation to vector field.
--   Quadratic approximation to curve.
--   Composite strategy.
--   Crossed line integral.
compositeSimpsonCrossedLineIntegral
    :: Int          -- ^ number of half-intervals
                    --   (one less than the number of function evaluations)
    -> VectorField  -- ^ vector field
    -> Curve        -- ^ curve to integrate over
    -> Vec          -- ^ vector result
compositeSimpsonCrossedLineIntegral n vf (Curve c a b)
    = let nEven = 2 * div n 2
          dt = (b - a) / fromIntegral nEven
          ts = [a + fromIntegral m * dt | m <- [0..nEven]]
          pairs = [(ct,vf ct) | t <- ts, let ct = c t]
          combine [] = error "compositeSimpson: odd number of half-intervals" -- this should never happen
          combine [_] = zeroV
          combine (_:_:[]) = error "compositeSimpson: odd number of half-intervals" -- this should never happen
          combine ((c0,f0):(c1,f1):(c2,f2):ps)
              = crossedSimp f0 f1 f2 (displacement c0 c1) (displacement c1 c2)
                ^+^ combine ((c2,f2):ps)
      in combine pairs


text:
//  Copyright Beman Dawes 2003

//  Distributed under the Boost Software License, Version 1.0. (See accompanying
//  file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

//  See library home page at http://www.boost.org/libs/filesystem

//----------------------------------------------------------------------------//

#ifndef BOOST_FILESYSTEM2_CONFIG_HPP
#define BOOST_FILESYSTEM2_CONFIG_HPP

# if defined(BOOST_FILESYSTEM_VERSION) && BOOST_FILESYSTEM_VERSION != 2
#   error Compiling Filesystem version 2 file with BOOST_FILESYSTEM_VERSION defined != 2
# endif

# if !defined(BOOST_FILESYSTEM_VERSION)
#   define BOOST_FILESYSTEM_VERSION 2
# endif

#define BOOST_FILESYSTEM_I18N  // aid users wishing to compile several versions

//  ability to change namespace aids path_table.cpp  ------------------------//
#ifndef BOOST_FILESYSTEM2_NAMESPACE
# define BOOST_FILESYSTEM2_NAMESPACE filesystem2
#endif

#include <boost/config.hpp>
#include <boost/system/api_config.hpp>  // for BOOST_POSIX_API or BOOST_WINDOWS_API
#include <boost/detail/workaround.hpp>

//  BOOST_POSIX_PATH or BOOST_WINDOWS_PATH specify which path syntax to recognise

# if defined(BOOST_WINDOWS_API) && defined(BOOST_POSIX_PATH)
#   error builds with Windows API do not support BOOST_POSIX_PATH
# endif

# if !defined(_WIN32) && !defined(__CYGWIN__) && defined(BOOST_WINDOWS_PATH)
#   error builds on non-Windows platforms do not support BOOST_WINDOWS_PATH
# endif

# if defined(BOOST_WINDOWS_PATH) && defined(BOOST_POSIX_PATH)
#   error both BOOST_WINDOWS_PATH and BOOST_POSIX_PATH are defined
# elif !defined(BOOST_WINDOWS_PATH) && !defined(BOOST_POSIX_PATH)
#   if !defined(BOOST_POSIX_PATH) && (defined(_WIN32) || defined(__CYGWIN__))
#     define BOOST_WINDOWS_PATH
#   else
#     define BOOST_POSIX_PATH
#   endif
# endif

//  narrow support only for badly broken compilers or libraries  -------------//

# if defined(BOOST_NO_STD_WSTRING) || defined(BOOST_NO_SFINAE) || defined(BOOST_NO_STD_LOCALE) || BOOST_WORKAROUND(__BORLANDC__, <0x610)
#   define BOOST_FILESYSTEM2_NARROW_ONLY
# endif

// This header implements separate compilation features as described in
// http://www.boost.org/more/separate_compilation.html

//  enable dynamic linking ---------------------------------------------------//

#if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_FILESYSTEM_DYN_LINK)
# if defined(BOOST_FILESYSTEM_SOURCE)
#   define BOOST_FILESYSTEM_DECL BOOST_SYMBOL_EXPORT
# else
#   define BOOST_FILESYSTEM_DECL BOOST_SYMBOL_IMPORT
# endif
#else
# define BOOST_FILESYSTEM_DECL
#endif

//  enable automatic library variant selection  ------------------------------//

#if !defined(BOOST_FILESYSTEM_SOURCE) && !defined(BOOST_ALL_NO_LIB) \
  && !defined(BOOST_FILESYSTEM_NO_LIB)
//
// Set the name of our library, this will get undef'ed by auto_link.hpp
// once it's done with it:
//
#define BOOST_LIB_NAME boost_filesystem
//
// If we're importing code from a dll, then tell auto_link.hpp about it:
//
#if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_FILESYSTEM_DYN_LINK)
#  define BOOST_DYN_LINK
#endif
//
// And include the header that does the work:
//
#include <boost/config/auto_link.hpp>
#endif  // auto-linking disabled

#endif // BOOST_FILESYSTEM2_CONFIG_HPP