text:
.class final Landroid/content/Intent$FlymeInjector;
.super Ljava/lang/Object;
.source "Intent.java"

# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Landroid/content/Intent;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x18
    name = "FlymeInjector"
.end annotation

# direct methods
.method constructor <init>()V
    .locals 0

    .prologue
    .line 7961
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method

.method private static copyIntent(Landroid/content/Intent;Landroid/content/Intent;)V
    .locals 2
    .param p0, "dst"    # Landroid/content/Intent;
    .param p1, "src"    # Landroid/content/Intent;

    .prologue
    .line 7973
    iget-object v0, p0, Landroid/content/Intent;->mFlymeIntent:Landroid/content/IntentExt;

    iget-object v1, p1, Landroid/content/Intent;->mFlymeIntent:Landroid/content/IntentExt;

    iget v1, v1, Landroid/content/IntentExt;->mMeizuFlags:I

    iput v1, v0, Landroid/content/IntentExt;->mMeizuFlags:I

    .line 7974
    iget-object v0, p0, Landroid/content/Intent;->mFlymeIntent:Landroid/content/IntentExt;

    iget-object v1, p1, Landroid/content/Intent;->mFlymeIntent:Landroid/content/IntentExt;

    iget v1, v1, Landroid/content/IntentExt;->mAccessSrcFlags:I

    iput v1, v0, Landroid/content/IntentExt;->mAccessSrcFlags:I

    .line 7975
    iget-object v0, p0, Landroid/content/Intent;->mFlymeIntent:Landroid/content/IntentExt;

    iget-object v1, p1, Landroid/content/Intent;->mFlymeIntent:Landroid/content/IntentExt;

    iget-object v1, v1, Landroid/content/IntentExt;->mAccessPackageName:Ljava/lang/String;

    iput-object v1, v0, Landroid/content/IntentExt;->mAccessPackageName:Ljava/lang/String;

    .line 7976
    iget-object v0, p0, Landroid/content/Intent;->mFlymeIntent:Landroid/content/IntentExt;

    iget-object v1, p1, Landroid/content/Intent;->mFlymeIntent:Landroid/content/IntentExt;

    iget-object v1, v1, Landroid/content/IntentExt;->mAccessPackageLabel:Ljava/lang/String;

    iput-object v1, v0, Landroid/content/IntentExt;->mAccessPackageLabel:Ljava/lang/String;

    .line 7977
    iget-object v0, p0, Landroid/content/Intent;->mFlymeIntent:Landroid/content/IntentExt;

    iget-object v1, p1, Landroid/content/Intent;->mFlymeIntent:Landroid/content/IntentExt;

    iget-object v1, v1, Landroid/content/IntentExt;->mAccessSrcPackageName:Ljava/lang/String;

    iput-object v1, v0, Landroid/content/IntentExt;->mAccessSrcPackageName:Ljava/lang/String;

    .line 7978
    iget-object v0, p0, Landroid/content/Intent;->mFlymeIntent:Landroid/content/IntentExt;

    iget-object v1, p1, Landroid/content/Intent;->mFlymeIntent:Landroid/content/IntentExt;

    iget-object v1, v1, Landroid/content/IntentExt;->mAccessSrcClassName:Ljava/lang/String;

    iput-object v1, v0, Landroid/content/IntentExt;->mAccessSrcClassName:Ljava/lang/String;

    .line 7979
    return-void
.end method

.method static copyMeizuFlag(Landroid/content/Intent;Landroid/content/Intent;)V
    .locals 2
    .param p0, "dst"    # Landroid/content/Intent;
    .param p1, "src"    # Landroid/content/Intent;

    .prologue
    .line 7982
    iget-object v0, p0, Landroid/content/Intent;->mFlymeIntent:Landroid/content/IntentExt;

    iget-object v1, p1, Landroid/content/Intent;->mFlymeIntent:Landroid/content/IntentExt;

    iget v1, v1, Landroid/content/IntentExt;->mMeizuFlags:I

    iput v1, v0, Landroid/content/IntentExt;->mMeizuFlags:I

    .line 7983
    return-void
.end method

.method static createFlymeIntent(Landroid/content/Intent;)V
    .locals 1
    .param p0, "dst"    # Landroid/content/Intent;

    .prologue
    .line 7964
    new-instance v0, Landroid/content/IntentExt;

    invoke-direct {v0}, Landroid/content/IntentExt;-><init>()V

    iput-object v0, p0, Landroid/content/Intent;->mFlymeIntent:Landroid/content/IntentExt;

    .line 7965
    return-void
.end method

.method static createFlymeIntent(Landroid/content/Intent;Landroid/content/Intent;)V
    .locals 0
    .param p0, "dst"    # Landroid/content/Intent;
    .param p1, "src"    # Landroid/content/Intent;

    .prologue
    .line 7968
    invoke-static {p0}, Landroid/content/Intent$FlymeInjector;->createFlymeIntent(Landroid/content/Intent;)V

    .line 7969
    invoke-static {p0, p1}, Landroid/content/Intent$FlymeInjector;->copyIntent(Landroid/content/Intent;Landroid/content/Intent;)V

    .line 7970
    return-void
.end method

.method static readIntentExt(Landroid/content/Intent;Landroid/os/Parcel;)V
    .locals 2
    .param p0, "dst"    # Landroid/content/Intent;
    .param p1, "in"    # Landroid/os/Parcel;

    .prologue
    .line 7995
    iget-object v0, p0, Landroid/content/Intent;->mFlymeIntent:Landroid/content/IntentExt;

    invoke-virtual {p1}, Landroid/os/Parcel;->readInt()I

    move-result v1

    iput v1, v0, Landroid/content/IntentExt;->mMeizuFlags:I

    .line 7996
    iget-object v0, p0, Landroid/content/Intent;->mFlymeIntent:Landroid/content/IntentExt;

    invoke-virtual {p1}, Landroid/os/Parcel;->readInt()I

    move-result v1

    iput v1, v0, Landroid/content/IntentExt;->mAccessSrcFlags:I

    .line 7997
    iget-object v0, p0, Landroid/content/Intent;->mFlymeIntent:Landroid/content/IntentExt;

    invoke-virtual {p1}, Landroid/os/Parcel;->readString()Ljava/lang/String;

    move-result-object v1

    iput-object v1, v0, Landroid/content/IntentExt;->mAccessPackageName:Ljava/lang/String;

    .line 7998
    iget-object v0, p0, Landroid/content/Intent;->mFlymeIntent:Landroid/content/IntentExt;

    invoke-virtual {p1}, Landroid/os/Parcel;->readString()Ljava/lang/String;

    move-result-object v1

    iput-object v1, v0, Landroid/content/IntentExt;->mAccessPackageLabel:Ljava/lang/String;

    .line 7999
    iget-object v0, p0, Landroid/content/Intent;->mFlymeIntent:Landroid/content/IntentExt;

    invoke-virtual {p1}, Landroid/os/Parcel;->readString()Ljava/lang/String;

    move-result-object v1

    iput-object v1, v0, Landroid/content/IntentExt;->mAccessSrcPackageName:Ljava/lang/String;

    .line 8000
    iget-object v0, p0, Landroid/content/Intent;->mFlymeIntent:Landroid/content/IntentExt;

    invoke-virtual {p1}, Landroid/os/Parcel;->readString()Ljava/lang/String;

    move-result-object v1

    iput-object v1, v0, Landroid/content/IntentExt;->mAccessSrcClassName:Ljava/lang/String;

    .line 8001
    return-void
.end method

.method static writeIntentExt(Landroid/content/Intent;Landroid/os/Parcel;)V
    .locals 1
    .param p0, "dst"    # Landroid/content/Intent;
    .param p1, "out"    # Landroid/os/Parcel;

    .prologue
    .line 7986
    iget-object v0, p0, Landroid/content/Intent;->mFlymeIntent:Landroid/content/IntentExt;

    iget v0, v0, Landroid/content/IntentExt;->mMeizuFlags:I

    invoke-virtual {p1, v0}, Landroid/os/Parcel;->writeInt(I)V

    .line 7987
    iget-object v0, p0, Landroid/content/Intent;->mFlymeIntent:Landroid/content/IntentExt;

    iget v0, v0, Landroid/content/IntentExt;->mAccessSrcFlags:I

    invoke-virtual {p1, v0}, Landroid/os/Parcel;->writeInt(I)V

    .line 7988
    iget-object v0, p0, Landroid/content/Intent;->mFlymeIntent:Landroid/content/IntentExt;

    iget-object v0, v0, Landroid/content/IntentExt;->mAccessPackageName:Ljava/lang/String;

    invoke-virtual {p1, v0}, Landroid/os/Parcel;->writeString(Ljava/lang/String;)V

    .line 7989
    iget-object v0, p0, Landroid/content/Intent;->mFlymeIntent:Landroid/content/IntentExt;

    iget-object v0, v0, Landroid/content/IntentExt;->mAccessPackageLabel:Ljava/lang/String;

    invoke-virtual {p1, v0}, Landroid/os/Parcel;->writeString(Ljava/lang/String;)V

    .line 7990
    iget-object v0, p0, Landroid/content/Intent;->mFlymeIntent:Landroid/content/IntentExt;

    iget-object v0, v0, Landroid/content/IntentExt;->mAccessSrcPackageName:Ljava/lang/String;

    invoke-virtual {p1, v0}, Landroid/os/Parcel;->writeString(Ljava/lang/String;)V

    .line 7991
    iget-object v0, p0, Landroid/content/Intent;->mFlymeIntent:Landroid/content/IntentExt;

    iget-object v0, v0, Landroid/content/IntentExt;->mAccessSrcClassName:Ljava/lang/String;

    invoke-virtual {p1, v0}, Landroid/os/Parcel;->writeString(Ljava/lang/String;)V

    .line 7992
    return-void
.end method


text:
import React from 'react';
import stateProxyFactory from './stateProxy';

const connectComponent = (mutations) => (Component) => { // eslint-disable-line
  const mutationKeys = Object.keys(mutations); // Array of all mutation keys (names)

  return class extends React.Component {
    constructor(props) {
      super(props);

      this.state = {};

      const composeMutation = (mutationKey, mutationFunction) => (...params) => {
        mutationFunction(...params, this.handleMutationResponseData(mutationKey));
      };

      // Compose all mutations
      this.composedMutations = {};
      this.mutationStateProxies = {};

      const StateProxy = stateProxyFactory(this);
      mutationKeys.forEach((mutationKey) => {
        const mutationFunction = mutations[mutationKey].mutation;
        const initialState = mutations[mutationKey].initialState;

        // Compose the mutation
        this.composedMutations[mutationKey] = composeMutation(mutationKey, mutationFunction);

        // Declare mutation state
        this.state[mutationKey] = initialState;

        // Create a mutation state proxy
        this.mutationStateProxies[mutationKey] = new StateProxy(mutationKey, initialState);
      });
    }

    setMutationState(mutationKey, data) {
      // Update component state
      this.setState({ [mutationKey]: data });

      // Update proxy state
      this.mutationStateProxies[mutationKey].state = data;
    }

    handleMutationResponseData(mutationKey) {
      return (response) => {
        const data = response[mutationKey];
        this.setMutationState(mutationKey, data);
      };
    }

    updateMutationProxies() {
      mutationKeys.forEach((mutationKey) => {
        this.mutationStateProxies[mutationKey].state = this.state[mutationKey];
      });
    }

    render() {
      const { props, composedMutations } = this;

      this.updateMutationProxies();
      return (<Component {...props} {...this.mutationStateProxies} mutations={composedMutations}/>);
    }
  };
};

export default connectComponent;

redpajama_set_name: RedPajamaGithub


text:
//>>built
define("dojox/mvc/Output", [
	"dojo/_base/declare",
	"dojo/_base/lang",
	"dojo/dom",
	"dijit/_WidgetBase"
], function(declare, lang, dom, _WidgetBase){
	/*=====
		declare = dojo.declare;
		dom = dojo.dom;
		_WidgetBase = dijit._WidgetBase;
	=====*/

	return declare("dojox.mvc.Output", [_WidgetBase], {
		// summary:
		//		A simple widget that displays templated output, parts of which may
		//		be data-bound.
		//
		// description:
		//		Simple output example:
		//
		//		|  <span dojoType="dojox.mvc.Output" ref="model.balance">
		//		|    Your balance is: ${this.value}
		//		|  </span>
		//
		//		The output widget being data-bound, if the balance changes in the
		//		dojox.mvc.StatefulModel, the content within the <span> will be
		//		updated accordingly.

		// templateString: [private] String
		//		The template or data-bound output content.
		templateString : "",

		postscript: function(params, srcNodeRef){
			// summary:
			//		Override and save template from body.
			this.srcNodeRef = dom.byId(srcNodeRef);
			if(this.srcNodeRef){
				this.templateString = this.srcNodeRef.innerHTML;
				this.srcNodeRef.innerHTML = "";
			}
			this.inherited(arguments);
		},

		set: function(name, value){
			// summary:
			//		Override and refresh output on value change.
			this.inherited(arguments);
			if(name === "value"){
				this._output();
			}
		},

		////////////////////// PRIVATE METHODS ////////////////////////

		_updateBinding: function(name, old, current){
			// summary:
			//		Rebuild output UI if data binding changes.
			// tags:
			//		private
			this.inherited(arguments);
			this._output();
		},

		_output: function(){
			// summary:
			//		Produce the data-bound output.
			// tags:
			//		private
			var outputNode = this.srcNodeRef || this.domNode;
			outputNode.innerHTML = this.templateString ? this._exprRepl(this.templateString) : this.value;
		},

		_exprRepl: function(tmpl){
			// summary:
			//		Does substitution of ${foo+bar} type expressions in template string.
			// tags:
			//		private
			var pThis = this, transform = function(value, key){
				if(!value){return "";}
				var exp = value.substr(2);
				exp = exp.substr(0, exp.length - 1);
				with(pThis){return eval(exp) || "";}
			};
			transform = lang.hitch(this, transform);
			return tmpl.replace(/\$\{.*?\}/g,
				function(match, key, format){
					return transform(match, key).toString();
				});
		}
	});
});


text:
package id.gits.dprkita.dao.anggota;

import java.io.Serializable;

/**
 * Created by yatnosudar on 3/7/15.
 */
public class Akd implements Serializable {

    private int id;
    private int id_lembaga;
    private String lembaga;
    private String jabatan;

    public int getId() {
        return id;
    }

    public int getId_lembaga() {
        return id_lembaga;
    }

    public String getLembaga() {
        return lembaga;
    }

    public String getJabatan() {
        return jabatan;
    }
}


text:
<?php

namespace SolubleTest\Japha\Bridge;

use Soluble\Japha\Bridge\Adapter;
use PHPUnit\Framework\TestCase;

/**
 * Generated by PHPUnit_SkeletonGenerator on 2014-11-04 at 16:47:42.
 */
class AdapterUsageInnerClassTest extends TestCase
{
    /**
     * @var string
     */
    protected $servlet_address;

    /**
     * @var Adapter
     */
    protected $adapter;

    /**
     * Sets up the fixture, for example, opens a network connection.
     * This method is called before a test is executed.
     */
    protected function setUp(): void
    {
        \SolubleTestFactories::startJavaBridgeServer();

        $this->servlet_address = \SolubleTestFactories::getJavaBridgeServerAddress();

        $this->adapter = new Adapter([
            'driver' => 'Pjb62',
            'servlet_address' => $this->servlet_address,
        ]);
    }

    /**
     * Tears down the fixture, for example, closes a network connection.
     * This method is called after a test is executed.
     */
    protected function tearDown(): void
    {
    }

    public function testInnerClassCalendarBuilder()
    {
        $ba = $this->adapter;

        // Use inner class, notice the '$' separator
        // @see https://docs.oracle.com/javase/8/docs/api/java/util/Calendar.Builder.html
        $builder = $ba->java('java.util.Calendar$Builder');

        self::assertEquals('java.util.Calendar$Builder', $ba->getClassName($builder));

        $calendar = $builder->setCalendarType('gregory')->build();

        self::assertEquals('java.util.GregorianCalendar', $ba->getClassName($calendar));
    }
}


text:
import * as angular from 'angular';

class LoadedMetaDataService{
	private ValidationService;

	private uniqSessionList;
	private bundleList;
	private curBndl;
	private demoDbName;
	private rendOptBndlList; // render optimized bundle list

	constructor(ValidationService){
		this.ValidationService = ValidationService;

		this.uniqSessionList = [];
		this.bundleList = [];
		this.curBndl = {} as any;
		this.demoDbName = '';
		this.rendOptBndlList = {} as any; // render optimized bundle list
	}

	private genUniqSessionList(bndlList) {
		var sList = [];
		var fistSes;
		bndlList.forEach((bndl, idx) => {
			sList[bndl.session] = {
				'collapsed': true
			};
			if (idx === 0) {
				fistSes = bndl.session;
			}
		});
		// open fist session up
		sList[fistSes].collapsed = false;
		return sList;
	}

	private genRendOptBndlList(bndlList) {
		bndlList.forEach((bndl) => {
			if (this.rendOptBndlList[bndl.session] === undefined) {
				this.rendOptBndlList[bndl.session] = [];
			}
			this.rendOptBndlList[bndl.session].push(bndl);
		});
		return this.rendOptBndlList;
	}
	///////////////
	// bundleList

	/**
	* setter for bundleList
	* @returns validation result for bundle list
	*/
	public setBundleList(bList) {
		// validate
		var validRes = this.ValidationService.validateJSO('bundleListSchema', bList);
		if (validRes === true) {
			// set
			this.bundleList = bList;
			// generate uniqSessionList
			this.uniqSessionList = this.genUniqSessionList(this.bundleList);
			// generate render optimized bundlList
			this.rendOptBndlList = this.genRendOptBndlList(this.bundleList);
		}
		return validRes;
	};

	/**
	* getter for bundleList
	*/
	public getBundleList () {
		return this.bundleList;
	};

	/**
	* getter for rendOptBndlList
	*/
	public getRendOptBndlList() {
		return this.rendOptBndlList;
	};

	///////////
	// curBndl

	/**
	* getter curBndl
	*/
	public getCurBndl() {
		return this.curBndl;
	};

	/**
	* setter curBndl
	*/
	public setCurBndl(bndl) {
		this.curBndl = bndl;
	};

	/**
	* remove BndlComment
	*/
	public setBndlComment(comment, key, index) {
		this.rendOptBndlList[key][index].comment = comment;
	};

	/**
	* setter BndlFinished
	*/
	public setBndlFinished(finished, key, index) {
		this.rendOptBndlList[key][index].finishedEditing = finished;
	};

	/**
	* getter curBndl name
	*/
	public getCurBndlName() {
		return this.curBndl.name;
	};

	/**
	* setter curBndl name
	*/
	public setCurBndlName(name) {
		this.curBndl.name = name;
	};

	///////////
	// timeAnchors

	/**
	* setter timeAnchors
	*/
	public setTimeAnchors(timeAnchors) {
		this.curBndl.timeAnchors = timeAnchors;
	};

	//////////////
	// demoDbName

	/**
	* setter demoDbName
	*/
	public setDemoDbName(name) {
		this.demoDbName = name;
	};

	/**
	* getter demoDbName
	*/
	public getDemoDbName() {
		return this.demoDbName;
	};

	///////////////////
	// uniqSessionList

	/**
	*
	*/
	public toggleCollapseSession(session) {
		// console.log(session);
		if(this.uniqSessionList[session] === undefined) {
			this.uniqSessionList[session] = {};
		}
		this.uniqSessionList[session].collapsed = !this.uniqSessionList[session].collapsed;
		// close all other sessions
		Object.keys(this.uniqSessionList).forEach((key) => {
			if (key !== session) {
				this.uniqSessionList[key].collapsed = true;
			}
		});
	};

	public openCollapseSession(session) {
		// console.log(session);
		this.uniqSessionList[session] = {};
		this.uniqSessionList[session].collapsed = false;
		// close all other sessions
		Object.keys(this.uniqSessionList).forEach((key) => {
			if (key !== session) {
				this.uniqSessionList[key].collapsed = true;
			}
		});
	};

	/**
	*
	*/
	// this.updateCollapseSessionState = function (text) {
	// 	angular.forEach(this.getBundleList(), (bundle) => {
	// 		if (bundle.name.indexOf(text)) {
	// 			uniqSessionList[bundle.session].collapsed = false;
	// 		} else {
	// 			uniqSessionList[bundle.session].collapsed = true;
	// 		}
	// 	});
	// };

	/**
	*
	*/
	public getSessionCollapseState(session) {
		if(this.uniqSessionList[session] === undefined) {
			return undefined;
		}
		else {
			return this.uniqSessionList[session].collapsed;
		}
	};

	///////////////////
	// other functions

	/**
	* reset all private vals to init state
	*/
	public resetToInitState() {
		this.uniqSessionList = [];
		this.bundleList = [];
		this.curBndl = {};
		this.rendOptBndlList = {};
	};

}

/**
* @ngdoc service
* @name emuwebApp.loadedMetaDataService
* @description
* # loadedMetaDataService
* Service in the emuwebApp.
*/
angular.module('emuwebApp')
.service('LoadedMetaDataService', ['ValidationService', LoadedMetaDataService]);


text:
import io
import os.path
import json
import sys
import six

from jupyter_core.paths import jupyter_config_dir
from notebook.nbextensions import InstallNBExtensionApp, UninstallNBExtensionApp, EnableNBExtensionApp, DisableNBExtensionApp, install_nbextension
from traitlets import Unicode
from traitlets.config import Config
from traitlets.config.application import catch_config_error
from traitlets.config.application import Application
from traitlets.config.loader import JSONFileConfigLoader, ConfigFileNotFound

from .baseapp import NbGrader, format_excepthook

class ExtensionInstallApp(InstallNBExtensionApp, NbGrader):

    name = u'nbgrader-extension-install'
    description = u'Install the nbgrader extensions'

    examples = """
        nbgrader extension install
        nbgrader extension install --user
        nbgrader extension install --prefix=/path/to/prefix
        nbgrader extension install --nbextensions=/path/to/nbextensions
    """

    destination = Unicode('')

    def _classes_default(self):
        return [ExtensionInstallApp, InstallNBExtensionApp]

    def excepthook(self, etype, evalue, tb):
        format_excepthook(etype, evalue, tb)

    def install_extensions(self):
        install_nbextension(
            self.extra_args[0],
            overwrite=self.overwrite,
            symlink=self.symlink,
            user=self.user,
            sys_prefix=self.sys_prefix,
            prefix=self.prefix,
            nbextensions_dir=self.nbextensions_dir,
            logger=self.log)

    def start(self):
        nbextensions_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', 'nbextensions'))
        extra_args = self.extra_args[:]

        # install the create_assignment extension
        if len(extra_args) == 0 or "create_assignment" in extra_args:
            self.log.info("Installing create_assignment extension")
            self.extra_args = [os.path.join(nbextensions_dir, 'static', 'create_assignment')]
            self.install_extensions()

        # install the assignment_list extension
        if sys.platform != 'win32' and (len(extra_args) == 0 or "assignment_list" in extra_args):
            self.log.info("Installing assignment_list extension")
            self.extra_args = [os.path.join(nbextensions_dir, 'static', 'assignment_list')]
            self.install_extensions()

        # install the lesson_list extension
        if sys.platform != 'win32' and (len(extra_args) == 0 or "lesson_list" in extra_args):
            self.log.info("Installing lesson_list extension")
            self.extra_args = [os.path.join(nbextensions_dir, 'static', 'lesson_list')]
            self.install_extensions()

class ExtensionUninstallApp(UninstallNBExtensionApp, NbGrader):

    name = u'nbgrader-extension-uninstall'
    description = u'Uninstall the nbgrader extensions'

    examples = """
        nbgrader extension uninstall
        nbgrader extension uninstall --user
        nbgrader extension uninstall --prefix=/path/to/prefix
        nbgrader extension uninstall --nbextensions=/path/to/nbextensions
    """

    destination = Unicode('')

    def _classes_default(self):
        return [ExtensionUninstallApp, UninstallNBExtensionApp]

    def excepthook(self, etype, evalue, tb):
        format_excepthook(etype, evalue, tb)

    def start(self):
        nbextensions_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', 'nbextensions'))
        extra_args = self.extra_args[:]

        # install the create_assignment extension
        if len(extra_args) == 0 or "create_assignment" in extra_args:
            self.log.info("Uninstalling create_assignment extension")
            self.extra_args = ["create_assignment"]
            self.uninstall_extensions()

        # install the assignment_list extension
        if sys.platform != 'win32' and (len(extra_args) == 0 or "assignment_list" in extra_args):
            self.log.info("Uninstalling assignment_list extension")
            self.extra_args = ["assignment_list"]
            self.uninstall_extensions()

        # install the lesson_list extension
        if sys.platform != 'win32' and (len(extra_args) == 0 or "lesson_list" in extra_args):
            self.log.info("Uninstalling lesson_list extension")
            self.extra_args = ["lesson_list"]
            self.uninstall_extensions()

class ExtensionActivateApp(EnableNBExtensionApp, NbGrader):

    name = u'nbgrader-extension-activate'
    description = u'Activate the nbgrader extension'

    flags = {}
    aliases = {}

    examples = """
        nbgrader extension activate
    """

    def _classes_default(self):
        return [ExtensionActivateApp, EnableNBExtensionApp]

    def enable_server_extension(self, extension):
        loader = JSONFileConfigLoader('jupyter_notebook_config.json', jupyter_config_dir())
        try:
            config = loader.load_config()
        except ConfigFileNotFound:
            config = Config()

        if 'server_extensions' not in config.NotebookApp:
            config.NotebookApp.server_extensions = []
        if extension not in config.NotebookApp.server_extensions:
            config.NotebookApp.server_extensions.append(extension)

        # save the updated config
        with io.open(os.path.join(jupyter_config_dir(), 'jupyter_notebook_config.json'), 'w+') as f:
            f.write(six.u(json.dumps(config, indent=2)))

    def start(self):
        if len(self.extra_args) == 0 or "create_assignment" in self.extra_args:
            self.section = "notebook"
            self.toggle_nbextension("create_assignment/main")

        if sys.platform != 'win32' and (len(self.extra_args) == 0 or "assignment_list" in self.extra_args):
            self.log.info("Activating assignment_list server extension")
            self.enable_server_extension('nbgrader.nbextensions.assignment_list')

            self.section = "tree"
            self.toggle_nbextension("assignment_list/main")

        if sys.platform != 'win32' and (len(self.extra_args) == 0 or "lesson_list" in self.extra_args):
            self.log.info("Activating lesson_list server extension")
            self.enable_server_extension('nbgrader.nbextensions.lesson_list')

            self.section = "tree"
            self.toggle_nbextension("lesson_list/main")

        self.log.info("Done. You may need to restart the Jupyter notebook server for changes to take effect.")

class ExtensionDeactivateApp(DisableNBExtensionApp, NbGrader):

    name = u'nbgrader-extension-deactivate'
    description = u'Deactivate the nbgrader extension'

    flags = {}
    aliases = {}

    examples = """
        nbgrader extension deactivate
    """

    def _classes_default(self):
        return [ExtensionDeactivateApp, DisableNBExtensionApp]

    def _recursive_get(self, obj, key_list):
        if obj is None or len(key_list) == 0:
            return obj
        return self._recursive_get(obj.get(key_list[0], None), key_list[1:])

    def disable_server_extension(self, extension):
        loader = JSONFileConfigLoader('jupyter_notebook_config.json', jupyter_config_dir())
        try:
            config = loader.load_config()
        except ConfigFileNotFound:
            config = Config()

        if 'server_extensions' not in config.NotebookApp:
            return
        if extension not in config.NotebookApp.server_extensions:
            return

        config.NotebookApp.server_extensions.remove(extension)

        # save the updated config
        with io.open(os.path.join(jupyter_config_dir(), 'jupyter_notebook_config.json'), 'w+') as f:
            f.write(six.u(json.dumps(config, indent=2)))

    def start(self):
        if len(self.extra_args) == 0 or "create_assignment" in self.extra_args:
            self.log.info("Deactivating create_assignment nbextension")
            self.section = "notebook"
            self.toggle_nbextension("create_assignment/main")

        if sys.platform != 'win32' and (len(self.extra_args) == 0 or "assignment_list" in self.extra_args):
            self.log.info("Deactivating assignment_list server extension")
            self.disable_server_extension('nbgrader.nbextensions.assignment_list')

            self.log.info("Deactivating assignment_list nbextension")
            self.section = "tree"
            self.toggle_nbextension("assignment_list/main")

        if sys.platform != 'win32' and (len(self.extra_args) == 0 or "lesson_list" in self.extra_args):
            self.log.info("Deactivating lesson_list server extension")
            self.disable_server_extension('nbgrader.nbextensions.lesson_list')

            self.log.info("Deactivating lesson_list nbextension")
            self.section = "tree"
            self.toggle_nbextension("lesson_list/main")

        self.log.info("Done. You may need to restart the Jupyter notebook server for changes to take effect.")

class ExtensionApp(NbGrader):

    name = u'nbgrader extension'
    description = u'Utilities for managing the nbgrader extension'
    examples = ""

    subcommands = dict(
        install=(
            ExtensionInstallApp,
            "Install the extensions."
        ),
        uninstall=(
            ExtensionUninstallApp,
            "Uninstall the extensions."
        ),
        activate=(
            ExtensionActivateApp,
            "Activate the extensions."
        ),
        deactivate=(
            ExtensionDeactivateApp,
            "Deactivate the extensions."
        )
    )

    def _classes_default(self):
        classes = super(ExtensionApp, self)._classes_default()

        # include all the apps that have configurable options
        for appname, (app, help) in self.subcommands.items():
            if len(app.class_traits(config=True)) > 0:
                classes.append(app)

        return classes

    @catch_config_error
    def initialize(self, argv=None):
        super(ExtensionApp, self).initialize(argv)

    def start(self):
        # check: is there a subapp given?
        if self.subapp is None:
            self.print_help()
            sys.exit(1)

        # This starts subapps
        super(ExtensionApp, self).start()


text:
weather android app

weather Android app fetches weather info from openweatherapi


text:
$('document').ready(function()
{
   var delay = 600;
   $(document).tooltip();

   /* validation */
   if ($("#register-form").length) {
      $("#register-form").validate({
        rules: {
           name: {
              required: true,
              minlength: 2
           },
           email: {
              required: true,
              email: true
           },
           password: {
              minlength: 8,
              maxlength: 15
           },
           cpassword: {
              equalTo: '#password'
           }
        },
        messages: {
           name: "please enter your name",
           email: "please enter a valid email address",
           password:{
              required: "please create a password",
              minlength: "password must have at least have 8 characters"
           },
           cpassword:{
              required: "please retype your password",
              equalTo: "passwords don't match !"
           }
         },
         submitHandler: submitForm
      });
   }

   /* form submit */
   function submitForm() {
      var data = $("#register-form").serialize();

      $.ajax({
         async: true,
         type : 'POST',
         url  : 'register.php',
         data : data,
         beforeSend: function() {
            $("#error").fadeOut();
            $("#btn-submit").html('   sending ...');
         },
         success : function(data) {
            if (data==1) {
               $("#error").fadeIn(1000, function(){
                  $("#error").html('
    Sorry - this user already exists!
');
                  $("#btn-submit").html('   Create Account');
               });
            } else if (data=="registered") {
               $("#btn-submit").html('   Signing Up ...');
               setTimeout('$(".form-signin").fadeOut(500, function(){ $(".signin-form").load("success.php"); }); ', delay);
            } else {
               $("#error").fadeIn(1000, function(){
                  $("#error").html('
   '+data+' !
');
                  $("#btn-submit").html('   Create Account');
               });
            }
         }
      });
      return false;
   }

   /* validation */
   if ($("#admin-form").length) {
      $("#admin-form").validate({
        rules: {
           email: {
              required: true,
              email: true
           },
           password: {
              required: true,
              minlength: 8,
              maxlength: 15
           }
         },
         messages: {
           password:{
              required: "please provide a password",
              minlength: "password at least have 8 characters"
           },
           user_email: "please enter a valid email address",
         },
         submitHandler: adminForm
      });
   }

   /* form cancel */
   function adminForm() {
      var data = $("#admin-form").serialize();

      $.ajax({
         async: true,
         type : 'POST',
         url  : 'admchk.php',
         data : data,
         beforeSend: function() {
            $("#error").fadeOut();
            $("#btn-submit").html('   sending ...');
         },
         success : function(data) {
            if (data==1) {
               $("#error").fadeIn(1000, function(){
                  $("#error").html('
    Sorry email not found!
');
                  $("#btn-submit").html('   List attendees');
               });
            } else if (data=="notadmin") {
               $("#error").fadeIn(1000, function(){
                  $("#error").html('
    You don\'t have administrative permissions!
');
                  $("#btn-submit").html('   List attendees');
               });
            } else if (data=="notactivated") {
               $("#error").fadeIn(1000, function(){
                  $("#error").html('
    You have not activated your account from the E-mail!
');
                  $("#btn-submit").html('   Login');
               });
            } else if (data=="badpassword") {
               $("#error").fadeIn(1000, function(){
                  $("#error").html('
    Sorry password incorrect!
');
                  $("#btn-submit").html('   Login');
               });
            } else if (data=="loggedin") {
               $("#btn-submit").html('   Retrieving attendees ...');
               setTimeout('$(".form-signin").fadeOut(500, function(){ $(".signin-form").load("listall.php"); }); ', delay);
            } else {
               $("#error").fadeIn(1000, function(){
                  $("#error").html('
   '+data+' !
');
                  $("#btn-submit").html('   List attendees');
               });
            }
         }
      });
      return false;
   }

   /* validation */
   if ($("#login-form").length) {
      $("#login-form").validate({
        rules: {
           email: {
              required: true,
              email: true
           },
           password: {
              required: true
           }
         },
         messages: {
           password:{
              required: "please provide your password"
           },
           user_email: "please enter a valid email address",
         },
         submitHandler: loginForm
      });
   }

   function loginForm() {
      var data = $("#login-form").serialize();

      $.ajax({
         async: true,
         type : 'POST',
         url  : 'login.php',
         data : data,
         beforeSend: function() {
            $("#error").fadeOut();
            $("#btn-submit").html('   sending ...');
         },
         success : function(data) {
            if (data==1 || data=="badpassword") {
               $("#error").fadeIn(1000, function(){
                  $("#error").html('
    Sorry - email or password incorrect!
');
                  $("#btn-submit").html('   Login');
               });
            } else if (data=="notactivated") {
               $("#error").fadeIn(1000, function(){
                  $("#error").html('
    Account not activated - please click on the link in the E-mail you received.
');
                  $("#btn-submit").html('   Login');
               });
            } else if (data=="ok") {
               $("#btn-submit").html('   Logging in ...');
               //setTimeout('$(".form-signin").fadeOut(500, function(){ $(".signin-form").load("showuser.php"); }); ', delay);
               setTimeout('$(".form-signin").fadeOut(500, function(){ window.location.href = "showuser.php"; }); ', delay);
            } else {
               $("#error").fadeIn(1000, function(){
                  $("#error").html('
   '+data+' !
');
                  $("#btn-submit").html('   Login');
               });
            }
         }
      });
      return false;
   }

   /* validation */
   if ($("#addapiary-form").length) {

     //$("#ccount").spinner({
     //   spin: function( event, ui ) {
     //            if ( ui.value < 0 ) {
     //               $(this).spinner( "value", 0 );
     //               return false;
     //            }
     //         },
     //   classes: {
     //      "ui-spinner": "fullwidth"
     //   }
     //   });

//     $("#btn-cancel").click(function(e) {
//         e.preventDefault();
//         setTimeout('$(".form-signin").fadeOut(500, function(){ window.location.href = "showuser.php"; }); ', delay);
//     });

     $("#addapiary-form").validate({
        rules: {
           aname: {
              required: true
           },
           where: {
              required: true
           },
           ccount: {
              required: true,
              number: true
           }
         },
         messages: {
           aname:{
              required: "please give a name to your apiary",
           },
           where:{
              required: "please state where the apiary is located",
           },
           ccount:{
              required: "please provide the number of hives",
           }
         },
         submitHandler: addapiaryForm
      });
   }

   function addapiaryForm() {
      var data = $("#addapiary-form").serialize();

      $.ajax({
         async: true,
         type : 'POST',
         url  : 'addapiary.php',
         data : data,
         beforeSend: function() {
            $("#error").fadeOut();
            $("#btn-submit").html('   Sending ...');
         },
         success : function(data) {
            if (data=="alreadyexists") {
               $("#error").fadeIn(1000, function(){
                  $("#error").html('
    Sorry - email or password incorrect!
');
                  $("#btn-submit").html('   Add');
               });
            } else if (data=="ok") {
               $("#btn-submit").html('   Adding ...');
               //setTimeout('$(".form-signin").fadeOut(500, function(){ $(".signin-form").load("showuser.php"); }); ', delay);
               setTimeout('$(".form-signin").fadeOut(500, function(){ window.location.href = "showuser.php"; }); ', delay);
            } else {
               $("#error").fadeIn(1000, function(){
                  $("#error").html('
   '+data+' !
');
                  $("#btn-submit").html('   Add');
               });
            }
         }
      });
      return false;
   }

   /* validation */
   if ($("#showuser-form").length) {
     $("#btn-submit").click(function(e) {
        e.preventDefault();
        //setTimeout('$(".form-signin").fadeOut(500, function(){ $(".signin-form").load("addapiary.php"); }); ', delay);
        setTimeout('$(".form-signin").fadeOut(500, function(){ window.location.href = "addapiary.php"; }); ', delay);
     });
   }

   /* validation */
   if ($("#newpassword-form").length) {
      $("#newpassword-form").validate({
        rules: {
           email: {
              required: true,
              email: true
           }
        },
        messages: {
           email: "please enter a valid email address"
         },
         submitHandler: newpasswordForm
      });
   }

   /* form submit */
   function newpasswordForm() {
      var data = $("#newpassword-form").serialize();

      $.ajax({
         async: true,
         type : 'POST',
         url  : 'newpassword.php',
         data : data,
         beforeSend: function() {
            $("#error").fadeOut();
            $("#btn-submit").html('   sending ...');
         },
         success : function(data) {
            if (data==1) {
               $("#error").fadeIn(1000, function(){
                  $("#error").html('
    Sorry - this user doesn\'t exist!
');
                  $("#btn-submit").html('   Change Password');
               });
            } else if (data=="mailsent") {
               $("#btn-submit").html('   Sending mail ...');
               setTimeout('$(".form-signin").fadeOut(500, function(){ $(".signin-form").load("successpwd.php"); }); ', delay);
            } else {
               $("#error").fadeIn(1000, function(){
                  $("#error").html('
   '+data+' !
');
                  $("#btn-submit").html('   Change Password');
               });
            }
         }
      });
      return false;
   }

   /* validation */
   if ($("#changepassword-form").length) {
      $("#changepassword-form").validate({
         rules: {
            password: {
               minlength: 8,
               maxlength: 15
            },
            cpassword: {
               equalTo: '#password'
            }
         },
         messages: {
         },
         submitHandler: changepasswordForm
      });
   }

   /* form submit */
   function changepasswordForm() {
      var data = $("#changepassword-form").serialize();

      $.ajax({
         async: true,
         type : 'POST',
         url  : 'changepassword.php',
         data : data,
         beforeSend: function() {
            $("#error").fadeOut();
            $("#btn-submit").html('   sending ...');
         },
         success : function(data) {
            if (data==1) {
               $("#error").fadeIn(1000, function(){
                  $("#error").html('
    Something went wrong! Please try again later.
');
                  $("#btn-submit").html('   Change Password');
               });
            } else if (data=="updated") {
               setTimeout('$(".form-signin").fadeOut(500, function(){ window.location.href = "login.php"; }); ', delay);
            } else {
               $("#error").fadeIn(1000, function(){
                  $("#error").html('
   '+data+' !
');
                  $("#btn-submit").html('   Change Password');
               });
            }
         }
      });
      return false;
   }

   /* validation */
   if ($("#delete-form").length) {
      $("#delete-form").validate({
         submitHandler: deleteForm
      });
   }

   /* form cancel */
   function deleteForm() {
      var data = $("#delete-form").serialize();

      $.ajax({
         async: true,
         type : 'POST',
         url  : 'delete.php',
         data : data,
         beforeSend: function() {
            $("#error").fadeOut();
            $("#btn-submit").html('   sending ...');
         },
         success : function(data) {
            if (data==1) {
               $("#error").fadeIn(1000, function(){
                  $("#error").html('
    Something went wrong!
');
                  $("#btn-submit").html('   Delete');
               });
            } else if (data.startsWith("goto:")) {
               var target = data.substr(5);
               $("#btn-submit").html('   Deleted ...');
               setTimeout('$(".form-signin").fadeOut(500, function(){ window.location.href = target; }); ', delay);
            } else {
               $("#error").fadeIn(1000, function(){
                  $("#error").html('
   '+data+' !
');
                  $("#btn-submit").html('   Delete');
               });
            }
         }
      });
      return false;
   }

   /* validation */
   if ($("#showapiary-form").length) {
      $("#showapiary-form").validate({
         submitHandler: showapiaryForm
      });
   }

   /* form submit */
   function showapiaryForm() {
      var data = $("#showapiary-form").serialize();

      $.ajax({
         async: true,
         type : 'POST',
         url  : 'showapiary.php',
         data : data,
         beforeSend: function() {
            $("#error").fadeOut();
            $("#btn-submit").html('   sending ...');
         },
         success : function(data) {
            if (data==1) {
               $("#error").fadeIn(1000, function(){
                  $("#error").html('
    Something went wrong! Please try again later.
');
                  $("#btn-submit").html('   Add Hive');
               });
            } else if (data=="delete") {
               setTimeout('$(".form-signin").fadeOut(500, function(){ window.location.href = "delete.php"; }); ', delay);
            } else if (data=="edit") {
               setTimeout('$(".form-signin").fadeOut(500, function(){ window.location.href = "editapiary.php"; }); ', delay);
            } else if (data=="add") {
               setTimeout('$(".form-signin").fadeOut(500, function(){ window.location.href = "addhive.php"; }); ', delay);
            } else {
               $("#error").fadeIn(1000, function(){
                  $("#error").html('
   '+data+' !
');
                  $("#btn-submit").html('   Change Password');
               });
            }
         }
      });
      return false;
   }

});


text: find_package(Pseudo 1.2.3.5 EXACT REQUIRED)


text:
<!DOCTYPE html>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css"
	href="css/themes/default/jquery.mobile-1.2.0.min.css">
<link rel="stylesheet" type="text/css" href="css/site.css">

<title>You Should login first</title>

Please Log in First

Please log in

You have not log in ,if you want to see the products please log in or register.

			Log in


text:
<?php

class RetainersController extends \BaseController {

    protected $retainer;
    protected $person;

    public function __construct(
        Retainer $retainer,
        Person $person)
    {
        $this->retainer = $retainer;
        $this->person = $person;
    }

	/**
	 * Display a listing of the resource.
	 * GET /retainers
	 *
	 * @return Response
	 */
    public function index()
    {
        $retainers = $this->retainer->all();

        return View::make('retainers.index')->with('retainers', $retainers);
    }

	/**
	 * Show the form for creating a new resource.
	 * GET /retainers/create
	 *
	 * @return Response
	 */
    public function create()
    {
        $accounts = $this->person->where('is_account_manager', '1');
        $strats = $this->person->where('is_marketing_strategiest', '1');

        $accountManagers[] = '';
        foreach($accounts as $account)
        {
            $accountManagers[$account->id] = $account->name . ' ' . $account->state;
        }

        $marketers[] = '';
        foreach($strats as $strat)
        {
            $marketers[$strat->id] = $strat->name . ' ' . $strat->state;
        }

        return View::make('retainers.create')
            ->with('marketers', $marketers)
            ->with('accountManagers', $accountManagers);
    }

	/**
	 * Store a newly created resource in storage.
	 * POST /retainers
	 *
	 * @return Response
	 */
    public function store()
    {
        $input = Input::all();

        $rules = [
            'title' => 'required'
        ];

        $validator = Validator::make($input, $rules);

        if ($validator->fails()) {

            return Redirect::route('retainers.create')
                ->withInput()
                ->withErrors($validator);
        } else {

            $retainer = $this->retainer->create($input);

            return Redirect::route('retainers.index')->with('flash', array(
                'class' => 'success',
                'message' => 'Retainer Created.'
            ));
        }
    }

	/**
	 * Display the specified resource.
	 * GET /retainers/{id}
	 *
	 * @param  int  $id
	 * @return Response
	 */
	public function show($id)
	{
        $retainer = $this->retainer->find($id);

        return View::make('retainers.show')->with('retainer', $retainer);
	}

	/**
	 * Show the form for editing the specified resource.
	 * GET /retainers/{id}/edit
	 *
	 * @param  int  $id
	 * @return Response
	 */
	public function edit($id)
	{
        $retainer = $this->retainer->find($id);
        $accounts = $this->person->where('is_account_manager', '1');
        $strats = $this->person->where('is_marketing_strategiest', '1');

        $accountManagers[] = '';
        foreach($accounts as $account)
        {
            $accountManagers[$account->id] = $account->name . ' ' . $account->state;
        }

        $marketers[] = '';
        foreach($strats as $strat)
        {
            $marketers[$strat->id] = $strat->name . ' ' . $strat->state;
        }

        return View::make('retainers.edit')
            ->with('retainer', $retainer)
            ->with('accountManagers', $accountManagers)
            ->with('marketers', $marketers);
	}

	/**
	 * Update the specified resource in storage.
	 * PUT /retainers/{id}
	 *
	 * @param  int  $id
	 * @return Response
	 */
	public function update($id)
	{
        $input = Input::all();

        $rules = [
            'title' => 'required'
        ];

        $validator = Validator::make($input, $rules);

        if ($validator->fails()) {

            return Redirect::to('retainers/' . $id . '/edit')
                ->withErrors($validator)
                ->withInput($input);
        } else {
            // store
            $this->retainer = Retainer::find($id);

            $this->retainer->update($input);

            // redirect
            return Redirect::route('retainers.show', [$id])->with('flash', 'Your Retainer has been updated!');
        }
	}

	/**
	 * Remove the specified resource from storage.
	 * DELETE /retainers/{id}
	 *
	 * @param  int  $id
	 * @return Response
	 */
	public function destroy($id)
	{
        $retainer = Retainer::find($id);

        $retainer->delete();

        return Redirect::route('retainers.index')->with('flash', 'Your Retainer has been removed!');
	}

    /**
     * Show form to upload CSV
     * @return mixed
     */
    public function upload()
    {
        return View::make('retainers.upload');
    }

    /**
     * Process the uploaded CSV file
     */
    public function import()
    {
        if (Input::hasFile('csv')) {

            $upload = fopen(Input::file('csv')->getRealPath(), 'r');
            $rowCount = 0;

            while (($row = fgetcsv($upload)) !== FALSE) {

                if($rowCount != 0)
                {
                    $retainer = new Retainer;

                    $retainer->title = $row['0'];
                    $retainer->hours = $row['1'];
                    $retainer->strategiest_id = $row['2'];
                    $retainer->account_manager_id = $row['3'];
                    $retainer->domain = $row['4'];
                    $retainer->comments = $row['5'];

                    $retainer->save();
                }

                $rowCount++;
            }
            fclose($upload);

            return Redirect::route('retainers.index')->with('flash', 'Your file has been imported');
        } else {

            Redirect::route('import.retainers')->with('flash', 'There was no file in your submission');
        }

    }
}


text:
package de.onyxbits.weave.util;

import java.text.ParseException;

public class Version implements Comparable<Version> {

	public final int major, minor, patch;

	/**
	 * Parse a version string
	 *
	 * @param version
	 *          version in flat string format
	 * @throws ParseException
	 *           if parsing fails
	 */
	public Version(String version) throws IllegalArgumentException {
		try {
			String[] tmp = version.split("\\.", 4);
			major = Integer.parseInt(tmp[0]);
			minor = Integer.parseInt(tmp[1]);
			patch = Integer.parseInt(tmp[2]);
		}
		catch (Exception e) {
			throw new IllegalArgumentException();
		}
	}

	public Version(int major, int minor, int patch) {
		this.major = major;
		this.minor = minor;
		this.patch = patch;
	}

	@Override
	public String toString() {
		return major + "." + minor + "." + patch;
	}

	@Override
	public int compareTo(Version v) {
		if (major < v.major) {
			return -1;
		}
		if (major > v.major) {
			return 1;
		}
		if (major == v.major) {
			if (minor < v.minor) {
				return -1;
			}
			if (minor > v.minor) {
				return 1;
			}
			if (minor == v.minor) {
				if (patch < v.patch) {
					return -1;
				}
				if (patch > v.patch) {
					return 1;
				}
				if (patch == v.patch) {
					return 0;
				}
			}
		}
		return 0; // We can't actually get here, but eclipse doesn't understand
							// that.
	}
}


text:
'use strict';
var log = require('./log');

var generatorFunction = function* (input1) {
	log('Generator block #1');
	var input2 = yield 'string from generator';

	log('Generator block #2');
	var input3 = yield ++input2;

	log('Generator block #3');
	return ++input3;
};

// Not a generator, just function
function delay (time) {
	log('I\'m', time, 'ms sync delay...');
	var end_time = (new Date()).valueOf() + time;
	var now = new Date();
	while (now.valueOf() < end_time) {
		now = new Date();
	}
}

// control code
try {
	var generator = generatorFunction(0); // --> input1
	log('Generator initialized', generator, '\n');

	var r1 = generator.next();
	log('\treturned', r1, '\n');

	delay(2000);

	var r2 = generator.next(1); // --> input2
	// generator.throw('some error');
	log('\treturned', r2, '\n');

	var r3 = generator.next(2); // --> input3
	log('\treturned', r3, '\n');

	var r4 = generator.next();
	log('\treturned', r4, '\n');
} catch (e) {
	log('Catched! ' + e);
}


text:
export const tests = Object.create(null)

export function defTest(name, f) {
  if (name in tests) throw new Error("Duplicate definition of test " + name)
  tests[name] = f
}

export function filter(name, filters) {
  if (!filters.length) return true
  for (let i = 0; i < filters.length; i++)
    if (name.indexOf(filters[i]) == 0) return true
  return false
}


text:
import { Component, Input, Output, EventEmitter, OnInit, ChangeDetectionStrategy, ChangeDetectorRef } from '@angular/core';
import { Router } from '@angular/router';
import { Repository } from '../repository';
import { State } from 'clarity-angular';

import { SearchTriggerService } from '../../base/global-search/search-trigger.service';

@Component({
  selector: 'list-repository',
  templateUrl: 'list-repository.component.html',
  changeDetection: ChangeDetectionStrategy.OnPush
})
export class ListRepositoryComponent implements OnInit {

  @Input() projectId: number;
  @Input() repositories: Repository[];

  @Output() delete = new EventEmitter<string>();
  @Output() paginate = new EventEmitter<State>();

  @Input() hasProjectAdminRole: boolean;

  pageOffset: number = 1;

  constructor(
    private router: Router,
    private searchTrigger: SearchTriggerService,
    private ref: ChangeDetectorRef) {
    let hnd = setInterval(()=>ref.markForCheck(), 100);
    setTimeout(()=>clearInterval(hnd), 1000);
  }

  ngOnInit() { }

  deleteRepo(repoName: string) {
    this.delete.emit(repoName);
  }

  refresh(state: State) {
    if (this.repositories) {
      this.paginate.emit(state);
    }
  }

  public gotoLink(projectId: number, repoName: string): void {
    this.searchTrigger.closeSearch(true);

    let linkUrl = ['harbor', 'tags', projectId, repoName];
    this.router.navigate(linkUrl);
  }

}


text:
<?php
/**
 *
 */

namespace Mvc5\Controller\Exception;

interface DispatchException
{
    /**
     *
     */
    const EXCEPTION = 'Controller\Exception';

    /**
     * @param callable $callable
     * @param array $args
     * @param callable $callback
     * @return mixed
     */
    function __invoke(callable $callable, array $args = [], callable $callback = null);
}


text:
package com.intellij.lang.properties.parsing;

import com.intellij.psi.tree.IElementType;
import com.intellij.openapi.fileTypes.StdFileTypes;
import org.jetbrains.annotations.NonNls;

/**
 * @author max
 */
public class PropertiesElementType extends IElementType {
  public PropertiesElementType(@NonNls String debugName) {
    super(debugName, StdFileTypes.PROPERTIES.getLanguage());
  }

  @SuppressWarnings({"HardCodedStringLiteral"})
  public String toString() {
    return "Properties:" + super.toString();
  }
}


text:
<?php
$fixed_ext = array('Core','date','ereg','libxml','openssl','pcre','zlib','bcmath','bz2','calendar','ctype','dba','dom','hash','fileinfo',
                   'filter','ftp','gettext','SPL','iconv','mbstring','pcntl','session','posix','Reflection','standard','shmop','SimpleXML',
                   'soap','sockets','Phar','exif','sysvmsg','sysvsem','sysvshm','tokenizer','wddx','xml','xmlreader','xmlwriter','zip','PDO',
                   'curl','gd','json','mysql','mysqli','pdo_mysql','pdo_pgsql','imagick','pgsql','readline','xsl','mongo','mcrypt','mhash',
                   'Zend OPcache', 'sqlite3', 'pdo_sqlite','mysqlnd', 'tidy', 'xmlrpc', 'xdebug');
$extensions = get_loaded_extensions();
foreach ($extensions as $extension) {
    if (!in_array($extension, $fixed_ext)) {
        throw new Exception("Extension not found: $extension \n");
    }
}
$version = explode('.', PHP_VERSION);
if ($version[0]!=5 || $version[1]!=5) {
    throw new Exception("Wrong php version");
}
?>


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

{% block title_block %}{% endblock title_block %}

{% block head_block %}
  <link rel="stylesheet" href="{% static 'groups/css/groups_style.css' %}">
{% endblock head_block %}

{% block nav_block %}
  {{ block.super }}
{% endblock nav_block %}

{% block body_block %}

{% endblock body_block %}

{% block javascript %}
  {{ block.super }}
{% endblock javascript %}


text:
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>W28569_text</title>
        <link rel="stylesheet" type="text/css" href="style.css" />

                «

    <p class="styleSans659.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">Gadeco, LLC Alexander 26-35 5TFH
Section 26 T155N R99W Williams County, North Dakota
Heidi Smith
Wellsite Geologist
NESET N CONSULTING —' SERVICE
6844 Hwy 40 Tioga ND, 58852 701—664-1492


text:
#region Copyright

#endregion

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Kodestruct.Common.CalculationLogger;
using Kodestruct.Common.CalculationLogger.Interfaces;

namespace Kodestruct.Steel.AISC.AISC360v10
{
    //Plates where the tension load is
    //transmitted by longitudinal welds only
    public class ShearLagCase4 : ShearLagFactorBase
    {
        double l;
        double w;

        public ShearLagCase4(double PlateWidth, double LengthOfConnection)

        {
            base.Log = new CalcLog();
            l = LengthOfConnection;
            w = PlateWidth;
        }

       /// <summary>
        ///Calculates shear lag factor per AISC Table D3.1 "Shear Lag Factors for Connections  to Tension Members".
       /// </summary>
        public override double GetShearLagFactor()
        {
            if (l>=2*w)
            {
                return 1.0;
            }
            else if (l<2*w && l>=1.5*w)
            {
                return 0.87;
            }
            else
            {
                return 0.75;
            }
        }
    }
}


text:
ACCEPTED

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Lich. univ. 608 (1810)

#### Original name
Lichen pollinarius Ach.

### Remarks
null


text:
% datadlg: create a data dialog box
%
%
function answer=datadlg_display(name,label,default,options)

% handle input
if (nargin<1) || isempty(name)
    name='Data Dialog';
end

if (nargin<2) || isempty(label)
    label={'Parameter:'};
end

if (nargin<3) || isempty(default)
    default={''};
end

if (nargin<4) || isempty(options)
    options=struct();
end
field='style';
if ~isfield(options,field) || isempty(options.(field))
    options.(field)='modal';
end
field='minwidth';
if ~isfield(options,field) || isempty(options.(field))
    options.(field)=20; % characters
end
field='root';
if ~isfield(options,field) || isempty(options.(field))
    options.(field)=0; % root object (the screen)
end
field='location';
if ~isfield(options,field) || isempty(options.(field))
    options.(field)='center';
end
field='fontname';
if ~isfield(options,field) || isempty(options.(field))
    options.(field)=get(0,'DefaultUIcontrolFontName');
end
field='fontsize';
if ~isfield(options,field) || isempty(options.(field))
    options.(field)=get(0,'DefaultUIcontrolFontSize');
end

popupstring1={'linear','log'};
switch default{1};
    case popupstring1{1}
        popupval1=1;
    case popupstring1{2}
        popupval1=2;
end
popupstring2={'jet','gray','rainbow','red','green','blue','cool','hot',...
    'spring','summer','autumn','winter',...
    'bone','copper','pink'};
for k=1:numel(popupstring2)
    if strcmp(default{3},popupstring2{k})
        popupval2=k;
    end
end

popupstring3 = {'yes','no'};
if ischar(default{4})
    if strcmpi(default{4},'yes')
        popupval3=1;
    else
        popupval3=2;
    end
elseif default{4}
    popupval3=1;
else
    popupval3=2;
end

edit{1}=default{1};
edit{2}=default{2};
edit{3}=default{3};
edit{4}=default{4};
data.edit=edit;

% create and size dialog
fig=figure('NumberTitle','off','Name',name,...
    'Menubar','none','Toolbar','none',...
    'Resize','off','Units','characters',...
    'ToolBar','none','MenuBar','none',...
    'IntegerHandle','off','Visible','on');
hgap=1.00; % horizontal gap [characters]
vgap=0.50; % vertical gap [characters]
textbg=get(fig,'Color');

%set(fig,'Position',[0 0 32 18],'Visible','off');
set(fig,'Position',[0 0 32 21.5],'Visible','off');
movedlg(fig,options.root,options.location);
set(fig,'Visible','on');

edittext = uicontrol('Style','text','String',label{2},...
        'Units','characters','Position',[5 19 25 1.2],...
        'BackgroundColor',textbg,'HorizontalAlignment','left');
editbox = uicontrol('Style','edit','String',edit{2},...
        'Units','characters','Position',[5 17 18 2],...
        'BackgroundColor','w','HorizontalAlignment','left');

popuptext1 = uicontrol('Style','Text','String',label{1},...
    'Units','characters','HorizontalAlignment','left',...
    'BackgroundColor',textbg,'Position',[5 15.5 15 1.2]);
popupstring1 = {'linear','log'};
popupbox1 = uicontrol('style','popupmenu',...
    'Units','characters',...
    'position',[5 13.5 20 1.2],...
    'string',popupstring1,...
    'backgroundcolor','w',...
    'value',popupval1, ...
    'tag','listbox',...
    'callback', {@doPopupClick,1,popupval1,popupstring1});

popuptext2 = uicontrol('Style','Text','String',label{3},'Units','characters',...
    'Units','characters','HorizontalAlignment','left',...
    'BackgroundColor',textbg,'Position',[5 11 15 1.2]);
%popupstring2 = {'jet','gray','inverse_gray','cool','hot'};
popupbox2 = uicontrol('style','popupmenu',...
    'Units','characters',...
    'position',[5 9.5 20 1.2],...
    'string',popupstring2,...
    'backgroundcolor','w',...
    'value',popupval2, ...
    'tag','listbox',...
    'callback', {@doPopupClick,3,popupval2,popupstring2});

popuptext3 = uicontrol('Style','Text','String',label{4},'Units','characters',...
    'Units','characters','HorizontalAlignment','left',...
    'BackgroundColor',textbg,'Position',[5 7 15 1.2]);
%popupval3={'yes','no'};
popupbox3 = uicontrol('style','popupmenu',...
    'Units','characters',...
    'position',[5 5.5 20 1.2],...
    'string',popupstring3,...
    'backgroundcolor','w',...
    'value',popupval3, ...
    'tag','listbox',...
    'callback', {@doPopupClick,4,popupval3,popupstring3});

pushbutton1 = uicontrol('Style','pushbutton','String','OK',...
        'Units','characters','Position',[5 1 10 2],...
        'Callback',@callbackOK);
pushbutton2 = uicontrol('Style','pushbutton','String','Cancel',...
        'Units','characters','Position',[15 1 10 2],...
        'Callback',@callbackCancel);

% store data in figure
data.editbox=editbox;
data.previous=default;
data.current=default;
set(fig,'UserData',data);

% finish up and wait for user input
set(fig,'Visible','on','HandleVisibility','Callback');
if strcmp(options.style,'modal')
    set(fig,'WindowStyle',options.style);
end
uiwait(fig);
if ishandle(fig)
    data=get(fig,'UserData');
    answer=data.current;
    delete(fig);
else
    answer={};
end

%%%%%%%%%%%%%%%%%%%%%
% utility functions %
%%%%%%%%%%%%%%%%%%%%%
function movedlg(dlg,target,location)

if (nargin<1) || isempty(location)
    location='center';
end

% determine absolute figure position
units=get(target,'Units');
set(target,'Units','pixels');
if target==0
   targetpos=get(target,'MonitorPositions');
   targetpos=targetpos(1,:);
else
    targetpos=get(target,'Position');
end
set(target,'Units',units);

% position dialog relative to figure
units=get(dlg,'Units') ;
set(dlg,'Units','pixels');
dlgpos=get(dlg,'Position');
x=targetpos(1)+(targetpos(3)-dlgpos(3))*[0 1/2 1];
y=targetpos(2)+(targetpos(4)-dlgpos(4))*[0 1/2 1];
switch lower(location)
    case 'north'
        dlgpos(1:2)=[x(2) y(3)];
    case 'south'
        dlgpos(1:2)=[x(2) y(1)];
    case 'east'
        dlgpos(1:2)=[x(1) y(2)];
    case 'west'
        dlgpos(1:2)=[x(3) y(2)];
    case 'northeast'
        dlgpos(1:2)=[x(3) y(3)];
    case 'northwest'
        dlgpos(1:2)=[x(1) y(3)];
    case 'southeast'
        dlgpos(1:2)=[x(3) y(1)];
    case 'southwest'
        dlgpos(1:2)=[x(1) y(1)];
    case 'center'
        dlgpos(1:2)=[x(2) y(2)];
    otherwise
        error('ERROR: %s is not a valid location',location);
end
set(dlg,'Position',dlgpos);
set(dlg,'Units',units);

function doPopupClick(src,eventdata,popupnum,oldval,popupstring)

fig=gcbf;
data=get(fig,'UserData');
nold = oldval;
n = get(src,'Value');
if n == 0
    n = nold;
end
set(src,'Value',n);
data.edit{popupnum}=popupstring{n};

set(fig,'UserData',data);

%%%%%%%%%%%%%%%%%%%%%
% default callbacks %
%%%%%%%%%%%%%%%%%%%%%
function callbackOK(src,varargin)
fig=gcbf;
data=get(fig,'UserData');
uiresume(fig);
data.edit{2}=get(data.editbox,'String');
data.current=data.edit;
set(fig,'UserData',data);

function callbackCancel(varargin)
fig=gcbf;
uiresume(fig);
data=get(fig,'UserData');
data.current={};
set(fig,'UserData',data);


text:
source includes.sh

# Set counter to Zero
count=0

# Exit unless host OS is macOS
# TODO: This should become a function in includes.sh
if [ `uname -s` != "Darwin" ]; then
  echo -e "\nThis script will only run on macOS"
  echo "exiting"
  exit 1
fi

# Install Homebrew unless it already exists
if ! brew -v > /dev/null 2>&1; then
  echo -e "\n  Installing Homebrew...\n"
  ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  count=1
fi

# Install packages if Homewbrew was just installed
if [ $count -eq 1 ]; then
  brew install arping git-lfs hping nmap node openssl python readline sqlite telnet tree wget
fi

# If Homebrew already exists, update brew and all packages
if [ $count -eq 0 ]; then
  echo -e "$txt_blue""\n Checking for Homebrew updates"
  echo -e " Please wait while things are brewing...\n""$txt_reset"
  brew update && brew upgrade && brew cleanup
  #TODO: If the result is Already up-to-date, there should be a green output message indicating brew is up-to-date.
fi

exit 0


text:
using System;
using System.Collections.Generic;
using System.Web.Http;
using System.Web.Http.Results;
using System.Net.Http;

using Microsoft.VisualStudio.TestTools.UnitTesting;

using LMS.Service;
using LMS.Service.Controllers;
using LMS.Model;
using LMS.Model.Resource;
using LMS.Model.Composite;
using LMS.Data;
using LMS.Model.Resource.Enums;

namespace LMS.Test.Controllers
{
    [TestClass]
    public class StatementControllerTest
    {
        private UnitTestContext<Statement> Context { get; set; }

        [TestInitialize]
        public void TestInitialize()
        {
            Context = new UnitTestContext<Statement>();

            Context.TestData.Add(Context.LabelRepository.Add(new Label()
            {
                Name = "lplabelgroup",
                Address = new Address()
                {
                    Line = new string[] { "Skansegade 1D", "Vorup" },
                    PostalCode = "8940",
                    City = "Randers SV",
                    Country = "Denmark",
                    District = "-",
                    State = "-"
                },
                Email = "mail@lplabelgroup.com",
                Telecom = "+4541990756"
            }));

            Context.TestData.Add(Context.ArtistRepository.Add(new Artist()
            {
                StageName = "Tomtek",
                Name = new HumanName()
                {
                    Family = new string[] { "Lykke", "Petersen" },
                    Given = new string[] { "Thomas" }
                },
                Address = new Address()
                {
                    Line = new string[] { "Skansegade 1D", "Vorup" },
                    PostalCode = "8940",
                    City = "Randers SV",
                    Country = "Denmark",
                    District = "-",
                    State = "-"
                },
                Email = "thomas@ktrecordings.com",
                Telecom = "+45 41990756"
            }));

            Context.TestData.Add(Context.AccountRepository.Add(new Account()
            {
                Name = "XXR001",
                Status = AccountStatus.Open,
                Transactions = null,
                Artist = new Reference(Reference.ArtistUri, Context.TestData.Find(m => m is Artist).Id),
                Label = new Reference(Reference.LabelUri, Context.TestData.Find(m => m is Label).Id)
            }));

            Context.TestData.Add(Context.TransactionRepository.Add(new Transaction()
            {
                Account = new Reference(Reference.AccountUri, Context.TestData.Find(m => m is Account).Id),
                Amount = -10,
                Description = "Advance payment.",
                Quarter = "Q4-2016",
                Status = TransactionStatus.Committed,
                Type = TransactionType.Advance
            }));

            Context.TestData.Add(Context.TransactionRepository.Add(new Transaction()
            {
                Account = new Reference(Reference.AccountUri, Context.TestData.Find(m => m is Account).Id),
                Amount = 12.57,
                Description = "Revenue from sales.",
                Quarter = "Q4-2016",
                Status = TransactionStatus.Committed,
                Type = TransactionType.Sales
            }));

            Context.TestData.Add(Context.TransactionRepository.Add(new Transaction()
            {
                Account = new Reference(Reference.AccountUri, Context.TestData.Find(m => m is Account).Id),
                Amount = 17.89,
                Description = "Revenue from streaming.",
                Quarter = "Q4-2016",
                Status = TransactionStatus.Committed,
                Type = TransactionType.Sales
            }));

            Context.TestData.Add(Context.TransactionRepository.Add(new Transaction()
            {
                Account = new Reference(Reference.AccountUri, Context.TestData.Find(m => m is Account).Id),
                Amount = 17.89,
                Description = "Revenue from streaming.",
                Quarter = "Q4-2016",
                Status = TransactionStatus.Failed,
                Type = TransactionType.Sales
            }));

            Context.Template = new Statement()
            {
                Artist = new Reference(Reference.ArtistUri, Context.TestData.Find(m => m is Artist).Id),
                Label = new Reference(Reference.LabelUri, Context.TestData.Find(m => m is Label).Id),
                Quarter = "Q4-2016",
                Reference = "TOMTEK-Q42016",
                Status = StatementStatus.Pending,
                Invoice = null
            };
        }

        [TestCleanup]
        public void TestCleanup()
        {
            foreach (DomainResource data in Context.TestData)
            {
                if (data is Label)
                    Context.LabelRepository.Remove(data.Id);
                if (data is Artist)
                    Context.ArtistRepository.Remove(data.Id);
                if (data is Account)
                    Context.AccountRepository.Remove(data.Id);
                if (data is Transaction)
                    Context.TransactionRepository.Remove(data.Id);
                if (data is Statement)
                    Context.StatementRepository.Remove(data.Id);
            }
        }

        [TestMethod]
        public void StatementCreateTest()
        {
            StatementController controller = new StatementController();
            controller.Configuration = new HttpConfiguration();
            controller.Request = new HttpRequestMessage();

            Statement statement = Context.Template;
            statement.Quarter = null;

            IHttpActionResult resultERR = controller.Create(statement);
            Assert.IsTrue(resultERR is BadRequestErrorMessageResult);

            statement.Quarter = "Q4-2016";

            OkNegotiatedContentResult<Statement> resultOK = controller.Create(statement) as OkNegotiatedContentResult<Statement>;
            Context.TestData.Add(resultOK.Content);

            Assert.IsNotNull(resultOK.Content);
            Assert.IsTrue(resultOK.Content.Id > 0);
            Assert.AreEqual(resultOK.Content.Artist.GetId(), statement.Artist.GetId());
            Assert.AreEqual(resultOK.Content.Label.GetId(), statement.Label.GetId());
            Assert.AreEqual(resultOK.Content.Quarter, statement.Quarter);
            Assert.AreEqual(resultOK.Content.Reference, statement.Reference);
            Assert.AreEqual(resultOK.Content.Status, statement.Status);
            Assert.IsTrue(resultOK.Content.EffectiveTime <= DateTime.Now);

            double amount = 0;
            foreach(Transaction transaction in Context.TestData.FindAll(m => m is Transaction))
            {
                if (transaction.Status == TransactionStatus.Committed)
                    amount += transaction.Amount;
            }

            Assert.AreEqual(resultOK.Content.Amount, amount);
            Assert.IsNotNull(resultOK.Content.Data);
            Assert.IsTrue(resultOK.Content.Data.Length == 1);
            Assert.IsNotNull(resultOK.Content.Data[0].Transactions);
            Assert.IsTrue(resultOK.Content.Data[0].Transactions.Length == 3);

            Assert.AreEqual(resultOK.Content.Data[0].Transactions[0].Id, ((Transaction)Context.TestData.FindAll(m => m is Transaction && ((Transaction)m).Status == TransactionStatus.Committed)[0]).Id);
            Assert.IsNotNull(resultOK.Content.Data[0].Transactions[0].Statement);
            Assert.AreEqual(resultOK.Content.Data[0].Transactions[0].Statement.GetId(), resultOK.Content.Id);

            Assert.AreEqual(resultOK.Content.Data[0].Transactions[1].Id, ((Transaction)Context.TestData.FindAll(m => m is Transaction && ((Transaction)m).Status == TransactionStatus.Committed)[1]).Id);
            Assert.IsNotNull(resultOK.Content.Data[0].Transactions[1].Statement);
            Assert.AreEqual(resultOK.Content.Data[0].Transactions[1].Statement.GetId(), resultOK.Content.Id);

            Assert.AreEqual(resultOK.Content.Data[0].Transactions[2].Id, ((Transaction)Context.TestData.FindAll(m => m is Transaction && ((Transaction)m).Status == TransactionStatus.Committed)[2]).Id);
            Assert.IsNotNull(resultOK.Content.Data[0].Transactions[2].Statement);
            Assert.AreEqual(resultOK.Content.Data[0].Transactions[2].Statement.GetId(), resultOK.Content.Id);
        }

        [TestMethod]
        public void StatementReadTest()
        {
            StatementController controller = new StatementController();
            controller.Configuration = new HttpConfiguration();
            controller.Request = new HttpRequestMessage();

            Statement statement = Context.Template;

            OkNegotiatedContentResult<Statement> resultOK = controller.Create(statement) as OkNegotiatedContentResult<Statement>;
            Context.TestData.Add(resultOK.Content);

            resultOK = controller.Read(resultOK.Content.Id) as OkNegotiatedContentResult<Statement>;

            Assert.IsNotNull(resultOK.Content);
            Assert.AreEqual(resultOK.Content.Id, statement.Id);
            Assert.AreEqual(resultOK.Content.Artist.GetId(), statement.Artist.GetId());
            Assert.AreEqual(resultOK.Content.Label.GetId(), statement.Label.GetId());
            Assert.AreEqual(resultOK.Content.Amount, statement.Amount);
            Assert.AreEqual(resultOK.Content.Quarter, statement.Quarter);
            Assert.AreEqual(resultOK.Content.Reference, statement.Reference);

            Assert.IsNotNull(resultOK.Content.Data);
            Assert.IsTrue(resultOK.Content.Data.Length == 1);
            Assert.AreEqual(resultOK.Content.Data[0].Id, ((Account)Context.TestData.Find(m => m is Account)).Id);
            Assert.AreEqual(resultOK.Content.Data[0].Name, ((Account)Context.TestData.Find(m => m is Account)).Name);

            Assert.IsNotNull(resultOK.Content.Data[0].Transactions);
            Assert.IsTrue(resultOK.Content.Data[0].Transactions.Length == 3);
            Assert.AreEqual(resultOK.Content.Data[0].Transactions[0].Id, ((Transaction)Context.TestData.FindAll(m => m is Transaction && ((Transaction)m).Status == TransactionStatus.Committed)[0]).Id);
            Assert.IsNotNull(resultOK.Content.Data[0].Transactions[0].Statement);
            Assert.AreEqual(resultOK.Content.Data[0].Transactions[0].Statement.GetId(), resultOK.Content.Id);
        }

        [TestMethod]
        public void StatementUpdateTest()
        {
            StatementController controller = new StatementController();
            controller.Configuration = new HttpConfiguration();
            controller.Request = new HttpRequestMessage();

            Statement statement = Context.Template;

            OkNegotiatedContentResult<Statement> resultOK = controller.Create(statement) as OkNegotiatedContentResult<Statement>;
            Context.TestData.Add(resultOK.Content);

            statement = resultOK.Content;
            statement.Status = StatementStatus.Sent;

            resultOK = controller.Update(statement) as OkNegotiatedContentResult<Statement>;

            Assert.IsNotNull(resultOK.Content);
            Assert.AreEqual(resultOK.Content.Id, statement.Id);
            Assert.AreEqual(resultOK.Content.Status, statement.Status);

            statement = resultOK.Content;
            statement.Status = StatementStatus.Cancelled;

            resultOK = controller.Update(statement) as OkNegotiatedContentResult<Statement>;

            Assert.IsNotNull(resultOK.Content);
            Assert.AreEqual(resultOK.Content.Id, statement.Id);
            Assert.AreEqual(resultOK.Content.Status, statement.Status);

            // Test if status is set cancelled, then link between transaction and statement is broken.
            foreach (Transaction t in Context.TestData.FindAll(m => m is Transaction))
            {
                Transaction transaction = Context.TransactionRepository.Get(t.Id);
                Assert.IsNull(transaction.Statement);
            }

            statement = resultOK.Content;
            statement.Status = StatementStatus.Pending;

            // Test if status is already cancelled it cannot be changed to any other state
            IHttpActionResult resultERR = controller.Update(statement);
            Assert.IsTrue(resultERR is BadRequestErrorMessageResult);
        }

        [TestMethod]
        public void StatementDeleteTest()
        {
            StatementController controller = new StatementController();
            controller.Configuration = new HttpConfiguration();
            controller.Request = new HttpRequestMessage();

            Statement statement = Context.Template;
            statement.Status = StatementStatus.Cancelled;

            OkNegotiatedContentResult<Statement> resultOK = controller.Create(statement) as OkNegotiatedContentResult<Statement>;
            Context.TestData.Add(resultOK.Content);

            statement = resultOK.Content;
            controller.Delete(statement.Id);

            IHttpActionResult resultNotFound = controller.Read(statement.Id);
            Assert.IsTrue(resultNotFound is NotFoundResult);

            statement = Context.Template;
            statement.Status = StatementStatus.Pending;

            resultOK = controller.Create(statement) as OkNegotiatedContentResult<Statement>;
            Context.TestData.Add(resultOK.Content);

            // Test if status is not cancelled statement cannot be deleted.
            IHttpActionResult resultBadRequest = controller.Delete(statement.Id);
            Assert.IsTrue(resultBadRequest is BadRequestErrorMessageResult);
        }

        [TestMethod]
        public void StatementSearchTest()
        {
            StatementController controller = new StatementController();
            controller.Configuration = new HttpConfiguration();
            controller.Request = new HttpRequestMessage();

            Statement statement = Context.Template;

            OkNegotiatedContentResult<Statement> resultOK = controller.Create(statement) as OkNegotiatedContentResult<Statement>;
            Context.TestData.Add(resultOK.Content);

            statement = resultOK.Content;

            OkNegotiatedContentResult<List<Statement>> resultList = controller.List() as OkNegotiatedContentResult<List<Statement>>;
            Assert.IsNotNull(resultList.Content);
            Assert.IsTrue(resultList.Content.Count == 1);

            OkNegotiatedContentResult<List<Statement>> resultSearch = controller.Search("reference|tom") as OkNegotiatedContentResult<List<Statement>>;
            Assert.IsNotNull(resultSearch.Content);
            Assert.IsTrue(resultSearch.Content.Count == 1);

            resultSearch = controller.Search("reference|x") as OkNegotiatedContentResult<List<Statement>>;
            Assert.IsNotNull(resultSearch.Content);
            Assert.IsTrue(resultSearch.Content.Count == 0);
        }
    }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated by org.testng.reporters.JUnitReportReporter -->
<testsuite hostname="retina.dellroad.org" name="org.jsimpledb.util.ObjIdBiMultiMapTest" tests="1" failures="0" timestamp="17 Apr 2015 01:30:29 GMT" time="0.653" errors="0">
  <testcase name="testObjIdBiMultiMap" time="0.653" classname="org.jsimpledb.util.ObjIdBiMultiMapTest"/>
</testsuite> <!-- org.jsimpledb.util.ObjIdBiMultiMapTest -->


text:
/*
* index routes
* author:changfuguo
* date  :2015-01-27
*
*/
var cUser = require('../controller/User');
var cCategory = require('../controller/Category');
var cTopic = require('../controller/Topic');
var authMiddleware = require('../../middlewares/auth.js');
module.exports = function(app){

	//get login page
	app.get('/admin/category/:id',authMiddleware.userRequired, function(req, res, next){
		console.log(req.params)
		res.send('test' + req.params.id);
	});

	app.delete('/admin/category/:id',authMiddleware.userRequired,cCategory.delete );
	//post login info
	app.post('/admin/category',authMiddleware.userRequired,cCategory.create);

	//logout
	app.put('/admin/category',authMiddleware.userRequired,cCategory.update);

	//get all categories

	app.get('/admin/categories',authMiddleware.userRequired,cCategory.getList);
}


text:
package org.apache.catalina.mbeans;

import javax.management.Attribute;
import javax.management.AttributeNotFoundException;
import javax.management.InstanceNotFoundException;
import javax.management.MBeanException;
import javax.management.ReflectionException;
import javax.management.RuntimeOperationsException;
import javax.management.modelmbean.InvalidTargetObjectTypeException;

import org.apache.tomcat.util.descriptor.web.ContextResourceLink;
import org.apache.tomcat.util.descriptor.web.NamingResources;
import org.apache.tomcat.util.modeler.BaseModelMBean;

/**
 *
A ModelMBean implementation for the
 * org.apache.tomcat.util.descriptor.web.ContextResourceLink component.

 *
 * @author Amy Roh
 */
public class ContextResourceLinkMBean extends BaseModelMBean {

    // ----------------------------------------------------------- Constructors

    /**
     * Construct a ModelMBean with default
     * ModelMBeanInfo information.
     *
     * @exception MBeanException if the initializer of an object
     *  throws an exception
     * @exception RuntimeOperationsException if an IllegalArgumentException
     *  occurs
     */
    public ContextResourceLinkMBean()
        throws MBeanException, RuntimeOperationsException {

        super();

    }

    // ----------------------------------------------------- Instance Variables

    // ------------------------------------------------------------- Attributes

    /**
     * Obtain and return the value of a specific attribute of this MBean.
     *
     * @param name Name of the requested attribute
     *
     * @exception AttributeNotFoundException if this attribute is not
     *  supported by this MBean
     * @exception MBeanException if the initializer of an object
     *  throws an exception
     * @exception ReflectionException if a Java reflection exception
     *  occurs when invoking the getter
     */
    @Override
    public Object getAttribute(String name)
        throws AttributeNotFoundException, MBeanException,
        ReflectionException {

        // Validate the input parameters
        if (name == null)
            throw new RuntimeOperationsException
                (new IllegalArgumentException("Attribute name is null"),
                 "Attribute name is null");

        ContextResourceLink cl = null;
        try {
            cl = (ContextResourceLink) getManagedResource();
        } catch (InstanceNotFoundException e) {
            throw new MBeanException(e);
        } catch (InvalidTargetObjectTypeException e) {
             throw new MBeanException(e);
        }

        String value = null;
        if ("global".equals(name)) {
            return (cl.getGlobal());
        } else if ("description".equals(name)) {
            return (cl.getDescription());
        } else if ("name".equals(name)) {
            return (cl.getName());
        } else if ("type".equals(name)) {
            return (cl.getType());
        } else {
            value = (String) cl.getProperty(name);
            if (value == null) {
                throw new AttributeNotFoundException
                    ("Cannot find attribute "+name);
            }
        }

        return value;

    }

    /**
     * Set the value of a specific attribute of this MBean.
     *
     * @param attribute The identification of the attribute to be set
     *  and the new value
     *
     * @exception AttributeNotFoundException if this attribute is not
     *  supported by this MBean
     * @exception MBeanException if the initializer of an object
     *  throws an exception
     * @exception ReflectionException if a Java reflection exception
     *  occurs when invoking the getter
     */
     @Override
    public void setAttribute(Attribute attribute)
        throws AttributeNotFoundException, MBeanException,
        ReflectionException {

        // Validate the input parameters
        if (attribute == null)
            throw new RuntimeOperationsException
                (new IllegalArgumentException("Attribute is null"),
                 "Attribute is null");

        String name = attribute.getName();
        Object value = attribute.getValue();
        if (name == null)
            throw new RuntimeOperationsException
                (new IllegalArgumentException("Attribute name is null"),
                 "Attribute name is null");

        ContextResourceLink crl = null;
        try {
            crl = (ContextResourceLink) getManagedResource();
        } catch (InstanceNotFoundException e) {
            throw new MBeanException(e);
        } catch (InvalidTargetObjectTypeException e) {
             throw new MBeanException(e);
        }

        if ("global".equals(name)) {
            crl.setGlobal((String)value);
        } else if ("description".equals(name)) {
            crl.setDescription((String)value);
        } else if ("name".equals(name)) {
            crl.setName((String)value);
        } else if ("type".equals(name)) {
            crl.setType((String)value);
        } else {
            crl.setProperty(name, ""+value);
        }

        // cannot use side-effects.  It's removed and added back each time
        // there is a modification in a resource.
        NamingResources nr = crl.getNamingResources();
        nr.removeResourceLink(crl.getName());
        nr.addResourceLink(crl);
    }

}


text:
module.exports = function (dbFolder) {
    const fs = require('fs');
    fs.exists(dbFolder, function (db) {
        if (!db) {
            console.log("not found db folder");

            fs.mkdir(dbFolder, function (err) {
                if (err) {
                    return console.log(err);
                }

                console.log("The db folder was created!");
            })

        }

        fs.exists(dbFolder + '/template.json', function (template) {
            if (!template)
                fs.writeFile(dbFolder + "/template.json", "", function (err) {
                    if (err) {
                        return console.log(err);
                    }

                    console.log("The template file was created!");
                });
        });
        fs.exists(dbFolder + '/metadata.json', function (metadata) {
            if (!metadata)
                fs.writeFile(dbFolder + "/metadata.json", "", function (err) {
                    if (err) {
                        return console.log(err);
                    }

                    console.log("The metadata file was created!");
                });
        });

    });
}


text:
package rocks.muki.graphql

package object codegen {

  /**
    * Type alias for a processing result during a code generation step
    * @tparam T the success type
    */
  type Result[T] = Either[Failure, T]

  /**
    * Type alias for a graphql file pre-processing function.
    * _ The input is the raw graphql file content
    * _ The output is the transformed graphql file content or an error
    */
  type PreProcessor = String => Result[String]
}