text:
Requirements:

* Google Analytics (GA) account
* Registered website (property) on GA
* Google developers console account

## Account setup

### Google developers console

We'll start creating a developers console account. This account is used to communicate with the Google APIs, and stores all credentials. We'll need these credentials in our app. You can skip this step if you already have an existing account set up.

Go to [http://cloud.google.com/console](http://cloud.google.com/console) and log in with a Google account. You can use an existing account or create a new one especially for your app. Start by creating a new project. Once the project is created, you'll have to enable access for the Analytics API. Go to the APIs & Auth section, and select the APIs tab. Search the list for the Analytics API, and enable it by pressing the button on the right.

Now go to the Credentials tab in the APIs & Auth section. You'll have to create both a client ID and an API key. Start with the client ID, select "web application" and press create. We'll add an authorized redirect URI later. Now create a new key and choose "browser key". Leave the whitelist blank and press "create". Be sure to keep the console open for a while.

Google is often working on it's cloud admin section, recently we have been getting 401 errors complaining the application name was empty. for some reason under "Consent Screen" the application name was indeed empty. Fill it in and you are good to go!

### Google analytics

Next up is a Google Analytics (GA) account. You can use the same account as used in the developers console, create a new one, or use an existing one. If you've already got a GA account and a web property set up, you can skip this step.

In GA, set up a new property: go to the admin section, open the dropdown in the "property" column and create a new one. After filling in all the required fields, press the "get tracking ID" button. You'll see a code snippet with some javascript, this has to be copied into the section of your app.

## Website setup

### Starting from a clean install

If you're starting a new project with the Kunstmaan bundles, everything is already in place if you've followed the [Getting Started guide](http://bundles.kunstmaan.be/getting-started), and you can skip this step.

### Update an existing website

Add following parameters to `app/config/parameters.yml.dist`

    google.api.client_id: ''
    google.api.client_secret: ''
    google.api.dev_key: ''

Add the dashboard bundle to `composer.json`

    "require": {
	...
	"kunstmaan/dashboard-bundle": "~3.0",
	...
    }

Add the bundle in `app/AppKernel.php`

	$bundles = array(
	    ...
	    new Kunstmaan\DashboardBundle\KunstmaanDashboardBundle(),
	    ...
	);

Add bundle routing in `app/config/routing.yml`

    kunstmaan_dashboard:
	resource: "@KunstmaanDashboardBundle/Resources/config/routing.yml"
	prefix:   /{_locale}/
	requirements:
	    _locale: %requiredlocales%

Change dashboard route in `app/config/config.yml`

    kunstmaan_admin:
	dashboard_route: 'kunstmaan_dashboard'

Update composer

    composer update

Update the database, use either a migration or force a schema update

    app/console doctrine:migrations:diff && app/console doctrine:migrations:migrate
    app/console doctrine:schema:update --force

## App setup

Navigate to the backend of your app. ( /app_dev.php/en/admin/ or something familiar). Log in (admin-admin or another account). You'll see a short summary on how to set up the console credentials, search for the redirect URI between brackets in step 1. You'll have to insert it into the developers console, so go back there, and edit the settings of the client ID you created in the first step. In the section "Authorized redirect URI", you can paste this link. (...../admin/dashboard/widget/googleanalytics/setToken/). Note that you can add multiple redirect URIs if you're using the same account for multiple apps, by just entering a new line for each.

Now it's time to configure the parameters.yml file in app/config/parameters.yml. You'll see three parameters with empty values:

* **google.api.client_id: ''** The client ID from the OAuth 2.0 Credentials in the Google Developers console.
* **google.api.client_secret: ''** The client secret from the OAuth 2.0 Credentials in the Google Developers console.
* **google.api.dev_key: ''** The API key from the public API Credentials in the Google Developers console.
After you've entered these credentials, save the parameters.yml file, and refresh the admin page in the backend. You can now connect your GA account.

## Connecting to Google Analytics

### Granting permission

We'll need a token from Google, which grants access to your GA data. After pressing the connect button, you'll be redirected to a Google page, asking you to log in (if you're not logged in yet), and accept the request for permission to view your analytics data. Note that you should use the account which you used in GA. This is probably the same though as your developers console account.

After pressing "accept', you'll be redirected again to the admin backend.

### First time collecting the data

On the next page, you'll be asked to select the website you want to track and which profile on the next one. Note that loading all the available websites can take a while, so just be patient when "stuck" on the previous screen, it will load after a while. After you've saved these settings, the dashboard will be loaded. However, it still has no data in it. Just press the update button to update your data.

You can also load the data from the console with the command

    app/console kuma:dashboard:collect

You can always update the data yourself this way, but it's easier to configure a cronjob to do this every 30 minutes, or another interval.


text:
package expressions

import (
	"strconv"
	"strings"
	"time"

	"github.com/juju/errors"
	"github.com/ngaut/log"
	"github.com/pingcap/tidb/context"
	"github.com/pingcap/tidb/expression"
	"github.com/pingcap/tidb/model"
	mysql "github.com/pingcap/tidb/mysqldef"
	"github.com/pingcap/tidb/parser/opcode"
	"github.com/pingcap/tidb/sessionctx/variable"
	"github.com/pingcap/tidb/util/types"
)

const (
	// ExprEvalFn is the key saving Call expression.
	ExprEvalFn = "$fn"
	// ExprEvalArgCtx is the key saving Context for a Call expression.
	ExprEvalArgCtx = "$ctx"
	// ExprAggDone is the key indicating that aggregate function is done.
	ExprAggDone = "$aggDone"
	// ExprEvalArgAggEmpty is the key to evaluate the aggregate function for empty table.
	ExprEvalArgAggEmpty = "$agg0"
	// ExprEvalDefaultName is the key saving default column name for Default expression.
	ExprEvalDefaultName = "$defaultName"
	// ExprEvalIdentFunc is the key saving a function to retrieve value for identifier name.
	ExprEvalIdentFunc = "$identFunc"
	// ExprEvalPositionFunc is the key saving a Position expresion.
	ExprEvalPositionFunc = "$positionFunc"
	// ExprAggDistinct is the key saving a distinct aggregate.
	ExprAggDistinct = "$aggDistinct"
	// ExprEvalValuesFunc is the key saving a function to retrieve value for column name.
	ExprEvalValuesFunc = "$valuesFunc"
)

var (
	// CurrentTimestamp is the keyword getting default value for datetime and timestamp type.
	CurrentTimestamp = "CURRENT_TIMESTAMP"
	// CurrentTimeExpr is the expression retireving default value for datetime and timestamp type.
	CurrentTimeExpr = &Ident{model.NewCIStr(CurrentTimestamp)}
	// ZeroTimestamp shows the zero datetime and timestamp.
	ZeroTimestamp = "0000-00-00 00:00:00"
)

var (
	errDivByZero    = errors.New("division by zero")
	errDefaultValue = errors.New("invalid default value")
)

// TypeStar is the type for *
type TypeStar string

// Expr removes parenthese expression, e.g, (expr) -> expr.
func Expr(v interface{}) expression.Expression {
	e := v.(expression.Expression)
	for {
		x, ok := e.(*PExpr)
		if !ok {
			return e
		}
		e = x.Expr
	}
}

func cloneExpressionList(list []expression.Expression) ([]expression.Expression, error) {
	r := make([]expression.Expression, len(list))
	var err error
	for i, v := range list {
		if r[i], err = v.Clone(); err != nil {
			return nil, err
		}
	}
	return r, nil
}

// FastEval evaluates Value and static +/- Unary expression and returns its value.
func FastEval(v interface{}) interface{} {
	switch x := v.(type) {
	case Value:
		return x.Val
	case int64, uint64:
		return v
	case *UnaryOperation:
		if x.Op != opcode.Plus && x.Op != opcode.Minus {
			return nil
		}
		if !x.IsStatic() {
			return nil
		}
		m := map[interface{}]interface{}{}
		return Eval(x, nil, m)
	default:
		return nil
	}
}

// IsQualified returns whether name contains ".".
func IsQualified(name string) bool {
	return strings.Contains(name, ".")
}

// Eval is a helper function evaluates expression v and do a panic if evaluating error.
func Eval(v expression.Expression, ctx context.Context, env map[interface{}]interface{}) (y interface{}) {
	var err error
	y, err = v.Eval(ctx, env)
	if err != nil {
		panic(err) // panic ok here
	}
	return
}

// MentionedAggregateFuncs returns a list of the Call expression which is aggregate function.
func MentionedAggregateFuncs(e expression.Expression) []expression.Expression {
	var m []expression.Expression
	mentionedAggregateFuncs(e, &m)
	return m
}

func mentionedAggregateFuncs(e expression.Expression, m *[]expression.Expression) {
	switch x := e.(type) {
	case Value, *Value, *Variable,
		*Default, *Ident, *SubQuery, *Position:
		// nop
	case *BinaryOperation:
		mentionedAggregateFuncs(x.L, m)
		mentionedAggregateFuncs(x.R, m)
	case *Call:
		f, ok := builtin[strings.ToLower(x.F)]
		if !ok {
			log.Errorf("unknown function %s", x.F)
			return
		}

		if f.isAggregate {
			// if f is aggregate function, we don't need check the arguments,
			// because using an aggregate function in the aggregate arg like count(max(c1)) is invalid
			// TODO: check whether argument contains an aggregate function and return error.
			*m = append(*m, e)
			return
		}

		for _, e := range x.Args {
			mentionedAggregateFuncs(e, m)
		}
	case *IsNull:
		mentionedAggregateFuncs(x.Expr, m)
	case *PExpr:
		mentionedAggregateFuncs(x.Expr, m)
	case *PatternIn:
		mentionedAggregateFuncs(x.Expr, m)
		for _, e := range x.List {
			mentionedAggregateFuncs(e, m)
		}
	case *PatternLike:
		mentionedAggregateFuncs(x.Expr, m)
		mentionedAggregateFuncs(x.Pattern, m)
	case *UnaryOperation:
		mentionedAggregateFuncs(x.V, m)
	case *ParamMarker:
		if x.Expr != nil {
			mentionedAggregateFuncs(x.Expr, m)
		}
	case *FunctionCast:
		if x.Expr != nil {
			mentionedAggregateFuncs(x.Expr, m)
		}
	case *FunctionConvert:
		if x.Expr != nil {
			mentionedAggregateFuncs(x.Expr, m)
		}
	case *FunctionSubstring:
		if x.StrExpr != nil {
			mentionedAggregateFuncs(x.StrExpr, m)
		}
		if x.Pos != nil {
			mentionedAggregateFuncs(x.Pos, m)
		}
		if x.Len != nil {
			mentionedAggregateFuncs(x.Len, m)
		}
	case *FunctionCase:
		if x.Value != nil {
			mentionedAggregateFuncs(x.Value, m)
		}
		for _, w := range x.WhenClauses {
			mentionedAggregateFuncs(w, m)
		}
		if x.ElseClause != nil {
			mentionedAggregateFuncs(x.ElseClause, m)
		}
	case *WhenClause:
		mentionedAggregateFuncs(x.Expr, m)
		mentionedAggregateFuncs(x.Result, m)
	case *IsTruth:
		mentionedAggregateFuncs(x.Expr, m)
	case *Between:
		mentionedAggregateFuncs(x.Expr, m)
		mentionedAggregateFuncs(x.Left, m)
		mentionedAggregateFuncs(x.Right, m)
	default:
		log.Errorf("Unknown Expression: %T", e)
	}
}

// ContainAggregateFunc checks whether expression e contains an aggregate function, like count(*) or other.
func ContainAggregateFunc(e expression.Expression) bool {
	m := MentionedAggregateFuncs(e)
	return len(m) > 0
}

func mentionedColumns(e expression.Expression, m map[string]bool, names *[]string) {
	switch x := e.(type) {
	case Value, *Value, *Variable,
		*Default, *SubQuery, *Position:
		// nop
	case *BinaryOperation:
		mentionedColumns(x.L, m, names)
		mentionedColumns(x.R, m, names)
	case *Call:
		for _, e := range x.Args {
			mentionedColumns(e, m, names)
		}
	case *Ident:
		name := x.L
		if !m[name] {
			m[name] = true
			*names = append(*names, name)
		}
	case *IsNull:
		mentionedColumns(x.Expr, m, names)
	case *PExpr:
		mentionedColumns(x.Expr, m, names)
	case *PatternIn:
		mentionedColumns(x.Expr, m, names)
		for _, e := range x.List {
			mentionedColumns(e, m, names)
		}
	case *PatternLike:
		mentionedColumns(x.Expr, m, names)
		mentionedColumns(x.Pattern, m, names)
	case *UnaryOperation:
		mentionedColumns(x.V, m, names)
	case *ParamMarker:
		if x.Expr != nil {
			mentionedColumns(x.Expr, m, names)
		}
	case *FunctionCast:
		if x.Expr != nil {
			mentionedColumns(x.Expr, m, names)
		}
	case *FunctionConvert:
		if x.Expr != nil {
			mentionedColumns(x.Expr, m, names)
		}
	case *FunctionSubstring:
		if x.StrExpr != nil {
			mentionedColumns(x.StrExpr, m, names)
		}
		if x.Pos != nil {
			mentionedColumns(x.Pos, m, names)
		}
		if x.Len != nil {
			mentionedColumns(x.Len, m, names)
		}
	case *FunctionCase:
		if x.Value != nil {
			mentionedColumns(x.Value, m, names)
		}
		for _, w := range x.WhenClauses {
			mentionedColumns(w, m, names)
		}
		if x.ElseClause != nil {
			mentionedColumns(x.ElseClause, m, names)
		}
	case *WhenClause:
		mentionedColumns(x.Expr, m, names)
		mentionedColumns(x.Result, m, names)
	case *IsTruth:
		mentionedColumns(x.Expr, m, names)
	case *Between:
		mentionedColumns(x.Expr, m, names)
		mentionedColumns(x.Left, m, names)
		mentionedColumns(x.Right, m, names)
	default:
		log.Errorf("Unknown Expression: %T", e)
	}
}

// MentionedColumns returns a list of names for Ident expression.
func MentionedColumns(e expression.Expression) []string {
	var names []string
	m := make(map[string]bool)
	mentionedColumns(e, m, &names)
	return names
}

func staticExpr(e expression.Expression) (expression.Expression, error) {
	if e.IsStatic() {
		v, err := e.Eval(nil, nil)
		if err != nil {
			return nil, err
		}

		if v == nil {
			return Value{nil}, nil
		}

		return Value{v}, nil
	}

	return e, nil
}

type exprTab struct {
	expr  expression.Expression
	table string
}

// IsCurrentTimeExpr returns whether e is CurrentTimeExpr.
func IsCurrentTimeExpr(e expression.Expression) bool {
	x, ok := e.(*Ident)
	if !ok {
		return false
	}

	return x.Equal(CurrentTimeExpr)
}

func getSystemTimestamp(ctx context.Context) (time.Time, error) {
	value := time.Now()

	if ctx == nil {
		return value, nil
	}

	// check whether use timestamp varibale
	sessionVars := variable.GetSessionVars(ctx)
	if v, ok := sessionVars.Systems["timestamp"]; ok {
		if v != "" {
			timestamp, err := strconv.ParseInt(v, 10, 64)
			if err != nil {
				return time.Time{}, errors.Trace(err)
			}

			if timestamp <= 0 {
				return value, nil
			}

			return time.Unix(timestamp, 0), nil
		}
	}

	return value, nil
}

// GetTimeValue gets the time value with type tp.
func GetTimeValue(ctx context.Context, v interface{}, tp byte, fsp int) (interface{}, error) {
	return getTimeValue(ctx, v, tp, fsp)
}

func getTimeValue(ctx context.Context, v interface{}, tp byte, fsp int) (interface{}, error) {
	value := mysql.Time{
		Type: tp,
		Fsp:  fsp,
	}

	defaultTime, err := getSystemTimestamp(ctx)
	if err != nil {
		return nil, errors.Trace(err)
	}

	switch x := v.(type) {
	case string:
		if x == CurrentTimestamp {
			value.Time = defaultTime
		} else if x == ZeroTimestamp {
			value, _ = mysql.ParseTimeFromNum(0, tp, fsp)
		} else {
			value, err = mysql.ParseTime(x, tp, fsp)
			if err != nil {
				return nil, errors.Trace(err)
			}
		}
	case Value:
		switch xval := x.Val.(type) {
		case string:
			value, err = mysql.ParseTime(xval, tp, fsp)
			if err != nil {
				return nil, errors.Trace(err)
			}
		case int64:
			value, err = mysql.ParseTimeFromNum(int64(xval), tp, fsp)
			if err != nil {
				return nil, errors.Trace(err)
			}
		case nil:
			return nil, nil
		default:
			return nil, errors.Trace(errDefaultValue)
		}
	case *Ident:
		if x.Equal(CurrentTimeExpr) {
			return CurrentTimestamp, nil
		}

		return nil, errors.Trace(errDefaultValue)
	case *UnaryOperation:
		// support some expression, like `-1`
		m := map[interface{}]interface{}{}
		v := Eval(x, nil, m)
		ft := types.NewFieldType(mysql.TypeLonglong)
		xval, err := types.Convert(v, ft)
		if err != nil {
			return nil, errors.Trace(err)
		}

		value, err = mysql.ParseTimeFromNum(xval.(int64), tp, fsp)
		if err != nil {
			return nil, errors.Trace(err)
		}
	default:
		return nil, nil
	}

	return value, nil
}

// EvalBoolExpr evaluates an expression and convert its return value to bool.
func EvalBoolExpr(ctx context.Context, expr expression.Expression, m map[interface{}]interface{}) (bool, error) {
	val, err := expr.Eval(ctx, m)
	if err != nil {
		return false, err
	}
	if val == nil {
		return false, nil
	}

	x, err := types.ToBool(val)
	if err != nil {
		return false, err
	}

	return x != 0, nil
}

redpajama_set_name: RedPajamaGithub


text:
<?php

namespace LeagueWrap\Api\Dto;

use LeagueWrap\Api\BaseDto;
use LeagueWrap\Enum;

/**
 * This object contains item tree data.
 *
 * @category LolStaticData
 */
class ItemTreeDto extends BaseDto {
    /** @var string */
    protected $header;

    /** @var string[] */
    protected $tags;

    /**
     * @return string
     */
    public function getHeader()
    {
        return $this->header;
    }

    /**
     * @return string[]
     */
    public function getTags()
    {
        return $this->tags;
    }

    /**
     * @param string $header
     *
     * @return $this
     */
    public function setHeader($header)
    {
        $this->header = $header;

        return $this;
    }

    /**
     * @param string[] $tags
     *
     * @return $this
     */
    public function setTags($tags)
    {
        $this->tags = $tags;

        return $this;
    }

}


text:
<?xml version="1.0" encoding="UTF-8"?>
<!--
    Licensed to the Apache Software Foundation (ASF) under one or more
    contributor license agreements.  See the NOTICE file distributed with
    this work for additional information regarding copyright ownership.
    The ASF licenses this file to You 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.
-->
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0">

    <bean id="a" class="org.apache.aries.blueprint.pojos.PojoCircular">
        <property name="circular" ref="b"/>
    </bean>

    <bean id="b" class="org.apache.aries.blueprint.pojos.PojoCircular">
        <property name="circular" ref="a"/>
    </bean>

    <bean id="c" class="org.apache.aries.blueprint.pojos.PojoCircular" init-method = "init">
        <property name="circular" ref="d"/>
    </bean>

    <bean id="d" class="org.apache.aries.blueprint.pojos.PojoCircular">
        <property name="circular" ref="c"/>
    </bean>

    <bean id="serviceBean" class="org.apache.aries.blueprint.pojos.PojoB">
        <property name="uri" value="urn:myuri" />
    </bean>

    <bean id="listener" class="org.apache.aries.blueprint.pojos.PojoListener">
        <property name="service" ref="service" />
    </bean>

    <service id="service" ref="serviceBean" interface="org.apache.aries.blueprint.pojos.PojoB">
        <service-properties>
            <entry key="key1" value="value1"/>
            <entry key="key2" value="value2"/>
        </service-properties>
        <registration-listener ref="listener"
           registration-method="register"
           unregistration-method="unregister"/>
    </service>

    <!-- for prototype cycle tests -->

    <bean id="circularPrototype" class="org.apache.aries.blueprint.pojos.PojoCircular" scope = "prototype">
        <property name="circular" ref="circularPrototype"/>
    </bean>

    <bean id="circularPrototypeDriver" class="org.apache.aries.blueprint.pojos.PojoCircular" scope = "prototype">
        <property name="circular" ref="circularPrototypeDriver"/>
    </bean>

     <!-- for dynamic cycle tests (blueprintContainer.getComponentInstance()) -->

    <bean id="recursiveConstructor" class="org.apache.aries.blueprint.pojos.PojoRecursive">
        <argument ref="blueprintContainer"/>
        <argument value="recursiveConstructor"/>
        <argument value="1"/>
    </bean>

    <bean id="recursiveSetter" class="org.apache.aries.blueprint.pojos.PojoRecursive">
        <argument ref="blueprintContainer"/>
        <argument value="recursiveSetter"/>
        <property name="foo" value="1"/>
    </bean>

    <bean id="recursiveInitMethod" class="org.apache.aries.blueprint.pojos.PojoRecursive" init-method = "init">
        <argument ref="blueprintContainer"/>
        <argument value="recursiveInitMethod"/>
    </bean>

    <!-- for breaking dependency cycle tests  -->

    <bean id="c1" class="org.apache.aries.blueprint.pojos.PojoCircular">
        <argument ref="c2"/>
    </bean>

    <bean id="c2" class="org.apache.aries.blueprint.pojos.PojoCircular">
        <argument ref="c3"/>
    </bean>

    <bean id="c3" class="org.apache.aries.blueprint.pojos.PojoCircular">
        <property name="circular" ref="c1"/>
    </bean>

</blueprint>


text:
export class RetryTimeoutError extends Error {
    static isRetryTimeoutError = true
}

export function retryUntil<T>(
    task: () => Promise<T>,
    condition: (value: T) => boolean,
    options: { intervalMiliseconds: number; timeoutMiliseconds: number },
): Promise<T> {
    const startMs = Date.now()
    return new Promise((resolve, reject) => {
        const doTry = async () => {
            let res
            try {
                res = await task()
            } catch (e) {
                reject(e)
                return true
            }

            const valid = condition(res)
            if (valid) {
                resolve(res)
            }
            return valid
        }

        const tryOrRetryLater = async () => {
            if (await doTry()) {
                return
            }

            if (Date.now() - startMs >= options.timeoutMiliseconds) {
                return reject(new RetryTimeoutError())
            }

            setTimeout(tryOrRetryLater, options.intervalMiliseconds)
        }

        tryOrRetryLater()
    })
}

/**
 * Keeps executing a promiseCreator function till no error is thrown.
 */
export function retryUntilErrorResolves(
    promiseCreator,
    {
        intervalMilliSeconds,
        timeoutMilliSeconds,
    }: { intervalMilliSeconds: number; timeoutMilliSeconds: number },
) {
    const startMs = Date.now()
    return new Promise((resolve, reject) => {
        const doTry = async () => {
            let res
            try {
                res = await promiseCreator()
                resolve(res)
                return true
            } catch (e) {
                return false
            }
        }

        const tryOrRetryLater = async () => {
            if (await doTry()) {
                resolve(true)
                return
            }

            if (Date.now() - startMs >= timeoutMilliSeconds) {
                return reject(new RetryTimeoutError())
            }

            setTimeout(tryOrRetryLater, intervalMilliSeconds)
        }

        tryOrRetryLater()
    })
}


text:
#include <aws/ec2/model/VpcEndpointConnection.h>
#include <aws/core/utils/xml/XmlSerializer.h>
#include <aws/core/utils/StringUtils.h>
#include <aws/core/utils/memory/stl/AWSStringStream.h>

#include <utility>

using namespace Aws::Utils::Xml;
using namespace Aws::Utils;

namespace Aws
{
namespace EC2
{
namespace Model
{

VpcEndpointConnection::VpcEndpointConnection() :
    m_serviceIdHasBeenSet(false),
    m_vpcEndpointIdHasBeenSet(false),
    m_vpcEndpointOwnerHasBeenSet(false),
    m_vpcEndpointState(State::NOT_SET),
    m_vpcEndpointStateHasBeenSet(false),
    m_creationTimestampHasBeenSet(false),
    m_dnsEntriesHasBeenSet(false),
    m_networkLoadBalancerArnsHasBeenSet(false),
    m_gatewayLoadBalancerArnsHasBeenSet(false),
    m_ipAddressType(IpAddressType::NOT_SET),
    m_ipAddressTypeHasBeenSet(false),
    m_vpcEndpointConnectionIdHasBeenSet(false),
    m_tagsHasBeenSet(false)
{
}

VpcEndpointConnection::VpcEndpointConnection(const XmlNode& xmlNode) :
    m_serviceIdHasBeenSet(false),
    m_vpcEndpointIdHasBeenSet(false),
    m_vpcEndpointOwnerHasBeenSet(false),
    m_vpcEndpointState(State::NOT_SET),
    m_vpcEndpointStateHasBeenSet(false),
    m_creationTimestampHasBeenSet(false),
    m_dnsEntriesHasBeenSet(false),
    m_networkLoadBalancerArnsHasBeenSet(false),
    m_gatewayLoadBalancerArnsHasBeenSet(false),
    m_ipAddressType(IpAddressType::NOT_SET),
    m_ipAddressTypeHasBeenSet(false),
    m_vpcEndpointConnectionIdHasBeenSet(false),
    m_tagsHasBeenSet(false)
{
  *this = xmlNode;
}

VpcEndpointConnection& VpcEndpointConnection::operator =(const XmlNode& xmlNode)
{
  XmlNode resultNode = xmlNode;

  if(!resultNode.IsNull())
  {
    XmlNode serviceIdNode = resultNode.FirstChild("serviceId");
    if(!serviceIdNode.IsNull())
    {
      m_serviceId = Aws::Utils::Xml::DecodeEscapedXmlText(serviceIdNode.GetText());
      m_serviceIdHasBeenSet = true;
    }
    XmlNode vpcEndpointIdNode = resultNode.FirstChild("vpcEndpointId");
    if(!vpcEndpointIdNode.IsNull())
    {
      m_vpcEndpointId = Aws::Utils::Xml::DecodeEscapedXmlText(vpcEndpointIdNode.GetText());
      m_vpcEndpointIdHasBeenSet = true;
    }
    XmlNode vpcEndpointOwnerNode = resultNode.FirstChild("vpcEndpointOwner");
    if(!vpcEndpointOwnerNode.IsNull())
    {
      m_vpcEndpointOwner = Aws::Utils::Xml::DecodeEscapedXmlText(vpcEndpointOwnerNode.GetText());
      m_vpcEndpointOwnerHasBeenSet = true;
    }
    XmlNode vpcEndpointStateNode = resultNode.FirstChild("vpcEndpointState");
    if(!vpcEndpointStateNode.IsNull())
    {
      m_vpcEndpointState = StateMapper::GetStateForName(StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(vpcEndpointStateNode.GetText()).c_str()).c_str());
      m_vpcEndpointStateHasBeenSet = true;
    }
    XmlNode creationTimestampNode = resultNode.FirstChild("creationTimestamp");
    if(!creationTimestampNode.IsNull())
    {
      m_creationTimestamp = DateTime(StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(creationTimestampNode.GetText()).c_str()).c_str(), Aws::Utils::DateFormat::ISO_8601);
      m_creationTimestampHasBeenSet = true;
    }
    XmlNode dnsEntriesNode = resultNode.FirstChild("dnsEntrySet");
    if(!dnsEntriesNode.IsNull())
    {
      XmlNode dnsEntriesMember = dnsEntriesNode.FirstChild("item");
      while(!dnsEntriesMember.IsNull())
      {
        m_dnsEntries.push_back(dnsEntriesMember);
        dnsEntriesMember = dnsEntriesMember.NextNode("item");
      }

      m_dnsEntriesHasBeenSet = true;
    }
    XmlNode networkLoadBalancerArnsNode = resultNode.FirstChild("networkLoadBalancerArnSet");
    if(!networkLoadBalancerArnsNode.IsNull())
    {
      XmlNode networkLoadBalancerArnsMember = networkLoadBalancerArnsNode.FirstChild("item");
      while(!networkLoadBalancerArnsMember.IsNull())
      {
        m_networkLoadBalancerArns.push_back(networkLoadBalancerArnsMember.GetText());
        networkLoadBalancerArnsMember = networkLoadBalancerArnsMember.NextNode("item");
      }

      m_networkLoadBalancerArnsHasBeenSet = true;
    }
    XmlNode gatewayLoadBalancerArnsNode = resultNode.FirstChild("gatewayLoadBalancerArnSet");
    if(!gatewayLoadBalancerArnsNode.IsNull())
    {
      XmlNode gatewayLoadBalancerArnsMember = gatewayLoadBalancerArnsNode.FirstChild("item");
      while(!gatewayLoadBalancerArnsMember.IsNull())
      {
        m_gatewayLoadBalancerArns.push_back(gatewayLoadBalancerArnsMember.GetText());
        gatewayLoadBalancerArnsMember = gatewayLoadBalancerArnsMember.NextNode("item");
      }

      m_gatewayLoadBalancerArnsHasBeenSet = true;
    }
    XmlNode ipAddressTypeNode = resultNode.FirstChild("ipAddressType");
    if(!ipAddressTypeNode.IsNull())
    {
      m_ipAddressType = IpAddressTypeMapper::GetIpAddressTypeForName(StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(ipAddressTypeNode.GetText()).c_str()).c_str());
      m_ipAddressTypeHasBeenSet = true;
    }
    XmlNode vpcEndpointConnectionIdNode = resultNode.FirstChild("vpcEndpointConnectionId");
    if(!vpcEndpointConnectionIdNode.IsNull())
    {
      m_vpcEndpointConnectionId = Aws::Utils::Xml::DecodeEscapedXmlText(vpcEndpointConnectionIdNode.GetText());
      m_vpcEndpointConnectionIdHasBeenSet = true;
    }
    XmlNode tagsNode = resultNode.FirstChild("tagSet");
    if(!tagsNode.IsNull())
    {
      XmlNode tagsMember = tagsNode.FirstChild("item");
      while(!tagsMember.IsNull())
      {
        m_tags.push_back(tagsMember);
        tagsMember = tagsMember.NextNode("item");
      }

      m_tagsHasBeenSet = true;
    }
  }

  return *this;
}

void VpcEndpointConnection::OutputToStream(Aws::OStream& oStream, const char* location, unsigned index, const char* locationValue) const
{
  if(m_serviceIdHasBeenSet)
  {
      oStream << location << index << locationValue << ".ServiceId=" << StringUtils::URLEncode(m_serviceId.c_str()) << "&";
  }

  if(m_vpcEndpointIdHasBeenSet)
  {
      oStream << location << index << locationValue << ".VpcEndpointId=" << StringUtils::URLEncode(m_vpcEndpointId.c_str()) << "&";
  }

  if(m_vpcEndpointOwnerHasBeenSet)
  {
      oStream << location << index << locationValue << ".VpcEndpointOwner=" << StringUtils::URLEncode(m_vpcEndpointOwner.c_str()) << "&";
  }

  if(m_vpcEndpointStateHasBeenSet)
  {
      oStream << location << index << locationValue << ".VpcEndpointState=" << StateMapper::GetNameForState(m_vpcEndpointState) << "&";
  }

  if(m_creationTimestampHasBeenSet)
  {
      oStream << location << index << locationValue << ".CreationTimestamp=" << StringUtils::URLEncode(m_creationTimestamp.ToGmtString(Aws::Utils::DateFormat::ISO_8601).c_str()) << "&";
  }

  if(m_dnsEntriesHasBeenSet)
  {
      unsigned dnsEntriesIdx = 1;
      for(auto& item : m_dnsEntries)
      {
        Aws::StringStream dnsEntriesSs;
        dnsEntriesSs << location << index << locationValue << ".DnsEntrySet." << dnsEntriesIdx++;
        item.OutputToStream(oStream, dnsEntriesSs.str().c_str());
      }
  }

  if(m_networkLoadBalancerArnsHasBeenSet)
  {
      unsigned networkLoadBalancerArnsIdx = 1;
      for(auto& item : m_networkLoadBalancerArns)
      {
        oStream << location << index << locationValue << ".NetworkLoadBalancerArnSet." << networkLoadBalancerArnsIdx++ << "=" << StringUtils::URLEncode(item.c_str()) << "&";
      }
  }

  if(m_gatewayLoadBalancerArnsHasBeenSet)
  {
      unsigned gatewayLoadBalancerArnsIdx = 1;
      for(auto& item : m_gatewayLoadBalancerArns)
      {
        oStream << location << index << locationValue << ".GatewayLoadBalancerArnSet." << gatewayLoadBalancerArnsIdx++ << "=" << StringUtils::URLEncode(item.c_str()) << "&";
      }
  }

  if(m_ipAddressTypeHasBeenSet)
  {
      oStream << location << index << locationValue << ".IpAddressType=" << IpAddressTypeMapper::GetNameForIpAddressType(m_ipAddressType) << "&";
  }

  if(m_vpcEndpointConnectionIdHasBeenSet)
  {
      oStream << location << index << locationValue << ".VpcEndpointConnectionId=" << StringUtils::URLEncode(m_vpcEndpointConnectionId.c_str()) << "&";
  }

  if(m_tagsHasBeenSet)
  {
      unsigned tagsIdx = 1;
      for(auto& item : m_tags)
      {
        Aws::StringStream tagsSs;
        tagsSs << location << index << locationValue << ".TagSet." << tagsIdx++;
        item.OutputToStream(oStream, tagsSs.str().c_str());
      }
  }

}

void VpcEndpointConnection::OutputToStream(Aws::OStream& oStream, const char* location) const
{
  if(m_serviceIdHasBeenSet)
  {
      oStream << location << ".ServiceId=" << StringUtils::URLEncode(m_serviceId.c_str()) << "&";
  }
  if(m_vpcEndpointIdHasBeenSet)
  {
      oStream << location << ".VpcEndpointId=" << StringUtils::URLEncode(m_vpcEndpointId.c_str()) << "&";
  }
  if(m_vpcEndpointOwnerHasBeenSet)
  {
      oStream << location << ".VpcEndpointOwner=" << StringUtils::URLEncode(m_vpcEndpointOwner.c_str()) << "&";
  }
  if(m_vpcEndpointStateHasBeenSet)
  {
      oStream << location << ".VpcEndpointState=" << StateMapper::GetNameForState(m_vpcEndpointState) << "&";
  }
  if(m_creationTimestampHasBeenSet)
  {
      oStream << location << ".CreationTimestamp=" << StringUtils::URLEncode(m_creationTimestamp.ToGmtString(Aws::Utils::DateFormat::ISO_8601).c_str()) << "&";
  }
  if(m_dnsEntriesHasBeenSet)
  {
      unsigned dnsEntriesIdx = 1;
      for(auto& item : m_dnsEntries)
      {
        Aws::StringStream dnsEntriesSs;
        dnsEntriesSs << location <<  ".DnsEntrySet." << dnsEntriesIdx++;
        item.OutputToStream(oStream, dnsEntriesSs.str().c_str());
      }
  }
  if(m_networkLoadBalancerArnsHasBeenSet)
  {
      unsigned networkLoadBalancerArnsIdx = 1;
      for(auto& item : m_networkLoadBalancerArns)
      {
        oStream << location << ".NetworkLoadBalancerArnSet." << networkLoadBalancerArnsIdx++ << "=" << StringUtils::URLEncode(item.c_str()) << "&";
      }
  }
  if(m_gatewayLoadBalancerArnsHasBeenSet)
  {
      unsigned gatewayLoadBalancerArnsIdx = 1;
      for(auto& item : m_gatewayLoadBalancerArns)
      {
        oStream << location << ".GatewayLoadBalancerArnSet." << gatewayLoadBalancerArnsIdx++ << "=" << StringUtils::URLEncode(item.c_str()) << "&";
      }
  }
  if(m_ipAddressTypeHasBeenSet)
  {
      oStream << location << ".IpAddressType=" << IpAddressTypeMapper::GetNameForIpAddressType(m_ipAddressType) << "&";
  }
  if(m_vpcEndpointConnectionIdHasBeenSet)
  {
      oStream << location << ".VpcEndpointConnectionId=" << StringUtils::URLEncode(m_vpcEndpointConnectionId.c_str()) << "&";
  }
  if(m_tagsHasBeenSet)
  {
      unsigned tagsIdx = 1;
      for(auto& item : m_tags)
      {
        Aws::StringStream tagsSs;
        tagsSs << location <<  ".TagSet." << tagsIdx++;
        item.OutputToStream(oStream, tagsSs.str().c_str());
      }
  }
}

} // namespace Model
} // namespace EC2
} // namespace Aws


text:
      抽奖配置(current)
      中奖名单

添加:

        <form class="form-inline">

            奖品级别
            <input type="text" class="form-control form-control-sm config-add-input" ng-model="vm.addedConfig.class">

            级别序列
            <input type="number" class="form-control form-control-sm config-add-input" ng-model="vm.addedConfig.classSeq">

            奖品轮数
            <input type="text" class="form-control form-control-sm config-add-input" ng-model="vm.addedConfig.round">

            轮数序列
            <input type="number" class="form-control form-control-sm config-add-input" ng-model="vm.addedConfig.roundSeq">

            中奖人数
            <input type="number" class="form-control form-control-sm config-add-input" ng-model="vm.addedConfig.ppl">

            中奖范围
            <input type="text" class="form-control form-control-sm config-add-input" ng-model="vm.addedConfig.scope">

          <button type="button" class="btn btn-outline-primary btn-sm" ng-click="vm.addConfig()">添加</button>
          <button type="button" class="btn btn-outline-danger btn-sm" ng-click="vm.resetAddedConfig()">清空</button>
        </form>

操作:

        <button type="button" class="btn btn-outline-primary btn-sm" ng-click="vm.start()" ng-if="vm.currentDraw.status == '未开始'">开始</button>
        <button type="button" class="btn btn-outline-primary btn-sm" ng-click="vm.stop()" ng-if="vm.currentDraw.status == '进行中'">停止</button>
        <button type="button" class="btn btn-outline-danger btn-sm" ng-click="vm.resetAll()">重置</button>

页面:

        {{vm.dbStatus[0].page == 'ready' ? '开始页' : (vm.dbStatus[0].page == 'result' ? '结果页' : '抽奖中页')}}

          奖品级别
          级别序列
          奖品轮数
          轮数序列
          中奖人数
          中奖范围
          状态
          操作

          {{config.class}}
          {{config.classSeq}}
          {{config.round}}
          {{config.roundSeq}}
          {{config.ppl}}
          {{config.scope}}
          {{config.status}}
          <button type="button" class="btn btn-outline-danger btn-sm" ng-click="vm.deleteConfig(config)">删除</button>

            {{class}}

{{round}}

                  {{ppl.sn}} {{ppl.name}}
                  <input type="checkbox" ng-checked="ppl.done" ng-model="ppl.done" ng-change="vm.updateDone(ppl)">


text:
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using EventStore.ClientAPI;
using EventStore.ClientAPI.SystemData;

namespace EventStore.Padmin
{
    internal static class Command
    {
        public static void Enable(ProjectionsManager manager, string[] commandArgs)
        {
            var nameAndCredentials = GetProjectionNameAndCredentials(commandArgs);
            var name = nameAndCredentials.Item1;
            Log("Enabling {0}...", name);
            manager.Enable(name, nameAndCredentials.Item2);
            Log("{0} enabled", name);
        }

        public static void Disable(ProjectionsManager manager, string[] commandArgs)
        {
            var nameAndCredentials = GetProjectionNameAndCredentials(commandArgs);
            var name = nameAndCredentials.Item1;
            Log("Disabling {0}...", nameAndCredentials.Item1);
            manager.Disable(name, nameAndCredentials.Item2);
            Log("{0} disabled", name);
        }

        public static void Create(ProjectionsManager manager, string[] commandArgs)
        {
            if (commandArgs.Length < 2)
            {
                Log("Invalid argument value (projection type)");
                return;
            }

            var type = commandArgs[0].Trim().ToLower();
            var queryInfo = GetQueryAndCredentials(commandArgs.Skip(1).ToArray());
            if (queryInfo == null || (type != "onetime" && string.IsNullOrEmpty(queryInfo.Item1)))
            {
                Log("Invalid arguments");
                return;
            }
            var pname = queryInfo.Item1;
            var query = queryInfo.Item2;
            var userCredentials = queryInfo.Item3;

            switch (type)
            {
                case "onetime":
                    Log("Creating onetime projection...");
                    manager.CreateOneTime(query, userCredentials);
                    Log("Created");
                    break;
                case "continuous":
                    Log("Creating continuous projection {0}...", pname);
                    manager.CreateContinuous(pname, query, userCredentials);
                    Log("Created");
                    break;
                default:
                    Log("projection type not recognized");
                    break;
            }
        }

        public static void List(ProjectionsManager manager, string[] commandArgs)
        {
            if (commandArgs.Length != 1 && commandArgs.Length != 3)
            {
                Log("Invalid argument value for list mode");
                return;
            }
            var userCredentials = commandArgs.Length == 3 ? new UserCredentials(commandArgs[1], commandArgs[2]) : null;
            var mode = commandArgs[0].Trim().ToLower();
            switch (mode)
            {
                case "all":
                    Log("Listing all projections...");
                    LogUnformatted(manager.ListAll(userCredentials));
                    Log("All projections listed");
                    break;
                case "onetime":
                    Log("Listing onetime projections...");
                    LogUnformatted(manager.ListOneTime(userCredentials));
                    Log("Onetime projections listed");
                    break;
                case "continuous":
                    Log("Listing continuous projections...");
                    LogUnformatted(manager.ListContinuous(userCredentials));
                    Log("Continuous projections listed");
                    break;
                default:
                    Log("List mode not recognized");
                    break;
            }
        }

        public static void Status(ProjectionsManager manager, string[] commandArgs)
        {
            var nameAndCredentials = GetProjectionNameAndCredentials(commandArgs);
            if (nameAndCredentials == null)
            {
                Log("Invalid arguments, should be: <projection-name> [<login> <password>].");
                return;
            }

            var name = nameAndCredentials.Item1;
            Log("{0} is '{1}'", name, manager.GetStatus(name, nameAndCredentials.Item2));
        }

        public static void State(ProjectionsManager manager, string[] commandArgs)
        {
            var nameAndCredentials = GetProjectionNameAndCredentials(commandArgs);
            if (nameAndCredentials == null)
            {
                Log("Invalid arguments, should be: <projection-name> [<login> <password>].");
                return;
            }
            var name = nameAndCredentials.Item1;
            Log("{0}'s state is : '{1}'", name, manager.GetState(name, nameAndCredentials.Item2));
        }

        public static void Statistics(ProjectionsManager manager, string[] commandArgs)
        {
            var nameAndCredentials = GetProjectionNameAndCredentials(commandArgs);
            if (nameAndCredentials == null)
            {
                Log("Invalid arguments, should be: <projection-name> [<login> <password>].");
                return;
            }
            var name = nameAndCredentials.Item1;
            Log("{0}'s statistics :", name);
            LogUnformatted(manager.GetStatistics(name, nameAndCredentials.Item2));
        }

        public static void ShowQuery(ProjectionsManager manager, string[] commandArgs)
        {
            var nameAndCredentials = GetProjectionNameAndCredentials(commandArgs);
            if (nameAndCredentials == null)
            {
                Log("Invalid arguments, should be: <projection-name> [<login> <password>].");
                return;
            }
            var name = nameAndCredentials.Item1;
            Log("{0}'s query :", name);
            LogUnformatted(manager.GetQuery(name, nameAndCredentials.Item2));
        }

        public static void UpdateQuery(ProjectionsManager manager, string[] commandArgs)
        {
            var queryInfo = GetQueryAndCredentials(commandArgs);
            if (queryInfo == null)
            {
                Log("Invalid arguments for command update query");
                return;
            }
            var pname = queryInfo.Item1;
            var query = queryInfo.Item2;
            var userCredentials = queryInfo.Item3;
            Log("Updating query of {0}...", pname);
            manager.UpdateQuery(pname, query, userCredentials);
            Log("Query updated");
        }

        public static void Delete(ProjectionsManager manager, string[] commandArgs)
        {
            var nameAndCredentials = GetProjectionNameAndCredentials(commandArgs);
            if (nameAndCredentials == null)
            {
                Log("Invalid arguments, should be: <projection-name> [<login> <password>].");
                return;
            }
            var name = nameAndCredentials.Item1;
            Log("Deleting {0}...", name);
            manager.Delete(name, nameAndCredentials.Item2);
            Log("{0} deleted", name);
        }

        private static Tuple<string, UserCredentials> GetProjectionNameAndCredentials(string[] commandArgs)
        {
            if (commandArgs.Length != 1 && commandArgs.Length != 3)
                return null;
            return Tuple.Create(commandArgs[0],
                                commandArgs.Length == 3 ? new UserCredentials(commandArgs[1], commandArgs[2]) : null);
        }

        private static Tuple<string, string, UserCredentials> GetQueryAndCredentials(string[] commandArgs)
        {
            if (commandArgs.Length == 3 || commandArgs.Length > 4)
                return null;

            if (commandArgs.Length == 1 || commandArgs.Length == 3)
            {
                return Tuple.Create(
                    (string)null,
                    File.ReadAllText(commandArgs[0]),
                    commandArgs.Length == 3 ? new UserCredentials(commandArgs[1], commandArgs[2]) : null);
            }

            if (commandArgs.Length == 2 || commandArgs.Length == 4)
            {
                return Tuple.Create(
                    commandArgs[0],
                    File.ReadAllText(commandArgs[1]),
                    commandArgs.Length == 4 ? new UserCredentials(commandArgs[2], commandArgs[3]) : null);
            }

            return null;
        }

        private static void Log(string format, params object[] args)
        {
            Console.WriteLine(format, args);
        }

        private static void LogUnformatted(string s)
        {
            Console.WriteLine(s);
        }
    }
}


text:
<!doctype html>

    <title>Socket.IO chat</title>

    <button id="orb">Open Room</button>
    <button id="jrb">Join Room</button>
    <button id="cb">Close</button>

    <form id="msgform" action="">
      <input id="m" autocomplete="off" /><button>Send</button>
    </form>


text:
package org.wso2.developerstudio.eclipse.greg.base.model;

import java.util.ArrayList;
import java.util.List;

import org.wso2.developerstudio.eclipse.usermgt.remote.UserManager;

public class RegistryUserRoleContainer {
	private List<RegistryUserRole> userRoles;
	private RegistryUserManagerContainer registryUserManagerContainer;
	private boolean iterativeRefresh = false;

	public RegistryNode getConnectionInfo() {
		return registryUserManagerContainer.getRegistryNode();
	}

	/**
	 * RegistryUserRoleContainer constructor
	 * represent all the roles in the server
	 * @param registryUserManagerContainer
	 */
	public RegistryUserRoleContainer(RegistryUserManagerContainer registryUserManagerContainer) {
		setRegistryUserManagerContainer(registryUserManagerContainer);
	}

	/**
	 * get all roles of the server
	 * @return RegistryUserRole list
	 */
	public List<RegistryUserRole> getUserRoles() {
		if (userRoles == null || isIterativeRefresh()) {
			UserManager userManager = getRegistryUserManagerContainer().getUserManager();
			userRoles = new ArrayList<RegistryUserRole>();
			String[] roles = userManager.getRoles("*");
			for (String role : roles) {
				userRoles.add(new RegistryUserRole(role, this));
			}
		}
		return userRoles;
	}

	/**
	 * set RegistryUserManagerContainer
	 * @param registryUserManagerContainer
	 */
	public void setRegistryUserManagerContainer(
										RegistryUserManagerContainer registryUserManagerContainer) {
		this.registryUserManagerContainer = registryUserManagerContainer;
	}

	/**
	 * get RegistryUserManagerContainer
	 * @return
	 */
	public RegistryUserManagerContainer getRegistryUserManagerContainer() {
		return registryUserManagerContainer;
	}

	/**
	 * set IterativeRefresh
	 * @param iterativeRefresh
	 */
	public void setIterativeRefresh(boolean iterativeRefresh) {
		this.iterativeRefresh = iterativeRefresh;
	}

	/**
	 *
	 * @return
	 */
	public boolean isIterativeRefresh() {
		return iterativeRefresh;
	}

	/**
	 * get caption for roles to view in the tree view
	 * @return
	 */
	public String getCaption() {
		return "Roles";
	}

	/**
	 * get the caption
	 */
	public String toString() {
		return getCaption();
	}

}


text:
'use strict';

/**
 * @ngdoc function
 * @name kordingApp.controller:MaintoolbarCtrl
 * @description
 * # MaintoolbarCtrl
 * Controller of the kordingApp
 */
angular.module('kordingApp')
    .controller('MaintoolbarCtrl', function($scope, $mdDialog, $mdSidenav) {
        this.navLinks = [{
            label: 'Home',
            href: '/#/'
        }, {
            label: 'Scale',
            href: '/#/scale'
        }, {
            label: 'kamps-duac.github.io',
            href: 'http://kamps-duac.github.io'
        }];

        $scope.showTabDialog = function(ev) {
            $mdDialog.show({
                parent: angular.element(document.body),
                targetEvent: ev,
                templateUrl: 'views/pickerdialog.html',
                controller: 'PickerdialogCtrl',
                clickOutsideToClose: true
            });
        };

        $scope.openLeftMenu = function() {
            $mdSidenav('left').toggle();
        };

        $scope.closeLeftMenu = function() {
            $mdSidenav('left').toggle();
        };
    });


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Boletín de la Soc. Ciencias de Córdoba 11(4): 605 (1889)

#### Original name
Melophia sapindacearum Speg.

### Remarks
null


text:
/**

Fetch status information from mysql: http://dev.mysql.com/doc/refman/5.7/en/show-status.html

TODO @ruflin, 20160315
 * Complete fields read
 * Complete template
 * Complete dashboards

*/
package status

import (
	"database/sql"

	"github.com/elastic/beats/libbeat/common"
	"github.com/elastic/beats/libbeat/logp"

	"github.com/elastic/beats/metricbeat/helper"
	"github.com/elastic/beats/metricbeat/module/mysql"
)

func init() {
	if err := helper.Registry.AddMetricSeter("mysql", "status", New); err != nil {
		panic(err)
	}
}

// New creates new instance of MetricSeter
func New() helper.MetricSeter {
	return &MetricSeter{
		connections: map[string]*sql.DB{},
	}
}

// MetricSetter object
type MetricSeter struct {
	connections map[string]*sql.DB
}

// Setup any metric specific configuration
func (m *MetricSeter) Setup(ms *helper.MetricSet) error {

	// Additional configuration options
	config := struct {
		Username string `config:"username"`
		Password string `config:"password"`
	}{
		Username: "",
		Password: "",
	}

	for _, host := range ms.Config.Hosts {
		dsn := mysql.CreateDSN(host, config.Username, config.Password)

		db, err := mysql.Connect(dsn)
		if err != nil {
			logp.Err(err.Error())
		}

		m.connections[host] = db
	}

	return nil
}

// Fetches status messages from mysql hosts
func (m *MetricSeter) Fetch(ms *helper.MetricSet, host string) (event common.MapStr, err error) {

	db := m.connections[host]

	status, err := m.loadStatus(db)

	if err != nil {
		return nil, err
	}

	return eventMapping(status), nil

}

// loadStatus loads all status entries from the given database into an array
func (m *MetricSeter) loadStatus(db *sql.DB) (map[string]string, error) {

	// Returns the global status, also for versions previous 5.0.2
	rows, err := db.Query("SHOW /*!50002 GLOBAL */ STATUS;")
	if err != nil {
		return nil, err
	}

	mysqlStatus := map[string]string{}

	for rows.Next() {
		var name string
		var value string
		rows.Scan(&name, &value)

		mysqlStatus[name] = value
	}

	return mysqlStatus, nil
}


text:
package br.hugo.sistema.snmp;

import java.util.*;

/**
*    The SNMPVariablePair class implements the VarBind specification detailed below from RFC 1157.
*    It is a specialization of SNMPSequence, defining a 2-element sequence containing a single
*    (object identifier, value) pair. Note that the values are themselves SNMPObjects.

          -- variable bindings

          VarBind ::=
                  SEQUENCE {
                      name
                          ObjectName,

                      value
                          ObjectSyntax
                  }

*/

public class SNMPVariablePair extends SNMPSequence
{

    /**
    *    Create a new variable pair having the supplied object identifier and vale.
    */

    public SNMPVariablePair(SNMPObjectIdentifier objectID, SNMPObject value)
        throws SNMPBadValueException
    {
        super();
        Vector contents = new Vector();
        contents.insertElementAt(objectID, 0);
        contents.insertElementAt(value, 1);
        this.setValue(contents);
    }

}


text:
from gevent.pool import Pool
import logging
import os
import core.utils as utils

# Execute maximum 10 concurrent jobs at a time
pool = Pool(10)

class Abstract():
    """
    This method takes care to dispath the event to the plugins that
    are subscribed for it

    @param Resource resource
    @param string event
    @param string uri  - the path in the global resource tree
    @param string path - the local resource path
    @param array meta
    """
    def publish(self, request, resource, path, meta):
        """
        Implement this method in the child class
        """
        pass

class Enabled(Abstract):
    """
    Loads all enabled plugins and notifies them when an event occurs.
    Enabled modules are the ones that can be found in the pluginDirs
    """

    _pluginDirs =  [
        'core/notify/plugins/enabled',
    ]

    _plugins = [
        # plugin object (instance notify.plugins.base)
    ]

    loaded = False

    def __init__(self):
        self.loadPlugins()

    def loadPlugins(self, force=False):
        """
        Takes care to (re)load all notification plugins
        """

        if not Enabled.loaded or force == True:
            # Get all plugins from the plugin directories.
            # Load them and init them
            for directory in Enabled._pluginDirs:
                # get  files in the directory
                try:
                    files = os.listdir(directory)
                except:
                    logging.getLogger().warn('Invalid Notification Plugin Directory: %s' % directory)
                    continue

                files.sort()
                for file in files:
                    if file[-3:]!='.py' or file[0:1] == '_':
                        continue
                    klass = utils.require(directory+'/'+file,'Plugin')
                    Enabled._plugins.append(klass())
            Enabled.loaded = True

    """
    This method takes care to dispath the event to the plugins that
    are subscribed for it

    @param Resource resource
    @param string event
    @param string uri  - the path in the global resource tree
    @param string path - the local resource path
    @param array meta
    """
    def publish(self, user, request, resource, path, meta):
        for plugin in Enabled._plugins:
            if plugin.canProcess(request.method, meta):
                # run the jobs in parallel
                pool.spawn(plugin.process, user, request, resource, path, meta)

class UserEnabled(Enabled):
    """
    This method takes care to dispath the event to the plugins that
    are subscribed for it

    @param Resource resource
    @param string event
    @param string uri  - the path in the global resource tree
    @param string path - the local resource path
    @param array meta
    """
    def publish(self, user, request, resource, path, meta):
        plugins = self.getUserPlugins(user,path)
        for plugin in plugins:
            if plugin.canProcess(request.method, meta):
                # run the jobs in parallel
                pool.spawn(plugin.process, user, request, resource, path, meta)

    def getUserPlugins(self, user, path):
        """
        Decides which plugins can be used from the current user for
        the given path based on the user settings.
        """

        """
        # @todo:
        User.Settings.Notification has:
            user
            path
            plugin
            options = {}
        """

        return self._plugins

        # @todo: Implement the user object

        plugins = []
        for notification in user.get('property').notifications:
            if notification.path.startswith(node.path):
                plugins.append(self._plugins[notification.plugin])

        return plugins

class Manual(Abstract):
    """
    Loads plugins and notifies them when a event occurs
    """

    _plugins = [
        # plugin object (instance notify.plugins.base)
    ]

    """
    @param user user
    @param list plugins list of objects instances of notify.plugins.base
    """
    def __init__(self, plugins):
        if type(plugins)!=list:
            raise ValueError("Plugins parameter must be list")
        self._plugins = plugins

    """
    This method takes care to dispath the event to the plugins that
    are subscribed for it

    @param Resource resource
    @param string event
    @param string uri  - the path in the global resource tree
    @param string path - the local resource path
    @param array meta
    """
    def publish(self, user, request, resource, path, meta):
        for plugin in self._plugins:
            if plugin.canProcess(request.method, meta):
                # run the jobs in parallel
                pool.spawn(plugin.process, user, request, resource, path, meta)


text:
#ifndef _WIN32
#include <sys/time.h>
#endif
#include "struct.h"
#include "common.h"
#include "sys.h"
#include "numeric.h"
#include <sys/stat.h>
#include <fcntl.h>
#include <assert.h>
#if !defined(ULTRIX) && !defined(SGI) && \
    !defined(__convex__) && !defined(_WIN32)
# include <sys/param.h>
#endif
#if defined(PCS) || defined(AIX) || defined(SVR3)
# include <time.h>
#endif
#ifdef HPUX
#include <unistd.h>
#endif
#ifdef _WIN32
# include <io.h>
#endif
#include "h.h"
#include "proto.h"
#include "channel.h"
#include <string.h>

extern ircstats IRCstats;
extern char	*me_hash;

static void exit_one_client(aClient *, const char *);

static char *months[] = {
	"January", "February", "March", "April",
	"May", "June", "July", "August",
	"September", "October", "November", "December"
};

static char *weekdays[] = {
	"Sunday", "Monday", "Tuesday", "Wednesday",
	"Thursday", "Friday", "Saturday"
};

typedef struct {
	int value;			/** Unique integer value of item */
	char character;		/** Unique character assigned to item */
	char *name;			/** Name of item */
} BanActTable;

static BanActTable banacttable[] = {
	{ BAN_ACT_KILL,		'K',	"kill" },
	{ BAN_ACT_TEMPSHUN,	'S',	"tempshun" },
	{ BAN_ACT_SHUN,		's',	"shun" },
	{ BAN_ACT_KLINE,	'k',	"kline" },
	{ BAN_ACT_ZLINE,	'z',	"zline" },
	{ BAN_ACT_GLINE,	'g',	"gline" },
	{ BAN_ACT_GZLINE,	'Z',	"gzline" },
	{ BAN_ACT_BLOCK,	'b',	"block" },
	{ BAN_ACT_DCCBLOCK,	'd',	"dccblock" },
	{ BAN_ACT_VIRUSCHAN,'v',	"viruschan" },
	{ BAN_ACT_WARN,		'w',	"warn" },
	{ 0, 0, 0 }
};

typedef struct {
	int value;			/** Unique integer value of item */
	char character;		/** Unique character assigned to item */
	char *name;			/** Name of item */
	char *irccommand;	/** Raw IRC command of item (not unique!) */
} SpamfilterTargetTable;

SpamfilterTargetTable spamfiltertargettable[] = {
	{ SPAMF_CHANMSG,	'c',	"channel",			"PRIVMSG" },
	{ SPAMF_USERMSG,	'p',	"private",			"PRIVMSG" },
	{ SPAMF_USERNOTICE,	'n',	"private-notice",	"NOTICE" },
	{ SPAMF_CHANNOTICE,	'N',	"channel-notice",	"NOTICE" },
	{ SPAMF_PART,		'P',	"part",				"PART" },
	{ SPAMF_QUIT,		'q',	"quit",				"QUIT" },
	{ SPAMF_DCC,		'd',	"dcc",				"PRIVMSG" },
	{ SPAMF_USER,		'u',	"user",				"NICK" },
	{ SPAMF_AWAY,		'a',	"away",				"AWAY" },
	{ SPAMF_TOPIC,		't',	"topic",			"TOPIC" },
	{ 0, 0, 0 }
};

/*
 * stats stuff
 */
struct stats ircst, *ircstp = &ircst;

char *date(time_t clock)
{
	static char buf[80], plus;
	struct tm *lt, *gm;
	struct tm gmbuf;
	int  minswest;

	if (!clock)
		time(&clock);
	gm = gmtime(&clock);
	bcopy((char *)gm, (char *)&gmbuf, sizeof(gmbuf));
	gm = &gmbuf;
	lt = localtime(&clock);
#ifndef _WIN32
	if (lt->tm_yday == gm->tm_yday)
		minswest = (gm->tm_hour - lt->tm_hour) * 60 +
		    (gm->tm_min - lt->tm_min);
	else if (lt->tm_yday > gm->tm_yday)
		minswest = (gm->tm_hour - (lt->tm_hour + 24)) * 60;
	else
		minswest = ((gm->tm_hour + 24) - lt->tm_hour) * 60;
#else
	minswest = (_timezone / 60);
#endif
	plus = (minswest > 0) ? '-' : '+';
	if (minswest < 0)
		minswest = -minswest;
	ircsnprintf(buf, sizeof(buf), "%s %s %d %d -- %02d:%02d %c%02d:%02d",
	    weekdays[lt->tm_wday], months[lt->tm_mon], lt->tm_mday,
	    1900 + lt->tm_year,
	    lt->tm_hour, lt->tm_min, plus, minswest / 60, minswest % 60);

	return buf;
}

char *convert_time (time_t ltime)
{
	unsigned long days = 0,hours = 0,minutes = 0,seconds = 0;
	static char buffer[40];

	*buffer = '\0';
	seconds = ltime % 60;
	ltime = (ltime - seconds) / 60;
	minutes = ltime%60;
	ltime = (ltime - minutes) / 60;
	hours = ltime % 24;
	days = (ltime - hours) / 24;
	ircsnprintf(buffer, sizeof(buffer), "%ludays %luhours %luminutes %lusecs",
days, hours, minutes, seconds);
	return buffer;
}

/*
 *  Fixes a string so that the first white space found becomes an end of
 * string marker (`\-`).  returns the 'fixed' string or "*" if the string
 * was NULL length or a NULL pointer.
 */
char *check_string(char *s)
{
	static char star[2] = "*";
	char *str = s;

	if (BadPtr(s))
		return star;

	for (; *s; s++)
		if (isspace(*s))
		{
			*s = '\0';
			break;
		}

	return (BadPtr(str)) ? star : str;
}

char *make_user_host(char *name, char *host)
{
	static char namebuf[USERLEN + HOSTLEN + 6];
	char *s = namebuf;

	bzero(namebuf, sizeof(namebuf));
	name = check_string(name);
	strlcpy(s, name, USERLEN + 1);
	s += strlen(s);
	*s++ = '@';
	host = check_string(host);
	strlcpy(s, host, HOSTLEN + 1);
	s += strlen(s);
	*s = '\0';
	return (namebuf);
}

/*
 * create a string of form "foo!bar@fubar" given foo, bar and fubar
 * as the parameters.  If NULL, they become "*".
 */
char *make_nick_user_host_r(char *namebuf, char *nick, char *name, char *host)
{
	char *s = namebuf;

	nick = check_string(nick);
	strlcpy(namebuf, nick, NICKLEN + 1);
	s += strlen(s);
	*s++ = '!';
	name = check_string(name);
	strlcpy(s, name, USERLEN + 1);
	s += strlen(s);
	*s++ = '@';
	host = check_string(host);
	strlcpy(s, host, HOSTLEN + 1);
	s += strlen(s);
	*s = '\0';
	return namebuf;
}

/*
 * create a string of form "foo!bar@fubar" given foo, bar and fubar
 * as the parameters.  If NULL, they become "*".
 */
char *make_nick_user_host(char *nick, char *name, char *host)
{
	static char namebuf[NICKLEN + USERLEN + HOSTLEN + 24];

	return make_nick_user_host_r(namebuf, nick, name, host);
}

/**
 ** myctime()
 **   This is like standard ctime()-function, but it zaps away
 **   the newline from the end of that string. Also, it takes
 **   the time value as parameter, instead of pointer to it.
 **   Note that it is necessary to copy the string to alternate
 **   buffer (who knows how ctime() implements it, maybe it statically
 **   has newline there and never 'refreshes' it -- zapping that
 **   might break things in other places...)
 **
 **/

char *myctime(time_t value)
{
	static char buf[28];
	char *p;

	(void)strlcpy(buf, ctime(&value), sizeof buf);
	if ((p = (char *)index(buf, '\n')) != NULL)
		*p = '\0';

	return buf;
}

/*
** check_registered_user is used to cancel message, if the
** originator is a server or not registered yet. In other
** words, passing this test, *MUST* guarantee that the
** sptr->user exists (not checked after this--let there
** be coredumps to catch bugs... this is intentional --msa ;)
**
** There is this nagging feeling... should this NOT_REGISTERED
** error really be sent to remote users? This happening means
** that remote servers have this user registered, althout this
** one has it not... Not really users fault... Perhaps this
** error message should be restricted to local clients and some
** other thing generated for remotes...
*/
int  check_registered_user(aClient *sptr)
{
	if (!IsRegisteredUser(sptr))
	{
		sendto_one(sptr, err_str(ERR_NOTREGISTERED), me.name, "*");
		return -1;
	}
	return 0;
}

/*
** check_registered user cancels message, if 'x' is not
** registered (e.g. we don't know yet whether a server
** or user)
*/
int  check_registered(aClient *sptr)
{
	if (!IsRegistered(sptr))
	{
		sendto_one(sptr, err_str(ERR_NOTREGISTERED), me.name, "*");
		return -1;
	}
	return 0;
}

/*
** get_client_name
**      Return the name of the client for various tracking and
**      admin purposes. The main purpose of this function is to
**      return the "socket host" name of the client, if that
**	differs from the advertised name (other than case).
**	But, this can be used to any client structure.
**
**	Returns:
**	  "name[user@ip#.port]" if 'showip' is true;
**	  "name[sockethost]", if name and sockhost are different and
**	  showip is false; else
**	  "name".
**
** NOTE 1:
**	Watch out the allocation of "nbuf", if either sptr->name
**	or sptr->local->sockhost gets changed into pointers instead of
**	directly allocated within the structure...
**
** NOTE 2:
**	Function return either a pointer to the structure (sptr) or
**	to internal buffer (nbuf). *NEVER* use the returned pointer
**	to modify what it points!!!
*/
char *get_client_name(aClient *sptr, int showip)
{
	static char nbuf[HOSTLEN * 2 + USERLEN + 5];

	if (MyConnect(sptr))
	{
		if (showip)
			(void)ircsnprintf(nbuf, sizeof(nbuf), "%s[%s@%s.%u]",
			    sptr->name,
			    (!(sptr->flags & FLAGS_GOTID)) ? "" :
			    sptr->username,
			    sptr->ip ? sptr->ip : "???",
			    (unsigned int)sptr->local->port);
		else
		{
			if (mycmp(sptr->name, sptr->local->sockhost))
				(void)ircsnprintf(nbuf, sizeof(nbuf), "%s[%s]",
				    sptr->name, sptr->local->sockhost);
			else
				return sptr->name;
		}
		return nbuf;
	}
	return sptr->name;
}

char *get_client_host(aClient *cptr)
{
	static char nbuf[HOSTLEN * 2 + USERLEN + 5];

	if (!MyConnect(cptr))
		return cptr->name;
	if (!cptr->local->hostp)
		return get_client_name(cptr, FALSE);
	(void)ircsnprintf(nbuf, sizeof(nbuf), "%s[%-.*s@%-.*s]",
	    cptr->name, USERLEN,
  	    (!(cptr->flags & FLAGS_GOTID)) ? "" : cptr->username,
	    HOSTLEN, cptr->local->hostp->h_name);
	return nbuf;
}

/*
 * Set sockhost to 'host'. Skip the user@ part of 'host' if necessary.
 */
void set_sockhost(aClient *cptr, char *host)
{
	char *s;
	if ((s = (char *)index(host, '@')))
		s++;
	else
		s = host;
	strlcpy(cptr->local->sockhost, s, sizeof(cptr->local->sockhost));
}

void remove_dcc_references(aClient *sptr)
{
aClient *acptr;
Link *lp, *nextlp;
Link **lpp, *tmp;
int found;

	lp = sptr->user->dccallow;
	while(lp)
	{
		nextlp = lp->next;
		acptr = lp->value.cptr;
		for(found = 0, lpp = &(acptr->user->dccallow); *lpp; lpp=&((*lpp)->next))
		{
			if(lp->flags == (*lpp)->flags)
				continue; /* match only opposite types for sanity */
			if((*lpp)->value.cptr == sptr)
			{
				if((*lpp)->flags == DCC_LINK_ME)
				{
					sendto_one(acptr, ":%s %d %s :%s has been removed from "
						"your DCC allow list for signing off",
						me.name, RPL_DCCINFO, acptr->name, sptr->name);
				}
				tmp = *lpp;
				*lpp = tmp->next;
				free_link(tmp);
				found++;
				break;
			}
		}

		if(!found)
			sendto_realops("[BUG] remove_dcc_references:  %s was in dccallowme "
				"list[%d] of %s but not in dccallowrem list!",
				acptr->name, lp->flags, sptr->name);

		free_link(lp);
		lp = nextlp;
	}
}

/*
 * Recursively send QUITs and SQUITs for cptr and all of it's dependent
 * clients.  A server needs the client QUITs if it does not support NOQUIT.
 *    - kaniini
 */
static void
recurse_send_quits(aClient *cptr, aClient *sptr, aClient *from, aClient *to,
	const char *comment, const char *splitstr)
{
	aClient *acptr, *next;

	if (!MyConnect(to))
		return; /* We shouldn't even be called for non-remotes */

	if (!CHECKPROTO(to, PROTO_NOQUIT))
	{
		list_for_each_entry_safe(acptr, next, &client_list, client_node)
		{
			if (acptr->srvptr != sptr)
				continue;

			sendto_one(to, ":%s QUIT :%s", acptr->name, splitstr);
		}
	}

	list_for_each_entry_safe(acptr, next, &global_server_list, client_node)
	{
		if (acptr->srvptr != sptr)
			continue;

		recurse_send_quits(cptr, acptr, from, to, comment, splitstr);
	}

	if ((cptr == sptr && to != from) || !CHECKPROTO(to, PROTO_NOQUIT))
		sendto_one(to, "SQUIT %s :%s", sptr->name, comment);
}

/*
 * Remove all clients that depend on source_p; assumes all (S)QUITs have
 * already been sent.  we make sure to exit a server's dependent clients
 * and servers before the server itself; exit_one_client takes care of
 * actually removing things off llists.   tweaked from +CSr31  -orabidoo
 */
static void
recurse_remove_clients(aClient *sptr, const char *comment)
{
	aClient *acptr, *next;

	list_for_each_entry_safe(acptr, next, &client_list, client_node)
	{
		if (acptr->srvptr != sptr)
			continue;

		exit_one_client(acptr, comment);
	}

	list_for_each_entry_safe(acptr, next, &global_server_list, client_node)
	{
		if (acptr->srvptr != sptr)
			continue;

		recurse_remove_clients(acptr, comment);
		exit_one_client(acptr, comment);
	}
}

/*
** Remove *everything* that depends on source_p, from all lists, and sending
** all necessary QUITs and SQUITs.  source_p itself is still on the lists,
** and its SQUITs have been sent except for the upstream one  -orabidoo
*/
static void
remove_dependents(aClient *sptr, aClient *from, const char *comment, const char *splitstr)
{
	aClient *acptr;

	list_for_each_entry(acptr, &global_server_list, client_node)
		recurse_send_quits(sptr, sptr, from, acptr, comment, splitstr);

	recurse_remove_clients(sptr, splitstr);
}

/*
** Exit one client, local or remote. Assuming all dependants have
** been already removed, and socket closed for local client.
*/
/* DANGER: Ugly hack follows. */
/* Yeah :/ */
static void exit_one_client(aClient *sptr, const char *comment)
{
	Link *lp;
	Membership *mp;

	assert(!IsMe(sptr));

	if (IsClient(sptr))
	{
		sendto_common_channels(sptr, ":%s QUIT :%s",
		    sptr->name, comment);

		if (!MyClient(sptr))
		{
			RunHook2(HOOKTYPE_REMOTE_QUIT, sptr, comment);
		}

		/* This hook may or may not be redundant */
		RunHook(HOOKTYPE_EXIT_ONE_CLIENT, sptr);

		while ((mp = sptr->user->channel))
			remove_user_from_channel(sptr, mp->chptr);

		/* Clean up invitefield */
		while ((lp = sptr->user->invited))
			del_invite(sptr, lp->value.chptr);
		/* again, this is all that is needed */

		/* Clean up silencefield */
		while ((lp = sptr->user->silence))
			(void)del_silence(sptr, lp->value.cp);

		/* Clean up dccallow list and (if needed) notify other clients
		 * that have this person on DCCALLOW that the user just left/got removed.
		 */
		remove_dcc_references(sptr);

		/* For remote clients, we need to check for any outstanding async
		 * connects attached to this 'sptr', and set those records to NULL.
		 * Why not for local? Well, we already do that in close_connection ;)
		 */
		if (!MyConnect(sptr))
			unrealdns_delreq_bycptr(sptr);

		/* Free module related data for this client */
		moddata_free_client(sptr);
	}

	/* Remove sptr from the client list */
	if (*sptr->id)
		del_from_id_hash_table(sptr->id, sptr);
	if (*sptr->name)
		del_from_client_hash_table(sptr->name, sptr);
	if (IsRegisteredUser(sptr))
		hash_check_watch(sptr, RPL_LOGOFF);
	if (remote_rehash_client == sptr)
		remote_rehash_client = NULL; /* client did a /REHASH and QUIT before rehash was complete */
	remove_client_from_list(sptr);
}

/*
** exit_client
**	This is old "m_bye". Name  changed, because this is not a
**	protocol function, but a general server utility function.
**
**	This function exits a client of *any* type (user, server, etc)
**	from this server. Also, this generates all necessary prototol
**	messages that this exit may cause.
**
**   1) If the client is a local client, then this implicitly
**	exits all other clients depending on this connection (e.g.
**	remote clients having 'from'-field that points to this.
**
**   2) If the client is a remote client, then only this is exited.
**
** For convenience, this function returns a suitable value for
** m_funtion return value:
**
**	FLUSH_BUFFER	if (cptr == sptr)
**	0		if (cptr != sptr)
*/
int  exit_client(aClient *cptr, aClient *sptr, aClient *from, char *comment)
{
	time_t on_for;
	ConfigItem_listen *listen_conf;

	if (MyConnect(sptr))
	{
		if (sptr->local->class)
		{
			sptr->local->class->clients--;
			if ((sptr->local->class->flag.temporary) && !sptr->local->class->clients && !sptr->local->class->xrefcount)
			{
				delete_classblock(sptr->local->class);
				sptr->local->class = NULL;
			}
		}
		if (IsClient(sptr))
			IRCstats.me_clients--;
		if (sptr->serv && sptr->serv->conf)
		{
			sptr->serv->conf->refcount--;
			Debug((DEBUG_ERROR, "reference count for %s (%s) is now %d",
				sptr->name, sptr->serv->conf->servername, sptr->serv->conf->refcount));
			if (!sptr->serv->conf->refcount
			  && sptr->serv->conf->flag.temporary)
			{
				Debug((DEBUG_ERROR, "deleting temporary block %s", sptr->serv->conf->servername));
				delete_linkblock(sptr->serv->conf);
				sptr->serv->conf = NULL;
			}
		}
		if (IsServer(sptr))
		{
			IRCstats.me_servers--;
			ircd_log(LOG_SERVER, "SQUIT %s (%s)", sptr->name, comment);
		}
		free_pending_net(sptr);
		if (sptr->local->listener)
			if (sptr->local->listener && !IsOutgoing(sptr))
			{
				listen_conf = sptr->local->listener;
				listen_conf->clients--;
				if (listen_conf->flag.temporary && (listen_conf->clients == 0))
				{
					/* Call listen cleanup */
					listen_cleanup();
				}
			}
		sptr->flags |= FLAGS_CLOSING;
		if (IsPerson(sptr))
		{
			RunHook2(HOOKTYPE_LOCAL_QUIT, sptr, comment);
			sendto_connectnotice(sptr, 1, comment);
			/* Clean out list and watch structures -Donwulff */
			hash_del_watch_list(sptr);
			if (sptr->user && sptr->user->lopt)
			{
				free_str_list(sptr->user->lopt->yeslist);
				free_str_list(sptr->user->lopt->nolist);
				MyFree(sptr->user->lopt);
			}
			on_for = TStime() - sptr->local->firsttime;
			if (IsHidden(sptr))
				ircd_log(LOG_CLIENT, "Disconnect - (%ld:%ld:%ld) %s!%s@%s [VHOST %s] (%s)",
					on_for / 3600, (on_for % 3600) / 60, on_for % 60,
					sptr->name, sptr->user->username,
					sptr->user->realhost, sptr->user->virthost, comment);
			else
				ircd_log(LOG_CLIENT, "Disconnect - (%ld:%ld:%ld) %s!%s@%s (%s)",
					on_for / 3600, (on_for % 3600) / 60, on_for % 60,
					sptr->name, sptr->user->username, sptr->user->realhost, comment);
		} else
		if (IsUnknown(sptr))
		{
			RunHook2(HOOKTYPE_UNKUSER_QUIT, sptr, comment);
		}

		if (sptr->fd >= 0 && !IsConnecting(sptr))
		{
			if (cptr != NULL && sptr != cptr)
				sendto_one(sptr,
				    "ERROR :Closing Link: %s %s (%s)",
				    get_client_name(sptr, FALSE), cptr->name,
				    comment);
			else
				sendto_one(sptr, "ERROR :Closing Link: %s (%s)",
				    get_client_name(sptr, FALSE), comment);
		}
		/*
		   ** Currently only server connections can have
		   ** depending remote clients here, but it does no
		   ** harm to check for all local clients. In
		   ** future some other clients than servers might
		   ** have remotes too...
		   **
		   ** Close the Client connection first and mark it
		   ** so that no messages are attempted to send to it.
		   ** (The following *must* make MyConnect(sptr) == FALSE!).
		   ** It also makes sptr->from == NULL, thus it's unnecessary
		   ** to test whether "sptr != acptr" in the following loops.
		 */
		close_connection(sptr);
	}
	else if (IsPerson(sptr) && !IsULine(sptr))
	{
		if (sptr->srvptr != &me)
			sendto_fconnectnotice(sptr, 1, comment);
	}

	/*
	 * Recurse down the client list and get rid of clients who are no
	 * longer connected to the network (from my point of view)
	 * Only do this expensive stuff if exited==server -Donwulff
	 */
	if (IsServer(sptr))
	{
		char splitstr[HOSTLEN + HOSTLEN + 2];

		assert(sptr->serv != NULL && sptr->srvptr != NULL);

		if (FLAT_MAP)
			strlcpy(splitstr, "*.net *.split", sizeof splitstr);
		else
			ircsnprintf(splitstr, sizeof splitstr, "%s %s", sptr->srvptr->name, sptr->name);

		remove_dependents(sptr, cptr, comment, splitstr);

		RunHook(HOOKTYPE_SERVER_QUIT, sptr);
	}
	else if (IsClient(sptr) && !(sptr->flags & FLAGS_KILLED))
	{
		sendto_server(cptr, PROTO_SID, 0,
			":%s QUIT :%s", ID(sptr), comment);
		sendto_server(cptr, 0, PROTO_SID,
			":%s QUIT :%s", sptr->name, comment);
	}

	/*
	 * Finally, clear out the server we lost itself
	 */
	exit_one_client(sptr, comment);
	return cptr == sptr ? FLUSH_BUFFER : 0;
}

void checklist(void)
{
	if (!(bootopt & BOOT_AUTODIE))
		return;

	if (!list_empty(&lclient_list))
		exit (0);

	return;
}

void initstats(void)
{
	bzero((char *)&ircst, sizeof(ircst));
}

void verify_opercount(aClient *orig, char *tag)
{
int counted = 0;
aClient *acptr;
char text[2048];

	list_for_each_entry(acptr, &client_list, client_node)
	{
		if (IsOper(acptr) && !IsHideOper(acptr))
			counted++;
	}
	if (counted == IRCstats.operators)
		return;
	snprintf(text, sizeof(text), "[BUG] operator count bug! value in /lusers is '%d', we counted '%d', "
	               "user='%s', userserver='%s', tag=%s. Corrected. ",
	               IRCstats.operators, counted, orig->name,
	               orig->srvptr ? orig->srvptr->name : "<null>", tag ? tag : "<null>");
#ifdef DEBUGMODE
	sendto_realops("%s", text);
#endif
	ircd_log(LOG_ERROR, "%s", text);
	IRCstats.operators = counted;
}

/** Check if the specified hostname does not contain forbidden characters.
 * RETURNS:
 * 1 if ok, 0 if rejected.
 */
int valid_host(char *host)
{
	char *p;

	if (strlen(host) > HOSTLEN)
		return 0; /* too long hosts are invalid too */

	for (p=host; *p; p++)
		if (!isalnum(*p) && (*p != '_') && (*p != '-') && (*p != '.') && (*p != ':'))
			return 0;

	return 1;
}

/** Checks if the specified regex (or fast badwords) is valid.
 * returns NULL in case of success [!],
 * pointer to buffer with error message otherwise
 * if check_broadness is 1, the function will attempt to determine
 * if the given regex string is too broad (i.e. matches everything)
 */
char *unreal_checkregex(char *s, int fastsupport, int check_broadness)
{
int errorcode, errorbufsize, regex=0;
char *errtmp, *tmp;
static char errorbuf[512];
regex_t expr;

	if (fastsupport)
	{
		for (tmp = s; *tmp; tmp++) {
			if (!isalnum(*tmp) && !(*tmp >= 128)) {
				if ((s == tmp) && (*tmp == '*'))
					continue;
				if ((*(tmp + 1) == '\0') && (*tmp == '*'))
					continue;
				regex = 1;
				break;
			}
		}
	}
	if (!fastsupport || regex)
	{
		errorcode = regcomp(&expr, s, REG_ICASE|REG_EXTENDED);
		if (errorcode > 0)
		{
			errorbufsize = regerror(errorcode, &expr, NULL, 0)+1;
			errtmp = MyMalloc(errorbufsize);
			regerror(errorcode, &expr, errtmp, errorbufsize);
			strlcpy(errorbuf, errtmp, sizeof(errorbuf));
			free(errtmp);
			regfree(&expr);
			return errorbuf;
		}
		if (check_broadness && !regexec(&expr, "", 0, NULL, 0))
		{
			strlcpy(errorbuf, "Regular expression is too broad", sizeof(errorbuf));
			regfree(&expr);
			return errorbuf;
		}
		regfree(&expr);
	}
	return NULL;
}

/*|| BAN ACTION ROUTINES FOLLOW ||*/

/** Converts a banaction string (eg: "kill") to an integer value (eg: BAN_ACT_KILL) */
int banact_stringtoval(char *s)
{
BanActTable *b;

	for (b = &banacttable[0]; b->value; b++)
		if (!strcasecmp(s, b->name))
			return b->value;
	return 0;
}

/** Converts a banaction character (eg: 'K') to an integer value (eg: BAN_ACT_KILL) */
int banact_chartoval(char c)
{
BanActTable *b;

	for (b = &banacttable[0]; b->value; b++)
		if (b->character == c)
			return b->value;
	return 0;
}

/** Converts a banaction value (eg: BAN_ACT_KILL) to a character value (eg: 'k') */
char banact_valtochar(int val)
{
BanActTable *b;

	for (b = &banacttable[0]; b->value; b++)
		if (b->value == val)
			return b->character;
	return '\0';
}

/** Converts a banaction value (eg: BAN_ACT_KLINE) to a string (eg: "kline") */
char *banact_valtostring(int val)
{
BanActTable *b;

	for (b = &banacttable[0]; b->value; b++)
		if (b->value == val)
			return b->name;
	return "UNKNOWN";
}

/*|| BAN TARGET ROUTINES FOLLOW ||*/

/** Extract target flags from string 's'. */
int spamfilter_gettargets(char *s, aClient *sptr)
{
SpamfilterTargetTable *e;
int flags = 0;

	for (; *s; s++)
	{
		for (e = &spamfiltertargettable[0]; e->value; e++)
			if (e->character == *s)
			{
				flags |= e->value;
				break;
			}
		if (!e->value && sptr)
		{
			sendnotice(sptr, "Unknown target type '%c'", *s);
			return 0;
		}
	}
	return flags;
}

/** Convert a string with a targetname to an integer value */
int spamfilter_getconftargets(char *s)
{
SpamfilterTargetTable *e;

	for (e = &spamfiltertargettable[0]; e->value; e++)
		if (!strcmp(s, e->name))
			return e->value;
	return 0;
}

/** Create a string with (multiple) targets from an integer mask */
char *spamfilter_target_inttostring(int v)
{
static char buf[128];
SpamfilterTargetTable *e;
char *p = buf;

	for (e = &spamfiltertargettable[0]; e->value; e++)
		if (v & e->value)
			*p++ = e->character;
	*p = '\0';
	return buf;
}

char *unreal_decodespace(char *s)
{
static char buf[512], *i, *o;
	for (i = s, o = buf; (*i) && (o < buf+510); i++)
		if (*i == '_')
		{
			if (i[1] != '_')
				*o++ = ' ';
			else {
				*o++ = '_';
				i++;
			}
		}
		else
			*o++ = *i;
	*o = '\0';
	return buf;
}

char *unreal_encodespace(char *s)
{
static char buf[512], *i, *o;

	if (!s)
		return NULL; /* NULL in = NULL out */

	for (i = s, o = buf; (*i) && (o < buf+509); i++)
	{
		if (*i == ' ')
			*o++ = '_';
		else if (*i == '_')
		{
			*o++ = '_';
			*o++ = '_';
		}
		else
			*o++ = *i;
	}
	*o = '\0';
	return buf;
}

/** This is basically only used internally by dospamfilter()... */
char *cmdname_by_spamftarget(int target)
{
SpamfilterTargetTable *e;

	for (e = &spamfiltertargettable[0]; e->value; e++)
		if (e->value == target)
			return e->irccommand;
	return "???";
}

int is_autojoin_chan(char *chname)
{
char buf[512];
char *p, *name;

	if (OPER_AUTO_JOIN_CHANS)
	{
		strlcpy(buf, OPER_AUTO_JOIN_CHANS, sizeof(buf));

		for (name = strtoken(&p, buf, ","); name; name = strtoken(&p, NULL, ","))
			if (!strcasecmp(name, chname))
				return 1;
	}

	if (AUTO_JOIN_CHANS)
	{
		strlcpy(buf, AUTO_JOIN_CHANS, sizeof(buf));

		for (name = strtoken(&p, buf, ","); name; name = strtoken(&p, NULL, ","))
			if (!strcasecmp(name, chname))
				return 1;
	}

	return 0;
}

char *getcloak(aClient *sptr)
{
	if (!*sptr->user->cloakedhost)
	{
		/* need to calculate (first-time) */
		make_virthost(sptr, sptr->user->realhost, sptr->user->cloakedhost, 0);
	}

	return sptr->user->cloakedhost;
}

int mixed_network(void)
{
	aClient *acptr;

	list_for_each_entry(acptr, &server_list, special_node)
	{
		if (!IsServer(acptr) || IsULine(acptr))
			continue; /* skip u-lined servers (=non-unreal, unless you configure your ulines badly, that is) */
		if (SupportTKLEXT(acptr) && !SupportTKLEXT2(acptr))
			return 1; /* yup, something below 3.4-alpha3 is linked */
	}
	return 0;
}

/** Free all masks in the mask list */
void unreal_delete_masks(ConfigItem_mask *m)
{
	ConfigItem_mask *m_next;

	for (; m; m = m_next)
	{
		m_next = m->next;

		safefree(m->mask);

		MyFree(m);
	}
}

/** Internal function to add one individual mask to the list */
static void unreal_add_mask(ConfigItem_mask **head, ConfigEntry *ce)
{
	ConfigItem_mask *m = MyMallocEx(sizeof(ConfigItem_mask));

	/* Since we allow both mask "xyz"; and mask { abc; def; };... */
	if (!strcmp(ce->ce_varname, "mask") && ce->ce_vardata)
		safestrdup(m->mask, ce->ce_vardata);
	else
		safestrdup(m->mask, ce->ce_varname);

	add_ListItem((ListStruct *)m, (ListStruct **)head);
}

/** Add mask entries from config */
void unreal_add_masks(ConfigItem_mask **head, ConfigEntry *ce)
{
	if (ce->ce_entries)
	{
		ConfigEntry *cep;
		for (cep = ce->ce_entries; cep; cep = cep->ce_next)
			unreal_add_mask(head, cep);
	} else
	{
		unreal_add_mask(head, ce);
	}
}

/** Check if a client matches any of the masks in the mask list */
int unreal_mask_match(aClient *acptr, ConfigItem_mask *m)
{
	for (; m; m = m->next)
	{
		if (match_user(m->mask, acptr, MATCH_CHECK_REAL))
			return 1;
	}

	return 0;
}

/*
 * our own strcasestr implementation because strcasestr is often not
 * available or is not working correctly.
 */
char *our_strcasestr(char *haystack, char *needle) {
int i;
int nlength = strlen (needle);
int hlength = strlen (haystack);

	if (nlength > hlength) return NULL;
	if (hlength <= 0) return NULL;
	if (nlength <= 0) return haystack;
	for (i = 0; i <= (hlength - nlength); i++) {
		if (strncasecmp (haystack + i, needle, nlength) == 0)
			return haystack + i;
	}
  return NULL; /* not found */
}

int swhois_add(aClient *acptr, char *tag, int priority, char *swhois, aClient *from, aClient *skip)
{
	SWhois *s;

	/* Make sure the line isn't added yet. If so, then bail out silently. */
	for (s = acptr->user->swhois; s; s = s->next)
		if (!strcmp(s->line, swhois))
			return -1; /* exists */

	s = MyMallocEx(sizeof(SWhois));
	s->line = strdup(swhois);
	s->setby = strdup(tag);
	s->priority = priority;
	AddListItemPrio(s, acptr->user->swhois, s->priority);

	sendto_server(skip, 0, PROTO_EXTSWHOIS, ":%s SWHOIS %s :%s",
		from->name, acptr->name, swhois);

	sendto_server(skip, PROTO_EXTSWHOIS, 0, ":%s SWHOIS %s + %s %d :%s",
		from->name, acptr->name, tag, priority, swhois);

	return 0;
}

/** Delete swhois title(s)
 * Delete swhois by tag and swhois. Then broadcast this change to all other servers.
 * Remark: if you use swhois "*" then it will remove all swhois titles for that tag
 */
int swhois_delete(aClient *acptr, char *tag, char *swhois, aClient *from, aClient *skip)
{
	SWhois *s, *s_next;
	int ret = -1; /* default to 'not found' */

	for (s = acptr->user->swhois; s; s = s_next)
	{
		s_next = s->next;

		/* If ( same swhois or "*" ) AND same tag */
		if ( ((!strcmp(s->line, swhois) || !strcmp(swhois, "*")) &&
		    !strcmp(s->setby, tag)))
		{
			DelListItem(s, acptr->user->swhois);
			MyFree(s->line);
			MyFree(s->setby);
			MyFree(s);

			sendto_server(skip, 0, PROTO_EXTSWHOIS, ":%s SWHOIS %s :",
				from->name, acptr->name);

			sendto_server(skip, PROTO_EXTSWHOIS, 0, ":%s SWHOIS %s - %s %d :%s",
				from->name, acptr->name, tag, 0, swhois);

			ret = 0;
		}
	}

	return ret;
}


text:
package org.eclipse.jdt.ui.cleanup;

import org.eclipse.core.runtime.Assert;

import org.eclipse.jdt.core.ICompilationUnit;
import org.eclipse.jdt.core.dom.CompilationUnit;

/**
 * The context that contains all information required by a clean up to create a fix.
 *
 * @since 3.5
 */
public class CleanUpContext {

	private final ICompilationUnit fUnit;

	private final CompilationUnit fAst;

	/**
	 * Creates a new clean up context.
	 *
	 * @param unit the compilation unit
	 * @param ast the AST, can be null if {@link CleanUpRequirements#requiresAST()}
	 *            returns false. The AST is guaranteed to contain changes made by
	 *            previous clean ups only if {@link CleanUpRequirements#requiresFreshAST()} returns
	 *            true.
	 */
	public CleanUpContext(ICompilationUnit unit, CompilationUnit ast) {
		Assert.isLegal(unit != null);
		fUnit= unit;
		fAst= ast;
	}

	/**
	 * The compilation unit to clean up.
	 *
	 * @return the compilation unit to clean up
	 */
	public ICompilationUnit getCompilationUnit() {
		return fUnit;
	}

	/**
	 * An AST built from the compilation unit to fix.
	 *

	 * Can be null if {@link CleanUpRequirements#requiresAST()} returns
	 * false. The AST is guaranteed to contain changes made by previous clean ups only
	 * if {@link CleanUpRequirements#requiresFreshAST()} returns true.
	 *

	 *
Clients should check the AST API level and do nothing if they are given an AST
	 * they can't handle (see {@link org.eclipse.jdt.core.dom.AST#apiLevel()}).
	 *
	 * @return an AST or null if none required
	 */
	public CompilationUnit getAST() {
		return fAst;
	}
}


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

    <title>Module: Sequel::Plugins::VersionedCollection [Versioning Sequel Plugin]</title>
    <meta content='text/html; charset=UTF-8' http-equiv='Content-Type' />
    <link href='../../.././rdoc-style.css' media='screen' rel='stylesheet' type='text/css' />

          Module
          Sequel::Plugins::VersionedCollection

            lib/versioned_collection.rb

            is :versioned_collection

            Assumptions:

there is one_to_many with a reciprocated many_to_one between the parent and
            versioned objects

the parent has an attr, fetch_version, to fetch specific version, otherwise
            it will get latest version

the parent has versioned_objects_version attributes defined

Classes and Modules

              Module Sequel::Plugins::VersionedCollection::ClassMethods

      Hanna RDoc template
      hand-crafted by
      Mislav


text:
<TITLE>Review for Primary Colors (1998)</TITLE>
<LINK REL="STYLESHEET" TYPE="text/css" HREF="/ramr.css">

Primary Colors (1998)

reviewed by
Ted Prigge

PRIMARY COLORS (1998)
A Film Review by Ted Prigge
Copyright 1998 Ted Prigge

Director: Mike Nichols
Writer: Elaine May (based on the novel by Joe Klein, who would like to
remain anonymous)
Starring: John Travolta, Emma Thompson, Adrian Lester, Kathy Bates, Billy
Bob Thornton, Maura Tierney, Paul Guilfoyle, Larry Hagman, Caroline Aaron,
Diane Ladd, Stacy Edwards, Tommy Hollis, Allison Janney, Robert Klein,
Mykelti Williamson, Rob Reiner, Tony Shalhoub, Chelcie Ross, Larry King,
Bill Maher

To be blunt, "Primary Colors" is one of the angriest and cynical films
about running for political office ever made, but luckily it doesn't allow
these two overpowering feelings to crush the film's power as entertainment.
 What could have been a really cynical reflection on working for the
Clinton campaign back in '92 (which is what the book by Joe "Anonymous"
Klein is) is instead an epic intelligent satire on a campaign very similar
to that one, not showing what an asswhole Bill Clinton may be, but what the
campaign road does to the people working on it.  Which, of course, suits me
just fine since I would have voted for him if I had been of age back then.

The focus of "Primary Colors" is, in fact, not even on Bill and Hillary
Clinton (as well as Chelsea), but on a man named Henry Burton (Adrian
Lester, nicely faking an American accent) who's the son of a famous civil
rights leader, and who becomes the film's version of George Stephanopolous.
 He's interested in working for an Arkansas governor named Jack Stanton
(John Travolta, done up in Clinton-gear), but before officially signing on
to the team, finds himself on his private jet to New Hampshire with Stanton
sleeping on his shoulder.

Before he can even get new clothes from his house, Burton has been swept
away by Stanton and his ideals (he sees him cry over a speech an uneducated
man played by Mykelti Williamson who describes his inability to read), and
has been given a head post of a campaign office.  Burton respects Stanton,
and has convinced himself that he is a good person and candidate, even
after seeing how he acts when not with people who can further his political
career.  As the film goes on, Burton finds himself on the road with Stanton
and a couple of other team members, such as: a James Carville-esque
political strategist, Richard Jemmons (a great Billy Bob Thornton); a
fellow worker named Daisy Green ("NewsRadio"'s Maura Tierney), who begins a
relationship with Burton more out of a lack of nothing else to do than out
of love; and others, like a member played by Paul Guilfoyle, who's been in
everything recently...or at least it seems that way.

The truth is, though, that Stanton's weakness is his libido, and the film
not only has a Gennifer Flowers for us, but also a young daughter of a
friends' who he may or may not have gotten pregnant.  Stanton seems to not
be able to control this, even after speaking to him about it, and this
obviously becomes his big weak point in terms of the media's coverage of
his race to become president.

The film is obviously and unsubtlely a caricature of the Clintons, even
giving Travolta the exact look of Clinton (right down to his eyebrows), and
portraying Stanton's Hillary, Susan (Emma Thompson, also faking a nice
American accent...or at least giving a good try), as a tough woman, almost
totally resembling Hillary's rough outer edge.  This may seem cheap, but
the film actually doesn't try and show how they are alone, and we never see
how Jack's infidelities hurt Susan.  There are at least three occurances of
Jack and Susan being left alone by someone else so that they can argue, but
we leave along with the people, never seeing what occurs in private.  This
is a wise choice: how does the film know what goes on?  Trying to come up
with a solution to the question of what goes on behind their closed doors
would lead to a mistep in the film.  The fact that Jack Stanton isn't in
all of this film is one of the film's major benefits.

There's another chief character in the film in the form of Kathy Bates (ha
ha) named Libby Holden, a woman who is hired by Stanton's staff to uncover
any secret information about Jack that could harm him (a woman uncovers a
time when Jack was arrested and released by a Senator).  Kathy plays her as
an extremely tough woman, bullying anyone who gets in her way, and taking
on a very demanding presence in Jack's staff.

One of the great things about this film is how it treats her character:
she's seen as a stereotype when she walks into the film for the first time
(the tough lesbian, sleeping with little staff member Stacy Edwards, who
just starred in "In the Company of Men" and is currently residing on
"Chicago Hope"), but as the film goes on, she is forced to do some
reconnaissance work AGAINST the main opponent (who soon becomes none other
than Larry Hagman, sans Jeanie), and reveals herself to not just be a tough
woman, but a woman with a strict moral center, who is only up for
protecting people from themselves, not hurting innocent people.

The film presents all of this with a touch of cynicism (after all, it's
told from the point of view of someone who has to endure all of this), but
with the right amount of reflexion, seeing that the problem with the
campaign road was not with Jack Stanton and his infidelities, but really
with being on the road itself.  Campaigning is shown to tear people apart,
make them crazy and do horrible things as things get worse.  Where else
would all of a person's past occurances come to light and be scrutinized
like it was something they did yesterday?

The greatest thing about this film is its presentation of Jack Stanton,
who's seen as a man with a severe character flaw, but is still a very good
person, and one hell of a politician.  Seeing him sitting down and
listening to people is something that is a very sellable political trait,
and the fact that his main wont in life is to help people makes him a good
person, not just a very good politician.  And the fact that we don't know
everything about him is one of the film's best traits.

"Primary Colors" comes off as being more honest than cynical, probably
because it tells it more as a reflexion of being on the road, remembering
what it was like those lonesome nights in the hotel room, and watching the
TV nervously, wondering what place the candidate your working for will get
a high rating.  It's bitter about how the media took advantage of the
candidate's past, trying to make them out to be horrible creatures, and
then how the other candidates tried to use this information for their own
benefit.  And it's even a little annoyed by the talk show hosts who mock
political leaders (represented by Bill Maher - what?  Leno was busy?),
taking advantage of the weakness of being completely in the public's eye.
It's angry and pissed off about this, but it's not overbearing.

"Primary Colors" is only the second film to be pissed off at the media in
terms of the way they handle politics in under six months (the others being
"Wag the Dog" and "Bulworth"), but this film actually comes off as being
more human and epic than those.  One of the best things about "Primary
Colors" is how it's mad as hell, but it has the intelligence to not let
that bring it down.  It's concerned with the way it affects people, making
them do terrible things to other people, and how it drives the people who
work for it sometimes over the edge.  I guess it's not so much an
adaptation of the bitter novel as much as it is a reflexion on it much
later with more facts and deeper recollection.

Just this week there was a primary in my home town where the one candidate
sent out newsletters to potential voters, telling them a bunch of lies
about the opponent, resulting in his win by over 50 percent.  Do I think
the guy who did this is an asswhole?  Well, I don't know him very well
(although I did shake his hand once), but I'm just assuming he did this out
of the stress of working so hard to run for political office and worrying
that it may result in nothing.

MY RATING (out of 4): ****

Homepage at: http://www.geocities.com/Hollywood/Hills/8335/

The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).

The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.

Please direct comments/criticisms of the review to relevant newsgroups.

Broken URLs inthe reviews are the responsibility of the author.

The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.

Related links: index of all rec.arts.movies.reviews reviews


text:
using System;
using System.Xml.Serialization;
using System.Collections.Generic;
using Aop.Api.Domain;

namespace Aop.Api.Response
{
    /// <summary>
    /// KoubeiMarketingDataRetailDmQueryResponse.
    /// </summary>
    public class KoubeiMarketingDataRetailDmQueryResponse : AopResponse
    {
        /// <summary>
        /// 内容ID
        /// </summary>
        [XmlElement("content_id")]
        public string ContentId { get; set; }

        /// <summary>
        /// 店面DM营销数据,包括商品的PV、UV、曝光。
        /// </summary>
        [XmlArray("dm_marketing_datas")]
        [XmlArrayItem("dm_activity_shop_data")]
        public List<DmActivityShopData> DmMarketingDatas { get; set; }

        /// <summary>
        /// 商品码
        /// </summary>
        [XmlElement("item_code")]
        public string ItemCode { get; set; }

        /// <summary>
        /// 商品名称
        /// </summary>
        [XmlElement("item_name")]
        public string ItemName { get; set; }
    }
}


text:
import java.util.Random;

/**
 * Die.java
 *
 * Represents one die (singular of dice) with faces showing values
 * between 1 and 6.
 *
 * @author Java Foundations
 * @author CS121 Instructors (modified a few things from book)
 */
public class Die
{
   private final int MAX = 6;  // maximum face value
   private int faceValue;  // current value showing on the die
   private Random rand;

   /**
    * Constructor: Sets the initial face value of this die.
    */
   public Die()
   {
      rand = new Random();
      faceValue = 1;
   }

   /**
    * Computes a new face value for this die.
    */
   public void roll()
   {
      faceValue = rand.nextInt(MAX) + 1;
   }

   /**
    * Face value mutator. The face value is not modified if the
    * specified value is not valid.
    *
    * @param value The new face value. Must be between 1 and max face
    * value.
    */
   public void setFaceValue (int value)
   {
      if (value > 0 && value <= MAX) {
         faceValue = value;
      }
   }

   /**
    * Face value accessor.
    * @return The current face value.
    */
   public int getFaceValue()
   {
       return faceValue;
   }

   /**
    * Returns a string representation of this die.
    */
   public String toString()
   {
      String result = "Die [faceValue = " + faceValue + "]";
      return result;
   }
}