text:
'use strict';
'format es6';

import moduleName from '../name';

angular.module(moduleName, ['ui.router',
  'ngCookies',
  'angular-storage',
  'angular-jwt',
  'auth0',
  'ui.bootstrap',
]);

redpajama_set_name: RedPajamaGithub


text:
package com.xinyou.frame.service;

import java.sql.Connection;
import java.sql.SQLException;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.ws.rs.Consumes;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.core.MediaType;

import com.xinyou.frame.domain.biz.FrameConfig;
import com.xinyou.frame.domain.biz.SYS_BIZ;
import com.xinyou.frame.domain.biz.USR_BIZ;
import com.xinyou.frame.domain.entities.BIZ_SYS;
import com.xinyou.frame.domain.entities.USR_MAIN;
import com.xinyou.frame.request.SysRequest;
import com.xinyou.frame.response.BizSysResponse;
import com.xinyou.util.ConnectionManager;
import com.xinyou.util.Log;
import com.xinyou.util.ServiceBase;

@Path("/BizSys")
public class BizSys extends ServiceBase {
	    USR_MAIN ui= null;

	    /**
	     *  登录以后,根据token获取用户的信息
	     * */
	    private void getUserInfo(String token,Connection conn) throws Exception {
	    	  ui = new USR_MAIN();
	    	  if(token==null || token.length() == 0) {
	    		   ui.setStatus(1); //无效用户
	    		   return;
	    	  }

	    	  USR_BIZ biz = new USR_BIZ();
	    	  ui = biz.getUserInfo(token, conn);
	    }

	    private void getUserInfo(HttpServletRequest httpRequest,
	    		   HttpServletResponse httpResponse,Connection conn) throws Exception {
	    	 ui = new USR_MAIN();
	    	 if(httpRequest.getCookies() == null || httpRequest.getCookies().length == 0) {
	    		  ui.setStatus(1);
	    		  return;
	    	 }

	    	 int iCookie = httpRequest.getCookies().length;
	    	 if(iCookie == 0) {
	    		  ui.setStatus(1);
	    		  return;
	    	 }

	    	 String token="";
	    	 for(int i=0;i<iCookie;i++) {
	    		 if(httpRequest.getCookies()[i].getName().equals("frame-token")) {
	    			  token = httpRequest.getCookies()[i].getValue();
	    			  break;
	    		 }
	    	 }

	    	 if(token == null || token.length()== 0) {
	    		  ui.setStatus(1);
	    		  return ;
	    	 }

	         USR_BIZ biz = new USR_BIZ();
	         ui = biz.getUserInfo(token, conn);

	    }

	    /**
	     *  添加系统功能模块
	     * */
	    @POST
	    @Consumes({MediaType.APPLICATION_JSON})
	    @Path("/addBizSys")
	    public BizSysResponse addBizSys(SysRequest sys_request) {

	    	 BizSysResponse  response = new BizSysResponse();
	    	 Connection conn = null;
	    	 try {
	    		 conn = ConnectionManager.getConnection(FrameConfig.DSNAME);
	    		 getUserInfo( sys_request.getToken(),conn);
	    		 if(ui == null || ui.getStatus() != 0) {

	    			  response.setStatus("2");
	    			  if(ui.getStatus()==1) {
	    				  response.setInfo("您没有登录系统");
	    			  }else if(ui.getStatus() == 2) {
	    				  response.setInfo("登录已经超时");
	    			  }
	    			  return response;
	    		 }

	    		 //to save data
	    		 BIZ_SYS biz_sys= sys_request.getBiz_sys();
	    		 if(biz_sys.getBiz_sys_id() == null || biz_sys.getBiz_sys_id().isEmpty()) {
	    			 throw new Exception("系统代码不能为空");
	    		 }

	    		 if(biz_sys.getSys_name() == null || biz_sys.getSys_name().isEmpty()) {
	    			 throw new Exception("系统名称不能为空");
	    		 }

	    		 biz_sys.setCreated_by(ui.getUsr_main_guid());
	    		 biz_sys.setUpdated_by(ui.getUsr_main_guid());
	    		 biz_sys.setClient_guid("");
	    		 SYS_BIZ biz = new SYS_BIZ();
	    		 biz.addBizSys(biz_sys, conn);
	    		 response.setInfo("");
	    		 response.setStatus("0");

	    	 }catch(Exception ex) {
	    		 response.setInfo( ex.getMessage() == null? "java.lang.NullPointerException: null":ex.getMessage());
	    		 response.setStatus("1");
	    		 StackTraceElement StackTrace = new Exception().getStackTrace()[0];
	    		 Log.logSys(FrameConfig.CONFIGNAME, StackTrace.getClassName(), StackTrace.getMethodName(), "Exception:" + ex.getMessage(), "Exception");

	    	 }finally {

	    		  try {
					if(conn != null && conn.isClosed() == false) conn.close();
				} catch (SQLException e) {
				}
	    	 }
	    	return response;
	    }

	    @POST
	    @Consumes({MediaType.APPLICATION_JSON})
	    @Path(value="/getBizSyss")
	    public BizSysResponse getBizSyss(SysRequest sys_request) {
	    	BizSysResponse response = new BizSysResponse();
	    	Connection conn = null;
	    	try {
	    		conn = ConnectionManager.getConnection(FrameConfig.CONFIGNAME);
	    		//user verification
	    		this.getUserInfo(sys_request.getToken(), conn);
	    		if(ui==null || ui.getStatus() != 0) {
	    			response.setStatus("2");

	    			if(ui.getStatus()==1)
						response.setInfo("您还未登录系统");
					else if(ui.getStatus()==2)
						response.setInfo("登录已超时");

	    			return response;

	    		}

	    		SYS_BIZ biz = new SYS_BIZ();
	    		response.setBizSysDMData(biz.getBizSyss(sys_request.getSys_id(), sys_request.getSys_name(), sys_request.getPage_no(), sys_request.getPage_size(), conn));
	    		response.setInfo("");
	    		response.setStatus("0");

	    	}catch(Exception ex) {
	    		response.setInfo(ex.getMessage()==null?"java.lang.NullPointerException: null":ex.getMessage());
				response.setStatus("1");
				// TODO Log
				StackTraceElement StackTrace = new Exception().getStackTrace()[0];
				Log.logSys(FrameConfig.CONFIGNAME, StackTrace.getClassName(), StackTrace.getMethodName(), "Exception: "+ex.getMessage(), "Exception");

	    	}finally {
	    		try {if(conn!=null&&!conn.isClosed())conn.close();} catch (SQLException e) {};
	    	}

	    	return response;
	    }
}


text:
var get = Ember.get, set = Ember.set;

var validatorClass, validator, originalExistentValidator, moduleOpts = {
  setup: function() {
    originalExistentValidator = Ember.Validators.ExistentValidator;
    Ember.Validators.ExistentValidator = Ember.Validator.extend();

    validatorClass = Ember.Validator.extend();
  },
  teardown: function() {
    validatorClass = null;
    validator = null;
    Ember.Validators.ExistentValidator = originalExistentValidator;
    originalExistentValidator = null;
  }
};
module("Ember.Validators.getValidator", moduleOpts);

// validator errors

test("should raise an exception if there is no options and no matching validator", function() {
  raises(function() { Ember.Validators.getValidator('inexistent'); }, /Validator not found for name \'inexistent\'./);
});

test("should raise an exception if options are empty and there is no matching validator", function() {
  raises(function() { Ember.Validators.getValidator('inexistent', {validator: null}); }, /Validator not found for name \'inexistent\'./);
});

// custom validator class

test("should instantiate validator from options when set", function() {
  var validator = Ember.Validators.getValidator('foo', {validator: validatorClass, options: {opt: 'yes'}});

  ok(validatorClass.detectInstance(validator), "return instance of validator class passed as parameters");
  equal(get(validator, 'options.opt'), 'yes', "should set validator options");
});

test("should instantiate validator from options, and set 'options.value' property when set", function() {
  var validator = Ember.Validators.getValidator('foo', {validator: validatorClass, options: 'foo'});
  equal(get(validator, 'options.value'), 'foo', "should set validator 'options.value' property");
});

// custom validate function

test("should create validator with validate method from options when set", function() {
  var validate = function() {};
  var validator = Ember.Validators.getValidator('foo', {validator: validate, options: {opt: 'yes'}});

  ok(Ember.Validator.detectInstance(validator), "should be an instance of Validator");
  equal(get(validator, 'validate'), validate, "should set validate method from options");
  equal(get(validator, 'options.opt'), 'yes', "should set validator options");
});

// existent validator

test("should find the validator whose name matches", function() {
  var validator = Ember.Validators.getValidator('existent', {opt: 'foo'});

  ok(Ember.Validators.ExistentValidator.detectInstance(validator), "should be an instance of ExistentValidator");
  equal(get(validator, 'options.opt'), 'foo', "should set validator options");
});

test("should set 'option.value' validator property when options is not a hash", function() {
  var validator = Ember.Validators.getValidator('existent', 12);

  equal(get(validator, 'options.value'), 12, "should set 'option' property to the argument value");
});


text:
package com.lesfurets.anagram;

import java.util.Set;

public class AnagramJava7 implements Anagram {
    @Override
    public Set<String> anagrams(String word, Set<String> candidates) {
        return null;
    }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
  <component name="ChangeListManager">
<<<<<<< HEAD
    <list default="true" id="3098e7b3-e6e2-489c-b19c-fa1fbe0ed4ca" name="Default" comment="">
      <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/src/main/resources/Dungeon1.png" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/workspace.xml" />
    </list>
=======
    <list default="true" id="3098e7b3-e6e2-489c-b19c-fa1fbe0ed4ca" name="Default" comment="" />
>>>>>>> 5da259ffe7a1b8e46a90a6d19ff7817ee3550301
    <ignored path="$PROJECT_DIR$/target/" />
    <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
    <option name="TRACKING_ENABLED" value="true" />
    <option name="SHOW_DIALOG" value="false" />
    <option name="HIGHLIGHT_CONFLICTS" value="true" />
    <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
    <option name="LAST_RESOLUTION" value="IGNORE" />
  </component>
  <component name="CreatePatchCommitExecutor">
    <option name="PATCH_PATH" value="" />
  </component>
  <component name="ExecutionTargetManager" SELECTED_TARGET="default_target" />
  <component name="FileEditorManager">
    <leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
      <file leaf-file-name="InputButton.java" pinned="false" current-in-tab="false">
        <entry file="file://$PROJECT_DIR$/src/main/java/h1z1/input/InputButton.java">
          <provider selected="true" editor-type-id="text-editor">
            <state relative-caret-position="204">
              <caret line="12" column="10" lean-forward="false" selection-start-line="12" selection-start-column="10" selection-end-line="12" selection-end-column="10" />
              <folding />
            </state>
          </provider>
        </entry>
      </file>
      <file leaf-file-name="GamePadInputProvider.java" pinned="false" current-in-tab="false">
        <entry file="file://$PROJECT_DIR$/src/main/java/h1z1/input/GamePadInputProvider.java">
          <provider selected="true" editor-type-id="text-editor">
            <state relative-caret-position="1292">
              <caret line="86" column="44" lean-forward="false" selection-start-line="86" selection-start-column="44" selection-end-line="86" selection-end-column="44" />
              <folding />
            </state>
          </provider>
        </entry>
      </file>
<<<<<<< HEAD
      <file leaf-file-name="SpriteSheet1.png" pinned="false" current-in-tab="false">
=======
      <file leaf-file-name="SpriteSheet1.png" pinned="false" current-in-tab="true">
>>>>>>> 5da259ffe7a1b8e46a90a6d19ff7817ee3550301
        <entry file="file://$PROJECT_DIR$/src/main/resources/SpriteSheet1.png">
          <provider selected="true" editor-type-id="images">
            <state />
          </provider>
        </entry>
      </file>
<<<<<<< HEAD
      <file leaf-file-name="Dungeon1.png" pinned="false" current-in-tab="true">
        <entry file="file://$PROJECT_DIR$/src/main/resources/Dungeon1.png">
          <provider selected="true" editor-type-id="images">
            <state />
          </provider>
        </entry>
      </file>
=======
>>>>>>> 5da259ffe7a1b8e46a90a6d19ff7817ee3550301
      <file leaf-file-name="InputProvider.java" pinned="false" current-in-tab="false">
        <entry file="file://$PROJECT_DIR$/src/main/java/h1z1/input/InputProvider.java">
          <provider selected="true" editor-type-id="text-editor">
            <state relative-caret-position="357">
              <caret line="24" column="0" lean-forward="false" selection-start-line="24" selection-start-column="0" selection-end-line="24" selection-end-column="0" />
              <folding />
            </state>
          </provider>
        </entry>
      </file>
      <file leaf-file-name="KeyboardInputProvider.java" pinned="false" current-in-tab="false">
        <entry file="file://$PROJECT_DIR$/src/main/java/h1z1/input/KeyboardInputProvider.java">
          <provider selected="true" editor-type-id="text-editor">
            <state relative-caret-position="1343">
              <caret line="82" column="41" lean-forward="false" selection-start-line="82" selection-start-column="41" selection-end-line="82" selection-end-column="41" />
              <folding />
            </state>
          </provider>
        </entry>
      </file>
    </leaf>
  </component>
  <component name="Git.Settings">
    <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
  </component>
  <component name="GradleLocalSettings">
    <option name="externalProjectsViewState">
      <projects_view />
    </option>
  </component>
  <component name="IdeDocumentHistory">
    <option name="CHANGED_PATHS">
      <list>
        <option value="$PROJECT_DIR$/src/main/java/h1z1/input/KeyboardInputProvider.java" />
        <option value="$PROJECT_DIR$/src/main/java/h1z1/input/InputButton.java" />
        <option value="$PROJECT_DIR$/src/main/java/h1z1/input/GamePadInputProvider.java" />
      </list>
    </option>
  </component>
  <component name="MavenProjectNavigator">
    <treeState>
      <PATH>
        <PATH_ELEMENT>
          <option name="myItemId" value="" />
          <option name="myItemType" value="org.jetbrains.idea.maven.navigator.MavenProjectsStructure$RootNode" />
        </PATH_ELEMENT>
        <PATH_ELEMENT>
          <option name="myItemId" value="h1z1" />
          <option name="myItemType" value="org.jetbrains.idea.maven.navigator.MavenProjectsStructure$ProjectNode" />
        </PATH_ELEMENT>
        <PATH_ELEMENT>
          <option name="myItemId" value="Lifecycle" />
          <option name="myItemType" value="org.jetbrains.idea.maven.navigator.MavenProjectsStructure$LifecycleNode" />
        </PATH_ELEMENT>
      </PATH>
    </treeState>
  </component>
  <component name="ProjectFrameBounds">
    <option name="x" value="-8" />
    <option name="y" value="-8" />
    <option name="width" value="1382" />
    <option name="height" value="744" />
  </component>
  <component name="ProjectLevelVcsManager" settingsEditedManually="true">
    <ConfirmationsSetting value="1" id="Add" />
  </component>
  <component name="ProjectView">
    <navigator currentView="ProjectPane" proportions="" version="1">
      <flattenPackages />
      <showMembers />
      <showModules />
      <showLibraryContents />
      <hideEmptyPackages />
      <abbreviatePackageNames />
      <autoscrollToSource />
      <autoscrollFromSource />
      <sortByType />
      <manualOrder />
      <foldersAlwaysOnTop value="true" />
    </navigator>
    <panes>
      <pane id="Scope" />
      <pane id="ProjectPane">
        <subPane>
          <PATH>
            <PATH_ELEMENT>
              <option name="myItemId" value="H1Z1" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="H1Z1" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
          </PATH>
          <PATH>
            <PATH_ELEMENT>
              <option name="myItemId" value="H1Z1" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="H1Z1" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="src" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="main" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
<<<<<<< HEAD
=======
            <PATH_ELEMENT>
              <option name="myItemId" value="resources" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
          </PATH>
          <PATH>
            <PATH_ELEMENT>
              <option name="myItemId" value="h1z1" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="h1z1" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="src" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
>>>>>>> 5da259ffe7a1b8e46a90a6d19ff7817ee3550301
            <PATH_ELEMENT>
              <option name="myItemId" value="resources" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
          </PATH>
          <PATH>
            <PATH_ELEMENT>
              <option name="myItemId" value="H1Z1" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="H1Z1" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="src" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="main" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
          </PATH>
        </subPane>
      </pane>
      <pane id="Scratches" />
      <pane id="PackagesPane" />
    </panes>
  </component>
  <component name="PropertiesComponent">
    <property name="last_opened_file_path" value="$PROJECT_DIR$" />
  </component>
  <component name="RecentsManager">
    <key name="MoveFile.RECENT_KEYS">
      <recent name="$PROJECT_DIR$/src/main/resources" />
    </key>
  </component>
  <component name="RunDashboard">
    <option name="ruleStates">
      <list>
        <RuleState>
          <option name="name" value="ConfigurationTypeDashboardGroupingRule" />
        </RuleState>
        <RuleState>
          <option name="name" value="StatusDashboardGroupingRule" />
        </RuleState>
      </list>
    </option>
  </component>
  <component name="RunManager">
    <configuration default="true" type="#org.jetbrains.idea.devkit.run.PluginConfigurationType" factoryName="Plugin">
      <module name="" />
      <option name="VM_PARAMETERS" value="-Xmx512m -Xms256m -XX:MaxPermSize=250m -ea" />
      <option name="PROGRAM_PARAMETERS" />
      <predefined_log_file id="idea.log" enabled="true" />
      <method />
    </configuration>
    <configuration default="true" type="Applet" factoryName="Applet">
      <option name="HTML_USED" value="false" />
      <option name="WIDTH" value="400" />
      <option name="HEIGHT" value="300" />
      <option name="POLICY_FILE" value="$APPLICATION_HOME_DIR$/bin/appletviewer.policy" />
      <module />
      <method />
    </configuration>
    <configuration default="true" type="Application" factoryName="Application">
      <extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
      <option name="MAIN_CLASS_NAME" />
      <option name="VM_PARAMETERS" />
      <option name="PROGRAM_PARAMETERS" />
      <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
      <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
      <option name="ALTERNATIVE_JRE_PATH" />
      <option name="ENABLE_SWING_INSPECTOR" value="false" />
      <option name="ENV_VARIABLES" />
      <option name="PASS_PARENT_ENVS" value="true" />
      <module name="" />
      <envs />
      <method />
    </configuration>
    <configuration default="true" type="JUnit" factoryName="JUnit">
      <extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
      <module name="" />
      <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
      <option name="ALTERNATIVE_JRE_PATH" />
      <option name="PACKAGE_NAME" />
      <option name="MAIN_CLASS_NAME" />
      <option name="METHOD_NAME" />
      <option name="TEST_OBJECT" value="class" />
      <option name="VM_PARAMETERS" value="-ea" />
      <option name="PARAMETERS" />
      <option name="WORKING_DIRECTORY" value="$MODULE_DIR$" />
      <option name="ENV_VARIABLES" />
      <option name="PASS_PARENT_ENVS" value="true" />
      <option name="TEST_SEARCH_SCOPE">
        <value defaultName="singleModule" />
      </option>
      <envs />
      <patterns />
      <method />
    </configuration>
    <configuration default="true" type="MavenRunConfiguration" factoryName="Maven">
      <MavenSettings>
        <option name="myGeneralSettings" />
        <option name="myRunnerSettings" />
        <option name="myRunnerParameters">
          <MavenRunnerParameters>
            <option name="profiles">
              <set />
            </option>
            <option name="goals">
              <list />
            </option>
            <option name="profilesMap">
              <map />
            </option>
            <option name="resolveToWorkspace" value="false" />
            <option name="workingDirPath" value="" />
          </MavenRunnerParameters>
        </option>
      </MavenSettings>
      <method />
    </configuration>
    <configuration default="true" type="Remote" factoryName="Remote">
      <option name="USE_SOCKET_TRANSPORT" value="true" />
      <option name="SERVER_MODE" value="false" />
      <option name="SHMEM_ADDRESS" value="javadebug" />
      <option name="HOST" value="localhost" />
      <option name="PORT" value="5005" />
      <method />
    </configuration>
    <configuration default="true" type="TestNG" factoryName="TestNG">
      <extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
      <module name="" />
      <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
      <option name="ALTERNATIVE_JRE_PATH" />
      <option name="SUITE_NAME" />
      <option name="PACKAGE_NAME" />
      <option name="MAIN_CLASS_NAME" />
      <option name="METHOD_NAME" />
      <option name="GROUP_NAME" />
      <option name="TEST_OBJECT" value="CLASS" />
      <option name="VM_PARAMETERS" value="-ea" />
      <option name="PARAMETERS" />
      <option name="WORKING_DIRECTORY" value="$MODULE_DIR$" />
      <option name="OUTPUT_DIRECTORY" />
      <option name="ANNOTATION_TYPE" />
      <option name="ENV_VARIABLES" />
      <option name="PASS_PARENT_ENVS" value="true" />
      <option name="TEST_SEARCH_SCOPE">
        <value defaultName="singleModule" />
      </option>
      <option name="USE_DEFAULT_REPORTERS" value="false" />
      <option name="PROPERTIES_FILE" />
      <envs />
      <properties />
      <listeners />
      <method />
    </configuration>
  </component>
  <component name="ShelveChangesManager" show_recycled="false">
    <option name="remove_strategy" value="false" />
  </component>
  <component name="TaskManager">
    <task active="true" id="Default" summary="Default task">
      <changelist id="3098e7b3-e6e2-489c-b19c-fa1fbe0ed4ca" name="Default" comment="" />
      <created>1498938312995</created>
      <option name="number" value="Default" />
      <option name="presentableId" value="Default" />
      <updated>1498938312995</updated>
    </task>
    <servers />
  </component>
  <component name="ToolWindowManager">
<<<<<<< HEAD
    <frame x="-8" y="-8" width="1382" height="744" extended-state="6" />
=======
    <frame x="0" y="23" width="1280" height="773" extended-state="6" />
>>>>>>> 5da259ffe7a1b8e46a90a6d19ff7817ee3550301
    <editor active="true" />
    <layout>
      <window_info id="Palette" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
      <window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
      <window_info id="Nl-Palette" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
      <window_info id="Palette	" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
      <window_info id="Image Layers" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
      <window_info id="Capture Analysis" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
      <window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="true" content_ui="tabs" />
      <window_info id="Maven Projects" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.329429" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
      <window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
      <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32977098" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
<<<<<<< HEAD
      <window_info id="Properties" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
      <window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.329653" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
      <window_info id="Capture Tool" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
      <window_info id="Designer" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
      <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.2489019" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
=======
      <window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
      <window_info id="Properties" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
      <window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.32977098" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
      <window_info id="Capture Tool" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
      <window_info id="Designer" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
      <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.24959612" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
>>>>>>> 5da259ffe7a1b8e46a90a6d19ff7817ee3550301
      <window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
      <window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
      <window_info id="UI Designer" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
      <window_info id="Theme Preview" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
      <window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="true" content_ui="tabs" />
      <window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
      <window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
      <window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
      <window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
      <window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
      <window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
      <window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
    </layout>
  </component>
  <component name="VcsContentAnnotationSettings">
    <option name="myLimit" value="2678400000" />
  </component>
  <component name="XDebuggerManager">
    <breakpoint-manager />
    <watches-manager />
  </component>
  <component name="editorHistoryManager">
    <entry file="file://$PROJECT_DIR$/src/main/java/h1z1/input/InputButton.java">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="204">
          <caret line="12" column="10" lean-forward="false" selection-start-line="12" selection-start-column="10" selection-end-line="12" selection-end-column="10" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/src/main/java/h1z1/input/GamePadInputProvider.java">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="1292">
          <caret line="86" column="44" lean-forward="false" selection-start-line="86" selection-start-column="44" selection-end-line="86" selection-end-column="44" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/src/main/resources/SpriteSheet1.png">
      <provider selected="true" editor-type-id="images">
        <state />
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/src/main/java/h1z1/input/InputProvider.java">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="357">
          <caret line="24" column="0" lean-forward="true" selection-start-line="24" selection-start-column="0" selection-end-line="24" selection-end-column="0" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/src/main/java/h1z1/input/KeyboardInputProvider.java">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="1343">
          <caret line="82" column="41" lean-forward="false" selection-start-line="82" selection-start-column="41" selection-end-line="82" selection-end-column="41" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/src/main/java/h1z1/input/InputProvider.java">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="357">
          <caret line="24" column="0" lean-forward="false" selection-start-line="24" selection-start-column="0" selection-end-line="24" selection-end-column="0" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/src/main/java/h1z1/input/KeyboardInputProvider.java">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="1343">
          <caret line="82" column="41" lean-forward="false" selection-start-line="82" selection-start-column="41" selection-end-line="82" selection-end-column="41" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/src/main/java/h1z1/input/InputButton.java">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="204">
          <caret line="12" column="10" lean-forward="false" selection-start-line="12" selection-start-column="10" selection-end-line="12" selection-end-column="10" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/src/main/java/h1z1/input/GamePadInputProvider.java">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="1292">
          <caret line="86" column="44" lean-forward="false" selection-start-line="86" selection-start-column="44" selection-end-line="86" selection-end-column="44" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/src/main/resources/SpriteSheet1.png">
      <provider selected="true" editor-type-id="images">
        <state />
      </provider>
    </entry>
<<<<<<< HEAD
    <entry file="file://$PROJECT_DIR$/src/main/resources/Dungeon1.png">
      <provider selected="true" editor-type-id="images">
        <state />
      </provider>
    </entry>
=======
>>>>>>> 5da259ffe7a1b8e46a90a6d19ff7817ee3550301
  </component>
  <component name="mavenExecuteGoalHistory">
    <option value="$PROJECT_DIR$" />
    <option value="package exec:exec" />
  </component>
</project>


text:
package pl.exsio.plupload.ex;

import java.io.Serializable;

/**
 *
 * @author exsio
 */
public class InvalidFileHandlerException extends RuntimeException implements Serializable {

    public InvalidFileHandlerException(String msg) {
        super(msg);
    }
}


text:
//============================================================================
//
// Copyright (C) 2006-2022 Talend Inc. - www.talend.com
//
// This source code is available under agreement available at
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
//
// You should have received a copy of the agreement
// along with this program; if not, write to Talend SA
// 9 rue Pages 92150 Suresnes, France
//
//============================================================================

package org.talend.components.netsuite.input;

import static org.talend.daikon.properties.property.PropertyFactory.newBoolean;

import java.util.Collections;
import java.util.Set;

import org.talend.components.api.component.Connector;
import org.talend.components.api.component.PropertyPathConnector;
import org.talend.components.common.FixedConnectorsComponentProperties;
import org.talend.components.netsuite.NetSuiteProvideConnectionProperties;
import org.talend.components.netsuite.connection.NetSuiteConnectionProperties;
import org.talend.daikon.properties.presentation.Form;
import org.talend.daikon.properties.property.Property;

import com.fasterxml.jackson.annotation.JsonProperty;

/**
 * Root properties of NetSuite Input component.
 */
public class NetSuiteInputProperties extends FixedConnectorsComponentProperties
        implements NetSuiteProvideConnectionProperties {

    public final NetSuiteConnectionProperties connection;

    public final NetSuiteInputModuleProperties module;

    public final Property<Boolean> bodyFieldsOnly = newBoolean("bodyFieldsOnly", true);

    protected transient final PropertyPathConnector mainConnector =
            new PropertyPathConnector(Connector.MAIN_NAME, "module.main");

    public NetSuiteInputProperties(@JsonProperty("name") String name) {
        super(name);

        connection = new NetSuiteConnectionProperties("connection");
        module = new NetSuiteInputModuleProperties("module", connection);
        bodyFieldsOnly.setValue(true);
    }

    @Override
    public void setupLayout() {
        super.setupLayout();

        Form mainForm = new Form(this, Form.MAIN);
        mainForm.addRow(connection.getForm(Form.REFERENCE));
        mainForm.addRow(module.getForm(Form.REFERENCE));

        Form advForm = Form.create(this, Form.ADVANCED);
        advForm.addRow(bodyFieldsOnly);
        advForm.addRow(module.getForm(Form.ADVANCED));
    }

    @Override
    public void refreshLayout(Form form) {
        super.refreshLayout(form);

        for (Form childForm : connection.getForms()) {
            connection.refreshLayout(childForm);
        }
    }

    @Override
    public NetSuiteConnectionProperties getConnectionProperties() {
        return connection.getEffectiveConnectionProperties();
    }

    @Override
    public String getReferencedComponentId() {
        return connection.getReferencedComponentId();
    }

    @Override
    protected Set<PropertyPathConnector> getAllSchemaPropertiesConnectors(boolean isOutputConnection) {
        if (isOutputConnection) {
            return Collections.singleton(mainConnector);
        }
        return Collections.emptySet();
    }
}


text:
package org.craft.spongeimpl.game;

import com.google.common.base.*;

import org.craft.blocks.*;
import org.craft.blocks.Block;
import org.craft.items.*;
import org.spongepowered.api.*;
import org.spongepowered.api.block.*;
import org.spongepowered.api.item.*;

public class SpongeGameRegistry implements GameRegistry
{

    @Override
    public Optional<BlockType> getBlock(String id)
    {
        // TODO
        Blocks.get(id);
        return null;
    }

    @Override
    public Optional<ItemType> getItem(String id)
    {
        // TODO
        Items.get(id);
        return null;
    }

    @Override
    public Optional<String> getId(Object obj)
    {
        if(obj instanceof IStackable)
        {
            // TODO
            ((IStackable) obj).getId();
            return null;
        }
        return null;
    }

    public void registerBlock(Block block)
    {
        Blocks.register(block);
    }

    public void registerItem(Item item)
    {
        Items.register(item);
    }
}


text:
package it.lutech.servizio;

import javax.xml.ws.WebFault;

/**
 * This class was generated by Apache CXF 3.1.10
 * 2017-03-15T15:24:34.549+01:00
 * Generated source version: 3.1.10
 */

@WebFault(name = "operazioneFault", targetNamespace = "http://lutech.it/servizio/")
public class OperazioneFault_Exception extends Exception {

    private it.lutech.servizio.OperazioneFault operazioneFault;

    public OperazioneFault_Exception() {
        super();
    }

    public OperazioneFault_Exception(String message) {
        super(message);
    }

    public OperazioneFault_Exception(String message, Throwable cause) {
        super(message, cause);
    }

    public OperazioneFault_Exception(String message, it.lutech.servizio.OperazioneFault operazioneFault) {
        super(message);
        this.operazioneFault = operazioneFault;
    }

    public OperazioneFault_Exception(String message, it.lutech.servizio.OperazioneFault operazioneFault, Throwable cause) {
        super(message, cause);
        this.operazioneFault = operazioneFault;
    }

    public it.lutech.servizio.OperazioneFault getFaultInfo() {
        return this.operazioneFault;
    }
}


text:
Please file issues for feature suggestions or bugs.

# Experimental

As this library is still experimental and still subject to change, I am not accepting major PRs at this time.
Minor fixes or documentation improvements may be accepted provided that they don't break anything.


text:
{% extends 'base.html' %}

{% block title %}Reaction Time{% endblock %}

{% block content %}

    {% block js_files %}

        <script src="{{ url_for('static', filename='js/libs/p5.min.js') }}"></script>
        <script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.5.7/addons/p5.dom.min.js"></script>
        <script src="{{ url_for('static', filename='js/interactive/reactionTime.js') }}"></script>

    {% endblock %}
{% endblock %}


text:
interface IMixpanel {

  people: Mixpanel.IPeople;

  init(token: string, onSuccess: () => void, onFail: (errors: string) => void): void;

  alias(alias: string, originalId: string, onSuccess: () => void, onFail: (errors: string) => void): void;
  createAlias(alias: string, originalId: string, onSuccess: () => void, onFail: (errors: string) => void): void;
  distinctId(onSuccess: () => void, onFail: (errors: string) => void): void;
  flush(onSuccess: () => void, onFail: (errors: string) => void): void;
  identify(id: string, onSuccess: () => void, onFail: (errors: string) => void): void;
  registerSuperProperties(superProperties: any, onSuccess: () => void, onFail: (errors: string) => void): void;
  reset(onSuccess: () => void, onFail: (errors: string) => void): void;
  showSurvey(onSuccess: () => void, onFail: (errors: string) => void): void;
  timeEvent(eventName: string, onSuccess: () => void, onFail: (errors: string) => void): void;
  track(eventName: string, eventProperties: any, onSuccess: () => void, onFail: (errors: string) => void): void;
}

declare namespace Mixpanel {
  interface IPeople {
    identify(distinctId: string, onSuccess: () => void, onFail: (errors: string) => void): void;
    increment(peopleProperties: any, onSuccess: () => void, onFail: (errors: string) => void): void;
    set(peopleProperties: any, onSuccess: () => void, onFail: (errors: string) => void): void;
    setOnce(peopleProperties: any, onSuccess: () => void, onFail: (errors: string) => void): void;
    setPushId(pushId: string, onSuccess: () => void, onFail: (errors: string) => void): void;
    trackCharge(amount: number, eventProperties: any, onSuccess: () => void, onFail: (errors: string) => void): void;
    unset(propertiesArray: Array<string>, onSuccess: () => void, onFail: (errors: string) => void): void;
  }
}

declare var mixpanel: IMixpanel;


text:
CREATE SEQUENCE SEQ_COMPANY_ID
    START WITH 1
    INCREMENT BY 1;

CREATE TABLE TBL_COMPANY (
    ID BIGINT,
    NAME VARCHAR(255) NOT NULL,
    VERSION INTEGER,
    PRIMARY KEY (ID)
);


text:
    #error "SOMETHING must be defined"
#endif

#ifndef MESSAGE
    #define MESSAGE "generic"
#endif

int main()
{
    printf("Hello, world (" MESSAGE ")!\n");
    return 0;
}


text:
// Copyright 2015-2018 Hans Dembinski
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt
// or copy at http://www.boost.org/LICENSE_1_0.txt)

#ifndef BOOST_HISTOGRAM_DETAIL_AXES_HPP
#define BOOST_HISTOGRAM_DETAIL_AXES_HPP

#include <array>
#include <boost/assert.hpp>
#include <boost/histogram/axis/traits.hpp>
#include <boost/histogram/axis/variant.hpp>
#include <boost/histogram/detail/static_if.hpp>
#include <boost/histogram/fwd.hpp>
#include <boost/mp11/algorithm.hpp>
#include <boost/mp11/list.hpp>
#include <boost/mp11/tuple.hpp>
#include <boost/mp11/utility.hpp>
#include <boost/throw_exception.hpp>
#include <stdexcept>
#include <tuple>
#include <type_traits>

/* Most of the histogram code is generic and works for any number of axes. Buffers with a
 * fixed maximum capacity are used in some places, which have a size equal to the rank of
 * a histogram. The buffers are statically allocated to improve performance, which means
 * that they need a preset maximum capacity. 32 seems like a safe upper limit for the rank
 * (you can nevertheless increase it here if necessary): the simplest non-trivial axis has
 * 2 bins; even if counters are used which need only a byte of storage per bin, this still
 * corresponds to 4 GB of storage.
 */
#ifndef BOOST_HISTOGRAM_DETAIL_AXES_LIMIT
#define BOOST_HISTOGRAM_DETAIL_AXES_LIMIT 32
#endif

namespace boost {
namespace histogram {
namespace detail {

template <class T>
unsigned axes_rank(const T& axes) {
  using std::begin;
  using std::end;
  return static_cast<unsigned>(std::distance(begin(axes), end(axes)));
}

template <class... Ts>
constexpr unsigned axes_rank(const std::tuple<Ts...>&) {
  return static_cast<unsigned>(sizeof...(Ts));
}

template <unsigned N, class... Ts>
decltype(auto) axis_get(std::tuple<Ts...>& axes) {
  return std::get<N>(axes);
}

template <unsigned N, class... Ts>
decltype(auto) axis_get(const std::tuple<Ts...>& axes) {
  return std::get<N>(axes);
}

template <unsigned N, class T>
decltype(auto) axis_get(T& axes) {
  return axes[N];
}

template <unsigned N, class T>
decltype(auto) axis_get(const T& axes) {
  return axes[N];
}

template <class... Ts>
decltype(auto) axis_get(std::tuple<Ts...>& axes, unsigned i) {
  using namespace boost::mp11;
  constexpr auto S = sizeof...(Ts);
  using V = mp_unique<axis::variant<Ts*...>>;
  return mp_with_index<S>(i, [&axes](auto i) { return V(&std::get<i>(axes)); });
}

template <class... Ts>
decltype(auto) axis_get(const std::tuple<Ts...>& axes, unsigned i) {
  using namespace boost::mp11;
  constexpr auto S = sizeof...(Ts);
  using V = mp_unique<axis::variant<const Ts*...>>;
  return mp_with_index<S>(i, [&axes](auto i) { return V(&std::get<i>(axes)); });
}

template <class T>
decltype(auto) axis_get(T& axes, unsigned i) {
  return axes.at(i);
}

template <class T>
decltype(auto) axis_get(const T& axes, unsigned i) {
  return axes.at(i);
}

template <class... Ts, class... Us>
bool axes_equal(const std::tuple<Ts...>& ts, const std::tuple<Us...>& us) {
  return static_if<std::is_same<mp11::mp_list<Ts...>, mp11::mp_list<Us...>>>(
      [](const auto& ts, const auto& us) {
        using N = mp11::mp_size<std::decay_t<decltype(ts)>>;
        bool equal = true;
        mp11::mp_for_each<mp11::mp_iota<N>>(
            [&](auto I) { equal &= relaxed_equal(std::get<I>(ts), std::get<I>(us)); });
        return equal;
      },
      [](const auto&, const auto&) { return false; }, ts, us);
}

template <class T, class... Us>
bool axes_equal(const T& t, const std::tuple<Us...>& u) {
  if (t.size() != sizeof...(Us)) return false;
  bool equal = true;
  mp11::mp_for_each<mp11::mp_iota_c<sizeof...(Us)>>(
      [&](auto I) { equal &= t[I] == std::get<I>(u); });
  return equal;
}

template <class... Ts, class U>
bool axes_equal(const std::tuple<Ts...>& t, const U& u) {
  return axes_equal(u, t);
}

template <class T, class U>
bool axes_equal(const T& t, const U& u) {
  if (t.size() != u.size()) return false;
  return std::equal(t.begin(), t.end(), u.begin());
}

template <class... Ts, class... Us>
void axes_assign(std::tuple<Ts...>& t, const std::tuple<Us...>& u) {
  static_if<std::is_same<mp11::mp_list<Ts...>, mp11::mp_list<Us...>>>(
      [](auto& a, const auto& b) { a = b; },
      [](auto&, const auto&) {
        BOOST_THROW_EXCEPTION(
            std::invalid_argument("cannot assign axes, types do not match"));
      },
      t, u);
}

template <class... Ts, class U>
void axes_assign(std::tuple<Ts...>& t, const U& u) {
  mp11::mp_for_each<mp11::mp_iota_c<sizeof...(Ts)>>([&](auto I) {
    using T = mp11::mp_at_c<std::tuple<Ts...>, I>;
    std::get<I>(t) = axis::get<T>(u[I]);
  });
}

template <class T, class... Us>
void axes_assign(T& t, const std::tuple<Us...>& u) {
  // resize instead of reserve, because t may not be empty and we want exact capacity
  t.resize(sizeof...(Us));
  mp11::mp_for_each<mp11::mp_iota_c<sizeof...(Us)>>(
      [&](auto I) { t[I] = std::get<I>(u); });
}

template <typename T, typename U>
void axes_assign(T& t, const U& u) {
  t.assign(u.begin(), u.end());
}

// create empty dynamic axis which can store any axes types from the argument
template <class T>
auto make_empty_dynamic_axes(const T& axes) {
  return make_default(axes);
}

template <class... Ts>
auto make_empty_dynamic_axes(const std::tuple<Ts...>&) {
  using namespace ::boost::mp11;
  using L = mp_unique<axis::variant<Ts...>>;
  // return std::vector<axis::variant<Axis0, Axis1, ...>> or std::vector<Axis0>
  return std::vector<mp_if_c<(mp_size<L>::value == 1), mp_first<L>, L>>{};
}

template <typename T>
void axis_index_is_valid(const T& axes, const unsigned N) {
  BOOST_ASSERT_MSG(N < axes_rank(axes), "index out of range");
}

template <typename F, typename T>
void for_each_axis_impl(std::true_type, const T& axes, F&& f) {
  for (const auto& x : axes) { axis::visit(std::forward<F>(f), x); }
}

template <typename F, typename T>
void for_each_axis_impl(std::false_type, const T& axes, F&& f) {
  for (const auto& x : axes) std::forward<F>(f)(x);
}

template <typename F, typename T>
void for_each_axis(const T& axes, F&& f) {
  using U = mp11::mp_first<T>;
  for_each_axis_impl(is_axis_variant<U>(), axes, std::forward<F>(f));
}

template <typename F, typename... Ts>
void for_each_axis(const std::tuple<Ts...>& axes, F&& f) {
  mp11::tuple_for_each(axes, std::forward<F>(f));
}

template <typename T>
std::size_t bincount(const T& axes) {
  std::size_t n = 1;
  for_each_axis(axes, [&n](const auto& a) {
    const auto old = n;
    const auto s = axis::traits::extent(a);
    n *= s;
    if (s > 0 && n < old) BOOST_THROW_EXCEPTION(std::overflow_error("bincount overflow"));
  });
  return n;
}

template <class T>
using tuple_size_t = typename std::tuple_size<T>::type;

template <class T>
using buffer_size = mp11::mp_eval_or<
    std::integral_constant<std::size_t, BOOST_HISTOGRAM_DETAIL_AXES_LIMIT>, tuple_size_t,
    T>;

template <class T, std::size_t N>
class sub_array : public std::array<T, N> {
  using base_type = std::array<T, N>;

public:
  explicit sub_array(std::size_t s) noexcept(
      std::is_nothrow_default_constructible<T>::value)
      : size_(s) {
    BOOST_ASSERT_MSG(size_ <= N, "requested size exceeds size of static buffer");
  }

  sub_array(std::size_t s,
            const T& value) noexcept(std::is_nothrow_copy_constructible<T>::value)
      : size_(s) {
    BOOST_ASSERT_MSG(size_ <= N, "requested size exceeds size of static buffer");
    std::array<T, N>::fill(value);
  }

  // need to override both versions of std::array
  auto end() noexcept { return base_type::begin() + size_; }
  auto end() const noexcept { return base_type::begin() + size_; }

  auto size() const noexcept { return size_; }

private:
  std::size_t size_;
};

template <class U, class T>
using stack_buffer = sub_array<U, buffer_size<T>::value>;

template <class U, class T, class... Ts>
auto make_stack_buffer(const T& t, const Ts&... ts) {
  return stack_buffer<U, T>(axes_rank(t), ts...);
}

} // namespace detail
} // namespace histogram
} // namespace boost

#endif


text:
/* -------------------------
 * UndirectedCycleBaseTest.java
 * -------------------------
 * (C) Copyright 2013, by Nikolay Ognyanov
 *
 * Original Author: Nikolay Ognyanov
 * Contributor(s) :
 *
 * $Id$
 *
 * Changes
 * -------
 * 06-Sep-2013 : Initial revision (NO);
 */
package org.jgrapht.alg.cycle;

import static org.junit.Assert.assertTrue;

import org.jgrapht.graph.ClassBasedEdgeFactory;
import org.jgrapht.graph.DefaultEdge;
import org.jgrapht.graph.SimpleGraph;
import org.junit.Test;

public class UndirectedCycleBaseTest
{
    private static int   MAX_SIZE = 10;
    private static int[] RESULTS  = { 0, 0, 0, 1, 3, 6, 10, 15, 21, 28, 36 };

    @Test
    public void test()
    {
        PatonCycleBase<Integer, DefaultEdge> patonFinder =
            new PatonCycleBase<Integer, DefaultEdge>();

        testAlgorithm(patonFinder);
    }

    private void testAlgorithm(
                               UndirectedCycleBase<Integer, DefaultEdge>
                               finder)
    {
        SimpleGraph<Integer, DefaultEdge> graph = new SimpleGraph<Integer, DefaultEdge>
            (
             new ClassBasedEdgeFactory<Integer, DefaultEdge>
             (
              DefaultEdge.class
             )
            );
        for (int i = 0; i < 7; i++) {
            graph.addVertex(i);
        }

        finder.setGraph(graph);
        graph.addEdge(0, 1);
        graph.addEdge(1, 2);
        graph.addEdge(2, 0);
        checkResult(finder, 1);
        graph.addEdge(2, 3);
        graph.addEdge(3, 0);
        checkResult(finder, 2);
        graph.addEdge(3, 1);
        checkResult(finder, 3);
        graph.addEdge(3, 4);
        graph.addEdge(4, 2);
        checkResult(finder, 4);
        graph.addEdge(4, 5);
        checkResult(finder, 4);
        graph.addEdge(5, 2);
        checkResult(finder, 5);
        graph.addEdge(5, 6);
        graph.addEdge(6, 4);
        checkResult(finder, 6);

        for (int size = 1; size <= MAX_SIZE; size++) {
            graph = new SimpleGraph<Integer, DefaultEdge>
                (
                 new ClassBasedEdgeFactory<Integer, DefaultEdge>
                 (
                  DefaultEdge.class
                 )
                );
            for (int i = 0; i < size; i++) {
                graph.addVertex(i);
            }
            for (int i = 0; i < size; i++) {
                for (int j = 0; j < size; j++) {
                    if (i != j) {
                        graph.addEdge(i, j);
                    }
                }
            }
            finder.setGraph(graph);
            checkResult(finder, RESULTS[size]);
        }
    }

    private void checkResult(UndirectedCycleBase
                             <Integer, DefaultEdge> finder,
                             int size)
    {
        assertTrue(finder.findCycleBase().size() == size);
    }
}


text:
package honcsim;
/*
 * An example to try and understand the symmetry of resolvability
 */
public class ResolvedHexPoints extends CoverageExperiment {

    static int vsDimension = 14;

    public ResolvedHexPoints() {
	super(vsDimension, 1.0);

    }
}


text:
/*jslint node: true, indent: 2 , nomen  : true, evil : true */
'use strict';
var R = require('ramda'),
  createMD5 = require('./createMD5'),
  nl = /(?:\\r|\\n|\n|\r)/g;

module.exports = function (doc) {
  if (doc.views && (!doc.id || (doc.id && doc._id.substr(0, 8) === '_design/'))) {
    Object.keys(doc.views).forEach(function (view) {
      var fn, thisView = doc.views[view];

      if (thisView.hasOwnProperty('map')) {
        fn = 'return ' + thisView.map.replace(nl, '');
        thisView.map = (new Function(fn))();
      }
      if (thisView.hasOwnProperty('reduce') && thisView.reduce !== '_sum' && thisView.reduce !== '_count') {
        fn = 'return ' + thisView.reduce.replace(nl, '');
        thisView.reduce = (new Function(fn))();
      }
    });
  }
  return doc;
};


text:
'use strict';

angular.module('users').controller('AuthenticationController', ['$scope', '$state', '$http', '$location', '$window', '$timeout', 'Authentication',
  function ($scope, $state, $http, $location, $window, $timeout, Authentication) {
    $scope.authentication = Authentication;

    // Get an eventual error defined in the URL query string:
    $scope.error = $location.search().err;

    // // If user is signed in then redirect back home
    // if ($scope.authentication.user) {
    //  $location.path('/');
    // }

    $scope.signup = function (isValid) {
      $scope.error = null;

      if (!isValid) {
        $scope.$broadcast('show-errors-check-validity', 'userForm');

        return false;
      }

      $http.post('/api/auth/signup', $scope.credentials).success(function (response) {
        // If successful we assign the response to the global user model

        $scope.authentication.user = response;

        // And redirect to the previous or home page

        $state.go('settings.picture');

      }).error(function (response) {
        $scope.error = response.message;
      });
    };

    //be sure to inject $scope and $location
    $scope.changeLocation = function (url, forceReload) {
      $scope = $scope || angular.element(document).scope();
      if (forceReload || $scope.$$phase) {
        window.location = url;
      }
      else {
        //only use this if you want to replace the history stack
        //$location.path(url).replace();

        //this this if you want to change the URL and add it to the history stack
        $location.path(url);
        $scope.$apply();
      }
    };

    $scope.signin = function (isValid) {
      $scope.error = null;

      if (!isValid) {
        $scope.$broadcast('show-errors-check-validity', 'userForm');

        return false;
      }

      $http.post('/api/auth/signin', $scope.credentials).success(function (response) {
        // If successful we assign the response to the global user model
        $scope.authentication.user = response;

        $scope.authentication.user.imageURL  = '/modules/users/client/img/profile/saveme-placeholder.png';

        // And redirect to the previous or home page
        $state.go($state.previous.state.name || 'home', $state.previous.params);
      }).error(function (response) {
        $scope.error = response.message;
      });

    };

    // OAuth provider request
    $scope.callOauthProvider = function (url) {
      if ($state.previous && $state.previous.href) {
        url += '?redirect_to=' + encodeURIComponent($state.previous.href);
      }

      // Effectively call OAuth authentication route:
      $window.location.href = url;
    };
  }
]);


text:
using System;
using FluentAssertions;
using NUnit.Framework;
using SharpDX;

namespace RiftDotNet.Test
{
	[TestFixture]
	public sealed class FusionSensorTest
	{
		[Test]
		public void TestCtor()
		{
			ISensorFusion fusion;
			using (fusion = Factory.CreateSensorFusion())
			{
				fusion.Should().NotBeNull();
				fusion.IsDisposed.Should().BeFalse();

				fusion.IsAttachedToSensor.Should().BeFalse();
				fusion.AccelGain.Should().Be(0.05f);
				fusion.Acceleration.Should().Be(Vector3.Zero);
				fusion.AngularVelocity.Should().Be(Vector3.Zero);
				fusion.IsGravityEnabled.Should().BeTrue();
				fusion.Orientation.Should().Be(Quaternion.Identity);
				fusion.PredictedOrientation.Should().Be(Quaternion.Identity);
				fusion.YawMultiplier.Should().Be(1);
			}

			fusion.IsDisposed.Should().BeTrue();
		}

		[Test]
		public void TestAttach()
		{
			using (var fusion = Factory.CreateSensorFusion())
			{
				fusion.AttachedDevice = null;
				fusion.IsAttachedToSensor.Should().BeFalse();
			}
		}

		[Test]
		public void TestContracts()
		{
			ISensorFusion fusion = Factory.CreateSensorFusion();
			fusion.Dispose();
			fusion.IsDisposed.Should().BeTrue();
			fusion.Dispose(); //< Must be allowed

			//
			// Get
			//
			new Action(() => { var unused = fusion.IsAttachedToSensor; }).ShouldThrow<ObjectDisposedException>();
			new Action(() => { var unused = fusion.IsGravityEnabled; }).ShouldThrow<ObjectDisposedException>();
			new Action(() => { var unused = fusion.IsPredictionEnabled; }).ShouldThrow<ObjectDisposedException>();
			new Action(() => { var unused = fusion.Orientation; }).ShouldThrow<ObjectDisposedException>();
			new Action(() => { var unused = fusion.PredictedOrientation; }).ShouldThrow<ObjectDisposedException>();
			new Action(() => { var unused = fusion.PredictionTime; }).ShouldThrow<ObjectDisposedException>();
			new Action(() => { var unused = fusion.YawMultiplier; }).ShouldThrow<ObjectDisposedException>();
			new Action(() => { var unused = fusion.AccelGain; }).ShouldThrow<ObjectDisposedException>();
			new Action(() => { var unused = fusion.Acceleration; }).ShouldThrow<ObjectDisposedException>();
			new Action(() => { var unused = fusion.AngularVelocity; }).ShouldThrow<ObjectDisposedException>();

			//
			// Set
			//

			new Action(() => fusion.AccelGain = 1.5f).ShouldThrow<ObjectDisposedException>();
			new Action(() => fusion.YawMultiplier = 1.5f).ShouldThrow<ObjectDisposedException>();
			new Action(() => fusion.IsPredictionEnabled = true).ShouldThrow<ObjectDisposedException>();
			new Action(() => fusion.PredictionTime = TimeSpan.FromDays(1)).ShouldThrow<ObjectDisposedException>();

			new Action(fusion.Reset).ShouldThrow<ObjectDisposedException>();
		}
	}
}


text:
package universalelectricity.api.core.grid;

import java.util.HashMap;

/**
 * A dynamic node loader for registering different nodes for different node interfaces.
 * <p/>
 * This is the essential class for loading different nodes.
 *
 * @author Calclavia
 */
public class NodeRegistry
{
	private static final HashMap<Class, Class> INTERFACE_NODE_MAP = new HashMap<Class, Class>();

	public static void register(Class nodeInterface, Class nodeClass)
	{
		INTERFACE_NODE_MAP.put(nodeInterface, nodeClass);
	}

	public static <N extends INode> N get(INodeProvider parent, Class<N> nodeInterface)
	{
		Class nodeClass = INTERFACE_NODE_MAP.get(nodeInterface);

		try
		{
			return (N) nodeClass.getConstructor(INodeProvider.class).newInstance(parent);
		}
		catch (Exception e)
		{
			e.printStackTrace();
		}

		return null;
	}
}


text:
package com.fingolfintek.mailtrap.model;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.databind.PropertyNamingStrategy.SnakeCaseStrategy;
import com.fasterxml.jackson.databind.annotation.JsonNaming;

@JsonNaming(SnakeCaseStrategy.class)
@JsonIgnoreProperties(ignoreUnknown = true)
public class Attachment {

    private String id;
    private String messageId;
    private String filename;
    private String attachmentType;
    private String contentId;
    private String transferEncoding;
    private String downloadPath;
    private long attachmentSize;
    private String attachmentHumanSize;

    public String getId() {
        return id;
    }

    public String getMessageId() {
        return messageId;
    }

    public String getFilename() {
        return filename;
    }

    public String getAttachmentType() {
        return attachmentType;
    }

    public String getContentId() {
        return contentId;
    }

    public String getTransferEncoding() {
        return transferEncoding;
    }

    public String getDownloadPath() {
        return downloadPath;
    }

    public long getAttachmentSize() {
        return attachmentSize;
    }

    public String getAttachmentHumanSize() {
        return attachmentHumanSize;
    }

    @Override
    public String toString() {
        return "Attachment{" + "id='" + id +
                ", messageId='" + messageId +
                ", filename='" + filename +
                ", attachmentType='" + attachmentType +
                ", contentId='" + contentId +
                ", transferEncoding='" + transferEncoding +
                ", downloadPath='" + downloadPath +
                ", attachmentSize=" + attachmentSize +
                ", attachmentHumanSize='" + attachmentHumanSize +
                '}';
    }
}


text:
module Prototyper
  module Renderer
    def self.included(base)
      base.extend ClassMethods
    end

    module ClassMethods

      def render_template_from(path, assigns)
        begin
          code = render_file(path, :assigns => assigns)
        rescue StandardError => e
          raise "'#{e}' while rendering prototype template '#{path}'}"
        end
      end

      def run_template_from(path, assigns)
        code = render_template_from(path, assigns)

        begin
          eval(code, TOPLEVEL_BINDING)
        rescue StandardError => e
          raise "'#{e}' while running prototype template '#{path}'"
        end

      end

      # TODO move this to a configuration place?
      def eval_template_helpers(temporary_binding)
        unless @helper_code
          helper_path = "app/prototypes/helpers.rb"
          @helper_code = read_file (helper_path, :raise => true)
        end

        eval(@helper_code, temporary_binding)
      end

      # Copy from the rails generator, with a helpers extension
      def render_file(relative_path, template_options = {})
        # Evaluate any assignments in a temporary, throwaway binding.
        vars = template_options[:assigns] || {}
        b = template_options[:binding] || binding
        vars.each { |k,v| eval "#{k} = vars[:#{k}] || vars['#{k}']", b }
        eval_template_helpers(binding)

        source = read_file(relative_path)
        ERB.new(source, nil, '-').result(b)
      end

      # Reads a file given the relative path (to the RAILS_ROOT), returns an empty string when the file wasn't found
      def read_file(relative_path, options = {})
        source_path = File.join(RAILS_ROOT, relative_path)
        File.exists?(source_path) || options[:raise] ? File.open(source_path, 'r').read : ""
      end

    end

  end
end


text:
namespace ash::quick_start {

class RandomSessionId;

// A factory class for creating instances of TargetDeviceConnectionBroker.
// Calling code should use the static Create() method.
class TargetDeviceConnectionBrokerFactory {
 public:
  static std::unique_ptr<TargetDeviceConnectionBroker> Create();

  // A RandomSessionId may be provided in order to resume a connection.
  static std::unique_ptr<TargetDeviceConnectionBroker> Create(
      RandomSessionId session_id);

  static void SetFactoryForTesting(
      TargetDeviceConnectionBrokerFactory* test_factory);

  TargetDeviceConnectionBrokerFactory();
  TargetDeviceConnectionBrokerFactory(TargetDeviceConnectionBrokerFactory&) =
      delete;
  TargetDeviceConnectionBrokerFactory& operator=(
      TargetDeviceConnectionBrokerFactory&) = delete;
  virtual ~TargetDeviceConnectionBrokerFactory();

 protected:
  virtual std::unique_ptr<TargetDeviceConnectionBroker> CreateInstance(
      RandomSessionId session_id) = 0;

 private:
  static TargetDeviceConnectionBrokerFactory* test_factory_;
};

}  // namespace ash::quick_start

#endif  // CHROME_BROWSER_ASH_LOGIN_OOBE_QUICK_START_CONNECTIVITY_TARGET_DEVICE_CONNECTION_BROKER_FACTORY_H_


text:
Install and configure nad, a nodejs-based monitoring agent.

More info on nad: https://github.com/circonus-labs/nad

## Platforms

centos, ubuntu

Other un*xes likely; windows unlikely.

## Recipes

### `nad` (`nad::default`)

Runs the install and configure recipes.

### `nad::install`

Installs nad by downloading tarballs from updates.circonus.com .

### `nad::configure`

nad doesn't have much configuration; this just sets the port, SSL options, and scripts directory.

## LWRPs

### `nad_script`

####  Actions

    :enable - Link a script into the config directory, enabling it (default)
    :disable - Delete a link

#### Attributes

   name - Name of the script (if.sh, cpu.elf, etc)
   subdir - Subdirectory within nad config directory where the actual script lives; required for :enable

#### Examples

   # Enable postgres replication script
   nad_script pg_replication.sh do
     subdir 'postgres'
   end

   # Disable vm script
   nad_script vm.sh do
     action :disable
   end

## Attributes

Defaults are shown below.

    :nad => {

        #------
        #  Cookbook Toggle
        #------
        # Set to false to disable the cookbook
        # (will not disable nad if running)
        :enabled => true,

        #------
        #  Installation
        #------
        # Where to store the tarball during installation
        :tmp_path => '/tmp',

        # URL without filename
        :download_url => 'http://updates.circonus.net/node-agent/packages',

        # File to download.  nad::install will find an appropriate file if possible.
        :download_file => "nad-omnibus-20140630T182203Z-1.el6.x86_64.rpm",

        # You can also just override the release.  nad::install will find an appropriate release if possible.
        :release => "20140630T182203Z"

        #-----
        # Daemon Config
        #-----
        :port => 2609,
        :config_dir => '/opt/circonus/etc/node_agent.d',

        # These are nil by default
        # Listen on a specific interface
        :ip => nil,
        # Use SSL (must place na.crt and na.key in conf dir).  If ssl_port is provided, :ip and :port are not used.
        :ssl_port => nil,
        :ssl_ip => nil,
    }

## See Also

https://github.com/modcloth-cookbooks/nad


text:
Avoid modifying your content in a loop

<?php
echo listview(array("Can really slow things down",
"if you have to make sure you don't read CSS props or element size / positions this will cause a re-flow on every iteration!",
"I'm looking at you bad lazy load implementations!",
));
?>


text:
I am a FogBugz Webhook listener that receives FogBugz case updates and ask the FogBugz client to update its collection of cases.

I am registered using pragma #gcFogBugzHook.


text:
title: world
category: monitoring system
layout: pages
tags:
  - knowhow
  - software
  - encryption
  - resources
permalink: /status/world
hyiplink: http://hyip.github.io/status/world
---
Horem ipsum dolor sit amettetur ing elit.


text:
For more information see our
[HTTP Proxy documentation](https://linkerd.io/getting-started/http-proxy/).

## Setup webapp

```bash
echo "Hello world" > hello; python3 -m http.server 8888
```

## Setup linkerd

```bash
curl -sLO https://github.com/linkerd/linkerd/releases/download/1.4.6/linkerd-1.4.6-exec
chmod +x linkerd-1.4.6-exec
./linkerd-1.4.6-exec ./linkerd.yaml
```

## Test

```bash
$ http_proxy=localhost:4140 curl -s http://webapp/hello
Hello world
```


text:
'use strict';

var gutil = require('gulp-util');
var through2 = require('through2');
var uglify = require('uglify-js');
var saveLicense = require('uglify-save-license');
var _ = require('lodash');

var createError = require('./create_error');

var reSourceMapComment = /\n\/\/# sourceMappingURL=.+?$/;
var PLUGIN_NAME = 'uglify';

function trycatch(fn, handle) {
  try {
    return fn();
  } catch (e) {
    return handle(e);
  }
}

function setup(opts) {
  if (opts && !_.isObject(opts)) {
    gutil.log('uglify expects an object, non-object provided');
    opts = {};
  }

  var options = _.assign({}, opts, {
    fromString: true,
    output: {}
  });

  if (options.preserveComments === 'all') {
    options.output.comments = true;
  } else if (options.preserveComments === 'some') {
    // preserve comments with directives or that start with a bang (!)
    options.output.comments = /^!|@preserve|@license|@cc_on/i;
  } else if (options.preserveComments === 'license') {
    options.output.comments = saveLicense;
  } else if (typeof options.preserveComments === 'function') {
    options.output.comments = options.preserveComments;
  }

  return options;
}

module.exports = function (opts) {
  var savedInfo = {};
  var stream = through2.obj(function (file, encoding, callback) {
    var options = setup(opts || {});
    if (file.isNull()) {
      return callback(null, file);
    }
    if (file.isStream()) {
      return callback(null, file);
    }
    if (file.isBuffer()) {
      var originalSize = file.contents.length;
      var optimizedSize;
      var saved;
      var percent;
      var mangled = trycatch(function() {
        var m = uglify.minify(String(file.contents), options);
        m.code = new Buffer(m.code.replace(reSourceMapComment, ''));
        return m;
      }, createError.bind(null, PLUGIN_NAME, file));

      if (mangled instanceof gutil.PluginError) {
        return callback(mangled);
      }

      file.contents = mangled.code;
      optimizedSize = file.contents.length;
      saved = originalSize - optimizedSize;
      percent = originalSize > 0 ? (saved / originalSize) * 100 : 0;
      savedInfo[file.relative] = {
        originalSize: originalSize,
        optimizedSize: optimizedSize,
        saved: saved,
        percent: percent
      };
      this.push(file);
      callback();
    }
  }, function (callback) {
    if (typeof opts.onComplete === 'function') {
      opts.onComplete(savedInfo);
    }
    callback();
  });

  return stream;
};


text:
var test = require("tape"),
	Sandal = require('../sandal.js');

test('Resolve service twice', function (t) {

	t.plan(2);

	var sandal = new Sandal();
	var i = 0;
	var factory = function () {
        i++;
		return i;
	};

	sandal.factory('factory', factory, 'transient');

	sandal.resolve(function(err, factory) {
		t.equal(factory, 1, 'Should get the return value');
	});

	sandal.resolve(function(err, factory) {
		t.equal(factory, 2, 'Should get a new return value');
	});

});


text:
env = ENV["RAILS_ENV"] || "development"

# See http://unicorn.bogomips.org/Unicorn/Configurator.html for complete
# documentation.
worker_processes 4

# listen on both a Unix domain socket and a TCP port,
# we use a shorter backlog for quicker failover when busy
listen "/tmp/classopoly.socket", :backlog => 64

# Preload our app for more speed
preload_app true

# nuke workers after 30 seconds instead of 60 seconds (the default)
timeout 30

pid "/tmp/unicorn.classopoly.pid"

# Production specific settings
if env == "production"
  # Help ensure your application will always spawn in the symlinked
  # "current" directory that Capistrano sets up.
  working_directory "/home/apps/classopoly/current"

  # feel free to point this anywhere accessible on the filesystem
  user 'apps', 'staff'
  shared_path = "/home/apps/classopoly/shared"

  stderr_path "#{shared_path}/log/unicorn.stderr.log"
  stdout_path "#{shared_path}/log/unicorn.stdout.log"
end

before_fork do |server, worker|
  # the following is highly recomended for Rails + "preload_app true"
  # as there's no need for the master process to hold a connection
  if defined?(ActiveRecord::Base)
    ActiveRecord::Base.connection.disconnect!
  end

  # Before forking, kill the master process that belongs to the .oldbin PID.
  # This enables 0 downtime deploys.
  old_pid = "/tmp/unicorn.classopoly.pid.oldbin"
  if File.exists?(old_pid) && server.pid != old_pid
    begin
      Process.kill("QUIT", File.read(old_pid).to_i)
    rescue Errno::ENOENT, Errno::ESRCH
      # someone else did our job for us
    end
  end
end

after_fork do |server, worker|
  # the following is *required* for Rails + "preload_app true",
  if defined?(ActiveRecord::Base)
    ActiveRecord::Base.establish_connection
  end

  # if preload_app is true, then you may also want to check and
  # restart any other shared sockets/descriptors such as Memcached,
  # and Redis.  TokyoCabinet file handles are safe to reuse
  # between any number of forked children (assuming your kernel
  # correctly implements pread()/pwrite() system calls)
end


text:
itk_module(ITK-NeuralNetworks
  DEPENDS
    ITK-Statistics
  TEST_DEPENDS
    ITK-TestKernel
)


text:
package com.groupr.backend;

import com.google.android.gcm.server.Constants;
import com.google.android.gcm.server.Message;
import com.google.android.gcm.server.Result;
import com.google.android.gcm.server.Sender;
import com.google.api.server.spi.config.Api;
import com.google.api.server.spi.config.ApiMethod;
import com.google.api.server.spi.config.ApiNamespace;
import com.google.api.server.spi.response.NotFoundException;
import com.googlecode.objectify.ObjectifyService;

import java.util.List;
import java.util.logging.Logger;
import javax.inject.Named;
import static com.googlecode.objectify.ObjectifyService.factory;
import static com.googlecode.objectify.ObjectifyService.ofy;

/**
 * WARNING: This generated code is intended as a sample or starting point for using a
 * Google Cloud Endpoints RESTful API with an Objectify entity. It provides no data access
 * restrictions and no data validation.
 * <p>
 * DO NOT deploy this code unchanged as part of a real application to real users.
 */
@Api(
        name = "eventApi",
        version = "v1",
        resource = "event",
        namespace = @ApiNamespace(
                ownerDomain = "backend.groupr.com",
                ownerName = "backend.groupr.com",
                packagePath = ""
        )
)
public class EventEndpoint {

    private static final Logger logger = Logger.getLogger(EventEndpoint.class.getName());
    private static final String MESSAGING_API_KEY = System.getProperty("gcm.api.key");

    static {
        // Typically you would register this inside an OfyServive wrapper. See: https://code.google.com/p/objectify-appengine/wiki/BestPractices
        ObjectifyService.register(Event.class);
        ObjectifyService.register(User.class);
    }

    /**
     * Returns the {@link Event} with the corresponding ID.
     *
     * @param eventid the ID of the entity to be retrieved
     * @return the entity with the corresponding ID
     * @throws NotFoundException if there is no {@code Event} with the provided ID.
     */
    @ApiMethod(
            name = "get",
            path = "event/{eventid}",
            httpMethod = ApiMethod.HttpMethod.GET)
    public Event get(@Named("eventid") long eventid) throws NotFoundException {
        logger.info("Getting Event with ID: " + eventid);
        Event event = ofy().load().type(Event.class).id(eventid).now();
        if (event == null) {
            throw new NotFoundException("Could not find Event with ID: " + eventid);
        }
        return event;
    }

    /**
     * Creates a new {@code Event} and marks the owner as confirmed.
     *
     * @param ownerid the owner of the event
     * @param eventName the name of the event
     * @param location the name of the location for the event
     * @param latitude the latitudinal location of the event
     * @param longitude the longitudinal location of the event
     * @param eventTime the time of the event
     * @return the created entity
     */
    @ApiMethod(
            name = "create",
            path = "event",
            httpMethod = ApiMethod.HttpMethod.POST)
    public Event create(
            @Named("ownerid") long ownerid,
            @Named("name") String eventName,
            @Named("location") String location,
            @Named("latitude") double latitude,
            @Named("longitude") double longitude,
            @Named("eventTime") long eventTime
    ) throws NotFoundException {
        User user = ofy().load().type(User.class).id(ownerid).now();
        if (user == null) {
            throw new NotFoundException("Could not find User with ID: " + ownerid);
        }

        long eventid = factory().allocateId(Event.class).getId();
        Event newEvent = new Event(
                eventid,
                ownerid,
                eventName,
                location,
                latitude,
                longitude,
                eventTime
        );
        ofy().save().entity(newEvent).now();
        user.addConfirmedEvent(newEvent.getEventid());
        ofy().save().entity(user).now();
        logger.info("Created Event " + eventid);
        return ofy().load().entity(newEvent).now();
    }

    /**
     * Updates an existing {@code Event}.
     *
     * @param eventid the id of the {@code Event} to update
     * @param eventName the name of the event
     * @param location the name of the location of the event
     * @param latitude the latitudinal location of the event
     * @param longitude the longitudinal location of the event
     * @param eventTime the time of the event
     * @return the updated version of the entity
     * @throws NotFoundException if the {@code eventid} does not correspond to an existing
     *          {@code Event}.
     */
    @ApiMethod(
            name = "update",
            path = "event/{eventid}",
            httpMethod = ApiMethod.HttpMethod.PUT)
    public Event update(
            @Named("eventid") long eventid,
            @Named("name") String eventName,
            @Named("location") String location,
            @Named("latitude") double latitude,
            @Named("longitude") double longitude,
            @Named("eventTime") long eventTime
    ) throws NotFoundException {
        Event event = ofy().load().type(Event.class).id(eventid).now();
        if (event == null) {
            throw new NotFoundException("Could not find Event with ID: " + eventid);
        }
        event.updateMetadata(eventName, location, latitude, longitude, eventTime);
        ofy().save().entity(event).now();
        logger.info("Updated Event: " + event);
        return ofy().load().entity(event).now();
    }

    /**
     * Adds a {@code User} to an {@code Event}'s invited list, and adds the event to the
     * {@code User}'s invited list.
     *
     * @param eventid the ID of the entity to be updated
     * @param userid the user to add
     * @return the updated version of the entity
     * @throws NotFoundException if the {@code eventid} does not correspond to an existing
     *                           {@code Event}
     */
    @ApiMethod(
            name = "inviteUser",
            path = "event/{eventid}/invite",
            httpMethod = ApiMethod.HttpMethod.PUT)
    public Event inviteUser(@Named("eventid") long eventid, @Named("userid") long userid) throws NotFoundException {
        Event event = ofy().load().type(Event.class).id(eventid).now();
        if (event == null) {
            throw new NotFoundException("Could not find Event with ID: " + eventid);
        }
        if (userid != event.getOwnerid()) {
            User user = ofy().load().type(User.class).id(userid).now();
            if (user == null) {
                throw new NotFoundException("Could not find User with ID: " + userid);
            }

            event.addInvitedUser(userid);
            user.addInvitedEvent(eventid);
            ofy().save().entity(event).now();
            ofy().save().entity(user).now();
            logger.info("Updated Event " + eventid + " + User " + userid);

            try {
                Sender sender = new Sender(MESSAGING_API_KEY);
                Message msg = new Message.Builder().addData("message", event.getOwnerid() + ";" + eventid).build();
                Result result = sender.send(msg, user.getRegid(), 5);

                if (result.getMessageId() != null) {
                    String canonicalRegId = result.getCanonicalRegistrationId();
                    if (canonicalRegId != null) {
                        // if the regId changed, we have to update the datastore
                        user.setRegid(canonicalRegId);
                        OfyService.ofy().save().entity(user).now();
                    }
                } else {
                    String error = result.getErrorCodeName();
                    if (error.equals(Constants.ERROR_NOT_REGISTERED)) {
                        logger.warning("Registration Id " + userid + " no longer registered with GCM");
                    } else {
                        logger.warning("Error when sending message : " + error);
                    }
                    throw new NotFoundException("Message Error");
                }
            } catch (Exception e) {
                logger.info("Unable to send push notification to " + userid);
                throw new NotFoundException("Message Exception: " + e.getMessage());
            }
        }
        return ofy().load().entity(event).now();
    }

    /**
     * Adds a {@code User} to an {@code Event}'s confirmed list, and adds the event to
     * the {@code User}'s confirmed events list.
     *
     * @param eventid the ID of the entity to be updated
     * @param userid the user to add
     * @return the updated version of the entity
     * @throws NotFoundException if the {@code eventid} does not correspond to an existing
     *                           {@code Event}
     */
    @ApiMethod(
            name = "confirmUser",
            path = "event/{eventid}/confirm",
            httpMethod = ApiMethod.HttpMethod.PUT)
    public Event confirmUser(@Named("eventid") long eventid, @Named("userid") long userid) throws NotFoundException {
        Event event = ofy().load().type(Event.class).id(eventid).now();
        if (event == null) {
            throw new NotFoundException("Could not find Event with ID: " + eventid);
        }
        if (userid != event.getOwnerid()) {
            User user = ofy().load().type(User.class).id(userid).now();
            if (user == null) {
                throw new NotFoundException("Could not find User with ID: " + userid);
            }

            event.addConfirmedUser(userid);
            user.addConfirmedEvent(eventid);
            ofy().save().entity(event).now();
            ofy().save().entity(user).now();
            logger.info("Updated Event " + eventid + " + User " + userid);
        }
        return ofy().load().entity(event).now();
    }

    /**
     * Marks the specified {@code User} as declining on the {@code Event}, and removes
     * the event from the {@code User}'s event lists
     *
     * @param eventid the ID of the event
     * @param userid the ID of the user declining
     * @throws NotFoundException if the {@code eventid} does not correspond to an existing
     *                           {@code Event}
     */
    @ApiMethod(
            name = "declineUser",
            path = "event/{eventid}/decline",
            httpMethod = ApiMethod.HttpMethod.PUT)
    public Event declineUser(@Named("eventid") long eventid, @Named("userid") long userid) throws NotFoundException {
        Event event = ofy().load().type(Event.class).id(eventid).now();
        if (event == null) {
            throw new NotFoundException("Could not find Event with ID: " + eventid);
        }
        if (userid != event.getOwnerid()) {
            User user = ofy().load().type(User.class).id(userid).now();
            if (user == null) {
                throw new NotFoundException("Could not find User with ID: " + userid);
            }

            event.addDeclinedUser(userid);
            user.removeEvent(eventid);
            ofy().save().entity(event).now();
            ofy().save().entity(user).now();
            logger.info("Updated Event " + eventid + " + User " + userid);
        }
        return ofy().load().entity(event).now();
    }

    /**
     * Deletes the specified {@code Event}.
     *
     * @param eventid the ID of the entity to delete
     * @throws NotFoundException if the {@code eventid} does not correspond to an existing
     *                           {@code Event}
     */
    @ApiMethod(
            name = "remove",
            path = "event/{eventid}",
            httpMethod = ApiMethod.HttpMethod.DELETE)
    public void remove(@Named("eventid") long eventid) throws NotFoundException {
        Event event = ofy().load().type(Event.class).id(eventid).now();
        if (event == null) {
            throw new NotFoundException("Could not find Event with ID: " + eventid);
        }

        // First remove the event from all users
        for (long userid : event.getInvitedGuests()) {
            User user = ofy().load().type(User.class).id(userid).now();
            user.removeEvent(eventid);
            ofy().save().entity(user).now();
        }
        for (long userid : event.getConfirmedGuests()) {
            User user = ofy().load().type(User.class).id(userid).now();
            user.removeEvent(eventid);
            ofy().save().entity(user).now();
        }

        ofy().delete().type(Event.class).id(eventid).now();
        logger.info("Deleted Event with ID: " + eventid);
    }
}


text:
@implementation KITestObject

@end


text:
module NewRelicAWS
  module Collectors
    class SQS < Base
      def queue_urls
        sqs = Aws::SQS::Resource.new(
          :access_key_id => @aws_access_key,
          :secret_access_key => @aws_secret_key,
          :region => @aws_region,
        )
	sqs.client.list_queues.queue_urls.map {|name| name.split("/").last}
      end

      def metric_list
        [
          ["NumberOfMessagesSent", "Sum", "Count"],
          ["SentMessageSize", "Average", "Bytes"],
          ["NumberOfMessagesReceived", "Sum", "Count"],
          ["NumberOfEmptyReceives", "Sum", "Count"],
          ["NumberOfMessagesDeleted", "Sum", "Count"],
          ["ApproximateNumberOfMessagesDelayed", "Average", "Count"],
          ["ApproximateNumberOfMessagesVisible", "Average", "Count"],
          ["ApproximateNumberOfMessagesNotVisible", "Average", "Count"]
        ]
      end

      def collect
        data_points = []
        queue_urls.each do |url|
          metric_list.each do |(metric_name, statistic, unit)|
            period = 300
            time_offset = 600 + @cloudwatch_delay
            data_point = get_data_point(
              :namespace   => "AWS/SQS",
              :metric_name => metric_name,
              :statistic   => statistic,
              :unit        => unit,
              :dimension   => {
                :name  => "QueueName",
                :value => url
              },
              :period => period,
              :start_time => (Time.now.utc - (time_offset + period)).iso8601,
              :end_time => (Time.now.utc - time_offset).iso8601
            )
            NewRelic::PlatformLogger.debug("metric_name: #{metric_name}, statistic: #{statistic}, unit: #{unit}, response: #{data_point.inspect}")
            unless data_point.nil?
              data_points << data_point
            end
          end
        end
        data_points
      end
    end
  end
end


text:
<?php
/**
 * @package WPSEO\Admin\Export
 */

/**
 * Class WPSEO_Export
 *
 * Class with functionality to export the WP SEO settings
 */
class WPSEO_Export {

	const ZIP_FILENAME = 'yoast-seo-settings-export.zip';
	const INI_FILENAME = 'settings.ini';

	const NONCE_ACTION = 'wpseo_export';
	const NONCE_NAME   = 'wpseo_export_nonce';

	/**
	 * @var string
	 */
	private $export = '';

	/**
	 * @var string
	 */
	private $error = '';

	/**
	 * @var string
	 */
	public $export_zip_url = '';

	/**
	 * @var boolean
	 */
	public $success;

	/**
	 * Whether or not the export will include taxonomy metadata
	 *
	 * @var boolean
	 */
	private $include_taxonomy;

	/**
	 * @var array
	 */
	private $dir = array();

	/**
	 * Class constructor
	 *
	 * @param boolean $include_taxonomy Whether to include the taxonomy metadata the plugin creates.
	 */
	public function __construct( $include_taxonomy = false ) {
		$this->include_taxonomy = $include_taxonomy;
		$this->dir              = wp_upload_dir();

		$this->export_settings();
	}

	/**
	 * Returns true when the property error has a value.
	 *
	 * @return bool
	 */
	public function has_error() {
		return ( $this->error !== '' );
	}

	/**
	 * Sets the error hook, to display the error to the user.
	 */
	public function set_error_hook() {
		$class   = 'notice notice-error';
		$message = sprintf( __( 'Error creating %1$s export: ', 'wordpress-seo' ), 'Yoast SEO' ) . $this->error;

		printf( '

%2$s

', $class, $message );
	}

	/**
	 * Exports the current site's WP SEO settings.
	 */
	private function export_settings() {

		$this->export_header();

		foreach ( WPSEO_Options::get_option_names() as $opt_group ) {
			$this->write_opt_group( $opt_group );
		}

		$this->taxonomy_metadata();

		if ( ! $this->write_settings_file() ) {
			$this->error = __( 'Could not write settings to file.', 'wordpress-seo' );

			return;
		}

		if ( $this->zip_file() ) {
			// Just exit, because there is a download being served.
			exit;
		}
	}

	/**
	 * Writes the header of the export file.
	 */
	private function export_header() {
		/* translators: %1$s expands to Yoast SEO */
		$this->write_line( '; ' . sprintf( __( 'This is a settings export file for the %1$s plugin by Yoast.com', 'wordpress-seo' ), 'Yoast SEO' ) . ' - https://yoast.com/wordpress/plugins/seo/' );
		if ( $this->include_taxonomy ) {
			$this->write_line( '; ' . __( 'This export includes taxonomy metadata', 'wordpress-seo' ) );
		}
	}

	/**
	 * Writes a line to the export
	 *
	 * @param string  $line          Line string.
	 * @param boolean $newline_first Boolean flag whether to prepend with new line.
	 */
	private function write_line( $line, $newline_first = false ) {
		if ( $newline_first ) {
			$this->export .= PHP_EOL;
		}
		$this->export .= $line . PHP_EOL;
	}

	/**
	 * Writes an entire option group to the export
	 *
	 * @param string $opt_group Option group name.
	 */
	private function write_opt_group( $opt_group ) {

		$this->write_line( '[' . $opt_group . ']', true );

		$options = get_option( $opt_group );

		if ( ! is_array( $options ) ) {
			return;
		}

		foreach ( $options as $key => $elem ) {
			if ( is_array( $elem ) ) {
				$count = count( $elem );
				for ( $i = 0; $i < $count; $i ++ ) {
					$this->write_setting( $key . '[]', $elem[ $i ] );
				}
			}
			else {
				$this->write_setting( $key, $elem );
			}
		}
	}

	/**
	 * Writes a settings line to the export
	 *
	 * @param string $key Key string.
	 * @param string $val Value string.
	 */
	private function write_setting( $key, $val ) {
		if ( is_string( $val ) ) {
			$val = '"' . $val . '"';
		}
		$this->write_line( $key . ' = ' . $val );
	}

	/**
	 * Adds the taxonomy meta data if there is any
	 */
	private function taxonomy_metadata() {
		if ( $this->include_taxonomy ) {
			$taxonomy_meta = get_option( 'wpseo_taxonomy_meta' );
			if ( is_array( $taxonomy_meta ) ) {
				$this->write_line( '[wpseo_taxonomy_meta]', true );
				$this->write_setting( 'wpseo_taxonomy_meta', urlencode( wp_json_encode( $taxonomy_meta ) ) );
			}
			else {
				$this->write_line( '; ' . __( 'No taxonomy metadata found', 'wordpress-seo' ), true );
			}
		}
	}

	/**
	 * Writes the settings to our temporary settings.ini file
	 *
	 * @return boolean unsigned
	 */
	private function write_settings_file() {
		$handle = fopen( $this->dir['path'] . '/' . self::INI_FILENAME, 'w' );
		if ( ! $handle ) {
			return false;
		}

		$res = fwrite( $handle, $this->export );
		if ( ! $res ) {
			return false;
		}

		fclose( $handle );

		return true;
	}

	/**
	 * Zips the settings ini file
	 *
	 * @return bool|null
	 */
	private function zip_file() {
		$is_zip_created = $this->create_zip();

		// The settings.ini isn't needed, because it's in the zipfile.
		$this->remove_settings_ini();

		if ( ! $is_zip_created ) {
			$this->error = __( 'Could not zip settings-file.', 'wordpress-seo' );

			return false;
		}

		$this->serve_settings_export();
		$this->remove_zip();

		return true;
	}

	/**
	 * Creates the zipfile and returns true if it created successful.
	 *
	 * @return bool
	 */
	private function create_zip() {
		chdir( $this->dir['path'] );
		$zip = new PclZip( './' . self::ZIP_FILENAME );
		if ( 0 === $zip->create( './' . self::INI_FILENAME ) ) {
			return false;
		}

		return file_exists( self::ZIP_FILENAME );
	}

	/**
	 * Downloads the zip file.
	 */
	private function serve_settings_export() {
		// Clean any content that has been already output. For example by other plugins or faulty PHP files.
		if ( ob_get_contents() ) {
			ob_clean();
		}
		header( 'Content-Type: application/octet-stream; charset=utf-8' );
		header( 'Content-Transfer-Encoding: Binary' );
		header( 'Content-Disposition: attachment; filename=' . self::ZIP_FILENAME );
		header( 'Content-Length: ' . filesize( self::ZIP_FILENAME ) );

		readfile( self::ZIP_FILENAME );
	}

	/**
	 * Removes the settings ini file.
	 */
	private function remove_settings_ini() {
		unlink( './' . self::INI_FILENAME );
	}

	/**
	 * Removes the files because they are already downloaded.
	 */
	private function remove_zip() {
		unlink( './' . self::ZIP_FILENAME );
	}
}