text:
'use strict';

// Customers controller
var CustomersApp = angular.module('customers');

CustomersApp.controller('CustomersController', ['$scope', '$stateParams','Authentication', 'Customers','$modal', '$log',
	function($scope, $stateParams, Authentication, Customers, $modal, $log) {

		this.authentication = Authentication;

		// Find a list of Customers
		this.customers = Customers.query();

		//open a modal window to create a customer
		this.modalCreate = function (size) {

		    var modalInstance = $modal.open({
		      templateUrl: 'modules/customers/views/create-customer.client.view.html',
		      controller: function ($scope, $modalInstance) {

	  				  $scope.ok = function (isValid) {
	  				  	if(isValid){
					    	$modalInstance.close();
						}
					  };

					  $scope.cancel = function () {
					    $modalInstance.dismiss('cancel');
					  };
		      },
		      size: size
		    });

		    modalInstance.result.then(function (selectedItem) {
		    }, function () {
		      $log.info('Modal dismissed at: ' + new Date());
		    });
		  };

 		//open a modal window to update a customer
		this.modalUpdate = function (size, selectedCustomer) {

		    var modalInstance = $modal.open({
		      templateUrl: 'modules/customers/views/edit-customer.client.view.html',
		      controller: function ($scope, $modalInstance, customer) {
		      		$scope.customer = customer;

	  				  $scope.ok = function (isValid) {
	  				  	if(isValid){
					    	$modalInstance.close($scope.customer);
						}
					  };

					  $scope.cancel = function () {
					    $modalInstance.dismiss('cancel');
					  };
		      },
		      size: size,
		      resolve: {
		        customer: function () {
		          return selectedCustomer;
		        }
		      }
		    });

		    modalInstance.result.then(function (selectedItem) {
		      $scope.selected = selectedItem;
		    }, function () {
		      $log.info('Modal dismissed at: ' + new Date());
		    });
		  };

		// Remove existing Customer
		this.remove = function(customer) {
			if ( customer ) {
				customer.$remove();

				for (var i in this.customers) {
					if (this.customers [i] === customer) {
						this.customers.splice(i, 1);
					}
				}
			} else {
				this.customer.$remove(function() {
				});
			}
		};
	}

]);

CustomersApp.controller('CustomersCreateController', ['$scope', 'Customers','Notify',
	function($scope, Customers,Notify) {
		// Create new Customer
		this.create = function() {
			// Create new Customer object
			var customer = new Customers ({
				firstname: this.firstname,
				surname: this.surname,
				suburb: this.suburb,
				country: this.country,
				industry: this.industry,
				email: this.email,
				phone: this.phone,
				referred: this.referred,
				channel: this.channel
			});

			// Redirect after save
			customer.$save(function(response) {
				Notify.sendMsg('NewCustomer',{'id':response._id});
			}, function(errorResponse) {
				$scope.error = errorResponse.data.message;
			});
		};

	}
]);

CustomersApp.controller('CustomersEditController', ['$scope','Customers',
	function($scope, Customers) {

		$scope.channelOptions = [
	      {id: 1, item:'linkedin'},
	      {id: 2, item:'twitter'},
	      {id: 3, item:'github'}
	    ];
		// Update existing Customer
		this.update = function(Updatedcustomer) {
			var customer = Updatedcustomer;

			customer.$update(function() {
			}, function(errorResponse) {
				$scope.error = errorResponse.data.message;
			});
		};
	}
]);

CustomersApp.directive('customerList', ['Customers','Notify',function(Customers,Notify) {
  return {
  	restrict: 'E',
  	transclude: true,
    templateUrl: 'modules/customers/views/customer-list-template.html',
    link: function(scope, element, attrs){
    		// update customers list when a new on added
    		Notify.getMsg('NewCustomer',function(event, data){
    				scope.customersCtrl.customers = Customers.query();
    		});
    	}
	};
}]);

		// // Find existing Customer
		// $scope.findOne = function() {
		// 	$scope.customer = Customers.get({
		// 		customerId: $stateParams.customerId
		// 	});
		// };


text:
swoole_process: exec
--SKIPIF--
<?php require __DIR__ . "/../include/skipif.inc"; ?>
--FILE--
<?php
$process = new swoole_process('python_process', true);
$pid = $process->start();

function python_process(swoole_process $worker)
{
    $worker->exec('/usr/bin/python', array(__DIR__ . "/echo.py"));
}

$process->write("Hello World\n");
echo $process->read();
?>
Done
--EXPECTREGEX--
Python: Hello World
Done.*
--CLEAN--

redpajama_set_name: RedPajamaGithub


text:
<bill session="110" type="s" number="3218" updated="2009-01-09T18:35:04-05:00">
	<status><enacted date="1217390400" datetime="2008-07-30" /></status>

	<introduced date="1214452800" datetime="2008-06-26"/>
	<titles>
		<title type="short" as="introduced">Criminal History Background Checks Pilot Extension Act of 2008</title>
		<title type="short" as="passed house">Criminal History Background Checks Pilot Extension Act of 2008</title>
		<title type="short" as="passed senate">Criminal History Background Checks Pilot Extension Act of 2008</title>
		<title type="short" as="enacted">Criminal History Background Checks Pilot Extension Act of 2008</title>
		<title type="official" as="introduced">A bill to extend the pilot program for volunteer groups to obtain criminal history background checks.</title>
	</titles>
	<sponsor id="300008"/>
	<cosponsors>
		<cosponsor id="300052" joined="2008-06-26"/>
	</cosponsors>
	<actions>
		<vote date="1214452800" how="by Unanimous Consent" datetime="2008-06-26" where="s" type="vote" result="pass" ><text>Introduced in the Senate, read twice, considered, read the third time, and passed without amendment by Unanimous Consent.</text><reference label="consideration" ref="CR S6306"/><reference label="text as passed Senate" ref="CR S6306"/></vote>
		<action date="1214539200" datetime="2008-06-27"><text>Message on Senate action sent to the House.</text></action>
		<action date="1215536640" datetime="2008-07-08T14:04:00-04:00"><text>Received in the House.</text></action>
		<action date="1215489600" datetime="2008-07-08"><text>Referred to the House Committee on the Judiciary.</text></action>
		<action date="1216064880" datetime="2008-07-14T16:48:00-04:00"><text>Mr. Schiff moved to suspend the rules and pass the bill.</text></action>
		<action date="1216064940" datetime="2008-07-14T16:49:00-04:00"><text>Considered under suspension of the rules.</text><reference label="consideration" ref="CR H6441-6443"/></action>
		<action date="1216064940" datetime="2008-07-14T16:49:00-04:00"><text>DEBATE - The House proceeded with forty minutes of debate on S. 3218.</text></action>
		<vote date="1216065360" how="by voice vote" datetime="2008-07-14T16:56:00-04:00" where="h" type="vote2" result="pass" ><text>On motion to suspend the rules and pass the bill Agreed to by voice vote.</text><reference label="text" ref="CR H6442"/></vote>
		<topresident date="1216008000" datetime="2008-07-14" ><text>Cleared for White House.</text></topresident>
		<topresident date="1216699200" datetime="2008-07-22" ><text>Presented to President.</text></topresident>
		<action date="1217217600" datetime="2008-07-28"><text>Referred to the Subcommittee on Crime, Terrorism, and Homeland Security.</text></action>
		<signed date="1217390400" datetime="2008-07-30" ><text>Signed by President.</text></signed>
		<enacted number="110-296" date="1217390400" datetime="2008-07-30" type="public" ><text>Became Public Law No: 110-296.</text></enacted>
	</actions>
	<committees>

	</committees>
	<relatedbills>

	</relatedbills>
	<subjects>

	</subjects>
	<amendments>

	</amendments>

	7/30/2008--Public Law. (This measure has not been amended since it was introduced. The summary of that version is repeated here.)
Criminal History Background Checks Pilot Extension Act of 2008 - Amends the PROTECT Act to extend by six months the Child Safety Pilot Program (allowing certain volunteer organizations to obtain national and state criminal history background checks on their volunteers).

</bill>


text:
/**
 *
 */
package com.scaffy.dao.hibernate;

import java.io.Serializable;

import javax.annotation.PostConstruct;

import org.hibernate.Session;
import org.hibernate.Transaction;
import org.springframework.beans.factory.annotation.Autowired;

import com.scaffy.controller.MultipartResponse;
import com.scaffy.dao.BasicRESTDao;
import com.scaffy.dao.DaoOperationException;
import com.scaffy.dao.bean.BeanMethod;
import com.scaffy.dao.bean.BeanMethod.Method;
import com.scaffy.dao.bean.BeanTraversalException;
import com.scaffy.dao.bean.BeanVisitor;
import com.scaffy.entity.attachment.Attachment;

/**
 * @author 	Sherief Shawky
 * @Email 	mcrakens@gmail.com
 */
public class HibernateRESTDao extends BasicRESTDao {

	@Autowired
	private Session session;

	@PostConstruct
	public void init() {

		addVisitor(BeanMethod.Method.POST,  new BeanVisitor() {

			public void visit(Object bean) {

				session.save(bean);
			}
		});

		addVisitor(BeanMethod.Method.PUT,  new BeanVisitor() {

			public void visit(Object bean) {

				session.merge(bean);
			}
		});

		addVisitor(BeanMethod.Method.DELETE,  new BeanVisitor() {

			public void visit(Object bean) {

				bean = session.merge(bean);

				session.delete(bean);
			}
		});
	}

	/* (non-Javadoc)
	 * @see com.scaffy.dao.RESTDao#read(java.lang.Object, java.lang.Class)
	 */
	public Object read(Object key, Class<?> type) throws DaoOperationException {

		Transaction t = session.beginTransaction();

		Object model;

		try {

			t.begin();

			model = session.get(type, (Serializable)key);

			t.commit();

			return model;

		} catch(RuntimeException e) {

			t.rollback();

			throw new DaoOperationException(e);
		}
	}

	/* (non-Javadoc)
	 * @see com.scaffy.dao.BasicRESTDao#execute(java.lang.Object, com.scaffy.dao.bean.BeanMethod.Method)
	 */
	@Override
	protected void execute(Object model, Method method)
			throws BeanTraversalException, DaoOperationException {

		Transaction t = session.getTransaction();

		try {

			t.begin();

			traverse(model, method);

			t.commit();

		} catch(BeanTraversalException e) {

			t.rollback();

			throw e;

		} catch (RuntimeException e) {

			t.rollback();

			throw new DaoOperationException(e);
		}
	}

	/* (non-Javadoc)
	 * @see com.scaffy.dao.BasicRESTDao#execute(com.scaffy.controller.MultipartResponse, com.scaffy.dao.bean.BeanMethod.Method)
	 */
	@Override
	protected void execute(MultipartResponse request, Method method)
			throws BeanTraversalException, DaoOperationException {

		Transaction t = session.getTransaction();

		try {

			t.begin();

			traverse(request.getModel(), method);

			for(Attachment attachment : request.getAttachments()){

				traverse(attachment, method);
			}

			t.commit();

		} catch(BeanTraversalException e) {

			t.rollback();

			throw e;

		} catch (RuntimeException e) {

			t.rollback();

			throw new DaoOperationException(e);
		}
	}

}


text:
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')

describe AstCopyFormula do

  it "should take a specified distance in rows and columns, and move all references by the appropriate ammount" do
    copy = AstCopyFormula.new
    copy.rows_to_move = 1
    copy.columns_to_move = 1
    copy.copy([:cell,:A1]).should == [:cell,:B2]
    copy.copy([:cell,:'$A1']).should == [:cell,:'$A2']
    copy.copy([:cell,:'A$1']).should == [:cell,:'B$1']
    copy.copy([:cell,:'$A$1']).should == [:cell,:'$A$1']
    copy.copy([:area,:'A1',:'Z10']).should == [:area,:'B2',:'AA11']
    copy.copy([:area,:'$A$1',:'Z$10']).should == [:area,:'$A$1',:'AA$10']
    copy.copy([:sheet_reference,:sheet1,[:cell,:A1]]).should == [:sheet_reference,:sheet1,[:cell,:B2]]
  end

  it "should throw an exception if column or row ranges are in the AST" do
    copy = AstCopyFormula.new
    lambda { copy.copy([:column_range,'C:F'])}.should raise_exception(NotSupportedException)
    lambda { copy.copy([:row_range,'10:12'])}.should raise_exception(NotSupportedException)
  end

  it "should not duplicate constant values" do
    copy = AstCopyFormula.new
    a = [:artithmetic, [:number, 2], [:operator, "+"], [:number, 3]]
    b = copy.copy(a)
    a[1].object_id.should == b[1].object_id
    a[2].object_id.should == b[2].object_id
    a[3].object_id.should == b[3].object_id
  end

end


text:
require_relative '../keyvalidatable'

module KeyValidatable
  module Refinements
    refine Hash do
      include KeyValidatable
    end

    refine Struct do
      include KeyValidatable
    end
  end
end


text:
ACCEPTED

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

#### Published in
Australasian Lichenology 60: 40 (2007)

#### Original name
Pyrenula xanthominuta Aptroot

### Remarks
null


text:
package org.contikios.cooja.dialogs;

import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Container;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.File;
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;

import javax.swing.BorderFactory;
import javax.swing.Box;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTabbedPane;
import javax.swing.JTable;
import javax.swing.JTextField;
import javax.swing.SwingUtilities;
import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener;

import org.apache.log4j.Logger;

import org.contikios.cooja.CoreComm;
import org.contikios.cooja.Cooja;
import org.contikios.cooja.MoteInterface;
import org.contikios.cooja.MoteType;
import org.contikios.cooja.ProjectConfig;
import org.contikios.cooja.Simulation;
import org.contikios.cooja.contikimote.ContikiMoteType;
import org.contikios.cooja.contikimote.ContikiMoteType.NetworkStack;

/**
 * Contiki Mote Type compile dialog.
 *
 * @author Fredrik Osterlind
 */
public class ContikiMoteCompileDialog extends AbstractCompileDialog {
  private static final long serialVersionUID = -2596048833554777606L;
  private static Logger logger = Logger.getLogger(ContikiMoteCompileDialog.class);

  private JComboBox netStackComboBox = new JComboBox(NetworkStack.values());

  public static boolean showDialog(
      Container parent,
      Simulation simulation,
      MoteType moteType) {

    final ContikiMoteCompileDialog dialog = new ContikiMoteCompileDialog(parent, simulation, moteType);

    /* Show dialog and wait for user */
    dialog.setVisible(true); /* BLOCKS */
    if (!dialog.createdOK()) {
      return false;
    }

    /* Assume that if a firmware exists, compilation was ok */
    return true;
  }

  private ContikiMoteCompileDialog(Container parent, Simulation simulation, MoteType moteType) {
    super(parent, simulation, moteType);

    if (contikiSource != null) {
      /* Make sure compilation variables are updated */
      getDefaultCompileCommands(contikiSource);
    }

    /* Add Contiki mote type specifics */
    addAdvancedTab(tabbedPane);
  }

  private void updateForSource(File source) {
    if (moteType.getIdentifier() == null) {
      /* Generate mote type identifier */
      moteType.setIdentifier(
          ContikiMoteType.generateUniqueMoteTypeID(simulation.getMoteTypes(), null));
    }

    /* Create variables used for compiling Contiki */
    ((ContikiMoteType)moteType).setContikiSourceFile(source);
    ((ContikiMoteType)moteType).libSource = new File(
        source.getParentFile(),
        "obj_cooja/" + moteType.getIdentifier() + ".c"
    );
    ((ContikiMoteType)moteType).libFile = new File(
        source.getParentFile(),
        "obj_cooja/" + moteType.getIdentifier() + ContikiMoteType.librarySuffix
    );
    ((ContikiMoteType)moteType).archiveFile = new File(
        source.getParentFile(),
        "obj_cooja/" + moteType.getIdentifier() + ContikiMoteType.dependSuffix
    );
    ((ContikiMoteType)moteType).mapFile = new File(
        source.getParentFile(),
        "obj_cooja/" + moteType.getIdentifier() + ContikiMoteType.mapSuffix);
    ((ContikiMoteType)moteType).javaClassName = CoreComm.getAvailableClassName();

    if (((ContikiMoteType)moteType).javaClassName == null) {
      logger.fatal("Could not allocate a core communicator.");
      return;
    }

    /* Prepare compiler environment */
    String[][] env = null;
    try {
      env = CompileContiki.createCompilationEnvironment(
          moteType.getIdentifier(),
          source,
          ((ContikiMoteType)moteType).mapFile,
          ((ContikiMoteType)moteType).libFile,
          ((ContikiMoteType)moteType).archiveFile,
          ((ContikiMoteType)moteType).javaClassName
      );
      CompileContiki.redefineCOOJASources(
          moteType,
          env
      );

      String[] envOneDimension = new String[env.length];
      for (int i=0; i < env.length; i++) {
        envOneDimension[i] = env[i][0] + "=" + env[i][1];
      }
      createEnvironmentTab(tabbedPane, env);

      /* Prepare compiler with environment variables */
      this.compilationEnvironment = envOneDimension;
    } catch (Exception e) {
      logger.warn("Error when creating environment: " + e.getMessage());
      e.printStackTrace();
      env = null;
    }
  }

  public boolean canLoadFirmware(File file) {
    /* Disallow loading firmwares without compilation */
    /*
    if (file.getName().endsWith(ContikiMoteType.librarySuffix)) {
      return true;
    }
    */

    return false;
  }

  public String getDefaultCompileCommands(final File source) {
    if (moteType == null) {
      /* Not ready to compile yet */
      return "";
    }

    if (source == null || !source.exists()) {
      /* Not ready to compile yet */
      return "";
    }

    if (SwingUtilities.isEventDispatchThread()) {
      updateForSource(source);
    } else {
      try {
        SwingUtilities.invokeAndWait(new Runnable() {
          public void run() {
            updateForSource(source);
          }
        });
      } catch (InvocationTargetException e) {
        logger.fatal("Error when updating for source " + source + ": " + e.getMessage(), e);
      } catch (InterruptedException e) {
        logger.fatal("Error when updating for source " + source + ": " + e.getMessage(), e);
      }
    }

    String defines = "";
    if (((ContikiMoteType) moteType).getNetworkStack().getHeaderFile() != null) {
      defines = " DEFINES=NETSTACK_CONF_H=" + ((ContikiMoteType) moteType).getNetworkStack().getHeaderFile();
    }

    return
    /*"make clean TARGET=cooja\n" + */
    Cooja.getExternalToolsSetting("PATH_MAKE") + " " + getExpectedFirmwareFile(source).getName() + " TARGET=cooja" + defines;
  }

  public File getExpectedFirmwareFile(File source) {
    return ContikiMoteType.getExpectedFirmwareFile(source);
  }

  public Class<? extends MoteInterface>[] getAllMoteInterfaces() {
	  ProjectConfig projectConfig = moteType.getConfig();
	  String[] intfNames = projectConfig.getStringArrayValue(ContikiMoteType.class, "MOTE_INTERFACES");
	  ArrayList<Class<? extends MoteInterface>> classes = new ArrayList<Class<? extends MoteInterface>>();

	  /* Load mote interface classes */
	  for (String intfName : intfNames) {
		  Class<? extends MoteInterface> intfClass =
				  gui.tryLoadClass(this, MoteInterface.class, intfName);

		  if (intfClass == null) {
			  logger.warn("Failed to load mote interface class: " + intfName);
			  continue;
		  }

		  classes.add(intfClass);
	  }
	  return classes.toArray(new Class[0]);
  }
  public Class<? extends MoteInterface>[] getDefaultMoteInterfaces() {
	  return getAllMoteInterfaces();
  }

  private void addAdvancedTab(JTabbedPane parent) {

    /* TODO System symbols */
    /*JCheckBox symbolsCheckBox = new JCheckBox("With system symbols", false);
    symbolsCheckBox.setAlignmentX(Component.LEFT_ALIGNMENT);
    symbolsCheckBox.setEnabled(false);
    symbolsCheckBox.setToolTipText("Not implemented");*/

    /* Communication stack */
    JLabel label = new JLabel("Default network stack header");
    label.setPreferredSize(LABEL_DIMENSION);
    final JTextField headerTextField = new JTextField();
    headerTextField.setText(((ContikiMoteType)moteType).getNetworkStack().manualHeader);
    headerTextField.getDocument().addDocumentListener(new DocumentListener() {
      public void insertUpdate(DocumentEvent e) {
        updateHeader();
      }
      public void removeUpdate(DocumentEvent e) {
        updateHeader();
      }
      public void changedUpdate(DocumentEvent e) {
        updateHeader();
      }
      private void updateHeader() {
        ((ContikiMoteType)moteType).getNetworkStack().manualHeader = headerTextField.getText();
      }
    });
    final Box netStackHeaderBox = Box.createHorizontalBox();
    netStackHeaderBox.setAlignmentX(Component.LEFT_ALIGNMENT);
    netStackHeaderBox.add(label);
    netStackHeaderBox.add(Box.createHorizontalStrut(20));
    netStackHeaderBox.add(headerTextField);

    label = new JLabel("Default network stack");
    label.setPreferredSize(LABEL_DIMENSION);
    netStackComboBox.setSelectedItem(((ContikiMoteType)moteType).getNetworkStack());
    netStackComboBox.setEnabled(true);
    netStackComboBox.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        ((ContikiMoteType)moteType).setNetworkStack((NetworkStack)netStackComboBox.getSelectedItem());
        netStackHeaderBox.setVisible((NetworkStack)netStackComboBox.getSelectedItem() == NetworkStack.MANUAL);
        setDialogState(DialogState.SELECTED_SOURCE);
      }
    });
    Box netStackBox = Box.createHorizontalBox();
    netStackBox.setAlignmentX(Component.LEFT_ALIGNMENT);
    netStackBox.add(label);
    netStackBox.add(Box.createHorizontalStrut(20));
    netStackBox.add(netStackComboBox);
    netStackHeaderBox.setVisible((NetworkStack)netStackComboBox.getSelectedItem() == NetworkStack.MANUAL);

    /* Advanced tab */
    Box box = Box.createVerticalBox();
    box.setBorder(BorderFactory.createEmptyBorder(5, 10, 5, 10));
    /*box.add(symbolsCheckBox);*/
    box.add(netStackBox);
    box.add(netStackHeaderBox);
    box.add(Box.createVerticalGlue());
    JPanel container = new JPanel(new BorderLayout());
    container.add(BorderLayout.NORTH, box);
    parent.addTab("Advanced", null, new JScrollPane(container), "Advanced Contiki Mote Type settings");
  }

  private void createEnvironmentTab(JTabbedPane parent, Object[][] env) {
    /* Remove any existing environment tabs */
    for (int i=0; i < tabbedPane.getTabCount(); i++) {
      if (tabbedPane.getTitleAt(i).equals("Environment")) {
        tabbedPane.removeTabAt(i--);
      }
    }

    /* Create new tab, fill with current environment data */
    String[] columnNames = { "Variable", "Value" };
    JTable table = new JTable(env, columnNames) {
      public boolean isCellEditable(int row, int column) {
        return false;
      }
    };

    JPanel panel = new JPanel(new BorderLayout());
    JButton button = new JButton("Change environment variables: Open external tools dialog");
    button.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        /* Show external tools dialog */
        ExternalToolsDialog.showDialog(Cooja.getTopParentContainer());

        /* Update and select environment tab */
        SwingUtilities.invokeLater(new Runnable() {
          public void run() {
            getDefaultCompileCommands(((ContikiMoteType)moteType).getContikiSourceFile());
            for (int i=0; i < tabbedPane.getTabCount(); i++) {
              if (tabbedPane.getTitleAt(i).equals("Environment")) {
                tabbedPane.setSelectedIndex(i);
                break;
              }
            }
            setDialogState(DialogState.AWAITING_COMPILATION);
          }
        });

      }
    });
    panel.add(BorderLayout.NORTH, button);
    panel.add(BorderLayout.CENTER, new JScrollPane(table));

    parent.addTab("Environment", null, panel, "Environment variables");
  }

  public void writeSettingsToMoteType() {
    /* XXX Do not load the generated firmware.
     * Instead, load the copy in obj_cooja/ */
    File contikiFirmware = new File(
        moteType.getContikiSourceFile().getParentFile(),
        "obj_cooja/" + moteType.getIdentifier() + ContikiMoteType.librarySuffix
    );
    moteType.setContikiFirmwareFile(contikiFirmware);

    /* TODO System symbols */
    ((ContikiMoteType)moteType).setHasSystemSymbols(false);
  }

  public void compileContiki()
  throws Exception {
    if (((ContikiMoteType)moteType).libSource == null ||
        ((ContikiMoteType)moteType).libFile == null ||
        ((ContikiMoteType)moteType).archiveFile == null ||
        ((ContikiMoteType)moteType).mapFile == null ||
        ((ContikiMoteType)moteType).javaClassName == null) {
      throw new Exception("Library variables not defined");
    }

    /* Delete output files before compiling */
    ((ContikiMoteType)moteType).libSource.delete();
    ((ContikiMoteType)moteType).libFile.delete();
    ((ContikiMoteType)moteType).archiveFile.delete();
    ((ContikiMoteType)moteType).mapFile.delete();

    /* Extract Contiki dependencies from currently selected mote interfaces */
    String[] coreInterfaces =
      ContikiMoteType.getRequiredCoreInterfaces(getSelectedMoteInterfaceClasses());
    ((ContikiMoteType)moteType).setCoreInterfaces(coreInterfaces);

    /* Generate Contiki main source */
    /*try {
      CompileContiki.generateSourceFile(
          ((ContikiMoteType)moteType).libSource,
          ((ContikiMoteType)moteType).javaClassName,
          ((ContikiMoteType)moteType).getSensors(),
          ((ContikiMoteType)moteType).getCoreInterfaces()
      );
    } catch (Exception e) {
      throw (Exception) new Exception("Error when generating Contiki main source").initCause(e);
    }*/

    /* Start compiling */
    super.compileContiki();
  }

  protected String getTargetName() {
  	return "cooja";
  }

}


text:
package com.bbn.kbp.events2014.assessmentDiff.observers;

import com.bbn.bue.common.symbols.Symbol;
import com.bbn.kbp.events2014.Response;
import com.bbn.kbp.events2014.ResponseAssessment;

/**
 * Created by rgabbard on 5/20/14.
 */
public class MentionTypeObserver extends ConfusionMatrixAssessmentPairObserver {

  @Override
  protected boolean filter(Response response, ResponseAssessment left, ResponseAssessment right) {
    return left.mentionTypeOfCAS().isPresent() && right.mentionTypeOfCAS().isPresent();
  }

  @Override
  protected Symbol toKey(ResponseAssessment assessment) {
    // get is safe by filter
    return Symbol.from(assessment.mentionTypeOfCAS().get().toString());
  }
}


text:
id: 5e8f2f13c4cdbe86b5c72da4
title: 'Reinforcement Learning With Q-Learning: Part 2'
challengeType: 11
isHidden: false
videoId: DX7hJuaUZ7o
---

## Description

## Tests

```yml
question:
  text: What can happen if the agent does not have a good balance of taking random actions and using learned actions?
  answers:
    - The agent will always try to minimize its reward for the current state/action, leading to local minima.
    - The agent will always try to maximize its reward for the current state/action, leading to local maxima.
  solution: 2
```


text:
"""
Djehouty intends to be a set of logging formatters and handlers to easily
send log entries.
"""

import unittest
import logging
import StringIO
import ltsv

from djehouty.libltsv.formatters import LTSVFormatter
from testfixtures import log_capture

class LTSVTestCase(unittest.TestCase):
    """ Test our LTSV formatter """

    def setUp(self):
        """"""
        self.logger = logging.getLogger('djehouty-ltsv')
        self.logger.setLevel(logging.DEBUG)
        self.buffer = StringIO.StringIO()
        self.log_handler = logging.StreamHandler(self.buffer)
        self.log_handler.setFormatter(
                 LTSVFormatter(static_fields={"app": 'djehouty-ltsv'})
        )
        self.logger.addHandler(self.log_handler)

    @log_capture()
    def test_logger(self, capture):
        """ Testing logger itself """
        self.logger.info('hello world')
        self.logger.error('Where is john doe?')
        self.logger.info('start of block number %i', 1)
        capture.check(
            ('djehouty-ltsv', 'INFO', 'hello world'),
            ('djehouty-ltsv', 'ERROR', 'Where is john doe?'),
            ('djehouty-ltsv', 'INFO', 'start of block number 1'),
        )

    def test_simple_message(self):
        """ Testing format with a common message """
        msg = "testing logging format"
        self.logger.info(msg)
        ltsv_object = ltsv.reader(self.buffer.getvalue().splitlines())
        for line in ltsv_object:
            cell = dict(line)
            self.assertEqual(cell["msg"], msg)
            self.assertEqual(cell["levelname"], "INFO")
            self.assertEqual(cell["level"], "6")
            self.assertEqual(cell["app"], "djehouty-ltsv")
            self.assertEqual(cell["funcName"], "test_simple_message")

    def test_complex_message(self):
        """ Testing format with extra values """
        msg = "testing logging format"
        self.logger.info(msg, extra={"lang": 'en', "env": 'test'})
        ltsv_object = ltsv.reader(self.buffer.getvalue().splitlines())
        for line in ltsv_object:
            cell = dict(line)
            self.assertEqual(cell["msg"], msg)
            self.assertEqual(cell["levelname"], "INFO")
            self.assertEqual(cell["level"], "6")
            self.assertEqual(cell["app"], "djehouty-ltsv")
            self.assertEqual(cell["funcName"], "test_complex_message")
            self.assertEqual(cell["lang"], "en")
            self.assertEqual(cell["env"], "test")


text:
import unittest
from textwrap import dedent

import pytest

from conans.model.ref import ConanFileReference
from conans.test.utils.tools import TestClient, GenConanfile
from conans.util.env_reader import get_env

class FullRevisionModeTest(unittest.TestCase):

    def test_recipe_revision_mode(self):
        liba_ref = ConanFileReference.loads("liba/0.1@user/testing")
        libb_ref = ConanFileReference.loads("libb/0.1@user/testing")

        clienta = TestClient()
        clienta.run("config set general.default_package_id_mode=recipe_revision_mode")
        conanfilea = dedent("""
            from conans import ConanFile
            from conans.tools import save
            import uuid, os
            class Pkg(ConanFile):
                def package(self):
                    save(os.path.join(self.package_folder, "file.txt"),
                         str(uuid.uuid1()))
            """)
        clienta.save({"conanfile.py": conanfilea})
        clienta.run("create . liba/0.1@user/testing")

        clientb = TestClient(cache_folder=clienta.cache_folder)
        clientb.save({"conanfile.py": GenConanfile().with_name("libb").with_version("0.1")
                                                    .with_require(liba_ref)})
        clientb.run("create . user/testing")

        clientc = TestClient(cache_folder=clienta.cache_folder)
        clientc.save({"conanfile.py": GenConanfile().with_name("libc").with_version("0.1")
                                                    .with_require(libb_ref)})
        clientc.run("install . user/testing")

        # Do a minor change to the recipe, it will change the recipe revision
        clienta.save({"conanfile.py": conanfilea + "# comment"})
        clienta.run("create . liba/0.1@user/testing")

        clientc.run("install . user/testing", assert_error=True)
        self.assertIn("ERROR: Missing prebuilt package for 'libb/0.1@user/testing'", clientc.out)
        # Building b with the new recipe revision of liba works
        clientc.run("install . user/testing --build=libb")

        # Now change only the package revision of liba
        clienta.run("create . liba/0.1@user/testing")
        clientc.run("install . user/testing")
        clientc.run("config set general.default_package_id_mode=package_revision_mode")
        clientc.run("install . user/testing", assert_error=True)
        self.assertIn("ERROR: Missing prebuilt package for 'libb/0.1@user/testing'", clientc.out)
        clientc.run("install . user/testing --build=libb")
        clientc.run("info . --build-order=ALL")

        clienta.run("create . liba/0.1@user/testing")
        clientc.run("install . user/testing", assert_error=True)
        self.assertIn("ERROR: Missing prebuilt package for 'libb/0.1@user/testing'", clientc.out)

        clienta.run("create . liba/0.1@user/testing")
        clientc.run("info . --build-order=ALL")

    def test_binary_id_recomputation_after_build(self):
        clienta = TestClient()
        clienta.run("config set general.default_package_id_mode=recipe_revision_mode")
        conanfile = dedent("""
            from conans import ConanFile
            from conans.tools import save
            import uuid, os
            class Pkg(ConanFile):
                %s
                def package(self):
                    save(os.path.join(self.package_folder, "file.txt"),
                         str(uuid.uuid1()))
            """)
        clienta.save({"conanfile.py": conanfile % ""})
        clienta.run("create . liba/0.1@user/testing")

        clientb = TestClient(cache_folder=clienta.cache_folder)
        clientb.save({"conanfile.py": conanfile % "requires = 'liba/0.1@user/testing'"})
        clientb.run("config set general.default_package_id_mode=package_revision_mode")
        clientb.run("create . libb/0.1@user/testing")

        clientc = TestClient(cache_folder=clienta.cache_folder)
        clientc.save({"conanfile.py": conanfile % "requires = 'libb/0.1@user/testing'"})
        clientc.run("config set general.default_package_id_mode=package_revision_mode")
        clientc.run("create . libc/0.1@user/testing")

        clientd = TestClient(cache_folder=clienta.cache_folder)
        clientd.run("config set general.default_package_id_mode=package_revision_mode")
        clientd.save({"conanfile.py": conanfile % "requires = 'libc/0.1@user/testing'"})
        clientd.run("install . libd/0.1@user/testing")

        # Change A PREV
        clienta.run("create . liba/0.1@user/testing")
        clientd.run("install . libd/0.1@user/testing", assert_error=True)
        self.assertIn("ERROR: Missing prebuilt package for 'libb/0.1@user/testing'", clientd.out)
        clientd.run("install . libd/0.1@user/testing --build=missing")

        self.assertIn("libc/0.1@user/testing: Unknown binary", clientd.out)
        self.assertIn("libc/0.1@user/testing: Updated ID", clientd.out)
        self.assertIn("libc/0.1@user/testing: Binary for the updated ID has to be built",
                      clientd.out)
        self.assertIn("libc/0.1@user/testing: Calling build()", clientd.out)

    def test_binary_id_recomputation_with_build_requires(self):
        clienta = TestClient()
        clienta.save({"conanfile.py": GenConanfile().with_name("Tool").with_version("0.1")
                                                    .with_package_info(cpp_info={"libs":
                                                                                ["tool.lib"]},
                                                                       env_info={})})
        clienta.run("create . user/testing")
        clienta.run("config set general.default_package_id_mode=recipe_revision_mode")
        conanfile = dedent("""
            from conans import ConanFile
            from conans.tools import save
            import uuid, os
            class Pkg(ConanFile):
                build_requires = "Tool/0.1@user/testing"
                %s
                def build(self):
                    self.output.info("TOOLS LIBS: {}".format(self.deps_cpp_info["Tool"].libs))
                def package(self):
                    save(os.path.join(self.package_folder, "file.txt"),
                         str(uuid.uuid1()))
            """)
        clienta.save({"conanfile.py": conanfile % ""})
        clienta.run("create . liba/0.1@user/testing")

        clientb = TestClient(cache_folder=clienta.cache_folder)
        clientb.save({"conanfile.py": conanfile % "requires = 'liba/0.1@user/testing'"})
        clientb.run("config set general.default_package_id_mode=package_revision_mode")
        clientb.run("create . libb/0.1@user/testing")

        clientc = TestClient(cache_folder=clienta.cache_folder)
        clientc.save({"conanfile.py": conanfile % "requires = 'libb/0.1@user/testing'"})
        clientc.run("config set general.default_package_id_mode=package_revision_mode")
        clientc.run("create . libc/0.1@user/testing")

        clientd = TestClient(cache_folder=clienta.cache_folder)
        clientd.run("config set general.default_package_id_mode=package_revision_mode")
        clientd.save({"conanfile.py": conanfile % "requires = 'libc/0.1@user/testing'"})
        clientd.run("install . libd/0.1@user/testing")

        # Change A PREV
        clienta.run("create . liba/0.1@user/testing")
        clientd.run("install . libd/0.1@user/testing", assert_error=True)
        self.assertIn("ERROR: Missing prebuilt package for 'libb/0.1@user/testing'", clientd.out)
        clientd.run("install . libd/0.1@user/testing --build=missing")

        self.assertIn("libc/0.1@user/testing: Unknown binary", clientd.out)
        self.assertIn("libc/0.1@user/testing: Updated ID", clientd.out)
        self.assertIn("libc/0.1@user/testing: Binary for the updated ID has to be built",
                      clientd.out)
        self.assertIn("libc/0.1@user/testing: Calling build()", clientd.out)

    def test_reusing_artifacts_after_build(self):
        # An unknown binary that after build results in the exact same PREF with PREV, doesn't
        # fire build of downstream
        client = TestClient()
        client.run("config set general.default_package_id_mode=package_revision_mode")
        client.save({"conanfile.py": GenConanfile()})
        client.run("create . liba/0.1@user/testing")

        client.save({"conanfile.py": GenConanfile().with_require('liba/0.1@user/testing')})
        client.run("create . libb/0.1@user/testing")

        client.save({"conanfile.py": GenConanfile().with_require('libb/0.1@user/testing')})
        client.run("create . libc/0.1@user/testing")

        client.save({"conanfile.py": GenConanfile().with_require('libc/0.1@user/testing')})
        # Telling to build LibA doesn't change the final result of LibA, which has same ID and PREV
        client.run("install . libd/0.1@user/testing --build=liba")
        # So it is not necessary to build the downstream consumers of LibA
        for lib in ("libb", "libc"):
            self.assertIn("%s/0.1@user/testing: Unknown binary" % lib, client.out)
            self.assertIn("%s/0.1@user/testing: Updated ID" % lib, client.out)
            self.assertIn("%s/0.1@user/testing: Binary for updated ID from: Cache" % lib, client.out)
            self.assertIn("%s/0.1@user/testing: Already installed!" % lib, client.out)

    @pytest.mark.skipif(not get_env("TESTING_REVISIONS_ENABLED", False), reason="Only revisions")
    def test_download_artifacts_after_build(self):
        # An unknown binary that after build results in the exact same PREF with PREV, doesn't
        # fire build of downstream
        client = TestClient(default_server_user=True)
        client.run("config set general.default_package_id_mode=package_revision_mode")
        client.save({"conanfile.py": GenConanfile()})
        client.run("create . liba/0.1@user/testing")
        self.assertIn("liba/0.1@user/testing:5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9 - Build",
                      client.out)
        self.assertIn("liba/0.1@user/testing: Created package revision "
                      "83c38d3b4e5f1b8450434436eec31b00", client.out)
        client.save({"conanfile.py": GenConanfile().with_require('liba/0.1@user/testing')})
        client.run("create . libb/0.1@user/testing")
        self.assertIn("libb/0.1@user/testing:830b7cbbb4fc193a756c82b19904df775dc92204 - Build",
                      client.out)

        client.save({"conanfile.py": GenConanfile().with_require('libb/0.1@user/testing')})
        client.run("create . libc/0.1@user/testing")
        client.run("upload * --all -c")
        client.run("remove * -f")

        client.save({"conanfile.py": GenConanfile().with_require('libc/0.1@user/testing')})
        # Telling to build LibA doesn't change the final result of LibA, which has same ID and PREV
        client.run("install . --build=liba")
        self.assertIn("liba/0.1@user/testing: Created package revision "
                      "83c38d3b4e5f1b8450434436eec31b00", client.out)
        # So it is not necessary to build the downstream consumers of LibA
        for lib in ("libb", "libc"):
            self.assertIn("%s/0.1@user/testing: Unknown binary" % lib, client.out)
            self.assertIn("%s/0.1@user/testing: Updated ID" % lib, client.out)
            self.assertIn("%s/0.1@user/testing: Binary for updated ID from: Download" % lib,
                          client.out)
            self.assertIn("%s/0.1@user/testing: Downloaded package" % lib, client.out)

class PackageRevisionModeTest(unittest.TestCase):

    def setUp(self):
        self.client = TestClient()
        self.client.run("config set general.default_package_id_mode=package_revision_mode")

    def _generate_graph(self, dependencies):
        for ref, deps in dependencies.items():
            ref = ConanFileReference.loads(ref)
            conanfile = GenConanfile().with_name(ref.name).with_version(ref.version)
            for dep in deps:
                conanfile.with_require(ConanFileReference.loads(dep))
            filename = "%s.py" % ref.name
            self.client.save({filename: conanfile})
            self.client.run("export %s %s@" % (filename, ref))

    def test_simple_dependency_graph(self):
        dependencies = {
            "Log4Qt/0.3.0": [],
            "MccApi/3.0.9": ["Log4Qt/0.3.0"],
            "Util/0.3.5": ["MccApi/3.0.9"],
            "Invent/1.0": ["Util/0.3.5"]
        }
        self._generate_graph(dependencies)

        self.client.run("install Invent.py --build missing")
        self.assertIn("MccApi/3.0.9: Package '484784c96c359def1283e7354eec200f9f9c5cd8' created",
                      self.client.out)
        self.assertIn("Util/0.3.5: Package 'ba438cd9d192b914edb1669b3e0149822290f7d8' created",
                      self.client.out)

    def test_triangle_dependency_graph(self):
        dependencies = {
            "Log4Qt/0.3.0": [],
            "MccApi/3.0.9": ["Log4Qt/0.3.0"],
            "Util/0.3.5": ["MccApi/3.0.9"],
            "GenericSU/1.0": ["Log4Qt/0.3.0", "MccApi/3.0.9", "Util/0.3.5"]
                        }
        self._generate_graph(dependencies)

        self.client.run("install GenericSU.py --build missing")
        self.assertIn("MccApi/3.0.9: Package '484784c96c359def1283e7354eec200f9f9c5cd8' created",
                      self.client.out)
        self.assertIn("Util/0.3.5: Package 'ba438cd9d192b914edb1669b3e0149822290f7d8' created",
                      self.client.out)

    def test_diamond_dependency_graph(self):
        dependencies = {
            "Log4Qt/0.3.0": [],
            "MccApi/3.0.9": ["Log4Qt/0.3.0"],
            "Util/0.3.5": ["Log4Qt/0.3.0"],
            "GenericSU/0.3.5": ["MccApi/3.0.9", "Util/0.3.5"]
                        }
        self._generate_graph(dependencies)

        self.client.run("install GenericSU.py --build missing")
        self.assertIn("MccApi/3.0.9: Package '484784c96c359def1283e7354eec200f9f9c5cd8' created",
                      self.client.out)
        self.assertIn("Util/0.3.5: Package '484784c96c359def1283e7354eec200f9f9c5cd8' created",
                      self.client.out)

    def test_full_dependency_graph(self):
        dependencies = {
            "Log4Qt/0.3.0": [],
            "MccApi/3.0.9": ["Log4Qt/0.3.0"],
            "Util/0.3.5": ["MccApi/3.0.9"],
            "GenericSU/0.3.5": ["Log4Qt/0.3.0", "MccApi/3.0.9", "Util/0.3.5"],
            "ManagementModule/0.3.5": ["Log4Qt/0.3.0", "MccApi/3.0.9", "Util/0.3.5"],
            "StationInterfaceModule/0.13.0": ["ManagementModule/0.3.5", "GenericSU/0.3.5"],
            "PleniterGenericSuApp/0.1.8": ["ManagementModule/0.3.5", "GenericSU/0.3.5",
                                           "Log4Qt/0.3.0", "MccApi/3.0.9", "Util/0.3.5"],
            "StationinterfaceRpm/2.2.0": ["StationInterfaceModule/0.13.0",
                                          "PleniterGenericSuApp/0.1.8"]
                        }
        self._generate_graph(dependencies)

        # Obtained with with create and reevaluate_node
        ids = {"Log4Qt/0.3.0": "5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9",
               "MccApi/3.0.9": "484784c96c359def1283e7354eec200f9f9c5cd8",
               "Util/0.3.5": "ba438cd9d192b914edb1669b3e0149822290f7d8",
               "GenericSU/0.3.5": "c152f6964d097021edab4a508d8fa926bad976fb",
               "ManagementModule/0.3.5": "c152f6964d097021edab4a508d8fa926bad976fb",
               "StationInterfaceModule/0.13.0": "7184518aa4cb352204d8b00d5424d3e52e5819d8",
               "PleniterGenericSuApp/0.1.8": "7184518aa4cb352204d8b00d5424d3e52e5819d8"}

        rev = {"Log4Qt/0.3.0": "ce3408b2884c458b2bcdfeff92404c85",
               "MccApi/3.0.9": "45aeac67977b1509a2d02f9a205baccb",
               "Util/0.3.5": "f446fb8e24603baafacda66aadd2503f",
               "GenericSU/0.3.5": "d5761d4d690ded2003c3cdab86e55d15",
               "ManagementModule/0.3.5": "743935f4f5664b059d54d361a232bf94",
               "StationInterfaceModule/0.13.0": "fc81fa83c3c134db6ba5af99fd8460cb",
               "PleniterGenericSuApp/0.1.8": "7191e6b6eaf79194f1b083c8dc508518"}

        self.client.run("install StationinterfaceRpm.py --build missing")
        for pkg, id_ in ids.items():
            self.assertIn("%s: Package '%s' created" % (pkg, id_), self.client.out)
        for pkg, r in rev.items():
            self.assertIn("%s: Created package revision %s" % (pkg, r), self.client.out)

        self.client.run("install StationinterfaceRpm.py")
        for pkg, id_ in ids.items():
            self.assertIn("%s:%s - Cache" % (pkg, id_), self.client.out)

def test_package_revision_mode_full_transitive_package_id():
    # https://github.com/conan-io/conan/issues/8310
    client = TestClient()
    client.run("config set general.default_package_id_mode=package_revision_mode")
    client.run("config set general.full_transitive_package_id=1")
    client.save({"tool/conanfile.py": GenConanfile(),
                 "pkga/conanfile.py": GenConanfile(),
                 "pkgb/conanfile.py": GenConanfile().with_requires("tool/0.1", "pkga/0.1"),
                 "profile": "[build_requires]\ntool/0.1"})
    client.run("export tool tool/0.1@")
    client.run("export pkga pkga/0.1@")
    client.run("create pkgb pkgb/0.1@ -pr=profile --build=missing")
    assert "pkgb/0.1:Package_ID_unknown - Unknown" in client.out
    assert "pkgb/0.1: Unknown binary for pkgb/0.1, computing updated ID" in client.out
    assert "pkgb/0.1: Package 'f524f1981a44932e1445e13ae4cf9e2ff8112027' created" in client.out


text:
package com.redhat.repository.validator.impl.xml;

import static org.apache.commons.io.filefilter.FileFilterUtils.trueFileFilter;

import java.io.File;
import java.io.IOException;

import org.apache.commons.io.FileUtils;
import org.apache.commons.io.filefilter.IOFileFilter;
import org.junit.Test;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.test.context.ContextConfiguration;

import com.redhat.repository.validator.impl.AbstractTest;
import com.redhat.repository.validator.impl.xml.XmlVerificationException;

@ContextConfiguration
public class TestXmlFileValidator extends AbstractTest {
    @Configuration
    public static class TestConfiguration {
        @Bean
        public IOFileFilter xmlFileValidatorFilter() {
            return trueFileFilter();
        }
    }

    private final File validXmlFile = new File(repoFooDir, "settings-valid.xml");
    private final File notValidXmlFile = new File(repoFooDir, "settings-not-valid.xml");
    private final File sourceXmlFile = new File("target/test-classes/TestXmlFileValidator-settings.xml");

    @Test
    public void validXML_shouldSuccess() throws IOException {
        FileUtils.copyFile(sourceXmlFile, validXmlFile);

        validationExecutor.execute(ctx);
        assertSuccess();
    }

    @Test
    public void notValidXML_addBracket_shouldFail() throws IOException {
        FileUtils.copyFile(sourceXmlFile, notValidXmlFile);

        String xmlText = FileUtils.readFileToString(notValidXmlFile);
        xmlText = xmlText.replace("<profiles>", "  <<profiles>");
        FileUtils.writeStringToFile(notValidXmlFile, xmlText);

        validationExecutor.execute(ctx);
        assertExpectedException(XmlVerificationException.class, "Xml file settings-not-valid.xml has following errors (182, 6): The content of elements must consist of well-formed character data or markup.");
    }

    @Test
    public void notValidXML_delBracket_shouldFail() throws IOException {
        FileUtils.copyFile(sourceXmlFile, notValidXmlFile);

        String xmlText = FileUtils.readFileToString(notValidXmlFile);
        xmlText = xmlText.replace("<profiles>", "<profiles");
        FileUtils.writeStringToFile(notValidXmlFile, xmlText);

        validationExecutor.execute(ctx);
        assertExpectedException(XmlVerificationException.class, "Xml file settings-not-valid.xml has following errors (183, 5): Element type \"profiles\" must be followed by either attribute specifications, \">\" or \"/>\".");
    }

}


text:
package bus

import (
	"bytes"
	"encoding/json"
	"errors"
	"fmt"
	"io"
	"io/ioutil"
	"net/http"
)

func Connect(url string, capabilities map[string]interface{}, httpClient *http.Client) (*Client, error) {
	requestBody, err := capabilitiesToJSON(capabilities)
	if err != nil {
		return nil, err
	}

	if httpClient == nil {
		httpClient = http.DefaultClient
	}

	sessionID, err := openSession(url, requestBody, httpClient)
	if err != nil {
		return nil, err
	}

	sessionURL := fmt.Sprintf("%s/session/%s", url, sessionID)
	return &Client{sessionURL, httpClient}, nil
}

func capabilitiesToJSON(capabilities map[string]interface{}) (io.Reader, error) {
	if capabilities == nil {
		capabilities = map[string]interface{}{}
	}
	desiredCapabilities := struct {
		DesiredCapabilities map[string]interface{} `json:"desiredCapabilities"`
	}{capabilities}

	capabiltiesJSON, err := json.Marshal(desiredCapabilities)
	if err != nil {
		return nil, err
	}
	return bytes.NewReader(capabiltiesJSON), err
}

func openSession(url string, body io.Reader, httpClient *http.Client) (sessionID string, err error) {
	request, err := http.NewRequest("POST", fmt.Sprintf("%s/session", url), body)
	if err != nil {
		return "", err
	}

	request.Header.Add("Content-Type", "application/json")

	response, err := httpClient.Do(request)
	if err != nil {
		return "", err
	}
	defer response.Body.Close()

	var sessionResponse struct {
		SessionID string
		// fallback for GeckoDriver
		Value struct {
			SessionID string
		}
	}
	responseBody, err := ioutil.ReadAll(response.Body)
	if err != nil {
		return "", err
	}

	if err := json.Unmarshal(responseBody, &sessionResponse); err != nil {
		return "", err
	}

	if sessionResponse.SessionID == "" {
		// fallback for GeckoDriver
		if sessionResponse.Value.SessionID != "" {
			return sessionResponse.Value.SessionID, nil
		}
		return "", errors.New("failed to retrieve a session ID")
	}

	return sessionResponse.SessionID, nil
}


text:
<?php

namespace eams;

use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;

define('EAMS_VERSION', '0.7.0');

define('APP_DIR', realpath(__DIR__. '/../'));

$loader = require APP_DIR. '/vendor/autoload.php';

\spf\core\Autoloader::addNamespace('eams', APP_DIR. '/src/classes');
\spf\core\Autoloader::addNamespace('SiEVE', APP_DIR. '/vendor/simon-downes/sieve/src');

$app = new \Silex\Application();

$app['config'] = $app->share(function () use ($app) {
	$config = new \spf\core\Config();
	return $config->load(APP_DIR. '/config/main.php');
});

$app->register(new \Silex\Provider\TwigServiceProvider(), array(
	'twig.path' => APP_DIR. '/src/views',
));

$app->error(function (\Exception $e, $code) use ( $app ) {

	if( $app['debug'] ) {
		return;
	}

	switch ($code) {
		case 404:
			$title    = 'Page Not Found';
			$template = 'errors/404.html';
			break;
		default:
			$title    = 'Internal Error';
			$template = 'errors/503.html';
	}

	return new Response($app['twig']->render($template, array(
		'error'      => $e,
		'code'       => $code,
		'section'    => 'error',
		'page_title' => $title,
	)));

});

$app->before(function( Request $request ) use ($app) {

	$app['user'] = false;

	if( $session_id = $request->cookies->get('EAMS_SESSION') ) {

		list($user_id, $hash) = explode('-', $session_id, 2);

		$user = $app['users']->findById($user_id);
		$app['users']->loadTokens($user);

		if( $user->verifyToken($hash, users\AccessToken::ACCESS_SESSION) ) {
			$app['user'] = $user;
			$user->character = $app['characters']->findById($user->character_id);
			$app['users']->seen($app['user']);
		}
		else {
			$app['users']->save(
				$user->revokeToken($hash)
			);
		}
	}

	if( !$app['user'] && !preg_match('/^\/(login|logout|register|activate|password-reset|update-email)\//', $app['request']->getRequestUri()) )
		return $app->redirect('/login/');

});

$app['db'] = $app->share(function () use ($app) {
	return new \spf\data\adapter\MySQL(array(
		'driver'  => 'mysql',
		'host'    => $app['config']->get('db.host'),
		'port'    => $app['config']->get('db.port'),
		'user'    => $app['config']->get('db.user'),
		'pass'    => $app['config']->get('db.pass'),
		'dbname'  => $app['config']->get('db.name'),
		'options' => array(),
	));
});

$app['map'] = $app->share(function () use ($app) {
	return new \spf\model\IdentityMap();
});

$app['users'] = $app->share(function () use ($app) {
	return new \eams\users\UserRepository(
		$app['db'],
		$app['map'],
		new \eams\users\UserMapper($app['db']),
		new \eams\users\KeyMapper($app['db'])
	);
});

$app['groups'] = $app->share(function () use ($app) {
	return new \eams\groups\GroupRepository(
		$app['db'],
		$app['map'],
		new \eams\groups\GroupMapper($app['db'])
	);
});

$app['categories'] = $app->share(function () use ($app) {
	return new \eams\groups\CategoryRepository(
		$app['db'],
		$app['map'],
		new \eams\groups\CategoryMapper($app['db'])
	);
});

$app['alliances'] = $app->share(function () use ($app) {
	return new \eams\AllianceRepository(
		$app['db'],
		$app['map'],
		new \eams\BaseMapper('\\eams\\Alliance', $app['db'], 'eve_alliance'),
		$app['sieve']
	);
});

$app['corporations'] = $app->share(function () use ($app) {
	return new \eams\CorporationRepository(
		$app['db'],
		$app['map'],
		new \eams\BaseMapper('\\eams\\Corporation', $app['db'], 'eve_corporation'),
		$app['sieve'],
		$app['alliances']
	);
});

$app['characters'] = $app->share(function () use ($app) {
	return new \eams\CharacterRepository(
		$app['db'],
		$app['map'],
		new \eams\BaseMapper('\\eams\\Character', $app['db'], 'eve_character', $app['db']),
		$app['sieve'],
		$app['corporations']
	);
});

$app['mailer'] = $app->share(function () use ($app) {
	return \Swift_Mailer::newInstance(
		\Swift_PostmarkTransport::newInstance($app['config']->get('mailer.postmark-key'))
	);
});

$app['email'] = $app->share(function () use ($app) {
	return \Swift_Message::newInstance();
});

$app['sieve'] = $app->share(function () use ($app) {
	return new \SiEVE\SiEVE(
		new \spf\core\Config($app['config']->get('sieve', array()))
	);
});

// EOF


text:
<title>GrADS Command: define</title>

define

The define command creates new Grads variables. The syntax is:

define var = expression

or

var = expression
(the define command may be implied)

where var is a variable name, and expression
is any valid Grads expression.

Usage Notes

See the section in the User's Guide on defining new variables for more
information.

Examples


text:
from setuptools import setup

setup(
    name='literate',
    version='0.1',
    description='Literate code preprocessor for LaTeX',
    url='https://github.com/sbroadhead/literate',
    author='Simon Broadhead',
    author_email='sbroadhead@gmail.com',
    license='MIT',
    install_requires=['setuptools', 'pygments'],
    packages=['literate', 'literate.renderer'],
    entry_points={
        'console_scripts': {
            'lit=literate.frontend:main'
        },
    },
    zip_safe=False)


text:
extern int CRM114__MATR_DEBUG_MODE; //debugging mode. see crm114_matrix_util.h
                                    //for possible values.

#define QP_DEBUG 2              //basic information about the qp solver

#define QP_DEBUG_LOOP 3         //prints some information during each qp loop
                                //useful if the svm is getting stuck during a QP
                                //problem

#define QP_LINEAR_SOLVER 4      //prints some information during each cg loop
                                //useful to discover if the run goes on forever
                                //because the cg isn't converging
                                //(usually indicates a bug in the add or remove
                                //constraint functions!)

#define QP_CONSTRAINTS 5        //prints out information about adding and
                                //removing constraints during the qp solver

//the accuracy to which we run conjugate_gradient
//this should be a pretty small number!!!
#define QP_LINEAR_ACCURACY 1e-10
//we should never exceed this but here just in case
#define QP_MAX_ITERATIONS 1000

void crm114__run_qp(Matrix *G, Matrix *A, Vector *c, Vector *b, Vector *x);

//int main(int argc, char **argv);

#endif // !defined(__CRM114_SVM_QUAD_PROG_H__)


text:
    <meta http-equiv="Content-Type" content="text/html; charset=Windows-1252" />
    <meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5" />
    <title>LevelMin Property</title>
    <xml>
    </xml>
    <link rel="stylesheet" type="text/css" href="MSDN.css" />

            log4net SDK Reference

LevelRangeFilter.LevelMin Property

 Set the minimum matched Level

        [Visual Basic]

Public Property LevelMin As Level

        [C#]

public log4net.Core.Level LevelMin {get; set;}

Remarks

 The minimum level that this filter will attempt to match against the LoggingEvent level. If a match is found then the result depends on the value of AcceptOnMatch.

See Also

LevelRangeFilter Class | log4net.Filter Namespace

Copyright 2001-2006 The Apache Software Foundation.

Generated from assembly log4net [1.2.10.0]


text:
"""Connect your vlan to the world."""

from webob import exc

from nova.api.openstack import extensions
from nova.api.openstack import wsgi

ALIAS = 'os-cloudpipe'

class CloudpipeController(wsgi.Controller):
    """Handle creating and listing cloudpipe instances."""

    @extensions.expected_errors((410))
    def create(self, req, body):
        """Create a new cloudpipe instance, if none exists.

        Parameters: {cloudpipe: {'project_id': ''}}
        """
        raise exc.HTTPGone()

    @extensions.expected_errors((410))
    def index(self, req):
        """List running cloudpipe instances."""
        raise exc.HTTPGone()

    @extensions.expected_errors(410)
    def update(self, req, id, body):
        """Configure cloudpipe parameters for the project."""
        raise exc.HTTPGone()

class Cloudpipe(extensions.V21APIExtensionBase):
    """Adds actions to create cloudpipe instances.

    When running with the Vlan network mode, you need a mechanism to route
    from the public Internet to your vlans.  This mechanism is known as a
    cloudpipe.

    At the time of creating this class, only OpenVPN is supported.  Support for
    a SSH Bastion host is forthcoming.
    """

    name = "Cloudpipe"
    alias = ALIAS
    version = 1

    def get_resources(self):
        resource = [extensions.ResourceExtension(ALIAS,
                                           CloudpipeController())]
        return resource

    def get_controller_extensions(self):
        """It's an abstract function V21APIExtensionBase and the extension
        will not be loaded without it.
        """
        return []


text:
'use strict';

const assert = require('assert');
const clear = require('./clear');
const mocha = require('mocha');
const Parse = require('../../node');

const TestObject = Parse.Object.extend('TestObject');

describe('Parse User', () => {
  before(() => {
    Parse.initialize('integration', null, 'notsosecret');
    Parse.CoreManager.set('SERVER_URL', 'http://localhost:1337/parse');
    Parse.Storage._clear();
  });

  beforeEach((done) => {
    let promise = Parse.Promise.as();
    try {
      promise = Parse.User.logOut();
    } catch (e) {}
    promise.then(() => {
      return clear();
    }).then(() => {
      done();
    });
  });

  it('can sign up users via static method', (done) => {
    Parse.User.signUp('asdf', 'zxcv').then((user) => {
      assert(user.getSessionToken());
      done();
    });
  });

  it('can sign up via instance method', (done) => {
    let user = new Parse.User();
    user.setPassword('asdf');
    user.setUsername('zxcv');
    user.signUp().then((user) => {
      assert(user.getSessionToken());
      done();
    });
  });

  it('fails log in with wrong username', (done) => {
    Parse.User.signUp('asdf', 'zxcv').then(() => {
      return Parse.User.logIn('false_user', 'asdf3');
    }).then(null, () => {
      done();
    });
  });

  it('fails log in with wrong password', (done) => {
    Parse.User.signUp('asdf', 'zxcv').then(() => {
      return Parse.User.logIn('asdf', 'asdfWrong');
    }).then(null, () => {
      done();
    });
  });

  it('can log in a user', (done) => {
    Parse.User.signUp('asdf', 'zxcv').then(() => {
      return Parse.User.logIn('asdf', 'zxcv');
    }).then((user) => {
      assert.equal(user.get('username'), 'asdf');
      done();
    });
  });

  it('can become a user', (done) => {
    Parse.User.enableUnsafeCurrentUser();
    let user = null;
    let session = null;
    Parse.User.signUp('jason', 'parse', {'code': 'red'}).then((newUser) => {
      assert.equal(Parse.User.current(), newUser);
      user = newUser;
      session = newUser.getSessionToken();
      assert(session);

      return Parse.User.logOut();
    }).then(() => {
      assert(!Parse.User.current());

      return Parse.User.become(sessionToken);
    }).then((user) => {
      assert.equal(Parse.User.current(), user);
      assert(user);
      assert.equal(user.id, newUser.id)
      assert.equal(user.get('code'), 'red');

      return Parse.User.logOut();
    }).then(() => {
      assert(!Parse.User.current());

      return Parse.User.become('garbage');
    }).then(null, () => {
      done();
    });
  });

  it('cannot save non-authed user', (done) => {
    let user = new Parse.User();
    let notAuthed = null;
    user.set({
      password: 'asdf',
      email: 'asdf@example.com',
      username: 'zxcv',
    });
    user.signUp().then((userAgain) => {
      assert.equal(user, userAgain);
      let query = new Parse.Query(Parse.User);
      return query.get(user.id);
    }).then((userNotAuthed) => {
      notAuthed = userNotAuthed;
      user = new Parse.User();
      user.set({
        username: 'hacker',
        password: 'password',
      });
      return user.signUp();
    }).then((userAgain) => {
      assert.equal(userAgain, user);
      notAuthed.set('username', 'changed');
      return notAuthed.save();
    }).then(null, (e) => {
      assert.equal(e.code, Parse.Error.SESSION_MISSING);
      done();
    });
  });

  it('cannot delete non-authed user', (done) => {
    let user = new Parse.User();
    let notAuthed = null;
    user.signUp({
      password: 'asdf',
      email: 'asdf@example.com',
      username: 'zxcv',
    }).then(() => {
      let query = new Parse.Query(Parse.User);
      return query.get(user.id);
    }).then((userNotAuthed) => {
      notAuthed = userNotAuthed;
      user = new Parse.User();
      return user.signUp({
        username: 'hacker',
        password: 'password',
      });
    }).then((userAgain) => {
      assert.equal(userAgain, user);
      notAuthed.set('username', 'changed');
      return notAuthed.destroy();
    }).then(null, (e) => {
      assert.equal(e.code, Parse.Error.SESSION_MISSING);
      done();
    });
  });

  it('cannot saveAll with non-authed user', (done) => {
    let user = new Parse.User();
    let notAuthed = null;
    user.signUp({
      password: 'asdf',
      email: 'asdf@example.com',
      username: 'zxcv',
    }).then(() => {
      let query = new Parse.Query(Parse.User);
      return query.get(user.id);
    }).then((userNotAuthed) => {
      notAuthed = userNotAuthed;
      user = new Parse.User();
      return user.signUp({
        username: 'hacker',
        password: 'password',
      });
    }).then(() => {
      let query = new Parse.Query(Parse.User);
      return query.get(user.id);
    }).then((userNotAuthedNotChanged) => {
      notAuthed.set('username', 'changed');
      let object = new TestObject();
      return object.save({ user: userNotAuthedNotChanged });
    }).then((o) => {
      let item1 = new TestObject();
      return item1.save({ number: 0 });
    }).then((item1) => {
      item1.set('number', 1);
      let item2 = new TestObject();
      item2.set('number', 2);
      return Parse.Object.saveAll([item1, item2, notAuthed]);
    }).then(null, (e) => {
      assert.equal(e.code, Parse.Error.SESSION_MISSING);
      done();
    });
  });

  it('can store the current user', (done) => {
    Parse.User.enableUnsafeCurrentUser();
    let user = new Parse.User();
    user.set('password', 'asdf');
    user.set('email', 'asdf@example.com');
    user.set('username', 'zxcv');
    user.signUp().then(() => {
      let current = Parse.User.current();
      assert.equal(user.id, current.id);
      assert(user.getSessionToken());

      let currentAgain = Parse.User.current();
      assert.equal(current, currentAgain);

      return Parse.User.logOut();
    }).then(() => {
      assert.equal(Parse.User.current(), null);
      done();
    });
  });

  it('can test if a user is current', (done) => {
    Parse.User.enableUnsafeCurrentUser();
    let user1 = new Parse.User();
    let user2 = new Parse.User();
    let user3 = new Parse.User();

    user1.set('username', 'a');
    user2.set('username', 'b');
    user3.set('username', 'c');

    user1.set('password', 'password');
    user2.set('password', 'password');
    user3.set('password', 'password');

    user1.signUp().then(() => {
      assert(user1.isCurrent());
      assert(!user2.isCurrent());
      assert(!user3.isCurrent());

      return user2.signUp();
    }).then(() => {
      assert(!user1.isCurrent());
      assert(user2.isCurrent());
      assert(!user3.isCurrent());

      return user3.signUp();
    }).then(() => {
      assert(!user1.isCurrent());
      assert(!user2.isCurrent());
      assert(user3.isCurrent());

      return Parse.User.logIn('a', 'password');
    }).then(() => {
      assert(user1.isCurrent());
      assert(!user2.isCurrent());
      assert(!user3.isCurrent());

      return Parse.User.logIn('b', 'password');
    }).then(() => {
      assert(!user1.isCurrent());
      assert(user2.isCurrent());
      assert(!user3.isCurrent());

      return Parse.User.logIn('c', 'password');
    }).then(() => {
      assert(!user1.isCurrent());
      assert(!user2.isCurrent());
      assert(user3.isCurrent());

      return Parse.User.logOut();
    }).then(() => {
      assert(!user3.isCurrent());
      done();
    });
  });

  it('can query for users', (done) => {
    let user = new Parse.User();
    user.set('password', 'asdf');
    user.set('email', 'asdf@exxample.com');
    user.set('username', 'zxcv');
    user.signUp().then(() => {
      let query = new Parse.Query(Parse.User);
      return query.get(user.id);
    }).then((u) => {
      assert.equal(u.id, user.id);
      return new Parse.Query(Parse.User).find();
    }).then((users) => {
      assert.equal(users.length, 1);
      assert.equal(users[0].id, user.id);
      done();
    });
  });

  it('preserves the session token when querying the current user', (done) => {
    let user = new Parse.User();
    user.set('password', 'asdf');
    user.set('email', 'asdf@example.com');
    user.set('username', 'zxcv');
    user.signUp().then(() => {
      assert(user.has('sessionToken'));
      let query = new Parse.Query(Parse.User);
      return query.get(user.id);
    }).then((u) => {
      // Old object maintains token
      assert(user.has('sessionToken'));
      // New object doesn't have token
      assert(!u.has('sessionToken'));
      done();
    });
  });

  it('does not log in a user when saving', (done) => {
    Parse.User.enableUnsafeCurrentUser();
    let user = new Parse.User();
    user.save({
      password: 'asdf',
      email: 'asdf@example.com',
      username: 'zxcv',
    }).then(() => {
      assert(!Parse.User.current());
      done();
    });
  });

  it('can update users', (done) => {
    let user = new Parse.User();
    user.signUp({
      password: 'asdf',
      email: 'asdf@example.com',
      username: 'zxcv',
    }).then(() => {
      user.set('username', 'test');
      return user.save();
    }).then(() => {
      assert.equal(Object.keys(user.attributes).length, 6);
      assert(user.attributes.hasOwnProperty('username'));
      assert(user.attributes.hasOwnProperty('email'));
      return user.destroy();
    }).then(() => {
      let query = new Parse.Query(Parse.User);
      return query.get(user.id);
    }).then(null, (e) => {
      assert.equal(e.code, Parse.Error.OBJECT_NOT_FOUND);
      done();
    });
  });

  it('can count users', (done) => {
    let james = new Parse.User();
    james.set('username', 'james');
    james.set('password', 'mypass');
    james.signUp().then(() => {
      let kevin = new Parse.User();
      kevin.set('username', 'kevin');
      kevin.set('password', 'mypass');
      return kevin.signUp();
    }).then(() => {
      let query = new Parse.Query(Parse.User);
      return query.count();
    }).then((c) => {
      assert.equal(c, 2);
      done();
    });
  });

  it('can sign up user with container class', (done) => {
    Parse.User.signUp('ilya', 'mypass', { 'array': ['hello'] }).then(() => {
      done();
    });
  });

  it('handles user subclassing', (done) => {
    let SuperUser = new Parse.Object.extend('User');
    let user = new SuperUser();
    user.set('username', 'bob');
    user.set('password', 'welcome');
    assert(user instanceof Parse.User);
    user.signUp().then(() => {
      done();
    });
  });

  it('uses subclasses when doing signup', (done) => {
    let SuperUser = Parse.User.extend({
      secret() {
        return 1337;
      }
    });

    Parse.User.signUp('bob', 'welcome').then((user) => {
      assert(user instanceof SuperUser);
      assert.equal(user.secret(), 1337);
      done();
    });
  });
});


text:
require 'rubybvc'
require 'yaml'

delay = 5

puts "Loading configuration..."
config = YAML.load_file('config.yml')

puts "\nStarting Demo 21: Setting OpenFlow flow on the Controller: "\
  "send to controller traffic with a particular ipv6 source and destination, "\
  "IPv6 Flow Label, IP DSCP and ECN, IPv6 Extension Header, Metadata and TCP "\
  "source and destination ports"

puts "\nCreating controller instance"
controller = Controller.new(ip_addr: config['controller']['ip_addr'],
  admin_name: config['controller']['username'],
  admin_password: config['controller']['password'])
puts "Controller: #{JSON.pretty_generate controller.to_hash}"

name = config['node']['name']
of_switch = OFSwitch.new(controller: controller, name: name)
eth_type = 34525
ipv6_src = "1234:5678:9ABC:DEF0:FDCD:A987:6543:210F/76"
ipv6_dst = "2000:2abc:edff:fe00::3456/94"
ipv6_flabel = 7
ipv6_exthdr = 0 # "Hop-by-Hop Options' header type
ip_dscp = 60
ip_ecn = 3
ip_proto = 6
tcp_src_port = 1831
tcp_dst_port = 100610
metadata = "123456789"

output_port = "CONTROLLER"

puts "\nMatch: Ethernet Type 0x#{eth_type.to_s(16)}, IPv6 Source #{ipv6_src}, "\
  "IPv6 Destination #{ipv6_dst}, IPv6 Flow Label #{ipv6_flabel}, "\
  "IP DSCP #{ip_dscp}, IP ECN #{ip_ecn}, TCP Source #{tcp_src_port}, "\
  "TCP Destination #{tcp_dst_port}, Metadata: #{metadata}"
puts "Action: Output (controller)"

sleep(delay)
flow_id = 27
table_id = 0
flow_entry = FlowEntry.new(flow_priority: 1020, flow_table_id: table_id,
  flow_id: flow_id, name: "demo21", cookie: 2100,
  hard_timeout: 1200, idle_timeout: 3400)
# Instruction: 'Apply-action'
#     Actions: 'Output'
instruction = Instruction.new(instruction_order: 0)
action = OutputAction.new(order: 0, port: output_port)
instruction.add_apply_action(action)
flow_entry.add_instruction(instruction)

# Match Fields: Ethernet Type
#               IPv6 Source Addres
#               IPv6 Destination Address
#               IPv6 Flow Label
#               IPv6 Extention Header
#               IP protocol number (TCP)
#               IP DCSP
#               IP ECN
#               TCP Source Port
#               TCP Destination Port
#               Metadata
match = Match.new(eth_type: eth_type, ipv6_source: ipv6_src,
  ipv6_destination: ipv6_dst, ip_protocol_num: ip_proto, ip_dscp: ip_dscp,
  ip_ecn: ip_ecn, tcp_source_port: tcp_src_port,
  tcp_destination_port: tcp_dst_port, ipv6_ext_header: ipv6_exthdr,
  ipv6_flabel: ipv6_flabel, metadata: metadata)
flow_entry.add_match(match)

puts"\nFlow to send: #{JSON.pretty_generate flow_entry.to_hash}"

sleep(delay)
response = of_switch.add_modify_flow(flow_entry)
if response.status == NetconfResponseStatus::OK
  puts "\nFlow successfully added to the controller"
else
  puts "\nDemo terminated: #{response.message}"
  exit
end

puts "\n Get configured flow from the Controller"
response = of_switch.get_configured_flow(table_id: table_id, flow_id: flow_id)
if response.status == NetconfResponseStatus::OK
  puts "Flow successfully read from the controller"
  puts "Flow info: #{JSON.pretty_generate response.body}"
else
  puts "\nDemo terminated: #{response.message}"
  exit
end

puts "\nDelete flow with ID #{flow_id} from Controller's cache and from table "\
  "#{table_id} on #{name} node"
sleep(delay)
response = of_switch.delete_flow(flow_id: flow_id, table_id: table_id)
if response.status == NetconfResponseStatus::OK
  puts "Flow successfully removed from the controller"
else
  puts "\nDemo terminated: #{response.message}"
  exit
end

puts "\nEnd of Demo 21"


text:
from distutils.core import setup
from setuptools import find_packages

setup(
    name='nfcu',
    packages=find_packages(),
    version='0.1.2',
    description='Navy Federal Credit Union Module',
    author='Matthew Harris',
    author_email='matt@x-qa.com',
    url='https://github.com/morissette/nfcu',
    download_url='https://github.com/morissette/nfcu/tarball/0.1.2',
    keywords=['nfcu', 'fintech', 'navy federal', 'api'],
    classifiers=[],
)


text:
package sqlancer.common.ast.newast;

public class NewTernaryNode<T> implements Node<T> {

    protected final Node<T> left;
    protected final Node<T> middle;
    protected final Node<T> right;
    private final String leftStr;
    private final String rightStr;

    public NewTernaryNode(Node<T> left, Node<T> middle, Node<T> right, String leftStr, String rightStr) {
        this.left = left;
        this.middle = middle;
        this.right = right;
        this.leftStr = leftStr;
        this.rightStr = rightStr;
    }

    public Node<T> getLeft() {
        return left;
    }

    public Node<T> getMiddle() {
        return middle;
    }

    public Node<T> getRight() {
        return right;
    }

    public String getLeftStr() {
        return leftStr;
    }

    public String getRightStr() {
        return rightStr;
    }

}


text:
var express = require('express');
var build = require('./build.js');

var server = express();
var port = 8000;

server
  .use(express.favicon())

server.configure('development', function() {
  server
    .use(express.logger('dev'))
    .use(build)
    .use(express.errorHandler({
      dumpExceptions: true,
      showStack: true
    }));
});

server.configure('production', function() {
  server.use(express.errorHandler());
});

server
  .use(express.static(__dirname + '/public'))
  .use(express.bodyParser());

server.listen(port, function() {
  console.log('Server listening on http://localhost:' + port);
});


text:
// Description: C# Extension Methods | Enhance the .NET Framework and .NET Core with over 1000 extension methods.
// Website & Documentation: https://csharp-extension.com/
// Issues: https://github.com/zzzprojects/Z.ExtensionMethods/issues
// License (MIT): https://github.com/zzzprojects/Z.ExtensionMethods/blob/master/LICENSE
// More projects: https://zzzprojects.com/
// Copyright © ZZZ Projects Inc. All rights reserved.
using System.Reflection;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.

[assembly: AssemblyTitle("Z.Web")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Z.Web")]
[assembly: AssemblyCopyright("Copyright ©  2014")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components.  If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.

[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is exposed to COM

[assembly: Guid("11b1b3ca-92b2-4abd-b339-2e9531a74be6")]

// Version information for an assembly consists of the following four values:
//
//      Major Version
//      Minor Version
//      Build Number
//      Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]

[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]


text:
/**
 * Module dependencies.
 */

var debug = require('debug')('koa-mount');
var compose = require('koa-compose');
var assert = require('assert');

/**
 * Expose `mount()`.
 */

module.exports = mount;

/**
 * Mount `app` with `prefix`, `app`
 * may be a Koa application or
 * middleware function.
 *
 * @param {String|Application|Function} prefix, app, or function
 * @param {Application|Function} [app or function]
 * @return {Function}
 * @api public
 */

function mount(prefix, app) {
  if ('string' != typeof prefix) {
    app = prefix;
    prefix = '/';
  }

  assert('/' == prefix[0], 'mount path must begin with "/"');

  // compose
  var downstream = app.middleware
    ? compose(app.middleware)
    : app;

  // don't need to do mounting here
  if ('/' == prefix) return downstream;

  var trailingSlash = '/' == prefix.slice(-1);

  var name = app.name || 'unnamed';
  debug('mount %s %s', prefix, name);

  return function *(upstream){
    var prev = this.path;
    var newPath = match(prev);
    debug('mount %s %s -> %s', prefix, name, newPath);
    if (!newPath) return yield* upstream;

    this.mountPath = prefix;
    this.path = newPath;
    debug('enter %s -> %s', prev, this.path);

    yield* downstream.call(this, function *(){
      this.path = prev;
      yield* upstream;
      this.path = newPath;
    }.call(this));

    debug('leave %s -> %s', prev, this.path);
    this.path = prev;
  }

  /**
   * Check if `prefix` satisfies a `path`.
   * Returns the new path.
   *
   * match('/images/', '/lkajsldkjf') => false
   * match('/images', '/images') => /
   * match('/images/', '/images') => false
   * match('/images/', '/images/asdf') => /asdf
   *
   * @param {String} prefix
   * @param {String} path
   * @return {String|Boolean}
   * @api private
   */

  function match(path) {
    // does not match prefix at all
    if (0 != path.indexOf(prefix)) return false;

    var newPath = path.replace(prefix, '') || '/';
    if (trailingSlash) return newPath;

    // `/mount` does not match `/mountlkjalskjdf`
    if ('/' != newPath[0]) return false;
    return newPath;
  }
}


text:
layout: page
title: Jackson Tech Trade Fair
date: 2016-05-24
author: John Jordan
tags: weekly links, java
status: published
summary: Sed at blandit felis, quis hendrerit ipsum. Aenean.
banner: images/banner/leisure-04.jpg
booking:
  startDate: 02/11/2017
  endDate: 02/12/2017
  ctyhocn: DALVRHX
  groupCode: JTTF
published: true
---
Fusce luctus congue laoreet. Ut nec dui eget nibh lacinia facilisis at sed nulla. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent varius ullamcorper sem. Pellentesque pellentesque sapien est, sed rhoncus ligula congue et. Duis vitae nibh laoreet, scelerisque sem eget, sodales eros. Nulla id lorem eget justo ultrices bibendum nec sit amet nunc. Maecenas porttitor tempus lobortis. Sed gravida facilisis ipsum, nec aliquam elit lobortis vitae. Nulla hendrerit cursus turpis, vel sodales odio dignissim condimentum. Aenean a nulla dui. Nulla nulla lectus, facilisis at rutrum at, venenatis a velit.
Praesent placerat lorem augue, faucibus egestas ligula interdum eu. Suspendisse vitae blandit enim. Integer gravida consectetur fringilla. Suspendisse potenti. Duis imperdiet eget velit accumsan semper. Nam blandit mattis dui sit amet imperdiet. Donec felis nisl, facilisis a scelerisque ac, sagittis ac erat.

* Donec laoreet tortor in augue egestas commodo
* Ut viverra mi at augue sollicitudin, non lobortis felis interdum
* Quisque sed nulla nec mi eleifend convallis.

Proin tincidunt tincidunt turpis eu condimentum. Phasellus sit amet sagittis orci, nec imperdiet erat. Donec tempus lorem at purus volutpat luctus. Aenean sed augue nec erat fermentum fringilla non ac metus. Sed posuere nec felis sed eleifend. Nunc dui eros, elementum congue tempus sed, accumsan ut ipsum. Duis mi augue, tempor id blandit at, suscipit in elit. Aliquam iaculis, erat in pellentesque laoreet, est enim bibendum quam, finibus tristique lorem mi nec nulla. Nulla at mauris nisi. Fusce vel scelerisque magna, id aliquam neque. Maecenas fermentum placerat fermentum. Ut vitae ipsum sed magna luctus viverra. Maecenas commodo nisi ante, ut mattis orci faucibus ac.


text:
<!doctype html>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <meta name="theme-color" content="#000000">

    <link rel="manifest" href="%PUBLIC_URL%/manifest.json">
    <link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico">
    <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">

    <title>Butterfly Pinner</title>

      Welcome to the butterfly pinner!


text:
import { GroupDetails } from "./groupinterfaces";
import { UserDetails } from "../user";

export const GroupRequestRoutes = {
  Create: "/api/group/create",
  Delete: "/api/group/delete",
  Edit: "/api/group/edit",
  SetMembers: "/api/group/setmembers",
  AddMember: "/api/group/addmember",
  RemoveMember: "/api/group/removemember",
};

export type GroupRequestRoutes = keyof typeof GroupRequestRoutes;

export interface CreateGroupRequest {
  group: GroupDetails;
}

export interface DeleteGroupRequest {
  groupId: string;
}

export interface EditGroupRequest {
  groupId: string;
  displayName: string;
  description: string;
}

export interface SetGroupMembersRequest {
  groupId: string;
  memberIds: string[];
}

export interface AddMemberToGroupRequest {
  groupId: string;
  memberId: string;
}

export interface RemoveMemberFromGroupRequest {
  groupId: string;
  memberId: string;
}


text:
using XenAdmin.Controls;

namespace XenAdmin.Dialogs
{
    partial class EnablePvsReadCachingDialog
    {
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code

        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(EnablePvsReadCachingDialog));
            this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
            this.pvsSiteList = new XenAdmin.Controls.LongStringComboBox();
            this.rubricLabel = new System.Windows.Forms.Label();
            this.pvsSiteLabel = new System.Windows.Forms.Label();
            this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel();
            this.cancel = new System.Windows.Forms.Button();
            this.enableButton = new System.Windows.Forms.Button();
            this.readonlyCheckboxToolTipContainer = new XenAdmin.Controls.ToolTipContainer();
            this.tableLayoutPanel1.SuspendLayout();
            this.flowLayoutPanel1.SuspendLayout();
            this.SuspendLayout();
            //
            // tableLayoutPanel1
            //
            resources.ApplyResources(this.tableLayoutPanel1, "tableLayoutPanel1");
            this.tableLayoutPanel1.Controls.Add(this.pvsSiteList, 1, 1);
            this.tableLayoutPanel1.Controls.Add(this.rubricLabel, 0, 0);
            this.tableLayoutPanel1.Controls.Add(this.pvsSiteLabel, 0, 1);
            this.tableLayoutPanel1.Controls.Add(this.flowLayoutPanel1, 0, 2);
            this.tableLayoutPanel1.Name = "tableLayoutPanel1";
            //
            // pvsSiteList
            //
            this.pvsSiteList.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
            resources.ApplyResources(this.pvsSiteList, "pvsSiteList");
            this.pvsSiteList.FormattingEnabled = true;
            this.pvsSiteList.Name = "pvsSiteList";
            //
            // rubricLabel
            //
            resources.ApplyResources(this.rubricLabel, "rubricLabel");
            this.tableLayoutPanel1.SetColumnSpan(this.rubricLabel, 2);
            this.rubricLabel.Name = "rubricLabel";
            //
            // pvsSiteLabel
            //
            resources.ApplyResources(this.pvsSiteLabel, "pvsSiteLabel");
            this.pvsSiteLabel.Name = "pvsSiteLabel";
            //
            // flowLayoutPanel1
            //
            resources.ApplyResources(this.flowLayoutPanel1, "flowLayoutPanel1");
            this.tableLayoutPanel1.SetColumnSpan(this.flowLayoutPanel1, 2);
            this.flowLayoutPanel1.Controls.Add(this.cancel);
            this.flowLayoutPanel1.Controls.Add(this.enableButton);
            this.flowLayoutPanel1.Name = "flowLayoutPanel1";
            //
            // cancel
            //
            resources.ApplyResources(this.cancel, "cancel");
            this.cancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
            this.cancel.Name = "cancel";
            this.cancel.UseVisualStyleBackColor = true;
            //
            // enableButton
            //
            this.enableButton.DialogResult = System.Windows.Forms.DialogResult.Yes;
            resources.ApplyResources(this.enableButton, "enableButton");
            this.enableButton.Name = "enableButton";
            this.enableButton.UseVisualStyleBackColor = true;
            this.enableButton.Click += new System.EventHandler(this.enableButton_Click);
            //
            // readonlyCheckboxToolTipContainer
            //
            resources.ApplyResources(this.readonlyCheckboxToolTipContainer, "readonlyCheckboxToolTipContainer");
            this.readonlyCheckboxToolTipContainer.Name = "readonlyCheckboxToolTipContainer";
            //
            // EnablePvsReadCachingDialog
            //
            this.AcceptButton = this.enableButton;
            resources.ApplyResources(this, "$this");
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
            this.CancelButton = this.cancel;
            this.Controls.Add(this.tableLayoutPanel1);
            this.Controls.Add(this.readonlyCheckboxToolTipContainer);
            this.Name = "EnablePvsReadCachingDialog";
            this.tableLayoutPanel1.ResumeLayout(false);
            this.tableLayoutPanel1.PerformLayout();
            this.flowLayoutPanel1.ResumeLayout(false);
            this.ResumeLayout(false);
            this.PerformLayout();

        }

        #endregion

        private XenAdmin.Controls.ToolTipContainer readonlyCheckboxToolTipContainer;
        private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
        private System.Windows.Forms.Label rubricLabel;
        private LongStringComboBox pvsSiteList;
        private System.Windows.Forms.Label pvsSiteLabel;
        private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel1;
        private System.Windows.Forms.Button cancel;
        private System.Windows.Forms.Button enableButton;
    }
}


text:
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
  <link href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap-glyphicons.css" rel="stylesheet">
  <title>Solarlux App Center</title>
</head>
<body>

<div id="content" />

</body>
</html>