text:
<?php

namespace Worker\Controller;

use Application\Model\Logger;
use Zend\Mvc\Controller\AbstractActionController;
use Zend\View\Model\ViewModel;
use Exception;

class WorkerController extends AbstractActionController
{
    protected $_workerTable;

    public function indexAction()
    {
        $vm = null;
        try{
            $basePath = $this->getRequest()->getBasePath();
            $cf = new \AdminBase\Model\AdminMenu();
            $menu = $cf->getMenu('员工管理', $basePath);
            $arr = array(
                "workerTable" => $this->getWorkerTable()->fetchSlice(1,10,null),
                "count" => $this->getWorkerTable()->fetchCount(),
                "menu" => $menu,
            );
            $fw = $this->forward();
            $this->layout()->setVariable("topNavbar",$fw->dispatch('Application\Controller\Plugin',array(
                "action" => "topnavbar",
            )));
            $this->layout()->setVariable("adminHeader",$fw->dispatch('Application\Controller\Plugin',array(
                "action" => "adminHeader",
            )));
            $this->layout()->setVariable("footer",$fw->dispatch('Application\Controller\Plugin',array(
                "action" => "footer",
            )));
            $vm =  new ViewModel($arr);
        }catch (Exception $e){
            $logger = new Logger();
            $logger->err($e->getCode(), $e->getMessage());
        }
        return $vm;
    }

    public function searchAction(){
        $request = $this->getRequest();
        $response = $this->getResponse();
        try{
            if($request->isPost()){
                $data = $request->getPost();
                $state = $data["state"];
                $text = $data["searchText"];
                $where = array();
                if($state != "0")
                    $where[] = "state = ".$state;
                if($text!="")
                    $where[] = "(username like '%".$text."%' or name like '%".$text."%')";
                //check text
                if($text!=""){
                    $regex = new \Application\Model\Regex();
                    $regex->flush()->checkSearchText($text);
                    if($regex->getCode() != 0){
                        $response->setContent(\Zend\Json\Json::encode(array("state" => false, "code" => $regex->getCode(), "message"=>$regex->getMessage())));
                        return $response;
                    }
                }
                $slice = $this->getWorkerTable()->fetchSlice((int)$data["curPage"], (int)$data["pageCount"], $where);
                $all = $this->getWorkerTable()->fetchCount($where);
                $cnt = count($slice);
                $workers = array();
                for($k=0; $k<$cnt; $k++){
                    $workers[$k]["id"] = (int)($slice[$k]->getID());
                    $workers[$k]["username"] = $slice[$k]->getUsername();
                    $workers[$k]["name"] = $slice[$k]->getName();
                    $workers[$k]["sex"] = $slice[$k]->getSex();
                    $workers[$k]["certNumber"] = $slice[$k]->getCertNumber();
                    $workers[$k]["phone"] = $slice[$k]->getPhone();
                    $workers[$k]["state"] = (int)($slice[$k]->getState());
                }
                if($cnt == 0)
                    $response->setContent(\Zend\Json\Json::encode(array("state" => true, "count" => 0)));
                else
                    $response->setContent(\Zend\Json\Json::encode(array("state" => true, "count" => $all, "workerTable" => $workers), true));
            }
        }catch (Exception $e){
            $logger = new Logger();
            $logger->err($e->getCode(), $e->getMessage());
        }
        return $response;
    }

    public function addAction(){
        $request = $this->getRequest();
        $response = $this->getResponse();
        $message = "";
        $code = 0;
        try{
            do{
                if($request->isPost()){
                    $data = $request->getPost();
                    $worker = new \Application\Entity\Worker();
                    $worker->setOptions(array(
                        "ID" => 0,
                        "Username" => $data["username"],
                        "Password" => $data["password"],
                        "Name" => $data["name"],
                        "Sex" => $data["sex"],
                        "CertNumber" => $data["certNumber"],
                        "Phone" => $data["phone"],
                        "SelfPhone" => $data["selfPhone"]
                    ));
                    //check worker
                    $regex = new \Application\Model\Regex();
                    $regex->flush()
                        ->checkWorkerUsername($worker->getUsername())
                        ->checkPassword($worker->getPassword())
                        ->checkRealName($worker->getName())
                        ->checkSex($worker->getSex())
                        ->checkCertNumber($worker->getCertNumber())
                        ->checkPhone($worker->getPhone());
                    if($worker->getSelfPhone()!="") $regex->checkPhone($worker->getSelfPhone());
                    if($regex->getCode() != 0){
                        $code = $regex->getCode();
                        $message = $regex->getMessage();
                        break;
                    }
                    //check username exist
                    $exist = $this->getWorkerTable()->select(array("username"=>$worker->getUsername()))->current();
                    if($exist){
                        $code = 101;
                        $message = "工号已存在";
                        break;
                    }
                    //insert
                    $workerId = $this->getWorkerTable()->saveWorker($worker);
                    if(!$workerId){
                        $code = 100;
                        $message = "添加员工失败";
                        break;
                    }else{
                        $response->setContent(\Zend\Json\Json::encode(array("state" => true, "id" => $workerId)));
                    }
                }
            }while(false);
        }catch (Exception $e){
            $logger = new Logger();
            $logger->err($e->getCode(), $e->getMessage());
        }
        if($code!=0){
            $response->setContent(\Zend\Json\Json::encode(array("state" => false, "code" => $code, "message" => $message)));
        }
        return $response;
    }

    public function viewAction(){
        $request = $this->getRequest();
        $response = $this->getResponse();
        try{
            if($request->isPost()){
                $data = $request->getPost();
                $wid = $data["id"];
                if(!$worker = $this->getWorkerTable()->getWorker($wid)){
                    $response->setContent(\Zend\Json\Json::encode(array("state" => false)));
                }else{
                    $response->setContent(\Zend\Json\Json::encode(array(
                        "state" => true,
                        "worker" => array(
                            "id" => $worker->getID(),
                            "username" => $worker->getUsername(),
                            "name" => $worker->getName(),
                            "certNumber" => $worker->getCertNumber(),
                            "sex" => $worker->getSex(),
                            "phone" => $worker->getPhone(),
                            "selfPhone" => $worker->getSelfPhone(),
                            "loginIP" => $worker->getLoginIP(),
                            "loginTime" => $worker->getLoginTime(),
                            "state" => $worker->getState()
                        ),
                    )));
                }
            }
        }catch (Exception $e){
            $logger = new Logger();
            $logger->err($e->getCode(), $e->getMessage());
        }
        return $response;
    }

    public function editAction(){
        $request = $this->getRequest();
        $response = $this->getResponse();
        $message = "";
        $code = 0;
        try{
            do{
                if($request->isPost()){
                    $data = $request->getPost();
                    $worker = new \Application\Entity\Worker();
                    $worker->setOptions(array(
                        "ID" => $data["id"],
                        "Username" => $data["username"],
                        "Password" => $data["password"],
                        "Name" => $data["name"],
                        "Sex" => $data["sex"],
                        "CertNumber" => $data["certNumber"],
                        "Phone" => $data["phone"],
                        "SelfPhone" => $data["selfPhone"],
                        "State" => $data["state"]
                    ));
                    //check worker
                    $regex = new \Application\Model\Regex();
                    $regex->flush()
                        ->checkRealName($worker->getName())
                        ->checkSex($worker->getSex())
                        ->checkCertNumber($worker->getCertNumber())
                        ->checkPhone($worker->getPhone())
                        ->checkState($worker->getState());
                    if($worker->getPassword()!="") $regex->checkPassword($worker->getPassword());
                    if($worker->getSelfPhone()!="") $regex->checkPhone($worker->getSelfPhone());
                    if($regex->getCode() != 0){
                        $code = $regex->getCode();
                        $message = $regex->getMessage();
                        break;
                    }
                    //update
                    if(!$wid = $this->getWorkerTable()->saveWorker($worker)){
                        $code = 101;
                        $message = "数据没有更新";
                        break;
                    }
                }
            }while(false);
        }catch (Exception $e){
            $logger = new Logger();
            $logger->err($e->getCode(), $e->getMessage());
        }
        if($code!=0){
            $response->setContent(\Zend\Json\Json::encode(array("state"=>false, "code"=>$code, "message"=>$message)));
        }else{
            $response->setContent(\Zend\Json\Json::encode(array("state"=>true)));
        }
        return $response;
    }

    /**
     * @return \Worker\Model\WorkerTable
     */
    public function  getWorkerTable(){
        if(!$this->_workerTable){
            $t = $this->getServiceLocator();
            $this->_workerTable = $t->get('Worker\Model\WorkerTable');
        }
        return $this->_workerTable;
    }
    public function fooAction()
    {
        // This shows the :controller and :action parameters in default route
        // are working when you browse to /worker/worker/foo
        return array();
    }
}


text:
var n = prompt("Enter an Integer. Ten Digits or Less.", "");

var firstDigit = n.toString();
var firstSlice = firstDigit.slice(0,1);
var secondSlice = firstDigit.slice(1,2);
var thirdSlice = firstDigit.slice(2,3);
var fourthSlice = firstDigit.slice(3,4);
var fifthSlice = firstDigit.slice(4,5);
var sixthSlice = firstDigit.slice(5,6);
var seventhSlice = firstDigit.slice(6,7);
var eighthSlice = firstDigit.slice(7,8);
var ninthSlice = firstDigit.slice(8,9);
var tenthSlice = firstDigit.slice(9,10);

var sliceDigitOne = parseInt(firstSlice);
var sliceDigitTwo = parseInt(secondSlice);
var sliceDigitThree = parseInt(thirdSlice);
var sliceDigitFour = parseInt(fourthSlice);
var sliceDigitFive = parseInt(fifthSlice);
var sliceDigitSix = parseInt(sixthSlice);
var sliceDigitSeven = parseInt(seventhSlice);
var sliceDigitEight = parseInt(eighthSlice);
var sliceDigitNine = parseInt(ninthSlice);
var sliceDigitTen = parseInt(tenthSlice);

var dubdigitOneTwo = (firstSlice + secondSlice);
var dubdigitTwoThree = (secondSlice + thirdSlice);
var dubdigitThreeFour = (thirdSlice + fourthSlice);
var dubdigitFourFive = (fourthSlice + fifthSlice);
var dubdigitFiveSix = (fifthSlice + sixthSlice);
var dubdigitSixSeven = (sixthSlice + seventhSlice);
var dubdigitSevenEight = (seventhSlice + eighthSlice);
var dubdigitEightNine = (eighthSlice + ninthSlice);
var dubdigitNineTen = (ninthSlice + tenthSlice);

var sliceDigitBone = (dubdigitOneTwo);
var sliceDigitBtwo = (dubdigitTwoThree);
var sliceDigitBthree = (dubdigitThreeFour);
var sliceDigitBfour = (dubdigitFourFive);
var sliceDigitBfive = (dubdigitFiveSix);
var sliceDigitBsix = (dubdigitSixSeven);
var sliceDigitBseven = (dubdigitSevenEight);
var sliceDigitBeight = (dubdigitEightNine);
var sliceDigitBnine = (dubdigitNineTen);

var tripdigitOneTwoThree = (firstSlice + secondSlice + thirdSlice);
var tripdigitTwoThreeFour = (secondSlice + thirdSlice + fourthSlice);
var tripdigitThreeFourFive = (thirdSlice + fourthSlice + fifthSlice);
var tripdigitFourFiveSix = (fourthSlice + fifthSlice + sixthSlice);
var tripdigitFiveSixSeven = (fifthSlice + sixthSlice + seventhSlice);
var tripdigitSixSevenEight = (sixthSlice + seventhSlice + eighthSlice);
var tripdigitSevenEightNine = (seventhSlice + eighthSlice + ninthSlice);
var tripdigitEightNineTen = (eighthSlice + ninthSlice + tenthSlice);

var sliceDigitTtwo = (tripdigitOneTwoThree);
var sliceDigitTthree = (tripdigitTwoThreeFour);
var sliceDigitTfour = (tripdigitThreeFourFive);
var sliceDigitTfive = (tripdigitFourFiveSix);
var sliceDigitTsix = (tripdigitFiveSixSeven);
var sliceDigitTseven = (tripdigitSixSevenEight);
var sliceDigitTeight = (tripdigitSevenEightNine);
var sliceDigitTnine = (tripdigitEightNineTen);

var digitOne;
var digitTwo;
var digitThree;
var digitFour;
var digitFive;
var digitSix;
var digitSeven;
var digitEight;
var digitNine;
var digitTen;

var digitBone;
var digitBtwo;
var digitBthree;
var digitBfour;
var digitBfive;
var digitBsix;
var digitBseven;
var digitBeight;
var digitBnine;

var digitTtwo;
var digitTthree;
var digitTfour;
var digitTfive;
var digitTsix;
var digitTseven;
var digitTeight;
var digitTnine;

var ptc=new Array(); // regular array (add an optional integer
ptc[0]="0";       // argument to control array's size)
ptc[1]="A";
ptc[2]="B";
ptc[3]="C";
ptc[4]="D";
ptc[5]="E";
ptc[6]="F";
ptc[7]="G";
ptc[8]="H";
ptc[9]="J";
ptc[10]="K";
ptc[11]="L";
ptc[12]="M";
ptc[13]="N";
ptc[14]="O";
ptc[15]="P";
ptc[16]="Q";
ptc[17]="R";
ptc[18]="S";
ptc[19]="T";
ptc[20]="U";
ptc[21]="V";
ptc[22]="W";
ptc[23]="X";
ptc[24]="Y";
ptc[25]="Z";

//First Digit Here : goes sliceDigitOne through sliceDigitNine

if (sliceDigitOne === 1)
{
digitOne = ptc[1];
}
else if (sliceDigitOne === 2)
{
digitOne = ptc[2];
}
else if(sliceDigitOne === 3)
{
digitOne = ptc[3];
}
else if (sliceDigitOne === 4)
{
digitOne = ptc[4]
}

else if (sliceDigitOne === 5)
{
digitOne = ptc[5]
}

else if (sliceDigitOne === 6)
{
digitOne = ptc[6]
}
else if (sliceDigitOne === 7)
{
digitOne = ptc[7]
}

else if (sliceDigitOne === 8)
{
digitOne = ptc[8]
}

else if (sliceDigitOne === 9 )
{
digitOne = ptc [9]
}

else if (sliceDigitOne === 0)
{
digitOne = ptc [0]
}

else
{
digitOne = "."
}

// Second digit here sliceDigitTwo

if (sliceDigitTwo === 1)
{
digitTwo = ptc[1]
}
else if (sliceDigitTwo === 2)
{
digitTwo = ptc[2]
}
else if (sliceDigitTwo === 3)
{
digitTwo = ptc[3];
}

else if (sliceDigitTwo === 4)
{
digitTwo = ptc[4]
}

else if (sliceDigitTwo === 5)
{
digitTwo = ptc[5]
}

else if (sliceDigitTwo === 6)
{
digitTwo = ptc[6]
}

else if (sliceDigitTwo === 7)
{
digitTwo = ptc[7]
}

else if (sliceDigitTwo === 8)
{
digitTwo = ptc[8]
}

else if (sliceDigitTwo === 9)
{
digitTwo = ptc[9]
}

else if (sliceDigitTwo === 0 )
{
digitTwo = ptc [0]
}

//Testing Null Cases Here

else
{
digitTwo = "."
}

// Digit Three Here

if (sliceDigitThree === 1)
{
digitThree = ptc[1]
}
else if (sliceDigitThree === 2)
{
digitThree = ptc[2]
}
else if (sliceDigitThree === 3)
{
digitThree = ptc[3];
}

else if (sliceDigitThree === 4)
{
digitThree = ptc[4]
}

else if (sliceDigitThree === 5)
{
digitThree = ptc[5]
}

else if (sliceDigitThree === 6)
{
digitThree = ptc[6]
}

else if (sliceDigitThree === 7)
{
digitThree = ptc[7]
}

else if (sliceDigitThree === 8)
{
digitThree = ptc[8]
}

else if (sliceDigitThree === 9)
{
digitThree = ptc[9]
}

else if (sliceDigitThree === 0)
{
digitThree = ptc [0]
}

//Testing Null Cases Here

else
{
digitThree = "."
}

// Digit Four here

if (sliceDigitFour === 1)
{
digitFour = ptc[1]
}
else if (sliceDigitFour === 2)
{
digitFour = ptc[2]
}
else if (sliceDigitFour === 3)
{
digitFour = ptc[3];
}

else if (sliceDigitFour === 4)
{
digitFour = ptc[4]
}

else if (sliceDigitFour === 5)
{
digitFour = ptc[5]
}

else if (sliceDigitFour === 6)
{
digitFour = ptc[6]
}

else if (sliceDigitFour === 7)
{
digitFour = ptc[7]
}

else if (sliceDigitFour === 8)
{
digitFour = ptc[8]
}

else if (sliceDigitFour === 9)
{
digitFour = ptc[9]
}

//Testing Null Cases Here

else if (sliceDigitFour === 0)
{
digitFour = ptc[0]
}

else
{
digitFour = "."
}

// Digit Five Here

if (sliceDigitFive === 1)
{
digitFive = ptc[1]
}
else if (sliceDigitFive === 2)
{
digitFive = ptc[2]
}
else if (sliceDigitFive === 3)
{
digitFive = ptc[3];
}

else if (sliceDigitFive === 4)
{
digitFive = ptc[4]
}

else if (sliceDigitFive === 5)
{
digitFive = ptc[5]
}

else if (sliceDigitFive === 6)
{
digitFive = ptc[6]
}

else if (sliceDigitFive === 7)
{
digitFive = ptc[7]
}

else if (sliceDigitFive === 8)
{
digitFive = ptc[8]
}

else if (sliceDigitFive === 9)
{
digitFive = ptc[9]
}

else if (sliceDigitFive === 0)

{
digitFive = ptc[0]
}

//Testing Null Cases Here

else
{
digitFive = "."
}

// Digit Six Here

if (sliceDigitSix === 1)
{
digitSix = ptc[1]
}
else if (sliceDigitSix === 2)
{
digitSix = ptc[2]
}
else if (sliceDigitSix === 3)
{
digitSix = ptc[3];
}

else if (sliceDigitSix === 4)
{
digitSix = ptc[4]
}

else if (sliceDigitSix === 5)
{
digitSix = ptc[5]
}

else if (sliceDigitSix === 6)
{
digitSix = ptc[6]
}

else if (sliceDigitSix === 7)
{
digitSix = ptc[7]
}

else if (sliceDigitSix === 8)
{
digitSix = ptc[8]
}

else if (sliceDigitSix === 9)
{
digitSix = ptc[9]
}

else if (sliceDigitSix === 0)
{
digitSix = ptc[0]
}

//Testing Null Cases Here

else
{
digitSix = "."
}

// Digit Seven Here

if (sliceDigitSeven === 1)
{
digitSeven = ptc[1]
}
else if (sliceDigitSeven === 2)
{
digitSeven = ptc[2]
}
else if (sliceDigitSeven === 3)
{
digitSeven = ptc[3];
}

else if (sliceDigitSeven === 4)
{
digitSeven = ptc[4]
}

else if (sliceDigitSeven === 5)
{
digitSeven = ptc[5]
}

else if (sliceDigitSeven === 6)
{
digitSeven = ptc[6]
}

else if (sliceDigitSeven === 7)
{
digitSeven = ptc[7]
}

else if (sliceDigitSeven === 8)
{
digitSeven = ptc[8]
}

else if (sliceDigitSeven === 9)
{
digitSeven = ptc[9]
}

else if (sliceDigitSeven === 0)
{
digitSeven = ptc[0]
}

//Testing Null Cases Here

else
{
digitSeven = "."
}

// Digit Eight Here

if (sliceDigitEight === 1)
{
digitEight = ptc[1]
}
else if (sliceDigitEight === 2)
{
digitEight = ptc[2]
}
else if (sliceDigitEight === 3)
{
digitEight = ptc[3];
}

else if (sliceDigitEight === 4)
{
digitEight = ptc[4]
}

else if (sliceDigitEight === 5)
{
digitEight = ptc[5]
}

else if (sliceDigitEight === 6)
{
digitEight = ptc[6]
}

else if (sliceDigitEight === 7)
{
digitEight = ptc[7]
}

else if (sliceDigitEight === 8)
{
digitEight = ptc[8]
}

else if (sliceDigitEight === 9)
{
digitEight = ptc[9]
}

else if (sliceDigitEight === 0)
{
digitEight = ptc[0]
}

//Testing Null Cases Here

else
{
digitEight = "."
}

// Digit Nine Here

if (sliceDigitNine === 1)
{
digitNine = ptc[1]
}
else if (sliceDigitNine === 2)
{
digitNine = ptc[2]
}
else if (sliceDigitNine === 3)
{
digitNine = ptc[3];
}

else if (sliceDigitNine === 4)
{
digitNine = ptc[4]
}

else if (sliceDigitNine === 5)
{
digitNine = ptc[5]
}

else if (sliceDigitNine === 6)
{
digitNine = ptc[6]
}

else if (sliceDigitNine === 7)
{
digitNine = ptc[7]
}

else if (sliceDigitNine === 8)
{
digitNine = ptc[8]
}

else if (sliceDigitNine === 9)
{
digitNine = ptc[9]
}

else if (sliceDigitNine === 0)
{
digitNine = ptc[0]
}

//Testing Null Cases Here

else
{
digitNine = "."
}

// Here is Tenth Digit

if (sliceDigitTen === 1)
{
digitTen = ptc[1]
}
else if (sliceDigitTen === 2)
{
digitTen = ptc[2]
}
else if (sliceDigitTen === 3)
{
digitTen = ptc[3];
}

else if (sliceDigitTen === 4)
{
digitTen = ptc[4]
}

else if (sliceDigitTen === 5)
{
digitTen = ptc[5]
}

else if (sliceDigitTen === 6)
{
digitTen = ptc[6]
}

else if (sliceDigitTen === 7)
{
digitTen = ptc[7]
}

else if (sliceDigitTen === 8)
{
digitTen = ptc[8]
}

else if (sliceDigitTen === 9)
{
digitTen = ptc[9]
}

//Testing Null Cases Here

else if (sliceDigitTen === 0)
{
digitTen = ptc[0]
}

else
{
digitTen = "."
}

// Here are the doubles with sliceDigitBone

if (sliceDigitBone === "00")
{
digitBone = ptc[0]
}

else if (sliceDigitBone === "01")
{
digitBone = ptc[1];
}

else if (sliceDigitBone === "02")
{
digitBone = ptc[2];
}
else if(sliceDigitBone === "03")
{
digitBone = ptc[3];
}
else if (sliceDigitBone === "04")
{
digitBone = ptc[4]
}

else if (sliceDigitBone === "05")
{
digitBone = ptc[5]
}

else if (sliceDigitBone === "06")
{
digitBone = ptc[6]
}
else if (sliceDigitBone === "07")
{
digitBone = ptc[7]
}

else if (sliceDigitBone === "08")
{
digitBone = ptc[8]
}

else if (sliceDigitBone === "09" )
{
digitBone = ptc [9]
}

else if (sliceDigitBone === "10")
{
digitBone = ptc[10];
}

else if (sliceDigitBone === "11")
{
digitBone = ptc[11];
}
else if(sliceDigitBone === "12")
{
digitBone = ptc[12];
}
else if (sliceDigitBone === "13")
{
digitBone = ptc[13]
}

else if (sliceDigitBone === "14")
{
digitBone = ptc[14]
}

else if (sliceDigitBone === "15")
{
digitBone = ptc[15]
}
else if (sliceDigitBone === "16")
{
digitBone = ptc[16]
}

else if (sliceDigitBone === "17")
{
digitBone = ptc[17]
}

else if (sliceDigitBone === "18" )
{
digitBone = ptc [18]
}

else if (sliceDigitBone === "19" )
{
digitBone = ptc [19]
}

else if (sliceDigitBone === "20" )
{
digitBone = ptc [20]
}

else if (sliceDigitBone === "21" )
{
digitBone = ptc [21]
}

else if (sliceDigitBone === "22" )
{
digitBone = ptc [22]
}

else if (sliceDigitBone === "23" )
{
digitBone = ptc [23]
}

else if (sliceDigitBone === "24" )
{
digitBone = ptc [24]
}

else if (sliceDigitBone === "25" )
{
digitBone = ptc [25]
}

else
{
digitBone = "."
}

// sliceDigitBtwo

if (sliceDigitBtwo === "00")
{
digitBtwo = ptc[0]
}
else if (sliceDigitBtwo === "01")
{
digitBtwo = ptc[1]
}

else if (sliceDigitBtwo === "02")
{
digitBtwo = ptc[2];
}
else if(sliceDigitBtwo === "03")
{
digitBtwo = ptc[3];
}
else if (sliceDigitBtwo === "04")
{
digitBtwo = ptc[4]
}

else if (sliceDigitBtwo === "05")
{
digitBtwo = ptc[5]
}

else if (sliceDigitBtwo === "06")
{
digitBtwo = ptc[6]
}
else if (sliceDigitBtwo === "07")
{
digitBtwo = ptc[7]
}

else if (sliceDigitBtwo === "08")
{
digitBtwo = ptc[8]
}

else if (sliceDigitBtwo === "09" )
{
digitBtwo = ptc [9]
}

else if (sliceDigitBtwo === "10")
{
digitBtwo = ptc[10];
}
else if (sliceDigitBtwo === "11")
{
digitBtwo = ptc[11];
}
else if(sliceDigitBtwo === "12")
{
digitBtwo = ptc[12];
}
else if (sliceDigitBtwo === "13")
{
digitBtwo = ptc[13]
}

else if (sliceDigitBtwo === "14")
{
digitBtwo = ptc[14]
}

else if (sliceDigitBtwo === "15")
{
digitBtwo = ptc[15]
}
else if (sliceDigitBtwo === "16")
{
digitBtwo = ptc[16]
}

else if (sliceDigitBtwo === "17")
{
digitBtwo = ptc[17]
}

else if (sliceDigitBtwo === "18" )
{
digitBtwo = ptc [18]
}

else if (sliceDigitBtwo === "19" )
{
digitBtwo = ptc [19]
}

else if (sliceDigitBtwo === "20" )
{
digitBtwo = ptc [20]
}

else if (sliceDigitBtwo === "21" )
{
digitBtwo = ptc [21]
}

else if (sliceDigitBtwo === "22" )
{
digitBtwo = ptc [22]
}

else if (sliceDigitBtwo === "23" )
{
digitBtwo = ptc [23]
}

else if (sliceDigitBtwo === "24" )
{
digitBtwo = ptc [24]
}

else if (sliceDigitBtwo === "25" )
{
digitBtwo = ptc [25]
}

else
{
digitBtwo = "."
}

// Here is sliceDigitBthree
if (sliceDigitBthree === "00")
{
digitBthree = ptc[0]
}
else if (sliceDigitBthree === "01")
{
digitBthree = ptc[1]
}
else if (sliceDigitBthree === "02")
{
digitBthree = ptc[2];
}
else if(sliceDigitBthree === "03")
{
digitBthree = ptc[3];
}
else if (sliceDigitBthree === "04")
{
digitBthree = ptc[4]
}

else if (sliceDigitBthree === "05")
{
digitBthree = ptc[5]
}

else if (sliceDigitBthree === "06")
{
digitBthree = ptc[6]
}
else if (sliceDigitBthree === "07")
{
digitBthree = ptc[7]
}

else if (sliceDigitBthree === "08")
{
digitBthree = ptc[8]
}

else if (sliceDigitBthree === "09" )
{
digitBthree = ptc [9]
}

else if (sliceDigitBthree === "10")
{
digitBthree = ptc[10];
}
else if (sliceDigitBthree === "11")
{
digitBthree = ptc[11];
}
else if(sliceDigitBthree === "12")
{
digitBthree = ptc[12];
}
else if (sliceDigitBthree === "13")
{
digitBthree = ptc[13]
}

else if (sliceDigitBthree === "14")
{
digitBthree = ptc[14]
}

else if (sliceDigitBthree === "15")
{
digitBthree = ptc[15]
}
else if (sliceDigitBthree === "16")
{
digitBthree = ptc[16]
}

else if (sliceDigitBthree === "17")
{
digitBthree = ptc[17]
}

else if (sliceDigitBthree === "18" )
{
digitBthree = ptc [18]
}

else if (sliceDigitBthree === "19" )
{
digitBthree = ptc [19]
}

else if (sliceDigitBthree === "20" )
{
digitBthree = ptc [20]
}

else if (sliceDigitBthree === "21" )
{
digitBthree = ptc [21]
}

else if (sliceDigitBthree === "22" )
{
digitBthree = ptc [22]
}

else if (sliceDigitBthree === "23" )
{
digitBthree = ptc [23]
}

else if (sliceDigitBthree === "24" )
{
digitBthree = ptc [24]
}

else if (sliceDigitBthree === "25" )
{
digitBthree = ptc [25]
}

else
{
digitBthree = "."
}

// here is digitBfour

if (sliceDigitBfour === "00")
{
digitBfour = ptc[0]
}
else if (sliceDigitBfour === "01")
{
digitBfour = ptc[1]
}
else if (sliceDigitBfour === "02")
{
digitBfour = ptc[2];
}
else if(sliceDigitBfour === "03")
{
digitBfour = ptc[3];
}
else if (sliceDigitBfour === "04")
{
digitBfour = ptc[4]
}

else if (sliceDigitBfour === "05")
{
digitBfour = ptc[5]
}

else if (sliceDigitBfour === "06")
{
digitBfour = ptc[6]
}
else if (sliceDigitBfour === "07")
{
digitBfour = ptc[7]
}

else if (sliceDigitBfour === "08")
{
digitBfour = ptc[8]
}

else if (sliceDigitBfour === "09" )
{
digitBfour = ptc [9]
}

else if (sliceDigitBfour === "10")
{
digitBfour = ptc[10];
}
else if (sliceDigitBfour === "11")
{
digitBfour = ptc[11];
}
else if(sliceDigitBfour === "12")
{
digitBfour = ptc[12];
}
else if (sliceDigitBfour === "13")
{
digitBfour = ptc[13]
}

else if (sliceDigitBfour === "14")
{
digitBfour = ptc[14]
}

else if (sliceDigitBfour === "15")
{
digitBfour = ptc[15]
}
else if (sliceDigitBfour === "16")
{
digitBfour = ptc[16]
}

else if (sliceDigitBfour === "17")
{
digitBfour = ptc[17]
}

else if (sliceDigitBfour === "18" )
{
digitBfour = ptc [18]
}

else if (sliceDigitBfour === "19" )
{
digitBfour = ptc [19]
}

else if (sliceDigitBfour === "20" )
{
digitBfour = ptc [20]
}

else if (sliceDigitBfour === "21" )
{
digitBfour = ptc [21]
}

else if (sliceDigitBfour === "22" )
{
digitBfour = ptc [22]
}

else if (sliceDigitBfour === "23" )
{
digitBfour = ptc [23]
}

else if (sliceDigitBfour === "24" )
{
digitBfour = ptc [24]
}

else if (sliceDigitBfour === "25" )
{
digitBfour = ptc [25]
}

else
{
digitBfour = "."
}

// Here is digitBfive

if (sliceDigitBfive === "00")
{
digitBfive = ptc[0]
}
else if (sliceDigitBfive === "01")
{
digitBfive = ptc[1]
}

else if (sliceDigitBfive === "02")
{
digitBfive = ptc[2];
}
else if(sliceDigitBfive === "03")
{
digitBfive = ptc[3];
}
else if (sliceDigitBfive === "04")
{
digitBfive = ptc[4]
}

else if (sliceDigitBfive === "05")
{
digitBfive = ptc[5]
}

else if (sliceDigitBfive === "06")
{
digitBfive = ptc[6]
}
else if (sliceDigitBfive === "07")
{
digitBfive = ptc[7]
}

else if (sliceDigitBfive === "08")
{
digitBfive = ptc[8]
}

else if (sliceDigitBfive === "09" )
{
digitBfive = ptc [9]
}

else if (sliceDigitBfive === "10")
{
digitBfive = ptc[10];
}
else if (sliceDigitBfive === "11")
{
digitBfive = ptc[11];
}
else if(sliceDigitBfive === "12")
{
digitBfive = ptc[12];
}
else if (sliceDigitBfive === "13")
{
digitBfive = ptc[13]
}

else if (sliceDigitBfive === "14")
{
digitBfive = ptc[14]
}

else if (sliceDigitBfive === "15")
{
digitBfive = ptc[15]
}
else if (sliceDigitBfive === "16")
{
digitBfive = ptc[16]
}

else if (sliceDigitBfive === "17")
{
digitBfive = ptc[17]
}

else if (sliceDigitBfive === "18" )
{
digitBfive = ptc [18]
}

else if (sliceDigitBfive === "19" )
{
digitBfive = ptc [19]
}

else if (sliceDigitBfive === "20" )
{
digitBfive = ptc [20]
}

else if (sliceDigitBfive === "21" )
{
digitBfive = ptc [21]
}

else if (sliceDigitBfive === "22" )
{
digitBfive = ptc [22]
}

else if (sliceDigitBfive === "23" )
{
digitBfive = ptc [23]
}

else if (sliceDigitBfive === "24" )
{
digitBfive = ptc [24]
}

else if (sliceDigitBfive === "25" )
{
digitBfive = ptc [25]
}

else
{
digitBfive = "."
}

// Here is sixth double element.
if (sliceDigitBsix === "00")
{
digitBsix = ptc[0]
}
else if (sliceDigitBsix === "01")
{
digitBsix = ptc[1]
}
else if (sliceDigitBsix === "02")
{
digitBsix = ptc[2];
}
else if(sliceDigitBsix === "03")
{
digitBsix = ptc[3];
}
else if (sliceDigitBsix === "04")
{
digitBsix = ptc[4]
}

else if (sliceDigitBsix === "05")
{
digitBsix = ptc[5]
}

else if (sliceDigitBsix === "06")
{
digitBsix = ptc[6]
}
else if (sliceDigitBsix === "07")
{
digitBsix = ptc[7]
}

else if (sliceDigitBsix === "08")
{
digitBsix = ptc[8]
}

else if (sliceDigitBsix === "09" )
{
digitBsix = ptc [9]
}

else if (sliceDigitBsix === "10")
{
digitBsix = ptc[10];
}
else if (sliceDigitBsix === "11")
{
digitBsix = ptc[11];
}
else if(sliceDigitBsix === "12")
{
digitBsix = ptc[12];
}
else if (sliceDigitBsix === "13")
{
digitBsix = ptc[13]
}

else if (sliceDigitBsix === "14")
{
digitBsix = ptc[14]
}

else if (sliceDigitBsix === "15")
{
digitBsix = ptc[15]
}
else if (sliceDigitBsix === "16")
{
digitBsix = ptc[16]
}

else if (sliceDigitBsix === "17")
{
digitBsix = ptc[17]
}

else if (sliceDigitBsix === "18" )
{
digitBsix = ptc [18]
}

else if (sliceDigitBsix === "19" )
{
digitBsix = ptc [19]
}

else if (sliceDigitBsix === "20" )
{
digitBsix = ptc [20]
}

else if (sliceDigitBsix === "21" )
{
digitBsix = ptc [21]
}

else if (sliceDigitBsix === "22" )
{
digitBsix = ptc [22]
}

else if (sliceDigitBsix === "23" )
{
digitBsix = ptc [23]
}

else if (sliceDigitBsix === "24" )
{
digitBsix = ptc [24]
}

else if (sliceDigitBsix === "25" )
{
digitBsix = ptc [25]
}

else
{
digitBsix = "."
}

// Here is the seventh

if (sliceDigitBseven === "00")
{
digitBseven = ptc[0]
}
else if (sliceDigitBseven === "01")
{
digitBseven = ptc[1]
}

else if (sliceDigitBseven === "02")
{
digitBseven = ptc[2];
}
else if(sliceDigitBseven === "03")
{
digitBseven = ptc[3];
}
else if (sliceDigitBseven === "04")
{
digitBseven = ptc[4]
}

else if (sliceDigitBseven === "05")
{
digitBseven = ptc[5]
}

else if (sliceDigitBseven === "06")
{
digitBseven = ptc[6]
}
else if (sliceDigitBseven === "07")
{
digitBseven = ptc[7]
}

else if (sliceDigitBseven === "08")
{
digitBseven = ptc[8]
}

else if (sliceDigitBseven === "09" )
{
digitBseven = ptc [9]
}

else if (sliceDigitBseven === "10")
{
digitBseven = ptc[10];
}
else if (sliceDigitBseven === "11")
{
digitBseven = ptc[11];
}
else if(sliceDigitBseven === "12")
{
digitBseven = ptc[12];
}
else if (sliceDigitBseven === "13")
{
digitBseven = ptc[13]
}

else if (sliceDigitBseven === "14")
{
digitBseven = ptc[14]
}

else if (sliceDigitBseven === "15")
{
digitBseven = ptc[15]
}
else if (sliceDigitBseven === "16")
{
digitBseven = ptc[16]
}

else if (sliceDigitBseven === "17")
{
digitBseven = ptc[17]
}

else if (sliceDigitBseven === "18" )
{
digitBseven = ptc [18]
}

else if (sliceDigitBseven === "19" )
{
digitBseven = ptc [19]
}

else if (sliceDigitBseven === "20" )
{
digitBseven = ptc [20]
}

else if (sliceDigitBseven === "21" )
{
digitBseven = ptc [21]
}

else if (sliceDigitBseven === "22" )
{
digitBseven = ptc [22]
}

else if (sliceDigitBseven === "23" )
{
digitBseven = ptc [23]
}

else if (sliceDigitBseven === "24" )
{
digitBseven = ptc [24]
}

else if (sliceDigitBseven === "25" )
{
digitBseven = ptc [25]
}

else
{
digitBseven = "."
}

// Here is the eigth pair
if (sliceDigitBeight === "00")
{
digitBeight = ptc[0]
}
else if (sliceDigitBeight === "01")
{
digitBeight = ptc[1]
}

else if (sliceDigitBeight === "02")
{
digitBeight = ptc[2];
}
else if(sliceDigitBeight === "03")
{
digitBeight = ptc[3];
}
else if (sliceDigitBeight === "04")
{
digitBeight = ptc[4]
}

else if (sliceDigitBeight === "05")
{
digitBeight = ptc[5]
}

else if (sliceDigitBeight === "06")
{
digitBeight = ptc[6]
}
else if (sliceDigitBeight === "07")
{
digitBeight = ptc[7]
}

else if (sliceDigitBeight === "08")
{
digitBeight = ptc[8]
}

else if (sliceDigitBeight === "09" )
{
digitBeight = ptc [9]
}

else if (sliceDigitBeight === "10")
{
digitBeight = ptc[10];
}
else if (sliceDigitBeight === "11")
{
digitBeight = ptc[11];
}
else if(sliceDigitBeight === "12")
{
digitBeight = ptc[12];
}
else if (sliceDigitBeight === "13")
{
digitBeight = ptc[13]
}

else if (sliceDigitBeight === "14")
{
digitBeight = ptc[14]
}

else if (sliceDigitBeight === "15")
{
digitBeight = ptc[15]
}
else if (sliceDigitBeight === "16")
{
digitBeight = ptc[16]
}

else if (sliceDigitBeight === "17")
{
digitBeight = ptc[17]
}

else if (sliceDigitBeight === "18" )
{
digitBeight = ptc [18]
}

else if (sliceDigitBeight === "19" )
{
digitBeight = ptc [19]
}

else if (sliceDigitBeight === "20" )
{
digitBeight = ptc [20]
}

else if (sliceDigitBeight === "21" )
{
digitBeight = ptc [21]
}

else if (sliceDigitBeight === "22" )
{
digitBeight = ptc [22]
}

else if (sliceDigitBeight === "23" )
{
digitBeight = ptc [23]
}

else if (sliceDigitBeight === "24" )
{
digitBeight = ptc [24]
}

else if (sliceDigitBeight === "25" )
{
digitBeight = ptc [25]
}

else
{
digitBeight = "."
}

// here is the ninth double

if (sliceDigitBnine === "00")
{
digitBnine = ptc[0]
}
else if (sliceDigitBnine === "01")
{
digitBnine = ptc[1]
}

else if (sliceDigitBnine === "02")
{
digitBnine = ptc[2];
}
else if(sliceDigitBnine === "03")
{
digitBnine = ptc[3];
}
else if (sliceDigitBnine === "04")
{
digitBnine = ptc[4]
}

else if (sliceDigitBnine === "05")
{
digitBnine = ptc[5]
}

else if (sliceDigitBnine === "06")
{
digitBnine = ptc[6]
}
else if (sliceDigitBnine === "07")
{
digitBnine = ptc[7]
}

else if (sliceDigitBnine === "08")
{
digitBnine = ptc[8]
}

else if (sliceDigitBnine === "09" )
{
digitBnine = ptc [9]
}

else if (sliceDigitBnine === "10")
{
digitBnine = ptc[10];
}
else if (sliceDigitBnine === "11")
{
digitBnine = ptc[11];
}
else if(sliceDigitBnine === "12")
{
digitBnine = ptc[12];
}
else if (sliceDigitBnine === "13")
{
digitBnine = ptc[13]
}

else if (sliceDigitBnine === "14")
{
digitBnine = ptc[14]
}

else if (sliceDigitBnine === "15")
{
digitBnine = ptc[15]
}
else if (sliceDigitBnine === "16")
{
digitBnine = ptc[16]
}

else if (sliceDigitBnine === "17")
{
digitBnine = ptc[17]
}

else if (sliceDigitBnine === "18" )
{
digitBnine = ptc [18]
}

else if (sliceDigitBnine === "19" )
{
digitBnine = ptc [19]
}

else if (sliceDigitBnine === "20" )
{
digitBnine = ptc [20]
}

else if (sliceDigitBnine === "21" )
{
digitBnine = ptc [21]
}

else if (sliceDigitBnine === "22" )
{
digitBnine = ptc [22]
}

else if (sliceDigitBnine === "23" )
{
digitBnine = ptc [23]
}

else if (sliceDigitBnine === "24" )
{
digitBnine = ptc [24]
}

else if (sliceDigitBnine === "25" )
{
digitBnine = ptc [25]
}

else
{
digitBnine = "."
}

document.write("This is the number you entered.")
document.write("<br />")
document.write(n);
	document.write("<br />")

document.write("These are single digits only.")
document.write("<br />")

document.write(digitOne, digitTwo, digitThree, digitFour, digitFive, digitSix, digitSeven, digitEight, digitNine, digitTen);
	document.write("<br />")

document.write("These are the double single digits.")
document.write("<br />")

	document.write(digitBone, digitBthree, digitFive, digitSix, digitSeven, digitEight, digitNine, digitTen);
	document.write("<br />")
	document.write(digitBone, digitThree, digitBfour, digitSix, digitSeven, digitEight, digitNine, digitTen);
	document.write("<br />")
	document.write(digitBone, digitThree, digitFour, digitBfive, digitSeven, digitEight, digitNine, digitTen);
	document.write("<br />")
	document.write(digitBone, digitThree, digitFour, digitFive, digitBsix, digitEight, digitNine, digitTen);
	document.write("<br />")
	document.write(digitBone, digitThree, digitFour, digitFive, digitSix, digitBseven, digitNine, digitTen);
	document.write("<br />")
	document.write(digitBone, digitThree, digitFour, digitFive, digitSix, digitSeven, digitBeight, digitTen);
	document.write("<br />")
	document.write(digitBone, digitThree, digitFour, digitFive, digitSix, digitSeven, digitEight, digitBnine);
	document.write("<br />")

// Second placement of Btwo
	document.write(digitOne, digitBtwo, digitBfour, digitSix, digitSeven, digitEight, digitNine, digitTen);
	document.write("<br />")
	document.write(digitOne, digitBtwo, digitFour, digitBfive, digitSeven, digitEight, digitNine, digitTen);
	document.write("<br />")
	document.write(digitOne, digitBtwo, digitFour, digitFive, digitBsix, digitEight, digitNine, digitTen);
	document.write("<br />")
	document.write(digitOne, digitBtwo, digitFour, digitFive, digitSix, digitBseven, digitNine, digitTen);
	document.write("<br />")
	document.write(digitOne, digitBtwo, digitFour, digitFive, digitSix, digitSeven, digitBeight, digitTen);
	document.write("<br />")
	document.write(digitOne, digitBtwo, digitFour, digitFive, digitSix, digitSeven, digitEight, digitBnine);
	document.write("<br />")

// Third placement of Bthree
	document.write(digitOne, digitTwo, digitBthree, digitBfive, digitSeven, digitEight, digitNine, digitTen);
	document.write("<br />")
	document.write(digitOne, digitTwo, digitBthree, digitFive, digitBsix, digitEight, digitNine, digitTen);
	document.write("<br />")
	document.write(digitOne, digitTwo, digitBthree, digitFive, digitSix, digitBseven, digitNine, digitTen);
	document.write("<br />")
	document.write(digitOne, digitTwo, digitBthree, digitFive, digitSix, digitSeven, digitBeight, digitTen);
	document.write("<br />")
	document.write(digitOne, digitTwo, digitBthree, digitFive, digitSix, digitSeven, digitEight, digitBnine);
	document.write("<br />")

// Fourth Placement of Bfour

	document.write(digitOne, digitTwo, digitThree, digitBfour, digitBsix, digitEight, digitNine, digitTen);
	document.write("<br />")
	document.write(digitOne, digitTwo, digitThree, digitBfour, digitSix, digitBseven, digitNine, digitTen);
	document.write("<br />")
	document.write(digitOne, digitTwo, digitThree, digitBfour, digitSix, digitSeven, digitBeight, digitTen);
	document.write("<br />")
	document.write(digitOne, digitTwo, digitThree, digitBfour, digitSix, digitSeven, digitEight, digitBnine);
	document.write("<br />")

// Fifth placement of Bfive

	document.write(digitOne, digitTwo, digitThree, digitFour, digitBfive, digitBseven, digitNine, digitTen);
	document.write("<br />")
	document.write(digitOne, digitTwo, digitThree, digitFour, digitBfive, digitSeven, digitBeight, digitTen);
	document.write("<br />")
	document.write(digitOne, digitTwo, digitThree, digitFour, digitBfive, digitSeven, digitEight, digitBnine);
	document.write("<br />")

// Sixth placement of Bsix
	document.write(digitOne, digitTwo, digitThree, digitFour, digitFive, digitBsix, digitBeight, digitTen);
	document.write("<br />")
	document.write(digitOne, digitTwo, digitThree, digitFour, digitFive, digitBsix, digitEight, digitBnine);
	document.write("<br />")

// Seventh placement of Bseven
	document.write(digitOne, digitTwo, digitThree, digitFour, digitFive, digitSix, digitBseven, digitBnine);
	document.write("<br />")

// Three B's staring with Bone, Bthree, Bfive

	document.write(digitBone, digitBthree, digitBfive, digitSeven, digitEight, digitNine, digitTen);
	document.write("<br />")
	document.write(digitBone, digitBthree, digitFive, digitBsix, digitEight, digitNine, digitTen);
	document.write("<br />")
	document.write(digitBone, digitBthree, digitFive, digitSix, digitBseven, digitNine, digitTen);
	document.write("<br />")
	document.write(digitBone, digitBthree, digitFive, digitSix, digitSeven, digitBeight, digitTen);
	document.write("<br />")
	document.write(digitBone, digitBthree, digitFive, digitSix, digitSeven, digitEight, digitBnine);
	document.write("<br />")

// Three B's Bone, Bfour, Bsix
	document.write(digitBone, digitThree, digitBfour, digitBsix, digitEight, digitNine, digitTen);
	document.write("<br />")
	document.write(digitBone, digitThree, digitBfour, digitSix, digitBseven, digitNine, digitTen);
	document.write("<br />")
	document.write(digitBone, digitThree, digitBfour, digitSix, digitSeven, digitBeight, digitTen);
	document.write("<br />")
	document.write(digitBone, digitThree, digitBfour, digitSix, digitSeven, digitEight, digitBnine);
	document.write("<br />")

// Three B's Bone, Bfive, Bseven forward

	document.write(digitBone, digitThree, digitFour, digitBfive, digitBseven, digitNine, digitTen);
	document.write("<br />")
	document.write(digitBone, digitThree, digitFour, digitBfive, digitSeven, digitBeight, digitTen);
	document.write("<br />")
	document.write(digitBone, digitThree, digitFour, digitBfive, digitSeven, digitEight, digitBnine);
	document.write("<br />")

// Three B's Bone, Bsix, Beight moving forward

	document.write(digitBone, digitThree, digitFour, digitFive, digitBsix, digitBeight, digitTen);
	document.write("<br />")
	document.write(digitBone, digitThree, digitFour, digitFive, digitBsix, digitEight, digitBnine);
	document.write("<br />")

// Three B's Bone, Bseven, Bnine

	document.write(digitBone, digitThree, digitFour, digitFive, digitSix, digitBseven, digitBnine);
	document.write("<br />")

// Three B's Btwo, Bfour, Bsix moving forward
	document.write(digitOne, digitBtwo, digitBfour, digitBsix, digitEight, digitNine, digitTen);
	document.write("<br />")
	document.write(digitOne, digitBtwo, digitBfour, digitSix, digitBseven, digitNine, digitTen);
	document.write("<br />")
	document.write(digitOne, digitBtwo, digitBfour, digitSix, digitSeven, digitBeight, digitTen);
	document.write("<br />")
	document.write(digitOne, digitBtwo, digitBfour, digitSix, digitSeven, digitEight, digitBnine);
	document.write("<br />")

// Three B's Btwo, Bfive, Bseven moving forward
	document.write(digitOne, digitBtwo, digitFour, digitBfive, digitBseven, digitNine, digitTen);
	document.write("<br />")
	document.write(digitOne, digitBtwo, digitFour, digitBfive, digitSeven, digitBeight, digitTen);
	document.write("<br />")
	document.write(digitOne, digitBtwo, digitFour, digitBfive, digitSeven, digitEight, digitBnine);
	document.write("<br />")

// Three B's Btwo, Bsix, Beight moving forward

	document.write(digitOne, digitBtwo, digitFour, digitFive, digitBsix, digitBeight, digitTen);
	document.write("<br />")
	document.write(digitOne, digitBtwo, digitFour, digitFive, digitBsix, digitEight, digitBnine);
	document.write("<br />")

// Three B's Btwo, Bseven, Bnine

	document.write(digitOne, digitBtwo, digitFour, digitFive, digitSix, digitBseven, digitBnine);
	document.write("<br />")

// Three B's Bthree, Bfive, Bseven moving forward

	document.write(digitOne, digitTwo, digitBthree, digitBfive, digitBseven, digitNine, digitTen);
	document.write("<br />")
	document.write(digitOne, digitTwo, digitBthree, digitBfive, digitSeven, digitBeight, digitTen);
	document.write("<br />")
	document.write(digitOne, digitTwo, digitBthree, digitBfive, digitSeven, digitEight, digitBnine);
	document.write("<br />")

// Three B's Bthree, Bsix, Beight moving forward
	document.write(digitOne, digitTwo, digitBthree, digitFive, digitBsix, digitBeight, digitTen);
	document.write("<br />")
	document.write(digitOne, digitTwo, digitBthree, digitFive, digitBsix, digitEight, digitBnine);
	document.write("<br />")

// Three B's Bthree, Bseven, Bnine
	document.write(digitOne, digitTwo, digitBthree, digitFive, digitSix, digitBseven, digitBnine);
	document.write("<br />")

// Three B's Bfour, Bsix, Beight moving forward

	document.write(digitOne, digitTwo, digitThree, digitBfour, digitBsix, digitBeight, digitTen);
	document.write("<br />")
	document.write(digitOne, digitTwo, digitThree, digitBfour, digitBsix, digitEight, digitBnine);
	document.write("<br />")

//Three B's Bfour to Bfive and Bseven and Bnine

	document.write(digitOne, digitTwo, digitThree, digitBfour, digitSix, digitBseven, digitBnine);
	document.write("<br />")
	document.write(digitOne, digitTwo, digitThree, digitFour, digitBfive, digitBseven, digitBnine);
	document.write("<br />")

//Four B's Bone, Bthree, Bfive, Bseven moving forward

	document.write(digitBone, digitBthree, digitBfive, digitBseven, digitNine, digitTen);
	document.write("<br />")
	document.write(digitBone, digitBthree, digitBfive, digitSeven, digitBeight, digitTen);
	document.write("<br />")
	document.write(digitBone, digitBthree, digitBfive, digitSeven, digitEight, digitBnine);
	document.write("<br />")

//Four B's Bone, Bthree, Bsix, Beight and Bnine

	document.write(digitBone, digitBthree, digitFive, digitBsix, digitBeight, digitTen);
	document.write("<br />")
	document.write(digitBone, digitBthree, digitFive, digitBsix, digitEight, digitBnine);
	document.write("<br />")

	document.write(digitBone, digitBthree, digitFive, digitSix, digitBseven, digitBnine);
	document.write("<br />")

	document.write(digitBone, digitThree, digitBfour, digitBsix, digitBeight, digitTen);
	document.write("<br />")
	document.write(digitBone, digitThree, digitBfour, digitBsix, digitEight, digitBnine);
	document.write("<br />")

	document.write(digitBone, digitThree, digitBfour, digitSix, digitBseven, digitBnine);
	document.write("<br />")

	document.write(digitBone, digitThree, digitFour, digitBfive, digitBseven, digitBnine);
	document.write("<br />")

	document.write(digitOne, digitBtwo, digitBfour, digitBsix, digitBeight, digitTen);
	document.write("<br />")

	document.write(digitOne, digitBtwo, digitBfour, digitBsix, digitEight, digitBnine);
	document.write("<br />")

	document.write(digitOne, digitBtwo, digitBfour, digitSix, digitBseven, digitBnine);
	document.write("<br />")

	document.write(digitOne, digitBtwo, digitFour, digitBfive, digitBseven, digitBnine);
	document.write("<br />")

	document.write(digitOne, digitTwo, digitBthree, digitBfive, digitBseven, digitBnine);
	document.write("<br />")

	document.write(digitBone, digitBthree, digitBfive, digitBseven, digitBnine);
	document.write("<br />")

// End Doubles

redpajama_set_name: RedPajamaGithub


text:
using System.Collections.Generic;
using Pustota.Maven.Models;

namespace Pustota.Maven.Validation
{
	internal class ParentSpecificVersionValidation : IProjectValidator
	{
		public IEnumerable<IProjectValidationProblem> Validate(IExecutionContext context, IProject project)
		{
			if (project.Parent != null)
			{
				if (!project.Parent.Version.IsDefined)
				{
					// var error = new ValidationError(project, "Project parent error", ErrorLevel.Error);
					// TODO: if there is correct parent found via relativePath, and it has version (or resolvedVersion) - add fix
					// error.AddFix(GetParentVersionFix(project, parent, realParentVersion, MessageResources.FixParentToMatchSource));
					yield return new ValidationProblem("parentversion")
					{
						ProjectReference = project,
						Severity = ProblemSeverity.ProjectFatal,
						Description = string.Format("parent version not specified")
					};
				}
			}
		}
	}
}


text:
module L {
    export class NewHeapObject extends LogicElement {
        constructor(
            public log_type: LogicElement,
            public log_arguments: LogicElement[]
            ) { super(); }

        _compile(environment: Compiler.TypeEnvironment): boolean {
            this.errorIfEmpty(this.log_type);
            this.cs = this.log_type.compile(environment) && this.cs;

            var passedValues: LogicElement[] = [];

            for (var i = 0; i < this.log_arguments.length; i++) {
                this.cs = this.log_arguments[i].compile(environment) && this.cs;

                if (this.log_arguments[i] instanceof EmptyElement)
                    continue;

                passedValues.push(this.log_arguments[i]);
            }

            this.errorIf(passedValues.length > 0, 'Argumnets for constructor are not supported yet');
            if (!this.cs) return false;

            this.errorIfNot(this.log_type.returns.varType instanceof TS.PrototypeType, 'Class definition expectad', this.log_type);
            if (!this.cs) return false;

            var classType = <TS.PrototypeType> this.log_type.returns.varType;
            this.returns = new TS.RValueOfType(new TS.ReferenceType(new TS.ReferenceClassType(classType)));

            return this.cs;
        }

        *execute(environment: Memory.Environment): IterableIterator<Operation> {
            yield* this.log_type.run(environment);

            var classType = <TS.Prototype> environment.popTempValue().getValue();
            var classObject = <TS.ClassObject> classType.defaultValue();
            yield* classObject.construct(environment);

            var onHeapElement = environment.addToHeap(classObject);
            environment.pushTempValue(new TS.Reference(new TS.ReferenceClass(classType), onHeapElement));

            yield Operation.tempMemory(this);

            return;
        }
    }
}

module E {
    export class NewHeapObject extends Element {
        getJSONName() { return 'NewHeapObject' }
        c_type: C.DropField
        c_arguments: C.DropList
        constructor(
            typ: E.Element = null,
            args: E.Element[] = []) {
            super();
            this.c_type = new C.DropField(this, typ),
            this.c_arguments = new C.DropList(this, args)
            this.initialize([
                [
                    new C.Label('new'),
                    this.c_type,
                    new C.Label('('),
                    this.c_arguments,
                    new C.Label(')'),
                ],
            ], ElementType.Value);
        }
        constructCode(): L.LogicElement {
            var logic = new L.NewHeapObject(
                this.c_type.constructCode(),
                this.c_arguments.getLogicComponents()
                );
            logic.setObserver(this);
            return logic;
        }
        getCopy(): Element {
            return new NewHeapObject(
                this.c_type.getContentCopy(),
                this.c_arguments.getContentCopy()).copyMetadata(this);
        }
    }
}


text:
package acmi.l2.clientmod.l2pe;

import acmi.l2.clientmod.io.UnrealPackage;
import acmi.l2.clientmod.unreal.UnrealSerializerFactory;
import acmi.l2.clientmod.unreal.core.*;
import acmi.l2.clientmod.unreal.core.Enum;
import acmi.l2.clientmod.unreal.core.Object;
import acmi.l2.clientmod.unreal.properties.L2Property;

import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
import java.util.Objects;
import java.util.stream.Collectors;
import java.util.stream.Stream;

import static acmi.l2.clientmod.unreal.properties.PropertiesUtil.removeDefaults;

@SuppressWarnings("unchecked")
public class Decompiler {
    static Object instantiate(UnrealPackage.ExportEntry entry, UnrealSerializerFactory objectFactory) {
        return objectFactory.getOrCreateObject(entry);
    }

    public static CharSequence decompileProperties(Object object, UnrealSerializerFactory objectFactory, int indent) {
        Stream.Builder<CharSequence> properties = Stream.builder();

        UnrealPackage.ExportEntry e = object.entry;
        UnrealPackage up = e.getUnrealPackage();

        List<L2Property> props = new ArrayList<>(object.properties);
        removeDefaults(props, e.getObjectClass() == null ? e.getObjectSuperClass().getObjectFullName() : e.getFullClassName(), objectFactory, up);

        props.forEach(property -> {
            StringBuilder sb = new StringBuilder();

            Property template = property.getTemplate();

            for (int i = 0; i < template.arrayDimension; i++) {
                java.lang.Object obj = property.getAt(i);

                if (template instanceof ByteProperty ||
                        template instanceof ObjectProperty ||
                        template instanceof NameProperty ||
                        template instanceof ArrayProperty) {
                    assert obj != null;
                }

                if (template instanceof StructProperty) {
                    if (obj == null || ((List) obj).isEmpty())
                        continue;
                }

                if (i > 0)
                    sb.append(newLine(indent));

                if (template instanceof ByteProperty) {
                    sb.append(property.getName());
                    if (template.arrayDimension > 1) {
                        sb.append("(").append(i).append(")");
                    }
                    sb.append("=");
                    if (((ByteProperty) template).enumType != null) {
                        Enum en = ((ByteProperty) template).enumType;
                        sb.append(en.values[(Integer) obj]);
                    } else {
                        sb.append(obj);
                    }
                } else if (template instanceof IntProperty ||
                        template instanceof BoolProperty) {
                    sb.append(property.getName());
                    if (template.arrayDimension > 1) {
                        sb.append("(").append(i).append(")");
                    }
                    sb.append("=");
                    sb.append(obj);
                } else if (template instanceof FloatProperty) {
                    sb.append(property.getName());
                    if (template.arrayDimension > 1) {
                        sb.append("(").append(i).append(")");
                    }
                    sb.append("=");
                    sb.append(String.format(Locale.US, "%f", (Float) obj));
                } else if (template instanceof ObjectProperty) {
                    UnrealPackage.Entry entry = up.objectReference((Integer) obj);
                    if (needExport(entry, template)) {
                        properties.add(toT3d(instantiate((UnrealPackage.ExportEntry) entry, objectFactory), objectFactory, indent));
                    }
                    sb.append(property.getName());
                    if (template.arrayDimension > 1) {
                        sb.append("(").append(i).append(")");
                    }
                    sb.append("=");
                    if (entry == null) {
                        sb.append("None");
                    } else if (entry instanceof UnrealPackage.ImportEntry) {
                        sb.append(((UnrealPackage.ImportEntry) entry).getClassName().getName())
                                .append("'")
                                .append(entry.getObjectFullName())
                                .append("'");
                    } else if (entry instanceof UnrealPackage.ExportEntry) {
                        String clazz = "Class";
                        if (((UnrealPackage.ExportEntry) entry).getObjectClass() != null)
                            clazz = ((UnrealPackage.ExportEntry) entry).getObjectClass().getObjectName().getName();
                        sb.append(clazz)
                                .append("'")
                                .append(entry.getObjectInnerFullName())
                                .append("'");
                    } else {
                        throw new IllegalStateException("wtf");
                    }
                } else if (template instanceof NameProperty) {
                    sb.append(property.getName());
                    if (template.arrayDimension > 1) {
                        sb.append("(").append(i).append(")");
                    }
                    sb.append("=");
                    sb.append("'").append(up.nameReference((Integer) obj)).append("'");
                } else if (template instanceof ArrayProperty) {
                    ArrayProperty arrayProperty = (ArrayProperty) property.getTemplate();
                    Property innerProperty = arrayProperty.inner;
                    L2Property fakeProperty = new L2Property(innerProperty);
                    List<java.lang.Object> list = (List<java.lang.Object>) obj;

                    for (int j = 0; j < list.size(); j++) {
                        java.lang.Object innerObj = list.get(j);

                        if (innerProperty instanceof ObjectProperty) {
                            UnrealPackage.Entry entry = up.objectReference((Integer) innerObj);
                            if (needExport(entry, innerProperty)) {
                                properties.add(toT3d(instantiate((UnrealPackage.ExportEntry) entry, objectFactory), objectFactory, indent));
                            }
                        }

                        fakeProperty.putAt(0, innerObj);
                        if (j > 0)
                            sb.append(newLine(indent));
                        sb.append(property.getName()).append("(").append(j).append(")")
                                .append("=")
                                .append(inlineProperty(fakeProperty, up, objectFactory, true));
                    }
                } else if (template instanceof StructProperty) {
                    sb.append(property.getName());
                    if (template.arrayDimension > 1) {
                        sb.append("(").append(i).append(")");
                    }
                    sb.append("=");
                    sb.append(inlineStruct((List<L2Property>) obj, up, objectFactory));
                } else if (template instanceof StrProperty) {
                    sb.append(property.getName());
                    if (template.arrayDimension > 1) {
                        sb.append("(").append(i).append(")");
                    }
                    sb.append("=");
                    sb.append("\"").append(Objects.toString(obj)).append("\"");
                }
            }

            properties.add(sb);
        });

        return properties.build().collect(Collectors.joining(newLine(indent)));
    }

    public static CharSequence inlineProperty(L2Property property, UnrealPackage up, UnrealSerializerFactory objectFactory, boolean valueOnly) {
        StringBuilder sb = new StringBuilder();

        Property template = property.getTemplate();

        for (int i = 0; i < template.arrayDimension; i++) {
            if (!valueOnly) {
                sb.append(property.getName());

                if (template.arrayDimension > 1) {
                    sb.append("(").append(i).append(")");
                }

                sb.append("=");
            }

            java.lang.Object object = property.getAt(i);

            if (template instanceof ByteProperty) {
                if (((ByteProperty) template).enumType != null) {
                    Enum en = ((ByteProperty) template).enumType;
                    sb.append(en.values[(Integer) object]);
                } else {
                    sb.append(object);
                }
            } else if (template instanceof IntProperty ||
                    template instanceof BoolProperty) {
                sb.append(object);
            } else if (template instanceof FloatProperty) {
                sb.append(String.format(Locale.US, "%f", (Float) object));
            } else if (template instanceof ObjectProperty) {
                UnrealPackage.Entry entry = up.objectReference((Integer) object);
                if (entry == null) {
                    sb.append("None");
                } else if (entry instanceof UnrealPackage.ImportEntry) {
                    sb.append(((UnrealPackage.ImportEntry) entry).getClassName().getName())
                            .append("'")
                            .append(entry.getObjectFullName())
                            .append("'");
                } else if (entry instanceof UnrealPackage.ExportEntry) {
                    if (Property.CPF.getFlags(template.propertyFlags).contains(Property.CPF.ExportObject)) {
                        sb.append("\"").append(entry.getObjectName().getName()).append("\"");
                    } else {
                        String clazz = "Class";
                        if (((UnrealPackage.ExportEntry) entry).getObjectClass() != null)
                            clazz = ((UnrealPackage.ExportEntry) entry).getObjectClass().getObjectName().getName();
                        sb.append(clazz)
                                .append("'")
                                .append(entry.getObjectName().getName())
                                .append("'");
                    }
                } else {
                    throw new IllegalStateException("wtf");
                }
            } else if (template instanceof NameProperty) {
                sb.append("'").append(Objects.toString(object)).append("'");
            } else if (template instanceof ArrayProperty) {
                ArrayProperty arrayProperty = (ArrayProperty) property.getTemplate();
                Property innerProperty = arrayProperty.inner;
                L2Property fakeProperty = new L2Property(innerProperty);
                List<java.lang.Object> list = (List<java.lang.Object>) object;

                sb.append(list.stream()
                        .map(o -> {
                            fakeProperty.putAt(0, o);
                            return inlineProperty(fakeProperty, up, objectFactory, true);
                        }).collect(Collectors.joining(",", "(", ")")));
            } else if (template instanceof StructProperty) {
                if (object == null) {
                    sb.append("None");
                } else {
                    sb.append(inlineStruct((List<L2Property>) object, up, objectFactory));
                }
            } else if (template instanceof StrProperty) {
                sb.append("\"").append(Objects.toString(object)).append("\"");
            }

            if (i != template.arrayDimension - 1)
                sb.append(",");
        }

        return sb;
    }

    public static CharSequence inlineStruct(List<L2Property> struct, UnrealPackage up, UnrealSerializerFactory objectFactory) {
        return struct.stream().map(p -> inlineProperty(p, up, objectFactory, false)).collect(Collectors.joining(",", "(", ")"));
    }

    public static boolean needExport(UnrealPackage.Entry entry, Property template) {
        return entry != null &&
                entry instanceof UnrealPackage.ExportEntry &&
                (Property.CPF.getFlags(template.propertyFlags).contains(Property.CPF.ExportObject) ||
                        Property.CPF.getFlags(template.propertyFlags).contains(Property.CPF.EditInlineNotify)); //FIXME

    }

    public static CharSequence toT3d(Object object, UnrealSerializerFactory objectFactory, int indent) {
        StringBuilder sb = new StringBuilder();

        sb.append("Begin Object");
        sb.append(" Class=").append(object.entry.getObjectClass().getObjectName().getName());
        sb.append(" Name=").append(object.entry.getObjectName().getName());
        sb.append(newLine(indent + 1)).append(decompileProperties(object, objectFactory, indent + 1));
        sb.append(newLine(indent)).append("End Object");

        return sb;
    }

    public static CharSequence tab(int indent) {
        StringBuilder sb = new StringBuilder(indent);
        for (int i = 0; i < indent; i++)
            sb.append('\t');
        return sb;
    }

    public static CharSequence newLine(int indent) {
        StringBuilder sb = new StringBuilder("\r\n");
        sb.append(tab(indent));
        return sb;
    }
}


text:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
	<modelVersion>4.0.0</modelVersion>
	<groupId>se.danielkonsult</groupId>
	<artifactId>fsm4j</artifactId>
	<version>1.0.0</version>
	<scm>
		<url>https://github.com/bolddp/fsm4j</url>
		<connection>scm:git:git://github.com/bolddp/fsm4j.git</connection>
		<developerConnection>scm:git:git@github.com:bolddp/fsm4j.git</developerConnection>
	</scm>
	<developers>
		<developer>
			<email>daniel@danielkonsult.se</email>
			<name>Daniel Persson</name>
			<url>https://github.com/bolddp</url>
			<id>bolddp</id>
		</developer>
	</developers>
	<build>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>3.3</version>
				<configuration>
					<source>1.8</source>
					<target>1.8</target>
				</configuration>
			</plugin>
		</plugins>
	</build>
	<dependencies>
		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<version>4.12</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>com.google.inject</groupId>
			<artifactId>guice</artifactId>
			<version>4.1.0</version>
			<scope>test</scope>
		</dependency>
	</dependencies>
</project>


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>quiz:bit</title>
    <link href="main.css" rel="stylesheet">


text:
$(document).ready(function () {
    $('.choose-collegue-list li').on('click', function () {
        var $current_checkbox = $(this).find('input[type=checkbox]');
        if (!$(this).hasClass('selected')) {
            $(this).toggleClass('selected');
            $current_checkbox.attr({"checked": "checked"});
            $current_checkbox.parent().addClass('ez-checked');
        }
        else {
            $(this).toggleClass('selected');
            $current_checkbox.removeAttr("checked");
            $current_checkbox.parent().removeClass('ez-checked');
        }
    });
});


text:
Diffie-Hellman key exchange.

Alice and Bob use Diffie-Hellman key exchange to share secrets.  They
start with prime numbers, pick private keys, generate and share public
keys, and then generate a shared secret key.

## Step 0

The test program supplies prime numbers p and g.

## Step 1

Alice picks a private key, a, greater than 1 and less than p.  Bob does
the same to pick a private key b.

## Step 2

Alice calculates a public key A.

    A = g**a mod p

Using the same p and g, Bob similarly calculates a public key B from his
private key b.

## Step 3

Alice and Bob exchange public keys.  Alice calculates secret key s.

    s = B**a mod p

Bob calculates

    s = A**b mod p

The calculations produce the same result!  Alice and Bob now share
secret s.

## Setup

Go through the setup instructions for ECMAScript to
install the necessary dependencies:

http://exercism.io/languages/ecmascript/installation

## Requirements

Install assignment dependencies:

```bash
$ npm install
```

## Making the test suite pass

Execute the tests with:

```bash
$ npm test
```

In the test suites all tests but the first have been skipped.

Once you get a test passing, you can enable the next one by
changing `xtest` to `test`.

## Source

Wikipedia, 1024 bit key from www.cryptopp.com/wiki. [http://en.wikipedia.org/wiki/Diffie%E2%80%93Hellman_key_exchange](http://en.wikipedia.org/wiki/Diffie%E2%80%93Hellman_key_exchange)

## Submitting Incomplete Solutions
It's possible to submit an incomplete solution so you can see how others have completed the exercise.


text:
from abc import abstractmethod

import logging
import zmq
from zmq.eventloop import ioloop, zmqstream

loop = ioloop.IOLoop().instance()

logger = logging.getLogger(__name__)
ch = logging.StreamHandler()
ch.setLevel(logging.DEBUG)

# create formatter
formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')

# add formatter to ch
ch.setFormatter(formatter)

# add ch to logger
logger.addHandler(ch)

class CommandHandler:

    def __init__(self, name, end_point):
        self._context = zmq.Context.instance()
        self._name = name
        self._end_point = end_point
        self._sockt = self._context.socket(zmq.REP)
        self._stream = zmqstream.ZMQStream(self._sockt)
        self._stream.on_recv_stream(self._on_recv)
        self.log = logger

    @property
    def get_name(self):
        return self._name

    def start(self):
        self._stream.bind(self._end_point)
        self.log.info('command handler started')

    def stop(self):
        self._stream.stop_on_send()
        self._stream.stop_on_recv()
        self._stream.close()
        self.log.info('command handler stopped')

    @abstractmethod
    def _on_recv(self, stream, msg):
        pass

    @abstractmethod
    def _on_send(self, stream, msg, status):
        pass


text:
<?xml version="1.0"?>
<tool id="ncbi_taxonomy_fetcher" name="NCBI" tool_type="manage_data" version="1.0.0">
    <description>taxonomy downloader</description>
    <command detect_errors="exit_code">
    <![CDATA[
        python '$__tool_directory__/data_manager.py' --out '${out_file}'
        #if $taxonomy_url:
            --url '${taxonomy_url}'
        #end if
        #if $database_name:
            --name '${database_name}'
        #end if
    ]]>
    </command>
    <inputs>
        <param name="database_name" type="text" optional="true" label="Name for this database" help="Enter a unique identifier, or leave blank for today's date" />
        <param name="taxonomy_url" type="text" label="Enter URL for taxonomy files" />
    </inputs>
    <outputs>
        <data name="out_file" format="data_manager_json" />
    </outputs>
</tool>


text:
using System.IO;
using System.Text;
using System.Threading.Tasks;
using Xunit;

namespace System.Security.Cryptography.Encryption.Tests.Asymmetric
{
    public static partial class CryptoStreamTests
    {
        [Theory]
        [InlineData(false)]
        [InlineData(true)]
        public static async Task DisposeAsync_DataFlushedCorrectly(bool explicitFlushFinalBeforeDispose)
        {
            const string Text = "hello";

            var stream = new MemoryStream();
            using (CryptoStream encryptStream = new CryptoStream(stream, new IdentityTransform(64, 64, true), CryptoStreamMode.Write))
            {
                Assert.Equal(0, stream.Position);

                byte[] toWrite = Encoding.UTF8.GetBytes(Text);
                encryptStream.Write(toWrite, 0, toWrite.Length);
                Assert.False(encryptStream.HasFlushedFinalBlock);
                Assert.Equal(0, stream.Position);

                if (explicitFlushFinalBeforeDispose)
                {
                    encryptStream.FlushFinalBlock();
                }

                await encryptStream.DisposeAsync();
                Assert.True(encryptStream.HasFlushedFinalBlock);
                Assert.Equal(5, stream.ToArray().Length);

                Assert.True(encryptStream.DisposeAsync().IsCompletedSuccessfully);
            }

            stream = new MemoryStream(stream.ToArray()); // CryptoStream.Dispose disposes the stream
            using (CryptoStream decryptStream = new CryptoStream(stream, new IdentityTransform(64, 64, true), CryptoStreamMode.Read))
            {
                using (StreamReader reader = new StreamReader(decryptStream))
                {
                    Assert.Equal(Text, reader.ReadToEnd());
                }

                Assert.True(decryptStream.DisposeAsync().IsCompletedSuccessfully);
            }
        }

        [Fact]
        public static void DisposeAsync_DerivedStream_InvokesDispose()
        {
            var stream = new MemoryStream();
            using (var encryptStream = new DerivedCryptoStream(stream, new IdentityTransform(64, 64, true), CryptoStreamMode.Write))
            {
                Assert.False(encryptStream.DisposeInvoked);
                Assert.True(encryptStream.DisposeAsync().IsCompletedSuccessfully);
                Assert.True(encryptStream.DisposeInvoked);
            }
        }

        [Fact]
        public static void PaddedAes_PartialRead_Success()
        {
            using (Aes aes = Aes.Create())
            {
                aes.Mode = CipherMode.CBC;
                aes.Key = aes.IV = new byte[] { 0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xA, 0xB, 0xC, 0xD, 0xE, 0xF, };

                var memoryStream = new MemoryStream();
                using (var cryptoStream = new CryptoStream(memoryStream, aes.CreateEncryptor(), CryptoStreamMode.Write, leaveOpen: true))
                {
                    cryptoStream.Write(Encoding.ASCII.GetBytes("Sample string that's bigger than cryptoAlg.BlockSize"));
                    cryptoStream.FlushFinalBlock();
                }

                memoryStream.Position = 0;
                using (var cryptoStream = new CryptoStream(memoryStream, aes.CreateDecryptor(), CryptoStreamMode.Read))
                {
                    cryptoStream.ReadByte(); // Partially read the CryptoStream before disposing it.
                }

                // No exception should be thrown.
            }
        }

        private sealed class DerivedCryptoStream : CryptoStream
        {
            public bool DisposeInvoked;
            public DerivedCryptoStream(Stream stream, ICryptoTransform transform, CryptoStreamMode mode) : base(stream, transform, mode) { }
            protected override void Dispose(bool disposing)
            {
                DisposeInvoked = true;
                base.Dispose(disposing);
            }
        }
    }
}


text:
namespace FabricUI
{
  namespace DFG
  {
    class DFGController;

    class DFGSavePresetDialog : public DFGBaseDialog
    {
      Q_OBJECT

    public:

      /// Constructor
      DFGSavePresetDialog(
        QWidget * parent,
        DFGController *dfgController,
        bool setAlphaNum = false,
        QString name = "",
        const DFGConfig & dfgConfig = DFGConfig()
        );
      /// Destrcutor
      virtual ~DFGSavePresetDialog();

      /// Gets the name of the preset
      QString name() const;
      /// Gets the location of the preset
      QString location() const;

      /// Filter the QLineEdit text with the regexFilter
      void alphaNumicStringOnly();
      /// Filter the QLineEdit text with the setRegexFilter
      void setRegexFilter(QString regex);

    public slots:
      void onItemSelected(FabricUI::TreeView::TreeItem * item);
      void onCustomContextMenuRequested(QPoint globalPos, FabricUI::TreeView::TreeItem * item);
      void onContextMenuAction(QAction * action);

    private:

      DFGController *m_dfgController;
      QLineEdit * m_nameEdit;
      PresetTreeWidget * m_presetTree;
      QString m_contextPath;
      QString m_location;

    };

  };

};

#endif // __UI_DFG_DFGSavePresetDialog__


text:
module Azure::Network::Mgmt::V2016_06_01
  module Models
    #
    # Contains ServiceProviderProperties in an ExpressRouteCircuit
    #
    class ExpressRouteCircuitServiceProviderProperties

      include MsRestAzure

      # @return [String] Gets or sets serviceProviderName.
      attr_accessor :service_provider_name

      # @return [String] Gets or sets peering location.
      attr_accessor :peering_location

      # @return [Integer] Gets or sets BandwidthInMbps.
      attr_accessor :bandwidth_in_mbps

      #
      # Mapper for ExpressRouteCircuitServiceProviderProperties class as Ruby
      # Hash.
      # This will be used for serialization/deserialization.
      #
      def self.mapper()
        {
          client_side_validation: true,
          required: false,
          serialized_name: 'ExpressRouteCircuitServiceProviderProperties',
          type: {
            name: 'Composite',
            class_name: 'ExpressRouteCircuitServiceProviderProperties',
            model_properties: {
              service_provider_name: {
                client_side_validation: true,
                required: false,
                serialized_name: 'serviceProviderName',
                type: {
                  name: 'String'
                }
              },
              peering_location: {
                client_side_validation: true,
                required: false,
                serialized_name: 'peeringLocation',
                type: {
                  name: 'String'
                }
              },
              bandwidth_in_mbps: {
                client_side_validation: true,
                required: false,
                serialized_name: 'bandwidthInMbps',
                type: {
                  name: 'Number'
                }
              }
            }
          }
        }
      end
    end
  end
end


text:
COOPR_DISTRIBUTIONS=${COOPR_DISTRIBUTIONS:-centos ubuntu}

die() { echo "ERROR: ${@}"; exit 1; }

__clean() {
  for __distro in ${COOPR_DISTRIBUTIONS}; do
    __containers=$(docker ps -a | grep omnibus-coopr-${__distro} | awk '{print $1}' 2>/dev/null)
    if [[ -n ${__containers} ]]; then
      for __id in ${__containers}; do
        docker stop ${__id} 2>/dev/null
        docker rm ${__id} 2>/dev/null
      done
    fi
    __images=$(docker images | grep omnibus-coopr-${__distro} | awk '{print $3}' | sort -u 2>/dev/null)
    if [[ -n ${__images} ]]; then
      for __img in ${__images}; do
        docker rmi ${__img} 2>/dev/null
      done
    fi
  done
  return
}

__build() {
  mkdir -p target
  local __failed
  for __distro in ${COOPR_DISTRIBUTIONS}; do
    # Create image
    __image=omnibus-coopr-${__distro}
    echo "Creating ${__image} from Dockerfile-${__distro}"
    docker build -f Dockerfile-${__distro} -t ${__image} .
    if [[ $? -eq 0 ]]; then
      echo "Copying artifacts from ${__image}"
      docker run --detach=false --tty=false -v $(pwd -P)/target:/tmp/target ${__image} /bin/bash -xc 'cp -vf /var/tmp/coopr-build/pkg/* /tmp/target'
      if [[ $? -eq 0 ]]; then
        echo "Copied ${__distro} packages to target successfully"
      else
        die "Copying ${__distro} packages failed!"
      fi
    else
      __failed+="${__distro} "
    fi
  done
  if [[ -n ${__failed} ]]; then
    die "Failed to build the following distribution packages: ${__failed}"
  fi
  __clean
  return
}

__ret=1
if [[ ${#} -eq 0 ]]; then
  echo "No arguments given, running: clean build"
  __clean ; __build
  __ret=$?
else
  while [[ ${#} -gt 0 ]]; do
    case ${1} in
      clean|build) __action=${1}; shift; __${__action}; __ret=$? ;;
      *) die "Unrecognized parameter!" ;;
    esac
  done
fi

exit ${__ret}


text:
package mocks

import "github.com/sclevine/agouti/api"

type Element struct {
	GetElementCall struct {
		Selector      api.Selector
		ReturnElement *api.Element
		Err           error
	}

	GetElementsCall struct {
		Selector       api.Selector
		ReturnElements []*api.Element
		Err            error
	}

	GetIDCall struct {
		ReturnText string
	}

	GetTextCall struct {
		ReturnText string
		Err        error
	}

	GetNameCall struct {
		ReturnName string
		Err        error
	}

	GetAttributeCall struct {
		Attribute   string
		ReturnValue string
		Err         error
	}

	GetCSSCall struct {
		Property    string
		ReturnValue string
		Err         error
	}

	ClickCall struct {
		Called bool
		Err    error
	}

	ClearCall struct {
		Called bool
		Err    error
	}

	ValueCall struct {
		Text string
		Err  error
	}

	IsSelectedCall struct {
		ReturnSelected bool
		Err            error
	}

	IsDisplayedCall struct {
		ReturnDisplayed bool
		Err             error
	}

	IsEnabledCall struct {
		ReturnEnabled bool
		Err           error
	}

	SubmitCall struct {
		Called bool
		Err    error
	}

	IsEqualToCall struct {
		Element      *api.Element
		ReturnEquals bool
		Err          error
	}

	GetLocationCall struct {
		ReturnX int
		ReturnY int
		Err     error
	}
}

func (e *Element) GetElement(selector api.Selector) (*api.Element, error) {
	e.GetElementCall.Selector = selector
	return e.GetElementCall.ReturnElement, e.GetElementCall.Err
}

func (e *Element) GetElements(selector api.Selector) ([]*api.Element, error) {
	e.GetElementsCall.Selector = selector
	return e.GetElementsCall.ReturnElements, e.GetElementsCall.Err
}

func (e *Element) GetText() (string, error) {
	return e.GetTextCall.ReturnText, e.GetTextCall.Err
}

func (e *Element) GetID() string {
	return e.GetIDCall.ReturnText
}

func (e *Element) GetName() (string, error) {
	return e.GetNameCall.ReturnName, e.GetNameCall.Err
}

func (e *Element) GetAttribute(attribute string) (string, error) {
	e.GetAttributeCall.Attribute = attribute
	return e.GetAttributeCall.ReturnValue, e.GetAttributeCall.Err
}

func (e *Element) GetCSS(property string) (string, error) {
	e.GetCSSCall.Property = property
	return e.GetCSSCall.ReturnValue, e.GetCSSCall.Err
}

func (e *Element) Click() error {
	e.ClickCall.Called = true
	return e.ClickCall.Err
}

func (e *Element) Clear() error {
	e.ClearCall.Called = true
	return e.ClearCall.Err
}

func (e *Element) Value(text string) error {
	e.ValueCall.Text = text
	return e.ValueCall.Err
}

func (e *Element) IsSelected() (bool, error) {
	return e.IsSelectedCall.ReturnSelected, e.IsSelectedCall.Err
}

func (e *Element) IsDisplayed() (bool, error) {
	return e.IsDisplayedCall.ReturnDisplayed, e.IsDisplayedCall.Err
}

func (e *Element) IsEnabled() (bool, error) {
	return e.IsEnabledCall.ReturnEnabled, e.IsEnabledCall.Err
}

func (e *Element) Submit() error {
	e.SubmitCall.Called = true
	return e.SubmitCall.Err
}

func (e *Element) IsEqualTo(other *api.Element) (bool, error) {
	e.IsEqualToCall.Element = other
	return e.IsEqualToCall.ReturnEquals, e.IsEqualToCall.Err
}

func (e *Element) GetLocation() (x, y int, err error) {
	return e.GetLocationCall.ReturnX, e.GetLocationCall.ReturnY, e.GetLocationCall.Err
}


text:
app.controller("homeCtrl",

	// Implementation the todoCtrl
	function($scope, Auth, $firebaseArray, $firebaseObject) {
		console.log("home");
	}
);


text:
package org.apache.isis.viewer.dnd.view.window;

import org.apache.isis.viewer.dnd.view.View;
import org.apache.isis.viewer.dnd.view.base.AbstractFocusManager;

public class SubviewFocusManager extends AbstractFocusManager {
    private final WindowBorder windowBorder;

    public SubviewFocusManager(final WindowBorder container) {
        super(container);
        windowBorder = container;
    }

    public SubviewFocusManager(final View container) {
        super(container);
        windowBorder = null;
    }

    public SubviewFocusManager(final View container, final View initalFocus) {
        super(container, initalFocus);
        windowBorder = null;
    }

    @Override
    protected View[] getChildViews() {
        final View[] subviews = container.getSubviews();
        final View[] buttons = windowBorder == null ? new View[0] : windowBorder.getButtons();

        final View[] views = new View[subviews.length + buttons.length];
        System.arraycopy(subviews, 0, views, 0, subviews.length);
        System.arraycopy(buttons, 0, views, subviews.length, buttons.length);
        return views;
    }

}


text:
package io.strati.functional.exception;

import io.strati.functional.resilience.CircuitBreaker;

/**
 * @author WalmartLabs
 * @author Georgi Khomeriki [gkhomeriki@walmartlabs.com]
 */

public class CircuitBreakerOpenException extends RuntimeException {
  private final CircuitBreaker.State state;

  public CircuitBreakerOpenException(final String msg, final Throwable cause, CircuitBreaker.State state) {
    super(msg, cause);
    this.state = state;
  }

  /**
   * @return The state of the circuit breaker when this exception was thrown,
   * either {@link io.strati.functional.resilience.CircuitBreaker.State#OPEN} or
   * {@link io.strati.functional.resilience.CircuitBreaker.State#HALF_OPEN}
   */
  public CircuitBreaker.State getState() {
    return state;
  }
}


text:
class LedDeviceP9813 : public ProviderSpi
{
public:
	///
	/// @brief Constructs a P9813 LED-device
	///
	/// @param deviceConfig Device's configuration as JSON-Object
	///
	explicit LedDeviceP9813(const QJsonObject &deviceConfig);

	///
	/// @brief Constructs the LED-device
	///
	/// @param[in] deviceConfig Device's configuration as JSON-Object
	/// @return LedDevice constructed
	static LedDevice* construct(const QJsonObject &deviceConfig);

private:

	///
	/// @brief Initialise the device's configuration
	///
	/// @param[in] deviceConfig the JSON device configuration
	/// @return True, if success
	///
	bool init(const QJsonObject &deviceConfig) override;

	///
	/// @brief Writes the RGB-Color values to the LEDs.
	///
	/// @param[in] ledValues The RGB-color per LED
	/// @return Zero on success, else negative
	///
	int write(const std::vector<ColorRgb> & ledValues) override;

	///
	/// Calculates the required checksum for one LED
	///
	/// @param color The color of the led
	/// @return The checksum for the led
	///
	uint8_t calculateChecksum(const ColorRgb & color) const;
};

#endif // LEDEVICEP9813_H


text:
using NUnit.Framework;
using KSPPartRemover.KspFormat.Objects;

namespace KSPPartRemover.Tests.KspFormat.Objects
{
    public class KspObjectSearchExtensionsTest
    {
        [Test]
        public void CanFindPropertiesOfAnObjectByName()
        {
            // given
            var obj = new KspObject("OBJ")
                .AddProperty(new KspStringProperty("property", "value1"))
                .AddProperty(new KspStringProperty("anotherProperty", "value2"))
                .AddProperty(new KspStringProperty("property", "value3"));

            // when / then
            Assert.That(obj.Properties<KspProperty>("property"), Is.EqualTo(new[] {
                obj.Properties [0],
                obj.Properties [2]
            }));
        }

        [Test]
        public void CanFindChildrenOfAnObjectByType()
        {
            // given
            var obj = new KspObject("OBJ")
                .AddChild(new KspPartObject() // found
                    .AddChild(new KspPartObject())) // not found
                .AddChild(new KspObject(KspPartObject.TypeId) // not found
                    .AddChild(new KspPartObject())) // not found
                .AddChild(new KspPartObject() // found
                    .AddChild(new KspObject(KspPartObject.TypeId))); // not found

            // when / then
            Assert.That(obj.Children<KspPartObject>(), Is.EqualTo(new[] { obj.Children[0], obj.Children[2] }));
        }

        [Test]
        public void CanRecursivelyFindChildrenByType()
        {
            // given
            var obj = new KspObject("OBJ")
                .AddChild(new KspPartObject() // found
                    .AddChild(new KspPartObject())) // found
                .AddChild(new KspObject(KspPartObject.TypeId) // not found
                    .AddChild(new KspPartObject())) // found
                .AddChild(new KspPartObject() // found
                    .AddChild(new KspObject(KspPartObject.TypeId))); // not found

            // when / then
            Assert.That(obj.Children<KspPartObject>(recursive: true), Is.EqualTo(new[] {
                obj.Children [0],
                obj.Children [0].Children [0],
                obj.Children [1].Children [0],
                obj.Children [2]
            }));
        }

        [Test]
        public void CanFindChildById()
        {
            // given
            var obj = new KspObject("OBJ")
                .AddChild(new KspCraftObject())
                .AddChild(new KspPartObject())
                .AddChild(new KspPartObject())
                .AddChild(new KspPartObject())
                .AddChild(new KspCraftObject());

            // when / then
            Assert.That(obj.Child<KspCraftObject>(-1), Is.Null);
            Assert.That(obj.Child<KspCraftObject>(0), Is.EqualTo(obj.Children[0])); // Ids are per object-type
            Assert.That(obj.Child<KspCraftObject>(1), Is.EqualTo(obj.Children[4]));
            Assert.That(obj.Child<KspCraftObject>(2), Is.Null);

            Assert.That(obj.Child<KspPartObject>(0), Is.EqualTo(obj.Children[1]));
            Assert.That(obj.Child<KspPartObject>(1), Is.EqualTo(obj.Children[2]));
            Assert.That(obj.Child<KspPartObject>(2), Is.EqualTo(obj.Children[3]));
        }

        [Test]
        public void CanRetrieveIdOfChild()
        {
            // given
            var obj = new KspObject("OBJ")
                .AddChild(new KspCraftObject())
                .AddChild(new KspPartObject())
                .AddChild(new KspPartObject())
                .AddChild(new KspPartObject())
                .AddChild(new KspCraftObject());

            // when / then
            Assert.That(obj.IdOfChild(obj.Children[0] as KspCraftObject), Is.EqualTo(0)); // Ids are per object-type
            Assert.That(obj.IdOfChild(obj.Children[4] as KspCraftObject), Is.EqualTo(1));

            Assert.That(obj.IdOfChild(obj.Children[1] as KspPartObject), Is.EqualTo(0));
            Assert.That(obj.IdOfChild(obj.Children[2] as KspPartObject), Is.EqualTo(1));
            Assert.That(obj.IdOfChild(obj.Children[3] as KspPartObject), Is.EqualTo(2));
        }
    }
}


text:
layout: page
title: Warren 10th Anniversary
date: 2016-05-24
author: Ruth Gibbs
tags: weekly links, java
status: published
summary: Class aptent taciti sociosqu ad.
banner: images/banner/people.jpg
booking:
  startDate: 06/01/2019
  endDate: 06/03/2019
  ctyhocn: FLLCYHX
  groupCode: W1A
published: true
---
Sed ut tincidunt mi. Pellentesque elementum velit ut augue ultrices congue. Suspendisse condimentum ligula imperdiet ipsum egestas posuere. Sed egestas libero ex, ut ultricies odio ornare id. Cras et semper lectus. Quisque ultricies felis libero, condimentum rhoncus dolor fringilla sed. Integer ac mollis urna. Fusce lobortis risus felis, ac mollis magna sodales in. Cras porta maximus aliquam. Morbi egestas dictum augue, id vulputate nisi posuere sit amet. Fusce posuere quam nisl, sed feugiat purus facilisis a. Phasellus fermentum tempus leo, in gravida eros. Mauris laoreet interdum placerat. Donec at ex semper mi tincidunt euismod nec sit amet est. Donec et ultrices tortor. Fusce volutpat dolor at ex pharetra, non fermentum ipsum bibendum.

* In at mauris id velit volutpat commodo quis dignissim magna
* Nunc non nisi vel ligula rutrum pharetra.

Duis nulla justo, aliquam sit amet massa mollis, finibus fringilla eros. Etiam vitae sem volutpat magna facilisis dapibus in et diam. Ut sagittis aliquet nulla ut consequat. Donec imperdiet, dui in ultrices auctor, elit ex lacinia dui, vel tempus nisl elit at magna. Nulla tempor orci eu euismod varius. Aenean ac ligula aliquet, gravida quam et, commodo ipsum. Curabitur mollis lacus sit amet dolor semper luctus. Integer tempus dui et molestie blandit. Mauris tempus urna ut porttitor venenatis. Mauris eget lectus elit.


text:
<form>

<?= trans('boomcms::settings.admin.heading') ?>

<?= trans('boomcms::settings.admin.internal-name') ?>

            <input type='text' name='internal_name' value='<?= $page->getInternalName() ?>' />

<?= trans('boomcms::settings.admin.disable-delete') ?>

            <select name="disable_delete">
                <option value="1"<?php if (!$page->canBeDeleted()): ?> selected<?php endif ?>>Yes</option>
                <option value=""<?php if ($page->canBeDeleted()): ?> selected<?php endif ?>>No</option>
            </select>

<?= trans('boomcms::settings.admin.add-behaviour-heading') ?>

<?= trans('boomcms::settings.admin.add-behaviour-desc') ?>

<?= trans('boomcms::settings.admin.add-behaviour') ?>

            <select name="add_behaviour">
                <?php foreach (Lang::get('boomcms::page.add-behaviour') as $value => $desc): ?>
                  <option value="<?= $value ?>"<?php if ($page->getAddPageBehaviour() === $value): ?> selected<?php endif ?>>
                    <?= $desc ?>
                  </option>
                <?php endforeach ?>
            </select>

<?= trans('boomcms::settings.admin.child-add-behaviour') ?>

            <select name="child_add_behaviour">
                <?php foreach (Lang::get('boomcms::page.add-behaviour') as $value => $desc): ?>
                  <option value="<?= $value ?>"<?php if ($page->getChildAddPageBehaviour() === $value): ?> selected<?php endif ?>>
                    <?= $desc ?>
                  </option>
                <?php endforeach ?>
            </select>

    <?= $button('refresh', 'reset', ['class' => 'b-button-cancel b-button-withtext']) ?>
    <?= $button('save', 'save', ['class' => 'b-button-save b-button-withtext']) ?>
</form>