text:
package com.marcos.emanuel.projectapp;
import android.app.ProgressDialog;
import android.content.Intent;
import android.content.SharedPreferences;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Color;
import android.os.AsyncTask;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.text.method.ScrollingMovementMethod;
import android.util.Log;
import android.view.View;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.TextView;
import com.jcraft.jsch.Channel;
import com.jcraft.jsch.ChannelExec;
import com.jcraft.jsch.JSch;
import com.jcraft.jsch.Session;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.DatagramPacket;
import java.net.DatagramSocket;
import java.net.SocketException;
import java.util.Properties;

public class MainActivity extends AppCompatActivity {
    private String command, ip, password, user, output;
    private SharedPreferences toSend;
    private SharedPreferences.Editor editor;
    private Button stop, park, videostream;
    private boolean stop_ = false, parked = false, streaming = false;
    private EditText IP, input, userText, passText;
    private TextView shell;
    private UdpServerThread udpServerThread;
    private ProgressDialog pDialog;
    private ImageView image;
    private DatagramSocket socket;
    private BitmapFactory.Options options;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        View mainView = findViewById(R.id.activity_main);
        View root = mainView.getRootView();
        root.setBackgroundColor(getResources().getColor(android.R.color.background_light));
        getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
        getSupportActionBar().hide();
        stop = (Button) findViewById(R.id.Stop);
        park = (Button) findViewById(R.id.Parker);
        stop.setBackgroundColor(Color.GREEN);
        park.setText("Park");
        toSend = getSharedPreferences("myPreferences", 0);
        IP = (EditText) findViewById(R.id.IPedit);
        input = (EditText) findViewById(R.id.sshText);
        videostream = (Button) findViewById(R.id.Stream);
        videostream.setText("Video Stream");
        shell = (TextView) findViewById(R.id.shell);
        userText = (EditText) findViewById(R.id.userText);
        passText = (EditText) findViewById(R.id.passText);
        shell.setMovementMethod(new ScrollingMovementMethod());

        image = (ImageView) findViewById(R.id.imageView);

    }
    // on click listener
    public void onClick(View v) {
        editor = toSend.edit();
        ip = IP.getText().toString().trim();
        password = passText.getText().toString().trim();
        user = userText.getText().toString().trim();
        editor.putString("IP", ip);

        switch (v.getId()) {
            case R.id.Stop:
                if (stop_) {
                    stop_ = false;
                    stop.setBackgroundColor(Color.GREEN);
                    stop.setText("Stop");
                    editor.putString("Function", "move");
                } else {
                    stop_ = true;
                    stop.setBackgroundColor(Color.RED);
                    stop.setText("Stopped!");
                    editor.putString("Function", "stop");
                }
                startService(v);
                break;
            case R.id.Overtaker:
                editor.putString("Function", "overtake");
                startService(v);
                break;
            case R.id.Parker:
                if (parked) {
                    parked = false;
                    park.setText("Park");
                    editor.putString("Function", "unpark");
                } else {
                    parked = true;
                    park.setText("Unpark");
                    editor.putString("Function", "park");
                }
                startService(v);
                break;
            case R.id.Connect:
                command = input.getText().toString().trim();
                new ExecuteRemoteCommand().execute();
                break;
            case R.id.Stream:
                if (streaming) {
                    streaming = false;
                    videostream.setText("Video Stream");
                    Stop();
                } else {
                    streaming = true;
                    videostream.setText("Stop Stream");
                    Start();
                }
                break;
            default:
                throw new RuntimeException("Button ID unknown");
        }
        editor.commit();
        stopService(v);
    }
    // start udp sender service method, used to send udp packets
    public void startService(View view) {
        startService(new Intent(getBaseContext(), UDPSender.class));
    }
    // stop udp sender service
    public void stopService(View view) {
        stopService(new Intent(getBaseContext(), UDPSender.class));
    }

    // start udp receiver thred, used to receive video stream via udp packets
    protected void Start() {
        udpServerThread = new UdpServerThread(1234);
        udpServerThread.start();
    }
    // stop udp receiver
    protected void Stop() {
        if (udpServerThread != null) {
            udpServerThread.setRunning(false);
            udpServerThread = null;
            socket.close();
        }
    }
    // method to update the image view with new frames
    private void updateState(final Bitmap img) {
        runOnUiThread(new Runnable() {
            @Override
            public void run() {
                image.setImageBitmap(img);
            }
        });
    }
    // for debugging purposes, a print is done into the shell edit text to signal stream start
    private void updatePrompt(final String prompt) {
        runOnUiThread(new Runnable() {
            @Override
            public void run() {
                shell.setText(prompt);
            }
        });
    }
    // upd receiver class runs on its own thread
    private class UdpServerThread extends Thread {
        int serverPort;
        boolean running;

        public UdpServerThread(int serverPort) {
            super();
            this.serverPort = serverPort;
        }

        public void setRunning(boolean running) {
            this.running = running;
        }

        @Override
        public void run() {
            running = true;
            String TAG = MainActivity.class.getSimpleName();
            try {
                socket = new DatagramSocket(serverPort);

                Log.e(TAG, "UDP Server is running");

                while (running) {
                    byte[] buf = new byte[60000];

                    // receive request
                    DatagramPacket packet = new DatagramPacket(buf, buf.length);
                    socket.receive(packet);     //this code block the program flow

                    buf = packet.getData();

                    final Bitmap new_img = BitmapFactory.decodeByteArray(buf, 0,
                            buf.length);

                    updateState(new_img);
                    updatePrompt("Stream started");
                }

                Log.e(TAG, "UDP Server ended");

            } catch (SocketException e) {
                e.printStackTrace();
            } catch (IOException e) {
                e.printStackTrace();
            } finally {
                if (socket != null) {
                    socket.close();
                    Log.e(TAG, "socket.close()");
                }
            }
        }
    }

     //Async class responsible for ssh functionality
    private class ExecuteRemoteCommand extends AsyncTask<String, Void, String> {
        @Override
        protected void onPreExecute() {
            super.onPreExecute();
            // Showing progress dialog
            pDialog = new ProgressDialog(MainActivity.this);
            pDialog.setMessage("Processing command...");
            pDialog.setCancelable(false);
            pDialog.show();
        }

        // doInBackGround method executes the string input into the edit text field by the user
        // on the targed device, generating a string with the echo resulting from the command
        @Override
        protected String doInBackground(String... params) {
            try {
                JSch jsch = new JSch();
                Session session = jsch.getSession(user, ip, 22);
                session.setPassword(password);

                Properties prop = new Properties();
                prop.put("StrictHostKeyChecking", "no");
                session.setConfig(prop);

                session.connect();

                Channel channel = session.openChannel("exec");
                ((ChannelExec) channel).setCommand(command);

                channel.setInputStream(null);

                InputStream in = channel.getInputStream();
                ((ChannelExec) channel).setErrStream(System.err);

                channel.connect();

                BufferedReader r = new BufferedReader(new InputStreamReader(in));
                StringBuilder total = new StringBuilder();
                String line;
                while ((line = r.readLine()) != null) {
                    total.append(line).append('\n');
                }

                output = total.toString();
                System.out.println(output);

                channel.disconnect();
                session.disconnect();

            } catch (Exception e) {
                e.printStackTrace();
            }
            return output;
        }
        // Updates the text field shell with the result string
        @Override
        protected void onPostExecute(String result) {
            if (pDialog.isShowing())
                pDialog.dismiss();
            shell.setText(output);
        }
    }
}


text:
from google.cloud import metastore_v1alpha

def sample_list_services():
    # Create a client
    client = metastore_v1alpha.DataprocMetastoreClient()

    # Initialize request argument(s)
    request = metastore_v1alpha.ListServicesRequest(
        parent="parent_value",
    )

    # Make the request
    page_result = client.list_services(request=request)

    # Handle the response
    for response in page_result:
        print(response)

# [END metastore_v1alpha_generated_DataprocMetastore_ListServices_sync]

redpajama_set_name: RedPajamaGithub


text:
<?php

namespace ZendTest\ComponentInstaller\Injector;

use Composer\IO\IOInterface;
use PHPUnit_Framework_TestCase as TestCase;
use Prophecy\Argument;
use Zend\ComponentInstaller\Injector\NoopInjector;

class NoopInjectorTest extends TestCase
{
    public function setUp()
    {
        $this->injector = new NoopInjector();
    }

    /**
     * @dataProvider packageTypes
     */
    public function testWillRegisterAnyType($type)
    {
        $this->assertTrue($this->injector->registersType($type), 'NoopInjector does not register type ' . $type);
    }

    public function testGetTypesAllowedReturnsNoTypes()
    {
        $this->assertEquals([], $this->injector->getTypesAllowed());
    }

    public function packageTypes()
    {
        return [
            'config-provider' => [NoopInjector::TYPE_CONFIG_PROVIDER],
            'component'       => [NoopInjector::TYPE_COMPONENT],
            'module'          => [NoopInjector::TYPE_MODULE],
        ];
    }

    /**
     * @dataProvider packageTypes
     */
    public function testInjectIsANoop($type)
    {
        $io = $this->prophesize(IOInterface::class);
        $io->write(Argument::any())->shouldNotBeCalled();
        $this->assertNull($this->injector->inject('Foo\Bar', $type, $io->reveal()));
    }

    /**
     * @dataProvider packageTypes
     */
    public function testRemoveIsANoop($type)
    {
        $io = $this->prophesize(IOInterface::class);
        $io->write(Argument::any())->shouldNotBeCalled();
        $this->assertNull($this->injector->remove('Foo\Bar', $io->reveal()));
    }
}


text:
Odyn CLI
---------

Commands

    alias       Create, list or delete a device alias
    config      Configure local or remote settings
    device      Create, list, describe or delete a device
    push        Push cloud variable data to the remote server
    org         Create, describe, modify or delete an an organization
    fetch       Fetch cloud variable data from the remote server
    subscribe   Listen to the remote server for changes to a cloud variable
    user        Create, describe, modify or delete an a user

All devices belong to either a user or an organization.

    push http://odyn.io/MyOrg/MyDevice/gps/latitude 53.43232

    odyn config remote.db.backend "cassandra"

Quick Start Guide
---------

Installation:

    apt-get install odyn

Start the server:

    sudo service odyn start

Create a user (named "Leela"):

    odyn user --create Leela

    (You will be prompted to set a password)

Create a device:

    odyn device --create Leela.HealthMonitor

Push data to the server:

    odyn push Leela.HealthMonitor.heartrate 140.3

Monitor data from the server (ctrl-C to cancel):

    odyn subscribe Leela.HealthMonitor

View the device's admin webpage:

    In your browser, go to: http://localhost:7280/Leela/HealthMonitor


text:
'use strict';
const fs = require('fs');
const path = require('path');
const yargs = require('yargs');
const chalk = require('chalk');
const npmLatestVersion = require('latest-version');
const download = require('./download');
const validateProjectName = require('validate-npm-package-name');

yargs
  .scriptName(`npx bloggerpack-create`)
  .usage('')
  .usage(`Usage: $0 ${chalk.cyan('<project-directory>')} [options]`)
  .demandCommand(
    1, 1,
    `Please specify the project directory.`,
    `Project directory can't contain spaces.`
  )
  .check((argv) => {
    const projectName = path.basename(argv._[0]);
    const projectPath = path.resolve(argv._[0]);
    const validationResult = validateProjectName(projectName);

    if (!validationResult.validForNewPackages) {
      console.log();
      console.error(
        chalk.red(`Cannot create a project named ${chalk.cyan(`"${projectName}"`)} because of npm naming restrictions:`)
      );
      console.log();
      [
        ...(validationResult.errors || []),
        ...(validationResult.warnings || []),
      ].forEach(error => {
        console.error(chalk.red(`   * ${error}`));
      });
      console.log();
      console.error(chalk.red('Please choose a different project name.'));
      yargs.showHelp();
      process.exit(1);
    }
    if (fs.existsSync(projectPath)) {
      console.log();
      console.error(chalk.red(`The ${chalk.cyan(projectPath)} already exists.`));
      console.log();
      console.log(chalk.red(`Please choose a different name or path.`));
      yargs.showHelp();
      process.exit(1);
    }

    return true;
  })
  .fail(function (msg, err, yargs) {
    if (err) throw err;
    console.log();
    console.error(chalk.red(msg));
    yargs.showHelp();
    process.exit(1);
  })
  .options({
    's': {
      alias: 'source',
      type: 'string',
      choices: ['npm', 'git', 'archive'],
      describe: `Set source`,
      demandOption: true
    },
    't': {
      alias: 'template',
      type: 'string',
      describe: `Set starter template`,
      demandOption: true
    }
  })
  .example('')
  .example(`${chalk.yellow('npm\n----------')}`)
  .example('')
  .example(`$ $0 ${chalk.cyan('<project-directory>')} -s ${chalk.cyan('npm')} -t ${chalk.cyan('<package>')}`)
  .example('')
  .example(`${chalk.yellow('# Latest version')}`)
  .example(`$ $0 ${chalk.cyan('project-name')} -s ${chalk.cyan('npm')} -t ${chalk.cyan('package-name')}`)
  .example(`${chalk.yellow('# Latest version with scoped package')}`)
  .example(`$ $0 ${chalk.cyan('project-name')} -s ${chalk.cyan('npm')} -t ${chalk.cyan('@org-name/package-name')}`)
  .example('')
  .example(`${chalk.yellow('# Latest 1.x.x')}`)
  .example(`$ $0 ${chalk.cyan('project-name')} -s ${chalk.cyan('npm')} -t ${chalk.cyan('package-name@1')}`)
  .example(`$ $0 ${chalk.cyan('project-name')} -s ${chalk.cyan('npm')} -t ${chalk.cyan('@org-name/package-name@1')}`)
  .example('')
  .example(`${chalk.yellow('# Latest 1.2.x')}`)
  .example(`$ $0 ${chalk.cyan('project-name')} -s ${chalk.cyan('npm')} -t ${chalk.cyan('package-name@1.2')}`)
  .example(`$ $0 ${chalk.cyan('project-name')} -s ${chalk.cyan('npm')} -t ${chalk.cyan('@org-name/package-name@1.2')}`)
  .example('')
  .example(`${chalk.yellow('# Specific version')}`)
  .example(`$ $0 ${chalk.cyan('project-name')} -s ${chalk.cyan('npm')} -t ${chalk.cyan('package-name@1.2.3')}`)
  .example(`$ $0 ${chalk.cyan('project-name')} -s ${chalk.cyan('npm')} -t ${chalk.cyan('@org-name/package-name@1.2.3')}`)
  .example('')
  .example(`${chalk.yellow('git\n----------')}`)
  .example('')
  .example(`$ $0 ${chalk.cyan('<project-directory>')} -s ${chalk.cyan('git')} -t ${chalk.cyan('<git-host>:<user>/<repo>#<branch|tag>')}`)
  .example('')
  .example(`${chalk.yellow('# Branch')}`)
  .example(`$ $0 ${chalk.cyan('project-name')} -s ${chalk.cyan('git')} -t ${chalk.cyan('github:username/repo-name#main')}`)
  .example(`$ $0 ${chalk.cyan('project-name')} -s ${chalk.cyan('git')} -t ${chalk.cyan('gitlab:username/repo-name#master')}`)
  .example('')
  .example(`${chalk.yellow('# Tag')}`)
  .example(`$ $0 ${chalk.cyan('project-name')} -s ${chalk.cyan('git')} -t ${chalk.cyan('github:username/repo-name#v1.0.0')}`)
  .example(`$ $0 ${chalk.cyan('project-name')} -s ${chalk.cyan('git')} -t ${chalk.cyan('gitlab:username/repo-name#v1.0.0')}`)
  .example('')
  .example(`${chalk.yellow('archive\n----------')}`)
  .example('')
  .example(`$ $0 ${chalk.cyan('project-name')} -s ${chalk.cyan('archive')} -t ${chalk.cyan('https://example.com/awesome-starter.zip')}`)
  .wrap(null)
  .help('help')
  .alias('h', 'help')
  .describe('help', `Show help`)
  .version()
  .alias('v', 'version')
  .describe('version', `Show version number`);

const argv = yargs.argv;

(async () => {
  const args = {
    projectName: path.basename(argv._[0]),
    projectPath: path.resolve(argv._[0]),
    bpLatestVersion: (await npmLatestVersion('bloggerpack')).trim(),
    argv: argv
  };
  let uri = '';

  if (argv.source === 'npm') {
    // `<@scope>/<name>` or `<@scope>/<name>@<version>`
    let isScope = argv.template.includes('/');
    let isScopeHasVersion = isScope ? argv.template.split('/')[1].includes('@') : false;
    let scopeOrg = isScope ? argv.template.split('/')[0] : '';
    let scopePkgName = isScope ? argv.template.split('/')[1].split('@')[0] : '';
    let scopePkgVersion = isScope && isScopeHasVersion ? argv.template.split('/')[1].split('@')[1] : '';
    let scopePkgVersionLatest = isScope ? await npmLatestVersion(scopeOrg + '/' +scopePkgName) : '';
    let scopePkgVersionLatestX = isScope ? await npmLatestVersion(scopeOrg + '/' +scopePkgName, { version: scopePkgVersion }) : '';
    scopePkgVersion = scopePkgVersion === '' ? scopePkgVersionLatest : scopePkgVersionLatestX;

    // `<name>` or `<name>@<version>`
    let hasVersion = !isScope ? argv.template.includes('@') : false;
    let pkgName = !isScope ? argv.template.split('@')[0] : '';
    let pkgVersion = !isScope && hasVersion ? argv.template.split('@')[1] : '';
    let pkgVersionLatest = !isScope ? await npmLatestVersion(pkgName) : '';
    let pkgVersionLatestX = !isScope ? await npmLatestVersion(pkgName, { version: pkgVersion }) : '';
    pkgVersion = pkgVersion === '' ? pkgVersionLatest : pkgVersionLatestX;

    if (isScope) {
      uri = `https://registry.npmjs.org/${scopeOrg}/${scopePkgName}/-/${scopePkgName}-${scopePkgVersion}.tgz`;
    }
    if (!isScope) {
      uri = `https://registry.npmjs.org/${pkgName}/-/${pkgName}-${pkgVersion}.tgz`;
    }
  }

  if (argv.source === 'git') {
    let gitHost = argv.template.split(':')[0];
    let gitUserRepo = argv.template.split('#')[0].split(':')[1];
    let gitBranchTag = argv.template.split('#')[1];
    let gitRepo = argv.template.split('/').pop().split('#')[0];

    if (gitBranchTag === undefined || gitHost === undefined || gitUserRepo.includes('/') === false) {
      console.log();
      console.error(`Please specify ${chalk.cyan('<git-host>')}, ${chalk.cyan('<user>/<repo>')}, ${chalk.cyan('<branch>')} or ${chalk.cyan('<tag>')}.`);
      console.log();
      console.log(`For example: ${chalk.cyan('<git-host>:<user>/<repo>#<branch|tag>')}`);
      console.log();
      console.log('---');
      yargs.showHelp();
      process.exit(1);
    }

    if (argv.source === 'git' && gitHost === 'github') {
      uri = `https://github.com/${gitUserRepo}/archive/${gitBranchTag}.zip`;
    }
    if (argv.source === 'git' && gitHost === 'gitlab') {
      uri = `https://gitlab.com/${gitUserRepo}/-/archive/${gitBranchTag}/${gitRepo}-${gitBranchTag}.zip`;
    }
  }

  if (argv.source === 'archive') {
    uri = argv.template;
  }

  download(uri, argv._[0], args);
})();


text:
txt2ppt
=======

Converts plain text ("presentations in Python-like syntax") and uses COM Client code to build a Microsoft PowerPoint® presentation, apply a generic template, and starts the slideshow


text:
package kz.rio.endpoint

import java.util.concurrent.TimeUnit

import akka.actor.{Props, ActorRef, ActorLogging, Actor}
import com.github.sstone.amqp.Amqp.Publish
import com.github.sstone.amqp.{Amqp, ChannelOwner, ConnectionOwner}
import com.rabbitmq.client.AMQP.BasicProperties
import kz.rio.core.ServiceActor
import kz.rio.domain.{Endpoint, DomainMessage, Echo, Pong}
import kz.rio.endpoint.ResponderActor.PublishReplay
import org.json4s.ShortTypeHints
import org.json4s.native.Serialization
import org.json4s.native.Serialization._

/**
 * Created by irybakov on 1/12/16.
 */

object ResponderActor {

  case class PublishReplay(replyTo: String, correlationId: String,dm: DomainMessage)

  def props(amqpConnection: ActorRef,endpoint: Endpoint,outboundGate: String): Props =  Props(classOf[ResponderActor],amqpConnection,endpoint,outboundGate)

}

class ResponderActor(amqpConnection: ActorRef,endpoint: Endpoint,outboundGate: String) extends Actor with ActorLogging {

  import context._
  implicit val formats = Serialization.formats(ShortTypeHints(List(classOf[Pong],classOf[Echo])))

  val producer = ConnectionOwner.createChildActor(amqpConnection, ChannelOwner.props())
  Amqp.waitForConnection(system, amqpConnection, producer).await(5, TimeUnit.SECONDS)

  override def receive = {
    case p @ PublishReplay(replayTo,correlationId, dm) => publish(write[DomainMessage](p.dm),p.correlationId,p.replyTo)

    //case Pong(pong) => producer ! Publish("amq.topic", "pong.replay", pong.getBytes, properties = None, mandatory = true, immediate = false)
    //case Echo(echo) => producer ! Publish("amq.topic", "echo.replay", echo.getBytes, properties = None, mandatory = true, immediate = false)
  }

  def publish (body: String, correlationId: String, replyTo: String)= {

    val props = new BasicProperties(null,null,null,1,null,correlationId,null,null,null,null,null,null,null,null)
    producer ! Publish(outboundGate, replyTo, body.getBytes(), properties = Some(props), mandatory = true, immediate = false)
    log.info("Replay {}", body)
  }
}


text:
/**
 * Swaggy Jenkins
 * Jenkins API clients generated from Swagger / Open API specification
 *
 * The version of the OpenAPI document: 1.5.1-pre.0
 * Contact: blah@cliffano.com
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */

#include "OAIAllView.h"

#include <QDebug>
#include <QJsonArray>
#include <QJsonDocument>
#include <QObject>

#include "OAIHelpers.h"

namespace OpenAPI {

OAIAllView::OAIAllView(QString json) {
    this->initializeModel();
    this->fromJson(json);
}

OAIAllView::OAIAllView() {
    this->initializeModel();
}

OAIAllView::~OAIAllView() {}

void OAIAllView::initializeModel() {

    m__class_isSet = false;
    m__class_isValid = false;

    m_name_isSet = false;
    m_name_isValid = false;

    m_url_isSet = false;
    m_url_isValid = false;
}

void OAIAllView::fromJson(QString jsonString) {
    QByteArray array(jsonString.toStdString().c_str());
    QJsonDocument doc = QJsonDocument::fromJson(array);
    QJsonObject jsonObject = doc.object();
    this->fromJsonObject(jsonObject);
}

void OAIAllView::fromJsonObject(QJsonObject json) {

    m__class_isValid = ::OpenAPI::fromJsonValue(_class, json[QString("_class")]);
    m__class_isSet = !json[QString("_class")].isNull() && m__class_isValid;

    m_name_isValid = ::OpenAPI::fromJsonValue(name, json[QString("name")]);
    m_name_isSet = !json[QString("name")].isNull() && m_name_isValid;

    m_url_isValid = ::OpenAPI::fromJsonValue(url, json[QString("url")]);
    m_url_isSet = !json[QString("url")].isNull() && m_url_isValid;
}

QString OAIAllView::asJson() const {
    QJsonObject obj = this->asJsonObject();
    QJsonDocument doc(obj);
    QByteArray bytes = doc.toJson();
    return QString(bytes);
}

QJsonObject OAIAllView::asJsonObject() const {
    QJsonObject obj;
    if (m__class_isSet) {
        obj.insert(QString("_class"), ::OpenAPI::toJsonValue(_class));
    }
    if (m_name_isSet) {
        obj.insert(QString("name"), ::OpenAPI::toJsonValue(name));
    }
    if (m_url_isSet) {
        obj.insert(QString("url"), ::OpenAPI::toJsonValue(url));
    }
    return obj;
}

QString OAIAllView::getClass() const {
    return _class;
}
void OAIAllView::setClass(const QString &_class) {
    this->_class = _class;
    this->m__class_isSet = true;
}

bool OAIAllView::is__class_Set() const{
    return m__class_isSet;
}

bool OAIAllView::is__class_Valid() const{
    return m__class_isValid;
}

QString OAIAllView::getName() const {
    return name;
}
void OAIAllView::setName(const QString &name) {
    this->name = name;
    this->m_name_isSet = true;
}

bool OAIAllView::is_name_Set() const{
    return m_name_isSet;
}

bool OAIAllView::is_name_Valid() const{
    return m_name_isValid;
}

QString OAIAllView::getUrl() const {
    return url;
}
void OAIAllView::setUrl(const QString &url) {
    this->url = url;
    this->m_url_isSet = true;
}

bool OAIAllView::is_url_Set() const{
    return m_url_isSet;
}

bool OAIAllView::is_url_Valid() const{
    return m_url_isValid;
}

bool OAIAllView::isSet() const {
    bool isObjectUpdated = false;
    do {
        if (m__class_isSet) {
            isObjectUpdated = true;
            break;
        }

        if (m_name_isSet) {
            isObjectUpdated = true;
            break;
        }

        if (m_url_isSet) {
            isObjectUpdated = true;
            break;
        }
    } while (false);
    return isObjectUpdated;
}

bool OAIAllView::isValid() const {
    // only required properties are required for the object to be considered valid
    return true;
}

} // namespace OpenAPI


text:
In previous versions of NativeScript-Vue `console.log` was overriden to bring better logging and colors to your console.
It was [removed in this commit](https://github.com/nativescript-vue/nativescript-vue/commit/226e108b92273b7a2f3e133e71f9f4fe3f5935b0) to improve perfomance and reduce the size of our bundle.

If you however need this in your app, you can bring it back at an application level.

Keep in mind that this override should not be present in production.

```bash
$ npm install --save-dev util-inspect
```

In your main app file:

```js
import Vue from 'nativescript-vue'

if (TNS_ENV !== 'production') {
    const inspect = require('util-inspect');
    const newLineRegExp = /\\n/g
    console.log = (function(log, inspect, Vue) {
        return function(...args) {
            return log.call(
                this,
                ...Array.prototype.map.call(args, function(arg) {
                    return inspect(arg, {
                    depth: 2,
                    colors: Vue.config.debug,
                    showHidden: true
                    }).replace(newLineRegExp, '\n')
                })
            )
        }
    })(console.log, inspect, Vue);
}
```

With this change, everything should work the way it worked before we removed our override.


text:
var bar = this;
console.log(bar);


text:
package org.springframework.cloud.stream.binder;

import java.util.Map;

/**
 * A registry of {@link BinderType}s, indexed by name. A {@link BinderTypeRegistry} bean
 * is created automatically based on information found in the
 * {@literal META-INF/spring.binders} files provided by binder implementors.
 *
 * @author Marius Bogoevici
 */
public interface BinderTypeRegistry {

	BinderType get(String name);

	Map<String, BinderType> getAll();

}


text:
// Copyright 2017 The Nomulus Authors. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package google.registry.rdap;

import static com.google.common.truth.Truth.assertThat;
import static org.junit.jupiter.api.Assertions.assertThrows;

import google.registry.request.HttpException.UnprocessableEntityException;
import org.junit.jupiter.api.Test;

/** Unit tests for {@link RdapSearchPattern}. */
class RdapSearchPatternTest {

  @Test
  void testNoWildcards_ok() {
    RdapSearchPattern rdapSearchPattern = RdapSearchPattern.createFromLdhDomainName("example.lol");
    assertThat(rdapSearchPattern.getInitialString()).isEqualTo("example.lol");
    assertThat(rdapSearchPattern.getHasWildcard()).isFalse();
    assertThat(rdapSearchPattern.getSuffix()).isNull();
  }

  @Test
  void testWildcardNoTld_ok() {
    RdapSearchPattern rdapSearchPattern = RdapSearchPattern.createFromLdhDomainName("exam*");
    assertThat(rdapSearchPattern.getInitialString()).isEqualTo("exam");
    assertThat(rdapSearchPattern.getHasWildcard()).isTrue();
    assertThat(rdapSearchPattern.getSuffix()).isNull();
  }

  @Test
  void testWildcardTld_ok() {
    RdapSearchPattern rdapSearchPattern = RdapSearchPattern.createFromLdhDomainName("exam*.lol");
    assertThat(rdapSearchPattern.getInitialString()).isEqualTo("exam");
    assertThat(rdapSearchPattern.getHasWildcard()).isTrue();
    assertThat(rdapSearchPattern.getSuffix()).isEqualTo("lol");
  }

  @Test
  void testWildcardAtStart_ok() {
    RdapSearchPattern rdapSearchPattern = RdapSearchPattern.createFromLdhDomainName("*.lol");
    assertThat(rdapSearchPattern.getInitialString()).isEmpty();
    assertThat(rdapSearchPattern.getHasWildcard()).isTrue();
    assertThat(rdapSearchPattern.getSuffix()).isEqualTo("lol");
  }

  @Test
  void testWildcardOnly_ok() {
    RdapSearchPattern rdapSearchPattern = RdapSearchPattern.createFromLdhDomainName("*");
    assertThat(rdapSearchPattern.getInitialString()).isEmpty();
    assertThat(rdapSearchPattern.getHasWildcard()).isTrue();
    assertThat(rdapSearchPattern.getSuffix()).isNull();
  }

  @Test
  void testMultipleWildcards_unprocessable() {
    assertThrows(
        UnprocessableEntityException.class,
        () -> RdapSearchPattern.createFromLdhDomainName("ex*am*.lol"));
  }

  @Test
  void testWildcardNotAtEnd_unprocessable() {
    assertThrows(
        UnprocessableEntityException.class,
        () -> RdapSearchPattern.createFromLdhDomainName("ex*am"));
  }

  @Test
  void testWildcardNotAtEndWithTld_unprocessable() {
    assertThrows(
        UnprocessableEntityException.class,
        () -> RdapSearchPattern.createFromLdhDomainName("ex*am.lol"));
  }

  @Test
  void testShortString_ok() {
    RdapSearchPattern rdapSearchPattern = RdapSearchPattern.createFromLdhDomainName("e");
    assertThat(rdapSearchPattern.getInitialString()).isEqualTo("e");
    assertThat(rdapSearchPattern.getHasWildcard()).isFalse();
    assertThat(rdapSearchPattern.getSuffix()).isNull();
  }

  @Test
  void testZeroLengthSuffix_unprocessable() {
    assertThrows(
        UnprocessableEntityException.class,
        () -> RdapSearchPattern.createFromLdhDomainName("exam*."));
  }

  @Test
  void testNextInitialString_alpha() {
    RdapSearchPattern rdapSearchPattern = RdapSearchPattern.createFromLdhDomainName("exam*.lol");
    assertThat(rdapSearchPattern.getNextInitialString()).isEqualTo("exan");
  }

  @Test
  void testNextInitialString_unicode_translatedToPunycode() {
    RdapSearchPattern rdapSearchPattern =
        RdapSearchPattern.createFromLdhOrUnicodeDomainName("cat.みんな");
    assertThat(rdapSearchPattern.getNextInitialString()).isEqualTo("cat.xn--q9jyb4d");
  }

  @Test
  void testUnicodeString_noWildcard() {
    RdapSearchPattern rdapSearchPattern =
        RdapSearchPattern.createFromUnicodeString("unicode みんに string");
    assertThat(rdapSearchPattern.getInitialString()).isEqualTo("unicode みんに string");
    assertThat(rdapSearchPattern.getHasWildcard()).isFalse();
    assertThat(rdapSearchPattern.getSuffix()).isNull();
  }

  @Test
  void testUnicodeString_withWildcard() {
    RdapSearchPattern rdapSearchPattern =
        RdapSearchPattern.createFromUnicodeString("unicode みんに string*");
    assertThat(rdapSearchPattern.getInitialString()).isEqualTo("unicode みんに string");
    assertThat(rdapSearchPattern.getHasWildcard()).isTrue();
    assertThat(rdapSearchPattern.getSuffix()).isNull();
  }

  @Test
  void testUnicodeString_middleWildcard() {
    assertThrows(
        UnprocessableEntityException.class,
        () -> RdapSearchPattern.createFromLdhDomainName("unicode みんに *string"));
  }
}


text:
const timeStart = Date.now();

class Animator {

	/* easeFn should be an easing function (t in, t out). applyFn is called with the resulting t value */
	static animate(duration, easeFn, applyFn) {

		return new Promise(function animationLoop(resolve) {

			let timestampStart = Date.now() - timeStart,
				tick = timestamp => {

					let d = timestamp - timestampStart;
					if (d >= duration) {
						applyFn(1);
						return resolve(1);
					}

					let t = easeFn( d / duration );
					applyFn(t);

					window.requestAnimationFrame(tick);

				};

			tick(timestampStart);

		});

	}

}

export default Animator;


text:
id: 58966a17f9fc0f352b528e6d
title: Registration of New Users
challengeType: 2
videoUrl: ''
localeTitle: 新用户注册
---

## Description

提醒一下,这个项目是基于Glitch的以下入门项目构建的,或者是从GitHub克隆的。现在我们需要允许我们网站上的新用户注册一个帐户。在主页的res.render上,向传递的对象添加一个新变量 - showRegistration: true 。刷新页面时,您应该会看到已在index.pug文件中创建的注册表单!此表单设置为POST on / register,因此我们应该设置此接受POST并在数据库中创建用户对象。注册路由的逻辑应如下所示:注册新用户>验证新用户>重定向到/配置文件步骤1的逻辑,注册新用户,应如下所示:使用findOne命令查询数据库>如果用户返回然后它存在并重定向回到主页或者如果用户未定义且没有发生错误,则使用用户名和密码将"insertOne"输入数据库,只要没有错误发生,然后调用next转到步骤2,验证新的user,我们已经在POST / login路由中编写了逻辑。
 app.route( '/寄存器')
  .post((req,res,next)=> {
      db.collection('users')。findOne({username:req.body.username},function(err,user){
          if(错误){
              下一个(ERR);
          } else if(user){
              res.redirect( '/');
          } else {
              db.collection( '用户')。insertOne(
                {username:req.body.username,
                 密码:req.body.password},
                (错误,doc)=> {
                    if(错误){
                        res.redirect( '/');
                    } else {
                        next(null,user);
                    }
                }
              )
          }
      })},
    passport.authenticate('local',{failureRedirect:'/'}),
    (req,res,next)=> {
        res.redirect( '/简档');
    }
);
当您认为自己已经做对时,请提交您的页面。如果您遇到错误,可以在这里查看到目前为止完成的项目。

## Instructions

## Tests

```yml
tests:
  - text: 注册路线并在家中显示
    testString: 'getUserInput => $.get(getUserInput(''url'')+ ''/_api/server.js'') .then(data => { assert.match(data, /showRegistration:( |)true/gi, ''You should be passing the variable "showRegistration" as true to your render function for the homepage''); assert.match(data, /register[^]*post[^]*findOne[^]*username:( |)req.body.username/gi, ''You should have a route accepted a post request on register that querys the db with findone and the query being "username: req.body.username"''); }, xhr => { throw new Error(xhr.statusText); })'
  - text: 注册应该工作
    testString: 'getUserInput => $.ajax({url: getUserInput(''url'')+ ''/register'',data: {username: ''freeCodeCampTester'', password: ''freeCodeCampTester''},crossDomain: true, type: ''POST'', xhrFields: { withCredentials: true }}) .then(data => { assert.match(data, /Profile/gi, ''I should be able to register and it direct me to my profile. CLEAR YOUR DATABASE if this test fails (each time until its right!)''); }, xhr => { throw new Error(xhr.statusText); })'
  - text: 登录应该工作
    testString: 'getUserInput => $.ajax({url: getUserInput(''url'')+ ''/login'',data: {username: ''freeCodeCampTester'', password: ''freeCodeCampTester''}, type: ''POST'', xhrFields: { withCredentials: true }}) .then(data => { assert.match(data, /Profile/gi, ''Login should work if previous test was done successfully and redirect successfully to the profile. Check your work and clear your DB''); assert.match(data, /freeCodeCampTester/gi, ''The profile should properly display the welcome to the user logged in''); }, xhr => { throw new Error(xhr.statusText); })'
  - text: 注销应该有效
    testString: 'getUserInput => $.ajax({url: getUserInput(''url'')+ ''/logout'', type: ''GET'', xhrFields: { withCredentials: true }}) .then(data => { assert.match(data, /Home/gi, ''Logout should redirect to home''); }, xhr => { throw new Error(xhr.statusText); })'
  - text: 注销后配置文件不再有效
    testString: 'getUserInput => $.ajax({url: getUserInput(''url'')+ ''/profile'', type: ''GET'', crossDomain: true, xhrFields: { withCredentials: true }}) .then(data => { assert.match(data, /Home/gi, ''Profile should redirect to home when we are logged out now again''); }, xhr => { throw new Error(xhr.statusText); })'

```

## Challenge Seed

## Solution

```js
// solution required
```


text:
* Star the project on [Github](https://github.com/testcontainers/testcontainers-java) and help spread the word :)
* Join our [Slack group](http://slack.testcontainers.org)
* [Post an issue](https://github.com/testcontainers/testcontainers-java/issues) if you find any bugs
* Contribute improvements or fixes using a [Pull Request](https://github.com/testcontainers/testcontainers-java/pulls). If you're going to contribute, thank you! Please just be sure to:
    * discuss with the authors on an issue ticket prior to doing anything big.
    * follow the style, naming and structure conventions of the rest of the project.
    * make commits atomic and easy to merge.
    * when updating documentation, please see [our guidance for documentation contributions](contributing_docs.md).
    * apply format running `./gradlew spotlessApply`
    * verify all tests are passing. Build the project with `./gradlew check` to do this.
    **N.B.** Gradle's Build Cache is enabled by default, but you can add `--no-build-cache` flag to disable it.

## Contributing new modules

We often receive proposals (or fully formed PRs) for new modules.
We're very happy to have contributions, but new modules require specific extra care. We want to balance:

* Usefulness of the module.
* Our ability to support the module in the future, potentially after contributors have moved on.
* Contributors time, so that nobody puts in wasted effort.

### Does it need to be a module?

*N.B. this is not a perfect list - please always reach out to us before starting on a module contribution!*

* Does the module enable use of Testcontainers with a popular or rapidly growing technology?
* Does the module 'add value' beyond a `GenericContainer` code snippet/example? e.g.
    * does it neatly encapsulate a difficult problem of running the program in a container?
    * does it add technology-specific [wait strategies](features/startup_and_waits.md)?
    * does it enable straightforward usage of client libraries?

If the answers to the above are all yes, then a new module may be a good approach.

Otherwise, it is entirely possible for you to:

* publish a code snippet
* contribute an example to the Testcontainers repo
* publish your own third party library

In any case, please contact us to help validate your proposal!

### Checklist

*Suggestion: copy and paste this list into PRs for new modules.*

Every item on this list will require judgement by the Testcontainers core maintainers. Exceptions will sometimes be possible; items with `should` are more likely to be negotiable than those items with `must`.

#### Default docker image

- [ ] Should be a Docker Hub official image, or published by a reputable source (ideally the company or organisation that officially supports the technology)
- [ ] Should have a verifiable open source Dockerfile and a way to view the history of changes
- [ ] MUST show general good practices regarding container image tagging - e.g. we do not use `latest` tags, and we do not use tags that may be mutated in the future
- [ ] MUST be legal for Testcontainers developers and Testcontainers users to pull and use. Mechanisms exist to allow EULA acceptance to be signalled, but images that can be used without a licence are greatly preferred.

#### Module dependencies

- [ ] The module should use as few dependencies as possible,
- [ ] Regarding libraries, either:
    - they should be `compileOnly` if they are likely to already be on the classpath for users' tests (e.g. client libraries or drivers)
    - they can be `implementation` (and thus transitive dependencies) if they are very unlikely to conflict with users' dependencies.
- [ ] If client libraries are used to test or use the module, these MUST be legal for Testcontainers developers and Testcontainers users to download and use.

#### API (e.g. `MyModuleContainer` class)

- [ ] Favour doing the right thing, and least surprising thing, by default
- [ ] Ensure that method and parameter names are easy to understand. Many users will ignore documentation, so IDE-based substitutes (autocompletion and Javadocs) should be intuitive.
- [ ] The module's public API should only handle standard JDK data types and MUST not expose data types that come from `compileOnly` dependencies. This is to reduce the risk of compatibility problems with future versions of third party libraries.

#### Documentation

- [ ] Every module MUST have a dedicated documentation page containing:
    - [ ] A high level overview
    - [ ] A usage example
    - [ ] If appropriate, basic API documentation or further usage guidelines
    - [ ] Dependency information
    - [ ] Acknowledgements, if appropriate
- [ ] Consider that many users will not read the documentation pages - even if the first person to add it to a project does, people reading/updating the code in the future may not. Try and avoid the need for critical knowledge that is only present in documentation.

### Incubating modules

We have a policy of marking new modules as 'incubating' so that we can evaluate its maintainability and usability traits over a longer period of time.
We currently believe 3 months is a fair period of time, but may change this.

New modules should have the following warning at the top of their documentation pages:

!!! note
    This module is INCUBATING. While it is ready for use and operational in the current version of Testcontainers, it is possible that it may receive breaking changes in the future. See [our contributing guidelines](/contributing/#incubating-modules) for more information on our incubating modules policy.

We will evaluate incubating modules periodically, and remove the label when appropriate.

## Combining Dependabot PRs

Since we generally get a lot of Dependabot PRs, we regularly combine them into single commits.
For this, we are using the [gh-combine-prs](https://github.com/rnorth/gh-combine-prs) extension for [GitHub CLI](https://cli.github.com/).

The whole process is as follow:

1. Check that all open Dependabot PRs did succeed their build. If they did not succeed, trigger a rerun if the cause were external factors or else document the reason if obvious.
2. Run the extension from an up-to-date local `master` branch: `gh combine-prs --query "author:app/dependabot"`
3. Merge conflicts might appear. Just ignore them, we will get those PRs in a future run.
4. Once the build of the combined PR did succeed, temporarily enable merge commits and merge the PR using a merge commit through the GitHub UI.
5. After the merge, disable merge commits again.


text:
"""autogenerated by genpy from rgbd_numpy/Floats.msg. Do not edit."""
import sys
python3 = True if sys.hexversion > 0x03000000 else False
import genpy
import struct

class Floats(genpy.Message):
  _md5sum = "420cd38b6b071cd49f2970c3e2cee511"
  _type = "rgbd_numpy/Floats"
  _has_header = False #flag to mark the presence of a Header object
  _full_text = """float32[] data

"""
  __slots__ = ['data']
  _slot_types = ['float32[]']

  def __init__(self, *args, **kwds):
    """
    Constructor. Any message fields that are implicitly/explicitly
    set to None will be assigned a default value. The recommend
    use is keyword arguments as this is more robust to future message
    changes.  You cannot mix in-order arguments and keyword arguments.

    The available fields are:
       data

    :param args: complete set of field values, in .msg order
    :param kwds: use keyword arguments corresponding to message field names
    to set specific fields.
    """
    if args or kwds:
      super(Floats, self).__init__(*args, **kwds)
      #message fields cannot be None, assign default values for those that are
      if self.data is None:
        self.data = []
    else:
      self.data = []

  def _get_types(self):
    """
    internal API method
    """
    return self._slot_types

  def serialize(self, buff):
    """
    serialize message into buffer
    :param buff: buffer, ``StringIO``
    """
    try:
      length = len(self.data)
      buff.write(_struct_I.pack(length))
      pattern = '<%sf'%length
      buff.write(struct.pack(pattern, *self.data))
    except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
    except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))

  def deserialize(self, str):
    """
    unpack serialized message in str into this message instance
    :param str: byte array of serialized message, ``str``
    """
    try:
      end = 0
      start = end
      end += 4
      (length,) = _struct_I.unpack(str[start:end])
      pattern = '<%sf'%length
      start = end
      end += struct.calcsize(pattern)
      self.data = struct.unpack(pattern, str[start:end])
      return self
    except struct.error as e:
      raise genpy.DeserializationError(e) #most likely buffer underfill

  def serialize_numpy(self, buff, numpy):
    """
    serialize message with numpy array types into buffer
    :param buff: buffer, ``StringIO``
    :param numpy: numpy python module
    """
    try:
      length = len(self.data)
      buff.write(_struct_I.pack(length))
      pattern = '<%sf'%length
      buff.write(self.data.tostring())
    except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
    except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))

  def deserialize_numpy(self, str, numpy):
    """
    unpack serialized message in str into this message instance using numpy for array types
    :param str: byte array of serialized message, ``str``
    :param numpy: numpy python module
    """
    try:
      end = 0
      start = end
      end += 4
      (length,) = _struct_I.unpack(str[start:end])
      pattern = '<%sf'%length
      start = end
      end += struct.calcsize(pattern)
      self.data = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=length)
      return self
    except struct.error as e:
      raise genpy.DeserializationError(e) #most likely buffer underfill

_struct_I = genpy.struct_I


text:
<!DOCTYPE html>

    <base href="/">
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Tubular</title>

    <link rel="stylesheet" href="//bootswatch.com/3/lumen/bootstrap.min.css" />
    <link rel="stylesheet" href="//cdn.jsdelivr.net/fontawesome/latest/css/font-awesome.min.css" />

    <link rel="stylesheet" href="./css/tubular-bundle.css" />

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

                </button>
                Tubular

Grid with Paginations

Grid with common features

Free-text search

Print and Export to CSV

Tubular Samples

Grid with Paginations

            <tb-grid server-url="//tubular.azurewebsites.net/api/orders/paged" request-method="POST" grid-name="sampleshap1" page-size="10"
                require-authentication="false">

                    <tb-grid-pager class="col-md-6 col-xs-12"></tb-grid-pager>
                    <tb-page-size-selector class="col-md-3 col-xs-6" selectorcss="input-sm">
                    </tb-page-size-selector>
                    <tb-grid-pager-info class="col-md-3 col-xs-6"></tb-grid-pager-info>

                            <tb-grid-table class="table-bordered">
                                <tb-column-definitions>
                                    <tb-column name="OrderID" column-type="numeric">
                                        <tb-column-header>
                                            {{label}}
                                        </tb-column-header>
                                    </tb-column>
                                    <tb-column name="CustomerName" searchable="true">
                                        <tb-column-header>
                                            {{label}}
                                        </tb-column-header>
                                    </tb-column>
                                    <tb-column name="ShippedDate">
                                        <tb-column-header>
                                            {{label}}
                                        </tb-column-header>
                                    </tb-column>
                                    <tb-column name="ShipperCity">
                                        <tb-column-header>
                                            {{label}}
                                        </tb-column-header>
                                    </tb-column>
                                </tb-column-definitions>
                                <tb-row-set>
                                    <tb-row-template ng-repeat="row in $component.rows" row-model="row" selectable="false">
                                        <tb-cell-template>
                                            {{row.OrderID}}
                                        </tb-cell-template>
                                        <tb-cell-template>
                                            {{row.CustomerName}}
                                        </tb-cell-template>
                                        <tb-cell-template>
                                            {{row.ShippedDate | date: 'short'}}
                                        </tb-cell-template>
                                        <tb-cell-template>
                                            {{row.ShipperCity}}
                                        </tb-cell-template>
                                    </tb-row-template>
                                </tb-row-set>
                            </tb-grid-table>

            </tb-grid>

Grid with common features

            <tb-grid server-url="//tubular.azurewebsites.net/api/orders/paged" request-method="POST" grid-name="sample3" page-size="10"
                require-authentication="false">

                    <tb-grid-pager class="col-md-6 col-xs-12"></tb-grid-pager>
                    <tb-page-size-selector class="col-md-3 col-xs-6" selectorcss="input-sm">
                    </tb-page-size-selector>
                    <tb-grid-pager-info class="col-md-3 col-xs-6"></tb-grid-pager-info>

                            <tb-grid-table class="table-bordered">
                                <tb-column-definitions>
                                    <tb-column name="OrderID" sortable="true" sort-order="1" sort-direction="Ascending" is-key="true" column-type="numeric">
                                        <tb-column-filter operator="Equals"></tb-column-filter>
                                        <tb-column-header>
                                            {{label}}
                                        </tb-column-header>
                                    </tb-column>
                                    <tb-column name="CustomerName" sortable="true" searchable="true">
                                        <tb-column-filter operator="Equals"></tb-column-filter>
                                        <tb-column-header>
                                            {{label}}
                                        </tb-column-header>
                                    </tb-column>
                                    <tb-column name="ShippedDate" sortable="true" searchable="false">
                                        <tb-column-header>
                                            {{label}}
                                        </tb-column-header>
                                    </tb-column>
                                    <tb-column name="ShipperCity" sortable="true" searchable="true">
                                        <tb-column-filter operator="Contains"></tb-column-filter>
                                        <tb-column-header>
                                            {{label}}
                                        </tb-column-header>
                                    </tb-column>
                                    <tb-column name="Amount" sortable="true" searchable="false" aggregate="Sum">
                                        <tb-column-header>
                                            {{label}}
                                        </tb-column-header>
                                    </tb-column>
                                </tb-column-definitions>
                                <tb-row-set>
                                    <tb-row-template ng-repeat="row in $component.rows" row-model="row" selectable="false">
                                        <tb-cell-template column-name="OrderID">
                                            {{row.OrderID}}
                                        </tb-cell-template>
                                        <tb-cell-template column-name="CustomerName">
                                            {{row.CustomerName}}
                                        </tb-cell-template>
                                        <tb-cell-template column-name="ShippedDate">
                                            {{row.ShippedDate | date: 'short'}}
                                        </tb-cell-template>
                                        <tb-cell-template column-name="ShipperCity">
                                            {{row.ShipperCity}}
                                        </tb-cell-template>
                                        <tb-cell-template column-name="Amount">
                                            {{row.Amount | number: 2}}
                                        </tb-cell-template>
                                    </tb-row-template>
                                </tb-row-set>
                            </tb-grid-table>

            </tb-grid>

Free-text search

            <tb-grid server-url="//tubular.azurewebsites.net/api/orders/paged" request-method="POST" grid-name="sample4" page-size="10"
                require-authentication="false">

                    <tb-grid-pager class="col-md-8 col-xs-12"></tb-grid-pager>
                    <tb-text-search class="col-md-4 col-xs-12"></tb-text-search>

                            <tb-grid-table class="table-bordered">
                                <tb-column-definitions>
                                    <tb-column name="OrderID" sortable="true" sort-order="1" sort-direction="Ascending" is-key="true" column-type="numeric">
                                        <tb-column-filter operator="Equals"></tb-column-filter>
                                        <tb-column-header>
                                            {{label}}
                                        </tb-column-header>
                                    </tb-column>
                                    <tb-column name="CustomerName" sortable="true" aggregate="Count" searchable="true">
                                        <tb-column-filter operator="Equals"></tb-column-filter>
                                        <tb-column-header>
                                            {{label}}
                                        </tb-column-header>
                                    </tb-column>
                                    <tb-column name="ShippedDate" sortable="true" searchable="false">
                                        <tb-column-header>
                                            {{label}}
                                        </tb-column-header>
                                    </tb-column>
                                    <tb-column name="ShipperCity" sortable="true" searchable="true">
                                        <tb-column-filter operator="Contains"></tb-column-filter>
                                        <tb-column-header>
                                            {{label}}
                                        </tb-column-header>
                                    </tb-column>
                                    <tb-column name="Amount" sortable="true" searchable="false" aggregate="Sum">
                                        <tb-column-header>
                                            {{label}}
                                        </tb-column-header>
                                    </tb-column>
                                </tb-column-definitions>
                                <tb-row-set>
                                    <tb-row-template ng-repeat="row in $component.rows" row-model="row" selectable="false">
                                        <tb-cell-template column-name="OrderID">
                                            {{row.OrderID}}
                                        </tb-cell-template>
                                        <tb-cell-template column-name="CustomerName">
                                            {{row.CustomerName}}
                                        </tb-cell-template>
                                        <tb-cell-template column-name="ShippedDate">
                                            {{row.ShippedDate | date: 'short'}}
                                        </tb-cell-template>
                                        <tb-cell-template column-name="ShipperCity">
                                            {{row.ShipperCity}}
                                        </tb-cell-template>
                                        <tb-cell-template column-name="Amount">
                                            {{row.Amount | number: 2}}
                                        </tb-cell-template>
                                    </tb-row-template>
                                </tb-row-set>
                            </tb-grid-table>

                    <tb-grid-pager class="col-md-6 col-xs-12"></tb-grid-pager>
                    <tb-page-size-selector class="col-md-3 col-xs-6"></tb-page-size-selector>
                    <tb-grid-pager-info class="col-md-3 col-xs-6"></tb-grid-pager-info>

            </tb-grid>

Print and Export to CSV

            <tb-grid server-url="//tubular.azurewebsites.net/api/orders/paged" request-method="POST" grid-name="sample5" page-size="10"
                require-authentication="false">

                    <tb-grid-pager class="col-md-6 col-xs-12"></tb-grid-pager>

                            <tb-export-button filename="data.csv"></tb-export-button>
                            <tb-print-button title="Sample"></tb-print-button>

                            <tb-grid-table class="table-bordered">
                                <tb-column-definitions>
                                    <tb-column name="OrderID" sortable="true" sort-order="1" sort-direction="Ascending" is-key="true" column-type="numeric">
                                        <tb-column-filter operator="Equals"></tb-column-filter>
                                        <tb-column-header>
                                            {{label}}
                                        </tb-column-header>
                                    </tb-column>
                                    <tb-column name="CustomerName" sortable="true" aggregate="Count" searchable="true">
                                        <tb-column-filter operator="Equals"></tb-column-filter>
                                        <tb-column-header>
                                            {{label}}
                                        </tb-column-header>
                                    </tb-column>
                                    <tb-column name="ShippedDate" sortable="true" searchable="false">
                                        <tb-column-header>
                                            {{label}}
                                        </tb-column-header>
                                    </tb-column>
                                    <tb-column name="ShipperCity" sortable="true" searchable="true">
                                        <tb-column-filter operator="Contains"></tb-column-filter>
                                        <tb-column-header>
                                            {{label}}
                                        </tb-column-header>
                                    </tb-column>
                                    <tb-column name="Amount" sortable="true" searchable="false" aggregate="Sum">
                                        <tb-column-header>
                                            {{label}}
                                        </tb-column-header>
                                    </tb-column>
                                </tb-column-definitions>
                                <tb-row-set>
                                    <tb-row-template ng-repeat="row in $component.rows" row-model="row" selectable="false">
                                        <tb-cell-template column-name="OrderID">
                                            {{row.OrderID}}
                                        </tb-cell-template>
                                        <tb-cell-template column-name="CustomerName">
                                            {{row.CustomerName}}
                                        </tb-cell-template>
                                        <tb-cell-template column-name="ShippedDate">
                                            {{row.ShippedDate | date: 'short'}}
                                        </tb-cell-template>
                                        <tb-cell-template column-name="ShipperCity">
                                            {{row.ShipperCity}}
                                        </tb-cell-template>
                                        <tb-cell-template column-name="Amount">
                                            {{row.Amount | number: 2}}
                                        </tb-cell-template>
                                    </tb-row-template>
                                </tb-row-set>
                            </tb-grid-table>

                    <tb-grid-pager class="col-md-6 col-xs-12"></tb-grid-pager>
                    <tb-page-size-selector class="col-md-3 col-xs-6"></tb-page-size-selector>
                    <tb-grid-pager-info class="col-md-3 col-xs-6"></tb-grid-pager-info>

            </tb-grid>


text:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace VisualRBM
{
	public partial class TrainingLog : UserControl
	{
		public TrainingLog()
		{
			InitializeComponent();
		}

		public void AddLog(String format, params object[] objects)
		{
			this.BeginInvoke( new Action(() =>
				{
					logTextBox.AppendText(String.Format(format, objects) + "\r\n");
				}));
		}
	}
}


text:
//
//  make_unique.h
//
//  Created by Edmund Kapusniak on 17/02/2014.
//  Copyright (c) 2014 Edmund Kapusniak. All rights reserved.
//

#ifndef MAKE_UNIQUE_H
#define MAKE_UNIQUE_H

#include <memory>

namespace std
{

template < typename object_t, typename ... arguments_t >
unique_ptr< object_t > make_unique( arguments_t&& ... arguments )
{
    return unique_ptr< object_t >(
                new object_t( forward< arguments_t >( arguments ) ... ) );
}

}

#endif /* MAKE_UNIQUE */


text:
module OpenSSL
  class Digest

    alg = %w(DSS DSS1 MD2 MD4 MD5 MDC2 RIPEMD160 SHA SHA1)
    if OPENSSL_VERSION_NUMBER > 0x00908000
      alg += %w(SHA224 SHA256 SHA384 SHA512)
    end

    # Return the +data+ hash computed with +name+ Digest. +name+ is either the
    # long name or short name of a supported digest algorithm.
    #
    # === Examples
    #
    #   OpenSSL::Digest.digest("SHA256", "abc")
    #
    # which is equivalent to:
    #
    #   OpenSSL::Digest::SHA256.digest("abc")

    def self.digest(name, data)
        super(data, name)
    end

    alg.each{|name|
      klass = Class.new(Digest){
        define_method(:initialize){|*data|
          if data.length > 1
            raise ArgumentError,
              "wrong number of arguments (#{data.length} for 1)"
          end
          super(name, data.first)
        }
      }
      singleton = (class << klass; self; end)
      singleton.class_eval{
        define_method(:digest){|data| Digest.digest(name, data) }
        define_method(:hexdigest){|data| Digest.hexdigest(name, data) }
      }
      const_set(name, klass)
    }

    # This class is only provided for backwards compatibility.  Use OpenSSL::Digest in the future.
    class Digest < Digest
      def initialize(*args)
        # add warning
        super(*args)
      end
    end

  end # Digest

  # Returns a Digest subclass by +name+.
  #
  #   require 'openssl'
  #
  #   OpenSSL::Digest("MD5")
  #   # => OpenSSL::Digest::MD5
  #
  #   Digest("Foo")
  #   # => NameError: wrong constant name Foo

  def Digest(name)
    OpenSSL::Digest.const_get(name)
  end

  module_function :Digest

end # OpenSSL


text:
import factory
reload(factory)
from factory import *

def serpent_factory(branch='develop'):
    factory = BuildFactory()
    for step in [
        Git(
            haltOnFailure = True,
            logEnviron = False,
            repourl='https://github.com/ethereum/serpent.git',
            branch=branch,
            mode='full',
            method = 'copy',
            codebase='serpent',
            retry=(5, 3)
        ),
        Git(
            haltOnFailure = True,
            logEnviron = False,
            repourl='https://github.com/ethereum/pyethereum.git',
            branch=branch,
            mode='full',
            method = 'copy',
            codebase='pyethereum',
            retry=(5, 3),
            workdir='pyethereum'
        ),
        ShellCommand(
            haltOnFailure = True,
            logEnviron = False,
            name="pip-install",
            description="installing",
            descriptionDone="install",
            command=["pip", "install", "-e", "."]
        ),
        SetPropertyFromCommand(
            haltOnFailure = True,
            logEnviron = False,
            name="serpent-version",
            command=["serpent", "-v"],
            property="version"
        ),
        ShellCommand(
            haltOnFailure = True,
            logEnviron = False,
            name="install-pyethereum",
            description="installing pyethereum",
            descriptionDone="install pyethereum",
            command=["pip", "install", "-e", "."],
            workdir="pyethereum"
        ),
        ShellCommand(
            haltOnFailure = True,
            logEnviron = False,
            name="pyethereum-requirements",
            description="installing pyethereum requirements",
            descriptionDone="install pyethereum requirements",
            command=["pip", "install", "--upgrade", "--no-deps", "-r", "requirements.txt"],
            workdir="pyethereum"
        ),
        ShellCommand(
            haltOnFailure = True,
            logEnviron = False,
            name="pyethereum-dev-requirements",
            description="installing pyethereum dev_requirements",
            descriptionDone="install pyethereum dev_requirements",
            command=["pip", "install", "--upgrade", "--no-deps", "-r", "dev_requirements.txt"],
            workdir="pyethereum"
        ),
        ShellCommand(
            haltOnFailure = True,
            logEnviron = False,
            name="test-submodule",
            descriptionDone="update test submodule",
            command="git submodule init && git submodule update --recursive",
            workdir="pyethereum"
        ),
        ShellCommand(
            flunkOnFailure=False,
            logEnviron=False,
            description="testing",
            descriptionDone="py.test",
            name="py.test",
            command=["py.test"],
            workdir="pyethereum"
        )
    ]: factory.addStep(step)
    return factory


text:
const config = require('../config')
const axios = require('axios')
const fs = require('fs')
const locales = [
  {file: '../../frontend/static/i18n/en-US/warcraft.json', name: 'en_US'},
  {file: '../../frontend/static/i18n/de-DE/warcraft.json', name: 'de_DE'},
  {file: '../../frontend/static/i18n/es-ES/warcraft.json', name: 'es_ES'},
  {file: '../../frontend/static/i18n/fr-FR/warcraft.json', name: 'fr_FR'},
  {file: '../../frontend/static/i18n/ru-RU/warcraft.json', name: 'ru_RU'},
  {file: '../../frontend/static/i18n/zh-CN/warcraft.json', name: 'zh_CN'},
  {file: '../../frontend/static/i18n/ko-KR/warcraft.json', name: 'ko_KR'},
]

async function go () {
  try {
    const token = await getToken()
    if (!token) throw 'no token'

    for (let i = 0; i < locales.length; i++) {
      locales[i].json = JSON.parse(fs.readFileSync(locales[i].file, 'utf8'))
      locales[i].json.classes = locales[i].json.classes || {}
      locales[i].json.encounters = locales[i].json.encounters || {}
      locales[i].json.expansions = locales[i].json.expansions || {}
      locales[i].json.instances = locales[i].json.instances || {}
      locales[i].json.professions = locales[i].json.professions || {}
    }

    // ---- Get class names and specs
    // class names are stored by matching id; specs are identified by sequential order - so if the order changes then this needs to be updated
    const classes = await axios.get(`https://us.api.blizzard.com/data/wow/playable-class/index?namespace=static-us&access_token=${token}`)
    for (const c of classes.data.classes) {
      console.log(c.name.en_US)
      const char = await axios.get(`https://us.api.blizzard.com/data/wow/playable-class/${c.id}?namespace=static-us&access_token=${token}`)
      for (let i = 0; i < locales.length; i++) {
        locales[i].json.classes[c.id] = char.data.name[locales[i].name]
        let n = 1
        // NOTE: 4-2c is used for Combat rogue in classic; this isn't available on the API
        for (const spec of char.data.specializations) {
          locales[i].json.classes[`${c.id}-${n++}`] = spec.name[locales[i].name]
        }
      }
    }

    console.log('Encounters')
    const encounters = await axios.get(`https://us.api.blizzard.com/data/wow/journal-encounter/index?namespace=static-us&access_token=${token}`)
    for (const e of encounters.data.encounters) {
      for (let i = 0; i < locales.length; i++) {
        locales[i].json.encounters[e.id] = e.name[locales[i].name]
      }
    }

    console.log('Expansions')
    const expansions = await axios.get(`https://us.api.blizzard.com/data/wow/journal-expansion/index?namespace=static-us&access_token=${token}`)
    for (const x of expansions.data.tiers) {
      for (let i = 0; i < locales.length; i++) {
        locales[i].json.expansions[x.id] = x.name[locales[i].name]
      }
    }

    console.log('Instances')
    const zones = await axios.get(`https://us.api.blizzard.com/data/wow/journal-instance/index?namespace=static-us&access_token=${token}`)
    for (const z of zones.data.instances) {
      for (let i = 0; i < locales.length; i++) {
        locales[i].json.instances[z.id] = z.name[locales[i].name]
      }
    }

    console.log('Professions')
    const professions = await axios.get(`https://us.api.blizzard.com/data/wow/profession/index?namespace=static-us&access_token=${token}`)
    for (const p of professions.data.professions) {
      for (let i = 0; i < locales.length; i++) {
        locales[i].json.professions[p.id] = p.name[locales[i].name]
      }
    }

    console.log('Saving JSON')
    for (let i = 0; i < locales.length; i++) {
      fs.writeFileSync(locales[i].file, JSON.stringify(locales[i].json, null, 2), 'utf8')
    }
  }
  catch (e) {
    if (e.code) {
      console.error('ERROR', e.code, e.errno)
      console.error(e.config)
      console.error(e.response)
    }
    else {
      console.error('ERROR', e)
    }
  }
}
go()

async function getToken (region) {
  if (region === 'cn') {
    tokenURL = 'https://www.battlenet.com.cn/oauth/token'
  }
  else {
    tokenURL = 'https://us.battle.net/oauth/token'
  }
  try {
    const response = await axios({
      method: 'post',
      url: tokenURL,
      data: 'grant_type=client_credentials',
      auth: {
        username: config.auth.battlenet.clientID,
        password: config.auth.battlenet.clientSecret
      }
    })

    if (response && response.data && response.data.access_token) {
      return response.data.access_token
    }
    else {
      return false
    }
  }
  catch (e) {
    console.log('ERR BNET TOKEN', region, e.message)
    return false
  }
}


text:
**(a) What are the main quality attributes the stakeholders are interested in? Give three quality attributes for each stakeholder.**

__Development/Maintenance team:__

1. Maintainability
2. Debugability
3. Testability

__Management:__

1. Configurability
2. Extensibility
3. Affordability

**(b) Give two other possible stakeholders we could have considered for this system. What would their concerns be?**

1. __End-Users__, their concerns would be:

	- Usability
	- Simplicity
	- Correctness

2. __Administrators__, their concerns would be:

	- Administrability
	- Usability
	- Autonomy

**(c) Study the system (source code and available documentation). Write a SAD based on the template at www.rupopmaat.nl. Make sure to include UML component diagram(s), package diagram(s) and deployment diagram(s).**

See attached `SAD Project DolVA.pdf`.

**(d) Identify three important design decisions that have been taken for the system. Where these design decisions documented by the original developers? What were the alternatives? What decision would you have made, with what rationale?**

1. __Design decision:__ *API Based*

	__Documented by original developers:__ Yes, it is documented. The given rationale is: *"Because of the simplicity of addressing there was made the decision to use a RESTful API. This reduces the complexity as much as possible."*

	__The alternatives:__ The alternative would be to let every endpoint communicate directly to the application layer. This would mean no intermediate API, which requires an interface for each individual endpoint.

	__Our decision and rationale:__ We would have made the same decision, because there is less tight coupling between the graphical user interface of the CMS and the logical view of the CMS. This extra layer of abstraction makes communication more tranparent, better maintainable, and also makes debugging and testing easier.

2. __Design decision:__ *Cordova App*

	__Documented by original developers:__ Yes, it is documented. The given rationale is: *"Cordova makes it possible to develop without using the device's native APIs."*

	__The alternatives:__ The alternative would have been to build native apps in Java (for Android) and Swift (for iOS).

	__Our decision and rationale:__ We would have made the same decision, because by using Cordova you combine best of both the browser possibilities and built-in native functionalities. Also Cordova makes developing an app for multiple platforms (cross-platform) a trivial task.

3. __Design decision:__ *MySQL*

	__Documented by original developers:__ Yes, it is documented. The given rationale is: *"Because there is a strong relational character between the data and there is a relatively small set of subjects."*

	__The alternatives:__ Yes, there were a lot of alternatives, e.g. Microsoft SQL Server, Oracle, PostgreSQL, MongoDB, and a lot of others.

	__Our decision and rationale:__ We would have made the same decision, because of the wide use of MySQL and the strong relation between the different data.

**(e) How could the architecture of the system be improved? Give suggestions for improvement, at least one for every view.**

1. __Improvements to the logical view__

	__Suggestion(s):__ There are no diagrams present at all. It would be better if there would also be made some static diagrams, like a component diagram or ERD.

2. __Improvements to the development view__

	__Suggestion(s):__ A lot of artifacts of this view have been left out. It would be useful to add the file structure. This would make it easier to find certain files for new developers and it would improve the extendability. On the plus side open-source frameworks are used, which means documentation on file structure (etc.) can be found online.

3. __Improvements to the process view__

	__Suggestion(s):__ It would be useful to add a desciption of how the scalability of the system has been improved. Also there are no diagrams to show the outline of the entire system and no documents explaining how the individual subsystems communicate with one another.

4. __Improvements to the physical view__

	__Suggestion(s):__ There are only explanations why certain decisions have been made. It would be useful if there is some documentation available about which protocols are uses and how the hardware has been configured.

5. __Improvements to the scenarios / use case view__

	__Suggestion(s):__ Only User Stories are made. Although they are very extensive, it would be better if there would also be made Use Case Diagrams and Use Cade Descriptions, because they give a clear overview.

**(f) The standard views are probably too technical for Martin. Write a management view. You are allowed to make reasonable assumptions. (This exercise is about writing for a non-technical person and being able to imagine the things he's interested in.)**

See attached `Management Review.pdf`.


text:
package com.qiyi.usercloude.carve.benchmark;

import java.util.concurrent.CountDownLatch;
import java.util.concurrent.CyclicBarrier;

import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.qiyi.usercloud.carve.demoservice.DemoService;

public class BenchmarkClient extends AbstractBenchmarkClient {

	private DemoService demo;
	public BenchmarkClient() {
		ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext("classpath*:service-refer.xml");
		this.demo = (DemoService)ctx.getBean("demoServiceRefer");
	}

    @Override
    public ClientRunnable getClientRunnable(String targetIP, int targetPort, int clientNums, int rpcTimeout,
                                            CyclicBarrier barrier,
                                            CountDownLatch latch,long startTime, long endTime) {
        return new SimpleProcessorBenchmarkClientRunnable(demo,targetIP, targetPort, clientNums, rpcTimeout,
                                                         barrier, latch, startTime, endTime);
    }

    public static void main(String[] args) throws Exception {
        new BenchmarkClient().run(args);
    }
}


text:
/* crypto/jpake/jpake_err.c */
/* ====================================================================
 * Copyright (c) 1999-2010 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 *
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in
 *    the documentation and/or other materials provided with the
 *    distribution.
 *
 * 3. All advertising materials mentioning features or use of this
 *    software must display the following acknowledgment:
 *    "This product includes software developed by the OpenSSL Project
 *    for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
 *
 * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
 *    endorse or promote products derived from this software without
 *    prior written permission. For written permission, please contact
 *    openssl-core@OpenSSL.org.
 *
 * 5. Products derived from this software may not be called "OpenSSL"
 *    nor may "OpenSSL" appear in their names without prior written
 *    permission of the OpenSSL Project.
 *
 * 6. Redistributions of any form whatsoever must retain the following
 *    acknowledgment:
 *    "This product includes software developed by the OpenSSL Project
 *    for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
 *
 * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
 * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE OpenSSL PROJECT OR
 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
 * OF THE POSSIBILITY OF SUCH DAMAGE.
 * ====================================================================
 *
 * This product includes cryptographic software written by Eric Young
 * (eay@cryptsoft.com).  This product includes software written by Tim
 * Hudson (tjh@cryptsoft.com).
 *
 */

/* NOTE: this file was auto generated by the mkerr.pl script: any changes
 * made to it will be overwritten when the script next updates this file,
 * only reason strings will be preserved.
 */

#include <stdio.h>
#include <openssl/err.h>
#include <openssl/jpake.h>

/* BEGIN ERROR CODES */
#ifndef OPENSSL_NO_ERR

#define ERR_FUNC(func) ERR_PACK(ERR_LIB_JPAKE,func,0)
#define ERR_REASON(reason) ERR_PACK(ERR_LIB_JPAKE,0,reason)

static ERR_STRING_DATA JPAKE_str_functs[]=
	{
{ERR_FUNC(JPAKE_F_JPAKE_STEP1_PROCESS),	"JPAKE_STEP1_process"},
{ERR_FUNC(JPAKE_F_JPAKE_STEP2_PROCESS),	"JPAKE_STEP2_process"},
{ERR_FUNC(JPAKE_F_JPAKE_STEP3A_PROCESS),	"JPAKE_STEP3A_process"},
{ERR_FUNC(JPAKE_F_JPAKE_STEP3B_PROCESS),	"JPAKE_STEP3B_process"},
{ERR_FUNC(JPAKE_F_VERIFY_ZKP),	"VERIFY_ZKP"},
{0,NULL}
	};

static ERR_STRING_DATA JPAKE_str_reasons[]=
	{
{ERR_REASON(JPAKE_R_G_TO_THE_X3_IS_NOT_LEGAL),"g to the x3 is not legal"},
{ERR_REASON(JPAKE_R_G_TO_THE_X4_IS_NOT_LEGAL),"g to the x4 is not legal"},
{ERR_REASON(JPAKE_R_G_TO_THE_X4_IS_ONE)  ,"g to the x4 is one"},
{ERR_REASON(JPAKE_R_HASH_OF_HASH_OF_KEY_MISMATCH),"hash of hash of key mismatch"},
{ERR_REASON(JPAKE_R_HASH_OF_KEY_MISMATCH),"hash of key mismatch"},
{ERR_REASON(JPAKE_R_VERIFY_B_FAILED)     ,"verify b failed"},
{ERR_REASON(JPAKE_R_VERIFY_X3_FAILED)    ,"verify x3 failed"},
{ERR_REASON(JPAKE_R_VERIFY_X4_FAILED)    ,"verify x4 failed"},
{ERR_REASON(JPAKE_R_ZKP_VERIFY_FAILED)   ,"zkp verify failed"},
{0,NULL}
	};

#endif

void ERR_load_JPAKE_strings(void)
	{
#ifndef OPENSSL_NO_ERR

	if (ERR_func_error_string(JPAKE_str_functs[0].error) == NULL)
		{
		ERR_load_strings(0,JPAKE_str_functs);
		ERR_load_strings(0,JPAKE_str_reasons);
		}
#endif
	}


text:
package javax.print.attribute.standard;

import javax.print.attribute.Attribute;
import javax.print.attribute.IntegerSyntax;
import javax.print.attribute.PrintJobAttribute;

public final class JobImpressionsCompleted extends IntegerSyntax implements PrintJobAttribute {
    private static final long serialVersionUID = 6722648442432393294L;

    public JobImpressionsCompleted(int value) {
        super(value, 0, Integer.MAX_VALUE);
    }

    @Override
    public boolean equals(Object object) {
        if (!(object instanceof JobImpressionsCompleted)) {
            return false;
        }
        return super.equals(object);
    }

    public final Class<? extends Attribute> getCategory() {
        return JobImpressionsCompleted.class;
    }

    public final String getName() {
        return "job-impressions-completed";
    }
}


text:
package nl.knaw.dans.common.lang.util;

import org.junit.Test;

public class WaitTest
{

    @Test
    public void waitAWhile()
    {
        Wait.milliSeconds(100);
    }

}


text:
require 'spec_helper'

describe GeoLocationPoint do
  it "has a valid factory" do
    expect(FactoryGirl.create(:geoLocationPoint)).to be_valid
  end
  it "has a latitude value within -90 and 90 range"
  it "has a longitude value within -180 and 180 range"
  it "returns a lat-long coordinate pair in Well-Known Text format"
  it "is associated with a Record"
  it "is invalid if there are already 25 points associated with a Record"
  it "is invalid if there is a geospatialType of 'box'"
  it "is invalid if there is a geospatialType of 'none'"
  it "is invalid if geospatialType is blank/nil"
end


text:
/* ** GENEREATED FILE - DO NOT MODIFY ** */
package com.wilutions.mslib.outlook;
import com.wilutions.com.*;

/**
 * OlAlwaysDeleteConversation.
 *
 */
@SuppressWarnings("all")
@CoInterface(guid="{00000000-0000-0000-0000-000000000000}")
public class OlAlwaysDeleteConversation implements ComEnum {
  static boolean __typelib__loaded = __TypeLib.load();

  // Typed constants
  public final static OlAlwaysDeleteConversation olDoNotDelete = new OlAlwaysDeleteConversation(0);
  public final static OlAlwaysDeleteConversation olAlwaysDelete = new OlAlwaysDeleteConversation(1);
  public final static OlAlwaysDeleteConversation olAlwaysDeleteUnsupported = new OlAlwaysDeleteConversation(2);

  // Integer constants for bitsets and switch statements
  public final static int _olDoNotDelete = 0;
  public final static int _olAlwaysDelete = 1;
  public final static int _olAlwaysDeleteUnsupported = 2;

  // Value, readonly field.
  public final int value;

  // Private constructor, use valueOf to create an instance.
  private OlAlwaysDeleteConversation(int value) { this.value = value; }

  // Return one of the predefined typed constants for the given value or create a new object.
  public static  OlAlwaysDeleteConversation valueOf(int value) {
    switch(value) {
    case 0: return olDoNotDelete;
    case 1: return olAlwaysDelete;
    case 2: return olAlwaysDeleteUnsupported;
    default: return new OlAlwaysDeleteConversation(value);
    }
  }

  public String toString() {
    switch(value) {
    case 0: return "olDoNotDelete";
    case 1: return "olAlwaysDelete";
    case 2: return "olAlwaysDeleteUnsupported";
    default: {
      StringBuilder sbuf = new StringBuilder();
      sbuf.append("[").append(value).append("=");
      if ((value & 0) != 0) sbuf.append("|olDoNotDelete");
      if ((value & 1) != 0) sbuf.append("|olAlwaysDelete");
      if ((value & 2) != 0) sbuf.append("|olAlwaysDeleteUnsupported");
      return sbuf.toString();
      }
    }
  }
}


text:
import { createAction } from "redux-actions";

export const FETCH_CHAPTER_BY_NAME = "FETCH_CHAPTER_BY_NAME";
export const fetchChapterByName = createAction(FETCH_CHAPTER_BY_NAME);


text:
require File.dirname(__FILE__) + '/../spec_helper'

describe DocumentMapper::Relations::Aggregation do

  before(:all) do
    DocumentMapper.setup(:adapter => 'couchrest', :database=>"http://127.0.0.1:5984/flatdoc-test")
  end

  after(:all) do
    DocumentMapper.repository.clear
  end

  context "single association" do

  end

end


text:
<?php namespace Fitz\Abstracts\Properties;

trait HttpHeaderTrait
{

    protected $code;

    protected $status;
}


text:
<!DOCTYPE html>

        <meta charset="utf-8">
        <title>StrongLoop Edison IoT Demo</title>

        <link href="../style.css" rel="stylesheet" type="text/css">
        <link href="../c3.css" rel="stylesheet" type="text/css">

                    StrongLoop Edison IoT Demo

                Select a Sensor to view:

                    Edison Sensors: Accelerometer

                © 2016 StrongLoop, an IBM Company: Developed by Dragonfly IoT


text:
<?php

namespace Bundle\NewsBundle\Entity;

use Doctrine\ORM\EntityRepository;
use Doctrine\ORM\NoResultException;

/**
 * NewsRepository
 *
 * This class was generated by the Doctrine ORM. Add your own custom
 * repository methods below.
 */
class NewsRepository extends EntityRepository
{

    public function findLatestNewsSortedBy($field, $order='desc', $nb = null)
    {
        $qb = $this->createQueryBuilder('n');
        $qb->orderBy('n.'.$field, $order);
        $query = $qb->getQuery();
        if(null !== $nb) {
            $query->setMaxResults($nb);
        }

        return $query->execute();
    }

}