text:
package com.bbu.spring.boot.autoconfigure.beetl;

import org.beetl.sql.ext.spring4.BeetlSqlScannerConfigurer;
import org.springframework.beans.factory.support.BeanDefinitionBuilder;
import org.springframework.beans.factory.support.DefaultListableBeanFactory;
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.context.ApplicationContextInitializer;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.env.Environment;

/**
 * BeetlConfigurationApplicationContextInitializer
 *
 * @author weihuazhang
 * @since 16/4/1
 */

@Configuration
@AutoConfigureAfter(BeetlSqlAutoConfiguration.class)
public class BeetlConfigurationApplicationContextInitializer implements ApplicationContextInitializer<ConfigurableApplicationContext> {

    private ConfigurableApplicationContext applicationContext;

    @Override
    public void initialize(ConfigurableApplicationContext applicationContext) {
        this.applicationContext = applicationContext;
        Environment env = applicationContext.getEnvironment();

        String basePackage = env.getProperty("beetlsql.basePackage");
        String daoSuffix = env.getProperty("beetlsql.daoSuffix");

        addScannerConfigurerToBeanFactory(basePackage, daoSuffix);
    }

    private void addScannerConfigurerToBeanFactory(String basePackage, String daoSuffix) {

        if (basePackage == null || basePackage.length() == 0) {
            return;
        }

        Class<?> beanClass = BeetlSqlScannerConfigurer.class;
        String beanName = beanClass.getName();

        DefaultListableBeanFactory beanFactory = (DefaultListableBeanFactory) applicationContext
                .getBeanFactory();
        if (!beanFactory.containsBean(beanName)) {
            BeanDefinitionBuilder beanDefinitionBuilder = BeanDefinitionBuilder.rootBeanDefinition(beanClass);
            beanDefinitionBuilder.addPropertyValue("basePackage", basePackage);
            if (daoSuffix != null && daoSuffix.length() > 0) {
                beanDefinitionBuilder.addPropertyValue("daoSuffix", daoSuffix);
            }
            beanDefinitionBuilder.addPropertyValue("sqlManagerFactoryBeanName", "sqlManagerFactoryBean");
            beanDefinitionBuilder.addPropertyValue("beanName", beanName);
            beanDefinitionBuilder.addPropertyValue("applicationContext", applicationContext);
            beanFactory.registerBeanDefinition(beanName, beanDefinitionBuilder.getBeanDefinition());
        }
    }
}


text:
{{ motion.getTitle() }}

      <translate>Motion</translate> {{ motion.identifier }} |
      <translate translate-comment='ballot of a motion'>Voting result</translate>

        {{ liveVotes.yes }}
        {{ poll.yes }}

          {{ poll.getVote(poll.yes, 'yes').percentStr || ' ' }}

          <uib-progressbar value="poll.getVote(poll.yes, 'yes').percentNumber" type="success"
            ng-class="{ 'progress-striped active': !poll.has_votes }"></uib-progressbar>

        {{ liveVotes.no }}
        {{ poll.no }}

          {{ poll.getVote(poll.no, 'no').percentStr || ' ' }}

          <uib-progressbar value="poll.getVote(poll.no, 'no').percentNumber" type="danger"
            ng-class="{ 'progress-striped active': !poll.has_votes }"></uib-progressbar>

        {{ liveVotes.abstain }}
        {{ poll.abstain }}

          {{ poll.getVote(poll.abstain, 'abstain').percentStr || ' '}}

          <uib-progressbar value="poll.getVote(poll.abstain, 'abstain').percentNumber" type="warning"
            ng-class="{ 'progress-striped active': !poll.has_votes }"></uib-progressbar>

        {{ poll.votesvalid || votes_received }}

        {{ poll.getVote(poll.votesvalid, 'votesvalid').percentStr }}

redpajama_set_name: RedPajamaGithub


text:
DROP TRIGGER IF EXISTS collection_update_lists_card_quantities_trigger ON collection;
DROP FUNCTION IF EXISTS update_lists_card_quantities();


text:
Spacer = class("Spacer")

---
-- Spacer:initialize
-- A blank spacer with variable height.
--
function Spacer:initialize()

    self.height = 50

end

---
-- Spacer:update
-- Called every frame, does nothing.
--
-- @param dt        Time passed since last frame
--
function Spacer:update(dt)

end

---
-- Spacer:draw
-- Draw a nothing!
--
function Spacer:draw()

end


text:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

using MVVMDemo.Entities;
using MVVMDemo.ViewModels.Account;

namespace MVVMDemo
{
	public partial class _Default : System.Web.UI.Page
	{
		public UserViewModel Model { get; set; }

	    private void SetSkillsVisibility()
	    {
            if (Model == null || Model.User == null)
                lvSkills.Visible = false;
            else if (Model.User.ID == 0)
                lvSkills.Visible = false;
            else
                lvSkills.Visible = true;
	    }

		protected void Page_Load(object sender, EventArgs e)
		{
			Model = UserViewModel.CreateInstance();
			Model.PropertyChanged += modelUpdated;
		    SetSkillsVisibility();
		}

	    protected void dataUser_OnObjectCreating(object sender, ObjectDataSourceEventArgs e)
		{
			e.ObjectInstance = Model;
            SetSkillsVisibility();
		}

		protected void frmUser_OnModeChanging(object sender, FormViewModeEventArgs e)
		{
			switch (e.NewMode)
			{
				case FormViewMode.Edit:
					frmUser.ChangeMode(FormViewMode.Edit);

					if (Model.User == null)
					{
						Model.User = new User();
					}

					break;
			}
		}

		private void modelUpdated(object sender, PropertyChangedEventArgs e)
		{
		    frmUser.DataBind();
		}
	}
}


text:
NewDeviceSetup :: Android Tablet
====================


text:
namespace Microsoft.Azure.Search.Models
{
    using System.Collections.Generic;
    using Newtonsoft.Json;

    /// <summary>
    /// Represents the current status and execution history of an indexer.
    /// </summary>
    public class IndexerExecutionInfo
    {
        /// <summary>
        /// Initializes a new instance of the IndexerExecutionInfo class.
        /// </summary>
        public IndexerExecutionInfo() { }

        /// <summary>
        /// Initializes a new instance of the IndexerExecutionInfo class.
        /// </summary>
        public IndexerExecutionInfo(IndexerStatus status = default(IndexerStatus), IndexerExecutionResult lastResult = default(IndexerExecutionResult), IList<IndexerExecutionResult> executionHistory = default(IList<IndexerExecutionResult>))
        {
            Status = status;
            LastResult = lastResult;
            ExecutionHistory = executionHistory;
        }

        /// <summary>
        /// Overall indexer status. Possible values for this property include:
        /// 'unknown', 'error', 'running'.
        /// </summary>
        [JsonProperty(PropertyName = "status")]
        public IndexerStatus Status { get; private set; }  // TODO: Note in the Swagger spec that it's non-nullable

        /// <summary>
        /// The result of the most recent or an in-progress indexer execution.
        /// </summary>
        [JsonProperty(PropertyName = "lastResult")]
        public IndexerExecutionResult LastResult { get; private set; }

        /// <summary>
        /// History of the recent indexer executions, sorted in reverse
        /// chronological order.
        /// </summary>
        [JsonProperty(PropertyName = "executionHistory")]
        public IList<IndexerExecutionResult> ExecutionHistory { get; private set; }

    }
}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Mycotaxon 35(1): 14 (1989)

#### Original name
Lecidea santensis Tuck.

### Remarks
null


text:
/**
 * Logs in, then creates a group "Api Group", edits the name to read "Api Group 2", then deletes it
 */

'use strict';
var Workfront = require('./../../');
var util = require('util');

var instance = new Workfront.NodeApi({
    url: 'http://localhost:8080',
    version: '7.0'
});

console.log('Logs in, then creates a group "Api Group", edits the name to read "Api Group 2", then deletes it\n');
util.log('Logging in ...');
instance.login('new@user.attask', 'user').then(
	function(data) {
		util.log('Creating new group ...');
		instance.create('group', {name: 'Api Group'}).then(
			function(data) {
				util.log('Create success. Received data:');
				console.log(util.inspect(data, {colors:true}));
				instance.edit('group', data.ID, {
					name: 'Api Group 2'
				}, ['ID']).then(
					function(data) {
						util.log('Edit success. Received data:');
						console.log(util.inspect(data, {colors:true}));
						instance.remove('group', data.ID).then(
							function() {
								util.log('Remove success');
							},
							function(error) {
								util.log('Remove failure. Received data:');
								console.log(util.inspect(error, {colors:true}));
							}
						);
					},
					function(error) {
						util.log('Edit failure. Received data:');
						console.log(util.inspect(error, {colors:true}));
					}
				);
			},
			function(error) {
				util.log('Create failure. Received data:');
				console.log(util.inspect(error, {colors:true}));
			}
		);
	},
	function(error) {
		util.log('Login failure. Received data:');
		console.log(util.inspect(error, {colors:true}));
	}
);


text:
package main

import (
	"encoding/json"
	"flag"
	"log"
	"math/rand"
	"net/http"
	"time"
)

func main() {
	listenAddr := flag.String("http.addr", ":8079", "http listen address")
	flag.Parse()

	http.HandleFunc("/primes", handler([]int{2, 3, 5, 7, 11, 13}))
	http.HandleFunc("/fibo", handler([]int{1, 1, 2, 3, 5, 8, 13, 21}))
	http.HandleFunc("/odd", handler([]int{1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23}))
	http.HandleFunc("/rand", handler([]int{5, 17, 3, 19, 76, 24, 1, 5, 10, 34, 8, 27, 7}))

	log.Fatal(http.ListenAndServe(*listenAddr, nil))
}

func handler(numbers []int) func(http.ResponseWriter, *http.Request) {
	return func(w http.ResponseWriter, r *http.Request) {
		waitPeriod := rand.Intn(750)
		log.Printf("%s: waiting %dms.", r.URL.Path, waitPeriod)

		time.Sleep(time.Duration(waitPeriod) * time.Millisecond)

		x := rand.Intn(100)
		if x < 10 {
			http.Error(w, "service unavailable", http.StatusServiceUnavailable)
			return
		}

		w.Header().Set("Content-Type", "application/json")
		w.WriteHeader(http.StatusOK)

		json.NewEncoder(w).Encode(map[string]interface{}{"numbers": numbers})
	}
}


text:
<?php

require("../../../include/session.php");

class totalReport{

	var $selectcolumns;
	var $selecttable;
	var $whereclause="";
	var $group="";
	var $showinvoices=false;
	var $showlineitems=false;
	var $padamount=20;

	function totalReport($db,$variables = NULL){
		$this->db = $db;

		// first we define the available groups
		$this->addGroup("Invoice Date - Year","YEAR(invoices.invoicedate)"); //0
		$this->addGroup("Invoice Date - Quarter","QUARTER(invoices.invoicedate)"); //1
		$this->addGroup("Invoice Date - Month","MONTH(invoices.invoicedate)"); //2
		$this->addGroup("Invoice Date","invoices.invoicedate","date"); //3

		$this->addGroup("Order Date - Year","YEAR(invoices.orderdate)"); //4
		$this->addGroup("Order Date - Quarter","QUARTER(invoices.orderdate)");//5
		$this->addGroup("Order Date - Month","MONTH(invoices.orderdate)");//6
		$this->addGroup("Order Date","invoices.orderdate","date");//7

		$this->addGroup("Required Date - Year","YEAR(invoices.requireddate)");//8
		$this->addGroup("Required Date - Quarter","QUARTER(invoices.requireddate)");//9
		$this->addGroup("Required Date - Month","MONTH(invoices.requireddate)");//10
		$this->addGroup("Required Date","invoices.requireddate","date");//11

		$this->addGroup("Client","if(clients.lastname!='',concat(clients.lastname,', ',clients.firstname,if(clients.company!='',concat(' (',clients.company,')'),'')),clients.company)");//12

		$this->addGroup("Client Sales Person","concat(salesPerson.firstname,' ',salesPerson.lastname)",NULL, "LEFT JOIN users AS salesPerson ON clients.salesmanagerid = salesPerson.id");//13

		$this->addGroup("Client Lead Source","clients.leadsource");//14

		$this->addGroup("Invoice Lead Source","invoices.leadsource");//15

		$this->addGroup("Payment Method","paymentmethods.name");//16

		$this->addGroup("Shipping Method","shippingmethods.name");//17
		$this->addGroup("Invoice Shipping Country","invoices.country");//18
		$this->addGroup("Invoice Shipping State / Province","invoices.state");//19
		$this->addGroup("Invoice Shipping Postal Code","invoices.postalcode");//20
		$this->addGroup("Invoice Shipping City","invoices.city");//21

		$this->addGroup("Web Order","invoices.weborder","boolean");//22

		//next we do the columns
		$this->addColumn("Record Count","count(invoices.id)");//0
		$this->addColumn("Invoice Total","sum(invoices.totalti)","currency");//1
		$this->addColumn("Average Invoice Total","avg(invoices.totalti)","currency");//2

		$this->addColumn("Subtotal","sum(invoices.totaltni)","currency");//3
		$this->addColumn("Average Subtotal","avg(invoices.totaltni)","currency");//4

		$this->addColumn("Tax","sum(invoices.tax)","currency");//5
		$this->addColumn("Average Tax","avg(invoices.tax)","currency");//6

		$this->addColumn("Shipping","sum(invoices.shipping)","currency");//7
		$this->addColumn("Average Shipping","avg(invoices.shipping)","currency");//8

		$this->addColumn("Amount Paid","sum(invoices.amountpaid)","currency");//9
		$this->addColumn("Average Amount Paid","avg(invoices.amountpaid)","currency");//10

		$this->addColumn("Amount Due","sum(invoices.totalti - invoices.amountpaid)","currency");//11
		$this->addColumn("Average Amount Due","avg(invoices.totalti - invoices.amountpaid)","currency");//12

		$this->addColumn("Cost","sum(invoices.totalcost)","currency");//13
		$this->addColumn("Average Cost","avg(invoices.totalcost)","currency");//14

		$this->addColumn("Total Weight","sum(invoices.totalweight)","real");//15
		$this->addColumn("Average Total Weight","avg(invoices.totalweight)","real");//16

		if($variables){
			$tempArray = explode("::", $variables["columns"]);

			foreach($tempArray as $id)
				$this->selectcolumns[] = $this->columns[$id];
			$this->selectcolumns = array_reverse($this->selectcolumns);

			$this->selecttable="((invoices inner join clients on invoices.clientid=clients.id) LEFT JOIN shippingmethods ON shippingmethods.id = invoices.shippingmethodid) LEFT JOIN paymentmethods ON paymentmethods.id=invoices.paymentmethodid";

			if($variables["groupings"] !== ""){
				$this->group = explode("::",$variables["groupings"]);
				$this->group = array_reverse($this->group);
			} else
				$this->group = array();

			foreach($this->group as $grp){
				if($this->groupings[$grp]["table"])
					$this->selecttable="(".$this->selecttable." ".$this->groupings[$grp]["table"].")";
			}

			$this->whereclause=$_SESSION["printing"]["whereclause"];
			if($this->whereclause=="") $this->whereclause="WHERE invoices.id!=-1";

			switch($variables["showwhat"]){
				case "invoices":
					$this->showinvoices = true;
					$this->showlineitems = false;
					break;

				case "lineitems":
					$this->showinvoices = true;
					$this->showlineitems = true;
					break;

				default:
					$this->showinvoices = false;
					$this->showlineitems = false;
			}// endswitch

			if($this->whereclause!="") $this->whereclause=" WHERE (".substr($this->whereclause,6).") ";
		}// endif
	}//end method

	function addGroup($name, $field, $format = NULL, $tableAddition = NULL){
		$temp = array();
		$temp["name"] = $name;
		$temp["field"] = $field;
		$temp["format"] = $format;
		$temp["table"] = $tableAddition;

		$this->groupings[] = $temp;
	}//end method

	function addColumn($name, $field, $format = NULL){
		$temp = array();
		$temp["name"] = $name;
		$temp["field"] = $field;
		$temp["format"] = $format;

		$this->columns[] = $temp;
	}//end method

	function showReportTable(){
		?>

		<?php
			foreach($this->selectcolumns as $thecolumn){
				?><?php echo $thecolumn["name"]?>	<?php
			}//end foreach
		?>

		<?php $this->showGroup($this->group,"",10);?>
		<?php $this->showGrandTotals();?>

		<?php
	}

	function showGrandTotals(){

		$querystatement="SELECT ";
		foreach($this->selectcolumns as $thecolumn)
			$querystatement.=$thecolumn["field"]." AS `".$thecolumn["name"]."`,";
		$querystatement.=" count(invoices.id) as thecount ";
		$querystatement.=" FROM ".$this->selecttable.$this->whereclause;
		$queryresult=$this->db->query($querystatement);

		$therecord=$this->db->fetchArray($queryresult);
		?>

			Totals: (<?php echo $therecord["thecount"]?>)
			<?php
				foreach($this->selectcolumns as $thecolumn){
					?><?php echo formatVariable($therecord[$thecolumn["name"]],$thecolumn["format"])?>	<?php
				}//end foreach
			?>

		<?php
	}

	function showGroup($group,$where,$indent){

		if(!$group){
			if($this->showinvoices)
				$this->showInvoices($where,$indent+$this->padamount);
		} else {
			$groupby = array_pop($group);

			$querystatement="SELECT ";
			foreach($this->selectcolumns as $thecolumn)
				$querystatement.=$thecolumn["field"]." AS `".$thecolumn["name"]."`,";
			$querystatement .= $this->groupings[$groupby]["field"]." AS thegroup, count(invoices.id) as thecount ";
			$querystatement .= " FROM ".$this->selecttable.$this->whereclause.$where." GROUP BY ".$this->groupings[$groupby]["field"];
			$queryresult=$this->db->query($querystatement);

			while($therecord=$this->db->fetchArray($queryresult)){

				$showbottom=true;
				if($group or $this->showinvoices) {
					$showbottom=false;
					?>

<td colspan="<?php echo (count($this->selectcolumns)+1)?>" class="group" style="padding-left:<?php echo ($indent+2)?>px;"><?php echo $this->groupings[$groupby]["name"].": ".formatVariable($therecord["thegroup"],$this->groupings[$groupby]["format"]).""?>

					<?php
				}//endif

				if($group) {
					$whereadd = $where." AND (".$this->groupings[$groupby]["field"]."= \"".$therecord["thegroup"]."\"";
					if(!$therecord["thegroup"])
						$whereadd .= " OR ISNULL(".$this->groupings[$groupby]["field"].")";
					$whereadd .= ")";
					$this->showGroup($group,$whereadd,$indent+$this->padamount);
				} elseif($this->showinvoices) {
					if($therecord["thegroup"])
						$this->showInvoices($where." AND (".$this->groupings[$groupby]["field"]."= \"".$therecord["thegroup"]."\")",$indent+$this->padamount);
					else
						$this->showInvoices($where." AND (".$this->groupings[$groupby]["field"]."= \"".$therecord["thegroup"]."\" or isnull(".$this->groupings[$groupby]["field"].") )",$indent+$this->padamount);
				}//endif

				?>

					<td width="100%" style=" <?php
						echo "padding-left:".($indent+2)."px";
					?>" class="groupFooter">
						<?php echo $this->groupings[$groupby]["name"].": ".formatVariable($therecord["thegroup"],$this->groupings[$groupby]["format"])." ";?>

					<?php
						foreach($this->selectcolumns as $thecolumn){
							?><?php echo formatVariable($therecord[$thecolumn["name"]],$thecolumn["format"])?>	<?php
						}//end foreach
					?>

				<?php
			}//end while
		}//endif
	}//end function

	function showInvoices($where,$indent){

		$querystatement="SELECT ";
		foreach($this->selectcolumns as $thecolumn)
			$querystatement.=$thecolumn["field"]." AS `".$thecolumn["name"]."`,";
		$querystatement.=" invoices.id as theid, if(clients.lastname!=\"\",concat(clients.lastname,\", \",clients.firstname,if(clients.company!=\"\",concat(\" (\",clients.company,\")\"),\"\")),clients.company) as thename,
							invoices.orderdate,invoices.invoicedate";
		$querystatement.=" FROM ".$this->selecttable.$this->whereclause.$where." GROUP BY invoices.id";
		$queryresult=$this->db->query($querystatement);

		while($therecord=$this->db->fetchArray($queryresult)){

			?>

				<td width="100%" style="padding-left:<?php echo ($indent+2)?>px;" class="invoices">
				<?php
					echo $therecord["theid"].": ";
					if($therecord["invoicedate"])
						echo "(".formatFromSQLDate($therecord["invoicedate"]).") ";
					else
						echo "(".formatFromSQLDate($therecord["orderdate"]).") ";
					echo $therecord["thename"]?>

				<?php
					foreach($this->selectcolumns as $thecolumn){
						if($thecolumn["name"] !="count"){
							?><?php echo formatVariable($therecord[$thecolumn["name"]],$thecolumn["format"])?>	<?php
						} else echo " 	";
					}//end foreach
				?>

			<?php
			if($this->showlineitems) $this->showLineItems($therecord["theid"],$indent+$this->padamount);
		}//end while

	}//end function

	function showLineItems($invoiceid,$indent){

		$querystatement="SELECT products.partnumber,products.partname,quantity,lineitems.unitprice,quantity*lineitems.unitprice as extended
							FROM (lineitems left join products on lineitems.productid=products.id)
						WHERE lineitems.invoiceid=".$invoiceid;
		$queryresult=$this->db->query($querystatement);

		if($this->db->numRows($queryresult)){
			?>

<td class="invoices" style="padding-left:<?php echo ($indent+2)?>px;">

							product
							price
							qty.
							ext.

			<?php

			while($therecord=$this->db->fetchArray($queryresult)){
				?>

					<?php echo $therecord["partnumber"]?>  <?php echo $therecord["partname"]?>
					<?php echo numberToCurrency($therecord["unitprice"])?>
					<?php echo formatVariable($therecord["quantity"],"real")?>
					<?php echo numberToCurrency($therecord["extended"])?>

				<?php
			}// endwhile

			?>

			<?php
				for($i=1;$i < count($this->selectcolumns); $i++)
					echo " 	"
			?>

<?php
		}// endif

	}//end method

	function showReport(){

		if($_POST["reporttitle"])
			$pageTitle = $_POST["reporttitle"];
		else
			$pageTitle = "Invoice Totals";

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

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="<?php echo APP_PATH ?>common/stylesheet/<?php echo STYLESHEET ?>/pages/totalreports.css" rel="stylesheet" type="text/css" />
<title><?php echo $pageTitle?></title>

<?php echo $pageTitle?>

Source: <?php echo $_SESSION["printing"]["dataprint"]?>

Date: <?php echo dateToString(mktime())." ".timeToString(mktime())?>

		<?php $this->showReportTable();?>

<?php

	}// end method

	function showOptions($what){
		?><option value="0">----- Choose One -----</option>
		<?php
		$i=0;

		foreach($this->$what as $value){
			?><option value="<?php echo $i+1; ?>"><?php echo $value["name"];?></option>
			<?php
			$i++;
		}// endforeach

	}//end mothd

	function showSelectScreen(){

        global  $phpbms;

        $pageTitle="Invoice Total";
        $phpbms->showMenu = false;
        $phpbms->cssIncludes[] = "pages/totalreports.css";
        $phpbms->jsIncludes[] = "modules/bms/javascript/totalreports.js";

        include("header.php");

        ?>

Invoice Total Options

            <form id="GroupForm" action="<?php echo $_SERVER["PHP_SELF"]?>" method="post" name="GroupForm">

                <fieldset>

                    <legend>report</legend>

                        report title

                        <input type="text" name="reporttitle" id="reporttitle" size="45"/>

		</fieldset>

                <fieldset>

                    <legend>groupings</legend>
                    <input id="groupings" type="hidden" name="groupings"/>

                            <select id="Group1Field">
                                <?php $this->showOptions("groupings")?>
                            </select>
                            <button type="button" id="Group1Minus" class="graphicButtons buttonMinusDisabled">-</button>
                            <button type="button" id="Group1Plus" class="graphicButtons buttonPlus">+</button>

                </fieldset>

		<fieldset>

			<legend>columns</legend>
			<input id="columns" type="hidden" name="columns"/>

					<select id="Column1Field">
						<?php $this->showOptions("columns")?>
					</select>
					<button type="button" id="Column1Minus" class="graphicButtons buttonMinusDisabled">-</button>
					<button type="button" id="Column1Plus" class="graphicButtons buttonPlus">+</button>

		</fieldset>

		<fieldset>
			<legend>Options</legend>

			information shown

			<select name="showwhat" id="showwhat">
				<option selected="selected" value="totals">Totals Only</option>
				<option value="invoices">Invoices</option>
				<option value="lineitems">Invoices & Line Items</option>
			</select>

		</fieldset>

                    <button id="print" type="button" class="Buttons">Print</button>
                    <button id="cancel" type="button" class="Buttons">Cancel</button>

            </form>

        <?php

        include("footer.php");
    }//end method

}//endclass

// Processing ===================================================================================================================
if(!isset($dontProcess)){
	if(isset($_POST["columns"])){
		$myreport= new totalReport($db,$_POST);
		$myreport->showReport();
	} else {
		$myreport = new totalReport($db);
		$myreport->showSelectScreen();
	}
}?>


text:
package container_pool_test

import (
	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"

	"testing"
)

func TestContainerPool(t *testing.T) {
	RegisterFailHandler(Fail)
	RunSpecs(t, "Container Pool Suite")
}


text:
ZONE=us-central1-b
MASTER_SIZE=g1-small
MINION_SIZE=g1-small
NUM_MINIONS=2
# gcloud/gcutil will expand this to the latest supported image.
IMAGE=backports-debian-7-wheezy
NETWORK=default
INSTANCE_PREFIX="e2e-test-${USER}"
MASTER_NAME="${INSTANCE_PREFIX}-master"
MASTER_TAG="${INSTANCE_PREFIX}-master"
MINION_TAG="${INSTANCE_PREFIX}-minion"
MINION_NAMES=($(eval echo ${INSTANCE_PREFIX}-minion-{1..${NUM_MINIONS}}))
MINION_IP_RANGES=($(eval echo "10.245.{1..${NUM_MINIONS}}.0/24"))


text:
require '../lib/nikeplus'

def generate_rss(builder, rss_title, rss_link, items)
  builder.rss('version' => '0.91') {
    builder.channel {
      builder.title rss_title
      builder.link  rss_link

      items.reverse.each do |item|
        builder.item {
          builder.title "#{item.startTime}"
          builder.description "This run was #{item.miles} miles and lasted #{item.minutes}'#{item.seconds}\"."
        }
      end
    }
  }
end

# Authenticate to access your private Nike+ user info
me = NikePlus.new('my@email.com', 'secretpassword')
my_runs = me.runs
builder = Builder::XmlMarkup.new

puts generate_rss(builder, "My Recent Runs", "http://petrock.org/runs.rss", me.runs)


text:
layout: post
cover: false
title: HTTP Quick Reference - A Quick reminder about HTTP
date:  2017-04-20 12:30:00
tags: tutorials
subclass: 'post tag-tutorials'
categories: 'dk'
navigation: True
#logo: 'assets/images/utilities/home_icon.png'
cover: 'assets/images/http1.png'
---
In this tutorial we will cover the basics of an HTTP request and see how it works.

HTTP Transaction Model:

The HTTP protocol is transaction-driven. This means that each request will lead
to one and only one response. Traditionally, a TCP connection is established
from the client to the server, a request is sent by the client on the
connection, the server responds and the connection is closed. A new request
will involve a new connection :

  [CON1] [REQ1] ... [RESP1] [CLO1] [CON2] [REQ2] ... [RESP2] [CLO2] ...

In this mode, called the "HTTP close" mode, there are as many connection
establishments as there are HTTP transactions. Since the connection is closed
by the server after the response, the client does not need to know the content
length.

Due to the transactional nature of the protocol, it was possible to improve it
to avoid closing a connection between two subsequent transactions. In this mode
however, it is mandatory that the server indicates the content length for each
response so that the client does not wait indefinitely. For this, a special
header is used: "Content-length". This mode is called the "keep-alive" mode :

  [CON] [REQ1] ... [RESP1] [REQ2] ... [RESP2] [CLO] ...

Its advantages are a reduced latency between transactions, and less processing
power required on the server side. It is generally better than the close mode,
but not always because the clients often limit their concurrent connections to
a smaller value.

A last improvement in the communications is the pipelining mode. It still uses
keep-alive, but the client does not wait for the first response to send the
second request. This is useful for fetching large number of images composing a
page :

  [CON] [REQ1] [REQ2] ... [RESP1] [RESP2] [CLO] ...

This can obviously have a tremendous benefit on performance because the network
latency is eliminated between subsequent requests. Many HTTP agents do not
correctly support pipelining since there is no way to associate a response with
the corresponding request in HTTP. For this reason, it is mandatory for the
server to reply in the exact same order as the requests were received.

HTTP Request

First, let's consider this HTTP request :

    Line Number
    Contents

    1
    GET /serv/login.php?lang=en&profile=2 HTTP/1.1

    2
    Host: www.mydomain.com

    3
    User-agent: my small browser

    4
    Accept: image/jpeg, image/gif

    5
    Accept: image/png

The Request line

Line 1 is the "request line". It is always composed of 3 fields :

METHOD      : GET

URI         : /serv/login.php?lang=en&profile=2

Version tag : HTTP/1.1

All of them are delimited by what the standard calls LWS (linear white spaces),
which are commonly spaces, but can also be tabs or line feeds/carriage returns
followed by spaces/tabs. The method itself cannot contain any colon (':') and
is limited to alphabetic letters.

The URI itself can have several forms :

A "relative URI" : (/serv/login.php?lang=en&profile=2)
    It is a complete URL without the host part. This is generally what is received by servers, reverse proxies and transparent proxies.

An "absolute URI", also called a "URL" : (http://192.168.0.12:8080/serv/login.php?lang=en&profile=2)
    It is composed of a "scheme" (the protocol name followed by '://'), a host
    name or address, optionally a colon (':') followed by a port number, then
    a relative URI beginning at the first slash ('/') after the address part.
    This is generally what proxies receive, but a server supporting HTTP/1.1
    must accept this form too.

A "star" : ('*') This form is only accepted in association with the OPTIONS
    method and is not relayable. It is used to inquiry a next hop's capabilities.

An address:port combination : (192.168.0.12:80)
    This is used with the CONNECT method, which is used to establish TCP
    tunnels through HTTP proxies, generally for HTTPS, but sometimes for
    other protocols too.

In a relative URI, two sub-parts are identified. The part before the question
mark is called the "path". It is typically the relative path to static objects
on the server. The part after the question mark is called the "query string".
It is mostly used with GET requests sent to dynamic scripts and is very
specific to the language, framework or application in use.

The request headers

The headers start at the second line and are composed of a name at the
beginning of the line, immediately followed by a colon (':'). Traditionally,
an LWS is added after the colon but that's not required. Then come the values.
Multiple identical headers may be folded into one single line, delimiting the
values with commas, provided that their order is respected. This is commonly
encountered in the "Cookie:" field. A header may span over multiple lines if
the subsequent lines begin with an LWS. In the example in 1.2, lines 4 and 5
define a total of 3 values for the "Accept:" header.

Contrary to a common mis-conception, header names are not case-sensitive, and
their values are not either if they refer to other header names (such as the
"Connection:" header).

The end of the headers is indicated by the first empty line. People often say
that it's a double line feed, which is not exact, even if a double line feed
is one valid form of empty line.

HTTP response

An HTTP response looks very much like an HTTP request. Both are called HTTP
messages. Let's consider this HTTP response :

Line
Contents

1
HTTP/1.1 200 OK

2
Content-length: 350

3
Content-Type: text/html

As a special case, HTTP supports so called "Informational responses" as status
codes 1xx. These messages are special in that they don't convey any part of the
response, they're just used as sort of a signaling message to ask a client to
continue to post its request for instance.

In the case of a status 100 response
the requested information will be carried by the next non-100 response message
following the informational one. This implies that multiple responses may be
sent to a single request, and that this only works when keep-alive is enabled
(1xx messages are HTTP/1.1 only).

The Response line

Line 1 is the "response line". It is always composed of 3 fields :

Name
Value(can be different at times)

Version tag
HTTP/1.1

Status code
200

Reason
OK

The status code is always 3-digit. The first digit indicates a general status :

Code
Message

 1xx
 informational message to be skipped (eg: 100, 101)

 2xx
 OK, content is following   (eg: 200, 206)

 3xx
 OK, no content following   (eg: 302, 304)

 4xx
 error caused by the client (eg: 401, 403, 404)

 5xx
 error caused by the server (eg: 500, 502, 503)

You can also refer to RFC2616 for the detailed meaning of all such codes. The
"reason" field is just a hint, but is not parsed by clients. Anything can be
found there, but it's a common practice to respect the well-established
messages. It can be composed of one or multiple words, such as "OK", "Found",
or "Authentication Required".

Below is the table depicting the basic interpretation of HTTP status codes:

  Code
  When / reason

   200
   access to stats page, and when replying to monitoring requests

   301
   when performing a redirection, depending on the configured code

   302
   when performing a redirection, depending on the configured code

   303
   when performing a redirection, depending on the configured code

   307
   when performing a redirection, depending on the configured code

   308
   when performing a redirection, depending on the configured code

   400
   for an invalid or too large request

   401
   when an authentication is required to perform the action (when accessing the stats page)

   403
   when a request is forbidden by a "block" ACL or "reqdeny" filter

   408
   when the request timeout strikes before the request is complete

   500
   when haproxy encounters an unrecoverable internal error, such as a memory allocation failure, which should never happen

   502
   when the server returns an empty, invalid or incomplete response, or when an "rspdeny" filter blocks the response.

   503
   when no server was available to handle the request, or in response to monitoring requests which match the "monitor fail" condition

   504
   when the response timeout strikes before the server responds

The response headers

Response headers work exactly like request headers.