text:
@extends('layouts.backend')
@section('content')

                    @if ($errors->any())

                            @foreach ($errors->all() as $error)

{{ $error }}

                            @endforeach

                    @endif

                    {!! Form::model($notification, ['method' => 'PATCH', 'action' => ['NotificationsController@update', $notification->id]]) !!}

                        {!! Form::label('title', 'Title: ') !!}
                        {!! Form::text('title', null, ['class' => 'form-control']) !!}

                        {!! Form::label('content', 'Content: ') !!}
                        {!! Form::text('content', null, ['class' => 'form-control']) !!}

                        {!! Form::submit('Save', ['class' => 'btn btn-primary form-control']) !!}

                    {!! Form::close() !!}

@endsection


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

    >

    <android.support.v7.widget.CardView xmlns:card_view="http://schemas.android.com/apk/res-auto"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_margin="10dp"
        card_view:cardBackgroundColor="@color/cardview_light_background"
        card_view:cardCornerRadius="1dp">

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

            <TextView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:textAppearance="?android:attr/textAppearanceMedium"
                android:text="Edit Printing Properties"
                android:id="@+id/my_details_label"
                android:paddingTop="10dp"
                android:paddingLeft="15dp"
                android:paddingRight="10dp"
                android:paddingBottom="10dp"
                android:textStyle="bold"
                android:background="@color/holo_blue_dark"
                android:textColor="@color/white" />

            <RelativeLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content">

                <Spinner
                    android:layout_width="300dp"
                    android:layout_height="55dp"
                    android:id="@+id/spinner_printer"
                    android:layout_alignParentTop="true"
                    android:layout_centerHorizontal="true"
                    android:layout_marginTop="10dp" />

                <TextView
                    android:layout_width="145dp"
                    android:layout_height="wrap_content"
                    android:text="Copies"
                    android:id="@+id/textView_copies"
                    android:layout_below="@+id/spinner_printer"
                    android:layout_alignLeft="@+id/spinner_printer"
                    android:layout_alignStart="@+id/spinner_printer"
                    android:layout_marginTop="10dp" />

                <TextView
                    android:layout_width="145dp"
                    android:layout_height="wrap_content"
                    android:text="Print Type"
                    android:id="@+id/textView_print_type"
                    android:layout_below="@+id/spinner_printer"
                    android:layout_toRightOf="@+id/textView_copies"
                    android:layout_marginLeft="10dp"
                    android:layout_marginRight="10dp"
                    android:layout_marginTop="10dp" />

                <Spinner
                    android:layout_width="145dp"
                    android:layout_height="50dp"
                    android:id="@+id/spinner_copies"
                    android:layout_below="@+id/textView_copies"
                    android:layout_alignLeft="@+id/spinner_printer"
                    android:layout_alignStart="@+id/spinner_printer" />

                <Spinner
                    android:layout_width="145dp"
                    android:layout_height="50dp"
                    android:id="@+id/spinner_print_type"
                    android:layout_above="@+id/textView_orientation"
                    android:layout_alignRight="@+id/spinner_printer"
                    android:layout_alignEnd="@+id/spinner_printer" />

                <TextView
                    android:layout_width="145dp"
                    android:layout_height="wrap_content"
                    android:text="Combination"
                    android:id="@+id/textView_combination"
                    android:layout_below="@+id/spinner_copies"
                    android:layout_alignLeft="@+id/spinner_copies"
                    android:layout_alignStart="@+id/spinner_copies"
                    android:layout_marginTop="10dp" />

                <TextView
                    android:layout_width="145dp"
                    android:layout_height="wrap_content"
                    android:text="Orientation"
                    android:id="@+id/textView_orientation"
                    android:layout_below="@+id/spinner_copies"
                    android:layout_toRightOf="@+id/textView_combination"
                    android:layout_marginLeft="10dp"
                    android:layout_marginRight="10dp"
                    android:layout_marginTop="10dp" />

                <Spinner
                    android:layout_width="145dp"
                    android:layout_height="50dp"
                    android:id="@+id/spinner_combination"
                    android:layout_below="@+id/textView_combination"
                    android:layout_alignLeft="@+id/textView_combination"
                    android:layout_alignStart="@+id/textView_combination" />

                <Spinner
                    android:layout_width="145dp"
                    android:layout_height="50dp"
                    android:id="@+id/spinner_orientation"
                    android:layout_alignTop="@+id/spinner_combination"
                    android:layout_alignLeft="@+id/textView_orientation"
                    android:layout_alignStart="@+id/textView_orientation" />

                <TextView
                    android:layout_width="145dp"
                    android:layout_height="wrap_content"
                    android:text="Binding Position"
                    android:id="@+id/textView_binding_position"
                    android:layout_below="@+id/spinner_combination"
                    android:layout_alignLeft="@+id/spinner_combination"
                    android:layout_alignStart="@+id/spinner_combination"
                    android:layout_marginTop="10dp" />

                <Spinner
                    android:layout_width="145dp"
                    android:layout_height="50dp"
                    android:id="@+id/spinner_binding_position"
                    android:layout_below="@+id/textView_binding_position"
                    android:layout_alignLeft="@+id/textView_binding_position"
                    android:layout_alignStart="@+id/textView_binding_position"
                    android:layout_marginBottom="40dp" />
            </RelativeLayout>
        </LinearLayout>

    </android.support.v7.widget.CardView>

    <Button
        android:layout_width="wrap_content"
        android:layout_height="35dp"
        android:text="OK"
        android:id="@+id/button_ok"
        android:layout_alignParentBottom="true"
        android:layout_alignParentRight="true"
        android:layout_marginBottom="20dp"
        android:layout_marginRight="10dp"
        android:layout_gravity="right"
        android:textColor="@color/white"
        android:background="@color/holo_blue_dark" />

</LinearLayout>

redpajama_set_name: RedPajamaGithub


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>com.fasterxml.aalto.in Class Hierarchy (aalto-xml 1.3.0 API)</title>
<meta name="date" content="2021-05-11">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Hierarchy For Package com.fasterxml.aalto.in

Package Hierarchies:

All Packages

Class Hierarchy

java.lang.Object

com.fasterxml.aalto.in.AttributeCollector

com.fasterxml.aalto.in.ByteBasedPNameFactory

com.fasterxml.aalto.impl.CommonConfig

com.fasterxml.aalto.in.ReaderConfig

com.fasterxml.aalto.in.ElementScope

com.fasterxml.aalto.in.EntityNames

com.fasterxml.aalto.in.FixedNsContext (implements javax.xml.namespace.NamespaceContext)

com.fasterxml.aalto.in.InputBootstrapper (implements com.fasterxml.aalto.util.XmlConsts)

com.fasterxml.aalto.in.ByteSourceBootstrapper

com.fasterxml.aalto.in.CharSourceBootstrapper

java.io.InputStream (implements java.io.Closeable)

com.fasterxml.aalto.in.MergedStream

com.fasterxml.aalto.util.NameTable

com.fasterxml.aalto.in.ByteBasedPNameTable

com.fasterxml.aalto.in.CharBasedPNameTable

com.fasterxml.aalto.in.NsDeclaration

com.fasterxml.aalto.in.PName

com.fasterxml.aalto.in.ByteBasedPName

com.fasterxml.aalto.in.PName1

com.fasterxml.aalto.in.PName2

com.fasterxml.aalto.in.PName3

com.fasterxml.aalto.in.PNameN

com.fasterxml.aalto.in.PNameC

java.io.Reader (implements java.io.Closeable, java.lang.Readable)

com.fasterxml.aalto.in.Utf32Reader

com.fasterxml.aalto.util.XmlCharTypes

com.fasterxml.aalto.in.InputCharTypes

com.fasterxml.aalto.in.XmlScanner (implements javax.xml.namespace.NamespaceContext, com.fasterxml.aalto.util.XmlConsts, javax.xml.stream.XMLStreamConstants)

com.fasterxml.aalto.in.ByteBasedScanner

com.fasterxml.aalto.in.StreamScanner

com.fasterxml.aalto.in.Utf8Scanner

com.fasterxml.aalto.in.ReaderScanner

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Copyright © 2021 FasterXML. All rights reserved.


text:
package org.languagetool.tokenizers.en;

import org.junit.Test;

import java.util.List;

import static org.junit.Assert.assertEquals;

public class EnglishWordTokenizerTest {

  @Test
  public void testTokenize() {
    final EnglishWordTokenizer wordTokenizer = new EnglishWordTokenizer();
    final List <String> tokens = wordTokenizer.tokenize("This is\u00A0a test");
    assertEquals(tokens.size(), 7);
    assertEquals("[This,  , is, \u00A0, a,  , test]", tokens.toString());
    final List <String> tokens2 = wordTokenizer.tokenize("This\rbreaks");
    assertEquals(3, tokens2.size());
    assertEquals("[This, \r, breaks]", tokens2.toString());
    //hyphen with no whitespace
    final List <String> tokens3 = wordTokenizer.tokenize("Now this is-really!-a test.");
    assertEquals(tokens3.size(), 10);
    assertEquals("[Now,  , this,  , is-really, !, -a,  , test, .]", tokens3.toString());
    //hyphen at the end of the word
    final List <String> tokens4 = wordTokenizer.tokenize("Now this is- really!- a test.");
    assertEquals(tokens4.size(), 15);
    assertEquals("[Now,  , this,  , is, -,  , really, !, -,  , a,  , test, .]", tokens4.toString());
    //mdash
    final List <String> tokens5 = wordTokenizer.tokenize("Now this is—really!—a test.");
    assertEquals(tokens5.size(), 13);
    assertEquals("[Now,  , this,  , is, —, really, !, —, a,  , test, .]", tokens5.toString());
    final List <String> tokens6 = wordTokenizer.tokenize("fo'c'sle");
    assertEquals(tokens6.size(), 1);
  }
}


text:
var five = require("johnny-five");
var Photon = require("particle-io");

var particleKey = process.env.PARTICLE_KEY || 'YOUR PARTICLE ACCESS TOKEN HERE';
var device1Name = process.env.DEVICE_1_NAME || 'YOUR PARTICLE PHOTON DEVICE ID/ALIAS HERE';
var device2Name = process.env.DEVICE_2_NAME || 'YOUR PARTICLE PHOTON DEVICE ID/ALIAS HERE';

console.log("particleKey: " + particleKey);

var b1 = new five.Board({
  io: new Photon({
    token: particleKey,
    deviceId: device1Name
  })
});

var b2 = new five.Board({
  io: new Photon({
    token: particleKey,
    deviceId: device2Name
  })
});

var boards = new five.Boards([b1, b2])

boards.on("ready", function() {
  // |this| is an array-like object containing references
  // to each initialized board.
  this.each(function(board) {

    var hygrometer = new five.Multi({
      controller: "HTU21D",
      freq: 1000,
      board: board,
      threshold: 5 // Fire a change event if the value changes by 0.5 or more
    });

    hygrometer.on("change", function() {
      console.log("Board " + board.id + " - Thermometer");
      console.log("  celsius           : ", this.temperature.celsius);
      console.log("  fahrenheit        : ", this.temperature.fahrenheit);
      console.log("  kelvin            : ", this.temperature.kelvin);
      console.log("--------------------------------------");

      console.log("Hygrometer");
      console.log("  relative humidity : ", this.hygrometer.relativeHumidity);
      console.log("======================================");
    });
  })
});


text:
/*global module, global*/
module.exports = function Context() {
	'use strict';
	var self = this,
		steps = [],
		expectationMatchers = [],
		stepMatch = function (stepDefinition, stepText) {
			if (stepText instanceof RegExp) {
				return stepDefinition.matcher.source === stepText.source;
			}
			if (!stepText) {
				return false;
			}
			return !!stepText.match(stepDefinition.matcher);
		},
		matchingSteps = function (stepText) {
			return steps.filter(function (stepDefinition) {
				return stepMatch(stepDefinition, stepText);
			});
		},
		globalOverrides = {};
	self.exportToGlobal = function () {
		['defineStep', 'addMatchers'].forEach(function (prop) {
			self.overrideGlobal(prop, self[prop]);
		});
	};
	self.addMatchers = function (matcherObject) {
		expectationMatchers.push(matcherObject);
	};
	self.getMatchers = function () {
		return expectationMatchers;
	};
	self.overrideGlobal = function (propname, value) {
		if (!globalOverrides[propname]) {
			globalOverrides[propname] = global[propname];
		}
		global[propname] = value;
	};
	self.resetGlobal = function () {
		var propname;
		for (propname in globalOverrides) {
			global[propname] = globalOverrides[propname];
			delete globalOverrides[propname];
		}
	};
	self.defineStep = function (regexMatcher, processFunction) {
		var matching;
		if (!regexMatcher) {
			throw new Error('Empty matchers are not supported');
		}
		if (regexMatcher.source.indexOf('(?:') >= 0) {
			throw new Error('Non-capturing regex groups are not supported');
		}
		matching = matchingSteps(regexMatcher);
		if (matching.length > 0) {
			throw new Error('The matching step is already defined');
		}
		steps.push({matcher: regexMatcher, processFunction: processFunction});
	};
	self.getStepDefinitionForLine = function (stepText) {
		var matching = matchingSteps(stepText);
		if (matching.length === 0) {
			return false;
		} else if (matching.length > 1) {
			throw new Error('multiple steps match line ' + stepText);
		}
		return matching[0];
	};
};


text:
package com.alkisum.android.cloudrun.adapters;

import android.content.Context;
import android.content.res.ColorStateList;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.alkisum.android.cloudrun.R;
import com.alkisum.android.cloudrun.model.Session;
import com.alkisum.android.cloudrun.utils.Format;

import java.util.Date;
import java.util.List;

import androidx.appcompat.widget.AppCompatCheckBox;
import androidx.core.content.ContextCompat;
import androidx.core.widget.CompoundButtonCompat;
import butterknife.BindView;
import butterknife.ButterKnife;

/**
 * Adapter for History ListView.
 *
 * @author Alkisum
 * @version 4.1
 * @since 1.0
 */
public class HistoryListAdapter extends BaseAdapter {

    /**
     * Context.
     */
    private final Context context;

    /**
     * List of sessions.
     */
    private final List<Session> sessions;

    /**
     * ID of the session to be highlighted, used after a session has been
     * stopped. The ID is null if the user started the HistoryActivity manually.
     */
    private final Long highlightedSessionId;

    /**
     * Flag set to true if the ListView is in edit mode, false otherwise.
     */
    private boolean editMode;

    /**
     * Color for checkboxes.
     */
    private final ColorStateList checkBoxColor;

    /**
     * Color for highlighted checkboxes.
     */
    private final ColorStateList highlightedCheckBoxColor;

    /**
     * HistoryListAdapter constructor.
     *
     * @param context              Context
     * @param sessions             List of sessions
     * @param highlightedSessionId ID of the session to be highlighted, used
     *                             after a session has been stopped.
     *                             The ID is null if the user started
     *                             the HistoryActivity manually
     */
    public HistoryListAdapter(final Context context,
                              final List<Session> sessions,
                              final Long highlightedSessionId) {
        this.context = context;
        this.sessions = sessions;
        resetSessionsSelectedStates();
        this.highlightedSessionId = highlightedSessionId;

        // Checkbox colors
        checkBoxColor = new ColorStateList(
                new int[][]{new int[]{android.R.attr.state_enabled}},
                new int[]{ContextCompat.getColor(this.context,
                        R.color.accent)});
        highlightedCheckBoxColor = new ColorStateList(
                new int[][]{new int[]{android.R.attr.state_enabled}},
                new int[]{ContextCompat.getColor(this.context,
                        android.R.color.white)});
    }

    /**
     * Set new list of sessions.
     *
     * @param sessions List of sessions to set
     */
    public final void setSessions(final List<Session> sessions) {
        this.sessions.clear();
        this.sessions.addAll(sessions);
    }

    /**
     * @return True if the ListView is in edit mode, false otherwise
     */
    public final boolean isEditMode() {
        return editMode;
    }

    /**
     * Disable the edit mode and reset the sessions' selected states.
     */
    public final void disableEditMode() {
        editMode = false;
        resetSessionsSelectedStates();
    }

    /**
     * Switch ListView into edit mode and select the checkbox attached to the
     * item that has been pressed long.
     *
     * @param position Position of the item that has been pressed long
     */
    public final void enableEditMode(final int position) {
        editMode = true;
        sessions.get(position).setSelected(true);
    }

    /**
     * Reverse the session selected state.
     *
     * @param position Position of the item that has been pressed
     */
    public final void changeSessionSelectedState(final int position) {
        Session session = sessions.get(position);
        session.setSelected(!session.getSelected());
    }

    /**
     * Reset the sessions' selected states. Mandatory to avoid the sessions to
     * be selected from actions performed during last HistoryActivity instance.
     */
    private void resetSessionsSelectedStates() {
        for (Session session : sessions) {
            session.setSelected(false);
        }
    }

    @Override
    public final int getCount() {
        return sessions.size();
    }

    @Override
    public final Object getItem(final int i) {
        return sessions.get(i);
    }

    @Override
    public final long getItemId(final int i) {
        return sessions.get(i).getId();
    }

    @Override
    public final View getView(final int i, final View v,
                              final ViewGroup viewGroup) {
        final LayoutInflater inflater = LayoutInflater.from(context);
        View view = v;
        if (view == null || view.getTag() == null) {
            view = inflater.inflate(R.layout.list_item_history, viewGroup,
                    false);
            final ViewHolder holder = new ViewHolder(view);
            view.setTag(holder);
        }
        final Session session = (Session) getItem(i);
        final ViewHolder holder = (ViewHolder) view.getTag();

        // Set values
        holder.dateTime.setText(Format.getDateTimeHistory().format(
                new Date(session.getStart())));
        if (session.getEnd() != null) {
            long duration = session.getDuration();
            holder.distance.setText(String.format("%s %s",
                    Format.formatDistance(session.getDistance()),
                    context.getString(R.string.unit_distance)));
            holder.duration.setText(Format.formatDuration(duration));
            holder.speed.setText(String.format("%s %s",
                    Format.formatSpeedAvg(duration, session.getDistance()),
                    context.getString(R.string.unit_speed)));
            holder.pace.setText(String.format("%s %s",
                    Format.formatPaceAvg(duration, session.getDistance()),
                    context.getString(R.string.unit_pace)));
        } else {
            // End of session unavailable, cannot calculate values
            holder.distance.setText(R.string.not_available);
            holder.duration.setText(R.string.not_available);
            holder.speed.setText(R.string.not_available);
            holder.pace.setText(R.string.not_available);
        }

        // Set colors
        if (session.getId().equals(highlightedSessionId)) {
            // Highlighted item
            holder.layout.setBackgroundColor(ContextCompat.getColor(
                    context, R.color.primary));
            holder.dateTime.setTextColor(ContextCompat.getColor(
                    context, android.R.color.white));
            CompoundButtonCompat.setButtonTintList(holder.checkBox,
                    highlightedCheckBoxColor);
        } else {
            // Default item
            holder.layout.setBackgroundColor(ContextCompat.getColor(
                    context, android.R.color.transparent));
            holder.dateTime.setTextColor(ContextCompat.getColor(
                    context, R.color.accent));
            CompoundButtonCompat.setButtonTintList(holder.checkBox,
                    checkBoxColor);
        }

        // Handle checkboxes according to the mode
        holder.checkBox.setChecked(session.getSelected());
        if (editMode) {
            holder.checkBox.setVisibility(View.VISIBLE);
            holder.checkBox.setOnClickListener(
                    view1 -> session.setSelected(holder.checkBox.isChecked()));
        } else {
            holder.checkBox.setVisibility(View.GONE);
        }

        return view;
    }

    /**
     * ViewHolder for history list adapter.
     */
    static class ViewHolder {

        /**
         * Item layout.
         */
        @BindView(R.id.history_list_layout)
        RelativeLayout layout;

        /**
         * Checkbox to select the item in edit mode.
         */
        @BindView(R.id.history_list_checkbox)
        AppCompatCheckBox checkBox;

        /**
         * TextView for date and time.
         */
        @BindView(R.id.history_list_date_time)
        TextView dateTime;

        /**
         * TextView for distance.
         */
        @BindView(R.id.history_list_distance)
        TextView distance;

        /**
         * TextView for duration.
         */
        @BindView(R.id.history_list_duration)
        TextView duration;

        /**
         * TextView for speed.
         */
        @BindView(R.id.history_list_speed)
        TextView speed;

        /**
         * TextView for pace.
         */
        @BindView(R.id.history_list_pace)
        TextView pace;

        /**
         * ViewHolder constructor.
         *
         * @param view View to bind with ButterKnife
         */
        ViewHolder(final View view) {
            ButterKnife.bind(this, view);
        }
    }
}


text:
package uk.gov.nationalarchives.droid.profile;

import java.io.File;
import java.io.InputStream;

/**
 * @author rflitcroft
 *
 */
public interface ProfileSpecDao {

    /**
     * Persists a new profile spec.
     * @param profileSpec the profile spec to persist
     * @param profileHomeDir the home directory of the profile
     */
    void saveProfile(ProfileInstance profileSpec, File profileHomeDir);

    /**
     * Loads a profile instabnce form the given input stream.
     * @param in the input stream containing the profile data.
     * @return the profile instance loaded
     */
    ProfileInstance loadProfile(InputStream in);
}


text:
from time import time
import matplotlib.pyplot as plt
import numpy as np
plt.close("all")

start = time()

# load the data
fid = open('Week2/pizza-train.json', 'r')

# find all distinct words
words = []

for line in fid:
    l = line.split()
    if l[0] == '"request_text":':
        text = l[1:]

        for word in text:
            if word not in words:
                words.append(word)

fid.close()

n_words = len(words)

# reload the data and create the bag-of-words matrix  list of lists
fid = open('Week2/pizza-train.json', 'r')

bow = []  # bag-of-words list of lists

for line in fid:
    l = line.split()
    if l[0] == '"request_text":':
        text = l[1:]

        bow_row = [0] * n_words  # row for the bow list of length n_words
        for word in text:
            ix = words.index(word)  # index in the word list where the current word matches
            bow_row[ix] = 1

        bow.append(bow_row)

fid.close()

end = time()

# sanity check that we did it right
im = np.array(bow)

plt.imshow(im)
plt.show()

# most popular word
s = sum(im)
max_ix = np.where(s == max(s))
print('Most popular word: ')
print(words[max_ix[0][0]])

print("Script time:: {:.2f}s".format(end-start))


text:
package ru.stqa.pft.addressbook.tests;

import com.google.common.reflect.TypeToken;
import com.google.gson.Gson;
import com.thoughtworks.xstream.XStream;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;
import ru.stqa.pft.addressbook.model.ContactData;
import ru.stqa.pft.addressbook.model.Contacts;
import ru.stqa.pft.addressbook.model.GroupData;
import ru.stqa.pft.addressbook.model.Groups;

import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.stream.Collectors;

import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.MatcherAssert.assertThat;

public class ContactCreationTest extends TestBase {
   @DataProvider
    public Iterator<Object[]> validContactsJson() throws IOException {
        try(BufferedReader reader = new BufferedReader(new FileReader("src\\test\\resources\\gencontacts.json"))){
        String content="";
        String data= reader.readLine();
        while (data!=null){
           content +=data;
            data = reader.readLine();
        }
        Gson gson = new Gson();
        ArrayList<ContactData> list = gson.fromJson(content, new TypeToken<List<ContactData>>(){}.getType());

        return list.stream().map((c)->new Object[]{c}).collect(Collectors.toList()).iterator();
        }
    }
    @DataProvider
    public Iterator<Object[]> validContactsXml() throws IOException {
       try( BufferedReader reader = new BufferedReader(new FileReader("src\\test\\resources\\gencontacts.xml"))){
        String content="";
        String data= reader.readLine();
        while (data!=null){
            content +=data;
            data = reader.readLine();
        }
        XStream xs = new XStream();
        xs.processAnnotations(ContactData.class);
        ArrayList<ContactData> list = (ArrayList<ContactData>) xs.fromXML(content);
        return list.stream().map((c)->new Object[]{c}).collect(Collectors.toList()).iterator();
       }
    }

    @Test(dataProvider = "validContactsXml")//(enabled = false)
    public void testAddContact(ContactData provider) {
        if(app.db().contacts().size()==0){
            app.contact().create(new ContactData().withName("contact 1").withLastname("Ivanow")
                    .withHomePhone("888111888").withEmail_1("mail@com").withAddress("Kijev"),true);
        }

        app.goTo().homePage();
        Contacts before = app.db().contacts();
        ContactData contact =  provider;
        app.contact().create(contact, true);
        Contacts after = app.db().contacts();
        assertThat(app.contact().count(), equalTo(before.size()+1));
        //before.sort((o1, o2) -> Integer.compare(o1.getId(),o2.getId()));
        // after.sort((o1, o2) -> Integer.compare(o1.getId(),o2.getId()));
        assertThat(after, equalTo(before.withAdded(
                contact.withiD(after.stream().mapToInt(value -> value.getId()).max().getAsInt()))));
        verifyContactListInUi();

    }
}


text:
<?php

namespace PayPal\EnumType;

use \WsdlToPhp\PackageBase\AbstractStructEnumBase;

/**
 * This class stands for ListingEnhancementsCodeType EnumType
 * Meta information extracted from the WSDL
 * - documentation: ListingEnhancementsCodeType Specifies the codes for various properties of an item.
 * @subpackage Enumerations
 * @author WsdlToPhp <contact@wsdltophp.com>
 */
class ListingEnhancementsCodeType extends AbstractStructEnumBase
{
    /**
     * Constant for value 'Border'
     * Meta information extracted from the WSDL
     * - documentation: Indicates whether an item will be displayed with a border that will go around the item (e.g., for category-based search result page or store search that brings up multiple items) to differentiate it from the rest of list.
     * @return string 'Border'
     */
    const VALUE_BORDER = 'Border';
    /**
     * Constant for value 'BoldTitle'
     * Meta information extracted from the WSDL
     * - documentation: Indicates whether the bolding option was used.
     * @return string 'BoldTitle'
     */
    const VALUE_BOLD_TITLE = 'BoldTitle';
    /**
     * Constant for value 'Featured'
     * Meta information extracted from the WSDL
     * - documentation: Indicates whether it is a featured item.
     * @return string 'Featured'
     */
    const VALUE_FEATURED = 'Featured';
    /**
     * Constant for value 'Highlight'
     * Meta information extracted from the WSDL
     * - documentation: Indicates item's listing is highlighted.
     * @return string 'Highlight'
     */
    const VALUE_HIGHLIGHT = 'Highlight';
    /**
     * Constant for value 'HomePageFeatured'
     * Meta information extracted from the WSDL
     * - documentation: Indicates item's listing is home page featured.
     * @return string 'HomePageFeatured'
     */
    const VALUE_HOME_PAGE_FEATURED = 'HomePageFeatured';
    /**
     * Constant for value 'CustomCode'
     * Meta information extracted from the WSDL
     * - documentation: Reserved for internal or future use.
     * @return string 'CustomCode'
     */
    const VALUE_CUSTOM_CODE = 'CustomCode';
    /**
     * Return allowed values
     * @uses self::VALUE_BORDER
     * @uses self::VALUE_BOLD_TITLE
     * @uses self::VALUE_FEATURED
     * @uses self::VALUE_HIGHLIGHT
     * @uses self::VALUE_HOME_PAGE_FEATURED
     * @uses self::VALUE_CUSTOM_CODE
     * @return string[]
     */
    public static function getValidValues()
    {
        return array(
            self::VALUE_BORDER,
            self::VALUE_BOLD_TITLE,
            self::VALUE_FEATURED,
            self::VALUE_HIGHLIGHT,
            self::VALUE_HOME_PAGE_FEATURED,
            self::VALUE_CUSTOM_CODE,
        );
    }
}


text:
function TplManager::addTemplateToGui(%this,%tplGui,%addTo) {
	GuiEd.closeTplPreview();
	%tplClone = %tplGui.getObject(0).deepClone();
	show(%tplClone);
	%tplClone.setName("");
	%tplClone.templateSrc = %tplGui.getName();

	if (!isObject(%addTo))
		%addTo = GuiEditor.getCurrentAddSet();

	%addTo.add(%tplClone);
}
//------------------------------------------------------------------------------


text:
const DrawCard = require('../../drawcard.js');

class MotherOfDragons extends DrawCard {
    setupCardAbilities(ability) {
        this.action({
            title: 'Add attached character to the challenge',
            condition: () => this.game.currentChallenge && this.parent.canParticipateInChallenge() &&
                             this.controller.anyCardsInPlay(card => this.game.currentChallenge.isParticipating(card) && card.hasTrait('Dragon')),
            cost: ability.costs.kneelSelf(),
            handler: () => {
                let challenge = this.game.currentChallenge;

                if(challenge.attackingPlayer === this.controller) {
                    challenge.addAttacker(this.parent);
                } else {
                    challenge.addDefender(this.parent);
                }
                this.game.addMessage('{0} kneels {1} to have {2} participate in the challenge on their side', this.controller, this, this.parent);
            }
        });
    }

    canAttach(player, card) {
        if(card.getType() !== 'character' || !card.hasTrait('Stormborn')) {
            return false;
        }

        return super.canAttach(player, card);
    }
}

MotherOfDragons.code = '04094';

module.exports = MotherOfDragons;


text:
package org.ehcache.sizeof.annotations;

import org.junit.Test;

import static org.junit.Assert.assertEquals;

/**
 * @author Alex Snaps
 */
public class AnnotationProxyFactoryTest {

    @Test(expected = UnsupportedOperationException.class)
    public void NoDefaultValueInReferenceAnnotationAndNoImplementationInCustomThrowsException_Test() {
        CustomAnnotation customAnnotation = UsingCustomAnnotation.class.getAnnotation(CustomAnnotation.class);
        ReferenceAnnotation annotationProxy = AnnotationProxyFactory
            .getAnnotationProxy(customAnnotation, ReferenceAnnotation.class);
        annotationProxy.things();
    }

    @Test
    public void NoImplementationInCustomFallsBackToReferenceImplementation_Test() {
        CustomAnnotation customAnnotation = UsingCustomAnnotation.class.getAnnotation(CustomAnnotation.class);
        ReferenceAnnotation annotationProxy = AnnotationProxyFactory
            .getAnnotationProxy(customAnnotation, ReferenceAnnotation.class);
        assertEquals("hello", annotationProxy.version());
    }

    @Test
    public void IfMethodExistsInCustomAnnotationRedirectsToIt_Test() {
        CustomAnnotation customAnnotation = UsingCustomAnnotation.class.getAnnotation(CustomAnnotation.class);
        ReferenceAnnotation annotationProxy = AnnotationProxyFactory
            .getAnnotationProxy(customAnnotation, ReferenceAnnotation.class);
        assertEquals(true, annotationProxy.deprecated());
    }

    @Test
    public void IfMethodExistsInCustomAnnotationButReturnTypeIsDifferentFallsBackToReferenceImplementation_Test() {
        CustomAnnotation customAnnotation = UsingCustomAnnotation.class.getAnnotation(CustomAnnotation.class);
        ReferenceAnnotation annotationProxy = AnnotationProxyFactory
            .getAnnotationProxy(customAnnotation, ReferenceAnnotation.class);
        assertEquals(5, annotationProxy.differentReturnType());
    }

    @Test
    public void DifferentReturnTypesFromDifferentMethods_Test() {
        CustomAnnotation customAnnotation = UsingCustomAnnotation.class.getAnnotation(CustomAnnotation.class);
        ReferenceAnnotation annotationProxy = net.sf
            .ehcache
            .pool
            .sizeof
            .filter
            .AnnotationProxyFactory
            .getAnnotationProxy(customAnnotation, ReferenceAnnotation.class);
        assertEquals(Integer.class, annotationProxy.aClass());
        assertEquals(ExampleEnum.TWO, annotationProxy.anEnum());
        assertEquals(customAnnotation.anAnnotation(), annotationProxy.anAnnotation());
    }

    @CustomAnnotation
    class UsingCustomAnnotation {
    }
}


text:
import asyncio
import os
import signal

# if it's idle will be restarted after N seconds
IDLE_TIME = 30
# check for idle each N seconds
IDLE_CHECK = 5

class ChildProcess:

    loop = None

    def __init__(self, loader, **options):
        self.loader = loader
        self.options = options

    def start(self):
        self.loop = loop = asyncio.new_event_loop()
        asyncio.set_event_loop(loop)

        asyncio.async(self.on_start())
        asyncio.async(self.loader.call_on_start())
        loop.add_signal_handler(signal.SIGINT, self.stop)
        loop.add_signal_handler(signal.SIGTERM, self.stop)

        loop.run_forever()
        loop.run_until_complete(self.loader.call_on_stop())

        loop.remove_signal_handler(signal.SIGINT)
        loop.remove_signal_handler(signal.SIGTERM)
        os._exit(0)

    @asyncio.coroutine
    def on_start(self):
        """ It's a callback which will be called when event loop starts. """

    def stop(self):
        if self.loop.is_running():
            self.loop.stop()

class WorkerProcess:

    _started = _restart = False

    def __init__(self, loop, loader, **options):
        self.loop = loop
        self.loader = loader
        self.options = options
        self.start()

    def start(self):
        assert not self._started
        self._started = True
        self.start_child()

    def kill(self):
        self._started = False
        self.kill_child()

    def restart(self):
        if not self._restart:
            self._restart = True
            self.kill()
            self.start()
            self._restart = False

    def start_child(self):
        raise NotImplementedError

    def kill_child(self):
        raise NotImplementedError


text:
class CreateVenues < ActiveRecord::Migration
  def change
    create_table :venues do |t|
      t.string :name
      t.string :street_address
      t.string :city
      t.string :state
      t.string :zipcode
      t.integer :capacity

      t.timestamps
    end
  end
end


text:
package com.endovectors.uta.presentation.button.button_two;

import com.endovectors.uta.presentation.button.ButtonStatesEnum;

import java.awt.Color;

import javax.swing.*;

/**
 * Created by asham_000 on 7/19/2015.
 */
public class ButtonTwo extends JButton {

    public ButtonTwo(String text){
        super(text);
        setBackground(Color.GREEN);
        setBorder(null);
    }

    public void setState(ButtonStatesEnum state){
        switch(state){
            case MENU_STATE:
                this.setText("Continue Game");
                break;
            case PLAY_STATE:
                this.setText("Pause Game");
                break;
        }
    }
}


text:
package com.icegreen.greenmail.util;

import com.icegreen.greenmail.Managers;
import com.icegreen.greenmail.configuration.ConfiguredGreenMail;
import com.icegreen.greenmail.imap.ImapServer;
import com.icegreen.greenmail.pop3.Pop3Server;
import com.icegreen.greenmail.smtp.SmtpServer;
import com.icegreen.greenmail.user.GreenMailUser;

import javax.mail.internet.MimeMessage;
import java.util.Properties;

/**
 * Proxy that routes all operations to an internal greenmail instance
 */
public abstract class GreenMailProxy extends ConfiguredGreenMail {
    @Override
    public SmtpServer getSmtp() {
        return getGreenMail().getSmtp();
    }

    @Override
    public ImapServer getImap() {
        return getGreenMail().getImap();
    }

    @Override
    public Pop3Server getPop3() {
        return getGreenMail().getPop3();
    }

    @Override
    public SmtpServer getSmtps() {
        return getGreenMail().getSmtps();
    }

    @Override
    public ImapServer getImaps() {
        return getGreenMail().getImaps();
    }

    @Override
    public Pop3Server getPop3s() {
        return getGreenMail().getPop3s();
    }

    @Override
    public Managers getManagers() {
        return getGreenMail().getManagers();
    }

    @Override
    public boolean waitForIncomingEmail(long timeout, int emailCount) {
        return getGreenMail().waitForIncomingEmail(timeout, emailCount);
    }

    @Override
    public boolean waitForIncomingEmail(int emailCount) {
        return getGreenMail().waitForIncomingEmail(emailCount);
    }

    @Override
    public MimeMessage[] getReceivedMessages() {
        return getGreenMail().getReceivedMessages();
    }

    @Override
    public MimeMessage[] getReceviedMessagesForDomain(String domain) {
        return getGreenMail().getReceviedMessagesForDomain(domain);
    }

    @Override
    public GreenMailUser setUser(String login, String password) {
        return getGreenMail().setUser(login, password);
    }

    @Override
    public GreenMailUser setUser(String email, String login, String password) {
        return getGreenMail().setUser(email, login, password);
    }

    @Override
    public void setUsers(Properties users) {
        getGreenMail().setUsers(users);
    }

    @Override
    public void setQuotaSupported(boolean isEnabled) {
        getGreenMail().setQuotaSupported(isEnabled);
    }

    @Override
    public void start() {
        getGreenMail().start();
        // Apply configuration that we store
        doConfigure();
    }

    @Override
    public void stop() {
        getGreenMail().stop();
    }

    @Override
    public void reset() {
        getGreenMail().reset();
    }

    /**
     * @return Greenmail instance provided by child class
     */
    protected abstract GreenMail getGreenMail();
}


text:
import React, { Component } from 'react';
import { connect } from 'react-redux';
import { Link } from 'react-router-dom';
import PropTypes from 'prop-types';
import { list, reset } from '../../actions/recipeingredient/list';

class List extends Component {
  static propTypes = {
    retrieved: PropTypes.object,
    loading: PropTypes.bool.isRequired,
    error: PropTypes.string,
    eventSource: PropTypes.instanceOf(EventSource),
    deletedItem: PropTypes.object,
    list: PropTypes.func.isRequired,
    reset: PropTypes.func.isRequired
  };

  componentDidMount() {
    this.props.list(
      this.props.match.params.page &&
        decodeURIComponent(this.props.match.params.page)
    );
  }

  componentWillReceiveProps(nextProps) {
    if (this.props.match.params.page !== nextProps.match.params.page)
      nextProps.list(
        nextProps.match.params.page &&
          decodeURIComponent(nextProps.match.params.page)
      );
  }

  componentWillUnmount() {
    this.props.reset(this.props.eventSource);
  }

  render() {
    return (

RecipeIngredient List

        {this.props.loading && (

Loading...

        )}
        {this.props.deletedItem && (

            {this.props.deletedItem['@id']} deleted.

        )}
        {this.props.error && (

{this.props.error}

        )}

          <Link to="create" className="btn btn-primary">
            Create
          </Link>

              id
              ingredient
              quantity
              recipe

            {this.props.retrieved &&
              this.props.retrieved['hydra:member'].map(item => (

                    <Link to={`show/${encodeURIComponent(item['@id'])}`}>
                      {item['@id']}
                    </Link>

                  {this.renderLinks('ingredients', item['ingredient'])}
                  {item['quantity']}
                  {this.renderLinks('recipes', item['recipe'])}

                    <Link to={`show/${encodeURIComponent(item['@id'])}`}>

                      Show
                    </Link>

                    <Link to={`edit/${encodeURIComponent(item['@id'])}`}>

                      Edit
                    </Link>

              ))}

        {this.pagination()}

    );
  }

  pagination() {
    const view = this.props.retrieved && this.props.retrieved['hydra:view'];
    if (!view) return;

    const {
      'hydra:first': first,
      'hydra:previous': previous,
      'hydra:next': next,
      'hydra:last': last
    } = view;

    return (

        <Link
          to="."
          className={`btn btn-primary${previous ? '' : ' disabled'}`}
        >
          ⇐ First
        </Link>
        <Link
          to={
            !previous || previous === first ? '.' : encodeURIComponent(previous)
          }
          className={`btn btn-primary${previous ? '' : ' disabled'}`}
        >
          ← Previous
        </Link>
        <Link
          to={next ? encodeURIComponent(next) : '#'}
          className={`btn btn-primary${next ? '' : ' disabled'}`}
        >
          Next →
        </Link>
        <Link
          to={last ? encodeURIComponent(last) : '#'}
          className={`btn btn-primary${next ? '' : ' disabled'}`}
        >
          Last ⇒
        </Link>

    );
  }

  renderLinks = (type, items) => {
    if (Array.isArray(items)) {
      return items.map((item, i) => (

{this.renderLinks(type, item)}

      ));
    }

    return (
      <Link to={`../${type}/show/${encodeURIComponent(items)}`}>{items}</Link>
    );
  };
}

const mapStateToProps = state => {
  const {
    retrieved,
    loading,
    error,
    eventSource,
    deletedItem
  } = state.recipeingredient.list;
  return { retrieved, loading, error, eventSource, deletedItem };
};

const mapDispatchToProps = dispatch => ({
  list: page => dispatch(list(page)),
  reset: eventSource => dispatch(reset(eventSource))
});

export default connect(
  mapStateToProps,
  mapDispatchToProps
)(List);


text:
/* this file has been autogenerated by vtkNodeJsWrap */
/* editing this might proof futile */

#define VTK_WRAPPING_CXX
#define VTK_STREAMS_FWD_ONLY
#include <nan.h>

#include "vtkGraphAlgorithmWrap.h"
#include "vtkExtractSelectedGraphWrap.h"
#include "vtkObjectBaseWrap.h"
#include "vtkAlgorithmOutputWrap.h"
#include "vtkInformationWrap.h"
#include "../../plus/plus.h"

using namespace v8;

extern Nan::Persistent<v8::Object> vtkNodeJsNoWrap;
Nan::Persistent<v8::FunctionTemplate> VtkExtractSelectedGraphWrap::ptpl;

VtkExtractSelectedGraphWrap::VtkExtractSelectedGraphWrap()
{ }

VtkExtractSelectedGraphWrap::VtkExtractSelectedGraphWrap(vtkSmartPointer<vtkExtractSelectedGraph> _native)
{ native = _native; }

VtkExtractSelectedGraphWrap::~VtkExtractSelectedGraphWrap()
{ }

void VtkExtractSelectedGraphWrap::Init(v8::Local<v8::Object> exports)
{
	Nan::SetAccessor(exports, Nan::New("vtkExtractSelectedGraph").ToLocalChecked(), ConstructorGetter);
	Nan::SetAccessor(exports, Nan::New("ExtractSelectedGraph").ToLocalChecked(), ConstructorGetter);
}

void VtkExtractSelectedGraphWrap::ConstructorGetter(
	v8::Local<v8::String> property,
	const Nan::PropertyCallbackInfo<v8::Value>& info)
{
	InitPtpl();
	info.GetReturnValue().Set(Nan::New(ptpl)->GetFunction());
}

void VtkExtractSelectedGraphWrap::InitPtpl()
{
	if (!ptpl.IsEmpty()) return;
	v8::Local<v8::FunctionTemplate> tpl = Nan::New<v8::FunctionTemplate>(New);
	VtkGraphAlgorithmWrap::InitPtpl( );
	tpl->Inherit(Nan::New<FunctionTemplate>(VtkGraphAlgorithmWrap::ptpl));
	tpl->SetClassName(Nan::New("VtkExtractSelectedGraphWrap").ToLocalChecked());
	tpl->InstanceTemplate()->SetInternalFieldCount(1);

	Nan::SetPrototypeMethod(tpl, "FillInputPortInformation", FillInputPortInformation);
	Nan::SetPrototypeMethod(tpl, "fillInputPortInformation", FillInputPortInformation);

	Nan::SetPrototypeMethod(tpl, "GetRemoveIsolatedVertices", GetRemoveIsolatedVertices);
	Nan::SetPrototypeMethod(tpl, "getRemoveIsolatedVertices", GetRemoveIsolatedVertices);

	Nan::SetPrototypeMethod(tpl, "NewInstance", NewInstance);
	Nan::SetPrototypeMethod(tpl, "newInstance", NewInstance);

	Nan::SetPrototypeMethod(tpl, "RemoveIsolatedVerticesOff", RemoveIsolatedVerticesOff);
	Nan::SetPrototypeMethod(tpl, "removeIsolatedVerticesOff", RemoveIsolatedVerticesOff);

	Nan::SetPrototypeMethod(tpl, "RemoveIsolatedVerticesOn", RemoveIsolatedVerticesOn);
	Nan::SetPrototypeMethod(tpl, "removeIsolatedVerticesOn", RemoveIsolatedVerticesOn);

	Nan::SetPrototypeMethod(tpl, "SafeDownCast", SafeDownCast);
	Nan::SetPrototypeMethod(tpl, "safeDownCast", SafeDownCast);

	Nan::SetPrototypeMethod(tpl, "SetAnnotationLayersConnection", SetAnnotationLayersConnection);
	Nan::SetPrototypeMethod(tpl, "setAnnotationLayersConnection", SetAnnotationLayersConnection);

	Nan::SetPrototypeMethod(tpl, "SetRemoveIsolatedVertices", SetRemoveIsolatedVertices);
	Nan::SetPrototypeMethod(tpl, "setRemoveIsolatedVertices", SetRemoveIsolatedVertices);

	Nan::SetPrototypeMethod(tpl, "SetSelectionConnection", SetSelectionConnection);
	Nan::SetPrototypeMethod(tpl, "setSelectionConnection", SetSelectionConnection);

#ifdef VTK_NODE_PLUS_VTKEXTRACTSELECTEDGRAPHWRAP_INITPTPL
	VTK_NODE_PLUS_VTKEXTRACTSELECTEDGRAPHWRAP_INITPTPL
#endif
	ptpl.Reset( tpl );
}

void VtkExtractSelectedGraphWrap::New(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	if(!info.IsConstructCall())
	{
		Nan::ThrowError("Constructor not called in a construct call.");
		return;
	}

	if(info.Length() == 0)
	{
		vtkSmartPointer<vtkExtractSelectedGraph> native = vtkSmartPointer<vtkExtractSelectedGraph>::New();
		VtkExtractSelectedGraphWrap* obj = new VtkExtractSelectedGraphWrap(native);
		obj->Wrap(info.This());
	}
	else
	{
		if(info[0]->ToObject() != vtkNodeJsNoWrap )
		{
			Nan::ThrowError("Parameter Error");
			return;
		}
	}

	info.GetReturnValue().Set(info.This());
}

void VtkExtractSelectedGraphWrap::FillInputPortInformation(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkExtractSelectedGraphWrap *wrapper = ObjectWrap::Unwrap<VtkExtractSelectedGraphWrap>(info.Holder());
	vtkExtractSelectedGraph *native = (vtkExtractSelectedGraph *)wrapper->native.GetPointer();
	if(info.Length() > 0 && info[0]->IsInt32())
	{
		if(info.Length() > 1 && info[1]->IsObject() && (Nan::New(VtkInformationWrap::ptpl))->HasInstance(info[1]))
		{
			VtkInformationWrap *a1 = ObjectWrap::Unwrap<VtkInformationWrap>(info[1]->ToObject());
			int r;
			if(info.Length() != 2)
			{
				Nan::ThrowError("Too many parameters.");
				return;
			}
			r = native->FillInputPortInformation(
				info[0]->Int32Value(),
				(vtkInformation *) a1->native.GetPointer()
			);
			info.GetReturnValue().Set(Nan::New(r));
			return;
		}
	}
	Nan::ThrowError("Parameter mismatch");
}

void VtkExtractSelectedGraphWrap::GetRemoveIsolatedVertices(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkExtractSelectedGraphWrap *wrapper = ObjectWrap::Unwrap<VtkExtractSelectedGraphWrap>(info.Holder());
	vtkExtractSelectedGraph *native = (vtkExtractSelectedGraph *)wrapper->native.GetPointer();
	bool r;
	if(info.Length() != 0)
	{
		Nan::ThrowError("Too many parameters.");
		return;
	}
	r = native->GetRemoveIsolatedVertices();
	info.GetReturnValue().Set(Nan::New(r));
}

void VtkExtractSelectedGraphWrap::NewInstance(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkExtractSelectedGraphWrap *wrapper = ObjectWrap::Unwrap<VtkExtractSelectedGraphWrap>(info.Holder());
	vtkExtractSelectedGraph *native = (vtkExtractSelectedGraph *)wrapper->native.GetPointer();
	vtkExtractSelectedGraph * r;
	if(info.Length() != 0)
	{
		Nan::ThrowError("Too many parameters.");
		return;
	}
	r = native->NewInstance();
	VtkExtractSelectedGraphWrap::InitPtpl();
	v8::Local<v8::Value> argv[1] =
		{ Nan::New(vtkNodeJsNoWrap) };
	v8::Local<v8::Function> cons =
		Nan::New<v8::FunctionTemplate>(VtkExtractSelectedGraphWrap::ptpl)->GetFunction();
	v8::Local<v8::Object> wo = cons->NewInstance(1, argv);
	VtkExtractSelectedGraphWrap *w = new VtkExtractSelectedGraphWrap();
	w->native = r;
	w->Wrap(wo);
	info.GetReturnValue().Set(wo);
}

void VtkExtractSelectedGraphWrap::RemoveIsolatedVerticesOff(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkExtractSelectedGraphWrap *wrapper = ObjectWrap::Unwrap<VtkExtractSelectedGraphWrap>(info.Holder());
	vtkExtractSelectedGraph *native = (vtkExtractSelectedGraph *)wrapper->native.GetPointer();
		if(info.Length() != 0)
	{
		Nan::ThrowError("Too many parameters.");
		return;
	}
	native->RemoveIsolatedVerticesOff();
}

void VtkExtractSelectedGraphWrap::RemoveIsolatedVerticesOn(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkExtractSelectedGraphWrap *wrapper = ObjectWrap::Unwrap<VtkExtractSelectedGraphWrap>(info.Holder());
	vtkExtractSelectedGraph *native = (vtkExtractSelectedGraph *)wrapper->native.GetPointer();
		if(info.Length() != 0)
	{
		Nan::ThrowError("Too many parameters.");
		return;
	}
	native->RemoveIsolatedVerticesOn();
}

void VtkExtractSelectedGraphWrap::SafeDownCast(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkExtractSelectedGraphWrap *wrapper = ObjectWrap::Unwrap<VtkExtractSelectedGraphWrap>(info.Holder());
	vtkExtractSelectedGraph *native = (vtkExtractSelectedGraph *)wrapper->native.GetPointer();
	if(info.Length() > 0 && info[0]->IsObject() && (Nan::New(VtkObjectBaseWrap::ptpl))->HasInstance(info[0]))
	{
		VtkObjectBaseWrap *a0 = ObjectWrap::Unwrap<VtkObjectBaseWrap>(info[0]->ToObject());
		vtkExtractSelectedGraph * r;
		if(info.Length() != 1)
		{
			Nan::ThrowError("Too many parameters.");
			return;
		}
		r = native->SafeDownCast(
			(vtkObjectBase *) a0->native.GetPointer()
		);
		VtkExtractSelectedGraphWrap::InitPtpl();
		v8::Local<v8::Value> argv[1] =
			{ Nan::New(vtkNodeJsNoWrap) };
		v8::Local<v8::Function> cons =
			Nan::New<v8::FunctionTemplate>(VtkExtractSelectedGraphWrap::ptpl)->GetFunction();
		v8::Local<v8::Object> wo = cons->NewInstance(1, argv);
		VtkExtractSelectedGraphWrap *w = new VtkExtractSelectedGraphWrap();
		w->native = r;
		w->Wrap(wo);
		info.GetReturnValue().Set(wo);
		return;
	}
	Nan::ThrowError("Parameter mismatch");
}

void VtkExtractSelectedGraphWrap::SetAnnotationLayersConnection(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkExtractSelectedGraphWrap *wrapper = ObjectWrap::Unwrap<VtkExtractSelectedGraphWrap>(info.Holder());
	vtkExtractSelectedGraph *native = (vtkExtractSelectedGraph *)wrapper->native.GetPointer();
	if(info.Length() > 0 && info[0]->IsObject() && (Nan::New(VtkAlgorithmOutputWrap::ptpl))->HasInstance(info[0]))
	{
		VtkAlgorithmOutputWrap *a0 = ObjectWrap::Unwrap<VtkAlgorithmOutputWrap>(info[0]->ToObject());
				if(info.Length() != 1)
		{
			Nan::ThrowError("Too many parameters.");
			return;
		}
		native->SetAnnotationLayersConnection(
			(vtkAlgorithmOutput *) a0->native.GetPointer()
		);
		return;
	}
	Nan::ThrowError("Parameter mismatch");
}

void VtkExtractSelectedGraphWrap::SetRemoveIsolatedVertices(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkExtractSelectedGraphWrap *wrapper = ObjectWrap::Unwrap<VtkExtractSelectedGraphWrap>(info.Holder());
	vtkExtractSelectedGraph *native = (vtkExtractSelectedGraph *)wrapper->native.GetPointer();
	if(info.Length() > 0 && info[0]->IsBoolean())
	{
				if(info.Length() != 1)
		{
			Nan::ThrowError("Too many parameters.");
			return;
		}
		native->SetRemoveIsolatedVertices(
			info[0]->BooleanValue()
		);
		return;
	}
	Nan::ThrowError("Parameter mismatch");
}

void VtkExtractSelectedGraphWrap::SetSelectionConnection(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkExtractSelectedGraphWrap *wrapper = ObjectWrap::Unwrap<VtkExtractSelectedGraphWrap>(info.Holder());
	vtkExtractSelectedGraph *native = (vtkExtractSelectedGraph *)wrapper->native.GetPointer();
	if(info.Length() > 0 && info[0]->IsObject() && (Nan::New(VtkAlgorithmOutputWrap::ptpl))->HasInstance(info[0]))
	{
		VtkAlgorithmOutputWrap *a0 = ObjectWrap::Unwrap<VtkAlgorithmOutputWrap>(info[0]->ToObject());
				if(info.Length() != 1)
		{
			Nan::ThrowError("Too many parameters.");
			return;
		}
		native->SetSelectionConnection(
			(vtkAlgorithmOutput *) a0->native.GetPointer()
		);
		return;
	}
	Nan::ThrowError("Parameter mismatch");
}


text:
All notable changes to this add-on will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

## Unreleased
### Added
- Completed PDF Output support (Issue 5535)
- Added option to specify active scan id in API.
- Added option to specify inclusion of passive alerts in API and command line.
- Add info and repo URLs.
- Maintenance changes.

### Changed
- Update minimum ZAP version to 2.9.0.

## [6] - 2019-06-24

- Remove API when uninstalling.
- Fix exception with Java 9+ (Issue 4214).

## 5 - 2018-01-04

- Change where XSL files are deployed to avoid clashes (Issue 4206).

## 4 - 2017-05-25

- Updated the command line help messages.

## 3 - 2016-11-18

- Correct link to official ZAP Jenkins plugin in help page.

## 2 - 2016-11-17

- Added API call support and minor enhancements and bug fixes.

## 1 - 2016-09-02

- First version

[6]: https://github.com/zaproxy/zap-extensions/releases/exportreport-v6


text:
package org.wso2.carbon.uuf.renderablecreator.hbs.core.js;

@FunctionalInterface
public interface CallOSGiServiceFunction {

    String NAME = "callOSGiService";

    Object call(String serviceClassName, String serviceMethodName, Object... args);
}


text:
{# Load the tag library #}
{% load bootstrap3 %}

{# Load CSS and JavaScript #}
{% bootstrap_css %}
{% bootstrap_javascript %}

{# Display django.contrib.messages as Bootstrap alerts #}
{% bootstrap_messages %}
{% load staticfiles %}

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">
    <link rel="shortcut icon" type="image/png" href="{% static 'blog/favicon.ico' %}"/>
    {% block title%}
    {% endblock %}

	<link href="{% static 'blog/css/blog.css' %}" rel="stylesheet">

    <link href="http://maxcdn.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css" rel="stylesheet" type="text/css">
    <link href='http://fonts.googleapis.com/css?family=Lora:400,700,400italic,700italic' rel='stylesheet' type='text/css'>
    <link href='http://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800' rel='stylesheet' type='text/css'>

                        {% block page_name %}
                        {% endblock %}

                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
                    Toggle navigation

                </button>
                Me's Blog

                        Home

                        About

                        Player

                        Contact

        {% block content %}
        {% endblock %}

Copyright © HanKun 2016

    >


text:
/**
 * If array includes second parameter, returns true.
 * Otherwise return false.
*/
function include(arr, obj) {
    return (arr.indexOf(obj) != -1);
}

/**
 * String format function
 * Gets a string includes {i} and replaces it with nth i parameter.
 */
function strFormat() {
    var s = arguments[0];

    for (var i = 0; i < arguments.length - 1; i++) {
        var reg = new RegExp("\\{" + i + "\\}", "gm");
        s = s.replace(reg, arguments[i + 1]);
    }

    return s;
}

function checkCallback(callback) {
    return callback && typeof(callback) === 'function';
}

Array.range = function(n) {
    // Array.range(5) --> [0,1,2,3,4]
    return Array.apply(null,Array(n)).map((x,i) => i)
};

function chunk(arr, n) {
    return Array.range(Math.ceil(arr.length/n)).map((x,i) => arr.slice(i*n,i*n+n));
}

exports.include = include;
exports.strFormat = strFormat;
exports.checkCallback = checkCallback;
exports.chunk = chunk;


text:
using MachenicWpf.Utils;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;

namespace MachenicWpf.Model {
    public class BaseViewModel : INotifyPropertyChanged {
        public DrawingType DrawingType { get; set; }

        public event PropertyChangedEventHandler PropertyChanged;

        public virtual void NotifyChanged(string prop) {
            if (this.PropertyChanged != null) {
                this.PropertyChanged(this, new PropertyChangedEventArgs(prop));
            }
        }
    }

}


text:
package callete.api.services.resources;

import java.awt.image.BufferedImage;

/**
 * Image wrapper to retrieve format metadata used
 * during scaling and cropping.
 */
public interface ImageResource {
  public String getUrl();

  public String getImageFormat();

  public BufferedImage getImage();
}


text:
import sbt._
import java.io.File

// simple build tool does not find the so libraries automatically,
// so we need to import them manually

class LWJGLProject(info: ProjectInfo) extends DefaultProject(info) {
  val scalatest = "org.scalatest"%"scalatest"%"1.3"

  // to specify new runJVMOptions we need to fork the execution
  override def fork = Some(new ForkScalaRun {
    val (os, separator) = System.getProperty("os.name").split(" ")(0).toLowerCase match {
      case "linux" => "linux" -> ":"
      case "mac" => "macosx" -> ":"
      case "windows" => "windows" -> ";"
      case "sunos" => "solaris" -> ":"
      case x => x -> ":"
    }

    val nativeLibsOpt = "-Djava.library.path=" + System.getProperty("java.library.path") + separator + ("lib" / "native" / os)
    override def runJVMOptions = super.runJVMOptions ++ Seq(nativeLibsOpt)
    override def scalaJars = Seq(buildLibraryJar.asFile, buildCompilerJar.asFile)
  })
}


text:
'''
Assemble trimmed Illumina read files (fastq)
'''

import os
import sys
import re
import glob
import shutil
import argparse
import subprocess
import pandas as pd
import numpy as np
from Bio import SeqIO
import time
import multiprocessing.pool
from functools import partial

# Complete path function
class CompletePath(argparse.Action):
    """give the full path of an input file/folder"""
    def __call__(self, parser, namespace, values, option_string=None):
        setattr(namespace, self.dest, os.path.abspath(os.path.expanduser(values)))

def add_arguments(parser):
    parser.add_argument(
        '--input',
        required=True,
        action=CompletePath,
        default=None,
        help='Call the folder that contains the cleaned fastq read files. The fastq files should be organized in a separate subfolder for each sample (default output of secapr clean_reads function).'
    )
    parser.add_argument(
        '--output',
        required=True,
        action=CompletePath,
        default=None,
        help='The output directory where results will be saved'
    )
    parser.add_argument(
        '--kmer',
        type=str,
        help='Set the kmer value. Provide a list of kmers for Spades, e.g. "--kmer 21,33,55". Default is 21,33,55,77,99,127. Note that Spades only accepts uneven kmer values.'
    )
    parser.add_argument(
        '--contig_length',
        type=int,
        default=200,
        help='Set the minimum contig length for the assembly. Contigs that are shorter than this threshold will be discarded.'
    )
    parser.add_argument(
        '--max_memory',
        type=str,
        help='Set the maximum memory to be used during assembly in GB. This can be necessary when working with computing nodes with limited memory or to avoid over-allocation of computing resources on clusters which can in some cases cause your assembly to be stopped or interrupted.'
    )
    parser.add_argument(
        '--cores',
        type=int,
        default=1,
        help='For parallel processing you can set the number of cores you want to run the assembly on.'
    )
    parser.add_argument(
        '--instances',
        type=int,
        default=1,
        help='How many parallel assemblies to run at a time. This will multiply the cores and max_memory arguments (for each SPAdes run). For example, max_memory=4, cores=2 and instances=4 will use 8 threads and 16 GB.'
    )

def assembly_spades(sorted_fastq_files,n_library_numbers,output_folder,id_sample,kmer,args):
    print("De-novo assembly with spades of sample %s:" %id_sample)
    command = [
        "spades.py",
        "-k",
        kmer,
        "--only-assembler"
    ]
    for i in np.arange(n_library_numbers):
        command += [
        "--pe-1",
        i+1,
        sorted_fastq_files[i*3],
        "--pe-2",
        i+1,
        sorted_fastq_files[i*3+1],
        "--pe-s",
        i+1,
        sorted_fastq_files[i*3+2],
        ]
    command += ["-o", output_folder]
    if args.cores > 1:
        command+=["--threads", args.cores]
    if args.max_memory:
        command+=["--memory", args.max_memory]
    command = list(np.array(command).astype(str))
    print ("Building contigs........")
    with open(os.path.join(output_folder, "%s_spades_screen_out.txt" %id_sample), 'w') as log_err_file:
        p = subprocess.Popen(command, stdout=log_err_file)
        p.communicate()
        p.wait()
    print(("%s assembled. Statistics are printed into %s" %(id_sample, os.path.join(output_folder, "%s_spades_screen_out.txt" %id_sample))))
    # except:
    #     print(("Could not assemble %s" %id_sample))

def count_contigs(contig_file):
    """Return a count of contigs from a fasta file"""
    return sum([1 for line in open(contig_file, 'r').readlines() if line.startswith('>')])

def remove_short_contigs(contig_file,min_length):
    fasta_content = list(SeqIO.parse(open(contig_file),'fasta'))
    new_fasta_content = []
    for record in fasta_content:
        contig_length = len(str(record.seq))
        if contig_length < min_length:
            pass
        else:
            new_fasta_content.append(record)
    SeqIO.write(new_fasta_content,contig_file, 'fasta-2line')

def get_stats_spades(contig_file,sample_id,sample_contig_count_dict):
    #contig_count_cmd = subprocess.Popen(["tail", "-n", "2", "%s/%s.fa" %('/'.join(sample_output_folder.split('/')[:-2]),sample_id)], stdout=subprocess.PIPE)
    #contig_count_pre = contig_count_cmd.communicate()[0]
    contig_count = count_contigs(contig_file)
    #contig_count = contig_count_pre.split(' ')[0].replace('>','')
    sample_contig_count_dict.setdefault(sample_id,contig_count)
    stats_df=pd.DataFrame.from_dict(sample_contig_count_dict, orient='index').reset_index()
    stats_df.columns = ['sample_id', 'total_contig_count']
    print(('#'*50))
    print(stats_df)
    return(stats_df,contig_file)
    #contig_count, header, percent, sequence = contig_count_pre.split("\t")

def process_subfolder(pool_args):
    sample_contig_count_dict = {}
    subfolder, args = pool_args
    # Set working directory
    out_dir = os.path.join(args.output,'stats')
    # Get all the other input variables
    min_length = args.contig_length

    if args.kmer:
        kmer = str(args.kmer)
    else:
        kmer = '21,33,55,77,99,127'
    if args.max_memory:
        max_memory = args.max_memory
    else:
        max_memory = None
    sample_id = os.path.basename(subfolder)
    # Loop through each sample-folder and find read-files
    sample_output_folder = os.path.join(out_dir, sample_id)
    if not os.path.exists(sample_output_folder):
        os.makedirs(sample_output_folder)
    fastq_files = glob.glob(os.path.join(subfolder,'*.fastq.gz'))
    sorted_fastq_files = ['']*len(fastq_files)
    n_library_numbers = int(len(fastq_files) / 3)
    for element in fastq_files:
        for i in np.arange(n_library_numbers):
            if element.endswith("_%i_clean-READ1.fastq.gz"%i):
                sorted_fastq_files[i*3] = element
            elif element.endswith("_%i_clean-READ2.fastq.gz"%i):
                sorted_fastq_files[i*3+1] = element
            elif element.endswith("_%i_clean-unpaired.fastq.gz"%i):
                sorted_fastq_files[i*3+2] = element
    print(('#' * 50))
    print(("Processing sample %s" % sample_id))
    start = time.time()
    assembly_spades(sorted_fastq_files, n_library_numbers, sample_output_folder, sample_id, kmer, args)
    contig_file = os.path.join(sample_output_folder, 'contigs.fasta')
    new_contig_file = '%s/../../%s.fa' % (sample_output_folder, sample_id)
    mv_contig = "cp %s %s" % (contig_file, new_contig_file)
    os.system(mv_contig)
    contig_count_df, contig_file = get_stats_spades(new_contig_file, sample_id,sample_contig_count_dict)
    remove_short_contigs(new_contig_file, min_length)
    end = time.time()
    print('Assembled contigs for sample %s in %i minutes' % (sample_id, int(np.round((end - start) / 60))))
    return(contig_count_df)

def main(args):
    input_folder = args.input
    out_folder = args.output
    out_dir = os.path.join(out_folder,'stats')
    if not os.path.exists(out_dir):
        os.makedirs(out_dir)
    instances = args.instances
    subfolder_list = [subfolder for subfolder, __, __ in os.walk(input_folder) if os.path.basename(subfolder) != os.path.basename(input_folder)]
    if instances > 1:
        print(("Running assemblies in parallel as %d instances" %instances))
        pool = multiprocessing.Pool(instances)
        pool_args = [[subfolder,args] for subfolder in subfolder_list]
        contig_count_df_list = list(pool.map(partial(process_subfolder), pool_args))
        pool.close()
    else:
        contig_count_df_list = [process_subfolder([subfolder,args]) for subfolder in subfolder_list]
    #print(contig_count_df_list)
    contig_count_df = pd.concat(contig_count_df_list)
    try:
        previous_stats_df = pd.read_csv(os.path.join(input_folder,'sample_stats.txt'),sep='\t')
        counter = 0
        for index,row in previous_stats_df.iterrows():
            sample_name = str(row['sample_id'])
            if sample_name in list(contig_count_df['sample_id']):
                new_info = contig_count_df[contig_count_df['sample_id']==sample_name]['total_contig_count']
                new_value = new_info.values[0]
                new_name = new_info.name
                headers = np.array(row.index)
                old_values = row.values
                new_index = np.append(headers,new_name)
                new_values = np.append(old_values,new_value)
                if counter == 0:
                    new_values_previous = new_values
                else:
                    new_values_previous = np.vstack([new_values_previous, new_values])
                counter += 1
        new_stats_df = pd.DataFrame(data=new_values_previous,columns=new_index)
    except:
        print('No previous stats file found, creating new stats file.')
        new_stats_df = contig_count_df
    new_stats_df.to_csv(os.path.join(args.output,'sample_stats.txt'),sep="\t",index=False)

# if assembler == "abyss":
#     assembly_abyss(forward, backward, single_f, single_b, sample_output_folder, sample_id, kmer, 1, args)
#     files = glob.glob(os.path.join(sample_output_folder, '*'))
#     links = [f for f in files if os.path.islink(f)]
#     for l in links:
#         if l.endswith("-contigs.fa"):
#             contig_file = os.path.realpath(l)
#             mv_contig = "mv %s %s/../../%s.fa" % (contig_file, sample_output_folder, sample_id)
#             os.system(mv_contig)
#     # mv_cmd1 = "mv %s/%s* %s" %(home_dir,sample_id,sample_output_folder)
#     # os.system(mv_cmd1)
#     # mv_cmd2 = "mv %s/coverage.hist %s" %(home_dir,sample_output_folder)
#     # os.system(mv_cmd2)
#     contig_count_df, contig_file = get_stats_abyss(sample_output_folder, sample_id,
#                                                    sample_contig_count_dict)
#     remove_short_contigs(contig_file, min_length)

#
# def assembly_abyss(forw,backw,singlef,singleb,output_folder,id_sample,kmer,cores,args):
#     print("\nWARNING: Abyss is very memory heavy (dependend on the size of your read files and the chosen kmer value) "
#           "and it may throw an error or run painstakingly slow because it's running out of memory. "
#           "For average sized read files amounting to approx. 1 GB per sample (forward and backward reads) at kmer 35 "
#           "Abyss will require around 6GB of memory (keep that in mind when parallelizing on multiple cores).\n")
#     print(("De-novo assembly with abyss of sample %s:" %id_sample))
#     try:
#         kmer = int(kmer)
#     except:
#         quit('\n\nError: Provided kmer value could not be formatted as integer. Please provide single numeric kmer value when choosing the Abyss assembler.')
#     command = [
#         "abyss-pe",
#         "--directory={}".format(output_folder),
#         "k={}".format(kmer),
#         "j={}".format(cores),
#         'name={}'.format(id_sample),
#         'in={} {}'.format(forw,backw)
#     ]
#     if args.single_reads:
#         command.append('se={} {}'.format(singlef,singleb))
#     try:
#         print ("Building contigs........")
#         with open(os.path.join(output_folder, "%s_abyss_screen_out.txt" %id_sample), 'w') as log_err_file:
#             p = subprocess.Popen(command, stdout=log_err_file)
#             p.communicate()
#             p.wait()
#         print(("%s assembled. Statistics are printed into %s" %(id_sample, os.path.join(output_folder, "%s_abyss_screen_out.txt" %id_sample))))
#     except:
#         print(("Could not assemble %s" %id_sample))
#
# def get_stats_abyss(sample_output_folder,sample_id,sample_contig_count_dict):
#     #contig_count_cmd = subprocess.Popen(["tail", "-n", "2", "%s/%s.fa" %('/'.join(sample_output_folder.split('/')[:-2]),sample_id)], stdout=subprocess.PIPE)
#     #contig_count_pre = contig_count_cmd.communicate()[0]
#     contig_file = "%s/%s.fa" %('/'.join(sample_output_folder.split('/')[:-2]),sample_id)
#     contig_count = count_contigs(contig_file)
#     #contig_count = contig_count_pre.split(' ')[0].replace('>','')
#     sample_contig_count_dict.setdefault(sample_id,contig_count)
#     stats_df=pd.DataFrame.from_dict(sample_contig_count_dict, orient='index').reset_index()
#     stats_df.columns = ['sample', 'total_contig_count']
#     print(('#'*50))
#     print(stats_df)
#     return(stats_df,contig_file)
#     #contig_count, header, percent, sequence = contig_count_pre.split("\t")


text:
require 'rails_helper'

describe SessionsController do
  request_json

  let(:password) { 'test1234' }
  let!(:user) do
    create(:user, password: password, password_confirmation: password)
  end

  let(:user_attributes) do
    {
      email: user.email,
      password: password
    }
  end

  let(:body) { JSON.parse(response.body) }

  describe '#create' do
    before do
      @request.env["devise.mapping"] = Devise.mappings[:user]
    end

    it 'allows me to sign in as a new user' do
      post :create, params: { user: user_attributes }
      expect(response).to be_success
      expect(body['name']).to eq(user.name)
    end
  end
end


text:
export declare class BrowserLocation {
    private _location;
    private _history;
    private _baseHref;
    constructor();
    onPopState(fn: EventListener): void;
    getBaseHref(): string;
    path(): string;
    pushState(state: any, title: string, url: string): void;
    forward(): void;
    back(): void;
}


text:
<?php
/**
 * Created by JetBrains PhpStorm.
 * User: JanGolle
 * Date: 01.12.14
 * Time: 14:03
 * To change this template use File | Settings | File Templates.
 */

namespace app\forms;

use app\abstracts\BaseForm;
use app\models\Ticket;
use app\models\TicketMessage;
use Yii;

class TicketForm extends BaseForm
{
    public $category_id;
    public $name;
    public $text;

    public function rules()
    {
        return [
            [['category_id', 'name'], 'required'],
            [['name'], 'string', 'max' => 256, 'message' => Yii::t('error','Это поле не может превышать {count} символов',['count' => 256])],
            [['text'], 'string', 'max' => 2048, 'message' => Yii::t('error','Это поле не может превышать {count} символов',['count' => 2048])],
        ];
    }

    public function attributeLabels()
    {
        return [
            'category_id' => Yii::t('base', 'Категория'),
            'name' => Yii::t('base', 'Заголовок'),
            'text' => Yii::t('base', 'Текст'),
        ];
    }

    public function save()
    {
        if(!$this->validate())
            return false;

        $ticket = new Ticket();
        $ticket->setAttributes($this->getAttributes());
        $ticket->save(false);

        $ticketMessage = new TicketMessage();
        $ticketMessage->setAttributes([
            'text' => $this->text,
            'ticket_id' => $ticket->id
        ]);

        return $ticketMessage->save(false);
    }
}


text:
local boss = {
	[3193] = "fury of the emperor",
	[3194] = "wrath of the emperor",
	[3195] = "scorn of the emperor",
	[3196] = "spite of the emperor",
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
	if(item.itemid == 12318 and boss[itemEx.uid] and itemEx.itemid == 12383) then
		doTransformItem(itemEx.uid, 11753)
		doSummonCreature(boss[itemEx.uid], {x = toPosition.x + 4, y = toPosition.y, z = toPosition.z})
		setGlobalStorageValue(itemEx.uid - 4, 1)
	elseif(item.itemid == 12318 and itemEx.itemid == 12317) then
		if(toPosition.x > 33034 and toPosition.x < 33071 and
			toPosition.y > 31079 and toPosition.y < 31102) then
			if(getPlayerStorageValue(cid, 1090) == 1) then
				setPlayerStorageValue(cid, 1090, 2)
				doCreatureSay(cid, "The sceptre is almost torn from your hand as you banish the presence of the emperor.", TALKTYPE_MONSTER_SAY)
			end
		elseif(toPosition.x > 33080 and toPosition.x < 33111 and
			toPosition.y > 31079 and toPosition.y < 31100) then
			if(getPlayerStorageValue(cid, 1090) == 2) then
				setPlayerStorageValue(cid, 1090, 3)
				doCreatureSay(cid, "The sceptre is almost torn from your hand as you banish the presence of the emperor.", TALKTYPE_MONSTER_SAY)
			end
		elseif(toPosition.x > 33078 and toPosition.x < 33112 and
			toPosition.y > 31106 and toPosition.y < 31127) then
			if(getPlayerStorageValue(cid, 1090) == 3) then
				setPlayerStorageValue(cid, 1090, 4)
				doCreatureSay(cid, "The sceptre is almost torn from your hand as you banish the presence of the emperor.", TALKTYPE_MONSTER_SAY)
			end
		elseif(toPosition.x > 33035 and toPosition.x < 33069 and
			toPosition.y > 31107 and toPosition.y < 31127) then
			if(getPlayerStorageValue(cid, 1090) == 4) then
				setPlayerStorageValue(cid, 1090, 5)
				doCreatureSay(cid, "The sceptre is almost torn from your hand as you banish the presence of the emperor.", TALKTYPE_MONSTER_SAY)
				doTeleportThing(cid, {x = 33072, y = 31151, z = 15})
				doSendMagicEffect({x = 33072, y = 31151, z = 15}, CONST_ME_TELEPORT)
			end
		end
	elseif(item.itemid == 12318 and itemEx.itemid == 12385) then
		if(getPlayerStorageValue(cid, 1060) == 33) then
			doCreatureSay(cid, "NOOOoooooooo...!", TALKTYPE_MONSTER_SAY, false, cid, toPosition)
			doCreatureSay(cid, "This should have dealt the deathblow to the snake things' ambitions.", TALKTYPE_MONSTER_SAY)
			setPlayerStorageValue(cid, 1060, 34)
		end
	end
	return true
end


text:
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef nsMacIcelandicToUnicode_h___
#define nsMacIcelandicToUnicode_h___

#include "nsISupports.h"

/**
 * A character set converter from MacIcelandic to Unicode.
 *
 * @created         4/26/1999
 * @author  Frank Tang [ftang]
 */
nsresult
nsMacIcelandicToUnicodeConstructor(nsISupports *aOuter, REFNSIID aIID,
                                   void **aResult);

#endif /* nsMacIcelandicToUnicode_h___ */


text:
package com.linecorp.armeria.server.grpc;

import com.linecorp.armeria.common.util.SafeCloseable;
import com.linecorp.armeria.server.ServiceRequestContext;

import kotlin.coroutines.AbstractCoroutineContextElement;
import kotlin.coroutines.CoroutineContext;
import kotlinx.coroutines.ThreadContextElement;

/**
 * Propagates {@link ServiceRequestContext} over Kotlin coroutines only when using
 * gRPC-Kotlin.
 */
final class ArmeriaRequestCoroutineContext extends AbstractCoroutineContextElement
        implements ThreadContextElement<SafeCloseable> {

    private static final Key<ArmeriaRequestCoroutineContext> CONTEXT_KEY =
            new Key<ArmeriaRequestCoroutineContext>() {};

    private final ServiceRequestContext requestContext;

    ArmeriaRequestCoroutineContext(ServiceRequestContext requestContext) {
        super(CONTEXT_KEY);
        this.requestContext = requestContext;
    }

    @SuppressWarnings("MustBeClosedChecker")
    @Override
    public SafeCloseable updateThreadContext(CoroutineContext coroutineContext) {
        return requestContext.push();
    }

    @Override
    public void restoreThreadContext(CoroutineContext coroutineContext, SafeCloseable oldState) {
        oldState.close();
    }
}


text: google-site-verification: google583b1ec6b968213a.html


text:
/*
 * PopupViewDelegate.m
 *
 * Created by Sajid Anwar.
 *
 * Subject to terms and conditions in LICENSE.md.
 *
 */

#import "PopupViewDelegate.h"

@implementation PopupViewDelegate

@synthesize appDelegate;
@synthesize popup;

@synthesize playbackMode;
@synthesize repeatMode;
@synthesize shuffleMode;
@synthesize songRating;

@synthesize noSongLabel;

@synthesize actionButtonMenu;
@synthesize actionButtonTopConstraint;
@synthesize actionButton;
@synthesize artExpandView;
@synthesize artView;
@synthesize artProgress;
@synthesize titleLabel;
@synthesize artistLabel;
@synthesize albumLabel;
@synthesize infoView;

@synthesize repeatButton;
@synthesize backButton;
@synthesize playPauseButton;
@synthesize forwardButton;
@synthesize shuffleButton;

@synthesize thumbsdownButton;
@synthesize thumbsupButton;

@synthesize playbackSlider;

@synthesize luckyButton;

- (void)awakeFromNib
{
    [repeatButton    setImage:[self repeatNoneImage]];
    [backButton      setImage:[self backImage]];
    [playPauseButton setImage:[self playImage]];
    [forwardButton   setImage:[self forwardImage]];
    [shuffleButton   setImage:[self shuffleOffImage]];

    [thumbsupButton   setImage:[self thumbsUpOffImage]];
    [thumbsdownButton setImage:[self thumbsUpOnImage]];

    [artExpandView          setImage:[self expandContractImage]];
    [actionButton           setImage:[self actionButtonImage]];

    [luckyButton   setImage:[self diceImage]];

    [popup.popupView setIsLargePlayer:NO];
}

- (void)updateSong:(NSString *)title artist:(NSString *)artist album:(NSString *)album art:(NSString *)art
{
    if (![noSongLabel isHidden])
    {
        [noSongLabel setHidden:YES];
        [thumbsupButton setHidden:NO];
        [thumbsdownButton setHidden:NO];
    }

    [titleLabel setStringValue:title];
    [artistLabel setStringValue:artist];
    [albumLabel setStringValue:album];

    if (art != nil) {
        [artView setImage:nil];
        [artProgress startAnimation:self];
        [self performSelectorInBackground:@selector(downloadAlbumArt:) withObject:art];
    }
}

- (void)downloadAlbumArt:(NSString *)art
{
    // Change url string to download album art image of the proper size
    NSInteger imageSize_px = floorf(popup.popupView.bounds.size.width * [NSScreen mainScreen].backingScaleFactor);
    NSRegularExpression *regex = [NSRegularExpression regularExpressionWithPattern:@"(?<=s)[0-9]{1,3}(?=-)" options:NSRegularExpressionCaseInsensitive error:nil];
    NSString *replacementString = [NSString stringWithFormat:@"%ld", (long)imageSize_px];
    art = [regex stringByReplacingMatchesInString:art
                                          options:0
                                            range:NSMakeRange(0, [art length])
                                     withTemplate:replacementString];

    NSURL *url = [NSURL URLWithString:art];
    NSImage *image = [[NSImage alloc] initWithContentsOfURL:url];
    [artView setImage:image];
    [artProgress stopAnimation:self];

    // Update the large mini player if necessary.
    if ([popup.popupView useWhiteIcons])
    {
        [popup.popupView setBackgroundImage:image];
        [popup.popupView setNeedsDisplay:YES];
    }
}

- (void)playbackChanged:(NSInteger)mode
{
    playbackMode = mode;

    if (mode == MUSIC_PLAYING)
        [playPauseButton setImage:[self pauseImage]];
    else
        [playPauseButton setImage:[self playImage]];
}

- (void)playbackTimeChanged:(NSInteger)currentTime totalTime:(NSInteger)totalTime
{
    [playbackSlider setMaxValue:totalTime];
    [playbackSlider setIntegerValue:currentTime];
}

- (void)repeatChanged:(NSString *)mode
{
    repeatMode = mode;

    if ([MUSIC_LIST_REPEAT isEqualToString:mode])
        [repeatButton setImage:[self repeatAllImage]];
    else if ([MUSIC_SINGLE_REPEAT isEqualToString:mode])
        [repeatButton setImage:[self repeatOneImage]];
    else
        [repeatButton setImage:[self repeatNoneImage]];
}

- (void)shuffleChanged:(NSString *)mode
{
    shuffleMode = mode;

    if ([MUSIC_ALL_SHUFFLE isEqualToString:mode])
        [shuffleButton setImage:[self shuffleOnImage]];
    else
        [shuffleButton setImage:[self shuffleOffImage]];
}

- (void)ratingChanged:(NSInteger)rating
{
    songRating = rating;

    if (rating == MUSIC_RATING_THUMBSUP)
    {
        [thumbsupButton setImage:[self thumbsUpOnImage]];
        [thumbsdownButton setImage:[self thumbsDownOffImage]];
    }
    else if (rating == MUSIC_RATING_THUMBSDOWN)
    {
        [thumbsupButton setImage:[self thumbsUpOffImage]];
        [thumbsdownButton setImage:[self thumbsDownOnImage]];
    }
    else
    {
        [thumbsupButton setImage:[self thumbsUpOffImage]];
        [thumbsdownButton setImage:[self thumbsDownOffImage]];
    }
}

- (void)setPlaybackTime:(id)sender
{
    NSInteger value = [playbackSlider integerValue];
    [appDelegate setPlaybackTime:value];
}

- (void)togglePlayerSize:(id)sender
{
    if ([popup.popupView isLargePlayer])
        [[appDelegate defaults] setBool:NO forKey:@"miniplayer.large"];
    else
        [[appDelegate defaults] setBool:YES forKey:@"miniplayer.large"];

    [popup.popupView togglePlayerSize];
}

- (void)showMainWindow:(id)selector
{
    [NSApp activateIgnoringOtherApps:YES];
    [[appDelegate window] makeKeyAndOrderFront:self];

    if ([popup docked])
        [popup close];
}

- (void)actionButtonSelector:(id)sender
{
    // If the popup is docked, the action button brings the main window.
    if ([popup docked])
    {
        [self showMainWindow:sender];
    }
    // Otherwise, it shows a context menu.
    else
    {
        [actionButtonMenu popUpMenuPositioningItem:nil atLocation:[NSEvent mouseLocation] inView:nil];
    }
}

- (void)popupDidDock
{
    [actionButton setImage:[self actionButtonImage]];
    [actionButtonTopConstraint setConstant:10];
    [popup.popupView setNeedsDisplay:YES];
}

- (void)popupDidUndock
{
    [actionButton setImage:[self actionButtonImage]];
    [actionButtonTopConstraint setConstant:5];
    [popup.popupView setNeedsDisplay:YES];
}

#pragma mark - Image code

- (NSImage *)repeatNoneImage
{
    if ([popup.popupView useWhiteIcons])
        return [Utilities imageFromName:@"repeat_none_white"];
    else
        return [Utilities imageFromName:@"repeat_none"];
}

- (NSImage *)repeatOneImage
{
    return [Utilities imageFromName:@"repeat_single"];
}

- (NSImage *)repeatAllImage
{
    return [Utilities imageFromName:@"repeat_list"];
}

- (NSImage *)backImage
{
    if ([popup.popupView useWhiteIcons])
        return [Utilities imageFromName:@"previous_white"];
    else
        return [Utilities imageFromName:@"previous"];
}

- (NSImage *)playImage
{
    if ([popup.popupView useWhiteIcons])
        return [Utilities imageFromName:@"play_white"];
    else
        return [Utilities imageFromName:@"play"];
}

- (NSImage *)pauseImage
{
    if ([popup.popupView useWhiteIcons])
        return [Utilities imageFromName:@"pause_white"];
    else
        return [Utilities imageFromName:@"pause"];
}

- (NSImage *)forwardImage
{
    if ([popup.popupView useWhiteIcons])
        return [Utilities imageFromName:@"next_white"];
    else
        return [Utilities imageFromName:@"next"];
}

- (NSImage *)shuffleOffImage
{
    if ([popup.popupView useWhiteIcons])
        return [Utilities imageFromName:@"shuffle_off_white"];
    else
        return [Utilities imageFromName:@"shuffle_off"];
}

- (NSImage *)shuffleOnImage
{
    return [Utilities imageFromName:@"shuffle_on"];
}

- (NSImage *)thumbsUpOffImage
{
    if ([popup.popupView useWhiteIcons])
        return [Utilities imageFromName:@"thumbsup_outline_white"];
    else
        return [Utilities imageFromName:@"thumbsup_outline"];
}

- (NSImage *)thumbsUpOnImage
{
    return [Utilities imageFromName:@"thumbsup_on"];
}

- (NSImage *)thumbsDownOffImage
{
    if ([popup.popupView useWhiteIcons])
        return [Utilities imageFromName:@"thumbsdown_outline_white"];
    else
        return [Utilities imageFromName:@"thumbsdown_outline"];
}

- (NSImage *)thumbsDownOnImage
{
    return [Utilities imageFromName:@"thumbsdown_on"];
}

- (NSImage *)expandContractImage
{
    if ([popup.popupView useWhiteIcons])
        return [Utilities imageFromName:@"arrow_contract_art"];
    else
        return [Utilities imageFromName:@"arrow_expand_art"];
}

- (NSImage *)actionButtonImage
{
    if ([popup docked])
    {
        if ([popup.popupView useWhiteIcons])
            return [Utilities templateImage:NSImageNameEnterFullScreenTemplate withColor:[NSColor colorWithDeviceWhite:0.8 alpha:1.0]];
        else
            return [Utilities templateImage:NSImageNameEnterFullScreenTemplate withColor:[NSColor colorWithDeviceWhite:0.4 alpha:1.0]];
    }
    else
    {
        if ([popup.popupView useWhiteIcons])
            return [[Utilities templateImage:NSImageNameActionTemplate withColor:[NSColor colorWithDeviceWhite:0.8 alpha:1.0]] resizeImage:NSMakeSize(12, 12)];
        else
            return [[Utilities templateImage:NSImageNameActionTemplate withColor:[NSColor colorWithDeviceWhite:0.4 alpha:1.0]] resizeImage:NSMakeSize(12, 12)];
    }
}

- (NSImage *)diceImage
{
    if ([popup.popupView useWhiteIcons])
        return [Utilities imageFromName:@"dice_white"];
    else
        return [Utilities imageFromName:@"dice"];
}

@end


text:
<template name="postInfo">

    {{#if can_edit}}
      | {{i18n "Edit"}}
    {{/if}}

</template>


text:
using System.Threading.Tasks;
using Microsoft.CodeAnalysis.Testing;
using Xunit;
using VerifyCS = Test.Utilities.CSharpCodeFixVerifier<
    Roslyn.Diagnostics.Analyzers.PartsExportedWithMEFv2MustBeMarkedAsSharedAnalyzer,
    Roslyn.Diagnostics.CSharp.Analyzers.CSharpPartsExportedWithMEFv2MustBeMarkedAsSharedFixer>;
using VerifyVB = Test.Utilities.VisualBasicCodeFixVerifier<
    Roslyn.Diagnostics.Analyzers.PartsExportedWithMEFv2MustBeMarkedAsSharedAnalyzer,
    Roslyn.Diagnostics.VisualBasic.Analyzers.BasicPartsExportedWithMEFv2MustBeMarkedAsSharedFixer>;

namespace Roslyn.Diagnostics.Analyzers.UnitTests
{
    public class PartsExportedWithMEFv2MustBeMarkedAsSharedTests
    {
        private const string CSharpWellKnownAttributesDefinition = @"
namespace System.Composition
{
    public class ExportAttribute : System.Attribute
    {
        public ExportAttribute(System.Type contractType){ }
    }

    public class SharedAttribute : System.Attribute
    {
    }
}
";
        private const string BasicWellKnownAttributesDefinition = @"
Namespace System.Composition
	Public Class ExportAttribute
		Inherits System.Attribute
		Public Sub New(contractType As System.Type)
		End Sub
	End Class

	Public Class SharedAttribute
		Inherits System.Attribute
	End Class
End Namespace

";

        #region No Diagnostic Tests

        [Fact]
        public async Task NoDiagnosticCases_ResolvedTypesAsync()
        {
            await VerifyCS.VerifyAnalyzerAsync(@"
using System;
using System.Composition;

[Export(typeof(C)), Shared]
public class C
{
}
" + CSharpWellKnownAttributesDefinition);

            await VerifyVB.VerifyAnalyzerAsync(@"
Imports System
Imports System.Composition

<Export(GetType(C)), [Shared]> _
Public Class C
End Class
" + BasicWellKnownAttributesDefinition);
        }

        [Fact]
        public async Task NoDiagnosticCases_UnresolvedTypesAsync()
        {
            await new VerifyCS.Test
            {
                TestState =
                {
                    Sources =
                    {
                        @"
using System;
using System.{|CS0234:Composition|};

[{|CS0246:{|CS0246:Export|}|}(typeof(C)), {|CS0246:{|CS0246:Shared|}|}]
public class C
{
}
",
                    },
                },
                ReferenceAssemblies = ReferenceAssemblies.Default,
            }.RunAsync();

            await new VerifyVB.Test
            {
                TestState =
                {
                    Sources =
                    {
                        @"
Imports System
Imports System.Composition

<{|BC30002:Export|}(GetType(C)), {|BC30002:[Shared]|}> _
Public Class C
End Class
"
                    },
                },
                ReferenceAssemblies = ReferenceAssemblies.Default,
            }.RunAsync();
        }

        #endregion

        #region Diagnostic Tests

        [Fact]
        public async Task DiagnosticCases_NoSharedAttributeAsync()
        {
            await VerifyCS.VerifyCodeFixAsync(@"
using System;
using System.Composition;

[[|Export(typeof(C))|]]
public class C
{
}
" + CSharpWellKnownAttributesDefinition, @"
using System;
using System.Composition;

[Export(typeof(C))]
[Shared]
public class C
{
}
" + CSharpWellKnownAttributesDefinition);

            await VerifyVB.VerifyCodeFixAsync(@"
Imports System
Imports System.Composition

<[|Export(GetType(C))|]> _
Public Class C
End Class
" + BasicWellKnownAttributesDefinition, @"
Imports System
Imports System.Composition

<Export(GetType(C))> _
<[Shared]>
Public Class C
End Class
" + BasicWellKnownAttributesDefinition);
        }

        [Fact]
        public async Task DiagnosticCases_DifferentSharedAttributeAsync()
        {
            await VerifyCS.VerifyCodeFixAsync(@"
using System;

[[|System.Composition.Export(typeof(C))|], Shared]
public class C
{
}

public class SharedAttribute: Attribute
{
}
" + CSharpWellKnownAttributesDefinition, @"
using System;

[System.Composition.Export(typeof(C)), Shared]
[System.Composition.Shared]
public class C
{
}

public class SharedAttribute: Attribute
{
}
" + CSharpWellKnownAttributesDefinition);

            await VerifyVB.VerifyCodeFixAsync(@"
Imports System

<[|System.Composition.Export(GetType(C))|], [Shared]> _
Public Class C
End Class

Public Class SharedAttribute
    Inherits Attribute
End Class
" + BasicWellKnownAttributesDefinition, @"
Imports System

<System.Composition.Export(GetType(C)), [Shared]> _
<Composition.Shared>
Public Class C
End Class

Public Class SharedAttribute
    Inherits Attribute
End Class
" + BasicWellKnownAttributesDefinition);
        }

        #endregion
    }
}


text:
import {gql} from "apollo-server";

export const queryFiles = gql`
  query {
    files {
      files {
        filename,
        id,
        status,
        storageId,
        createdAt,
        updatedAt,
      }
    }
  }
`;
export const fileQuery = (fileId: string) => gql`
  query {
    file(id: "${fileId}") {
      filename,
      id,
      status,
      storageId,
      createdAt,
      updatedAt,
    }
  }
`;
export const fileUpdateQuery = ({id, filename, storageId, status}) => gql`
  mutation {
    fileUpdate(id: "${id}", filename: "${filename}", storageId: ${storageId}, status: "${status}") {
      filename,
      id,
      status,
      storageId,
      createdAt,
      updatedAt,
    }
  }
`;


text:
use serde_derive::{Deserialize, Serialize};

/// Config for to use Todoist API.
#[derive(Debug, Serialize, Deserialize)]
pub struct TodoistConfig {
    pub api_token: String,
    pub ignore_project_ids: Option<Vec<i64>>,
}

impl TodoistConfig {
    pub fn api_token_owned(&self) -> String {
        self.api_token.clone()
    }
}


text: Wrapper library for setup and usge of the Razor 9DOF sensor board from SparkFun.