text:
package org.apache.tools.ant.taskdefs.optional.image;

import org.apache.tools.ant.BuildFileTest;
import org.apache.tools.ant.util.FileUtils;

import java.io.File;

/**
 * Tests the Image task.
 *
 * @since     Ant 1.5
 */
public class ImageTest extends BuildFileTest {

    private final static String TASKDEFS_DIR =
        "src/etc/testcases/taskdefs/optional/image/";
    private final static String LARGEIMAGE = "largeimage.jpg";

    private static final FileUtils FILE_UTILS = FileUtils.getFileUtils();

    public ImageTest(String name) {
        super(name);
    }

    public void setUp() {
        configureProject(TASKDEFS_DIR + "image.xml");
    }

    public void tearDown() {
        executeTarget("cleanup");
    }

    public void testEchoToLog() {
        expectLogContaining("testEchoToLog", "Processing File");
    }

    public void testSimpleScale(){
        expectLogContaining("testSimpleScale", "Processing File");
        File f = createRelativeFile("/dest/" + LARGEIMAGE);
        assertTrue(
                   "Did not create "+f.getAbsolutePath(),
                   f.exists());

    }

    public void testOverwriteTrue() {
        expectLogContaining("testSimpleScale", "Processing File");
        File f = createRelativeFile("/dest/" + LARGEIMAGE);
        long lastModified = f.lastModified();
        try {
            Thread.sleep(FILE_UTILS
                         .getFileTimestampGranularity());
        }
        catch (InterruptedException e) {}
        expectLogContaining("testOverwriteTrue", "Processing File");
        f = createRelativeFile("/dest/" + LARGEIMAGE);
        long overwrittenLastModified = f.lastModified();
        assertTrue("File was not overwritten.",
                   lastModified < overwrittenLastModified);
    }

    public void testOverwriteFalse() {
        expectLogContaining("testSimpleScale", "Processing File");
        File f = createRelativeFile("/dest/" + LARGEIMAGE);
        long lastModified = f.lastModified();
        expectLogContaining("testOverwriteFalse", "Processing File");
        f = createRelativeFile("/dest/" + LARGEIMAGE);
        long overwrittenLastModified = f.lastModified();
        assertTrue("File was overwritten.",
                   lastModified == overwrittenLastModified);
    }

    public void testSimpleScaleWithMapper() {
        expectLogContaining("testSimpleScaleWithMapper", "Processing File");
        File f = createRelativeFile("/dest/scaled-" + LARGEIMAGE);
        assertTrue(
                   "Did not create "+f.getAbsolutePath(),
                   f.exists());

    }

    public void off_testFailOnError() {
        try {
            expectLogContaining("testFailOnError",
                                "Unable to process image stream");
        }
        catch (RuntimeException re){
            assertTrue("Run time exception should say "
                       + "'Unable to process image stream'. :"
                       + re.toString(),
                       re.toString()
                       .indexOf("Unable to process image stream") > -1);
        }
    }

    protected File createRelativeFile(String filename) {
        if (filename.equals(".")) {
            return getProjectDir();
        }
        // else
        return new File(getProjectDir(), filename);
    }
}


text:
(function($){

	/*
	*  Validation
	*
	*  JS model
	*
	*  @type	object
	*  @date	1/06/13
	*
	*/

	acf.validation = {

		status : true,
		disabled : false,

		run : function(){

			// reference
			var _this = this;

			// reset
			_this.status = true;

			// loop through all fields
			$('.postbox:not(.acf-hidden) .field.required, .form-field.required').each(function(){

				// vars
				var div = $(this);

				// set validation data
				div.data('validation', true);

				// if is hidden by conditional logic, ignore
				if( div.hasClass('acf-conditional_logic-hide') )
				{
					return;
				}

				// if is hidden by conditional logic on a parent tab, ignore
				if( div.hasClass('acf-tab_group-hide') )
				{
					if( div.prevAll('.field_type-tab:first').hasClass('acf-conditional_logic-hide') )
					{
						return;
					}
				}

				// text / textarea
				if( div.find('input[type="text"], input[type="email"], input[type="number"], input[type="hidden"], textarea').val() == "" )
				{
					div.data('validation', false);
				}

				// wysiwyg
				if( div.find('.acf_wysiwyg').exists() && typeof(tinyMCE) == "object")
				{
					div.data('validation', true);

					var id = div.find('.wp-editor-area').attr('id'),
						editor = tinyMCE.get( id );

					if( editor && !editor.getContent() )
					{
						div.data('validation', false);
					}
				}

				// select
				if( div.find('select').exists() )
				{
					div.data('validation', true);

					if( div.find('select').val() == "null" || ! div.find('select').val() )
					{
						div.data('validation', false);
					}
				}

				// radio
				if( div.find('input[type="radio"]').exists() )
				{
					div.data('validation', false);

					if( div.find('input[type="radio"]:checked').exists() )
					{
						div.data('validation', true);
					}
				}

				// checkbox
				if( div.find('input[type="checkbox"]').exists() )
				{
					div.data('validation', false);

					if( div.find('input[type="checkbox"]:checked').exists() )
					{
						div.data('validation', true);
					}
				}

				// relationship
				if( div.find('.acf_relationship').exists() )
				{
					div.data('validation', false);

					if( div.find('.acf_relationship .relationship_right input').exists() )
					{
						div.data('validation', true);
					}
				}

				// repeater
				if( div.find('.repeater').exists() )
				{
					div.data('validation', false);

					if( div.find('.repeater tr.row').exists() )
					{
						div.data('validation', true);
					}
				}

				// flexible content
				if( div.find('.acf_flexible_content').exists() )
				{
					div.data('validation', false);
					if( div.find('.acf_flexible_content .values table').exists() )
					{
						div.data('validation', true);
					}
				}

				// gallery
				if( div.find('.acf-gallery').exists() )
				{
					div.data('validation', false);

					if( div.find('.acf-gallery .thumbnail').exists())
					{
						div.data('validation', true);
					}
				}

				// hook for custom validation
				$(document).trigger('acf/validate_field', div );

				// set validation
				if( ! div.data('validation') )
				{
					_this.status = false;
					div.closest('.field').addClass('error');
				}

			});
			// end loop through all fields
		}

	};

	/*
	*  Events
	*
	*  Remove error class on focus
	*
	*  @type	function
	*  @date	1/03/2011
	*
	*  @param	N/A
	*  @return	N/A
	*/

	$(document).on('focus click', '.field.required input, .field.required textarea, .field.required select', function( e ){

		$(this).closest('.field').removeClass('error');

	});

	/*
	*  Save Post
	*
	*  If user is saving a draft, allow them to bypass the validation
	*
	*  @type	function
	*  @date	1/03/2011
	*
	*  @param	N/A
	*  @return	N/A
	*/

	$(document).on('click', '#save-post', function(){

		acf.validation.disabled = true;

	});

	/*
	*  Submit Post
	*
	*  Run validation and return true|false accordingly
	*
	*  @type	function
	*  @date	1/03/2011
	*
	*  @param	N/A
	*  @return	N/A
	*/

	$(document).on('submit', '#post', function(){

		// If disabled, bail early on the validation check
		if( acf.validation.disabled )
		{
			return true;
		}

		// do validation
		acf.validation.run();

		if( ! acf.validation.status )
		{
			// vars
			var $form = $(this);

			// show message
			$form.siblings('#message').remove();
			$form.before('

' + acf.l10n.validation.error + '

');

			// hide ajax stuff on submit button
			$('#publish').removeClass('button-primary-disabled');
			$('#ajax-loading').attr('style','');
			$('#publishing-action .spinner').hide();

			return false;
		}

		// remove hidden postboxes
		// + this will stop them from being posted to save
		$('.acf_postbox.acf-hidden').remove();

		// submit the form
		return true;

	});

})(jQuery);

redpajama_set_name: RedPajamaGithub


text:
Provides utilities for working with Roblox's streaming system

View docs →

## Installation
```
npm install @quenty/streamingutils --save
```

## Usage
Usage is designed to be simple.

### `StreamingUtils.promiseStreamAround(player, position, timeOut)`


text:
/** The osmplayer namespace. */
var osmplayer = osmplayer || {};

/** The parser object. */
osmplayer.parser = osmplayer.parser || {};

/**
 * The rss parser object.
 *
 * @return {object} The rss parser.
 **/
osmplayer.parser.rss = {

  // The priority for this parser.
  priority: 8,

  // Return if this is a valid youtube feed.
  valid: function(feed) {
    feed = feed.replace(/(.*)\??(.*)/i, '$1');
    return feed.match(/\.rss$/i) !== null;
  },

  // Returns the type of request to make.
  getType: function(feed) {
    return 'xml';
  },

  // Returns the feed provided the start and numItems.
  getFeed: function(feed, start, numItems) {
    return feed;
  },

  // Parse the feed.
  parse: function(data) {
    var playlist = {
      total_rows: 0,
      nodes: []
    };
    jQuery('rss channel', data).find('item').each(function(index) {
      osmplayer.parser.rss.addRSSItem(playlist, jQuery(this));
    });
    return playlist;
  },

  // Parse an RSS item.
  addRSSItem: function(playlist, item) {
    playlist.total_rows++;
    playlist.nodes.push({
      title: item.find('title').text(),
      description: item.find('annotation').text(),
      mediafiles: {
        image: {
          'image': {
            path: item.find('image').text()
          }
        },
        media: {
          'media': {
            path: item.find('location').text()
          }
        }
      }
    });
  }
};


text:
"use strict";
define("model.login", [
	"helper.fetch",
	"helper.translate",
	"helper.util",
	"model.account",
], function () {
	/** @class RAD.model.login */
	RAD.model("model.login", Backbone.Model.extend({
		defaults: {
			"login_signup_fullname": "",
			"login_signup_email": "",
			"login_signup_password": "",
		},
		validate (attrs, options) {
			if (options.signup) {
				if (!attrs.login_signup_email) {
					return __("please fill email field");
				}
				if (!RAD.helper.util.validate.email(attrs.login_signup_email)) {
					return __("email field is incorrect");
				}
				if (!attrs.login_signup_password) {
					return __("please fill password field");
				}
				attrs.login_signup_fullname = attrs.login_signup_fullname.trim();
				if (!RAD.helper.util.validate.fullName(attrs.login_signup_fullname)) {
					return __("please fill full name field");
				}
			}
		},
	}), true);
});


text:
using namespace dami;

ID3_TagImpl::const_iterator ID3_TagImpl::Find(const ID3_Frame *frame) const
{
  const_iterator cur = _frames.begin();

  for (; cur != _frames.end(); ++cur)
  {
    if (*cur == frame)
    {
      break;
    }
  }

  return cur;
}

ID3_TagImpl::iterator ID3_TagImpl::Find(const ID3_Frame *frame)
{
  iterator cur = _frames.begin();

  for (; cur != _frames.end(); ++cur)
  {
    if (*cur == frame)
    {
      break;
    }
  }

  return cur;
}

ID3_Frame *ID3_TagImpl::Find(ID3_FrameID id) const
{
  ID3_Frame *frame = NULL;

  // reset the cursor if it isn't set
  if (_frames.end() == _cursor)
  {
    _cursor = _frames.begin();
  }

  for (int iCount = 0; iCount < 2 && frame == NULL; iCount++)
  {
    // We want to cycle through the list to find the matching frame.  We
    // should begin from the cursor, search each successive frame, wrapping
    // if necessary.  The enclosing loop and the assignment statments below
    // ensure that we first begin at the cursor and search to the end of the
    // list and, if unsuccessful, start from the beginning of the list and
    // search to the cursor.
    const_iterator
      begin  = (0 == iCount ? _cursor       : _frames.begin()),
      end    = (0 == iCount ? _frames.end() : _cursor);
    // search from the cursor to the end
    for (const_iterator cur = begin; cur != end; ++cur)
    {
      if ((*cur != NULL) && ((*cur)->GetID() == id))
      {
        // We've found a valid frame.  Set the cursor to be the next element
        frame = *cur;
        _cursor = ++cur;
        break;
      }
    }
  }

  return frame;
}

ID3_Frame *ID3_TagImpl::Find(ID3_FrameID id, ID3_FieldID fldID, String data) const
{
  ID3_Frame *frame = NULL;
  ID3D_NOTICE( "Find: looking for comment with data = " << data.c_str() );

  // reset the cursor if it isn't set
  if (_frames.end() == _cursor)
  {
    _cursor = _frames.begin();
    ID3D_NOTICE( "Find: resetting cursor" );
  }

  for (int iCount = 0; iCount < 2 && frame == NULL; iCount++)
  {
    ID3D_NOTICE( "Find: iCount = " << iCount );
    // We want to cycle through the list to find the matching frame.  We
    // should begin from the cursor, search each successive frame, wrapping
    // if necessary.  The enclosing loop and the assignment statments below
    // ensure that we first begin at the cursor and search to the end of the
    // list and, if unsuccessful, start from the beginning of the list and
    // search to the cursor.
    const_iterator
      begin  = (0 == iCount ? _cursor       : _frames.begin()),
      end    = (0 == iCount ? _frames.end() : _cursor);
    // search from the cursor to the end
    for (const_iterator cur = begin; cur != end; ++cur)
    {
      ID3D_NOTICE( "Find: frame = 0x" << hex << (uint32) *cur << dec );
      if ((*cur != NULL) && ((*cur)->GetID() == id) &&
          (*cur)->Contains(fldID))
      {
        ID3_Field* fld = (*cur)->GetField(fldID);
        if (NULL == fld)
        {
          continue;
          ID3D_NOTICE( "Find: didn't have the right field" );
        }

        String text( NULL == fld->GetRawText() ? "" : fld->GetRawText() , fld->Size()); //PHF
        ID3D_NOTICE( "Find: text = " << text.c_str() );

        if (text == data)
        {
          // We've found a valid frame.  Set cursor to be the next element
          frame = *cur;
          _cursor = ++cur;
          break;
        }
      }
    }
  }

  return frame;
}

ID3_Frame *ID3_TagImpl::Find(ID3_FrameID id, ID3_FieldID fldID, WString data) const
{
  ID3_Frame *frame = NULL;

  // reset the cursor if it isn't set
  if (_frames.end() == _cursor)
  {
    _cursor = _frames.begin();
  }

  for (int iCount = 0; iCount < 2 && frame == NULL; iCount++)
  {
    // We want to cycle through the list to find the matching frame.  We
    // should begin from the cursor, search each successive frame, wrapping
    // if necessary.  The enclosing loop and the assignment statments below
    // ensure that we first begin at the cursor and search to the end of the
    // list and, if unsuccessful, start from the beginning of the list and
    // search to the cursor.
    const_iterator
      begin  = (0 == iCount ? _cursor       : _frames.begin()),
      end    = (0 == iCount ? _frames.end() : _cursor);
    // search from the cursor to the end
    for (const_iterator cur = begin; cur != end; ++cur)
    {
      if ((*cur != NULL) && ((*cur)->GetID() == id) &&
          (*cur)->Contains(fldID))
      {
        ID3_Field* fld = (*cur)->GetField(fldID);
        if (NULL == fld)
        {
          continue;
        }
        WString text = toWString(fld->GetRawUnicodeText(), fld->Size());

        if (text == data)
        {
          // We've found a valid frame.  Set cursor to be the next element
          frame = *cur;
          _cursor = ++cur;
          break;
        }
      }
    }
  }

  return frame;
}

ID3_Frame *ID3_TagImpl::Find(ID3_FrameID id, ID3_FieldID fldID, uint32 data) const
{
  ID3_Frame *frame = NULL;

  // reset the cursor if it isn't set
  if (_frames.end() == _cursor)
  {
    _cursor = _frames.begin();
  }

  for (int iCount = 0; iCount < 2 && frame == NULL; iCount++)
  {
    // We want to cycle through the list to find the matching frame.  We
    // should begin from the cursor, search each successive frame, wrapping
    // if necessary.  The enclosing loop and the assignment statments below
    // ensure that we first begin at the cursor and search to the end of the
    // list and, if unsuccessful, start from the beginning of the list and
    // search to the cursor.
    const_iterator
      begin  = (0 == iCount ? _cursor       : _frames.begin()),
      end    = (0 == iCount ? _frames.end() : _cursor);
    // search from the cursor to the end
    for (const_iterator cur = begin; cur != end; ++cur)
    {
      if ((*cur != NULL) && ((*cur)->GetID() == id) &&
          ((*cur)->GetField(fldID)->Get() == data))
      {
        // We've found a valid frame.  Set the cursor to be the next element
        frame = *cur;
        _cursor = ++cur;
        break;
      }
    }
  }

  return frame;
}


text:
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

package org.chromium.chrome.browser.firstrun;

import androidx.fragment.app.FragmentActivity;

/**
 * This interface is implemented by FRE fragments.
 */
public interface FirstRunFragment {
    /**
     * Notifies this fragment that native has been initialized.
     */
    default void onNativeInitialized() {}

    /**
     * @return Whether the back button press was handled by this page.
     */
    default boolean interceptBackPressed() {
        return false;
    }

    /**
     * @see Fragment#getActivity().
     */
    FragmentActivity getActivity();

    /**
     * Convenience method to get {@link FirstRunPageDelegate}.
     */
    default FirstRunPageDelegate getPageDelegate() {
        return (FirstRunPageDelegate) getActivity();
    }
}


text:
<?php

namespace App\Policies;

use App\Models\Post;
use App\Models\User;
use Illuminate\Auth\Access\HandlesAuthorization;

class PostPolicy
{
    use HandlesAuthorization;

    /**
     * Determine whether the user can update the user.
     *
     * @param User             $authenticatedUser
     * @param \App\Models\Post $post
     *
     * @return mixed
     *
     * @internal param \App\Models\User $user
     */
    public function view(User $authenticatedUser, Post $post)
    {
        if ($authenticatedUser->can('view posts')) {
            return true;
        }

        if ($authenticatedUser->can('view own posts')) {
            return $authenticatedUser->id === $post->user_id;
        }

        return false;
    }

    /**
     * Determine whether the user can update the post.
     *
     * @param User             $authenticatedUser
     * @param \App\Models\Post $post
     *
     * @return mixed
     *
     * @internal param \App\Models\User $user
     */
    public function update(User $authenticatedUser, Post $post)
    {
        if ($authenticatedUser->can('edit posts')) {
            return true;
        }

        if ($authenticatedUser->can('edit own posts')) {
            return $authenticatedUser->id === $post->user_id;
        }

        return false;
    }

    /**
     * Determine whether the user can delete the post.
     *
     * @param User             $authenticatedUser
     * @param \App\Models\Post $post
     *
     * @return mixed
     *
     * @internal param \App\Models\User $user
     */
    public function delete(User $authenticatedUser, Post $post)
    {
        if ($authenticatedUser->can('delete posts')) {
            return true;
        }

        if ($authenticatedUser->can('delete own posts')) {
            return $authenticatedUser->id === $post->user_id;
        }

        return false;
    }
}


text:
track "better_exception_app" do
  rubygem     "better_exception_app"
  github_url  "https://github.com/eric1234/better_exception_app"

  gemfile do
    gem_group :production do
      gem 'better_exception_app'
    end
  end

  before_migrate do
    remove_file "public/404.html"
    remove_file "public/422.html"
    remove_file "public/500.html"
  end
end


text:
#include <sstream>

#include "Logger/Log.h"
#include "Publisher.h"

using namespace SideCar::Zeroconf;

Logger::Log&
Publisher::Log()
{
    static Logger::Log& log_ = Logger::Log::Find("SideCar.Zeroconf.Publisher");
    return log_;
}

Publisher::Ref
Publisher::Make(Monitor* monitor)
{
    Ref ref(new Publisher(monitor));
    ref->setSelf(ref);
    return ref;
}

Publisher::Publisher(Monitor* monitor) :
    Super(monitor), publishedSignal_(), textData_(), name_(""), type_(""), domain_(""), interface_(0), port_(0),
    isPublished_(false)
{
    Logger::ProcLog log("Publisher", Log());
    LOGINFO << std::endl;
}

bool
Publisher::setTextData(const std::string& key, const std::string& value, bool postNow)
{
    if ((key.size() + value.size() + 1) > 255) return false;

    Logger::ProcLog log("Publisher", Log());
    LOGINFO << "Adding to TXTRecord " << key << "=" << value << std::endl;

    textData_[key] = value;
    return postNow ? postTextData() : true;
}

bool
Publisher::postTextData()
{
    return isRunning() ? updateTextRecord() : true;
}

/** Functor used to accumulate key/value text strings into a valid Zeroconf byte array for a TXT record. In
    short, each entry starts with a byte count describing the number of bytes that make up the entry, followed
    by the key text, an equals sign ('='), and then the value text.
*/
struct BuildBuffer {
    std::string buffer_; ///< Accumulation buffer

    /** Constructor.
     */
    BuildBuffer() : buffer_("") {}

    /** Functor method. Accumulates the given entry to the internal buffer.

        \param v entry to add
    */
    void operator()(const Publisher::StringMap::value_type& v)
    {
        // Size of each entry is the key and value sizes plus an '=' sign.
        //
        unsigned char size = v.first.size() + v.second.size() + 1;
        buffer_ += size;
        buffer_ += v.first;
        buffer_ += '=';
        buffer_ += v.second;
    }

    /** Conversion operator. Returns the contents of the internal buffer.

        \return std::string copy
    */
    operator std::string() { return buffer_; }
};

bool
Publisher::publish(const std::string& name, bool noRename)
{
    Logger::ProcLog log("publish", Log());
    LOGINFO << "Registering " << name << "." << type_ << " " << domain_ << " " << port_ << ' ' << noRename << std::endl;

    if (isRunning()) stop();

    std::string buffer(std::for_each(textData_.begin(), textData_.end(), BuildBuffer()));
    LOGDEBUG << "buffer: " << buffer << std::endl;

    // Loop here to support renaming in case of name conflict.
    //
    int counter = 1;
    name_ = name;
    while (1) {
        auto err =
            ::DNSServiceRegister(&getDNSServiceRef(), noRename ? kDNSServiceFlagsNoAutoRename : 0, interface_,
                                 name_.size() ? name_.c_str() : 0, type_.c_str(), domain_.size() ? domain_.c_str() : 0,
                                 0, htons(port_), buffer.size(), buffer.c_str(), &Publisher::RegisterCallback, this);

        if (err == kDNSServiceErr_NoError) {
            break;
        }

        // Have an error, or a name conflict and we don't want to rename.
        //
        else if (err != kDNSServiceErr_NameConflict || noRename) {
            LOGERROR << name_ << " failed DNSServiceRegister - error: " << err << std::endl;
            return false;
        }

        // Must have a name conflict. Append an increasing counter value to our original name and try again.
        //
        std::ostringstream os;
        os << name << " (" << ++counter << ")";
        name_ = os.str();
        LOGWARNING << "renaming to " << name_ << std::endl;
    }

    // Must have succeeded in starting the publishing process.
    //
    serviceStarted();
    return true;
}

void
Publisher::processResponse(DNSServiceErrorType err, const char* name, const char* type, const char* domain)
{
    Logger::ProcLog log("processResponse", Log());

    isPublished_ = err == kDNSServiceErr_NoError;

    // Update our values to reflect those used by the DNSSD server.
    //
    if (isPublished_) {
        if (name_ != std::string(name)) {
            LOGWARNING << "name conflict - new name is " << name << std::endl;
            name_ = name;
        }

        type_ = type;
        domain_ = domain;
    }

    notifyObservers(isPublished_);
}

void
Publisher::notifyObservers(bool state)
{
    publishedSignal_(state);
}

bool
Publisher::updateTextRecord()
{
    if (!isPublished_) return false;
    std::string buffer(std::for_each(textData_.begin(), textData_.end(), BuildBuffer()));
    return ::DNSServiceUpdateRecord(getDNSServiceRef(), 0, 0, buffer.size(), buffer.c_str(), 0) ==
           kDNSServiceErr_NoError;
}

void
Publisher::serviceStopping()
{
    isPublished_ = false;
    Super::serviceStopping();
}

void
Publisher::RegisterCallback(DNSServiceRef ref, DNSServiceFlags flags, DNSServiceErrorType err, const char* name,
                            const char* type, const char* domain, void* context)
{
    reinterpret_cast<Publisher*>(context)->processResponse(err, name, type, domain);
}


text:
<!DOCTYPE html>

        <meta charset="utf8"/>

        <title>Free Transform Halo</title>

        <link rel="stylesheet" type="text/css" href="../../../../dist/joint.css" />
        <link rel="stylesheet" type="text/css" href="../freetransform.css" />

Try to click an element to bring up a Halo and try to resize it or rotate it.


text:
#ifndef JUCE_RESULT_H_INCLUDED
#define JUCE_RESULT_H_INCLUDED

//==============================================================================
/**
    Represents the 'success' or 'failure' of an operation, and holds an associated
    error message to describe the error when there's a failure.

    E.g.
    @code
    Result myOperation()
    {
        if (doSomeKindOfFoobar())
            return Result::ok();
        else
            return Result::fail ("foobar didn't work!");
    }

    const Result result (myOperation());

    if (result.wasOk())
    {
        ...it's all good...
    }
    else
    {
        warnUserAboutFailure ("The foobar operation failed! Error message was: "
                                + result.getErrorMessage());
    }
    @endcode
*/
class JUCE_API  Result
{
public:
    //==============================================================================
    /** Creates and returns a 'successful' result. */
    static Result ok() noexcept                         { return Result(); }

    /** Creates a 'failure' result.
        If you pass a blank error message in here, a default "Unknown Error" message
        will be used instead.
    */
    static Result fail (const String& errorMessage) noexcept;

    //==============================================================================
    /** Returns true if this result indicates a success. */
    bool wasOk() const noexcept;

    /** Returns true if this result indicates a failure.
        You can use getErrorMessage() to retrieve the error message associated
        with the failure.
    */
    bool failed() const noexcept;

    /** Returns true if this result indicates a success.
        This is equivalent to calling wasOk().
    */
    operator bool() const noexcept;

    /** Returns true if this result indicates a failure.
        This is equivalent to calling failed().
    */
    bool operator!() const noexcept;

    /** Returns the error message that was set when this result was created.
        For a successful result, this will be an empty string;
    */
    const String& getErrorMessage() const noexcept;

    //==============================================================================
    Result (const Result&);
    Result& operator= (const Result&);

   #if JUCE_COMPILER_SUPPORTS_MOVE_SEMANTICS
    Result (Result&&) noexcept;
    Result& operator= (Result&&) noexcept;
   #endif

    bool operator== (const Result& other) const noexcept;
    bool operator!= (const Result& other) const noexcept;

private:
    String errorMessage;

    // The default constructor is not for public use!
    // Instead, use Result::ok() or Result::fail()
    Result() noexcept;
    explicit Result (const String&) noexcept;

    // These casts are private to prevent people trying to use the Result object in numeric contexts
    operator int() const;
    operator void*() const;
};

#endif   // JUCE_RESULT_H_INCLUDED


text:
module.exports.id = 'aa22c294-bc63-4fd3-babc-b7b597353892';
module.exports.title = 'Migration with changed signature';
module.exports.time = '1383598223619';

//--dependencies
module.exports.dependencies = [
  'd36d73f9-fa17-4588-92cb-28013d01e24c'
];

//--migrate function
module.exports.up = function up(mig, flok, done) {
  done();
};

//--backout function
module.exports.down = function down(mig, flok, done) {
  done();
};


text:
require 'rails_helper'

RSpec.describe Track, "validations" do
  it { is_expected.to validate_presence_of(:site) }
  it { is_expected.to validate_presence_of(:url) }
  it {should_not allow_value('https://mysterysite.com').for(:url)}
  it do
    should allow_values('https://youtu.be/44bigiDX6lI',
     'https://soundcloud.com/scottishfoldlp/blinded-by-light-final-fantasy').
      for(:url)
  end
end

RSpec.describe Track, ".create" do
  it 'detects and sets attributes based on url' do
    soundcloud = create(:site, name: 'SoundCloud')
    track = Track.new(url: 'https://soundcloud.com/moeshop/love-taste')
    track.save
    expect(track.site.name).to eq('SoundCloud')
    expect(track.name).to eq('Love Taste (w/ Jamie Paige & Shiki)')
    expect(track.artist_name).to eq('Moe Shop')
  end
end

RSpec.describe Track, ".add_to_playlist" do
  it "adds track to playlist" do
    track_url = "https://soundcloud.com/moeshop/love-taste"
    playlist = create(:playlist)

    result = Track.add_to_playlist track_url, playlist.id

    expect(playlist.tracks.count).to eq(1)
    expect(result).to be_truthy
  end

  it "returns false if url is invalid" do
    track_url = "coolsounds.co?cool_track=123"
    playlist = create(:playlist)

    result = Track.add_to_playlist track_url, playlist.id

    expect(playlist.tracks.count).to eq(0)
    expect(result).to be false
  end

  # May be over kill to check ALL params
  it "returns false if playlist is invalid" do
    track_url = "https://soundcloud.com/moeshop/love-taste"
    playlist = nil

    result = Track.add_to_playlist track_url, playlist

    expect(result).to be false
  end
end

# FIXME: (POTENTIALLY) This is just saving and testing this works via callback.
# I'd rather call it directly but since it's private I can't. I may be able to
# do this better with stubbing or something.
RSpec.describe Track, "#fetch_soundcloud_info" do
  it 'sets artist_name and track with valid url' do
    track_url = 'https://soundcloud.com/moeshop/love-taste'
    track = Track.new(url: track_url)

    track.save

    expect(track.artist_name).to eq('Moe Shop')
    expect(track.name).to eq('Love Taste (w/ Jamie Paige & Shiki)')
  end

  it 'sets artist_name and track to unknown with invalid url' do
    track_url = 'https://soundcloud.com/moeshop/oasndona-taste'
    track = Track.new(url: track_url)

    track.save

    expect(track.artist_name).to eq('Unknown')
    expect(track.name).to eq('Unknown')
  end
end

RSpec.describe Track, "#fetch_youtube_info" do
  it 'sets artist_name and track with valid url' do
    track_url = 'https://youtu.be/nY7GnAq6Znw'
    track = Track.new(url: track_url)

    track.save

    expect(track.artist_name).to eq('Jon Gomm')
    expect(track.name).to eq('Jon Gomm - Passionflower')
  end

  it 'sets artist_name and track to unknown with invalid url' do
    track_url = 'https://youtu.be/nY7GnAq6asdasdZnw'
    track = Track.new(url: track_url)

    track.save

    expect(track.artist_name).to eq('Unknown')
    expect(track.name).to eq('Unknown')
  end
end

RSpec.describe Track, 'obsolete association tests' do
  it 'can belong to a site' do
    track = build(:track)
    expect(track.site).not_to be_nil
  end

  it 'can have many playlists' do
    track = build(:track)
    # Not sure if it's best for this to be in trait or well defined here
    3.times{ create(:track_playlist, track: track) }
    expect(track.playlists.count).to eq(3)
  end
end


text:
package org.kie.wb.selenium.model;

import java.util.Optional;
import java.util.stream.Stream;

public enum KieWbDistribution {

    BUSINESS_CENTRAL,
    BUSINESS_MONITORING;

    public static Optional<KieWbDistribution> fromWarNameString(final String warName) {
        return Stream.of(KieWbDistribution.values())
                .filter(distro -> distro.getWarName().equals(warName))
                .findFirst();
    }

    public String getWarName() {
        return this.name().toLowerCase().replace("_", "-");
    }
}


text:
<?php
  $page_title = 'Listado de academias';
  $page = 'acadm';
  include("templates/header.php");
?>

Listado de academias

          <?php if ($userRol == 1 || $userRol == 2) { ?>
            Registrar academia
          <?php } ?>

          <input type="text" id="edit-query" name="query" value="" size="30" maxlength="128" class="search-form__text" placeholder="Buscar...">

Academias

            ID
            Nombre
            Teléfono
            Encargado
            <?php if ($userRol == 1 || $userRol == 2) { ?>
              Estado

            <?php } ?>

No hay academias disponibles

  <?php
    include("templates/footer.php");
  ?>


text:
require 'spec_helper'

describe "User pages" do

  subject { page }

  # describe "index" do
  #   let(:user) { FactoryGirl.create(:user) }
  #   before(:each) do
  #     sign_in user
  #     visit users_path
  #   end

  #   it { should have_title("All users") }
  #   it { should have_content("All users") }

  #   describe "pagination" do

  #     before(:all) { 30.times { FactoryGirl.create(:user) } }
  #     after(:all) { User.delete_all }

  #     it { should have_selector("ul.pagination") }

  #     it "should list each user" do
  #       User.paginate(page: 1).each do |user|
  #         expect(page).to have_selector("li", text: user.name)
  #       end
  #     end
  #   end

  #   describe "delete links" do
  #     it { should_not have_link("delete") }

  #     describe "as an admin user" do
  #       let(:admin) { FactoryGirl.create(:admin) }
  #       before do
  #         sign_in admin
  #         visit users_path
  #       end

  #       # it "should be admin" do
  #       #   expect(admin).to be_admin
  #       # end

  #       it { should have_link("delete", href: user_path(User.first)) }
  #       it "should be able to delete another user" do
  #         expect do
  #           click_link("delete", match: :first)
  #         end.to change(User, :count).by(-1)
  #       end
  #       it { should_not have_link("delete", href: user_path(admin)) }
  #     end
  #   end
  # end

  # describe "profile page" do
  #   let(:user) { FactoryGirl.create(:user) }
  #   let(:v1) { FactoryGirl.create(:video, user: user, url: "Url 1", title: "Title 1", description: "Description 1") }
  #   let(:v2) { FactoryGirl.create(:video, user: user, url: "Url 2", title: "Title 2", description: "Description 2") }

  #   before { visit user_path(user) }

  #   it { should have_content(user.name) }
  #   it { should have_title(user.name) }

  #   describe "videos" do
  #     # it { should have_content(v1.title) }
  #     # it { should have_content(v2.title) }
  #     it { should have_content(user.videos.count) }
  #   end
  # end

  describe "signup page" do
    before { visit new_user_registration_path }

    it { should have_content('Sign up') }
    it { should have_title('Sign up') }
  end

  describe "signup" do
    before { visit new_user_registration_path }

    let(:submit) { "Sign up" }

    describe "with invalid information" do
      it "should not create a user" do
        expect { click_button submit }.not_to change(User, :count)
      end
    end

    describe "with valid information" do
      before do
        fill_in "Name", with: "Example User"
        fill_in "Email", with: "user@example.com"
        fill_in "Password", with: "foobar"
        fill_in "Password confirmation", with: "foobar"
      end

      it "should create a user" do
        expect { click_button submit }.to change(User, :count).by(1)
      end

      describe "after saving the user" do
        before { click_button submit }
        let(:user) { User.find_by(email: "user@example.com") }

        # it { should have_title(user.name) }
        it { should have_selector("div.alert.alert-notice" ) }
      end
    end
  end

  describe "edit" do
    let(:user) { FactoryGirl.create(:user) }
    before do
      sign_in user
      visit edit_user_registration_path(user)
    end

    describe "page" do
      it { should have_content("Edit User") }
      it { should have_title("Edit User") }
      # it { should have_link("change", href: "http://gravatar.com/emails") }
    end

    describe "with invalid information" do
      before { click_button "Update" }

      it { should have_selector("div.field_with_errors") }
    end

    describe "with valid information" do
      let(:new_name)  { "New Name" }
      let(:new_email) { "new@example.com" }
      before do
        fill_in "Name",                  with: new_name
        # fill_in "Email",                 with: new_email
        fill_in "Password",              with: user.password
        # fill_in "Password confirmation", with: user.password
        click_button "Update"
      end

      # it { should have_title(new_name) }
      # it { should have_selector('div.alert.alert-notice') }
      it { should have_link('Sign out', href: destroy_user_session_path) }
      # specify { expect(user.reload.name).to  eq new_name }
      # specify { expect(user.reload.email).to eq new_email }
    end
  end

end


text:
Ext.define('KitchenSink.view.panel.BasicPanels', {
    extend: 'Ext.Container',
    xtype: 'basic-panels',
    width: 660,

    layout: {
        type: 'table',
        columns: 3,
        tdAttrs: { style: 'padding: 10px;' }
    },

    defaults: {
        xtype: 'panel',
        width: 200,
        height: 200,
        bodyPadding: 10
    },
    //<example>
    exampleDescription: [
        '
This example shows how to create basic panels
',
        '
Panels typically have a header and a body, although the header is optional. ',
        'The panel header can contain a title, and icon, and one or more tools for ',
        'performing specific actions when clicked
'
    ],
    themes: {
        classic: {
            percentChangeColumn: {
                width: 75
            }
        },
        neptune: {
            percentChangeColumn: {
                width: 100
            }
        }
    },
    //</example>

    initComponent: function () {
        this.items = [
            {
                html: KitchenSink.DummyText.mediumText
            },
            {
                title: 'Title',
                html: KitchenSink.DummyText.mediumText
            },
            {
                title: 'Header Icons',
                tools: [
                    { type:'pin' },
                    { type:'refresh' },
                    { type:'search' },
                    { type:'save' }
                ],
                html: KitchenSink.DummyText.mediumText
            },
            {
                title: 'Collapsed Panel',
                collapsed: true,
                collapsible: true,
                width: 640,
                html: KitchenSink.DummyText.mediumText,
                colspan: 3
            }
        ];

        this.callParent();
    }
});


text:
from dask import config, datasets
from dask._version import get_versions
from dask.base import (
    annotate,
    compute,
    is_dask_collection,
    optimize,
    persist,
    visualize,
)
from dask.core import istask
from dask.delayed import delayed
from dask.local import get_sync as get

versions = get_versions()
__version__ = versions["version"]
__git_revision__ = versions["full-revisionid"]
del get_versions, versions


text:
A [video.js](https://www.videojs.com/) plugin for recording audio/video/image files.

![Screenshot](https://raw.githubusercontent.com/collab-project/videojs-record/master/docs/img/screenshot.png?raw=true "Screenshot")

## Documentation

The documentation and examples can be found on: https://collab-project.github.io/videojs-record

[![npm version](https://img.shields.io/npm/v/videojs-record.svg?style=flat)](https://www.npmjs.com/package/videojs-record)
[![npm](https://img.shields.io/npm/dm/videojs-record.svg)](https://github.com/collab-project/videojs-record/releases)
[![License](https://img.shields.io/npm/l/videojs-record.svg)](LICENSE)
[![Build Status](https://github.com/collab-project/videojs-record/workflows/videojs-record/badge.svg?branch=master)](https://github.com/collab-project/videojs-record/actions?workflow=videojs-record)
[![Coverage Status](https://coveralls.io/repos/github/collab-project/videojs-record/badge.svg?branch=master)](https://coveralls.io/github/collab-project/videojs-record?branch=master)
![Size](https://img.shields.io/bundlephobia/minzip/videojs-record.svg?style=flat)
[![Financial Contributors on Open Collective](https://opencollective.com/collab/all/badge.svg?label=financial+contributors)](https://opencollective.com/collab)
![Stars](https://img.shields.io/github/stars/collab-project/videojs-record.svg?style=social)

Donate
------

### Financial Contributors

Become a financial contributor and help us sustain our community. [[Contribute](https://opencollective.com/collab/contribute)]

#### Individuals

#### Organizations

Support this project with your organization. Your logo will show up here with a link to your website. [[Contribute](https://opencollective.com/collab/contribute)]


text:
//******************************************************************************************************
//  LightningDataProvider.cs - Gbtc
//
//  Copyright © 2019, Grid Protection Alliance.  All Rights Reserved.
//
//  Licensed to the Grid Protection Alliance (GPA) under one or more contributor license agreements. See
//  the NOTICE file distributed with this work for additional information regarding copyright ownership.
//  The GPA licenses this file to you under the MIT License (MIT), the "License"; you may not use this
//  file except in compliance with the License. You may obtain a copy of the License at:
//
//      http://opensource.org/licenses/MIT
//
//  Unless agreed to in writing, the subject software distributed under the License is distributed on an
//  "AS-IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. Refer to the
//  License for the specific language governing permissions and limitations.
//
//  Code Modification History:
//  ----------------------------------------------------------------------------------------------------
//  04/02/2019 - Stephen C. Wills
//       Generated original version of source code.
//
//******************************************************************************************************

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Configuration;
using System.Linq;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using Esri.ArcGISRuntime;
using Esri.ArcGISRuntime.Data;
using Esri.ArcGISRuntime.Geometry;
using FaultData.DataResources;
using GSF.Configuration;
using openXDA.Configuration;
using openXDA.Model;

namespace openXDA.ArcGIS
{
    public class LightningDataProviderSettings
    {
        public const string CategoryName = "Lightning";

        private const string ServiceKey = "Service";
        private const string URLKey = "URL";
        private const string LightningMapServerPattern = @"\[(?<" + ServiceKey + @">[^]]+)\]\((?<" + URLKey + @">[^)]+)\)";

        [Setting]
        public string TransmissionDataMapServer { get; set; }

        [Setting]
        [SettingName(nameof(LightningMapServers))]
        public string LightningMapServersSetting { get; set; }

        [Setting]
        [DefaultValue(5)]
        public int QueryRetries { get; set; }

        public List<LightningMapServer> LightningMapServers => Regex.Matches(LightningMapServersSetting, LightningMapServerPattern)
            .Cast<Match>()
            .Where(match => match.Success)
            .Select(match => new LightningMapServer(match.Groups[ServiceKey].Value, match.Groups[URLKey].Value))
            .ToList();
    }

    public class LightningDataProvider : ILightningDataProvider
    {
        public LightningDataProvider()
        {
            SystemSettings = new SystemSection();
            LightningDataSettings = new LightningDataProviderSettings();
        }

        [Category]
        [SettingName(SystemSection.CategoryName)]
        public SystemSection SystemSettings { get; }

        [Category]
        [SettingName(LightningDataProviderSettings.CategoryName)]
        public LightningDataProviderSettings LightningDataSettings { get; }

        private TimeZoneInfo XDATimeZone =>
            SystemSettings.XDATimeZoneInfo;

        public IEnumerable<ILightningStrike> GetLightningStrikes(string lineKey, DateTime start, DateTime end) =>
            QueryLightningStrikes(lineKey, start, end).GetAwaiter().GetResult();

        private async Task<IEnumerable<ILightningStrike>> QueryLightningStrikes(string lineKey, DateTime start, DateTime end)
        {
            List<Geometry> lineGeometry = await QueryLineGeometry(lineKey);
            Geometry lightningBufferGeometry = ToLightningBufferGeometry(lineGeometry);

            if (lightningBufferGeometry == null)
                return Enumerable.Empty<ILightningStrike>();

            TimeZoneInfo xdaTimeZone = XDATimeZone;
            DateTime startUTC = TimeZoneInfo.ConvertTimeToUtc(start, xdaTimeZone);
            DateTime endUTC = TimeZoneInfo.ConvertTimeToUtc(end, xdaTimeZone);
            DateTimeOffset startOffset = new DateTimeOffset(startUTC);
            DateTimeOffset endOffset = new DateTimeOffset(endUTC);
            return await QueryLightningData(lightningBufferGeometry, startOffset, endOffset);
        }

        private async Task<List<Geometry>> QueryLineGeometry(string lineKey)
        {
            string transmissionDataMapServer = LightningDataSettings.TransmissionDataMapServer;

            QueryParameters lineQuery = new QueryParameters();
            lineQuery.ReturnGeometry = true;
            lineQuery.WhereClause = $"UPPER(LINENAME) LIKE '%{lineKey.ToUpper()}%'";

            Uri source = new Uri(transmissionDataMapServer);
            ServiceFeatureTable featureTable = new ServiceFeatureTable(source);
            FeatureQueryResult result = await featureTable.QueryFeaturesAsync(lineQuery);

            return result
                .Select(feature => feature.Geometry)
                .ToList();
        }

        private Geometry ToLightningBufferGeometry(List<Geometry> lineGeometry)
        {
            const double BufferMiles = 5.0D;

            List<double> distances = lineGeometry
                .Select(geometry => geometry.SpatialReference.Unit as LinearUnit)
                .Select(unit => (unit != null) ? LinearUnits.Miles.ConvertTo(unit, BufferMiles) : BufferMiles)
                .ToList();

            return GeometryEngine.Buffer(lineGeometry, distances, true).SingleOrDefault();
        }

        private async Task<List<ILightningStrike>> QueryLightningData(Geometry lightningBufferGeometry, DateTimeOffset startTime, DateTimeOffset endTime)
        {
            List<LightningMapServer> lightningMapServers = LightningDataSettings.LightningMapServers;
            List<ILightningStrike> strikes = new List<ILightningStrike>();

            foreach (LightningMapServer server in lightningMapServers)
            {
                QueryParameters lightningQuery = new QueryParameters();
                lightningQuery.TimeExtent = new TimeExtent(startTime, endTime);
                lightningQuery.Geometry = lightningBufferGeometry;
                lightningQuery.SpatialRelationship = SpatialRelationship.Intersects;

                int retryCount = 0;
                int maxRetries = LightningDataSettings.QueryRetries;

                while (true)
                {
                    try
                    {
                        Uri source = new Uri(server.URL);
                        ServiceFeatureTable featureTable = new ServiceFeatureTable(source);
                        FeatureQueryResult result = await featureTable.QueryFeaturesAsync(lightningQuery, QueryFeatureFields.LoadAll);
                        IEnumerable<ILightningStrike> serverStrikes = result.Select(feature => new LightningStrike(server.Service, feature));
                        strikes.AddRange(serverStrikes);
                        break;
                    }
                    catch (ArcGISRuntimeException)
                    {
                        if (maxRetries >= 0 && retryCount >= maxRetries)
                            throw;

                        await Task.Delay(500);
                        retryCount++;
                    }
                }
            }

            return strikes;
        }
    }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent" >

    <TextView
        android:id="@+id/tv_country"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerHorizontal="true"
        android:textSize="20dp"
        android:textStyle="bold" />

    <ImageView
        android:id="@+id/iv_flag"
        android:layout_width="50dp"
        android:layout_height="50dp"
        android:layout_below="@id/tv_country"
        android:layout_centerVertical="true"
        android:padding="5dp"
        android:contentDescription="@string/str_iv_flag" />

    <TextView
        android:id="@+id/tv_country_details"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_toRightOf="@id/iv_flag"
        android:layout_below="@id/tv_country"  />

</RelativeLayout>


text:
$script:SPDscUtilModulePath = Join-Path -Path $PSScriptRoot -ChildPath '..\..\Modules\SharePointDsc.Util'
Import-Module -Name $script:SPDscUtilModulePath

function Get-TargetResource
{
    [CmdletBinding()]
    [OutputType([System.Collections.Hashtable])]
    param
    (
        [Parameter(Mandatory = $true)]
        [System.String]
        $Name,

        [Parameter(Mandatory = $true)]
        [System.String]
        $ApplicationPool,

        [Parameter(Mandatory = $true)]
        [System.String]
        $ApplicationPoolAccount,

        [Parameter(Mandatory = $true)]
        [System.String]
        $WebAppUrl,

        [Parameter()]
        [System.Boolean]
        $AllowAnonymous,

        [Parameter()]
        [System.String]
        $DatabaseName,

        [Parameter()]
        [System.String]
        $DatabaseServer,

        [Parameter()]
        [System.Boolean]
        $UseSQLAuthentication,

        [Parameter()]
        [System.Management.Automation.PSCredential]
        $DatabaseCredentials,

        [Parameter()]
        [System.String]
        $HostHeader,

        [Parameter()]
        [System.String]
        $Path,

        [Parameter()]
        [System.String]
        $Port,

        [Parameter()]
        [System.Boolean]
        $UseClassic = $false,

        [Parameter()]
        [ValidateSet("Present", "Absent")]
        [System.String]
        $Ensure = "Present",

        [Parameter()]
        [System.Management.Automation.PSCredential]
        $InstallAccount
    )

    Write-Verbose -Message "Getting web application '$Name' config"

    $result = Invoke-SPDscCommand -Credential $InstallAccount `
        -Arguments $PSBoundParameters `
        -ScriptBlock {
        $params = $args[0]

        $wa = Get-SPWebApplication -Identity $params.Name -ErrorAction SilentlyContinue
        if ($null -eq $wa)
        {
            return @{
                Name                   = $params.Name
                ApplicationPool        = $params.ApplicationPool
                ApplicationPoolAccount = $params.ApplicationPoolAccount
                WebAppUrl              = $params.WebAppUrl
                Ensure                 = "Absent"
            }
        }

        ### COMMENT: Are we making an assumption here, about Default Zone
        $classicAuth = $false
        $authProvider = Get-SPAuthenticationProvider -WebApplication $wa.Url -Zone "Default"
        if ($null -eq $authProvider)
        {
            $classicAuth = $true
        }

        $IISPath = $wa.IisSettings[0].Path
        if (-not [System.String]::IsNullOrEmpty($IISPath))
        {
            $IISPath = $IISPath.ToString()
        }
        return @{
            Name                   = $wa.DisplayName
            ApplicationPool        = $wa.ApplicationPool.Name
            ApplicationPoolAccount = $wa.ApplicationPool.Username
            WebAppUrl              = $wa.Url
            AllowAnonymous         = $authProvider.AllowAnonymous
            DatabaseName           = $wa.ContentDatabases[0].Name
            DatabaseServer         = $wa.ContentDatabases[0].Server
            HostHeader             = (New-Object -TypeName System.Uri $wa.Url).Host
            Path                   = $IISPath
            Port                   = (New-Object -TypeName System.Uri $wa.Url).Port
            UseClassic             = $classicAuth
            Ensure                 = "Present"
        }
    }
    return $result
}

function Set-TargetResource
{
    [CmdletBinding()]
    param
    (
        [Parameter(Mandatory = $true)]
        [System.String]
        $Name,

        [Parameter(Mandatory = $true)]
        [System.String]
        $ApplicationPool,

        [Parameter(Mandatory = $true)]
        [System.String]
        $ApplicationPoolAccount,

        [Parameter(Mandatory = $true)]
        [System.String]
        $WebAppUrl,

        [Parameter()]
        [System.Boolean]
        $AllowAnonymous,

        [Parameter()]
        [System.String]
        $DatabaseName,

        [Parameter()]
        [System.String]
        $DatabaseServer,

        [Parameter()]
        [System.Boolean]
        $UseSQLAuthentication,

        [Parameter()]
        [System.Management.Automation.PSCredential]
        $DatabaseCredentials,

        [Parameter()]
        [System.String]
        $HostHeader,

        [Parameter()]
        [System.String]
        $Path,

        [Parameter()]
        [System.String]
        $Port,

        [Parameter()]
        [System.Boolean]
        $UseClassic = $false,

        [Parameter()]
        [ValidateSet("Present", "Absent")]
        [System.String]
        $Ensure = "Present",

        [Parameter()]
        [System.Management.Automation.PSCredential]
        $InstallAccount
    )

    Write-Verbose -Message "Setting web application '$Name' config"

    $PSBoundParameters.UseClassic = $UseClassic

    if ($Ensure -eq "Present")
    {
        Invoke-SPDscCommand -Credential $InstallAccount `
            -Arguments @($PSBoundParameters, $MyInvocation.MyCommand.Source) `
            -ScriptBlock {
            $params = $args[0]
            $eventSource = $args[1]

            $wa = Get-SPWebApplication -Identity $params.Name -ErrorAction SilentlyContinue
            if ($null -eq $wa)
            {
                $newWebAppParams = @{
                    Name            = $params.Name
                    ApplicationPool = $params.ApplicationPool
                    Url             = $params.WebAppUrl
                }

                # Get a reference to the Administration WebService
                $admService = Get-SPDscContentService
                $appPools = $admService.ApplicationPools | Where-Object -FilterScript {
                    $_.Name -eq $params.ApplicationPool
                }
                if ($null -eq $appPools)
                {
                    # Application pool does not exist, create a new one.
                    # Test if the specified managed account exists. If so, add
                    # ApplicationPoolAccount parameter to create the application pool
                    try
                    {
                        Get-SPManagedAccount $params.ApplicationPoolAccount -ErrorAction Stop | Out-Null
                        $newWebAppParams.Add("ApplicationPoolAccount", $params.ApplicationPoolAccount)
                    }
                    catch
                    {
                        if ($_.Exception.Message -like "*No matching accounts were found*")
                        {
                            $message = ("The specified managed account was not found. Please make " + `
                                    "sure the managed account exists before continuing.")
                            Add-SPDscEvent -Message $message `
                                -EntryType 'Error' `
                                -EventID 100 `
                                -Source $eventSource
                            throw $message
                        }
                        else
                        {
                            $message = ("Error occurred. Web application was not created. Error " + `
                                    "details: $($_.Exception.Message)")
                            Add-SPDscEvent -Message $message `
                                -EntryType 'Error' `
                                -EventID 100 `
                                -Source $eventSource
                            throw $message
                        }
                    }
                }

                if ($params.UseClassic -eq $false)
                {
                    $ap = New-SPAuthenticationProvider
                    $newWebAppParams.Add("AuthenticationProvider", $ap)
                }

                if ($params.ContainsKey("AllowAnonymous") -eq $true)
                {
                    $newWebAppParams.Add("AllowAnonymousAccess", $params.AllowAnonymous)
                }
                if ($params.ContainsKey("DatabaseName") -eq $true)
                {
                    $newWebAppParams.Add("DatabaseName", $params.DatabaseName)
                }
                if ($params.ContainsKey("DatabaseServer") -eq $true)
                {
                    $newWebAppParams.Add("DatabaseServer", $params.DatabaseServer)
                }
                if ($params.ContainsKey("HostHeader") -eq $true)
                {
                    $newWebAppParams.Add("HostHeader", $params.HostHeader)
                }
                if ($params.ContainsKey("Path") -eq $true)
                {
                    $newWebAppParams.Add("Path", $params.Path)
                }
                if ($params.ContainsKey("Port") -eq $true)
                {
                    $newWebAppParams.Add("Port", $params.Port)
                }
                if ((New-Object -TypeName System.Uri $params.WebAppUrl).Scheme -eq "https")
                {
                    $newWebAppParams.Add("SecureSocketsLayer", $true)
                }
                if ($params.useSQLAuthentication -eq $true)
                {
                    Write-Verbose -Message "Using SQL authentication to create web app as `$useSQLAuthentication is set to $($params.useSQLAuthentication)."
                    $newWebAppParams.Add("DatabaseCredentials", $params.DatabaseCredentials)
                }
                else
                {
                    Write-Verbose -Message "`$useSQLAuthentication is false or not specified; using default Windows authentication."
                }

                New-SPWebApplication @newWebAppParams | Out-Null
            }
        }
    }

    if ($Ensure -eq "Absent")
    {
        Invoke-SPDscCommand -Credential $InstallAccount `
            -Arguments $PSBoundParameters `
            -ScriptBlock {
            $params = $args[0]

            $wa = Get-SPWebApplication -Identity $params.Name -ErrorAction SilentlyContinue
            if ($null -ne $wa)
            {
                $wa | Remove-SPWebApplication -Confirm:$false -DeleteIISSite
            }
        }
    }
}

function Test-TargetResource
{
    [CmdletBinding()]
    [OutputType([System.Boolean])]
    param
    (
        [Parameter(Mandatory = $true)]
        [System.String]
        $Name,

        [Parameter(Mandatory = $true)]
        [System.String]
        $ApplicationPool,

        [Parameter(Mandatory = $true)]
        [System.String]
        $ApplicationPoolAccount,

        [Parameter(Mandatory = $true)]
        [System.String]
        $WebAppUrl,

        [Parameter()]
        [System.Boolean]
        $AllowAnonymous,

        [Parameter()]
        [System.String]
        $DatabaseName,

        [Parameter()]
        [System.String]
        $DatabaseServer,

        [Parameter()]
        [System.Boolean]
        $UseSQLAuthentication,

        [Parameter()]
        [System.Management.Automation.PSCredential]
        $DatabaseCredentials,

        [Parameter()]
        [System.String]
        $HostHeader,

        [Parameter()]
        [System.String]
        $Path,

        [Parameter()]
        [System.String]
        $Port,

        [Parameter()]
        [System.Boolean]
        $UseClassic = $false,

        [Parameter()]
        [ValidateSet("Present", "Absent")]
        [System.String]
        $Ensure = "Present",

        [Parameter()]
        [System.Management.Automation.PSCredential]
        $InstallAccount
    )

    Write-Verbose -Message "Testing for web application '$Name' config"

    $PSBoundParameters.Ensure = $Ensure

    $CurrentValues = Get-TargetResource @PSBoundParameters

    Write-Verbose -Message "Current Values: $(Convert-SPDscHashtableToString -Hashtable $CurrentValues)"
    Write-Verbose -Message "Target Values: $(Convert-SPDscHashtableToString -Hashtable $PSBoundParameters)"

    $result = Test-SPDscParameterState -CurrentValues $CurrentValues `
        -Source $($MyInvocation.MyCommand.Source) `
        -DesiredValues $PSBoundParameters `
        -ValuesToCheck @("Ensure")

    Write-Verbose -Message "Test-TargetResource returned $result"

    return $result
}

function Export-TargetResource
{
    $VerbosePreference = "SilentlyContinue"
    $content = ''
    $ParentModuleBase = Get-Module "SharePointDsc" -ListAvailable | Select-Object -ExpandProperty Modulebase
    $module = Join-Path -Path $ParentModuleBase -ChildPath "\DSCResources\MSFT_SPWebApplication\MSFT_SPWebApplication.psm1" -Resolve

    $spWebApplications = Get-SPWebApplication | Sort-Object -Property Name

    $i = 1;
    $total = $spWebApplications.Length
    foreach ($spWebApp in $spWebApplications)
    {
        try
        {
            Write-Host "Scanning SPWebApplication [$i/$total] {$webAppName}"
            $partialContent = "        SPWebApplication " + $spWebApp.Name.Replace(" ", "") + "`r`n        {`r`n"

            $params = Get-DSCFakeParameters -ModulePath $module
            $params.Name = $spWebApp.name

            $results = Get-TargetResource @params

            $results = Repair-Credentials -results $results

            $appPoolAccount = Get-Credentials $results.ApplicationPoolAccount
            $convertToVariable = $false
            if ($appPoolAccount)
            {
                $convertToVariable = $true
                $results.ApplicationPoolAccount = (Resolve-Credentials -UserName $results.ApplicationPoolAccount) + ".UserName"
            }

            if ($null -eq $results.Get_Item("AllowAnonymous"))
            {
                $results.Remove("AllowAnonymous")
            }

            Add-ConfigurationDataEntry -Node "NonNodeData" -Key "DatabaseServer" -Value $results.DatabaseServer -Description "Name of the Database Server associated with the destination SharePoint Farm;"
            $results.DatabaseServer = "`$ConfigurationData.NonNodeData.DatabaseServer"
            $results["Path"] = $results["Path"].ToString()
            $currentDSCBlock = Get-DSCBlock -Params $results -ModulePath $PSScriptRoot
            if ($convertToVariable)
            {
                $currentDSCBlock = Convert-DSCStringParamToVariable -DSCBlock $currentDSCBlock -ParameterName "ApplicationPoolAccount"
            }
            $currentDSCBlock = Convert-DSCStringParamToVariable -DSCBlock $currentDSCBlock -ParameterName "DatabaseServer"
            $currentDSCBlock = Convert-DSCStringParamToVariable -DSCBlock $currentDSCBlock -ParameterName "PsDscRunAsCredential"
            $partialContent += $currentDSCBlock
            $partialContent += "        }`r`n"

            if ($Global:ExtractionModeValue -ge 2)
            {
                Write-Host "    -> Scanning SharePoint Designer Settings"
                #Read-SPDesignerSettings -WebAppUrl $results.WebAppUrl.ToString() -Scope "WebApplication" -WebAppName $spWebApp.Name.Replace(" ", "")
            }

            <# SPWebApplication Feature Section #>
            if (($Global:ExtractionModeValue -eq 3 -and $Quiet) -or $Global:ComponentsToExtract.Contains("SPFeature"))
            {
                $properties = @{
                    Scope     = "WebApplication"
                    Url       = $SpWebApp.Url
                    DependsOn = "[SPWebApplication]$($spWebApp.Name.Replace(' ', ''))"
                }
                $partialContent += Read-TargetResource -ResourceName 'SPFeature' `
                    -ExportParams $properties
            }
            $properties = @{
                WebAppUrl = $spWebApp.Url
                DependsOn = "[SPWebApplication]$($spWebApp.Name.Replace(' ', ''))"
            }
            $partialContent += Read-TargetResource -ResourceName 'SPOutgoingEmailSettings' `
                -ExportParams $properties
            $i++
        }
        catch
        {
            $_
            $Global:ErrorLog += "[Web Application]" + $spWebApp.Name + "`r`n"
            $Global:ErrorLog += "$_`r`n`r`n"
        }

        $content += $partialContent
    }
    return $content
}

Export-ModuleMember -Function *-TargetResource


text:
<mods xmlns="http://www.loc.gov/mods/v3" xmlns:exslt="http://exslt.org/common" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xlink="http://www.w3.org/1999/xlink" xsi:schemaLocation="http://www.loc.gov/mods/v3 http://www.loc.gov/standards/mods/v3/mods-3-3.xsd" version="3.3" ID="P0b002ee1818e98b2">
<name type="corporate">
 <namePart>United States Government Printing Office</namePart>
 <role>
  <roleTerm type="text" authority="marcrelator">printer</roleTerm>
  <roleTerm type="code" authority="marcrelator">prt</roleTerm>
</role>
 <role>
  <roleTerm type="text" authority="marcrelator">distributor</roleTerm>
  <roleTerm type="code" authority="marcrelator">dst</roleTerm>
</role>
</name>
<name type="corporate">
 <namePart>United States</namePart>
 <namePart>United States Court of Appeals for the Eighth Circuit</namePart>
 <role>
  <roleTerm type="text" authority="marcrelator">author</roleTerm>
  <roleTerm type="code" authority="marcrelator">aut</roleTerm>
</role>
 <description>Government Organization</description>
</name>
<typeOfResource>text</typeOfResource>
<genre authority="marcgt">government publication</genre>
<language>
 <languageTerm authority="iso639-2b" type="code">eng</languageTerm>
</language>
<extension>
 <collectionCode>USCOURTS</collectionCode>
 <category>Judicial Publications</category>
 <branch>judicial</branch>
 <dateIngested>2012-01-17</dateIngested>
</extension>
<originInfo>
 <publisher>Administrative Office of the United States Courts</publisher>
 <dateIssued encoding="w3cdtf">2012-01-13</dateIssued>
 <issuance>monographic</issuance>
</originInfo>
<physicalDescription>
 <note type="source content type">deposited</note>
 <digitalOrigin>born digital</digitalOrigin>
</physicalDescription>
<classification authority="sudocs">JU 2.11</classification>
<identifier type="uri">http://www.gpo.gov/fdsys/pkg/USCOURTS-ca8-10-03552</identifier>
<identifier type="local">P0b002ee1818e98b2</identifier>
<recordInfo>
 <recordContentSource authority="marcorg">DGPO</recordContentSource>
 <recordCreationDate encoding="w3cdtf">2012-01-17</recordCreationDate>
 <recordChangeDate encoding="w3cdtf">2012-01-17</recordChangeDate>
 <recordIdentifier source="DGPO">USCOURTS-ca8-10-03552</recordIdentifier>
 <recordOrigin>machine generated</recordOrigin>
 <languageOfCataloging>
  <languageTerm authority="iso639-2b" type="code">eng</languageTerm>
</languageOfCataloging>
</recordInfo>
<accessCondition type="GPO scope determination">fdlp</accessCondition>
<extension>
 <docClass>USCOURTS</docClass>
 <accessId>USCOURTS-ca8-10-03552</accessId>
 <courtType>Appellate</courtType>
 <courtCode>ca8</courtCode>
 <courtCircuit>8th</courtCircuit>
 <courtSortOrder>1080</courtSortOrder>
 <caseNumber>10-03552</caseNumber>
 <natureSuitCode>440</natureSuitCode>
 <natureSuit>Other Civil Rights</natureSuit>
 <party firstName="Brook" fullName="Brook Bernini" lastName="Bernini" role="Appellant"></party>
 <party firstName="Matthew" fullName="Matthew Byrnes" lastName="Byrnes" role="Appellant"></party>
 <party firstName="Simon" fullName="Simon Cecil" lastName="Cecil" role="Appellant"></party>
 <party fullName="City of St. Paul" lastName="City of St. Paul" role="Appellee"></party>
 <party firstName="Matthew" fullName="Matthew Clark" lastName="Clark" role="Appellee"></party>
 <party firstName="Andrew" fullName="Andrew Cohen" lastName="Cohen" role="Appellant"></party>
 <party firstName="David" fullName="David Drew Jr." generation="Jr." lastName="Drew" role="Appellant"></party>
 <party firstName="Kellan" fullName="Kellan Dubbels" lastName="Dubbels" role="Appellant"></party>
 <party firstName="Kristofer" fullName="Kristofer Dubbels" lastName="Dubbels" role="Appellant"></party>
 <party firstName="Patricia" fullName="Patricia Englund" lastName="Englund" role="Appellee"></party>
 <party firstName="Alana" fullName="Alana Michelle Exum" lastName="Exum" middleName="Michelle" role="Appellant"></party>
 <party firstName="Steven" fullName="Steven Frazer" lastName="Frazer" role="Appellee"></party>
 <party firstName="Bobby" fullName="Bobby Reese Hagy Jr." generation="Jr." lastName="Hagy" middleName="Reese" role="Appellant"></party>
 <party firstName="Adam" fullName="Adam Hayden" lastName="Hayden" role="Appellant"></party>
 <party firstName="Adryn" fullName="Adryn Hayes" lastName="Hayes" role="Appellant"></party>
 <party firstName="Axel" fullName="Axel Henry" lastName="Henry" role="Appellee"></party>
 <party firstName="Kevin" fullName="Kevin Hundt" lastName="Hundt" role="Appellant"></party>
 <party firstName="Rachel" fullName="Rachel Jackson" lastName="Jackson" role="Appellant"></party>
 <party firstName="Tiana" fullName="Tiana Johnson" lastName="Johnson" role="Appellant"></party>
 <party firstName="Garth" fullName="Garth Kahl" lastName="Kahl" role="Appellant"></party>
 <party firstName="Jared" fullName="Jared Lanctot" lastName="Lanctot" role="Appellant"></party>
 <party firstName="Michael" fullName="Michael Larson" lastName="Larson" role="Appellant"></party>
 <party firstName="Vain" fullName="Vain Mainstream" lastName="Mainstream" role="Appellant"></party>
 <party firstName="David" fullName="David Morse" lastName="Morse" role="Appellant"></party>
 <party firstName="Craig" fullName="Craig Neef" lastName="Neef" role="Appellant"></party>
 <party firstName="Joe" fullName="Joe Neuberger" lastName="Neuberger" role="Appellee"></party>
 <party firstName="Mary" fullName="Mary Ogle" lastName="Ogle" role="Appellant"></party>
 <party firstName="Tim" fullName="Tim Phillips" lastName="Phillips" role="Appellant"></party>
 <party firstName="Raphi" fullName="Raphi Rechitsky" lastName="Rechitsky" role="Appellant"></party>
 <party firstName="Lambert" fullName="Lambert Rochfort" lastName="Rochfort" role="Appellant"></party>
 <party firstName="Nick" fullName="Nick Segner" lastName="Segner" role="Appellant"></party>
 <party firstName="Ryan" fullName="Ryan Solem" lastName="Solem" role="Appellant"></party>
 <party firstName="Zach" fullName="Zach Swift" lastName="Swift" role="Appellant"></party>
 <party firstName="Andrew" fullName="Andrew Temperante" lastName="Temperante" role="Appellant"></party>
 <party firstName="Michael" fullName="Michael Ward II" generation="II" lastName="Ward" role="Appellant"></party>
 <party firstName="Rachel" fullName="Rachel Westlund" lastName="Westlund" role="Appellant"></party>
 <party firstName="Nelson" fullName="Nelson Whitmore" lastName="Whitmore" role="Appellant"></party>
 <party firstName="Bruce" fullName="Bruce Wilkinson" lastName="Wilkinson" role="Appellant"></party>
</extension>
<titleInfo>
 <title>Brook Bernini, et al v. City of St. Paul, et al</title>
 <partNumber>10-03552</partNumber>
</titleInfo>
<location>
 <url access="object in context" displayLabel="Content Detail">http://www.gpo.gov/fdsys/pkg/USCOURTS-ca8-10-03552/content-detail.html</url>
</location>
<classification authority="sudocs">JU 2.11</classification>
<identifier type="preferred citation">10-03552;10-3552</identifier>
<name type="corporate">
 <namePart>United States Court of Appeals for the Eighth Circuit</namePart>
 <namePart>8th Circuit</namePart>
 <namePart></namePart>
 <affiliation>U.S. Courts</affiliation>
 <role>
  <roleTerm authority="marcrelator" type="text">author</roleTerm>
  <roleTerm authority="marcrelator" type="code">aut</roleTerm>
</role>
</name>
<name type="personal">
 <displayForm>Brook Bernini</displayForm>
 <namePart type="family">Bernini</namePart>
 <namePart type="given">Brook</namePart>
 <namePart type="termsOfAddress"></namePart>
 <description>Appellant</description>
</name>
<name type="personal">
 <displayForm>Matthew Byrnes</displayForm>
 <namePart type="family">Byrnes</namePart>
 <namePart type="given">Matthew</namePart>
 <namePart type="termsOfAddress"></namePart>
 <description>Appellant</description>
</name>
<name type="personal">
 <displayForm>Simon Cecil</displayForm>
 <namePart type="family">Cecil</namePart>
 <namePart type="given">Simon</namePart>
 <namePart type="termsOfAddress"></namePart>
 <description>Appellant</description>
</name>
<name type="personal">
 <displayForm>City of St. Paul</displayForm>
 <namePart type="family">City of St. Paul</namePart>
 <namePart type="given"></namePart>
 <namePart type="termsOfAddress"></namePart>
 <description>Appellee</description>
</name>
<name type="personal">
 <displayForm>Matthew Clark</displayForm>
 <namePart type="family">Clark</namePart>
 <namePart type="given">Matthew</namePart>
 <namePart type="termsOfAddress"></namePart>
 <description>Appellee</description>
</name>
<name type="personal">
 <displayForm>Andrew Cohen</displayForm>
 <namePart type="family">Cohen</namePart>
 <namePart type="given">Andrew</namePart>
 <namePart type="termsOfAddress"></namePart>
 <description>Appellant</description>
</name>
<name type="personal">
 <displayForm>David Drew Jr.</displayForm>
 <namePart type="family">Drew</namePart>
 <namePart type="given">David</namePart>
 <namePart type="termsOfAddress">Jr.</namePart>
 <description>Appellant</description>
</name>
<name type="personal">
 <displayForm>Kellan Dubbels</displayForm>
 <namePart type="family">Dubbels</namePart>
 <namePart type="given">Kellan</namePart>
 <namePart type="termsOfAddress"></namePart>
 <description>Appellant</description>
</name>
<name type="personal">
 <displayForm>Kristofer Dubbels</displayForm>
 <namePart type="family">Dubbels</namePart>
 <namePart type="given">Kristofer</namePart>
 <namePart type="termsOfAddress"></namePart>
 <description>Appellant</description>
</name>
<name type="personal">
 <displayForm>Patricia Englund</displayForm>
 <namePart type="family">Englund</namePart>
 <namePart type="given">Patricia</namePart>
 <namePart type="termsOfAddress"></namePart>
 <description>Appellee</description>
</name>
<name type="personal">
 <displayForm>Alana Michelle Exum</displayForm>
 <namePart type="family">Exum</namePart>
 <namePart type="given">Alana</namePart>
 <namePart type="termsOfAddress"></namePart>
 <description>Appellant</description>
</name>
<name type="personal">
 <displayForm>Steven Frazer</displayForm>
 <namePart type="family">Frazer</namePart>
 <namePart type="given">Steven</namePart>
 <namePart type="termsOfAddress"></namePart>
 <description>Appellee</description>
</name>
<name type="personal">
 <displayForm>Bobby Reese Hagy Jr.</displayForm>
 <namePart type="family">Hagy</namePart>
 <namePart type="given">Bobby</namePart>
 <namePart type="termsOfAddress">Jr.</namePart>
 <description>Appellant</description>
</name>
<name type="personal">
 <displayForm>Adam Hayden</displayForm>
 <namePart type="family">Hayden</namePart>
 <namePart type="given">Adam</namePart>
 <namePart type="termsOfAddress"></namePart>
 <description>Appellant</description>
</name>
<name type="personal">
 <displayForm>Adryn Hayes</displayForm>
 <namePart type="family">Hayes</namePart>
 <namePart type="given">Adryn</namePart>
 <namePart type="termsOfAddress"></namePart>
 <description>Appellant</description>
</name>
<name type="personal">
 <displayForm>Axel Henry</displayForm>
 <namePart type="family">Henry</namePart>
 <namePart type="given">Axel</namePart>
 <namePart type="termsOfAddress"></namePart>
 <description>Appellee</description>
</name>
<name type="personal">
 <displayForm>Kevin Hundt</displayForm>
 <namePart type="family">Hundt</namePart>
 <namePart type="given">Kevin</namePart>
 <namePart type="termsOfAddress"></namePart>
 <description>Appellant</description>
</name>
<name type="personal">
 <displayForm>Rachel Jackson</displayForm>
 <namePart type="family">Jackson</namePart>
 <namePart type="given">Rachel</namePart>
 <namePart type="termsOfAddress"></namePart>
 <description>Appellant</description>
</name>
<name type="personal">
 <displayForm>Tiana Johnson</displayForm>
 <namePart type="family">Johnson</namePart>
 <namePart type="given">Tiana</namePart>
 <namePart type="termsOfAddress"></namePart>
 <description>Appellant</description>
</name>
<name type="personal">
 <displayForm>Garth Kahl</displayForm>
 <namePart type="family">Kahl</namePart>
 <namePart type="given">Garth</namePart>
 <namePart type="termsOfAddress"></namePart>
 <description>Appellant</description>
</name>
<name type="personal">
 <displayForm>Jared Lanctot</displayForm>
 <namePart type="family">Lanctot</namePart>
 <namePart type="given">Jared</namePart>
 <namePart type="termsOfAddress"></namePart>
 <description>Appellant</description>
</name>
<name type="personal">
 <displayForm>Michael Larson</displayForm>
 <namePart type="family">Larson</namePart>
 <namePart type="given">Michael</namePart>
 <namePart type="termsOfAddress"></namePart>
 <description>Appellant</description>
</name>
<name type="personal">
 <displayForm>Vain Mainstream</displayForm>
 <namePart type="family">Mainstream</namePart>
 <namePart type="given">Vain</namePart>
 <namePart type="termsOfAddress"></namePart>
 <description>Appellant</description>
</name>
<name type="personal">
 <displayForm>David Morse</displayForm>
 <namePart type="family">Morse</namePart>
 <namePart type="given">David</namePart>
 <namePart type="termsOfAddress"></namePart>
 <description>Appellant</description>
</name>
<name type="personal">
 <displayForm>Craig Neef</displayForm>
 <namePart type="family">Neef</namePart>
 <namePart type="given">Craig</namePart>
 <namePart type="termsOfAddress"></namePart>
 <description>Appellant</description>
</name>
<name type="personal">
 <displayForm>Joe Neuberger</displayForm>
 <namePart type="family">Neuberger</namePart>
 <namePart type="given">Joe</namePart>
 <namePart type="termsOfAddress"></namePart>
 <description>Appellee</description>
</name>
<name type="personal">
 <displayForm>Mary Ogle</displayForm>
 <namePart type="family">Ogle</namePart>
 <namePart type="given">Mary</namePart>
 <namePart type="termsOfAddress"></namePart>
 <description>Appellant</description>
</name>
<name type="personal">
 <displayForm>Tim Phillips</displayForm>
 <namePart type="family">Phillips</namePart>
 <namePart type="given">Tim</namePart>
 <namePart type="termsOfAddress"></namePart>
 <description>Appellant</description>
</name>
<name type="personal">
 <displayForm>Raphi Rechitsky</displayForm>
 <namePart type="family">Rechitsky</namePart>
 <namePart type="given">Raphi</namePart>
 <namePart type="termsOfAddress"></namePart>
 <description>Appellant</description>
</name>
<name type="personal">
 <displayForm>Lambert Rochfort</displayForm>
 <namePart type="family">Rochfort</namePart>
 <namePart type="given">Lambert</namePart>
 <namePart type="termsOfAddress"></namePart>
 <description>Appellant</description>
</name>
<name type="personal">
 <displayForm>Nick Segner</displayForm>
 <namePart type="family">Segner</namePart>
 <namePart type="given">Nick</namePart>
 <namePart type="termsOfAddress"></namePart>
 <description>Appellant</description>
</name>
<name type="personal">
 <displayForm>Ryan Solem</displayForm>
 <namePart type="family">Solem</namePart>
 <namePart type="given">Ryan</namePart>
 <namePart type="termsOfAddress"></namePart>
 <description>Appellant</description>
</name>
<name type="personal">
 <displayForm>Zach Swift</displayForm>
 <namePart type="family">Swift</namePart>
 <namePart type="given">Zach</namePart>
 <namePart type="termsOfAddress"></namePart>
 <description>Appellant</description>
</name>
<name type="personal">
 <displayForm>Andrew Temperante</displayForm>
 <namePart type="family">Temperante</namePart>
 <namePart type="given">Andrew</namePart>
 <namePart type="termsOfAddress"></namePart>
 <description>Appellant</description>
</name>
<name type="personal">
 <displayForm>Michael Ward II</displayForm>
 <namePart type="family">Ward</namePart>
 <namePart type="given">Michael</namePart>
 <namePart type="termsOfAddress">II</namePart>
 <description>Appellant</description>
</name>
<name type="personal">
 <displayForm>Rachel Westlund</displayForm>
 <namePart type="family">Westlund</namePart>
 <namePart type="given">Rachel</namePart>
 <namePart type="termsOfAddress"></namePart>
 <description>Appellant</description>
</name>
<name type="personal">
 <displayForm>Nelson Whitmore</displayForm>
 <namePart type="family">Whitmore</namePart>
 <namePart type="given">Nelson</namePart>
 <namePart type="termsOfAddress"></namePart>
 <description>Appellant</description>
</name>
<name type="personal">
 <displayForm>Bruce Wilkinson</displayForm>
 <namePart type="family">Wilkinson</namePart>
 <namePart type="given">Bruce</namePart>
 <namePart type="termsOfAddress"></namePart>
 <description>Appellant</description>
</name>
<extension>
 <docClass>USCOURTS</docClass>
 <accessId>USCOURTS-ca8-10-03552</accessId>
 <courtType>Appellate</courtType>
 <courtCode>ca8</courtCode>
 <courtCircuit>8th</courtCircuit>
 <courtSortOrder>1080</courtSortOrder>
 <caseNumber>10-03552</caseNumber>
 <natureSuitCode>440</natureSuitCode>
 <natureSuit>Other Civil Rights</natureSuit>
 <party firstName="Brook" fullName="Brook Bernini" lastName="Bernini" role="Appellant"></party>
 <party firstName="Matthew" fullName="Matthew Byrnes" lastName="Byrnes" role="Appellant"></party>
 <party firstName="Simon" fullName="Simon Cecil" lastName="Cecil" role="Appellant"></party>
 <party fullName="City of St. Paul" lastName="City of St. Paul" role="Appellee"></party>
 <party firstName="Matthew" fullName="Matthew Clark" lastName="Clark" role="Appellee"></party>
 <party firstName="Andrew" fullName="Andrew Cohen" lastName="Cohen" role="Appellant"></party>
 <party firstName="David" fullName="David Drew Jr." generation="Jr." lastName="Drew" role="Appellant"></party>
 <party firstName="Kellan" fullName="Kellan Dubbels" lastName="Dubbels" role="Appellant"></party>
 <party firstName="Kristofer" fullName="Kristofer Dubbels" lastName="Dubbels" role="Appellant"></party>
 <party firstName="Patricia" fullName="Patricia Englund" lastName="Englund" role="Appellee"></party>
 <party firstName="Alana" fullName="Alana Michelle Exum" lastName="Exum" middleName="Michelle" role="Appellant"></party>
 <party firstName="Steven" fullName="Steven Frazer" lastName="Frazer" role="Appellee"></party>
 <party firstName="Bobby" fullName="Bobby Reese Hagy Jr." generation="Jr." lastName="Hagy" middleName="Reese" role="Appellant"></party>
 <party firstName="Adam" fullName="Adam Hayden" lastName="Hayden" role="Appellant"></party>
 <party firstName="Adryn" fullName="Adryn Hayes" lastName="Hayes" role="Appellant"></party>
 <party firstName="Axel" fullName="Axel Henry" lastName="Henry" role="Appellee"></party>
 <party firstName="Kevin" fullName="Kevin Hundt" lastName="Hundt" role="Appellant"></party>
 <party firstName="Rachel" fullName="Rachel Jackson" lastName="Jackson" role="Appellant"></party>
 <party firstName="Tiana" fullName="Tiana Johnson" lastName="Johnson" role="Appellant"></party>
 <party firstName="Garth" fullName="Garth Kahl" lastName="Kahl" role="Appellant"></party>
 <party firstName="Jared" fullName="Jared Lanctot" lastName="Lanctot" role="Appellant"></party>
 <party firstName="Michael" fullName="Michael Larson" lastName="Larson" role="Appellant"></party>
 <party firstName="Vain" fullName="Vain Mainstream" lastName="Mainstream" role="Appellant"></party>
 <party firstName="David" fullName="David Morse" lastName="Morse" role="Appellant"></party>
 <party firstName="Craig" fullName="Craig Neef" lastName="Neef" role="Appellant"></party>
 <party firstName="Joe" fullName="Joe Neuberger" lastName="Neuberger" role="Appellee"></party>
 <party firstName="Mary" fullName="Mary Ogle" lastName="Ogle" role="Appellant"></party>
 <party firstName="Tim" fullName="Tim Phillips" lastName="Phillips" role="Appellant"></party>
 <party firstName="Raphi" fullName="Raphi Rechitsky" lastName="Rechitsky" role="Appellant"></party>
 <party firstName="Lambert" fullName="Lambert Rochfort" lastName="Rochfort" role="Appellant"></party>
 <party firstName="Nick" fullName="Nick Segner" lastName="Segner" role="Appellant"></party>
 <party firstName="Ryan" fullName="Ryan Solem" lastName="Solem" role="Appellant"></party>
 <party firstName="Zach" fullName="Zach Swift" lastName="Swift" role="Appellant"></party>
 <party firstName="Andrew" fullName="Andrew Temperante" lastName="Temperante" role="Appellant"></party>
 <party firstName="Michael" fullName="Michael Ward II" generation="II" lastName="Ward" role="Appellant"></party>
 <party firstName="Rachel" fullName="Rachel Westlund" lastName="Westlund" role="Appellant"></party>
 <party firstName="Nelson" fullName="Nelson Whitmore" lastName="Whitmore" role="Appellant"></party>
 <party firstName="Bruce" fullName="Bruce Wilkinson" lastName="Wilkinson" role="Appellant"></party>
</extension>
<relatedItem type="constituent" ID="id-USCOURTS-ca8-10-03552-0" xlink:href="http://www.gpo.gov/fdsys/granule/USCOURTS-ca8-10-03552/USCOURTS-ca8-10-03552-0/mods.xml">
 <titleInfo>
  <title>Brook Bernini, et al v. City of St. Paul, et al</title>
  <subTitle>OPINION FILED - THE COURT: STEVEN M. COLLOTON, RAYMOND C. CLEVENGER, III and DUANE BENTON. Steven M. Colloton, Authoring Judge (PUBLISHED) [3868656] [10-3552]</subTitle>
  <partNumber>0</partNumber>
</titleInfo>
 <originInfo>
  <dateIssued>2012-01-13</dateIssued>
</originInfo>
 <relatedItem xlink:href="http://www.gpo.gov/fdsys/pkg/pdf/USCOURTS-ca8-10-03552-0.pdf" type="otherFormat">
  <identifier type="FDsys Unique ID">D09002ee1818f2e3d</identifier>
</relatedItem>
 <identifier type="uri">http://www.gpo.gov/fdsys/granule/USCOURTS-ca8-10-03552/USCOURTS-ca8-10-03552-0</identifier>
 <identifier type="former granule identifier">ca8-10-03552_0.pdf</identifier>
 <location>
  <url access="object in context" displayLabel="Content Detail">http://www.gpo.gov/fdsys/granule/USCOURTS-ca8-10-03552/USCOURTS-ca8-10-03552-0/content-detail.html</url>
  <url access="raw object" displayLabel="PDF rendition">http://www.gpo.gov/fdsys/pkg/USCOURTS-ca8-10-03552/pdf/USCOURTS-ca8-10-03552-0.pdf</url>
</location>
 <extension>
  <searchTitle>USCOURTS 10-03552; Brook Bernini, et al v. City of St. Paul, et al; </searchTitle>
  <courtName>United States Court of Appeals for the Eighth Circuit</courtName>
  <accessId>USCOURTS-ca8-10-03552-0</accessId>
  <sequenceNumber>0</sequenceNumber>
  <dateIssued>2012-01-13</dateIssued>
  <docketText>OPINION FILED - THE COURT: STEVEN M. COLLOTON, RAYMOND C. CLEVENGER, III and DUANE BENTON. Steven M. Colloton, Authoring Judge (PUBLISHED) [3868656] [10-3552]</docketText>
</extension>
</relatedItem>
</mods>


text:
<?php

namespace Spec\Dumplie\SharedKernel\Domain\Money;

use Dumplie\SharedKernel\Domain\Exception\DifferentPricePrecisionException;
use Dumplie\SharedKernel\Domain\Exception\InvalidArgumentException;
use Dumplie\SharedKernel\Domain\Exception\InvalidCurrencyException;
use Dumplie\SharedKernel\Domain\Money\Price;
use PhpSpec\ObjectBehavior;
use Prophecy\Argument;

class PriceSpec extends ObjectBehavior
{
    function it_throws_exception_when_value_is_negative()
    {
        $this->shouldThrow(InvalidArgumentException::class)->during('__construct', [-100, 'EUR']);
    }

    function it_throws_exception_when_precision_is_negaive()
    {
        $this->shouldThrow(InvalidArgumentException::class)->during('__construct', [1000, 'EUR', -100]);
    }

    function it_throw_exception_when_currency_is_not_known()
    {
        $this
            ->shouldThrow(InvalidArgumentException::invalidCurrency('Unknown'))
            ->during('__construct', [1000, 'Unknown', 100])
        ;
    }

    function it_is_converted_to_float()
    {
        $this->beConstructedWith(10000, 'EUR', 100);

        $this->floatValue()->shouldReturn(100.00);
    }

    function it_has_immutable_currency()
    {
        $this->beConstructedWith(10000, 'EUR', 100);

        $this->hasCurrency('EUR')->shouldReturn(true);
        $this->hasCurrency('eur')->shouldReturn(true);

        $this->hasCurrency('PLN')->shouldReturn(false);
    }

    function it_can_be_created_from_integer()
    {
        $this->beConstructedThrough('fromInt', [100, 'EUR']);

        $this->floatValue()->shouldReturn(100.00);
    }

    function it_knows_when_other_price_has_same_currency()
    {
        $this->beConstructedThrough('fromInt', [100, 'EUR']);
        $this->hasSameCurrency(Price::EUR(100))->shouldReturn(true);
        $this->hasSameCurrency(Price::PLN(100))->shouldReturn(false);
    }

    function it_throws_exception_when_adding_to_price_with_a_different_currency()
    {
        $this->beConstructedThrough('fromInt', [100, 'EUR']);

        $this->shouldThrow(InvalidCurrencyException::class)->during('add', [Price::PLN(100)]);
    }

    function it_throws_exception_when_adding_to_price_with_a_different_precisions()
    {
        $this->beConstructedWith(10000, 'EUR', 100);

        $this->shouldThrow(DifferentPricePrecisionException::class)->during('add', [Price::EUR(100, 10)]);
    }

    function it_can_be_multiplied()
    {
        $this->beConstructedWith(10000, 'EUR', 100);

        $this->multiply(5)->floatValue()->shouldReturn(500.00);
    }
}


text:
module Main where

import Options.Applicative
import System.IO

import Interpreter

main :: IO ()
main = do
        filePath <- execParser (parseFile `withInfo` "Interpret a Brainfuck file")
        fileHandle <- openFile filePath ReadMode
        contents <- hGetContents fileHandle
        runBF contents filePath

withInfo :: Parser a -> String -> ParserInfo a
withInfo opts desc = info (helper <*> opts) $ progDesc desc

parseFile :: Parser FilePath
parseFile = strOption $
  short 'f' <> long "file" <> metavar "FILE-PATH" <>
  help "Path of Brainfuck file to interpret"


text:
docker ps -q --filter=status=exited|xargs -r docker rm
docker images -q --filter=dangling=true|xargs -r docker rmi


text:
import UnzippingProgress from './UnzippingProgress';

export default UnzippingProgress;


text:
#include "hook.h"
#include "hookmock.h"

using ::testing::Return;

bool MyConnect(const char* url)
{

	return true;
}

int MyPrintf(const char* format, ...)
{
	Hook::UnHookFunction(printf);

	return printf(format);
}

class MockGlobal
{
public:
	TMOCK_CLASS(MockGlobal);

	TMOCK_METHOD1(Connect, bool(const char* url));
};

TEST(GlobalMethodTest, NoNamespace)
{
	TEXPECT_CALL(MockGlobal, Connect(_))
		.Times(1).WillOnce(Return(true));
	ASSERT_TRUE(Connect("127.0.0.1"));

	Hook::UnHookFunction(Connect);
	ASSERT_FALSE(Connect("127.0.0.1"));

	Hook::HookFunction(printf, MyPrintf);
	printf("abc");
}


text:
<?php use Roots\Sage\Utils; ?>

  <?php echo Utils\sage_get_heading('h1'); ?>

  <?php if (have_posts()) : ?>

    <?php while (have_posts()) : the_post(); ?>
      <?php get_template_part('templates/content'); ?>
    <?php endwhile; ?>

    <?php the_posts_navigation(); ?>

  <?php else : ?>

      <?php _e('Sorry, no results were found.', 'sage'); ?>

    <?php get_search_form(); ?>

  <?php endif; ?>


text:
<!DOCTYPE html>

<meta charset="utf-8">
<title>Moderna - Bootstrap 3 flat corporate template</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="" />
<meta name="author" content="http://bootstraptaste.com" />

<link href="css/bootstrap.min.css" rel="stylesheet" />
<link href="css/fancybox/jquery.fancybox.css" rel="stylesheet">
<link href="css/jcarousel.css" rel="stylesheet" />
<link href="css/flexslider.css" rel="stylesheet" />
<link href="css/style.css" rel="stylesheet" />

<link href="skins/default.css" rel="stylesheet" />

                    <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">

                    </button>
                    Moderna

Home

                            Features

Typography

Components

Pricing box

Portfolio

Blog

Contact

Contact

Get in touch with us by filling contact form below

				<form id="contactform" action="contact/contact.php" method="post" class="validateform" name="send-contact">

						 Your message has been sent. Thank you!

							<input type="text" name="name" placeholder="* Enter your full name" data-rule="maxlen:4" data-msg="Please enter at least 4 chars" />

							<input type="text" name="email" placeholder="* Enter your email address" data-rule="email" data-msg="Please enter a valid email" />

							<input type="text" name="subject" placeholder="Enter your subject" data-rule="maxlen:4" data-msg="Please enter at least 4 chars" />

							<textarea rows="12" name="message" class="input-block-level" placeholder="* Your message here..." data-rule="required" data-msg="Please write something"></textarea>

								<button class="btn btn-theme margintop10 pull-left" type="submit">Submit message</button>
								* Please fill all required form field, thanks!

				</form>

Get in touch with us

					<address>
					Moderna company Inc

					 Modernbuilding suite V124, AB 01

					 Someplace 16425 Earth </address>

						 (123) 456-7890 - (123) 555-7891

						 email@domainname.com

Pages

Press release

Terms and conditions

Privacy policy

Career center

Contact us

Latest posts

Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Pellentesque et pulvinar enim. Quisque at tempor ligula

Natus error sit voluptatem accusantium doloremque

Flickr photostream

							© Moderna 2014 All right reserved. By Bootstraptaste