text:
import json
import requests
import argparse
import datetime
from string import Template

def get_repo_list(username="mengzhuo"):
    """
    Get the lastest 100 active repos of user
    """
    return requests.get("https://api.github.com/users/%s/repos" % username,
            params={"sort":"push", "type":"all", "per_page":100}).json()

def caculate_impact(repo=None):
    """
    Fork: 300 each
    Star: 100 each
    Watch: 50 each
    Size: 0.01 each
    Fork From others: 10
    """

    if repo.get("fork"):
        is_contributor = 10
    else:
        is_contributor = 0

    return sum([200  * repo.get("forks_count",0),
                100  * repo.get("stargazers_count", 0),
                50   * repo.get("watchers_count",0),
                0.01 * repo.get("size",0),
                is_contributor
                ])

def generate_data(repo_list=None):

    filter_list = ("name", "html_url", "language", "forks_count",
                   "stargazers_count", "watchers_count", "size")
    # keep the order
    result = []
    for repo in repo_list:
        data = {k:v for k,v in repo.items()
                if k in filter_list}
        data['impact'] = caculate_impact(repo)
        result.append(data)

    return result

def main():

    parser = argparse.ArgumentParser(version="Github Visual Profile 0.1-alpha")
    parser.add_argument("-u", action="store", dest="username", const="mengzhuo",
                        help="Your Github Account Name", nargs="?", default="mengzhuo")
    parser.add_argument("-o", action="store", dest="output", const="index.html",
                        help="Output file", nargs="?", default="index.html")
    parser.add_argument("-i", action="store", dest="input", const="default.tpl",
                        help="Input Template file i.e. include $data", nargs="?",
                        default="default.tpl")

    args = parser.parse_args()

    data = json.dumps(generate_data(get_repo_list(args.username)))

    if args.input.lower().startswith("http"):
        tpl = Template(requests.get(args.input).content)
    else:
        with open(args.input) as tpl_file:
            tpl = Template(tpl_file.read())

    with open(args.output, "wb") as of:
        of.write(tpl.safe_substitute(username=args.username.title(),
                                data=data,
                                generate_time=datetime.datetime.utcnow().isoformat()))

if __name__ == '__main__':
    main()


text: <img src="public/images/Ant-Logo.png" />

redpajama_set_name: RedPajamaGithub


text:
package com.swfarm.biz.chain.web;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.StringUtils;
import org.springframework.validation.BindException;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.SimpleFormController;
import org.springframework.web.servlet.view.RedirectView;

import com.swfarm.biz.chain.bo.Currency;
import com.swfarm.biz.chain.bo.EbayGrossProfitTester;
import com.swfarm.biz.chain.bo.EbayGrossProfitTesterItem;
import com.swfarm.biz.chain.dto.SearchShippingMethodsCriteria;
import com.swfarm.biz.chain.srv.ChainService;
import com.swfarm.biz.chain.srv.GrossProfitTesterHelper;
import com.swfarm.biz.oa.srv.SysConfigService;
import com.swfarm.biz.product.bo.ArticleItemListingInfo;
import com.swfarm.biz.product.bo.PackingMaterial;
import com.swfarm.biz.product.bo.SaleSuite;
import com.swfarm.biz.product.bo.SaleSuiteItem;
import com.swfarm.biz.product.bo.StockKeepingUnit;
import com.swfarm.biz.product.srv.ProductService;
import com.swfarm.pub.framework.Env;

public class TestEbayGrossProfitController extends SimpleFormController {

	private ChainService chainService;

	private SysConfigService sysConfigService;

	private ProductService productService;

	public void setChainService(ChainService chainService) {
		this.chainService = chainService;
	}

	public void setSysConfigService(SysConfigService sysConfigService) {
		this.sysConfigService = sysConfigService;
	}

	public void setProductService(ProductService productService) {
		this.productService = productService;
	}

	protected Object formBackingObject(HttpServletRequest request) throws Exception {
		EbayGrossProfitTester grossProfitTester = new EbayGrossProfitTester();
		Currency usdCurrency = this.chainService.findCurrencyByCode("usd");
		grossProfitTester.setUsdCurrencyRate(usdCurrency.getBuyingRate());
		String articleItemListingInfoIdStr = request.getParameter("articleItemListingInfoId");
		if (StringUtils.isNotEmpty(articleItemListingInfoIdStr)) {
			Long articleItemListingInfoId = new Long(articleItemListingInfoIdStr);
			ArticleItemListingInfo articleItemListingInfo = this.productService
					.findArticleItemListingInfo(articleItemListingInfoId);
			String skuArticleNumbers = articleItemListingInfo.getSkuArticleNumbers();
			String skuQuantities = articleItemListingInfo.getSkuQuantities();
			if (StringUtils.isNotEmpty(skuArticleNumbers) && StringUtils.isNotEmpty(skuQuantities)) {
				String[] skuArticleNumberArr = StringUtils.split(skuArticleNumbers, ",");
				String[] skuQuantityArr = StringUtils.split(skuQuantities, ",");
				if (skuArticleNumberArr.length == skuQuantityArr.length) {
					if (skuArticleNumberArr.length > 1 || (skuArticleNumberArr.length == 1 && skuQuantityArr.length == 1
							&& new Double(skuQuantityArr[0]) > 1)) {
						List skuArticleNumberList = new ArrayList();
						CollectionUtils.addAll(skuArticleNumberList, skuArticleNumberArr);
						List stockKeepingUnits = this.productService
								.findStockKeepingUnitsByArticleNumbers(skuArticleNumberList);
						for (int i = 0; i < skuArticleNumberArr.length; i++) {
							String skuArticleNumber = skuArticleNumberArr[i];
							Double skuQuantity = new Double(skuQuantityArr[i]);
							StockKeepingUnit stockKeepingUnit = this.getStockKeepingUnit(stockKeepingUnits,
									skuArticleNumber);
							EbayGrossProfitTesterItem ebayGrossProfitTesterItem = new EbayGrossProfitTesterItem();
							ebayGrossProfitTesterItem.setArticleNumber(skuArticleNumber);
							ebayGrossProfitTesterItem.setSkuLifeCyclePhase(stockKeepingUnit.getSkuLifeCyclePhase());
							ebayGrossProfitTesterItem.setSkuName(stockKeepingUnit.getName());
							ebayGrossProfitTesterItem.setQuantity(skuQuantity);
							ebayGrossProfitTesterItem
									.setAveragePurchasePrice(stockKeepingUnit.getAveragePurchasePrice());
							ebayGrossProfitTesterItem.setSkuImage(stockKeepingUnit.getProductImage());
							ebayGrossProfitTesterItem.setWeight(stockKeepingUnit.getWeight() * skuQuantity);
							grossProfitTester.getEbayGrossProfitTesterItems().add(ebayGrossProfitTesterItem);

						}
					} else if (skuArticleNumberArr.length == 1 && skuQuantityArr.length == 1
							&& new Double(skuQuantityArr[0]) == 1) {
						String skuArticleNumber = skuArticleNumberArr[0];
						Double skuQuantity = new Double(skuQuantityArr[0]);
						StockKeepingUnit stockKeepingUnit = this.productService
								.findStockKeepingUnitByArticleNumber(skuArticleNumber);
						EbayGrossProfitTesterItem ebayGrossProfitTesterItem = new EbayGrossProfitTesterItem();
						ebayGrossProfitTesterItem.setArticleNumber(skuArticleNumber);
						ebayGrossProfitTesterItem.setSkuLifeCyclePhase(stockKeepingUnit.getSkuLifeCyclePhase());
						ebayGrossProfitTesterItem.setSkuName(stockKeepingUnit.getName());
						ebayGrossProfitTesterItem.setQuantity(skuQuantity);
						ebayGrossProfitTesterItem.setAveragePurchasePrice(stockKeepingUnit.getAveragePurchasePrice());
						ebayGrossProfitTesterItem.setSkuImage(stockKeepingUnit.getProductImage());
						ebayGrossProfitTesterItem.setWeight(stockKeepingUnit.getWeight() * skuQuantity);
						grossProfitTester.getEbayGrossProfitTesterItems().add(ebayGrossProfitTesterItem);
						PackingMaterial packingMaterial = stockKeepingUnit.getPackingMaterial();
						if (packingMaterial != null) {
							grossProfitTester.setPackingMaterialArticleNumber(packingMaterial.getArticleNumber());
							grossProfitTester.setPackingPrice(packingMaterial.getPurchasePrice());
							grossProfitTester.setPackingWeight(packingMaterial.getWeight());
						}
					}
				}
			}
		}
		String saleSuiteIdStr = request.getParameter("saleSuiteId");
		if (StringUtils.isNotEmpty(saleSuiteIdStr)) {
			Long saleSuiteId = new Long(saleSuiteIdStr);
			SaleSuite saleSuite = this.productService.findSaleSuite(saleSuiteId);
			for (Iterator iter = saleSuite.getSaleSuiteItems().iterator(); iter.hasNext();) {
				SaleSuiteItem saleSuiteItem = (SaleSuiteItem) iter.next();
				StockKeepingUnit stockKeepingUnit = saleSuiteItem.getStockKeepingUnit();
				EbayGrossProfitTesterItem ebayGrossProfitTesterItem = new EbayGrossProfitTesterItem();
				ebayGrossProfitTesterItem.setArticleNumber(stockKeepingUnit.getArticleNumber());
				ebayGrossProfitTesterItem.setSkuLifeCyclePhase(stockKeepingUnit.getSkuLifeCyclePhase());
				ebayGrossProfitTesterItem.setSkuName(stockKeepingUnit.getName());
				ebayGrossProfitTesterItem.setQuantity(saleSuiteItem.getQuantity());
				ebayGrossProfitTesterItem.setAveragePurchasePrice(stockKeepingUnit.getAveragePurchasePrice());
				ebayGrossProfitTesterItem.setSkuImage(stockKeepingUnit.getProductImage());
				ebayGrossProfitTesterItem.setWeight(stockKeepingUnit.getWeight() * saleSuiteItem.getQuantity());
				grossProfitTester.getEbayGrossProfitTesterItems().add(ebayGrossProfitTesterItem);
			}
		}
		return grossProfitTester;
	}

	private StockKeepingUnit getStockKeepingUnit(List stockKeepingUnits, String skuArticleNumber) {
		for (Iterator iter = stockKeepingUnits.iterator(); iter.hasNext();) {
			StockKeepingUnit stockKeepingUnit = (StockKeepingUnit) iter.next();
			if (stockKeepingUnit.getArticleNumber().equalsIgnoreCase(skuArticleNumber)) {
				return stockKeepingUnit;
			}
		}
		return this.productService.findStockKeepingUnitByArticleNumber(skuArticleNumber);
	}

	protected Map referenceData(HttpServletRequest request) throws Exception {
		Map dataMap = new HashMap();
		List currencies = this.chainService.findLatestCurrencies();
		dataMap.put("currencies", currencies);
		List shippingCountries = this.sysConfigService.findCountries();
		dataMap.put("shippingCountries", shippingCountries);
		List packingMaterials = this.productService.findPackingMaterials();
		dataMap.put("packingMaterials", packingMaterials);
		GrossProfitTesterHelper helper = new GrossProfitTesterHelper();
		List saleChannels = helper.getSaleChannels();
		Collections.sort(saleChannels, new Comparator() {
			public int compare(Object o1, Object o2) {
				String saleChannel1 = (String) o1;
				String saleChannel2 = (String) o2;
				if ("速卖通".equalsIgnoreCase(saleChannel1)) {
					return -1;
				} else if ("速卖通".equalsIgnoreCase(saleChannel2)) {
					return 1;
				} else if ("WISH".equalsIgnoreCase(saleChannel1)) {
					return -1;
				} else if ("WISH".equalsIgnoreCase(saleChannel1)) {
					return 1;
				} else {
					return saleChannel1.compareTo(saleChannel2);
				}
			}
		});
		dataMap.put("saleChannels", saleChannels);
		List paymentCommissionFormulas = this.chainService.findPaymentCommissionFormulas();
		dataMap.put("paymentCommissionFormulas", paymentCommissionFormulas);
		dataMap.put("companyCode", Env.COMPANY_CODE);
		return dataMap;
	}

	protected void onBindAndValidate(HttpServletRequest request, Object command, BindException errors)
			throws Exception {
		EbayGrossProfitTester grossProfitTester = (EbayGrossProfitTester) command;
	}

	protected ModelAndView onSubmit(HttpServletRequest request, HttpServletResponse response, Object command,
			BindException errors) throws Exception {
		EbayGrossProfitTester grossProfitTester = (EbayGrossProfitTester) command;
		Double grossProfit = grossProfitTester.calculateGrossProfit();
		Map dataMap = new HashMap();
		dataMap.put("grossProfit", grossProfit);
		return new ModelAndView(new RedirectView(getSuccessView(), true), dataMap);
	}
}


text:
<?php
	include 'includes/config.php';

	 // Identificador de la barra lateral
	$res = mysql_query("SELECT contenido FROM barra_lateral where id = 1");
	if (!$res) die('Consulta inválida ' . mysql_error());
	$barra = mysql_fetch_array($res,MYSQL_BOTH);

        $unno = mysql_query("SELECT contenido FROM barra_lateral where id = 2");
	$uno = mysql_fetch_array($unno);

 $ddos = mysql_query("SELECT contenido FROM barra_lateral where id = 3");
	$dos = mysql_fetch_array($ddos);

	  $ttres = mysql_query("SELECT contenido FROM barra_lateral where id = 4");
	$tres = mysql_fetch_array($ttres);

 $ccuatro = mysql_query("SELECT contenido FROM barra_lateral where id = 5");
	$cuatro = mysql_fetch_array($ccuatro);

 $ccinco = mysql_query("SELECT contenido FROM barra_lateral where id = 6");
	$cinco = mysql_fetch_array($ccinco);

 $sseis = mysql_query("SELECT contenido FROM barra_lateral where id = 7");
	$seis = mysql_fetch_array($sseis);

 $ssiete = mysql_query("SELECT contenido FROM barra_lateral where id = 8");
	$siete = mysql_fetch_array($ssiete);

?>


text:
<?xml version="1.0" encoding="UTF-8"?>
<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/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>org.gridkit.lab</groupId>
        <artifactId>grid-lab-pom</artifactId>
        <version>2</version>
    </parent>

    <artifactId>gridbeans</artifactId>
    <version>0.1-SNAPSHOT</version>
    <name>${project.groupId}::${project.artifactId}</name>

    <licenses>
      <license>
        <name>The Apache Software License, Version 2.0</name>
        <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
        <distribution>repo</distribution>
      </license>
    </licenses>

    <developers>
      <developer>
        <id>alexey.ragozin</id>
        <name>Alexey Ragozin</name>
        <email>alexey.ragozin@gmail.com</email>
      </developer>
    </developers>

    <properties>
        <javaVersion>1.6</javaVersion>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.gridkit.lab</groupId>
            <artifactId>nanocloud</artifactId>
            <version>0.8.3-SNAPSHOT</version>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.10</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <version>2.4</version>
                <configuration>
                    <preparationGoals>pre-clean</preparationGoals>
                    <autoVersionSubmodules>true</autoVersionSubmodules>
                    <pushChanges>true</pushChanges>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.0</version>
                <configuration>
                    <source>${javaVersion}</source>
                    <target>${javaVersion}</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.14</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>2.9</version>
                <executions>
                    <execution>
                        <id>attach-javadoc</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>2.2.1</version>
                <executions>
                    <execution>
                        <id>attach-source</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-resources-plugin</artifactId>
                <version>2.6</version>
                <configuration>
                    <encoding>UTF-8</encoding>
                </configuration>
            </plugin>
        </plugins>
    </build>

</project>


text:
distributed create table nation as virtual
select
  cast(c1 as int) as n_nationkey,
  cast(c2 as text) as n_name,
  cast(c3 as int) as n_regionkey,
  cast(c4 as text) as n_comment
from (file '/home/vaggelis/tpch-kit/tpch/datasets/nation.tbl' delimiter:|);


text:
<?php

namespace Seahinet\Article\ViewModel\Product;

class Related extends Link
{

    public function getProducts()
    {
        $products = $this->getVariable('product')->getLinkedProducts('r');
        if ($this->getLimit() && is_object($products)) {
            $products->where(['status' => 1])->limit($this->getLimit());
        }
        return $products;
    }

}


text:
package features

import (
	"fmt"
	"strconv"
	"sync"
	"time"

	"github.com/onsi/ginkgo"

	"github.com/fatedier/frp/test/e2e/framework"
	"github.com/fatedier/frp/test/e2e/framework/consts"
	"github.com/fatedier/frp/test/e2e/mock/server/httpserver"
	"github.com/fatedier/frp/test/e2e/mock/server/streamserver"
	"github.com/fatedier/frp/test/e2e/pkg/request"
)

var _ = ginkgo.Describe("[Feature: Group]", func() {
	f := framework.NewDefaultFramework()

	newHTTPServer := func(port int, respContent string) *httpserver.Server {
		return httpserver.New(
			httpserver.WithBindPort(port),
			httpserver.WithHandler(framework.SpecifiedHTTPBodyHandler([]byte(respContent))),
		)
	}

	validateFooBarResponse := func(resp *request.Response) bool {
		if string(resp.Content) == "foo" || string(resp.Content) == "bar" {
			return true
		}
		return false
	}

	doFooBarHTTPRequest := func(vhostPort int, host string) []string {
		results := []string{}
		var wait sync.WaitGroup
		var mu sync.Mutex
		expectFn := func() {
			framework.NewRequestExpect(f).Port(vhostPort).
				RequestModify(func(r *request.Request) {
					r.HTTP().HTTPHost(host)
				}).
				Ensure(validateFooBarResponse, func(resp *request.Response) bool {
					mu.Lock()
					defer mu.Unlock()
					results = append(results, string(resp.Content))
					return true
				})
		}
		for i := 0; i < 10; i++ {
			wait.Add(1)
			go func() {
				defer wait.Done()
				expectFn()
			}()
		}

		wait.Wait()
		return results
	}

	ginkgo.Describe("Load Balancing", func() {
		ginkgo.It("TCP", func() {
			serverConf := consts.DefaultServerConfig
			clientConf := consts.DefaultClientConfig

			fooPort := f.AllocPort()
			fooServer := streamserver.New(streamserver.TCP, streamserver.WithBindPort(fooPort), streamserver.WithRespContent([]byte("foo")))
			f.RunServer("", fooServer)

			barPort := f.AllocPort()
			barServer := streamserver.New(streamserver.TCP, streamserver.WithBindPort(barPort), streamserver.WithRespContent([]byte("bar")))
			f.RunServer("", barServer)

			remotePort := f.AllocPort()
			clientConf += fmt.Sprintf(`
			[foo]
			type = tcp
			local_port = %d
			remote_port = %d
			group = test
			group_key = 123

			[bar]
			type = tcp
			local_port = %d
			remote_port = %d
			group = test
			group_key = 123
			`, fooPort, remotePort, barPort, remotePort)

			f.RunProcesses([]string{serverConf}, []string{clientConf})

			fooCount := 0
			barCount := 0
			for i := 0; i < 10; i++ {
				framework.NewRequestExpect(f).Explain("times " + strconv.Itoa(i)).Port(remotePort).Ensure(func(resp *request.Response) bool {
					switch string(resp.Content) {
					case "foo":
						fooCount++
					case "bar":
						barCount++
					default:
						return false
					}
					return true
				})
			}

			framework.ExpectTrue(fooCount > 1 && barCount > 1, "fooCount: %d, barCount: %d", fooCount, barCount)
		})
	})

	ginkgo.Describe("Health Check", func() {
		ginkgo.It("TCP", func() {
			serverConf := consts.DefaultServerConfig
			clientConf := consts.DefaultClientConfig

			fooPort := f.AllocPort()
			fooServer := streamserver.New(streamserver.TCP, streamserver.WithBindPort(fooPort), streamserver.WithRespContent([]byte("foo")))
			f.RunServer("", fooServer)

			barPort := f.AllocPort()
			barServer := streamserver.New(streamserver.TCP, streamserver.WithBindPort(barPort), streamserver.WithRespContent([]byte("bar")))
			f.RunServer("", barServer)

			remotePort := f.AllocPort()
			clientConf += fmt.Sprintf(`
			[foo]
			type = tcp
			local_port = %d
			remote_port = %d
			group = test
			group_key = 123
			health_check_type = tcp
			health_check_interval_s = 1

			[bar]
			type = tcp
			local_port = %d
			remote_port = %d
			group = test
			group_key = 123
			health_check_type = tcp
			health_check_interval_s = 1
			`, fooPort, remotePort, barPort, remotePort)

			f.RunProcesses([]string{serverConf}, []string{clientConf})

			// check foo and bar is ok
			results := []string{}
			for i := 0; i < 10; i++ {
				framework.NewRequestExpect(f).Port(remotePort).Ensure(validateFooBarResponse, func(resp *request.Response) bool {
					results = append(results, string(resp.Content))
					return true
				})
			}
			framework.ExpectContainElements(results, []string{"foo", "bar"})

			// close bar server, check foo is ok
			barServer.Close()
			time.Sleep(2 * time.Second)
			for i := 0; i < 10; i++ {
				framework.NewRequestExpect(f).Port(remotePort).ExpectResp([]byte("foo")).Ensure()
			}

			// resume bar server, check foo and bar is ok
			f.RunServer("", barServer)
			time.Sleep(2 * time.Second)
			results = []string{}
			for i := 0; i < 10; i++ {
				framework.NewRequestExpect(f).Port(remotePort).Ensure(validateFooBarResponse, func(resp *request.Response) bool {
					results = append(results, string(resp.Content))
					return true
				})
			}
			framework.ExpectContainElements(results, []string{"foo", "bar"})
		})

		ginkgo.It("HTTP", func() {
			vhostPort := f.AllocPort()
			serverConf := consts.DefaultServerConfig + fmt.Sprintf(`
			vhost_http_port = %d
			`, vhostPort)
			clientConf := consts.DefaultClientConfig

			fooPort := f.AllocPort()
			fooServer := newHTTPServer(fooPort, "foo")
			f.RunServer("", fooServer)

			barPort := f.AllocPort()
			barServer := newHTTPServer(barPort, "bar")
			f.RunServer("", barServer)

			clientConf += fmt.Sprintf(`
			[foo]
			type = http
			local_port = %d
			custom_domains = example.com
			group = test
			group_key = 123
			health_check_type = http
			health_check_interval_s = 1
			health_check_url = /healthz

			[bar]
			type = http
			local_port = %d
			custom_domains = example.com
			group = test
			group_key = 123
			health_check_type = http
			health_check_interval_s = 1
			health_check_url = /healthz
			`, fooPort, barPort)

			f.RunProcesses([]string{serverConf}, []string{clientConf})

			// send first HTTP request
			var contents []string
			framework.NewRequestExpect(f).Port(vhostPort).
				RequestModify(func(r *request.Request) {
					r.HTTP().HTTPHost("example.com")
				}).
				Ensure(func(resp *request.Response) bool {
					contents = append(contents, string(resp.Content))
					return true
				})

			// send second HTTP request, should be forwarded to another service
			framework.NewRequestExpect(f).Port(vhostPort).
				RequestModify(func(r *request.Request) {
					r.HTTP().HTTPHost("example.com")
				}).
				Ensure(func(resp *request.Response) bool {
					contents = append(contents, string(resp.Content))
					return true
				})

			framework.ExpectContainElements(contents, []string{"foo", "bar"})

			// check foo and bar is ok
			results := doFooBarHTTPRequest(vhostPort, "example.com")
			framework.ExpectContainElements(results, []string{"foo", "bar"})

			// close bar server, check foo is ok
			barServer.Close()
			time.Sleep(2 * time.Second)
			results = doFooBarHTTPRequest(vhostPort, "example.com")
			framework.ExpectContainElements(results, []string{"foo"})
			framework.ExpectNotContainElements(results, []string{"bar"})

			// resume bar server, check foo and bar is ok
			f.RunServer("", barServer)
			time.Sleep(2 * time.Second)
			results = doFooBarHTTPRequest(vhostPort, "example.com")
			framework.ExpectContainElements(results, []string{"foo", "bar"})
		})
	})
})


text:
<!DOCTYPE html>

    <title>coLaboratory</title>

    <link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css?family=Open+Sans:300,600"/>

    <link rel="shortcut icon" href="/colab/img/colab-black.png" />

    <link rel="stylesheet" href="/ipython/components/codemirror/lib/codemirror.css"/>
    <link rel="stylesheet" href="/ipython/components/codemirror/addon/hint/show-hint.css"/>

    <link rel="stylesheet" href="/extern/polymer/paper-shadow/paper-shadow.css">
    <link rel="stylesheet" href="/closure/css/common.css">
    <link rel="stylesheet" href="/closure/css/menu.css">
    <link rel="stylesheet" href="/closure/css/menubar.css">
    <link rel="stylesheet" href="/closure/css/menubutton.css">
    <link rel="stylesheet" href="/closure/css/menuitem.css">
    <link rel="stylesheet" href="/closure/css/menuseparator.css">
    <link rel="stylesheet" href="/closure/css/toolbar.css">
    <link rel="stylesheet" href="/closure/css/combobox.css">
    <link rel="stylesheet" href="/closure/css/dialog.css">
    <link rel="stylesheet" href="/closure/css/tab.css">
    <link rel="stylesheet" href="/closure/css/tabbar.css">
    <link rel="stylesheet" href="/colab/css/main.css"/>
    <link rel="stylesheet" href="/colab/css/cell.css"/>
    <link rel="stylesheet" href="/colab/css/celltoolbar.css"/>
    <link rel="stylesheet" href="/colab/css/ansi.css"/>
    <link rel="stylesheet" href="/colab/css/header.css"/>
    <link rel="stylesheet" href="/colab/css/form.css"/>
    <link rel="stylesheet" href="/colab/css/comments.css"/>
    <link rel="stylesheet" href="/colab/css/ipython.css"/>

            <input id="doc-name" disabled>

                File

Open...

New Notebook

Open Local Directory

Share...

Save and Checkpoint

View in Drive...

Clone

Download Ipynb

                Edit

Undo

Redo

Clear Outputs

                Run

Run All

Run Before

Run After

                Python

Connect...

Interrupt

Restart

                Feedback

Report Bug

                Help

Keyboard Shortcuts...

          <button id="comments" style="display: none;"
                  class="realtime-button comments-button">Comments</button>
          <button id="share" style="display: none;"
                  class="realtime-button">Share</button>

Add Text

Add Code

Cell Up

Cell Down

Connect to Python


text:
var gameName = "Game Name";

// Put in this array the name of your mini-game
// (the same name you used for the folder of your mini-game)
var gamesId = [ "HelloWorld", "ArnoldNFly"];

// number of levels in the global game
var maxLevels = 3;

// number of lifes in the global game
var startLifes = 5;

// activate server synchronization (mainly for leaderboard sharing)
var serverSync = false;


text:
@interface LZNewsTableViewController : LZViewController

@end


text:
package com.easyjf.core.i18n;

public interface LocaleSupport {

}


text:
.class public abstract Landroid/filterfw/core/Scheduler;
.super Ljava/lang/Object;
.source "Scheduler.java"

# instance fields
.field private mGraph:Landroid/filterfw/core/FilterGraph;

# direct methods
.method constructor <init>(Landroid/filterfw/core/FilterGraph;)V
    .locals 0
    .parameter "graph"

    .prologue
    .line 31
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 32
    iput-object p1, p0, Landroid/filterfw/core/Scheduler;->mGraph:Landroid/filterfw/core/FilterGraph;

    .line 33
    return-void
.end method

# virtual methods
.method finished()Z
    .locals 1

    .prologue
    .line 45
    const/4 v0, 0x1

    return v0
.end method

.method getGraph()Landroid/filterfw/core/FilterGraph;
    .locals 1

    .prologue
    .line 36
    iget-object v0, p0, Landroid/filterfw/core/Scheduler;->mGraph:Landroid/filterfw/core/FilterGraph;

    return-object v0
.end method

.method abstract reset()V
.end method

.method abstract scheduleNextNode()Landroid/filterfw/core/Filter;
.end method


text:
package org.duracloud.stitch;

import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.List;

import org.apache.commons.io.FileUtils;
import org.duracloud.chunk.manifest.ChunksManifest;
import org.duracloud.chunk.manifest.xml.ManifestDocumentBinding;
import org.duracloud.domain.Content;
import org.duracloud.stitch.datasource.DataSource;
import org.easymock.EasyMock;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;

/**
 * @author Andrew Woods
 * Date: 9/5/11
 */
public class FileStitcherDriverTest {

    private FileStitcherDriver driver;

    private DataSource dataSource;
    private List<InputStream> streams = new ArrayList<InputStream>();

    private File toDir;
    private static final String chunkIdPrefix = "chunk-id";
    private static final String spaceId = "space-id";
    private static final String contentId = "content-id";
    private static final String manifestId =
        contentId + ChunksManifest.manifestSuffix;

    @Before
    public void setUp() throws Exception {
        File targetDir = new File("target");
        Assert.assertTrue("target/ must exist: " + targetDir.getAbsolutePath(),
                          targetDir.exists());
        toDir = new File(targetDir, "test-stitcher-driver");
        FileUtils.deleteDirectory(toDir);

        dataSource = EasyMock.createMock("DataSource", DataSource.class);
        driver = new FileStitcherDriver(dataSource);
    }

    @After
    public void tearDown() throws Exception {
        EasyMock.verify(dataSource);

        for (InputStream stream : streams) {
            stream.close();
        }
    }

    private void replayMocks() {
        EasyMock.replay(dataSource);
    }

    @Test
    public void testStitch() throws Exception {
        createStitchMocks();
        replayMocks();
        driver.stitch(spaceId, manifestId, toDir);

        File result = new File(toDir, contentId);
        Assert.assertTrue("stitched file must exist", result.exists());
        Assert.assertTrue("stitched file must have size", result.length() > 0);
    }

    private void createStitchMocks() {
        // build manifest
        String sourceContentId = contentId;
        String sourceMimetype = "text/plain";
        long sourceByteSize = 99;
        ChunksManifest manifest = new ChunksManifest(sourceContentId,
                                                     sourceMimetype,
                                                     sourceByteSize);
        // build chunks
        String md5 = "md5";
        String index;
        String chunkId;
        String chunkText;
        final int numChunks = 5;
        for (int i = 0; i < numChunks; ++i) {
            // create chunk entry.
            index = getStringIndex(i);
            chunkId = chunkIdPrefix + ChunksManifest.chunkSuffix + index;
            chunkText = getChunkContent(i);
            manifest.addEntry(chunkId, md5, chunkText.length());

            // create chunk expectation.
            Content chunk = new Content();
            chunk.setId(chunkId);
            chunk.setStream(getStream(chunkText));
            EasyMock.expect(dataSource.getContent(spaceId, chunkId)).andReturn(
                chunk);
        }

        String xml = ManifestDocumentBinding.createDocumentFrom(manifest);

        Content content = new Content();
        content.setId(manifestId);
        content.setStream(getStream(xml));
        EasyMock.expect(dataSource.getContent(spaceId, manifestId)).andReturn(
            content);
    }

    private String getStringIndex(int i) {
        return String.format("%1$04d", i);
    }

    private String getChunkContent(int index) {
        String chunkTextIntro = "hello-";
        return chunkTextIntro + index;
    }

    private InputStream getStream(String xml) {
        InputStream stream = new ByteArrayInputStream(xml.getBytes());
        streams.add(stream);
        return stream;
    }
}


text:
namespace Reactive.ActorModel.Messages
{
    public class RequestStatusUpdate
    {
    }
}


text:
module Umakadata

  module HTTPHeader

    USER_AGENT = 'Umaka-Crawler/1.0 by DBCLS (umakadata@dbcls.jp)'.freeze

  end

end


text:
NS_ENUM_AVAILABLE(10_11, 9_0)
typedef NS_ENUM(NSUInteger, XCUIElementType) {
    XCUIElementTypeAny = 0,
    XCUIElementTypeOther = 1,
    XCUIElementTypeApplication = 2,
    XCUIElementTypeGroup = 3,
    XCUIElementTypeWindow = 4,
    XCUIElementTypeSheet = 5,
    XCUIElementTypeDrawer = 6,
    XCUIElementTypeAlert = 7,
    XCUIElementTypeDialog = 8,
    XCUIElementTypeButton = 9,
    XCUIElementTypeRadioButton = 10,
    XCUIElementTypeRadioGroup = 11,
    XCUIElementTypeCheckBox = 12,
    XCUIElementTypeDisclosureTriangle = 13,
    XCUIElementTypePopUpButton = 14,
    XCUIElementTypeComboBox = 15,
    XCUIElementTypeMenuButton = 16,
    XCUIElementTypeToolbarButton = 17,
    XCUIElementTypePopover = 18,
    XCUIElementTypeKeyboard = 19,
    XCUIElementTypeKey = 20,
    XCUIElementTypeNavigationBar = 21,
    XCUIElementTypeTabBar = 22,
    XCUIElementTypeTabGroup = 23,
    XCUIElementTypeToolbar = 24,
    XCUIElementTypeStatusBar = 25,
    XCUIElementTypeTable = 26,
    XCUIElementTypeTableRow = 27,
    XCUIElementTypeTableColumn = 28,
    XCUIElementTypeOutline = 29,
    XCUIElementTypeOutlineRow = 30,
    XCUIElementTypeBrowser = 31,
    XCUIElementTypeCollectionView = 32,
    XCUIElementTypeSlider = 33,
    XCUIElementTypePageIndicator = 34,
    XCUIElementTypeProgressIndicator = 35,
    XCUIElementTypeActivityIndicator = 36,
    XCUIElementTypeSegmentedControl = 37,
    XCUIElementTypePicker = 38,
    XCUIElementTypePickerWheel = 39,
    XCUIElementTypeSwitch = 40,
    XCUIElementTypeToggle = 41,
    XCUIElementTypeLink = 42,
    XCUIElementTypeImage = 43,
    XCUIElementTypeIcon = 44,
    XCUIElementTypeSearchField = 45,
    XCUIElementTypeScrollView = 46,
    XCUIElementTypeScrollBar = 47,
    XCUIElementTypeStaticText = 48,
    XCUIElementTypeTextField = 49,
    XCUIElementTypeSecureTextField = 50,
    XCUIElementTypeDatePicker = 51,
    XCUIElementTypeTextView = 52,
    XCUIElementTypeMenu = 53,
    XCUIElementTypeMenuItem = 54,
    XCUIElementTypeMenuBar = 55,
    XCUIElementTypeMenuBarItem = 56,
    XCUIElementTypeMap = 57,
    XCUIElementTypeWebView = 58,
    XCUIElementTypeIncrementArrow = 59,
    XCUIElementTypeDecrementArrow = 60,
    XCUIElementTypeTimeline = 61,
    XCUIElementTypeRatingIndicator = 62,
    XCUIElementTypeValueIndicator = 63,
    XCUIElementTypeSplitGroup = 64,
    XCUIElementTypeSplitter = 65,
    XCUIElementTypeRelevanceIndicator = 66,
    XCUIElementTypeColorWell = 67,
    XCUIElementTypeHelpTag = 68,
    XCUIElementTypeMatte = 69,
    XCUIElementTypeDockItem = 70,
    XCUIElementTypeRuler = 71,
    XCUIElementTypeRulerMarker = 72,
    XCUIElementTypeGrid = 73,
    XCUIElementTypeLevelIndicator = 74,
    XCUIElementTypeCell = 75,
    XCUIElementTypeLayoutArea = 76,
    XCUIElementTypeLayoutItem = 77,
    XCUIElementTypeHandle = 78,
    XCUIElementTypeStepper = 79,
    XCUIElementTypeTab = 80,
    XCUIElementTypeTouchBar = 81
};

#endif


text:
import os
import pathlib
import pandas as pd

def folder_stamped(*args):
    # create a time stamped folder
    date = pd.Timestamp("today")
    folder = os.path.join(os.path.join(*args), "{t}".format(t=date.strftime("%Y%m%d")))
    pathlib.Path(folder).mkdir(parents=True, exist_ok=True)
    return folder


text:
@interface XMGVoiceViewController : XMGTopicViewController

@end


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

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

    <title>Call to Action (CTA) Tracking — CampaignChain 1.0.0-alpha.3 documentation</title>

    <link rel="stylesheet" href="../../_static/default.css" type="text/css" />
    <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />

    <link rel="top" title="CampaignChain 1.0.0-alpha.3 documentation" href="../../index.html" />
    <link rel="up" title="The Developer Book" href="index.html" />
    <link rel="next" title="The Developer Cookbook" href="../cookbook/index.html" />
    <link rel="prev" title="Activity and Operation Modules" href="activities_operations.html" />

Navigation

          index

          next |

          previous |

CampaignChain 1.0.0-alpha.3 documentation »

The Developer Book »

Call to Action (CTA) Tracking¶

This section describes the inner workings of CampaignChain’s Call to Action Tracking.
The provided information is useful for anyone developing Operation modules with
CampaignChain or for those configuring third-party channels to work with
CampaignChain.

What is a CTA?¶

In web design, a CTA is a banner, button, or some type of graphic or text
on a website meant to prompt a user to click it and continue down a
conversion funnel. It is an essential part of inbound marketing as well
as permission marketing in that it actively strives to convert a user
into a lead and later into a customer.

—Wikipedia

In CampaignChain, a CTA is essentially a URL that appears in a HTML href link or
form action. It appears within an Operation and each Operation can contain 0 to
many CTAs. For example, a tweet could include various links that CampaignChain treats
as CTAs, while a Google Ad would contain only 1 link as the CTA.

Tracking ID¶

CampaignChain leverages two types of IDs for its CTA tracking:

CTA Tracking ID: Each CTA has a unique ID assigned by CampaignChain per URL that
is included in an Operation. If you read about just the Tracking ID in the
documentation, then it’s referring to the CTA Tracking ID.

Channel Tracking ID: For each Channel that has been connected with CampaignChain,
a unique ID will be generated. This ID must be provided in the tracking code
that is being included in a Channel. When the tracking code is activated,
CampaignChain checks whether the provided Channel Tracking ID exists and whether the
tracking code has been executed from a URL that actually resides within the
Channel.

Tracking Process¶

To make CTA tracking work, a Channel that is connected with CampaignChain provides
the relevant information to CampaignChain for tracking the CTA path
that is part of a conversion funnel.

High-level View¶

From a 30,000-feet perspective, this is how the tracking process works:

A link or form inside an Operation acts as the initial CTA at the beginning
of a marketing funnel. The initial CTA contains a unique Tracking
ID which allows CampaignChain to trace back the link to the respective Actions
and Media (Campaign, Activity, Operation, Location, etc.). For example,
a Twitter post that links to a landing page within a website.

All subsequent Locations inside a connected Channel ping CampaignChain and let it
know through the Tracking ID that the respective Location was referred by a
CTA.

The communication between CampaignChain and a Channel is achieved through JavaScript
included in the Channel that posts the CTA information to CampaignChain and
optionally also through REST-based communication between CampaignChain and the
Channel. Depending on the depth of integration between CampaignChain and a Channel,
there are 3 different types of tracking (described in subsequent sections).

In-depth Flow Description¶

The single steps of the CTA tracking process are as follows:

1. The Operation’s content gets parsed for links right before execution.

2. If the Operation contains 1 or more links, the following happens:

2.1. A unique Tracking ID gets assigned to each URL, no matter if an
Operation contains the same URLs multiple times.

Note

An Operation could well contain the same URL multiple times, For example,
a banner image on a landing page could point to the same URL in its key
visual as well as a button that is part of the banner. When analyzing the
effectiveness of the banner image, you want to know whether the key visual
or the button caused more clicks. That’s why each of them gets treated as a
unique CTA with its own Tracking ID, although they have the same URL.

2.2. The Tracking ID gets appended to the URLs found inside the Operation.

2.2.1. If it is a full URL, then append the Tracking ID and
replace the original URL with a shortened URL (CampaignChain uses Bit.ly by default).

2.2.2. If the URL is already shortened, expand it, append the
Tracking ID and replace the original shortened URL with a new shortened
URL.

2.3. For each link, an entry is made in the CTA table with the Tracking
ID and the related Operation as well as the original URL (full and short, if
the latter was provided).

3. CampaignChain executes the Operation that now contains the new short URLs with
the Tracking ID, e.g. it publishes a status update on Twitter that contains a
link to a landing page.

4. When someone activates a CTA, e.g. clicks a link in a Tweet published by
CampaignChain, the URL points to a Location. If that Location is part of a Channel
that includes the tracking code and is connected with CampaignChain, then the
following happens:

4.1. The tracking code checks whether the URL that pointed to the current page
includes the Tracking ID. If yes, then it proceeds. If not, then it exits.

4.2. If the Tracking ID exists, the Tracking code sends this information to
CampaignChain: Channel Tracking ID, CTA Tracking ID, URL of current Location, URL of
target Location and additional information useful for monitoring.

4.3. CampaignChain checks whether the Channel Tracking ID is valid, i.e. if the
Channel sending the tracking data is actually connected with CampaignChain.

4.3.1. If yes, then it performs some validity checks on the data, most notably
whether the Tracking ID exists within CampaignChain, and finally saves the tracking
data for monitoring purposes.

4.3.2. If no, then it will not save the data and instead notify the admin of
an error (most likely, the Tracking Code has been included in a Channel that
has not been connected with CampaignChain yet or this is a Denial of Service
attack).

4.4. While CampaignChain processes the tracking data, the tracking code in the
Channel appends the Tracking ID to the target URL (if another one does not exist
yet, because the target URL is part of a new Operation) or saves it in a cookie.
It then redirects the visitor to the target Location.

Note

Passing on the Tracking ID enables CampaignChain to do two things:

Understand, whether e.g. the visitor browses a website away from a landing
page before coming back to it and activating a CTA that leads to another
Operation.

Track the effectiveness of Operations across Channels.

Types of Tracking¶

To track CTAs, different types of tracking are used with CampaignChain to
monitor the inbound marketing funnel.

CampaignChain-to-Channel (unidirectional)¶

Integration level: Useful if CTA is under control, but not the Channel.

Example: We can add a Tracking ID to a link that will be published on
Twitter, but we cannot install something on Twitter to establish a
connection between Twitter and CampaignChain to exchange information.

Tracking ID: The Tracking ID must be included in the CTA. It is
important, because it helps to distinguish between Campaigns and Activities
if e.g. the same Landing Page is being used as a CTA target within the same
Campaign various times or in different campaigns.

Pros: Simple to implement by adding the Tracking ID to the URL of the
CTA.

Cons: Ideally, CampaignChain would be in control of the Operation (e.g. posting
to Twitter from within CampaignChain). If not possible, then a user would have to
manually append the Tracking ID.

Channel-to-CampaignChain (unidirectional)¶

Integration level: The channel sends information about the Operation,
Location and CTA to CampaignChain.

Example: A JavaScript snippet included in Wordpress sends information to
CampaignChain about a link’s URL that was clicked inside a blog post, as well as
the URL of the blog entry, etc.

Tracking ID: At least the Tracking ID of the initial CTA should be
available. Then CampaignChain is able to match the CTA’s URL provided by the
Channel with the Campaign and Activity it belongs to. Information about the
source and target Location is also provided by the Channel for CampaignChain to
easily map the related URLs to the Locations inside CampaignChain.

Pros: This approach has the security advantage that the third-party application
is in control of the communication towards CampaignChain.

Cons: There must be a mechanism inside the Channel that ensures that at
least the Tracking ID of the initial CTA is being carried on to the target
Location.

CampaignChain-to-Channel (bidirectional)¶

Integration level: CampaignChain and the Channel are tightly integrated when it
comes to creating Operations and Locations, thus providing maximum
communication between the two when it comes to CTA tracking.

Example: A landing page has been created within Wordpress. With CampaignChain
connected to Wordpress (e.g. through a REST API), CampaignChain grabs the content
of the Wordpress page, parses it, stores the CTAs the page includes and
makes the page public at the scheduled time. As in the unidirectional
Channel-to-CampaignChain approach, a JavaScript snippet inside Wordpress sends
information to CampaignChain once the CTA gets activated.

Tracking ID: CampaignChain can pass all Tracking IDs for the CTAs in a Location
to the Channel to be appended to each respective URL inside a Location for
more granular tracking.

Pros: The tighter coupling allows for more granular tracking, i.e. it is
possible for CampaignChain to identify not just a Location, but also the Operation
that includes a triggered CTA. Also, this approach has the performance
advantage that the Channel as well as CampaignChain can handle the tracking more
efficiently, because both are aware of all relevant information.

Cons: Creating the tighter integration requires a higher investment in terms of
time and money.

Table Of Contents

Call to Action (CTA) Tracking

What is a CTA?

Tracking ID

Tracking Process

High-level View

In-depth Flow Description

Types of Tracking

CampaignChain-to-Channel (unidirectional)

Channel-to-CampaignChain (unidirectional)

CampaignChain-to-Channel (bidirectional)

Previous topic

Activity and Operation Modules

Next topic

The Developer Cookbook

Quick search

    <form class="search" action="../../search.html" method="get">
      <input type="text" name="q" />
      <input type="submit" value="Go" />
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>

    Enter search terms or a module, class or function name.

Navigation

          index

          next |

          previous |

CampaignChain 1.0.0-alpha.3 documentation »

The Developer Book »


text:
module JSS

### A mix-in module providing object-updating via the JSS API.
###

  #####################################
  ### Module Variables
  #####################################

  #####################################
  ### Module Methods
  #####################################

  #####################################
  ### Sub-Modules
  #####################################

  ###
  ### A mix-in module that allows objects to be updated in the JSS via the API.
  ###
  ### When a JSS::APIObject subclass includes this module, instances of that
  ### subclass can be modified in the JSS using the {#update} or {APIObject#save} methods.
  ###
  ### Such classes should define setter methods for any values that they wish to
  ### modify, such as the {#name=} method defined here. Those setter methods must:
  ### - ensure the correctness of the data they accept.
  ### - set @need_to_update to true, indicating that the local object no longer
  ###   matches the JSS, and the changes should be pushed to the server with {#update}
  ###
  ### Classes mixing this module *must* provide a #rest_xml instance method that returns the XML
  ### String to be submitted to the API for object updating.
  ###
  ### @see APIObject#save
  ###
  module Updatable

    #####################################
    ###  Constants
    #####################################

    UPDATABLE = true

    #####################################
    ###  Attributes
    #####################################

    ### @return [Boolean] do we have unsaved changes?
    attr_reader :need_to_update

    #####################################
    ###  Mixed-in Instance Methods
    #####################################

    ###
    ### Change the name of this item
    ### Remember to #update to push changes to the server.
    ###
    ### @param newname[String] the new name
    ###
    ### @return [void]
    ###
    def name= (newname)
      raise JSS::UnsupportedError, "Editing #{self.class::RSRC_LIST_KEY} isn't yet supported. Please use other Casper workflows." unless UPDATABLE
      return nil if @name == newname
      raise JSS::InvalidDataError, "Names can't be empty!" if newname.to_s.empty?
      raise JSS::AlreadyExistsError, "A #{self.class::RSRC_OBJECT_KEY} named '#{newname}' already exsists in the JSS" if self.class.all_names(:refresh).include? newname
      @name = newname
      @rest_rsrc = "#{self.class::RSRC_BASE}/name/#{URI.escape @name}" if @rest_rsrc.include? '/name/'
      @need_to_update = true
    end #  name=(newname)

    ###
    ### Save changes to the JSS
    ###
    ### @return [Boolean] success
    ###
    def update
      raise JSS::UnsupportedError, "Editing #{self.class::RSRC_LIST_KEY} isn't yet supported. Please use other Casper workflows." unless UPDATABLE
      return nil unless @need_to_update
      raise JSS::NoSuchItemError, "Not In JSS! Use #create to create this #{self.class::RSRC_OBJECT_KEY} in the JSS before updating it." unless @in_jss
      JSS::API.put_rsrc  @rest_rsrc, rest_xml
      @need_to_update = false
      @id
    end # update

  end # module Creatable

end # module


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<meta http-equiv="Content-Type" content="text/html" charset="UTF-8">
<title>Uses of Package com.thinkaurelius.titan.graphdb.internal (Titan: Distributed Graph Database 0.3.0 API)</title>
<meta name="date" content="2013-03-29">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Uses of Package
com.thinkaurelius.titan.graphdb.internal

Packages that use com.thinkaurelius.titan.graphdb.internal

Package
Description

com.thinkaurelius.titan.graphdb.database

com.thinkaurelius.titan.graphdb.database.idassigner

com.thinkaurelius.titan.graphdb.database.idassigner.placement

com.thinkaurelius.titan.graphdb.internal

com.thinkaurelius.titan.graphdb.query

com.thinkaurelius.titan.graphdb.relations

com.thinkaurelius.titan.graphdb.transaction

com.thinkaurelius.titan.graphdb.transaction.addedrelations

com.thinkaurelius.titan.graphdb.transaction.vertexcache

com.thinkaurelius.titan.graphdb.types.system

com.thinkaurelius.titan.graphdb.types.vertices

com.thinkaurelius.titan.graphdb.vertices

Classes in com.thinkaurelius.titan.graphdb.internal used by com.thinkaurelius.titan.graphdb.database

Class and Description

InternalElement

InternalRelation

The abstract TitanRelation class defines the standard interface for edges used
 in DOGMA.

InternalVertex

Classes in com.thinkaurelius.titan.graphdb.internal used by com.thinkaurelius.titan.graphdb.database.idassigner

Class and Description

InternalElement

InternalRelation

The abstract TitanRelation class defines the standard interface for edges used
 in DOGMA.

Classes in com.thinkaurelius.titan.graphdb.internal used by com.thinkaurelius.titan.graphdb.database.idassigner.placement

Class and Description

InternalElement

InternalVertex

Classes in com.thinkaurelius.titan.graphdb.internal used by com.thinkaurelius.titan.graphdb.internal

Class and Description

ElementLifeCycle.Event

InternalElement

InternalRelation

The abstract TitanRelation class defines the standard interface for edges used
 in DOGMA.

InternalVertex

Classes in com.thinkaurelius.titan.graphdb.internal used by com.thinkaurelius.titan.graphdb.query

Class and Description

InternalVertex

Classes in com.thinkaurelius.titan.graphdb.internal used by com.thinkaurelius.titan.graphdb.relations

Class and Description

AbstractElement

(c) Matthias Broecheler (me@matthiasb.com)

InternalElement

InternalRelation

The abstract TitanRelation class defines the standard interface for edges used
 in DOGMA.

InternalType

InternalVertex

Classes in com.thinkaurelius.titan.graphdb.internal used by com.thinkaurelius.titan.graphdb.transaction

Class and Description

InternalRelation

The abstract TitanRelation class defines the standard interface for edges used
 in DOGMA.

InternalVertex

Classes in com.thinkaurelius.titan.graphdb.internal used by com.thinkaurelius.titan.graphdb.transaction.addedrelations

Class and Description

InternalRelation

The abstract TitanRelation class defines the standard interface for edges used
 in DOGMA.

Classes in com.thinkaurelius.titan.graphdb.internal used by com.thinkaurelius.titan.graphdb.transaction.vertexcache

Class and Description

InternalVertex

Classes in com.thinkaurelius.titan.graphdb.internal used by com.thinkaurelius.titan.graphdb.types.system

Class and Description

InternalElement

InternalRelation

The abstract TitanRelation class defines the standard interface for edges used
 in DOGMA.

InternalType

InternalVertex

Classes in com.thinkaurelius.titan.graphdb.internal used by com.thinkaurelius.titan.graphdb.types.vertices

Class and Description

AbstractElement

(c) Matthias Broecheler (me@matthiasb.com)

InternalElement

InternalType

InternalVertex

Classes in com.thinkaurelius.titan.graphdb.internal used by com.thinkaurelius.titan.graphdb.vertices

Class and Description

AbstractElement

(c) Matthias Broecheler (me@matthiasb.com)

InternalElement

InternalRelation

The abstract TitanRelation class defines the standard interface for edges used
 in DOGMA.

InternalVertex

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Copyright © 2012-2013. All Rights Reserved.


text:
public class Quack implements QuackBehaviour{
	public void quack(){
		System.out.println("Quack!");
	}
}


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<title>Uses of Class br.ufrn.imd.pitagoras.geneticz.AVLTreeDouble</title>
<meta name="date" content="2015-05-27">
<link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Uses of Class
br.ufrn.imd.pitagoras.geneticz.AVLTreeDouble

Uses of AVLTreeDouble in br.ufrn.imd.pitagoras.geneticz

Methods in br.ufrn.imd.pitagoras.geneticz that return AVLTreeDouble

Modifier and Type
Method and Description

AVLTreeDouble[]
SignatureDialog.getGeneratedSignature()

AVLTreeDouble[]
GeneticAnalysis.getSignature()

static AVLTreeDouble[]
SampleSimplifier.getSignature(java.io.File samplesFile,
            java.io.File groupsFile,
            java.lang.String testOption,
            double pValue)

Methods in br.ufrn.imd.pitagoras.geneticz with parameters of type AVLTreeDouble

Modifier and Type
Method and Description

double
AVLTreeDouble.difference(AVLTreeDouble x)

void
GeneticAnalysis.setSignature(AVLTreeDouble[] signature)

Constructors in br.ufrn.imd.pitagoras.geneticz with parameters of type AVLTreeDouble

Constructor and Description

DistanceMatrix(AVLTreeDouble[] signature)

Skip navigation links

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes


text:
Модератор

Уникален номер на класа

{{identity.currentUser.schoolClass}}

                Оценки

                    {{subject.subject}}

Отсъствия

Забележки


text:
from __future__ import unicode_literals

from django.db import models
from django.utils.encoding import python_2_unicode_compatible

from taggit.managers import TaggableManager
from taggit.models import (TaggedItemBase, GenericTaggedItemBase, TaggedItem,
    TagBase, Tag)

@python_2_unicode_compatible
class Food(models.Model):
    name = models.CharField(max_length=50)

    tags = TaggableManager()

    def __str__(self):
        return self.name

@python_2_unicode_compatible
class Pet(models.Model):
    name = models.CharField(max_length=50)

    tags = TaggableManager()

    def __str__(self):
        return self.name

class HousePet(Pet):
    trained = models.BooleanField()

# Test direct-tagging with custom through model

class TaggedFood(TaggedItemBase):
    content_object = models.ForeignKey('DirectFood')

class TaggedPet(TaggedItemBase):
    content_object = models.ForeignKey('DirectPet')

@python_2_unicode_compatible
class DirectFood(models.Model):
    name = models.CharField(max_length=50)

    tags = TaggableManager(through="TaggedFood")

    def __str__(self):
        return self.name

@python_2_unicode_compatible
class DirectPet(models.Model):
    name = models.CharField(max_length=50)

    tags = TaggableManager(through=TaggedPet)

    def __str__(self):
        return self.name

class DirectHousePet(DirectPet):
    trained = models.BooleanField()

# Test custom through model to model with custom PK

class TaggedCustomPKFood(TaggedItemBase):
    content_object = models.ForeignKey('CustomPKFood')

class TaggedCustomPKPet(TaggedItemBase):
    content_object = models.ForeignKey('CustomPKPet')

@python_2_unicode_compatible
class CustomPKFood(models.Model):
    name = models.CharField(max_length=50, primary_key=True)

    tags = TaggableManager(through=TaggedCustomPKFood)

    def __str__(self):
        return self.name

@python_2_unicode_compatible
class CustomPKPet(models.Model):
    name = models.CharField(max_length=50, primary_key=True)

    tags = TaggableManager(through=TaggedCustomPKPet)

    def __str__(self):
        return self.name

class CustomPKHousePet(CustomPKPet):
    trained = models.BooleanField()

# Test custom through model to a custom tag model

class OfficialTag(TagBase):
    official = models.BooleanField(default=False)

class OfficialThroughModel(GenericTaggedItemBase):
    tag = models.ForeignKey(OfficialTag, related_name="tagged_items")

@python_2_unicode_compatible
class OfficialFood(models.Model):
    name = models.CharField(max_length=50)

    tags = TaggableManager(through=OfficialThroughModel)

    def __str__(self):
        return self.name

@python_2_unicode_compatible
class OfficialPet(models.Model):
    name = models.CharField(max_length=50)

    tags = TaggableManager(through=OfficialThroughModel)

    def __str__(self):
        return self.name

class OfficialHousePet(OfficialPet):
    trained = models.BooleanField()

class Media(models.Model):
    tags = TaggableManager()

    class Meta:
        abstract = True

class Photo(Media):
    pass

class Movie(Media):
    pass

class ArticleTag(Tag):
    class Meta:
        proxy = True

    def slugify(self, tag, i=None):
        slug = "category-%s" % tag.lower()

        if i is not None:
            slug += "-%d" % i
        return slug

class ArticleTaggedItem(TaggedItem):
    class Meta:
        proxy = True

    @classmethod
    def tag_model(self):
        return ArticleTag

class Article(models.Model):
    title = models.CharField(max_length=100)

    tags = TaggableManager(through=ArticleTaggedItem)


text:
.PHONY: tests

up:
	@docker-compose rm -f
	@docker-compose pull
	@sed -e "s/HOSTIP/$$(docker-machine ip)/g" docker-compose.yml | docker-compose --file - up --build -d
	@docker-compose run php-event-pubsub /bin/bash

down:
	@docker-compose stop -t 1

tests:
	@./vendor/bin/phpunit --configuration phpunit.xml


text:
namespace base {
namespace internal {

// TrackedRefs are effectively a ref-counting scheme for objects that have a
// single owner.
//
// Deletion is still controlled by the single owner but ~T() itself will block
// until all the TrackedRefs handed by its TrackedRefFactory have been released
// (by ~TrackedRef<T>()).
//
// Just like WeakPtrFactory: TrackedRefFactory<T> should be the last member of T
// to ensure ~TrackedRefFactory<T>() runs first in ~T().
//
// The owner of a T should hence be certain that the last TrackedRefs to T are
// already gone or on their way out before destroying it or ~T() will hang
// (indicating a bug in the tear down logic -- proper refcounting on the other
// hand would result in a leak).
//
// TrackedRefFactory only makes sense to use on types that are always leaked in
// production but need to be torn down in tests (blocking destruction is
// impractical in production).
//
// Why would we ever need such a thing? In thread_pool there is a clear
// ownership hierarchy with mostly single owners and little refcounting. In
// production nothing is ever torn down so this isn't a problem. In tests
// however we must JoinForTesting(). At that point, all the raw back T* refs
// used by the worker threads are problematic because they can result in use-
// after-frees if a worker outlives the deletion of its corresponding
// ThreadPool/TaskTracker/ThreadGroup/etc.
//
// JoinForTesting() isn't so hard when all workers are managed. But with cleanup
// semantics (reclaiming a worker who's been idle for too long) it becomes
// tricky because workers can go unaccounted for before they exit their main
// (https://crbug.com/827615).
//
// For that reason and to clearly document the ownership model, thread_pool
// uses TrackedRefs.
//
// On top of being a clearer ownership model than proper refcounting, a hang in
// tear down in a test with out-of-order tear down logic is much preferred to
// letting its worker thread and associated constructs outlive the test
// (potentially resulting in flakes in unrelated tests running later in the same
// process).
//
// Note: While there's nothing thread_pool specific about TrackedRefs it
// requires an ownership model where all the TrackedRefs are released on other
// threads in sync with ~T(). This isn't a typical use case beyond shutting down
// ThreadPool in tests and as such this is kept internal here for now.

template <class T>
class TrackedRefFactory;

// TrackedRef<T> can be used like a T*.
template <class T>
class TrackedRef {
 public:
  // Moveable and copyable.
  TrackedRef(TrackedRef<T>&& other)
      : ptr_(other.ptr_), factory_(other.factory_) {
    // Null out |other_|'s factory so its destructor doesn't decrement
    // |live_tracked_refs_|.
    other.factory_ = nullptr;
  }
  TrackedRef(const TrackedRef<T>& other)
      : ptr_(other.ptr_), factory_(other.factory_) {
    factory_->live_tracked_refs_.Increment();
  }

  // Intentionally not assignable for now because it makes the logic slightly
  // convoluted and it's not a use case that makes sense for the types using
  // this at the moment.
  TrackedRef& operator=(TrackedRef<T>&& other) = delete;
  TrackedRef& operator=(const TrackedRef<T>& other) = delete;

  ~TrackedRef() {
    if (factory_ && !factory_->live_tracked_refs_.Decrement()) {
      DCHECK(factory_->ready_to_destroy_);
      DCHECK(!factory_->ready_to_destroy_->IsSignaled());
      factory_->ready_to_destroy_->Signal();
    }
  }

  T& operator*() const { return *ptr_; }

  T* operator->() const { return ptr_; }

  explicit operator bool() const { return ptr_ != nullptr; }

  bool operator==(const void* compared_ptr) const {
    return ptr_ == compared_ptr;
  }

  // Returns the raw pointer stored in this TrackedRef. This is occasionally
  // useful for operations in scope but, as with other smart pointers, it
  // shouldn't be used beyond the scope of this TrackedRef.
  T* get() const { return ptr_; }

 private:
  friend class TrackedRefFactory<T>;

  TrackedRef(T* ptr, TrackedRefFactory<T>* factory)
      : ptr_(ptr), factory_(factory) {
    factory_->live_tracked_refs_.Increment();
  }

  T* ptr_;
  TrackedRefFactory<T>* factory_;
};

// TrackedRefFactory<T> should be the last member of T.
template <class T>
class TrackedRefFactory {
 public:
  explicit TrackedRefFactory(T* ptr)
      : ptr_(ptr), self_ref_(TrackedRef<T>(ptr_.get(), this)) {
    DCHECK(ptr_);
  }

  TrackedRefFactory(const TrackedRefFactory&) = delete;
  TrackedRefFactory& operator=(const TrackedRefFactory&) = delete;

  ~TrackedRefFactory() {
    // Enter the destruction phase.
    ready_to_destroy_.emplace();

    // Release self-ref. If this was the last one it will signal the event right
    // away. Otherwise it establishes an happens-after relationship between
    // |ready_to_destroy.emplace()| and the eventual
    // |ready_to_destroy_->Signal()|.
    self_ref_.reset();

    ready_to_destroy_->Wait();
  }

  TrackedRef<T> GetTrackedRef() {
    // TrackedRefs cannot be obtained after |live_tracked_refs_| has already
    // reached zero. In other words, the owner of a TrackedRefFactory shouldn't
    // vend new TrackedRefs while it's being destroyed (owners of TrackedRefs
    // may still copy/move their refs around during the destruction phase).
    DCHECK(!live_tracked_refs_.IsZero());
    return TrackedRef<T>(ptr_.get(), this);
  }

 private:
  friend class TrackedRef<T>;
  FRIEND_TEST_ALL_PREFIXES(TrackedRefTest, CopyAndMoveSemantics);

  const raw_ptr<T> ptr_;

  // The number of live TrackedRefs vended by this factory.
  AtomicRefCount live_tracked_refs_{0};

  // Non-null during the destruction phase. Signaled once |live_tracked_refs_|
  // reaches 0. Note: making this optional and only initializing it in the
  // destruction phase avoids keeping a handle open for the entire session.
  absl::optional<WaitableEvent> ready_to_destroy_;

  // TrackedRefFactory holds a TrackedRef as well to prevent
  // |live_tracked_refs_| from ever reaching zero before ~TrackedRefFactory().
  absl::optional<TrackedRef<T>> self_ref_;
};

}  // namespace internal
}  // namespace base

#endif  // BASE_TASK_THREAD_POOL_TRACKED_REF_H_


text:
var rome = require('rome');
var moment = require('moment');

(function() {
  'use strict';

  angular
    .module('bgn.rome', [])
    .directive('rome', romeDirective);

  romeDirective.$inject = [];
  function romeDirective() {
    // Usage:
    //
    // Creates:
    //
    var directive = {
        controllerAs: 'vm',
        require: 'ngModel',
        link: link,
        restrict: 'E',
        scope: {
        },
        template: '<input type="text" />'
    };
    return directive;

    function link(scope, element, attrs, ngModelCtrl) {
      var inputElement = element.find('input');
      var input = inputElement[0];

      addNonDirectiveAttributes(attrs, element, inputElement);

      var romeConfig = getRomeConfig(attrs);
      var romeElement = rome(input, romeConfig);

      ngModelCtrl.$formatters.push(function(modelValue) {
        if (modelValue) {
          input.value = romeElement.setValue(modelValue);
        }
        return modelValue;
      });

      ngModelCtrl.$render = function() {
        input.value = romeElement.getDateString();
      };

      ngModelCtrl.$parsers.push(function(viewValue) {
        return romeElement.getDate().toISOString();
      });

      romeElement.on('data', function (value) {
        input.value = value;
        scope.$apply(function () {
          ngModelCtrl.$setViewValue({
            date: value
          });
        });
      });
    }

    function addNonDirectiveAttributes(attrs, directiveElement, inputElement) {
      angular.forEach({
        'id': attrs.id
      }, function (value, name) {
        if (angular.isDefined(value)) {
          directiveElement.removeAttr(name);
          inputElement.attr(name, value);
        }
      });
    }

    /**
     * Get rome configuration
     *
     * @param {Object} attrs - directive element attributes
     */
    function getRomeConfig(attrs) {
      var romeConfig = {};

      if (attrs.initialValue) { romeConfig.initialValue = attrs.initialValue; }
      if (attrs.time) { romeConfig.time = attrs.time === 'true'; }
      if (attrs.date) { romeConfig.date = attrs.date === 'true'; }
      if (attrs.inputFormat) { romeConfig.inputFormat = attrs.inputFormat; }
      if (attrs.weekStart) { romeConfig.weekStart = Number(attrs.weekStart); }
      if (attrs.monthsInCalendar) { romeConfig.monthsInCalendar = Number(attrs.monthsInCalendar); }
      if (attrs.min) { romeConfig.min = attrs.min; }
      if (attrs.max) { romeConfig.max = attrs.max; }
      if (attrs.dayFormat) { romeConfig.dayFormat = attrs.dayFormat; }
      if (attrs.weekdayFormat) { romeConfig.weekdayFormat = attrs.weekdayFormat; }
      if (attrs.styles) { romeConfig.styles = JSON.parse(attrs.styles); }
      if (attrs.timeInterval) { romeConfig.timeInterval = Number(attrs.timeInterval); }
      if (attrs.autoHideOnBlur) { romeConfig.autoHideOnBlur = attrs.autoHideOnBlur === 'true'; }
      if (attrs.autoClose) { romeConfig.autoClose = attrs.autoClose === 'true'; }

      if (attrs.beforeEq) {
        var beforeElementEq = document.getElementById(attrs.beforeEq);
        romeConfig.dateValidator = rome.val.beforeEq(beforeElementEq);
      }

      if (attrs.before) {
        var beforeElement = document.getElementById(attrs.before);
        romeConfig.dateValidator = rome.val.after(beforeElement);
      }

      if (attrs.afterEq) {
        var afterElementEq = document.getElementById(attrs.afterEq);
        romeConfig.dateValidator = rome.val.afterEq(afterElementEq);
      }

      if (attrs.after) {
        var afterElement = document.getElementById(attrs.after);
        romeConfig.dateValidator = rome.val.after(afterElement);
      }

      return romeConfig;
    }
  }
})();


text:
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.container.jdisc;

import com.yahoo.container.logging.AccessLogEntry;
import com.yahoo.jdisc.HeaderFields;
import com.yahoo.jdisc.Request;
import com.yahoo.jdisc.Response;
import com.yahoo.processing.execution.Execution.Trace.LogValue;

import java.io.IOException;
import java.io.OutputStream;
import java.util.Collections;

/**
 * An HTTP response as an opaque payload with headers and content type.
 *
 * @author hmusum
 * @author Steinar Knutsen
 */
public abstract class HttpResponse {

    /** Default response content type; text/plain. */
    public static final String DEFAULT_MIME_TYPE = "text/plain";

    /** Default encoding/character set of a HTTP response; UTF-8. */
    public static final String DEFAULT_CHARACTER_ENCODING = "UTF-8";

    private final Response parentResponse;

    /**
     * Creates a new HTTP response
     *
     * @param status the HTTP status code to return with this response (may be changed later)
     * @see Response
     */
    public HttpResponse(int status) {
        parentResponse = com.yahoo.jdisc.http.HttpResponse.newInstance(status);
    }

    /** Marshals this response to the network layer. The caller is responsible for flushing and closing outputStream. */
    public abstract void render(OutputStream outputStream) throws IOException;

    /** The amount of content bytes this response may have in-flight (if positive) before response rendering blocks. */
    public long maxPendingBytes() { return -1; }

    /**
     * Returns the numeric HTTP status code, e.g. 200, 404 and so on.
     *
     * @return the numeric HTTP status code
     */
    public int getStatus() {
        return parentResponse.getStatus();
    }

    /**
     * Sets the numeric HTTP status code this will return.
     */
    public void setStatus(int status) { parentResponse.setStatus(status); }

    /**
     * The response headers.
     *
     * @return a mutable, thread-unsafe view of the response headers
     */
    public HeaderFields headers() {
        return parentResponse.headers();
    }

    /**
     * The underlying JDisc response.
     *
     * @return the actual response which will be used by the JDisc layer
     */
    public com.yahoo.jdisc.Response getJdiscResponse() {
        return parentResponse;
    }

    /**
     * The MIME type of the response contents or null. If null is returned, no
     * content type header is added to the HTTP response.
     *
     * @return by default {@link HttpResponse#DEFAULT_MIME_TYPE}
     */
    public String getContentType() {
        return DEFAULT_MIME_TYPE;
    }

    /**
     * The name of the encoding for the response contents, if applicable. Return
     * null if character set is not applicable to the response in question (e.g.
     * binary formats). If null is returned, not "charset" element is added to
     * the content type header.
     *
     * @return by default {@link HttpResponse#DEFAULT_CHARACTER_ENCODING}
     */
    public String getCharacterEncoding() {
        return DEFAULT_CHARACTER_ENCODING;
    }

    // ========================================
    // Purely optional stuff from this point on
    // ========================================

    /**
     * Override this method to add information from the response to the access log.
     *
     * Remember to also invoke super if you override it.
     *
     * @param accessLogEntry the access log entry to add information to.
     */
    public void populateAccessLogEntry(final AccessLogEntry accessLogEntry) {
        for (LogValue logValue : getLogValues()) {
            accessLogEntry.addKeyValue(logValue.getKey(), logValue.getValue());
        }
    }

    /**
     * Complete creation of this response.
     * This is called by the container once just before writing the response header back to the caller,
     * so this is the last moment at which status and headers can be determined.
     * This default implementation does nothing.
     */
    public void complete() { }

    public Iterable<LogValue> getLogValues() {
        return Collections::emptyIterator;
    }

    /** Sets the type classification of this request for metric collection purposes */
    public void setRequestType(Request.RequestType requestType) { parentResponse.setRequestType(requestType); }

    /**
     * Returns the type classification of this request for metric collection purposes, or null if not set.
     * When not set, the request type will be "read" for GET requests and "write" for other request methods.
     */
    public Request.RequestType getRequestType() { return parentResponse.getRequestType(); }

}