text:
<!DOCTYPE html>

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

    <title>mne.set_log_level — MNE 0.11.0 documentation</title>

    <link rel="stylesheet" href="../_static/basic.css" type="text/css" />
    <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
    <link rel="stylesheet" href="../_static/gallery.css" type="text/css" />
    <link rel="stylesheet" href="../_static/bootswatch-3.3.4/flatly/bootstrap.min.css" type="text/css" />
    <link rel="stylesheet" href="../_static/bootstrap-sphinx.css" type="text/css" />
    <link rel="stylesheet" href="../_static/style.css" type="text/css" />

    <link rel="shortcut icon" href="../_static/favicon.ico"/>
    <link rel="top" title="MNE 0.11.0 documentation" href="../index.html" />
    <link rel="up" title="API Reference" href="../python_reference.html" />
    <link rel="next" title="mne.set_log_file" href="mne.set_log_file.html" />
    <link rel="prev" title="mne.get_config" href="mne.get_config.html" />

<link href='http://fonts.googleapis.com/css?family=Open+Sans:400italic,700italic,400,700' rel='stylesheet' type='text/css'>

  <link rel="canonical" href="https://mne.tools/stable/index.html" />

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

        </button>

        0.11.0

Tutorials

Gallery

Manual

API

FAQ

Cite

  Site

Getting Started

What’s new

Cite MNE

Related publications

Tutorials

Examples Gallery

Manual

API Reference

Frequently Asked Questions

Advanced installation and setup

MNE with CPP

  Page

mne.set_log_level

<form class="navbar-form navbar-right" action="../search.html" method="get">

  <input type="text" name="q" class="form-control" placeholder="Search" />

  <input type="hidden" name="check_keywords" value="yes" />
  <input type="hidden" name="area" value="default" />
</form>

mne.set_log_level

    « mne.get_config

    mne.set_log_file »

<form action="../search.html" method="get">

  <input type="text" name="q" class="form-control" placeholder="Search" />

  <input type="hidden" name="check_keywords" value="yes" />
  <input type="hidden" name="area" value="default" />
</form>

mne.set_log_level¶

mne.set_log_level(verbose=None, return_old_level=False)¶

Convenience function for setting the logging level

<col class="field-name" />
<col class="field-body" />

Parameters:
verbose : bool, str, int, or None

The verbosity of messages to print. If a str, it can be either DEBUG,
INFO, WARNING, ERROR, or CRITICAL. Note that these are for
convenience and are equivalent to passing in logging.DEBUG, etc.
For bool, True is the same as ‘INFO’, False is the same as ‘WARNING’.
If None, the environment variable MNE_LOGGING_LEVEL is read, and if
it doesn’t exist, defaults to INFO.

return_old_level : bool

If True, return the old verbosity level.

      Back to top

        © Copyright 2012-2015, MNE Developers.


text:
package net.sf.reportengine.util;

/**
 * <p>
 *  Helper class for Cross Tab reports holding some important coefficients like :
 *  1. the number of total columns
 *  2. the numnber of spaces per row
 *  3. the number of totals per row
 *  4. the colspanPerRow for non-space and non-total values
 * </p>
 *
 * @author dragos balan (dragos.balan@gmail.com)
 * @since 0.2
 */
public class CrossTabCoefficients {

	/**
	 * the template of the report header (the result)
	 */
	//private String[][] template;

	/**
	 * the number of distinct values for each header row
	 */
	private int[] distValuesCntInHeaderRow;

	/**
	 * the number of totals for each header row
	 */
	private int[] totalsCntInHeaderRow;

	/**
	 * the colspanPerRow for non-total and non-space columns
	 * (valid only when report doesn't have totals in header)
	 */
	private int[] colspanPerRow;

	/**
	 * the number of spaces per header row
	 */
	private int[] spaceCntInHeaderRow;

	/**
	 * the column count of the header
	 */
	private int templateColumnCount;

	/**
	 * the row count of the header template
	 */
	private int templateRowCount;

	/**
	 *
	 */
	private boolean headerHasTotals;

	/**
	 *
	 */
	private String[][] distinctHeaderValues;

    /**
     * empty constructor
     *
     */
	public CrossTabCoefficients(String[][] distinctValues, boolean hasTotals) {
		this.templateRowCount = distinctValues.length;
		this.headerHasTotals = hasTotals;
		this.distinctHeaderValues = distinctValues;

		computeCoeficients();
	}

	/**
	 * initializing the coefficients ...
	 */
	public void computeCoeficients() {

		int[] distValuesCnt = new int[templateRowCount];	//number of distinct values for each headerrow
		int[] colspan = new int[templateRowCount]; 			//colspan for each header row
		int[] totalCnt = new int[templateRowCount];			//number of totals for each row
		int[] spacesCnt = new int[templateRowCount];
		//int[] dPrim = new int[templateRowCount];

		//step 0
		distValuesCnt[0] = distinctHeaderValues[0].length;	//the number of distinct values on first row
		colspan[templateRowCount - 1] = 1;     					//the distance between values on the last row is 1
		int headerColumnCnt = distValuesCnt[0];				//first step in calculating the header column count
		if(headerHasTotals){
			totalCnt[0] = 1; 						//one total on first row
			spacesCnt[0] = 0; 						//zero spaces on first row
			//dPrim[templateRowCount - 1] = 1; 	//even if the totals are displayed the distance on the last row is 1
		}

		//all next steps
		for (int i = 1; i < templateRowCount; i++) {
			distValuesCnt[i] = distinctHeaderValues[i].length;

			//the distance between same values is inversely calculated (bottom to top)
			colspan[templateRowCount-i-1] = colspan[templateRowCount-i] * (distinctHeaderValues[templateRowCount-i].length);

			//the header column count
			headerColumnCnt *= distValuesCnt[i];

			if(headerHasTotals){
				//the totals on each row is the totals on previous row times the number of distinct values on prev row
				totalCnt[i] = totalCnt[i - 1] * distValuesCnt[i - 1];

				//the spaces on each row is the spaces on prev row plus totals on previous row
				//under each prev total we should put a space
				spacesCnt[i] = spacesCnt[i - 1] + totalCnt[i - 1];

				//distance (when totals)
				//dPrim[templateRowCount-i-1] = (distinctHeaderValues[templateRowCount-i].length * dPrim[templateRowCount-i]) + 1;
				colspan[templateRowCount-i-1]++;
			}
		}

		if (headerHasTotals) {
			headerColumnCnt += (totalCnt[totalCnt.length - 1] + spacesCnt[spacesCnt.length - 1]);
		}

		setColspanPerRow(colspan);
		setDistValuesCntInHeaderRow(distValuesCnt);
		//setColspanWhenTotals(dPrim);
		setTotalsCntInHeaderRow(totalCnt);
		setSpacesCntInHeaderRow(spacesCnt);
		setTemplateColumnCount(headerColumnCnt);
	}

	public int getColspanForRow(int i){
	    return colspanPerRow[i];
	}

	public int[] getColspanPerRow() {
		return colspanPerRow;
	}

	public void setColspanPerRow(int[] d) {
		this.colspanPerRow = d;
	}

	@Deprecated
	public int[] getColspanWhenTotals() {
		return colspanPerRow;
	}

	public int[] getDistValuesCntInHeaderRow() {
		return distValuesCntInHeaderRow;
	}

	public void setDistValuesCntInHeaderRow(int[] n) {
		this.distValuesCntInHeaderRow = n;
	}

	public int[] getTotalsCntInHeaderRow() {
		return totalsCntInHeaderRow;
	}

	public void setTotalsCntInHeaderRow(int[] t) {
		this.totalsCntInHeaderRow = t;
	}

	/*public String[][] getTemplate() {
		return template;
	}*/

	/*public void setTemplate(String[][] template) {
		this.template = template;
	}*/

	public int getTemplateColumnCount() {
		return templateColumnCount;
	}

	public void setTemplateColumnCount(int templateColumnCount) {
		this.templateColumnCount = templateColumnCount;
	}

	public int[] getSpacesCntInHeaderRow() {
		return spaceCntInHeaderRow;
	}

	public void setSpacesCntInHeaderRow(int[] s) {
		this.spaceCntInHeaderRow = s;
	}

	/**
	 * @return the templateRowCount
	 */
	public int getTemplateRowCount() {
		return templateRowCount;
	}

	/**
	 * @param templateRowCount the templateRowCount to set
	 */
	public void setTemplateRowCount(int templateRowCount) {
		this.templateRowCount = templateRowCount;
	}

	public String[][] getDistinctHeaderValues(){
		return distinctHeaderValues;
	}
}

redpajama_set_name: RedPajamaGithub


text:
import styled, { css } from 'styled-components';
import { NavLink, Link } from 'react-router-dom';

import { media } from 'styles/Responsive';
import theme from 'styles/theme.json';

const buttonMinWidth = `min-width: 8rem;`;
const buttonMinHeightWidth = `min-height: 2rem; ${buttonMinWidth}`;
const buttonMinHeightWidthMobile = `min-height: 3.5rem; ${buttonMinWidth}`;

export const Page = styled.section``;
export const NavShell = styled.nav`
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  text-align: center;
  ${media.tablet`grid-column-gap: 1rem;`}
  ${media.desktop`grid-column-gap: 1rem`}
  height: 3rem;
`;
export const MainNavShell = styled(NavShell)`
  ${media.tablet`grid-column-gap: 0;`}
  ${media.desktop`grid-column-gap: 0`}
`;

export const Header = styled.header`
  h1,
  h2 {
    padding-left: 1rem;
  }
`;
export const Heading = styled.h2`
  height: 3.5rem;
`;
export const SubTitle = styled.p``;

const BasicButton = styled.button`
  ${buttonMinHeightWidthMobile}
  ${media.tablet`${buttonMinHeightWidth}  border-radius: 0.25rem;`}
  ${media.desktop`${buttonMinHeightWidth}  border-radius: 0.25rem;`}

  transition: color 0.25s ease-in-out;
  a {
    color: ${theme.black};
  }
  ${({ active }) =>
    active &&
    css`
      background-color: ${theme.light};
      border: 1px solid ${theme.medium};
    `};
`;
export const OutlineButton = styled(BasicButton)`
  border: 1px solid ${theme.medium};
`;

export const LightButtonLink = styled(Link)`
  padding: 1rem;
  ${buttonMinHeightWidthMobile}
  ${media.tablet`${buttonMinHeightWidth}  border-radius: 0.25rem;`}
  ${media.desktop`${buttonMinHeightWidth}  border-radius: 0.25rem;`}

  transition: color 0.25s ease-in-out;
  ${media.tablet`border-radius: 0.25rem;`}
  ${media.desktop`border-radius: 0.25rem;`}

  background-color: ${theme.lighter};
  border: 1px solid ${theme.medium};
  color: ${theme.black};
  white-space: nowrap;
`;

export const DarkButtonLink = styled(NavLink)`
  ${buttonMinHeightWidthMobile}
  padding: 0.5rem;

  background-color: ${theme.charcoal};
  color: ${theme.bright};
  font-size: 1.5rem;
  transition: color 0.25s ease-in-out;
  &.active {
    font-weight: bold;
    background-color: ${theme.darker};
    color: ${theme.charcoal};
  }
`;

export const UnderlineButton = styled.div`
  border-bottom: 1px solid ${theme.bright};
  font-size: 1.2rem;
  margin: 0.5rem 1rem;
  white-space: nowrap;
  min-width: 1.5rem;
  text-align: center;
  a {
    color: ${theme.black};
  }
`;

export const ErrorMessage = styled.p`
  background: ${theme.red};
  border-radius: 2px;
  font-size: 0.85rem;
  padding: 0.25rem 1rem;
`;


text:
using namespace std;
typedef int ItemType;

struct Node
{
  Node * precede
  ItemType item;
  Node * next;
};

class LinkedList
{
  public:
    LinkedList();
    ~LinkedList();
    bool isEmpty() const;
    int getLength() const;
    void insert(ItemType val);
    void remove(ItemType val);
    void retrieve(int index, ItemType& dataItem) const;
    void print();
    void writeFile(string fileName);
    void readFile(string fileName);

  private:
    Node *dummy;
    Node *head;
};


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Monographiae Botanicae, Societas Botanicorum Poloniae 90: 84 (2002)

#### Original name
Lachnum uralense Chleb.

### Remarks
null


text:
<?php

namespace MilesAsylum\Schnoop\SchemaFactory\MySQL\Trigger;

use MilesAsylum\Schnoop\SchemaAdapter\MySQL\Trigger;

interface TriggerFactoryInterface extends \MilesAsylum\Schnoop\SchemaFactory\MySQL\TriggerFactoryInterface
{
    /**
     * Fetch the raw row from the database that defines a trigger.
     *
     * @param string $tableName
     * @param string $databaseName
     *
     * @return array
     */
    public function fetchRaw($tableName, $databaseName);

    /**
     * Create a trigger from row data that defines the trigger.
     *
     * @param string $databaseName
     *
     * @return Trigger
     */
    public function createFromRaw(array $rawTriggers, $databaseName);

    /**
     * Create a new trigger.
     *
     * @param string $name
     * @param string $timing    one of Trigger::TIMING_* constants
     * @param string $event     one of Trigger::EVENT_* constants
     * @param string $tableName
     *
     * @return Trigger
     */
    public function newTrigger($name, $timing, $event, $tableName);
}


text:
using System;
using System.IO;
using System.Threading.Tasks;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using LynxPrivacyLib;

namespace LynxPrivacyLibTests
{
    [TestClass]
    public class UnitTest_GenerateKeys
    {
        [TestMethod]
        public async Task TestMethod1()
        {
            await GenerateKeys.GenerateKeyRing("John W. Davidson <jwdavidson+BcPGPTest@gmail.com>", new char[] { 'W','i','7','a','r','d','r','y', '!','T','e','s','t'}, @"C:\Users\John\BcPGP\");
            Assert.IsTrue(File.Exists(Path.Combine(@"C:\Users\John\BcPGP\", "jwdavidson+BcPGPTest@gmail_com_public.asc")));
            Assert.IsTrue(File.Exists(Path.Combine(@"C:\Users\John\BcPGP\", "jwdavidson+BcPGPTest@gmail_com_secret.asc")));
        }
        [TestMethod]
        public async Task TestMethod2()
        {
            await GenerateKeys.GenerateKeyRing("Test User <testuser@example.com>", new char[] {'t','e','s','t','u','s','e','r'}, @"C:\Users\John\BcPGP\");
            Assert.IsTrue(File.Exists(Path.Combine(@"C:\Users\John\BcPGP\", "testuser@example.com.public.asc")));
            Assert.IsTrue(File.Exists(Path.Combine(@"C:\Users\John\BcPGP\", "testuser@example.com.secret.asc")));
        }
    }
}


text:
<TITLE>Review for Meet Joe Black (1998)</TITLE>
<LINK REL="STYLESHEET" TYPE="text/css" HREF="/ramr.css">

Meet Joe Black (1998)

reviewed by
Steve Kong

MEET JOE BLACK (1998)

A film review by Steve Kong
Edited by Cher Johnson
Copyright 1998 Steve Kong

Running at about three hours, Meet Joe Black is an hour too long. If you
can overlook that, the film is very enjoyable.

Death wants to take a vacation and he's picked the rich and well-to-do Bill
Parrish (Anthony Hopkins) as his guide to the living. Death takes a body
from a New Yorker (Brad Pitt) and comes to visit Bill just a few days
before Bill's 65th birthday. Bill finds out that he's scheduled to be taken
by Death. But, Death offers to postpone Bill's demise for a few days,
hours, and minutes if Bill shows Death, who's now known as Joe Black,
around. You see, Joe is bored with his job and he wants to see what it is
to be alive.

Bill's cherished daughter, Susan (Claire Forlani), starts to fall in love
with the mysterious Joe. This is much to the dismay of Susan's father and
her current beau Drew (Jake Weber). Drew works closely with Bill - Drew is
second in command of Bill's company.

Meet Joe Black follows three story lines. The first is the love affair
between Susan and Joe. This story works, but not as well as it could have.
Forlani and Pitt have no screen chemistry whatsoever. Of course, how could
they? Pitt is supposed to be a dead guy. The second, which takes up a lot
of the screen time, is that of Bill being overthrown as the head of his own
broadcasting company. And the third, and most interesting, is the story
that follows between Bill and Joe, showing the relationship these two build.

As far as acting goes, Hopkins, as always, is superb. His Bill Parrish
reminded me of the character he played in The Edge -- smart and likeable.
Pitt tries something new and succeeds. At first, Pitt plays a live guy --
before Death takes over his body, and this part is like all other parts
Pitt has played. Pitt plays the suave guy who picks up women with a wink of
the eye. When Death takes over the body of Pitt's character is when Pitt
really does something fun. Pitt plays Joe energetically and most of the
time he is hilarious. His movements
are toned down and stiff.

Forlani, who I last saw in The Rock, is wonderful. She has a very
expressive face and I'd love to see her in more movies. She was a delight
to watch on screen.

Worth mentioning is the score by Thomas Newton; it is one of the best I've
heard this year. Yes, it is a bit overwrought for the film, and at times
distracting, but it just sounds good. Listen to it when you see Meet Joe
Black.

Also worth mentioning is the cinematography by Emmanuel Lubezki (A Walk in
the Clouds). Meet Joe Black is the prettiest picture of the year.

Martin Brest impressed me as a director with his film Midnight Run. His
style is to concentrate on characters and I wanted to see if this carried
onto Meet Joe Black. He's done well, though he could have sat down with
editors Joe Hutshing and Michael Tronick to shave off 45 minutes from the
film and done better. Another suggestion for Brest is to have the actors
read their lines more quickly. This sounds like a ridiculous suggestion,
but it's quite relevant for Meet Joe Black. The actors often pause for long
periods between lines - which is at first jarring, and second, makes for
the long movie that Meet Joe Black is.

Overall, Meet Joe Black is an enjoyable film that is worth the three hours
it takes to unfold its story. If you could sit through Titanic, Meet Joe
Black shouldn't be a problem. See Meet Joe Black for the performances of
the three leads: Hopkins, Pitt, and Forlani. Also, see it to hear the score
by Newton and to see the cinematography by Lubezki. Don't Miss Meet Joe
Black on the big screen.

---
 Steve Kong                                    reviews@boiled.sbay.org

 recipe for a hard boiled review:  one egg, two cups water, a pot,
 a helluva attitude, and a guy who loves the cinema.
 i'm your hard boiled movie guide.

 http://boiledmovies.sbay.com/

The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).

The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.

Please direct comments/criticisms of the review to relevant newsgroups.

Broken URLs inthe reviews are the responsibility of the author.

The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.

Related links: index of all rec.arts.movies.reviews reviews


text: <ng-content></ng-content>


text:
export { ResponsiveConfig, ResponsiveState, ResponsiveConfigInterface } from './config/index';
export declare class ResponsiveModule {
}


text:
var sys = require('sys');
var exec = require('child_process').exec;

exec('grunt compile --ver=6', function(err, stdout, stderr) {
	sys.print(stdout);
	sys.print(stderr);
});


text:
namespace tests
{

    template <typename T>
    struct Foo
    {
        std::vector<std::vector<T, typename arena::rebind<T>::other>, typename arena::rebind<std::vector<T, typename arena::rebind<T>::other> >::other> aa;

        Foo()
        {
        }

#ifndef BOND_NO_CXX11_DEFAULTED_FUNCTIONS
        // Compiler generated copy ctor OK
        Foo(const Foo& other) = default;
#endif

#if !defined(BOND_NO_CXX11_DEFAULTED_MOVE_CTOR)
        Foo(Foo&& other) = default;
#elif !defined(BOND_NO_CXX11_RVALUE_REFERENCES)
        Foo(Foo&& other)
          : aa(std::move(other.aa))
        {
        }
#endif

        explicit
        Foo(const arena& allocator)
          : aa(allocator)
        {
        }

#ifndef BOND_NO_CXX11_DEFAULTED_FUNCTIONS
        // Compiler generated operator= OK
        Foo& operator=(const Foo& other) = default;
#endif

        bool operator==(const Foo& other) const
        {
            return true
                && (aa == other.aa);
        }

        bool operator!=(const Foo& other) const
        {
            return !(*this == other);
        }

        void swap(Foo& other)
        {
            using std::swap;
            swap(aa, other.aa);
        }

        struct Schema;

    protected:
        void InitMetadata(const char*, const char*)
        {
        }
    };

    template <typename T>
    inline void swap(::tests::Foo<T>& left, ::tests::Foo<T>& right)
    {
        left.swap(right);
    }
} // namespace tests

#if !defined(BOND_NO_CXX11_ALLOCATOR)
namespace std
{
    template <typename _Alloc, typename T>
    struct uses_allocator<typename ::tests::Foo<T>, _Alloc>
        : is_convertible<_Alloc, arena>
    {};
}
#endif


text:
'use strict';

module.exports = function (N, apiPath) {
  N.validate(apiPath, {});

  N.wire.on(apiPath, async function nntp_group_rebuild_all_start() {
    let groups = await N.models.nntp.Group.find().sort('name').lean(true);

    await N.queue.chain(groups.map(group =>
      N.queue['nntp_group_rebuild_' + group.type](group._id)
    )).run();
  });
};


text:
package io.rsocket.resume;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue;

import io.rsocket.Frame;
import io.rsocket.FrameType;
import io.rsocket.util.PayloadImpl;
import org.junit.jupiter.api.Test;

public class ResumeUtilTest {
  private final Frame CANCEL = Frame.Cancel.from(1);
  private final Frame STREAM =
      Frame.Request.from(1, FrameType.REQUEST_STREAM, new PayloadImpl("Test"), 100);

  @Test
  public void testSupportedTypes() {
    assertTrue(ResumeUtil.isTracked(FrameType.REQUEST_STREAM));
    assertTrue(ResumeUtil.isTracked(FrameType.REQUEST_CHANNEL));
    assertTrue(ResumeUtil.isTracked(FrameType.REQUEST_RESPONSE));
    assertTrue(ResumeUtil.isTracked(FrameType.REQUEST_N));
    assertTrue(ResumeUtil.isTracked(FrameType.CANCEL));
    assertTrue(ResumeUtil.isTracked(FrameType.ERROR));
    assertTrue(ResumeUtil.isTracked(FrameType.FIRE_AND_FORGET));
    assertTrue(ResumeUtil.isTracked(FrameType.PAYLOAD));
  }

  @Test
  public void testUnsupportedTypes() {
    assertFalse(ResumeUtil.isTracked(FrameType.METADATA_PUSH));
    assertFalse(ResumeUtil.isTracked(FrameType.RESUME));
    assertFalse(ResumeUtil.isTracked(FrameType.RESUME_OK));
    assertFalse(ResumeUtil.isTracked(FrameType.SETUP));
    assertFalse(ResumeUtil.isTracked(FrameType.EXT));
    assertFalse(ResumeUtil.isTracked(FrameType.KEEPALIVE));
  }

  @Test
  public void testOffset() {
    assertEquals(6, ResumeUtil.offset(CANCEL));
    assertEquals(14, ResumeUtil.offset(STREAM));
  }
}


text:
require "test_helper"

class PaperTrailTest < ActiveSupport::TestCase
  test "Sanity test" do
    assert_kind_of Module, PaperTrail::Version
  end

  test "Version Number" do
    assert PaperTrail.const_defined?(:VERSION)
  end

  context "setting enabled" do
    should "affect all threads" do
      Thread.new { PaperTrail.enabled = false }.join
      assert_equal false, PaperTrail.enabled?
    end
    teardown { PaperTrail.enabled = true }
  end

  test "create with plain model class" do
    widget = Widget.create
    assert_equal 1, widget.versions.length
  end

  test "update with plain model class" do
    widget = Widget.create
    assert_equal 1, widget.versions.length
    widget.update_attributes(name: "Bugle")
    assert_equal 2, widget.versions.length
  end

  test "destroy with plain model class" do
    widget = Widget.create
    assert_equal 1, widget.versions.length
    widget.destroy
    versions_for_widget = PaperTrail::Version.with_item_keys("Widget", widget.id)
    assert_equal 2, versions_for_widget.length
  end
end


text:
'use strict';

/* Controllers */
  // signin controller
app.controller('SigninFormController', ['$scope', '$http', '$state','subject', 'usernamePasswordToken',
    function ($scope, $http, $state, subject,usernamePasswordToken) {

        $scope.user = {};
        $scope.authError = null;
        $scope.token = usernamePasswordToken;
        if(subject.authenticated){
            $state.go('app.dashboard-v1');
        }
        $scope.myInterval = 5000;
        var slides = $scope.slides = [];
        $scope.addSlide = function () {
            slides.push({
                image: 'img/c' + slides.length + '.jpg',
                text: ['Carousel text #0', 'Carousel text #1', 'Carousel text #2', 'Carousel text #3'][slides.length % 4]
            });
        };
        for (var i = 0; i < 4; i++) {
            $scope.addSlide();
        }

        $scope.login = function() {
            $scope.authError = null;

            // Try to login
            /**$http.post('/auth/login', {email: $scope.user.email, password: $scope.user.password})
            .then(function(response) {
                if ( !response.data.user ) {
                    $scope.authError = 'Email or Password not right';
                }else{
                    $state.go('app.dashboard-v1');
                }
                }, function(x) {
                    $scope.authError = 'Server Error';
             });*/
            $scope.token.rememberMe=true;
            $scope.token.username=$scope.token.email;

            subject.login($scope.token).then(function (data) {
                console.log(data);
                if(!data.info||!data.info.authc.principal){
                    $scope.authError = data;
                }else{
                    $scope.user=data.info.authc.principal;
                    $state.go('app.dashboard-v1');
                }
            }, function (error) {
                console.log(error);
                $scope.authError = 'Server Error';
            });
    };
  }])
;


text:
//
//  PLSLoadAnimationView.m
//  PLShortVideoKitDemo
//
//  Created by 冯文秀 on 2017/10/25.
//  Copyright © 2017年 Pili Engineering, Qiniu Inc. All rights reserved.
//

#import "PLSLoadAnimationView.h"

@implementation PLSLoadAnimationView
- (instancetype)initWithFrame:(CGRect)frame {
    if (self = [super initWithFrame:frame]) {
        self.scrollImageView = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, 79, 79)];
        self.scrollImageView.center = self.center;
        self.scrollImageView.image = [UIImage imageNamed:@"scroll_image"];
        [self addSubview:_scrollImageView];

        self.centerLabel = [[UILabel alloc]initWithFrame:CGRectMake(0, 0, 70, 30)];
        self.centerLabel.center = self.scrollImageView.center;
        self.centerLabel.font = [UIFont systemFontOfSize:8];
        self.centerLabel.textAlignment = NSTextAlignmentCenter;
        [self addSubview:_centerLabel];

        [self startScrollAnimation];
    }
    return self;
}

- (void)startScrollAnimation {
    CABasicAnimation* rotationAnimation = [CABasicAnimation animationWithKeyPath:@"transform.rotation.z"];
    rotationAnimation.toValue = [NSNumber numberWithFloat: M_PI * 2.0 ];
    rotationAnimation.duration = 1.2f;
    rotationAnimation.cumulative = NO;
    rotationAnimation.removedOnCompletion = NO;
    rotationAnimation.repeatCount = FLT_MAX;
    [self.scrollImageView.layer addAnimation:rotationAnimation forKey:@"rotationAnimation"];
    [self .scrollImageView startAnimating];
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end


text:
package ua.kata;

import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

import java.util.stream.IntStream;

import io.reactivex.Observable;

import static org.assertj.core.api.Assertions.assertThat;

class BowlingGameTest {

  private BowlingGame game;

  @BeforeEach
  void setUp() {
    game = new BowlingGame();
  }

  private Observable<Integer> rollMany(int times, int pin) {
    return Observable.fromArray(
      IntStream.generate(() -> pin)
        .limit(times)
        .boxed()
        .toArray(Integer[]::new)
    );
  }

  private Observable<Integer> rollSpare() {
    return Observable.just(4, 6);
  }

  private Observable<Integer> rollStrike() {
    return Observable.just(10);
  }

  @Test
  void gutterGame() throws Exception {
    rollMany(20, 0).subscribe(game::roll);

    assertThat(game.score().blockingGet()).isEqualTo(0);
  }

  @Test
  void allOnes() throws Exception {
    rollMany(20, 1).subscribe(game::roll);

    assertThat(game.score().blockingGet()).isEqualTo(20);
  }

  @Test
  void oneSpare() throws Exception {
    rollSpare().concatWith(Observable.just(3)).concatWith(rollMany(17, 0)).subscribe(game::roll);

    assertThat(game.score().blockingGet()).isEqualTo(16);
  }

  @Test
  void oneStrike() throws Exception {
    rollStrike().concatWith(Observable.just(3, 4)).concatWith(rollMany(16, 0)).subscribe(game::roll);

    assertThat(game.score().blockingGet()).isEqualTo(24);
  }

  @Test
  void perfectGame() throws Exception {
    rollMany(12, 10).subscribe(game::roll);

    assertThat(game.score().blockingGet()).isEqualTo(300);
  }
}


text:
<?php
namespace Helper;

// here you can define custom actions
// all public methods declared in helper class will be available in $I

class Functional extends \Codeception\Module
{
    protected $requiredFields = ['tool'];

    /**
     * @param string $filepath
     * @return array
     */
    public function readGraphNodeTitlesFrom($filepath)
    {
        $xml = simplexml_load_file($filepath);
        $xml->registerXPathNamespace('svg', 'http://www.w3.org/2000/svg');
        $titles = array_map('strval', $xml->xpath('/svg:svg/svg:g[1]/svg:g/svg:title'));
        sort($titles);

        return $titles;
    }

    /**
     * @return string
     */
    public function getTool()
    {
        return $this->config['tool'];
    }
}


text:
layout: site

permalink: wellington

location: Wellington

dates: 8 February - 10 February, 2017

splashImage: /img/wellington.jpg

map: sites/wellington.geojson

---

                    About

                    Schedule

                    Register

                    Speakers

                    {{page.location}}

                    {{page.dates}}

 About

The Wellington Research Bazaar is a three day conference promoting the digital literacy emerging at the centre of modern research. In the spirit of a marketplace or bazaar, ResBaz is a highly participatory event where researchers from many different disciplines can learn new skills, showcase current projects, and share knowledge.

Researchers at all levels and from all disciplines are encouraged to apply.
Research technologists who support researchers to do their job are welcome also.

The Wellington ResBaz will be broken into two key streams: Code and Learn. There's also a drop-in Play stream.

Code  is comprised of Software Carpentry courses where you can get stuck into learning the basics of research computing;

Learn has various sessions to introduce a range of interesting programs, tools, and research tips and tricks;

Play will allow for hands-on interactions with a number of novel technologies.

There will be speakers from all stages of their research careers in various fields, as well as highlights on up-and-coming projects. The event is fully catered and will include a Data Olympics competition, Digital Research Awards, a beer and pizza evening — and of course valuable opportunities to share ideas and network.

            Read more about the history and philosophy of ResBaz in these blog posts from The Research Whisperer and Software Carpentry.

CODE
 (SOFTWARE CARPENTRY)

                        The Unix Shell

 The Unix Shell allows you to do complex things with just a few keystrokes. More importantly, it helps them combine existing programs in new ways and automate repetitive tasks.

                        Programming with Python

 The best way to learn how to program is to do something useful, so this introduction to Python is built around a common scientific task - data analysis. Our real goal isn't to teach you Python, but to teach you the basic concepts that all programming depends on.

                        Version Control with Git

 Version control is the lab notebook of the digital world. It's what professionals use to keep track of what they've done and to collaborate with other people. Every large software development project relies on it, and most programmers use it for their small jobs as well. And it isn't just for software - books, papers, small data sets, and anything that changes over time or needs to be shared can and should be stored in a version control system.

LEARN
(INTRODUCTORY ELECTIVES)

                        Quick Qualtrics

 If data is the new gold, then survey-creation software Qaultrics maybe the gold digging tool you need. Learn how to capture both qualitative and quantitative data effectively by understanding survey design principles and tools. Sign up for an account here.

                        NVivo in 2 hours

 Get an edge by better understanding the explosion of unstructured data in the world today using  NVivo  — powerful software for qualitative data analysis. VUW staff can download NVivo via the ITS Software Download Site.

                        Digital Storytelling Tool Suite

 Overview of a range of free tools useful for digital history projects, including StoryMap, which fuses digital mapping with interactive storytelling. Possible assets to use here

                        Excel for Research

 Microsoft Excel is widely used in a range of research contexts. This session will give some pointers on how to utilise it effeciently and effectively.

                        R in 2 hours

 An introductory session outlining the basics of R, a free software environment for statistical computing and graphics, which will be followed by a hands-on workshop

                        Author Carpentry

 Promote your publications, increase impact and collaborate in research by learning about alternative metrics, social networking and unique author identifiers.

                        Weebly for Personal Websites

 Learn how to create dynamic websites for research projects using Weebly

                         Learn LaTeX

 LaTeX is a document preparation system for high-quality typesetting. It is most often used for medium-to-large technical or scientific documents but it can be used for almost any form of publishing.

                         Working with Wikipedia

                         ERSI basic Story Map

MAKE
 (EVERYTHING ELSE)

                        Play Sessions

 A range of tools and toys to experiment, interrogate and play with.

                        Meet The Press

 Take a step back into the analogue and a history of the nineteenth century printing press with a guided, hands-on tour of the Wai-te-ata Press by Syndey Shep

                         Lightning talks

 Five five-minute presentations from a range of researchers delving into the digital.

                        Hack - Data Oympics

 Multi-disciplinary teams collaborate to turn open government data sets into compelling, data-driven narratives.

Schedule - CODE

          Each day of the ResBaz CODE stream will be split into morning and afternoon events (scroll down for the LEARN schedule). Following a Key Story (mini-Keynote), the mornings will consist of Software Carpentry lessons. Afternoon sessions will continue the morning's Software Carpentry workshop, before transitioning to a more informal series of events, with plenty of chances to explore other parts of the programme.

            (Below is a provisional timetable and may be subject to slight changes.)

Wednesday February 8
 (AM105)

                            8:30 Coffee and Registration

                            9:00 Welcome (AVC Digital Futures Steven Warburton) & Key Story Victor Anton (The Hub)

                            9:40 The UNIX Shell

                            10:45 Morning Tea

                            11:00 The UNIX Shell (cont)

                            12:00  Lightning Talk Competition (The Hub)

                            12:45 Lunch (Hub Mezzanine)

                            13:15 The UNIX Shell (cont)

                            14:30 LaTeX
        OR
      Introduction to R (cont)
        OR
     Data Insights with TEC

                             16:25 Key Story Anne Niemetz (The Hub)

                            15:05 Film Screening and Social Event (TBD)

Thursday February 9
 (AM105)

                            8:30 Coffee, Follow Up and Collaboration

                            9:00 Key Story  Karsten Lundqvist (The Hub)

                            9:45 Version Control with Git

                            10:45 Morning Tea

                            11:00 Version Control with Git (cont)

                            12:00 Lunch (Hub Mezzanine)

                            12:45 Version Control with Git (cont)

                            14:15 HACK — Shell Extras/SSH(AM105)
       OR
      GGPlot 2 (R Extras) (The Hub)
        OR
     Story MapJS (The Hub)

Friday February 10
 (AM105)

                            8:30 Coffee, Follow Up and Collaboration

                            9:00 Key Story  Lillian Grace - FigureNZ  (The Hub)

                            9:45 The Great Data Debate (The Hub)

                            10:45 Morning Tea

                            11:00 Programming with Python

                            12:00 Lunch (Hub Mezzanine)

                            12:30 Wolgang Hayek on data Science at NIWA

                            13:00 Programming with Python (cont)
       OR
      Data Olympics (The Hub)

                            16:00 Data Olympics Presentations and
     Software Carpentry Takeaways

                            16:30 Digital Research Awards 2017

Schedule - LEARN

             All events in the LEARN stream will be held on Level 1 of The Hub, in two pods at the south of the building unless otherwise stated.
 See the About section for more detailed information on each session.

             (Below is a provisional timetable and may be subject to slight changes.)

Wednesday February 8

                            8:30 Coffee and Registration

                            9:00 Welcome (AVC Digital Futures Steven Warburton) & Key Story Victor Anton (The Hub)

                            9:35 Session Pitch and Data Olympics Preview

                            9:45 NVivo in 2 hours
       OR
     Intro to TimelineJS

                            10:45 Morning Tea

                            11:00 NVivo in 2 hours (cont)
      OR
     ERSI basic StoryMap

                            12:00  Lightning Talk Competition (The Hub)

                            12:45 Lunch (Hub Mezzanine)

                            13:15 R in 2 hours
       OR
     Author Carpentry

                            14:30 R in 2 hours (cont)
        OR
     Data Insights from TEC
       OR
     Learn LaTeX (AM105)*

                             16:25 Key Story Anne Niemetz - School of Design

                            15:05 Film Screening and Social Event (TBD)

Thursday February 9

                            8:30 Coffee, Follow Up and Collaboration

                            9:00 Key Story  Karsten Lundqvist (The Hub)

                            9:45 Making Word work for you
       OR
     Make your own website with Weebly

                            10:45 Morning Tea

                            11:00 Mapping Stories with StoryMap JS
       OR
     Working with Wikipedia

                            12:00 Lunch (Hub Mezzanine)

                            12:45 Intro to R (repeater)
        OR
     Research Tips and Tricks Skill Share
    session (google + beyond)       OR
     Guided Tour of the Wai-te-ata Press

                            14:00 R Extras feat. ggplot2
        OR
     LaTeX vs Word (repeater battle)

Friday February 10

                            8:30 Coffee, Follow Up and Collaboration

                            9:00 Key Story Lillian Grace  - FigureNZ  (The Hub)

                            9:45 The Great Data Debate (The Hub)

                            10:45 Morning Tea

                            11:00 Quick Qualtrics
        OR
     Referencing Refresh

                            12:00 Lunch (Hub Mezzanine)

                            12:30 Data Olympics

                            16:00 Data Olympics Presentations and
   Software Carpentry Takeaways

                            16:30 Digital Research Awards 2017

                            17:15 ResBaz 2017 concludes

Venue

ResBaz Wellington 2017 will be held in and around the Hub
at Victoria University of Wellington's Kelburn Campus.

Register for Resbaz

Register  here  for the Wellington Research Bazaar.

                     Register

Meet Our Speakers

Lillian Grace

 Figure.nz

                    Lillian brings a new perspective on data, one where data is a language in which everyone can be fluent. She believes societies and individuals will benefit when anyone can use data to inform their thinking and insights without requiring intermediaries.

                    In establishing Figure.NZ in 2012, Lillian took the unique position of designating everyone to be a user of data. She leads the team to build systems and software, and to widely and deeply collaborate throughout New Zealand to deliver to this standard.

                    Lillian is also on the Data Futures Partnership Working Group, as well as on the board of the NZ Innovation Partnership and of NZ Centre of Research Excellence Te Pūnaha Matatini. Previously Lillian was at Academy Award-Winning Massive Software, at think tank The New Zealand Institute. a href="">

Ann Niemetz

 VUW - Media Design

                    Anne Niemetz is a media artist and designer working in the fields of wearable technology, interactive installation and audio-visual design. She is particularly fascinated by the convergence of art, science, design and technology, and she pursues collaborative and cross-disciplinary projects.

                    Anne holds a Media Arts degree from the Staatliche Hochschule für Gestaltung Karlsruhe, with a focus in digital media and interactive sound installation, and an MFA in Design|Media Arts from the University of California Los Angeles. Since 2007 she's been living and working in New Zealand, where she holds the position of Senior Lecturer in the Media Design programme at Victoria University of Wellington.

Karsten Lundqvist

 VUW
 Computer Science

                    Karsten has a special interest in eLearning and knowledge representation, having run a successful mobile development MOOC for a number of years at Reading University before joining VUW last year.  He's had computer science as a hobby since he got his first Sinclair Spectrum in 1984, and started programming a year later on his Amstrad CPC 464.

                    In my his spare time he runs a company where he develops mobile phone apps, at the moment mostly concentrated on the Android platform.

Victor Anton

 VUW PhD
 Biological Sciences

                    Interested in the use of novel technologies and citizens science to study New Zealand ecology, Victor is currently utilising remote cameras to research introduced mammals and native fauna in urban areas. In 2015, he launched a website where members of the public identify the animals recorded in over 100,000 photographs

Our Sponsors

Many thanks to all our sponsors for helping bring the Resarch Bazaar to Wellington.

 -->


text:
/**
* Phone.js
*
* @description :: TODO: You might write a short summary of how this model works and what it represents here.
* @docs        :: http://sailsjs.org/#!documentation/models
*/

module.exports = {

  attributes: {
    type    : {
      type    : 'string',
      in      : ['home', 'work', 'mobile', 'proMobile'],
      required: false
    },
    number  : {
      type: 'string'
    },
    contacts: {
      collection: 'contact',
      via       : 'phoneNumbers'
    }
  }
};


text:
        Invoice #
        Item
        Booking From
        Booking To
        Total Nights
        Payment Method
        Total
        Status
        Change Status
        Action
        Message

    <?php foreach ($records as $k => $v): ?>
        <tr class="<?php echo 'booking_status_'.$v->booking_status;?>" id="<?php echo $v->booking_ref_no; ?>">
            <?php echo $v->booking_ref_no; ?>
            <?php echo $v->booking_item_title; ?>
            <?php echo $v->booking_checkin; ?>
            <?php echo $v->booking_checkout; ?>
            <?php echo $v->booking_nights; ?>
            <?php echo $v->booking_payment_type; ?>
            <?php echo $v->booking_total; ?>
            <?php echo $status[$v->booking_status]; ?>

                <?php if($v->booking_status == 0)
                {
                echo form_dropdown( 'booking_status', array( 'pending', 'approved', 'booked', 'cancelled' ), $v->booking_status, " class='field_change_booking_status pull-right' data-booking_id='" . $v->booking_id . "' onChange='javascript:change_booking_agent(this)'" );
                }elseif($v->booking_status == 1){
                echo form_dropdown( 'booking_status', array( 1=> 'approved', 2=>'booked' ), $v->booking_status, " class='field_change_booking_status pull-right' data-booking_id='" . $v->booking_id . "' onChange='javascript:change_booking_agent(this)'" );
                }?>

                <a target="_blank" href="<?=base_url("invoice/{$v->booking_ref_no}");?>">  View Invoice

                <a target="_blank" href="<?=base_url("clients/message/{$v->booking_ref_no}");?>">  Message

    <?php endforeach; ?>


text:
import "selection";

d3_selectionPrototype.datum = function(value) {
  return arguments.length
      ? this.property("__data__", value)
      : this.property("__data__");
};


text:
// Copyright (c) Committed Software 2018, opensource@committed.io
package uk.gov.dstl.baleen.graph.coerce;

/** Return all the values as Strings */
public class ToString implements ValueCoercer {

  @Override
  public Object coerce(Object value) {
    return value.toString();
  }
}


text:
<?xml version="1.0" encoding="UTF-8"?><testrun name="RappelDaoTestCase" project="cadre" tests="1" started="1" failures="1" errors="0" ignored="0">
  <testsuite name="projet.cadre.dao.RappelDaoTestCase" time="0.469">
    <testcase name="shouldSaveRappel" classname="projet.cadre.dao.RappelDaoTestCase" time="0.469">
      <failure>
        <expected>"10122019"</expected>
        <actual>"2017-01-23"</actual>org.junit.ComparisonFailure: expected:<"[10122019]"> but was:<"[2017-01-23]">
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
	at projet.cadre.dao.RappelDaoTestCase.shouldSaveRappel(RappelDaoTestCase.java:47)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)
	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:678)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)

</failure>
    </testcase>
  </testsuite>
</testrun>


text:
var app = require('app')
var meow = require('meow')
var fs = require('fs')
var path = require('path')
var BrowserWindow = require('browser-window')

app.on('ready', appReady)

app.on('window-all-closed', function () {
  if (process.platform !== 'darwin') {
    app.quit()
  }
})

var cli = meow({
  pkg: './package.json',
  help: [
    'Options',
    '  --help                     Show this help',
    '  --version                  Current version of package',
    '  -i | --input               String - The peer ID of your camera',

    ''
  ].join('\n')
})

// send the camera peer ID to the rendering process
var ipc = require('ipc')
ipc.on('asynchronous-message', function (event, arg) {
  var input = cli.input[0] || cli.flags.i || cli.flags.input

  console.log('Camera peer ID: ', input)

  event.sender.send('asynchronous-reply', input)
})

function appReady () {
  // var win = new BrowserWindow({ width: '900px', height: '700px', show: true })

  var win = new BrowserWindow({ width: 0, height: 0, show: false, frame: false })
  win.on('closed', function () { win = null })
  win.loadUrl('file://' + __dirname + '/main.html')
}


text:
{{<govuk_template}}

{{$head}}
  {{>includes/elements_head}}
  {{>includes/elements_scripts}}
{{/head}}

{{$propositionHeader}}
  {{>includes/propositional_navigation4}}
{{/propositionHeader}}

{{$headerClass}}with-proposition{{/headerClass}}

{{$content}}

	{{>includes/phase_banner}}

			As a result of your medical condition, which special controls have been fitted to your car?

		Select all options that are relevant to you

		<fieldset id="q1">

				<input id="checkbox-1" type="checkbox" name="checkbox-group" value="1">Combined braking and accelerator system

				<input id="checkbox-2" type="checkbox" name="checkbox-group" value="2">Accelerator system

				<input id="checkbox-3" type="checkbox" name="checkbox-group" value="3">Rear view mirror

				<input id="checkbox-4" type="checkbox" name="checkbox-group" value="4">Braking system

				<input id="checkbox-5" type="checkbox" name="checkbox-group" value="5">Clutch

				<input id="checkbox-6" type="checkbox" name="checkbox-group" value="6">Control layouts

				<input id="checkbox-7" type="checkbox" name="checkbox-group" value="7">Driver seat

				<input id="checkbox-8" type="checkbox" name="checkbox-group" value="8">Steering

				<input id="checkbox-9" type="checkbox" name="checkbox-group" value="9">Transmission

		</fieldset>

	Save and continue

{{/content}}

{{$bodyEnd}}
{{/bodyEnd}}

{{/govuk_template}}


text:
package org.elasticsearch.index.query;

import org.apache.lucene.search.Query;
import org.apache.lucene.search.spans.SpanContainingQuery;
import org.apache.lucene.search.spans.SpanQuery;
import org.elasticsearch.common.ParseField;
import org.elasticsearch.common.ParsingException;
import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput;
import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.common.xcontent.XContentParser;

import java.io.IOException;
import java.util.Objects;
import java.util.Optional;

/**
 * Builder for {@link org.apache.lucene.search.spans.SpanContainingQuery}.
 */
public class SpanContainingQueryBuilder extends AbstractQueryBuilder<SpanContainingQueryBuilder>
        implements SpanQueryBuilder {

    public static final String NAME = "span_containing";
    public static final ParseField QUERY_NAME_FIELD = new ParseField(NAME);

    private static final ParseField BIG_FIELD = new ParseField("big");
    private static final ParseField LITTLE_FIELD = new ParseField("little");

    private final SpanQueryBuilder big;
    private final SpanQueryBuilder little;

    /**
     * @param big the big clause, it must enclose {@code little} for a match.
     * @param little the little clause, it must be contained within {@code big} for a match.
     */
    public SpanContainingQueryBuilder(SpanQueryBuilder big, SpanQueryBuilder little) {
        if (big == null) {
            throw new IllegalArgumentException("inner clause [big] cannot be null.");
        }
        if (little == null) {
            throw new IllegalArgumentException("inner clause [little] cannot be null.");
        }
        this.little = little;
        this.big = big;
    }

    /**
     * Read from a stream.
     */
    public SpanContainingQueryBuilder(StreamInput in) throws IOException {
        super(in);
        big = (SpanQueryBuilder) in.readNamedWriteable(QueryBuilder.class);
        little = (SpanQueryBuilder) in.readNamedWriteable(QueryBuilder.class);
    }

    @Override
    protected void doWriteTo(StreamOutput out) throws IOException {
        out.writeNamedWriteable(big);
        out.writeNamedWriteable(little);
    }

    /**
     * @return the big clause, it must enclose {@code little} for a match.
     */
    public SpanQueryBuilder bigQuery() {
        return this.big;
    }

    /**
     * @return the little clause, it must be contained within {@code big} for a match.
     */
    public SpanQueryBuilder littleQuery() {
        return this.little;
    }

    @Override
    protected void doXContent(XContentBuilder builder, Params params) throws IOException {
        builder.startObject(NAME);
        builder.field(BIG_FIELD.getPreferredName());
        big.toXContent(builder, params);
        builder.field(LITTLE_FIELD.getPreferredName());
        little.toXContent(builder, params);
        printBoostAndQueryName(builder);
        builder.endObject();
    }

    public static Optional<SpanContainingQueryBuilder> fromXContent(QueryParseContext parseContext) throws IOException {
        XContentParser parser = parseContext.parser();
        float boost = AbstractQueryBuilder.DEFAULT_BOOST;
        String queryName = null;
        SpanQueryBuilder big = null;
        SpanQueryBuilder little = null;

        String currentFieldName = null;
        XContentParser.Token token;
        while ((token = parser.nextToken()) != XContentParser.Token.END_OBJECT) {
            if (token == XContentParser.Token.FIELD_NAME) {
                currentFieldName = parser.currentName();
            } else if (token == XContentParser.Token.START_OBJECT) {
                if (parseContext.getParseFieldMatcher().match(currentFieldName, BIG_FIELD)) {
                    Optional<QueryBuilder> query = parseContext.parseInnerQueryBuilder();
                    if (query.isPresent() == false || query.get() instanceof SpanQueryBuilder == false) {
                        throw new ParsingException(parser.getTokenLocation(), "span_containing [big] must be of type span query");
                    }
                    big = (SpanQueryBuilder) query.get();
                } else if (parseContext.getParseFieldMatcher().match(currentFieldName, LITTLE_FIELD)) {
                    Optional<QueryBuilder> query = parseContext.parseInnerQueryBuilder();
                    if (query.isPresent() == false || query.get() instanceof SpanQueryBuilder == false) {
                        throw new ParsingException(parser.getTokenLocation(), "span_containing [little] must be of type span query");
                    }
                    little = (SpanQueryBuilder) query.get();
                } else {
                    throw new ParsingException(parser.getTokenLocation(),
                            "[span_containing] query does not support [" + currentFieldName + "]");
                }
            } else if (parseContext.getParseFieldMatcher().match(currentFieldName, AbstractQueryBuilder.BOOST_FIELD)) {
                boost = parser.floatValue();
            } else if (parseContext.getParseFieldMatcher().match(currentFieldName, AbstractQueryBuilder.NAME_FIELD)) {
                queryName = parser.text();
            } else {
                throw new ParsingException(parser.getTokenLocation(),
                        "[span_containing] query does not support [" + currentFieldName + "]");
            }
        }

        SpanContainingQueryBuilder query = new SpanContainingQueryBuilder(big, little);
        query.boost(boost).queryName(queryName);
        return Optional.of(query);
    }

    @Override
    protected Query doToQuery(QueryShardContext context) throws IOException {
        Query innerBig = big.toQuery(context);
        assert innerBig instanceof SpanQuery;
        Query innerLittle = little.toQuery(context);
        assert innerLittle instanceof SpanQuery;
        return new SpanContainingQuery((SpanQuery) innerBig, (SpanQuery) innerLittle);
    }

    @Override
    protected int doHashCode() {
        return Objects.hash(big, little);
    }

    @Override
    protected boolean doEquals(SpanContainingQueryBuilder other) {
        return Objects.equals(big, other.big) &&
               Objects.equals(little, other.little);
    }

    @Override
    public String getWriteableName() {
        return NAME;
    }
}


text:
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package org.smartbricks.exceptions;

/**
 * thrown by the template engine if templates contains errors
 * @author cambierr
 */
public class RenderException extends Exception {

    public RenderException(String _msg){
        super(_msg);
    }
}


text:
/* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */
/* plugins/kdb/ldap/libkdb_ldap/ldap_service_stash.c */
/*
 * Copyright (c) 2004-2005, Novell, Inc.
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 *   * Redistributions of source code must retain the above copyright notice,
 *       this list of conditions and the following disclaimer.
 *   * Redistributions in binary form must reproduce the above copyright
 *       notice, this list of conditions and the following disclaimer in the
 *       documentation and/or other materials provided with the distribution.
 *   * The copyright holder's name is not used to endorse or promote products
 *       derived from this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 */

#include <ctype.h>
#include "ldap_main.h"
#include "kdb_ldap.h"
#include "ldap_service_stash.h"

/* Decode a password of the form {HEX}<hexstring>. */
static krb5_error_code
dec_password(krb5_context context, const char *str,
             unsigned char **password_out)
{
    size_t len;
    const unsigned char *p;
    unsigned char *password, *q;
    unsigned int k;

    *password_out = NULL;

    if (strncmp(str, "{HEX}", 5) != 0) {
        krb5_set_error_message(context, EINVAL,
                               _("Not a hexadecimal password"));
        return EINVAL;
    }
    str += 5;

    len = strlen(str);
    if (len % 2 != 0) {
        krb5_set_error_message(context, EINVAL, _("Password corrupt"));
        return EINVAL;
    }

    q = password = malloc(len / 2 + 1);
    if (password == NULL)
        return ENOMEM;

    for (p = (unsigned char *)str; *p != '\0'; p += 2) {
        if (!isxdigit(*p) || !isxdigit(p[1])) {
            free(password);
            krb5_set_error_message(context, EINVAL, _("Password corrupt"));
            return EINVAL;
        }
        sscanf((char *)p, "%2x", &k);
        *q++ = k;
    }
    *q = '\0';

    *password_out = password;
    return 0;
}

krb5_error_code
krb5_ldap_readpassword(krb5_context context, krb5_ldap_context *ldap_context,
                       unsigned char **password)
{
    int                         entryfound=0;
    krb5_error_code             st=0;
    char                        line[RECORDLEN]="0", *start=NULL, *file=NULL;
    FILE                        *fptr=NULL;

    *password = NULL;

    if (ldap_context->service_password_file)
        file = ldap_context->service_password_file;

#ifndef HAVE_STRERROR_R
# undef strerror_r
# define strerror_r(ERRNUM, BUF, SIZE) (strncpy(BUF, strerror(ERRNUM), SIZE), BUF[(SIZE)-1] = 0)
#endif

    fptr = fopen(file, "r");
    if (fptr == NULL) {
        st = errno;
        krb5_set_error_message(context, st,
                               _("Cannot open LDAP password file '%s': %s"),
                               file, error_message(st));
        goto rp_exit;
    }
    set_cloexec_file(fptr);

    /* get the record from the file */
    while (fgets(line, RECORDLEN, fptr)!= NULL) {
        char tmp[RECORDLEN];

        tmp[0] = '\0';
        /* Handle leading white-spaces */
        for (start = line; isspace(*start); ++start);

        /* Handle comment lines */
        if (*start == '!' || *start == '#')
            continue;
        sscanf(line, "%*[ \t]%[^#]", tmp);
        if (tmp[0] == '\0')
            sscanf(line, "%[^#]", tmp);
        if (strcasecmp(tmp, ldap_context->bind_dn) == 0) {
            entryfound = 1; /* service_dn record found !!! */
            break;
        }
    }
    fclose (fptr);

    if (entryfound == 0)  {
        st = KRB5_KDB_SERVER_INTERNAL_ERR;
        krb5_set_error_message(context, st, _("Bind DN entry '%s' missing in "
                                              "LDAP password file '%s'"),
                               ldap_context->bind_dn, file);
        goto rp_exit;
    }
    /* replace the \n with \0 */
    start = strchr(line, '\n');
    if (start)
        *start = '\0';

    start = strchr(line, '#');
    if (start == NULL) {
        /* password field missing */
        st = KRB5_KDB_SERVER_INTERNAL_ERR;
        krb5_set_error_message(context, st, _("Stash file entry corrupt"));
        goto rp_exit;
    }
    ++ start;

    /* Extract the plain password information. */
    st = dec_password(context, start, password);

rp_exit:
    if (st) {
        if (*password)
            free (*password);
        *password = NULL;
    }
    return st;
}

/* Encodes a sequence of bytes in hexadecimal */

int
tohex(krb5_data in, krb5_data *ret)
{
    unsigned int       i=0;
    int                err = 0;

    ret->length = 0;
    ret->data = NULL;

    ret->data = malloc((unsigned int)in.length * 2 + 1 /*Null termination */);
    if (ret->data == NULL) {
        err = ENOMEM;
        goto cleanup;
    }
    ret->length = in.length * 2;
    ret->data[ret->length] = 0;

    for (i = 0; i < in.length; i++)
        snprintf(ret->data + 2 * i, 3, "%02x", in.data[i] & 0xff);

cleanup:

    if (ret->length == 0) {
        free(ret->data);
        ret->data = NULL;
    }

    return err;
}


text:
/** \file SharedNetwork.h
 * \brief
 *
 */

#ifndef _SHARED_NETWORK_H_
#define _SHARED_NETWORK_H_

#include <stdint.h>
#include <sys/socket.h>
#include <sys/time.h>
#include <linux/if.h>
#include <linux/netdevice.h>
#include <netinet/in.h>
#include <netinet/ip6.h>
#include <unistd.h>

#include <list>

namespace ICMPv6 { class Socket; }

/**
 */
namespace Network {

    class Bridge;
    class Interface;
    class Node;
    class Peer;

    class Monitor;

    typedef enum { ACCESS_PRIVATE, ACCESS_BUSINESS } access_t;

    /**
     */
    class SharedNetwork {
    private:
        char *_name;
        int _ordinal;
	access_t _access;
// XXX there really can only be one Interface and one remote interface
//        std::list <Interface*> interfaces;
//        std::list <char*> remote_interfaces;
        Interface *_interface;
        char *_remote_interface;
        Bridge *_bridge;
    public:
        SharedNetwork( const char *, int );
        ~SharedNetwork();
// This is done in the Manager class since it manages the collection of objects
        static const char * create( const char *, int );
        static const char * destroy();
        const char * add_interface( Interface * );
        const char * remove_interface( Interface * );
        const char * add_remote_interface( const char * );
        const char * remove_remote_interface( const char * );
        const char * add_bridge( Bridge * );
        const char * remove_bridge( Bridge *);
        char * set_access( const char * );
        const char *name() const { return _name; }
        const access_t access() const { return _access; }

        Interface *interface() const { return _interface; }
        Bridge *bridge() const { return _bridge; }

// XXX removed
//      char    *tunnel_interface();	// "atun<N>"
//      char    *bridge_interface();	// "biz<N>"
//      char    *physical_interface();	// "ibiz<N>"
//      char    *network_interface();	// "network<N>"  - This is what "_name" is
    };

}

#endif

/* vim: set autoindent expandtab sw=4 : */


text:
package com.navercorp.pinpoint.plugin.jdk7.cassandra;

import com.navercorp.pinpoint.plugin.AgentPath;
import com.navercorp.pinpoint.test.plugin.Dependency;
import com.navercorp.pinpoint.test.plugin.JvmVersion;
import com.navercorp.pinpoint.test.plugin.PinpointAgent;
import com.navercorp.pinpoint.test.plugin.PinpointPluginTestSuite;
import org.junit.runner.RunWith;

/**
 * @author HyunGil Jeong
 */
@RunWith(PinpointPluginTestSuite.class)
@PinpointAgent(AgentPath.PATH)
@JvmVersion(8)
@Dependency({
        "com.datastax.cassandra:cassandra-driver-core:[3.0.0,4.0.0)",
        "org.scassandra:java-client:1.1.2"})
public class CassandraDatastax_3_0_x_IT extends CassandraDatastaxITBase {
}


text:
"""
A test spanning all the capabilities of all the serializers.

This class defines sample data and a dynamically generated
test case that is capable of testing the capabilities of
the serializers. This includes all valid data values, plus
forward, backwards and self references.
"""

import unittest, datetime

from django.utils.functional import curry
from django.core import serializers
from django.db import transaction
from django.core import management

from models import *

# A set of functions that can be used to recreate
# test data objects of various kinds
def data_create(pk, klass, data):
    instance = klass(id=pk)
    instance.data = data
    instance.save()
    return instance

def generic_create(pk, klass, data):
    instance = klass(id=pk)
    instance.data = data[0]
    instance.save()
    for tag in data[1:]:
        instance.tags.create(data=tag)
    return instance

def fk_create(pk, klass, data):
    instance = klass(id=pk)
    setattr(instance, 'data_id', data)
    instance.save()
    return instance

def m2m_create(pk, klass, data):
    instance = klass(id=pk)
    instance.save()
    instance.data = data
    return instance

def o2o_create(pk, klass, data):
    instance = klass()
    instance.data_id = data
    instance.save()
    return instance

def pk_create(pk, klass, data):
    instance = klass()
    instance.data = data
    instance.save()
    return instance

# A set of functions that can be used to compare
# test data objects of various kinds
def data_compare(testcase, pk, klass, data):
    instance = klass.objects.get(id=pk)
    testcase.assertEqual(data, instance.data,
                         "Objects with PK=%d not equal; expected '%s' (%s), got '%s' (%s)" % (pk,data, type(data), instance.data, type(instance.data)))

def generic_compare(testcase, pk, klass, data):
    instance = klass.objects.get(id=pk)
    testcase.assertEqual(data[0], instance.data)
    testcase.assertEqual(data[1:], [t.data for t in instance.tags.all()])

def fk_compare(testcase, pk, klass, data):
    instance = klass.objects.get(id=pk)
    testcase.assertEqual(data, instance.data_id)

def m2m_compare(testcase, pk, klass, data):
    instance = klass.objects.get(id=pk)
    testcase.assertEqual(data, [obj.id for obj in instance.data.all()])

def o2o_compare(testcase, pk, klass, data):
    instance = klass.objects.get(data=data)
    testcase.assertEqual(data, instance.data_id)

def pk_compare(testcase, pk, klass, data):
    instance = klass.objects.get(data=data)
    testcase.assertEqual(data, instance.data)

# Define some data types. Each data type is
# actually a pair of functions; one to create
# and one to compare objects of that type
data_obj = (data_create, data_compare)
generic_obj = (generic_create, generic_compare)
fk_obj = (fk_create, fk_compare)
m2m_obj = (m2m_create, m2m_compare)
o2o_obj = (o2o_create, o2o_compare)
pk_obj = (pk_create, pk_compare)

test_data = [
    # Format: (data type, PK value, Model Class, data)
    (data_obj, 1, BooleanData, True),
    (data_obj, 2, BooleanData, False),
    (data_obj, 10, CharData, "Test Char Data"),
    (data_obj, 11, CharData, ""),
    (data_obj, 12, CharData, "None"),
    (data_obj, 13, CharData, "null"),
    (data_obj, 14, CharData, "NULL"),
    (data_obj, 15, CharData, None),
    (data_obj, 20, DateData, datetime.date(2006,6,16)),
    (data_obj, 21, DateData, None),
    (data_obj, 30, DateTimeData, datetime.datetime(2006,6,16,10,42,37)),
    (data_obj, 31, DateTimeData, None),
    (data_obj, 40, EmailData, "hovercraft@example.com"),
    (data_obj, 41, EmailData, None),
    (data_obj, 50, FileData, 'file:///foo/bar/whiz.txt'),
    (data_obj, 51, FileData, None),
    (data_obj, 60, FilePathData, "/foo/bar/whiz.txt"),
    (data_obj, 61, FilePathData, None),
    (data_obj, 70, FloatData, 12.345),
    (data_obj, 71, FloatData, -12.345),
    (data_obj, 72, FloatData, 0.0),
    (data_obj, 73, FloatData, None),
    (data_obj, 80, IntegerData, 123456789),
    (data_obj, 81, IntegerData, -123456789),
    (data_obj, 82, IntegerData, 0),
    (data_obj, 83, IntegerData, None),
    #(XX, ImageData
    (data_obj, 90, IPAddressData, "127.0.0.1"),
    (data_obj, 91, IPAddressData, None),
    (data_obj, 100, NullBooleanData, True),
    (data_obj, 101, NullBooleanData, False),
    (data_obj, 102, NullBooleanData, None),
    (data_obj, 110, PhoneData, "212-634-5789"),
    (data_obj, 111, PhoneData, None),
    (data_obj, 120, PositiveIntegerData, 123456789),
    (data_obj, 121, PositiveIntegerData, None),
    (data_obj, 130, PositiveSmallIntegerData, 12),
    (data_obj, 131, PositiveSmallIntegerData, None),
    (data_obj, 140, SlugData, "this-is-a-slug"),
    (data_obj, 141, SlugData, None),
    (data_obj, 150, SmallData, 12),
    (data_obj, 151, SmallData, -12),
    (data_obj, 152, SmallData, 0),
    (data_obj, 153, SmallData, None),
    (data_obj, 160, TextData, """This is a long piece of text.
It contains line breaks.
Several of them.
The end."""),
    (data_obj, 161, TextData, ""),
    (data_obj, 162, TextData, None),
    (data_obj, 170, TimeData, datetime.time(10,42,37)),
    (data_obj, 171, TimeData, None),
    (data_obj, 180, USStateData, "MA"),
    (data_obj, 181, USStateData, None),
    (data_obj, 190, XMLData, "<foo></foo>"),
    (data_obj, 191, XMLData, None),

    (generic_obj, 200, GenericData, ['Generic Object 1', 'tag1', 'tag2']),
    (generic_obj, 201, GenericData, ['Generic Object 2', 'tag2', 'tag3']),

    (data_obj, 300, Anchor, "Anchor 1"),
    (data_obj, 301, Anchor, "Anchor 2"),

    (fk_obj, 400, FKData, 300), # Post reference
    (fk_obj, 401, FKData, 500), # Pre reference
    (fk_obj, 402, FKData, None), # Empty reference

    (m2m_obj, 410, M2MData, []), # Empty set
    (m2m_obj, 411, M2MData, [300,301]), # Post reference
    (m2m_obj, 412, M2MData, [500,501]), # Pre reference
    (m2m_obj, 413, M2MData, [300,301,500,501]), # Pre and Post reference

    (o2o_obj, None, O2OData, 300), # Post reference
    (o2o_obj, None, O2OData, 500), # Pre reference

    (fk_obj, 430, FKSelfData, 431), # Pre reference
    (fk_obj, 431, FKSelfData, 430), # Post reference
    (fk_obj, 432, FKSelfData, None), # Empty reference

    (m2m_obj, 440, M2MSelfData, []),
    (m2m_obj, 441, M2MSelfData, []),
    (m2m_obj, 442, M2MSelfData, [440, 441]),
    (m2m_obj, 443, M2MSelfData, [445, 446]),
    (m2m_obj, 444, M2MSelfData, [440, 441, 445, 446]),
    (m2m_obj, 445, M2MSelfData, []),
    (m2m_obj, 446, M2MSelfData, []),

    (data_obj, 500, Anchor, "Anchor 3"),
    (data_obj, 501, Anchor, "Anchor 4"),

    (pk_obj, 601, BooleanPKData, True),
    (pk_obj, 602, BooleanPKData, False),
    (pk_obj, 610, CharPKData, "Test Char PKData"),
#     (pk_obj, 620, DatePKData, datetime.date(2006,6,16)),
#     (pk_obj, 630, DateTimePKData, datetime.datetime(2006,6,16,10,42,37)),
    (pk_obj, 640, EmailPKData, "hovercraft@example.com"),
    (pk_obj, 650, FilePKData, 'file:///foo/bar/whiz.txt'),
    (pk_obj, 660, FilePathPKData, "/foo/bar/whiz.txt"),
    (pk_obj, 670, FloatPKData, 12.345),
    (pk_obj, 671, FloatPKData, -12.345),
    (pk_obj, 672, FloatPKData, 0.0),
    (pk_obj, 680, IntegerPKData, 123456789),
    (pk_obj, 681, IntegerPKData, -123456789),
    (pk_obj, 682, IntegerPKData, 0),
#     (XX, ImagePKData
    (pk_obj, 690, IPAddressPKData, "127.0.0.1"),
    (pk_obj, 700, NullBooleanPKData, True),
    (pk_obj, 701, NullBooleanPKData, False),
    (pk_obj, 710, PhonePKData, "212-634-5789"),
    (pk_obj, 720, PositiveIntegerPKData, 123456789),
    (pk_obj, 730, PositiveSmallIntegerPKData, 12),
    (pk_obj, 740, SlugPKData, "this-is-a-slug"),
    (pk_obj, 750, SmallPKData, 12),
    (pk_obj, 751, SmallPKData, -12),
    (pk_obj, 752, SmallPKData, 0),
#     (pk_obj, 760, TextPKData, """This is a long piece of text.
# It contains line breaks.
# Several of them.
# The end."""),
#    (pk_obj, 770, TimePKData, datetime.time(10,42,37)),
    (pk_obj, 780, USStatePKData, "MA"),
#     (pk_obj, 790, XMLPKData, "<foo></foo>"),
]

# Dynamically create serializer tests to ensure that all
# registered serializers are automatically tested.
class SerializerTests(unittest.TestCase):
    pass

def serializerTest(format, self):
    # Clear the database first
    management.flush(verbosity=0, interactive=False)

    # Create all the objects defined in the test data
    objects = []
    transaction.enter_transaction_management()
    transaction.managed(True)
    for (func, pk, klass, datum) in test_data:
        objects.append(func[0](pk, klass, datum))
    transaction.commit()
    transaction.leave_transaction_management()

    # Add the generic tagged objects to the object list
    objects.extend(Tag.objects.all())

    # Serialize the test database
    serialized_data = serializers.serialize(format, objects, indent=2)

    # Flush the database and recreate from the serialized data
    management.flush(verbosity=0, interactive=False)
    transaction.enter_transaction_management()
    transaction.managed(True)
    for obj in serializers.deserialize(format, serialized_data):
        obj.save()
    transaction.commit()
    transaction.leave_transaction_management()

    # Assert that the deserialized data is the same
    # as the original source
    for (func, pk, klass, datum) in test_data:
        func[1](self, pk, klass, datum)

for format in serializers.get_serializer_formats():
    setattr(SerializerTests, 'test_'+format+'_serializer', curry(serializerTest, format))


text:
PACKAGE=nuclblog
SYSTEMS=":${PACKAGE} :${PACKAGE}-demo"

sbcl --noinform --noprint \
    --eval '(require :asdf)' \
    --eval "(pushnew (make-pathname :directory \""`pwd`"\") asdf:*central-registry*)" \
    --eval "(asdf:operate 'asdf:load-op 'ch-util)" \
    --eval "(asdf:operate 'asdf:load-op 'asdf-package)" \
    --eval "(asdf-package:package-system ${SYSTEMS})" \
    --eval '(quit)'


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

<section class="html-content <?= @$params['page_class']; ?>">

	<?php if ( $params[ 'show_page_content_title' ] ) { ?>

			<?= $this->mcm->html_data['content']['title']; ?>

	<?php } ?>

		<?= $params[ 'html_content' ]; ?>


text:
/**
 * Definition for singly-linked list.
 * function ListNode(val) {
 *     this.val = val;
 *     this.next = null;
 * }
 */
/**
 * @param {ListNode} head
 * @return {ListNode}
 */
const reverseList = function (head) {
    if (head === null) {
        return null;
    }
    let curr = head.next;
    let previous = head;
    head.next = null;
    while (curr) {
        let temp = curr.next;
        curr.next = previous;
        previous = curr;
        curr = temp;
    }
    return previous;
};

module.exports = reverseList;