text:
<?php

namespace PHPCraft\Subject\Traits\Upload;

/**
 * Manages uploads using codeguy/upload  (https://github.com/codeguy/Upload.git)
 *
 * @author vuk <info@vuk.bg.it>
 */
class Field
{
    protected $field;
    protected $uploader;
    protected $outputsFiles;
    protected $inputFile;
    protected $inputHash;

    /**
    * array of PHPCraft\Subject\Upload\Output instances
    **/
    protected $outputs;

    /**
    * array[
    * type => as defined into Upload adapter
    * options => for the type, if any
    * message => localized message for rule breaking warning
    **/
    protected $validations;

    /**
    * string of html code with placeholders for outputs destination in the form of {{output-name}}
    **/
    protected $previewTemplate;

    /**
    * array of html code for each uploadedFile with placeholders replaced by actual outputs files paths
    **/
    protected $previews;

    /**
     * constructor
     * @param string $field
     * @param array $validations rules to validate uploaded file against
     * @param string $previewTemplate html template to be shown into preview
     **/
    public function __construct($field, $validations = null, $previewTemplate = null)
    {
        $this->field = $field;
        $this->outputs = array();
        $this->validations = $validations;
        $this->previewTemplate = $previewTemplate;
        $this->outputsFiles = array();
        $this->previews = array();
    }

    /**
     * Stores input informations
     **/
    private function setInput()
    {
        $this->inputFile = $_FILES[$this->field]['name'];
        $this->inputHash = hash_file('md5', $_FILES[$this->field]['tmp_name']);
    }

    /**
     * Adds an output definition
     * @param string $name
     * @param string $destination path to destination directory
     **/
    public function addOutput($name, $destination)
    {
        $this->outputs[$name] = new Output($name, $destination);
    }

    /**
     * Handles an upload
     * @param $uploader adapter following PHPCraft\Upload\UploadInterface
     **/
    public function handleUpload(&$uploader)
    {
        // store uploader
        $this->uploader =& $uploader;
        //store input
        $this->setInput();
        // tell uploader which field is uploaded
        $this->uploader->setField($this->field);
        // make temporary file
        $this->uploader->setDestination(sys_get_temp_dir());
        // loop validation rules
        foreach($this->validations as $validation) {
            $options = isset($validation['options']) ? $validation['options'] : null;
            $message = isset($validation['message']) ? $validation['message'] : null;
            // set rule
            $this->uploader->addValidationRule($validation['type'], $options, $message);
        }
        // upload
        if(!$this->uploader->process()) {
            // failure
            return false;
        }
        // loop field outputs
        $temporaryFile = sprintf('%s/%s', sys_get_temp_dir(), $this->uploader->getUploadedFileInfo()['name']);
        foreach($this->outputs as $outputName => $output) {
            $outputPath = $output->getDestination() .  $this->uploader->getUploadedFileInfo()['name'];
            if(is_file($outputPath)){
                $outputPath = sprintf('%s%s_%s', $output->getDestination(), time(),  $this->uploader->getUploadedFileInfo()['name']);
            }
            copy($temporaryFile, $outputPath);
            $this->outputsFiles[$outputName] = [
                'name' => $this->uploader->getUploadedFileInfo()['name'],
                'path' => $outputPath
            ];
        }
        // delete temporary file
        unlink($temporaryFile);
        // close upload
        $this->uploader->close();
        return true;
    }

    /**
     * Return input file hash
     * @return array
     **/
    public function getInputHash()
    {
        return $this->inputHash;
    }

    /**
     * Return input file name
     * @return array
     **/
    public function getInputFile()
    {
        return $this->inputFile;
    }

    /**
     * Return outputs files (generated by upload action) paths and names
     * @return array
     **/
    public function getOutputsFiles()
    {
        return $this->outputsFiles;
    }

     /**
     * Return previewTemplate filled with correct destinations
     * @return array
     **/
    public function getPreviews()
    {
        return $this->previews;
    }
}

redpajama_set_name: RedPajamaGithub


text:
package org.apache.pig.newplan.logical.relational;

import java.util.Iterator;

import org.apache.pig.impl.logicalLayer.FrontendException;
import org.apache.pig.newplan.Operator;
import org.apache.pig.newplan.OperatorPlan;
import org.apache.pig.newplan.PlanVisitor;
import org.apache.pig.newplan.PlanWalker;

/**
 * A visitor for logical plans.
 */
public abstract class LogicalRelationalNodesVisitor extends PlanVisitor {

    protected LogicalRelationalNodesVisitor(OperatorPlan plan, PlanWalker walker) throws FrontendException {
        super(plan, walker);

        Iterator<Operator> iter = plan.getOperators();
        while(iter.hasNext()) {
            if (!(iter.next() instanceof LogicalRelationalOperator)) {
                throw new FrontendException("LogicalPlanVisitor can only visit logical plan", 2240);
            }
        }
    }

    public void visit(LOLoad load) throws FrontendException {
    }

    public void visit(LOFilter filter) throws FrontendException {
    }

    public void visit(LOStore store) throws FrontendException {
    }

    public void visit(LOJoin join) throws FrontendException {
    }

    public void visit(LOForEach foreach) throws FrontendException {
    }

    public void visit(LORollupHIIForEach horeach) throws FrontendException {
    }

    public void visit(LOGenerate gen) throws FrontendException {
    }

    public void visit(LOInnerLoad load) throws FrontendException {
    }

    public void visit(LOCube cube) throws FrontendException {
    }

    public void visit(LOCogroup loCogroup) throws FrontendException {
    }

    public void visit(LOSplit loSplit) throws FrontendException {
    }

    public void visit(LOSplitOutput loSplitOutput) throws FrontendException {
    }

    public void visit(LOUnion loUnion) throws FrontendException {
    }

    public void visit(LOSort loSort) throws FrontendException {
    }

    public void visit(LORank loRank) throws FrontendException{
    }

    public void visit(LODistinct loDistinct) throws FrontendException {
    }

    public void visit(LOLimit loLimit) throws FrontendException {
    }

    public void visit(LOCross loCross) throws FrontendException {
    }

    public void visit(LOStream loStream) throws FrontendException {
    }

    public void visit(LONative nativeMR) throws FrontendException{
    }
}


text:
import { shareAlbum } from '~reusable/sharePage';

import { openSharePage, openDiscoverPage } from '~reusable/navigation';

import e2e from '~shared/data/e2e';
import {
  DISCOVER_FEED_LIMIT,
} from '~shared/data/constants';

import album1 from '~shared/data/assets/album2';
import {
  discoverFeedLengthEquals,
  discoverAlbumTitleEquals,
} from '~reusable/discoverPage';

const ALBUMS_COUNT = DISCOVER_FEED_LIMIT + 1;

describe('pagination tests', () => {
  // ALBUM SELECTION

  before(async function () {
    this.timeout(120000);
    await openSharePage.call(this);
    let inc = 1;
    const publishNextAlbum = async () => {
      if (inc > ALBUMS_COUNT) return;
      await shareAlbum.call(this, album1, `album ${inc}`);
      inc += 1;
      await publishNextAlbum();
    };
    await publishNextAlbum();
    await openDiscoverPage.call(this);
    await this.app.client.waitForExist(e2e.DISCOVER_FEED_ID);
  });

  it(`feed length must be ${DISCOVER_FEED_LIMIT}`, async function () {
    return discoverFeedLengthEquals.call(this, DISCOVER_FEED_LIMIT);
  });

  describe('albums must be ordered from newest to oldest', () => {
    for (let i = 1; i <= DISCOVER_FEED_LIMIT; i += 1) {
      const name = `album ${ALBUMS_COUNT + 1 - i}`;
      it(`album #${i} should be named "${name}"`, function () {
        return discoverAlbumTitleEquals.call(this, i, name);
      });
    }
  });
});


text:
package com.github.ldaniels528.trifecta.modules.etl.io.record.impl

import com.github.ldaniels528.trifecta.modules.etl.io.Scope
import com.github.ldaniels528.trifecta.modules.etl.io.device.DataSet
import com.github.ldaniels528.trifecta.modules.etl.io.record.Field._
import com.github.ldaniels528.trifecta.modules.etl.io.record.{Field, Record, TextSupport}

/**
  * Delimited Record
  * @author lawrence.daniels@gmail.com
  */
case class DelimitedRecord(id: String,
                           delimiter: Char,
                           isTextQuoted: Boolean = false,
                           isNumbersQuoted: Boolean = false,
                           fields: Seq[Field])
  extends Record with TextSupport {

  override def fromText(line: String)(implicit scope: Scope) = {
    val rawValues = fromDelimitedText(line)
    val delta = fields.size - rawValues.size
    val values = rawValues ++ (if (delta > 0) fields.takeRight(delta).map(_.defaultValue.getOrElse("")) else Nil)
    DataSet(fields zip values map {
      case (field, value: String) =>
        field.name -> value.convert(field.`type`)
      case (field, value) =>
        field.name -> Option(value)
    })
  }

  override def toText(dataSet: DataSet)(implicit scope: Scope) = {
    toDelimitedText(dataSet.values(fields) map {
      case (name, Some(value: String)) =>
        scope.evaluate(value) getOrElse value
      case (name, value) =>
        value.map(_.toString) getOrElse ""
    })
  }

  private def fromDelimitedText(text: String) = {
    var inQuotes = false
    val sb = new StringBuilder()
    val values = text.toCharArray.foldLeft[List[String]](Nil) {
      case (list, '"') =>
        inQuotes = !inQuotes
        list
      case (list, ch) if ch == delimiter =>
        if (inQuotes) {
          sb.append(ch)
          list
        }
        else {
          val s = sb.toString().trim
          sb.clear()
          s :: list
        }
      case (list, ch) =>
        sb.append(ch)
        list
    }
    (if (sb.nonEmpty) sb.toString().trim :: values else values).reverse
  }

  private def toDelimitedText(values: Seq[Any]) = {
    val text = values.foldLeft(new StringBuilder()) { (sb, value) =>
      sb.append(delimiter).append(quote(value))
    }
    text.toString().tail
  }

  private def quote(value: Any) = value match {
    case n@(_: BigDecimal | _: BigInt | _: Byte | _: Double | _: Float | _: Int | _: Long | _: Number) if !isNumbersQuoted => n.toString
    case s: String if isTextQuoted => s""""$s""""
    case x => x.toString
  }

}


text: app.post('/post', (request, response) => response.end('success'))


text:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
        "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
        "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">

<!--

-->

<hibernate-mapping package="org.hibernate.test.event.collection.association.unidirectional">

    <class name="ParentWithCollectionOfEntities" table="PARENT">
        <id name="id" column="ID" type="long">
            <generator class="native"/>
        </id>
        <bag name="children" table="PARENT_CHILD"
             inverse="false" cascade="all">
            <key column="parent_id"/>
            <many-to-many column="child_id" class="org.hibernate.test.event.collection.ChildEntity"/>
        </bag>
    </class>

    <class name="org.hibernate.test.event.collection.ChildEntity" table="CHILD">
        <id name="id" column="ID" type="long">
            <generator class="native"/>
        </id>
        <property name="name" column="NAME" type="string"/>
    </class>

</hibernate-mapping>


text:
package com.tonychen.trainingapp.services;

import android.content.ComponentName;
import android.content.Intent;
import android.content.ServiceConnection;
import android.os.IBinder;
import android.os.RemoteException;
import android.view.KeyEvent;

import com.orhanobut.logger.Logger;
import com.tonychen.trainingapp.IDaemonInterface;
import com.tonychen.trainingapp.IMainInterface;
import com.tonychen.trainingapp.config.Attribute;
import com.tonychen.trainingapp.events.EventOpenDeamonService;
import com.tonychen.trainingapp.utils.SPUtil;
import com.tonychen.trainingapp.utils.ShellUtils;
import com.tonychen.trainingapp.utils.ToastUtil;

import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;

import java.io.IOException;

public class MainService extends BaseService {

    private ServiceConnection mDaemonServiceConnection = new ServiceConnection() {
        @Override
        public void onServiceConnected(ComponentName componentName, IBinder iBinder) {
            Logger.i("onServiceConnected ComponentName = " + componentName.getClassName());
            deamonServiceHolder = IDaemonInterface.Stub.asInterface(iBinder);
            try {
                Logger.i("MainService 当前PID = " + android.os.Process.myPid() + " 绑定的守护进程的PID = " + deamonServiceHolder.getPID());
                ToastUtil.showText("MainService 当前PID = " + android.os.Process.myPid() + " 绑定的守护进程的PID = " + deamonServiceHolder.getPID());
            } catch (RemoteException e) {
                e.printStackTrace();
            }

        }

        @Override
        public void onServiceDisconnected(ComponentName componentName) {
            Logger.i("onServiceDisconnected ComponentName = " + componentName.getClassName());
            if ((Boolean) SPUtil.getData(Attribute.ISBINDDAEMONSERVICE, false)) {
                startService(new Intent(MainService.this, DaemonService.class));
                Logger.i("MainService 重启 DaemonService");
            }
        }
    };
    private IDaemonInterface deamonServiceHolder;
    private Intent startDaemonService;

    public MainService() {
    }

    @Override
    public IBinder onBind(Intent intent) {
        return mMainServiceHolder;
    }

    @Override
    public void onCreate() {
        super.onCreate();
        EventBus.getDefault().register(this);
        mMainServiceHolder = new MainServiceHolder();

        startDaemonService = new Intent(MainService.this, DaemonService.class);
        keepAppAlive((Boolean) SPUtil.getData(Attribute.ISBINDDAEMONSERVICE, false));

    }

    @Override
    public void onDestroy() {
        super.onDestroy();
        EventBus.getDefault().unregister(this);
    }

    private MainServiceHolder mMainServiceHolder;

    @Subscribe(threadMode = ThreadMode.MAIN)
    public void onMessageEvent(EventOpenDeamonService event) {
        Logger.d(" onMessageEvent EventOpenDeamonService event.isOpen =" + event.isOpen);
        keepAppAlive(event.isOpen);
    }

    /**
     * 进程保活
     */
    private void keepAppAlive(final boolean isBindDaemonService) {
        Logger.i("keepAppAlive isBindDaemonService = " + isBindDaemonService);
        if (isBindDaemonService) {
//            /**
//             * 如果已经绑过来了,就没有必要再调用了
//             */
            if (deamonServiceHolder == null) {
                bindService(startDaemonService, mDaemonServiceConnection, BIND_AUTO_CREATE);
            }

        } else {
            if (deamonServiceHolder == null) {
                Logger.i("deamonServiceHolder is null!");
                return;
            }
            try {

                deamonServiceHolder.stopDeamonService();
                unbindService(mDaemonServiceConnection);
                deamonServiceHolder = null;
                ToastUtil.showText("断开与守护进程的连接");
            } catch (RemoteException e) {
                e.printStackTrace();
            }

        }

    }

    private final class MainServiceHolder extends IMainInterface.Stub {

        @Override
        public void basicTypes(int anInt, long aLong, boolean aBoolean,
                               float aFloat, double aDouble, String aString) throws RemoteException {
            Logger.i("basicTypes anInt = " + anInt + " aLong = " + aLong + " aBoolean = " +
                    aBoolean + " aFloat = " + aFloat + " aDouble = " + aDouble + " aString = " +
                    aString);
        }

        @Override
        public int getPID() throws RemoteException {

            return android.os.Process.myPid();
            //获取进程pid
        }

        @Override
        public void simulateHome() throws RemoteException {
            Logger.i("simulateHome");
            Intent it = new Intent(Intent.ACTION_MAIN);
            it.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
            it.addCategory(Intent.CATEGORY_HOME);
            startActivity(it);
            Logger.i("执行返回到launcher主页的指令");
        }

        @Override
        public void simulateBack() throws RemoteException {
            Logger.i("simulateBack");
            Runtime runtime = Runtime.getRuntime();
            try {
                runtime.exec("input keyevent " + KeyEvent.KEYCODE_BACK);
                Logger.i("执行返回键指令完成");
            } catch (IOException e) {
                e.printStackTrace();
            }

        }

        @Override
        public void setData(String data) throws RemoteException {
            Logger.i("setData start");
            ShellUtils.execCommand("input text 23523434242342424", true);
            Logger.i("setData end");
        }

        @Override
        public void deleData() throws RemoteException {
            Logger.i("del start");
            ShellUtils.execCommand("input keyevent 67", true);
            Logger.i("del end");
            Intent it = new Intent();
            it.putExtra("command","append");
            it.putExtra("value","1234567");
        }

        @Override
        public void clearData() throws RemoteException {
            Logger.i("clear start");
            for (int i = 0; i < 10; i++) {
                ShellUtils.execCommand("input keyevent 67", true);
            }
            Logger.i("clear end");
        }
    }

}


text:
layout: post
title: VIND - INFORMATION DISCOVERY FOR JAVA
author: tkurz
tag: vind
---

## Vind - Information Discovery for Java

We all know it. When dealing with application development we often face the same problem again and again.
When a problem comes up for the first time you study it, think about a proper solution, search for fitting technology
and build the solution which fits best. For the second time, you reuse some code (by copy-paste), debug it and make it
fitting. No later than for the third time this approach... sucks. Copy-pasting often produces sub-optimal results and
(which is even worse) causes bugs that you have to find and fix. Additionally this enlarges the codebase you have to
maintain and forces you to develop and test new features for all applications individually.

In our case the recurring problem was the integration of custom search facilities including reporting, analysis,
personalization and recommendation - a topic that we call *Information Discovery* (ID) on which we have been working on for almost a decade.
What we did is: we sat down, thought about proper scenarios and packaged these into a modular framework which provides you with an easy to use API, abstracts the complexity of the real ID tasks and thus lets you focus on the other parts of your application - things that you are expert in.

So let me kindly introduce to you Vind (faɪnd) - a modular Java framework for Information Discovery.

## Do you know this issue? Then you are at the right place!

Let me start with a simple example. Imagine your application provides blog posts with title, description and date.
It is obvious, that a search on the blog posts would be a great feature for your app. By using Vind this feature is just
a view steps ahead:

### 1. Include Vind by dependency

{% highlight xml %}
<!-- in this case we use the embedded solr server -->
<dependency>
    <groupId>com.rbmhtechnology.vind</groupId>
    <artifactId>embedded-solr-server</artifactId>
    <version>${vind.version}</version>
</dependency>
{% endhighlight %}

### 2. Create a Pojo with annotations

{% highlight java %}
class Post {

    // The @id annotation is obligatory for the post identification within Vind
    @Id
    private String id;

    // The fulltext annotation means: 'use this for fulltext search'.
    // The language enables a language specific handling on indexing an query time
    // The boost leads a a better ranking if (parts of) the title matches the query.
    @FullText(language = Language.English, boost = 1.2f)
    private String title;

    // The @Facet annotation enables faceting and filtering on this value
    @Facet
    private String category;

    // A field which is not annotated is not used for fulltext search but stored,
    // so it can be used for sorting
    private ZonedDateTime created;
}
{% endhighlight %}

### 3. Index and Search Pojos
{% highlight java %}
// Get an instance of a server (in this case a embedded solr server)
SearchServer server = SearchServer.getInstance();

// Index a Post
server.indexBean(my_new_post);

// Don't forget to commit
server.commit();

// Search for blogs of type 'news' that contain 'cool stuff'
FulltextSearch search = Search
    .fulltext("redbull release")
    .facet("category","news");

BeanSearchResult<Post> result = server.execute(search, Post.class);
{% endhighlight %}

That's it. Your applications now includes a simple search functionality.
Of course, Vind can do much more things, but we follow a simple paradigm:

> No expert? No problem! Which means: easy things should be easy to do.

So if your application has more sophisticated requirements on ID, Vind can still support
many of them, whereby the code may be more complex. But we still try to keep it simple ;)

## Mhh, Vind - interesting. But what's its real power?

Vind does not only provide you with annotation based indexing and simple search facilities.
It is rather meant to support you with the whole *Information Discovery* environment, that also includes logging,
adaption, evolution, and recommendation. This stack shows all the components that are planned
for Vind.

{:style="width:50%"}
![Vind Modules](../images/vind-modules.png)

As it is the basis for all the further work we started with the definition and implementation of the
basic features - indexing and searching. Vind can be splitted into two parts, client and server. The lib thereby
has the goal to be backend agnostic but we started with [Apache Solr](http://lucene.apache.org/solr/),
a widespread and enterprise proven search server, as a first implementation basis.

### Already in place

* **Search Client:** Includes the whole API definition for indexing (annotation and field-descriptor based) and search (bean-based as well as type-save).
* **Solr Client:** Implements the API on top of the Solr framework.
* **Solr Server:** Contains Solr configuration, specific Solr components, utilities for backend management and a Test environment.

### Currently in progress

* **Logging:** Enables logging of all interactions (indexing, search, result access)
* **Reporter:** Includes utils to analyze the logging (data condense, visualization)

### Plannend in the midterm

* **Analysis:** Allows to analyze and use logging results for search improvements (ranking, suggestions, etc)
* **Smart Search:** Adds natural language components and workflow detection for a more natural behaviour

### Planned in the longterm
* **Recommendation:** Includes analysis based clustering, personalization and history based recommendations (filters, ranking, etc.)

## Cool! But how to start now?

There are several ways, how you can get familiar with the whole Vind modules.

* [Fork the repository](https://github.com/RBMHTechnology/vind)
* [Read the documentation](https://rbmhtechnology.github.io/vind)
* [Follow the blog posts](http://rbmhtechnology.github.io/blog/tag/vind/)
* [Contact us on gitter](https://gitter.im/RBMHTechnology/vind)

Have fun, we hope you enjoy Vind! And if you have any questions, feature requests or bug report: Please get in touch with us!


text:
 Weitere Informationen

		{% for link in site.data.footer %}
      {% if link.url contains 'http' %}
        {% assign domain = '' %}
        {% else %}
        {% assign domain = site.url | replace: 'http://', '//' %}
      {% endif %}

				{{ link.title }}

		{% endfor %}

© {{ site.time | date: '%Y' }} {{ site.title }}


text:
module CacheDeleteMatchedBehavior
  def test_delete_matched
    @cache.write("foo", "bar")
    @cache.write("fu", "baz")
    @cache.write("foo/bar", "baz")
    @cache.write("fu/baz", "bar")
    @cache.delete_matched(/oo/)
    assert !@cache.exist?("foo")
    assert @cache.exist?("fu")
    assert !@cache.exist?("foo/bar")
    assert @cache.exist?("fu/baz")
  end
end


text:
'use strict';

// Configuring the Articles module
angular.module('articles').run(['Menus',
	function(Menus) {
		// Set top bar menu items
		Menus.addMenuItem('topbar', 'Proposals', 'articles', 'dropdown', '/articles(/create)?');
		Menus.addSubMenuItem('topbar', 'articles', 'List of Policy Proposals', 'articles');
		Menus.addSubMenuItem('topbar', 'articles', 'Create a New Proposal', 'articles/create');
	}
]);


text:
<?php

declare(strict_types=1);

namespace Czim\NestedModelUpdater\Data;

use Illuminate\Database\Eloquent\Model;

/**
 * Container for the results of a nested update or create operation
 *
 * @template TModel of \Illuminate\Database\Eloquent\Model
 */
class UpdateResult
{
    /**
     * @var null|TModel
     */
    protected ?Model $model = null;

    /**
     * Wether the operation was successful.
     * If no model is set, but the operation is successful, no exceptions should
     * be thrown, the relation should be assumed deliberately discarded.
     *
     * @var bool
     */
    protected bool $success = true;

    /**
     * @param TModel|null $model
     * @return $this
     */
    public function setModel(?Model $model): static
    {
        $this->model = $model;

        return $this;
    }

    public function model(): ?Model
    {
        return $this->model;
    }

    /**
     * @param bool $success
     * @return $this
     */
    public function setSuccess(bool $success): static
    {
        $this->success = $success;

        return $this;
    }

    public function success(): bool
    {
        return $this->success;
    }
}


text:
var config = require('../../config/config.js');
var mbaasRequest = require('../../mbaasRequest/mbaasRequest.js');
var constants = require('../../config/constants.js');

/**
 * List Submissions For An Environment
 * @param params
 * @param cb
 */
function list(params, cb){
  var resourcePath = config.addURIParams(constants.FORMS_BASE_PATH + "/submissions", params);
  var method = "GET";
  var data = {};

  params.resourcePath = resourcePath;
  params.method = method;
  params.data = data;

  mbaasRequest.admin(params, cb);
}

/**
 * Get A Single Submission From An Environment
 * @param params
 * @param cb
 */
function get(params, cb){
  var resourcePath = config.addURIParams(constants.FORMS_BASE_PATH + "/submissions/:id", params);
  var method = "GET";
  var data = {};

  params.resourcePath = resourcePath;
  params.method = method;
  params.data = data;

  mbaasRequest.admin(params, cb);
}

/**
 * Update A Submission In An Environment
 * @param params
 * @param cb
 */
function update(params, cb){
  var resourcePath = config.addURIParams(constants.FORMS_BASE_PATH + "/submissions/:id", params);
  var method = "PUT";
  var data = params.submission;

  params.resourcePath = resourcePath;
  params.method = method;
  params.data = data;

  mbaasRequest.admin(params, cb);
}

/**
 * Creating A New Submission.
 * @param params
 * @param cb
 */
function create(params, cb){
  params.resourcePath = config.addURIParams(constants.FORMS_BASE_PATH + "/submissions", params);
  params.method = "POST";
  params.data = params.submission;

  mbaasRequest.admin(params, cb);
}

/**
 * Marking A Pending Submission As Complete.
 * @param params
 * @param cb
 */
function complete(params, cb){
  params.resourcePath = config.addURIParams(constants.FORMS_BASE_PATH + "/submissions/:id/complete", params);
  params.method = "POST";
  params.data = {};

  mbaasRequest.admin(params, cb);
}

/**
 * Update A File For A Submission
 * @param params
 * @param cb
 */
function updateFile(params, cb){
  var resourcePath = config.addURIParams(constants.FORMS_BASE_PATH + "/submissions/:id/fields/:fieldId/files/:fileId", params);
  var method = "PUT";
  var data = params.fileDetails;

  params.resourcePath = resourcePath;
  params.method = method;
  params.data = data;

  params.fileRequest = true;
  params.fileUploadRequest = true;

  mbaasRequest.admin(params, cb);
}

/**
 * Adding A File To A Submission
 * @param params
 * @param cb
 */
function addFile(params, cb){
  params.resourcePath = config.addURIParams(constants.FORMS_BASE_PATH + "/submissions/:id/fields/:fieldId/files/:fileId", params);
  params.method = "POST";
  params.data = params.fileDetails;
  params.fileRequest = true;
  params.fileUploadRequest = true;

  mbaasRequest.admin(params, cb);
}

/**
 * Remove A Submission From An Environment
 * @param params
 * @param cb
 */
function remove(params, cb){
  var resourcePath = config.addURIParams(constants.FORMS_BASE_PATH + "/submissions/:id", params);
  var method = "DELETE";
  var data = {};

  params.resourcePath = resourcePath;
  params.method = method;
  params.data = data;

  mbaasRequest.admin(params, cb);
}

/**
 * Search For Submission In An Environment
 * @param params
 * @param cb
 */
function search(params, cb){
  var resourcePath = config.addURIParams(constants.FORMS_BASE_PATH + "/submissions/search", params);
  var method = "POST";
  var data = params.queryParams;

  params.resourcePath = resourcePath;
  params.method = method;
  params.data = data;

  mbaasRequest.admin(params, cb);
}

/**
 * Filtering Submissions From An Environment Mbaas.
 *
 * Forms Can Be Filtered By form ID or Project ID
 *
 * @param params
 * @param cb
 */
function filterSubmissions(params, cb){
  params.resourcePath = config.addURIParams(constants.FORMS_BASE_PATH + "/submissions/filter", params);
  params.method = "POST";
  params.data = params.filterParams;

  mbaasRequest.admin(params, cb);
}

/**
 * Export Submissions As A Zip File Containing CSVs.
 * @param params
 * @param cb
 */
function exportSubmissions(params, cb){
  var resourcePath = config.addURIParams(constants.FORMS_BASE_PATH + "/submissions/export", params);
  var method = "POST";
  var data = params.queryParams;

  params.resourcePath = resourcePath;
  params.method = method;
  params.data = data;

  //Export is a zip file response..
  params.fileRequest = true;

  mbaasRequest.admin(params, cb);
}

/**
 * Get A File Contained In A Submission For An Environment
 * @param params
 * @param cb
 */
function getSubmissionFile(params, cb){
  var resourcePath = config.addURIParams(constants.FORMS_BASE_PATH + "/submissions/:id/files/:fileId", params);
  var method = "GET";
  var data = {};

  params.resourcePath = resourcePath;
  params.method = method;
  params.data = data;

  params.fileRequest = true;

  mbaasRequest.admin(params, cb);
}

/**
 * Getting A PDF Of A Submission
 * @param params
 * @param cb
 */
function getSubmissionPDF(params, cb){
  var resourcePath = config.addURIParams(constants.FORMS_BASE_PATH + "/submissions/:id/exportpdf", params);
  var method = "GET";
  var data = {};

  params.resourcePath = resourcePath;
  params.method = method;
  params.data = data;

  params.fileRequest = true;

  mbaasRequest.admin(params, cb);
}

module.exports = {
  list: list,
  get: get,
  update: update,
  create: create,
  complete: complete,
  updateFile: updateFile,
  addFile: addFile,
  remove: remove,
  search: search,
  filterSubmissions: filterSubmissions,
  export: exportSubmissions,
  getSubmissionFile: getSubmissionFile,
  getSubmissionPDF: getSubmissionPDF
};


text:
using Medidata.MAuth.Core.Models;
using System;
using System.Collections.Generic;

namespace Medidata.MAuth.Core
{
    /// <summary>
    /// Contains the options used by the <see cref="MAuthSigningHandler"/>.
    /// </summary>
    public class MAuthSigningOptions
    {
        private string _privateKey;

        /// <summary>
        /// Determines the RSA private key for the authentication requests. The value of this property can be set as a
        /// valid path to a readable key file as well.After set, this property will either contain an inflated
        /// private key or `null`.
        /// </summary>
        public string PrivateKey {
            get => _privateKey;
            set => _privateKey = value.Inflate();
        }

        /// <summary>Determines the unique identifier used for the MAuth service authentication requests.</summary>
        public Guid ApplicationUuid { get; set; }

        /// <summary>
        /// Determines the time when signing requests instead of the current date and time.
        /// This property is for testing purposes only.
        /// </summary>
        internal DateTimeOffset? SignedTime { get; set; }

        /// <summary>
        /// Enumeration values of MAuth protocol versions to sign requests, if not provided defaults to `MWS`.
        /// </summary>
        public MAuthVersion SignVersions { get; set; } = MAuthVersion.MWS;
    }
}


text:
var express = require('express');
var bodyParser = require('body-parser');
var cors = require('cors');
var _ = require('underscore');
/**
 * Including fh-mbaas-api to be able to use $fh.db to store and retrieve jobs
 */
var fh = require('fh-mbaas-api');

function jobRoute() {
  var jobsRouter = new express.Router();
  jobsRouter.use(cors());
  jobsRouter.use(bodyParser());

  function handleError(err, response){
    var error = {
      "message": err,
      "code": 500
    };
    response.writeHead(500);
    response.end(JSON.stringify(error));
  }

  /**
   * Finding a list of jobs located in mongo database
   */
  function findJobEntry(jobId, cb){
    fh.db({
      act: "list",
      type: "jobs",
      eq: {
        jobId: jobId
      }
    }, cb);
  }

  /**
   * Getting a list of jobs from the server.
   */
  jobsRouter.get('/', function(req, res) {
    /**
     * Finding a list of jobs located in mongo database
     */
    fh.db({
      act: "list",
      type: "jobs"
    }, function(err, listResult){
      if(err){
        handleError(err, res);
      } else {
        var jobs = _.map(listResult.list, function(jobEntry){
          return jobEntry.fields;
        });
        res.json(jobs);
      }
    });
  });

  /**
   * Getting a specific job by its id
   */
  jobsRouter.get('/:jobId', function(req, res) {

    var reqParams = req.params;
    var jobId = reqParams.jobId;

    findJobEntry(jobId, function(err, listResult){
      if(err){
        handleError(err, res);
      } else {
        if(listResult.count === 1){
          var job = listResult.list[0].fields;
          res.json(job);
        } else {
          handleError("No job found matching id " + jobId, res);
        }
      }
    });
  });

  /**
   * Creating a new job
   */
  jobsRouter.post('/', function(req, res) {

    var jobDetails = req.body;

    fh.db({
      act: "create",
      type: "jobs",
      fields: jobDetails
    }, function(err, data){
      if(err){
        handleError(err, res);
      } else {
        var jobData = data.fields;
        res.json(jobData);
      }
    });
  });

  /**
   * Updating job details using a put request.
   */
  jobsRouter.put('/:jobId', function(req, res) {
    var reqParams = req.params;
    var jobId = reqParams.jobId;
    var jobData = req.body;

    console.log("reqParams", reqParams, jobData);

    /**
     * Finding a job with jobId
     */
    findJobEntry(jobId, function(err, listResult){
      console.log("Found Job", err, listResult);
      if(err){
        handleError(err, res);
      } else {

        /**
         * Checking that a job with jobId is found
         */
        if(listResult.count < 1){
          /**
           * Creating a new job
           */
          jobData.status = "new";
          fh.db({
            act: "create",
            type: "jobs",
            fields: jobData
          }, function(err, data){
            if(err){
              handleError(err, res);
            } else {
              var jobData = data.fields;
              res.json(jobData);
            }
          });
          return;
        }

        var job = listResult.list[0];
        var jobGuid = job.guid;

        /**
         * Updating the job
         */
        fh.db({
          act: "update",
          type: "jobs",
          guid: jobGuid,
          fields: jobData
        }, function(err, data){
          console.log("Finsihed Update", err, data, jobData);
          if(err){
            handleError(err, res);
          } else {
            res.json(data.fields);
          }
        });
      }
    });
  });

  /**
   * Deleting a job
   */
  jobsRouter['delete']('/:jobId', function(req, res) {
    var reqParams = req.params;
    var jobId = reqParams.jobId;

    findJobEntry(jobId, function(err, listResult){
      if(err){
        handleError(err, res);
      } else {
        /**
         * Checking that a job with jobId is found
         */
        if(listResult.count < 1){
          return handleError("No job found matching id " + jobId, res);
        }

        var job = listResult.list[0];
        var jobGuid = job.guid;

        fh.db({
          act: "delete",
          type: "jobs",
          guid: jobGuid
        }, function(err, deletedRecord){
          if(err){
            handleError(err, res);
          } else {
            res.json({});
          }
        });
      }
    });
  });

  return jobsRouter;
}

module.exports = jobRoute;


text:
class LevelSettings {
public:
    unsigned int seed;
	int gameType;
	int generator;
	int dayCycle;
public:
    LevelSettings();

    void* getDefaultSpawn() const;
	int getGameType() const;
	int getGenerator() const;
	unsigned int getSeed() const;
	int hasBeenLoadedInCreative() const;
};


text:
import {
  green100, greenA700, green700,
  pinkA200, greenA100, lightGreenA700,
  grey900, white, grey400, darkBlack
} from 'material-ui/styles/colors'
import {fade} from 'material-ui/utils/colorManipulator'
import spacing from 'material-ui/styles/spacing'
import zIndex from 'material-ui/styles/zIndex'

export default {
  spacing,
  zIndex: zIndex,
  fontFamily: 'Roboto, sans-serif',
  palette: {
    primary1Color: greenA700,
    primary2Color: green700,
    primary3Color: green100,
    accent1Color: pinkA200,
    accent2Color: greenA100,
    accent3Color: lightGreenA700,
    textColor: grey900,
    alternateTextColor: white,
    canvasColor: white,
    borderColor: grey400,
    disabledColor: fade(darkBlack, 0.3),
    pickerHeaderColor: pinkA200
  }
}

/* import {
  blueGrey100, blueGrey500, blueGrey700,
  pinkA200, tealA100, lightBlue500,
  grey900, white, grey400, darkBlack
} from 'material-ui/styles/colors'
import {fade} from 'material-ui/utils/colorManipulator'
import spacing from 'material-ui/styles/spacing'
import zIndex from 'material-ui/styles/zIndex'

export default {
  spacing,
  zIndex: zIndex,
  fontFamily: 'Roboto, sans-serif',
  palette: {
    primary1Color: blueGrey500,
    primary2Color: blueGrey700,
    primary3Color: blueGrey100,
    accent1Color: pinkA200,
    accent2Color: tealA100,
    accent3Color: lightBlue500,
    textColor: grey900,
    alternateTextColor: white,
    canvasColor: white,
    borderColor: grey400,
    disabledColor: fade(darkBlack, 0.3),
    pickerHeaderColor: pinkA200
  }
}
*/