text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" />
<title>MkcolExchange xref</title>
<link type="text/css" rel="stylesheet" href="../../../../../stylesheet.css" />

View Javadoc

1   //========================================================================
2   //Copyright 2008 Mort Bay Consulting Pty. Ltd.
3   //------------------------------------------------------------------------
4   //Licensed under the Apache License, Version 2.0 (the "License");
5   //you may not use this file except in compliance with the License.
6   //You may obtain a copy of the License at
7   //http://www.apache.org/licenses/LICENSE-2.0
8   //Unless required by applicable law or agreed to in writing, software
9   //distributed under the License is distributed on an "AS IS" BASIS,
10  //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11  //See the License for the specific language governing permissions and
12  //limitations under the License.
13  //========================================================================
14
15  package org.mortbay.jetty.client.webdav;
16
17  import java.io.IOException;
18
19  import javax.servlet.http.HttpServletResponse;
20
21  import org.mortbay.io.Buffer;
22  import org.mortbay.jetty.client.CachedExchange;
23  import org.mortbay.log.Log;
24
25
26  public class MkcolExchange extends CachedExchange
27  {
28      boolean exists = false;
29
30      public MkcolExchange()
31      {
32          super(true);
33      }
34
35      /* ------------------------------------------------------------ */
36      protected void onResponseStatus(Buffer version, int status, Buffer reason) throws IOException
37      {
38          if ( status == HttpServletResponse.SC_CREATED )
39          {
40              Log.debug( "MkcolExchange:Status: Successfully created resource" );
41              exists = true;
42          }
43
44          if ( status == HttpServletResponse.SC_METHOD_NOT_ALLOWED ) // returned when resource exists
45          {
46              Log.debug( "MkcolExchange:Status: Resource must exist" );
47              exists = true;
48          }
49
50          super.onResponseStatus(version, status, reason);
51      }
52
53      public boolean exists()
54      {
55          return exists;
56      }
57  }

This page was automatically generated by Maven


text:
<?php

/**
 * Needed package(s): php5-curl apache2 php5
 **/
/**
 * Rest API Proxy - Allowing cross domain json calls.
 * initial build for use with the opsview REST API in mind.
 */
class RESTProxy {
	private $_G;
	private $_RawGET;
	private $headers = Array();
	private $Host;
	private $Port;
	private $Https;
	private $tmp;
	private $input;
	private $HTTPErrorCodes = array(
			    100 => 'Continue',
			    101 => 'Switching Protocols',
			    102 => 'Processing',
			    200 => 'OK',
			    201 => 'Created',
			    202 => 'Accepted',
			    203 => 'Non-Authoritative Information',
			    204 => 'No Content',
			    205 => 'Reset Content',
			    206 => 'Partial Content',
			    207 => 'Multi-Status',
			    300 => 'Multiple Choices',
			    301 => 'Moved Permanently',
			    302 => 'Found',
			    303 => 'See Other',
			    304 => 'Not Modified',
			    305 => 'Use Proxy',
			    306 => 'Switch Proxy',
			    307 => 'Temporary Redirect',
			    400 => 'Bad Request',
			    401 => 'Unauthorized',
			    402 => 'Payment Required',
			    403 => 'Forbidden',
			    404 => 'Not Found',
			    405 => 'Method Not Allowed',
			    406 => 'Not Acceptable',
			    407 => 'Proxy Authentication Required',
			    408 => 'Request Timeout',
			    409 => 'Conflict',
			    410 => 'Gone',
			    411 => 'Length Required',
			    412 => 'Precondition Failed',
			    413 => 'Request Entity Too Large',
			    414 => 'Request-URI Too Long',
			    415 => 'Unsupported Media Type',
			    416 => 'Requested Range Not Satisfiable',
			    417 => 'Expectation Failed',
			    418 => 'I\'m a teapot',
			    420 => 'Enhance Your Calm',
			    422 => 'Unprocessable Entity',
			    423 => 'Locked',
			    424 => 'Failed Dependency',
			    425 => 'Unordered Collection',
			    426 => 'Upgrade Required',
			    428 => 'Precondition Required',
			    429 => 'Too Many Requests',
			    449 => 'Retry With',
			    450 => 'Blocked by Windows Parental Controls',
			    500 => 'Internal Server Error',
			    501 => 'Not Implemented',
			    502 => 'Bad Gateway',
			    503 => 'Service Unavailable',
			    504 => 'Gateway Timeout',
			    505 => 'HTTP Version Not Supported',
			    506 => 'Variant Also Negotiates',
			    507 => 'Insufficient Storage',
			    509 => 'Bandwidth Limit Exceeded',
			    510 => 'Not Extended'
			);

	public function __construct(){
		// Fetch the request headers
		$this->headers = apache_request_headers();
		// Save the special x-RESTProxy-* headers
		$this->Host = $this->Host? $this->Host : $this->headers['x-RESTProxy-Host'];
		$this->Port = $this->headers['x-RESTProxy-Port'] ? ':'.$this->headers['x-RESTProxy-Port'] : "";
		$this->Https = ($this->headers['x-RESTProxy-HTTPS'])? $this->headers['x-RESTProxy-HTTPS'] : false;
		// Create a temp file in memory
		$this->fp = fopen('php://temp/maxmemory:256000','w');
		if (!$this->fp){
			$this->Error(100);
		}
		// Write the input into the in-memory tempfile
		$this->input = file_get_contents("php://input");
		fwrite($this->fp,$this->input);
		fseek($this->fp,0);

		//Get the REST Path
		if(!empty($_SERVER['PATH_INFO'])){
		     $this->_G = substr($_SERVER['PATH_INFO'], 1);
		     //$this->_G = explode('/', $_mGET);
		 }

		 // Get the raw GET request
		 $tmp = explode('?',$_SERVER['REQUEST_URI']);
		 if ($tmp[1]) {
		 	$this->_RawGET = $tmp[1];
		 } else {
		 	$this->_RawGET = "";
		 }

	}

	public function setHost($host) {
  	$this->Host = $host;
  	return $this;
	}

	public function doRequest(){
		$headers = $this->headers;
		// Delete some original headers
		unset($headers['Host']);
		unset($headers['Origin']);
		unset($headers['x-RESTProxy-Host']);
		unset($headers['x-RESTProxy-Port']);
		unset($headers['x-RESTProxy-HTTPS']);
		unset($headers['Referer']);
		// Currently we do not support gz encoding
		unset($headers['Accept-Encoding']);

		// Convert the headers to curl format
		$curlHeaders = array();
		foreach($headers as $h => $c){
			$curlHeaders[] = $h . ': ' . $c;
		}

		//Build the url
		$c_url = ""; //($this->Https ? "https" : "http"). '://';
		$c_url .= $this->Host . $this->Port . '/' . $this->_G . '?' . $this->_RawGET;

		// Initiate the curl command
		$ch = curl_init();
		curl_setopt($ch, CURLOPT_URL, $c_url);
		curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
		curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
    curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
    curl_setopt($ch, CURLOPT_PORT , 443);
    curl_setopt($ch, CURLOPT_HTTPHEADER, array(
      'content_type: application/json',
    //'X-Apple-Store-Front: 143444,12'
    ));

		// Use the headers
		curl_setopt($ch, CURLOPT_HTTPHEADER, $curlHeaders);

		if ($_SERVER['REQUEST_METHOD'] != "GET"){
			if ($_SERVER['REQUEST_METHOD'] == "POST"){
				// Use the Curlopt_post instead of customrequest
				// seems to work better
				curl_setopt($ch, CURLOPT_POST,true);
			} else 	if ($_SERVER['REQUEST_METHOD'] == "PUT"){
				// The same for put
				curl_setopt($ch, CURLOPT_PUT,true);
			} else {
				// Other requests (like DELETE), use a customrequest
				curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $_SERVER['REQUEST_METHOD']);
			}

			// Send the content of the in-memory tempfile
			curl_setopt($ch, CURLOPT_INFILE, $this->fp);
			curl_setopt($ch, CURLOPT_INFILESIZE, strlen($this->input));
		} else {

			// Just simple GET here, GET request is in the url
			curl_setopt($ch, CURLOPT_HTTPGET, true);
		}

		$output = curl_exec($ch);
		// Get the request info for headers
		$info = curl_getinfo($ch);
		//print_r($info);

		// Set our headers to the headers we received from the REST API
		header('Content-Type: application/json');
		(!$info['http_code'])? $info['http_code'] = "502": $info['http_code'] = $info['http_code'];
		header('HTTP/1.1 ' . $info['http_code'] . ' ' . $this->HTTPErrorCodes[$info['http_code']]);

		// Some informatic headers
		header('x-RESTProxy-url: ' . $info['url']);
		header('x-RESTProxy-total-time: ' . $info['total_time']);
		header('x-RESTProxy-namelookup-time: ' . $info['namelookup_time']);
		header('x-RESTProxy-connect-time: ' . $info['connect_time']);
		header('x-RESTProxy-size-upload: ' . $info['size_upload']);
		header('x-RESTProxy-size-download: ' . $info['size_download']);
		header('x-RESTProxy-speed-download: ' . $info['speed_download']);
		header('x-RESTProxy-speed-upload: ' . $info['speed_upload']);
		header('x-RESTProxy-download-content-lenght: ' . $info['download_content_length']);
		header('x-RESTProxy-upload-content-lenght: ' . $info['upload_content_length']);
		header('x-RESTProxy-start-transfer-time: ' . $info['starttransfer_time']);
		header('x-RESTProxy-redirect-time: ' . $info['redirect_time']);
		//var_dump($info);
		// Return the output
		echo $output;

		fclose($this->fp);
		curl_close($ch);
	}
}

redpajama_set_name: RedPajamaGithub


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">

    <title>About - Business Casual - Start Bootstrap Theme</title>

    <link href="css/bootstrap.min.css" rel="stylesheet">

    <link href="css/business-casual.css" rel="stylesheet">

    <link href="https://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800" rel="stylesheet" type="text/css">
    <link href="https://fonts.googleapis.com/css?family=Josefin+Slab:100,300,400,600,700,100italic,300italic,400italic,600italic,700italic" rel="stylesheet" type="text/css">

Get Organized

Select a focus and track your organization's research.

                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
                    Toggle navigation

                </button>

                Business Casual

                        My Demographics

                        My Organization

                        My Issue

                        My Engagement

My
                        Organization

                    <form role="form">

                                Do you know how final decisions are made in your organization?

                                <input type="radio" name="q1" value="yes">Yes

                                <input type="radio" name="q1" value="no">No

                                Can you name the key decision makers in your organization?

                                <input type="radio" name="q2" value="yes" onclick="">Yes

                                <input type="radio" name="q2" value="no">No

                                Can you name all stakeholders involved?

                                <input type="radio" name="q3" value="yes" id="orgq3y" onclick="javascript:yesnoCheck();">Yes

                                <input type="radio" name="q3" value="no" id="orgq3n" onclick="javascript:yesnoCheck();">No

                                If yes, list their contact information

                                <textarea class="form-control" rows="6"></textarea>

                                Are there other organizations working to solve this issue?

                                <input type="radio" name="q4" value="yes">Yes

                                <input type="radio" name="q4" value="no">No

                                Do you know the other organizations working to solve this issue?

                                <input type="radio" name="q5" value="yes">Yes

                                <input type="radio" name="q5" value="no">No

                                <input type="hidden" name="save" value="contact">
                                <button type="submit" class="btn btn-default">Print</button>

                    </form>

Copyright © Your Website 2014


text:
require 'thread'

module NewRelic
  module Agent
    module VM
      class RubiniusVM
        def snapshot
          snap = Snapshot.new
          gather_stats(snap)
          snap
        end

        def gather_stats(snap)
          gather_gc_stats(snap)
          gather_thread_stats(snap)
        end

        def gather_gc_stats(snap)
          snap.gc_runs = GC.count

          # Rubinius::Metrics is available since Rubinius 2.3
          if has_metrics?
            gather_stats_from_metrics(snap)
          else
            gather_stats_from_gc_stat(snap)
          end

          gather_gc_time(snap)
        end

        # The '+ 0' bits in here are a workaround for a Rubinius bug wherein
        # Rubinius::Metrics.data returns 0's as Bignums, and these Bignums
        # cannot be safely subtraced from Fixnums. The + 0  has the effect of
        # truncating to a Fixnum if possible without loss of precision.
        # See https://github.com/rubinius/rubinius/issues/3316
        def gather_stats_from_metrics(snap)
          snap.major_gc_count = metric(:'gc.immix.count') + 0
          snap.minor_gc_count = metric(:'gc.young.count') + 0

          if has_metric_totals?
            # Rubinius < 2.5.8 metric names
            snap.heap_live = metric(:'memory.large.objects.current') +
              metric(:'memory.young.objects.current') +
              metric(:'memory.immix.objects.current')

            snap.total_allocated_object =
              metric(:'memory.large.objects.total') +
              metric(:'memory.young.objects.total') +
              metric(:'memory.immix.objects.total')

            snap.method_cache_invalidations = metric(:'vm.inline_cache.resets') + 0
          else
            # Rubinius >= 2.5.8 metric names and no total metrics
            snap.heap_live = metric(:'memory.large.objects') +
              metric(:'memory.young.objects') +
              metric(:'memory.immix.objects')

            snap.method_cache_invalidations = metric(:'machine.inline_cache.resets') + 0
          end
        end

        def gather_stats_from_gc_stat(snap)
          gc_stats = GC.stat[:gc]

          if gc_stats
            snap.major_gc_count = gc_stats[:full][:count] if gc_stats[:full]
            snap.minor_gc_count = gc_stats[:young][:count] if gc_stats[:young]
          end
        end

        def gather_gc_time(snap)
          if GC.respond_to?(:time)
            # On Rubinius GC.time returns a time in miliseconds, not seconds.
            snap.gc_total_time = GC.time / 1000
          end
        end

        def gather_thread_stats(snap)
          snap.thread_count = Thread.list.size
        end

        def has_metrics?
          Rubinius.const_defined?(:Metrics)
        end

        def metric(key)
          Rubinius::Metrics.data[key]
        end

        def has_metric?(key)
          Rubinius::Metrics.data.keys.include? key
        end

        def has_metric_totals?
          has_metric? :'memory.large.objects.total'
        end

        def supports?(key)
          if has_metrics?
            case key
            when :major_gc_count
              true
            when :minor_gc_count
              true
            when :heap_live
              true
            when :total_allocated_object
              has_metric_totals?
            when :method_cache_invalidations
              true
            when :gc_runs
              true
            when :gc_total_time
              GC.respond_to?(:time)
            when :thread_count
              true
            else
              false
            end
          else
            case key
            when :major_gc_count
              true
            when :minor_gc_count
              true
            when :thread_count
              true
            else
              false
            end
          end
        end
      end
    end
  end
end


text:
package com.frameworkset.platform.security.authentication;

import java.io.IOException;
import java.security.Principal;

import javax.servlet.http.HttpServletRequest;

import org.apache.log4j.Logger;

import com.frameworkset.platform.security.authorization.AuthPrincipal;
import com.frameworkset.platform.sysmgrcore.entity.Organization;

public abstract class ACLLoginModule implements LoginModule {

    private static Logger log = Logger.getLogger(ACLLoginModule.class);
    protected String loginModuleName;

    /**注册表类型*/
    protected String registTable = "DB";
    /**全局subject*/
    private Subject subject;
    /**标识用户身份的凭证*/
    private Principal principal;
    /**获取用户名称和口令的回调函数*/
    private CallbackHandler callbackHandler;

    private CheckCallBack checkCallBack;
    private Credential credential;
    /**保存用户名称变量*/
    private String username;

    /**
     * 用户登录时要求的用户类型表
     * 如果登录接口指定了用户类型表,则只有用户的类型存在于用户类型表中才允许用户登录,否则不允许用户登录系统
     * 如果登录接口没有指定用户类型表,不需要检测用户的类型
     */
    protected String[] userTypes ;
//    protected HttpServletRequest request;

    /**标识用户登录是否成功*/
    private boolean loginSuccess;
    /**登录口令*/
    private String password;

    protected boolean enableusertype(String userType)
    {
    	if(userTypes == null || userTypes.length == 0)
    		return true;
    	for(int i = 0; i < userTypes.length; i ++)
    	{
    		if(userTypes[i] != null && userTypes[i].equals(userType))
    			return true;
    	}
    	return false;
    }

    /**
     * Initialize this LoginModule.
     * @param subject the Subject to be authenticated.

     * @param callbackHandler a CallbackHandler for
     * communicating with the end user (prompting for usernames and
     * passwords, for example).

     * @param sharedState state shared with other configured LoginModules.
     *

     * @param options options specified in the login
     * Configuration for this particular
     * LoginModule.
     * @todo Implement this javax.security.auth.spi.LoginModule method
     * @roseuid 43FD4F86005D
     */
    public void initialize(Subject subject, CallbackHandler callbackHandler) {
        this.subject = subject;
        this.callbackHandler = callbackHandler;
        this.loginSuccess = false;
        if(subject == null || subject.getCredential() == null || subject.getCredential().getCheckCallBack() == null)
        	this.checkCallBack = new CheckCallBack();
        else
        	this.checkCallBack = subject.getCredential().getCheckCallBack();
        username = null;
        userTypes = null;
        //this.loginModuleName = null;
        //this.registTable = "DB";
        clearPassword();
    }

    /**
     * Method to authenticate a Subject (phase 1).
     * @throws javax.security.auth.login.LoginException if the authentication fails
     * @return true if the authentication succeeded, or false if this
     * LoginModule should be ignored.
     * @throws javax.security.auth.login.LoginException
     * @todo Implement this javax.security.auth.spi.LoginModule method
     * @roseuid 43FD4F8600AC
     */
    public boolean login() throws LoginException {
        //
        // Since we need input from a user, we need a callback handler
        if (callbackHandler == null) {
            throw new LoginException("No CallbackHandler defined for LoginModule" + this.getClass().getName()  );

        }
//        Callback[] callbacks = new Callback[3];
//        callbacks[0] = new NameCallback("Username");
//        callbacks[1] = new PasswordCallback("Password", false);
//        callbacks[2] = new UserTypeCallBack("UserType");

        //
        // Call the callback handler to get the username
        try {
            log.debug( this.getClass().getName() + " Login");
//            callbackHandler.handle(callbacks);
            username =callbackHandler.getUserName();
            userTypes = callbackHandler.getUserTypes();
//            this.request = ((RequestCallBack)callbacks[3]).getRequest();
            password = callbackHandler.getPassword();
//            password = new char[temp.length];

//            System.arraycopy(temp, 0, password, 0, temp.length);
//            ((PasswordCallback) callbacks[1]).clearPassword();
            /**
             * 匿名用户登录系统
             */
            if (username.equals("guest___")) {
                checkCallBack.setUserAttribute("userName", "匿名用户");
                checkCallBack.setUserAttribute("userID", "-1");
                checkCallBack.setUserAttribute("password", EncrpyPwd.encodePassword("123456"));
                checkCallBack.setUserAttribute("password_i", "123456");
                checkCallBack.setUserAttribute("CHARGEORGID", (Organization) null);
                checkCallBack.setUserAttribute("orgName", "没有兼职单位");
                checkCallBack.setUserAttribute("secondOrgs", null);
                checkCallBack.setUserAttribute("userAccount", "guest___");
                loginSuccess = true;
            }
            else
            {
	            CheckCallBackWrapper checkCallBackWrapper = new CheckCallBackWrapper(checkCallBack,callbackHandler.getRequest(),callbackHandler.getResponse());
	//            if(request == null)
	            	loginSuccess = check(callbackHandler.getUserName(), callbackHandler.getPassword(),checkCallBackWrapper);
            }
//            else
//            	loginSuccess = check(request,username, new String(password),checkCallBack);

            if (loginSuccess) {

                log.debug( "" + this.getClass().getName() + " login SUCCESS");
                return true;
            }
            else
            {
                log.debug( "" + this.getClass().getName() + " login failed");
            }
        }
        catch (LoginException ioe) {

           throw ioe;
        }
        catch (Exception ioe) {

            throw new LoginException(ioe.getMessage(),ioe);
        }
        throw new LoginException();
    }

    /**
     * Method to commit the authentication process (phase 2).
     * @throws javax.security.auth.login.LoginException if the commit fails
     * @return true if this method succeeded, or false if this
     * LoginModule should be ignored.
     * @throws javax.security.auth.login.LoginException
     * @todo Implement this javax.security.auth.spi.LoginModule method
     * @roseuid 43FD4F86000F
     */
    public boolean commit() throws LoginException {
        if (loginSuccess == false) {
            log.debug( "" + this.getClass().getName() + " commit  FAIL");
            return false;
        }

        // If this login module succeeded too, then add the new principal
        // to the subject (if it does not already exist)
        principal = new AuthPrincipal(username, loginModuleName);
        /**
         * 如果登录时设置了用户的类型则保存用户的类型到上下文变量中
         */
        if(this.userTypes != null && this.userTypes.length != 0)
        	checkCallBack.setUserAttribute("LOGINCONTEXT.USERTYPE",userTypes);
        credential = new Credential(checkCallBack,loginModuleName );

        //往subject中添加用户身份
        subject.addAuthPrincipal(principal);

        //往subject中添加用户身份令牌
        subject.addCredential(credential);
        log.debug( "" + this.getClass().getName() + " commit SUCCESS");
        return true;

    }

    /**
     * Method to abort the authentication process (phase 2).
     * @throws javax.security.auth.login.LoginException if the abort fails
     * @return true if this method succeeded, or false if this
     * LoginModule should be ignored.
     * @throws javax.security.auth.login.LoginException
     * @todo Implement this javax.security.auth.spi.LoginModule method
     * @roseuid 43FD4F85039B
     */
    public boolean abort() throws LoginException {

        if (loginSuccess == false) {
            log.debug( "" + this.getClass().getName() + " abort FAIL");
            principal = null;
            username = null;
            this.checkCallBack = null;
            this.credential = null;
            return false;
        }
        log.debug( "" + this.getClass().getName() + " abort SUCCESS");
        logout();
        return true;

    }

    /**
     * Method which logs out a Subject.
     * @throws javax.security.auth.login.LoginException if the logout fails
     * @return true if this method succeeded, or false if this
     * LoginModule should be ignored.
     * @throws javax.security.auth.login.LoginException
     * @todo Implement this javax.security.auth.spi.LoginModule method
     * @roseuid 43FD4F8600FA
     */
    public boolean logout() throws LoginException {

    	CheckCallBackWrapper checkCallBackWrapper = new CheckCallBackWrapper(checkCallBack,callbackHandler.getRequest(),callbackHandler.getResponse());
    	try {
			logoutCallback(username,checkCallBackWrapper);
		} catch (Exception e) {

		}
//        if(principal != null)
//        {
//            subject.getPrincipals().remove(principal);
//        }
//        if(credential != null)
//            subject.getCredentials().remove(this.credential);
    	this.subject = null;
        loginSuccess = false;
        username = null;
        principal = null;
        credential = null;
        checkCallBack = null;
        log.debug( "" + this.getClass().getName() + " logout SUCCESS");
        return true;

    }
    /**
     * 用户登出系统时,回调函数方法,登录插件可以根据实际情况覆盖这个方法
     * @param userName
     * @param checkCallBackWrapper
     */
    public void logoutCallback(String userName,CheckCallBackWrapper checkCallBackWrapper)
    {

    }

    /**
     * 对用户名和口令进行校验
     * @param userName String 用户名称
     * @param password String 用户口令
     * @param checkCallBack CheckCallBack 用户通过本变量回填用户的基本信息
     * @return boolean
     * @throws LoginException
     */
    protected abstract boolean check(String userName, String password,CheckCallBackWrapper checkCallBack) throws
            LoginException;

//    protected abstract boolean check(HttpServletRequest request,String userName, String password,CheckCallBackWrapper checkCallBack) throws
//    LoginException;

    private void clearPassword() {

        password = null;
    }

    /**
     * @param args
     * @roseuid 43FE53BD032C
     */
    public static void main(String[] args) {

    }

    public void setLoginModuleName(String loginModuleName) {
        this.loginModuleName = loginModuleName;
    }

    public void setRegistTable(String registTable) {
        this.registTable = registTable;
    }
    /**
     * 重置指定的用户属性
     * @param userAttribute
     * @param value
     */
    public void resetUserAttribute(HttpServletRequest request,CheckCallBack checkCallBack,String userAttribute)
    {

    }

    /**
     * 重置用户属性
     * @param userAttribute
     * @param value
     */
    public void resetUserAttributes(HttpServletRequest request,CheckCallBack checkCallBack)
    {

    }
}


text:
<?php

namespace Puli\Manager\Api\Module;

use Puli\Manager\Api\Config\ConfigManager;
use Puli\Manager\Api\Context\ProjectContext;
use Puli\Manager\Api\Storage\WriteException;
use Webmozart\Expression\Expression;
use Webmozart\Json\Migration\MigrationFailedException;

/**
 * Manages changes to the root module file.
 *
 * Use this class to make persistent changes to the puli.json of a project.
 * Whenever you call methods in this class, the changes will be written to disk.
 *
 * @since  1.0
 *
 * @author Bernhard Schussek <bschussek@gmail.com>
 */
interface RootModuleFileManager extends ConfigManager
{
    /**
     * Returns the project context.
     *
     * @return ProjectContext The project context.
     */
    public function getContext();

    /**
     * Returns the managed module file.
     *
     * @return RootModuleFile The managed module file.
     */
    public function getModuleFile();

    /**
     * Returns the module name configured in the module file.
     *
     * @return null|string The configured module name.
     */
    public function getModuleName();

    /**
     * Sets the module name configured in the module file.
     *
     * @param string $moduleName The module name.
     */
    public function setModuleName($moduleName);

    /**
     * Adds a plugin class to the module file.
     *
     * The plugin class must be passed as fully-qualified name of a class that
     * implements {@link PuliPlugin}. Plugin constructors must not have
     * mandatory parameters.
     *
     * @param string $pluginClass The fully qualified plugin class name.
     */
    public function addPluginClass($pluginClass);

    /**
     * Removes a plugin class from the module file.
     *
     * If the module file does not contain the class, this method does nothing.
     *
     * @param string $pluginClass The fully qualified plugin class name.
     */
    public function removePluginClass($pluginClass);

    /**
     * Removes the plugin classes from the module file that match the given
     * expression.
     *
     * @param Expression $expr The search criteria.
     */
    public function removePluginClasses(Expression $expr);

    /**
     * Removes all plugin classes from the module file.
     *
     * If the module file does not contain any classes, this method does
     * nothing.
     */
    public function clearPluginClasses();

    /**
     * Returns whether the module file contains a plugin class.
     *
     * @param string $pluginClass The fully qualified plugin class name.
     *
     * @return bool Returns `true` if the module file contains the given
     *              plugin class and `false` otherwise.
     */
    public function hasPluginClass($pluginClass);

    /**
     * Returns whether the module file contains any plugin classes.
     *
     * You can optionally pass an expression to check whether the manager has
     * plugin classes matching the expression.
     *
     * @param Expression|null $expr The search criteria.
     *
     * @return bool Returns `true` if the manager has plugin classes in the root
     *              module and `false` otherwise. If an expression is passed,
     *              this method only returns `true` if the manager has plugin
     *              classes matching the expression.
     */
    public function hasPluginClasses(Expression $expr = null);

    /**
     * Returns all installed plugin classes.
     *
     * @return string[] The fully qualified plugin class names.
     */
    public function getPluginClasses();

    /**
     * Returns all installed plugin classes matching the given expression.
     *
     * @param Expression $expr The search criteria.
     *
     * @return string[] The fully qualified plugin class names matching the
     *                  expression.
     */
    public function findPluginClasses(Expression $expr);

    /**
     * Sets an extra key in the file.
     *
     * The file is saved directly after setting the key.
     *
     * @param string $key   The key name.
     * @param mixed  $value The stored value.
     *
     * @throws WriteException If the file cannot be written.
     */
    public function setExtraKey($key, $value);

    /**
     * Sets the extra keys in the file.
     *
     * The file is saved directly after setting the keys.
     *
     * @param string[] $values A list of values indexed by their key names.
     *
     * @throws WriteException If the file cannot be written.
     */
    public function setExtraKeys(array $values);

    /**
     * Removes an extra key from the file.
     *
     * The file is saved directly after removing the key.
     *
     * @param string $key The name of the removed extra key.
     *
     * @throws WriteException If the file cannot be written.
     */
    public function removeExtraKey($key);

    /**
     * Removes the extra keys from the module file that match the given
     * expression.
     *
     * The file is saved directly after removing the keys.
     *
     * @param Expression $expr The search criteria.
     *
     * @throws WriteException If the file cannot be written.
     */
    public function removeExtraKeys(Expression $expr);

    /**
     * Removes all extra keys from the file.
     *
     * The file is saved directly after removing the keys.
     *
     * @throws WriteException If the file cannot be written.
     */
    public function clearExtraKeys();

    /**
     * Returns whether an extra key exists.
     *
     * @param string $key The extra key to search.
     *
     * @return bool Returns `true` if the file contains the key and `false`
     *              otherwise.
     */
    public function hasExtraKey($key);

    /**
     * Returns whether the file contains any extra keys.
     *
     * You can optionally pass an expression to check whether the file contains
     * extra keys matching the expression.
     *
     * @param Expression|null $expr The search criteria.
     *
     * @return bool Returns `true` if the file contains extra keys and `false`
     *              otherwise. If an expression is passed, this method only
     *              returns `true` if the file contains extra keys matching the
     *              expression.
     */
    public function hasExtraKeys(Expression $expr = null);

    /**
     * Returns the value of a configuration key.
     *
     * @param string $key     The name of the extra key.
     * @param mixed  $default The value to return if the key was not set.
     *
     * @return mixed The value of the key or the default value, if none is set.
     */
    public function getExtraKey($key, $default = null);

    /**
     * Returns the values of all extra keys set in the file.
     *
     * @return array A mapping of configuration keys to values.
     */
    public function getExtraKeys();

    /**
     * Returns the values of all extra keys matching the given expression.
     *
     * @param Expression $expr The search criteria.
     *
     * @return array A mapping of configuration keys to values.
     */
    public function findExtraKeys(Expression $expr);

    /**
     * Migrates the root module file to the given version.
     *
     * @param string $targetVersion The target version string.
     *
     * @throws MigrationFailedException If the migration fails.
     * @throws WriteException           If the file cannot be written.
     */
    public function migrate($targetVersion);
}


text:
package de.hochschuleTrier.fmv.model.interfaces.listener;

import prefuse.data.Tree;

public interface IFeatureDiagramModelListener {

	public void treeHasChanged(final Tree tree);

}


text:
import {
  ADD_TO_CART,
  REMOVE_FROM_CART,
  CHECKOUT_REQUEST,
  CHECKOUT_FAILURE
} from '../Constants/ActionTypes'
import _ from 'lodash'

const initialState = {
  addedIds: [],
  quantityById: {}
}

const addedIds = (state = initialState.addedIds, action) => {
  switch (action.type) {
  case ADD_TO_CART:
    if (state.indexOf(action.productId) !== -1) {
      return state
    }
    return [...state, action.productId];
  case REMOVE_FROM_CART:
    let editedCart;
    let index = state.indexOf(action.productId);
    editedCart = state.filter(item => item !== action.productId)
    console.log("editedCart" +JSON.stringify(editedCart));
    return editedCart
  default:
    return state
  }
};

const quantityById = (state = initialState.quantityById, action) => {
  switch (action.type) {
  case ADD_TO_CART:
    let { productId } = action
    return { ...state,
      [productId]: (state[productId] || 0) + 1
    }
  case REMOVE_FROM_CART:
    let removeProduct = action.productId
    let stateCopy = _.cloneDeep(state);
    delete stateCopy[removeProduct]
    return stateCopy;
  default:
    return state
  }
};

export const getQuantity = (state, productId) =>
  state.quantityById[productId] || 0;

export const getAddedIds = state => state.addedIds;

const cart = (state = initialState, action) => {
  switch (action.type) {
  case CHECKOUT_REQUEST:
    return initialState;
  case CHECKOUT_FAILURE:
    return action.cart;
  default:
    return {
      addedIds: addedIds(state.addedIds, action),
      quantityById: quantityById(state.quantityById, action),
    };
  }
};

export default cart;


text:
<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;

/* @var $this yii\web\View */
/* @var $model app\models\WorkOrderTypeSearch */
/* @var $form yii\widgets\ActiveForm */
?>

    <?php $form = ActiveForm::begin([
        'action' => ['index'],
        'method' => 'get',
    ]); ?>

    <?= $form->field($model, 'id') ?>

    <?= $form->field($model, 'work_order_type') ?>

    <?= $form->field($model, 'user_level') ?>

        <?= Html::submitButton('Search', ['class' => 'btn btn-primary']) ?>
        <?= Html::resetButton('Reset', ['class' => 'btn btn-default']) ?>

    <?php ActiveForm::end(); ?>


text:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module PUBLIC "-//NetBeans//DTD Module Status 1.0//EN"
                        "http://www.netbeans.org/dtds/module-status-1_0.dtd">
<module name="org.netbeans.modules.debugger.jpda">
    <param name="autoload">true</param>
    <param name="eager">false</param>
    <param name="jar">modules/org-netbeans-modules-debugger-jpda.jar</param>
    <param name="reloadable">false</param>
</module>


text:
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

// ReSharper disable UnusedMember.Global
// ReSharper disable UnusedMember.Local

namespace NakedFramework.Persistor.Entity.Test.AdventureWorksCodeOnly;

[Table("HumanResources.Shift")]
public class Shift {
    [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
    public byte ShiftID { get; set; }

    [Required]
    [StringLength(50)]
    public string Name { get; set; }

    public DateTime StartTime { get; set; }

    public DateTime EndTime { get; set; }

    public DateTime ModifiedDate { get; set; }

    public virtual ICollection<EmployeeDepartmentHistory> EmployeeDepartmentHistories { get; set; } = new HashSet<EmployeeDepartmentHistory>();
}


text:
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">

    <PreferenceCategory
        android:dependency="I_understand"
        android:title="Data Source"
        android:key="dataSource">

        <ListPreference
            android:key="dex_collection_method"
            android:title="Dexcom Data Collection Method"
            android:summary="How are you going to receive data from your Dexcom?"
            android:entries="@array/DexCollectionMethods"
            android:entryValues="@array/DexCollectionMethodValues"
            android:defaultValue="BluetoothWixel"/>
        <CheckBoxPreference
            android:key="run_service_in_foreground"
            android:title="Run Collection Service in foreground"
            android:summary="Running in foreground prevents android from killing the service to free up memory but it creates an annoying notification, Not recommended."
            android:defaultValue="false" />
    </PreferenceCategory>

</PreferenceScreen>


text:
package in.twizmwaz.cardinal.module.modules.permissions;

import in.twizmwaz.cardinal.Cardinal;
import in.twizmwaz.cardinal.GameHandler;
import in.twizmwaz.cardinal.event.CycleCompleteEvent;
import in.twizmwaz.cardinal.event.MatchEndEvent;
import in.twizmwaz.cardinal.event.MatchStartEvent;
import in.twizmwaz.cardinal.event.PlayerChangeTeamEvent;
import in.twizmwaz.cardinal.event.RankChangeEvent;
import in.twizmwaz.cardinal.module.Module;
import in.twizmwaz.cardinal.rank.Rank;
import in.twizmwaz.cardinal.util.TeamUtils;
import org.bukkit.Bukkit;
import org.bukkit.OfflinePlayer;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.event.player.PlayerKickEvent;
import org.bukkit.event.player.PlayerQuitEvent;
import org.bukkit.permissions.PermissionAttachment;
import org.bukkit.plugin.Plugin;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;

public class PermissionModule implements Module {

    private final Plugin plugin;
    private final Map<Player, PermissionAttachment> attachmentMap;

    private List<UUID> developers = Arrays.asList(UUID.fromString("670223bb-7560-48c8-8f01-2f463549b917") /* twiz_mwazin */, UUID.fromString("33a703d0-3237-4337-9ddd-3dbf33b3d8a6") /* iEli2tyree011 */, UUID.fromString("208c84af-790a-41da-bf7e-eb184f17bdf8") /* Elly */, UUID.fromString("260004f0-996b-4539-ba21-df4ee6336b63") /* Elliott_ */);
    private List<OfflinePlayer> muted = new ArrayList<>();

    public PermissionModule(Plugin plugin) {
        this.plugin = plugin;
        this.attachmentMap = new HashMap<>();
    }

    public static boolean isMod(UUID player) {
        for (String uuid : GameHandler.getGameHandler().getPlugin().getConfig().getStringList("permissions.Moderator.players")) {
            if (uuid.equals(player.toString())) {
                return true;
            }
        }
        return false;
    }

    public static boolean isStaff(OfflinePlayer player) {
        return isMod(player.getUniqueId()) || player.isOp();
    }

    public static boolean isDeveloper(UUID player) {
        return GameHandler.getGameHandler().getMatch().getModules().getModule(PermissionModule.class).getDevelopers().contains(player);
    }

    @Override
    public void unload() {
        for (Player player : Bukkit.getOnlinePlayers()) {
            player.removeAttachment(attachmentMap.get(player));
        }

        attachmentMap.clear();
    }

    public List<UUID> getDevelopers() {
        return developers;
    }

    @EventHandler(priority = EventPriority.LOWEST)
    public void onPlayerJoin(PlayerJoinEvent event) {
        attachmentMap.put(event.getPlayer(), event.getPlayer().addAttachment(plugin));
        for (String permission : GameHandler.getGameHandler().getPlugin().getConfig().getStringList("permissions.Default.permissions")) {
            attachmentMap.get(event.getPlayer()).setPermission(permission, true);
        }
        if (event.getPlayer().isOp() && GameHandler.getGameHandler().getPlugin().getConfig().getStringList("permissions.Moderator.players").contains(event.getPlayer().getUniqueId().toString())) {
            List<String> players = new ArrayList<>();
            players.addAll(GameHandler.getGameHandler().getPlugin().getConfig().getStringList("permissions.Moderator.players"));
            players.remove(event.getPlayer().getUniqueId().toString());
            GameHandler.getGameHandler().getPlugin().getConfig().set("permissions.Moderator.players", players);
            GameHandler.getGameHandler().getPlugin().saveConfig();
        }
        if (GameHandler.getGameHandler().getPlugin().getConfig().get("permissions.Moderator.players") != null) {
            for (String uuid : GameHandler.getGameHandler().getPlugin().getConfig().getStringList("permissions.Moderator.players")) {
                if (event.getPlayer().getUniqueId().toString().equals(uuid)) {
                    for (String permission : GameHandler.getGameHandler().getPlugin().getConfig().getStringList("permissions.Moderator.permissions")) {
                        attachmentMap.get(event.getPlayer()).setPermission(permission, true);
                    }
                }
            }
        }
    }

    @EventHandler(priority = EventPriority.LOWEST)
    public void onCycleComplete(CycleCompleteEvent event) {
        for (Player player : Bukkit.getOnlinePlayers())
            attachmentMap.put(player, player.addAttachment(plugin));
    }

    @EventHandler(priority = EventPriority.HIGHEST)
    public void onPlayerLeave(PlayerQuitEvent event) {
        if (attachmentMap.get(event.getPlayer()) != null) {
            event.getPlayer().removeAttachment(attachmentMap.get(event.getPlayer()));
            attachmentMap.remove(event.getPlayer());
        }
    }

    @EventHandler(priority = EventPriority.HIGHEST)
    public void onPlayerKick(PlayerKickEvent event) {
        event.getPlayer().removeAttachment(attachmentMap.get(event.getPlayer()));
        attachmentMap.remove(event.getPlayer());
    }

    @EventHandler
    public void onPlayerChangeTeam(PlayerChangeTeamEvent event) {
        if (Cardinal.getInstance().getConfig().getBoolean("worldEditPermissions")) {
            if (event.getNewTeam().isObserver() || !GameHandler.getGameHandler().getMatch().isRunning()) {
                attachmentMap.get(event.getPlayer()).setPermission("worldedit.navigation.jumpto.tool", true);
                attachmentMap.get(event.getPlayer()).setPermission("worldedit.navigation.thru.tool", true);

                attachmentMap.get(event.getPlayer()).setPermission("worldedit.navigation.jumpto.command", true);
                attachmentMap.get(event.getPlayer()).setPermission("worldedit.navigation.thru.command", true);
            } else {
                attachmentMap.get(event.getPlayer()).setPermission("worldedit.navigation.jumpto.tool", false);
                attachmentMap.get(event.getPlayer()).setPermission("worldedit.navigation.thru.tool", false);

                attachmentMap.get(event.getPlayer()).setPermission("worldedit.navigation.jumpto.command", false);
                attachmentMap.get(event.getPlayer()).setPermission("worldedit.navigation.thru.command", false);
            }
        }
    }

    @EventHandler
    public void onMatchStart(MatchStartEvent event) {
        if (Cardinal.getInstance().getConfig().getBoolean("worldEditPermissions")) {
            for (Player player : Bukkit.getOnlinePlayers()) {
                if (TeamUtils.getTeamByPlayer(player) == null || TeamUtils.getTeamByPlayer(player).isObserver()) {
                    attachmentMap.get(player).setPermission("worldedit.navigation.jumpto.tool", true);
                    attachmentMap.get(player).setPermission("worldedit.navigation.thru.tool", true);

                    attachmentMap.get(player).setPermission("worldedit.navigation.jumpto.command", true);
                    attachmentMap.get(player).setPermission("worldedit.navigation.thru.command", true);
                } else {
                    attachmentMap.get(player).setPermission("worldedit.navigation.jumpto.tool", false);
                    attachmentMap.get(player).setPermission("worldedit.navigation.thru.tool", false);

                    attachmentMap.get(player).setPermission("worldedit.navigation.jumpto.command", false);
                    attachmentMap.get(player).setPermission("worldedit.navigation.thru.command", false);
                }
            }
        }
    }

    @EventHandler
    public void onMatchEnd(MatchEndEvent event) {
        if (Cardinal.getInstance().getConfig().getBoolean("worldEditPermissions")) {
            for (Player player : Bukkit.getOnlinePlayers()) {
                attachmentMap.get(player).setPermission("worldedit.navigation.jumpto.tool", true);
                attachmentMap.get(player).setPermission("worldedit.navigation.thru.tool", true);

                attachmentMap.get(player).setPermission("worldedit.navigation.jumpto.command", true);
                attachmentMap.get(player).setPermission("worldedit.navigation.thru.command", true);
            }
        }
    }

    public PermissionAttachment getPlayerAttachment(Player player) {
        return attachmentMap.get(player);
    }

    @EventHandler
    public void onRankChange(RankChangeEvent event) {
        String prefix = Rank.getPlayerPrefix(event.getPlayer().getUniqueId());
        event.getPlayer().setDisplayName(prefix + event.getTeam().getColor() + event.getPlayer().getName());
        event.getPlayer().setPlayerListName(prefix + event.getTeam().getColor() + event.getPlayer().getName());
    }

    @EventHandler(priority = EventPriority.MONITOR)
    public void onPlayerChangeTeamRank(PlayerChangeTeamEvent event) {
        Bukkit.getServer().getPluginManager().callEvent(new RankChangeEvent(event.getPlayer(), event.getNewTeam()));
    }

    @EventHandler(priority = EventPriority.MONITOR)
    public void onPlayerJoinRank(PlayerJoinEvent event) {
        Bukkit.getServer().getPluginManager().callEvent(new RankChangeEvent(event.getPlayer()));
    }

    public void disablePermission(Player player, String permission) {
        attachmentMap.get(player).unsetPermission(permission);
    }

    public void enablePermission(Player player, String permission) {
        attachmentMap.get(player).setPermission(permission, true);
    }

    public void mute(Player player) {
        if (!muted.contains(player)) {
            muted.add(player);
            disablePermission(player, "cardinal.chat.team");
            disablePermission(player, "cardinal.chat.global");
        }
    }

    public void unmute(Player player) {
        if (muted.contains(player)) {
            muted.remove(player);
            enablePermission(player, "cardinal.chat.team");
            enablePermission(player, "cardinal.chat.global");
        }
    }

    public boolean isMuted(Player player) {
        return muted.contains(player);
    }

}


text:
package org.activiti.runtime.api.event.impl;

import org.activiti.api.process.model.ProcessInstance;
import org.activiti.api.process.model.events.ProcessRuntimeEvent;
import org.activiti.api.process.runtime.events.ProcessCompletedEvent;
import org.activiti.api.runtime.event.impl.RuntimeEventImpl;

public class ProcessCompletedImpl extends RuntimeEventImpl<ProcessInstance, ProcessRuntimeEvent.ProcessEvents>
        implements ProcessCompletedEvent {

    public ProcessCompletedImpl(ProcessInstance entity) {
        super(entity);
        setProcessInstanceId(entity.getId());
    }

    @Override
    public ProcessEvents getEventType() {
        return ProcessEvents.PROCESS_COMPLETED;
    }

    @Override
    public String toString() {
        return "ProcessCompletedEventImpl{" + super.toString() + '}';
    }
}


text:
WhatsNearby
===========

A jQuery plugin to list and show nearby places around a certain position using Google Maps.

###[DEMO](http://lagrangemtl.github.io/WhatsNearby/example/index.html)

Dependencies
------------

- [jQuery](http://jquery.com)
- [Google Maps Javascript API v3](https://developers.google.com/maps/documentation/javascript/)
- [Google Places API](https://developers.google.com/places/)
- [ES5 Shim and Sham](https://github.com/kriskowal/es5-shim)

Basic usage
-----------

First, be sure to include all the above libraries. Then, include WhatsNearby :
````html
<script src="js/WhatsNearby.js" type="text/javascript"></script>
````

WhatsNearby must be attached to an html element :
````html
<div id="wn"></div>
````

Using jQuery, setup WhatsNearby on the selected element :
````js
$("#wn").whatsnearby();
````

You can customize WhatsNearby using an options argument (more details on all options will follow):
````js
$("#wn").whatsnearby({ zoom:14, address:"Montréal, Qc" });
````

Options
-------
````js
options: {
    address: "Montréal, Qc", //A string representing a physical address, this will be used as the center of the map
    lat: 45.509234, //The latitude coordinate of the center of the map (default if no address set)
    lng: -73.559067, //The longitude coordinate of the center of the map (default if no address set)
    width: 500 , //can be px or %
    height: 500, //can be px or %
    zoom : 8, //map zoom level
    mapType : google.maps.MapTypeId.ROADMAP, //ROADMAP, SATELLITE, HYBRID, TERRAIN
    placeMainMarker : true, //shows the marker for the center position of the map
    mainMarkerIcon : "", //if set, this image will replace the default marker icon
    placesTypes : ['store', 'gym'], //an array of places types
    placesTypesIcon : [], //if set, those images will replace type marker icons (must match placesTypes order)
    excludePlacesTypes : [], //an array of types that will be excluded from the search
    excludeByKeywords: [], //an array of string that will be excluded from the search (name of the place)
    placesRadius : 500 //the radius, in meters in which Places will be found
    disableDefaultUI: false,
    style: [], // pasted from https://snazzymaps.com/
    draggable:true, // Can you drag the map around
    scrollwheel:true, // Deactivate scrollwheel (very useful for mobile users!)
    backgroundColor: "#000000", // Background color under the map
    markercluster: false, // requires markercluster.js
    markerclusterStyles: [], // requires markercluster.js
    markerclusterOptions: {}, // requires markercluster.js
    centerOffsetX: 0, // offsets the center of the map
    centerOffsetY: 0,
    useInfoBox: false, // uses InfoBox to customize Info Windows
    infoBoxOptions: {}
},
````


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace EasySense.Models
{
    public class BillViewModel
    {
        public Guid ID { get; set; }

        public decimal Plan { get; set; }

        public decimal Actual { get; set; }

        public string Time { get; set; }

        public string Hint { get; set; }

        public int TypeAsInt { get; set; }

        public string Type { get; set; }

        public string RefNum { get; set; }

        public static implicit operator BillViewModel(BillModel Bill)
        {
            string refNum = null;
            if (Bill.Project != null)
            {
                refNum = Bill.Project.RefNum;
            }
            return new BillViewModel
            {
                ID = Bill.ID,
                Hint = Bill.Hint,
                Actual = Bill.Actual,
                Time = Bill.Time.ToString("yyyy-MM-dd"),
                Plan = Bill.Plan,
                TypeAsInt = Bill.Type,
                Type = BillModel.BillTypes[Bill.Type],
                RefNum = refNum
            };
        }
    }
}


text:
package in.devmetric.opportunityhackcwdr;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;

public class ResetPasswordActivity extends AppCompatActivity {

    private Button bSubmit;
    private EditText etNewPassword, etConfirmPassword;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_reset_password);

        bSubmit = (Button) findViewById(R.id.bSubmit);
        etNewPassword = (EditText) findViewById(R.id.etNewPassword);
        etConfirmPassword = (EditText) findViewById(R.id.etConfirmPassword);

        bSubmit.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                String newPass = etNewPassword.getText().toString();
                String confirmPass = etConfirmPassword.getText().toString();

                if(newPass.equals(confirmPass)) {
                    Toast.makeText(ResetPasswordActivity.this, "Cool! You did it :D", Toast.LENGTH_SHORT).show();
                } else {
                    Toast.makeText(ResetPasswordActivity.this, "Useless fellow can't copy the same password", Toast.LENGTH_SHORT).show();
                }
            }
        });
    }
}


text:
"""
This is a script originally written by Wikihermit and then rewritten by Filnik,
to delete the templates used to warn in the pages that a page is blocked, when
the page isn't blocked at all. Indeed, very often sysops block the pages for a
setted time but then the forget to delete the warning! This script is useful if
you want to delete those useless warning left in these pages.

Parameters:

These command line parameters can be used to specify which pages to work on:

&params;

-xml              Retrieve information from a local XML dump (pages-articles
                  or pages-meta-current, see http://download.wikimedia.org).
                  Argument can also be given as "-xml:filename".

-protectedpages:  Check all the blocked pages; useful when you have not
                  categories or when you have problems with them. (add the
                  namespace after ":" where you want to check - default checks
                  all protected pages.)

-moveprotected:   Same as -protectedpages, for moveprotected pages

Furthermore, the following command line parameters are supported:

-always         Doesn't ask every time if the bot should make the change or not,
                do it always.

-show           When the bot can't delete the template from the page (wrong
                regex or something like that) it will ask you if it should show
                the page on your browser.
                (attention: pages included may give false positives!)

-move           The bot will check if the page is blocked also for the move
                option, not only for edit

--- Warning! ---
You have to edit this script in order to add your preferences
otherwise the script won't work!

If you have problems, ask on botwiki ( http://botwiki.sno.cc )
or on IRC (#pywikipediabot)

--- Example of how to use the script ---

python blockpageschecker.py -always

python blockpageschecker.py -cat:Geography -always

python blockpageschecker.py -show -protectedpages:4

"""
#
# (C) Monobi a.k.a. Wikihermit, 2007
# (C) Filnik, 2007-2009
# (C) NicDumZ, 2008-2009
# (C) Pywikipedia bot team, 2007-2010
#
# Distributed under the terms of the MIT license.
#
__version__ = '$Id: blockpageschecker.py,v 1.5 2008/04/24 19.40.00 filnik Exp$'
#

import re, webbrowser
import pywikibot
from pywikibot import pagegenerators
from pywikibot import config

# This is required for the text that is shown when you run this script
# with the parameter -help.
docuReplacements = {
    '&params;':     pagegenerators.parameterHelp,
}

#######################################################
#--------------------- PREFERENCES -------------------#
################### -- Edit below! -- #################

templateSemiProtection = {
            'en': None,
            'it':[r'\{\{(?:[Tt]emplate:|)[Aa]vvisobloccoparziale(?:|[ _]scad\|.*?|\|.*?)\}\}',
                  r'\{\{(?:[Tt]emplate:|)[Aa]bp(?:|[ _]scad\|(?:.*?))\}\}'],
            'fr': [ur'\{\{(?:[Tt]emplate:|[Mm]odèle:|)[Ss]emi[- ]?protection(|[^\}]*)\}\}'],
            'ja':[ur'(?<!\<nowiki\>)\{\{(?:[Tt]emplate:|)半保護(?:[Ss]|)(?:\|.+|)\}\}(?!\<\/nowiki\>)\s*(?:\r\n|)*'],
            #'zh':[ur'\{\{(?:[Tt]emplate:|)Protected|(?:[Ss]|[Ss]emi|半)(?:\|.+|)\}\}(\n+?|)',ur'\{\{(?:[Tt]emplate:|)Mini-protected|(?:[Ss]|[Ss]emi|半)(?:\|.+|)\}\}(\n+?|)',ur'\{\{(?:[Tt]emplate:|)Protected-logo|(?:[Ss]|[Ss]emi|半)(?:\|.+|)\}\}(\n+?|)'],
            }
# Regex to get the total-protection template
templateTotalProtection = {
            'en': None,
            'it':[r'\{\{(?:[Tt]emplate:|)[Aa]vvisoblocco(?:|[ _]scad\|(?:.*?)|minaccia|cancellata)\}\}',
                  r'\{\{(?:[Tt]emplate:|)(?:[Cc][Tt]|[Cc]anc fatte|[Cc][Ee])\}\}', r'<div class="toccolours[ _]itwiki[ _]template[ _]avviso">(?:\s|\n)*?[Qq]uesta pagina'],
            'fr':[ur'\{\{(?:[Tt]emplate:|[Mm]odèle:|)[Pp]rotection(|[^\}]*)\}\}',
                 ur'\{\{(?:[Tt]emplate:|[Mm]odèle:|)(?:[Pp]age|[Aa]rchive|[Mm]odèle) protégée?(|[^\}]*)\}\}'],
            'ja':[ur'(?<!\<nowiki\>)\{\{(?:[Tt]emplate:|)保護(?:性急|)(?:[Ss]|)(?:\|.+|)\}\}(?!\<\/nowiki\>)\s*(?:\r\n|)*'],
            #'zh':[r'\{\{(?:[Tt]emplate:|)Protected|(?:[Nn]|[Nn]ormal)(?:\|.+|)\}\}(\n+?|)',r'\{\{(?:[Tt]emplate:|)Mini-protected|(?:[Nn]|[Nn]ormal)(?:\|.+|)\}\}(\n+?|)',r'\{\{(?:[Tt]emplate:|)Protected-logo|(?:[Nn]|[Nn]ormal)(?:\|.+|)\}\}(\n+?|)'],
            }
# Regex to get the semi-protection move template
templateSemiMoveProtection = {
            'en': None,
            'it':[r'\{\{(?:[Tt]emplate:|)[Aa]vvisobloccospostamento(?:|[ _]scad\|.*?|\|.*?)\}\}'],
            'ja':[ur'(?<!\<nowiki\>)\{\{(?:[Tt]emplate:|)移動半保護(?:[Ss]|)(?:\|.+|)\}\}(?!\<\/nowiki\>)\s*(?:\r\n|)*'],
            #'zh':[r'\{\{(?:[Tt]emplate:|)Protected|(?:MS|ms)(?:\|.+|)\}\}(\n+?|)',r'\{\{(?:[Tt]emplate:|)Mini-protected|(?:MS|ms)(?:\|.+|)\}\}(\n+?|)',r'\{\{(?:[Tt]emplate:|)Protected-logo|(?:MS|ms)(?:\|.+|)\}\}(\n+?|)'],
            }
# Regex to get the total-protection move template
templateTotalMoveProtection = {
            'en': None,
            'it':[r'\{\{(?:[Tt]emplate:|)[Aa]vvisobloccospostamento(?:|[ _]scad\|.*?|\|.*?)\}\}'],
            'ja':[ur'(?<!\<nowiki\>)\{\{(?:[Tt]emplate:|)移動保護(?:[Ss]|)(?:\|.+|)\}\}(?!\<\/nowiki\>)\s*(?:\r\n|)*'],
            #'zh':[ur'\{\{(?:[Tt]emplate:|)Protected|(?:[Mm]|[Mm]ove|移[動动])(?:\|.+|)\}\}(\n+?|)',ur'\{\{(?:[Tt]emplate:|)Mini-protected|(?:[Mm]|[Mm]ove|移[動动])(?:\|.+|)\}\}(\n+?|)',ur'\{\{(?:[Tt]emplate:|)Protected-logo|(?:[Mm]|[Mm]ove|移[動动])(?:\|.+|)\}\}(\n+?|)'],
            }

# If you use only one template for all the type of protection, put it here.
# You may use only one template or an unique template and some other "old" template that the
# script should still check (as on it.wikipedia)
templateUnique =  {
            'en': None,
            'it': [r'\{\{(?:[Tt]emplate:|)[Pp]rotetta\}\}'],
}

# Array: 0 => Semi-block, 1 => Total Block, 2 => Semi-Move, 3 => Total-Move, 4 => template-unique
templateNoRegex = {
            'it':['{{Avvisobloccoparziale}}', '{{Avvisoblocco}}', None, None, '{{Protetta}}'],
            'fr':['{{Semi-protection}}', '{{Protection}}', None, None, None],
            'ja':[u'{{半保護}}', u'{{保護}}', u'{{移動半保護}}', u'{{移動保護}}', None],
            #'zh':[u'{{Protected/semi}}',u'{{Protected}}',u'{{Protected/ms}}',u'{{Protected/move}}', None],
            }

# Category where the bot will check
categoryToCheck = {
            'en':[u'Category:Protected'],
            'ar':[u'تصنيف:محتويات محمية'],
            'fr':[u'Category:Page semi-protégée', u'Category:Page protégée', u'Catégorie:Article protégé'],
            'he':[u'קטגוריה:ויקיפדיה: דפים מוגנים', u'קטגוריה:ויקיפדיה: דפים מוגנים חלקית'],
            'it':[u'Categoria:Pagine protette - scadute', u'Categoria:Pagine semiprotette', u'Categoria:Voci protette'],
            'ja':[u'Category:編集保護中の記事',u'Category:編集半保護中の記事',
                u'Category:移動保護中の記事',],
            'pt':[u'Category:!Páginas protegidas', u'Category:!Páginas semiprotegidas'],
            'zh':[u'Category:被保护的页面',u'Category:被保護的模板',u'Category:暂时不能移动的页面',
                u'Category:被半保护的页面',],
            }
# Comment used when the Bot edits
comment = {
            'en':u'Bot: Deleting out-dated template',
            'ar':u'بوت: حذف قالب قديم',
            'fr':u'Robot: Mise à jour des bandeaux de protection',
            'he':u'בוט: מסיר תבנית שעבר זמנה',
            'it':u'Bot: Tolgo o sistemo template di avviso blocco',
            'ja':u'ロボットによる: 保護テンプレート除去',
            'pt':u'Bot: Retirando predefinição de proteção',
            'zh':u'機器人: 移除過期的保護模板',
            }
# Check list to block the users that haven't set their preferences
project_inserted = ['en', 'fr', 'it', 'ja', 'pt', 'zh']

#######################################################
#------------------ END PREFERENCES ------------------#
################## -- Edit above! -- ##################

def understandBlock(text, TTP, TSP, TSMP, TTMP, TU):
    """ Understand if the page is blocked and if it has the right template """
    if TTP != None:
        for catchRegex in TTP: # TTP = templateTotalProtection
            resultCatch = re.findall(catchRegex, text)
            if resultCatch:
                return ('sysop-total', catchRegex)
    if TSP != None:
        for catchRegex in TSP:
            resultCatch = re.findall(catchRegex, text)
            if resultCatch:
                return ('autoconfirmed-total', catchRegex)
    if TU != None:
        for catchRegex in TU:
            resultCatch = re.findall(catchRegex, text)
            if resultCatch:
                return ('unique', catchRegex)
    if TSMP != None and TTMP != None and TTP != TTMP and TSP != TSMP:
        for catchRegex in TTMP:
            resultCatch = re.findall(catchRegex, text)
            if resultCatch:
                return ('sysop-move', catchRegex)
        for catchRegex in TSMP:
            resultCatch = re.findall(catchRegex, text)
            if resultCatch:
                return ('autoconfirmed-move', catchRegex)
    # If editable means that we have no regex, won't change anything with this
    # regex
    return ('editable', r'\A\n')

def showQuest(site, page):
    quest = pywikibot.inputChoice(u'Do you want to open the page?',
                                  ['with browser', 'with gui', 'no'],
                                  ['b','g','n'], 'n')
    pathWiki = site.family.nicepath(site.lang)
    url = 'http://%s%s%s?&redirect=no' % (pywikibot.getSite().hostname(),
                                          pathWiki, page.urlname())
    if quest == 'b':
        webbrowser.open(url)
    elif quest == 'g':
        import editarticle
        editor = editarticle.TextEditor()
        text = editor.edit(page.get())

def main():
    """ Main Function """
    # Loading the comments
    global categoryToCheck, comment, project_inserted
    # always, define a generator to understand if the user sets one,
    # defining what's genFactory
    always = False; generator = False; show = False
    moveBlockCheck = False
    protectedpages = False
    protectType = 'edit'
    namespace = 0
    genFactory = pagegenerators.GeneratorFactory()
    # To prevent Infinite loops
    errorCount = 0
    # Loading the default options.
    for arg in pywikibot.handleArgs():
        if arg == '-always':
            always = True
        elif arg == '-move':
            moveBlockCheck = True
        elif arg == '-show':
            show = True
        elif arg.startswith('-protectedpages'):
            protectedpages = True
            if len(arg) > 15:
                namespace = int(arg[16:])
        elif arg.startswith('-moveprotected'):
            protectedpages = True
            protectType = 'move'
            if len(arg) > 14:
                namespace = int(arg[15:])
        else:
            genFactory.handleArg(arg)

    if config.mylang not in project_inserted:
        pywikibot.output(u"Your project is not supported by this script.\nYou have to edit the script and add it!")
        return
    site = pywikibot.getSite()
    if protectedpages:
        generator = site.protectedpages(namespace=namespace, type=protectType)
    # Take the right templates to use, the category and the comment
    TSP = pywikibot.translate(site, templateSemiProtection)
    TTP = pywikibot.translate(site, templateTotalProtection)
    TSMP = pywikibot.translate(site, templateSemiMoveProtection)
    TTMP = pywikibot.translate(site, templateTotalMoveProtection)
    TNR = pywikibot.translate(site, templateNoRegex)
    TU = pywikibot.translate(site, templateUnique)

    category = pywikibot.translate(site, categoryToCheck)
    commentUsed = pywikibot.translate(site, comment)
    if not generator:
        gen = genFactory.getCombinedGenerator()
    if not generator:
        generator = list()
        pywikibot.output(u'Loading categories...')
        # Define the category if no other generator has been setted
        for CAT in category:
            cat = pywikibot.Category(site, CAT)
            # Define the generator
            gen = pagegenerators.CategorizedPageGenerator(cat)
            for pageCat in gen:
                generator.append(pageCat)
        pywikibot.output(u'Categories loaded, start!')
    # Main Loop
    preloadingGen = pagegenerators.PreloadingGenerator(generator, step = 60)
    for page in preloadingGen:
        pagename = page.title(asLink=True)
        pywikibot.output('Loading %s...' % pagename)
        try:
            text = page.get()
            restrictions = site.page_restrictions(page)
        except pywikibot.NoPage:
            pywikibot.output("%s doesn't exist! Skipping..." % pagename)
            continue
        except pywikibot.IsRedirectPage:
            pywikibot.output("%s is a redirect! Skipping..." % pagename)
            if show:
                showQuest(site, page)
            continue
        """
        # This check does not work :
        # PreloadingGenerator cannot set correctly page.editRestriction
        # (see bug #1949476 )
        if not page.canBeEdited():
            pywikibot.output("%s is sysop-protected : this account can't edit it! Skipping..." % pagename)
            continue
        """
        if 'edit' in restrictions.keys():
            editRestr = restrictions['edit']
        else:
            editRestr = None
        if editRestr and editRestr[0] == 'sysop':
            try:
                config.sysopnames[site.family.name][site.lang]
            except:
                pywikibot.output("%s is sysop-protected : this account can't edit it! Skipping..." % pagename)
                continue

        # Understand, according to the template in the page, what should be the protection
        # and compare it with what there really is.
        TemplateInThePage = understandBlock(text, TTP, TSP, TSMP, TTMP, TU)
        # Only to see if the text is the same or not...
        oldtext = text
        # keep track of the changes for each step (edit then move)
        changes = -1

        if not editRestr:
            # page is not edit-protected
            # Deleting the template because the page doesn't need it.
            if TU != None:
                replaceToPerform = u'|'.join(TTP + TSP + TU)
            else:
                replaceToPerform = u'|'.join(TTP + TSP)
            text, changes = re.subn('<noinclude>(%s)</noinclude>' % replaceToPerform, '', text)
            if changes == 0:
                text, changes = re.subn('(%s)' % replaceToPerform, '', text)
            msg = u'The page is editable for all'
            if not moveBlockCheck:
                msg += u', deleting the template..'
            pywikibot.output(u'%s.' % msg)

        elif editRestr[0] == 'sysop':
            # total edit protection
            if (TemplateInThePage[0] == 'sysop-total' and TTP != None) or (TemplateInThePage[0] == 'unique' and TU != None):
                msg = 'The page is protected to the sysop'
                if not moveBlockCheck:
                    msg += ', skipping...'
                pywikibot.output(msg)
            else:
                pywikibot.output(u'The page is protected to the sysop, but the template seems not correct. Fixing...')
                if TU != None:
                    text, changes = re.subn(TemplateInThePage[1], TNR[4], text)
                else:
                    text, changes = re.subn(TemplateInThePage[1], TNR[1], text)

        elif TSP != None or TU != None:
            # implicitely editRestr[0] = 'autoconfirmed', edit-Semi-protection
            if TemplateInThePage[0] == 'autoconfirmed-total' or TemplateInThePage[0] == 'unique':
                msg = 'The page is editable only for the autoconfirmed users'
                if not moveBlockCheck:
                    msg += ', skipping...'
                pywikibot.output(msg)
            else:
                pywikibot.output(u'The page is editable only for the autoconfirmed users, but the template seems not correct. Fixing...')
                if TU != None:
                    text, changes = re.subn(TemplateInThePage[1], TNR[4], text)
                else:
                    text, changes = re.subn(TemplateInThePage[1], TNR[0], text)

        if changes == 0:
            # We tried to fix edit-protection templates, but it did not work.
            pywikibot.output('Warning : No edit-protection template could be found')

        if moveBlockCheck:
            # checking move protection now
            moveRestr = restrictions['move']
            changes = -1

            if not moveRestr:
                pywikibot.output(u'The page is movable for all, deleting the template...')
                # Deleting the template because the page doesn't need it.
                if TU != None:
                    replaceToPerform = u'|'.join(TSMP + TTMP + TU)
                else:
                    replaceToPerform = u'|'.join(TSMP + TTMP)
                text, changes = re.subn('<noinclude>(%s)</noinclude>' % replaceToPerform, '', text)
                if changes == 0:
                    text, changes = re.subn('(%s)' % replaceToPerform, '', text)
            elif moveRestr[0] == 'sysop':
                # move-total-protection
                if (TemplateInThePage[0] == 'sysop-move' and TTMP != None) or (TemplateInThePage[0] == 'unique' and TU != None):
                    pywikibot.output(u'The page is protected from moving to the sysop, skipping...')
                    if TU != None:
                        text = oldtext # no changes needed, better to revert the old text.
                else:
                    pywikibot.output(u'The page is protected from moving to the sysop, but the template seems not correct. Fixing...')
                    if TU != None:
                        text, changes = re.subn(TemplateInThePage[1], TNR[4], text)
                    else:
                        text, changes = re.subn(TemplateInThePage[1], TNR[3], text)

            elif TSMP != None or TU != None:
                # implicitely moveRestr[0] = 'autoconfirmed', move-semi-protection
                if TemplateInThePage[0] == 'autoconfirmed-move' or TemplateInThePage[0] == 'unique':
                    pywikibot.output(u'The page is movable only for the autoconfirmed users, skipping...')
                    if TU != None:
                        text = oldtext # no changes needed, better to revert the old text.
                else:
                    pywikibot.output(u'The page is movable only for the autoconfirmed users, but the template seems not correct. Fixing...')
                    if TU != None:
                        text, changes = re.subn(TemplateInThePage[1], TNR[4], text)
                    else:
                        text, changes = re.subn(TemplateInThePage[1], TNR[2], text)

            if changes == 0:
                # We tried to fix move-protection templates, but it did not work.
                pywikibot.output('Warning : No move-protection template could be found')

        if oldtext != text:
            # Ok, asking if the change has to be performed and do it if yes.
            pywikibot.output(u"\n\n>>> \03{lightpurple}%s\03{default} <<<" % page.title())
            pywikibot.showDiff(oldtext, text)
            if not always:
                choice = pywikibot.inputChoice(u'Do you want to accept these changes?', ['Yes', 'No', 'All'], ['y', 'N', 'a'], 'N')
                if choice == 'a':
                    always = True
            if always or choice == 'y':
                while 1:
                    try:
                        page.put(text, commentUsed, force=True)
                    except pywikibot.EditConflict:
                        pywikibot.output(u'Edit conflict! skip!')
                        break
                    except pywikibot.ServerError:
                        # Sometimes there is this error that's quite annoying because
                        # can block the whole process for nothing.
                        errorCount += 1
                        if errorCount < 5:
                            pywikibot.output(u'Server Error! Wait..')
                            time.sleep(3)
                            continue
                        else:
                            # Prevent Infinite Loops
                            raise pywikibot.ServerError(u'Fifth Server Error!')
                    except pywikibot.SpamfilterError, e:
                        pywikibot.output(u'Cannot change %s because of blacklist entry %s' % (page.title(), e.url))
                        break
                    except pywikibot.PageNotSaved, error:
                        pywikibot.output(u'Error putting page: %s' % (error.args,))
                        break
                    except pywikibot.LockedPage:
                        pywikibot.output(u'The page is still protected. Skipping...')
                        break
                    else:
                        # Break only if the errors are one after the other
                        errorCount = 0
                        break

if __name__ == "__main__":
    try:
        main()
    finally:
        pywikibot.stopme()


text:
var rAF = window.requestAnimationFrame	||
	window.webkitRequestAnimationFrame	||
	window.mozRequestAnimationFrame		||
	window.oRequestAnimationFrame		||
	window.msRequestAnimationFrame		||
	function (callback) { window.setTimeout(callback, 1000 / 60); };

var utils = (function () {
	var me = {};

	var _elementStyle = document.createElement('div').style;
	var _vendor = (function () {
		var vendors = ['t', 'webkitT', 'MozT', 'msT', 'OT'],
			transform,
			i = 0,
			l = vendors.length;

		for ( ; i < l; i++ ) {
			transform = vendors[i] + 'ransform';
			if ( transform in _elementStyle ) return vendors[i].substr(0, vendors[i].length-1);
		}

		return false;
	})();

	function _prefixStyle (style) {
		if ( _vendor === false ) return false;
		if ( _vendor === '' ) return style;
		return _vendor + style.charAt(0).toUpperCase() + style.substr(1);
	}

	me.getTime = Date.now || function getTime () { return new Date().getTime(); };

	me.extend = function (target, obj) {
		for ( var i in obj ) {
			target[i] = obj[i];
		}
	};

	me.addEvent = function (el, type, fn, capture) {
		el.addEventListener(type, fn, !!capture);
	};

	me.removeEvent = function (el, type, fn, capture) {
		el.removeEventListener(type, fn, !!capture);
	};

	me.prefixPointerEvent = function (pointerEvent) {
		return window.MSPointerEvent ?
			'MSPointer' + pointerEvent.charAt(7).toUpperCase() + pointerEvent.substr(8):
			pointerEvent;
	};

	me.momentum = function (current, start, time, lowerMargin, wrapperSize, deceleration) {
		var distance = current - start,
			speed = Math.abs(distance) / time,
			destination,
			duration;

		deceleration = deceleration === undefined ? 0.0006 : deceleration;

		destination = current + ( speed * speed ) / ( 2 * deceleration ) * ( distance < 0 ? -1 : 1 );
		duration = speed / deceleration;

		if ( destination < lowerMargin ) {
			destination = wrapperSize ? lowerMargin - ( wrapperSize / 2.5 * ( speed / 8 ) ) : lowerMargin;
			distance = Math.abs(destination - current);
			duration = distance / speed;
		} else if ( destination > 0 ) {
			destination = wrapperSize ? wrapperSize / 2.5 * ( speed / 8 ) : 0;
			distance = Math.abs(current) + destination;
			duration = distance / speed;
		}

		return {
			destination: Math.round(destination),
			duration: duration
		};
	};

	var _transform = _prefixStyle('transform');

	me.extend(me, {
		hasTransform: _transform !== false,
		hasPerspective: _prefixStyle('perspective') in _elementStyle,
		hasTouch: 'ontouchstart' in window,
		hasPointer: !!(window.PointerEvent || window.MSPointerEvent), // IE10 is prefixed
		hasTransition: _prefixStyle('transition') in _elementStyle
	});

	/*
	This should find all Android browsers lower than build 535.19 (both stock browser and webview)
	- galaxy S2 is ok
    - 2.3.6 : `AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1`
    - 4.0.4 : `AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30`
   - galaxy S3 is badAndroid (stock brower, webview)
     `AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30`
   - galaxy S4 is badAndroid (stock brower, webview)
     `AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30`
   - galaxy S5 is OK
     `AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Mobile Safari/537.36 (Chrome/)`
   - galaxy S6 is OK
     `AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Mobile Safari/537.36 (Chrome/)`
  */
	me.isBadAndroid = (function() {
		var appVersion = window.navigator.appVersion;
		// Android browser is not a chrome browser.
		if (/Android/.test(appVersion) && !(/Chrome\/\d/.test(appVersion))) {
			var safariVersion = appVersion.match(/Safari\/(\d+.\d)/);
			if(safariVersion && typeof safariVersion === "object" && safariVersion.length >= 2) {
				return parseFloat(safariVersion[1]) < 535.19;
			} else {
				return true;
			}
		} else {
			return false;
		}
	})();

	me.extend(me.style = {}, {
		transform: _transform,
		transitionTimingFunction: _prefixStyle('transitionTimingFunction'),
		transitionDuration: _prefixStyle('transitionDuration'),
		transitionDelay: _prefixStyle('transitionDelay'),
		transformOrigin: _prefixStyle('transformOrigin')
	});

	me.hasClass = function (e, c) {
		var re = new RegExp("(^|\\s)" + c + "(\\s|$)");
		return re.test(e.className);
	};

	me.addClass = function (e, c) {
		if ( me.hasClass(e, c) ) {
			return;
		}

		var newclass = e.className.split(' ');
		newclass.push(c);
		e.className = newclass.join(' ');
	};

	me.removeClass = function (e, c) {
		if ( !me.hasClass(e, c) ) {
			return;
		}

		var re = new RegExp("(^|\\s)" + c + "(\\s|$)", 'g');
		e.className = e.className.replace(re, ' ');
	};

	me.offset = function (el) {
		var left = -el.offsetLeft,
			top = -el.offsetTop;

		// jshint -W084
		while (el = el.offsetParent) {
			left -= el.offsetLeft;
			top -= el.offsetTop;
		}
		// jshint +W084

		return {
			left: left,
			top: top
		};
	};

	me.preventDefaultException = function (el, exceptions) {
		for ( var i in exceptions ) {
			if ( exceptions[i].test(el[i]) ) {
				return true;
			}
		}

		return false;
	};

	me.extend(me.eventType = {}, {
		touchstart: 1,
		touchmove: 1,
		touchend: 1,

		mousedown: 2,
		mousemove: 2,
		mouseup: 2,

		pointerdown: 3,
		pointermove: 3,
		pointerup: 3,

		MSPointerDown: 3,
		MSPointerMove: 3,
		MSPointerUp: 3
	});

	me.extend(me.ease = {}, {
		quadratic: {
			style: 'cubic-bezier(0.25, 0.46, 0.45, 0.94)',
			fn: function (k) {
				return k * ( 2 - k );
			}
		},
		circular: {
			style: 'cubic-bezier(0.1, 0.57, 0.1, 1)',	// Not properly "circular" but this looks better, it should be (0.075, 0.82, 0.165, 1)
			fn: function (k) {
				return Math.sqrt( 1 - ( --k * k ) );
			}
		},
		back: {
			style: 'cubic-bezier(0.175, 0.885, 0.32, 1.275)',
			fn: function (k) {
				var b = 4;
				return ( k = k - 1 ) * k * ( ( b + 1 ) * k + b ) + 1;
			}
		},
		bounce: {
			style: '',
			fn: function (k) {
				if ( ( k /= 1 ) < ( 1 / 2.75 ) ) {
					return 7.5625 * k * k;
				} else if ( k < ( 2 / 2.75 ) ) {
					return 7.5625 * ( k -= ( 1.5 / 2.75 ) ) * k + 0.75;
				} else if ( k < ( 2.5 / 2.75 ) ) {
					return 7.5625 * ( k -= ( 2.25 / 2.75 ) ) * k + 0.9375;
				} else {
					return 7.5625 * ( k -= ( 2.625 / 2.75 ) ) * k + 0.984375;
				}
			}
		},
		elastic: {
			style: '',
			fn: function (k) {
				var f = 0.22,
					e = 0.4;

				if ( k === 0 ) { return 0; }
				if ( k == 1 ) { return 1; }

				return ( e * Math.pow( 2, - 10 * k ) * Math.sin( ( k - f / 4 ) * ( 2 * Math.PI ) / f ) + 1 );
			}
		}
	});

	me.tap = function (e, eventName) {
		var ev = document.createEvent('Event');
		ev.initEvent(eventName, true, true);
		ev.pageX = e.pageX;
		ev.pageY = e.pageY;
		e.target.dispatchEvent(ev);
	};

	me.click = function (e) {
		var target = e.target,
			ev;

		if ( !(/(SELECT|INPUT|TEXTAREA)/i).test(target.tagName) ) {
			// https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/initMouseEvent
			// initMouseEvent is deprecated.
			ev = document.createEvent(window.MouseEvent ? 'MouseEvents' : 'Event');
			ev.initEvent('click', true, true);
			ev.view = e.view || window;
			ev.detail = 1;
			ev.screenX = target.screenX || 0;
			ev.screenY = target.screenY || 0;
			ev.clientX = target.clientX || 0;
			ev.clientY = target.clientY || 0;
			ev.ctrlKey = !!e.ctrlKey;
			ev.altKey = !!e.altKey;
			ev.shiftKey = !!e.shiftKey;
			ev.metaKey = !!e.metaKey;
			ev.button = 0;
			ev.relatedTarget = null;
			ev._constructed = true;
			target.dispatchEvent(ev);
		}
	};

	me.getRect = function(el) {
		if (el instanceof SVGElement) {
			var rect = el.getBoundingClientRect();
			return {
				top : rect.top,
				left : rect.left,
				width : rect.width,
				height : rect.height
			};
		} else {
			return {
				top : el.offsetTop,
				left : el.offsetLeft,
				width : el.offsetWidth,
				height : el.offsetHeight
			};
		}
	};

	return me;
})();


text:
package com.tomorrowhi.thdemo.activitys;

import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ImageButton;
import android.widget.ProgressBar;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.blankj.utilcode.util.LogUtils;
import com.tomorrowhi.thdemo.R;
import com.tomorrowhi.thdemo.base.BaseActivity;
import com.tomorrowhi.thdemo.bean.AndroidApiTest;
import com.tomorrowhi.thdemo.bean.Repos;
import com.tomorrowhi.thdemo.bean.ResBaseModel;
import com.tomorrowhi.thdemo.bean.ShangHaiBean;
import com.tomorrowhi.thdemo.util.retrofitUtils.RetrofitResult;
import com.tomorrowhi.thdemo.util.retrofitUtils.RetrofitTools;
import com.trello.rxlifecycle2.android.ActivityEvent;

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

import butterknife.BindView;
import butterknife.OnClick;
import io.reactivex.Observable;

/**
 * Created by zhaotaotao on 10/01/2017.
 * retrofit 2 使用
 */
public class RetrofitActivity extends BaseActivity {
    @BindView(R.id.title_return_iv)
    ImageButton titleReturnIv;
    @BindView(R.id.retrofit_result_tv)
    TextView retrofitResultTv;
    @BindView(R.id.app_upgrade_progress_bar)
    ProgressBar appUpgradeProgressBar;
    @BindView(R.id.app_upgrade_progress_bar_tv)
    TextView appUpgradeProgressBarTv;
    @BindView(R.id.app_update_download_rl)
    RelativeLayout appUpdateDownloadRl;
    @BindView(R.id.retrofit_post)
    Button retrofitPost;
    @BindView(R.id.retrofit_get)
    Button retrofitGet;
    @BindView(R.id.retrofit_download)
    Button retrofitDownload;

    private List<AndroidApiTest> apiTests;
    private ResBaseModel<ShangHaiBean> shangHaiBeanResBaseModel;

    @Override
    protected int getLayoutRes() {
        return R.layout.activity_retrofit;
    }

    @Override
    protected void initComplete(Bundle savedInstanceState) {

    }

    @Override
    protected void initEvent() {

    }

    @Override
    protected void initData() {

    }

    @Override
    protected void initView() {

    }

    @Override
    protected void init(Bundle savedInstanceState) {
    }

    @OnClick({R.id.title_return_iv, R.id.retrofit_post, R.id.retrofit_get, R.id.retrofit_download})
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.title_return_iv:
                this.finish();
                break;
            case R.id.retrofit_post:
                //TODO retrofit
                break;
            case R.id.retrofit_get:
                Observable<Repos> reposObservable = myApplication.httpApis().getRepos();
                reposObservable.compose(this.bindUntilEvent(ActivityEvent.DESTROY));
                RetrofitTools.httpRequest(false, false, null, null,
                        mCompositeDisposable, reposObservable, new RetrofitResult() {
                            @Override
                            public void handleResponse(Object object) {
                                Repos repos = (Repos) object;
                                LogUtils.d("Repos " + repos.toString());
                                LogUtils.d("Repos handleResponse");
                            }

                            @Override
                            public void handleError(Throwable error) {
                                LogUtils.d("Repos handleError");
                            }

                            @Override
                            public void handleComplete() {
                                LogUtils.d("Repos handleComplete");
                            }
                        });

                Observable<List<AndroidApiTest>> compose = myApplication.httpApis().androidApiTest();
                compose.compose(this.bindUntilEvent(ActivityEvent.DESTROY));
                RetrofitTools.httpRequest(true, true, mContext, "正在加载AndroidAPI数据",
                        mCompositeDisposable, compose, new RetrofitResult() {
                            @Override
                            public void handleResponse(Object object) {
                                apiTests = (List<AndroidApiTest>) object;
                                retrofitResultTv.setText(Arrays.toString(apiTests.toArray()));
                            }

                            @Override
                            public void handleError(Throwable error) {
                                LogUtils.d(error.toString());
                            }

                            @Override
                            public void handleComplete() {
                                LogUtils.d("请求结束2");
                            }
                        });
                Observable<ResBaseModel<ShangHaiBean>> demo = myApplication.httpApis().getShanghaiData("demo");
                demo.compose(this.bindUntilEvent(ActivityEvent.DESTROY));
                RetrofitTools.httpCommonRequest(false, false, null, null,
                        mCompositeDisposable, demo, new RetrofitResult() {

                            @Override
                            public void handleResponse(Object object) {
                                if (object != null) {
                                    shangHaiBeanResBaseModel = (ResBaseModel<ShangHaiBean>) object;
                                    LogUtils.d("shangHaiBeanResBaseModel:" + shangHaiBeanResBaseModel.toString());
                                }
                            }

                            @Override
                            public void handleError(Throwable error) {
                                LogUtils.d(error.toString());
                            }

                            @Override
                            public void handleComplete() {
                                LogUtils.d("请求结束3");
                            }
                        });
                break;
            case R.id.retrofit_download:
                break;
        }
    }

}


text:
package cromwell.services.instrumentation.impl.stackdriver

import com.typesafe.config.ConfigFactory
import common.exception.AggregatedMessageException
import cromwell.core.TestKitSuite
import org.scalatest.BeforeAndAfterAll
import org.scalatest.flatspec.AnyFlatSpecLike
import org.scalatest.matchers.should.Matchers

import scala.concurrent.duration._

class StackdriverConfigSpec extends TestKitSuite with AnyFlatSpecLike with BeforeAndAfterAll with Matchers {
  behavior of "StackdriverConfig"

  val googleConfig = ConfigFactory.parseString(
    s"""
       |google {
       |  application-name = "cromwell"
       |  auths = [
       |    {
       |      name = "application-default"
       |      scheme = "application_default"
       |    }
       |  ]
       |}
      """.stripMargin
  )

  it should "correctly parse all config" in {
    val config = ConfigFactory.parseString(
      """
        |auth = "application-default"
        |google-project = "my-project"
        |flush-rate = 1 minute
        |cromwell-instance-role = "backend"
        |cromwell-perf-test-case = "perf-test-1"
      """.stripMargin
    )

    val stackdriverConfig = StackdriverConfig(config, googleConfig)

    stackdriverConfig.auth.name shouldBe "application-default"
    stackdriverConfig.googleProject shouldBe "my-project"
    stackdriverConfig.flushRate shouldBe 1.minute
    stackdriverConfig.cromwellInstanceRole shouldBe Option("backend")
    stackdriverConfig.cromwellPerfTestCase shouldBe Option("perf-test-1")
  }

  it should "correctly parse config with optional values" in {
    val config = ConfigFactory.parseString(
      """
        |auth = "application-default"
        |google-project = "my-project"
        |flush-rate = 1 minute
      """.stripMargin
    )

    val stackdriverConfig = StackdriverConfig(config, googleConfig)

    stackdriverConfig.auth.name shouldBe "application-default"
    stackdriverConfig.googleProject shouldBe "my-project"
    stackdriverConfig.flushRate shouldBe 1.minute
    stackdriverConfig.cromwellInstanceIdentifier shouldBe None
    stackdriverConfig.cromwellInstanceRole shouldBe None
    stackdriverConfig.cromwellPerfTestCase shouldBe None
  }

  it should "correctly add cromwell instance identifier to config" in {
    val globalConfig = ConfigFactory.parseString(
      s"""
         |google {
         |  application-name = "cromwell"
         |  auths = [
         |    {
         |      name = "application-default"
         |      scheme = "application_default"
         |    }
         |  ]
         |}
         |
         |system.cromwell_id = "cromwell-101"
      """.stripMargin
    )

    val config = ConfigFactory.parseString(
      """
        |auth = "application-default"
        |google-project = "my-project"
        |flush-rate = 1 minute
      """.stripMargin
    )

    val stackdriverConfig = StackdriverConfig(config, globalConfig)

    stackdriverConfig.auth.name shouldBe "application-default"
    stackdriverConfig.googleProject shouldBe "my-project"
    stackdriverConfig.flushRate shouldBe 1.minute
    stackdriverConfig.cromwellInstanceIdentifier shouldBe Option("cromwell-101")
    stackdriverConfig.cromwellInstanceRole shouldBe None
    stackdriverConfig.cromwellPerfTestCase shouldBe None
  }

  it should "throw error for invalid auth" in {
    val config = ConfigFactory.parseString(
      """
        |auth = "my-auth"
        |google-project = "my-project"
        |flush-rate = 1 minute
      """.stripMargin
    )

    val exception = the[AggregatedMessageException] thrownBy StackdriverConfig(config, googleConfig)

    exception.getMessage shouldBe """Stackdriver instrumentation config is invalid. Error(s):
                                    |`auth` scheme is invalid. Errors: NonEmptyList(`google` configuration stanza does not contain an auth named 'my-auth'.  Known auth names: application-default)""".stripMargin
  }

  it should "throw error for invalid flush rate" in {
    val config = ConfigFactory.parseString(
      """
        |auth = "application-default"
        |google-project = "my-project"
        |flush-rate = 30 seconds
      """.stripMargin
    )

    val exception = the[AggregatedMessageException] thrownBy StackdriverConfig(config, googleConfig)

    exception.getMessage shouldBe """Stackdriver instrumentation config is invalid. Error(s):
                                    |`flush-rate` must be 1 minute or longer, specified rate is `30 seconds`. Google's Stackdriver API needs each metric to be sent not more than once per minute.""".stripMargin
  }
}


text:
<?php

defined('BASEPATH') OR exit('No direct script access allowed');

$lang['pagination_first_link'] = '‹ 第一頁';
$lang['pagination_next_link'] = '>';
$lang['pagination_prev_link'] = '<';
$lang['pagination_last_link'] = '最後一頁 ›';

/* End of file pagination_lang.php */
/* Location: ./application/language/traditional-chinese/pagination_lang.php */