text:
<?php
/**
 * Class Minify_HTML
 * @package Minify
 */

/**
 * Compress HTML
 *
 * This is a heavy regex-based removal of whitespace, unnecessary comments and
 * tokens. IE conditional comments are preserved. There are also options to have
 * STYLE and SCRIPT blocks compressed by callback functions.
 *
 * A test suite is available.
 *
 * @package Minify
 * @author Stephen Clay <steve@mrclay.org>
 */
class Minify_HTML
{
    /**
     * @var boolean
     */
    protected $_jsCleanComments = true;

    /**
     * "Minify" an HTML page
     *
     * @param string $html
     *
     * @param array $options
     *
     * 'cssMinifier' : (optional) callback function to process content of STYLE
     * elements.
     *
     * 'jsMinifier' : (optional) callback function to process content of SCRIPT
     * elements. Note: the type attribute is ignored.
     *
     * 'xhtml' : (optional boolean) should content be treated as XHTML1.0? If
     * unset, minify will sniff for an XHTML doctype.
     *
     * @return string
     */
    public static function minify($html, $options = array())
    {
        $min = new self($html, $options);

        return $min->process();
    }

    /**
     * Create a minifier object
     *
     * @param string $html
     *
     * @param array $options
     *
     * 'cssMinifier' : (optional) callback function to process content of STYLE
     * elements.
     *
     * 'jsMinifier' : (optional) callback function to process content of SCRIPT
     * elements. Note: the type attribute is ignored.
     *
     * 'jsCleanComments' : (optional) whether to remove HTML comments beginning and end of script block
     *
     * 'xhtml' : (optional boolean) should content be treated as XHTML1.0? If
     * unset, minify will sniff for an XHTML doctype.
     */
    public function __construct($html, $options = array())
    {
        $this->_html = str_replace("\r\n", "\n", trim($html));
        if (isset($options['xhtml'])) {
            $this->_isXhtml = (bool)$options['xhtml'];
        }
        if (isset($options['cssMinifier'])) {
            $this->_cssMinifier = $options['cssMinifier'];
        }
        if (isset($options['jsMinifier'])) {
            $this->_jsMinifier = $options['jsMinifier'];
        }
        if (isset($options['jsCleanComments'])) {
            $this->_jsCleanComments = (bool)$options['jsCleanComments'];
        }
    }

    /**
     * Minify the markeup given in the constructor
     *
     * @return string
     */
    public function process()
    {
        if ($this->_isXhtml === null) {
            $this->_isXhtml = (false !== strpos($this->_html, '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML'));
        }

        $this->_replacementHash = 'MINIFYHTML' . md5($_SERVER['REQUEST_TIME']);
        $this->_placeholders = array();

        // replace SCRIPTs (and minify) with placeholders
        $this->_html = preg_replace_callback(
            '/(\\s*)<script(\\b[^>]*?>)([\\s\\S]*?)<\\/script>(\\s*)/i'
            ,array($this, '_removeScriptCB')
            ,$this->_html);

        // replace STYLEs (and minify) with placeholders
        $this->_html = preg_replace_callback(
            '/\\s*<style(\\b[^>]*>)([\\s\\S]*?)<\\/style>\\s*/i'
            ,array($this, '_removeStyleCB')
            ,$this->_html);

        // remove HTML comments (not containing IE conditional comments).
        $this->_html = preg_replace_callback(
            '/<!--([\\s\\S]*?)-->/'
            ,array($this, '_commentCB')
            ,$this->_html);

        // replace PREs with placeholders
        $this->_html = preg_replace_callback('/\\s*<pre(\\b[^>]*?>[\\s\\S]*?<\\/pre>)\\s*/i'
            ,array($this, '_removePreCB')
            ,$this->_html);

        // replace TEXTAREAs with placeholders
        $this->_html = preg_replace_callback(
            '/\\s*<textarea(\\b[^>]*?>[\\s\\S]*?<\\/textarea>)\\s*/i'
            ,array($this, '_removeTextareaCB')
            ,$this->_html);

        // trim each line.
        // @todo take into account attribute values that span multiple lines.
        $this->_html = preg_replace('/^\\s+|\\s+$/m', '', $this->_html);

        // remove ws around block/undisplayed elements
        $this->_html = preg_replace('/\\s+(<\\/?(?:area|article|aside|base(?:font)?|blockquote|body'
            .'|canvas|caption|center|col(?:group)?|dd|dir|div|dl|dt|fieldset|figcaption|figure|footer|form'
            .'|frame(?:set)?|h[1-6]|head|header|hgroup|hr|html|legend|li|link|main|map|menu|meta|nav'
            .'|ol|opt(?:group|ion)|output|p|param|section|t(?:able|body|head|d|h||r|foot|itle)'
            .'|ul|video)\\b[^>]*>)/i', '$1', $this->_html);

        // remove ws outside of all elements
        $this->_html = preg_replace_callback(
            '/>([^<]+)</'
            ,array($this, '_outsideTagCB')
            ,$this->_html);

        // fill placeholders
        $this->_html = str_replace(
            array_keys($this->_placeholders)
            ,array_values($this->_placeholders)
            ,$this->_html
        );
        // issue 229: multi-pass to catch scripts that didn't get replaced in textareas
        $this->_html = str_replace(
            array_keys($this->_placeholders)
            ,array_values($this->_placeholders)
            ,$this->_html
        );

        return $this->_html;
    }

    protected function _commentCB($m)
    {
        return (0 === strpos($m[1], '[') || false !== strpos($m[1], '<![') || 0 === strpos($m[1], 'esi') || 0 === strpos($m[1], 'noindex') || 0 === strpos($m[1], '/noindex') || 0 === strpos($m[1], 'start_content') || 0 === strpos($m[1], 'end_content'))
            ? $m[0]
            : '';
    }

    protected function _reservePlace($content)
    {
        $placeholder = '%' . $this->_replacementHash . count($this->_placeholders) . '%';
        $this->_placeholders[$placeholder] = $content;

        return $placeholder;
    }

    protected $_isXhtml = null;
    protected $_replacementHash = null;
    protected $_placeholders = array();
    protected $_cssMinifier = null;
    protected $_jsMinifier = null;

	protected function _outsideTagCB($m)
    {
       return '>' . preg_replace('/^\\s+|\\s+$/', ' ', $m[1]) . '<';
    }

    protected function _removePreCB($m)
    {
        return $this->_reservePlace("<pre{$m[1]}");
    }

    protected function _removeTextareaCB($m)
    {
        return $this->_reservePlace("<textarea{$m[1]}");
    }

    protected function _removeStyleCB($m)
    {
        $openStyle = "<style{$m[1]}";
        $css = $m[2];
        // remove HTML comments
        $css = preg_replace('/(?:^\\s*<!--|-->\\s*$)/u', '', $css);

        // remove CDATA section markers
        $data = $this->_removeCdata($css);

        // minify
        $minifier = $this->_cssMinifier
            ? $this->_cssMinifier
            : 'trim';
        $css = call_user_func($minifier, $data['content']);

        return $this->_reservePlace( $data['cdata']
            ? "{$openStyle}/* <![CDATA[ */ {$css} /* ]]> */</style>"
            : "{$openStyle}{$css}</style>"
        );
    }

    protected function _removeScriptCB($m)
    {
        $openScript = "<script{$m[2]}";
        $js = $m[3];

        // whitespace surrounding? preserve at least one space
        $ws1 = ($m[1] === '') ? '' : ' ';
        $ws2 = ($m[4] === '') ? '' : ' ';

        // remove HTML comments (and ending "//" if present)
        if ($this->_jsCleanComments) {
            $js = preg_replace('/(?:^\\s*<!--\\s*|\\s*(?:\\/\\/)?\\s*-->\\s*$)/u', '', $js);
        }

        // remove CDATA section markers
        $data = $this->_removeCdata($js);

        // minify
        $minifier = $this->_jsMinifier
            ? $this->_jsMinifier
            : 'trim';
        $js = call_user_func($minifier, $data['content']);

        return $this->_reservePlace($data['cdata']
            ? "{$ws1}{$openScript}/* <![CDATA[ */ {$js} /* ]]> */</script>{$ws2}"
            : "{$ws1}{$openScript}{$js}</script>{$ws2}"
        );
    }

    protected function _removeCdata($str)
    {
	   	$data = array();

	    if ( false !== strpos( $str, '<![CDATA[' ) ) {
		    $data['content'] = str_replace( array( '/* <![CDATA[ */', '/* ]]> */' ), '', $str );
		    $data['cdata']   = true;

	    } else {
		    $data['content'] = $str;
		    $data['cdata']   = false;
	    }

        return $data;
    }

}


text:
FROM node:6-alpine

RUN mkdir -p /var/www/app

WORKDIR /var/www/app

ADD package.json /var/www/app/package.json

RUN npm install

RUN npm install -g nodemon

ADD ./ /var/www/app

redpajama_set_name: RedPajamaGithub


text:
package configuration

type HAProxy struct {
	TemplatePath  string
	OutputPath    string
	ReloadCommand string
}


text:
#upgrade_bar {
    /* The filter creates a vertical background gradient that works in IE6-IE8 */
    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#f9c019', endColorstr='#ee4727', GradientType=0);
    position: relative;
    height: 42px;
    text-align: center;
}

#upgrade_bar div {
    display: inline-block;
    width: 920px;
    text-align: center;
    font-family: Arial, sans-serif;
    color: white;
    font-size: 14px;
}

#upgrade_bar div span {
    font-weight: bold;
    margin-right: 10px;
}

#upgrade_bar div img {
    margin: 0 10px;
    vertical-align: middle;
}

#upgrade_bar_link {
    display: block;
    height: 42px;
    position: relative;
    background: url('transparent_link_bg.png'); /* so the user can click anywhere on the empty link */
    margin-top: -42px;
    margin-bottom: 15px;
    text-decoration: none;
}


text:
<?cs
def:sdk_nav() ?>

<?cs
        include:"../../../../frameworks/base/docs/html/sdk/sdk_toc.cs" ?>

<?cs /def ?>
<?cs
def:resources_tab_nav() ?>

<?cs
        include:"../../../../frameworks/base/docs/html/resources/resources_toc.cs" ?>

<?cs /def ?>
<?cs
def:guide_nav() ?>

<?cs
        include:"../../../../vendor/pdk/data/google/docs/guide/guide_toc.cs" ?>

<?cs /def ?>
<?cs
def:design_nav() ?>
  <?cs include:"../../../../frameworks/base/docs/html/design/design_toc.cs" ?>
<?cs /def ?>

<?cs # The default side navigation for the reference docs ?><?cs
def:default_left_nav() ?>

<nobr>
                <a href="<?cs var:toroot ?>reference/packages.html" <?cs if:(page.title == "Package Index") ?>class="selected"<?cs /if ?> >Package Index |
                <a href="<?cs var:toroot ?>reference/classes.html" <?cs if:(page.title == "Class Index") ?>class="selected"<?cs /if ?>>Class Index</nobr>

              	<?cs call:package_link_list(docs.packages) ?>

<?cs
            if:subcount(class.package) ?>

              <?cs call:list("Interfaces", class.package.interfaces) ?>
              <?cs call:list("Classes", class.package.classes) ?>
              <?cs call:list("Enums", class.package.enums) ?>
              <?cs call:list("Exceptions", class.package.exceptions) ?>
              <?cs call:list("Errors", class.package.errors) ?>

<?cs
            elif:subcount(package) ?>

              <?cs call:class_link_list("Interfaces", package.interfaces) ?>
              <?cs call:class_link_list("Classes", package.classes) ?>
              <?cs call:class_link_list("Enums", package.enums) ?>
              <?cs call:class_link_list("Exceptions", package.exceptions) ?>
              <?cs call:class_link_list("Errors", package.errors) ?>

<?cs
            else ?>

Select a package to view its members
<?cs
            /if ?>

<nobr>
            <a href="<?cs var:toroot ?>reference/packages.html" <?cs if:(page.title == "Package Index") ?>class="selected"<?cs /if ?> >Package Index |
            <a href="<?cs var:toroot ?>reference/classes.html" <?cs if:(page.title == "Class Index") ?>class="selected"<?cs /if ?>>Class Index</nobr>

    <?cs
/def ?>

<?cs
def:custom_left_nav() ?><?cs
  if:guide ?><?cs
    call:guide_nav() ?><?cs
  elif:resources ?><?cs
    call:resources_tab_nav() ?><?cs
  elif:sdk ?><?cs
    call:sdk_nav() ?><?cs
  else ?><?cs
    call:default_left_nav() ?><?cs
  /if ?><?cs
/def ?>

<?cs # appears at the bottom of every page ?><?cs
def:custom_cc_copyright() ?>
  Except as noted, this content is
  licensed under
  Creative Commons Attribution 2.5. For details and
  restrictions, see the <a href="<?cs var:toroot ?>license.html">Content
  License.<?cs
/def ?>

<?cs
def:custom_copyright() ?>
  Except as noted, this content is licensed under Apache 2.0.
  For details and restrictions, see the <a href="<?cs var:toroot ?>license.html">
  Content License.<?cs
/def ?>

<?cs
def:custom_footerlinks() ?>

    Privacy & Terms -
    Brand Guidelines -
    Report Document Issues

<?cs
/def ?>

<?cs # appears on the right side of the blue bar at the bottom off every page ?><?cs
def:custom_buildinfo() ?>
  Android <?cs var:sdk.version ?> r<?cs var:sdk.rel.id ?> - <?cs var:page.now ?>
<?cs /def ?>


text:
+++
title = "Erro Duplicate identifiers for rows Usando Spread"
date = "2018-02-07 20:46:37"
categories = ["sopt"]
original_url = "https://pt.stackoverflow.com/q/275025"
at_home="no"
+++


text:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>com.github.bogdanlivadariu</groupId>
        <artifactId>bootstraped-multi-test-results-report-reactor-parent</artifactId>
        <version>2.2.2-SNAPSHOT</version>
    </parent>

    <artifactId>testng-reporting-handlebars</artifactId>
    <packaging>jar</packaging>
    <name>testng-reporting-handlebars</name>
    <description>Module used to generate TestNG reports using handlebars</description>
    <url>https://github.com/web-innovate/bootstraped-multi-test-results-report/tree/master/testng-reporting-handlebars
    </url>
    <licenses>
        <license>
            <name>MIT</name>
            <url>http://opensource.org/licenses/mit-license.php</url>
            <distribution>repo</distribution>
        </license>
    </licenses>
    <scm>
        <url>https://github.com/BogdanLivadariu/testng-reporting-handlebars.git</url>
        <tag>2.2.1</tag>
    </scm>
    <developers>
        <developer>
            <id>bogdanlivadariu</id>
            <name>Bogdan Livadariu</name>
            <email>bogdan.livadariu@gmail.com</email>
        </developer>
    </developers>
    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.target>11</maven.compiler.target>
        <maven.compiler.source>11</maven.compiler.source>
    </properties>
    <build>
        <plugins>
            <plugin>
                <artifactId>maven-assembly-plugin</artifactId>
                <configuration>
                    <archive>
                        <manifest>
                            <addClasspath>true</addClasspath>
                            <mainClass>com.github.bogdanlivadariu.reporting.testng.cli.TestNgReportBuilderCli
                            </mainClass>
                        </manifest>
                    </archive>
                    <descriptorRefs>
                        <descriptorRef>jar-with-dependencies</descriptorRef>
                    </descriptorRefs>
                </configuration>
                <executions>
                    <execution>
                        <id>make-my-jar-with-dependencies</id>
                        <phase>package</phase>
                        <goals>
                            <goal>single</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
    <dependencies>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-io</artifactId>
            <version>1.3.2</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>com.github.jknack</groupId>
            <artifactId>handlebars</artifactId>
            <version>${handlebars.version}</version>
            <exclusions>
                <exclusion>
                    <groupId>antlr</groupId>
                    <artifactId>antlr</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-core</artifactId>
            <version>${log4j-core.version}</version>
        </dependency>
        <dependency>
            <groupId>joda-time</groupId>
            <artifactId>joda-time</artifactId>
            <version>${joda-time.version}</version>
        </dependency>
        <dependency>
            <groupId>org.testng</groupId>
            <artifactId>testng</artifactId>
            <version>${testng.version}</version>
        </dependency>
        <!-- JAXB API only -->
        <dependency>
            <groupId>jakarta.xml.bind</groupId>
            <artifactId>jakarta.xml.bind-api</artifactId>
            <version>3.0.1</version>
        </dependency>

        <!-- JAXB RI, Jakarta XML Binding -->
        <dependency>
            <groupId>com.sun.xml.bind</groupId>
            <artifactId>jaxb-impl</artifactId>
            <version>3.0.1</version>
            <scope>runtime</scope>
        </dependency>

    </dependencies>
</project>


text:
package io.seata.serializer.protobuf.convertor;

import io.seata.serializer.protobuf.generated.HeartbeatMessageProto;
import io.seata.core.protocol.HeartbeatMessage;

/**
 * @author leizhiyuan
 */
public class HeartbeatMessageConvertor implements PbConvertor<HeartbeatMessage, HeartbeatMessageProto> {
    @Override
    public HeartbeatMessageProto convert2Proto(HeartbeatMessage heartbeatMessage) {
        HeartbeatMessageProto result = HeartbeatMessageProto.newBuilder().setPing(heartbeatMessage.isPing()).build();
        return result;
    }

    @Override
    public HeartbeatMessage convert2Model(HeartbeatMessageProto heartbeatMessageProto) {
        return heartbeatMessageProto.getPing() ? HeartbeatMessage.PING : HeartbeatMessage.PONG;
    }
}


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

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="48dp"
        android:background="#FFF">

        <LinearLayout
            android:id="@+id/ac_iv_press_back"
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:layout_gravity="center_vertical">

            <ImageView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center_vertical"
                android:layout_marginLeft="16dp"
                android:layout_marginRight="20dp"
                android:src="@drawable/black_back"/>
        </LinearLayout>

        <View
            android:layout_width="0.5dp"
            android:layout_height="20dp"
            android:layout_gravity="center"
            android:layout_marginBottom="6.5dp"
            android:layout_marginTop="6.5dp"
            android:background="#D9D9D9"
            />

        <EditText
            android:id="@+id/ac_et_search"
            style="?android:attr/textViewStyle"
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_marginLeft="8dp"
            android:layout_marginRight="8dp"
            android:layout_weight="1"
            android:background="@null"
            android:drawableLeft="@drawable/search1"
            android:drawablePadding="8dp"
            android:drawableRight="@drawable/search_cancel_icon"
            android:focusableInTouchMode="true"
            android:imeActionLabel=""
            android:imeOptions="actionSearch"
            android:inputType="number"
            android:maxLines="1"
            android:paddingRight="6dp"
            android:textColor="#000"
            android:textSize="16sp"/>

        <TextView
            android:id="@+id/tv_search"
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:background="@color/line_normal"
            android:gravity="center"
            android:paddingLeft="16dp"
            android:layout_marginTop="8dp"
            android:layout_marginBottom="8dp"
            android:paddingRight="16dp"
            android:layout_marginRight="5dp"
            android:text="搜索"
            android:textColor="#fff"
            android:textSize="14sp"/>
    </LinearLayout>

    <View
        android:layout_width="match_parent"
        android:layout_height="5dp"
        android:background="#E8EDF3"/>

    <LinearLayout
        android:id="@+id/ll_chatRoomItem"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        android:paddingBottom="8dp"
        android:paddingLeft="14dp"
        android:paddingRight="14dp"
        android:paddingTop="8dp"
        android:visibility="gone">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent">

            <ImageView
                android:id="@+id/iv_chatRoomAvatar"
                android:layout_width="47dp"
                android:layout_height="47dp"
                android:layout_gravity="center_vertical"
                android:src="@drawable/group"/>

            <RelativeLayout
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center_vertical"
                android:layout_marginStart="14dp"
                android:gravity="center_vertical">

                <TextView
                    android:id="@+id/tv_chatRoomName"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="聊天室名字"
                    android:ellipsize="end"
                    android:maxLines="1"
                    android:textColor="#2C2C2C"
                    android:textSize="16sp"/>

                <TextView
                    android:id="@+id/tv_chatRoomDesc"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_below="@id/tv_chatRoomName"
                    android:layout_marginTop="2dp"
                    android:ellipsize="end"
                    android:maxLines="1"
                    android:text="聊天室介绍"
                    android:textColor="#999999"
                    android:textSize="14sp"/>
            </RelativeLayout>
        </LinearLayout>

        <View
            android:layout_width="match_parent"
            android:layout_height="0.3dp"
            android:layout_marginTop="8dp"
            android:background="@color/gray"/>
    </LinearLayout>

</LinearLayout>


text:
@interface WHLoginForm: WHForm

@property (nonatomic, strong) NSString *user;
@property (nonatomic, strong) NSString *password;

@end


text:
package com.mood.jenaPlus;

import android.app.Activity;
import android.test.ActivityInstrumentationTestCase2;
import android.view.View;
import android.widget.EditText;
import android.widget.GridView;

import com.robotium.solo.Solo;

/**
 * Created by Carlo on 2017-03-12.
 */

public class AddMoodActivityTest extends ActivityInstrumentationTestCase2{

    public Solo solo;

    public AddMoodActivityTest() {
        super(com.mood.jenaPlus.WelcomeActivity.class);
    }

    public void testStart() throws Exception {
        Activity activity = getActivity();
    }

    public void setUp() throws Exception{
        solo = new Solo(getInstrumentation(),getActivity());
    }

    public void testAddBareMood() {
        solo.assertCurrentActivity("Wrong Activity", WelcomeActivity.class);
        solo.clearEditText((EditText) solo.getView(R.id.loginUserName));
        solo.enterText((EditText) solo.getView(R.id.loginUserName), "josefina");
        solo.clickOnButton("Log in");
        solo.assertCurrentActivity("Wrong Activity", MoodPlusActivity.class);

        solo.clickOnView((solo.getView(R.id.fab)));
        solo.assertCurrentActivity("Wrong Activity", AddMoodActivity.class);

        //clicking on the first mood: "Feeling Surprised" appears on the toast
        GridView gridview = (GridView)solo.getView(R.id.gridView);
        View element = gridview.getChildAt(0);
        solo.clickOnView(element);

        solo.clickOnView((solo.getView(R.id.AddButton)));
        solo.assertCurrentActivity("Wrong Activity", MoodPlusActivity.class);
        deleteTestMood();
    }

    public void testAddLocationMood() {

        solo.assertCurrentActivity("Wrong Activity", WelcomeActivity.class);
        solo.clearEditText((EditText) solo.getView(R.id.loginUserName));
        solo.enterText((EditText) solo.getView(R.id.loginUserName), "josefina");
        solo.clickOnButton("Log in");
        solo.assertCurrentActivity("Wrong Activity", MoodPlusActivity.class);

        solo.clickOnView((solo.getView(R.id.fab)));
        solo.assertCurrentActivity("Wrong Activity", AddMoodActivity.class);

        // clicking on the first mood: "Feeling Surprised" appears on the toast
        GridView gridview = (GridView)solo.getView(R.id.gridView);
        View element = gridview.getChildAt(0);
        solo.clickOnView(element);

        // Click the location button
        solo.clickOnView((solo.getView(R.id.action_navigation)));

        // Add mood and return to main activity.
        solo.clickOnView((solo.getView(R.id.AddButton)));
        solo.assertCurrentActivity("Wrong Activity", MoodPlusActivity.class);

        solo.clickInList(0);
        solo.assertCurrentActivity("Wrong Activity", ViewMoodActivity.class);

        // Click on the navigation button, view the mood, view the location, and go back to main
        solo.clickOnView((solo.getView(R.id.test_location)));
        solo.assertCurrentActivity("Wrong Activity", MapActivity.class);
        solo.goBack();
        solo.assertCurrentActivity("Wrong Activity", ViewMoodActivity.class);
        solo.goBack();
        solo.assertCurrentActivity("Wrong Activity", MoodPlusActivity.class);

        // Remove the test mood
        deleteTestMood();

    }

    public void testAddSocialSituationMood() {

        solo.assertCurrentActivity("Wrong Activity", WelcomeActivity.class);
        solo.clearEditText((EditText) solo.getView(R.id.loginUserName));
        solo.enterText((EditText) solo.getView(R.id.loginUserName), "josefina");
        solo.clickOnButton("Log in");
        solo.assertCurrentActivity("Wrong Activity", MoodPlusActivity.class);

        solo.clickOnView((solo.getView(R.id.fab)));
        solo.assertCurrentActivity("Wrong Activity", AddMoodActivity.class);

        // clicking on the first mood: "Feeling Surprised" appears on the toast
        GridView gridview = (GridView)solo.getView(R.id.gridView);
        View element = gridview.getChildAt(0);
        solo.clickOnView(element);

        solo.clickOnView((solo.getView(R.id.socialPopup)));
        solo.searchText("Alone");
        solo.clickOnText("Alone");

        solo.clickOnView((solo.getView(R.id.AddButton)));
        solo.assertCurrentActivity("Wrong Activity", MoodPlusActivity.class);
        deleteTestMood();

    }

    public void deleteTestMood() {

        solo.clickLongInList(0);
        solo.clickOnText("Delete");
        solo.clickOnText("Yes");
    }

}


text:
PROGRAM MAIN
    USE ISO_FORTRAN_ENV, ONLY : output_unit
    USE MPI
    IMPLICIT NONE
    INTEGER :: ncpu, my_rank, ierr

    CALL INIT_COMM()

    CALL SWAP_DOUBLE()

    CALL SWAP_INTEGER()

    CALL SWAP_MULTI_DOUBLE()

    CALL MPI_FINALIZE(ierr)

CONTAINS

    SUBROUTINE SWAP_DOUBLE()
        IMPLICIT NONE
        REAL*8 :: my_val, send_val
        INTEGER :: mtag1 = 3, mtag2 = 4, ierr
        INTEGER :: source, dest, ireq(2)
        INTEGER :: mstat(MPI_STATUS_SIZE, 2)
        my_val = my_rank
        !Swap the values of my_val between rank 0 and 1
        send_val = my_val

        IF (my_rank .eq. 0) THEN

            source = 1  ! receive from rank 1
            ! The "1" in the calls to receive and send indicates that we wish to transmit
            ! a single value of type MPI_DOUBLE_PRECISION (Real*8)
            WRITE(output_unit,*)' '
            WRITE(output_unit,*)'     Sending/Receiving one double-precision (8-byte) number...'
            WRITE(output_unit,'(a,F4.1)')'Rank 0;  pre-receive; my_val = ', my_val
            Call MPI_irecv(my_val, 1, MPI_DOUBLE_PRECISION, source, &
                mtag1, MPI_COMM_WORLD, ireq(1),ierr)

            !Once we have received, we send to rank 1
            dest = 1
            Call MPI_isend(send_val, 1, MPI_DOUBLE_PRECISION, dest, &
                mtag2, MPI_COMM_WORLD, ireq(2),ierr)
        ENDIF

        IF (my_rank .eq. 1) THEN ! highest rank does not send

            ! Mimic the logic used for rank 0, but send first and swap the tags
            dest = 0
            Call MPI_isend(send_val, 1, MPI_DOUBLE_PRECISION, dest, &
                mtag1, MPI_COMM_WORLD, ireq(1),ierr)

            source = 0
            WRITE(output_unit,'(a,F4.1)')'Rank 1;  pre-receive; my_val = ', my_val
            Call MPI_irecv(my_val, 1, MPI_DOUBLE_PRECISION, source, &
                mtag2, MPI_COMM_WORLD, ireq(2),ierr)

        ENDIF
        CALL MPI_Waitall(2, ireq, mstat, ierr)
        WRITE(output_unit,'(a,i0,a,F4.1)')'Rank ',my_rank,'; post-receive; my_val = ', my_val
        CALL MPI_BARRIER(MPI_COMM_WORLD,ierr)  ! Pause execution to give I/O time to catch up
    END SUBROUTINE SWAP_DOUBLE

    SUBROUTINE SWAP_INTEGER()
        IMPLICIT NONE
        INTEGER :: my_val, send_val
        INTEGER :: mtag1 = 3, mtag2 = 4, ierr
        INTEGER :: source, dest, ireq(2)
        INTEGER :: mstat(MPI_STATUS_SIZE, 2)
        my_val = my_rank
        !Swap the values of my_val between rank 0 and 1
        send_val = my_val

        IF (my_rank .eq. 0) THEN

            source = 1  ! receive from rank 1
            ! The "1" in the calls to receive and send indicates that we wish to transmit
            ! a single value of type MPI_DOUBLE_PRECISION (Real*8)
            WRITE(output_unit,*)' '
            WRITE(output_unit,*)'     Sending/Receiving one integer (4-byte) number...'
            WRITE(output_unit,'(a,i0)')'Rank 0;  pre-receive; my_val = ', my_val
            Call MPI_irecv(my_val, 1, MPI_INTEGER, source, &
                mtag1, MPI_COMM_WORLD, ireq(1),ierr)

            !Once we have received, we send to rank 1
            dest = 1
            Call MPI_isend(send_val, 1, MPI_INTEGER, dest, &
                mtag2, MPI_COMM_WORLD, ireq(2),ierr)
        ENDIF

        IF (my_rank .eq. 1) THEN ! highest rank does not send

            ! Mimic the logic used for rank 0, but send first and swap the tags
            dest = 0
            Call MPI_isend(send_val, 1, MPI_INTEGER, dest, &
                mtag1, MPI_COMM_WORLD, ireq(1),ierr)

            source = 0
            WRITE(output_unit,'(a,i0)')'Rank 1;  pre-receive; my_val = ', my_val
            Call MPI_irecv(my_val, 1, MPI_INTEGER, source, &
                mtag2, MPI_COMM_WORLD, ireq(2),ierr)

        ENDIF
        CALL MPI_Waitall(2, ireq, mstat, ierr)
        WRITE(output_unit,'(a,i0,a,i0)')'Rank ',my_rank,'; post-receive; my_val = ', my_val
        CALL MPI_BARRIER(MPI_COMM_WORLD,ierr)  ! Pause execution to give I/O time to catch up
    END SUBROUTINE SWAP_INTEGER

    SUBROUTINE SWAP_MULTI_DOUBLE()
        IMPLICIT NONE
        REAL*8 :: my_vals(1:4), send_buffer(1:2)
        INTEGER :: mtag1 = 3, mtag2 = 4, ierr
        INTEGER :: source, dest, ireq(2)
        INTEGER :: mstat(MPI_STATUS_SIZE, 2)
        my_vals(:) = my_rank
        !Swap the last two elements of my_vals between ranks 0 and 1
        send_buffer(1:2) = my_vals(3:4)

        IF (my_rank .eq. 0) THEN

            ! Receive from rank 1
            ! While we could receive into a separate receive buffer,
            ! we can also receive directly into the vals array.
            ! Note that this wouldn't work reliably if we did not first
            ! copy the elements we want to send into the send_buffer.

            !In this case, we look for a message containing two double-precision
            ! elements and store them in memory beginning at my_vals(3)
            !    -- had we not specified my_vals(3), and just my_vals, say,
            !       data received would be copied into memory beginning at my_vals(1).
            source = 1  ! receive from rank 1
            WRITE(output_unit,*)' '
            WRITE(output_unit,*)'     Sending/Receiving multiple double-precision numbers...'
            WRITE(output_unit,'(a,4F4.1)')'Rank 0;  pre-receive; my_vals = ', my_vals
            Call MPI_irecv(my_vals(3), 2, MPI_DOUBLE_PRECISION, source, &
                mtag1, MPI_COMM_WORLD, ireq(1),ierr)

            !Once we have received, we send to rank 1
            dest = 1
            Call MPI_isend(send_buffer, 2, MPI_DOUBLE_PRECISION, dest, &
                mtag2, MPI_COMM_WORLD, ireq(2),ierr)
        ENDIF
        IF (my_rank .eq. 1) THEN ! highest rank does not send

            ! Mimic the logic used for rank 0, but send first and swap the tags.
            ! Q:  What happens if we try to receive first?

            dest = 0
            Call MPI_isend(send_buffer, 2, MPI_DOUBLE_PRECISION, dest, &
                mtag1, MPI_COMM_WORLD, ireq(1),ierr)

            source = 0
            WRITE(output_unit,'(a,4F4.1)')'Rank 1;  pre-receive; my_vals = ', my_vals
            Call MPI_irecv(my_vals(3), 2, MPI_DOUBLE_PRECISION, source, &
                mtag2, MPI_COMM_WORLD, ireq(2),ierr)

        ENDIF
        CALL MPI_Waitall(2, ireq, mstat, ierr)
        WRITE(output_unit,'(a,i0,a,4F4.1)')'Rank ',my_rank,'; post-receive; my_val = ', my_vals
        CALL MPI_BARRIER(MPI_COMM_WORLD,ierr)  ! Pause execution to give I/O time to catch up
    END SUBROUTINE SWAP_MULTI_DOUBLE

    SUBROUTINE INIT_COMM()
        IMPLICIT NONE
        INTEGER :: ierr
        !Initialize MPI  (ierr is an error flag with nonzero value if there's a problem)
        Call MPI_INIT( ierr )
        IF (ierr .ne. 0) STOP 'Error intializing MPI'

        !Find number of MPI processes executing this program (ncpu)
        Call MPI_Comm_size(MPI_COMM_WORLD, ncpu,ierr)
        IF (ierr .ne. 0) STOP 'Error finding ncpu'

        !Find this process's rank (my_rank; unique numeric identifier for each MPI process)
        Call MPI_Comm_rank(MPI_COMM_WORLD, my_rank,ierr)
        IF (ierr .ne. 0) STOP 'Error finding my_rank'
        WRITE(output_unit,'(a,i0,a,i0,a)')'Rank ',my_rank,' of ', ncpu, ' is active.'

        CALL MPI_BARRIER(MPI_COMM_WORLD,ierr)  ! Pause until all processes have initiated MPI

    END SUBROUTINE INIT_COMM
END PROGRAM


text:
package com.zimbra.soap.account.message;

import com.google.common.base.Objects;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;

import com.zimbra.common.soap.AccountConstants;
import com.zimbra.soap.account.type.Signature;

/**
 * @zm-api-command-auth-required true
 * @zm-api-command-admin-auth-required false
 * @zm-api-command-description Change attributes of the given signature.
 * Only the attributes specified in the request are modified.
 *

 * Note: The Server identifies the signature by id, if the name attribute is present and is
 * different from the current name of the signature, the signature will be renamed.
 */
@XmlAccessorType(XmlAccessType.NONE)
@XmlRootElement(name=AccountConstants.E_MODIFY_SIGNATURE_REQUEST)
public class ModifySignatureRequest {

    /**
     * @zm-api-field-description Specifies the changes to the signature
     */
    @XmlElement(name=AccountConstants.E_SIGNATURE, required=true)
    private final Signature signature;

    /**
     * no-argument constructor wanted by JAXB
     */
    @SuppressWarnings("unused")
    private ModifySignatureRequest() {
        this((Signature) null);
    }

    public ModifySignatureRequest(Signature signature) {
        this.signature = signature;
    }

    public Signature getSignature() { return signature; }

    @Override
    public String toString() {
        return Objects.toStringHelper(this)
            .add("signature", signature)
            .toString();
    }
}


text:
![Game screenshot](http://i.imgur.com/yEVrnQB.png)
An endless ~~running~~ rolling mobile game.

This is the repository for the mobile game Ball Run. Contributions are welcome.

This project is licensed under the terms of the MIT license. For more information please read LICENSE.md


text:
import { IState, IGroupState, ICommentState } from './interfaces';
export declare function reduce(current: ICommentState, token: string): IState;
export declare function createState(previous: IGroupState): ICommentState;


text:
package kops

import "github.com/golang/glog"

// StatusStore abstracts the key status functions; and lets us introduce status gradually
type StatusStore interface {
	GetApiIngressStatus(cluster *Cluster) ([]ApiIngressStatus, error)
}

// ApiIngress represents the status of an ingress point:
// traffic intended for the service should be sent to an ingress point.
type ApiIngressStatus struct {
	// IP is set for load-balancer ingress points that are IP based
	// (typically GCE or OpenStack load-balancers)
	// +optional
	IP string `json:"ip,omitempty" protobuf:"bytes,1,opt,name=ip"`

	// Hostname is set for load-balancer ingress points that are DNS based
	// (typically AWS load-balancers)
	// +optional
	Hostname string `json:"hostname,omitempty" protobuf:"bytes,2,opt,name=hostname"`
}

// NoopStatusStore is a stub implementation that returns empty status
// It is a temporary hackaround while we introduce status
type NoopStatusStore struct {
}

var _ StatusStore = &NoopStatusStore{}

func (s *NoopStatusStore) GetApiIngressStatus(cluster *Cluster) ([]ApiIngressStatus, error) {
	glog.Warningf("GetApiIngressStatus called on NoopStore")
	return nil, nil
}


text:
class AddPharmacyToPrescription < ActiveRecord::Migration
  def change
    add_reference :prescriptions, :pharmacy, index: true
  end
end


text:
package org.apache.activemq.artemis.tests.integration.mqtt5.spec;

import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;

import org.apache.activemq.artemis.core.protocol.mqtt.MQTTUtil;
import org.apache.activemq.artemis.tests.integration.mqtt5.MQTT5TestSupport;
import org.apache.activemq.artemis.utils.Wait;
import org.eclipse.paho.mqttv5.client.MqttClient;
import org.eclipse.paho.mqttv5.common.MqttMessage;
import org.jboss.logging.Logger;
import org.junit.Test;

/**
 * Fulfilled by client or Netty codec (i.e. not tested here):
 *
 * [MQTT-4.8.2-1] A Shared Subscription's Topic Filter MUST start with $share/ and MUST contain a ShareName that is at least one character long.
 * [MQTT-4.8.2-2] The ShareName MUST NOT contain the characters "/", "+" or "#", but MUST be followed by a "/" character. This "/" character MUST be followed by a Topic Filter.
 *
 *
 * These requirements are related to shared subscriptions and consumption via QoS 2. These are not tested:
 *
 * [MQTT-4.8.2-4] The Server MUST complete the delivery of the message to that Client when it reconnects.
 * [MQTT-4.8.2-5] If the Client's Session terminates before the Client reconnects, the Server MUST NOT send the Application Message to any other subscribed Client.
 */

public class SubscriptionTests extends MQTT5TestSupport {

   private static final Logger log = Logger.getLogger(SubscriptionTests.class);

   public SubscriptionTests(String protocol) {
      super(protocol);
   }

   /*
    * [MQTT-4.8.2-3] The Server MUST respect the granted QoS for the Client's subscription.
    */
   @Test(timeout = DEFAULT_TIMEOUT)
   public void testSharedSubscriptionRespectQoS() throws Exception {
      final String TOPIC = "myTopic";
      final String SUB_NAME = "myShare";
      final String SHARED_SUB = MQTTUtil.SHARED_SUBSCRIPTION_PREFIX + SUB_NAME + "/" + TOPIC;
      final int MESSAGE_COUNT = 100;
      final AtomicInteger consumer1MessagesReceived = new AtomicInteger(0);
      final AtomicInteger consumer2MessagesReceived = new AtomicInteger(0);

      MqttClient consumer1 = createPahoClient("consumer1");
      consumer1.connect();
      consumer1.setCallback(new DefaultMqttCallback() {
         @Override
         public void messageArrived(String incomingTopic, MqttMessage message) throws Exception {
            if (message.getQos() == 0) {
               consumer1MessagesReceived.incrementAndGet();
            } else {
               fail("Wrong QoS for consumer 1: " + message.getId() + " " + message.getQos());
            }
         }
      });
      consumer1.subscribe(SHARED_SUB, 0);

      assertNotNull(server.locateQueue(SUB_NAME));
      assertEquals(TOPIC, server.locateQueue(SUB_NAME).getAddress().toString());

      MqttClient consumer2 = createPahoClient("consumer2");
      consumer2.connect();
      consumer2.setCallback(new DefaultMqttCallback() {
         @Override
         public void messageArrived(String incomingTopic, MqttMessage message) throws Exception {
            if (message.getQos() == 1) {
               consumer2MessagesReceived.incrementAndGet();
            } else {
               fail("Wrong QoS for consumer 2: " + message.getId() + " " + message.getQos());
            }
         }
      });
      consumer2.subscribe(SHARED_SUB, 1);

      assertEquals(2, server.locateQueue(SUB_NAME).getConsumerCount());

      MqttClient producer = createPahoClient("producer");
      producer.connect();
      for (int i = 0; i < MESSAGE_COUNT; i++) {
         producer.publish(TOPIC, new byte[0], 1, false);
      }
      producer.disconnect();
      producer.close();

      Wait.assertTrue(() -> consumer1MessagesReceived.get() > 0, 2000, 100);
      Wait.assertTrue(() -> consumer2MessagesReceived.get() > 0, 2000, 100);
      Wait.assertEquals(MESSAGE_COUNT, () -> consumer1MessagesReceived.get() + consumer2MessagesReceived.get(), 2000, 100);
      consumer1.disconnect();
      consumer1.close();
      consumer2.disconnect();
      consumer2.close();
   }

   /*
    * [MQTT-4.8.2-6] If a Client responds with a PUBACK or PUBREC containing a Reason Code of 0x80 or greater to a
    * PUBLISH packet from the Server, the Server MUST discard the Application Message and not attempt to send it to any
    * other Subscriber.
    */
   @Test(timeout = DEFAULT_TIMEOUT)
   public void testSharedSubscriptionWithAck() throws Exception {
      final String TOPIC = "myTopic";
      final String SUB_NAME = "myShare";
      final String SHARED_SUB = MQTTUtil.SHARED_SUBSCRIPTION_PREFIX + SUB_NAME + "/" + TOPIC;
      CountDownLatch ackLatch = new CountDownLatch(1);
      CountDownLatch negativeAckLatch = new CountDownLatch(1);

      MqttClient consumer1 = createPahoClient("consumer1");
      consumer1.connect();
      consumer1.setCallback(new LatchedMqttCallback(ackLatch));
      consumer1.subscribe(SHARED_SUB, 1);

      assertNotNull(server.locateQueue(SUB_NAME));
      assertEquals(TOPIC, server.locateQueue(SUB_NAME).getAddress().toString());
      assertEquals(1, server.locateQueue(SUB_NAME).getConsumerCount());

      MqttClient producer = createPahoClient("producer");
      producer.connect();
      producer.publish(TOPIC, new byte[0], 1, false);
      producer.disconnect();
      producer.close();

      MqttClient consumer2 = createPahoClient("consumer2");
      consumer2.connect();
      consumer2.setCallback(new LatchedMqttCallback(negativeAckLatch));
      consumer2.subscribe(SHARED_SUB, 1);

      assertTrue(ackLatch.await(2, TimeUnit.SECONDS));
      assertFalse(negativeAckLatch.await(2, TimeUnit.SECONDS));
      consumer1.disconnect();
      consumer1.close();
      consumer2.disconnect();
      consumer2.close();
   }
}


text:
package com.whitestein.vaadin.widgets;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.InputStream;

import org.vaadin.addonhelpers.AbstractTest;

import com.vaadin.server.StreamResource;
import com.vaadin.server.StreamResource.StreamSource;
import com.vaadin.ui.Component;
import com.whitestein.vaadin.widgets.wtpdfviewer.WTPdfViewer;

/**
 * Add many of these with different configurations,
 * combine with different components, for regressions
 * and also make them dynamic if needed.
 */
@SuppressWarnings("serial")
public class NotAPdfUI extends AbstractTest {

  @Override
  public Component getTestComponent() {
    WTPdfViewer clearableTextBox = new TestWTPdfViewer();
    clearableTextBox.setHeight("600px");
    clearableTextBox.setWidth("600px");

    clearableTextBox.setResource(createPdfFileSource("src\\test\\resources\\pdf\\this-is-not-pdf.txt"));
    return clearableTextBox;
  }

  StreamResource createPdfFileSource(final String filename) {
    StreamSource source = new StreamSource() {

      @Override
      public InputStream getStream() {
        try {
          File initialFile = new File(filename);
          final InputStream targetStream = new FileInputStream(initialFile);

          return targetStream;
        } catch (FileNotFoundException e) {
          throw new RuntimeException(e);
        }
      }

    };

    return new StreamResource(source, "chacha");

  }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) Philip Bliss, 2013

This file is provided under the Apache License, Version 2.0. See the file LICENSE for more.
-->
<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit trunk//EN" "http://google-web-toolkit.googlecode.com/svn/trunk/distro-source/core/src/gwt-module.dtd">
<module>
	<inherits name='com.badlogic.gdx.backends.gdx_backends_gwt' />
	<inherits name='GdxTest' />
	<entry-point class='com.me.mygdxgame.client.GwtLauncher' />
	<set-configuration-property name="gdx.assetpath" value="../gdx-test-android/assets" />
</module>


text:
WSO2SERVER = "bin/wso2server"
DATASOURCE_PATHS = "repository/conf/deployment.toml"
M2_PATH = "is/wso2is"
DIST_POM_PATH = "modules/distribution/pom.xml"
LIB_PATH = "repository/components/lib"
DISTRIBUTION_PATH = "modules/distribution/target"
INTEGRATION_PATH = "modules/integration/tests-integration/tests-backend"
POM_FILE_PATHS = {}
TESTNG_DIST_XML_PATHS = {}
TESTNG_SERVER_MGT_DIST = {}
ARTIFACT_REPORTS_PATHS = {"modules/integration/tests-integration/tests-backend/target/logs/automation.log",
        "modules/integration/tests-integration/tests-backend/target/surefire-reports/emailable-report.html",
        "modules/integration/tests-integration/tests-backend/target/surefire-reports/index.html",
        "modules/integration/tests-integration/tests-backend/target/surefire-reports/TEST-TestSuite.xml",
        "modules/integration/tests-integration/tests-backend/target/surefire-reports/testng.css",
        "modules/integration/tests-integration/tests-backend/target/surefire-reports/testng-results.xml",
        "modules/integration/tests-integration/tests-backend/target/surefire-reports/TestSuite.txt"}
DB_META_DATA = {
    "MYSQL": {"prefix": "jdbc:mysql://", "driverClassName": "com.mysql.jdbc.Driver", "jarName": "mysql.jar",
              "DB_SETUP": {"WSO2_IDENTITY_DB": ['dbscripts/identity/mysql.sql',
                                              'dbscripts/identity/uma/mysql.sql',
                                              'dbscripts/consent/mysql.sql'],
                           "WSO2_SHARED_DB": ['dbscripts/mysql.sql']}
              },

    "SQLSERVER-SE": {"prefix": "jdbc:sqlserver://",
                     "driverClassName": "com.microsoft.sqlserver.jdbc.SQLServerDriver", "jarName": "sqlserver-ex.jar",
                     "DB_SETUP": {"WSO2_IDENTITY_DB": ['dbscripts/identity/mssql.sql',
                                                     'dbscripts/identity/uma/mssql.sql',
                                                     'dbscripts/consent/mssql.sql'],
                                  "WSO2_SHARED_DB": ['dbscripts/mssql.sql']}

                     },

    "ORACLE-SE2": {"prefix": "jdbc:oracle:thin:@", "driverClassName": "oracle.jdbc.OracleDriver",
                   "jarName": "oracle-se.jar",
                   "DB_SETUP": {"WSO2_IDENTITY_DB": ['dbscripts/identity/oracle.sql',
                                                   'dbscripts/identity/uma/oracle.sql',
                                                   'dbscripts/consent/oracle.sql'],
                                "WSO2_SHARED_DB": ['dbscripts/oracle.sql']}
                   },

    "POSTGRESQL": {"prefix": "jdbc:postgresql://", "driverClassName": "org.postgresql.Driver",
                   "jarName": "postgres.jar",
                   "DB_SETUP": {"WSO2_IDENTITY_DB": [
                                                   'dbscripts/identity/postgresql.sql',
                                                   'dbscripts/identity/uma/postgresql.sql',
                                                   'dbscripts/consent/postgresql.sql'],
                                "WSO2_SHARED_DB": ['dbscripts/postgresql.sql']}
                   }
}


text:
package com.wandrell.tabletop.dreadball.ws.toolkit.business.service.unit.jpa;

import static com.google.common.base.Preconditions.checkNotNull;

import java.util.Collection;

import javax.inject.Singleton;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.wandrell.pattern.repository.DefaultQueryData;
import com.wandrell.pattern.repository.QueryData;
import com.wandrell.tabletop.dreadball.model.unit.AffinityGroup;
import com.wandrell.tabletop.dreadball.ws.toolkit.business.service.unit.AffinityGroupDataService;
import com.wandrell.tabletop.dreadball.ws.toolkit.data.repository.unit.AffinityGroupRepository;

/**
 * Implementation of {@link AffinityGroupDataService} working behind the scenes
 * with JPA.
 *

 * This is prepared to be used with Spring, as part of the dependency injection
 * process.
 *
 * @author Bernardo Martínez Garrido
 */
@Singleton
@Service("affinityGroupDataService")
public final class JPAAffinityGroupDataService
        implements AffinityGroupDataService {

    /**
     * Repository for the {@code AffinityGroup} instances.
     */
    private final AffinityGroupRepository affinityRepository;

    /**
     * Constructs a {@code JPAAffinityGroupService} with the specified
     * repository.
     *

     * Said repository is meant to be injected through Spring.
     *
     * @param repository
     *            the repository to be used by the service
     */
    @Autowired
    public JPAAffinityGroupDataService(
            final AffinityGroupRepository repository) {
        super();

        affinityRepository = checkNotNull(repository,
                "Received a null pointer as abilities repository");
    }

    @Override
    public final AffinityGroup getAffinityGroupById(final Integer id) {
        final QueryData filter;

        filter = new DefaultQueryData(
                "SELECT affinity FROM AffinityGroup affinity WHERE id = :id");
        filter.addParameter("id", id);

        return getRepository().getEntity(filter);
    }

    @Override
    public final Collection<AffinityGroup> getAllAffinityGroups() {
        return getRepository().getAll();
    }

    /**
     * Returns the repository being used by the service.
     *
     * @return the repository being used by the service
     */
    private final AffinityGroupRepository getRepository() {
        return affinityRepository;
    }

}


text:
$path='F:\Public\videos\computer\VTC Red Hat Certified System Administrator RHCSE\*'

Function renameFiles
{
  # Search for the files set in the filter (*.mov in this case)
  $files = ls $path -include *.mov -Recurse
  # Set default value for addition to file name
  $i = 1
  Foreach ($file In $files)
  {
      # Check if a file exists
      If ($file)
      {
        # Split the name and rename it to the parent folder
        $split = $file.name.split("_")
		$newfn = $split[1]
        $replace = $split[0] -Replace $split[0],("{0:D2}" -f $i + "_" + $newfn)

        # Trim spaces and rename the file
        $image_string = $file.fullname.ToString().Trim()
        "$file.name renamed to $replace"
        Rename-Item "$image_string" "$replace"
        $i++
      }
    }
}
renamefiles


text:
package org.jetbrains.plugins.scala.lang.formatting.settings;

/**
 * Pavel Fatin
 */
public enum TypeAnnotationPolicy {
  Optional("Optional"),
  Regular("As Usual");

  private String myDescription;

  private TypeAnnotationPolicy(String description) {
    myDescription = description;
  }

  @Override
  public String toString() {
    return myDescription;
  }
}


text:
<?php namespace Pixiu\Commerce\Classes;

use Illuminate\Support\Facades\Lang;
use Illuminate\Support\Facades\Response;
use Pixiu\Commerce\Classes\OrderStatus as OS;
use Pixiu\Commerce\Classes\PaymentStatus as PS;
use Pixiu\Commerce\Classes\OrderLogger;
use Pixiu\Commerce\Models\OrderLog;
use Illuminate\Support\Facades\Mail;
use Pixiu\Commerce\Models\CommerceSettings;
use Pixiu\Commerce\Classes\Invoice\CanceledInvoiceManager;

class OrderStatusFSM
{
    private $allButtons;
    private $order;

    /**
     * OrderStatusFSM constructor.
     * @param $state
     * @param $paymentMethod
     * @param $paymentStatus
     */
    public function __construct(\Pixiu\Commerce\Models\Order $order)
    {
        $this->order = $order;
        $this->allButtons = $this->generateButtons();
    }

    public function getAvailableActions() : array
    {
        $buttons = [];

        if ($this->order->status === OS::FINISHED OR $this->order->status === OS::CANCELED) { return []; }

        if (count($this->order->variants)) {
            $buttons = [
                $this->allButtons['canceled']
            ];

            if ($this->order->status === OS::NEW) {
                if ($this->order->payment_status == PS::AWAITING_PAYMENT) {
                    array_push($buttons, $this->allButtons[PS::PAID]);
                    return array_reverse($buttons);
                }

                if ($this->order->delivery_option->personal_collection === 1) {
                    array_push($buttons, $this->allButtons[OS::READY_FOR_COLLECTION]);
                    return array_reverse($buttons);
                } else {
                    array_push($buttons, $this->allButtons[OS::SHIPPED]);
                    return array_reverse($buttons);
                }
            }
        }

        if ($this->order->status === OS::SHIPPED OR $this->order->status === OS::READY_FOR_COLLECTION) {
            array_push($buttons, $this->allButtons[OS::FINISHED]);
            return array_reverse($buttons);
        }
        return $buttons;
    }

    /**
     * @param string $action
     */
    public function manageStateChange(string $action): bool
    {
        switch ($action) {
            case str_slug(OS::READY_FOR_COLLECTION):
                $this->changeStateToReady();
                break;
            case str_slug(OS::CANCELED):
                $this->changeStateToCanceled();
                break;
            case str_slug(OS::SHIPPED):
                $this->changeStateToShipped();
                break;
            case str_slug(OS::FINISHED):
                $this->changeStateToFinished();
                break;
            case str_slug(PS::PAID):
                $this->changeStateToPaid();
                break;
        }
        $this->order->save();
        return true;
    }

    /**
     * @return array
     */
    private function generateButtons(): array
    {
        return [
            OS::FINISHED => [
                'label' => OS::getFinished(),
                'id' => str_slug(OS::FINISHED, '-')
            ],
            OS::SHIPPED => [
                'label' => OS::getShipped(),
                'id' => str_slug(OS::SHIPPED, '-')
            ],
            OS::CANCELED => [
                'label' => OS::getCanceled(),
                'id' => str_slug(OS::CANCELED, '-'),
                'class' => 'btn-outline-canceled'
            ],
            OS::READY_FOR_COLLECTION => [
                'label' => OS::getReadyForCollection(),
                'id' => str_slug(OS::READY_FOR_COLLECTION, '-')
            ],
            PS::PAID => [
                'label' => 'Zaplaceno',
                'id' => str_slug(PS::PAID, '-')
            ]
        ];
    }

    public function changeStateToNew()
    {
        $this->order->status = OS::NEW;

        if ($this->order->payment_method->cash_on_delivery === 1) {
            $this->order->payment_status = PS::CASH_ON_DELIVERY;
        }

        $this->order->save();
    }

    public function changeStateToPaid()
    {
        $this->order->payment_status = PS::PAID;
        OrderLogger::addLog($this->order, Lang::get('pixiu.commerce::lang.orderlog.paid'), 'text-info');
    }

    public function changeStateToReady()
    {
        $this->order->status = OS::READY_FOR_COLLECTION;
        OrderLogger::addLog($this->order, Lang::get('pixiu.commerce::lang.orderlog.ready'), 'text-info');
        $this->order->variantsLeftWarehouse();
    }

    public function changeStateToCanceled()
    {
        $this->order->status = OS::CANCELED;
        OrderLogger::addLog($this->order, Lang::get('pixiu.commerce::lang.orderlog.canceled'), 'text-danger');
        $this->order->returnVariantsToStock();
        (new CanceledInvoiceManager($this->order))->generateInvoice();
    }

    public function changeStateToShipped()
    {
        $this->order->status = OS::SHIPPED;
        OrderLogger::addLog($this->order, Lang::get('pixiu.commerce::lang.orderlog.shipped'), 'text-info');
        $this->order->variantsLeftWarehouse();
    }

    public function changeStateToFinished()
    {
        $this->order->status = OS::FINISHED;
        OrderLogger::addLog($this->order, Lang::get('pixiu.commerce::lang.orderlog.finished'), 'text-success');
    }
}


text:
page_type: sample
products:
- office-sp
languages:
- javascript
- typescript
extensions:
  contentType: samples
  technologies:
  - SharePoint Framework
  platforms:
  - react
  createdDate: 3/1/2018 12:00:00 AM
---
# TinyMCE Editor

## Summary
React TinyMCE is one of the worlds most popular editors for the web.
It has many features out of the box and many more plugins that can be
added when needed. You can create your own plugins if you want, the
editor is powered by the community.

![picture of the web part in action](./assets/preview.gif)

## Compatibility

![SPFx 1.4.1](https://img.shields.io/badge/SPFx-1.4.1-green.svg)
![Node.js v8 | v6](https://img.shields.io/badge/Node.js-v8%20%7C%20v6-green.svg)
![Compatible with SharePoint Online](https://img.shields.io/badge/SharePoint%20Online-Compatible-green.svg)
![Compatible with SharePoint 2019](https://img.shields.io/badge/SharePoint%20Server%202019-Compatible-green.svg)
![Does not work with SharePoint 2016 (Feature Pack 2)](https://img.shields.io/badge/SharePoint%20Server%202016%20(Feature%20Pack%202)-Incompatible-red.svg "SharePoint Server 2016 Feature Pack 2 requires SPFx 1.1")
![Local Workbench Compatible](https://img.shields.io/badge/Local%20Workbench-Compatible-green.svg)
![Hosted Workbench Compatible](https://img.shields.io/badge/Hosted%20Workbench-Compatible-green.svg)
![Compatible with Remote Containers](https://img.shields.io/badge/Remote%20Containers-Compatible-green.svg)

## Applies to

* [SharePoint Framework](https://docs.microsoft.com/sharepoint/dev/spfx/sharepoint-framework-overview)
* [Office 365 tenant](https://docs.microsoft.com/sharepoint/dev/spfx/set-up-your-development-environment)

## Prerequisites
If you are going to use tinymce be aware of it's license, and you must
agree to it.

## Solution

Solution|Author(s)
--------|---------
React-TinyMCE | @AustinBreslinDev

## Version history

Version|Date|Comments
-------|----|--------
1.0|Feb |Initial release

## Minimal Path to Awesome

- Clone this repository
- in the command line run:
  - `npm install`
  - `gulp serve`
  - `add web part to page`

>  This sample can also be opened with [VS Code Remote Development](https://code.visualstudio.com/docs/remote/remote-overview). Visit https://aka.ms/spfx-devcontainer for further instructions.

## Features
Description of the web part with possible additional details than in short summary.
This Web Part illustrates the following concepts on top of the SharePoint Framework:

- Rich text editing, that has more features than the Out of the box.
- Uses an Open Source, community-driven Editor.
- Can be extended to accept copy/paste from using Paste Plugin.
- Can be extended to accept images using the manager in the Editor.
- Can write your own Styles for all content on your site.
- Can style your authoring experience using the skins folder.
- For more features please look at the extensive list of extensions available.

## Disclaimer

**THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.**

<img src="https://pnptelemetry.azurewebsites.net/sp-dev-fx-webparts/samples/React-TinyMce" />


text:
from participantCollection import ParticipantCollection
import pyperclip

participants = ParticipantCollection()

def stringToPrint():
    answer = ""
    answer += "Here are the **" + str(participants.size()) + " participants** who have already signed up:\n\n"
    for participant in participants.participants:
        answer += "/u/" + participant.name
        answer += "\n\n"
    return answer

outputString = stringToPrint()
print "============================================================="
print outputString
print "============================================================="
pyperclip.copy(outputString)


text:
An experimental automatic mode for advanced customization of automated prints.

![Manual Mode Example](images/manual_preview_1.jpg?raw=true)

This module is a mode for [RoboPaint](https://github.com/evil-mad/robopaint),
the software for drawing robots, and your
[friendly painting robot kit, the WaterColorBot](http://watercolorbot.com)!

This mode is a playground for experimental features and customization of
various Automatic paint features. Its current state is highly in flux and
not stable, nor easy to use.

-----

All code MIT licensed. Created by [TechNinja](https://github.com/techninja),
with support and collaboration from
[Evil Mad Scientist](http://evilmadscientist.com).


text:
package com.github.autotest.sapient.dispatch.testcase;

import java.util.ArrayList;
import java.util.List;

import com.github.autotest.sapient.toolkit.util.LogUtil;

/**
 * XML文件类型的测试用例
 * @author lianghui (lianghui@360.cn)
 *
 */
public class XmlFileCase extends SuperCase{

	private LogUtil log=LogUtil.getLogger(XmlFileCase.class);//日志记录
	/**
	 *默认构造函数
	 */
	public  XmlFileCase() {
		super();
		xmlPathNameList=new ArrayList<>();
	}
	/**
	 * 构造函数  根据xml文件列表信息创建
	 * @param xmlPathNameList
	 */
	public  XmlFileCase(List<String> xmlPathNameList) {
		super();
		xmlPathNameList=new ArrayList<>();
		this.xmlPathNameList=xmlPathNameList;
	}
	/**
	 * 构造函数 根据单个xml文件信息创建
	 * @param xmlPathName
	 */
	public  XmlFileCase(String xmlPathName) {
		super();
		xmlPathNameList=new ArrayList<>();
		if (null==xmlPathName)return;
		this.xmlPathNameList.add(xmlPathName);
	}

	/**
	 * 添加xml文件列表信息
	 * @param xmlPathNameList
	 */
	public void addXmlCase(List<String> xmlPathNameList) {
		this.xmlPathNameList.addAll(xmlPathNameList);
	}
	/**
	 * 添加单个xml文件信息
	 * @param xmlPathName
	 */
	public void addXmlCase(String xmlPathName) {
		if (null==xmlPathName){
			log.error("添加的Xml文件为null,添加失败");
			return;
		}
		this.xmlPathNameList.add(xmlPathName);
	}

}


text:
#include <malloc.h>
#include "main.h"
#include "queue.h"
#include "ndmp_common.h"

/* enqueue():
 *   Description:
 *      Queues up particular NDMP client requests for processing at
 *      the top level.  If head is NULL the list is assumed to be
 *      empty and head is changed to point to the new data element.
 *
 *   Inputs:
 *      MsgQueue *head  - head of the message queue to put the message on
 *      MsgData  *data  - message data to put on the queue.
 *
 *   Outputs:
 *      MsgQueue *head  - set to the head of a new queue if the queue was
 *                        previously empty (head == NULL).
 *
 *   Returns:
 *      void
 */

void
enqueue(MsgQueue *head, MsgData *data)
{

    MsgData *newdata;

    newdata = (MsgData *) malloc(sizeof(MsgData));
    if (newdata == NULL) {
	fprintf(stderr, "\n\nCould not allocate memory for NDMP message.\n"
			"message = %d, reason = %d.\n",
			data->message, data->reason);
	exit (1);
    }
    newdata->message = data->message;
    newdata->reason = data->reason;
    strcpy(newdata->text, data->text);
    newdata->connection = data->connection;
    newdata->next = NULL;

    if (*head == NULL) {
	*head = newdata;
    }
    else
    {
	newdata->next = *head;
	*head = newdata;
    }
    return;
}

/* dequeue():
 *   Description:
 *      Removes a data element from the queue.
 *
 *   Inputs:
 *      MsgQueue *head  - head of the message queue to take the message from
 *
 *   Outputs:
 *      MsgData  *data  - data element to store information in
 *
 *   Returns:
 *      number of messages that were in the queue BEFORE this one was removed.
 */

int
dequeue(MsgQueue *head, MsgData *data)
{
    int element_count = 0;
    MsgData *cur_data;

    for (cur_data = *head;
	 cur_data && cur_data->next && cur_data->next->next;
	 cur_data = cur_data->next, element_count++);

    /* this only occurs when there are no elements in the list */
    if (cur_data == NULL)
	return 0;

    /* This only occurs if it's the only element in the list */
    if (cur_data->next == NULL) {
	memcpy(data, cur_data, sizeof(MsgData));
	*head = NULL;
	free(cur_data);
	return 1;
    }

    /* if there are two or more elements, cur_data points to the
     * second to last element.
     */
    if (cur_data->next->next == NULL) {
	memcpy(data, cur_data->next, sizeof(MsgData));
	free(cur_data->next);
	cur_data->next = NULL;
	return element_count+1;
    }

    /* this should never happen */
    return -1;
}

/* peek():
 *   Description:
 *      Same as dequeue but the message is left in the queue.  This is
 *      useful for determing if there are messages waiting to be processed
 *      and how many.
 *
 *   Inputs:
 *      MsgQueue *head  - head of the message queue to take the message from
 *
 *   Outputs:
 *      MsgData  *data  - data element with head of the message queue
 *
 *   Returns:
 *      number of messages that were in the queue BEFORE this one was removed.
 */

int peek(MsgQueue *head, MsgData *data)
{
    MsgData *cur_data;
    int element_count = 0;

    for (cur_data = *head;
	 cur_data && cur_data->next;
	 cur_data = cur_data->next, element_count++);

    if (cur_data == NULL)
	return 0;

    if (cur_data ->next == NULL) {
	memcpy(data, cur_data->next, sizeof(MsgData));
	return element_count;
    }

    /* this should never happen */
    return -1;
}


text:
package com.upwork.springmvc.service;

import java.util.List;

import com.upwork.springmvc.model.Employee;

public interface EmployeeService {

	Employee findById(int id);

	void saveEmployee(Employee employee);

	void updateEmployee(Employee employee);

	void deleteEmployeeBySsn(String ssn);

	List<Employee> findAllEmployees();

	Employee findEmployeeBySsn(String ssn);

	boolean isEmployeeSsnUnique(Integer id, String ssn);

}


text:
package igel.batrak;

import java.util.*;

/**
 * Cortege of values.
 *
 * @param <T> type of values.
 */
public class CN<T> {

    /**
     * Constructs a cortege.
     *
     * @param values values.
     */
    @SuppressWarnings("unchecked")
    public static <T> CN<T> make(T... values) {
        return new CN<>(values);
    }

    /**
     * Constructs a cortege.
     *
     * @param values values.
     */
    public static <T> CN<T> make(Collection<T> values) {
        return new CN<>(values);
    }

    private final List<T> values;

    /**
     * Constructs a cortege.
     *
     * @param values values.
     */
    public CN(Collection<T> values) {
        this.values = Collections.unmodifiableList(new ArrayList<>(values));
    }

    /**
     * Constructs a cortege.
     *
     * @param values values.
     */
    @SuppressWarnings("unchecked")
    public CN(T... values) {
        this(Arrays.asList(values));
    }

    /**
     * Returns count of values in cortege.
     *
     * @return count of values.
     */
    public int size() {
        return values.size();
    }

    /**
     * Returns a value with the specified index.
     *
     * @param index index of value.
     * @return the value.
     */
    public T get(int index) {
        return values.get(index);
    }

    /**
     * Returns the cortege as unmodifiable list.
     *
     * @return the list of values.
     */
    public List<T> asList() {
        return values;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        CN c = (CN) o;
        return values.equals(c.values);
    }

    @Override
    public int hashCode() {
        return values.hashCode();
    }

    @Override
    public String toString() {
        return String.format("CN{values=%s}", values);
    }

}