text:
package org.pentaho.di.job.entries.pig;

import java.io.File;
import java.io.PrintWriter;
import java.net.URL;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Properties;

import org.apache.log4j.Logger;
import org.apache.log4j.WriterAppender;
import org.pentaho.di.cluster.SlaveServer;
import org.pentaho.di.core.Const;
import org.pentaho.di.core.Result;
import org.pentaho.di.core.ResultFile;
import org.pentaho.di.core.annotations.JobEntry;
import org.pentaho.di.core.database.DatabaseMeta;
import org.pentaho.di.core.exception.KettleException;
import org.pentaho.di.core.exception.KettleXMLException;
import org.pentaho.di.core.hadoop.HadoopConfigurationBootstrap;
import org.pentaho.di.core.logging.Log4jFileAppender;
import org.pentaho.di.core.logging.Log4jKettleLayout;
import org.pentaho.di.core.logging.LogWriter;
import org.pentaho.di.core.xml.XMLHandler;
import org.pentaho.di.i18n.BaseMessages;
import org.pentaho.di.job.entry.JobEntryBase;
import org.pentaho.di.job.entry.JobEntryInterface;
import org.pentaho.di.repository.ObjectId;
import org.pentaho.di.repository.Repository;
import org.pentaho.hadoop.shim.HadoopConfiguration;
import org.pentaho.hadoop.shim.api.Configuration;
import org.pentaho.hadoop.shim.spi.HadoopShim;
import org.pentaho.hadoop.shim.spi.PigShim;
import org.pentaho.hadoop.shim.spi.PigShim.ExecutionMode;
import org.w3c.dom.Node;

/**
 * Job entry that executes a Pig script either on a hadoop cluster or
 * locally.
 *
 * @author Mark Hall (mhall{[at]}pentaho{[dot]}com)
 * @version $Revision$
 */
@JobEntry(id = "HadoopPigScriptExecutorPlugin", name = "Pig Script Executor", categoryDescription = "Big Data", description = "Execute Pig Scripts in Hadoop", image = "HDE.png")
public class JobEntryPigScriptExecutor extends JobEntryBase implements Cloneable, JobEntryInterface {

  private static Class<?> PKG = JobEntryPigScriptExecutor.class; // for i18n purposes, needed by Translator2!! $NON-NLS-1$

  /** Hostname of the job tracker */
  protected String m_jobTrackerHostname = "";

  /** Port that the job tracker is listening on */
  protected String m_jobTrackerPort = "";

  /** Name node hostname */
  protected String m_hdfsHostname = "";

  /** Port that the name node is listening on */
  protected String m_hdfsPort = "";

  /** URL to the pig script to execute */
  protected String m_scriptFile = "";

  /** True if the job entry should block until the script has executed */
  protected boolean m_enableBlocking;

  /** True if the script should execute locally, rather than on a hadoop cluster */
  protected boolean m_localExecution;

  /** Parameters for the script */
  protected HashMap<String, String> m_params = new HashMap<String, String>();

  /**
   * An extended PrintWriter that sends output to Kettle's logging
   *
   * @author Mark Hall (mhall{[at]}pentaho{[dot]}com)
   */
  class KettleLoggingPrintWriter extends PrintWriter {
    public KettleLoggingPrintWriter() {
      super(System.out);
    }

    public void println(String string) {
      logBasic(string);
    }

    public void println(Object obj) {
      println(obj.toString());
    }

    public void write(String string) {
      println(string);
    }

    public void print(String string) {
      println(string);
    }

    public void print(Object obj) {
      print(obj.toString());
    }
  }

  /* (non-Javadoc)
   * @see org.pentaho.di.job.entry.JobEntryBase#getXML()
   */
  public String getXML() {
    StringBuffer retval = new StringBuffer();
    retval.append(super.getXML());
    retval.append("    ").append(XMLHandler.addTagValue("hdfs_hostname", m_hdfsHostname));
    retval.append("    ").append(XMLHandler.addTagValue("hdfs_port", m_hdfsPort));
    retval.append("    ").append(XMLHandler.addTagValue("jobtracker_hostname", m_jobTrackerHostname));
    retval.append("    ").append(XMLHandler.addTagValue("jobtracker_port", m_jobTrackerPort));
    retval.append("    ").append(XMLHandler.addTagValue("script_file", m_scriptFile));
    retval.append("    ").append(XMLHandler.addTagValue("enable_blocking", m_enableBlocking));
    retval.append("    ").append(XMLHandler.addTagValue("local_execution", m_localExecution));

    retval.append("    <script_parameters>").append(Const.CR);
    if (m_params != null) {
      for (String name : m_params.keySet()) {
        String value = m_params.get(name);
        if (!Const.isEmpty(name) && !Const.isEmpty(value)) {
          retval.append("      <parameter>").append(Const.CR);
          retval.append("        ").append(XMLHandler.addTagValue("name", name));
          retval.append("        ").append(XMLHandler.addTagValue("value", value));
          retval.append("      </parameter>").append(Const.CR);
        }
      }
    }
    retval.append("    </script_parameters>").append(Const.CR);

    return retval.toString();
  }

  /* (non-Javadoc)
   * @see org.pentaho.di.job.entry.JobEntryInterface#loadXML(org.w3c.dom.Node, java.util.List, java.util.List, org.pentaho.di.repository.Repository)
   */
  public void loadXML(Node entrynode, List<DatabaseMeta> databases,
      List<SlaveServer> slaveServers, Repository repository) throws KettleXMLException {
    super.loadXML(entrynode, databases, slaveServers);

    m_hdfsHostname = XMLHandler.getTagValue(entrynode, "hdfs_hostname");
    m_hdfsPort = XMLHandler.getTagValue(entrynode, "hdfs_port");
    m_jobTrackerHostname = XMLHandler.getTagValue(entrynode, "jobtracker_hostname");
    m_jobTrackerPort = XMLHandler.getTagValue(entrynode, "jobtracker_port");
    m_scriptFile = XMLHandler.getTagValue(entrynode, "script_file");
    m_enableBlocking = XMLHandler.getTagValue(entrynode, "enable_blocking").equalsIgnoreCase("Y");
    m_localExecution = XMLHandler.getTagValue(entrynode, "local_execution").equalsIgnoreCase("Y");

    // Script parameters
    m_params = new HashMap<String, String>();
    Node paramList = XMLHandler.getSubNode(entrynode, "script_parameters");
    if (paramList != null) {
      int numParams = XMLHandler.countNodes(paramList, "parameter");
      for (int i = 0; i < numParams; i++) {
        Node paramNode = XMLHandler.getSubNodeByNr(paramList, "parameter", i);
        String name = XMLHandler.getTagValue(paramNode, "name");
        String value = XMLHandler.getTagValue(paramNode, "value");
        m_params.put(name, value);
      }
    }
  }

  /* (non-Javadoc)
   * @see org.pentaho.di.job.entry.JobEntryBase#loadRep(org.pentaho.di.repository.Repository, org.pentaho.di.repository.ObjectId, java.util.List, java.util.List)
   */
  public void loadRep(Repository rep, ObjectId id_jobentry,
      List<DatabaseMeta> databases, List<SlaveServer> slaveServers)
    throws KettleException {
    if (rep != null) {
      super.loadRep(rep, id_jobentry, databases, slaveServers);

      setHDFSHostname(rep.getJobEntryAttributeString(id_jobentry, "hdfs_hostname"));
      setHDFSPort(rep.getJobEntryAttributeString(id_jobentry, "hdfs_port"));
      setJobTrackerHostname(rep.getJobEntryAttributeString(id_jobentry, "jobtracker_hostname"));
      setJobTrackerPort(rep.getJobEntryAttributeString(id_jobentry, "jobtracker_port"));
      setScriptFilename(rep.getJobEntryAttributeString(id_jobentry, "script_file"));
      setEnableBlocking(rep.getJobEntryAttributeBoolean(id_jobentry, "enable_blocking"));
      setLocalExecution(rep.getJobEntryAttributeBoolean(id_jobentry, "local_execution"));

      // Script parameters
      m_params = new HashMap<String, String>();
      int numParams = rep.countNrJobEntryAttributes(id_jobentry, "param_name");
      if (numParams > 0) {
        for (int i = 0; i < numParams; i++) {
          String name = rep.getJobEntryAttributeString(id_jobentry, i, "param_name");
          String value = rep.getJobEntryAttributeString(id_jobentry, i, "param_value");
          m_params.put(name, value);
        }
      }
    } else {
      throw new KettleException("Unable to load from a repository. The repository is null.");
    }
  }

  /* (non-Javadoc)
   * @see org.pentaho.di.job.entry.JobEntryBase#saveRep(org.pentaho.di.repository.Repository, org.pentaho.di.repository.ObjectId)
   */
  public void saveRep(Repository rep, ObjectId id_job) throws KettleException {
    if (rep != null) {
      super.saveRep(rep, id_job);

      rep.saveJobEntryAttribute(id_job, getObjectId(), "hdfs_hostname", m_hdfsHostname);
      rep.saveJobEntryAttribute(id_job, getObjectId(), "hdfs_port", m_hdfsPort);
      rep.saveJobEntryAttribute(id_job, getObjectId(), "jobtracker_hostname", m_jobTrackerHostname);
      rep.saveJobEntryAttribute(id_job, getObjectId(), "jobtracker_port", m_jobTrackerPort);
      rep.saveJobEntryAttribute(id_job, getObjectId(), "script_file", m_scriptFile);
      rep.saveJobEntryAttribute(id_job, getObjectId(), "enable_blocking", m_enableBlocking);
      rep.saveJobEntryAttribute(id_job, getObjectId(), "local_execution", m_localExecution);

      if (m_params != null) {
        int i = 0;
        for (String name : m_params.keySet()) {
          String value = m_params.get(name);
          if (!Const.isEmpty(name) && !Const.isEmpty(value)) {
            rep.saveJobEntryAttribute(id_job, getObjectId(), i, "param_name", name);
            rep.saveJobEntryAttribute(id_job, getObjectId(), i, "param_value", value);
            i++;
          }
        }
      }
    } else {
      throw new KettleException("Unable to save to a repository. The repository is null.");
    }
  }

  /* (non-Javadoc)
   * @see org.pentaho.di.job.entry.JobEntryBase#evaluates()
   */
  public boolean evaluates() {
    return true;
  }

  /**
   * Get the job tracker host name
   *
   * @return the job tracker host name
   */
  public String getJobTrackerHostname() {
    return m_jobTrackerHostname;
  }

  /**
   * Set the job tracker host name
   *
   * @param jt the job tracker host name
   */
  public void setJobTrackerHostname(String jt) {
    m_jobTrackerHostname = jt;
  }

  /**
   * Get the job tracker port
   *
   * @return the job tracker port
   */
  public String getJobTrackerPort() {
    return m_jobTrackerPort;
  }

  /**
   * Set the job tracker port
   *
   * @param jp the job tracker port
   */
  public void setJobTrackerPort(String jp) {
    m_jobTrackerPort = jp;
  }

  /**
   * Get the HDFS host name
   *
   * @return the HDFS host name
   */
  public String getHDFSHostname() {
    return m_hdfsHostname;
  }

  /**
   * Set the HDFS host name
   *
   * @param nameN the HDFS host name
   */
  public void setHDFSHostname(String nameN) {
    m_hdfsHostname = nameN;
  }

  /**
   * Get the HDFS port
   *
   * @return the HDFS port
   */
  public String getHDFSPort() {
    return m_hdfsPort;
  }

  /**
   * Set the HDFS port
   *
   * @param p the HDFS port
   */
  public void setHDFSPort(String p) {
    m_hdfsPort = p;
  }

  /**
   * Get whether the job entry will block until the script finishes
   *
   * @return true if the job entry will block until the script finishes
   */
  public boolean getEnableBlocking() {
    return m_enableBlocking;
  }

  /**
   * Set whether the job will block until the script finishes
   *
   * @param block true if the job entry is to block until the script finishes
   */
  public void setEnableBlocking(boolean block) {
    m_enableBlocking = block;
  }

  /**
   * Set whether the script is to be run locally rather than on a hadoop
   * cluster
   *
   * @param l true if the script is to run locally
   */
  public void setLocalExecution(boolean l) {
    m_localExecution = l;
  }

  /**
   * Get whether the script is to run locally rather than on a hadoop
   * cluster
   *
   * @return true if the script is to run locally
   */
  public boolean getLocalExecution() {
    return m_localExecution;
  }

  /**
   * Set the URL to the pig script to run
   *
   * @param filename the URL to the pig script
   */
  public void setScriptFilename(String filename) {
    m_scriptFile = filename;
  }

  /**
   * Get the URL to the pig script to run
   *
   * @return the URL to the pig script to run
   */
  public String getScriptFilename() {
    return m_scriptFile;
  }

  /**
   * Set the values of parameters to replace in the script
   *
   * @param params a HashMap mapping parameter names to values
   */
  public void setScriptParameters(HashMap<String, String> params) {
    m_params = params;
  }

  /**
   * Get the values of parameters to replace in the script
   *
   * @return a HashMap mapping parameter names to values
   */
  public HashMap<String, String> getScriptParameters() {
    return m_params;
  }

  /* (non-Javadoc)
   * @see org.pentaho.di.job.entry.JobEntryInterface#execute(org.pentaho.di.core.Result, int)
   */
  public Result execute(final Result result, int arg1) throws KettleException {

    result.setNrErrors(0);

    // Set up an appender that will send all pig log messages to Kettle's log
    // via logBasic().
    KettleLoggingPrintWriter klps = new KettleLoggingPrintWriter();
    WriterAppender pigToKettleAppender = new WriterAppender(new Log4jKettleLayout(true), klps);

    Logger pigLogger = Logger.getLogger("org.apache.pig");
    Log4jFileAppender appender = null;
    String logFileName = "pdi-" + this.getName(); //$NON-NLS-1$
    LogWriter logWriter = LogWriter.getInstance();
    try {
      appender = LogWriter.createFileAppender(logFileName, true, false);
      logWriter.addAppender(appender);
      log.setLogLevel(parentJob.getLogLevel());
      if (pigLogger != null) {
        pigLogger.addAppender(pigToKettleAppender);
      }
    } catch (Exception e) {
      logError(BaseMessages.getString(PKG, "JobEntryPigScriptExecutor.FailedToOpenLogFile", logFileName, e.toString())); //$NON-NLS-1$
      logError(Const.getStackTracker(e));
    }

    if (Const.isEmpty(m_scriptFile)) {
      throw new KettleException(BaseMessages.getString(PKG,
          "JobEntryPigScriptExecutor.Error.NoPigScriptSpecified"));
    }

    try {
      URL scriptU = null;
      String scriptFileS = m_scriptFile;
      scriptFileS = environmentSubstitute(scriptFileS);
      if (scriptFileS.indexOf("://") == -1) {
        File scriptFile = new File(scriptFileS);
        scriptU = scriptFile.toURI().toURL();
      } else {
        scriptU = new URL(scriptFileS);
      }

      HadoopConfiguration active = HadoopConfigurationBootstrap.getHadoopConfigurationProvider().getActiveConfiguration();
      HadoopShim hadoopShim = active.getHadoopShim();
      final PigShim pigShim = active.getPigShim();
      // Make sure we can execute locally if desired
      if (m_localExecution && !pigShim.isLocalExecutionSupported()) {
        throw new KettleException(BaseMessages.getString(PKG,
            "JobEntryPigScriptExecutor.Warning.LocalExecution"));
      }

      // configure for connection to hadoop
      Configuration conf = hadoopShim.createConfiguration();
      if (!m_localExecution) {
        String hdfsHost = environmentSubstitute(m_hdfsHostname);
        String hdfsP = environmentSubstitute(m_hdfsPort);
        String jobTrackerHost = environmentSubstitute(m_jobTrackerHostname);
        String jobTP = environmentSubstitute(m_jobTrackerPort);

        List<String> configMessages = new ArrayList<String>();
        hadoopShim.configureConnectionInformation(hdfsHost, hdfsP,
            jobTrackerHost, jobTP, conf, configMessages);
        for (String m : configMessages) {
          logBasic(m);
        }
      }

      final Properties properties = new Properties();
      pigShim.configure(properties, m_localExecution ? null : conf);

      // transform the map type to list type which can been accepted by ParameterSubstitutionPreprocessor
      List<String> paramList = new ArrayList<String>();
      if (m_params != null){
        for (Map.Entry<String, String> entry : m_params.entrySet()) {
          String name = entry.getKey();
          name = environmentSubstitute(name); // do environment variable substitution
          String value = entry.getValue();
          value = environmentSubstitute(value); // do environment variable substitution
          paramList.add(name + "=" + value);
        }
      }

      final String pigScript = pigShim.substituteParameters(scriptU, paramList);
      final ExecutionMode execMode = (m_localExecution ? ExecutionMode.LOCAL : ExecutionMode.MAPREDUCE);

      if (m_enableBlocking) {
        int[] executionStatus = pigShim.executeScript(pigScript, execMode, properties);
        logBasic(BaseMessages.getString(PKG,
          "JobEntryPigScriptExecutor.JobCompletionStatus",
          "" + executionStatus[0], "" + executionStatus[1]));

        if (executionStatus[1] > 0) {
          result.setStopped(true);
          result.setNrErrors(executionStatus[1]);
          result.setResult(false);
        }

        removeAppender(appender, pigToKettleAppender);
        if (appender != null) {
          ResultFile resultFile = new ResultFile(ResultFile.FILE_TYPE_LOG, appender.getFile(), parentJob.getJobname(), getName());
          result.getResultFiles().put(resultFile.getFile().toString(), resultFile);
        }
      } else {
        final Log4jFileAppender fa = appender;
        final WriterAppender ptk = pigToKettleAppender;
        Thread runThread = new Thread() {
          public void run() {
            try {
              int[] executionStatus = pigShim.executeScript(pigScript, execMode, properties);
              logBasic(BaseMessages.getString(PKG,
                  "JobEntryPigScriptExecutor.JobCompletionStatus",
                  "" + executionStatus[0], "" + executionStatus[1]));
            } catch (Exception ex) {
              ex.printStackTrace();
              result.setStopped(true);
              result.setNrErrors(1);
              result.setResult(false);
            } finally {
              removeAppender(fa, ptk);
              if (fa != null) {
                ResultFile resultFile = new ResultFile(ResultFile.FILE_TYPE_LOG, fa.getFile(), parentJob.getJobname(), getName());
                result.getResultFiles().put(resultFile.getFile().toString(), resultFile);
              }
            }
          }
        };

        runThread.start();
      }
    } catch (Exception ex) {
      ex.printStackTrace();
      result.setStopped(true);
      result.setNrErrors(1);
      result.setResult(false);
      logError(ex.getMessage(), ex);
    }

    return result;
  }

  protected void removeAppender(Log4jFileAppender appender,
      WriterAppender pigToKettleAppender) {

    // remove the file appender from kettle logging
    if (appender != null) {
      LogWriter.getInstance().removeAppender(appender);
      appender.close();
    }

    Logger pigLogger = Logger.getLogger("org.apache.pig");
    if (pigLogger != null && pigToKettleAppender != null) {
      pigLogger.removeAppender(pigToKettleAppender);
      pigToKettleAppender.close();
    }
  }
}


text:
<?php //-->

class Eden_Twitter_Tests_Twitter_FavoritesTest extends \PHPUnit_Framework_TestCase
{
    public function setUp()
    {
        $this->consumerKey = '';
        $this->consumerSecret = '';

        $this->accessToken = '';
        $this->accessSecret = '';

        $this->id = '';
        $this->count = '1';
        $this->sinceId = '';
        $this->maxId = '';
        $this->page = '1';
    }

    public function testAddFavorites()
    {
        $favorites = eden('twitter')
            ->favorites($this->consumerKey, $this->consumerSecret, $this->accessToken, $this->accessSecret)
            ->addFavorites($this->id);
        $this->assertArrayHasKey('user', $favorites);
    }

    public function testGetList()
    {
        $list = eden('twitter')
            ->favorites($this->consumerKey, $this->consumerSecret, $this->accessToken, $this->accessSecret)
            ->getList();
        $this->assertArrayHasKey('user', $list[0]);
    }

    public function testRemove()
    {
        $remove = eden('twitter')
            ->favorites($this->consumerKey, $this->consumerSecret, $this->accessToken, $this->accessSecret)
            ->remove($this->id);
        $this->assertArrayHasKey('id', $remove);
    }

    public function testSetUserId()
    {
        $userId = eden('twitter')
            ->favorites($this->consumerKey, $this->consumerSecret, $this->accessToken, $this->accessSecret)
            ->setUserId($this->id);

        $this->assertObjectHasAttribute('query', $userId);
    }

    public function testSetCount()
    {
        $count = eden('twitter')
            ->favorites($this->consumerKey, $this->consumerSecret, $this->accessToken, $this->accessSecret)
            ->setCount($this->count);
        $this->assertObjectHasAttribute('query', $count);
    }

    public function testSetSinceId()
    {
        $since = eden('twitter')
            ->favorites($this->consumerKey, $this->consumerSecret, $this->accessToken, $this->accessSecret)
            ->setSinceId($this->sinceId);
        $this->assertObjectHasAttribute('query', $since);
    }

    public function testSetMaxId()
    {
        $max = eden('twitter')
            ->favorites($this->consumerKey, $this->consumerSecret, $this->accessToken, $this->accessSecret)
            ->setMaxId($this->maxId);
        $this->assertObjectHasAttribute('query', $max);
    }

    public function testSetPage()
    {
        $page = eden('twitter')
            ->favorites($this->consumerKey, $this->consumerSecret, $this->accessToken, $this->accessSecret)
            ->setPage($this->page);
        $this->assertObjectHasAttribute('query', $page);
    }

    public function testIncludeEntities()
    {
        $entities = eden('twitter')
            ->favorites($this->consumerKey, $this->consumerSecret, $this->accessToken, $this->accessSecret)
            ->includeEntities($this->count);
        $this->assertObjectHasAttribute('query', $entities);
    }
}

redpajama_set_name: RedPajamaGithub


text:
(function( $, undefined ) {
    $.KBWidget({
        name: "KBaseTomtomRunResultCard",
        parent: "kbaseWidget",
        version: "1.0.0",

        options: {
            id: null,
            ws: null,
            auth: null,
            userId: null,
            loadingImage: "assets/img/ajax-loader.gif",
            title: "TOMTOM Run Result Overview",
            isInCard: false,
            width: 400
        },

        newWorkspaceServiceUrl: "https://kbase.us/services/ws",//"http://140.221.84.209:7058/",

        init: function(options) {
            this._super(options);
            var self = this;

            if (this.options.id === null) {
                //throw an error
                return;
            }

            this.workspaceClient = new Workspace(this.newWorkspaceServiceUrl, { 'token' : this.options.auth, 'user_id' : this.options.userId});

            var container = $('
');
            this.$elem.append(container);

            this.tableLoading = $('

Loading...

');
            container.append(this.tableLoading);

            this.contentDiv = $('
');
            this.contentDiv.addClass('hide');
            container.append(this.contentDiv);

            this.workspaceClient.get_objects([{workspace: this.options.ws, name: this.options.id}],
	    		function(data){
					self.tomtomresult = data[0];
					var d = new Date(parseInt(self.tomtomresult.data.timestamp));
					var creationMonth = d.getMonth()+1;

                            self.contentDiv.append($("
").append("TOMTOM Run Info"));

                            self.contentDiv.append($("
").
                                    append($("
").addClass("invtable")
                                            .append($("
")
                                                    .append($("").append("Object name"))
                                                    .append($("").addClass("invtable-boldcell").append(self.tomtomresult.data.id)))
                                            .append($("
")
                                                    .append($("").append("Created"))
                                                    .append($("").addClass("invtable-cell").append(creationMonth +"/"+ d.getDate() +"/"+ d.getFullYear() +" "+ d.getHours() +":"+ d.getMinutes() +":"+ d.getSeconds())))
                                            .append($("
")
                                                    .append($("").append("Number of motifs"))
                                                    .append($("").addClass("invtable-boldcell").append(self.tomtomresult.data.hits.length)))
                                            ));

					self.$elem.append($("").append("
<button class='btn btn-default'>Show TOMTOM run parameters</button>")
	                	.on("click",
	                    	function(event) {
								self.trigger("showTomtomRunParameters", { tomtomresult: self.tomtomresult, event: event });
	                    })
	                );

			        self.$elem.append("
View hits
");
					self.$elem.append($("<button class='btn btn-default'>Show hit list</button>")
	                	.on("click",
	                    	function(event) {
								self.trigger("showTomtomHits", { tomtomresult: self.tomtomresult, event: event });
	                    })
	                );
                                self.loading(false);
			    },

			    function(data) {
                                self.contentDiv.remove();
                                self.loading(false);
                                self.$elem.append('
[Error] ' + data.error.message + '
');
                                return;
                            }
			);

            return this;
	        },

        loading: function(flag) {
            if (flag) {
                this.tableLoading.removeClass('hide');
                this.contentDiv.addClass('hide');
            } else {
                this.contentDiv.removeClass('hide');
                this.tableLoading.addClass('hide');
            }
        },

        getData: function() {
            return {
                type: "TomtomRunResult",
                id: this.options.id,
                workspace: this.options.ws,
                auth: this.options.auth,
                userId: this.options.userId,
                title: "TOMTOM Run Result Overview"
            };
        },

    });
})( jQuery );


text:
module RolesystemTestHelper
  def self.all_mock_roles
    ["admin", "staff", "editor", "host", "newshound", "content_editor"]
  end

  def add_roles
    RolesystemTestHelper.all_mock_roles.each do |rs|
      instance_variable_set("@#{rs}_role".to_sym, mock_model(Group, :name => rs.to_s.humanize, :context => 'role', :slug => rs, :add_member => true))
    end
    @group = mock_model(Group, :name => 'Watchdogs', :add_member => true)
  end

  def login_as(role)
    instance_variable_set("@#{role}".to_sym, MockMember.new(:roles => [instance_variable_get("@#{role}_role")]))
    @controller.stub!(:current_member).and_return(instance_variable_get("@#{role}"))
  end

  def check_access_restriction(failure_role, success_role)
    if block_given?
      login_as(failure_role)
      yield

      if request.format.to_sym == :js
        response.status.should == "401 Unauthorized"
      else
        response.should redirect_to(access_denied_path)
      end

      login_as success_role
      yield
    end
  end

  def should_be_admin_only(*args)
    check_access_restriction(args[0].blank? ? "editor" : args[0], "admin") { yield }
  end
end


text:
<?php

namespace Webiny\Component\Security\Token;

use Webiny\Component\Crypt\CryptTrait;
use Webiny\Component\Http\HttpTrait;
use Webiny\Component\Security\Role\Role;
use Webiny\Component\Security\Token\CryptDrivers\CryptDriverInterface;
use Webiny\Component\Security\User\AbstractUser;
use Webiny\Component\StdLib\StdLibTrait;

/**
 * Token storage abstract.
 * Every token storage class must extend this class.
 *
 * @package         Webiny\Component\Security\User\Token
 */
abstract class AbstractTokenStorage implements TokenStorageInterface
{
    use HttpTrait, CryptTrait, StdLibTrait;

    /**
     * Name of the token.
     * @var string
     */
    protected $tokenName;

    /**
     * Should token be remembered
     * @var bool
     */
    protected $tokenRememberMe;

    /**
     * Security key used for encrypting the token data.
     * @var string
     */
    protected $securityKey;

    /**
     * @var string Name of the crypt service.
     */
    protected $crypt;

    /**
     * This function provides the token name to the storage.
     *
     * @param string $tokenName Token name.
     */
    public function setTokenName($tokenName)
    {
        $this->tokenName = $tokenName;
    }

    /**
     * Get token name.
     *
     * @return string Token name.
     */
    public function getTokenName()
    {
        return $this->tokenName;
    }

    /**
     * This function provides the token 'remember me' flag to the storage.
     *
     * @param bool $rememberMe Token rememberme.
     */
    public function setTokenRememberMe($rememberMe){
        $this->tokenRememberMe = $rememberMe;
    }

    /**
     * Sets crypt driver instance.
     *
     * @param CryptDriverInterface $crypt Name of the crypt service.
     */
    public function setCrypt(CryptDriverInterface $crypt)
    {
        $this->crypt = $crypt;
    }

    /**
     * Returns the crypt driver instance.
     *
     * @return CryptDriverInterface
     */
    public function getCrypt()
    {
        return $this->crypt;
    }

    /**
     * Stores user data into an array, encrypts it and returns the encrypted string.
     *
     * @param AbstractUser $user Instance of AbstractUser class that holds the pre-filled object from user provider.
     *
     * @return string
     */
    public function encryptUserData(AbstractUser $user)
    {
        // extract the roles
        $roles = $user->getRoles();
        $roleArray = [];
        foreach($roles as $r){
            $roleArray[] = $r->getRole();
        }

        // data (we use short syntax to reduce the size of the cookie or session)
        $data = [
            // username
            'u'   => $user->getUsername(),
            // roles
            'r'   => $roleArray,
            // valid until
            'vu'  => time() + (86400 * 30),
            // session id
            'sid' => $this->httpSession()->getSessionId(),
            // auth provider driver
            'ap'  => $user->getAuthProviderName()
        ];

        // build and add token to $data
        return $this->getCrypt()->encrypt($this->jsonEncode($data), $this->getEncryptionKey());
    }

    /**
     * Decrypts the provided $tokenData, unserializes the string, creates an instance of TokenData and validates it.
     * If TokenData is valid, its instance is returned, otherwise false is returned.
     *
     * @param string $tokenData Encrypted data.
     *
     * @return TokenData|bool
     * @throws TokenException
     */
    public function decryptUserData($tokenData)
    {
        // decrypt token data
        try {
            $data = $this->getCrypt()->decrypt($tokenData, $this->getEncryptionKey());
            $data = $this->jsonDecode($data, true);
        } catch (\Exception $e) {
            $this->deleteUserToken();

            return false;
        }

        // validate token data
        if (!isset($data['u']) || !isset($data['r']) || !isset($data['vu']) || !isset($data['sid']) || !isset($data['ap'])
        ) {
            $this->deleteUserToken();

            return false;
        }

        // validate sid
        if ($this->httpSession()->getSessionId() != $data['sid']) {
            $this->deleteUserToken();

            return false;
        }

        // check that token data is still valid
        if ($this->datetime()->setTimestamp($data['vu'])->isPast()) {
            $this->deleteUserToken();

            return false;
        }

        // recreate the roles
        $roles = [];
        foreach($data['r'] as $role){
            $roles[] = new Role($role);
        }
        $data['r'] = $roles;

        // return TokenData instance
        return new TokenData($data);
    }

    /**
     * Sets the security key that will be used for encryption of token data.
     *
     * @param string $securityKey Must have 16/32/64 chars.
     */
    public function setSecurityKey($securityKey)
    {
        $this->securityKey = $securityKey;
    }

    /**
     * Uses the current key, user session id and browser user agent, to form a new key.
     * The new key is then unique to that user, and is used for encryption/decryption process.
     *
     * @return string
     */
    public function getEncryptionKey()
    {
        // initial key
        $securityKey = $this->securityKey;

        // append current session id
        $securityKey .= $this->httpSession()->getSessionId();

        // hash and return
        return hash('sha512', $securityKey);
    }
}


text:
package spotify

import (
	"encoding/json"
	"errors"
	"fmt"
	"net/http"
	"strings"
)

// UserHasTracks checks if one or more tracks are saved to the current user's
// "Your Music" library.  This call requires authorization.
func (c *Client) UserHasTracks(ids ...ID) ([]bool, error) {
	if l := len(ids); l == 0 || l > 50 {
		return nil, errors.New("spotify: UserHasTracks supports 1 to 50 IDs per call")
	}
	spotifyURL := fmt.Sprintf("%sme/tracks/contains?ids=%s", baseAddress, strings.Join(toStringSlice(ids), ","))
	resp, err := c.http.Get(spotifyURL)
	if err != nil {
		return nil, err
	}
	defer resp.Body.Close()
	if resp.StatusCode != http.StatusOK {
		return nil, decodeError(resp.Body)
	}
	var result []bool
	err = json.NewDecoder(resp.Body).Decode(&result)
	return result, err
}

// AddTracksToLibrary saves one or more tracks to the current user's
// "Your Music" library.  This call requires authorization (the
// ScopeUserLibraryModify scope).
// A track can only be saved once; duplicate IDs are ignored.
func (c *Client) AddTracksToLibrary(ids ...ID) error {
	return c.modifyLibraryTracks(true, ids...)
}

// RemoveTracksFromLibrary removes one or more tracks from the current user's
// "Your Music" library.  This call requires authorization (the ScopeUserModifyLibrary
// scope).  Trying to remove a track when you do not have the user's authorization
// results in a `spotify.Error` with the status code set to http.StatusUnauthorized.
func (c *Client) RemoveTracksFromLibrary(ids ...ID) error {
	return c.modifyLibraryTracks(false, ids...)
}

func (c *Client) modifyLibraryTracks(add bool, ids ...ID) error {
	if l := len(ids); l == 0 || l > 50 {
		return errors.New("spotify: this call supports 1 to 50 IDs per call")
	}
	spotifyURL := fmt.Sprintf("%sme/tracks?ids=%s", baseAddress, strings.Join(toStringSlice(ids), ","))
	method := "DELETE"
	if add {
		method = "PUT"
	}
	req, err := http.NewRequest(method, spotifyURL, nil)
	if err != nil {
		return err
	}
	resp, err := c.http.Do(req)
	if err != nil {
		return err
	}
	defer resp.Body.Close()
	if resp.StatusCode != http.StatusOK {
		return decodeError(resp.Body)
	}
	return nil
}


text:
local PEER_EVASIVE       = 3000   --  3 seconds' silence is evasive
local PEER_EXPIRED       = 5000   --  5 seconds' silence is expired
local REAP_INTERVAL      = 1000   --  Once per second
---------------------------------------------------------------------

local zmq      = require "lzmq"
local ztimer   = require "lzmq.timer"
local zthreads = require "lzmq.threads"
local UUID     = require "lyre.impl.uuid"
local utils    = require "lyre.impl.utils"
local ZRE      = require "lyre.zre"
local bit      = utils.bit

---------------------------------------------------------------------
local Peer = {} do
Peer.__index = Peer

function Peer:new(node, uuid)
  local o = setmetatable({}, self)
  uuid = UUID.new(uuid)
  o._private = {
    node          = node;
    uuid          = uuid;
    name          = uuid:str():sub(1, 6);
    version       = ZRE.VERSION;
    sent_sequence = 0;
    want_sequence = 1;
    status        = 1;
    headers       = {};
  }
  return o
end

function Peer:connect(node_uuid, endpoint)
  assert(not self:connected())
  local ctx = zmq.assert(zthreads.context())

  local mailbox, err = ctx:socket{zmq.DEALER,
    identity = '\001' .. node_uuid;
    sndhwm   = PEER_EXPIRED * 100;
    sndtimeo = 0;
    connect  = endpoint;
  }
  if not mailbox then return nil, err end

  self._private.mailbox    = mailbox;
  self._private.endpoint   = endpoint;
  self._private.evasive_at = ztimer.monotonic():start(PEER_EVASIVE)
  self._private.expired_at = ztimer.monotonic():start(PEER_EXPIRED)

  return self
end

function Peer:refresh()
  self._private.evasive_at:start()
  self._private.expired_at:start()
end

function Peer:evasive()
  return self._private.evasive_at:rest() == 0
end

function Peer:expire()
  return self._private.expired_at:rest() == 0
end

function Peer:send(msg)
  local ok, err = msg:send(self, self._private.mailbox)
  if not ok then
    if err:mnemo() == 'EAGAIN' then
      self._private.node:remove_peer(self):disconnect()
      return nil, err
    end
    zmq.assert(nil, err)
  end

  return true
end

function Peer:endpoint()
  return self._private.endpoint or ""
end

function Peer:version()
  return self._private.version
end

function Peer:next_sent_sequence(i)
  local p = self._private
  p.sent_sequence = bit.band(p.sent_sequence + (i or 1), 0xFFFF)
  return p.sent_sequence
end

function Peer:next_want_sequence(i)
  local p = self._private
  p.want_sequence = bit.band(p.want_sequence + (i or 1), 0xFFFF)
  return p.want_sequence
end

function Peer:status()
  return self._private.status
end

function Peer:set_status(v)
  self._private.status = v
  return self
end

function Peer:inc_status(i)
  local p = self._private
  p.status = bit.band(p.status + (i or 1), 0xFF)
  return p.status
end

function Peer:ready()
  return not not self._private.ready
end

function Peer:set_ready(v)
  self._private.ready = v
end

function Peer:connected()
  return not not self._private.mailbox
end

function Peer:name()
  return self._private.name
end

function Peer:set_name(name)
  self._private.name = name
  return self
end

function Peer:uuid(as_str)
  if as_str then return self._private.uuid:str() end
  return self._private.uuid:bin()
end

function Peer:headers()
  return self._private.headers
end

function Peer:set_header(k, v)
  self._private.headers[k] = v
  return self
end

function Peer:header(k)
  return self._private.headers[k]
end

function Peer:disconnect()
  if self:connected() then
    local p = self._private
    p.mailbox:close()
    p.mailbox, p.endpoint, p.ready = nil
  end
end

end
---------------------------------------------------------------------

return {
  new = function(...) return Peer:new(...) end;
}


text:
$(document).ready(function(){
    var baseURL = $('#base_url').val();
	var assetURL = $('#asset_url').val();

	/*
	SIGNUP FOR PROFESSORS
	*/
	$('#signup_prof').on('submit', function(e) {

		var creds = $(this).serialize();

		 $.ajax({
			 type: "POST",
			 url:  baseURL+'professors/add_professor',
			 dataType: 'json',
			 data: creds,
			 success: function(data) {
			 	if( data.added ) {

					 $('#banner-prof').html("  You have successfully created a new account. Please login to continue.");
				} else {

					 $('#banner-prof').html(" Please provide necessary inputs to create an account.");

				}
			 }
		});

		e.preventDefault();
	});

	/*
	LOGIN FOR PROFESSORS
	*/
	  $("#prof_log").on('submit',function(e) {

		 var creds = $(this).serialize();

		 $.ajax({
			 type: "POST",
			 url:  baseURL+'professors/login',
			 dataType: 'json',
			 data: creds,
			 success: function(data) {
			 	if( data.prof ) {

					window.location.href = baseURL+'professors/home';

				} else {

					 $('#banner-prof').html(" Wrong username or password");

				}
			 }
		});
		 	e.preventDefault();
	 });

	 /*
	RELOAD Profile Picture fro database
	*/

	 function reloadPicProf() {

	 	  $.ajax({
			 type: "GET",
			 url:  baseURL+'professors/get_profile_picture',
			 success: function(data) {
			 	$('#profile-picture').attr('src', baseURL+'assets/uploads/' + data['img']);
			 }
		});

	 };

	reloadPicProf();

	/*=====UPDATING CREDS=======*/

	/*
	UPDATE NAME
	*/
	$('#update_prof_name').on('submit', function(e) {
		var creds = $(this).serialize();

		 $.ajax({
			 type: "POST",
			 url:  baseURL+'professors/update_name',
			 dataType: 'json',
			 data: creds,
			 success: function(data) {
			 	if( data.updated ) {
					 $('#banner-prof-name').html("  You have updated you name");
					 nameForm.delay(1500).slideUp();
				} else {

					 $('#banner-prof-name').html(" Your name hasn't been updated");

				}
			 }
		});

		e.preventDefault();
	});

	/*
	UPDATE USERNAME
	*/
	$('#update_prof_username').on('submit', function(e) {
		var creds = $(this).serialize();

		 $.ajax({
			 type: "POST",
			 url:  baseURL+'professors/update_username',
			 dataType: 'json',
			 data: creds,
			 success: function(data) {
			 	if( data.updated ) {
					 $('#banner-prof-usrn').html("  You have updated your username");
					 usernForm.delay(1500).slideUp();
				} else {

					 $('#banner-prof-usrn').html(" Your username hasn't been updated");

				}
			 }
		});

		e.preventDefault();
	});

	/*UPDATE EMAIL*/
	$('#update_prof_email').on('submit', function(e) {
		var creds = $(this).serialize();

		 $.ajax({
			 type: "POST",
			 url:  baseURL+'professors/update_email',
			 dataType: 'json',
			 data: creds,
			 success: function(data) {
			 	if( data.updated ) {
					 $('#banner-prof-email').html("  You have updated your email");
					 emailForm.delay(1500).slideUp();
				} else {

					 $('#banner-prof-email').html(" Your email hasn't been updated");

				}
			 }
		});

		e.preventDefault();
	});

	/*UPDATE ABOUT*/
	$('#update_prof_about').on('submit', function(e) {
		var creds = $(this).serialize();

		 $.ajax({
			 type: "POST",
			 url:  baseURL+'professors/update_about',
			 dataType: 'json',
			 data: creds,
			 success: function(data) {
			 	if( data.updated ) {
					 $('#banner-prof-about').html("  You have updated your email");
					 emailForm.delay(1500).slideUp();
				} else {

					 $('#banner-prof-about').html(" Your email hasn't been updated");

				}
			 }
		});

		e.preventDefault();
	});

	/*UPDATE COURSE*/
	$('#update_prof_dept').on('submit', function(e) {
		var creds = $(this).serialize();

		 $.ajax({
			 type: "POST",
			 url:  baseURL+'professors/update_dept',
			 dataType: 'json',
			 data: creds,
			 success: function(data) {
			 	if( data.updated ) {
					 $('#banner-prof-dept').html("  You have updated your course");
					 courseForm.delay(1500).slideUp();
				} else {

					 $('#banner-prof-dept').html(" Your course hasn't been updated");

				}
			 }
		});

		e.preventDefault();
	});

	  /*
		Add new schedule
	  */

	  	$('#new-schedule').on('submit', function(e) {

		var creds = $(this).serialize();

		 $.ajax({
			 type: "POST",
			 url:  baseURL+'professors/add_schedule',
			 dataType: 'json',
			 data: creds,
			 success: function(data) {
			 	if( data.added ) {
		 			$('#sched-banner').text("Added new Schedule");
		 		} else {
		 			$('#sched-banner').text("Schedule already exist").delay(1500).slideUp(1500);
		 		}

		 		$("#new-schedule")[0].reset();

			 }
		});

		e.preventDefault();
	});

	 /*====================== LOAD SCHEDULES =======================*/
	(function(){
		 function loadSchedules() {
	 	 var contents = "";
	 	  $.ajax({
			 type: "GET",
			 url:  baseURL+'professors/get_schedules',
			 success: function(data) {
			 	if(data.length == 0) {
			 		contents = '

  No Schedules for today.

';
			 		$('#schedule-list').html(contents);
			 	} else {
			 		 $('#schedule-list').append(
			 		 	`

								Room
								Time

`
			 		 	);

			 		 $.each(data, function(index){
			 			contents += `

										`+data[index]['room']+`
										`+data[index]['f_from_time']+ ' '  + ' - ' + data[index]['to_time'] + ' '  +`

`;
			 		});

			 	}

			 	 $('#current-schedule').html(contents);
	 			 $('.loading-sched').hide();
			 }
		});

	 };

	 loadSchedules();
	}());

	/*====================== Search Requests ====================*/
	 (function(){

	 	let searchContainer = $('#search-results');

	 	searchContainer.hide();

	 	$('#search-student').keyup(function(){
	 		$.ajax({
				 type: "GET",
				 url:  baseURL+'professors/get_search_result/'+$('#search-student').val(),
				 success: function(data) {
				 	if( data ) {
				 		// show results
				 		searchContainer.slideDown(400);

				 		var resultString = "";

				 		data.forEach(function(value, index) {

				 			resultString += "
";
					 		resultString += "	";
					 		resultString += `

`+value.name+`

					 							<a href="`+baseURL+"professors/message/"+value.stud_id+`">  Message
					 					    	`;
					 		resultString += "
";
				 		});

				 		searchContainer.html(resultString);

				 	}

				 }
	 		});

	 		// Hide when search is empty
	 		function hideSearchResults() {
	 			if($('#search-student').val() == "") {
	 				searchContainer.slideUp(400);
	 			}
		 	}

		 	setTimeout(hideSearchResults, 100);

	 	});

	 }());

});


text:
package k8sutil

import (
	"strings"
	"testing"

	"github.com/zalando/postgres-operator/pkg/util/constants"

	v1 "k8s.io/api/core/v1"
)

func newsService(ann map[string]string, svcT v1.ServiceType, lbSr []string) *v1.Service {
	svc := &v1.Service{
		Spec: v1.ServiceSpec{
			Type:                     svcT,
			LoadBalancerSourceRanges: lbSr,
		},
	}
	svc.Annotations = ann
	return svc
}

func TestSameService(t *testing.T) {
	tests := []struct {
		about   string
		current *v1.Service
		new     *v1.Service
		reason  string
		match   bool
	}{
		{
			about: "two equal services",
			current: newsService(
				map[string]string{
					constants.ZalandoDNSNameAnnotation: "clstr.acid.zalan.do",
					constants.ElbTimeoutAnnotationName: constants.ElbTimeoutAnnotationValue,
				},
				v1.ServiceTypeClusterIP,
				[]string{"128.141.0.0/16", "137.138.0.0/16"}),
			new: newsService(
				map[string]string{
					constants.ZalandoDNSNameAnnotation: "clstr.acid.zalan.do",
					constants.ElbTimeoutAnnotationName: constants.ElbTimeoutAnnotationValue,
				},
				v1.ServiceTypeClusterIP,
				[]string{"128.141.0.0/16", "137.138.0.0/16"}),
			match: true,
		},
		{
			about: "services differ on service type",
			current: newsService(
				map[string]string{
					constants.ZalandoDNSNameAnnotation: "clstr.acid.zalan.do",
					constants.ElbTimeoutAnnotationName: constants.ElbTimeoutAnnotationValue,
				},
				v1.ServiceTypeClusterIP,
				[]string{"128.141.0.0/16", "137.138.0.0/16"}),
			new: newsService(
				map[string]string{
					constants.ZalandoDNSNameAnnotation: "clstr.acid.zalan.do",
					constants.ElbTimeoutAnnotationName: constants.ElbTimeoutAnnotationValue,
				},
				v1.ServiceTypeLoadBalancer,
				[]string{"128.141.0.0/16", "137.138.0.0/16"}),
			match:  false,
			reason: `new service's type "LoadBalancer" does not match the current one "ClusterIP"`,
		},
		{
			about: "services differ on lb source ranges",
			current: newsService(
				map[string]string{
					constants.ZalandoDNSNameAnnotation: "clstr.acid.zalan.do",
					constants.ElbTimeoutAnnotationName: constants.ElbTimeoutAnnotationValue,
				},
				v1.ServiceTypeLoadBalancer,
				[]string{"128.141.0.0/16", "137.138.0.0/16"}),
			new: newsService(
				map[string]string{
					constants.ZalandoDNSNameAnnotation: "clstr.acid.zalan.do",
					constants.ElbTimeoutAnnotationName: constants.ElbTimeoutAnnotationValue,
				},
				v1.ServiceTypeLoadBalancer,
				[]string{"185.249.56.0/22"}),
			match:  false,
			reason: `new service's LoadBalancerSourceRange does not match the current one`,
		},
		{
			about: "new service doesn't have lb source ranges",
			current: newsService(
				map[string]string{
					constants.ZalandoDNSNameAnnotation: "clstr.acid.zalan.do",
					constants.ElbTimeoutAnnotationName: constants.ElbTimeoutAnnotationValue,
				},
				v1.ServiceTypeLoadBalancer,
				[]string{"128.141.0.0/16", "137.138.0.0/16"}),
			new: newsService(
				map[string]string{
					constants.ZalandoDNSNameAnnotation: "clstr.acid.zalan.do",
					constants.ElbTimeoutAnnotationName: constants.ElbTimeoutAnnotationValue,
				},
				v1.ServiceTypeLoadBalancer,
				[]string{}),
			match:  false,
			reason: `new service's LoadBalancerSourceRange does not match the current one`,
		},
		{
			about: "services differ on DNS annotation",
			current: newsService(
				map[string]string{
					constants.ZalandoDNSNameAnnotation: "clstr.acid.zalan.do",
					constants.ElbTimeoutAnnotationName: constants.ElbTimeoutAnnotationValue,
				},
				v1.ServiceTypeLoadBalancer,
				[]string{"128.141.0.0/16", "137.138.0.0/16"}),
			new: newsService(
				map[string]string{
					constants.ZalandoDNSNameAnnotation: "new_clstr.acid.zalan.do",
					constants.ElbTimeoutAnnotationName: constants.ElbTimeoutAnnotationValue,
				},
				v1.ServiceTypeLoadBalancer,
				[]string{"128.141.0.0/16", "137.138.0.0/16"}),
			match:  false,
			reason: `new service's annotations does not match the current one: 'external-dns.alpha.kubernetes.io/hostname' changed from 'clstr.acid.zalan.do' to 'new_clstr.acid.zalan.do'.`,
		},
		{
			about: "services differ on AWS ELB annotation",
			current: newsService(
				map[string]string{
					constants.ZalandoDNSNameAnnotation: "clstr.acid.zalan.do",
					constants.ElbTimeoutAnnotationName: constants.ElbTimeoutAnnotationValue,
				},
				v1.ServiceTypeLoadBalancer,
				[]string{"128.141.0.0/16", "137.138.0.0/16"}),
			new: newsService(
				map[string]string{
					constants.ZalandoDNSNameAnnotation: "clstr.acid.zalan.do",
					constants.ElbTimeoutAnnotationName: "1800",
				},
				v1.ServiceTypeLoadBalancer,
				[]string{"128.141.0.0/16", "137.138.0.0/16"}),
			match:  false,
			reason: `new service's annotations does not match the current one: 'service.beta.kubernetes.io/aws-load-balancer-connection-idle-timeout' changed from '3600' to '1800'.`,
		},
		{
			about: "service changes existing annotation",
			current: newsService(
				map[string]string{
					constants.ZalandoDNSNameAnnotation: "clstr.acid.zalan.do",
					constants.ElbTimeoutAnnotationName: constants.ElbTimeoutAnnotationValue,
					"foo":                              "bar",
				},
				v1.ServiceTypeLoadBalancer,
				[]string{"128.141.0.0/16", "137.138.0.0/16"}),
			new: newsService(
				map[string]string{
					constants.ZalandoDNSNameAnnotation: "clstr.acid.zalan.do",
					constants.ElbTimeoutAnnotationName: constants.ElbTimeoutAnnotationValue,
					"foo":                              "baz",
				},
				v1.ServiceTypeLoadBalancer,
				[]string{"128.141.0.0/16", "137.138.0.0/16"}),
			match:  false,
			reason: `new service's annotations does not match the current one: 'foo' changed from 'bar' to 'baz'.`,
		},
		{
			about: "service changes multiple existing annotations",
			current: newsService(
				map[string]string{
					constants.ZalandoDNSNameAnnotation: "clstr.acid.zalan.do",
					constants.ElbTimeoutAnnotationName: constants.ElbTimeoutAnnotationValue,
					"foo":                              "bar",
					"bar":                              "foo",
				},
				v1.ServiceTypeLoadBalancer,
				[]string{"128.141.0.0/16", "137.138.0.0/16"}),
			new: newsService(
				map[string]string{
					constants.ZalandoDNSNameAnnotation: "clstr.acid.zalan.do",
					constants.ElbTimeoutAnnotationName: constants.ElbTimeoutAnnotationValue,
					"foo":                              "baz",
					"bar":                              "fooz",
				},
				v1.ServiceTypeLoadBalancer,
				[]string{"128.141.0.0/16", "137.138.0.0/16"}),
			match: false,
			// Test just the prefix to avoid flakiness and map sorting
			reason: `new service's annotations does not match the current one:`,
		},
		{
			about: "service adds a new custom annotation",
			current: newsService(
				map[string]string{
					constants.ZalandoDNSNameAnnotation: "clstr.acid.zalan.do",
					constants.ElbTimeoutAnnotationName: constants.ElbTimeoutAnnotationValue,
				},
				v1.ServiceTypeLoadBalancer,
				[]string{"128.141.0.0/16", "137.138.0.0/16"}),
			new: newsService(
				map[string]string{
					constants.ZalandoDNSNameAnnotation: "clstr.acid.zalan.do",
					constants.ElbTimeoutAnnotationName: constants.ElbTimeoutAnnotationValue,
					"foo":                              "bar",
				},
				v1.ServiceTypeLoadBalancer,
				[]string{"128.141.0.0/16", "137.138.0.0/16"}),
			match:  false,
			reason: `new service's annotations does not match the current one: Added 'foo' with value 'bar'.`,
		},
		{
			about: "service removes a custom annotation",
			current: newsService(
				map[string]string{
					constants.ZalandoDNSNameAnnotation: "clstr.acid.zalan.do",
					constants.ElbTimeoutAnnotationName: constants.ElbTimeoutAnnotationValue,
					"foo":                              "bar",
				},
				v1.ServiceTypeLoadBalancer,
				[]string{"128.141.0.0/16", "137.138.0.0/16"}),
			new: newsService(
				map[string]string{
					constants.ZalandoDNSNameAnnotation: "clstr.acid.zalan.do",
					constants.ElbTimeoutAnnotationName: constants.ElbTimeoutAnnotationValue,
				},
				v1.ServiceTypeLoadBalancer,
				[]string{"128.141.0.0/16", "137.138.0.0/16"}),
			match:  false,
			reason: `new service's annotations does not match the current one: Removed 'foo'.`,
		},
		{
			about: "service removes a custom annotation and adds a new one",
			current: newsService(
				map[string]string{
					constants.ZalandoDNSNameAnnotation: "clstr.acid.zalan.do",
					constants.ElbTimeoutAnnotationName: constants.ElbTimeoutAnnotationValue,
					"foo":                              "bar",
				},
				v1.ServiceTypeLoadBalancer,
				[]string{"128.141.0.0/16", "137.138.0.0/16"}),
			new: newsService(
				map[string]string{
					constants.ZalandoDNSNameAnnotation: "clstr.acid.zalan.do",
					constants.ElbTimeoutAnnotationName: constants.ElbTimeoutAnnotationValue,
					"bar":                              "foo",
				},
				v1.ServiceTypeLoadBalancer,
				[]string{"128.141.0.0/16", "137.138.0.0/16"}),
			match:  false,
			reason: `new service's annotations does not match the current one: Removed 'foo'. Added 'bar' with value 'foo'.`,
		},
		{
			about: "service removes a custom annotation, adds a new one and change another",
			current: newsService(
				map[string]string{
					constants.ZalandoDNSNameAnnotation: "clstr.acid.zalan.do",
					constants.ElbTimeoutAnnotationName: constants.ElbTimeoutAnnotationValue,
					"foo":                              "bar",
					"zalan":                            "do",
				},
				v1.ServiceTypeLoadBalancer,
				[]string{"128.141.0.0/16", "137.138.0.0/16"}),
			new: newsService(
				map[string]string{
					constants.ZalandoDNSNameAnnotation: "clstr.acid.zalan.do",
					constants.ElbTimeoutAnnotationName: constants.ElbTimeoutAnnotationValue,
					"bar":                              "foo",
					"zalan":                            "do.com",
				},
				v1.ServiceTypeLoadBalancer,
				[]string{"128.141.0.0/16", "137.138.0.0/16"}),
			match: false,
			// Test just the prefix to avoid flakiness and map sorting
			reason: `new service's annotations does not match the current one: Removed 'foo'.`,
		},
		{
			about: "service add annotations",
			current: newsService(
				map[string]string{},
				v1.ServiceTypeLoadBalancer,
				[]string{"128.141.0.0/16", "137.138.0.0/16"}),
			new: newsService(
				map[string]string{
					constants.ZalandoDNSNameAnnotation: "clstr.acid.zalan.do",
					constants.ElbTimeoutAnnotationName: constants.ElbTimeoutAnnotationValue,
				},
				v1.ServiceTypeLoadBalancer,
				[]string{"128.141.0.0/16", "137.138.0.0/16"}),
			match: false,
			// Test just the prefix to avoid flakiness and map sorting
			reason: `new service's annotations does not match the current one: Added `,
		},
	}
	for _, tt := range tests {
		t.Run(tt.about, func(t *testing.T) {
			match, reason := SameService(tt.current, tt.new)
			if match && !tt.match {
				t.Errorf("expected services to do not match: '%q' and '%q'", tt.current, tt.new)
				return
			}
			if !match && tt.match {
				t.Errorf("expected services to be the same: '%q' and '%q'", tt.current, tt.new)
				return
			}
			if !match && !tt.match {
				if !strings.HasPrefix(reason, tt.reason) {
					t.Errorf("expected reason prefix '%s', found '%s'", tt.reason, reason)
					return
				}
			}
		})
	}
}


text:
docker push registry.cn-north-1.huaweicloud.com/hwcse/sockshop-catalogue:latest
docker push registry.cn-north-1.huaweicloud.com/hwcse/sockshop-payment:latest
docker push registry.cn-north-1.huaweicloud.com/hwcse/sockshop-user:latest
docker push registry.cn-north-1.huaweicloud.com/hwcse/sockshop-frontend:latest
docker push registry.cn-north-1.huaweicloud.com/hwcse/sockshop-carts:latest
docker push registry.cn-north-1.huaweicloud.com/hwcse/sockshop-shipping:latest
docker push registry.cn-north-1.huaweicloud.com/hwcse/sockshop-orders:latest


text:
<title>Phing API Documentation</title><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></meta><link rel="stylesheet" href="css/jquery-ui.css" type="text/css"></link><link rel="stylesheet" href="css/docblox/jquery-ui-1.8.16.custom.css" type="text/css"></link><link rel="stylesheet" href="css/jquery.treeview.css" type="text/css"></link><link rel="stylesheet" href="css/theme.css" type="text/css"></link>

tasks/ext/rSTTask.php

              Show:
              inherited

                          Classes

\rSTTask

              Table of Contents

reStructuredText rendering task for Phing, the PHP build tool.

PHP version 5

Author

Christian Weiske

Category

Tasks

License

LGPL v3 or later http://www.gnu.org/licenses/lgpl.html

Link

https://gitorious.org/phing/rsttask

Package

phing.tasks.ext

Version

SVN: $Id: rSTTask.php 1401 2011-12-28 16:48:57Z mrook $

\rSTTask
jump to top

Package: phing\tasks\ext
reStructuredText rendering task for Phing, the PHP build tool.

PHP version 5

Parent(s)

\Task
            <
            \ProjectComponent

Author

Christian Weiske

Category

Tasks

License

LGPL v3 or later http://www.gnu.org/licenses/lgpl.html

Link

https://gitorious.org/phing/rsttask

Properties

string
                 $destination= 'null'

Output file or directory. May be omitted.

When it ends with a slash, it is considered to be a directory

Default valuenullDetails

Type

string

string
                 $file= 'null'

Input file in rST format.

Required

Default valuenullDetails

Type

string

                 $filesets= 'array()'

Default valuearray()Details

Type

n/a

array
                 $filterChains= 'array()'

all filterchains objects assigned to this task

Default valuearray()Details

Type

array

string
                 $format= ''html''

Result format, defaults to "html".

Default value'html'Details

Type

string

See

\$supportedFormats

                 $mapperElement= 'null'

Default valuenullDetails

Type

n/a

integer
                 $mode= '0755'

mode to create directories with

Default value0755Details

Type

integer

array
                 $supportedFormats= 'array(
        'html''

static
Array of supported output formats

Default valuearray(
        'html'Details

Type

array

See

\$format

See

\$targetExt

array
                 $targetExt= 'array(
        'html'  => 'html''

static
Maps formats to file extensions

Default valuearray(
        'html'  => 'html'Details

Type

array

string
                 $taskName= ''rST''

Taskname for logger

Default value'rST'Details

Type

string

string
                 $toolParam= 'null'

Additional rst2* tool parameters.

Default valuenullDetails

Type

string

string
                 $toolPath= 'null'

Full path to the tool, i.e. /usr/local/bin/rst2html

Default valuenullDetails

Type

string

boolean
                 $uptodate= 'false'

Only render files whole source files are newer than the
target files

Default valuefalseDetails

Type

boolean

Methods

createFileSet(

          )

        :
          object

Nested creator, creates a FileSet for this task

Returns

Type
Description

object
The created fileset object

createFilterChain(

          )

        :
          \FilterChain

Creates a filterchain, stores and returns it

Returns

Type
Description

\FilterChain
The created filterchain object

createMapper(

          )

        :
          \Mapper

Nested creator, creates one Mapper for this task

Returns

Type
Description

\Mapper
The created Mapper type object

Throws

Exception
Description

\BuildException

getDescription(

          )

        :
          void

getLocation(

          )

        :
          void

getOwningTarget(

          )

        :
          void

getProject(

          )

        :
          void

getRegisterSlot(

          )

        :
          void

getRuntimeConfigurableWrapper(

          )

        :
          void

getTargetFile(
          string $file, string $destination
              =
              null
          )

        :
          string

Determines and returns the target file name from the
input file and the configured destination name.

Parameters

Name
Type
Description

$file
string

Input file

$destination
string

Destination file or directory name, may be null

Returns

Type
Description

string
Target file name

Details

Uses

\$format

Uses

\$targetExt

getTaskName(

          )

        :
          void

getTaskType(

          )

        :
          void

getToolPath(
          string $format
          )

        :
          string

Finds the rst2* binary path

Parameters

Name
Type
Description

$format
string

Output format

Returns

Type
Description

string
Full path to rst2$format

Throws

Exception
Description

\BuildException
When the tool cannot be found

init(

          )

        :
          void

Init method: requires the PEAR System class

log(

          )

        :
          void

main(

          )

        :
          void

The main entry point method.

maybeConfigure(

          )

        :
          void

perform(

          )

        :
          void

render(
          string $tool, string $source, string $targetFile
          )

        :
          void

Renders a single file and applies filters on it

Parameters

Name
Type
Description

$tool
string

conversion tool to use

$source
string

rST source file

$targetFile
string

target file name

renderFile(
          string $tool, string $source, string $targetFile
          )

        :
          void

Renders a single file with the rST tool.

Parameters

Name
Type
Description

$tool
string

conversion tool to use

$source
string

rST source file

$targetFile
string

target file name

Throws

Exception
Description

\BuildException
When the conversion fails

setDescription(

          )

        :
          void

setDestination(
          string $destination
          )

        :
          void

The setter for the attribute "destination"

Parameters

Name
Type
Description

$destination
string

Output file or directory. When it ends with a slash, it is taken as directory.

setFile(
          string $file
          )

        :
          void

The setter for the attribute "file"

Parameters

Name
Type
Description

$file
string

Path of file to render

setFormat(
          string $format
          )

        :
          void

The setter for the attribute "format"

Parameters

Name
Type
Description

$format
string

Output format

Throws

Exception
Description

\BuildException
When the format is not supported

setLocation(

          )

        :
          void

setOwningTarget(

          )

        :
          void

setProject(

          )

        :
          void

setRuntimeConfigurableWrapper(

          )

        :
          void

setTaskName(

          )

        :
          void

setTaskType(

          )

        :
          void

setToolparam(
          string $param
          )

        :
          void

The setter for the attribute "toolparam"

Parameters

Name
Type
Description

$param
string

Additional rst2* tool parameters

setToolpath(
           $path
          )

        :
          void

The setter for the attribute "toolpath"

Parameters

Name
Type
Description

$path

Throws

Exception
Description

\BuildException
When the tool does not exist or is not executable

setUptodate(
          string $uptodate
          )

        :
          void

The setter for the attribute "uptodate"

Parameters

Name
Type
Description

$uptodate
string

True/false

Documentation was generated by DocBlox 0.17.1.


text:
class Circle {
  constructor({ origin, speed, color, angle, context }) {
    this.origin = origin
    this.position = { ...this.origin }
    this.color = color
    this.speed = speed
    this.angle = angle
    this.context = context
    this.renderCount = 0
  }

  draw() {
    this.context.fillStyle = this.color
    this.context.beginPath()
    this.context.arc(this.position.x, this.position.y, 2, 0, Math.PI * 2)
    this.context.fill()
  }

  move() {
    this.position.x = (Math.sin(this.angle) * this.speed) + this.position.x
    this.position.y = (Math.cos(this.angle) * this.speed) + this.position.y + (this.renderCount * 0.3)
    this.renderCount++
  }
}

class Boom {
  constructor ({ origin, context, circleCount = 10, area }) {
    this.origin = origin
    this.context = context
    this.circleCount = circleCount
    this.area = area
    this.stop = false
    this.circles = []
  }

  randomArray(range) {
    const length = range.length
    const randomIndex = Math.floor(length * Math.random())
    return range[randomIndex]
  }

  randomColor() {
    const range = ['8', '9', 'A', 'B', 'C', 'D', 'E', 'F']
    return '#' + this.randomArray(range) + this.randomArray(range) + this.randomArray(range) + this.randomArray(range) + this.randomArray(range) + this.randomArray(range)
  }

  randomRange(start, end) {
    return (end - start) * Math.random() + start
  }

  init() {
    for(let i = 0; i < this.circleCount; i++) {
      const circle = new Circle({
        context: this.context,
        origin: this.origin,
        color: this.randomColor(),
        angle: this.randomRange(Math.PI - 1, Math.PI + 1),
        speed: this.randomRange(1, 6)
      })
      this.circles.push(circle)
    }
  }

  move() {
    this.circles.forEach((circle, index) => {
      if (circle.position.x > this.area.width || circle.position.y > this.area.height) {
        return this.circles.splice(index, 1)
      }
      circle.move()
    })
    if (this.circles.length == 0) {
      this.stop = true
    }
  }

  draw() {
    this.circles.forEach(circle => circle.draw())
  }
}

class CursorSpecialEffects {
  constructor() {
    this.computerCanvas = document.createElement('canvas')
    this.renderCanvas = document.createElement('canvas')

    this.computerContext = this.computerCanvas.getContext('2d')
    this.renderContext = this.renderCanvas.getContext('2d')

    this.globalWidth = window.innerWidth
    this.globalHeight = window.innerHeight

    this.booms = []
    this.running = false
  }

  handleMouseDown(e) {
    const boom = new Boom({
      origin: { x: e.clientX, y: e.clientY },
      context: this.computerContext,
      area: {
        width: this.globalWidth,
        height: this.globalHeight
      }
    })
    boom.init()
    this.booms.push(boom)
    this.running || this.run()
  }

  handlePageHide() {
    this.booms = []
    this.running = false
  }

  init() {
    const style = this.renderCanvas.style
    style.position = 'fixed'
    style.top = style.left = 0
    style.zIndex = '999999999999999999999999999999999999999999'
    style.pointerEvents = 'none'

    style.width = this.renderCanvas.width = this.computerCanvas.width = this.globalWidth
    style.height = this.renderCanvas.height = this.computerCanvas.height = this.globalHeight

    document.body.append(this.renderCanvas)

    window.addEventListener('mousedown', this.handleMouseDown.bind(this))
    window.addEventListener('pagehide', this.handlePageHide.bind(this))
  }

  run() {
    this.running = true
    if (this.booms.length == 0) {
      return this.running = false
    }

    requestAnimationFrame(this.run.bind(this))

    this.computerContext.clearRect(0, 0, this.globalWidth, this.globalHeight)
    this.renderContext.clearRect(0, 0, this.globalWidth, this.globalHeight)

    this.booms.forEach((boom, index) => {
      if (boom.stop) {
        return this.booms.splice(index, 1)
      }
      boom.move()
      boom.draw()
    })
    this.renderContext.drawImage(this.computerCanvas, 0, 0, this.globalWidth, this.globalHeight)
  }
}

const cursorSpecialEffects = new CursorSpecialEffects()
cursorSpecialEffects.init()


text:
<!DOCTYPE html>

  <meta charset="utf-8" />
  <title>goe</title>
  <meta name="viewport" content="width=device-width, initial-scale=1" />

    <link href="https://fonts.googleapis.com/css?family=Poppins" rel="stylesheet" type="text/css">

    <link href='https://fonts.googleapis.com/css?family=Work+Sans:400,100,200,300,500,600,700,800,900' rel='stylesheet' type='text/css'>
    <link href="//fonts.googleapis.com/css?family=Raleway:400,300,600" rel="stylesheet" type="text/css">

  <link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/3.0.3/normalize.css">
  <link rel="stylesheet" type ="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/skeleton/2.0.4/skeleton.css">
  <link href="index.css" rel="stylesheet" />

goe

  <form id="send-message" class = "container">

      To
      <input class ="u-full-width" id="name" type="text" placeholder=" ">
      Message
      <textarea class ="u-full-width" id="message" type="text" placeholder=" "></textarea>

      <input type="submit" value="Send message">
      <input type="submit" value="Open message">
      <input type="submit" value="Filter message">
      <input type ="submit" value="Twitter">
    </form>


text:
<!DOCTYPE html>

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta name="viewport" content="width=device-width,user-scalable=no,minimum-scale=1.0, maximum-scale=1.0, user-scalable=no,initial-scale=1"/>
    <meta name="Liudq" content="Administrator"/>
    <link rel="stylesheet" type="text/css" href="components/css/base.css"/>
    <link rel="stylesheet" type="text/css" href="components/css/Lhuipayapp-common.css"/>
    <link rel="stylesheet" type="text/css" href="components/css/06_main.css"/>
    <link rel="stylesheet" type="text/css" href="components/css/07_logIn.css"/>
    <link rel="stylesheet" href="http://cache.amap.com/lbs/static/main.css"/>

    <title>海豹送水</title>

                    海豹送水

                    订单

                    我的


text:
using System;
using System.Diagnostics;
using System.CodeDom.Compiler;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Threading.Tasks;
using System.Web;
using System.Web.Hosting;
using System.Web.Mvc;
using System.Web.Mvc.Ajax;
using System.Web.Mvc.Html;
using System.Web.Routing;
using T4MVC;
namespace T4MVCHostMvcApp.Controllers
{
    public partial class ModelUnbinderController
    {
        [GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
        public ModelUnbinderController() { }

        [GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
        protected ModelUnbinderController(Dummy d) { }

        [GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
        protected RedirectToRouteResult RedirectToAction(ActionResult result)
        {
            var callInfo = result.GetT4MVCResult();
            return RedirectToRoute(callInfo.RouteValueDictionary);
        }

        [GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
        protected RedirectToRouteResult RedirectToAction(Task<ActionResult> taskResult)
        {
            return RedirectToAction(taskResult.Result);
        }

        [GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
        protected RedirectToRouteResult RedirectToActionPermanent(ActionResult result)
        {
            var callInfo = result.GetT4MVCResult();
            return RedirectToRoutePermanent(callInfo.RouteValueDictionary);
        }

        [GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
        protected RedirectToRouteResult RedirectToActionPermanent(Task<ActionResult> taskResult)
        {
            return RedirectToActionPermanent(taskResult.Result);
        }

        [NonAction]
        [GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
        public virtual System.Web.Mvc.ActionResult TestUnbindModel()
        {
            return new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.TestUnbindModel);
        }
        [NonAction]
        [GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
        public virtual System.Web.Mvc.ActionResult TestBaseClass()
        {
            return new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.TestBaseClass);
        }
        [NonAction]
        [GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
        public virtual System.Web.Mvc.ActionResult TestChildClass1()
        {
            return new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.TestChildClass1);
        }
        [NonAction]
        [GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
        public virtual System.Web.Mvc.ActionResult TestChildClass2()
        {
            return new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.TestChildClass2);
        }
        [NonAction]
        [GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
        public virtual System.Web.Mvc.ActionResult TestComplexModel()
        {
            return new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.TestComplexModel);
        }
        [NonAction]
        [GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
        public virtual System.Web.Mvc.ActionResult TestComplexModelWithEnumerable()
        {
            return new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.TestComplexModelWithEnumerable);
        }

        [GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
        public ModelUnbinderController Actions { get { return MVC.ModelUnbinder; } }
        [GeneratedCode("T4MVC", "2.0")]
        public readonly string Area = "";
        [GeneratedCode("T4MVC", "2.0")]
        public readonly string Name = "ModelUnbinder";
        [GeneratedCode("T4MVC", "2.0")]
        public const string NameConst = "ModelUnbinder";

        static readonly ActionNamesClass s_actions = new ActionNamesClass();
        [GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
        public ActionNamesClass ActionNames { get { return s_actions; } }
        [GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
        public class ActionNamesClass
        {
            public readonly string TestUnbindModel = "TestUnbindModel";
            public readonly string TestBaseClass = "TestBaseClass";
            public readonly string TestChildClass1 = "TestChildClass1";
            public readonly string TestChildClass2 = "TestChildClass2";
            public readonly string TestComplexModel = "TestComplexModel";
            public readonly string TestComplexModelWithEnumerable = "TestComplexModelWithEnumerable";
            public readonly string ParameterlessAction = "ParameterlessAction";
        }

        [GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
        public class ActionNameConstants
        {
            public const string TestUnbindModel = "TestUnbindModel";
            public const string TestBaseClass = "TestBaseClass";
            public const string TestChildClass1 = "TestChildClass1";
            public const string TestChildClass2 = "TestChildClass2";
            public const string TestComplexModel = "TestComplexModel";
            public const string TestComplexModelWithEnumerable = "TestComplexModelWithEnumerable";
            public const string ParameterlessAction = "ParameterlessAction";
        }

        static readonly ActionParamsClass_TestUnbindModel s_params_TestUnbindModel = new ActionParamsClass_TestUnbindModel();
        [GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
        public ActionParamsClass_TestUnbindModel TestUnbindModelParams { get { return s_params_TestUnbindModel; } }
        [GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
        public class ActionParamsClass_TestUnbindModel
        {
            public readonly string model = "model";
        }
        static readonly ActionParamsClass_TestBaseClass s_params_TestBaseClass = new ActionParamsClass_TestBaseClass();
        [GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
        public ActionParamsClass_TestBaseClass TestBaseClassParams { get { return s_params_TestBaseClass; } }
        [GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
        public class ActionParamsClass_TestBaseClass
        {
            public readonly string entity = "entity";
        }
        static readonly ActionParamsClass_TestChildClass1 s_params_TestChildClass1 = new ActionParamsClass_TestChildClass1();
        [GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
        public ActionParamsClass_TestChildClass1 TestChildClass1Params { get { return s_params_TestChildClass1; } }
        [GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
        public class ActionParamsClass_TestChildClass1
        {
            public readonly string user = "user";
        }
        static readonly ActionParamsClass_TestChildClass2 s_params_TestChildClass2 = new ActionParamsClass_TestChildClass2();
        [GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
        public ActionParamsClass_TestChildClass2 TestChildClass2Params { get { return s_params_TestChildClass2; } }
        [GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
        public class ActionParamsClass_TestChildClass2
        {
            public readonly string child = "child";
        }
        static readonly ActionParamsClass_TestComplexModel s_params_TestComplexModel = new ActionParamsClass_TestComplexModel();
        [GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
        public ActionParamsClass_TestComplexModel TestComplexModelParams { get { return s_params_TestComplexModel; } }
        [GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
        public class ActionParamsClass_TestComplexModel
        {
            public readonly string model = "model";
        }
        static readonly ActionParamsClass_TestComplexModelWithEnumerable s_params_TestComplexModelWithEnumerable = new ActionParamsClass_TestComplexModelWithEnumerable();
        [GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
        public ActionParamsClass_TestComplexModelWithEnumerable TestComplexModelWithEnumerableParams { get { return s_params_TestComplexModelWithEnumerable; } }
        [GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
        public class ActionParamsClass_TestComplexModelWithEnumerable
        {
            public readonly string model = "model";
        }
        static readonly ViewsClass s_views = new ViewsClass();
        [GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
        public ViewsClass Views { get { return s_views; } }
        [GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
        public class ViewsClass
        {
            static readonly _ViewNamesClass s_ViewNames = new _ViewNamesClass();
            public _ViewNamesClass ViewNames { get { return s_ViewNames; } }
            public class _ViewNamesClass
            {
            }
        }
    }

    [GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
    public partial class T4MVC_ModelUnbinderController : T4MVCHostMvcApp.Controllers.ModelUnbinderController
    {
        public T4MVC_ModelUnbinderController() : base(Dummy.Instance) { }

        [NonAction]
        partial void TestUnbindModelOverride(T4MVC_System_Web_Mvc_ActionResult callInfo, T4MVCHostMvcApp.Controllers.UnbindModel model);

        [NonAction]
        public override System.Web.Mvc.ActionResult TestUnbindModel(T4MVCHostMvcApp.Controllers.UnbindModel model)
        {
            var callInfo = new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.TestUnbindModel);
            ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "model", model);
            TestUnbindModelOverride(callInfo, model);
            return callInfo;
        }

        [NonAction]
        partial void TestBaseClassOverride(T4MVC_System_Web_Mvc_ActionResult callInfo, T4MVCHostMvcApp.Controllers.BaseEntity entity);

        [NonAction]
        public override System.Web.Mvc.ActionResult TestBaseClass(T4MVCHostMvcApp.Controllers.BaseEntity entity)
        {
            var callInfo = new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.TestBaseClass);
            ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "entity", entity);
            TestBaseClassOverride(callInfo, entity);
            return callInfo;
        }

        [NonAction]
        partial void TestChildClass1Override(T4MVC_System_Web_Mvc_ActionResult callInfo, T4MVCHostMvcApp.Controllers.UserEntity user);

        [NonAction]
        public override System.Web.Mvc.ActionResult TestChildClass1(T4MVCHostMvcApp.Controllers.UserEntity user)
        {
            var callInfo = new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.TestChildClass1);
            ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "user", user);
            TestChildClass1Override(callInfo, user);
            return callInfo;
        }

        [NonAction]
        partial void TestChildClass2Override(T4MVC_System_Web_Mvc_ActionResult callInfo, T4MVCHostMvcApp.Controllers.AnotherChildEntity child);

        [NonAction]
        public override System.Web.Mvc.ActionResult TestChildClass2(T4MVCHostMvcApp.Controllers.AnotherChildEntity child)
        {
            var callInfo = new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.TestChildClass2);
            ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "child", child);
            TestChildClass2Override(callInfo, child);
            return callInfo;
        }

        [NonAction]
        partial void TestComplexModelOverride(T4MVC_System_Web_Mvc_ActionResult callInfo, T4MVCHostMvcApp.Controllers.ComplexModel model);

        [NonAction]
        public override System.Web.Mvc.ActionResult TestComplexModel(T4MVCHostMvcApp.Controllers.ComplexModel model)
        {
            var callInfo = new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.TestComplexModel);
            ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "model", model);
            TestComplexModelOverride(callInfo, model);
            return callInfo;
        }

        [NonAction]
        partial void TestComplexModelWithEnumerableOverride(T4MVC_System_Web_Mvc_ActionResult callInfo, T4MVCHostMvcApp.Controllers.ComplexModelWithEnumerable model);

        [NonAction]
        public override System.Web.Mvc.ActionResult TestComplexModelWithEnumerable(T4MVCHostMvcApp.Controllers.ComplexModelWithEnumerable model)
        {
            var callInfo = new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.TestComplexModelWithEnumerable);
            ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "model", model);
            TestComplexModelWithEnumerableOverride(callInfo, model);
            return callInfo;
        }

        [NonAction]
        partial void ParameterlessActionOverride(T4MVC_System_Web_Mvc_ActionResult callInfo);

        [NonAction]
        public override System.Web.Mvc.ActionResult ParameterlessAction()
        {
            var callInfo = new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.ParameterlessAction);
            ParameterlessActionOverride(callInfo);
            return callInfo;
        }

    }
}

#endregion T4MVC
#pragma warning restore 1591, 3008, 3009, 0108, 0114