text:
package gov.nih.nci.gss.util;

import gov.nih.nci.gss.support.SimpleName;

import java.util.HashSet;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.regex.PatternSyntaxException;

import org.apache.log4j.Logger;
import org.hibernate.SessionFactory;
import org.hibernate.classic.Session;
/**
 * Utilities for translating and generating names.
 *
 * @author Konrad Rokicki
 */
public class NamingUtil {

    private static Logger log = Logger.getLogger(NamingUtil.class);

    private Map<String,String> simpleServiceNameMap = new LinkedHashMap<String,String>();
    private Map<String,String> simpleHostNameMap = new LinkedHashMap<String,String>();
    private Set<String> hideSet = new HashSet<String>();

	public NamingUtil(SessionFactory sessionFactory) {

        Session s = sessionFactory.openSession();
        try {
            log.info("Configuring naming map...");
            List<SimpleName> names = s.createCriteria(SimpleName.class).list();

            for(SimpleName simpleName : names) {
                String pattern = simpleName.getPattern();

                try {
                    Pattern.compile(pattern);
                    String type = simpleName.getType();
                    if ("ServiceName".equals(type)) {
                        log.info("Service pattern: /"+pattern+"/"+simpleName.getSimpleName()+"/");
                        simpleServiceNameMap.put(
                            simpleName.getPattern(), simpleName.getSimpleName());
                    }
                    else if ("HostName".equals(type)) {
                        log.info("Host pattern: /"+pattern+"/"+simpleName.getSimpleName()+"/");
                        simpleHostNameMap.put(
                            simpleName.getPattern(), simpleName.getSimpleName());
                    }
                    else {
                        log.info("Unknown SimpleName type: "+
                            type+" (id="+simpleName.getId()+")");
                    }

                    if (simpleName.getHide()) {
                        hideSet.add(simpleName.getPattern());
                    }

                }
                catch (PatternSyntaxException e) {
                    log.warn("Invalid SimpleName pattern: "+pattern+" " +
                    		"("+e.getMessage()+")");
                }
            }
            log.info("Naming map configuration complete.");
        }
        finally {
            s.close();
        }
    }

    /**
     * Attempt to generate a simple name for the input name. If no simple name
     * pattern matches then the input is returned unchanged.
     * @param originalName a name to simplify
     * @return simple name
     */
    private String getSimpleName(String originalName,
            Map<String,String> simpleNameMap) {

        if (originalName == null) return null;

        String simpleName = originalName.trim();
        for (String pattern : simpleNameMap.keySet()) {
            String replacement = simpleNameMap.get(pattern);
            Matcher m = Pattern.compile(pattern, Pattern.CASE_INSENSITIVE).matcher(simpleName);
            simpleName = m.replaceAll(replacement);
        }

        return simpleName;
    }

    public String getSimpleServiceName(String originalName) {
        return getSimpleName(originalName, simpleServiceNameMap);
    }

    public String getSimpleHostName(String originalName) {
        return getSimpleName(originalName, simpleHostNameMap);
    }

    /**
     * Should this service or host be hidden?
     * @param originalName
     * @return true if the service should be hidden by default
     */
    public boolean isHidden(String originalName) {

        if (originalName == null) return false;

        String simpleName = originalName.trim();
        for (String pattern : hideSet) {
            Matcher m = Pattern.compile(pattern, Pattern.CASE_INSENSITIVE).matcher(simpleName);
            if (m.find()) {
                return true;
            }
        }
        return false;
    }

    /**
     * Test harness for regular expressions.
     * @param args
     */
    public static final void main(String[] args) {

        String originalName = "Washington University at St. Louis";
        String pattern = "^Washington University( at St\\.\\s?Louis)?$";

        Matcher m = Pattern.compile(pattern, Pattern.CASE_INSENSITIVE).matcher(originalName);

        String finalName = m.replaceAll("Washington University in St. Louis");
        System.out.println("Simplify: "+originalName+" -> "+finalName);

    }

}


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

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="chrome=1">
    <title>Light Fields | Owen Jow</title>

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

    <link href="css/zoom.min.css" rel="stylesheet">
    <meta name="viewport" content="width=device-width">

Depth Refocusing and Aperture Adjustment with Light Field Data

CS 194-26 Project #6  ·  Owen Jow  ·  October 2016

[0] Introduction

            If a regular 2D photograph is the amount of light that runs into each pixel on an image plane, then the analogous 4D light field is the amount of light traveling along each ray that runs into the image plane. In other words, it captures the direction of the light values as well as the light values themselves. As Ng. et al. describe in this paper, we can use the additional information to enable countless post-processing effects such as refocusing and aperture resizing. (As a result, having light field data is useful for photographers since it means they no longer have to decide between controlling motion blur and controlling depth of field!)

            In this project, we focus (through alignment and averaging, haha) on the two light field applications mentioned a few seconds ago: depth refocusing and aperture adjustment. Without a Lytro camera, we turn to the Stanford Light Field Archive for photographic data to process.

[1] Depth Refocusing

            Each light field in the Stanford dataset is represented as a collection of 289 sub-aperture images taken over a 17 x 17 grid (/captured over a plane orthogonal to the optical axis). Each sub-aperture image can be thought of as the light that comes through a different part of some universal aperture, or effectively just the same "back of the lens" picture taken a bunch of times from slightly different positions. (As a side note, this means that it's theoretically possible to record light field data with a conventional camera just by snapping many variations on the same shot. We could do that as a bells and whistles option for this project, actually, but ain't nobody got time for that.)

            In our minds, we can turn such images into light rays because each \((x, y)\) position on the image plane and each \((u, v)\) position on the aperture plane uniquely define a ray. In this way, the parameters \((x, y, u, v)\) make up the four dimensions of our plenoptic function. With the Stanford data, we maintain a fixed \((x, y)\)-plane – the output image itself – while varying \((u, v)\) over the positions specified in the image names. Thus we can consider ourselves to have the set of rays that will be integrated by a single pixel, for every pixel on the image plane.

            Then what? Well, we can create our output photograph by performing that integration process – i.e. adding up and averaging the light from all those rays. But perhaps we don't want just any output photograph; perhaps we want our image to be focused on a specific point of interest. For this we introduce shifting. With the Stanford dataset in hand, all we have to do to focus on some element is shift-align the sub-aperture images so that our element is at the same position in every image... and then average the lot of them. Of course this means we need an image of reference (the image whose content all of the other images will be shifted toward), and here we choose the central sub-aperture image for that role: the one corresponding to point \((8, 8)\) if we're still speaking of our 17 x 17 grid.

            Unfortunately, it turns out that to focus on a certain element it's necessary to run extra processing (in order to compute those tailored shifts). Accordingly, for the time being we remain lazy and deign merely to shift the image based on some arbitrary constant \(C\). With this, we arrive at our refocusing algorithm, where actually the pseudocode below was straight ripped from Prof. Ng's lecture slides:

for every sub-aperture image I(x, y):
    compute the (u, v) coordinates corresponding to that image
    shift by Δ(x, y) = C * (u, v)
    average the shifted image into an output image

We compute \((u, v)\) by utilizing the absolute coordinates given in the image filenames.

            Note that when \(C = 0\), we're just averaging all the images without any shifting. This produces an output image that's sharp for distant objects and blurry for the nearby ones (why? Because from the aperture's point of view distant objects hardly even move, relatively at least, so their pixel values are unaffected and are as sharp as they would be for a tiny aperture. Meanwhile, nearby objects vary their position a lot and as a result have their colors all mixed together and blurred). So by default, averaging focuses on faraway world space. This is demonstrated below; the following two images each represent the non-shifted mean of their respective dataset:

Chess; C = 0

Truck; C = 0

            We also observe the difference between choices of \(C\) by running the algorithm for a range of values and then combining the image results into GIFs.

Chess; C = -0.3 to 0.8

Truck; C = -0.2 to 0.6

Tarot; C = -0.5 to 0.6

            As it happens, positive values of \(C\) correspond to near focus, while negative values of \(C\) correspond to far focus. Furthermore, the magnitude of \(C\) represents the distance of focus (a higher magnitude means that we're refocusing further from the physical focus).

[2] Aperture Adjustment

            We can also post-process the images in order to virtually modify the size of the aperture. To do this, we fix our \(C\) (if only so we can highlight aperture adjustment instead of depth refocusing) and simply include more or less sub-aperture images in our average. If wanted the smallest possible aperture, we wouldn't average anything at all – instead we'd just return a single one of our sub-aperture images. In our case, we'll again base our photographs around the central \((8, 8)\) image, so we'd actually return that.

            Then, to increase the aperture size, we'd average more images in the space around the central image. We step over radius lengths here (although technically we average over a box, not a circle). For radius 0, we return the central image; for radius 1, we average the 3 x 3 box of sub-aperture images around the central image; for radius 2, we average the 5 x 5 box... and so on so forth. By the end of it, we're averaging the entire collection of sub-aperture images again.

            Intuitively, this represents a larger aperture because we're expanding the space (the grid) around the center of the aperture that we're letting light pass through. If we think of each sub-aperture image as the light that passes through a certain portion of the aperture, then obviously taking into account more sub-aperture images will take into account a bigger portion of the aperture. (We get more light rays – more pixel values – due to a larger aperture!)

            Below are examples of aperture adjustment in action. In each, we set \(C = 0.1\) (which seems to focus around the middle) and run Part 1's depth refocusing algorithm on varying numbers of images around the \((8, 8)\) photograph.

Chess; C = 0.1

Truck; C = 0.1

Tarot; C = 0.1

            We can see that the focused depth range around the center of each image remains in focus, while the rest of each image transitions from mostly in focus (small aperture size) to blurry (large aperture size). Basically we're changing the depth of field.

[3] Summary

            About a year ago, I found Lytro's living picture demonstrations and they became a nontrivial motivator for my enrollment in Ren Ng's graphics class / interest in comp. photo-esque material in general. I remember being blown away by the idea of refocusing images and seemingly moving the viewpoint after taking a picture. Thus, through this project I'm excited to have been able to implement a refocusing algorithm via light field data at last.

            Also, I found it interesting that light fields would be given in the form of sub-aperture images (I previously thought it would be more of a primitive "directional rays with light values" kind of deal), but in hindsight it makes a lot of sense and was very straightforward to work with. On the whole, it was pretty eye-opening to experience how simple and effective these light field methods can be – because really all this project came down to was shifting and averaging, and through that I was able to recreate the type of post-processing that so amazed me one year ago...

redpajama_set_name: RedPajamaGithub


text:
package eloqua

import (
	"bytes"
	"encoding/base64"
	"encoding/json"
	"errors"
	"fmt"
	"io"
	"io/ioutil"
	"net/http"
	"strings"

	"github.com/google/go-querystring/query"
)

var _ = fmt.Printf
var _ = ioutil.ReadAll

// Client manages communications with the Eloqua API. It contains services to access each
// endpoint grouping so the API can be used in a fluent manner.
type Client struct {
	client *http.Client

	// The base URL for the eloqua instance
	BaseURL string

	// Eloqua login company name
	companyName string
	// Eloqua login user name
	userName string
	// Eloqua login password
	password string
	// Basic auth header value
	authHeader string

	// The service endpoints of the API
	Accounts           *AccountService
	Activities         *ActivityService
	Campaigns          *CampaignService
	Contacts           *ContactService
	ContactFields      *ContactFieldService
	ContactLists       *ContactListService
	ContactSegments    *ContactSegmentService
	ContentSections    *ContentSectionService
	CustomObjects      *CustomObjectService
	CustomObjectData   *CustomObjectDataService
	Emails             *EmailService
	EmailFolders       *EmailFolderService
	EmailGroups        *EmailGroupService
	EmailHeaders       *EmailHeaderService
	EmailFooters       *EmailFooterService
	ExternalActivity   *ExternalActivityService
	ExternalAssets     *ExternalAssetService
	ExternalAssetTypes *ExternalAssetTypeService
	Forms              *FormService
	FormData           *FormDataService
	Images             *ImageService
	LandingPages       *LandingPageService
	Microsites         *MicrositeService
	OptionLists        *OptionListService
	Users              *UserService
	Visitors           *VisitorService
}

// NewClient creates a new instance of an Eloqua HTTP client
// used to interface with the Eloqua API.
func NewClient(baseURL string, companyName string, userName string, password string) *Client {

	authString := companyName + "\\" + userName + ":" + password
	encodedAuth := base64.StdEncoding.EncodeToString([]byte(authString))

	c := &Client{
		client:      http.DefaultClient,
		BaseURL:     strings.Trim(baseURL, " /"),
		companyName: companyName,
		userName:    userName,
		password:    password,
		authHeader:  "Basic " + encodedAuth,
	}

	// Create services
	c.Accounts = &AccountService{client: c}
	c.Activities = &ActivityService{client: c}
	c.Campaigns = &CampaignService{client: c}
	c.Contacts = &ContactService{client: c}
	c.ContactFields = &ContactFieldService{client: c}
	c.ContactLists = &ContactListService{client: c}
	c.ContactSegments = &ContactSegmentService{client: c}
	c.ContentSections = &ContentSectionService{client: c}
	c.CustomObjects = &CustomObjectService{client: c}
	c.CustomObjectData = &CustomObjectDataService{client: c}
	c.Emails = &EmailService{client: c}
	c.EmailFolders = &EmailFolderService{client: c}
	c.EmailGroups = &EmailGroupService{client: c}
	c.EmailHeaders = &EmailHeaderService{client: c}
	c.EmailFooters = &EmailFooterService{client: c}
	c.ExternalActivity = &ExternalActivityService{client: c}
	c.ExternalAssets = &ExternalAssetService{client: c}
	c.ExternalAssetTypes = &ExternalAssetTypeService{client: c}
	c.Forms = &FormService{client: c}
	c.FormData = &FormDataService{client: c}
	c.Images = &ImageService{client: c}
	c.LandingPages = &LandingPageService{client: c}
	c.Microsites = &MicrositeService{client: c}
	c.OptionLists = &OptionListService{client: c}
	c.Users = &UserService{client: c}
	c.Visitors = &VisitorService{client: c}

	return c
}

// Response is a custom http response that, upon a standard http response,
// contains eloqua specific details such as listing properies and error details.
type Response struct {
	*http.Response

	// Variables used in listing operations.
	// Will remain zero-valued for other operations

	// The main body containing the request entities
	Elements json.RawMessage `json:"elements,omitempty"`
	// The current page of the response
	Page int `json:"page,omitempty"`
	// The page size of the response
	PageSize int `json:"pageSize,omitempty"`
	// The total entities found in the query
	Total int `json:"total,omitempty"`

	// The returned response body in the event of an error
	// Use this to help debug in the event of unknown errors
	ErrorContent string `json:"-"`
}

// newReponse creates a new custom Response for the given http.Response
func newResponse(r *http.Response) *Response {
	return &Response{Response: r}
}

// ListOptions represents the options available for making listing requests.
type ListOptions struct {
	// Level of detail returned from request
	// Values: "minimal", "partial", "complete"
	Depth string `url:"depth,omitempty"`
	// Number of entities to return
	Count int `url:"count,omitempty"`
	// The page count of entities to return, Starting at 1
	Page int `url:"page,omitempty"`
	// A term for searching through entities
	Search string `url:"search,omitempty"`
	// The property on which to sort the returned data
	Sort string `url:"sort,omitempty"`
	// The direction of the applied sort
	SortDir string `url:"dir,omitempty"`
	// The field on which to order results
	OrderBy string `url:"orderBy,omitempty"`
	// A minimum last updated timestamp
	LastUpdatedAt int `url:"lastUpdatedAt,omitempty"`
}

// RestRequest provides a generic way to make a request to the Eloqua API.
// It's very general but simple performs much of the boilerplate request actions such
// as setting the correct api url and adding auth headers.
func (c *Client) RestRequest(endpoint string, method string, jsonData string) (*Response, error) {
	url := c.BaseURL
	endpoint = strings.Trim(endpoint, " /")

	// Assume rest 2.0 if not in request
	if strings.Index(endpoint, "api/") == -1 {
		url += "/api/rest/2.0/"
	} else {
		url += "/"
	}

	url += endpoint

	// fmt.Println(jsonData)
	jsonStr := []byte(jsonData)
	req, err := http.NewRequest(strings.ToUpper(method), url, bytes.NewBuffer(jsonStr))
	if err != nil {
		return nil, err
	}

	req.Header.Add("Authorization", c.authHeader)
	req.Header.Add("Content-Type", "application/json")

	resp, err := c.client.Do(req)
	return newResponse(resp), err
}

// CustomJSONRequest performs a HTTP request with a JSON string body to any endpoint
// with Eloqua authentication. The client base url is not used here, allowing a completely
// custom endpoint to be used when required.
func (c *Client) CustomJSONRequest(endpoint string, method string, jsonData string) (*Response, error) {
	url := endpoint

	// fmt.Println(jsonData)
	jsonStr := []byte(jsonData)
	req, err := http.NewRequest(strings.ToUpper(method), url, bytes.NewBuffer(jsonStr))
	if err != nil {
		return nil, err
	}

	req.Header.Add("Authorization", c.authHeader)
	req.Header.Add("Content-Type", "application/json")

	resp, err := c.client.Do(req)
	elqResp := newResponse(resp);
	if err == nil {
		err = checkResponse(elqResp)
	}
	return elqResp, err
}

// Performs a GET request and decodes the response into the provided interface
func (c *Client) getRequestDecode(endpoint string, v interface{}) (*Response, error) {
	resp, err := c.RestRequest(endpoint, "GET", "")
	if resp != nil {
		defer resp.Body.Close()
	}
	if err != nil {
		return resp, err
	}

	err = checkResponse(resp)
	if err != nil {
		return resp, err
	}

	if v != nil {
		err = json.NewDecoder(resp.Body).Decode(v)
		if err == io.EOF {
			err = nil // ignore EOF errors caused by empty response body
		}
	}

	return resp, err
}

// Performs a GET request for a listing endpoint and decodes the response into the provided interface
func (c *Client) getRequestListDecode(endpoint string, v interface{}, opts *ListOptions) (*Response, error) {

	// Create our options if not set
	if opts == nil {
		opts = &ListOptions{}
	}
	// Set a default minimal depth
	if opts.Depth == "" {
		opts.Depth = "minimal"
	}

	encoder, _ := query.Values(opts)
	endpoint += "?" + encoder.Encode()

	resp, err := c.RestRequest(endpoint, "GET", "")

	if resp != nil {
		defer resp.Body.Close()
	}

	if err != nil {
		return resp, err
	}

	err = checkResponse(resp)
	if err != nil {
		return resp, err
	}

	// Decode response
	if resp != nil {
		err = json.NewDecoder(resp.Body).Decode(resp)
	}

	// Decode elements onto model
	if v != nil {
		err = json.Unmarshal(resp.Elements, v)
	}

	return resp, err
}

// Performs a HTTP request using the given method
// and decodes the response into the provided interface
func (c *Client) RequestDecode(endpoint string, method string, v interface{}) (*Response, error) {

	postBody := ""

	if v != nil {
		jsonString, err := json.Marshal(v)
		if err != nil {
			return nil, err
		}
		postBody = string(jsonString)
	}

	resp, err := c.RestRequest(endpoint, strings.ToUpper(method), postBody)
	if resp != nil {
		defer resp.Body.Close()
	}

	if err != nil {
		return resp, err
	}

	err = checkResponse(resp)
	if err != nil {
		return resp, err
	}

	if v != nil {
		err = json.NewDecoder(resp.Body).Decode(v)
		if err == io.EOF {
			err = nil // ignore EOF errors caused by empty response body
		}
	}

	return resp, err
}

// Performs a POST request and decodes the response into the provided interface
func (c *Client) postRequestDecode(endpoint string, v interface{}) (*Response, error) {
	return c.RequestDecode(endpoint, "POST", v)
}

// Performs a PUT request and decodes the response into the provided interface
func (c *Client) putRequestDecode(endpoint string, v interface{}) (*Response, error) {
	return c.RequestDecode(endpoint, "PUT", v)
}

// Performs a DELETE request to the provided endpoint, sending the provided interface data.
func (c *Client) deleteRequest(endpoint string, v interface{}) (*Response, error) {
	postBody := ""

	if v != nil {
		jsonString, err := json.Marshal(v)
		if err != nil {
			return nil, err
		}
		postBody = string(jsonString)
	}

	resp, err := c.RestRequest(endpoint, "DELETE", postBody)
	err = checkResponse(resp)

	return resp, err
}

// errorMessages lists the common meanings for each common HTTP status code.
// These are taken directly from the Eloqua documentation.
var errorMessages = map[int]string{
	301: "Login required",
	304: "Not Modified",
	400: "Bad Request",
	// 400 Alternatives:
	// There was a missing reference
	// There was a parsing error
	// There was a serialization error
	// There was a validation error
	401: "You are not authorized to make this request",
	// 401 Alternatives:
	// Login required
	// Unauthorized
	403: "Forbidden",
	// 403 Alternatives:
	// This service has not been enabled for your site
	// XSRF Protection Failure
	404: "The requested resource was not found",
	409: "There was a conflict",
	412: "The resource you are attempting to delete has dependencies, and cannot be deleted",
	413: "Storage space exceeded",
	429: "Too Many Requests",
	500: "The service has encountered an error",
	// 500 Alternatives:
	// Internal Server Error
	502: "Bad Gateway",
	503: "Service Unavailable",
	// 503 Alternatives:
	// There was a timeout processing the request
}

// checkResponse checks the Eloqua response for errors
// and returns them in a descriptive way if possible.
func checkResponse(r *Response) error {
	if c := r.StatusCode; 200 <= c && c <= 299 {
		return nil
	}

	content, err := ioutil.ReadAll(r.Body)
	if err == nil {
		r.ErrorContent = string(content)
	}

	if message, ok := errorMessages[r.StatusCode]; ok {
		return errors.New(message)
	}

	return errors.New("There was an issue performing your request")
}

// HTMLContent represents the htmlContent model of an Eloqua email or landing page object
type HTMLContent struct {
	Type          string `json:"type,omitempty"`
	ContentSource string `json:"contentSource,omitempty"`
	HTML          string `json:"html,omitempty"`
}

// FieldValue represents the structure in which custom field values are passed
// via the API.
type FieldValue struct {
	Type  string `json:"type,omitempty"`
	ID    int    `json:"id,omitempty,string"`
	Value string `json:"value,omitempty"`
}

// Hyperlink is an Eloqua hyperlink object that is commonly
// contained in Eloqua assets such as emails and landing pages.
type Hyperlink struct {
	Type string `json:"type,omitempty"`
	ID   int    `json:"id,omitempty,string"`
	Name string `json:"name,omitempty"`
	Href string `json:"href,omitempty"`
}

// FieldMerge is an Eloqua FieldMerge Object.
// The fields available depend on the merge source (or type).
type FieldMerge struct {
	Type                  string                `json:"type,omitempty"`
	ID                    int                   `json:"id,omitempty,string"`
	Depth                 string                `json:"depth,omitempty"`
	Name                  string                `json:"name,omitempty"`
	FolderID              int                   `json:"folderId,omitempty,string"`
	Syntax                string                `json:"syntax,omitempty"`
	UpdatedAt             int                   `json:"updatedAt,omitempty,string"`
	UpdatedBy             int                   `json:"updatedBy,omitempty,string"`
	ContactFieldID        int                   `json:"contactFieldId,omitempty,string"`
	DefaultValue          string                `json:"defaultValue,omitempty"`
	MergeType             string                `json:"mergeType,omitempty"`
	DefaultContentSection DynamicContentSection `json:"defaultContentSection,omitempty"`
}

// DynamicContent represents Eloqua Dynamic Content objects.
// These can be found as part of emails or landing pages.
type DynamicContent struct {
	Type        string               `json:"type,omitempty"`
	ID          int                  `json:"id,omitempty,string"`
	Depth       string               `json:"depth,omitempty"`
	Name        string               `json:"name,omitempty"`
	FolderID    int                  `json:"folderId,omitempty,string"`
	UpdatedAt   int                  `json:"updatedAt,omitempty,string"`
	UpdatedBy   int                  `json:"updatedBy,omitempty,string"`
	CreatedAt   int                  `json:"createdAt,omitempty,string"`
	CreatedBy   int                  `json:"createdBy,omitempty,string"`
	Permissions []string             `json:"permissions,omitempty"`
	Rules       []DynamicContentRule `json:"rules,omitempty"`
}

// DynamicContentSection represents the 'section' of content of an Eloqua dynmaic content object.
type DynamicContentSection struct {
	Type        string      `json:"type,omitempty"`
	ID          int         `json:"id,omitempty,string"`
	Depth       string      `json:"depth,omitempty"`
	Name        string      `json:"name,omitempty"`
	FolderID    int         `json:"folderId,omitempty,string"`
	Permissions []string    `json:"permissions,omitempty"`
	UpdatedAt   int         `json:"updatedAt,omitempty,string"`
	UpdatedBy   int         `json:"updatedBy,omitempty,string"`
	CreatedAt   int         `json:"createdAt,omitempty,string"`
	CreatedBy   int         `json:"createdBy,omitempty,string"`
	ContentHTML string      `json:"contentHtml,omitempty"`
	ContentText string      `json:"contentText,omitempty"`
	Forms       []Form      `json:"forms,omitempty"`
	Hyperlinks  []Hyperlink `json:"hyperlinks,omitempty"`
	Images      []Image     `json:"images,omitempty"`
	Scope       string      `json:"scope,omitempty"`
	Size        Size        `json:"size,omitempty"`
}

// DynamicContentRule specifies the conditions for Dynamic Content to be shown.
type DynamicContentRule struct {
	Type           string                  `json:"type,omitempty"`
	ID             int                     `json:"id,omitempty,string"`
	ContentSection DynamicContentSection   `json:"contentSection,omitempty"`
	Depth          string                  `json:"depth,omitempty"`
	Statement      int                     `json:"statement,omitempty,string"`
	Criteria       []ContactFieldCriterion `json:"criteria,omitempty"`
}

// ContactFieldCriterion is a simple criteria for finding a match against the contact record.
type ContactFieldCriterion struct {
	Type      string             `json:"type,omitempty"`
	ID        int                `json:"id,omitempty,string"`
	FieldID   int                `json:"fieldId,omitempty,string"`
	Condition TextValueCondition `json:"condition,omitempty"`
}

// TextValueCondition represents the conditional matching of simple text values.
type TextValueCondition struct {
	Type     string `json:"type,omitempty"`
	Operator string `json:"operator,omitempty"`
	Value    string `json:"value,omitempty"`
}

// Size is a universal Eloqua object to simply track width & height
// of other assets such as images.
type Size struct {
	Type   string `json:"type,omitempty"`
	Width  int    `json:"width,omitempty,string"`
	Height int    `json:"height,omitempty,string"`
}

// TypeObject is a very simple model of an eloqua object containing
// only the 'type' field. This is used in cases where there are no extra field,
// Just a type available.
type TypeObject struct {
	Type string `json:"type,omitempty"`
}

// Position simply stores x/y coordinates. It's used for the positioning of other elements
// such as campaign elements.
type Position struct {
	Type string `json:"type,omitempty"`
	X    int    `json:"x,omitempty,string"`
	Y    int    `json:"y,omitempty,string"`
}


text:
namespace base {

namespace internal {

namespace {
#if !defined(OS_NACL)
const struct sched_param kRealTimePrio = {8};
const struct sched_param kResetPrio = {0};
#endif
}  // namespace

const ThreadPriorityToNiceValuePair kThreadPriorityToNiceValueMap[4] = {
    {ThreadPriority::BACKGROUND, 10},
    {ThreadPriority::NORMAL, 0},
    {ThreadPriority::DISPLAY, -6},
    {ThreadPriority::REALTIME_AUDIO, -10},
};

bool SetThreadPriorityForPlatform(PlatformThreadHandle handle,
                                  ThreadPriority priority) {
#if !defined(OS_NACL)
  ThreadPriority current_priority;
  if (priority != ThreadPriority::REALTIME_AUDIO &&
      GetThreadPriorityForPlatform(handle, &current_priority) &&
      current_priority == ThreadPriority::REALTIME_AUDIO) {
    // If the pthread's round-robin scheduler is already enabled, and the new
    // priority will use setpriority() instead, the pthread scheduler should be
    // reset to use SCHED_OTHER so that setpriority() just works.
    pthread_setschedparam(pthread_self(), SCHED_OTHER, &kResetPrio);
    return false;
  }
  // TODO(gab): Assess the correctness of using |pthread_self()| below instead
  // of |handle|. http://crbug.com/468793.
  return priority == ThreadPriority::REALTIME_AUDIO  &&
         pthread_setschedparam(pthread_self(), SCHED_RR, &kRealTimePrio) == 0;
#else
  return false;
#endif
}

bool GetThreadPriorityForPlatform(PlatformThreadHandle handle,
                                  ThreadPriority* priority) {
#if !defined(OS_NACL)
  int maybe_sched_rr = 0;
  struct sched_param maybe_realtime_prio = {0};
  // TODO(gab): Assess the correctness of using |pthread_self()| below instead
  // of |handle|. http://crbug.com/468793.
  if (pthread_getschedparam(pthread_self(), &maybe_sched_rr,
                            &maybe_realtime_prio) == 0 &&
      maybe_sched_rr == SCHED_RR &&
      maybe_realtime_prio.sched_priority == kRealTimePrio.sched_priority) {
    *priority = ThreadPriority::REALTIME_AUDIO;
    return true;
  }
#endif
  return false;
}

}  // namespace internal

// static
void PlatformThread::SetName(const std::string& name) {
  ThreadIdNameManager::GetInstance()->SetName(CurrentId(), name);
  tracked_objects::ThreadData::InitializeThreadContext(name);

#if !defined(OS_NACL)
  // On linux we can get the thread names to show up in the debugger by setting
  // the process name for the LWP.  We don't want to do this for the main
  // thread because that would rename the process, causing tools like killall
  // to stop working.
  if (PlatformThread::CurrentId() == getpid())
    return;

  // http://0pointer.de/blog/projects/name-your-threads.html
  // Set the name for the LWP (which gets truncated to 15 characters).
  // Note that glibc also has a 'pthread_setname_np' api, but it may not be
  // available everywhere and it's only benefit over using prctl directly is
  // that it can set the name of threads other than the current thread.
  int err = prctl(PR_SET_NAME, name.c_str());
  // We expect EPERM failures in sandboxed processes, just ignore those.
  if (err < 0 && errno != EPERM)
    DPLOG(ERROR) << "prctl(PR_SET_NAME)";
#endif  //  !defined(OS_NACL)
}

void InitThreading() {}

void InitOnThread() {}

void TerminateOnThread() {}

size_t GetDefaultThreadStackSize(const pthread_attr_t& attributes) {
#if !defined(THREAD_SANITIZER)
  return 0;
#else
  // ThreadSanitizer bloats the stack heavily. Evidence has been that the
  // default stack size isn't enough for some browser tests.
  return 2 * (1 << 23);  // 2 times 8192K (the default stack size on Linux).
#endif
}

}  // namespace base


text:
project_path: /web/_project.yaml
book_path: /web/ilt/pwa/_book.yaml

{# wf_updated_on: 2017-04-14 #}
{# wf_published_on: 2017-04-14 #}

# Introduction to Push Notifications {: .page-title }

With service workers, push notifications are now available on the web. This
video explains the Notifications API and the Push API, and how they are used to
implement push notifications in Progressive Web Apps.

{% setvar videoId "ggUY0Q4f5ok" %}
{% setvar slidesId "1vd6cFL0Vg3-ciDq2xpN0HxN_UowyKjJsTrCOdulkExM" %}

{% include "web/ilt/pwa/_slides.html" %}


text:
using System;

namespace Caliburn.Micro
{
    /// <summary>
    /// The event args for the Completed event of an <see cref="IResult"/>.
    /// </summary>
    public class ResultCompletionEventArgs : EventArgs
    {
        /// <summary>
        /// Gets or sets the error if one occurred.
        /// </summary>
        /// <value>The error.</value>
        public Exception Error;

        /// <summary>
        /// Gets or sets a value indicating whether the result was cancelled.
        /// </summary>
        /// <value><c>true</c> if cancelled; otherwise, <c>false</c>.</value>
        public bool WasCancelled;
    }
}


text:
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="Test_Hand.cs" company="">
//
// </copyright>
// <summary>
//   The test_ hand.
// </summary>
// --------------------------------------------------------------------------------------------------------------------

namespace Poker.Test
{
    using System.Collections.Generic;

    using Microsoft.VisualStudio.TestTools.UnitTesting;

    /// <summary>
    /// The test_ hand.
    /// </summary>
    [TestClass]
    public class Test_Hand
    {
        /// <summary>
        /// The test_ hand_ valid value.
        /// </summary>
        [TestMethod]
        public void Test_Hand_ValidValue()
        {
            IHand hand =
                new Hand(
                    new List<ICard>
                        {
                            new Card(CardFace.Ace, CardSuit.Clubs),
                            new Card(CardFace.Ace, CardSuit.Diamonds),
                            new Card(CardFace.King, CardSuit.Hearts),
                            new Card(CardFace.King, CardSuit.Spades),
                            new Card(CardFace.Seven, CardSuit.Diamonds)
                        });
            Assert.AreEqual("A♣ A♦ K♥ K♠ 7♦", hand.ToString(), "Not valid hand!" + hand);
        }
    }
}


text:
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="idkey30.xsl"?>
<doc>
  <side att="view">text-in-side<?s-pi side ?></side>
  <begin bat="top"><?a-pi some data?>

  text-in-begin
  <inner blat="blob">
    inner-text

    subtext
  </inner>
  text-in-begin2
  </begin>
</doc>


text:
namespace BookShop
{
    using System;
    using System.Linq;
    using BookShop.Data;
    using BookShop.Initializer;
    using BookShop.Models;
    using System.Globalization;

    public class StartUp
    {
        public static void Main()
        {
            using (var context = new BookShopContext())
            {
                // DbInitializer.ResetDatabase(context);

                // Console.WriteLine(GetBooksByAgeRestriction(context)); ;// 1. Age Restriction
                // Console.WriteLine(GetGoldenBooks(context)); // 2. Golden Books
                // Console.WriteLine(GetBooksByPrice(context)); ; // 3. Books by Price
                // Console.WriteLine(GetBooksNotRealeasedIn(context)); ; // 4. Not Released In
                // Console.WriteLine(GetBooksByCategory(context)); ; // 5. Book Titles by Category
                // Console.WriteLine(GetBooksReleasedBefore(context)); ; // 6. Released Before Date
                // Console.WriteLine(GetAuthorNamesEndingIn(context)); // 7. Author Search
                // Console.WriteLine(GetBookTitlesContaining(context)); // 8. Book Search
                // Console.WriteLine(GetBooksByAuthor(context)); // 9. Book Search by Author
                // Console.WriteLine(CountBooks(context)); // 10. Count Books
                // Console.WriteLine(CountCopiesByAuthor(context)); // 11. Total Book Copies
                // Console.WriteLine(GetTotalProfitByCategory(context)); // 12. Profit by Category
                // Console.WriteLine(GetMostRecentBooks(context)); // 13. Most Recent Books
                // Console.WriteLine(IncreasePrices(context)); // 14. Increase Prices
                Console.WriteLine(RemoveBooks(context)); // 15. Remove Books
            }
        }

        public static int RemoveBooks(BookShopContext context, int lessThanCopies = 4200)
        {
            var books = context.Books
                    .Where(b => b.Copies < lessThanCopies)
                    .ToArray();

            var removedBooks = books.Length;

            context.Books.RemoveRange(books);
            context.SaveChanges();

            return removedBooks;
        }

        public static int IncreasePrices(BookShopContext context, decimal increasement = 5, int yearTopBorder = 2010)
        {
            var books = context.Books
                .Where(b => b.ReleaseDate != null && b.ReleaseDate.Value.Year < yearTopBorder)
                .ToArray();

            foreach (var book in books)
            {
                book.Price += increasement;
            }

            return context.SaveChanges();
        }

        public static string GetMostRecentBooks(BookShopContext context)
            => "--" + string.Join($"{Environment.NewLine}--", context.Categories
                .Select(c => new
                {
                    Name = c.Name,
                    BookCount = c.CategoryBooks
                        .Select(cb => cb.Book)
                        .Count(),
                    TopThreeString = string.Join(Environment.NewLine, c.CategoryBooks
                        .Select(cb => cb.Book)
                        .OrderByDescending(b => b.ReleaseDate)
                        .Take(3)
                        .Select(b => b.ReleaseDate == null
                            ? $"{b.Title} ()"
                            : $"{b.Title} ({b.ReleaseDate.Value.Year})"))
                })
                // .OrderBy(c => c.BookCount) // Wrong Requirement - Judge wants sorting by Name
                .OrderBy(c => c.Name)
                .Select(c => $"{c.Name}{Environment.NewLine}{c.TopThreeString}"));

        public static string GetTotalProfitByCategory(BookShopContext context)
            => string.Join(Environment.NewLine, context.Categories
                .Select(c => new
                {
                    Name = c.Name,
                    TotalProffit = c.CategoryBooks
                        .Select(cb => cb.Book.Price * cb.Book.Copies)
                        .Sum()
                })
                .OrderByDescending(c => c.TotalProffit)
                .ThenBy(c => c.Name)
                .Select(c => $"{c.Name} ${c.TotalProffit:F2}"));

        public static string CountCopiesByAuthor(BookShopContext context)
            => string.Join(Environment.NewLine, context.Authors
                .Select(a => new
                {
                    Name = a.FirstName == null
                        ? a.LastName
                        : $"{a.FirstName} {a.LastName}",
                    Copies = a.Books
                        .Select(b => b.Copies)
                        .Sum()
                })
                .OrderByDescending(a => a.Copies)
                .Select(a => $"{a.Name} - {a.Copies}"));

        public static int CountBooks(BookShopContext context, int? lengthCheck = null)
        {
            if (lengthCheck == null)
            {
                lengthCheck = int.Parse(Console.ReadLine());
            }

            return context.Books
                .Where(b => b.Title.Length > lengthCheck)
                .Count();
        }

        public static string GetBooksByAuthor(BookShopContext context, string key = null)
        {
            if (key == null)
            {
                key = Console.ReadLine();
            }

            key = key.ToLower();

            return string.Join(Environment.NewLine, context.Books
                .Where(b => b.Author.LastName.ToLower().StartsWith(key))
                .OrderBy(b => b.BookId)
                .Select(b => b.Author.FirstName == null
                    ? $"{b.Title} ({b.Author.LastName})"
                    : $"{b.Title} ({b.Author.FirstName} {b.Author.LastName})"));
        }

        public static string GetBookTitlesContaining(BookShopContext context, string key = null)
        {
            if (key == null)
            {
                key = Console.ReadLine();
            }

            key = key.ToLower();

            return string.Join(Environment.NewLine, context.Books
                .Where(b => b.Title.ToLower().Contains(key))
                .Select(b => b.Title)
                .OrderBy(t => t));
        }

        public static string GetAuthorNamesEndingIn(BookShopContext context, string endingWith = null)
        {
            if (endingWith == null)
            {
                endingWith = Console.ReadLine();
            }

            return string.Join(Environment.NewLine, context.Authors
                .Where(a => a.FirstName != null && a.FirstName.EndsWith(endingWith))
                .Select(a => a.FirstName == null ? a.LastName : $"{a.FirstName} {a.LastName}")
                .OrderBy(n => n));
        }

        public static string GetBooksReleasedBefore(BookShopContext context, string date = null)
        {
            if (date == null)
            {
                date = Console.ReadLine();
            }

            var parsedDate = DateTime.ParseExact(date, "dd-MM-yyyy", CultureInfo.InvariantCulture);

            return string.Join(Environment.NewLine, context.Books
                .Where(b => b.ReleaseDate < parsedDate)
                .OrderByDescending(b => b.ReleaseDate)
                .Select(b => $"{b.Title} - {b.EditionType} - ${b.Price:F2}"));
        }

        public static string GetBooksByCategory(BookShopContext context, string input = null)
        {
            if (input == null)
            {
                input = Console.ReadLine();
            }

            var categories = input
                .ToLower()
                .Split(new [] { ' ', '\t', '\r', '\n' }, StringSplitOptions.RemoveEmptyEntries);

            return string.Join(Environment.NewLine, context.Books
                .Where(b => b.BookCategories
                    .Select(bc => bc.Category.Name.ToLower())
                    .Intersect(categories)
                    .Any())
                .Select(b => b.Title)
                .OrderBy(t => t));
        }

        public static string GetBooksNotRealeasedIn(BookShopContext context, int? year = null)
        {
            if (year == null)
            {
                year = int.Parse(Console.ReadLine());
            }

            return string.Join(Environment.NewLine, context.Books
                .Where(b => b.ReleaseDate != null && b.ReleaseDate.Value.Year != year)
                .OrderBy(b => b.BookId)
                .Select(b => b.Title));
        }

        public static string GetBooksByPrice(BookShopContext context)
            => string.Join(Environment.NewLine, context.Books
                .Where(b => b.Price > 40)
                .OrderByDescending(b => b.Price)
                .Select(b => $"{b.Title} - ${b.Price:F2}"));

        public static string GetGoldenBooks(BookShopContext context)
            => string.Join(Environment.NewLine, context.Books
                .Where(b => b.EditionType == EditionType.Gold && b.Copies < 5000)
                .OrderBy(b => b.BookId)
                .Select(b => b.Title));

        public static string GetBooksByAgeRestriction(BookShopContext context, string targetAgeGroup = null)
        {
            if (targetAgeGroup == null)
            {
                targetAgeGroup = Console.ReadLine();
            }

            return string.Join(Environment.NewLine, context.Books
                .Where(b => b.AgeRestriction.ToString().Equals(targetAgeGroup, StringComparison.OrdinalIgnoreCase))
                .Select(b => b.Title)
                .OrderBy(t => t));
        }
    }
}


text:
local ipairs, pairs, next, pcall, select = ipairs, pairs, next, pcall, select
local string, math, table = string, math, table
-- lib apis caching
local X = MY
local UI, GLOBAL, CONSTANT, wstring, lodash = X.UI, X.GLOBAL, X.CONSTANT, X.wstring, X.lodash
-------------------------------------------------------------------------------------------------------
local PLUGIN_NAME = 'MY_TeamTools'
local PLUGIN_ROOT = X.PACKET_INFO.ROOT .. PLUGIN_NAME
local MODULE_NAME = 'MY_TeamTools'
local _L = X.LoadLangPack(PLUGIN_ROOT .. '/lang/')
--------------------------------------------------------------------------
if not X.AssertVersion(MODULE_NAME, _L[MODULE_NAME], '^9.0.0') then
	return
end
--------------------------------------------------------------------------
local TI = {
	szYY = '',
	szNote = '',
}

local O = X.CreateUserSettingsModule('MY_TeamNotice', _L['Raid'], {
	bEnable = {
		ePathType = X.PATH_TYPE.ROLE,
		szLabel = _L['MY_TeamTools'],
		xSchema = X.Schema.Boolean,
		xDefaultValue = true,
	},
	nWidth = {
		ePathType = X.PATH_TYPE.ROLE,
		szLabel = _L['MY_TeamTools'],
		xSchema = X.Schema.Number,
		xDefaultValue = 320,
	},
	nHeight = {
		ePathType = X.PATH_TYPE.ROLE,
		szLabel = _L['MY_TeamTools'],
		xSchema = X.Schema.Number,
		xDefaultValue = 195,
	},
	anchor = {
		ePathType = X.PATH_TYPE.ROLE,
		szLabel = _L['MY_TeamTools'],
		xSchema = X.Schema.FrameAnchor,
		xDefaultValue = { s = 'CENTER', r = 'CENTER', x = 0, y = 0 },
	},
})

function TI.SaveList()
	X.SaveLUAData({'config/yy.jx3dat', X.PATH_TYPE.GLOBAL}, TI.tList, { indent = '\t', passphrase = false, crc = false })
end

function TI.GetList()
	if not TI.tList then
		TI.tList = X.LoadLUAData({'config/yy.jx3dat', X.PATH_TYPE.GLOBAL}, { passphrase = false }) or {}
	end
	return TI.tList
end

function TI.GetFrame()
	return Station.Lookup('Normal/MY_TeamNotice')
end

function TI.CreateFrame(a, b)
	if X.IsInZombieMap() then
		return
	end
	local ui = TI.GetFrame()
	if ui then
		ui = UI(ui)
		ui:Children('#YY'):Text(a, WNDEVENT_FIRETYPE.PREVENT)
		ui:Children('#Message'):Text(b, WNDEVENT_FIRETYPE.PREVENT)
	else
		local function FormatAllContentPos()
			if not ui then
				return
			end
			X.DelayCall('MY_TeamNotice#DragResize', 500, function()
				O.nWidth  = ui:Width()
				O.nHeight = ui:Height()
				O.anchor  = ui:Anchor()
			end)
			local W, H = select(3, ui:Size())
			ui:Fetch('YY'):Width(ui:Width() - 160)
			local uiBtn = ui:Fetch('Btn_YY')
			uiBtn:Left(W - uiBtn:Width() - 10)
			local uiBtns = ui:Fetch('WndBtn_RaidTools'):Add(ui:Fetch('WndBtn_GKP')):Add(ui:Fetch('WndBtn_TeamMon'))
			uiBtns:Top(H - uiBtns:Height() - 10)
			local uiMessage = ui:Fetch('Message')
			uiMessage:Size(W - 20, uiBtns:Top() - uiMessage:Top() - 10)
		end
		ui = UI.CreateFrame('MY_TeamNotice', {
			w = O.nWidth, h = O.nHeight,
			text = _L['Team Message'],
			anchor = O.anchor,
			simple = true, close = true, dragresize = true,
			minwidth = 320, minheight = 195,
			setting = function()
				X.ShowPanel()
				X.FocusPanel()
				X.SwitchTab('MY_TeamTools')
			end,
			ondragresize = FormatAllContentPos,
		})
		local x, y = 10, 5
		x = x + ui:Append('Text', { x = x, y = y - 3, text = GLOBAL.GAME_LANG == 'zhcn' and _L['YY:'] or _L['DC:'], font = 48 }):AutoWidth():Width() + 5
		x = x + ui:Append('WndAutocomplete', {
			name = 'YY',
			w = 160, h = 26, x = x, y = y,
			text = a, font = 48, color = { 128, 255, 0 },
			edittype = UI.EDIT_TYPE.NUMBER,
			onclick = function()
				if IsPopupMenuOpened() then
					UI(this):Autocomplete('close')
				elseif X.IsLeader() then
					UI(this):Autocomplete('search', '')
				end
			end,
			onchange = function(szText)
				if TI.szYY == szText then
					return
				end
				if X.IsLeader() then
					if not X.IsSafeLocked(SAFE_LOCK_EFFECT_TYPE.TALK) then
						TI.szYY = szText
						X.SendBgMsg(PLAYER_TALK_CHANNEL.RAID, 'TI', {'Edit', szText, ui:Children('#Message'):Text()})
						return
					end
					X.Systopmsg(_L['Please unlock talk lock first.'])
				end
				ui:Fetch('YY'):Text(TI.szYY, WNDEVENT_FIRETYPE.PREVENT)
			end,
			autocomplete = {
				{
					'option', 'beforeSearch', function(text)
						local source = {}
						if X.IsLeader() then
							TI.tList = TI.GetList()
							for k, v in pairs(TI.tList) do
								table.insert(source, k)
							end
							if #source == 1 and tostring(source[1]) == text then
								source = {}
							end
						end
						UI(this):Autocomplete('option', 'source', source)
					end,
				},
				{
					'option', 'beforeDelete', function(szOption)
						TI.tList[tonumber(szOption)] = nil
						TI.SaveList()
					end,
				},
			},
		}):Width() + 5
		y = y + ui:Append('WndButton', {
			name = 'Btn_YY',
			x = x, y = y, text = X.IsLeader()
				and (GLOBAL.GAME_LANG == 'zhcn' and _L['Paste YY'] or _L['Paste DC'])
				or (GLOBAL.GAME_LANG == 'zhcn' and _L['Copy YY'] or _L['Copy DC']),
			buttonstyle = 'FLAT',
			onclick = function()
				local yy = ui:Children('#YY'):Text()
				if X.IsLeader() then
					if X.IsSafeLocked(SAFE_LOCK_EFFECT_TYPE.TALK) then
						return X.Alert('TALK_LOCK', _L['Please unlock talk lock first.'])
					end
					if tonumber(yy) then
						TI.tList = TI.GetList()
						if not TI.tList[tonumber(yy)] then
							TI.tList[tonumber(yy)] = true
							TI.SaveList()
						end
					end
					if yy ~= '' then
						for i = 0, 2 do -- ·¢Èý´Î
							X.SendChat(PLAYER_TALK_CHANNEL.RAID, yy)
						end
					end
					local message = ui:Children('#Message'):Text():gsub('\n', ' ')
					if message ~= '' then
						X.SendChat(PLAYER_TALK_CHANNEL.RAID, message)
					end
				else
					SetDataToClip(yy)
					X.Topmsg(_L['Channel number has been copied to clipboard'])
				end
			end,
		}):Height() + 5
		ui:Append('WndEditBox', {
			name = 'Message',
			w = 300, h = 80, x = 10, y = y,
			multiline = true, limit = 512,
			text = b,
			onchange = function(szText)
				if TI.szNote == szText then
					return
				end
				if X.IsLeader() then
					if not X.IsSafeLocked(SAFE_LOCK_EFFECT_TYPE.TALK) then
						TI.szNote = szText
						X.SendBgMsg(PLAYER_TALK_CHANNEL.RAID, 'TI', {'Edit', ui:Children('#YY'):Text(), szText})
						return
					end
					X.Systopmsg(_L['Please unlock talk lock first.'])
				end
				ui:Fetch('Message'):Text(TI.szNote, WNDEVENT_FIRETYPE.PREVENT)
			end,
		})
		x, y = 11, 130
		local bTeamMon = MY_TeamMon_RR and GLOBAL.GAME_BRANCH ~= 'classic'
		local nBtnW = bTeamMon and 96 or 144
		x = x + ui:Append('WndButton', {
			name = 'WndBtn_RaidTools',
			x = x, y = y, w = nBtnW,
			text = _L['MY_TeamTools'],
			buttonstyle = 'FLAT',
			onclick = MY_TeamTools.Toggle,
		}):AutoWidth():Width() + 5
		x = x + ui:Append('WndButton', {
			name = 'WndBtn_GKP',
			x = x, y = y, w = nBtnW,
			text = _L['GKP Golden Team Record'],
			buttonstyle = 'FLAT',
			onclick = function()
				if MY_GKP then
					MY_GKP_MI.TogglePanel()
				else
					X.Alert(_L['You haven\'t had MY_GKP installed and loaded yet.'])
				end
			end,
		}):AutoWidth():Width() + 5
		if bTeamMon then
			x = x + ui:Append('WndButton', {
				name = 'WndBtn_TeamMon',
				x = x, y = y, w = nBtnW,
				text = _L['Import Data'],
				buttonstyle = 'FLAT',
				onclick = MY_TeamMon_RR.OpenPanel,
			}):AutoWidth():Width() + 5
		end
		FormatAllContentPos()
		-- ×¢²á'þ
		local frame = TI.GetFrame()
		frame.OnFrameKeyDown = nil -- esc close --> nil
		frame:RegisterEvent('PARTY_DISBAND')
		frame:RegisterEvent('PARTY_DELETE_MEMBER')
		frame:RegisterEvent('PARTY_ADD_MEMBER')
		frame:RegisterEvent('UI_SCALED')
		frame:RegisterEvent('TEAM_AUTHORITY_CHANGED')
		frame.OnEvent = function(szEvent)
			if szEvent == 'PARTY_DISBAND' then
				ui:Remove()
			elseif szEvent == 'PARTY_DELETE_MEMBER' then
				if arg1 == UI_GetClientPlayerID() then
					ui:Remove()
				end
			elseif szEvent == 'PARTY_ADD_MEMBER' then
				if X.IsLeader() then
					if X.IsSafeLocked(SAFE_LOCK_EFFECT_TYPE.TALK) then
						return
					end
					X.SendBgMsg(PLAYER_TALK_CHANNEL.RAID, 'TI', {'reply', arg1, TI.szYY, TI.szNote})
				end
			elseif szEvent == 'UI_SCALED' then
				ui:Anchor(O.anchor)
			elseif szEvent == 'TEAM_AUTHORITY_CHANGED' then
				ui:Fetch('Btn_YY'):Text(X.IsLeader() and _L['Paste YY'] or _L['Copy YY'])
			end
		end
		frame.OnFrameDragSetPosEnd = function()
			this:CorrectPos()
		end
		frame.OnFrameDragEnd = function()
			this:CorrectPos()
			O.anchor = GetFrameAnchor(this)
		end
		PlaySound(SOUND.UI_SOUND, g_sound.OpenFrame)
	end
	TI.szYY   = a or TI.szYY
	TI.szNote = b or TI.szNote
end

function TI.OpenFrame()
	if X.IsInZombieMap() then
		return X.Topmsg(_L['TeamNotice is disabled in this map.'])
	end
	O.bEnable = true
	if X.IsInParty() then
		if X.IsLeader() then
			TI.CreateFrame()
		else
			if X.IsSafeLocked(SAFE_LOCK_EFFECT_TYPE.TALK) then
				return X.Alert('TALK_LOCK', _L['Please unlock talk lock first.'])
			end
			X.SendBgMsg(PLAYER_TALK_CHANNEL.RAID, 'TI', {'ASK'})
			X.Sysmsg(_L['Asking..., If no response in longtime, team leader not enable plug-in.'])
		end
	end
end

X.RegisterEvent('PARTY_LEVEL_UP_RAID', 'TEAM_NOTICE', function()
	if X.IsInZombieMap() then
		return
	end
	if X.IsLeader() then
		X.Confirm(_L['Edit team info?'], function()
			O.bEnable = true
			TI.CreateFrame()
		end)
	end
end)
X.RegisterEvent('FIRST_LOADING_END', 'TEAM_NOTICE', function()
	if not O.bEnable then
		return
	end
	-- ²»´æÔÚ¶Ó³¤²»¶Ó³¤µÄÎÊÌâÁË
	if X.IsInParty() then
		X.SendBgMsg(PLAYER_TALK_CHANNEL.RAID, 'TI', {'ASK'}, true)
	end
end)
X.RegisterEvent('LOADING_END', 'TEAM_NOTICE', function()
	local frame = TI.GetFrame()
	if frame and X.IsInZombieMap() then
		Wnd.CloseWindow(frame)
		X.Topmsg(_L['TeamNotice is disabled in this map.'])
	end
end)

-- Í˶ÓʱÇå¿ÕÍŶӸæʾ
X.RegisterEvent({'PARTY_DISBAND', 'PARTY_DELETE_MEMBER'}, 'TEAM_NOTICE', function(e)
	if e == 'PARTY_DISBAND' or (e == 'PARTY_DELETE_MEMBER' and arg1 == UI_GetClientPlayerID()) then
		local frame = TI.GetFrame()
		if frame then
			Wnd.CloseWindow(frame)
		end
		TI.szYY = nil
		TI.szNote = nil
	end
end)

X.RegisterEvent('ON_BG_CHANNEL_MSG', 'LR_TeamNotice', function()
	if not O.bEnable then
		return
	end
	local szMsgID, nChannel, dwID, szName, aMsg, bSelf = arg0, arg1, arg2, arg3, arg4, arg2 == UI_GetClientPlayerID()
	if szMsgID ~= 'LR_TeamNotice' or bSelf then
		return
	end
	if not X.IsLeader(dwID) then
		return
	end
	local szCmd, szText = aMsg[1], aMsg[2]
	if szCmd == 'SEND' then
		TI.CreateFrame('', szText)
	end
end)

X.RegisterBgMsg('TI', function(_, data, nChannel, dwID, szName, bIsSelf)
	if not O.bEnable then
		return
	end
	if not bIsSelf then
		local me = GetClientPlayer()
		local team = GetClientTeam()
		if team then
			if data[1] == 'ASK' and X.IsLeader() then
				if TI.GetFrame() then
					X.SendBgMsg(PLAYER_TALK_CHANNEL.RAID, 'TI', {'reply', szName, TI.szYY, TI.szNote}, true)
				end
			else
				if not X.IsLeader(dwID) then
					return
				end
				if data[1] == 'Edit' then
					TI.CreateFrame(data[2], data[3])
				elseif data[1] == 'reply' and (tonumber(data[2]) == UI_GetClientPlayerID() or data[2] == me.szName) then
					TI.CreateFrame(data[3], data[4])
				end
			end
		end
	end
end)

X.RegisterAddonMenu(function()
	return {{
		szOption = _L['Team Message'],
		fnDisable = function()
			return not X.IsInParty()
		end,
		fnAction = TI.OpenFrame,
	}}
end)

-- Global exports
do
local settings = {
	name = 'MY_TeamNotice',
	exports = {
		{
			preset = 'UIEvent',
			fields = {
				'OpenFrame',
			},
			root = TI,
		},
		{
			fields = {
				'bEnable',
			},
			root = O,
		},
	},
	imports = {
		{
			fields = {
				'bEnable',
			},
			root = O,
		},
	},
}
MY_TeamNotice = X.CreateModule(settings)
end


text:
package execfakes

import (
	"sync"

	"github.com/concourse/concourse/atc/exec"
)

type FakePutDelegateFactory struct {
	PutDelegateStub        func(exec.RunState) exec.PutDelegate
	putDelegateMutex       sync.RWMutex
	putDelegateArgsForCall []struct {
		arg1 exec.RunState
	}
	putDelegateReturns struct {
		result1 exec.PutDelegate
	}
	putDelegateReturnsOnCall map[int]struct {
		result1 exec.PutDelegate
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *FakePutDelegateFactory) PutDelegate(arg1 exec.RunState) exec.PutDelegate {
	fake.putDelegateMutex.Lock()
	ret, specificReturn := fake.putDelegateReturnsOnCall[len(fake.putDelegateArgsForCall)]
	fake.putDelegateArgsForCall = append(fake.putDelegateArgsForCall, struct {
		arg1 exec.RunState
	}{arg1})
	stub := fake.PutDelegateStub
	fakeReturns := fake.putDelegateReturns
	fake.recordInvocation("PutDelegate", []interface{}{arg1})
	fake.putDelegateMutex.Unlock()
	if stub != nil {
		return stub(arg1)
	}
	if specificReturn {
		return ret.result1
	}
	return fakeReturns.result1
}

func (fake *FakePutDelegateFactory) PutDelegateCallCount() int {
	fake.putDelegateMutex.RLock()
	defer fake.putDelegateMutex.RUnlock()
	return len(fake.putDelegateArgsForCall)
}

func (fake *FakePutDelegateFactory) PutDelegateCalls(stub func(exec.RunState) exec.PutDelegate) {
	fake.putDelegateMutex.Lock()
	defer fake.putDelegateMutex.Unlock()
	fake.PutDelegateStub = stub
}

func (fake *FakePutDelegateFactory) PutDelegateArgsForCall(i int) exec.RunState {
	fake.putDelegateMutex.RLock()
	defer fake.putDelegateMutex.RUnlock()
	argsForCall := fake.putDelegateArgsForCall[i]
	return argsForCall.arg1
}

func (fake *FakePutDelegateFactory) PutDelegateReturns(result1 exec.PutDelegate) {
	fake.putDelegateMutex.Lock()
	defer fake.putDelegateMutex.Unlock()
	fake.PutDelegateStub = nil
	fake.putDelegateReturns = struct {
		result1 exec.PutDelegate
	}{result1}
}

func (fake *FakePutDelegateFactory) PutDelegateReturnsOnCall(i int, result1 exec.PutDelegate) {
	fake.putDelegateMutex.Lock()
	defer fake.putDelegateMutex.Unlock()
	fake.PutDelegateStub = nil
	if fake.putDelegateReturnsOnCall == nil {
		fake.putDelegateReturnsOnCall = make(map[int]struct {
			result1 exec.PutDelegate
		})
	}
	fake.putDelegateReturnsOnCall[i] = struct {
		result1 exec.PutDelegate
	}{result1}
}

func (fake *FakePutDelegateFactory) Invocations() map[string][][]interface{} {
	fake.invocationsMutex.RLock()
	defer fake.invocationsMutex.RUnlock()
	fake.putDelegateMutex.RLock()
	defer fake.putDelegateMutex.RUnlock()
	copiedInvocations := map[string][][]interface{}{}
	for key, value := range fake.invocations {
		copiedInvocations[key] = value
	}
	return copiedInvocations
}

func (fake *FakePutDelegateFactory) recordInvocation(key string, args []interface{}) {
	fake.invocationsMutex.Lock()
	defer fake.invocationsMutex.Unlock()
	if fake.invocations == nil {
		fake.invocations = map[string][][]interface{}{}
	}
	if fake.invocations[key] == nil {
		fake.invocations[key] = [][]interface{}{}
	}
	fake.invocations[key] = append(fake.invocations[key], args)
}

var _ exec.PutDelegateFactory = new(FakePutDelegateFactory)


text:
#ifndef PLASMA_CLIENT_H
#define PLASMA_CLIENT_H

#include "plasma.h"

typedef struct plasma_connection plasma_connection;

/**
 * This is used by the Plasma Client to send a request to the Plasma Store or
 * the Plasma Manager.
 *
 * @param conn The file descriptor to use to send the request.
 * @param type The type of request.
 * @param req The address of the request to send.
 * @return Void.
 */
void plasma_send_request(int fd, int type, plasma_request *req);

/**
 * Create a plasma request to be sent with a single object ID.
 *
 * @param object_id The object ID to include in the request.
 * @return The plasma request.
 */
plasma_request make_plasma_request(object_id object_id);

/**
 * Create a plasma request to be sent with multiple object ID. Caller must free
 * the returned plasma request pointer.
 *
 * @param num_object_ids The number of object IDs to include in the request.
 * @param object_ids The array of object IDs to include in the request. It must
 *        have length at least equal to num_object_ids.
 * @return A pointer to the newly created plasma request.
 */
plasma_request *make_plasma_multiple_request(int num_object_ids,
                                             object_id object_ids[]);

/**
 * Connect to the local plasma store and plasma manager. Return
 * the resulting connection.
 *
 * @param socket_name The name of the UNIX domain socket to use to connect to
 *        the Plasma Store.
 * @param manager_addr The IP address of the plasma manager to connect to. If
 *        this is NULL, then this function will not connect to a manager.
 * @param manager_port The port of the plasma manager to connect to. If
 *        manager_addr is NULL, then this argument is unused.
 * @return The object containing the connection state.
 */
plasma_connection *plasma_connect(const char *store_socket_name,
                                  const char *manager_addr,
                                  int manager_port);

/**
 * Disconnect from the local plasma instance, including the local store and
 * manager.
 *
 * @param conn The connection to the local plasma store and plasma manager.
 * @return Void.
 */
void plasma_disconnect(plasma_connection *conn);

/**
 * Try to connect to a possibly remote Plasma Manager.
 *
 * @param addr The IP address of the Plasma Manager to connect to.
 * @param port The port of the Plasma Manager to connect to.
 * @return The file descriptor to use to send messages to the
 *         Plasma Manager. If connection was unsuccessful, this
 *         value is -1.
 */
int plasma_manager_connect(const char *addr, int port);

/**
 * Create an object in the Plasma Store. Any metadata for this object must be
 * be passed in when the object is created.
 *
 * @param conn The object containing the connection state.
 * @param object_id The ID to use for the newly created object.
 * @param size The size in bytes of the space to be allocated for this object's
          data (this does not include space used for metadata).
 * @param metadata The object's metadata. If there is no metadata, this pointer
          should be NULL.
 * @param metadata_size The size in bytes of the metadata. If there is no
          metadata, this should be 0.
 * @param data The address of the newly created object will be written here.
 * @return Void.
 */
void plasma_create(plasma_connection *conn,
                   object_id object_id,
                   int64_t size,
                   uint8_t *metadata,
                   int64_t metadata_size,
                   uint8_t **data);

/**
 * Get an object from the Plasma Store. This function will block until the
 * object has been created and sealed in the Plasma Store.
 *
 * @param conn The object containing the connection state.
 * @param object_id The ID of the object to get.
 * @param size The size in bytes of the retrieved object will be written at this
          address.
 * @param data The address of the object will be written at this address.
 * @param metadata_size The size in bytes of the object's metadata will be
 *        written at this address.
 * @param metadata The address of the object's metadata will be written at this
 *        address.
 * @return Void.
 */
void plasma_get(plasma_connection *conn,
                object_id object_id,
                int64_t *size,
                uint8_t **data,
                int64_t *metadata_size,
                uint8_t **metadata);

/**
 * Tell Plasma that the client no longer needs the object. This should be called
 * after plasma_get when the client is done with the object. After this call,
 * the address returned by plasma_get is no longer valid. This should be called
 * once for each call to plasma_get (with the same object ID).
 *
 * @param conn The object containing the connection state.
 * @param object_id The ID of the object that is no longer needed.
 * @return Void.
 */
void plasma_release(plasma_connection *conn, object_id object_id);

/**
 * Check if the object store contains a particular object and the object has
 * been sealed. The result will be stored in has_object.
 *
 * @todo: We may want to indicate if the object has been created but not sealed.
 *
 * @param conn The object containing the connection state.
 * @param object_id The ID of the object whose presence we are checking.
 * @param has_object The function will write 1 at this address if the object is
 *        present and 0 if it is not present.
 * @return Void.
 */
void plasma_contains(plasma_connection *conn,
                     object_id object_id,
                     int *has_object);

/**
 * Seal an object in the object store. The object will be immutable after this
 * call.
 *
 * @param conn The object containing the connection state.
 * @param object_id The ID of the object to seal.
 * @return Void.
 */
void plasma_seal(plasma_connection *conn, object_id object_id);

/**
 * Delete an object from the object store. This currently assumes that the
 * object is present and has been sealed.
 *
 * @todo We may want to allow the deletion of objects that are not present or
 *       haven't been sealed.
 *
 * @param conn The object containing the connection state.
 * @param object_id The ID of the object to delete.
 * @return Void.
 */
void plasma_delete(plasma_connection *conn, object_id object_id);

/**
 * Fetch objects from remote plasma stores that have the
 * objects stored.
 *
 * @param manager A file descriptor for the socket connection
 *        to the local manager.
 * @param object_id_count The number of object IDs requested.
 * @param object_ids[] The vector of object IDs requested. Length must be at
 *        least num_object_ids.
 * @param is_fetched[] The vector in which to return the success
 *        of each object's fetch operation, in the same order as
 *        object_ids. Length must be at least num_object_ids.
 * @return Void.
 */
void plasma_fetch(plasma_connection *conn,
                  int num_object_ids,
                  object_id object_ids[],
                  int is_fetched[]);

/**
 * Subscribe to notifications when objects are sealed in the object store.
 * Whenever an object is sealed, a message will be written to the client socket
 * that is returned by this method.
 *
 * @param conn The object containing the connection state.
 * @return The file descriptor that the client should use to read notifications
           from the object store about sealed objects.
 */
int plasma_subscribe(plasma_connection *conn);

/**
 * Get the file descriptor for the socket connection to the plasma manager.
 *
 * @param conn The plasma connection.
 * @return The file descriptor for the manager connection. If there is no
 *         connection to the manager, this is -1.
 */
int get_manager_fd(plasma_connection *conn);

#endif


text:
const serverMap = require('../lib/serverFileOp').serverMap;
const serverYaml = require('../lib/serverFileOp').serverYaml;

exports.getwhois = function(req,res) {
    // res.reply('afafsafa');
    res.send('haha');
}

exports.getWhoisAllServer = function(req,res) {
    let result=[];
    for(let key in serverYaml) {
        result.push({name:key,address:serverYaml[key]});
    }
    console.log(result);
    res.reply({
        data:result
    });
}


text:
* { margin: 0; padding: 0; outline: none; }

body { font: 16px/22px Arial, sans-serif; color: #D6D6CE; }

h1, h2, h3, h4, h5, p, pre, ul, ol, dl, address, caption, table, form, hr { margin-bottom: 22px; }

ul ul, ul ol, ul dl, ol ol, ol ul, ol dl, dl dl, dl ul, dl ol { margin-bottom: 0; }

ul, ol, dd { margin-left: 1.615em; }

dd ul, dd ol { margin-left: 0; }

blockquote { padding: 0 1.615em; }

h1 { font-size: 42px; line-height: 44px;}

h2 { font-size: 32px; line-height: 32px;}

h3 { font-size: 26px; line-height: 32px;}

h4 { font-size: 20px; line-height: 22px;}

article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section { display: block; }

nav ul { list-style: none; }

a img { border: none; }

body { background: #D6D6CE; cursor: default; }

h1, h3, h4, h5, h6 { font-family: Garamond, Arial, sans-serif; }

h1, h3, h4, h5, h6 { color: white; }

h1 { font-size: 50px; line-height: 55px; font-weight: 500; font-family:'BebasNeue', Garamond}

h2 { font-size: 44px; line-height: 44px; font-family: 'BebasNeue', Garamond, Serif;font-weight: 900; color:#000000; text-rendering:optimizelegibility; text-align: right;}

h3 { font-size: 40px; line-height: 32px; font-weight: 900; text-rendering: optimizelegibility; padding-top:10px}

h4 { font-size: 32px; line-height: 32px; font-weight: 900; 	text-rendering: optimizelegibility; padding-top:10px}

h5 { font-size: 28px; line-height: 30px; font-family: 'BebasNeue', Garamond; font-weight: 900; text-rendering:optimizelegibility; color:#000000;}

h6 { font-size: 20px; line-height: 20px; font-family: 'BebasNeue', Arial; font-weight: 900; text-rendering:optimizelegibility; color:#000000;}

sup { font-size: 11px; line-height: 11px; }

a { color: #606060; text-decoration: none; }
a:hover { color: black; }

.summary { color: #00c2dc; }

.more { display: block; margin-top: 22px; }

.wrapper { width: 928px; margin-left: auto; margin-right: auto; *zoom: 1; position: relative; }
.wrapper:after { content: "\0020"; display: block; height: 0; clear: both; overflow: hidden; visibility: hidden; }

#main-header { padding-top: 32px; background: #D6D6CE; position: relative; z-index: 40000; }
#main-header .wrapper { height: 111px; overflow: hidden; }

#logo { display: inline; float: left; margin-top: -5px; }

#linkbar { display: inline; float: right; margin-top:47px; margin-right: 0px; }
#linkbar ul { display: inline; margin: 0; }
#linkbar ul li { display: inline; }
#linkbar ul a { font: bold 13px/22px Arial, sans-serif; display: block; float: left; padding: 22px; color: #606060}
#linkbar ul a:hover { background-color: #7d6a55; border-bottom: 3px solid black; padding-bottom: 17px; color: #000000}
#linkbar ul .current a { color: black; border-bottom: 5px solid #00c2dc; padding-bottom: 18px;}

#content { overflow: hidden; *zoom: 1; background: #d6d6ce; }
.boardperson{-moz-border-radius: 15px; border-radius: 15px; margin-left:100px; margin-bottom: 10px;}
.facebook{margin-left: auto; margin-right: auto; vertical-align:middle; padding-top:40px; padding-bottom:33px}
.plusone{position:relative; top:20px; right:20px}

#page-footer { border-top: 1px solid #d7d7d7; background: #d6d6ce; position: relative; z-index: 40001; color: #000000; font-size: 13px; line-height: 18px; padding-bottom: 50px; }
#page-footer .wrapper { padding: 0 10px; background: url('../images/dotline.png?1294241747') center top repeat-y; }
#page-footer .block { display: inline; float: left; margin-left: 20px; width: 256px; position: relative; margin-left: -10px; padding-top: 0px; padding-left: 10px; padding-right: 50px; }
#page-footer .block2 { display: inline; float: left; margin-left: 20px; width: 256px; position: relative; margin-left: -10px; padding-top: 0px; padding-left: 10px; padding-right: 0px; }
#page-footer .rightblock{display: inline; float: left; margin-left: 20px; width: 562px; position: relative; margin-left: 10px; padding-left: 20px; padding-right: 20px; }
#page-footer .rightblock .awardsplace{font-size:20px; font-family:'BebasNeue', Arial, sans-serif; font-weight:bold; padding-bottom:12px}
#page-footer .rightblock .awardstype{font-size: 12px; font-family: Arial, sans-serif; padding-bottom:4px}
#page-footer .rightblock .last{padding-bottom: 22px;}
#page-footer .rightblock .first{padding-bottom: 10px;}
#page-footer .rightblock ul.a:hover{font-color:#000}
#page-footer .rightblock ul{list-style: none; border:0; margin:0}
#page-footer .cntr { margin-left: 10px; margin-right: 20px; }
#page-footer .hidden { display: none; }
#page-footer .phone { white-space: nowrap; }
#page-footer .more { padding-left: 18px; background: url('../images/point-arrow.png?1294241747') left -74px no-repeat; }
#page-footer input { width: auto; }
#page-footer #newsletter-block p { margin-bottom: 11px; }
#page-footer #newsletter-block #id_email { width: 100px; border-bottom-color: #a8a8a8; font: normal 13px/22px Arial, sans-serif; }
#page-footer #newsletter-block ul { display: inline; margin: 0; }
#page-footer #newsletter-block li { display: -moz-inline-box; -moz-box-orient: vertical; display: inline-block; vertical-align: middle; *vertical-align: auto; }
#page-footer #newsletter-block li { *display: inline; }

.list-wrapper {width: 9000px; position: relative; margin: 0; list-style: none; overflow: hidden; *zoom: 1;}
.list-wrapper .list-item { float: left; display: inline !important;}

#home #content, #home #quotes, #home #projects { height: 462px; overflow: hidden; }
#home #content { position: relative; }
#home #main-nav { display: none; }

#quotes-wrapper { background: #800000; padding: 0px;}

#quotes { position: relative; margin: 0 0px; padding: 0 0; margin-top: -419px; }
#quotes .quote { width: 958px; margin-right: 316px; }
#quotes .quote h1 { font: 900 65px/70px Garamond, sans-serif; margin-top: 60px; }
#quotes .quote h2 { font: bold 22px/22px Arial, sans-serif; color: white; }
#quotes .quote a { font: bold 14px/22px Arial, sans-serif; color: black; padding-right: 18px; background: url('../images/point-arrow.png?1294241747') right -32px no-repeat; }
#quotes .quote a:hover { color: white; background-position: right 8px; }

#quotes #news {width:259px; height:600px}
#quotes #picture {width: 481px; float:right}
#quotes .block { display: inline; float: left; margin-left: 0px; width: 256px; position: relative; margin-left: 0px; padding-top:0px; padding-left: 0px; padding-right: 0px; }
#quotes .cntr { margin-left: 0px; margin-right: 0px; }

#projects { margin-top: 0; margin-bottom: 0; position: relative; }
#projects .title { font: bold 14px/22px Arial, sans-serif; margin: 44px 0 22px 10px; }

.stripe-nav {repeat-y; position: absolute; bottom: 0; left: 0; margin: 0; z-index: 100; }
.stripe-nav ul { overflow: hidden; *zoom: 1; margin: 0; }
.stripe-nav li { display: inline; margin: 7px; padding-left: 0;}
.stripe-nav a { display: inline; float: left; margin-left: 0px; width: 136px; height: 44px; margin-left: 0px; overflow: visible; text-align: center;  background-color: #d6d6ce;}
.stripe-nav a.hover { background-color: #000000; }
.stripe-nav .inactive a { cursor: default; background-color: #800000 !important; }

#quotes-nav a:hover { background: #7d6a55;}
#quotes-nav .previous-button a { background-position: 10px -608px; }
#quotes-nav .previous-button a:hover { background-position: 10px -608px; }
#quotes-nav .next-button a { background-position: 286px -519px; }
#quotes-nav .next-button a:hover { background-position: 286px -519px;}
#quotes-nav .previous-button.inactive a { background-position: 10px -788px; }
#quotes-nav .next-button.inactive a { background-position: 286px -699px; }

#about-us #content article h1 { margin-top: 88px; margin-bottom: 66px; }
#about-us #content article h2 { margin-top: 66px; margin-bottom: 44px; }
#about-us #content article p, #about-us #content article ol { margin-left: 158px !important; }
#about-us #our-process { lisst-style: none; background-color: #f5f5f5; border: 1px dotted #e0e0e0; border-left: none; border-right: none; margin: 38px -20px; font-size: 15px; color: black; overflow: hidden; *zoom: 1; white-space: nowrap; text-align: center; }
#about-us #our-process li { display: inline; padding: 0 17px; color: #404040; font-style: italic; line-height: 132px; }
#about-us #our-process span { color: #00c2dc; font: 900 28px/22px Arial, sans-serif; }
#about-us .footnote { font: normal 13px/20px Arial, sans-serif; color: #a8a8a8; border-top: 1px dotted #a8a8a8; padding-top: 11px; margin: 66px 0 88px 0; margin-right: 474px; }
#about-us .footnote li { margin-right: -316px; }

#contact hgroup { margin-top: 88px; margin-bottom: 66px; }
#contact hgroup h1 { margin-bottom: 0; }
#contact hgroup h2 { margin-top: 22px; font: normal 25px/33px Arial, sans-serif; }
#contact #contact-details { display: inline; float: left; margin-left: 20px; width: 296px; margin-left: 0; }
#contact #contact-details address { font-style: normal; }
#contact #contact-details dl { display: inline; }
#contact #contact-details dt { display: inline; float: left; margin-left: 20px; width: 59px; margin-left: 0; color: black; }
#contact #contact-details dd { display: inline; float: left; margin-left: 20px; width: 197px; padding-left: 20px; }
#contact #contact-details .address { margin-top: 22px; }
#contact #contact-details a { color: #a8a8a8; text-decoration: none; }
#contact #contact-details a:hover { color: black; text-decoration: underline; }
#contact #map { display: inline; float: left; margin-left: 20px; width: 612px; }
#contact #contact-form { height: 197px; overflow: hidden; display: inline; float: left; margin-left: 20px; width: 928px; margin-left: 0; border-top: 1px dotted #a8a8a8; margin-top: 44px; padding: 44px 0; }
#contact #message { display: inline; float: left; margin-left: 20px; width: 454px; margin-left: 0; margin-top: -6px; }
#contact #message .field { margin: 0; }
#contact #details { display: inline; float: left; margin-left: 20px; width: 345px; }
#contact #submit input { display: inline; float: left; margin-left: 20px; width: 89px; background: #333333; font-size: 13px; color: #e0e0e0; cursor: pointer; padding-top: 93px; padding-bottom: 26px; *height: 121px; }
#contact #submit input:hover { background: black; }
#contact .notes { display: inline; float: left; margin-left: 20px; width: 454px; margin-left: 0; font: normal 13px/20px Arial, sans-serif; color: #a8a8a8; clear: left; }
#contact #contact-form .form-errors { display: inline; float: left; margin-left: 20px; width: 454px; font: bold 13px/22px Arial, sans-serif; color: #fd3d3d; }
#contact #contact-form .form-errors ul { list-style: none; margin: 0; }
#contact #contact-form .message { font: normal 18px/22px Arial, sans-serif; color: #00c2dc; }


text:
package com.phloc.commons.aggregate;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.fail;

import org.junit.Test;

/**
 * Test class for class {@link AggregatorFactoryNewInstance}.
 *
 * @author Philip Helger
 */
public final class AggregatorFactoryNewInstanceTest
{
  @Test
  public void testAll ()
  {
    final AggregatorFactoryNewInstance <String, String> a1 = new AggregatorFactoryNewInstance <String, String> (AggregatorUseFirst.class);
    final AggregatorFactoryNewInstance <String, String> a21 = new AggregatorFactoryNewInstance <String, String> (AggregatorUseFirst.class);
    final AggregatorFactoryNewInstance <String, String> a22 = new AggregatorFactoryNewInstance <String, String> (AggregatorUseLast.class);
    assertEquals (a1, a1);
    assertEquals (a1, a21);
    assertFalse (a1.equals (null));
    assertFalse (a1.equals ("any other"));
    assertFalse (a1.equals (a22));
    assertEquals (a1.hashCode (), a1.hashCode ());
    assertEquals (a1.hashCode (), a21.hashCode ());
    assertFalse (a1.hashCode () == 0);
    assertFalse (a1.hashCode () == "any other".hashCode ());
    assertFalse (a1.hashCode () == a22.hashCode ());
    assertNotNull (a1.toString ());
    assertFalse (a1.toString ().equals (a21.toString ()));
    assertFalse (a1.create () == a1.create ());
    assertEquals (a1.create (), a1.create ());
    assertEquals (a1.create (), a21.create ());
    assertFalse (a1.create ().equals (a22.create ()));

    try
    {
      // null not allowed
      new AggregatorFactoryNewInstance <String, String> (null);
      fail ();
    }
    catch (final NullPointerException ex)
    {}

    try
    {
      // non-instancable class
      new AggregatorFactoryNewInstance <String, String> (IAggregator.class);
      fail ();
    }
    catch (final IllegalArgumentException ex)
    {}
  }
}


text:
=begin
	awscli.rb

	Copyright 2013 Erin Wilkins

	Licensed under the Apache License, Version 2.0 (the "License");
	you may not use this file except in compliance with the License.
	You may obtain a copy of the License at

	 http://www.apache.org/licenses/LICENSE-2.0

	Unless required by applicable law or agreed to in writing, software
	distributed under the License is distributed on an "AS IS" BASIS,
	WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
	See the License for the specific language governing permissions and
	limitations under the License.
=end

require 'json'

=begin rdoc
	A simple collection of utility methods to ease the running of the Amazon Web
	Services command-line utility.
=end
module AWSCLI
	NAME = 'aws' #:nodoc:
	REQUIRED = '1.1.0' #:nodoc:
	CONFIG = 'AWS_CONFIG_FILE' #:nodoc:

=begin rdoc
	Generic exception class.
=end
	class AWSCLIError < StandardError
	end

=begin rdoc
	Determines whether the AWS command-line utility is available. Returns +true+
	or +false+.
=end
	def AWSCLI.available?
		return false unless `whereis #{NAME}` != '' or `which #{NAME}` != ''
		return false unless ENV.key?(CONFIG)
		return true
	end

=begin rdoc
	Returns the current version of the AWS command-line utility. Returns +nil+ if
	the utility is not available.
=end
	def AWSCLI.version
		return nil unless AWSCLI.available?

		text = `#{NAME} --version 2>&1`
		return text.gsub(/^aws-cli\/(\d+\.\d+\.\d+).*$/, '\1')
	end

=begin rdoc
	Determines if the prerequisites have been met to run the AWS command-line
	utility. Returns +true+ or +false+.
=end
	def AWSCLI.prereqs?
		return false unless AWSCLI.available?

		ver = AWSCLI.version
		return false if ver == nil
		has = ver.split('.')
		needs = REQUIRED.split('.')
		has.each_index do |i|
			return true if i >= needs.length
			return true if has[i].to_i > needs[i].to_i
			return false if has[i].to_i < need[i].to_i
		end
		return has.length >= needs.length
	end

=begin rdoc
	Runs an AWS command. The method will parse the resulting JSON, and return it
	as a corresponding +Hash+ or +Array+. An +AWSCLIError+ exception will be
	raised if the command fails, or if the prerequisites for the utility have not
	been met.

	==== Attributes

	* +cmd+ - The command to run. This should *not* include the leading +aws+ literal.
=end
	def AWSCLI.run(cmd)
		raise AWSCLIError, 'AWS command line utility prerequisites have not been met' unless AWSCLI.prereqs?

		text = `#{NAME} #{cmd} 2&1`.strip
		json = Hash.new
		return json if text == ''

		begin
			json = JSON.parse(text)
		rescue JSON::ParserError
			raise AWSCLIError, "AWS command failed. Command was:\n#{cmd}\n\nError was:\n#{text}"
		end
		return json
	end
end


text:
'use strict';

Object.defineProperty(exports, "__esModule", {
    value: true
});

var _react = require('react');

var _react2 = _interopRequireDefault(_react);

var _reactRouter = require('react-router');

var _FlatButton = require('material-ui/FlatButton');

var _FlatButton2 = _interopRequireDefault(_FlatButton);

var _delete = require('material-ui/svg-icons/action/delete');

var _delete2 = _interopRequireDefault(_delete);

var _linkToRecord = require('../../util/linkToRecord');

var _linkToRecord2 = _interopRequireDefault(_linkToRecord);

var _translate = require('../../i18n/translate');

var _translate2 = _interopRequireDefault(_translate);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var DeleteButton = function DeleteButton(_ref) {
    var _ref$basePath = _ref.basePath,
        basePath = _ref$basePath === undefined ? '' : _ref$basePath,
        _ref$label = _ref.label,
        label = _ref$label === undefined ? 'aor.action.delete' : _ref$label,
        _ref$record = _ref.record,
        record = _ref$record === undefined ? {} : _ref$record,
        translate = _ref.translate;
    return _react2.default.createElement(_FlatButton2.default, {
        secondary: true,
        label: label && translate(label),
        icon: _react2.default.createElement(_delete2.default, null),
        containerElement: _react2.default.createElement(_reactRouter.Link, { to: (0, _linkToRecord2.default)(basePath, record.id) + '/delete' }),
        style: { overflow: 'inherit' }
    });
};

DeleteButton.propTypes = {
    basePath: _react.PropTypes.string,
    label: _react.PropTypes.string,
    record: _react.PropTypes.object,
    translate: _react.PropTypes.func.isRequired
};

exports.default = (0, _translate2.default)(DeleteButton);
module.exports = exports['default'];


text:
require 'test_helper'

class CtAngularCookiesRailsTest < ActiveSupport::TestCase
  test "truth" do
    assert_kind_of Module, CtAngularCookiesRails
  end
end


text:
use warnings;
use strict;

use IO::Socket::INET;

use FindBin;

@ARGV == 1 or @ARGV == 2
    or die "Usage: $FindBin::Script HOST:PORT [COUNT]\n";

# Note that it's better to run the test over the wire, because for
# localhost the task may become CPU bound.
my $addr = $ARGV[0];
my $count = $ARGV[1] || 10_000;

my $sock = IO::Socket::INET->new(PeerAddr => $addr,
                                 Timeout  => 3);
die "$!\n" unless $sock;

# By running 'noreply' test first we also ensure there are no reply
# packets left in the network.
foreach my $noreply (1, 0) {
    use Time::HiRes qw(gettimeofday tv_interval);

    print "'noreply' is ", $noreply ? "enabled" : "disabled", ":\n";
    my $param = $noreply ? 'noreply' : '';
    my $start = [gettimeofday];
    foreach (1 .. $count) {
        print $sock "add foo 0 0 1 $param\r\n1\r\n";
        scalar<$sock> unless $noreply;
        print $sock "set foo 0 0 1 $param\r\n1\r\n";
        scalar<$sock> unless $noreply;
        print $sock "replace foo 0 0 1 $param\r\n1\r\n";
        scalar<$sock> unless $noreply;
        print $sock "append foo 0 0 1 $param\r\n1\r\n";
        scalar<$sock> unless $noreply;
        print $sock "prepend foo 0 0 1 $param\r\n1\r\n";
        scalar<$sock> unless $noreply;
        print $sock "incr foo 1 $param\r\n";
        scalar<$sock> unless $noreply;
        print $sock "decr foo 1 $param\r\n";
        scalar<$sock> unless $noreply;
        print $sock "delete foo $param\r\n";
        scalar<$sock> unless $noreply;
    }
    my $end = [gettimeofday];
    printf("update commands: %.2f secs\n\n", tv_interval($start, $end));
}


text:
<?php
//about_view.php controller

class associatedbusiness extends CI_Controller {
	// constructor used for needed initialization
	public function __construct() {
		parent::__construct();
		$this->load->helper(array('url', 'html'));
		$this->load->library('session');
	}
	function index() {
		$this->load->view('associatedbusiness_view');
	}
}
?>


text:
package com.hazelcast.map.impl.query;

import com.hazelcast.map.impl.MapDataSerializerHook;
import com.hazelcast.map.impl.operation.MapOperation;
import com.hazelcast.nio.ObjectDataInput;
import com.hazelcast.nio.ObjectDataOutput;
import com.hazelcast.query.impl.Indexes;
import com.hazelcast.spi.impl.operationservice.PartitionAwareOperation;
import com.hazelcast.spi.impl.operationservice.ReadonlyOperation;

import java.io.IOException;

public class QueryPartitionOperation extends MapOperation
        implements PartitionAwareOperation, ReadonlyOperation {

    private Query query;
    private Result result;

    public QueryPartitionOperation() {
    }

    public QueryPartitionOperation(Query query) {
        super(query.getMapName());
        this.query = query;
    }

    @Override
    protected void runInternal() {
        QueryRunner queryRunner = mapServiceContext.getMapQueryRunner(getName());
        result = queryRunner.runPartitionIndexOrPartitionScanQueryOnGivenOwnedPartition(query, getPartitionId());

        // we have to increment query count here manually since we are not even
        // trying to use indexes
        Indexes indexes = mapServiceContext.getMapContainer(getName()).getIndexes();
        if (indexes != null) {
            indexes.getIndexesStats().incrementQueryCount();
        }
    }

    @Override
    public Object getResponse() {
        return result;
    }

    @Override
    protected void writeInternal(ObjectDataOutput out) throws IOException {
        super.writeInternal(out);
        out.writeObject(query);
    }

    @Override
    protected void readInternal(ObjectDataInput in) throws IOException {
        super.readInternal(in);
        query = in.readObject();
    }

    @Override
    public int getClassId() {
        return MapDataSerializerHook.QUERY_PARTITION;
    }
}


text:
{% extends 'base.html' %}
{% load compress %}
{% block content %}

New Member

Compellingly reintermediate premier materials for client-centered markets.for client-centered markets.

        <form id = 'id_form_append'>

                    Email Address
                    <input name = 'email' type="text" class='input'>

                    Member Designation
                    <select name = 'designation' type="text" class='input'>
                        <option>UX</option>
                        <option>Front end Developer</option>
                    </select>

            {% csrf_token %}
        </form>

        <form id = 'id_form_description'>

                Description
                <textarea id = 'id_textarea_description' name = 'description' class="textarea"></textarea>

            {% csrf_token %}
        </form>

            <button id = 'id_button_create_member'>create memeber</button>

If users are already registered on pietrack, they will be added automatically. Otherwise they will receive an invitation.

    {% endblock %}
    {% block extra_js %}

    {% endblock %}