text:
/* Table of Contents
==================================================
  #Base 960 Grid
  #Tablet (Portrait)
  #Mobile (Portrait)
  #Mobile (Landscape)
  #Clearing */

/* #Base 960 Grid
================================================== */

  .container-twelve, .container { position: relative; width: 960px; margin: 0 auto; padding: 0; }
  .column, .columns { float: left; display: inline; margin-left: 10px; margin-right: 10px; }
  .row { margin-bottom: 20px; }

  /* Nested Column Classes */
  .column.alpha, .columns.alpha             { margin-left: 0; }
  .column.omega, .columns.omega             { margin-right: 0; }

  .container-twelve .one-third.column, .container .one-third.column { width: 300px; }
  .container-twelve .two-thirds.column, .container .two-thirds.column { width: 620px; }

  .ten-column-wrapper {width: 880px;}

  /*****************************
    12 Column
  *****************************/

  /* Base Grid */
  .container-twelve .one.column             { width: 60px;  }
  .container-twelve .two.columns            { width: 140px; }
  .container-twelve .three.columns          { width: 220px; }
  .container-twelve .four.columns           { width: 300px; }
  .container-twelve .five.columns           { width: 380px; }
  .container-twelve .six.columns            { width: 460px; }
  .container-twelve .seven.columns          { width: 540px; }
  .container-twelve .eight.columns          { width: 620px; }
  .container-twelve .nine.columns           { width: 700px; }
  .container-twelve .ten.columns            { width: 780px; }
  .container-twelve .eleven.columns           { width: 860px; }
  .container-twelve .twelve.columns           { width: 940px; }

  /* Offsets */
  .container-twelve .offset-by-one          { margin-left: 90px;  }
  .container-twelve .offset-by-two          { margin-left: 170px; }
  .container-twelve .offset-by-three          { margin-left: 250px; }
  .container-twelve .offset-by-four           { margin-left: 330px; }
  .container-twelve .offset-by-five           { margin-left: 410px; }
  .container-twelve .offset-by-six          { margin-left: 490px; }
  .container-twelve .offset-by-seven          { margin-left: 570px; }
  .container-twelve .offset-by-eight          { margin-left: 650px; }
  .container-twelve .offset-by-nine           { margin-left: 730px; }
  .container-twelve .offset-by-ten          { margin-left: 810px; }
  .container-twelve .offset-by-eleven         { margin-left: 890px; }

  /*****************************
    16 Column
  *****************************/

  /* Base Grid */
  .container-sixteen .one.column            { width: 40px;  }
  .container-sixteen .two.columns           { width: 100px; }
  .container-sixteen .three.columns           { width: 160px; }
  .container-sixteen .four.columns          { width: 220px; }
  .container-sixteen .five.columns          { width: 280px; }
  .container-sixteen .six.columns           { width: 340px; }
  .container-sixteen .seven.columns           { width: 400px; }
  .container-sixteen .eight.columns           { width: 460px; }
  .container-sixteen .nine.columns          { width: 520px; }
  .container-sixteen .ten.columns           { width: 580px; }
  .container-sixteen .eleven.columns          { width: 640px; }
  .container-sixteen .twelve.columns          { width: 700px; }
  .container-sixteen .thirteen.columns        { width: 760px; }
  .container-sixteen .fourteen.columns        { width: 820px; }
  .container-sixteen .fifteen.columns         { width: 880px; }
  .container-sixteen .sixteen.columns         { width: 940px; }

  /* Offsets */
  .container-sixteen .offset-by-one           { margin-left: 60px;  }
  .container-sixteen .offset-by-two           { margin-left: 120px; }
  .container-sixteen .offset-by-three         { margin-left: 180px; }
  .container-sixteen .offset-by-four          { margin-left: 240px; }
  .container-sixteen .offset-by-five          { margin-left: 300px; }
  .container-sixteen .offset-by-six           { margin-left: 360px; }
  .container-sixteen .offset-by-seven         { margin-left: 420px; }
  .container-sixteen .offset-by-eight         { margin-left: 480px; }
  .container-sixteen .offset-by-nine          { margin-left: 540px; }
  .container-sixteen .offset-by-ten           { margin-left: 600px; }
  .container-sixteen .offset-by-eleven        { margin-left: 660px; }
  .container-sixteen .offset-by-twelve        { margin-left: 720px; }
  .container-sixteen .offset-by-thirteen        { margin-left: 780px; }
  .container-sixteen .offset-by-fourteen        { margin-left: 840px; }
  .container-sixteen .offset-by-fifteen         { margin-left: 900px; }

/* #Clearing
================================================== */

  /* Self Clearing Goodness */
  .container-twelve:after, .container:after { content: "\0020"; display: block; height: 0; clear: both; visibility: hidden; }

  /* Use clearfix class on parent to clear nested columns,
  or wrap each row of columns in a
 */
  .clearfix:before,
  .clearfix:after,
  .row:before,
  .row:after {
    content: '\0020';
    display: block;
    overflow: hidden;
    visibility: hidden;
    width: 0;
    height: 0; }
  .row:after,
  .clearfix:after {
    clear: both; }
  .row,
  .clearfix {
    zoom: 1; }

  /* You can also use a
 to clear columns */
  .clear {
    clear: both;
    display: block;
    overflow: hidden;
    visibility: hidden;
    width: 0;
    height: 0;
  }

  .last-one
  {
    clear:right;
  }

/* Extra */
img.fitted
{
  max-width:100%;
  height:auto !important;
}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Lobaria adscripta f. angustifolia Asahina ex Kurok.

### Remarks
null

redpajama_set_name: RedPajamaGithub


text:
<?php
/**
 *
 * This file is part of the Aura Project for PHP.
 *
 * @package Aura.Intl
 *
 * @license http://opensource.org/licenses/bsd-license.php BSD
 *
 */
namespace Aura\Intl;

/**
 *
 * Exception
 *
 * @package Aura.Intl
 *
 */
class Exception extends \Exception
{
}


text:
package org.locke.biokit.biology.genetics.bases.ambiguous;

import org.locke.biokit.biology.genetics.Base;

public class Weak extends Base
{
	@Override
	public char asCharacter()
	{
		return 'K';
	}
}


text:
A synesthetic (relating to synesthesia) approach to coloring music notation in JavaScript by note.

## Purpose
The purpose of this is to create a new learning method for teaching musical notation to children, especially the very young. The hope would be that this approach will take advantage of neuroplasticity to actually promote synesthesia in the student. In my mind, recognizing the color combinations of piano chords could be made easier like this, making a C-maj chord more readily distinguishable from a D-maj, for example.

## Existing code

This projects builds on the excellent JavaScript library [vexflow](https://github.com/0xfe/vexflow) by 0xfe. See also [vexflow.com](http://www.vexflow.com) for more information and tutorials. To work with this project, you'd need some experience working with the way vexflow creates and decorates notation on one or more musical staves, as rendered to an HTML5 canvas.

## Definition

Wikipedia defines synesthesia as "a neurological phenomenon in which stimulation of one sensory or cognitive pathway leads to automatic, involuntary experiences in a second sensory or cognitive pathway".

In case you're interested, according to [this blog post](http://synspectrum.com/synesthesia.html), the synesthetic author experiences the following colors associated with these notes:

C:	white

C#/Db:	somewhat-metallic navy blue

D:	gray-green

D#:	yellow-green

Eb:	metallic gold

E:	bright yellow

F:	crimson red, tending toward magenta (very vivid and rich)

F#:	maroon, a bit redder

Gb:	metallic maroon, slightly darker

G:	brown-orange, browner the lower the note is

G#:	bright/matte-finish orange-copper

Ab:	metallic copper/brass

A:	orange

A#:	magenta

Bb:	beautiful royal purple--more violet, reddish-purple hue

B:	a very crisp black

## Synesthetes
Alexander Scriabin (1872-1915), Hélène Grimaud (1969-), Franz Liszt (1811-1886), Itzhak Perman (1945-), Duke Ellington (1899-1974, Joachim Raff (1822-1882), Jean Sibelius (1865-1957), György Ligeti (1923-2006), Nikolai Rimsky-Korsakov (1844-1908), Olivier Messiaen (1908-1992) and David Hockney (1937) all were famous musicians and composers who wrote about their own synesthesia and how it affected them personally.

## A strategy for coloring notation
Since I've not been able to determine a commonality or consensus among the anecdotal collective evidence of existing writings, I've decided to issue colors based upon a common childhood toy from kindergarten:  the xylophone.

![xylophone](https://cloud.githubusercontent.com/assets/15971213/25959487/95def22e-3628-11e7-9a7e-022278aeb1a8.jpg)

The approach here is to use the natural red-to-violet color spectrum and map this to the span of one octave of white keys on a typical piano keyboard. This gives us the following table:

C	red

D	orange

E	yellow

F	green

G	blue

A	purple

B	violet

Next, we need to find a color for the accidentals (sharps/flats). The best method here appears to be to find an intermediate color between the notes above/below and then I've decided to make the color grayer, more pastel in feel.

![vexflow-syn_example](https://cloud.githubusercontent.com/assets/15971213/26010325/53a45d2a-3701-11e7-9f94-b14363448406.png)

In this example, we see a chromatic scale in the first stave: B, C, C#, D | Eb, E, F, F# | G, G#, A and a rest.  The next stave includes: Bb, B, C, C# | D, Eb, E, F | F#, G, G# and A.  The final stave includes four major chords (C-maj, D-maj, E-maj and F-maj) followed by their minors (C-min, D-min, E-min and F-min).

One should readily see some of the advantages here with the colorized version:
* Visualizing octaves on the piano would be monochromatic, there might be two red notes separated by a common distance across the stave, for example.
* All black keys on the piano appear grayer in color than their white-key counterparts.
* The red/yellow/blue primary color combination is seen in the C-maj 1-3-5 chord.  If the expected yellow middle note is shifted more orange and grayer, then this is a quick visual indication of the C-min variation in this case.
* A melody which is gradually moving through the color spectrum is chromatic (half-note steps).  A melody which is in a major key like C-maj has little gray in it.
* In musical theory for conventional music, you often hear terms like "dominant" (for the C-maj key that's 5-7-9 or G/B/D or blue/violet/orange in this case).  So the music might begin with the root C-maj red/yellow/blue, then move to the dominant G-maj blue/violet/orange, temporarily move to the fourth F-maj with green/purple/red and then back to the root. With practice, the recognition of these color movements could make things easier for the student, if not almost instinctual at some point.

## Progress
At the moment, this project is simply an example of a client-side approach to displaying a few staves of colorized musical notation.  It relies upon the (normally external) dependency of the vexflow JavaScript include but to make things easier I've copied a snapshot of this library to make installation go quickly for you.

## Installation
```
$ git clone https://github.com/OutsourcedGuru/vexflow-syn.git
$ cd vexflow-syn
$ open index.html         // in Windows, "start index.html"
$ open mary.html          // See before/after version
$ open 9crimes.html       // Great example
```

## Notes
It looks like vexflow at the moment is a little early in its development cycle. Although it's an awesome effort by its author, it still lacks in the ease-of-use areas, in my humble opinion.  You might also want to investigate some of the one-off projects like [vexflow-json](https://github.com/rubiety/vexflow-json) and [jquery-vexflow-json](https://github.com/rubiety/jquery-vexflow-json) which likely make things easier on importing into the note array for one or more staves.

What appears to be missing is "stave continuation" (for want of a term to describe it), a feature which would allow an entire score to be added as a single array.  In theory, then, the rendering engine would make some reasonable assumptions about note spacing and then essentially do what any text editor might: find suitable places to add an end-of-line character to move to the next line (stave), in this case.  The underlying vexflow library does not have this.

I'm also in the learning stage for vexflow since this project is less than a week old for me, to be honest.  I find it difficult at the moment to easily change note durations without this causing errors in the rendering step.  It feels like the vexflow author expects me to manually type in the beat count for each stave but I'd rather do this programmatically, of course.

## Complexity
Having now learned a bit about the vexflow styling tutorial, I've added a pair of staves from the "9 Crimes" song by Damien Rice to demonstrate bracing a treble/bass clef, properly marking notes when they're in a different clef, adding ties and note bars, etc. This file also adds to the collection of accidentals and exceptions for the simpler cases so it's probably the best file to use as a base point for your own work.

I've done a better job of using arrays in this pair of files (9crimes.html & css) so you should clone from here if you're trying to create a song.

![9crimes](https://cloud.githubusercontent.com/assets/15971213/26123137/aeb46f86-3a2e-11e7-943f-212bd36f2ac1.png)

|Donate||Cryptocurrency|
|:-----:|---|:--------:|
| ![eth-receive](https://user-images.githubusercontent.com/15971213/40564950-932d4d10-601f-11e8-90f0-459f8b32f01c.png) || ![btc-receive](https://user-images.githubusercontent.com/15971213/40564971-a2826002-601f-11e8-8d5e-eeb35ab53300.png) |
|Ethereum||Bitcoin|


text:
package com.pachakutech.geofencingdemo.utils;

import java.io.IOException;

import com.google.api.client.http.HttpRequest;
import com.google.api.client.http.HttpRequestFactory;
import com.google.api.client.http.HttpRequestInitializer;
import com.google.api.client.http.HttpResponse;
import com.google.api.client.http.HttpTransport;
import com.google.api.client.http.javanet.NetHttpTransport;
import com.google.api.client.json.JsonObjectParser;
import com.google.api.client.json.JsonFactory;
import com.google.api.client.json.jackson.JacksonFactory;
import com.pachakutech.geofencingdemo.structs.*;

public class GoogleClient {
    private static final HttpTransport HTTP_TRANSPORT = new NetHttpTransport();
    private static final JsonFactory JSON_FACTORY = new JacksonFactory();
    private static HttpRequestFactory REQUEST_FACTORY;

    public GoogleClient() {
        /* creating the transport for the data to server */
        REQUEST_FACTORY = HTTP_TRANSPORT
			.createRequestFactory(new HttpRequestInitializer() {
				@Override
				public void initialize(HttpRequest request) {
					/* use JacksonFactory to add a JSON parser to the request*/
					request.setParser(new JsonObjectParser(JSON_FACTORY));
				}
			});

    }
	public Places executePlacesSearchGet(String keyword, String key, String location, int radius) {
        /* Define all parameters that are part of the URL */
        PlacesSearchUrl url = new PlacesSearchUrl();
        url.key = key;
        url.location = location;
        url.radius = radius;
        url.sensor = true;
        url.keyword = keyword;

        try {
            /* Build the request and execute it */
            HttpRequest request = REQUEST_FACTORY.buildGetRequest(url);
            HttpResponse response = request.execute();
            // System.out.println(response.parseAsString());

            Places places = response.parseAs(Places.class);
            return places;

        } catch (IOException e) {
            e.printStackTrace();
			return null;
        }

    }
}


text:
title: HTML5 Video
localeTitle: HTML5 فيديو
---
## HTML5 فيديو

قبل HTML5 ، لكي يكون لديك تشغيل فيديو في صفحة ويب ، ستحتاج إلى استخدام مكون إضافي ، مثل Adobe Flash Player. مع إدخال HTML5 ، يمكنك الآن وضعها مباشرة في الصفحة نفسها. HTML يتم استخدام العلامة لتضمين الفيديو في مستندات الويب. قد يحتوي على واحد أو أكثر من مصادر الفيديو ، ممثلة باستخدام السمة src أو عنصر [المصدر](source) .

لتضمين ملف الفيديو في صفحة الويب ، ما عليك سوى إضافة مقتطف الشفرة وتغيير src للملف الصوتي.

\`\` \`أتش تي أم أل   متصفحك لا يدعم عنصر الفيديو. يرجى تحديثه إلى أحدث إصدار.

 `The controls attribute includes video controls, similar to play, pause, and volume.

 This feature is supported by all modern/updated browsers. However, not all support the same video file format. My recommendation for a wide range of compatibilty is MP4, as it is the most widely accepted format. There are also two other formats (WebM and Ogg) that are supported in Chrome, Firefox, and Opera.

 The <source> element enables you to indicate alternative video files which the browser may choose from. The browser will utilize the first recognized format.
 In HTML5, there are 3 supported video formats: MP4, WebM, and Ogg.

 The text between the <video> and </video> tags will only be displayed in browsers that do not support the <video> element.
 Since this is html5, some browsers do not support it. You can check the support at https://caniuse.com/#search=audio.

 There are several different elements of the video tag, many of these explanations are based on Mozilla's web docs (linked below). There are even more if you click the link at the bottom.

 #### autoplay

 "autoplay" can be set to either true or false. You set it to true by adding it into the tag, if it is not present in the tag it is set to false. If set to true, the video will begin playing as soon as enough of the video has buffered for it to be able to play. Many people find autoplaying videos as disruptive or annoying so use this feature sparingly. Also note, that some mobile browsers, such as Safari for iOS, ignore this attribute.
`

أتش تي أم أل

 `#### poster

 The "poster" attribute is the image that shows on the video until the user clicks to play it.
`

أتش تي أم أل

 `#### controls

 The "controls" attribute can be set to true or false and will handle whether controls such as the play/pause button or volume slider appear. You set it to true by adding it into the tag, if it is not present in the tag it is set to false.
`

أتش تي أم أل

\`\` \`

هناك العديد من السمات التي يمكن إضافتها والتي تعد اختيارية لتخصيص مشغل الفيديو في الصفحة. لمعرفة المزيد ، انقر على الروابط أدناه.

## معلومات اكثر:

*   [W3Schools - فيديو HTML5](https://www.w3schools.com/html/html5_video.asp)
*   [موزيلا على الويب مستندات - فيديو](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/video)
*   [ويكيبيديا - فيديو HTML5](https://en.wikipedia.org/wiki/HTML5_video)
*   [HTML5 Rocks - HTML5 Video](https://www.html5rocks.com/en/tutorials/video/basics/)
*   [هل يمكنني استخدام الفيديو؟](https://caniuse.com/#search=video)
*   [كيفية استخدام HTML5 لتشغيل ملفات الفيديو على صفحة الويب الخاصة بك](https://docs.microsoft.com/en-us/previous-versions/windows/internet-explorer/ie-developer/samples/hh924821(v=vs.85))


text:
<?php

namespace Everon\Rest\Interfaces;

interface ApiKey
{
    /**
     * @param string $secret
     */
    function setSecret($secret);

    /**
     * @return string
     */
    function getSecret();

    /**
     * @param string $id
     */
    function setId($id);

    /**
     * @return string
     */
    function getId();
}


text:
/*
 * This software is distributed under BSD 3-clause license (see LICENSE file).
 *
 * Authors: Yuyu Zhang, Sergey Lisitsyn
 */

#ifndef _POLYMATCHSTRINGKERNEL_H___
#define _POLYMATCHSTRINGKERNEL_H___

#include <shogun/lib/config.h>

#include <shogun/lib/common.h>
#include <shogun/kernel/string/StringKernel.h>

namespace shogun
{
/** @brief The class PolyMatchStringKernel computes a variant of the polynomial
 * kernel on strings of same length.
 *
 * It is computed as
 *
 * \f[
 * k({\bf x},{\bf x'})= (\sum_{i=0}^L I(x_i=x'_i)+c)^d
 * \f]
 *
 * where I is the indicator function which evaluates to 1 if its argument is
 * true and to 0 otherwise.
 *
 * Note that additional normalisation is applied, i.e.
 * \f[
 *     k'({\bf x}, {\bf x'})=\frac{k({\bf x}, {\bf x'})}{\sqrt{k({\bf x}, {\bf x})k({\bf x'}, {\bf x'})}}
 * \f]
 */
class PolyMatchStringKernel: public StringKernel<char>
{
	public:
		/** default constructor  */
		PolyMatchStringKernel();

		/** constructor
		 *
		 * @param size cache size
		 * @param degree degree
		 * @param inhomogene is inhomogeneous
		 */
		PolyMatchStringKernel(int32_t size, int32_t degree, bool inhomogene);

		/** constructor
		 *
		 * @param l features of left-hand side
		 * @param r features of right-hand side
		 * @param degree degree
		 * @param inhomogene is inhomogeneous
		 */
		PolyMatchStringKernel(
			const std::shared_ptr<StringFeatures<char>>& l, const std::shared_ptr<StringFeatures<char>>& r,
			int32_t degree, bool inhomogene);

		~PolyMatchStringKernel() override;

		/** initialize kernel
		 *
		 * @param l features of left-hand side
		 * @param r features of right-hand side
		 * @return if initializing was successful
		 */
		bool init(std::shared_ptr<Features> l, std::shared_ptr<Features> r) override;

		/** clean up kernel */
		void cleanup() override;

		/** return what type of kernel we are
		 *
		 * @return kernel type POLYMATCH
		 */
		EKernelType get_kernel_type() override
		{
			return K_POLYMATCH;
		}

		/** return the kernel's name
		 *
		 * @return name PolyMatchString
		 */
		const char* get_name() const override { return "PolyMatchStringKernel"; }

		/** enable rescaling by length of feature vector
		 *
		 * @param n true to enable
		 */
		void set_rescaling_enabled(bool n)
		{
			rescaling=n;
		}

		/** return rescaling parameter
		 *
		 * @return true if rescaling is enabled
		 */
		bool get_rescaling_enabled()
		{
			return rescaling;
		}

	protected:
		/** compute kernel function for features a and b
		 * idx_{a,b} denote the index of the feature vectors
		 * in the corresponding feature object
		 *
		 * @param idx_a index a
		 * @param idx_b index b
		 * @return computed kernel function at indices a,b
		 */
		float64_t compute(int32_t idx_a, int32_t idx_b) override;

	private:
		void init();

	protected:
		/** degree */
		int32_t degree;
		/** if kernel is inhomogeneous */
		bool inhomogene;
		/** true to rescale kernel with string length */
		bool rescaling;
};
}
#endif /* _POLYMATCHSTRINGKERNEL_H___ */


text:
{% extends "base.html" %}

{% block content %}

About Evention

Hi, I'm Eric. I made a thing. It's pretty alright. Follow it on GitHub.

How it works

First you should search for performers and build up a list of your favourites.

Then you should compile a list of your favourite cities and places you want to visit.

Finally, hop over to the events page and see what your favourite bands are up to, and when they'll be somewhere you want to visit. Want an excuse to go on vacation? There it is!

Planned features

In no particular order, here are some of the things that will be coming next to Evention:

Sports.

Importing favourite artists from Spotify and other services.

Adding your planned trips and get information on relevant events happening while you're in a particular area.

Deals on event tickets and flights delivered to you via the site or email.

{% endblock %}


text:
package org.apache.rocketmq.test.client.producer.exception.msg;

import org.apache.rocketmq.client.producer.DefaultMQProducer;
import org.apache.rocketmq.client.producer.SendResult;
import org.apache.rocketmq.client.producer.SendStatus;
import org.apache.rocketmq.common.message.Message;
import org.apache.rocketmq.test.base.BaseConf;
import org.apache.rocketmq.test.factory.MessageFactory;
import org.apache.rocketmq.test.factory.ProducerFactory;
import org.apache.rocketmq.test.util.RandomUtils;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;

import static com.google.common.truth.Truth.assertThat;

public class MessageExceptionIT extends BaseConf {
    private static DefaultMQProducer producer = null;
    private static String topic = null;

    @Before
    public void setUp() {
        producer = ProducerFactory.getRMQProducer(nsAddr);
        topic = initTopic();
    }

    @After
    public void tearDown() {
        producer.shutdown();
    }

    @Test
    public void testProducerSmoke() {
        Message msg = new Message(topic, RandomUtils.getStringByUUID().getBytes());
        SendResult sendResult = null;
        try {
            sendResult = producer.send(msg);
        } catch (Exception e) {
        }

        assertThat(sendResult).isNotEqualTo(null);
        assertThat(sendResult.getSendStatus()).isEqualTo(SendStatus.SEND_OK);
    }

    @Test(expected = org.apache.rocketmq.client.exception.MQClientException.class)
    public void testSynSendNullMessage() throws Exception {
        producer.send((Message) null);
    }

    @Test(expected = org.apache.rocketmq.client.exception.MQClientException.class)
    public void testSynSendNullBodyMessage() throws Exception {
        Message msg = new Message(topic, RandomUtils.getStringByUUID().getBytes());
        msg.setBody(null);
        producer.send(msg);
    }

    @Test(expected = org.apache.rocketmq.client.exception.MQClientException.class)
    public void testSynSendZeroSizeBodyMessage() throws Exception {
        Message msg = new Message(topic, RandomUtils.getStringByUUID().getBytes());
        msg.setBody(new byte[0]);
        producer.send(msg);
    }

    @Test(expected = org.apache.rocketmq.client.exception.MQClientException.class)
    public void testSynSendOutOfSizeBodyMessage() throws Exception {
        Message msg = new Message(topic, RandomUtils.getStringByUUID().getBytes());
        msg.setBody(new byte[1024 * 1024 * 4 + 1]);
        producer.send(msg);
    }

    @Test(expected = org.apache.rocketmq.client.exception.MQClientException.class)
    public void testSynSendNullTopicMessage() throws Exception {
        Message msg = new Message(null, RandomUtils.getStringByUUID().getBytes());
        producer.send(msg);
    }

    @Test(expected = org.apache.rocketmq.client.exception.MQClientException.class)
    public void testSynSendBlankTopicMessage() throws Exception {
        Message msg = new Message("", RandomUtils.getStringByUUID().getBytes());
        producer.send(msg);
    }

    @Test(expected = org.apache.rocketmq.client.exception.MQClientException.class)
    public void testSend128kMsg() throws Exception {
        Message msg = new Message(topic,
            RandomUtils.getStringWithNumber(1024 * 1024 * 4 + 1).getBytes());
        producer.send(msg);
    }

    @Test
    public void testSendLess128kMsg() {
        Message msg = new Message(topic, RandomUtils.getStringWithNumber(128 * 1024).getBytes());
        SendResult sendResult = null;
        try {
            sendResult = producer.send(msg);
        } catch (Exception e) {
        }
        assertThat(sendResult.getSendStatus()).isEqualTo(SendStatus.SEND_OK);
    }

    @Test
    public void testSendMsgWithUserProperty() {
        Message msg = MessageFactory.getRandomMessage(topic);
        msg.putUserProperty("key", RandomUtils.getCheseWord(10 * 1024));
        SendResult sendResult = null;
        try {
            sendResult = producer.send(msg);
        } catch (Exception e) {
        }
        assertThat(sendResult.getSendStatus()).isEqualTo(SendStatus.SEND_OK);
    }
}


text:
'use strict';

var React = require('react');
var Router = require('react-router');
var mui = require('material-ui');
var UserStore = require('stores/UserStore');
var UserActions = require('actions/UserActions');
import connectToStores from 'alt-utils/lib/connectToStores';

@connectToStores
class Root extends React.Component {
  constructor(props) {
    super(props);
    // UserActions.loadSession();
  }

  static getStores() {
    return [UserStore];
  }

  static getPropsFromStores() {
    var st = UserStore.getState();
    return st;
  }

  componentDidMount() {
    if (this.props.user == null) {
      this.props.history.replaceState(null, '/public');
    } else {
      this.props.history.replaceState(null, '/app');
    }
  }

  render() {
    return (
        <div>
          {this.props.children}
        </div>
    )
  }
};

module.exports = Root;


text:
<?php

require_once('../../_include.php');

/**
 * This SAML 2.0 endpoint is the endpoint at the SAML 2.0 SP that takes an Authentication Response
 * as HTTP-POST in, and parses and processes it before it redirects the use to the RelayState.
 *
 * @author Andreas Aakre Solberg, UNINETT AS. <andreas.solberg@uninett.no>
 * @package simpleSAMLphp
 * @version $Id: AssertionConsumerService.php 2642 2010-11-16 14:31:18Z olavmrk $
 * @abstract
 */

$config = SimpleSAML_Configuration::getInstance();

/* Get the session object for the user. Create a new session if no session
 * exists for this user.
 */
$session = SimpleSAML_Session::getInstance();

/**
 * Finish login operation.
 *
 * This helper function finishes a login operation and redirects the user back to the page which
 * requested the login.
 *
 * @param array $authProcState  The state of the authentication process.
 */
function finishLogin($authProcState) {
	assert('is_array($authProcState)');
	assert('array_key_exists("Attributes", $authProcState)');
	assert('array_key_exists("core:saml20-sp:NameID", $authProcState)');
	assert('array_key_exists("core:saml20-sp:SessionIndex", $authProcState)');
	assert('array_key_exists("core:saml20-sp:TargetURL", $authProcState)');
	assert('array_key_exists("Source", $authProcState)');
	assert('array_key_exists("entityid", $authProcState["Source"])');

	$authData = array(
		'Attributes' => $authProcState['Attributes'],
		'saml:sp:NameID' => $authProcState['core:saml20-sp:NameID'],
		'saml:sp:SessionIndex' => $authProcState['core:saml20-sp:SessionIndex'],
		'saml:sp:IdP' => $authProcState['Source']['entityid'],
	);

	global $session;
	$session->doLogin('saml2', $authData);

	SimpleSAML_Utilities::redirect($authProcState['core:saml20-sp:TargetURL']);
}

SimpleSAML_Logger::info('SAML2.0 - SP.AssertionConsumerService: Accessing SAML 2.0 SP endpoint AssertionConsumerService');

if (!$config->getBoolean('enable.saml20-sp', TRUE))
	throw new SimpleSAML_Error_Error('NOACCESS');

if (array_key_exists(SimpleSAML_Auth_ProcessingChain::AUTHPARAM, $_REQUEST)) {
	/* We have returned from the authentication processing filters. */

	$authProcId = $_REQUEST[SimpleSAML_Auth_ProcessingChain::AUTHPARAM];
	$authProcState = SimpleSAML_Auth_ProcessingChain::fetchProcessedState($authProcId);
	finishLogin($authProcState);
}

try {
	$metadataHandler = SimpleSAML_Metadata_MetaDataStorageHandler::getMetadataHandler();
	$sp = $metadataHandler->getMetaDataCurrentEntityID();
	$spMetadata = $metadataHandler->getMetaDataConfig($sp, 'saml20-sp-hosted');

	$b = SAML2_Binding::getCurrentBinding();
	if ($b instanceof SAML2_HTTPArtifact) {
		$b->setSPMetadata($spMetadata);
	}

	$response = $b->receive();
	if (!($response instanceof SAML2_Response)) {
		throw new SimpleSAML_Error_BadRequest('Invalid message received to AssertionConsumerService endpoint.');
	}

	$idp = $response->getIssuer();
	if ($idp === NULL) {
		throw new Exception('Missing <saml:Issuer> in message delivered to AssertionConsumerService.');
	}

	$idpMetadata = $metadataHandler->getMetaDataConfig($idp, 'saml20-idp-remote');

	/* Fetch the request information if it exists, fall back to RelayState if not. */
	$requestId = $response->getInResponseTo();
	$info = $session->getData('SAML2:SP:SSO:Info', $requestId);
	if($info === NULL) {
		/* Fall back to RelayState. */
		$info = array();
		$info['RelayState'] = $response->getRelayState();
		if(empty($info['RelayState'])) {
			$info['RelayState'] = $spMetadata->getString('RelayState', NULL);
		}
		if(empty($info['RelayState'])) {
			/* RelayState missing. */
			throw new SimpleSAML_Error_Error('NORELAYSTATE');
		}
	}

	try {
		$assertion = sspmod_saml_Message::processResponse($spMetadata, $idpMetadata, $response);
		if (count($assertion) > 1) {
			throw new SimpleSAML_Error_Exception('More than one assertion in received response.');
		}
		$assertion = $assertion[0];
	} catch (sspmod_saml_Error $e) {
		/* The status of the response wasn't "success". */

		$status = $response->getStatus();
		if(array_key_exists('OnError', $info)) {
			/* We have an error handler. Return the error to it. */
			SimpleSAML_Utilities::redirect($info['OnError'], array('StatusCode' => $status['Code']));
		}

		/* We don't have an error handler. Show an error page. */
		throw new SimpleSAML_Error_Error('RESPONSESTATUSNOSUCCESS', $e);
	}

	SimpleSAML_Logger::info('SAML2.0 - SP.AssertionConsumerService: Successful response from IdP');

	/*
	 * Attribute handling
	 */
	$attributes = $assertion->getAttributes();

	SimpleSAML_Logger::stats('saml20-sp-SSO ' . $metadataHandler->getMetaDataCurrentEntityID() . ' ' . $idp . ' NA');

	$nameId = $assertion->getNameId();

	/* Begin module attribute processing */

	$spMetadataArray = $spMetadata->toArray();
	$idpMetadataArray = $idpMetadata->toArray();

	$pc = new SimpleSAML_Auth_ProcessingChain($idpMetadataArray, $spMetadataArray, 'sp');

	$authProcState = array(
		'core:saml20-sp:NameID' => $nameId,
		'core:saml20-sp:SessionIndex' => $assertion->getSessionIndex(),
		'core:saml20-sp:TargetURL' => $info['RelayState'],
		'ReturnURL' => SimpleSAML_Utilities::selfURLNoQuery(),
		'Attributes' => $attributes,
		'Destination' => $spMetadataArray,
		'Source' => $idpMetadataArray,
	);

	$pc->processState($authProcState);
	/* Since this function returns, processing has completed and attributes have
	 * been updated.
	 */

	finishLogin($authProcState);

} catch(Exception $exception) {
	throw new SimpleSAML_Error_Error('PROCESSASSERTION', $exception);
}

?>


text:
class Spree::Slide < ActiveRecord::Base

  has_attached_file :image
  validates_attachment :image, content_type: { content_type: ["image/jpg", "image/jpeg", "image/png", "image/gif"] }
  scope :published, -> { where(published: true).order('position ASC') }

  belongs_to :product, touch: true

  def initialize(attrs = nil)
    attrs ||= {:published => true}
    super
  end

  def slide_name
    name.blank? && product.present? ? product.name : name
  end

  def slide_link
    link_url.blank? && product.present? ? product : link_url
  end

  def slide_image
    !image.file? && product.present? && product.images.any? ? product.images.first.attachment : image
  end
end


text:
/// <reference path="../N.js" />

/**
* SuiteScript module
*
* @module N/runtime
* @suiteScriptVersion 2.x
*
*/

'use strict';

N.runtime = {};

N.runtime.module = function () {

    /**
    * Get the current log in user object
    * @return {N.runtime.objects.User}
    */
    this.getCurrentUser = function (options) {
        return new N.runtime.objects.User();
    };

    /**
    * Get the current executing Script object
    * @return {N.runtime.objects.Script}
    */
    this.getCurrentScript = function (options) {
        return new N.runtime.objects.Script();
    };

    /**
    * Get the current session object
    * @return {N.runtime.objects.Session}
    */
    this.getCurrentSession = function (options) {
        return new N.runtime.objects.Session();
    };

    /**
    * Check if a feature is turned on and in effect
    * @param {Object} options
    * @param { string } options.feature id of the feature
    * @return {boolean}
    */
    this.isFeatureInEffect = function (options) { };

    /**
    * @name runtime#queueCount
    * @type number
    * @readonly
    * @since 2015.2
    */
    this.queueCount = undefined;

    /**
    * @name runtime#version
    * @type string
    * @readonly
    * @since 2015.2
    */
    this.version = undefined;

    /**
    * @name runtime#accountId
    * @type string
    * @readonly
    * @since 2015.2
    */
    this.accountId = undefined;

    /**
    * @name runtime#envType
    * @type string
    * @readonly
    * @since 2015.2
    */
    this.envType = undefined;

    /**
    * @name runtime#executionContext
    * @type string
    * @readonly
    * @since 2015.2
    */
    this.executionContext = undefined;

    /**
    * get JSON format of the object
    * @return {Object}
    *
    */
    this.toJSON = function (options) { };

    /**
    * @return {string}
    *
    */
    this.toString = function (options) { };

    /**
    * @enum
    */
    function RuntimeEnvType() {
        this.SANDBOX = 'SANDBOX';
        this.PRODUCTION = 'PRODUCTION';
        this.BETA = 'BETA';
        this.INTERNAL = 'INTERNAL';
    }
    this.EnvType = new RuntimeEnvType();

    /**
        * @enum
        */
    function RuntimeContextType() {
        this.USER_INTERFACE = 'USERINTERFACE';
        this.WEBSERVICES = 'WEBSERVICES';
        this.WEBSTORE = 'WEBSTORE';
        this.PORTLET = 'PORTLET';
        this.SCHEDULED = 'SCHEDULED';
        this.SUITELET = 'SUITELET';
        this.CSV_IMPORT = 'CSVIMPORT';
        this.CUSTOM_MASSUPDATE = 'CUSTOMMASSUPDATE';
        this.WORKFLOW = 'WORKFLOW';
        this.USEREVENT = 'USEREVENT';
        this.OFFLINE_CLIENT = 'OFFLINECLIENT';
        this.ACTION = 'ACTION';
        this.DEBUGGER = 'DEBUGGER';
        this.CLIENT = 'CLIENT';
        this.SYSTEM = 'SYSTEM';
        this.BUNDLE_INSTALLATION = 'BUNDLE_INSTALLATION';
        this.RESTLET = 'RESTLET';
        this.WEBAPPLICATION = 'WEBAPPLICATION';
        this.APPPKG_INSTALL = 'APPPKGINSTALL';
        this.PAYMENTGATEWAY = 'PAYMENTGATEWAY';
        this.CONSOLRATEADJUSTOR = 'CONSOLRATEADJUSTOR';
        this.TESTPLUGIN = 'TESTPLUGIN';
        this.PROMOTIONS = 'PROMOTIONS';
        this.CUSTOMGLLINES = 'CUSTOMGLLINES';
        this.TAX_CALCULATION = 'TAXCALCULATION';
        this.SHIPPING_PARTNERS = 'SHIPPINGPARTNERS';
        this.EMAIL_CAPTURE = 'EMAILCAPTURE';
    }

    this.ContextType = new RuntimeContextType();

    /**
    * @enum
    */
    function RuntimePermission() {
        this.FULL = 4.0;
        this.EDIT = 3.0;
        this.CREATE = 2.0;
        this.VIEW = 1.0;
        this.NONE = 0.0;
    }
    this.Permission = new RuntimePermission();
};

N.runtime.objects = (function () {
    /**
    * @protected
    * @constructor
    */
    function Script() {
        /**
        * Current script log level
        * @name Script#logLevel
        * @type string
        * @readonly
        * @since 2015.2
        */
        this.logLevel = undefined;

        /**
        * Current script id
        * @name Script#id
        * @type string
        * @readonly
        * @since 2015.2
        */
        this.id = undefined;

        /**
        * Current script runtime version
        * @name Script#apiVersion
        * @type string
        * @readonly
        * @since 2015.2
        */
        this.apiVersion = undefined;

        /**
        * Percentage complete specified for the current scheduled script execution
        * @name Script#percentComplete
        * @type number
        * @throws {error.SuiteScriptError} SSS_OPERATION_UNAVAILABLE
        * @since 2015.2
        */
        this.percentComplete = undefined;

        /**
        * The deploymentId for the current script deployment
        * @name Script#deploymentId
        * @type string
        * @readonly
        * @since 2015.2
        */

        this.deploymentId = undefined;
        /**
        * The bundle IDs the current script belongs to
        * @name Script#bundleIds
        * @type array
        * @readonly
        * @since 2015.2
        */
        this.bundleIds = undefined;

        /**
        * Returns the remaining amount of unit usage for the current script
        * @return {number}
        *
        */
        this.getRemainingUsage = function (options) { };

        /**
        * Returns script parameter value which is defined per script
        *
        * @param {Object} options
        * @param { string } options.name The name of the parameter
        * @return {number|Date|string|Array}
        *
        */
        this.getParameter = function (options) { };

        /**
        * get JSON format of the object
        * @return {string}
        *
        */
        this.toJSON = function (options) { };

        /**
        * @return {string}
        *
        */
        this.toString = function (options) { };
    }

    /**
    * @protected
    * @constructor
    */
    function Session() {
        /**
        * Get the value of a user-defined session object for the current user.
        * @param {Object} options
        * @param { string } options.name The key used to store the session object
        * @return {string}
        *
        */
        this.get = function (options) { };

        /**
        * Add or set the value of a user-defined session object for the current user.
        * @param {Object} options
        * @param { string } options.name The key used to store the session object
        * @param { string } options.value The value to associate with this key in the user's session
        * @return {undefined}
        *
        */
        this.set = function (options) { };

        /**
        * get JSON format of the object
        * @return {string}
        *
        */
        this.toJSON = function (options) { };

        /**
        * @return {string}
        *
        */
        this.toString = function (options) { };
    }

    /**
    * @protected
    * @constructor
    */
    function User() {
        /**
        * Returns the currently logged in user's e-mail address
        * @name User#email
        * @type string
        * @readonly
        * @since 2015.2
        */
        this.email = undefined;

        /**
        * Returns the currently logged in user's name
        * @name User#name
        * @type string
        * @readonly
        * @since 2015.2
        */
        this.name = undefined;

        /**
        * Returns the internal ID of the currently logged in user's location
        * @name User#location
        * @type number
        * @readonly
        * @since 2015.2
        */
        this.location = undefined;

        /**
        * Returns the internal ID of the currently logged in user's department
        * @name User#department
        * @type number
        * @readonly
        * @since 2015.2
        */
        this.department = undefined;

        /**
        * Returns the internal ID of the currently logged in user's role
        * @name User#role
        * @type number
        * @readonly
        * @since 2015.2
        */
        this.role = undefined;

        /**
        * Returns the internal ID of the currently logged in user's center type (role center)
        * @name User#roleCenter  The string value of the logged in user's center - for example, SALES, ACCOUNTING, CLASSIC.
        * @type string
        * @readonly
        * @since 2015.2
        */
        this.roleCenter = undefined;

        /**
        * Returns the custom scriptId of the role (as opposed to the internal numerical ID).
        * @name User#roleId
        * @type string
        * @readonly
        * @since 2015.2
        */
        this.roleId = undefined;

        /**
        * Returns the currently logged in user's internal ID
        * @name User#id
        * @type number
        * @readonly
        * @since 2015.2
        */
        this.id = undefined;

        /**
        * Returns the internal ID of the currently logged in user's subsidiary
        * @name User#subsidiary
        * @type number
        * @readonly
        * @since 2015.2
        */
        this.subsidiary = undefined;

        /**
        * Get a user's permission level for a given permission
        * @param {Object} options
        * @param { string } options.name The internal ID of a permission
        * @return {number} one value of the Permission
        *
        */
        this.getPermission = function (options) { };

        /**
        * Get the value of a NetSuite preference
        * @param {Object} options
        * @param { string } name The internal ID of the preference
        * @return {string} The value of a system or script preference for the current user
        *
        */
        this.getPreference = function (options) { };

        /**
        * get JSON format of the object
        * @return {string}
        *
        */
        this.toJSON = function (options) { };

        /**
        * @return {string}
        *
        */
        this.toString = function (options) { };
    }

    return {
        Script: Script,
        Session: Session,
        User: User
    };
})();

define([], function () {
    return new N.runtime.module();
});


text:
layout: page
title: Twin Swift Motors Dinner
date: 2016-05-24
author: Hannah Arroyo
tags: weekly links, java
status: published
summary: Donec id imperdiet dui. Quisque varius turpis.
banner: images/banner/office-01.jpg
booking:
  startDate: 12/24/2016
  endDate: 12/26/2016
  ctyhocn: BALAMHX
  groupCode: TSMD
published: true
---
Phasellus vel vestibulum lacus, quis commodo orci. Proin suscipit ipsum et orci mattis aliquam. Quisque et dictum lorem. Vestibulum tincidunt mollis justo, a lobortis lacus pretium at. Duis imperdiet diam eget rhoncus pulvinar. Maecenas tincidunt lorem consequat, tempor odio eget, porta eros. Aenean varius massa et sapien lacinia molestie id at arcu. Nulla sit amet hendrerit quam. Donec gravida mauris nec cursus rutrum.

1 Morbi non augue eu enim hendrerit pretium in sed erat
1 Nulla sit amet odio dictum, fermentum erat in, ullamcorper magna
1 Ut non risus eu nisl placerat mollis vel sit amet elit
1 In gravida nisi at tortor faucibus tristique
1 Ut sollicitudin ipsum vel mi iaculis pretium sit amet vel felis.

Suspendisse quis tortor nec metus sollicitudin sollicitudin. Integer vitae placerat ligula. Mauris tincidunt lacus risus, eget dignissim ex volutpat vitae. Vivamus sodales sapien ut enim tristique, quis porttitor felis tincidunt. Ut sed tempor urna, in semper velit. Praesent ac mattis justo. Phasellus a ligula orci. Proin finibus dolor finibus euismod efficitur. Phasellus a nisl fermentum, lobortis ante vitae, suscipit metus. Suspendisse sollicitudin urna id neque ultrices ultricies. Fusce pulvinar condimentum ex. Sed fringilla cursus mauris, vel volutpat leo semper vitae.
Nunc molestie ante vitae justo viverra aliquam. Mauris id volutpat velit, id blandit justo. In ac elit ipsum. Donec felis mi, aliquet in erat quis, euismod sagittis nisl. Aliquam congue velit ac fringilla malesuada. Etiam porta lorem facilisis turpis pellentesque scelerisque. Quisque id elementum justo, non viverra neque. Nunc non ipsum ex. Nullam maximus euismod porttitor. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Praesent tincidunt risus sed placerat efficitur. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. In euismod mi dui, et fringilla purus viverra quis. Aenean et mollis ipsum. Donec vitae dolor a elit ultricies elementum.


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Ophiobolus persolinus var. persolinus (Caldesi & De Not.) Sacc.

### Remarks
null


text:
package hugolib

import (
	"strings"
	"testing"

	"github.com/spf13/viper"
)

func TestSitePossibleTaxonomies(t *testing.T) {
	site := new(Site)
	page, _ := NewPageFrom(strings.NewReader(pageYamlWithTaxonomiesA), "path/to/page")
	site.Pages = append(site.Pages, page)
	taxonomies := site.possibleTaxonomies()
	if !compareStringSlice(taxonomies, []string{"tags", "categories"}) {
		if !compareStringSlice(taxonomies, []string{"categories", "tags"}) {
			t.Fatalf("possible taxonomies do not match [tags categories].  Got: %s", taxonomies)
		}
	}
}

func TestByCountOrderOfTaxonomies(t *testing.T) {
	viper.Reset()
	defer viper.Reset()

	taxonomies := make(map[string]string)

	taxonomies["tag"] = "tags"
	taxonomies["category"] = "categories"

	viper.Set("taxonomies", taxonomies)

	site := new(Site)
	page, _ := NewPageFrom(strings.NewReader(pageYamlWithTaxonomiesA), "path/to/page")
	site.Pages = append(site.Pages, page)
	site.assembleTaxonomies()

	st := make([]string, 0)
	for _, t := range site.Taxonomies["tags"].ByCount() {
		st = append(st, t.Name)
	}

	if !compareStringSlice(st, []string{"a", "b", "c"}) {
		t.Fatalf("ordered taxonomies do not match [a, b, c].  Got: %s", st)
	}
}


text:
'use strict';

var callbacks = {
  main: function (api) {

    return   {
      nodes: function (res, operationId, nodeType, locales, template, nodeId, inQueryParam) {

        return {
          api: function (error, responseBodyFromNeo) {
            var basePath = '/' + api.tags[0].name + '/' + nodeType + (nodeType.endsWith('s') ? '' : 's');
            var idPathTemplate = '/{id}';

            var responseObjectToSwagger = {};
            var nodes = [];

            switch (operationId){
              case api.paths[basePath].get.operationId:
                nodes = [];
                nodes = callbacks.utils.readBulk(error, responseBodyFromNeo);
                responseObjectToSwagger[nodeType] = nodes;
                break;
              case api.paths[basePath + idPathTemplate].delete.operationId:
                responseObjectToSwagger.nodes_deleted = responseBodyFromNeo.results[0].stats.nodes_deleted;
                break;
              default:
                responseObjectToSwagger[nodeType] = responseBodyFromNeo.results[0].data[0].row[0];
            }

            return res.json(responseObjectToSwagger);
          },

          web: function (error, responseBodyFromNeo) {
            var basePath = '/{locale}/' + nodeType + (nodeType.endsWith('s') ? '' : 's');
            var idPathTemplate = '/{id}';

            var responseObjectToSwagger = {
              locale: locales.locale,
              localesMenu: locales.localesMenu,
              localesCommands: locales.localesCommands,
              localesStrings: locales.localesStrings,
              id: typeof nodeId === 'undefined' ? -1 : parseInt(nodeId),
            };
            var nodes = [];

            switch (operationId){
              case api.paths[basePath + '/create'].post.operationId:
                responseObjectToSwagger.slogan = responseObjectToSwagger.localesStrings['New <Instance> created'];
                responseObjectToSwagger[nodeType] = responseBodyFromNeo.results[0].data[0].row[0];
                var url = '/' + locales.locale + '/' +nodeType + 's/read/' + responseBodyFromNeo.results[0].data[0].row[1];

                return res.redirect(url);
              case api.paths[basePath].get.operationId:
                nodes = [];
                nodes = callbacks.utils.readBulkGraph(error, responseBodyFromNeo);
                responseObjectToSwagger[nodeType] = nodes;
                responseObjectToSwagger.inQueryParam = inQueryParam;
                break;
              case api.paths[basePath + '/read' + idPathTemplate].get.operationId:
                responseObjectToSwagger.slogan = responseObjectToSwagger.localesStrings['<Instance>'];
                responseObjectToSwagger[nodeType] = responseBodyFromNeo.results[0].data[0].row[0];
                break;
              case api.paths[basePath + '/update' + idPathTemplate].post.operationId:
                responseObjectToSwagger.slogan = responseObjectToSwagger.localesStrings['<Instance> updated'];
                responseObjectToSwagger[nodeType] = responseBodyFromNeo.results[0].data[0].row[0];
                break;
              case api.paths[basePath + '/delete' + idPathTemplate].post.operationId:
                responseObjectToSwagger.nodes_deleted = responseBodyFromNeo.results[0].stats.nodes_deleted;

                return res.json(responseObjectToSwagger);
              default:
                responseObjectToSwagger[nodeType] = responseBodyFromNeo.results[0].data[0].row[0];
            }

            return res.render(template, responseObjectToSwagger);
          },

          search: {
            api: function (error, responseBodyFromNeo) {
              var basePath = '/' + api.tags[0].name + '/' + nodeType + (nodeType.endsWith('s') ? '' : 's') + '/search';

              var responseObjectToSwagger = {};
              var nodes = [];

              switch (operationId){
                case api.paths[basePath + '/distinctProperties'].get.operationId:
                  // responseObjectToSwagger.distinctValues = responseBodyFromNeo.results[0].data[0].row[0];
                  responseObjectToSwagger.columns = responseBodyFromNeo.results[0].columns;
                  responseObjectToSwagger.data = responseBodyFromNeo.results[0].data;
                  break;
                default:
                  responseObjectToSwagger.columns = responseBodyFromNeo.results[0].columns;
                  responseObjectToSwagger.data = responseBodyFromNeo.results[0].data;
              }
              return res.json(responseObjectToSwagger);
            },
          },
        };
      },

      graph: function (res, operationId, type, locales, template, nodeId, subType, relationshipTypes, searchParam) {

        return {
          api: function (error, responseBodyFromNeo) {
            var basePath = '/' + api.tags[0].name + '/' + type;
            var idPathTemplate = '/{id}';

            var responseObjectToSwagger = {};

            switch (operationId) {
              case api.paths[basePath].get.operationId:
              case api.paths[basePath + '/readGraphOfMovie' + idPathTemplate].get.operationId:
              case api.paths[basePath + '/readGraphOfPerson' + idPathTemplate].get.operationId:
                responseObjectToSwagger.graph = callbacks.utils.nodeLinks(error, responseBodyFromNeo);
                break;
              default:
                // responseObjectToSwagger.graph = callbacks.utils.nodeLinks(error, responseBodyFromNeo);
                responseObjectToSwagger.columns = responseBodyFromNeo.results[0].columns;
                responseObjectToSwagger.data = responseBodyFromNeo.results[0].data;
            }

            return res.json(responseObjectToSwagger);
          },

          web: function (error, responseBodyFromNeo) {
            var basePath = '/{locale}'

            var responseObjectToSwagger = {
              locale: locales.locale,
              localesMenu: locales.localesMenu,
              localesCommands: locales.localesCommands,
              localesStrings: locales.localesStrings,
              id: typeof nodeId === 'undefined' ? -1 : parseInt(nodeId),
            };
            var nodes = [];

            switch (operationId){
              case api.paths[basePath].get.operationId:
                nodes = [];
                nodes = callbacks.utils.readBulkGraph(error, responseBodyFromNeo);
                responseObjectToSwagger[subType] = nodes;
                break;
              default:
                nodes = callbacks.utils.readBulkGraph(error, responseBodyFromNeo);
                responseObjectToSwagger[subType] = nodes;
            }

            return res.render(template, responseObjectToSwagger);
          },

          relationships: {
            api: function (error, responseBodyFromNeo) {
              var basePath = '/' + api.tags[0].name + '/' + type + '/' + subType;

              var responseObjectToSwagger = {};

              switch (operationId) {
                case api.paths[basePath +'/readAllPaginated'].get.operationId:
                  responseObjectToSwagger.columns = responseBodyFromNeo.results[0].columns;
                  responseObjectToSwagger.data = responseBodyFromNeo.results[0].data;
                default:
                  responseObjectToSwagger.columns = responseBodyFromNeo.results[0].columns;
                  responseObjectToSwagger.data = responseBodyFromNeo.results[0].data;
              }

              return res.json(responseObjectToSwagger);
            },

            web: function (error, responseBodyFromNeo) {
              var basePath = '/{locale}/' + type + '/' + subType;
              var idPathTemplate = '/{id}';

              var responseObjectToSwagger = {
                locale: locales.locale,
                localesMenu: locales.localesMenu,
                localesCommands: locales.localesCommands,
                localesStrings: locales.localesStrings,
                id: typeof nodeId === 'undefined' ? -1 : parseInt(nodeId),
              };

              switch (operationId) {
                case api.paths[basePath + '/create'].get.operationId:
                  responseObjectToSwagger.persons = responseBodyFromNeo[0].body.data;
                  responseObjectToSwagger.relationships = relationshipTypes;
                  responseObjectToSwagger.movies = responseBodyFromNeo[1].body.data;
                  break;
                case api.paths[basePath + '/create'].post.operationId:
                  responseObjectToSwagger.slogan = responseObjectToSwagger.localesStrings['New Relationship created'];
                  responseObjectToSwagger.relationship = responseBodyFromNeo.results[0].data[0];
                  var url = '/' + locales.locale + '/graph/' + subType + '/read/' + responseBodyFromNeo.results[0].data[0].row[2];

                  return res.redirect(url);
                case api.paths[basePath + '/read' + idPathTemplate].get.operationId:
                  responseObjectToSwagger.slogan = responseObjectToSwagger.localesStrings['Relationship'];
                  responseObjectToSwagger.relationship = responseBodyFromNeo.results[0].data[0].row;
                  break;
                case api.paths[basePath + '/update' + idPathTemplate].get.operationId:
                  responseObjectToSwagger.relationship = responseBodyFromNeo.results[0].data[0].row;
                  break;
                case api.paths[basePath + '/update' + idPathTemplate].post.operationId:
                  responseObjectToSwagger.slogan = responseObjectToSwagger.localesStrings['Relationship updated'];
                  responseObjectToSwagger.relationship = responseBodyFromNeo.results[0].data[0].row;
                  break;
                case api.paths[basePath + '/delete' + idPathTemplate].post.operationId:
                  responseObjectToSwagger.relationship_deleted = responseBodyFromNeo.results[0].stats.relationship_deleted;

                  return res.json(responseObjectToSwagger);
                default:
                  responseObjectToSwagger.relationship = responseBodyFromNeo.results[0].data[0];
              }

              return res.render(template, responseObjectToSwagger);
            },
          },

          search: {
            api: function (error, responseBodyFromNeo) {
              var basePath = '/' + api.tags[0].name + '/' + type;
              var idPathTemplate = '/{id}';

              var responseObjectToSwagger = {};

              switch (operationId) {
                // case '...':
                //   break;
                default:
                  responseObjectToSwagger.columns = responseBodyFromNeo.results[0].columns;
                  responseObjectToSwagger.data = responseBodyFromNeo.results[0].data;
              }

              return res.json(responseObjectToSwagger);
            },

            web: function (error, responseBodyFromNeo) {
              var basePath = '/{locale}/' + type + '/' + subType;

              var responseObjectToSwagger = {
                locale: locales.locale,
                localesMenu: locales.localesMenu,
                localesCommands: locales.localesCommands,
                localesStrings: locales.localesStrings,
                id: typeof nodeId === 'undefined' ? -1 : parseInt(nodeId),
                searchParam: searchParam,
                message: "No Results found."
              };

              switch (operationId) {
                case api.paths[basePath + '/searchField'].get.operationId:
                  responseObjectToSwagger.graph = responseBodyFromNeo.results[0].data;
                  break;
                default:
                  responseObjectToSwagger.graph = responseBodyFromNeo.results[0].data;
              }

              return res.render(template, responseObjectToSwagger);
            },
          },
        };
      },
    };
  },
  utils: {
    readBulk: function(error, responseBodyFromNeo) {
      var dataFromNeo4j = [];
      var dataToSwagger = [];

      dataFromNeo4j = responseBodyFromNeo.results[0].data;
      dataFromNeo4j.map(function(element, index) {
        dataToSwagger[index] = element.row[0];
      });

      return dataToSwagger;
    },

    readBulkGraph: function(error, responseBodyFromNeo) {
      var dataFromNeo4j = [];
      var dataToSwagger = [];

      dataFromNeo4j = responseBodyFromNeo.results[0].data;
      dataFromNeo4j.map(function(element, index) {
        dataToSwagger[index] = element.graph.nodes[0];
      });

      return dataToSwagger;
    },

    idIndex: function(array, id) {
      for (var i = 0; i < array.length; i++) {
        if (array[i].id === id) {
          return i;
        }
      }

      return null;
    },

    nodeLinks: function(error, response) {
      var nodes = [];
      var links = [];

      response.results[0].data.forEach(function(row) {

        row.graph.nodes.forEach(function(n) {
          if (callbacks.utils.idIndex(nodes, n.id) === null) {
            if (n.labels[0] === 'Movie') {
              nodes.push({
                id: n.id,
                label: n.labels[0],
                title: n.properties.title,
                tagline: n.properties.tagline,
                released: n.properties.released,
              });
            }

            if (n.labels[0] === 'Person') {
              nodes.push({
                id: n.id,
                label: n.labels[0],
                name: n.properties.name,
                born: n.properties.born,
              });
            }
          }
        });

        links = links.concat(row.graph.relationships.map(function(r) {

          return {
            id: r.id,
            source: callbacks.utils.idIndex(nodes, r.startNode),
            target: callbacks.utils.idIndex(nodes, r.endNode),
            value: r.type,
          };
        }));
      });

      return { nodes:nodes, links:links };
    },
  },
};

module.exports = callbacks.main;


text:
from threading import RLock
from Tally import Tally

class Stats:
    clientRequestsTally = Tally()
    clientTimeWaitedTally = Tally()
    usedMemoryTally = Tally()
    _reconstructedFilesTally = Tally()
    lostSwitchMessagesTally = Tally()

    def __init__(self):
        self._clientRequestsTmpTally = Tally()
        self._clientTimeWaitedTmpTally = Tally()
        self._usedMemoryTmpTally = Tally()
        self._reconstructedFiles = 0
        self._lostSwitchMessages = 0

    def clientRequestsAvg(self):
        return self._clientRequestsTmpTally.mean()

    def clientRequestsTotalAvg(self):
        return Stats.clientRequestsTally.mean()

    def addClientRequests(self, n):
        Stats.clientRequestsTally.observe(n)
        self._clientRequestsTmpTally.observe(n)

    def clientTimeWaitedAvg(self):
        return self._clientTimeWaitedTmpTally.mean()

    def clientTimeWaitedTotalAvg(self):
        return Stats.clientTimeWaitedTally.mean()

    def addClientTimeWaited(self, t):
        Stats.clientTimeWaitedTally.observe(t)
        self._clientTimeWaitedTmpTally.observe(t)

    def usedMemoryAvg(self):
        return int(self._usedMemoryTmpTally.mean())

    def usedMemoryTotalAvg(self):
        mem = int(Stats.usedMemoryTally.mean())
        Stats.usedMemoryTally.reset()
        return mem

    def addUsedMemory(self, m):
        Stats.usedMemoryTally.observe(m)
        self._usedMemoryTmpTally.observe(m)

    def reconstructedFiles(self):
    	return self._reconstructedFiles

    def lostSwitchMessages(self):
        return self._lostSwitchMessages

    def reconstructedFilesAvg(self):
    	return Stats._reconstructedFilesTally.mean()

    def lostSwitchMessagesAvg(self):
        return Stats.lostSwitchMessagesTally.mean()

    def fileReconstructed(self):
        self._reconstructedFiles += 1

    def messageLost(self):
        self._lostSwitchMessages += 1

    # Called when each simulation has ended.
    def tmpReset(self):
        Stats._reconstructedFilesTally.observe(self._reconstructedFiles)
        Stats.lostSwitchMessagesTally.observe(self._lostSwitchMessages)

    # Called when all simulations have ended.
    def reset(self):
        Stats.clientRequestsTally.reset()
        Stats.clientTimeWaitedTally.reset()
        Stats._reconstructedFilesTally.reset()
        Stats.lostSwitchMessagesTally.reset()


text:
body{

    background: url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/399710/white_gray_abstract-2500x1927px.jpg) no-repeat;
background-position: 0 -10px;
    background-attachment: fixed;
    background-size: cover;
}

.wrapper {

  width: 400px;
  margin: 0 auto;
  margin-top: 100px;

}
.top {

    border-bottom:4px solid #2185d0;
    padding: 10px;
    background-color: #fff;
}
.top .header {

    padding-top: 10px;

}
.top .button {

    margin: 3px;
    margin-top: 15px;

}

body {

  background-color: #999;

}

                       Semantic UI: Layout - Item View

Simple & elegant layout components using Semantic UI.

                    More Components...

                    Docs


text:
using FluentAssertions;
using NUnit.Framework;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Nest.Tests.Integration.Cluster
{
	[TestFixture]
	public class StatsTest : IntegrationTests
	{
		[Test]
		public void ClusterStats()
		{
			var r = this.Client.ClusterStats();
			r.IsValid.Should().BeTrue();
			r.ClusterName.Should().NotBeNullOrEmpty();
			r.Status.Should().NotBeNullOrEmpty();
			r.Indices.Should().NotBeNull();
			r.Nodes.Should().NotBeNull();
		}
	}
}


text:
package com.healthmarketscience.jackcess.impl.expr;

import java.math.BigDecimal;
import java.time.DateTimeException;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.time.format.DateTimeFormatter;
import java.time.temporal.TemporalAccessor;
import java.util.AbstractMap;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.EnumMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;

import static com.healthmarketscience.jackcess.impl.expr.Expressionator.*;
import com.healthmarketscience.jackcess.expr.LocaleContext;
import com.healthmarketscience.jackcess.expr.ParseException;
import com.healthmarketscience.jackcess.expr.TemporalConfig;
import com.healthmarketscience.jackcess.expr.Value;
import com.healthmarketscience.jackcess.impl.ColumnImpl;
import org.apache.commons.lang3.StringUtils;

/**
 *
 * @author James Ahlborn
 */
class ExpressionTokenizer
{
  private static final int EOF = -1;
  static final char QUOTED_STR_CHAR = '"';
  private static final char SINGLE_QUOTED_STR_CHAR = '\'';
  private static final char OBJ_NAME_START_CHAR = '[';
  private static final char OBJ_NAME_END_CHAR = ']';
  private static final char DATE_LIT_QUOTE_CHAR = '#';
  private static final char EQUALS_CHAR = '=';

  private static final byte IS_OP_FLAG =     0x01;
  private static final byte IS_COMP_FLAG =   0x02;
  private static final byte IS_DELIM_FLAG =  0x04;
  private static final byte IS_SPACE_FLAG =  0x08;
  private static final byte IS_QUOTE_FLAG =  0x10;

  enum TokenType {
    OBJ_NAME, LITERAL, OP, DELIM, STRING, SPACE;
  }

  private static final byte[] CHAR_FLAGS = new byte[128];
  private static final Set<String> TWO_CHAR_COMP_OPS = new HashSet<String>(
      Arrays.asList("<=", ">=", "<>"));

  static {
    setCharFlag(IS_OP_FLAG, '+', '-', '*', '/', '\\', '^', '&');
    setCharFlag(IS_COMP_FLAG, '<', '>', '=');
    setCharFlag(IS_DELIM_FLAG, '.', '!', ',', '(', ')');
    setCharFlag(IS_SPACE_FLAG, ' ', '\n', '\r', '\t');
    setCharFlag(IS_QUOTE_FLAG, '"', '#', '[', ']', '\'');
  }

  private ExpressionTokenizer() {}

  /**
   * Tokenizes an expression string of the given type and (optionally) in the
   * context of the relevant database.
   */
  static List<Token> tokenize(Type exprType, String exprStr,
                              ParseContext context) {

    if(exprStr != null) {
      exprStr = exprStr.trim();
    }

    if(StringUtils.isEmpty(exprStr)) {
      return null;
    }

    List<Token> tokens = new ArrayList<Token>();

    ExprBuf buf = new ExprBuf(exprStr, context);

    while(buf.hasNext()) {
      char c = buf.next();

      byte charFlag = getCharFlag(c);
      if(charFlag != 0) {

        // what could it be?
        switch(charFlag) {
        case IS_OP_FLAG:

          // all simple operator chars are single character operators
          tokens.add(new Token(TokenType.OP, String.valueOf(c)));
          break;

        case IS_COMP_FLAG:

          // special case for default values
          if((exprType == Type.DEFAULT_VALUE) && (c == EQUALS_CHAR) &&
             (buf.prevPos() == 0)) {
            // a leading equals sign indicates how a default value should be
            // evaluated
            tokens.add(new Token(TokenType.OP, String.valueOf(c)));
            continue;
          }

          tokens.add(new Token(TokenType.OP, parseCompOp(c, buf)));
          break;

        case IS_DELIM_FLAG:

          // all delimiter chars are single character symbols
          tokens.add(new Token(TokenType.DELIM, String.valueOf(c)));
          break;

        case IS_SPACE_FLAG:

          // normalize whitespace into single space
          consumeWhitespace(buf);
          tokens.add(new Token(TokenType.SPACE, " "));
          break;

        case IS_QUOTE_FLAG:

          switch(c) {
          case QUOTED_STR_CHAR:
          case SINGLE_QUOTED_STR_CHAR:
            tokens.add(new Token(TokenType.LITERAL, null,
                                 parseQuotedString(buf, c), Value.Type.STRING));
            break;
          case DATE_LIT_QUOTE_CHAR:
            tokens.add(parseDateLiteral(buf));
            break;
          case OBJ_NAME_START_CHAR:
            tokens.add(new Token(TokenType.OBJ_NAME, parseObjNameString(buf)));
            break;
          default:
            throw new ParseException(
                "Invalid leading quote character " + c + " " + buf);
          }

          break;

        default:
          throw new RuntimeException("unknown char flag " + charFlag);
        }

      } else {

        if(isDigit(c)) {
          Token numLit = maybeParseNumberLiteral(c, buf);
          if(numLit != null) {
            tokens.add(numLit);
            continue;
          }
        }

        // standalone word of some sort
        String str = parseBareString(c, buf, exprType);
        tokens.add(new Token(TokenType.STRING, str));
      }

    }

    return tokens;
  }

  private static byte getCharFlag(char c) {
    return ((c < 128) ? CHAR_FLAGS[c] : 0);
  }

  private static boolean isSpecialChar(char c) {
    return (getCharFlag(c) != 0);
  }

  private static String parseCompOp(char firstChar, ExprBuf buf) {
    String opStr = String.valueOf(firstChar);

    int c = buf.peekNext();
    if((c != EOF) && hasFlag(getCharFlag((char)c), IS_COMP_FLAG)) {

      // is the combo a valid comparison operator?
      String tmpStr = opStr + (char)c;
      if(TWO_CHAR_COMP_OPS.contains(tmpStr)) {
        opStr = tmpStr;
        buf.next();
      }
    }

    return opStr;
  }

  private static void consumeWhitespace(ExprBuf buf) {
    int c = EOF;
    while(((c = buf.peekNext()) != EOF) &&
          hasFlag(getCharFlag((char)c), IS_SPACE_FLAG)) {
        buf.next();
    }
  }

  private static String parseBareString(char firstChar, ExprBuf buf,
                                        Type exprType) {
    StringBuilder sb = buf.getScratchBuffer().append(firstChar);

    byte stopFlags = (IS_OP_FLAG | IS_DELIM_FLAG | IS_SPACE_FLAG);
    if(exprType == Type.FIELD_VALIDATOR) {
      stopFlags |= IS_COMP_FLAG;
    }

    while(buf.hasNext()) {
      char c = buf.next();
      byte charFlag = getCharFlag(c);
      if(hasFlag(charFlag, stopFlags)) {
        buf.popPrev();
        break;
      }
      sb.append(c);
    }

    return sb.toString();
  }

  private static String parseQuotedString(ExprBuf buf, char quoteChar) {
    return parseStringUntil(buf, null, quoteChar, true);
  }

  private static String parseObjNameString(ExprBuf buf) {
    return parseStringUntil(buf, OBJ_NAME_START_CHAR, OBJ_NAME_END_CHAR, false);
  }

  private static String parseDateLiteralString(ExprBuf buf) {
    return parseStringUntil(buf, null, DATE_LIT_QUOTE_CHAR, false);
  }

  static String parseStringUntil(ExprBuf buf, Character startChar,
                                 char endChar, boolean allowDoubledEscape)
  {
    return parseStringUntil(buf, startChar, endChar, allowDoubledEscape,
                            buf.getScratchBuffer())
      .toString();
  }

  static StringBuilder parseStringUntil(
      ExprBuf buf, Character startChar, char endChar, boolean allowDoubledEscape,
      StringBuilder sb)
  {
    boolean complete = false;
    while(buf.hasNext()) {
      char c = buf.next();
      if(c == endChar) {
        if(allowDoubledEscape && (buf.peekNext() == endChar)) {
          buf.next();
        } else {
          complete = true;
          break;
        }
      } else if((startChar != null) &&
                (startChar == c)) {
        throw new ParseException("Missing closing '" + endChar +
                                 "' for quoted string " + buf);
      }

      sb.append(c);
    }

    if(!complete) {
      throw new ParseException("Missing closing '" + endChar +
                               "' for quoted string " + buf);
    }

    return sb;
  }

  private static Token parseDateLiteral(ExprBuf buf)
  {
    String dateStr = parseDateLiteralString(buf);

    TemporalConfig.Type type = determineDateType(
        dateStr, buf.getContext());
    if(type == null) {
      throw new ParseException("Invalid date/time literal " + dateStr +
                               " " + buf);
    }

    // note that although we may parse in the time "24" format, we will
    // display as the default time format
    DateTimeFormatter parseDf = buf.getParseDateTimeFormat(type);

    try {
      TemporalAccessor parsedInfo = parseDf.parse(dateStr);

      LocalDate ld = ColumnImpl.BASE_LD;
      if(type.includesDate()) {
        ld = LocalDate.from(parsedInfo);
      }

      LocalTime lt = ColumnImpl.BASE_LT;
      if(type.includesTime()) {
        lt = LocalTime.from(parsedInfo);
      }

      return new Token(TokenType.LITERAL, LocalDateTime.of(ld, lt),
                       dateStr, type.getValueType());
    } catch(DateTimeException de) {
      throw new ParseException(
          "Invalid date/time literal " + dateStr + " " + buf, de);
    }
  }

  static TemporalConfig.Type determineDateType(
      String dateStr, LocaleContext ctx)
  {
    TemporalConfig cfg = ctx.getTemporalConfig();
    boolean hasDate = (dateStr.indexOf(cfg.getDateSeparator()) >= 0);
    boolean hasTime = (dateStr.indexOf(cfg.getTimeSeparator()) >= 0);
    boolean hasAmPm = false;

    if(hasTime) {
      String[] amPmStrs = cfg.getAmPmStrings();
      String amStr = " " + amPmStrs[0];
      String pmStr = " " + amPmStrs[1];
      hasAmPm = (hasSuffix(dateStr, amStr) || hasSuffix(dateStr, pmStr));
    }

    if(hasDate) {
      if(hasTime) {
        return (hasAmPm ? TemporalConfig.Type.DATE_TIME_12 :
                TemporalConfig.Type.DATE_TIME_24);
      }
      return TemporalConfig.Type.DATE;
    } else if(hasTime) {
      return (hasAmPm ? TemporalConfig.Type.TIME_12 :
              TemporalConfig.Type.TIME_24);
    }
    return null;
  }

  private static boolean hasSuffix(String str, String suffStr) {
    int strLen = str.length();
    int suffStrLen = suffStr.length();
    return ((strLen >= suffStrLen) &&
            str.regionMatches(true, strLen - suffStrLen,
                              suffStr, 0, suffStrLen));
  }

  private static Token maybeParseNumberLiteral(char firstChar, ExprBuf buf) {
    StringBuilder sb = buf.getScratchBuffer().append(firstChar);
    boolean hasDigit = isDigit(firstChar);

    int startPos = buf.curPos();
    boolean foundNum = false;
    boolean isFp = false;
    int expPos = -1;

    try {

      int c = EOF;
      while((c = buf.peekNext()) != EOF) {
        if(isDigit(c)) {
          hasDigit = true;
          sb.append((char)c);
          buf.next();
        } else if(c == '.') {
          isFp = true;
          sb.append((char)c);
          buf.next();
        } else if(hasDigit && (expPos < 0) && ((c == 'e') || (c == 'E'))) {
          isFp = true;
          sb.append((char)c);
          expPos = sb.length();
          buf.next();
        } else if((expPos == sb.length()) && ((c == '-') || (c == '+'))) {
          sb.append((char)c);
          buf.next();
        } else if(isSpecialChar((char)c)) {
          break;
        } else {
          // found a non-number, non-special string
          return null;
        }
      }

      if(!hasDigit) {
        // no digits, no number
        return null;
      }

      String numStr = sb.toString();
      try {
        Number num = null;
        Value.Type numType = null;

        if(!isFp) {
          try {
            // try to parse as int.  if that fails, fall back to BigDecimal
            // (this will handle the case of int overflow)
            num = Integer.valueOf(numStr);
            numType = Value.Type.LONG;
          } catch(NumberFormatException ne) {
            // fallback to decimal
          }
        }

        if(num == null) {
          num = new BigDecimal(numStr);
          numType = Value.Type.BIG_DEC;
        }

        foundNum = true;
        return new Token(TokenType.LITERAL, num, numStr, numType);
      } catch(NumberFormatException ne) {
        throw new ParseException(
            "Invalid number literal " + numStr + " " + buf, ne);
      }

    } finally {
      if(!foundNum) {
        buf.reset(startPos);
      }
    }
  }

  private static boolean hasFlag(byte charFlag, byte flag) {
    return ((charFlag & flag) != 0);
  }

  private static void setCharFlag(byte flag, char... chars) {
    for(char c : chars) {
      CHAR_FLAGS[c] |= flag;
    }
  }

  private static boolean isDigit(int c) {
    return ((c >= '0') && (c <= '9'));
  }

  static <K,V> Map.Entry<K,V> newEntry(K a, V b) {
    return new AbstractMap.SimpleImmutableEntry<K,V>(a, b);
  }

  static final class ExprBuf
  {
    private final String _str;
    private final ParseContext _ctx;
    private int _pos;
    private final Map<TemporalConfig.Type,DateTimeFormatter> _dateTimeFmts =
      new EnumMap<TemporalConfig.Type,DateTimeFormatter>(
          TemporalConfig.Type.class);
    private final StringBuilder _scratch = new StringBuilder();

    ExprBuf(String str, ParseContext ctx) {
      _str = str;
      _ctx = ctx;
    }

    private int len() {
      return _str.length();
    }

    public int curPos() {
      return _pos;
    }

    public int prevPos() {
      return _pos - 1;
    }

    public boolean hasNext() {
      return _pos < len();
    }

    public char next() {
      return _str.charAt(_pos++);
    }

    public void popPrev() {
      --_pos;
    }

    public int peekNext() {
      if(!hasNext()) {
        return EOF;
      }
      return _str.charAt(_pos);
    }

    public void reset(int pos) {
      _pos = pos;
    }

    public StringBuilder getScratchBuffer() {
      _scratch.setLength(0);
      return _scratch;
    }

    public ParseContext getContext() {
      return _ctx;
    }

    public DateTimeFormatter getParseDateTimeFormat(TemporalConfig.Type type) {
      DateTimeFormatter df = _dateTimeFmts.get(type);
      if(df == null) {
        df = _ctx.createDateFormatter(
            _ctx.getTemporalConfig().getDateTimeFormat(type));
        _dateTimeFmts.put(type, df);
      }
      return df;
    }

    @Override
    public String toString() {
      return "[char " + _pos + "] '" + _str + "'";
    }
  }

  static final class Token
  {
    private final TokenType _type;
    private final Object _val;
    private final String _valStr;
    private final Value.Type _valType;

    private Token(TokenType type, String val) {
      this(type, val, val);
    }

    private Token(TokenType type, Object val, String valStr) {
      this(type, val, valStr, null);
    }

    private Token(TokenType type, Object val, String valStr, Value.Type valType) {
      _type = type;
      _val = ((val != null) ? val : valStr);
      _valStr = valStr;
      _valType = valType;
    }

    public TokenType getType() {
      return _type;
    }

    public Object getValue() {
      return _val;
    }

    public String getValueStr() {
      return _valStr;
    }

    public Value.Type getValueType() {
      return _valType;
    }

    @Override
    public String toString() {
      if(_type == TokenType.SPACE) {
        return "' '";
      }
      String str = "[" + _type + "] '" + _val + "'";
      if(_valType != null) {
        str += " (" + _valType + ")";
      }
      return str;
    }
  }

}


text:
<?php
Yii::setAlias('@common', dirname(__DIR__));
Yii::setAlias('@frontend', dirname(dirname(__DIR__)) . '/frontend');
Yii::setAlias('@backend', dirname(dirname(__DIR__)) . '/backend');
Yii::setAlias('@console', dirname(dirname(__DIR__)) . '/console');

Yii::setAlias('@static', dirname(dirname(__DIR__)) . (YII_ENV_DEV ? '/static' : '/static_dist'));


text:
package s3

import (
	"flag"
	"log"
	"strings"
	"testing"

	"camlistore.org/pkg/blob"
	"camlistore.org/pkg/blobserver"
	"camlistore.org/pkg/blobserver/storagetest"
	"camlistore.org/pkg/context"
	"camlistore.org/pkg/jsonconfig"
)

var (
	key    = flag.String("s3_key", "", "AWS access Key ID")
	secret = flag.String("s3_secret", "", "AWS access secret")
	bucket = flag.String("s3_bucket", "", "Bucket name to use for testing. If empty, testing is skipped. If non-empty, it must begin with 'camlistore-' and end in '-test' and have zero items in it.")
)

func TestS3(t *testing.T) {
	if *bucket == "" || *key == "" || *secret == "" {
		t.Skip("Skipping test because at least one of -s3_key, -s3_secret, or -s3_bucket flags has not been provided.")
	}
	if !strings.HasPrefix(*bucket, "camlistore-") || !strings.HasSuffix(*bucket, "-test") {
		t.Fatalf("bogus bucket name %q; must begin with 'camlistore-' and end in '-test'", *bucket)
	}
	storagetest.Test(t, func(t *testing.T) (sto blobserver.Storage, cleanup func()) {
		sto, err := newFromConfig(nil, jsonconfig.Obj{
			"aws_access_key":        *key,
			"aws_secret_access_key": *secret,
			"bucket":                *bucket,
		})
		if err != nil {
			t.Fatalf("newFromConfig error: %v", err)
		}
		if !testing.Short() {
			log.Printf("Warning: this test does many serial operations. Without the go test -short flag, this test will be very slow.")
		}
		clearBucket := func() {
			var all []blob.Ref
			blobserver.EnumerateAll(context.New(), sto, func(sb blob.SizedRef) error {
				t.Logf("Deleting: %v", sb.Ref)
				all = append(all, sb.Ref)
				return nil
			})
			if err := sto.RemoveBlobs(all); err != nil {
				t.Fatalf("Error removing blobs during cleanup: %v", err)
			}
		}
		clearBucket()
		return sto, clearBucket
	})
}

func TestNextStr(t *testing.T) {
	tests := []struct {
		s, want string
	}{
		{"", ""},
		{"abc", "abd"},
		{"ab\xff", "ac\x00"},
		{"a\xff\xff", "b\x00\x00"},
		{"sha1-da39a3ee5e6b4b0d3255bfef95601890afd80709", "sha1-da39a3ee5e6b4b0d3255bfef95601890afd8070:"},
	}
	for _, tt := range tests {
		if got := nextStr(tt.s); got != tt.want {
			t.Errorf("nextStr(%q) = %q; want %q", tt.s, got, tt.want)
		}
	}
}


text:
from __future__ import unicode_literals
from ..utils import SurfaceTransform

def test_SurfaceTransform_inputs():
    input_map = dict(args=dict(argstr='%s',
    ),
    environ=dict(nohash=True,
    usedefault=True,
    ),
    hemi=dict(argstr='--hemi %s',
    mandatory=True,
    ),
    ignore_exception=dict(nohash=True,
    usedefault=True,
    ),
    out_file=dict(argstr='--tval %s',
    genfile=True,
    ),
    reshape=dict(argstr='--reshape',
    ),
    reshape_factor=dict(argstr='--reshape-factor',
    ),
    source_annot_file=dict(argstr='--sval-annot %s',
    mandatory=True,
    xor=['source_file'],
    ),
    source_file=dict(argstr='--sval %s',
    mandatory=True,
    xor=['source_annot_file'],
    ),
    source_subject=dict(argstr='--srcsubject %s',
    mandatory=True,
    ),
    source_type=dict(argstr='--sfmt %s',
    requires=['source_file'],
    ),
    subjects_dir=dict(),
    target_ico_order=dict(argstr='--trgicoorder %d',
    ),
    target_subject=dict(argstr='--trgsubject %s',
    mandatory=True,
    ),
    target_type=dict(argstr='--tfmt %s',
    ),
    terminal_output=dict(deprecated='1.0.0',
    nohash=True,
    ),
    )
    inputs = SurfaceTransform.input_spec()

    for key, metadata in list(input_map.items()):
        for metakey, value in list(metadata.items()):
            assert getattr(inputs.traits()[key], metakey) == value

def test_SurfaceTransform_outputs():
    output_map = dict(out_file=dict(),
    )
    outputs = SurfaceTransform.output_spec()

    for key, metadata in list(output_map.items()):
        for metakey, value in list(metadata.items()):
            assert getattr(outputs.traits()[key], metakey) == value


text:
- defaults, strict options
#0.0.3 (03/04/2012)
- aug(true, {}, {}) to do deep augment
#0.0.2
- made augmenting functions more generic. (don't assume aug prototype)
#0.0.1
- initial release


text:
using pb = global::Google.Protobuf;
using pbc = global::Google.Protobuf.Collections;
using pbr = global::Google.Protobuf.Reflection;
using scg = global::System.Collections.Generic;
/// Holder for reflection information generated from NavSatFix.proto
public static partial class NavSatFixReflection {

  #region Descriptor
  /// File descriptor for NavSatFix.proto
  public static pbr::FileDescriptor Descriptor {
    get { return descriptor; }
  }
  private static pbr::FileDescriptor descriptor;

  static NavSatFixReflection() {
    byte[] descriptorData = global::System.Convert.FromBase64String(
        string.Concat(
          "Cg9OYXZTYXRGaXgucHJvdG8aDEhlYWRlci5wcm90bxoSTmF2U2F0U3RhdHVz",
          "LnByb3RvInoKCU5hdlNhdEZpeBIXCgZoZWFkZXIYASABKAsyBy5IZWFkZXIS",
          "EAoIbGF0aXR1ZGUYAiABKAESEQoJbG9uZ2l0dWRlGAMgASgBEhAKCGFsdGl0",
          "dWRlGAQgASgBEh0KBnN0YXR1cxgFIAEoCzINLk5hdlNhdFN0YXR1c2IGcHJv",
          "dG8z"));
    descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
        new pbr::FileDescriptor[] { global::HeaderReflection.Descriptor, global::NavSatStatusReflection.Descriptor, },
        new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] {
          new pbr::GeneratedClrTypeInfo(typeof(global::NavSatFix), global::NavSatFix.Parser, new[]{ "Header", "Latitude", "Longitude", "Altitude", "Status" }, null, null, null)
        }));
  }
  #endregion

}
#region Messages
public sealed partial class NavSatFix : pb::IMessage<NavSatFix> {
  private static readonly pb::MessageParser<NavSatFix> _parser = new pb::MessageParser<NavSatFix>(() => new NavSatFix());
  [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  public static pb::MessageParser<NavSatFix> Parser { get { return _parser; } }

  [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  public static pbr::MessageDescriptor Descriptor {
    get { return global::NavSatFixReflection.Descriptor.MessageTypes[0]; }
  }

  [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  pbr::MessageDescriptor pb::IMessage.Descriptor {
    get { return Descriptor; }
  }

  [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  public NavSatFix() {
    OnConstruction();
  }

  partial void OnConstruction();

  [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  public NavSatFix(NavSatFix other) : this() {
    Header = other.header_ != null ? other.Header.Clone() : null;
    latitude_ = other.latitude_;
    longitude_ = other.longitude_;
    altitude_ = other.altitude_;
    Status = other.status_ != null ? other.Status.Clone() : null;
  }

  [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  public NavSatFix Clone() {
    return new NavSatFix(this);
  }

  /// Field number for the "header" field.
  public const int HeaderFieldNumber = 1;
  private global::Header header_;
  [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  public global::Header Header {
    get { return header_; }
    set {
      header_ = value;
    }
  }

  /// Field number for the "latitude" field.
  public const int LatitudeFieldNumber = 2;
  private double latitude_;
  [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  public double Latitude {
    get { return latitude_; }
    set {
      latitude_ = value;
    }
  }

  /// Field number for the "longitude" field.
  public const int LongitudeFieldNumber = 3;
  private double longitude_;
  [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  public double Longitude {
    get { return longitude_; }
    set {
      longitude_ = value;
    }
  }

  /// Field number for the "altitude" field.
  public const int AltitudeFieldNumber = 4;
  private double altitude_;
  [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  public double Altitude {
    get { return altitude_; }
    set {
      altitude_ = value;
    }
  }

  /// Field number for the "status" field.
  public const int StatusFieldNumber = 5;
  private global::NavSatStatus status_;
  [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  public global::NavSatStatus Status {
    get { return status_; }
    set {
      status_ = value;
    }
  }

  [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  public override bool Equals(object other) {
    return Equals(other as NavSatFix);
  }

  [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  public bool Equals(NavSatFix other) {
    if (ReferenceEquals(other, null)) {
      return false;
    }
    if (ReferenceEquals(other, this)) {
      return true;
    }
    if (!object.Equals(Header, other.Header)) return false;
    if (Latitude != other.Latitude) return false;
    if (Longitude != other.Longitude) return false;
    if (Altitude != other.Altitude) return false;
    if (!object.Equals(Status, other.Status)) return false;
    return true;
  }

  [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  public override int GetHashCode() {
    int hash = 1;
    if (header_ != null) hash ^= Header.GetHashCode();
    if (Latitude != 0D) hash ^= Latitude.GetHashCode();
    if (Longitude != 0D) hash ^= Longitude.GetHashCode();
    if (Altitude != 0D) hash ^= Altitude.GetHashCode();
    if (status_ != null) hash ^= Status.GetHashCode();
    return hash;
  }

  [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  public override string ToString() {
    return pb::JsonFormatter.ToDiagnosticString(this);
  }

  [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  public void WriteTo(pb::CodedOutputStream output) {
    if (header_ != null) {
      output.WriteRawTag(10);
      output.WriteMessage(Header);
    }
    if (Latitude != 0D) {
      output.WriteRawTag(17);
      output.WriteDouble(Latitude);
    }
    if (Longitude != 0D) {
      output.WriteRawTag(25);
      output.WriteDouble(Longitude);
    }
    if (Altitude != 0D) {
      output.WriteRawTag(33);
      output.WriteDouble(Altitude);
    }
    if (status_ != null) {
      output.WriteRawTag(42);
      output.WriteMessage(Status);
    }
  }

  [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  public int CalculateSize() {
    int size = 0;
    if (header_ != null) {
      size += 1 + pb::CodedOutputStream.ComputeMessageSize(Header);
    }
    if (Latitude != 0D) {
      size += 1 + 8;
    }
    if (Longitude != 0D) {
      size += 1 + 8;
    }
    if (Altitude != 0D) {
      size += 1 + 8;
    }
    if (status_ != null) {
      size += 1 + pb::CodedOutputStream.ComputeMessageSize(Status);
    }
    return size;
  }

  [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  public void MergeFrom(NavSatFix other) {
    if (other == null) {
      return;
    }
    if (other.header_ != null) {
      if (header_ == null) {
        header_ = new global::Header();
      }
      Header.MergeFrom(other.Header);
    }
    if (other.Latitude != 0D) {
      Latitude = other.Latitude;
    }
    if (other.Longitude != 0D) {
      Longitude = other.Longitude;
    }
    if (other.Altitude != 0D) {
      Altitude = other.Altitude;
    }
    if (other.status_ != null) {
      if (status_ == null) {
        status_ = new global::NavSatStatus();
      }
      Status.MergeFrom(other.Status);
    }
  }

  [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  public void MergeFrom(pb::CodedInputStream input) {
    uint tag;
    while ((tag = input.ReadTag()) != 0) {
      switch(tag) {
        default:
          input.SkipLastField();
          break;
        case 10: {
          if (header_ == null) {
            header_ = new global::Header();
          }
          input.ReadMessage(header_);
          break;
        }
        case 17: {
          Latitude = input.ReadDouble();
          break;
        }
        case 25: {
          Longitude = input.ReadDouble();
          break;
        }
        case 33: {
          Altitude = input.ReadDouble();
          break;
        }
        case 42: {
          if (status_ == null) {
            status_ = new global::NavSatStatus();
          }
          input.ReadMessage(status_);
          break;
        }
      }
    }
  }

}

#endregion

#endregion Designer generated code


text:
<?xml version="1.0" encoding="utf-8"?>
<resources>

    <string name="app_name">Shaped image samples</string>

</resources>


text:
alter table WikiPage add minorEdit bool;

commit;

update WikiPage set minorEdit = false;


text:
@implementation FFTLRUCache

- (id)initWithInt:(int)maxEntries {
  if (self = [super initWithInt:8 withFloat:.75f withBoolean:YES]) {
    removedListeners_ = [[JavaUtilArrayList alloc] init];
    self->maxEntries_ = maxEntries;
  }
  return self;
}

- (BOOL)removeEldestEntryWithJavaUtilMap_Entry:(id<JavaUtilMap_Entry>)eldest {
  BOOL shouldRemove = [self size] > maxEntries_;
  if (shouldRemove) {
    for (id<FFTLRUCache_RemovedListener> __strong l in nil_chk(removedListeners_)) {
      [((id<FFTLRUCache_RemovedListener>) nil_chk(l)) entryWasRemovedWithId:[((id<JavaUtilMap_Entry>) nil_chk(eldest)) getKey] withId:[eldest getValue]];
    }
  }
  return [self size] > maxEntries_;
}

- (void)addRemovedListenerWithFFTLRUCache_RemovedListener:(id<FFTLRUCache_RemovedListener>)listener {
  [((JavaUtilArrayList *) nil_chk(removedListeners_)) addWithId:listener];
}

- (void)copyAllFieldsTo:(FFTLRUCache *)other {
  [super copyAllFieldsTo:other];
  other->maxEntries_ = maxEntries_;
  other->removedListeners_ = removedListeners_;
}

+ (J2ObjcClassInfo *)__metadata {
  static J2ObjcMethodInfo methods[] = {
    { "initWithInt:", "LRUCache", NULL, 0x1, NULL },
    { "removeEldestEntryWithJavaUtilMap_Entry:", "removeEldestEntry", "Z", 0x4, NULL },
    { "addRemovedListenerWithFFTLRUCache_RemovedListener:", "addRemovedListener", "V", 0x1, NULL },
  };
  static J2ObjcFieldInfo fields[] = {
    { "maxEntries_", NULL, 0x12, "I", NULL,  },
    { "removedListeners_", NULL, 0x0, "Ljava.util.ArrayList;", NULL,  },
  };
  static const char *superclass_type_args[] = {"TK;", "TV;"};
  static J2ObjcClassInfo _FFTLRUCache = { "LRUCache", "com.sponberg.fluid.util", NULL, 0x1, 3, methods, 2, fields, 2, superclass_type_args};
  return &_FFTLRUCache;
}

@end

@interface FFTLRUCache_RemovedListener : NSObject
@end

@implementation FFTLRUCache_RemovedListener

+ (J2ObjcClassInfo *)__metadata {
  static J2ObjcMethodInfo methods[] = {
    { "entryWasRemovedWithId:withId:", "entryWasRemoved", "V", 0x401, NULL },
  };
  static J2ObjcClassInfo _FFTLRUCache_RemovedListener = { "RemovedListener", "com.sponberg.fluid.util", "LRUCache", 0x209, 1, methods, 0, NULL, 0, NULL};
  return &_FFTLRUCache_RemovedListener;
}

@end


text:
 package pro.foundev.commons.test_support

import scala.collection.mutable
import com.datastax.driver.core.Cluster
import com.datastax.driver.core.Session
import org.scalatest._

trait CassandraSupport extends BeforeAndAfterEach {
 this: Suite =>

  var cluster: Cluster = _
  var session: Session = _
  val keyspaces: mutable.ArrayBuffer[String] = mutable.ArrayBuffer.empty[String]

  override def beforeEach(): Unit = {
    cluster = Cluster.builder()
           .addContactPoint("127.0.0.1")
                    .build()
    session = cluster.newSession
    super.beforeEach
  }

  override def afterEach(): Unit = {
    keyspaces.foreach(keyspace => cql("DROP KEYSPACE IF EXISTS " + keyspace ))
    if(cluster != null){
      cluster.close
    }
    super.afterEach
  }

  def makeTable(table:String, columns: Seq[Tuple2[String, String]], pk: String): Unit = {
    val colString: String = columns.map(x=>x._1 + " " + x._2).mkString(",")
    cql("CREATE TABLE " + table + " ( " + colString + ", PRIMARY KEY(" + pk + "))")
  }
  def makeKeyspace(keyspace:String):Unit = {
    //horrible race condition waiting to happen
    cql("DROP KEYSPACE IF EXISTS " + keyspace   )
    cql("CREATE KEYSPACE IF NOT EXISTS " + keyspace + " WITH REPLICATION = { 'class':'SimpleStrategy', 'replication_factor':1 } ")
    keyspaces += keyspace
  }
  def cql(cql:String):Unit = {
    session.execute(cql)
  }

 }


text:
require "Scripts Common/tables"
require "Scripts Common/slaves"
require "Scripts STM32F103/functions"
require "Scripts STM32F103/commands"

OpenCnx("COM1",Uart["speed"]);
ScenarioBegin("Read operational parameters test set")

    TestCaseBegin("readOperationalParameter nominal case")

        SetUByteInTxBuffer(0, AddressPC[1])
        SetUByteInTxBuffer(1, AddressPC[2])
        SetUByteInTxBuffer(2, AddressSTM32[1])
        SetUByteInTxBuffer(3, AddressSTM32[2])
        SetUShortInTxBuffer(4, ProtocolID)  -- Protocol ID
        SetUShortInTxBuffer(6, 0)  -- Frame number
        SetULongInTxBuffer(8, 0)   -- Size
        SetUByteInTxBuffer(12, Cmd["readOperationalParameter"]) -- Message protocol
        SendFrame(13)

        ret, size, ts = ReceiveFrame(1000)
        ret8, val8 = GetULongInRxBuffer(8)
        ret12, val12 = GetUByteInRxBuffer(12)
        ret6, val6 = GetUShortInRxBuffer(6)

        VerifyThat(ret == 0 and val12 == 1 and  val8 == 2, "readOperationalParameter format valid")
        VerifyThat(val6 == 0, "readOperationalParameter frame number = 0")

        WaitMs(100)
    TestCaseEnd()
ScenarioEnd()
CloseCnx();


text:
class PopulateUserFields < ActiveRecord::Migration
  def up
    User.find_each do |u|
      cuds = u.course_user_data

      school = nil
      major = nil
      year = nil

      cuds.find_each do |cud|
        school ||= cud.school
        major ||= cud.school
        year ||= cud.year
      end

      u.school = school
      u.major = major
      u.year = year
    end

    change_table :course_user_data do |cud|
      cud.rename :major, :major_backup
      cud.rename :school, :school_backup
      cud.rename :year, :year_backup
    end
  end

  def down
    change_table :course_user_data do |cud|
      cud.rename :major_backup, :major
      cud.rename :school_backup, :school
      cud.rename :year_backup, :year
    end
  end
end