text:
/* Custom CSS generated on http://twitter.github.com/bootstrap/customize.html using:
     -JS Components: Modals
     -Misc: Close icon
     -Misc: Utilities
     -Misc: Component animations
*/

.clearfix{*zoom:1;}.clearfix:before,.clearfix:after{display:table;content:"";line-height:0;}
.clearfix:after{clear:both;}
.hide-text{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0;}
.input-block-level{display:block;width:100%;min-height:30px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;}
.modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1040;background-color:#000000;}.modal-backdrop.fade{opacity:0;}
.modal-backdrop,.modal-backdrop.fade.in{opacity:0.8;filter:alpha(opacity=80);}
.modal{position:fixed;top:10%;left:50%;z-index:1050;width:560px;margin-left:-280px;background-color:#ffffff;border:1px solid #999;border:1px solid rgba(0, 0, 0, 0.3);*border:1px solid #999;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;-webkit-box-shadow:0 3px 7px rgba(0, 0, 0, 0.3);-moz-box-shadow:0 3px 7px rgba(0, 0, 0, 0.3);box-shadow:0 3px 7px rgba(0, 0, 0, 0.3);-webkit-background-clip:padding-box;-moz-background-clip:padding-box;background-clip:padding-box;outline:none;}.modal.fade{-webkit-transition:opacity .3s linear, top .3s ease-out;-moz-transition:opacity .3s linear, top .3s ease-out;-o-transition:opacity .3s linear, top .3s ease-out;transition:opacity .3s linear, top .3s ease-out;top:-25%;}
.modal.fade.in{top:10%;}
.modal-header{padding:9px 15px;border-bottom:1px solid #eee;}.modal-header .close{margin-top:2px;}
.modal-header h3{margin:0;line-height:30px;}
.modal-body{position:relative;overflow-y:auto;max-height:400px;padding:15px;}
.modal-form{margin-bottom:0;}
.modal-footer{padding:14px 15px 15px;margin-bottom:0;text-align:right;background-color:#f5f5f5;border-top:1px solid #ddd;-webkit-border-radius:0 0 6px 6px;-moz-border-radius:0 0 6px 6px;border-radius:0 0 6px 6px;-webkit-box-shadow:inset 0 1px 0 #ffffff;-moz-box-shadow:inset 0 1px 0 #ffffff;box-shadow:inset 0 1px 0 #ffffff;*zoom:1;}.modal-footer:before,.modal-footer:after{display:table;content:"";line-height:0;}
.modal-footer:after{clear:both;}
.modal-footer .btn+.btn{margin-left:5px;margin-bottom:0;}
.modal-footer .btn-group .btn+.btn{margin-left:-1px;}
.modal-footer .btn-block+.btn-block{margin-left:0;}
.close{float:right;font-size:20px;font-weight:bold;line-height:20px;color:#000000;text-shadow:0 1px 0 #ffffff;opacity:0.2;filter:alpha(opacity=20);}.close:hover,.close:focus{color:#000000;text-decoration:none;cursor:pointer;opacity:0.4;filter:alpha(opacity=40);}
button.close{padding:0;cursor:pointer;background:transparent;border:0;-webkit-appearance:none;}
.pull-right{float:right;}
.pull-left{float:left;}
.hide{display:none;}
.show{display:block;}
.invisible{visibility:hidden;}
.affix{position:fixed;}
.fade{opacity:0;-webkit-transition:opacity 0.15s linear;-moz-transition:opacity 0.15s linear;-o-transition:opacity 0.15s linear;transition:opacity 0.15s linear;}.fade.in{opacity:1;}
.collapse{position:relative;height:0;overflow:hidden;-webkit-transition:height 0.35s ease;-moz-transition:height 0.35s ease;-o-transition:height 0.35s ease;transition:height 0.35s ease;}.collapse.in{height:auto;}


text:
from keystoneauth1 import loading
from keystoneauth1 import session
import novaclient.client as nova_client
import glanceclient.client as glance_client
import neutronclient.v2_0.client as neutron_client

from cloud_client.openstack import config

# I think it's not a good idea to let the user change the code to provide their credentials
# instead, I think the user should just source their own openstack-rc file
# and then everything works
def get_session():
    loader = loading.get_plugin_loader('password')
    auth = loader.load_from_options(
            auth_url = config.auth_url,
            username = config.username,
            password = config.password,
            project_id = config.tenant_id)
    return session.Session(auth = auth)

def get_nova_client():
    VERSION = '2'
    sess = get_session()
    return nova_client.Client(VERSION, session = sess)

def get_glance_client():
    VERSION = '2'
    sess = get_session()
    return glance_client.Client(VERSION, session = sess)

def get_neutron_client():
    sess = get_session()
    return neutron_client.Client(session = sess)

redpajama_set_name: RedPajamaGithub


text:
package org.cloudfoundry.uaa.users;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import org.cloudfoundry.Nullable;
import org.immutables.value.Value;

/**
 * An invite for a new user
 */
@JsonDeserialize
@Value.Immutable
abstract class _Invite {

    /**
     * The email address
     */
    @JsonProperty("email")
    abstract String getEmail();

    /**
     * The error code
     */
    @JsonProperty("errorCode")
    @Nullable
    abstract String getErrorCode();

    /**
     * The error message
     */
    @JsonProperty("errorMessage")
    @Nullable
    abstract String getErrorMessage();

    /**
     * The invite link
     */
    @JsonProperty("inviteLink")
    @Nullable
    abstract String getInviteLink();

    /**
     * The origin
     */
    @JsonProperty("origin")
    @Nullable
    abstract String getOrigin();

    /**
     * Whether the invite was sent successfully
     */
    @JsonProperty("success")
    abstract Boolean getSuccess();

    /**
     * The user id
     */
    @JsonProperty("userId")
    @Nullable
    abstract String getUserId();

}


text:
import * as errorsExports from './error';
import { errors } from './error';
import * as MetadataUtils from './metadata';
import * as type from './type';

/**
 * @param name Name of the function.
 * @param specs Argument specs.
 * @param passed The actual arguments passed to the function.
 * @throws {fbs.Error} If the arguments are invalid.
 */
export function validate(name: string, specs: ArgSpec[], passed: IArguments) {
  let minArgs = specs.length;
  let maxArgs = specs.length;
  for (let i = 0; i < specs.length; i++) {
    if (specs[i].optional) {
      minArgs = i;
      break;
    }
  }
  let validLength = minArgs <= passed.length && passed.length <= maxArgs;
  if (!validLength) {
    throw errorsExports.invalidArgumentCount(
      minArgs,
      maxArgs,
      name,
      passed.length
    );
  }
  for (let i = 0; i < passed.length; i++) {
    try {
      specs[i].validator(passed[i]);
    } catch (e) {
      if (e instanceof Error) {
        throw errorsExports.invalidArgument(i, name, e.message);
      } else {
        throw errorsExports.invalidArgument(i, name, e);
      }
    }
  }
}

/**
 * @struct
 */
export class ArgSpec {
  validator: (p1: any) => void;
  optional: boolean;

  constructor(validator: (p1: any) => void, opt_optional?: boolean) {
    let self = this;
    this.validator = function(p: any) {
      if (self.optional && !type.isJustDef(p)) {
        return;
      }
      validator(p);
    };
    this.optional = !!opt_optional;
  }
}

export function and_(v1: (p1: any) => void, v2: Function): (p1: any) => void {
  return function(p) {
    v1(p);
    v2(p);
  };
}

export function stringSpec(
  opt_validator?: (p1: any) => void | null,
  opt_optional?: boolean
): ArgSpec {
  function stringValidator(p: any) {
    if (!type.isString(p)) {
      throw 'Expected string.';
    }
  }
  let validator;
  if (opt_validator) {
    validator = and_(stringValidator, opt_validator);
  } else {
    validator = stringValidator;
  }
  return new ArgSpec(validator, opt_optional);
}

export function uploadDataSpec(): ArgSpec {
  function validator(p: any) {
    let valid =
      p instanceof Uint8Array ||
      p instanceof ArrayBuffer ||
      (type.isNativeBlobDefined() && p instanceof Blob);
    if (!valid) {
      throw 'Expected Blob or File.';
    }
  }
  return new ArgSpec(validator);
}

export function metadataSpec(opt_optional?: boolean): ArgSpec {
  return new ArgSpec(MetadataUtils.metadataValidator, opt_optional);
}

export function nonNegativeNumberSpec(): ArgSpec {
  function validator(p: any) {
    let valid = type.isNumber(p) && p >= 0;
    if (!valid) {
      throw 'Expected a number 0 or greater.';
    }
  }
  return new ArgSpec(validator);
}

export function looseObjectSpec(
  opt_validator?: ((p1: any) => void) | null,
  opt_optional?: boolean
): ArgSpec {
  function validator(p: any) {
    let isLooseObject = p === null || (type.isDef(p) && p instanceof Object);
    if (!isLooseObject) {
      throw 'Expected an Object.';
    }
    if (opt_validator !== undefined && opt_validator !== null) {
      opt_validator(p);
    }
  }
  return new ArgSpec(validator, opt_optional);
}

export function nullFunctionSpec(opt_optional?: boolean): ArgSpec {
  function validator(p: any) {
    let valid = p === null || type.isFunction(p);
    if (!valid) {
      throw 'Expected a Function.';
    }
  }
  return new ArgSpec(validator, opt_optional);
}


text:
'use strict';

const path = require('path');
const { execCommand } = require('cli-testlab');

const KNEX = path.normalize(__dirname + '/../../bin/cli.js');

describe('help', () => {
  it('Prints help', () => {
    return execCommand(`node ${KNEX} --help`, {
      expectedOutput: { expectedText: 'Usage', exactlyTimes: 1 },
    });
  });

  it('Prints help using -h flag', () => {
    return execCommand(`node ${KNEX} -h`, {
      expectedOutput: { expectedText: 'Usage', exactlyTimes: 1 },
    });
  });

  it('Prints help when no arguments are given', () => {
    return execCommand(`node ${KNEX}`, {
      expectedErrorMessage: 'Usage: cli [options] [command]',
    });
  });

  it('Does not print help when argument is given', () => {
    return execCommand(`node ${KNEX} -V`, {
      notExpectedOutput: 'Usage',
    });
  });
});


text:
package fs

import (
	"syscall"

	"github.com/hanwen/go-fuse/v2/fuse"
)

// OK is the Errno return value to indicate absense of errors.
var OK = syscall.Errno(0)

// ToErrno exhumes the syscall.Errno error from wrapped error values.
func ToErrno(err error) syscall.Errno {
	s := fuse.ToStatus(err)
	return syscall.Errno(s)
}

// RENAME_EXCHANGE is a flag argument for renameat2()
const RENAME_EXCHANGE = 0x2

// seek to the next data
const _SEEK_DATA = 3

// seek to the next hole
const _SEEK_HOLE = 4


text:
		<form name="contactList">

Add a Contact.

				<input name="listingName" type="text" placeholder="Full Name" ng-model="contactsName" class="col-xs-12 left-input"/>
				<input name="listingName" type="text" placeholder="example@gmail.com" ng-model="contactsEmail" class="col-xs-12 left-input"/>
				<input name="listingName" type="text" placeholder="Phone Number" ng-model="contactsPhone" class="col-xs-12 left-input"/>

				<input id="listing-name-confirm" class="col-xs-12 custom-button" type="submit" value="Add" ng-click="newContact()"/>

Contact List

{{ contact.name }}

{{ contact.email }}

{{ contact.phone }}

{{ contact.price }}

							<button ng-click="deleteContact(contact)" class="pull-right delete-button">×</button>

		</form>


text:
@startDocuBlock post_admin_backup_download
@brief download a specific local backup

@RESTHEADER{POST /_admin/backup/download, Download a backup from a remote repository}

@RESTDESCRIPTION
Download a specific local backup from a remote repository, or query
progress on a previously scheduled download operation, or abort
a running download operation.

@RESTBODYPARAM{id,string,optional,string}
The identifier for this backup. This is required when a download
operation is scheduled. In this case leave out the `downloadId`
attribute.

@RESTBODYPARAM{remoteRepository,string,required,string}
URL of remote reporsitory. This is required when a download
operation is scheduled. In this case leave out the `downloadId`
attribute. Provided repository URLs are normalized and validated as follows: One single colon must appear separating the configurtion section name and the path. The URL prefix up to the colon must exist as a key in the config object below. No slashes must appear before the colon. Multiple back to back slashes are collapsed to one, as `..` and `.` are applied accordingly. Local repositories must be absolute paths and must begin with a `/`. Trailing `/` are removed.

@RESTBODYPARAM{config,object,required,object}
Configuration of remote repository. This is required when a download
operation is scheduled. In this case leave out the `downloadId`
attribute. See the description of the _arangobackup_ program in the manual
for a description of the `config` object.

@RESTBODYPARAM{downloadId,string,optional,string}
Download ID to specify for which download operation progress is queried, or
the download operation to abort.
If you specify this, leave out all the above body parameters.

@RESTBODYPARAM{abort,boolean,optional,boolean}
Set this to `true` if a running download operation should be aborted. In
this case, the only other body parameter which is needed is `downloadId`.

@RESTRETURNCODES

@RESTRETURNCODE{200}
If all is well, code 200 is returned if progress is inquired or the
operation is aborted.

@RESTRETURNCODE{202}
If all is well, code 202 is returned if a new operation is scheduled.

@RESTRETURNCODE{400}
If the download command is invoked with bad parameters or any HTTP
method other than `POST`, then an *HTTP 400* is returned.

@RESTRETURNCODE{401}
If the authentication to the rempote repository fails, then an *HTTP
401* is returned.

@RESTRETURNCODE{404}
If a backup corresponding to the identifier `id`  cannot be found, or if
there is no known download operation with the given `downloadId`.

@EXAMPLES

@EXAMPLE_ARANGOSH_RUN{RestBackupDownloadBackup_rocksdb}
    var hotbackup = require("@arangodb/hotbackup");
    try {
      require("fs").makeDirectory("/tmp/backups");
    } catch(e) {
    }
    var backup = hotbackup.create();
    var upload = hotbackup.upload(backup.id, "local://tmp/backups",
                                  {local:{type:"local"}});
    // Wait until upload complete:
    for (var count = 0; count < 30; ++count) {
      var progress = hotbackup.uploadProgress(upload.uploadId);
      try {
        if (progress.DBServers.SNGL.Status === "COMPLETED") {
          break;
        }
      } catch(e) {
      }
      internal.wait(0.5);
    }
    hotbackup.delete(backup.id);
    var url = "/_admin/backup/download";
    body = {"id" : backup.id,
            "remoteRepository": "local://tmp/backups",
            "config": {
              "local": {
                "type":"local"
              }
            }
           };
    var response = logCurlRequest('POST', url, body);

    assert(response.code === 202);

    logJsonResponse(response);
    body = {
      result: {
        downloadId: "10046"
      }
    };
@END_EXAMPLE_ARANGOSH_RUN

The `result` object of the body holds the `downloadId` string attribute which can be used to follow the download process.

@EXAMPLE_ARANGOSH_RUN{RestBackupDownloadBackupStarted_rocksdb}
    var hotbackup = require("@arangodb/hotbackup");
    try {
      require("fs").makeDirectory("/tmp/backups");
    } catch(e) {
    }
    var backup = hotbackup.create();
    var body = {"id" : backup.id,
                "remoteRepository": "local://tmp/backups",
                "config": {
                  "local": {
                    "type":"local"
                  }
                }
               };
    var upload = hotbackup.upload(backup.id, "local://tmp/backups",
                                  {local:{type:"local"}});
    // Wait until upload complete:
    for (var count = 0; count < 30; ++count) {
      var progress = hotbackup.uploadProgress(upload.uploadId);
      try {
        if (progress.DBServers.SNGL.Status === "COMPLETED") {
          break;
        }
      } catch(e) {
      }
      internal.wait(0.5);
    }
    hotbackup.delete(backup.id);
    var download = hotbackup.download(backup.id, "local://tmp/backups",
                                      {local:{type:"local"}});

    body = {"downloadId" : download.downloadId};
    var url = "/_admin/backup/download";
    var response = logCurlRequest('POST', url, body);

    assert(response.code === 200);

    logJsonResponse(response);
    body = {
      "result": {
        "Timestamp": "2019-05-14T14:50:56Z",
        "BackupId": "2019-05-01T00.00.00Z_some-label",
        "DBServers": {
          "SNGL": {
            "Status": "COMPLETED"
          }
        }
      }
    };
@END_EXAMPLE_ARANGOSH_RUN

@endDocuBlock


text:
package org.apache.hadoop.hdfs;

import java.io.IOException;
import java.io.OutputStream;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Queue;
import java.util.concurrent.ConcurrentLinkedQueue;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.conf.Configured;
import org.apache.hadoop.fs.FSDataInputStream;
//import org.apache.hadoop.fs.FSDataOutputStream;
import org.apache.hadoop.hdfs.DFSClient.DFSInputStream;
import org.apache.hadoop.hdfs.DFSClient.DFSOutputStream;
import org.apache.hadoop.fs.FileStatus;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.fs.permission.FsPermission;
import org.apache.hadoop.hdfs.NNBenchDFSThread.RemoteFileDFSHandle;
import org.apache.hadoop.util.StringUtils;
import org.apache.hadoop.mapred.JobConf;

import org.apache.hadoop.util.Progressable;
import org.apache.hadoop.util.Tool;
import org.apache.hadoop.util.ToolRunner;

/**
 * This program executes a specified operation that applies load to
 * the NameNode. Possible operations include create/writing files,
 * opening/reading files, renaming files, and deleting files.
 *
 * When run simultaneously on multiple nodes, this program functions
 * as a stress-test and benchmark for namenode, especially when
 * the number of bytes written to each file is small.
 *
 * This version does not use the map reduce framework
 *
 */
public class NNBenchTestLock extends Configured implements Tool {

  private static final Log LOG = LogFactory.getLog(
                                            "org.apache.hadoop.hdfs.NNBench");

  // variable initialzed from command line arguments
  private static long startTime = 0;
  private static int numFiles = 2000;
  private static long bytesPerBlock = 1024;
  private static long blocksPerFile = 1024;
  private static long bytesPerFile = 1;
  private static int bytesPerChecksum = 1024;
  //private static Path baseDir = null;
  private static long replicationFactorPerFile = 2;
  // variables initialized in main()

  private static DFSClient dfsClient = null;
  private static String    dfsTaskDir = null;
  private static String    baseDir = "/test";

  private static byte[] buffer;
  private static long maxExceptionsPerFile = 2000;
  private static NNBenchDFSThread handleThread = null;
  private static int sectionInterval = 5;
  private static int sectionNum = 100;
  private static Date execTime = new Date();
  private static Date endTime  = new Date();
  private static String hostName = null;
  //private static int failFileCount = 0;
  /**
   * Returns when the current number of seconds from the epoch equals
   * the command line argument given by -startTime.
   * This allows multiple instances of this program, running on clock
   * synchronized nodes, to start at roughly the same time.
   */

  static void barrier() {
    long sleepTime;
    while ((sleepTime = startTime - System.currentTimeMillis()) > 0) {
      try {
        Thread.sleep(sleepTime);
      } catch (InterruptedException ex) {
        //This left empty on purpose
      }
    }
  }

  /**
   * This launches a given namenode operation (-operation),
   * starting at a given time (-startTime).  The files used
   * by the openRead, rename, and delete operations are the same files
   * created by the createWrite operation.  Typically, the program
   * would be run four times, once for each operation in this order:
   * createWrite, openRead, rename, delete.
   *
   *

   * Usage: nnbench
   *          -operation <one of createWrite, openRead, rename, or delete>
   *          -baseDir <base output/input DFS path>
   *          -startTime <time to start, given in seconds from the epoch>
   *          -numFiles <number of files to create, read, rename, or delete>
   *          -blocksPerFile <number of blocks to create per file>
   *         [-bytesPerBlock <number of bytes to write to each block, default is 1>]
   *         [-bytesPerChecksum <value for io.bytes.per.checksum>]
   *

   *
   * @param args is an array of the program command line arguments
   * @throws IOException indicates a problem with test startup
   */
  public static void main(String[] args) throws Exception {
    int res = ToolRunner.run(new NNBenchTestLock(), args);
    System.exit(res);
  }

  @Override
  public int run(String[] args) throws Exception {

    String version = "NameNodeBenchmark.0.3";
    System.out.println(version);
    //int bytesPerChecksum = -1;

    String usage =
      "Usage: NNBenchLock " +
      "  -operation <one of createWrite, openRead, rename, or delete> " +
      "  -baseDir <base output/input DFS path> " +
      "  -startTime <time to start, given in seconds from the epoch> " +
      "  -numFiles <number of files to create> " +
      "  -blocksPerFile <number of blocks to create per file> " +
      "  -replicationFactorPerFile < replication factor>" +
      "  -sectionInterval <second>" +
      "  -sectionNum <collection num>" +
      "  [-bytesPerBlock <number of bytes to write to each block, default is 1>] " +
      "  [-bytesPerChecksum <value for io.bytes.per.checksum>]" +
      "Note: bytesPerBlock MUST be a multiple of bytesPerChecksum";

    String operation = null;
    String[] operationArray = null;
    HashMap<String,String> opHash = new HashMap<String,String>();
    for (int i = 0; i < args.length; i++) { // parse command line
      if (args[i].equals("-baseDir")) {
        baseDir = args[++i];
      } else if (args[i].equals("-numFiles")) {
        numFiles = Integer.parseInt(args[++i]);
      } else if (args[i].equals("-blocksPerFile")) {
        blocksPerFile = Integer.parseInt(args[++i]);
      } else if (args[i].equals("-bytesPerBlock")) {
        bytesPerBlock = Long.parseLong(args[++i]);
      } else if (args[i].equals("-bytesPerChecksum")) {
        bytesPerChecksum = Integer.parseInt(args[++i]);
      } else if (args[i].equals("-startTime")) {
        startTime = Long.parseLong(args[++i]) * 1000;
        if(startTime <= 0){
        	startTime = System.currentTimeMillis()/1000;
        }
      } else if (args[i].equals("-operation")) {
        operation = args[++i];
        operationArray = operation.split(",");
        for(String tmp:operationArray){
        	String[] tmp2= tmp.split(":");
        	opHash.put(tmp2[0], tmp2[1]);
        }
      }else if(args[i].equals("-replicationFactorPerFile")){
    	  replicationFactorPerFile = Integer.parseInt(args[++i]);
      }else if(args[i].equals("-sectionInterval")){
    	  sectionInterval = Integer.parseInt(args[++i]);
      }else if(args[i].equals("-sectionNum")){
    	  sectionNum = Integer.parseInt(args[++i]);
      }else if(args[i].equals("-host")){
    	  hostName = args[++i];
    	  hostName = hostName.trim();
      }
      else {
        System.out.println(usage);
        for(int j = 0; j < args.length; j++){
        	System.out.println("args["+args[j]+"]");
        }
        return -1;
      }
    }
    //1024*2
    bytesPerFile = bytesPerBlock * blocksPerFile;

    JobConf jobConf = new JobConf(new Configuration(), NNBench.class);

    if ( bytesPerChecksum < 0 ) { // if it is not set in cmdline
      bytesPerChecksum = jobConf.getInt("io.bytes.per.checksum", 512);
    }
    jobConf.set("io.bytes.per.checksum", Integer.toString(bytesPerChecksum));

    System.out.println("Inputs: ");
    System.out.println("   operation: " + operation);
    System.out.println("   baseDir: " + baseDir);
    System.out.println("   startTime: " + startTime);
    System.out.println("   numFiles: " + numFiles);
    System.out.println("   blocksPerFile: " + blocksPerFile);
    System.out.println("   bytesPerBlock: " + bytesPerBlock);
    System.out.println("   bytesPerChecksum: " + bytesPerChecksum);
    System.out.println("   replicationFactorPerFile: " + replicationFactorPerFile);
    System.out.println("   sectionInterval: "+ sectionInterval);
    System.out.println("   sectionNum: "+ sectionNum);

    if (operation == null ||  // verify args
        numFiles < 1 )
      {
        System.err.println(usage);
        System.out.println("args:operation="+operation+" baseDir="+baseDir+" numFiles="+numFiles+
        		" blocksPerFile="+blocksPerFile+" bytesPerBlock="+bytesPerBlock+
        		" bytesPerBlock % bytesPerChecksum="+(bytesPerBlock % bytesPerChecksum));
        return -1;
      }
    String uniqueId = null;
    if(hostName != null){
    	uniqueId = hostName;
    }else{
    	uniqueId = java.net.InetAddress.getLocalHost().getHostName();
    }

    //taskDir = new Path(baseDir, uniqueId);
    //dfsTaskDir = baseDir+"/"+uniqueId;

     //add exec code .................
    int index=0;
    MetadataLock[] mdLockArray= new MetadataLock[opHash.size()];
    Iterator iter = opHash.entrySet().iterator();
    while(iter.hasNext()){
    	Map.Entry entry = (Map.Entry)iter.next();
    	String opCode = (String)entry.getKey();
    	String opDir = (String)entry.getValue();
        if(opCode.equals("createwrite")){
        	mdLockArray[index] = new MetadataLock("createwrite",opDir,numFiles,uniqueId);
        	mdLockArray[index].start();
        }else if(opCode.equals("mkdir")){
        	mdLockArray[index] = new MetadataLock("mkdir",opDir,numFiles,uniqueId);
        	mdLockArray[index].start();
        }else if(opCode.equals("lsdir")){
        	mdLockArray[index] = new MetadataLock("lsdir",opDir,numFiles,uniqueId);
        	mdLockArray[index].start();
        }else if(opCode.equals("openRead")){
        	mdLockArray[index] = new MetadataLock("openRead",opDir,numFiles,uniqueId);
        	mdLockArray[index].start();
        }else if(opCode.equals("delete")){
        	mdLockArray[index] = new MetadataLock("delete",opDir,numFiles,uniqueId);
        	mdLockArray[index].start();
       }else if(opCode.equals("rename")){
       	mdLockArray[index] = new MetadataLock("rename",opDir,numFiles,dfsTaskDir);
       	mdLockArray[index].start();
       }

        index++;
        Thread.sleep(100);

    }

    while(true){
    	Thread.sleep(1000);
    }
    //for(;index<0;index--){
    //	mdLockArray[index].join();
    //}
    //return 0;
  }
}


text:
COMPONENT=EMG

include ../../Makerules


text:
/**
 * Define the module which provides the service.
 */
module provider {
	// exports the interface
	exports com.github.wesleyegberto.provider;
	// define the implementation for the interface
	provides com.github.wesleyegberto.provider.Calculator
		with com.github.wesleyegberto.provider.dadams.HitchhikerCalculator;
}


text:
/* @flow weak */

/*
This script can be used to read data from a Google Docs table.
var text = `
`;
var pieces = text.trim().split('\n\n').join('\n').split('\n');
function orNull(value) { return value === '' ? null : value; }
console.log(JSON.stringify({
  id: null,
  grade: `7th grade`,
  name: orNull(pieces[0]),
  gender: pieces[1] === 'M' ? 'male' : 'female',
  race: orNull(pieces[2]),
  behavior: orNull(pieces[3]),
  ell: orNull(pieces[4]),
  learningDisabilities: orNull(pieces[5]),
  interests: orNull(pieces[6]),
  familyBackground: orNull(pieces[7]),
  ses: orNull(pieces[8]),
  academicPerformance: orNull(pieces[9])
}, null, 2));
*/

function addFields(fields) {
  return (student)=> {
    return {
      ...student,
      ...fields
    };
  };
}

const initialStudents = [
  {
    id: 1,
    name: `Kevin`,
    grade: `7th grade`,
    gender: `male`,
    race: `Hispanic`,
    behavior: `Disruptive in class`,
    ell: null,
    learningDisabilities: null,
    academicPerformance: `Grades are C/D and borderline failing. Failed science the last two semesters. Reading and writing is at the 5th grade level. Arrives late to class most of the time.`,
    interests: null,
    familyBackground: null,
    ses: null,
  },
  {
    id: 2,
    name: `Floyd`,
    grade: `7th grade`,
    gender: `male`,
    race: `Caucasian`,
    behavior: `Attendance issues`,
    ell: null,
    learningDisabilities: `ADHD`,
    academicPerformance: null,
    interests: `Wants to be a firefighter`,
    familyBackground: `Divorced parents, younger brother`,
    ses: `Free and reduced lunch`
  },
  {
    id: 3,
    name: `Maia`,
    grade: `7th grade`,
    gender: `female`,
    race: `Caucasian`,
    behavior: `Discipline report`,
    ell: null,
    learningDisabilities: null,
    academicPerformance: null,
    interests: `In theater and loves art`,
    familyBackground: `Single mom, two olders sisters`,
    ses: null
  },
  {
    id: 4,
    name: `Hayin`,
    grade: `7th grade`,
    gender: `female`,
    race: `Korean`,
    behavior: null,
    ell: null,
    learningDisabilities: null,
    academicPerformance: null,
    interests: `Plays the flute, very involved in church, loves coding`,
    familyBackground: `1st generation parents, twin sister`,
    ses: `Free and reduced lunch`

  },
  {
    id: 5,
    name: `Mike`,
    grade: `7th grade`,
    gender: `male`,
    race: `African American`,
    behavior: null,
    ell: null,
    learningDisabilities: null,
    academicPerformance: null,
    interests: `Plays in a band, sings in the school chorus`,
    familyBackground: `1 older brother`,
    ses: null,
  },
  {
    id: 6,
    name: `Jasmine`,
    grade: `7th grade`,
    gender: `female`,
    race: `African American`,
    behavior: `Quiet`,
    ell: null,
    learningDisabilities: null,
    academicPerformance: null,
    interests: `Plays tennis and soccer`,
    familyBackground: `Divorced parents, only child`,
    ses: `Free and reduced lunch`
  },
  {
    id: 7,
    name: 'Miquel',
    grade: '7th grade',
    gender: 'male',
    race: 'Latino',
    behavior: 'Attendance issues',
    ell: 'Spanish is native language',
    learningDisabilities: null,
    academicPerformance: null,
    interests: `Has an after school job`,
    familyBackground: `3 younger siblings`,
    ses: `Free and reduced lunch`
  },
  {
    id: 8,
    name: `Ada`,
    grade: `7th grade`,
    gender: `female`,
    race: `Haitian`,
    behavior: null,
    ell: `Haitian Creole is native language`,
    learningDisabilities: `Auditory disability`,
    academicPerformance: null,
    interests: `High-achiever, teacher's pet. Wants to be a doctor, is in yearbook`,
    familyBackground: `Aunt is guardian`,
    ses: null
  },
  {
    id: 9,
    name: `Steve`,
    grade: `7th grade`,
    gender: `male`,
    race: `Caucasian`,
    behavior: `Often tired in class`,
    ell: null,
    learningDisabilities: null,
    academicPerformance: null,
    interests: `Prefers ELA over math and science. Plays drums at home with his family. Has an after school job`,
    familyBackground: `Younger sister`,
    ses: null
  },
  {
    id: 10,
    name: `Sasha`,
    grade: `7th grade`,
    gender: `female`,
    race: `African American`,
    familyBackground: `Family recently moved to town`
  }
].map(addFields({
  isMursion: false,
  cohortKey: 'initial'
}));

// From Virtual School Context_Update_072716
const julyStudentsNotFromMursion = [
  {
    id: 2000,
    grade: `7th grade`,
    name: `Mike Bilson`,
    gender: `male`,
    race: `African American`,
    behavior: null,
    ell: null,
    learningDisabilities: null,
    interests: `Plays in a band, sings in the school chorus`,
    familyBackground: `Lives with Mom, 1 older brother`,
    ses: null,
    academicPerformance: `A in 6th grade science, A in 6th grade math`
  }, {
    id: 2001,
    grade: `7th grade`,
    name: `Miguel Fernandez`,
    gender: `male`,
    race: `Salvadoran`,
    behavior: `Attendance issues`,
    ell: `Spanish is native language`,
    learningDisabilities: null,
    interests: `Helps out in his dad's store after school and on weekends, plays soccer in the fall`,
    familyBackground: `Lives with both parents, 3 younger sisters`,
    ses: `Free and reduced lunch`,
    academicPerformance: `C in 6th grade science, B in 6th grade math`
  }, {
    id: 2002,
    grade: `7th grade`,
    name: `Floyd Markey`,
    gender: `male`,
    race: `Caucasian`,
    behavior: `Attendance issues`,
    ell: null,
    learningDisabilities: `ADHD`,
    interests: `Wants to be a forensic scientist`,
    familyBackground: `Divorced parents, splits time between parents, younger brother`,
    ses: `Free and reduced lunch`,
    academicPerformance: `D in 6th grade science, C in 6th grade math`
  }, {
    id: 2003,
    grade: `7th grade`,
    name: `Jasmine Martine`,
    gender: `male`,
    race: `African American`,
    behavior: `Reserved`,
    ell: null,
    learningDisabilities: `ADHD`,
    interests: `Plays a sport every season`,
    familyBackground: `Divorced parents, lives mainly with Mom, only child`,
    ses: `Free and reduced lunch`,
    academicPerformance: `B in 6th grade science, B in 6th grade math`
  }, {
    "id": 2004,
    "grade": "7th grade",
    "name": "Manuel Martinez",
    "gender": "male",
    "race": "Puerto Rican",
    "behavior": "Arrives late to class frequently",
    "ell": null,
    "learningDisabilities": null,
    "interests": "Does not like to read, very interested in Puerto Rican politics",
    "familyBackground": "Lives with both parents, parents speak Spanish at home and English is their 2nd language, 2 younger cousins live with family",
    "ses": null,
    "academicPerformance": "C in 6th grade science, B in 6th grade math"
  }, {
    "id": 2005,
    "grade": "7th grade",
    "name": "Hayin Park",
    "gender": "female",
    "race": "Korean",
    "behavior": null,
    "ell": null,
    "learningDisabilities": null,
    "interests": "Plays the flute, very involved in church, loves coding",
    "familyBackground": "Lives with both parents, 1st generation parents and English is their 2nd language, twin sister",
    "ses": "Free and reduced lunch",
    "academicPerformance": "A in 6th grade science, A  in 6th grade math"
  }, {
    "id": 2006,
    "grade": "7th grade",
    "name": "Ada Phillipe",
    "gender": "female",
    "race": "Haitian",
    "behavior": null,
    "ell": "Yes, Haitian Creole is native language",
    "learningDisabilities": "Auditory disability, has IEP",
    "interests": "Wants to be a doctor, is in yearbook club",
    "familyBackground": "Adopted, lives with both parents who ar Caucasian, one younger brother who is biological son of parents",
    "ses": null,
    "academicPerformance": "B in 6th grade science, B in 6th grade math"
  }, {
    "id": 2007,
    "grade": "7th grade",
    "name": "Steve Timland",
    "gender": "male",
    "race": "Caucasian",
    "behavior": "Often tired in class",
    "ell": null,
    "learningDisabilities": null,
    "interests": "Plays Mindcraft all the time",
    "familyBackground": "Lives with both parents - two moms, Younger sister",
    "ses": null,
    "academicPerformance": "A in 6th grade science, A in 6th grade math"
  }, {
    "id": 2008,
    "grade": "7th grade",
    "name": "Lucy Winston",
    "gender": "female",
    "race": "Caucasian",
    "behavior": "Sent to principal for fighting with CJ",
    "ell": null,
    "learningDisabilities": null,
    "interests": "In drama club and loves art",
    "familyBackground": "Single mom, two older sisters",
    "ses": null,
    "academicPerformance": "C in 6th grade science, B in 6th grade science"
  }
].map(addFields({
  isMursion: false,
  cohortKey: '20160722'
}));

// From Virtual School Context_Update_072716
const julyStudentsFromMursion = [
  {
    "id": 3001,
    "grade": "7th grade",
    "name": "Maria Gonzales",
    "gender": "female",
    "race": "Dominican",
    "behavior": "Quiet",
    "ell": null,
    "learningDisabilities": null,
    "interests": "Loves to draw, write, and read",
    "familyBackground": "Lives with both parents, 2 older brothers",
    "ses": null,
    "academicPerformance": "A in 6th grade science, A in 6th grade math"
  }, {
    "id": 3002,
    "grade": "7th grade",
    "name": "Cindy "CJ" Harper",
    "gender": "female",
    "race": "Caucasian",
    "behavior": "Sent to principal for fighting with Lucy",
    "ell": null,
    "learningDisabilities": null,
    "interests": "Loves movies, spends lots of time with 9th grade boyfriend",
    "familyBackground": "Mom is ill, Dad is not present, older brother is often truant from high school",
    "ses": null,
    "academicPerformance": "F in 6th grade science, C in 6th grade math"
  }, {
    "id": 3003,
    "grade": "7th grade",
    "name": "Kevin Jordan",
    "gender": "male",
    "race": "African American",
    "behavior": null,
    "ell": null,
    "learningDisabilities": null,
    "interests": "Plays guitar, loves mixing music",
    "familyBackground": "Lives with grandmother, ½ sister lives with Mom and boyfriend",
    "ses": "Free and reduced lunch",
    "academicPerformance": "C in 6th grade science, C in 6th grade math"
  }, {
    "id": 3004,
    "grade": "7th grade",
    "name": "Ed Lewis",
    "gender": "male",
    "race": "African American",
    "behavior": null,
    "ell": null,
    "learningDisabilities": null,
    "interests": "Wants to be an air force pilot like uncle, plays basketball",
    "familyBackground": "Lives with both parents, younger sister and younger twin brothers",
    "ses": null,
    "academicPerformance": "B in 6th grade science, B in 6th grade math"
  }, {
    "id": 3005,
    "grade": "7th grade",
    "name": "Sean McGowen",
    "gender": "male",
    "race": "Caucasian",
    "behavior": "Talkative",
    "ell": null,
    "learningDisabilities": null,
    "interests": "Boy scouts, video games, math camp",
    "familyBackground": "Lives with both parents, only child",
    "ses": null,
    "academicPerformance": "B in 6th grade science, C in 6th grade math"
  }
].map(addFields({
  isMursion: true,
  cohortKey: '20160722'
}));

const demoStudents = [{
  id: 4001,
  sketchFab: {
    id: 'f6548660b118491fbf32d78d5dbc8403',
    eye: [-3, -20, -6],
    target: [0.0, 0.01, 0.15],
    fallbackUrl: 'http://tsl-hacking.s3-website-us-east-1.amazonaws.com/teacher-moments/danny.jpg'
  },
  sketchFabId: '',
  name: `Danny`,
  grade: `7th grade`,
  gender: `male`,
  race: `African American`,
  behavior: null,
  ell: null,
  learningDisabilities: null,
  academicPerformance: null,
  interests: `Plays in a band, sings in the school chorus`,
  familyBackground: `1 older brother`,
  ses: null,
}, {
  id: 4002,
  sketchFab: {
    id: '2106cb61b95c48dc8b506ffb3c1daa6e',
    eye: [-12, -20, -1],
    target: [-0.09, -0.05, 0.10],
    fallbackUrl: 'http://tsl-hacking.s3-website-us-east-1.amazonaws.com/teacher-moments/sheena.jpg'
  },
  name: `Sheena`,
  grade: `7th grade`,
  gender: `female`,
  race: `Asian`,
  behavior: null,
  ell: null,
  learningDisabilities: null,
  academicPerformance: null,
  interests: null,
  familyBackground: null,
  ses: null
}, {
  id: 4003,
  name: `Rita`,
  grade: `7th grade`,
  gender: `female`,
  race: `Caucasian`,
  behavior: null,
  ell: null,
  learningDisabilities: `ADHD`,
  academicPerformance: null,
  interests: 'Active in theater clubs',
  familyBackground: null,
  ses: null
}].map(addFields({
  isMursion: false,
  cohortKey: '20161026'
}));

export const allStudents = initialStudents.concat(
  julyStudentsFromMursion,
  julyStudentsNotFromMursion,
  demoStudents
);

// Only include the latest cohort of students (others are essentially archived).
export const activeStudents = allStudents.filter(student => student.cohortKey === '20160722');


text:
from pymocap.gui.natnet_view import NatnetView
from pymocap.gui.recorder_view import RecorderView

import Tkinter as tk

class RecordView:
    def __init__(self, parent, reader, writer):
        self.parent = parent
        self.reader = reader
        self.writer = writer
        self.setup()

    def __del__(self):
        self.destroy()

    def destroy(self):
        self.frame.grid_forget()

    def setup(self):
        # container
        self.frame = tk.Frame(self.parent, padx=10, pady=10)
        self.frame.grid()
        self.natnet_view = NatnetView(parent=self.frame, reader=self.reader)
        self.recorder_view = RecorderView(parent=self.frame, writer=self.writer)

        self.natnet_view.frame.grid(row=0, column=0)
        self.recorder_view.frame.grid(row=1, column=0)


text:
<?php

// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.

require_once("../../config.php");
require_once("lib.php");

$id    = required_param('id',PARAM_INT);           // forum
$group = optional_param('group',0,PARAM_INT);      // change of group
$edit  = optional_param('edit',-1,PARAM_BOOL);     // Turn editing on and off

$url = new moodle_url('/mod/forum/subscribers.php', array('id'=>$id));
if ($group !== 0) {
    $url->param('group', $group);
}
if ($edit !== 0) {
    $url->param('edit', $edit);
}
$PAGE->set_url($url);

$forum = $DB->get_record('forum', array('id'=>$id), '*', MUST_EXIST);
$course = $DB->get_record('course', array('id'=>$forum->course), '*', MUST_EXIST);
if (! $cm = get_coursemodule_from_instance('forum', $forum->id, $course->id)) {
    $cm->id = 0;
}

require_login($course, false, $cm);

$context = context_module::instance($cm->id);
if (!has_capability('mod/forum:viewsubscribers', $context)) {
    print_error('nopermissiontosubscribe', 'forum');
}

unset($SESSION->fromdiscussion);

$params = array(
    'context' => $context,
    'other' => array('forumid' => $forum->id),
);
$event = \mod_forum\event\subscribers_viewed::create($params);
$event->trigger();

$forumoutput = $PAGE->get_renderer('mod_forum');
$currentgroup = groups_get_activity_group($cm);
$options = array('forumid'=>$forum->id, 'currentgroup'=>$currentgroup, 'context'=>$context);
$existingselector = new mod_forum_existing_subscriber_selector('existingsubscribers', $options);
$subscriberselector = new mod_forum_potential_subscriber_selector('potentialsubscribers', $options);
$subscriberselector->set_existing_subscribers($existingselector->find_users(''));

if (data_submitted()) {
    require_sesskey();
    $subscribe = (bool)optional_param('subscribe', false, PARAM_RAW);
    $unsubscribe = (bool)optional_param('unsubscribe', false, PARAM_RAW);
    /** It has to be one or the other, not both or neither */
    if (!($subscribe xor $unsubscribe)) {
        print_error('invalidaction');
    }
    if ($subscribe) {
        $users = $subscriberselector->get_selected_users();
        foreach ($users as $user) {
            if (!\mod_forum\subscriptions::subscribe_user($user->id, $forum)) {
                print_error('cannotaddsubscriber', 'forum', '', $user->id);
            }
        }
    } else if ($unsubscribe) {
        $users = $existingselector->get_selected_users();
        foreach ($users as $user) {
            if (!\mod_forum\subscriptions::unsubscribe_user($user->id, $forum)) {
                print_error('cannotremovesubscriber', 'forum', '', $user->id);
            }
        }
    }
    $subscriberselector->invalidate_selected_users();
    $existingselector->invalidate_selected_users();
    $subscriberselector->set_existing_subscribers($existingselector->find_users(''));
}

$strsubscribers = get_string("subscribers", "forum");
$PAGE->navbar->add($strsubscribers);
$PAGE->set_title($strsubscribers);
$PAGE->set_heading($COURSE->fullname);
if (has_capability('mod/forum:managesubscriptions', $context) && \mod_forum\subscriptions::is_forcesubscribed($forum) === false) {
    if ($edit != -1) {
        $USER->subscriptionsediting = $edit;
    }
    $PAGE->set_button(forum_update_subscriptions_button($course->id, $id));
} else {
    unset($USER->subscriptionsediting);
}
echo $OUTPUT->header();
echo $OUTPUT->heading(get_string('forum', 'forum').' '.$strsubscribers);
if (empty($USER->subscriptionsediting)) {
    $subscribers = \mod_forum\subscriptions::fetch_subscribed_users($forum, $currentgroup, $context);
    if (\mod_forum\subscriptions::is_forcesubscribed($forum)) {
        $subscribers = mod_forum_filter_hidden_users($cm, $context, $subscribers);
    }
    echo $forumoutput->subscriber_overview($subscribers, $forum, $course);
} else {
    echo $forumoutput->subscriber_selection_form($existingselector, $subscriberselector);
}
echo $OUTPUT->footer();

/**
 * Filters a list of users for whether they can see a given activity.
 * If the course module is hidden (closed-eye icon), then only users who have
 * the permission to view hidden activities will appear in the output list.
 *
 * @todo MDL-48625 This filtering should be handled in core libraries instead.
 *
 * @param stdClass $cm the course module record of the activity.
 * @param context_module $context the activity context, to save re-fetching it.
 * @param array $users the list of users to filter.
 * @return array the filtered list of users.
 */
function mod_forum_filter_hidden_users(stdClass $cm, context_module $context, array $users) {
    if ($cm->visible) {
        return $users;
    } else {
        // Filter for users that can view hidden activities.
        $filteredusers = array();
        $hiddenviewers = get_users_by_capability($context, 'moodle/course:viewhiddenactivities');
        foreach ($hiddenviewers as $hiddenviewer) {
            if (array_key_exists($hiddenviewer->id, $users)) {
                $filteredusers[$hiddenviewer->id] = $users[$hiddenviewer->id];
            }
        }
        return $filteredusers;
    }
}


text:
package org.broadleafcommerce.common.extensibility.context.merge.handlers;

import org.apache.commons.collections.CollectionUtils;
import org.w3c.dom.Attr;
import org.w3c.dom.Element;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;

import java.util.Arrays;
import java.util.Comparator;
import java.util.List;

/**
 * Merge the attributes of a source and patch node, only adding attributes from
 * the patch side. When the same attribute is encountered in the source and
 * patch children list, the source attribute is left untouched.
 * @author jfischer
 */
public class AttributePreserveInsert extends BaseHandler {

    public Node[] merge(List<Node> nodeList1, List<Node> nodeList2, List<Node> exhaustedNodes) {
        if (CollectionUtils.isEmpty(nodeList1) || CollectionUtils.isEmpty(nodeList2)) {
            return null;
        }
        Node node1 = nodeList1.get(0);
        Node node2 = nodeList2.get(0);
        NamedNodeMap attributes2 = node2.getAttributes();

        Comparator<Object> nameCompare = new Comparator<Object>() {
            public int compare(Object arg0, Object arg1) {
                return ((Node) arg0).getNodeName().compareTo(((Node) arg1).getNodeName());
            }
        };
        Node[] tempNodes = {};
        tempNodes = exhaustedNodes.toArray(tempNodes);
        Arrays.sort(tempNodes, nameCompare);
        int length = attributes2.getLength();
        for (int j = 0; j < length; j++) {
            Node temp = attributes2.item(j);
            int pos = Arrays.binarySearch(tempNodes, temp, nameCompare);
            if (pos < 0) {
                ((Element) node1).setAttributeNode((Attr) node1.getOwnerDocument().importNode(temp.cloneNode(true), true));
            }
        }

        return null;
    }

}


text:
======================
VistA Patches: TOOLKIT
======================

This directory contains patch host files for a VistA package.
The files are organized into subdirectories named for each patch.

See `<../README.rst>`__ for package details.


text:
var characteri = 0;
var characterlasti = 0;
var institutioni = 0;
var institutionlasti = 0;
var eventi = 0;
var eventlasti = 0;
var initial_characters = new Array();
var available_characters = new Array();
var initial_institutions = new Array();
var available_institutions = new Array();
var initial_events = new Array();
var available_events = new Array();

function documentInit()
{
	initial_characters = available_characters.slice();
	initial_institutions = available_institutions.slice();
	initial_events = available_events.slice();
}

function cloneCharacters()
{
	var characters = $('#characters').clone();
	characters.each(function(i, select) {
		$('option', this).each(function() {
			if ($.inArray(this.value, available_characters) == -1) {
				$(this).remove();
			}
		})
	});
	return characters;
}

function reloadCharacters()
{
	$.ajax({
		url: '/index.php/api/characters',
		success: function(data) {
			var server_characters = JSON.parse(data);
			var initial_characters_ = new Array();
			$.each(server_characters, function(i, server_character) {
				if ($.inArray(server_character.id, initial_characters) == -1) {
					$('#characters').append('<option value="' + server_character.id + '">' + server_character.name + '</option>');
					available_characters.push(server_character.id);
				}
				initial_characters_.push(server_character.id);
			});
			initial_characters = initial_characters_;
			$('#characterwrapper' + (characteri - 1)).remove();
			addCharacterSelection();
		}
	});
}

function addCharacterSelection()
{
	if (!(available_characters.length - 1)) {
		characterlasti = characteri;
		++characteri;
		return;
	}

	var character = cloneCharacters();
	character.attr('id', 'Document_character' + characteri);
	character.attr('name', 'Document[character' + characteri + ']');

	var character_wrapper = $('

');
	character_wrapper.append(character);
	character_wrapper.append('

');
	character_wrapper.append('
' + $('#js_remove').text() + '
');

	$('#selectedcharacters').append(character_wrapper);

	$('#Document_character' + characteri).show();
	$('#addcharacter' + characteri).show();

	characterlasti = characteri;
	++characteri;
}

function updateCharacterSelection()
{
	$('#characterwrapper' + characterlasti).remove();
	addCharacterSelection();
}

function addCharacter_(selected)
{
	if (characteri > 0) {
		if (selected == '') {
			alert('Please, select the character you want to add');
			return;
		}
		$('#Document_character' + characterlasti).val(selected);
		var removeMe;
		$.each(available_characters, function(i, v) {
			if (v == selected) {
				removeMe = i;
			}
		});
		available_characters.splice(removeMe, 1);
		$('#Document_character' + characterlasti).hide();
		$('#addcharacter' + characterlasti).hide();
		$('#removecharacter' + characterlasti).show();
		$('#characterlabel' + characterlasti).html($('#Document_character' + characterlasti + ' option:selected').text());
		$('#characterlabel' + characterlasti).attr('character', $('#Document_character' + characterlasti + ' option:selected').val());
		$('#characterlabel' + characterlasti).show();
	}

	addCharacterSelection();
}

function addCharacter()
{
	addCharacter_($('#Document_character' + characterlasti).val());
}

function removeCharacter(i)
{
	available_characters.push($('#characterlabel' + i).attr('character'));
	$('#characterwrapper' + i).remove();
	if (available_characters.length == 2) {
		addCharacterSelection();
	} else {
		updateCharacterSelection();
	}
}

////////////////////////////////////////////////////////////////////////////////////////////////////

function cloneInstitutions()
{
	var institutions = $('#institutions').clone();
	institutions.each(function(i, select) {
			$('option', this).each(function() {
				if ($.inArray(this.value, available_institutions) == -1) {
					$(this).remove();
				}
			})
		}
	);
	return institutions;
}

function reloadInstitutions()
{
	$.ajax({
		url: '/index.php/api/institutions',
		success: function(data) {
			var server_institutions = JSON.parse(data);
			var initial_institutions_ = new Array();
			$.each(server_institutions, function(i, server_institution) {
				if ($.inArray(server_institution.id, initial_institutions) == -1) {
					$('#institutions').append('<option value="' + server_institution.id + '">' + server_institution.name + '</option>');
					available_institutions.push(server_institution.id);
				}
				initial_institutions_.push(server_institution.id);
			});
			initial_institutions = initial_institutions_;
			$('#institutionwrapper' + (institutioni - 1)).remove();
			addInstitutionSelection();
		}
	});
}

function addInstitutionSelection()
{
	if (!(available_institutions.length - 1)) {
		institutionlasti = institutioni;
		++institutioni;
		return;
	}

	var institution = cloneInstitutions();
	institution.attr('id', 'Document_institution' + institutioni);
	institution.attr('name', 'Document[institution' + institutioni + ']');

	var institution_wrapper = $('

');
	institution_wrapper.append(institution);
	institution_wrapper.append('

');
	institution_wrapper.append('
' + $('#js_remove').text() + '
');

	$('#selectedinstitutions').append(institution_wrapper);

	$('#Document_institution' + institutioni).show();
	$('#addinstitution' + institutioni).show();

	institutionlasti = institutioni;
	++institutioni;
}

function updateInstitutionSelection()
{
	$('#institutionwrapper' + institutionlasti).remove();
	addInstitutionSelection();
}

function addInstitution_(selected)
{
	if (institutioni > 0) {
		if (selected == '') {
			alert('Please, select the institution you want to add');
			return;
		}
		$('#Document_institution' + institutionlasti).val(selected);
		var removeMe;
		$.each(available_institutions, function(i, v) {
			if (v == selected) {
				removeMe = i;
			}
		});
		available_institutions.splice(removeMe, 1);
		$('#Document_institution' + institutionlasti).hide();
		$('#addinstitution' + institutionlasti).hide();
		$('#removeinstitution' + institutionlasti).show();
		$('#institutionlabel' + institutionlasti).html($('#Document_institution' + institutionlasti + ' option:selected').text());
		$('#institutionlabel' + institutionlasti).attr('institution', $('#Document_institution' + institutionlasti + ' option:selected').val());
		$('#institutionlabel' + institutionlasti).show();
	}

	addInstitutionSelection();
}

function addInstitution()
{
	addInstitution_($('#Document_institution' + institutionlasti).val());
}

function removeInstitution(i)
{
	available_institutions.push($('#institutionlabel' + i).attr('institution'));
	$('#institutionwrapper' + i).remove();
	if (available_institutions.length == 2) {
		addInstitutionSelection();
	} else {
		updateInstitutionSelection();
	}
}

////////////////////////////////////////////////////////////////////////////////////////////////////

function cloneEvents()
{
    var events = $('#events').clone();
    events.each(function(i, select) {
            $('option', this).each(function() {
                if ($.inArray(this.value, available_events) == -1) {
                    $(this).remove();
                }
            })
        }
    );
    return events;
}

function reloadEvents()
{
	$.ajax({
		url: '/index.php/api/events',
		success: function(data) {
			var server_events = JSON.parse(data);
			var initial_events_ = new Array();
			$.each(server_events, function(i, server_event) {
				if ($.inArray(server_event.id, initial_events) == -1) {
					$('#events').append('<option value="' + server_event.id + '">' + server_event.name + '</option>');
					available_events.push(server_event.id);
				}
				initial_events_.push(server_event.id);
			});
			initial_events = initial_events_;
			$('#eventwrapper' + (eventi - 1)).remove();
			addEventSelection();
		}
	});
}

function addEventSelection()
{
    if (!(available_events.length - 1)) {
		eventlasti = eventi;
		++eventi;
        return;
    }

    var event = cloneEvents();
    event.attr('id', 'Document_event' + eventi);
    event.attr('name', 'Document[event' + eventi + ']');

    var event_wrapper = $('

');
    event_wrapper.append(event);
    event_wrapper.append('

');
    event_wrapper.append('
' + $('#js_remove').text() + '');

    $('#selectedevents').append(event_wrapper);

    $('#Document_event' + eventi).show();
    $('#addevent' + eventi).show();

    eventlasti = eventi;
    ++eventi;
}

function updateEventSelection()
{
    $('#eventwrapper' + eventlasti).remove();
    addEventSelection();
}

function addEvent_(selected)
{
    if (eventi > 0) {
        if (selected == '') {
            alert('Please, select the event you want to add');
            return;
        }
        $('#Document_event' + eventlasti).val(selected);
        var removeMe;
        $.each(available_events, function(i, v) {
            if (v == selected) {
                removeMe = i;
            }
        });
        available_events.splice(removeMe, 1);
        $('#Document_event' + eventlasti).hide();
        $('#addevent' + eventlasti).hide();
        $('#removeevent' + eventlasti).show();
        $('#eventlabel' + eventlasti).html($('#Document_event' + eventlasti + ' option:selected').text());
        $('#eventlabel' + eventlasti).attr('event', $('#Document_event' + eventlasti + ' option:selected').val());
        $('#eventlabel' + eventlasti).show();
    }

    addEventSelection();
}

function addEvent()
{
    addEvent_($('#Document_event' + eventlasti).val());
}

function removeEvent(i)
{
    available_events.push($('#eventlabel' + i).attr('event'));
    $('#eventwrapper' + i).remove();
    if (available_events.length == 2) {
        addEventSelection();
    } else {
        updateEventSelection();
    }
}


text:
ARRANGEMENTS HAVE CHANGED FRIDAY — SUNDAY

**Thursday lunch**:

We will be meeting for lunch at New Hope Church (95 York Rd, RG1 8DU) at 1–2pm where we will be able to share stories of what God has been doing. If you are planning to join us in the afternoon please arrive here by 1:45pm – thanks.

**Friday — Sunday** lunch:

for the rest if the weekend we are linching at 203 Caversham road at Carey's drinks stall.


text:
function loadImage(n) {
    var elem = document.createElement("img");
    elem.setAttribute("src", "http://www.google-analytics.com/__utm.gif");
    document.getElementById("placehere").appendChild(elem);

    window.setTimeout(function() {
        console.log((new Date())+" - Loading image..");
        loadImage();
    }, 1000);
}

loadImage();


text:
package org.jetbrains.plugins.groovy.refactoring.introduce;

import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.project.Project;
import com.intellij.psi.PsiElement;
import javax.annotation.Nonnull;

import org.jetbrains.plugins.groovy.lang.psi.api.statements.GrVariable;
import org.jetbrains.plugins.groovy.lang.psi.api.statements.expressions.GrExpression;

/**
 * @author Max Medvedev
 */
public interface GrIntroduceContext {
  @Nonnull
  Project getProject();

  Editor getEditor();

  @javax.annotation.Nullable
  GrExpression getExpression();

  @javax.annotation.Nullable
  GrVariable getVar();

  @javax.annotation.Nullable
  StringPartInfo getStringPart();

  @Nonnull
  PsiElement[] getOccurrences();

  PsiElement getScope();

  @Nonnull
  PsiElement getPlace();
}


text:
//
//  DJAbstractAlertActionView.h
//  alertviewtest
//
//  Created by chentengfei on 16/8/29.
//  Copyright © 2016年 chentengfei. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "Masonry.h"

@protocol DJAbstractAlertActionViewDelegate;

@interface DJAbstractAlertActionView : UIView

@property (nonatomic, assign) id<DJAbstractAlertActionViewDelegate> delegate;

- (instancetype)initWithDelegate:(id<DJAbstractAlertActionViewDelegate>)delegate;

/**
 *  设置选中的下标
 */
- (void)setSelectedIndex:(NSUInteger)index;

@end

@protocol DJAbstractAlertActionViewDelegate <NSObject>

/**
 选项选中回调

 @param actionView 当前的actionView对象
 @param index      下标
 */
- (void)ActionView:(DJAbstractAlertActionView *)actionView SelectedIndex:(NSUInteger)index;

@end


text:
/*$NetBSD: ixgbe_netbsd.h,v 1.2.2.1 2015/05/06 23:29:21 riz Exp $*/
/*
 * Copyright (c) 2011 The NetBSD Foundation, Inc.
 * All rights reserved.
 *
 * This code is derived from software contributed to The NetBSD Foundation
 * by Coyote Point Systems, Inc.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 */

#ifndef _IXGBE_NETBSD_H
#define _IXGBE_NETBSD_H

#define	IXGBE_LEGACY_TX	1

#define	ETHERCAP_VLAN_HWFILTER	0
#define	ETHERCAP_VLAN_HWCSUM	0
#define	MJUM9BYTES	(9 * 1024)
#define	MJUM16BYTES	(16 * 1024)
#define	MJUMPAGESIZE	PAGE_SIZE

#define IFCAP_RXCSUM	\
	(IFCAP_CSUM_IPv4_Rx|IFCAP_CSUM_TCPv4_Rx|IFCAP_CSUM_UDPv4_Rx|\
	IFCAP_CSUM_TCPv6_Rx|IFCAP_CSUM_UDPv6_Rx)

#define IFCAP_TXCSUM	\
	(IFCAP_CSUM_IPv4_Tx|IFCAP_CSUM_TCPv4_Tx|IFCAP_CSUM_UDPv4_Tx|\
	IFCAP_CSUM_TCPv6_Tx|IFCAP_CSUM_UDPv6_Tx)

#define IFCAP_HWCSUM	(IFCAP_RXCSUM|IFCAP_TXCSUM)

#define	ETHER_ALIGN		2

struct ixgbe_dma_tag {
	bus_dma_tag_t	dt_dmat;
	bus_size_t	dt_alignment;
	bus_size_t	dt_boundary;
	bus_size_t	dt_maxsize;
	int		dt_nsegments;
	bus_size_t	dt_maxsegsize;
	int		dt_flags;
};

typedef struct ixgbe_dma_tag ixgbe_dma_tag_t;

struct ixgbe_extmem_head;
typedef struct ixgbe_extmem_head ixgbe_extmem_head_t;

struct ixgbe_extmem {
	ixgbe_extmem_head_t		*em_head;
	bus_dma_tag_t			em_dmat;
	bus_size_t			em_size;
	bus_dma_segment_t		em_seg;
	void				*em_vaddr;
	TAILQ_ENTRY(ixgbe_extmem)	em_link;
};

typedef struct ixgbe_extmem ixgbe_extmem_t;

struct ixgbe_extmem_head {
	TAILQ_HEAD(, ixgbe_extmem)	eh_freelist;
	kmutex_t			eh_mtx;
	bool				eh_initialized;
};

int ixgbe_dma_tag_create(bus_dma_tag_t, bus_size_t, bus_size_t, bus_size_t, int,
    bus_size_t, int, ixgbe_dma_tag_t **);
void ixgbe_dma_tag_destroy(ixgbe_dma_tag_t *);
int ixgbe_dmamap_create(ixgbe_dma_tag_t *, int, bus_dmamap_t *);
void ixgbe_dmamap_destroy(ixgbe_dma_tag_t *, bus_dmamap_t);
void ixgbe_dmamap_sync(ixgbe_dma_tag_t *, bus_dmamap_t, int);
void ixgbe_dmamap_unload(ixgbe_dma_tag_t *, bus_dmamap_t);

void ixgbe_jcl_reinit(ixgbe_extmem_head_t *, bus_dma_tag_t, int, size_t);
struct mbuf *ixgbe_getjcl(ixgbe_extmem_head_t *, int, int, int, size_t);

#endif /* _IXGBE_NETBSD_H */


text:
package com.shmup.hiscores.ui.score.add.options;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ListView;

import com.shmup.hiscores.R;
import com.shmup.hiscores.activity.CreateScoreActivity;
import com.shmup.hiscores.games.adapter.OptionAdapter;
import com.shmup.hiscores.games.model.Option;
import com.shmup.hiscores.scores.view.ScoreCardItemView;
import com.shmup.hiscores.ui.score.add.ItemFragment;

import java.util.List;

public abstract class SelectFragment<O extends Option> extends ItemFragment {

    private int titleId;
    private int listViewId;
    private OptionAdapter<O> adapter;

    public SelectFragment(int layoutId, int titleId, int listViewId) {
        super(layoutId);
        this.titleId = titleId;
        this.listViewId = listViewId;
    }

    @Override
    public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);
        ((CreateScoreActivity) getActivity()).setActionBarTitle(getResources().getString(titleId));

        ListView listView = (ListView) view.findViewById(this.listViewId);
        adapter = new OptionAdapter<>(view.getContext());
        adapter.setOptions(getOptions());
        listView.setAdapter(adapter);
        listView.setOnItemClickListener(select(adapter));

        ((ScoreCardItemView) view.findViewById(R.id.preview)).bindView(getItem());
    }

    private AdapterView.OnItemClickListener select(final OptionAdapter<O> adapter) {
        return new AdapterView.OnItemClickListener() {
            @Override
            public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
                populateItemWith(adapter.getItem(position));
                goToNextFragmentFrom(SelectFragment.this.getClass());
            }
        };
    }

    protected abstract List<O> getOptions();

    protected abstract void populateItemWith(O option);

    protected OptionAdapter<O> getAdapter() {
        return adapter;
    }

}


text:
import { NgModule }             from '@angular/core';
import { RouterModule, Routes } from '@angular/router';

import { UsersComponent }      from './component/users.component';
import { DevicesComponent }      from './component/devices.component';
import { UserDetailComponent }      from './component/user-detail.component';
import { AddUserComponent }      from './component/add-user.component';

const routes: Routes = [
  { path: '', redirectTo: '/users', pathMatch: 'full' },
  { path: 'users',     component: UsersComponent },
  { path: 'devices',     component: DevicesComponent },
  { path: 'adduser',     component: AddUserComponent },
  { path: 'detail/:id',     component: UserDetailComponent }
];

@NgModule({
  imports: [ RouterModule.forRoot(routes) ],
  exports: [ RouterModule ]
})
export class AppRoutingModule {}


text:
#if !NO_RUNTIME
using System;

#if FEAT_IKVM
using Type = IKVM.Reflection.Type;
using IKVM.Reflection;
#else
using System.Reflection;
#endif

namespace ProtoBuf.Meta
{
    ///
    /// Represents the set of serialization callbacks to be used when serializing/deserializing a type.
    ///
    public class CallbackSet
    {
        private readonly MetaType metaType;
        internal CallbackSet(MetaType metaType)
        {
            if (metaType == null) throw new ArgumentNullException("metaType");
            this.metaType = metaType;
        }
        internal MethodInfo this[TypeModel.CallbackType callbackType]
        {
            get
            {
                switch (callbackType)
                {
                    case TypeModel.CallbackType.BeforeSerialize: return beforeSerialize;
                    case TypeModel.CallbackType.AfterSerialize: return afterSerialize;
                    case TypeModel.CallbackType.BeforeDeserialize: return beforeDeserialize;
                    case TypeModel.CallbackType.AfterDeserialize: return afterDeserialize;
                    default: throw new ArgumentException("Callback type not supported: " + callbackType.ToString(), "callbackType");
                }
            }
        }
        internal static bool CheckCallbackParameters(TypeModel model, MethodInfo method)
        {
            ParameterInfo[] args = method.GetParameters();
            for (int i = 0; i < args.Length; i++)
            {
                Type paramType = args[i].ParameterType;
                if(paramType == model.MapType(typeof(SerializationContext))) {}
                else if(paramType == model.MapType(typeof(System.Type))) {}
#if PLAT_BINARYFORMATTER
                else if(paramType == model.MapType(typeof(System.Runtime.Serialization.StreamingContext))) {}
#endif
                else return false;
            }
            return true;
        }
        private MethodInfo SanityCheckCallback(TypeModel model, MethodInfo callback)
        {
            metaType.ThrowIfFrozen();
            if (callback == null) return callback; // fine
            if (callback.IsStatic) throw new ArgumentException("Callbacks cannot be static", "callback");
            if (callback.ReturnType != model.MapType(typeof(void))
                || !CheckCallbackParameters(model, callback))
            {
                throw CreateInvalidCallbackSignature(callback);
            }
            return callback;
        }
        internal static Exception CreateInvalidCallbackSignature(MethodInfo method)
        {
            return new NotSupportedException("Invalid callback signature in " + method.DeclaringType.FullName + "." + method.Name);
        }
        private MethodInfo beforeSerialize, afterSerialize, beforeDeserialize, afterDeserialize;
        /// Called before serializing an instance
        public MethodInfo BeforeSerialize
        {
            get { return beforeSerialize; }
            set { beforeSerialize = SanityCheckCallback(metaType.Model, value); }
        }
        /// Called before deserializing an instance
        public MethodInfo BeforeDeserialize
        {
            get { return beforeDeserialize; }
            set { beforeDeserialize = SanityCheckCallback(metaType.Model, value); }
        }
        /// Called after serializing an instance
        public MethodInfo AfterSerialize
        {
            get { return afterSerialize; }
            set { afterSerialize = SanityCheckCallback(metaType.Model, value); }
        }
        /// Called after deserializing an instance
        public MethodInfo AfterDeserialize
        {
            get { return afterDeserialize; }
            set { afterDeserialize = SanityCheckCallback(metaType.Model, value); }
        }
        ///
        /// True if any callback is set, else False
        ///
        public bool NonTrivial
        {
            get
            {
                return beforeSerialize != null || beforeDeserialize != null
                    || afterSerialize != null || afterDeserialize != null;
            }
        }
    }
}
#endif


text:
using System;
using System.Collections.Generic;
using System.Linq;
using BlueSheep.Common.IO;

namespace BlueSheep.Common.Protocol.Types
{

public class FightResultFighterListEntry : FightResultListEntry
{

public new const short ID = 189;
public override short TypeId
{
    get { return ID; }
}

public int id;
        public bool alive;

public FightResultFighterListEntry()
{
}

public FightResultFighterListEntry(short outcome, sbyte wave, Types.FightLoot rewards, int id, bool alive)
         : base(outcome, wave, rewards)
        {
            this.id = id;
            this.alive = alive;
        }

public override void Serialize(BigEndianWriter writer)
{

base.Serialize(writer);
            writer.WriteInt(id);
            writer.WriteBoolean(alive);

}

public override void Deserialize(BigEndianReader reader)
{

base.Deserialize(reader);
            id = reader.ReadInt();
            alive = reader.ReadBoolean();

}

}

}


text:
/**
 * A global dictionary that holds information about what Caffe2 modules have
 * been loaded in the current runtime, and also utility functions to load
 * modules.
 */
#ifndef CAFFE2_CORE_MODULE_H_
#define CAFFE2_CORE_MODULE_H_

#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <functional>
#include <memory>
#include <mutex>

#include "caffe2/core/common.h"
#include "caffe2/core/typeid.h"

namespace caffe2 {

/**
 * A module schema that can be used to store specific information about
 * different modules. Currently, we only store the name and a simple
 * description of what this module does.
 */
class ModuleSchema {
 public:
  ModuleSchema(const char* name, const char* description);

 private:
  const char* name_;
  const char* description_;
};

/**
 * @brief Current Modules present in the Caffe2 runtime.
 * Returns:
 *   map: a map of modules and (optionally) their description. The key is the
 *       module name, and the value is the description for that module. The
 *       module name is recommended to be the part that constitutes the trunk
 *       of the dynamic library: for example, a module called
 *       libcaffe2_db_rocksdb.so should have the name "caffe2_db_rocksdb". The
 *       reason we do not use "lib" is because it's somewhat redundant, and
 *       the reason we do not include ".so" is for cross-platform compatibility
 *       on platforms like mac os.
 */
const CaffeMap<string, const ModuleSchema*>& CurrentModules();

/**
 * @brief Checks whether a module is already present in the current binary.
 */
bool HasModule(const string& name);

/**
 * @brief Load a module.
 * Inputs:
 *   name: a module name or a path name.
 *       It is recommended that you use the name of the module, and leave the
 *       full path option to only experimental modules.
 *   filename: (optional) a filename that serves as a hint to load the module.
 */
void LoadModule(const string& name, const string& filename="");

#define CAFFE2_MODULE(name, description)                                    \
  extern "C" {                                                              \
    const bool gCaffe2ModuleSanityCheck##name() { return true; }            \
  }                                                                         \
  namespace {                                                               \
    static ::caffe2::ModuleSchema module_schema_##name(#name, description); \
  }

}  // namespace caffe2
#endif  // CAFFE2_CORE_MODULE_H_


text:
function gcloud::auth_activate(){
    echo "Activating service-account"
    gcloud auth activate-service-account --key-file=${GOOGLE_APPLICATION_CREDENTIALS}
    gcloud version
}