text:
package org.assertj.core.api;

import static org.mockito.Mockito.mock;

import org.assertj.core.internal.Int2DArrays;

/**
 * Base class for {@link Int2DArrayAssert} tests.
 *
 * @author Maciej Wajcht
 */
public abstract class Int2DArrayAssertBaseTest extends BaseTestTemplate<Int2DArrayAssert, int[][]> {
  protected Int2DArrays arrays;

  @Override
  protected Int2DArrayAssert create_assertions() {
    return new Int2DArrayAssert(new int[][] {});
  }

  @Override
  protected void inject_internal_objects() {
    super.inject_internal_objects();
    arrays = mock(Int2DArrays.class);
    assertions.int2dArrays = arrays;
  }

  protected Int2DArrays getArrays(Int2DArrayAssert someAssertions) {
    return someAssertions.int2dArrays;
  }
}


text:
<?xml version="1.0" encoding="utf-8"?>

<LinearLayout
	xmlns:android="http://schemas.android.com/apk/res/android"
	android:layout_width="match_parent"
	android:layout_height="wrap_content"
	android:background="#FFFAFAFA"
	android:orientation="vertical">

	<View
		android:layout_width="match_parent"
		android:layout_height="1dp"
		android:background="#9FDBDBDB"/>

	<FrameLayout
		android:layout_width="match_parent"
		android:layout_height="45dp">

		<TextView
			android:layout_width="wrap_content"
			android:layout_height="wrap_content"
			android:layout_gravity="center_vertical"
			android:layout_marginLeft="26dp"
			android:text="选择日期"
			android:textColor="#FF2C2C2C"
			android:textSize="16sp"/>
	</FrameLayout>

	<View
		android:layout_width="match_parent"
		android:layout_height="1dp"
		android:background="#FF0092F7"/>

	<calv1n.datetime.DatePickerView
		android:id="@+id/dpv"
		android:layout_width="match_parent"
		android:layout_height="wrap_content"/>

	<View
		android:layout_width="match_parent"
		android:layout_height="1dp"
		android:background="#9FDBDBDB"/>

	<LinearLayout
		android:layout_width="match_parent"
		android:layout_height="40dp"
		android:gravity="center"
		android:orientation="horizontal">

		<Button
			android:id="@+id/btn_cancel"
			android:layout_width="0dp"
			android:layout_height="match_parent"
			android:layout_weight="1"
			android:background="@drawable/selector_transparent_gary"
			android:text="取消"
			android:textColor="@android:color/darker_gray"
			android:textSize="16sp"/>

		<View
			android:layout_width="1dp"
			android:layout_height="match_parent"
			android:background="#9FDBDBDB"/>

		<Button
			android:id="@+id/btn_commit"
			android:layout_width="0dp"
			android:layout_height="match_parent"
			android:layout_weight="1"
			android:background="@drawable/selector_transparent_gary"
			android:text="确定"
			android:textColor="#FFFC8A8A"
			android:textSize="16sp"/>

	</LinearLayout>

</LinearLayout>

redpajama_set_name: RedPajamaGithub


text:
using System.ComponentModel;
using System.Runtime.CompilerServices;
using aXon.Rover;
using aXon.Rover.Annotations;
using aXon.Rover.Enumerations;

namespace aXon.Desktop
{
    public class DataSource : INotifyPropertyChanged
    {
        private MapMode _mapMode;
        private RobotSimulator _simulation;
        private Rover.Models.Warehouse _warehouse;

        public RobotSimulator Simulation
        {
            get { return _simulation; }
            set
            {
                if (Equals(value, _simulation)) return;
                _simulation = value;
                OnPropertyChanged();
            }
        }

        public Rover.Models.Warehouse Warehouse
        {
            get { return _warehouse; }
            set
            {
                if (Equals(value, _warehouse)) return;
                _warehouse = value;
                OnPropertyChanged();
            }
        }

        public MapMode ModeMap
        {
            get { return _mapMode; }
            set
            {
                if (value == _mapMode) return;
                _mapMode = value;
                OnPropertyChanged();
            }
        }

        public event PropertyChangedEventHandler PropertyChanged;

        [NotifyPropertyChangedInvocator]
        protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
        {
            var handler = PropertyChanged;
            if (handler != null) handler(this, new PropertyChangedEventArgs(propertyName));
        }
    }
}


text:
<?xml version="1.0" ?>

<container xmlns="http://symfony.com/schema/dic/services"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">

    <services>
        <service id="app.twig_extension"
                 class="AppBundle\Twig\AppExtension"
                 public="false">
            <tag name="twig.extension" />
            <argument key="doctrine" type="service" id="doctrine"/>
        </service>

        <service id="app.post_manager"
                 class="AppBundle\Services\PostManager">
            <argument key="doctrine" type="service" id="doctrine"/>
            <argument key="knpPaginator" type="service" id="knp_paginator"/>
            <argument key="limit" type="string" >%limit_page%</argument>
            <argument key="formFactory" type="service" id="form.factory"/>
            <argument key="router" type="service" id="router"/>
            <argument key="tokenStorage" type="service" id="security.token_storage"/>
        </service>

        <service id="app.doctrine_subscriber" class="AppBundle\EventSubscribers\DoctrineEventSubscriber">
            <tag name="doctrine.event_subscriber" connection="default" />
        </service>

        <service id="app.admin_user_provider" class="AppBundle\Services\AdminUserProvider">
            <argument type="service" id="doctrine.orm.default_entity_manager"/>
        </service>

        <service id="app.security.role_hierarchy_checker" class="AppBundle\Security\RoleHierarchyChecker">
            <argument type="service" id="security.role_hierarchy"/>
        </service>

        <service id="twig.extension.intl" class="Twig_Extensions_Extension_Intl">
            <tag name="twig.extension"/>
        </service>

    </services>
</container>


text:
@extends('app')

@section('content')

Edit Project

                    @if (count($errors) > 0)

                            Whoops! There were some problems with your input.

                                @foreach ($errors->all() as $error)

{{ $error }}

                                @endforeach

                    @endif

                    {!! Form::open(['route' => ['projects.update', $project->id], 'method' => 'put', 'role' => 'form','class' => 'form-horizontal']) !!}

                            Project Name

                                {!! Form::text('name', $project->name, ['class' => 'form-control', 'id' => 'name']) !!}

                            Recipe

                                {!! Form::select('recipe_id[]', $recipes, $projectRecipe, ['class' => 'form-control multi-select', 'id' => 'recipe_id', 'multiple' => 'multiple']) !!}

                            Server

                                {!! Form::select('server_id', $servers, $project->server_id, ['class' => 'form-control', 'id' => 'server_id']) !!}

                            Repository URL

                                {!! Form::text('repository', $project->repository, ['class' => 'form-control', 'id' => 'repository']) !!}

                            Stage

                                {!! Form::text('stage', $project->stage, ['class' => 'form-control', 'id' => 'stage']) !!}

Overriding Server Definition

                            Deploy Path

                                {!! Form::text('deploy_path', $project->attributes->getDeployPath(), ['class' => 'form-control', 'id' => 'deploy_path']) !!}

E-Mail Notification

                            Recipient

                                {!! Form::email('email_notification_recipient', $project->email_notification_recipient, ['class' => 'form-control', 'id' => 'email_notification_recipient']) !!}

Discard Old Deployments

                            Days To Keep Deployments

                                {!! Form::text('days_to_keep_deployments', $project->days_to_keep_deployments, ['class' => 'form-control', 'id' => 'days_to_keep_deployments']) !!}

                                        {!! Form::checkbox('keep_last_deployment', $project->keep_last_deployment, $project->keep_last_deployment) !!}
                                        Keep Last Deployment

                            Max # Of Deployments To Keep

                                {!! Form::text('max_number_of_deployments_to_keep', $project->max_number_of_deployments_to_keep, ['class' => 'form-control', 'id' => 'max_number_of_deployments_to_keep']) !!}

GitHub Webhook

                            Secret

                                {!! Form::text('github_webhook_secret', $project->github_webhook_secret, ['class' => 'form-control', 'id' => 'github_webhook_secret']) !!}

                            Execute By

                                {!! Form::select('github_webhook_user_id', $users, $project->github_webhook_user_id, ['class' => 'form-control', 'id' => 'github_webhook_user_id']) !!}

                                {!! link_to_route('projects.index', 'cancel', [], ['class' => 'btn btn-danger']) !!}
                                {!! form::submit('update', ['class' => 'btn btn-primary']) !!}

                        {!! Form::hidden('recipe_id_order', implode(',', $projectRecipe), ['id' => 'recipe_id_order']) !!}
                    {!! Form::close() !!}

@stop


text:
<!doctype html>

    <title>legendTextNotPlaceholder</title>

        <form action="http://example.com/donut" method="post">
            <fieldset>
                <legend class="quail-failed-element">legend</legend>

                    <input type="radio" name="flavour" id="choc" value="chocolate" checked="checked"
                    />
                    Chocolate

                    <input type="radio" name="flavour" id="cream" value="cream" />
                    Cream Filled

                    <input type="radio" name="flavour" id="honey" value="honey" />
                    Honey Glazed

            </fieldset>

                <input type="submit" value="Purchase Donut" />

        </form>

        <form action="http://example.com/donut" method="post">
            <fieldset>
                <legend>Donut Type</legend>

                    <input type="radio" name="flavour" id="choc" value="chocolate" checked="checked"
                    />
                    Chocolate

                    <input type="radio" name="flavour" id="cream" value="cream" />
                    Cream Filled

                    <input type="radio" name="flavour" id="honey" value="honey" />
                    Honey Glazed

            </fieldset>

                <input type="submit" value="Purchase Donut" />

        </form>


text:
[![Stories in Ready](https://badge.waffle.io/foosnetio/foosnet.io.png?label=ready&title=Ready)](https://waffle.io/foosnetio/foosnet.io)
# foosnet.io


text:
int main()
{
	printf(SimpleClass::_getHelloWorld());
	printf("\n");
}


text:
var medea = require('medea')
var ttl = require('medea-ttl');

var oneDay = 86400;

module.exports = function(connect){

  var Store = connect.session.Store;

  function MedeaStore(options) {
    var self = this;

    options = options || {};
    Store.call(this, options);
    this.prefix = null == options.prefix
      ? 'sess:'
      : options.prefix;

    this.client = ttl(options.client || medea(options));
    this.ttl =  options.ttl;

    options.dirname = options.dirname || process.cwd() + '/data';

    this.client.open(options.dirname, function(err) {
      if (err) {
        this.emit('disconnect');
        throw err;
        return;
      }

      self.emit('connect');
    });
  };

  MedeaStore.prototype.__proto__ = Store.prototype;

  MedeaStore.prototype.get = function(sid, fn){
    var self = this;
    sid = this.prefix + sid;
    this.client.get(sid, function(err, data){
      if (err) return fn(err);
      if (!data) return fn();
      var result;
      data = data.toString();

      try {
        result = JSON.parse(data);
      } catch (err) {
        return fn(err);
      }

      return fn(null, result);
    });
  };

  MedeaStore.prototype.set = function(sid, sess, fn){
    sid = this.prefix + sid;
    try {
      var maxAge = sess.cookie.maxAge
        , ttl = this.ttl
        , sess = JSON.stringify(sess);

      ttl = ttl || ('number' == typeof maxAge ? maxAge : oneDay);

      this.client.put(sid, sess, ttl, function(err) {
        fn && fn.apply(this, arguments);
      });
    } catch (err) {
      fn && fn(err);
    }
  };

  MedeaStore.prototype.destroy = function(sid, fn){
    sid = this.prefix + sid;
    this.client.remove(sid, fn);
  };

  return MedeaStore;
};


text:
A Microsoft Visual Studio Addin that uses the Blink(1).mk2 USB LED project to indicate build status with pulsating colors of light.

Copyright 2015 John Farrier
Apache 2.0 License

###Building
I wasn't too fancy setting this up.  First, grab the blink(1).mk2 SDK from https://github.com/todbot/blink1.
Next, check out the BuildStatusIndicator project to:
```
blink1/windows/ManagedBlink1
```
Open the ManagedBlink1.sln file and add the BuildStatusIndicator project.  Compile and you're done.

###Installing

When compiled, copy these files to your user addins directory:

```
C:\Users\John\Documents\Visual Studio 2012\Addins
```
or
```
C:\Users\John\Documents\Visual Studio 2013\Addins
```

Then, inside Visual Studio, go to Tools->AddIn Manager and you should see the BuildStatusIndicator plugin.


text:
package ipallocator

import (
	"errors"
	"fmt"
	"math/big"
	"net"

	api "k8s.io/kubernetes/pkg/apis/core"
	"k8s.io/kubernetes/pkg/registry/core/service/allocator"
	netutils "k8s.io/utils/net"
)

// Interface manages the allocation of IP addresses out of a range. Interface
// should be threadsafe.
type Interface interface {
	Allocate(net.IP) error
	AllocateNext() (net.IP, error)
	Release(net.IP) error
	ForEach(func(net.IP))
	CIDR() net.IPNet
	IPFamily() api.IPFamily
	Has(ip net.IP) bool

	// DryRun offers a way to try operations without persisting them.
	DryRun() Interface
}

var (
	ErrFull              = errors.New("range is full")
	ErrAllocated         = errors.New("provided IP is already allocated")
	ErrMismatchedNetwork = errors.New("the provided network does not match the current range")
)

type ErrNotInRange struct {
	IP         net.IP
	ValidRange string
}

func (e *ErrNotInRange) Error() string {
	return fmt.Sprintf("the provided IP (%v) is not in the valid range. The range of valid IPs is %s", e.IP, e.ValidRange)
}

// Range is a contiguous block of IPs that can be allocated atomically.
//
// The internal structure of the range is:
//
//   For CIDR 10.0.0.0/24
//   254 addresses usable out of 256 total (minus base and broadcast IPs)
//     The number of usable addresses is r.max
//
//   CIDR base IP          CIDR broadcast IP
//   10.0.0.0                     10.0.0.255
//   |                                     |
//   0 1 2 3 4 5 ...         ... 253 254 255
//     |                              |
//   r.base                     r.base + r.max
//     |                              |
//   offset #0 of r.allocated   last offset of r.allocated
type Range struct {
	net *net.IPNet
	// base is a cached version of the start IP in the CIDR range as a *big.Int
	base *big.Int
	// max is the maximum size of the usable addresses in the range
	max int
	// family is the IP family of this range
	family api.IPFamily

	alloc allocator.Interface
}

// New creates a Range over a net.IPNet, calling allocatorFactory to construct the backing store.
func New(cidr *net.IPNet, allocatorFactory allocator.AllocatorFactory) (*Range, error) {
	registerMetrics()

	max := netutils.RangeSize(cidr)
	base := netutils.BigForIP(cidr.IP)
	rangeSpec := cidr.String()
	var family api.IPFamily

	if netutils.IsIPv6CIDR(cidr) {
		family = api.IPv6Protocol
		// Limit the max size, since the allocator keeps a bitmap of that size.
		if max > 65536 {
			max = 65536
		}
	} else {
		family = api.IPv4Protocol
		// Don't use the IPv4 network's broadcast address, but don't just
		// Allocate() it - we don't ever want to be able to release it.
		max--
	}

	// Don't use the network's ".0" address, but don't just Allocate() it - we
	// don't ever want to be able to release it.
	base.Add(base, big.NewInt(1))
	max--

	r := Range{
		net:    cidr,
		base:   base,
		max:    maximum(0, int(max)),
		family: family,
	}
	var err error
	r.alloc, err = allocatorFactory(r.max, rangeSpec)

	return &r, err
}

// NewInMemory creates an in-memory allocator.
func NewInMemory(cidr *net.IPNet) (*Range, error) {
	return New(cidr, func(max int, rangeSpec string) (allocator.Interface, error) {
		return allocator.NewAllocationMap(max, rangeSpec), nil
	})
}

// NewFromSnapshot allocates a Range and initializes it from a snapshot.
func NewFromSnapshot(snap *api.RangeAllocation) (*Range, error) {
	_, ipnet, err := netutils.ParseCIDRSloppy(snap.Range)
	if err != nil {
		return nil, err
	}
	r, err := NewInMemory(ipnet)
	if err != nil {
		return nil, err
	}
	if err := r.Restore(ipnet, snap.Data); err != nil {
		return nil, err
	}
	return r, nil
}

func maximum(a, b int) int {
	if a > b {
		return a
	}
	return b
}

// Free returns the count of IP addresses left in the range.
func (r *Range) Free() int {
	return r.alloc.Free()
}

// Used returns the count of IP addresses used in the range.
func (r *Range) Used() int {
	return r.max - r.alloc.Free()
}

// CIDR returns the CIDR covered by the range.
func (r *Range) CIDR() net.IPNet {
	return *r.net
}

// DryRun returns a non-persisting form of this Range.
func (r *Range) DryRun() Interface {
	return dryRunRange{r}
}

// For clearer code.
const dryRunTrue = true
const dryRunFalse = false

// Allocate attempts to reserve the provided IP. ErrNotInRange or
// ErrAllocated will be returned if the IP is not valid for this range
// or has already been reserved.  ErrFull will be returned if there
// are no addresses left.
func (r *Range) Allocate(ip net.IP) error {
	return r.allocate(ip, dryRunFalse)
}

func (r *Range) allocate(ip net.IP, dryRun bool) error {
	label := r.CIDR()
	ok, offset := r.contains(ip)
	if !ok {
		// update metrics
		clusterIPAllocationErrors.WithLabelValues(label.String()).Inc()
		return &ErrNotInRange{ip, r.net.String()}
	}
	if dryRun {
		// Don't bother to check whether the IP is actually free. It's racy and
		// not worth the effort to plumb any further.
		return nil
	}

	allocated, err := r.alloc.Allocate(offset)
	if err != nil {
		// update metrics
		clusterIPAllocationErrors.WithLabelValues(label.String()).Inc()

		return err
	}
	if !allocated {
		// update metrics
		clusterIPAllocationErrors.WithLabelValues(label.String()).Inc()

		return ErrAllocated
	}
	// update metrics
	clusterIPAllocations.WithLabelValues(label.String()).Inc()
	clusterIPAllocated.WithLabelValues(label.String()).Set(float64(r.Used()))
	clusterIPAvailable.WithLabelValues(label.String()).Set(float64(r.Free()))

	return nil
}

// AllocateNext reserves one of the IPs from the pool. ErrFull may
// be returned if there are no addresses left.
func (r *Range) AllocateNext() (net.IP, error) {
	return r.allocateNext(dryRunFalse)
}

func (r *Range) allocateNext(dryRun bool) (net.IP, error) {
	label := r.CIDR()
	if dryRun {
		// Don't bother finding a free value. It's racy and not worth the
		// effort to plumb any further.
		return r.CIDR().IP, nil
	}

	offset, ok, err := r.alloc.AllocateNext()
	if err != nil {
		// update metrics
		clusterIPAllocationErrors.WithLabelValues(label.String()).Inc()

		return nil, err
	}
	if !ok {
		// update metrics
		clusterIPAllocationErrors.WithLabelValues(label.String()).Inc()

		return nil, ErrFull
	}
	// update metrics
	clusterIPAllocations.WithLabelValues(label.String()).Inc()
	clusterIPAllocated.WithLabelValues(label.String()).Set(float64(r.Used()))
	clusterIPAvailable.WithLabelValues(label.String()).Set(float64(r.Free()))

	return netutils.AddIPOffset(r.base, offset), nil
}

// Release releases the IP back to the pool. Releasing an
// unallocated IP or an IP out of the range is a no-op and
// returns no error.
func (r *Range) Release(ip net.IP) error {
	return r.release(ip, dryRunFalse)
}

func (r *Range) release(ip net.IP, dryRun bool) error {
	ok, offset := r.contains(ip)
	if !ok {
		return nil
	}
	if dryRun {
		return nil
	}

	err := r.alloc.Release(offset)
	if err == nil {
		// update metrics
		label := r.CIDR()
		clusterIPAllocated.WithLabelValues(label.String()).Set(float64(r.Used()))
		clusterIPAvailable.WithLabelValues(label.String()).Set(float64(r.Free()))
	}
	return err
}

// ForEach calls the provided function for each allocated IP.
func (r *Range) ForEach(fn func(net.IP)) {
	r.alloc.ForEach(func(offset int) {
		ip, _ := netutils.GetIndexedIP(r.net, offset+1) // +1 because Range doesn't store IP 0
		fn(ip)
	})
}

// Has returns true if the provided IP is already allocated and a call
// to Allocate(ip) would fail with ErrAllocated.
func (r *Range) Has(ip net.IP) bool {
	ok, offset := r.contains(ip)
	if !ok {
		return false
	}

	return r.alloc.Has(offset)
}

// IPFamily returns the IP family of this range.
func (r *Range) IPFamily() api.IPFamily {
	return r.family
}

// Snapshot saves the current state of the pool.
func (r *Range) Snapshot(dst *api.RangeAllocation) error {
	snapshottable, ok := r.alloc.(allocator.Snapshottable)
	if !ok {
		return fmt.Errorf("not a snapshottable allocator")
	}
	rangeString, data := snapshottable.Snapshot()
	dst.Range = rangeString
	dst.Data = data
	return nil
}

// Restore restores the pool to the previously captured state. ErrMismatchedNetwork
// is returned if the provided IPNet range doesn't exactly match the previous range.
func (r *Range) Restore(net *net.IPNet, data []byte) error {
	if !net.IP.Equal(r.net.IP) || net.Mask.String() != r.net.Mask.String() {
		return ErrMismatchedNetwork
	}
	snapshottable, ok := r.alloc.(allocator.Snapshottable)
	if !ok {
		return fmt.Errorf("not a snapshottable allocator")
	}
	if err := snapshottable.Restore(net.String(), data); err != nil {
		return fmt.Errorf("restoring snapshot encountered %v", err)
	}
	return nil
}

// contains returns true and the offset if the ip is in the range, and false
// and nil otherwise. The first and last addresses of the CIDR are omitted.
func (r *Range) contains(ip net.IP) (bool, int) {
	if !r.net.Contains(ip) {
		return false, 0
	}

	offset := calculateIPOffset(r.base, ip)
	if offset < 0 || offset >= r.max {
		return false, 0
	}
	return true, offset
}

// calculateIPOffset calculates the integer offset of ip from base such that
// base + offset = ip. It requires ip >= base.
func calculateIPOffset(base *big.Int, ip net.IP) int {
	return int(big.NewInt(0).Sub(netutils.BigForIP(ip), base).Int64())
}

// dryRunRange is a shim to satisfy Interface without persisting state.
type dryRunRange struct {
	real *Range
}

func (dry dryRunRange) Allocate(ip net.IP) error {
	return dry.real.allocate(ip, dryRunTrue)
}

func (dry dryRunRange) AllocateNext() (net.IP, error) {
	return dry.real.allocateNext(dryRunTrue)
}

func (dry dryRunRange) Release(ip net.IP) error {
	return dry.real.release(ip, dryRunTrue)
}

func (dry dryRunRange) ForEach(cb func(net.IP)) {
	dry.real.ForEach(cb)
}

func (dry dryRunRange) CIDR() net.IPNet {
	return dry.real.CIDR()
}

func (dry dryRunRange) IPFamily() api.IPFamily {
	return dry.real.IPFamily()
}

func (dry dryRunRange) DryRun() Interface {
	return dry
}

func (dry dryRunRange) Has(ip net.IP) bool {
	return dry.real.Has(ip)
}


text:
<?php

namespace Gentor\BnpPF;

use Illuminate\Support\ServiceProvider;
use Gentor\BnpPF\Service\Bnp;

/**
 * Class BnpServiceProvider
 *
 * @package Gentor\BnpPF
 */
class BnpServiceProvider extends ServiceProvider
{

    /**
     * Indicates if loading of the provider is deferred.
     *
     * @var bool
     */
    protected $defer = true;

    /**
     * Register any application services.
     *
     * @return void
     */
    public function register()
    {
        $this->app->bind('bnp', function ($app) {
            return new Bnp($app['config']['bnp']);
        });
    }

    /**
     * Get the services provided by the provider.
     *
     * @return array
     */
    public function provides()
    {
        return ['bnp'];
    }

}


text:
using System;
using NServiceBus;
using NServiceBus.Installation.Environments;

class Program
{
    static void Main()
    {
        Console.Title = "Samples.FullDuplex.Client";
        Configure.Serialization.Json();
        Configure configure = Configure.With();
        configure.Log4Net();
        configure.DefineEndpointName("Samples.FullDuplex.Client");
        configure.DefaultBuilder();
        configure.InMemorySagaPersister();
        configure.UseInMemoryTimeoutPersister();
        configure.InMemorySubscriptionStorage();
        configure.UseTransport<Msmq>();
        using (IStartableBus startableBus = configure.UnicastBus().CreateBus())
        {
            IBus bus = startableBus
                .Start(() => configure.ForInstallationOn<Windows>().Install());
            Console.WriteLine("Press enter to send a message");
            Console.WriteLine("Press any key to exit");

            #region ClientLoop

            while (true)
            {
                ConsoleKeyInfo key = Console.ReadKey();
                Console.WriteLine();

                if (key.Key != ConsoleKey.Enter)
                {
                    return;
                }
                Guid guid = Guid.NewGuid();
                Console.WriteLine("Requesting to get data by id: {0}", guid.ToString("N"));

                RequestDataMessage message = new RequestDataMessage
                {
                    DataId = guid,
                    String = "String property value"
                };
                bus.Send("Samples.FullDuplex.Server", message);
            }

            #endregion
        }
    }
}


text:
         @border
         Border (Frame) around a Table (NISO JATS table model)

Thickness, in pixels, of the border to draw around the table. A value of "0" indicates that the table has no border. (This attribute is based on and
intended to be converted easily to the XHMTL border attribute.)


text:
package org.bson.codecs;

import org.bson.BsonReader;
import org.bson.BsonWriter;

import java.util.concurrent.atomic.AtomicLong;

/**
 * Encodes and decodes {@code AtomicLong} objects.
 *
 * @since 3.0
 */

public class AtomicLongCodec implements Codec<AtomicLong> {
    @Override
    public void encode(final BsonWriter writer, final AtomicLong value, final EncoderContext encoderContext) {
        writer.writeInt64(value.longValue());
    }

    @Override
    public AtomicLong decode(final BsonReader reader, final DecoderContext decoderContext) {
        return new AtomicLong(reader.readInt64());
    }

    @Override
    public Class<AtomicLong> getEncoderClass() {
        return AtomicLong.class;
    }
}


text:
package org.apache.river.test.spec.constraint.coreconstraint.invocationconstraints;

import java.util.logging.Level;
// org.apache.river.qa.harness
import org.apache.river.qa.harness.QAConfig;
import org.apache.river.qa.harness.TestException;

// org.apache.river.qa.harness
import org.apache.river.qa.harness.QAConfig;
import org.apache.river.qa.harness.QATestEnvironment;

// java.util
import org.apache.river.qa.harness.Test;
import java.util.logging.Level;
import java.util.HashSet;

// Davis packages
import net.jini.core.constraint.InvocationConstraints;
import net.jini.core.constraint.ClientAuthentication;
import net.jini.core.constraint.Confidentiality;
import net.jini.core.constraint.Delegation;
import net.jini.core.constraint.Integrity;
import net.jini.core.constraint.ServerAuthentication;

/**
 * <pre>
 *
 * Purpose:
 *   This test verifies the behavior of
 *   {@link net.jini.core.constraint.InvocationConstraints#combine(InvocationConstraints,InvocationConstraints)}
 *   method.
 *   The method should return an instance of
 *   {@link net.jini.core.constraint.InvocationConstraints} that has all of
 *   the requirements from each non-null argument added as requirements and
 *   has all of the preferences from each non-null argument added as
 *   preferences.
 *   Duplicate requirements, duplicate preferences, and preferences that are
 *   duplicates of requirements are all removed.
 *
 * Test Cases:
 *   TestCase #1
 *    both arguments are null; it's expected that the returned
 *    InvocationConstraints object is empty (has no requirements and no
 *    preferences);
 *   TestCase #2
 *    both arguments are empty InvocationConstraints objects;
 *    it's expected that the returned InvocationConstraints object is empty;
 *   TestCase #3
 *    the first argument is null, the second argument is empty; it's expected
 *    that the returned InvocationConstraints object is empty;
 *   TestCase #4
 *    the first argument is empty, the second argument is null; it's expected
 *    that the returned InvocationConstraints object is empty;
 *   TestCase #5
 *    the first argument is null; it's expected that the returned
 *    InvocationConstraints object is equal to the InvocationConstraints
 *    object specified as the second argument;
 *   TestCase #6
 *    the first argument is empty ; it's expected that the returned
 *    InvocationConstraints object is equal to the InvocationConstraints
 *    object specified as the second argument;
 *   TestCase #7
 *    the second argument is null; it's expected that the returned
 *    InvocationConstraints object is equal to the InvocationConstraints
 *    object specified as the first argument;
 *   TestCase #8
 *    the second argument is empty; it's expected that the returned
 *    InvocationConstraints object is equal to the InvocationConstraints
 *    object specified as the first argument;
 *   TestCase #9
 *    both arguments are non-null and non-empty InvocationConstraints objects
 *    without any duplicate requirements, preferences or preferences
 *    that are duplicates of requirements; it's expected that the returned
 *    InvocationConstraints object has all of the requirements and all of the
 *    preferences from both arguments;
 *   TestCase #10
 *    both arguments are non-null and non-empty InvocationConstraints objects
 *    with duplicate requirements, duplicate preferences, and preferences that
 *    are duplicates of requirements; it's expected that the returned
 *    InvocationConstraints object has all of the requirements and all of the
 *    preferences from both arguments without duplicate requirements, duplicate
 *    preferences, and preferences that are duplicates of requirements;
 *
 * Infrastructure:
 *     - {@link CombineTest}
 *         performs actions; this file
 *     - {@link CombineTest.TestCase}
 *         auxiliary class that describes a Test Case
 *
 * Actions:
 *   Test performs the following steps:
 *     - constructing {@link CombineTest.TestCase} objects for all test cases;
 *     - invoking {@link CombineTest.TestCase#combine()} method on each created
 *       {@link CombineTest.TestCase} object;
 *
 * </pre>
 */
public class CombineTest extends QATestEnvironment implements Test {
    QAConfig config;

    /**
     * An auxiliary class that describes a Test Case.
     * {@link CombineTest.TestCase#combine()}  method launches
     * {@link net.jini.core.constraint.InvocationConstraints#combine(InvocationConstraints,InvocationConstraints)}
     * method and compares the returned result with the expected one.
     */
    public class TestCase {

        /**
         * {@link net.jini.core.constraint.InvocationConstraints} object #1.
         * This is the 1-st argument for InvocationConstraints.combine() method.
         */
        private InvocationConstraints ic_arg1;

        /**
         * {@link net.jini.core.constraint.InvocationConstraints} object #2.
         * This is the 2-nd argument for InvocationConstraints.combine() method.
         */
        private InvocationConstraints ic_arg2;

        /**
         * Expected result of combine() method.
         */
        private InvocationConstraints ic_expected;

        /**
         * Constructor. Creates an instance of {@link CombineTest.TestCase}
         * object.
         *
         * @param ic1 the 1-st arg for InvocationConstraints.combine() method
         * @param ic2 the 2-nd arg for InvocationConstraints.combine() method
         * @param ic_exp the expected result of InvocationConstraints.combine()
         *               method
         */
        public TestCase(InvocationConstraints ic1, InvocationConstraints ic2,
                InvocationConstraints ic_exp) {
            ic_arg1 = ic1;
            ic_arg2 = ic2;
            ic_expected = ic_exp;
        }

        /**
         * Runs
         * {@link net.jini.core.constraint.InvocationConstraints#combine(InvocationConstraints,InvocationConstraints)}
         * method for {@link net.jini.core.constraint.InvocationConstraints}
         * objects of this Test Case and compare the returned result with the
         * expected result of this Test Case.
         *
         * @return true if the result of InvocationConstraints.combine() method
         *         is equal to the expected one or false otherwise
         */
        public boolean combine() {
            logger.log(Level.FINE, "InvocationConstraints.combine(arg1, arg2)");
            logger.log(Level.FINE, "arg1:: " + ic_arg1);
            logger.log(Level.FINE, "arg2:: " + ic_arg2);
            InvocationConstraints ic_returned =
                    InvocationConstraints.combine(ic_arg1, ic_arg2);
            logger.log(Level.FINE, "Expected:: " + ic_expected);
            logger.log(Level.FINE, "Returned:: " + ic_returned);
            return (ic_expected.equals(ic_returned));
        }
    }

    /**
     * Test Cases. The desciption of the test cases is in the class description.
     */
    public TestCase tc[] = new TestCase[10];

    /**
     * This method performs all preparations.
     * Creates {@link CombineTest.TestCase} objects for all test cases specified
     * in the class description.
     */
    public Test construct(QAConfig config) throws Exception {
        super.construct(config);
        this.config = (QAConfig) config; // or this.config = getConfig();

        // Requirements
        HashSet reqs = new HashSet();

        // Preferences
        HashSet prefs = new HashSet();

        // InvocationConstraints object #1 (argument #1)
        InvocationConstraints icArg1;

        // InvocationConstraints object #2 (argument #2)
        InvocationConstraints icArg2;

        // The expected InvocationConstraints object
        InvocationConstraints icExp;

        /*
         * +++++ TestCase #1 +++++
         */
        tc[0] = new TestCase(null, null, InvocationConstraints.EMPTY);

        /*
         * +++++ TestCase #2 +++++
         */
        tc[1] = new TestCase(InvocationConstraints.EMPTY,
                InvocationConstraints.EMPTY, InvocationConstraints.EMPTY);

        /*
         * +++++ TestCase #3 +++++
         */
        tc[2] = new TestCase(null, InvocationConstraints.EMPTY,
                InvocationConstraints.EMPTY);

        /*
         * +++++ TestCase #4 +++++
         */
        tc[3] = new TestCase(InvocationConstraints.EMPTY, null,
                InvocationConstraints.EMPTY);

        /*
         * +++++ TestCase #5 +++++
         */
        // Requirements
        reqs.clear();
        reqs.add(ClientAuthentication.YES);
        reqs.add(Confidentiality.YES);
        reqs.add(Delegation.YES);
        reqs.add(Integrity.YES);
        reqs.add(ServerAuthentication.YES);
        // Preferences
        prefs.clear();
        prefs.add(ClientAuthentication.NO);
        prefs.add(Confidentiality.NO);
        prefs.add(Delegation.NO);
        prefs.add(Integrity.NO);
        prefs.add(ServerAuthentication.NO);
        tc[4] = new TestCase(null, new InvocationConstraints(reqs, prefs),
                new InvocationConstraints(reqs, prefs));

        /*
         * +++++ TestCase #6 +++++
         */
        // Requirements
        reqs.clear();
        reqs.add(ClientAuthentication.YES);
        reqs.add(Confidentiality.YES);
        reqs.add(Delegation.YES);
        reqs.add(Integrity.YES);
        reqs.add(ServerAuthentication.YES);
        // Preferences
        prefs.clear();
        prefs.add(ClientAuthentication.NO);
        prefs.add(Confidentiality.NO);
        prefs.add(Delegation.NO);
        prefs.add(Integrity.NO);
        prefs.add(ServerAuthentication.NO);
        tc[5] = new TestCase(InvocationConstraints.EMPTY,
                new InvocationConstraints(reqs, prefs),
                new InvocationConstraints(reqs, prefs));

        /*
         * +++++ TestCase #7 +++++
         */
        // Requirements
        reqs.clear();
        reqs.add(ClientAuthentication.YES);
        reqs.add(Confidentiality.YES);
        reqs.add(Delegation.YES);
        reqs.add(Integrity.YES);
        reqs.add(ServerAuthentication.YES);
        // Preferences
        prefs.clear();
        prefs.add(ClientAuthentication.NO);
        prefs.add(Confidentiality.NO);
        prefs.add(Delegation.NO);
        prefs.add(Integrity.NO);
        prefs.add(ServerAuthentication.NO);
        tc[6] = new TestCase(new InvocationConstraints(reqs, prefs), null,
                new InvocationConstraints(reqs, prefs));

        /*
         * +++++ TestCase #8 +++++
         */
        // Requirements
        reqs.clear();
        reqs.add(ClientAuthentication.YES);
        reqs.add(Confidentiality.YES);
        reqs.add(Delegation.YES);
        reqs.add(Integrity.YES);
        reqs.add(ServerAuthentication.YES);
        // Preferences
        prefs.clear();
        prefs.add(ClientAuthentication.NO);
        prefs.add(Confidentiality.NO);
        prefs.add(Delegation.NO);
        prefs.add(Integrity.NO);
        prefs.add(ServerAuthentication.NO);
        tc[7] = new TestCase(new InvocationConstraints(reqs, prefs),
                InvocationConstraints.EMPTY, new InvocationConstraints(reqs,
                prefs));

        /*
         * +++++ TestCase #9 +++++
         */
        // Reqs for InvocationConstraints #1
        reqs.clear();
        reqs.add(ClientAuthentication.YES);
        reqs.add(Confidentiality.YES);
        reqs.add(Delegation.YES);
        // Prefs for InvocationConstraints #1
        prefs.clear();
        prefs.add(ClientAuthentication.NO);
        prefs.add(Confidentiality.NO);
        prefs.add(Delegation.NO);

        // InvocationConstraints #1
        icArg1 = new InvocationConstraints(reqs, prefs);

        // Reqs for InvocationConstraints #2
        reqs.clear();
        reqs.add(Integrity.YES);
        reqs.add(ServerAuthentication.YES);
        // Prefs for InvocationConstraints #2
        prefs.clear();
        prefs.add(Integrity.NO);
        prefs.add(ServerAuthentication.NO);

        // InvocationConstraints #2
        icArg2 = new InvocationConstraints(reqs, prefs);

        // Reqs for the expected InvocationConstraints object
        reqs.clear();
        reqs.add(ClientAuthentication.YES);
        reqs.add(Confidentiality.YES);
        reqs.add(Delegation.YES);
        reqs.add(Integrity.YES);
        reqs.add(ServerAuthentication.YES);
        // Prefs for the expected InvocationConstraints object
        prefs.clear();
        prefs.add(ClientAuthentication.NO);
        prefs.add(Confidentiality.NO);
        prefs.add(Delegation.NO);
        prefs.add(Integrity.NO);
        prefs.add(ServerAuthentication.NO);

        // The expected InvocationConstraints object
        icExp = new InvocationConstraints(reqs, prefs);
        tc[8] = new TestCase(icArg1, icArg2, icExp);

        /*
         * +++++ TestCase #10 +++++
         */
        // Reqs for InvocationConstraints #1
        reqs.clear();
        reqs.add(ClientAuthentication.YES);
        reqs.add(Confidentiality.YES);
        reqs.add(Delegation.YES);
        // Duplicate req
        reqs.add(Integrity.YES);

        // Prefs for InvocationConstraints #1
        prefs.clear();
        prefs.add(ClientAuthentication.NO);
        prefs.add(Confidentiality.NO);
        prefs.add(Delegation.NO);
        // Duplicate pref
        prefs.add(Integrity.NO);
        // Pref that is duplicate of reqs in InvocationConstraints #2
        prefs.add(Integrity.YES);

        // InvocationConstraints #1
        icArg1 = new InvocationConstraints(reqs, prefs);

        // Reqs for InvocationConstraints #2
        reqs.clear();
        // Duplicate req
        reqs.add(Delegation.YES);
        reqs.add(Integrity.YES);
        reqs.add(ServerAuthentication.YES);

        // Prefs for InvocationConstraints #2
        prefs.clear();
        // Pref that is duplicate of reqs in InvocationConstraints #1
        prefs.add(ClientAuthentication.YES);
        // Duplicate pref
        prefs.add(Delegation.NO);
        prefs.add(Integrity.NO);
        prefs.add(ServerAuthentication.NO);

        // InvocationConstraints #2
        icArg2 = new InvocationConstraints(reqs, prefs);

        // Reqs for the expected InvocationConstraints object
        reqs.clear();
        reqs.add(ClientAuthentication.YES);
        reqs.add(Confidentiality.YES);
        reqs.add(Delegation.YES);
        reqs.add(Integrity.YES);
        reqs.add(ServerAuthentication.YES);

        // Prefs for the expected InvocationConstraints object
        prefs.clear();
        prefs.add(ClientAuthentication.NO);
        prefs.add(Confidentiality.NO);
        prefs.add(Delegation.NO);
        prefs.add(Integrity.NO);
        prefs.add(ServerAuthentication.NO);

        // The expected InvocationConstraints object
        icExp = new InvocationConstraints(reqs, prefs);
        tc[9] = new TestCase(icArg1, icArg2, icExp);
        return this;
    }

    /**
     * This method performs all test cases mentioned in the class description.
     */
    public void run() throws TestException {
        for (int i = 0; i < tc.length; i++) {
            logger.log(Level.FINE, "\n\t+++++ TestCase #" + (i + (int) 1));

            if (!tc[i].combine()) {
                throw new TestException(
                        "" + " test failed");
            }
        }
        return;
    }
}


text:
set -e
logfile="oneapm-ci-agent-install.log"
gist_request=/tmp/agent-gist-request.tmp
gist_response=/tmp/agent-gist-response.tmp

if [ $(command -v curl) ]; then
    cl_cmd="curl -f"
else
    cl_cmd="wget --quiet"
fi

# Set up a named pipe for logging
npipe=/tmp/$$.tmp
mknod $npipe p

# Log all output to a log for error checking
tee <$npipe $logfile &
exec 1>&-
exec 1>$npipe 2>&1
trap "rm -f $npipe" EXIT

function on_error() {
    printf "\033[31m$ERROR_MESSAGE
It looks like you hit an issue when trying to install the Agent.

Troubleshooting and basic usage information for the Agent are available at:

    http://support.oneapm.com

If you're still having problems, please contact to support@oneapm.com
and we'll do our very best to help you
solve your problem.\n\033[0m\n"
}
trap on_error ERR

if [ -n "$CI_LICENSE_KEY" ]; then
    license_key=$CI_LICENSE_KEY
fi

if [ -n "$CI_INSTALL_ONLY" ]; then
    no_start=true
else
    no_start=false
fi

if [ ! $license_key ]; then
    printf "\033[31mLicense key not available in CI_LICENSE_KEY environment variable.\033[0m\n"
    exit 1;
fi

# OS/Distro Detection
# Try lsb_release, fallback with /etc/issue then uname command
KNOWN_DISTRIBUTION="(Debian|Ubuntu|RedHat|CentOS|Amazon)"
DISTRIBUTION=$(lsb_release -d 2>/dev/null | grep -Eo $KNOWN_DISTRIBUTION  || grep -Eo $KNOWN_DISTRIBUTION /etc/issue 2>/dev/null || uname -s)

if [ $DISTRIBUTION = "Darwin" ]; then
    printf "\033[31mThis script does not support installing on the Mac..\033[0m\n"
    exit 1;

elif [ -f /etc/debian_version -o "$DISTRIBUTION" == "Debian" -o "$DISTRIBUTION" == "Ubuntu" ]; then
    OS="Debian"
elif [ -f /etc/redhat-release -o "$DISTRIBUTION" == "RedHat" -o "$DISTRIBUTION" == "CentOS" -o "$DISTRIBUTION" == "Amazon" ]; then
    OS="RedHat"
elif [ -f /etc/system-release -o "$DISTRIBUTION" == "Amazon" ]; then
    OS="RedHat"
fi

# Root user detection
if [ $(echo "$UID") = "0" ]; then
    sudo_cmd=''
else
    sudo_cmd='sudo'
fi

# Install the necessary package sources
if [ $OS = "RedHat" ]; then
    echo -e "\033[34m\n* Installing YUM sources for OneAPM\n\033[0m"

    UNAME_M=$(uname -m)
    if [ "$UNAME_M"  == "i686" -o "$UNAME_M"  == "i386" -o "$UNAME_M"  == "x86" ]; then
        ARCHI="i386"
    else
        ARCHI="x86_64"
    fi

    $sudo_cmd sh -c "echo -e '[oneapm-ci-agent]\nname = OneAPM, Inc.\nbaseurl = http://yum.oneapm.com/$ARCHI/\nenabled=1\ngpgcheck=0\npriority=1' > /etc/yum.repos.d/oneapm-ci-agent.repo"

    printf "\033[34m* Installing the OneAPM CI Agent package\n\033[0m\n"

    $sudo_cmd yum -y --disablerepo='*' --enablerepo='oneapm-ci-agent' install oneapm-ci-agent
elif [ $OS = "Debian" ]; then
    printf "\033[34m\n* Installing APT package sources for OneAPM\n\033[0m\n"
    $sudo_cmd sh -c "echo 'deb http://apt.oneapm.com/ stable main' > /etc/apt/sources.list.d/oneapm-ci-agent.list"
    $sudo_cmd apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 54B043BC

    printf "\033[34m\n* Installing the OneAPM CI Agent package\n\033[0m\n"
    ERROR_MESSAGE="ERROR
Failed to update the sources after adding the OneAPM repository.
This may be due to any of the configured APT sources failing -
see the logs above to determine the cause.
If the failing repository is OneAPM, please contact OneAPM support.
*****
"

    $sudo_cmd apt-get update -o Dir::Etc::sourcelist="sources.list.d/oneapm-ci-agent.list" -o Dir::Etc::sourceparts="-" -o APT::Get::List-Cleanup="0"
    ERROR_MESSAGE="ERROR
Failed to install the OneAPM package, sometimes it may be
due to another APT source failing. See the logs above to
determine the cause.
If the cause is unclear, please contact OneAPM support.
*****
"
    $sudo_cmd apt-get install -y --force-yes oneapm-ci-agent
    ERROR_MESSAGE=""
else
    printf "\033[31mYour OS or distribution are not supported by this install script.
Please follow the instructions on the Agent setup page.\033[0m\n"
    exit;
fi

# Set the configuration
if [ -e /etc/oneapm-ci-agent/oneapm-ci-agent.conf ]; then
    printf "\033[34m\n* Keeping old oneapm-ci-agent.conf configuration file\n\033[0m\n"
else
    printf "\033[34m\n* Adding your license key to the Agent configuration: /etc/oneapm-ci-agent/oneapm-ci-agent.conf\n\033[0m\n"
    $sudo_cmd sh -c "sed 's/license_key:.*/license_key: $license_key/' /etc/oneapm-ci-agent/oneapm-ci-agent.conf.example > /etc/oneapm-ci-agent/oneapm-ci-agent.conf"
fi

restart_cmd="$sudo_cmd /etc/init.d/oneapm-ci-agent restart"
if command -v invoke-rc.d >/dev/null 2>&1; then
    restart_cmd="$sudo_cmd invoke-rc.d oneapm-ci-agent restart"
fi

if $no_start; then
    printf "\033[34m
* CI_INSTALL_ONLY environment variable set: the newly installed version of the agent
will not start by itself. You will have to do it manually using the following
command:

    $restart_cmd

\033[0m\n"
    exit
fi

printf "\033[34m* Starting the Agent...\n\033[0m\n"
eval $restart_cmd

# Wait for metrics to be submitted by the forwarder
printf "\033[32m
Your Agent has started up for the first time. We're currently verifying that
data is being submitted.\033[0m

Waiting for metrics..."

c=0
while [ "$c" -lt "30" ]; do
    sleep 1
    echo -n "."
    c=$(($c+1))
done

# Reuse the same counter
c=0

# The command to check the status of the forwarder might fail at first, this is expected
# so we remove the trap and we set +e
set +e
trap - ERR

$cl_cmd http://127.0.0.1:10010/status?threshold=0 > /dev/null 2>&1
success=$?
while [ "$success" -gt "0" ]; do
    sleep 1
    echo -n "."
    $cl_cmd http://127.0.0.1:10010/status?threshold=0 > /dev/null 2>&1
    success=$?
    c=$(($c+1))

    if [ "$c" -gt "15" -o "$success" -eq "0" ]; then
        # After 15 tries, we give up, we restore the trap and set -e
        # Also restore the trap on success
        set -e
        trap on_error ERR
    fi
done

# Metrics are submitted, echo some instructions and exit
printf "\033[32m

Your Agent is running and functioning properly. It will continue to run in the
background and submit metrics to OneAPM.

If you ever want to stop the Agent, run:

    sudo /etc/init.d/oneapm-ci-agent stop

And to run it again run:

    sudo /etc/init.d/oneapm-ci-agent start

\033[0m"


text:
/*
 *		This Code Was Created By Brett Porter For NeHe Productions 2000
 *		Visit NeHe Productions At http://nehe.gamedev.net
 *
 *		Visit Brett Porter's Web Page at
 *		http://www.geocities.com/brettporter/programming
 */

#include <windows.h>												// Header File For Windows
#include <stdio.h>													// Header File For Standard Input/Output
#include <gl\gl.h>													// Header File For The OpenGL32 Library
#include <gl\glu.h>													// Header File For The GLu32 Library

#include "glaux.h"												    // Our Local Copy Of The Header File
                                                                    // For The Glaux Library

#include "MilkshapeModel.h"											// Header File For Milkshape File

HDC			hDC=NULL;												// Private GDI Device Context
HGLRC		hRC=NULL;												// Permanent Rendering Context
HWND		hWnd=NULL;												// Holds Our Window Handle
HINSTANCE	hInstance;												// Holds The Instance Of The Application

Model *pModel = NULL;												// Holds The Model Data

bool	keys[256];													// Array Used For The Keyboard Routine
bool	active=TRUE;												// Window Active Flag Set To TRUE By Default
bool	fullscreen=TRUE;											// Fullscreen Flag Set To Fullscreen Mode By Default

GLfloat	yrot=0.0f;													// Y Rotation

LRESULT	CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);				// Declaration For WndProc

AUX_RGBImageRec *LoadBMP(const char *Filename)						// Loads A Bitmap Image
{
	FILE *File=NULL;												// File Handle

	if (!Filename)													// Make Sure A Filename Was Given
	{
		return NULL;												// If Not Return NULL
	}

	File=fopen(Filename,"r");										// Check To See If The File Exists

	if (File)														// Does The File Exist?
	{
		fclose(File);												// Close The Handle
		return auxDIBImageLoad(Filename);							// Load The Bitmap And Return A Pointer
	}

	return NULL;													// If Load Failed Return NULL
}

GLuint LoadGLTexture( const char *filename )						// Load Bitmaps And Convert To Textures
{
	AUX_RGBImageRec *pImage;										// Create Storage Space For The Texture
	GLuint texture = 0;												// Texture ID

	pImage = LoadBMP( filename );									// Loads The Bitmap Specified By filename

	// Load The Bitmap, Check For Errors, If Bitmap's Not Found Quit
	if ( pImage != NULL && pImage->data != NULL )					// If Texture Image Exists
	{
		glGenTextures(1, &texture);									// Create The Texture

		// Typical Texture Generation Using Data From The Bitmap
		glBindTexture(GL_TEXTURE_2D, texture);
		glTexImage2D(GL_TEXTURE_2D, 0, 3, pImage->sizeX, pImage->sizeY, 0, GL_RGB, GL_UNSIGNED_BYTE, pImage->data);
		glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR);
		glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR);

		free(pImage->data);											// Free The Texture Image Memory
		free(pImage);												// Free The Image Structure
	}

	return texture;													// Return The Status
}

GLvoid ReSizeGLScene(GLsizei width, GLsizei height)					// Resize And Initialize The GL Window
{
	if (height==0)													// Prevent A Divide By Zero By
	{
		height=1;													// Making Height Equal One
	}

	glViewport(0,0,width,height);									// Reset The Current Viewport

	glMatrixMode(GL_PROJECTION);									// Select The Projection Matrix
	glLoadIdentity();												// Reset The Projection Matrix

	// Calculate The Aspect Ratio Of The Window
	gluPerspective(45.0f,(GLfloat)width/(GLfloat)height,1.0f,1000.0f);	// View Depth of 1000

	glMatrixMode(GL_MODELVIEW);										// Select The Modelview Matrix
	glLoadIdentity();												// Reset The Modelview Matrix
}

int InitGL(GLvoid)													// All Setup For OpenGL Goes Here
{
	pModel->reloadTextures();										// Loads Model Textures

	glEnable(GL_TEXTURE_2D);										// Enable Texture Mapping ( NEW )
	glShadeModel(GL_SMOOTH);										// Enable Smooth Shading
	glClearColor(0.0f, 0.0f, 0.0f, 0.5f);							// Black Background
	glClearDepth(1.0f);												// Depth Buffer Setup
	glEnable(GL_DEPTH_TEST);										// Enables Depth Testing
	glDepthFunc(GL_LEQUAL);											// The Type Of Depth Testing To Do
	glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);				// Really Nice Perspective Calculations
	return TRUE;													// Initialization Went OK
}

int DrawGLScene(GLvoid)												// Here's Where We Do All The Drawing
{
	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);				// Clear The Screen And The Depth Buffer
	glLoadIdentity();												// Reset The Modelview Matrix
	gluLookAt( 75, 75, 75, 0, 0, 0, 0, 1, 0 );						// (3) Eye Postion (3) Center Point (3) Y-Axis Up Vector

	glRotatef(yrot,0.0f,1.0f,0.0f);									// Rotate On The Y-Axis By yrot

	pModel->draw();													// Draw The Model

	yrot+=1.0f;														// Increase yrot By One
	return TRUE;													// Keep Going
}

GLvoid KillGLWindow(GLvoid)											// Properly Kill The Window
{
	if (fullscreen)													// Are We In Fullscreen Mode?
	{
		ChangeDisplaySettings(NULL,0);								// If So Switch Back To The Desktop
		ShowCursor(TRUE);											// Show Mouse Pointer
	}

	if (hRC)														// Do We Have A Rendering Context?
	{
		if (!wglMakeCurrent(NULL,NULL))								// Are We Able To Release The DC And RC Contexts?
		{
			MessageBox(NULL,"Release Of DC And RC Failed.","SHUTDOWN ERROR",MB_OK | MB_ICONINFORMATION);
		}

		if (!wglDeleteContext(hRC))									// Are We Able To Delete The RC?
		{
			MessageBox(NULL,"Release Rendering Context Failed.","SHUTDOWN ERROR",MB_OK | MB_ICONINFORMATION);
		}
		hRC=NULL;													// Set RC To NULL
	}

	if (hDC && !ReleaseDC(hWnd,hDC))								// Are We Able To Release The DC
	{
		MessageBox(NULL,"Release Device Context Failed.","SHUTDOWN ERROR",MB_OK | MB_ICONINFORMATION);
		hDC=NULL;													// Set DC To NULL
	}

	if (hWnd && !DestroyWindow(hWnd))								// Are We Able To Destroy The Window?
	{
		MessageBox(NULL,"Could Not Release hWnd.","SHUTDOWN ERROR",MB_OK | MB_ICONINFORMATION);
		hWnd=NULL;													// Set hWnd To NULL
	}

	if (!UnregisterClass("OpenGL",hInstance))						// Are We Able To Unregister Class
	{
		MessageBox(NULL,"Could Not Unregister Class.","SHUTDOWN ERROR",MB_OK | MB_ICONINFORMATION);
		hInstance=NULL;												// Set hInstance To NULL
	}
}

/*	This Code Creates Our OpenGL Window.  Parameters Are:					*
 *	title			- Title To Appear At The Top Of The Window				*
 *	width			- Width Of The GL Window Or Fullscreen Mode				*
 *	height			- Height Of The GL Window Or Fullscreen Mode			*
 *	bits			- Number Of Bits To Use For Color (8/16/24/32)			*
 *	fullscreenflag	- Use Fullscreen Mode (TRUE) Or Windowed Mode (FALSE)	*/

BOOL CreateGLWindow(char* title, int width, int height, int bits, bool fullscreenflag)
{
	GLuint		PixelFormat;										// Holds The Results After Searching For A Match
	WNDCLASS	wc;													// Windows Class Structure
	DWORD		dwExStyle;											// Window Extended Style
	DWORD		dwStyle;											// Window Style
	RECT		WindowRect;											// Grabs Rectangle Upper Left / Lower Right Values
	WindowRect.left=(long)0;										// Set Left Value To 0
	WindowRect.right=(long)width;									// Set Right Value To Requested Width
	WindowRect.top=(long)0;											// Set Top Value To 0
	WindowRect.bottom=(long)height;									// Set Bottom Value To Requested Height

	fullscreen=fullscreenflag;										// Set The Global Fullscreen Flag

	hInstance			= GetModuleHandle(NULL);					// Grab An Instance For Our Window
	wc.style			= CS_HREDRAW | CS_VREDRAW | CS_OWNDC;		// Redraw On Size, And Own DC For Window.
	wc.lpfnWndProc		= (WNDPROC) WndProc;						// WndProc Handles Messages
	wc.cbClsExtra		= 0;										// No Extra Window Data
	wc.cbWndExtra		= 0;										// No Extra Window Data
	wc.hInstance		= hInstance;								// Set The Instance
	wc.hIcon			= LoadIcon(NULL, IDI_WINLOGO);				// Load The Default Icon
	wc.hCursor			= LoadCursor(NULL, IDC_ARROW);				// Load The Arrow Pointer
	wc.hbrBackground	= NULL;										// No Background Required For GL
	wc.lpszMenuName		= NULL;										// We Don't Want A Menu
	wc.lpszClassName	= "OpenGL";									// Set The Class Name

	if (!RegisterClass(&wc))										// Attempt To Register The Window Class
	{
		MessageBox(NULL,"Failed To Register The Window Class.","ERROR",MB_OK|MB_ICONEXCLAMATION);
		return FALSE;												// Return FALSE
	}

	if (fullscreen)													// Attempt Fullscreen Mode?
	{
		DEVMODE dmScreenSettings;									// Device Mode
		memset(&dmScreenSettings,0,sizeof(dmScreenSettings));		// Makes Sure Memory's Cleared
		dmScreenSettings.dmSize=sizeof(dmScreenSettings);			// Size Of The Devmode Structure
		dmScreenSettings.dmPelsWidth	= width;					// Selected Screen Width
		dmScreenSettings.dmPelsHeight	= height;					// Selected Screen Height
		dmScreenSettings.dmBitsPerPel	= bits;						// Selected Bits Per Pixel
		dmScreenSettings.dmFields=DM_BITSPERPEL|DM_PELSWIDTH|DM_PELSHEIGHT;

		// Try To Set Selected Mode And Get Results.  NOTE: CDS_FULLSCREEN Gets Rid Of Start Bar.
		if (ChangeDisplaySettings(&dmScreenSettings,CDS_FULLSCREEN)!=DISP_CHANGE_SUCCESSFUL)
		{
			// If The Mode Fails, Offer Two Options.  Quit Or Use Windowed Mode.
			if (MessageBox(NULL,"The Requested Fullscreen Mode Is Not Supported By\nYour Video Card. Use Windowed Mode Instead?","NeHe GL",MB_YESNO|MB_ICONEXCLAMATION)==IDYES)
			{
				fullscreen=FALSE;									// Windowed Mode Selected.  Fullscreen = FALSE
			}
			else
			{
				// Pop Up A Message Box Letting User Know The Program Is Closing.
				MessageBox(NULL,"Program Will Now Close.","ERROR",MB_OK|MB_ICONSTOP);
				return FALSE;										// Return FALSE
			}
		}
	}

	if (fullscreen)													// Are We Still In Fullscreen Mode?
	{
		dwExStyle=WS_EX_APPWINDOW;									// Window Extended Style
		dwStyle=WS_POPUP;											// Windows Style
		ShowCursor(FALSE);											// Hide Mouse Pointer
	}
	else
	{
		dwExStyle=WS_EX_APPWINDOW | WS_EX_WINDOWEDGE;				// Window Extended Style
		dwStyle=WS_OVERLAPPEDWINDOW;								// Windows Style
	}

	AdjustWindowRectEx(&WindowRect, dwStyle, FALSE, dwExStyle);		// Adjust Window To True Requested Size

	// Create The Window
	if (!(hWnd=CreateWindowEx(	dwExStyle,							// Extended Style For The Window
								"OpenGL",							// Class Name
								title,								// Window Title
								dwStyle |							// Defined Window Style
								WS_CLIPSIBLINGS |					// Required Window Style
								WS_CLIPCHILDREN,					// Required Window Style
								0, 0,								// Window Position
								WindowRect.right-WindowRect.left,	// Calculate Window Width
								WindowRect.bottom-WindowRect.top,	// Calculate Window Height
								NULL,								// No Parent Window
								NULL,								// No Menu
								hInstance,							// Instance
								NULL)))								// Dont Pass Anything To WM_CREATE
	{
		KillGLWindow();												// Reset The Display
		MessageBox(NULL,"Window Creation Error.","ERROR",MB_OK|MB_ICONEXCLAMATION);
		return FALSE;												// Return FALSE
	}

	static	PIXELFORMATDESCRIPTOR pfd=								// pfd Tells Windows How We Want Things To Be
	{
		sizeof(PIXELFORMATDESCRIPTOR),								// Size Of This Pixel Format Descriptor
		1,															// Version Number
		PFD_DRAW_TO_WINDOW |										// Format Must Support Window
		PFD_SUPPORT_OPENGL |										// Format Must Support OpenGL
		PFD_DOUBLEBUFFER,											// Must Support Double Buffering
		PFD_TYPE_RGBA,												// Request An RGBA Format
		bits,														// Select Our Color Depth
		0, 0, 0, 0, 0, 0,											// Color Bits Ignored
		0,															// No Alpha Buffer
		0,															// Shift Bit Ignored
		0,															// No Accumulation Buffer
		0, 0, 0, 0,													// Accumulation Bits Ignored
		16,															// 16Bit Z-Buffer (Depth Buffer)
		0,															// No Stencil Buffer
		0,															// No Auxiliary Buffer
		PFD_MAIN_PLANE,												// Main Drawing Layer
		0,															// Reserved
		0, 0, 0														// Layer Masks Ignored
	};

	if (!(hDC=GetDC(hWnd)))											// Did We Get A Device Context?
	{
		KillGLWindow();												// Reset The Display
		MessageBox(NULL,"Can't Create A GL Device Context.","ERROR",MB_OK|MB_ICONEXCLAMATION);
		return FALSE;												// Return FALSE
	}

	if (!(PixelFormat=ChoosePixelFormat(hDC,&pfd)))					// Did Windows Find A Matching Pixel Format?
	{
		KillGLWindow();												// Reset The Display
		MessageBox(NULL,"Can't Find A Suitable PixelFormat.","ERROR",MB_OK|MB_ICONEXCLAMATION);
		return FALSE;												// Return FALSE
	}

	if(!SetPixelFormat(hDC,PixelFormat,&pfd))						// Are We Able To Set The Pixel Format?
	{
		KillGLWindow();												// Reset The Display
		MessageBox(NULL,"Can't Set The PixelFormat.","ERROR",MB_OK|MB_ICONEXCLAMATION);
		return FALSE;												// Return FALSE
	}

	if (!(hRC=wglCreateContext(hDC)))								// Are We Able To Get A Rendering Context?
	{
		KillGLWindow();												// Reset The Display
		MessageBox(NULL,"Can't Create A GL Rendering Context.","ERROR",MB_OK|MB_ICONEXCLAMATION);
		return FALSE;												// Return FALSE
	}

	if(!wglMakeCurrent(hDC,hRC))									// Try To Activate The Rendering Context
	{
		KillGLWindow();												// Reset The Display
		MessageBox(NULL,"Can't Activate The GL Rendering Context.","ERROR",MB_OK|MB_ICONEXCLAMATION);
		return FALSE;												// Return FALSE
	}

	ShowWindow(hWnd,SW_SHOW);										// Show The Window
	SetForegroundWindow(hWnd);										// Slightly Higher Priority
	SetFocus(hWnd);													// Sets Keyboard Focus To The Window
	ReSizeGLScene(width, height);									// Set Up Our Perspective GL Screen

	if (!InitGL())													// Initialize Our Newly Created GL Window
	{
		KillGLWindow();												// Reset The Display
		MessageBox(NULL,"Initialization Failed.","ERROR",MB_OK|MB_ICONEXCLAMATION);
		return FALSE;												// Return FALSE
	}

	return TRUE;													// Success
}

LRESULT CALLBACK WndProc(	HWND	hWnd,							// Handle For This Window
							UINT	uMsg,							// Message For This Window
							WPARAM	wParam,							// Additional Message Information
							LPARAM	lParam)							// Additional Message Information
{
	switch (uMsg)													// Check For Windows Messages
	{
		case WM_ACTIVATE:											// Watch For Window Activate Message
		{
			if (!HIWORD(wParam))									// Check Minimization State
			{
				active=TRUE;										// Program Is Active
			}
			else
			{
				active=FALSE;										// Program Is No Longer Active
			}

			return 0;												// Return To The Message Loop
		}

		case WM_SYSCOMMAND:											// Intercept System Commands
		{
			switch (wParam)											// Check System Calls
			{
				case SC_SCREENSAVE:									// Screensaver Trying To Start?
				case SC_MONITORPOWER:								// Monitor Trying To Enter Powersave?
				return 0;											// Prevent From Happening
			}
			break;													// Exit
		}

		case WM_CLOSE:												// Did We Receive A Close Message?
		{
			PostQuitMessage(0);										// Send A Quit Message
			return 0;												// Jump Back
		}

		case WM_KEYDOWN:											// Is A Key Being Held Down?
		{
			keys[wParam] = TRUE;									// If So, Mark It As TRUE
			return 0;												// Jump Back
		}

		case WM_KEYUP:												// Has A Key Been Released?
		{
			keys[wParam] = FALSE;									// If So, Mark It As FALSE
			return 0;												// Jump Back
		}

		case WM_SIZE:												// Resize The OpenGL Window
		{
			ReSizeGLScene(LOWORD(lParam),HIWORD(lParam));			// LoWord=Width, HiWord=Height
			return 0;												// Jump Back
		}
	}

	// Pass All Unhandled Messages To DefWindowProc
	return DefWindowProc(hWnd,uMsg,wParam,lParam);
}

int WINAPI WinMain(	HINSTANCE	hInstance,							// Instance
					HINSTANCE	hPrevInstance,						// Previous Instance
					LPSTR		lpCmdLine,							// Command Line Parameters
					int			nCmdShow)							// Window Show State
{
	MSG		msg;													// Windows Message Structure
	BOOL	done=FALSE;												// Bool Variable To Exit Loop

	pModel = new MilkshapeModel();									// Memory To Hold The Model
	if ( pModel->loadModelData( "data/model.ms3d" ) == false )		// Loads The Model And Checks For Errors
	{
		MessageBox( NULL, "Couldn't load the model data\\model.ms3d", "Error", MB_OK | MB_ICONERROR );
		return 0;													// If Model Didn't Load Quit
	}

	// Ask The User Which Screen Mode They Prefer
	if (MessageBox(NULL,"Would You Like To Run In Fullscreen Mode?", "Start FullScreen?",MB_YESNO|MB_ICONQUESTION)==IDNO)
	{
		fullscreen=FALSE;											// Windowed Mode
	}

	// Create Our OpenGL Window
	if (!CreateGLWindow("Brett Porter & NeHe's Model Rendering Tutorial",640,480,16,fullscreen))
	{
		return 0;													// Quit If Window Was Not Created
	}

	while(!done)													// Loop That Runs While done=FALSE
	{
		if (PeekMessage(&msg,NULL,0,0,PM_REMOVE))					// Is There A Message Waiting?
		{
			if (msg.message==WM_QUIT)								// Have We Received A Quit Message?
			{
				done=TRUE;											// If So done=TRUE
			}
			else													// If Not, Deal With Window Messages
			{
				TranslateMessage(&msg);								// Translate The Message
				DispatchMessage(&msg);								// Dispatch The Message
			}
		}
		else														// If There Are No Messages
		{
			// Draw The Scene.  Watch For ESC Key And Quit Messages From DrawGLScene()
			if ((active && !DrawGLScene()) || keys[VK_ESCAPE])		// Active?  Was There A Quit Received?
			{
				done=TRUE;											// ESC or DrawGLScene Signalled A Quit
			}
			else													// Not Time To Quit, Update Screen
			{
				SwapBuffers(hDC);									// Swap Buffers (Double Buffering)
			}

			if (keys[VK_F1])										// Is F1 Being Pressed?
			{
				keys[VK_F1]=FALSE;									// If So Make Key FALSE
				KillGLWindow();										// Kill Our Current Window
				fullscreen=!fullscreen;								// Toggle Fullscreen / Windowed Mode
				// Recreate Our OpenGL Window
				if (!CreateGLWindow("Brett Porter & NeHe's Model Rendering Tutorial",640,480,16,fullscreen))
				{
					return 0;										// Quit If Window Was Not Created
				}
			}
		}
	}

	// Shutdown
	KillGLWindow();													// Kill The Window
	return (msg.wParam);											// Exit The Program
}


text:
ACCEPTED

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
null

#### Original name
Bollea pulvinaris (Rchb.f.) Rchb.f.

### Remarks
null


text:
package cn.zxl.common.io;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.UnsupportedEncodingException;

public abstract class IOUtil {

	private static final String CHARSET = "utf-8";

	public static byte[] readBytes(InputStream inputStream, int bufSize) throws IOException {
		byte[] buf = new byte[bufSize];
		byte[] data = new byte[0];
		int length = 0;
		while ((length = inputStream.read(buf)) > 0) {
			int oldLength = data.length;
			byte[] temp = new byte[oldLength];
			System.arraycopy(data, 0, temp, 0, oldLength);
			data = new byte[length + oldLength];
			System.arraycopy(temp, 0, data, 0, oldLength);
			System.arraycopy(buf, 0, data, oldLength, length);
		}
		return data;
	}

	public static String readString(InputStream inputStream, int bufSize) throws IOException {
		return new String(readBytes(inputStream, bufSize), CHARSET);
	}

	public static void write(OutputStream outputStream, String message) throws UnsupportedEncodingException, IOException {
		outputStream.write(message.getBytes(CHARSET));
		outputStream.flush();
	}

}


text:
<?php
namespace Craft;

/**
 * Seomatic Meta field type
 */
class Seomatic_MetaFieldType extends BaseFieldType
{

    public function getName()
    {
        return Craft::t('SEOmatic Meta');
    }

    public function defineContentAttribute()
    {
        return AttributeType::Mixed;
    }

    public function getInputHtml($name, $value)
    {
        if (isset($this->element))
        {

        $id = craft()->templates->formatInputId($name);
        $namespacedId = craft()->templates->namespaceInputId($id);

        // Include our Javascript & CSS
        craft()->templates->includeCssResource('seomatic/css/css-reset.css');
        craft()->templates->includeCssResource('seomatic/css/prism.min.css');
        craft()->templates->includeCssResource('seomatic/css/bootstrap-tokenfield.css');
        craft()->templates->includeCssResource('seomatic/css/style.css');
        craft()->templates->includeCssResource('seomatic/css/field.css');
        craft()->templates->includeJsResource('seomatic/js/main_entity_type_list.js');
        craft()->templates->includeJs("var metaFieldPrefix='" . $namespacedId . "';");
        craft()->templates->includeJsResource('seomatic/js/meta.js');
        craft()->templates->includeJsResource('seomatic/js/field.js');
        craft()->templates->includeJsResource('seomatic/js/jquery.bpopup.min.js');
        craft()->templates->includeJsResource('seomatic/js/prism.min.js');
        craft()->templates->includeJsResource('seomatic/js/bootstrap-tokenfield.min.js');

        $variables = array(
            'id' => $id,
            'name' => $name,
            'meta' => $value,
            'element' => $this->element,
            'field' => $this->model,
            );

        $jsonVars = array(
            'id' => $id,
            'name' => $name,
            'namespace' => $namespacedId,
            'prefix' => craft()->templates->namespaceInputId(""),
            );

        if (isset($variables['locale']))
            $locale = $variables['locale'];
        else
            $locale = craft()->language;

        $siteMeta = craft()->seomatic->getSiteMeta($locale);
        $titleLength = craft()->config->get("maxTitleLength", "seomatic");
        if ($siteMeta['siteSeoTitlePlacement'] == "none")
            $variables['titleLength'] = $titleLength;
        else
            $variables['titleLength'] = ($titleLength - strlen(" | ") - strlen($siteMeta['siteSeoName']));

/* -- Prep some parameters */

        // Whether any assets sources exist
        $sources = craft()->assets->findFolders();
        $variables['assetsSourceExists'] = count($sources);

        // URL to create a new assets source
        $variables['newAssetsSourceUrl'] = UrlHelper::getUrl('settings/assets/sources/new');

        // Set asset ID
        $variables['seoImageId'] = $variables['meta']->seoImageId;

        // Set asset elements
        if ($variables['seoImageId']) {
            if (is_array($variables['seoImageId'])) {
                $variables['seoImageId'] = $variables['seoImageId'][0];
            }
            $asset = craft()->elements->getElementById($variables['seoImageId']);
            $variables['elements'] = array($asset);
        } else {
            $variables['elements'] = array();
        }

        // Set asset ID
        $variables['seoTwitterImageId'] = $variables['meta']->seoTwitterImageId;

        // Set asset elements
        if ($variables['seoTwitterImageId']) {
            if (is_array($variables['seoTwitterImageId'])) {
                $variables['seoTwitterImageId'] = $variables['seoTwitterImageId'][0];
            }
            $asset = craft()->elements->getElementById($variables['seoTwitterImageId']);
            $variables['elementsTwitter'] = array($asset);
        } else {
            $variables['elementsTwitter'] = array();
        }

        // Set asset ID
        $variables['seoFacebookImageId'] = $variables['meta']->seoFacebookImageId;

        // Set asset elements
        if ($variables['seoFacebookImageId']) {
            if (is_array($variables['seoFacebookImageId'])) {
                $variables['seoFacebookImageId'] = $variables['seoFacebookImageId'][0];
            }
            $asset = craft()->elements->getElementById($variables['seoFacebookImageId']);
            $variables['elementsFacebook'] = array($asset);
        } else {
            $variables['elementsFacebook'] = array();
        }

        // Set element type
        $variables['elementType'] = craft()->elements->getElementType(ElementType::Asset);

        $variables['assetSources'] = $this->getSettings()->assetSources;

        $variables['seoTitleSourceChangeable'] = $this->getSettings()->seoTitleSourceChangeable;
        $variables['seoDescriptionSourceChangeable'] = $this->getSettings()->seoDescriptionSourceChangeable;
        $variables['seoKeywordsSourceChangeable'] = $this->getSettings()->seoKeywordsSourceChangeable;
        $variables['seoImageIdSourceChangeable'] = $this->getSettings()->seoImageIdSourceChangeable;
        $variables['seoTwitterImageIdSourceChangeable'] = $this->getSettings()->seoTwitterImageIdSourceChangeable;
        $variables['seoFacebookImageIdSourceChangeable'] = $this->getSettings()->seoFacebookImageIdSourceChangeable;
        $variables['twitterCardTypeChangeable'] = $this->getSettings()->twitterCardTypeChangeable;
        $variables['openGraphTypeChangeable'] = $this->getSettings()->openGraphTypeChangeable;
        $variables['robotsChangeable'] = $this->getSettings()->robotsChangeable;

        $variables['transformsList'] = craft()->seomatic->getTransformsList();

/* -- Extract a list of the other plain text fields that are in this entry's layout */

        $fieldList = array('title' => 'Title');
        $fieldData = array('title' => $this->element->content['title']);
        $fieldImage = array();
        $imageFieldList = array();
        $fieldLayouts = $this->element->fieldLayout->getFields();
        foreach ($fieldLayouts as $fieldLayout)
        {
            $field = craft()->fields->getFieldById($fieldLayout->fieldId);

            switch ($field->type)
            {
                case "PlainText":
                case "RichText":
                case "RedactorI":
                case "PreparseField_Preparse":
                    $fieldList[$field->handle] = $field->name;
                    $fieldData[$field->handle] = craft()->seomatic->truncateStringOnWord(
                            strip_tags($this->element->content[$field->handle]),
                            200);
                    break;

                case "Neo":
                    $fieldList[$field->handle] = $field->name;
                    $fieldData[$field->handle] = craft()->seomatic->truncateStringOnWord(
                            craft()->seomatic->extractTextFromNeo($this->element[$field->handle]),
                            200);
                    break;

                case "Matrix":
                    $fieldList[$field->handle] = $field->name;
                    $fieldData[$field->handle] = craft()->seomatic->truncateStringOnWord(
                            craft()->seomatic->extractTextFromMatrix($this->element[$field->handle]),
                            200);
                    break;

                case "Tags":
                    $fieldList[$field->handle] = $field->name;
                    $fieldData[$field->handle] = craft()->seomatic->truncateStringOnWord(
                            craft()->seomatic->extractTextFromTags($this->element[$field->handle]),
                            200);
                    break;

                case "FocusPoint_FocusPoint":
                case "Assets":
                    $imageFieldList[$field->handle] = $field->name;
                    $img = $this->element[$field->handle]->first();
                    if ($img)
                        {
                            $fieldImage[$field->handle] = $img->url;
                        }
                    break;
            }
        }
        $variables['fieldList'] = $fieldList;
        $variables['imageFieldList'] = $imageFieldList;
        $variables['elementId'] = $this->element->id;
        $jsonVars['fieldData'] = $fieldData;
        $jsonVars['fieldImage'] = $fieldImage;
        $jsonVars['missing_image'] = UrlHelper::getResourceUrl('seomatic/images/missing_image.png');
        $jsonVars = json_encode($jsonVars);
        craft()->templates->includeJs("$('#{$namespacedId}').SeomaticFieldType(" . $jsonVars . ");");
        return craft()->templates->render('seomatic/field', $variables);
        }
    }

    /**
     * Define our settings
     * @return none
     */
    protected function defineSettings()
        {
            return array(
                'assetSources' => AttributeType::Mixed,

                'seoMainEntityCategory' => array(AttributeType::String, 'default' => 'CreativeWork'),
                'seoMainEntityOfPage' => array(AttributeType::String, 'default' => 'WebPage'),

                'seoTitle' => AttributeType::String,
                'seoTitleSource' => array(AttributeType::String, 'default' => 'field'),
                'seoTitleSourceField' => array(AttributeType::String, 'default' => 'title'),
                'seoTitleSourceChangeable' => array(AttributeType::Bool, 'default' => 1),

                'seoDescription' => AttributeType::String,
                'seoDescriptionSource' => AttributeType::String,
                'seoDescriptionSourceField' => AttributeType::String,
                'seoDescriptionSourceChangeable' => array(AttributeType::Bool, 'default' => 1),

                'seoKeywords' => AttributeType::String,
                'seoKeywordsSource' => AttributeType::String,
                'seoKeywordsSourceField' => AttributeType::String,
                'seoKeywordsSourceChangeable' => array(AttributeType::Bool, 'default' => 1),

                'seoImageIdSource' => AttributeType::String,
                'seoImageIdSourceField' => AttributeType::String,
                'seoImageIdSourceChangeable' => array(AttributeType::Bool, 'default' => 1),
                'seoImageTransform' => AttributeType::String,

                'twitterCardType' => AttributeType::String,
                'twitterCardTypeChangeable' => array(AttributeType::Bool, 'default' => 1),
                'seoTwitterImageIdSource' => AttributeType::String,
                'seoTwitterImageIdSourceField' => AttributeType::String,
                'seoTwitterImageIdSourceChangeable' => array(AttributeType::Bool, 'default' => 1),
                'seoTwitterImageTransform' => AttributeType::String,

                'openGraphType' => AttributeType::String,
                'openGraphTypeChangeable' => array(AttributeType::Bool, 'default' => 1),
                'seoFacebookImageIdSource' => AttributeType::String,
                'seoFacebookImageIdSourceField' => AttributeType::String,
                'seoFacebookImageIdSourceChangeable' => array(AttributeType::Bool, 'default' => 1),
                'seoFacebookImageTransform' => AttributeType::String,

                'robots' => AttributeType::String,
                'robotsChangeable' => array(AttributeType::Bool, 'default' => 1),
            );
        }

    /**
     * Render the field settings
     * @return none
     */
    public function getSettingsHtml()
    {
        $locale = craft()->language;
        $siteMeta = craft()->seomatic->getSiteMeta($locale);

        $fields = craft()->fields->getAllFields();

        $fieldList = array('title' => 'Title');
        $imageFieldList = array();
        foreach ($fields as $field)
        {

            switch ($field->type)
            {
                case "PlainText":
                case "RichText":
                case "RedactorI":
                case "PreparseField_Preparse":
                    $fieldList[$field->handle] = $field->name;
                    break;

                case "Matrix":
                    $fieldList[$field->handle] = $field->name;
                    break;

                case "Neo":
                    $fieldList[$field->handle] = $field->name;
                    break;

                case "Tags":
                    $fieldList[$field->handle] = $field->name;
                    break;

                case "FocusPoint_FocusPoint":
                case "Assets":
                    $imageFieldList[$field->handle] = $field->name;
                    break;
            }
        }

        $titleLength = craft()->config->get("maxTitleLength", "seomatic");
        if ($siteMeta['siteSeoTitlePlacement'] == "none")
            $titleLength = $titleLength;
        else
            $titleLength = ($titleLength - strlen(" | ") - strlen($siteMeta['siteSeoName']));

        craft()->templates->includeCssResource('seomatic/css/bootstrap-tokenfield.css');
        craft()->templates->includeCssResource('seomatic/css/style.css');
        craft()->templates->includeCssResource('seomatic/css/field.css');
        craft()->templates->includeJsResource('seomatic/js/main_entity_type_list.js');
        craft()->templates->includeJs("var metaFieldPrefix='types-Seomatic_Meta-';");
        craft()->templates->includeJsResource('seomatic/js/field_settings.js');
        craft()->templates->includeJsResource('seomatic/js/meta.js');
        craft()->templates->includeJsResource('seomatic/js/bootstrap-tokenfield.min.js');

        $assetElementType = craft()->elements->getElementType(ElementType::Asset);
        return craft()->templates->render('seomatic/field_settings', array(
            'assetSources'          => $this->getElementSources($assetElementType),
            'fieldList'             => $fieldList,
            'imageFieldList'        => $imageFieldList,
            'titleLength'           => $titleLength,
            'transformsList'        => craft()->seomatic->getTransformsList(),
            'settings'              => $this->getSettings()
        ));
   }

    /**
     * [prepValueFromPost description]
     * @param  [type] $value [description]
     * @return none          n/a
     */
    public function prepValueFromPost($value)
    {
        $result = null;

        if (empty($value))
        {
            $value = $this->prepValue($value);
        }
        else
        {
            $value = new Seomatic_MetaFieldModel($value);
            $value = $this->prepValue($value);
        }

/* -- Handle pulling values from other fields */

        $element = $this->element;
        if ($value->seoTitleUnparsed == "")
            $value->seoTitleUnparsed = $value->seoTitle;
        if ($value->seoDescriptionUnparsed == "")
            $value->seoDescriptionUnparsed = $value->seoDescription;
        if ($value->seoKeywordsUnparsed == "")
            $value->seoKeywordsUnparsed = $value->seoKeywords;

/* -- If we're attached to a Commerce_Product element, always have the Main Enity of Page be a Product */

        $elemType = $element->getElementType();
        if ($elemType == "Commerce_Product")
        {
            $value->seoMainEntityCategory = "Product";
            $value->seoMainEntityOfPage = "";
        }

        if ($element)
        {
    /* -- Swap in any SEOmatic fields that are pulling from other entry fields */

            switch ($value->seoTitleSource)
            {
                case 'field':
                    if (isset($element[$value->seoTitleSourceField]))
                    {
                        $value->seoTitle = craft()->seomatic->getTextFromEntryField($element[$value->seoTitleSourceField]);
                        if (craft()->config->get("truncateTitleTags", "seomatic"))
                        {
                            $truncLength = craft()->config->get("maxTitleLength", "seomatic");
                            $value->seoTitle = craft()->seomatic->truncateStringOnWord($value->seoTitle, $truncLength);
                        }
                    }
                break;

                case 'custom':
                    $value->seoTitle = craft()->seomatic->parseAsTemplate($value->seoTitleUnparsed, $element);
                break;
            }

            switch ($value->seoDescriptionSource)
            {
                case 'field':
                    if (isset($element[$value->seoDescriptionSourceField]))
                    {
                        $value->seoDescription = craft()->seomatic->getTextFromEntryField($element[$value->seoDescriptionSourceField]);
                        if (craft()->config->get("truncateDescriptionTags", "seomatic"))
                        {
                            $truncLength = craft()->config->get("maxDescriptionLength", "seomatic");
                            $value->seoDescription = craft()->seomatic->truncateStringOnWord($value->seoDescription, $truncLength);
                        }
                    }
                break;

                case 'custom':
                    $value->seoDescription = craft()->seomatic->parseAsTemplate($value->seoDescriptionUnparsed, $element);
               break;
            }

            switch ($value->seoKeywordsSource)
            {
                case 'field':
                    if (isset($element[$value->seoKeywordsSourceField]))
                    {
                        $value->seoKeywords = craft()->seomatic->getTextFromEntryField($element[$value->seoKeywordsSourceField]);
                        if (craft()->config->get("truncateKeywordsTags", "seomatic"))
                        {
                            $truncLength = craft()->config->get("maxKeywordsLength", "seomatic");
                            $value->seoKeywords = craft()->seomatic->truncateStringOnWord($value->seoKeywords, $truncLength);
                        }
                    }
                break;

                case 'keywords':
                    if (isset($element[$value->seoKeywordsSourceField]))
                    {
                        $text = craft()->seomatic->getTextFromEntryField($element[$value->seoKeywordsSourceField]);
                        $value->seoKeywords = craft()->seomatic->extractKeywords($text);
                    }
                break;

                case 'custom':
                    $value->seoKeywords = craft()->seomatic->parseAsTemplate($value->seoKeywordsUnparsed, $element);
               break;
            }

            switch ($value->seoImageIdSource)
            {
                case 'field':
                    if (isset($element[$value->seoImageIdSourceField]) && isset($element[$value->seoImageIdSourceField][0]))
                    {
                        $value->seoImageId = $element[$value->seoImageIdSourceField][0]->id;
                    }
                break;
            }

            switch ($value->seoTwitterImageIdSource)
            {
                case 'field':
                    if (isset($element[$value->seoTwitterImageIdSourceField]) && isset($element[$value->seoTwitterImageIdSourceField][0]))
                    {
                        $value->seoTwitterImageId = $element[$value->seoTwitterImageIdSourceField][0]->id;
                    }
                break;
            }

            switch ($value->seoFacebookImageIdSource)
            {
                case 'field':
                    if (isset($element[$value->seoFacebookImageIdSourceField]) && isset($element[$value->seoFacebookImageIdSourceField][0]))
                    {
                        $value->seoFacebookImageId = $element[$value->seoFacebookImageIdSourceField][0]->id;
                    }
                break;
            }

        }
        return $value;
    }

    public function prepValue($value)
    {

        if (!$value)
        {
            $value = new Seomatic_MetaFieldModel();

            $value->seoMainEntityCategory = $this->getSettings()->seoMainEntityCategory;
            $value->seoMainEntityOfPage = $this->getSettings()->seoMainEntityOfPage;

            $value->seoTitle = $this->getSettings()->seoTitle;
            $value->seoTitleUnparsed = $this->getSettings()->seoTitle;
            $value->seoTitleSource = $this->getSettings()->seoTitleSource;
            $value->seoTitleSourceField = $this->getSettings()->seoTitleSourceField;

            $value->seoDescription = $this->getSettings()->seoDescription;
            $value->seoDescriptionUnparsed = $this->getSettings()->seoDescription;
            $value->seoDescriptionSource = $this->getSettings()->seoDescriptionSource;
            $value->seoDescriptionSourceField = $this->getSettings()->seoDescriptionSourceField;

            $value->seoKeywords = $this->getSettings()->seoKeywords;
            $value->seoKeywordsUnparsed = $this->getSettings()->seoKeywords;
            $value->seoKeywordsSource = $this->getSettings()->seoKeywordsSource;
            $value->seoKeywordsSourceField = $this->getSettings()->seoKeywordsSourceField;

            $value->seoImageIdSource = $this->getSettings()->seoImageIdSource;
            $value->seoImageIdSourceField = $this->getSettings()->seoImageIdSourceField;
            $value->seoImageTransform = $this->getSettings()->seoImageTransform;

            $value->twitterCardType = $this->getSettings()->twitterCardType;
            $value->seoTwitterImageIdSource = $this->getSettings()->seoTwitterImageIdSource;
            $value->seoTwitterImageIdSourceField = $this->getSettings()->seoTwitterImageIdSourceField;
            $value->seoTwitterImageTransform = $this->getSettings()->seoTwitterImageTransform;

            $value->openGraphType = $this->getSettings()->openGraphType;
            $value->seoFacebookImageIdSource = $this->getSettings()->seoFacebookImageIdSource;
            $value->seoFacebookImageIdSourceField = $this->getSettings()->seoFacebookImageIdSourceField;
            $value->seoFacebookImageTransform = $this->getSettings()->seoFacebookImageTransform;

            $value->robots = $this->getSettings()->robots;
        }

        if (craft()->request->isSiteRequest())
        {
        }

        return $value;
    }

    /**
     * @inheritDoc IFieldType::onAfterElementSave()
     *
     * @return null
     */
    public function onAfterElementSave()
    {
        $element = $this->element;
        $content = $element->getContent();
        $fieldHandle = $this->model->handle;
        $shouldResave = false;

        if (empty($fieldHandle))
            $shouldResave = true;
        if (!isset($content[$fieldHandle]))
            $shouldResave = true;
        else
        {
            if (empty($content[$fieldHandle]))
                $shouldResave = true;
        }

// We should always re-save here, in case they changed the source for some fields or such
//        if ($shouldResave)
        if (true)
        {
            if ($content)
                $defaultField = $this->prepValueFromPost($content[$fieldHandle]);
            else
                $defaultField = $this->prepValueFromPost(null);
            $content->setAttribute($fieldHandle, $defaultField);
            $element->setContent($content);
            craft()->content->saveContent($element);
        }

        parent::onAfterElementSave();
    }

    /**
     * Returns sources avaible to an element type.
     *
     * @access protected
     * @return mixed
     */
    protected function getElementSources($elementType)
    {
        $sources = array();

        foreach ($elementType->getSources() as $key => $source)
        {
            if (!isset($source['heading']))
            {
                $sources[] = array('label' => $source['label'], 'value' => $key);
            }
        }

        return $sources;
    }

} /* -- Seomatic_MetaFieldType */


text:
> `npm install --save @types/sinonjs__fake-timers`

# Summary
This package contains type definitions for @sinonjs/fake-timers (https://github.com/sinonjs/fake-timers).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/sinonjs__fake-timers.

### Additional Details
 * Last updated: Tue, 30 Nov 2021 01:31:09 GMT
 * Dependencies: none
 * Global values: none

# Credits
These definitions were written by [Wim Looman](https://github.com/Nemo157), [Rogier Schouten](https://github.com/rogierschouten), [Yishai Zehavi](https://github.com/zyishai), [Remco Haszing](https://github.com/remcohaszing), and [Jaden Simon](https://github.com/JadenSimon).


text:
package com.consol.citrus.endpoint.adapter.mapping;

import com.consol.citrus.exceptions.CitrusRuntimeException;
import com.consol.citrus.message.DefaultMessage;
import org.testng.Assert;
import org.testng.annotations.Test;

/**
 * @author Christoph Deppisch
 */
public class HeaderMappingKeyExtractorTest {

    @Test
    public void testExtractMappingKey() throws Exception {
        HeaderMappingKeyExtractor extractor = new HeaderMappingKeyExtractor();
        extractor.setHeaderName("Foo");

        Assert.assertEquals(extractor.extractMappingKey(new DefaultMessage("Foo")
                .setHeader("Foo", "foo")
                .setHeader("Bar", "bar")), "foo");
    }

    @Test
    public void testExtractMappingKeyWithoutHeaderNameSet() throws Exception {
        HeaderMappingKeyExtractor extractor = new HeaderMappingKeyExtractor();

        try {
            extractor.extractMappingKey(new DefaultMessage("Foo")
                    .setHeader("Foo", "foo")
                    .setHeader("Bar", "bar"));
            Assert.fail("Missing exception due to unknown header");
        } catch (CitrusRuntimeException e) {
            Assert.assertTrue(e.getMessage().startsWith("Unable to find header"));
        }
    }

    @Test
    public void testExtractMappingKeyWithUnknownHeaderName() throws Exception {
        HeaderMappingKeyExtractor extractor = new HeaderMappingKeyExtractor("UNKNOWN");

        try {
            extractor.extractMappingKey(new DefaultMessage("Foo")
                    .setHeader("Foo", "foo")
                    .setHeader("Bar", "bar"));
            Assert.fail("Missing exception due to unknown header");
        } catch (CitrusRuntimeException e) {
            Assert.assertTrue(e.getMessage().startsWith("Unable to find header 'UNKNOWN'"));
        }
    }
}


text:
function __processArg(obj, key) {
    var arg = null;
    if (obj) {
        arg = obj[key] || null;
        delete obj[key];
    }
    return arg;
}

function Controller() {
    function registerForPushNotification() {
        if (!Alloy.Globals.DEMO_MODE) if (Titanium.Network.online) {
            LogManager.info("Register to iOS Push Notification");
            iOsRegistration();
        } else errorCallback({
            error: "NETWORK_ERROR"
        });
    }
    require("alloy/controllers/BaseController").apply(this, Array.prototype.slice.call(arguments));
    this.__controllerPath = "business/PushNotificationManager";
    if (arguments[0]) {
        __processArg(arguments[0], "__parentSymbol");
        __processArg(arguments[0], "$model");
        __processArg(arguments[0], "__itemTemplate");
    }
    var $ = this;
    var exports = {};
    exports.destroy = function() {};
    _.extend($, $.__views);
    var LogManager = Alloy.createController("business/LogManager");
    var errorCallback = function(e) {
        LogManager.error(String.format("Error during push notification registration: %s", e.error));
        var message;
        if ("ACCOUNT_MISSING" == e.error) {
            message = "Nessun Google account trovato, configurarne uno per ricevere le notifiche push.";
            Titanium.UI.createAlertDialog({
                title: "Attenzione",
                message: message,
                buttonNames: [ "OK" ]
            }).show();
        }
    };
    var iOsRegistration = function() {
        Ti.Network.registerForPushNotifications({
            types: [ Ti.Network.NOTIFICATION_TYPE_BADGE, Ti.Network.NOTIFICATION_TYPE_ALERT, Ti.Network.NOTIFICATION_TYPE_SOUND ],
            success: function(e) {
                var deviceToken = e.deviceToken;
                LogManager.info("iOS Registration success with ID:" + e.deviceToken);
                var UserManager = Alloy.createController("business/UserManager");
                UserManager.registerDeviceToken(deviceToken);
            },
            error: errorCallback,
            callback: function(e) {
                Ti.UI.iPhone.appBadge = 0;
                LogManager.info("Message reveived: " + e.data.alert);
                Titanium.UI.createAlertDialog({
                    title: "Notifica",
                    message: e.data.alert,
                    buttonNames: [ "OK" ]
                }).show();
            }
        });
    };
    this.registerForPushNotification = registerForPushNotification;
    _.extend($, exports);
}

var Alloy = require("alloy"), Backbone = Alloy.Backbone, _ = Alloy._;

module.exports = Controller;


text:
<?php
$sample_array = array(1, 2, array(3, 4));

$iterator = new RecursiveIteratorIterator(new RecursiveArrayIterator($sample_array));

$iterator->next();
$iterator->next();
var_dump(get_class($iterator->getSubIterator()));
var_dump($iterator->getSubIterator()->getArrayCopy());
$iterator->next();
var_dump(get_class($iterator->getSubIterator()));
var_dump($iterator->getSubIterator()->getArrayCopy());
?>