text:
//
//  UAEC2DeleteTagsRequest.m
//  AWS iOS SDK
//
//  Copyright © Unsigned Apps 2014. See License file.
//  Created by Rob Amos.
//
//

#import "UAEC2DeleteTagsRequest.h"
#import "UAAWSAdditionalAccessors.h"
#import "UAEC2DeleteTagsResponse.h"
#import "UAEC2Tag.h"

@interface UAEC2DeleteTagsRequest ()

@property (nonatomic, copy) NSString *action;
@property (nonatomic, copy) NSString *version;

@end

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wincomplete-implementation"

@implementation UAEC2DeleteTagsRequest

@synthesize action=_action, version=_version, dryRun=_dryRun, resources=_resources, tags=_tags;

- (id)init
{
	if (self = [super init])
	{
		[self setAction:@"DeleteTags"];
		[self setVersion:@"2014-05-01"];

		[self UA_addAtIndexAdditionalAccessorForSelector:@selector(resourceAtIndex:) propertyName:@"resources"];
		[self UA_addAtIndexAdditionalAccessorForSelector:@selector(tagAtIndex:) propertyName:@"tags"];
		[self UA_addAddObjectAdditionalAccessorForSelector:@selector(addResource:) propertyName:@"resources"];
		[self UA_addAddObjectAdditionalAccessorForSelector:@selector(addTag:) propertyName:@"tags"];
	}
	return self;
}

- (Class)UA_ResponseClass
{
	return [UAEC2DeleteTagsResponse class];
}

+ (NSDictionary *)queryStringKeyPathsByPropertyKey
{
    // Start with super's key paths (if there are any)
    NSMutableDictionary *keyPaths = [[UAEC2Request queryStringKeyPathsByPropertyKey] mutableCopy];

    [keyPaths addEntriesFromDictionary:
    @{
        @"action": @"Action",
        @"version": @"Version",
        @"dryRun": @"DryRun",
        @"resources": @"ResourceId",
        @"tags": @"Tag"
    }];
    return [keyPaths copy];
}

+ (NSValueTransformer *)tagsJSONTransformer
{
  return [NSValueTransformer UAMTL_JSONArrayTransformerWithModelClass:[UAEC2Tag class]];
}

+ (NSValueTransformer *)dryRunQueryStringTransformer
{
    return [UAMTLValueTransformer UA_JSONTransformerForBooleanString];
}

+ (NSValueTransformer *)tagsQueryStringTransformer
{
	return [NSValueTransformer UAMTL_QueryStringArrayTransformerWithModelClass:[UAEC2Tag class]];
}

/*#pragma mark - Invocation

- (void)invokeWithOwner:(id)owner completionBlock:(UAEC2DeleteTagsRequestCompletionBlock)completionBlock
{
    [self setUA_Owner:owner];
    [self setUA_RequestCompletionBlock:completionBlock];
    [self invoke];
}

- (void)waitWithOwner:(id)owner shouldContinueWaitingBlock:(UAEC2DeleteTagsRequestShouldContinueWaitingBlock)shouldContinueWaitingBlock completionBlock:(UAEC2DeleteTagsRequestCompletionBlock)completionBlock
{
    [self setUA_Owner:owner];
    [self setUA_ShouldContinueWaiting:shouldContinueWaitingBlock];
    [self setUA_RequestCompletionBlock:completionBlock];
    [self invoke];
}

- (void)waitWithOwner:(id)owner untilValueAtKeyPath:(NSString *)keyPath isInArray:(NSArray *)array completionBlock:(UAEC2DeleteTagsRequestCompletionBlock)completionBlock
{
    [self setUA_Owner:self];
    [self setUA_ShouldContinueWaiting:[UAAWSRequest UA_ShouldContinueWaitingBlockUntilValueAtKeyPath:keyPath isInArray:array]];
    [self setUA_RequestCompletionBlock:completionBlock];
    [self invoke];
}
*/
@end

#pragma clang diagnostic pop

redpajama_set_name: RedPajamaGithub


text:
/**
 * This is the root package for the Case Matcher library. This package provides the basic
 * interfaces for defining cases. To create eager versions of case matchers, the class
 * {@link de.boereck.matcher.eager.EagerMatcher EagerMatcher} provides static methods.
 * Other implementations of these interfaces (such as lazy or asynchronous versions) are
 * possible, but not part of this core library.
 * @see de.boereck.matcher.eager.EagerMatcher
 */
package de.boereck.matcher;


text:
- force-verify fix
- Twitch Clips
- Error handling
- v5 compatability

## 1.3.5
- Function name fix.

## 1.3.4

- New function `getAccessObject($code, $state = null)` to retrieve full response object when requesting access_token from Twitch. Use this instead of `getAccessToken($code, $state = null)` which is now deprecated.

## 1.3.3

- Twitch tokens can now be set again.
- Fixes to make updating a channel work properly

## 1.3.2

Improved headers and URL parameters.

## 1.3.1

Small authentication function fixes

## 1.3.0

### News

- Use `TwitchApi::getAuthenticationUrl($state, $forceVerify)` to get the redirection url for your users to sign in through Twitch. `$state` and `$forceVerify` are optional, read about them [here](https://github.com/justintv/Twitch-API/blob/master/authentication.md#authorization-code-flow).
- Use `getAccessToken($code)` to retrieve the Twitch token after the user has signed in through Twitch and been redirected back to your application/website.

### Fixes

- `chatBadges($channel)` and `chatEmoticons($channel)` were duplicates.

## 1.2.1

- A client id [is now required](https://blog.twitch.tv/client-id-required-for-kraken-api-calls-afbb8e95f843) for Twitch API calls. Make sure your Twitch client id is set in either `.env` using the `TWITCH_KEY` variable, or directly in `config/twitch-api.php`.

## 1.2.0

- Functions using the $option parameter has been fixed. This had to do with how headers were constructed in HTTP requests to the Twitch API using Guzzle.
- The Twitch API is now using https by default. Replacing http with https is no longer necessary.

## 1.1.0

- Function names are more friendly.

## 1.0.1

- Packagist support

## 1.0.0

- First release


text:
package org.basex.io;

import static org.junit.Assert.*;

import org.basex.util.*;
import org.junit.*;

/**
 * Test class for IO methods.
 *
 * @author BaseX Team 2005-16, BSD License
 * @author Christian Gruen
 */
public final class IOTest {
  /** URL to file conversions. */
  @Test
  public void urlToFile() {
    if(Prop.WIN) {
      assertEquals("C:/x y", IO.get("file:/c:/x%20y").path());
      assertEquals("C:/x y", IO.get("file://C:/x y").path());
      assertEquals("D:/x+y", IO.get("file:///D:/x%2By").path());
      assertEquals("G:/X", IO.get("file:///G:/X").path());
    } else {
      assertEquals("/x y", IOUrl.toFile("file:///x%20y"));
    }
  }

  /** File to URL conversions. */
  @Test
  public void fileToURL() {
    final String url = new IOFile("X Y").url();
    assertTrue(url.startsWith("file:/"));
    assertTrue(url.endsWith("X%20Y"));
  }
}


text:
<?php

namespace Base;

use Illuminate\Container\Container as IlluminateContainer;

/**
 * 基础容器类
 *
 * Class Container
 *
 * @package Base
 * @author  liuchao
 */
class Container extends IlluminateContainer {

    use MiddlewareTrait;

    /**
     * @var HttpRouter
     */
    public $router;

    /**
     * Container constructor.
     */
    public function __construct() {
        static::setInstance($this);
        $this->router = new HttpRouter($this);
    }

    /**
     * 执行应用
     *
     * @param \Request|null  $request
     * @param \Response|null $response
     *
     * @author  liuchao
     */
    public function run(\Request $request = null, \Response $response = null) {
        if (is_null($request)) {
            $request = $this->resolve(\Request::class);
        }
        if (is_null($response)) {
            $response = $this->resolve(\Response::class);
        }

        $response = $this->process($request, $response);

        if ($response instanceof \Response) {
            $response->send();
        } else {
            echo (string) $response;
        }
    }

    /**
     * 处理请求
     *
     * @param \Request  $request
     * @param \Response $response
     *
     * @return HttpResponse|\Response
     *
     * @author  liuchao
     */
    public function process(\Request $request, \Response $response) {

        try {
            $response = $this->callMiddlewareStack($request, $response);
        } catch (\Throwable $e) {
            $response = \HandleExceptions::makeExceptionResponse($e);
        }

        $response = $this->prepareResponse($response);

        return $response;
    }

    /**
     * 处理返回值
     *
     * @param $response
     *
     * @return HttpResponse
     *
     * @author  liuchao
     */
    public function prepareResponse($response) {
        if ( !$response instanceof \Response) {
            $response = new \Response($response);
        }

        return $response;
    }

    /**
     * 注册中间件
     *
     * @param $middleware
     *
     * @return $this
     *
     * @author  liuchao
     */
    public function middleware($middleware) {
        if (is_array($middleware)) {
            foreach ($middleware as $v) {
                $this->addMiddleware(new DeferredCallable($v, $this));
            }

            return $this;
        }

        return $this->addMiddleware(new DeferredCallable($middleware, $this));
    }

    /**
     * 注册事件监听
     *
     * @param array $listen
     *
     * @author  liuchao
     */
    public function listen(array $listen) {
        $events = $this->resolve('events');

        foreach ($listen as $event => $listeners) {
            foreach ($listeners as $listener) {
                $events->listen($event, $listener);
            }
        }
    }

    /**
     * 注册事件订阅
     *
     * @param array $subscribe
     *
     * @author  liuchao
     */
    public function subscribe(array $subscribe) {
        $events = $this->resolve('events');

        foreach ($subscribe as $subscriber) {
            $events->subscribe($subscriber);
        }
    }

    /**
     * 执行请求
     *
     * @param \Request  $request
     * @param \Response $response
     *
     * @return mixed
     *
     * @author  liuchao
     */
    public function __invoke(\Request $request, \Response $response) {
        return $this->router->run($request, $response);
    }

}


text:
package net.teamio.taam.integration.jei;

import mezz.jei.api.recipe.IRecipeHandler;
import mezz.jei.api.recipe.IRecipeWrapper;
import net.teamio.taam.Taam;
import net.teamio.taam.recipes.impl.SprayerRecipe;

public class SprayerRecipeHandler implements IRecipeHandler<SprayerRecipe> {

	@Override
	public Class<SprayerRecipe> getRecipeClass() {
		return SprayerRecipe.class;
	}

	@Override
	public String getRecipeCategoryUid(SprayerRecipe recipe) {
		return Taam.INTEGRATION_JEI_CAT_SPRAYER;
	}

	@Override
	public IRecipeWrapper getRecipeWrapper(SprayerRecipe recipe) {
		return new ProcessingRecipeFluidBasedWrapper(recipe);
	}

	@Override
	public boolean isRecipeValid(SprayerRecipe recipe) {
		return true;
	}

}


text:
package com.blooms.kingsite.modules.sys.listener;

import javax.servlet.ServletContext;

import org.springframework.web.context.WebApplicationContext;

import com.blooms.kingsite.modules.sys.service.SystemService;

public class WebContextListener extends org.springframework.web.context.ContextLoaderListener {

	@Override
	public WebApplicationContext initWebApplicationContext(ServletContext servletContext) {
		if (!SystemService.printKeyLoadMessage()){
			return null;
		}
		return super.initWebApplicationContext(servletContext);
	}
}


text:
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

          <title>IteratorTemplate - core 0.8.3-SNAPSHOT API - kafka.utils.IteratorTemplate</title>
          <meta name="description" content="IteratorTemplate - core 0.8.3 - SNAPSHOT API - kafka.utils.IteratorTemplate" />
          <meta name="keywords" content="IteratorTemplate core 0.8.3 SNAPSHOT API kafka.utils.IteratorTemplate" />
          <meta http-equiv="content-type" content="text/html; charset=UTF-8" />

      <link href="../../lib/template.css" media="screen" type="text/css" rel="stylesheet" />
      <link href="../../lib/diagrams.css" media="screen" type="text/css" rel="stylesheet" id="diagrams-css" />

kafka.utils

IteratorTemplate

        abstract
        class

        IteratorTemplate[T] extends Iterator[T] with Iterator[T]

Transliteration of the iterator template in google collections. To implement an iterator
override makeNext and call allDone() when there is no more items

          Linear Supertypes

Iterator[T], Iterator[T], TraversableOnce[T], GenTraversableOnce[T], AnyRef, Any

          Known Subclasses

ConsumerIterator

<input id="mbrsel-input" type="text" accesskey="/" />

              Ordering

Alphabetic

By inheritance

                Inherited

IteratorTemplate

Iterator

Iterator

TraversableOnce

GenTraversableOnce

AnyRef

Any

Hide All

Show all

            Learn more about member selection

            Visibility

Public

All

Instance Constructors

        new

        IteratorTemplate()

Type Members

        class

        GroupedIterator[B >: A] extends AbstractIterator[Seq[B]] with Iterator[Seq[B]]

Definition Classes

Iterator

Abstract Value Members

        abstract
        def

        makeNext(): T

Attributes

protected

Concrete Value Members

        final
        def

        !=(arg0: AnyRef): Boolean

Definition Classes

AnyRef

        final
        def

        !=(arg0: Any): Boolean

Definition Classes

Any

        final
        def

        ##(): Int

Definition Classes

AnyRef → Any

        def

        ++[B >: T](that: ⇒ GenTraversableOnce[B]): Iterator[B]

Definition Classes

Iterator

        def

        /:[B](z: B)(op: (B, T) ⇒ B): B

Definition Classes

TraversableOnce → GenTraversableOnce

        def

        :\[B](z: B)(op: (T, B) ⇒ B): B

Definition Classes

TraversableOnce → GenTraversableOnce

        final
        def

        ==(arg0: AnyRef): Boolean

Definition Classes

AnyRef

        final
        def

        ==(arg0: Any): Boolean

Definition Classes

Any

        def

        addString(b: StringBuilder): StringBuilder

Definition Classes

TraversableOnce

        def

        addString(b: StringBuilder, sep: String): StringBuilder

Definition Classes

TraversableOnce

        def

        addString(b: StringBuilder, start: String, sep: String, end: String): StringBuilder

Definition Classes

TraversableOnce

        def

        aggregate[B](z: B)(seqop: (B, T) ⇒ B, combop: (B, B) ⇒ B): B

Definition Classes

TraversableOnce → GenTraversableOnce

        def

        allDone(): T

Attributes

protected

        final
        def

        asInstanceOf[T0]: T0

Definition Classes

Any

        def

        buffered: BufferedIterator[T]

Definition Classes

Iterator

        def

        clone(): AnyRef

Attributes

protected[java.lang]

Definition Classes

AnyRef

Annotations

                @throws(

      ...
    )

        def

        collect[B](pf: PartialFunction[T, B]): Iterator[B]

Definition Classes

Iterator

Annotations

                @migration

Migration

(Changed in version 2.8.0) collect has changed. The previous behavior can be reproduced with toSeq.

        def

        collectFirst[B](pf: PartialFunction[T, B]): Option[B]

Definition Classes

TraversableOnce

        def

        contains(elem: Any): Boolean

Definition Classes

Iterator

        def

        copyToArray[B >: T](xs: Array[B], start: Int, len: Int): Unit

Definition Classes

Iterator → TraversableOnce → GenTraversableOnce

        def

        copyToArray[B >: T](xs: Array[B]): Unit

Definition Classes

TraversableOnce → GenTraversableOnce

        def

        copyToArray[B >: T](xs: Array[B], start: Int): Unit

Definition Classes

TraversableOnce → GenTraversableOnce

        def

        copyToBuffer[B >: T](dest: Buffer[B]): Unit

Definition Classes

TraversableOnce

        def

        corresponds[B](that: GenTraversableOnce[B])(p: (T, B) ⇒ Boolean): Boolean

Definition Classes

Iterator

        def

        count(p: (T) ⇒ Boolean): Int

Definition Classes

TraversableOnce → GenTraversableOnce

        def

        drop(n: Int): Iterator[T]

Definition Classes

Iterator

        def

        dropWhile(p: (T) ⇒ Boolean): Iterator[T]

Definition Classes

Iterator

        def

        duplicate: (Iterator[T], Iterator[T])

Definition Classes

Iterator

        final
        def

        eq(arg0: AnyRef): Boolean

Definition Classes

AnyRef

        def

        equals(arg0: Any): Boolean

Definition Classes

AnyRef → Any

        def

        exists(p: (T) ⇒ Boolean): Boolean

Definition Classes

Iterator → TraversableOnce → GenTraversableOnce

        def

        filter(p: (T) ⇒ Boolean): Iterator[T]

Definition Classes

Iterator

        def

        filterNot(p: (T) ⇒ Boolean): Iterator[T]

Definition Classes

Iterator

        def

        finalize(): Unit

Attributes

protected[java.lang]

Definition Classes

AnyRef

Annotations

                @throws(

      classOf[java.lang.Throwable]
    )

        def

        find(p: (T) ⇒ Boolean): Option[T]

Definition Classes

Iterator → TraversableOnce → GenTraversableOnce

        def

        flatMap[B](f: (T) ⇒ GenTraversableOnce[B]): Iterator[B]

Definition Classes

Iterator

        def

        fold[A1 >: T](z: A1)(op: (A1, A1) ⇒ A1): A1

Definition Classes

TraversableOnce → GenTraversableOnce

        def

        foldLeft[B](z: B)(op: (B, T) ⇒ B): B

Definition Classes

TraversableOnce → GenTraversableOnce

        def

        foldRight[B](z: B)(op: (T, B) ⇒ B): B

Definition Classes

TraversableOnce → GenTraversableOnce

        def

        forall(p: (T) ⇒ Boolean): Boolean

Definition Classes

Iterator → TraversableOnce → GenTraversableOnce

        def

        foreach[U](f: (T) ⇒ U): Unit

Definition Classes

Iterator → TraversableOnce → GenTraversableOnce

        final
        def

        getClass(): Class[_]

Definition Classes

AnyRef → Any

        def

        grouped[B >: T](size: Int): GroupedIterator[B]

Definition Classes

Iterator

        def

        hasDefiniteSize: Boolean

Definition Classes

Iterator → TraversableOnce → GenTraversableOnce

        def

        hasNext(): Boolean

Definition Classes

IteratorTemplate → Iterator → Iterator

        def

        hashCode(): Int

Definition Classes

AnyRef → Any

        def

        indexOf[B >: T](elem: B): Int

Definition Classes

Iterator

        def

        indexWhere(p: (T) ⇒ Boolean): Int

Definition Classes

Iterator

        def

        isEmpty: Boolean

Definition Classes

Iterator → TraversableOnce → GenTraversableOnce

        final
        def

        isInstanceOf[T0]: Boolean

Definition Classes

Any

        def

        isTraversableAgain: Boolean

Definition Classes

Iterator → GenTraversableOnce

        def

        length: Int

Definition Classes

Iterator

        def

        map[B](f: (T) ⇒ B): Iterator[B]

Definition Classes

Iterator

        def

        max[B >: T](implicit cmp: Ordering[B]): T

Definition Classes

TraversableOnce → GenTraversableOnce

        def

        maxBy[B](f: (T) ⇒ B)(implicit cmp: Ordering[B]): T

Definition Classes

TraversableOnce → GenTraversableOnce

        def

        maybeComputeNext(): Boolean

        def

        min[B >: T](implicit cmp: Ordering[B]): T

Definition Classes

TraversableOnce → GenTraversableOnce

        def

        minBy[B](f: (T) ⇒ B)(implicit cmp: Ordering[B]): T

Definition Classes

TraversableOnce → GenTraversableOnce

        def

        mkString: String

Definition Classes

TraversableOnce → GenTraversableOnce

        def

        mkString(sep: String): String

Definition Classes

TraversableOnce → GenTraversableOnce

        def

        mkString(start: String, sep: String, end: String): String

Definition Classes

TraversableOnce → GenTraversableOnce

        final
        def

        ne(arg0: AnyRef): Boolean

Definition Classes

AnyRef

        def

        next(): T

Definition Classes

IteratorTemplate → Iterator → Iterator

        def

        nonEmpty: Boolean

Definition Classes

TraversableOnce → GenTraversableOnce

        final
        def

        notify(): Unit

Definition Classes

AnyRef

        final
        def

        notifyAll(): Unit

Definition Classes

AnyRef

        def

        padTo[A1 >: T](len: Int, elem: A1): Iterator[A1]

Definition Classes

Iterator

        def

        partition(p: (T) ⇒ Boolean): (Iterator[T], Iterator[T])

Definition Classes

Iterator

        def

        patch[B >: T](from: Int, patchElems: Iterator[B], replaced: Int): Iterator[B]

Definition Classes

Iterator

        def

        peek(): T

        def

        product[B >: T](implicit num: Numeric[B]): B

Definition Classes

TraversableOnce → GenTraversableOnce

        def

        reduce[A1 >: T](op: (A1, A1) ⇒ A1): A1

Definition Classes

TraversableOnce → GenTraversableOnce

        def

        reduceLeft[B >: T](op: (B, T) ⇒ B): B

Definition Classes

TraversableOnce

        def

        reduceLeftOption[B >: T](op: (B, T) ⇒ B): Option[B]

Definition Classes

TraversableOnce → GenTraversableOnce

        def

        reduceOption[A1 >: T](op: (A1, A1) ⇒ A1): Option[A1]

Definition Classes

TraversableOnce → GenTraversableOnce

        def

        reduceRight[B >: T](op: (T, B) ⇒ B): B

Definition Classes

TraversableOnce → GenTraversableOnce

        def

        reduceRightOption[B >: T](op: (T, B) ⇒ B): Option[B]

Definition Classes

TraversableOnce → GenTraversableOnce

        def

        remove(): Nothing

Definition Classes

IteratorTemplate → Iterator

        def

        resetState(): Unit

Attributes

protected

        def

        reversed: List[T]

Attributes

protected[this]

Definition Classes

TraversableOnce

        def

        sameElements(that: Iterator[_]): Boolean

Definition Classes

Iterator

        def

        scanLeft[B](z: B)(op: (B, T) ⇒ B): Iterator[B]

Definition Classes

Iterator

        def

        scanRight[B](z: B)(op: (T, B) ⇒ B): Iterator[B]

Definition Classes

Iterator

        def

        seq: Iterator[T]

Definition Classes

Iterator → TraversableOnce → GenTraversableOnce

        def

        size: Int

Definition Classes

TraversableOnce → GenTraversableOnce

        def

        slice(from: Int, until: Int): Iterator[T]

Definition Classes

Iterator

        def

        sliding[B >: T](size: Int, step: Int): GroupedIterator[B]

Definition Classes

Iterator

        def

        span(p: (T) ⇒ Boolean): (Iterator[T], Iterator[T])

Definition Classes

Iterator

        def

        sum[B >: T](implicit num: Numeric[B]): B

Definition Classes

TraversableOnce → GenTraversableOnce

        final
        def

        synchronized[T0](arg0: ⇒ T0): T0

Definition Classes

AnyRef

        def

        take(n: Int): Iterator[T]

Definition Classes

Iterator

        def

        takeWhile(p: (T) ⇒ Boolean): Iterator[T]

Definition Classes

Iterator

        def

        to[Col[_]](implicit cbf: CanBuildFrom[Nothing, T, Col[T]]): Col[T]

Definition Classes

TraversableOnce → GenTraversableOnce

        def

        toArray[B >: T](implicit arg0: ClassTag[B]): Array[B]

Definition Classes

TraversableOnce → GenTraversableOnce

        def

        toBuffer[B >: T]: Buffer[B]

Definition Classes

TraversableOnce → GenTraversableOnce

        def

        toIndexedSeq: IndexedSeq[T]

Definition Classes

TraversableOnce → GenTraversableOnce

        def

        toIterable: Iterable[T]

Definition Classes

TraversableOnce → GenTraversableOnce

        def

        toIterator: Iterator[T]

Definition Classes

Iterator → GenTraversableOnce

        def

        toList: List[T]

Definition Classes

TraversableOnce → GenTraversableOnce

        def

        toMap[T, U](implicit ev: <:<[T, (T, U)]): Map[T, U]

Definition Classes

TraversableOnce → GenTraversableOnce

        def

        toSeq: Seq[T]

Definition Classes

TraversableOnce → GenTraversableOnce

        def

        toSet[B >: T]: Set[B]

Definition Classes

TraversableOnce → GenTraversableOnce

        def

        toStream: Stream[T]

Definition Classes

Iterator → GenTraversableOnce

        def

        toString(): String

Definition Classes

Iterator → AnyRef → Any

        def

        toTraversable: Traversable[T]

Definition Classes

Iterator → TraversableOnce → GenTraversableOnce

        def

        toVector: Vector[T]

Definition Classes

TraversableOnce → GenTraversableOnce

        final
        def

        wait(): Unit

Definition Classes

AnyRef

Annotations

                @throws(

      ...
    )

        final
        def

        wait(arg0: Long, arg1: Int): Unit

Definition Classes

AnyRef

Annotations

                @throws(

      ...
    )

        final
        def

        wait(arg0: Long): Unit

Definition Classes

AnyRef

Annotations

                @throws(

      ...
    )

        def

        withFilter(p: (T) ⇒ Boolean): Iterator[T]

Definition Classes

Iterator

        def

        zip[B](that: Iterator[B]): Iterator[(T, B)]

Definition Classes

Iterator

        def

        zipAll[B, A1 >: T, B1 >: B](that: Iterator[B], thisElem: A1, thatElem: B1): Iterator[(A1, B1)]

Definition Classes

Iterator

        def

        zipWithIndex: Iterator[(T, Int)]

Definition Classes

Iterator

Deprecated Value Members

        def

        /:\[A1 >: T](z: A1)(op: (A1, A1) ⇒ A1): A1

Definition Classes

GenTraversableOnce

Annotations

                @deprecated

Deprecated

(Since version 2.10.0) use fold instead

Inherited from Iterator[T]

Inherited from Iterator[T]

Inherited from TraversableOnce[T]

Inherited from GenTraversableOnce[T]

Inherited from AnyRef

Inherited from Any

Ungrouped


text:
html {
    height: 100%;
    font-family: "Helvetica Neue" Helvetica;

    background-image:url(../img/background.jpg);
    background-repeat:no-repeat;
    background-size:cover;
    background-position: top center;
    color: #DEDEDE;
}

header {
    background: transparent url(../img/logo.png) no-repeat left center;
    background-size: contain;
    height: auto;
    text-align: right;
    font-size: 65px;
    line-height: inherit;
    padding: 20px;
    color: white;
    text-shadow: 2px 2px 2px #111;
}

h1 {
    text-align: center;
    margin-top: 5%;
}

ul {
  font-size: 32px;
  text-align: center;
  list-style: none;
  margin: 0;
  padding: 0;
}

li {
  color: #FF6600;
    text-shadow: 2px 2px 2px #444;
    margin: 30px;
    text-align: center;
    border-radius: 15px;
    background-color: rgba(230,230,230,0.6);
    box-shadow: 5px 5px 10px #555;
    padding: 20px;
}

li div {
  font-size: 25px;
  margin: -5px 10px;
  color: #8800BB;
  text-align: right;
}

.twitter-timeline {
  width: 90% !important;
  height: 80% !important;
  margin: 20px auto !important;
  display: block !important;
}


text:
define(function () {
  return function PointSeriesInitX() {
    return function initXAxis(chart) {
      const x = chart.aspects.x;
      chart.xAxisFormatter = x.agg ? x.agg.fieldFormatter() : String;
      chart.xAxisLabel = x.col.title;

      if (!x.agg || !x.agg.type.ordered) return;

      chart.indexPattern = x.agg.vis.indexPattern;
      chart.xAxisField = x.agg.params.field;

      chart.ordered = {};
      const xAggOutput = x.agg.write();
      if (xAggOutput.params.interval) {
        chart.ordered.interval = xAggOutput.params.interval;
      }
    };
  };
});


text:
\subsection{Paradigmatic vs Syntagmatic Representations of Word Context}
\label{sec:pvss}

To get a direct comparison of the paradigmatic and syntagmatic context
representations we feed 4 different co-occurrences defined in
Section~\ref{sec:representation} into the S-CODE algorithm.  The first
model accepts word ($W$) - right bigram ($C$) pairs as the input, the
second model accepts word ($W$) - left bigram($C$) pairs as the input,
the third model accepts word ($W$) - concatenation of the left and
right bigrams ($C$) pairs \cite{mintz2003frequent} as the input and
the final model accepts words ($W$) - left bigram($C_1$) and right
bigram ($C_2$) tuples \cite{20674613} as the input to the S-CODE.
Finally, we cluster the word type embeddings ($W$) with k-means
algorithm and report the results on Table \ref{tab:syntagmatic}.
\begin{table}[ht]
\centering
\caption{Summary of results in terms of the \mto\ and \vm\ scores of
  the S-CODE algorithm when the paradigmatic or syntagmatic
  representations are feed as an input.  Standard errors are given in
  parentheses when available.  Results of the statistically best
  performing system are written in bold.  We do not report the
  original results of Maron et al. \protect\shortcite{maron2010sphere}
  since our replication achieves higher accuracies.}
\begin{tabular}{|l|l|l|}
\hline
Input & \mto & \vm\\
\hline
$W$ (word) - $C$ (right bigram) & .6625 (.0115) & .5809 (.0066)\\
$W$ (word) - $C$ (left bigram) & .6604 (.0054) & .5983 (.0028)\\
$W$ (word) - $C$ (left and right bigram concatenation) & .7268 (.0091) & .6416 (.0052)\\
$W$ (word) - $C_1$, $C_2$ (left and right bigrams) & .7173 (.0061) & .6381 (.0032)\\
Maron et al. \shortcite{maron2010sphere}(replication)  & \bgmto & \bgvm \\
$W$ (word) - $C$ (random substitutes) & {\bf\wsmto} & {\bf\wsvm} \\
\hline
\end{tabular}
\label{tab:syntagmatic}
\end{table}

To replicate the work of Maron et al. \shortcite{maron2010sphere} we
feed word ($W$) - right bigram ($C$) pairs as the input.  At the end
each word $w$ in the vocabulary ends up with two points on the sphere,
a $\phi_w$ point representing the behavior of $w$ as the left word of
a bigram and a $\psi_w$ point representing it as the right word.  The
two vectors for $w$ are concatenated to create a 50-dimensional
representation at the end.  These 50-dimensional vectors are clustered
using the k-means algorithm.  Maron et al. \shortcite{maron2010sphere}
report many-to-one scores of .6880 (.0016) for 45 clusters and .7150
(.0060) for 50 clusters (on the PTB).  Using our default settings the
bigram model achieves \bgmto\ \mto\ and \bgvm\ \vm\ accuracies.  Table
\ref{tab:syntagmatic} summarizes all the results and shows that the
paradigmatic representation accuracies are significantly higher than
the syntagmatic representation \mto\ and \vm\ accuracies.


text:
<?xml version="1.0"?>
<doc>
    <assembly>
        <name>Microsoft.Extensions.WebEncoders</name>
    </assembly>
    <members>
        <member name="T:Microsoft.Extensions.DependencyInjection.EncoderServiceCollectionExtensions">
            <summary>
            Extension methods for setting up web encoding services in an <see cref="T:Microsoft.Extensions.DependencyInjection.IServiceCollection" />.
            </summary>
        </member>
        <member name="M:Microsoft.Extensions.DependencyInjection.EncoderServiceCollectionExtensions.AddWebEncoders(Microsoft.Extensions.DependencyInjection.IServiceCollection)">
            <summary>
            Adds <see cref="T:System.Text.Encodings.Web.HtmlEncoder"/>, <see cref="T:System.Text.Encodings.Web.JavaScriptEncoder"/> and <see cref="T:System.Text.Encodings.Web.UrlEncoder"/>
            to the specified <paramref name="services" />.
            </summary>
            <param name="services">The <see cref="T:Microsoft.Extensions.DependencyInjection.IServiceCollection"/>.</param>
            <returns>The <see cref="T:Microsoft.Extensions.DependencyInjection.IServiceCollection"/> so that additional calls can be chained.</returns>
        </member>
        <member name="M:Microsoft.Extensions.DependencyInjection.EncoderServiceCollectionExtensions.AddWebEncoders(Microsoft.Extensions.DependencyInjection.IServiceCollection,System.Action{Microsoft.Extensions.WebEncoders.WebEncoderOptions})">
            <summary>
            Adds <see cref="T:System.Text.Encodings.Web.HtmlEncoder"/>, <see cref="T:System.Text.Encodings.Web.JavaScriptEncoder"/> and <see cref="T:System.Text.Encodings.Web.UrlEncoder"/>
            to the specified <paramref name="services" />.
            </summary>
            <param name="services">The <see cref="T:Microsoft.Extensions.DependencyInjection.IServiceCollection"/>.</param>
            <param name="setupAction">An <see cref="T:System.Action`1"/> to configure the provided <see cref="T:Microsoft.Extensions.WebEncoders.WebEncoderOptions"/>.</param>
            <returns>The <see cref="T:Microsoft.Extensions.DependencyInjection.IServiceCollection"/> so that additional calls can be chained.</returns>
        </member>
        <member name="T:Microsoft.Extensions.WebEncoders.WebEncoderOptions">
            <summary>
            Specifies options common to all three encoders (HtmlEncode, JavaScriptEncode, UrlEncode).
            </summary>
        </member>
        <member name="P:Microsoft.Extensions.WebEncoders.WebEncoderOptions.TextEncoderSettings">
            <summary>
            Specifies which code points are allowed to be represented unescaped by the encoders.
            </summary>
            <remarks>
            If this property is null, then the encoders will use their default allow lists.
            </remarks>
        </member>
        <member name="T:Microsoft.Extensions.WebEncoders.Testing.HtmlTestEncoder">
            <summary>
            Encoder used for unit testing.
            </summary>
        </member>
        <member name="T:Microsoft.Extensions.WebEncoders.Testing.JavaScriptTestEncoder">
            <summary>
            Encoder used for unit testing.
            </summary>
        </member>
        <member name="T:Microsoft.Extensions.WebEncoders.Testing.UrlTestEncoder">
            <summary>
            Encoder used for unit testing.
            </summary>
        </member>
    </members>
</doc>


text:
package de.eorg.cumulusgenius.shared.cloudmapping.model.ahp.configuration;

import de.eorg.cumulusgenius.shared.cloudmapping.model.ahp.values.GoalImportance;

import java.io.Serializable;
import java.util.*;
import java.util.logging.Logger;

public class Decision<T extends Alternative> implements Serializable, Cloneable {

	/**
	 *
	 */

	private static final long serialVersionUID = 4411517735777225339L;

	private static Logger log = Logger.getLogger(Decision.class.getName());

	/**
	 * @uml.property name="userId"
	 */
	protected String userId;

	/**
	 * @uml.property name="name"
	 */
	protected String name;

	/**
	 * @uml.property name="description"
	 */
	protected String description;

	/**
	 * @uml.property name="alternatives"
	 * @uml.associationEnd multiplicity="(0 -1)" inverse=
	 *                     "decision:de.eorg.cumulusgenius.shared.cloudmapping.model.ahp.configuration.Alternative"
	 */
	protected List<T> alternatives = new ArrayList<T>();

	/**
	 * @uml.property name="goals"
	 * @uml.associationEnd multiplicity="(0 -1)" inverse=
	 *                     "decision:de.eorg.cumulusgenius.shared.cloudmapping.model.ahp.configuration.Goal"
	 */
	protected List<Goal> goals = new ArrayList<Goal>();

	/**
	 * @uml.property name="importanceGoals"
	 * @uml.associationEnd multiplicity="(0 -1)" inverse=
	 *                     "decision:de.eorg.cumulusgenius.shared.cloudmapping.model.ahp.values.GoalImportance"
	 */
	protected Map<GoalType, List<GoalImportance>> importanceGoals = new HashMap<GoalType, List<GoalImportance>>();

	public Decision() {
		super();
	}

	public Decision(String decisionName) {
		super();
		this.name = decisionName;
	}

	public Decision(String userId, String name, String description) {
		super();
		this.userId = userId;
		this.name = name;
		this.description = description;
	}

	public void addAlternative(T alternative) {
		getAlternatives().add(alternative);
	}

	public void addGoal(Goal goal) {
		getGoals().add(goal);
	}

	public int countGoals() {
		return getGoals().size();
	}

	public Alternative getAlternative(String alternativeName) {
		for (Alternative a : getAlternatives())
			if (a.getName().equals(alternativeName))
				return a;
		return null;
	}

	public List<T> getAlternatives() {
		return alternatives;
	}

	public Criterion getCriterion(String criterionName) {
		if (getGoal(criterionName) != null)
			return getGoal(criterionName);
		for (Goal goal : getGoals()) {
			Criterion a = getCriterion(goal, criterionName);
			if (a != null)
				return a;
		}
		return null;
	}

	public Criterion getCriterion(String goalName, String criterionName) {
		if (goalName.equals(criterionName) && getGoal(criterionName) != null)
			return getGoal(criterionName);
		return getCriterion(getGoal(goalName), criterionName);
	}

	public Criterion getCriterion(Criterion goal, String criterionName) {
		if (goal.getName().equals(criterionName))
			return goal;
		return goal.getCriterion(criterionName);
	}

	public Criterion getParentCriterion(String criterionName) {
		if (getGoal(criterionName) != null)
			return null;
		for (Goal goal : getGoals()) {
			Criterion a = getParentCriterion(goal, criterionName);
			if (a != null)
				return a;
		}
		return null;
	}

	public Criterion getParentCriterion(String goalName, String criterionName) {
		if (goalName.equals(criterionName))
			return null;
		return getParentCriterion(getGoal(goalName), criterionName);
	}

	public Criterion getParentCriterion(Criterion goal, String criterionName) {
		if (goal.getName().equals(criterionName))
			return null;
		return goal.getParentCriterion(criterionName);
	}

	public List<List<Criterion>> getCriteriaByLevels() {
		List<List<Criterion>> result = new ArrayList<List<Criterion>>();
		result.add(new ArrayList<Criterion>(getGoals()));
		for (Goal g : getGoals())
			result.addAll(g.getCriteriaByLevels());

		return result;
	}

	public List<Criterion> getLeafCriteria() {
		List<Criterion> result = new ArrayList<Criterion>();
		for (Goal g : getGoals())
			result.addAll(g.getLeafCriteria());

		return result;
	}

	public List<Criterion> getLeafCriteria(CriterionType type) {
		List<Criterion> result = new ArrayList<Criterion>();
		for (Goal g : getGoals())
			result.addAll(g.getLeafCriteria(type));

		return result;
	}

	/**
	 * @return
	 * @uml.property name="description"
	 */
	public String getDescription() {
		return description;
	}

	public Goal getGoal(String name) {
		Iterator<Goal> iti = getGoals().iterator();
		Goal help = null;
		while (iti.hasNext()) {
			help = iti.next();
			if (help.getName().equals(name))
				return help;
		}
		return null;
	}

	public String deleteGoal(String goalName) {
		Iterator<Goal> iti = this.getGoals().iterator();
		while (iti.hasNext()) {
			if (goalName.equals(iti.next().getName())) {
				iti.remove();
				return "removed";
			}
		}
		return null;
	}

	public List<Goal> getGoals() {
		return goals;
	}

	public List<Goal> getGoals(GoalType type) {
		List<Goal> result = new ArrayList<Goal>();
		Iterator<Goal> git = getGoals().iterator();
		while (git.hasNext()) {
			Goal next = git.next();
			if (type.equals(next.getGoalType()))
				result.add(next);
		}
		return result;
	}

	/**
	 * @return
	 * @uml.property name="name"
	 */
	public String getName() {
		return name;
	}

	/**
	 * @return the userId
	 * @uml.property name="userId"
	 */
	public String getUserId() {
		return userId;
	}

	public void setAlternatives(List<T> alternatives) {
		this.alternatives = alternatives;
	}

	/**
	 * @param description
	 * @uml.property name="description"
	 */
	public void setDescription(String description) {
		this.description = description;
	}

	public void setGoals(List<Goal> goals) {
		this.goals = goals;
	}

	/**
	 * @param name
	 * @uml.property name="name"
	 */
	public void setName(String name) {
		this.name = name;
	};

	/**
	 * @param userId
	 *            the userId to set
	 * @uml.property name="userId"
	 */
	public void setUserId(String userId) {
		this.userId = userId;
	}

	/*
	 * (non-Javadoc)
	 *
	 * @see java.lang.Object#toString()
	 */
	@Override
	public String toString() {
		return getName() + ", " + getAlternatives() + ", " + getGoals() + ", "
				+ getImportanceGoalsMap();
	}

	/*
	 * (non-Javadoc)
	 *
	 * @see java.lang.Object#clone()
	 */

	private Map<GoalType, List<GoalImportance>> getImportanceGoalsMap() {
		return this.importanceGoals;
	}

	public Decision<T> clone() {
		Decision<T> dec = new Decision<T>(getName());
		dec.setDescription(getDescription());
		dec.setUserId(getUserId());

		for (T a : getAlternatives())
			dec.addAlternative((T) a.clone());
		for (Goal g : getGoals())
			dec.addGoal(g.clone());

		return dec;
	}

	/**
	 * @return the importanceGoals
	 */
	public List<GoalImportance> getImportanceGoals(GoalType gt) {
		if (importanceGoals.get(gt) == null)
			importanceGoals.put(gt, new ArrayList<GoalImportance>());
		return importanceGoals.get(gt);
	}

	/**
	 * @param importanceGoals
	 *            the importanceGoals to set
	 */
	public void setImportanceGoals(GoalType gt,
			List<GoalImportance> importanceGoals) {
		this.importanceGoals.put(gt, importanceGoals);
	}

	public GoalImportance getImportanceGoal(GoalType gt, int i, int j) {
		GoalImportance test = new GoalImportance(i, j, 1D, null);
		test.setDecision(this);
		if (!getImportanceGoals(gt).contains(test))
			return null;
		for (GoalImportance gi : getImportanceGoals(gt))
			if (test.equals(gi))
				return gi;
		return null;
	}

	public void insertImportanceGoal(GoalType gt, GoalImportance gi) {
		if (getImportanceGoals(gt).contains(gi)) {
			for (GoalImportance goali : getImportanceGoals(gt))
				if (goali.equals(gi)) {
					goali.setComparisonAToB(gi.getComparisonAToB());
					goali.setComment(gi.getComment());
				}

		} else
			getImportanceGoals(gt).add(gi);
	}

	/*
	 * (non-Javadoc)
	 *
	 * @see java.lang.Object#hashCode()
	 */
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((name == null) ? 0 : name.hashCode());
		result = prime * result + ((userId == null) ? 0 : userId.hashCode());
		return result;
	}

	/*
	 * (non-Javadoc)
	 *
	 * @see java.lang.Object#equals(java.lang.Object)
	 */
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (!(obj instanceof Decision))
			return false;
		Decision other = (Decision) obj;
		if (name == null) {
			if (other.name != null)
				return false;
		} else if (!name.equals(other.name))
			return false;
		if (userId == null) {
			if (other.userId != null)
				return false;
		} else if (!userId.equals(other.userId))
			return false;
		return true;
	}

}


text:
package info.u_team.u_team_test.blockentity;

import info.u_team.u_team_core.api.block.MenuSyncedBlockEntity;
import info.u_team.u_team_core.blockentity.UBlockEntity;
import info.u_team.u_team_core.inventory.BlockEntityUItemStackHandler;
import info.u_team.u_team_test.init.TestBlockEntityTypes;
import info.u_team.u_team_test.menu.BasicBlockEntityMenu;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.network.FriendlyByteBuf;
import net.minecraft.network.chat.Component;
import net.minecraft.world.entity.player.Inventory;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.inventory.AbstractContainerMenu;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraftforge.common.capabilities.Capability;
import net.minecraftforge.common.capabilities.ForgeCapabilities;
import net.minecraftforge.common.util.LazyOptional;

public class BasicBlockEntityBlockEntity extends UBlockEntity implements MenuSyncedBlockEntity {

	private final BlockEntityUItemStackHandler slots;
	private final LazyOptional<BlockEntityUItemStackHandler> slotsOptional;

	private int cooldown, timer, value;

	public BasicBlockEntityBlockEntity(BlockPos pos, BlockState state) {
		super(TestBlockEntityTypes.BASIC.get(), pos, state);
		slots = new BlockEntityUItemStackHandler(18, this);
		slotsOptional = LazyOptional.of(() -> slots);
	}

	@Override
	public void sendInitialMenuDataToClient(FriendlyByteBuf buffer) {
		buffer.writeInt(value);
		buffer.writeInt(cooldown);
	}

	@Override
	public void handleInitialMenuDataFromServer(FriendlyByteBuf buffer) {
		value = buffer.readInt();
		cooldown = buffer.readInt();
	}

	public static void serverTick(Level level, BlockPos pos, BlockState state, BasicBlockEntityBlockEntity blockEntity) {
		if (blockEntity.timer < blockEntity.cooldown) {
			blockEntity.timer++;
			return;
		}
		blockEntity.timer = 0;
		blockEntity.value++;
		blockEntity.setChanged();
	}

	@Override
	public void saveNBT(CompoundTag compound) {
		compound.putInt("value", value);
		compound.putInt("cooldown", cooldown);
		compound.put("inventory", slots.serializeNBT());
	}

	@Override
	public void loadNBT(CompoundTag compound) {
		value = compound.getInt("value");
		cooldown = compound.getInt("cooldown");
		slots.deserializeNBT(compound.getCompound("inventory"));
	}

	public BlockEntityUItemStackHandler getSlots() {
		return slots;
	}

	public int getCooldown() {
		return cooldown;
	}

	public int getValue() {
		return value;
	}

	public void setCooldown(int cooldown) {
		this.cooldown = cooldown;
	}

	public void setValue(int value) {
		this.value = value;
	}

	// Capability

	@Override
	public <X> LazyOptional<X> getCapability(Capability<X> capability, Direction side) {
		if (capability == ForgeCapabilities.ITEM_HANDLER) {
			return slotsOptional.cast();
		} else {
			return super.getCapability(capability, side);
		}
	}

	@Override
	public void setRemoved() {
		super.setRemoved();
		slotsOptional.invalidate();
	}

	@Override
	public void onChunkUnloaded() {
		super.onChunkUnloaded();
		slotsOptional.invalidate();
	}

	// Container

	@Override
	public AbstractContainerMenu createMenu(int containerId, Inventory playerInventory, Player player) {
		return new BasicBlockEntityMenu(containerId, playerInventory, this);
	}

	@Override
	public Component getDisplayName() {
		return Component.literal("Tile Entity");
	}
}


text:
using MatterHackers.Agg.VertexSource;

//----------------------------------------------------------------------------
// Anti-Grain Geometry - Version 2.4
// Copyright (C) 2007 Lars Brubaker
//                  larsbrubaker@gmail.com
//
// Permission to copy, use, modify, sell and distribute this software
// is granted provided this copyright notice appears in all copies.
// This software is provided "as is" without express or implied
// warranty, and with no claim as to its suitability for any purpose.
//
// classes ButtonWidget
//
//----------------------------------------------------------------------------
using System;

namespace MatterHackers.Agg.UI
{
	public class ButtonViewText : GuiWidget
	{
		protected double borderWidth;
		protected double borderRadius;

		public double BorderWidth { get { return borderWidth; } set { borderWidth = value; } }

		public double BorderRadius { get { return borderRadius; } set { borderRadius = value; } }

		protected TextWidget buttonText;

		public static BorderDouble DefaultPadding = new BorderDouble(5);

		public ButtonViewText(string label, double textHeight = 16, double borderWidth = 3, double borderRadius = 5)
		{
			BorderRadius = borderRadius;
			this.borderWidth = borderWidth;
			buttonText = new TextWidget(label, textHeight);
			buttonText.VAnchor = VAnchor.ParentCenter;
			buttonText.HAnchor = HAnchor.ParentCenter;

			AnchorAll();

			AddChild(buttonText);

			Padding = DefaultPadding;

			SetBoundsToEncloseChildren();
		}

		public override void OnParentChanged(EventArgs e)
		{
			GuiWidget parentButton = Parent;

			parentButton.TextChanged += new EventHandler(parentButton_TextChanged);

			parentButton.MouseEnter += redrawButtonIfRequired;
			parentButton.MouseDown += redrawButtonIfRequired;
			parentButton.MouseUp += redrawButtonIfRequired;
			parentButton.MouseLeave += redrawButtonIfRequired;

			base.OnParentChanged(e);
		}

		private void parentButton_TextChanged(object sender, EventArgs e)
		{
			buttonText.Text = ((GuiWidget)sender).Text;

			SetBoundsToEncloseChildren();
		}

		public override void OnDraw(Graphics2D graphics2D)
		{
			Button parentButton = (Button)Parent;

			RectangleDouble Bounds = LocalBounds;

			RoundedRect rectBorder = new RoundedRect(Bounds, BorderRadius);
			if (parentButton.Enabled == true)
			{
				graphics2D.Render(rectBorder, new RGBA_Bytes(0, 0, 0));
			}
			else
			{
				graphics2D.Render(rectBorder, new RGBA_Bytes(128, 128, 128));
			}
			RectangleDouble insideBounds = Bounds;
			insideBounds.Inflate(-BorderWidth);
			RoundedRect rectInside = new RoundedRect(insideBounds, Math.Max(BorderRadius - BorderWidth, 0));
			RGBA_Bytes insideColor = new RGBA_Bytes(1.0, 1.0, 1.0);
			if (parentButton.FirstWidgetUnderMouse)
			{
				if (parentButton.MouseDownOnButton)
				{
					insideColor = DefaultViewFactory.DefaultBlue;
				}
				else
				{
					insideColor = DefaultViewFactory.DefaultBlue.GetAsRGBA_Floats().Blend(RGBA_Floats.White, .75).GetAsRGBA_Bytes();
				}
			}

			graphics2D.Render(rectInside, insideColor);

			base.OnDraw(graphics2D);
		}

		public void redrawButtonIfRequired(object sender, EventArgs e)
		{
			((GuiWidget)sender).Invalidate();
		}
	}
}


text:
require 'ruby/node/position'

# Tokens are simple value objects that hold the token type, value and position.
# There are a bunch of helper methods to check the token type and convert the
# token to Ruby nodes.
#
# We mostly operate with Ripper's token types (such as :@ident etc.). For Ripper's
# sexp types :@kw (keyword) and :@op we use more specific token types based on
# the sexp's value. E.g. Ripper's sexp [:@op, '+', [0, 0]] would become a token
# with the type :@+.

class Ripper
  class RubyBuilder < Ripper::SexpBuilder
    class Token
      include Comparable

      attr_accessor :type, :token, :position, :prolog

      def initialize(type = nil, token = nil, position = nil)
        @type = token_type(type, token)
        @token = token
        @position = position if position
      end

      def newline?
        NEWLINE.include?(type)
      end

      def whitespace?
        WHITESPACE.include?(type)
      end

      def opener?
        OPENERS.include?(type)
      end

      def keyword?
        KEYWORDS.include?(type)
      end

      def operator?
        OPERATORS.include?(type)
      end

      def separator?
        SEPARATORS.include?(type)
      end

      def prolog?
        whitespace? or separator? or heredoc?
      end

      def known?
        keyword? || operator? || opener? || whitespace? || [:@backtick].include?(type)
      end

      def comment?
        type == :@comment
      end

      def heredoc?
        type == :@heredoc
      end

      def to_sexp
        [type, token, [row + 1, column]]
      end

      def to_identifier
        Ruby::Identifier.new(token, position, prolog)
      end

      def <=>(other)
        position <=> (other.respond_to?(:position) ? other.position : other)
      end

      protected

        def token_type(type, token)
          case type
          when :@kw
            :"@#{token.gsub(/\W/, '')}"
          when :@op
            :"@#{token}"
          else
            type
          end
        end
    end
  end
end


text:
# This file is copied to spec/ when you run 'rails generate rspec:install'
require 'codeclimate-test-reporter'
CodeClimate::TestReporter.start
ENV['RAILS_ENV'] ||= 'test'
require 'spec_helper'
require File.expand_path('../../config/environment', __FILE__)
require 'rspec/rails'
# Add additional requires below this line. Rails is not loaded until this point!
require 'capybara/rspec'

# Requires supporting ruby files with custom matchers and macros, etc, in
# spec/support/ and its subdirectories. Files matching `spec/**/*_spec.rb` are
# run as spec files by default. This means that files in spec/support that end
# in _spec.rb will both be required and run as specs, causing the specs to be
# run twice. It is recommended that you do not name files matching this glob to
# end with _spec.rb. You can configure this pattern with the --pattern
# option on the command line or in ~/.rspec, .rspec or `.rspec-local`.
#
# The following line is provided for convenience purposes. It has the downside
# of increasing the boot-up time by auto-requiring all files in the support
# directory. Alternatively, in the individual `*_spec.rb` files, manually
# require only the support files necessary.
#
# Dir[Rails.root.join('spec/support/**/*.rb')].each { |f| require f }

# Checks for pending migrations before tests are run.
# If you are not using ActiveRecord, you can remove this line.
ActiveRecord::Migration.maintain_test_schema!

RSpec.configure do |config|
  # Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
  config.fixture_path = "#{::Rails.root}/spec/fixtures"

  # https://github.com/plataformatec/devise/wiki/How-To:-Stub-authentication-in-controller-specs
  # If you're using RSpec, you can put the following inside a file named spec/support/devise.rb
  # or in your spec/spec_helper.rb (or spec/rails_helper.rb if you are using rspec-rails)
  config.include Devise::TestHelpers, type: :controller
  config.include Devise::TestHelpers, type: :view
  config.include Warden::Test::Helpers, type: :view
  Devise.stretches = 1

  Rails.logger.level = 4
  config.include Capybara::DSL

  Shoulda::Matchers.configure do |shoulda|
    shoulda.integrate do |with|
      # Choose a test framework:
      with.test_framework :rspec

      # Choose one or more libraries:
      with.library :active_record
      with.library :active_model
      with.library :action_controller

      # Or, choose the following (which implies all of the above):
      with.library :rails
    end
  end

  # If you're not using ActiveRecord, or you'd prefer not to run each of your
  # examples within a transaction, remove the following line or assign false
  # instead of true.
  config.use_transactional_fixtures = true

  config.fuubar_progress_bar_options = { format: 'ElectreTri APP! %a %bᗧ%i %p%% %t',
                                         progress_mark: ' ', remainder_mark: '・', starting_at: 0 }

  # RSpec Rails can automatically mix in different behaviours to your tests
  # based on their file location, for example enabling you to call `get` and
  # `post` in specs under `spec/controllers`.
  #
  # You can disable this behaviour by removing the line below, and instead
  # explicitly tag your specs with their type, e.g.:
  #
  #     RSpec.describe UsersController, :type => :controller do
  #       # ...
  #     end
  #
  # The different available types are documented in the features, such as in
  # https://relishapp.com/rspec/rspec-rails/docs
  config.infer_spec_type_from_file_location!
end


text:
var BASE = '../../../services/sys/';

$(function() {
	initAuthoritiesTree();
	initResourcesTree();
	console.info('添加一级节点有问题!');
})

var authId = 0;
var curAuthId = 0;
var initAuthoritiesTree = function(authId) {
	var baseUrl = BASE + 'authoritiesService/findAuthoritiesTree';
	var url = baseUrl;
	if (authId != undefined) {
		url = url + '/' + authId;
	} else {
		url = url + '/0';
	}

	var authTreeConfig = {
		url : url,
		method : 'get',
		fit : true,
		lines : true,
		checkbox : false,
		onLoadSuccess : function(node, data) {
			var t = $(this);
			if (data) {
				$(data).each(function(index, d) {
					if (this.state == 'closed') {
						t.tree('expandAll');
					}
				});
			}
		},
		onClick : function(node) {
			// console.info('onClick', node);
			node.authName = node.text;
			node.authId = node.id;
			// node.parentId = pnode.id;
			var pnode = $('#authResourcesTree').tree('getParent', node.target);
			/*
			 * if(pnode!=null){ node.parentId = node.id; }
			 */
		},
		onSelect : function(node) {
			console.info('select', node);
			// 选择行查询权限的资源,并赋值给资源的视图
			$('#authBYName').text(node.text);
			if (authId != node.id) {
				authId = node.id;
				curAuthId = node.id;
			}
			doSearchAuthResource(node);
		},
		onBeforeExpand : function(node) {
			if (node) {
				$('#authTree').tree('options').url = baseUrl + "/" + node.id;
			}
		}
	}

	var authTreeView = $('#authTree').tree(authTreeConfig);
}

/** 权限的资源,权限标识为数组标识 */
var authResources = [];
/**
 * 验证权限的资源是否已经有数据,有则不再查询
 */
validateAuthData = function(nodeId) {

	return false;
}

/** 根据权限拥有的资源选择资源 */
doSelectResource = function(data) {
	var child = $("#authResourcesTree").tree("getChildren");
	for (var i = 0; i < child.length; i++) {
		//console.info(child[i].id, child[i].text);
		var node = $("#authResourcesTree").tree('find',child[i].id);
		$('#authResourcesTree').tree('update', node);
		for(var j=0;j<data.length;j++){
			if(data[j].resourceId==child[i].id){
                if(node){
                    $("#authResourcesTree").tree('check',node.target);
                }
				console.info(data[j].resourceId+" = "+child[i].id+" -> "+child[i].text);
			}
		}
	}
}

/**
 * 查询权限的资源,AuthoritiesResources
 *
 * @param node
 */
doSearchAuthResource = function(node) {
	var url = BASE + 'authorityResourcesService/findAuthoritiesResources/'
			+ node.id;
	AjaxUtil.sendGetAsyncRequest(url, function(data) {
		console.info(data);
		//authResources.push(data);
		doSelectResource(data);
	});
}

var initResourcesTree = function(resId) {
	var baseUrl = BASE
			+ 'authoritiesResourcesTreeService/findAuthResourcesTree';
	var url = baseUrl;
	if (resId != undefined) {
		url = url + '/' + resId;
	}

	var authResourcesTreeConfig = {
		url : url,
		method : 'get',
		fit : true,
		lines : true,
		checkbox : true,
		onLoadSuccess : function(node, data) {
			var t = $(this);
			if (data) {
				$(data).each(function(index, d) {
					if (this.state == 'closed') {
						t.tree('expandAll');
					}
				});
			}
		},
		/*
		 * formatter : function(node) { if (node.leaf) { // 叶子节点否? //
		 * node.iconCls = 'icon-reload'; node.state = 'closed';
		 * $("#authResourcesTree").tree("expandAll", node.target); } var s =
		 * getNodeName(node.text, node); if (node.children) { s += ' <span
		 * style="color:CCCCCC">(' + node.children.length + ')</span>'; }
		 * return s; },
		 */
		onClick : function(node) {
			console.info('onClick', node);
			node.authName = node.text;
			node.authId = node.id;
			// node.parentId = pnode.id;
			var pnode = $('#authResourcesTree').tree('getParent', node.target);
			/*
			 * if(pnode!=null){ node.parentId = node.id; }
			 */
		},
		onSelect : function(row) {
			// console.info('select', row);
			// 选择行后可以执行添加删除修改
		},
		onBeforeLoad : function() {
			var rooNode = $("#authResourcesTree").tree('getRoot');
			$("#authResourcesTree").tree('expand', rooNode);
		},
		onBeforeExpand : function(node) {
			if (node) {
				$('#authResourcesTree').tree('options').url = baseUrl + "/"
						+ node.id;
			}
		}
	}

	$('#authResourcesTree').tree(authResourcesTreeConfig);
}

function getNodeName(value, rowData) {
	var names = value.split(",");
	var lan = names[0];
	var lans = lan.split('=');
	if (lans[1] != undefined) {
		return lans[1];
	}
	return lans;
}

resourceNameFormatter = function(value, rowData) {
	if (!value) {
		return "";
	}
	//
	if (rowData.leaf == true && rowData.parentId != null) {
		//rowData.iconCls = 'icon-reload';
		rowData.state = 'closed';
	}
	/*
	 * if(rowData.leaf == true&&rowData.parentId==null){ rowData.iconCls =
	 * 'fa-folder-o'; rowData.state = 'closed'; }
	 */
	var names = value.split(",");
	var lan = names[0];
	var lans = lan.split('=');
	if (lans[1] != undefined) {
		return lans[1];
	}
	return lans;
}

// $('#' + ids[j]).prop("checked", true);

// 保存,含新增和修改
function doSave() {

	if(curAuthId==0){
		alert('请选择权限信息!!!');
		return ;
	}

	var nodes = $('#authResourcesTree').tree('getChecked');
	var chks = [];
	for (var i = 0; i < nodes.length; i++) {
		var item = {};
		item.resourceId = nodes[i].id;
		//item.text = nodes[i].text;
		item.authId = curAuthId;
		chks.push(item);

	}
	if(chks.length<1){
		alert('请选择资源条目!!!');
		return;
	}
	console.info('save authorities ' + curAuthId + ' Resources params', chks);

	var url = BASE + 'authorityResourcesService/batchInsert';
	AjaxUtil.sendPostData(url,chks, function(data) {
		console.info(data);
	});

}


text:
package org.apache.wicket.protocol.ws.api.registry;

import java.util.Objects;

import org.apache.wicket.util.lang.Args;

/**
 * A key based on shared resource's name and a token
 */
public class ResourceNameTokenKey extends AbstractKey
{
	private final String resourceName;
	private final String connectionToken;

	public ResourceNameTokenKey(String resourceName, String connectionToken)
	{
		this(resourceName, connectionToken, null);
	}

	public ResourceNameTokenKey(String resourceName, String connectionToken, String context)
	{
		super(context);
		this.resourceName = Args.notNull(resourceName, "resourceName");
		this.connectionToken = Args.notNull(connectionToken, "connectionToken");
	}

	@Override
	public boolean equals(Object o)
	{
		if (this == o)
			return true;
		if (o == null || getClass() != o.getClass())
			return false;
		final ResourceNameTokenKey that = (ResourceNameTokenKey)o;
		return resourceName.equals(that.resourceName) && connectionToken.equals(that.connectionToken);
	}

	@Override
	public int hashCode()
	{
		return Objects.hash(resourceName, connectionToken);
	}
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
  <component name="EntryPointsManager">
    <entry_points version="2.0" />
  </component>
  <component name="MavenProjectsManager">
    <option name="originalFiles">
      <list>
        <option value="$PROJECT_DIR$/pom.xml" />
      </list>
    </option>
  </component>
  <component name="ProjectInspectionProfilesVisibleTreeState">
    <entry key="Project Default">
      <profile-state>
        <expanded-state>
          <State>
            <id />
          </State>
          <State>
            <id>Android Lint</id>
          </State>
          <State>
            <id>Class structure</id>
          </State>
          <State>
            <id>Data flow issues</id>
          </State>
          <State>
            <id>Declaration redundancy</id>
          </State>
          <State>
            <id>Dependency issues</id>
          </State>
          <State>
            <id>Error handling</id>
          </State>
          <State>
            <id>Imports</id>
          </State>
          <State>
            <id>Modularization issues</id>
          </State>
          <State>
            <id>Numeric issues</id>
          </State>
          <State>
            <id>Packaging issues</id>
          </State>
          <State>
            <id>Pattern Validation</id>
          </State>
          <State>
            <id>XPath</id>
          </State>
        </expanded-state>
      </profile-state>
    </entry>
  </component>
  <component name="ProjectRootManager" version="2" languageLevel="JDK_1_6" assert-keyword="true" jdk-15="true" project-jdk-name="1.7" project-jdk-type="JavaSDK">
    <output url="file://$PROJECT_DIR$/out" />
  </component>
  <component name="SuppressionsComponent">
    <option name="suppComments" value="[]" />
  </component>
  <component name="masterDetails">
    <states>
      <state key="ProjectJDKs.UI">
        <settings>
          <last-edited>1.7</last-edited>
          <splitter-proportions>
            <option name="proportions">
              <list>
                <option value="0.2" />
              </list>
            </option>
          </splitter-proportions>
        </settings>
      </state>
    </states>
  </component>
</project>


text:
package tors

import (
	. "github.com/h8liu/reactsim/react/sim/config"
	. "github.com/h8liu/reactsim/react/sim/queues"
)

func NewNics() *Queues {
	return NewSizedQueues(NicBufSize())
	// return NewNicQueues(NicBufSize(), NicBufTotalSize())
}


text:
int SentenceClass::sentenceIDCount = 0;

SentenceClass::SentenceClass(){
	m_Font = NULL;
}

SentenceClass::SentenceClass(const SentenceClass& other){
	m_Font = NULL;
}

SentenceClass::SentenceClass(FontClass* font) {
	m_Font = font;
}

SentenceClass::~SentenceClass(){}

void SentenceClass::Initialize(FontClass* font, char* text, int posX, int posY, XMFLOAT4 textColor, ID3D11Device* device,
	ID3D11DeviceContext* deviceContext, HWND hwnd, int screenWidth, int screenHeight){

	m_Font = font;

	posX = posX + m_Font->GetCharacterWidth(text[0]) / 2;
	posY = posY + m_Font->GetCharacterHeight(text[0]) / 2;

	UpdateSentence(text, posX, posY, textColor);

	sentenceIDCount++;
	m_sentenceID = sentenceIDCount;

}

void SentenceClass::UpdateSentence(char* text, int posX, int posY, XMFLOAT4 textColor){

	m_Sentence.length = (int)strlen(text);
	m_Sentence.textColor = textColor;

	m_Sentence.posX = posX;
	m_Sentence.posY = posY;

	int currentXPos = posX;
	int currentYPos = posY;

	for (int i = 0; i < MAX_STR_LEN; i++){
		m_Sentence.character[i].pBitmap = NULL;
	}

	for (int i = 0; i < m_Sentence.length; i++){
		if (text[i] == '\0') {
			break;
		}
		else if (text[i] == ' '){
			m_Sentence.character[i].pBitmap = NULL;
			currentXPos += 5;
		}
		else if (text[i] == '\n'){
			m_Sentence.character[i].pBitmap = NULL;
			currentXPos = posX;
			currentYPos += 12;
		}
		else{
			int width = m_Font->GetCharacterWidth(text[i]);
			m_Sentence.character[i].ctrX = currentXPos + width / 2;
			m_Sentence.character[i].ctrY = currentYPos;
			m_Sentence.character[i].pBitmap = m_Font->GetCharacterBitmap(text[i]);
			currentXPos += width + 2;
		}
	}

	strcpy(m_Sentence.text, text);

}

void SentenceClass::Shutdown(){

}

bool SentenceClass::Render(HWND hwnd, TextureShaderClass* textureShader, ID3D11DeviceContext* deviceContext,
	XMMATRIX& worldMatrix, XMMATRIX& viewMatrix, XMMATRIX& orthoMatrix){

	bool result;
	for (int i = 0; i < m_Sentence.length; i++) {
		if (m_Sentence.character[i].pBitmap){
			XMFLOAT4 processedTextColor = { m_Sentence.textColor.x, m_Sentence.textColor.y, m_Sentence.textColor.z, 1.0f };
			result = m_Sentence.character[i].pBitmap->Render(deviceContext, m_Sentence.character[i].ctrX,
				m_Sentence.character[i].ctrY, m_Sentence.character[i].pBitmap->GetWidth(),
				m_Sentence.character[i].pBitmap->GetHeight());

			if (!result){
				return false;
			}

			result = textureShader->Render(hwnd, deviceContext, m_Sentence.character[i].pBitmap->GetIndexCount(),
				worldMatrix, viewMatrix, orthoMatrix, m_Sentence.character[i].pBitmap->GetTexture(),
				m_Sentence.textColor.w, processedTextColor);

			if (!result){
				return false;
			}
		}
	}
	return true;
}

int SentenceClass::GetSentenceID(){
	return m_sentenceID;
}

int SentenceClass::GetSentencePosX(){
	return m_Sentence.posX;
}

int SentenceClass::GetSentencePosY(){
	return m_Sentence.posY;
}

char* SentenceClass::GetSentenceCharArray(){
	return m_Sentence.text;
}

void SentenceClass::SwapSentence(SentenceClass& other){
	if (m_Font){
		m_Font->Shutdown();
		m_Font = 0;
	}
	m_Font = other.m_Font;
	other.m_Font = 0;

	m_sentenceID = other.m_sentenceID;
	UpdateSentence(other.m_Sentence.text, other.m_Sentence.posX, other.m_Sentence.posY, other.m_Sentence.textColor);
}


text:
use std::io::{self, Read, Seek};
use std::collections::{HashMap};

use super::stream::{ByteOrder, SmartReader, EndianReader};

use self::Value::{Unsigned, List};

macro_rules! tags {
    {$(
        $tag:ident
        $val:expr;
    )*} => {

        /// TIFF tag
        #[derive(Clone, Copy, PartialEq, Eq, Debug, Hash)]
        pub enum Tag {
            $($tag,)*
            Unknown(u16)
        }
        impl Tag {
            pub fn from_u16(n: u16) -> Tag {
                $(if n == $val { Tag::$tag } else)* {
                    Tag::Unknown(n)
                }
            }
        }
    }
}

// Note: These tags appear in the order they are mentioned in the TIFF reference
tags!{
    // Baseline tags:
    Artist 315; // TODO add support
    // grayscale images PhotometricInterpretation 1 or 3
    BitsPerSample 258;
    CellLength 265; // TODO add support
    CellWidth 264; // TODO add support
    // palette-color images (PhotometricInterpretation 3)
    ColorMap 320; // TODO add support
    Compression 259; // TODO add support for 2 and 32773
    Copyright 33432; // TODO add support
    DateTime 306; // TODO add support
    ExtraSamples 338; // TODO add support
    FillOrder 266; // TODO add support
    FreeByteCounts 289; // TODO add support
    FreeOffsets 288; // TODO add support
    GrayResponseCurve 291; // TODO add support
    GrayResponseUnit 290; // TODO add support
    HostComputer 316; // TODO add support
    ImageDescription 270; // TODO add support
    ImageLength 257;
    ImageWidth 256;
    Make 271; // TODO add support
    MaxSampleValue 281; // TODO add support
    MinSampleValue 280; // TODO add support
    Model 272; // TODO add support
    NewSubfileType 254; // TODO add support
    Orientation 274; // TODO add support
    PhotometricInterpretation 262;
    PlanarConfiguration 284;
    ResolutionUnit 296; // TODO add support
    RowsPerStrip 278;
    SamplesPerPixel 277;
    Software 305;
    StripByteCounts 279;
    StripOffsets 273;
    SubfileType 255; // TODO add support
    Threshholding 263; // TODO add support
    XResolution 282;
    YResolution 283;
    // Advanced tags
    Predictor 317;
}

enum_from_primitive! {
#[derive(Clone, Copy, Debug)]
pub enum Type {
    BYTE = 1,
    ASCII = 2,
    SHORT = 3,
    LONG = 4,
    RATIONAL = 5,
}
}

#[allow(unused_qualifications)]
#[derive(Debug)]
pub enum Value {
    //Signed(i32),
    Unsigned(u32),
    List(Vec<Value>)
}

impl Value {
    pub fn into_u32(self) -> ::image::ImageResult<u32> {
        match self {
            Unsigned(val) => Ok(val),
            val => Err(::image::ImageError::FormatError(format!(
                "Expected unsigned integer, {:?} found.", val
            )))
        }
    }
    pub fn into_u32_vec(self) -> ::image::ImageResult<Vec<u32>> {
        match self {
            List(vec) => {
                let mut new_vec = Vec::with_capacity(vec.len());
                for v in vec {
                    new_vec.push(v.into_u32()?)
                }
                Ok(new_vec)
            },
            Unsigned(val) => Ok(vec![val]),
            //_ => Err(::image::FormatError("Tag data malformed.".to_string()))
        }
    }
}

pub struct Entry {
    type_: Type,
    count: u32,
    offset: [u8; 4],
}

impl ::std::fmt::Debug for Entry {
    fn fmt(&self, fmt: &mut ::std::fmt::Formatter) -> Result<(), ::std::fmt::Error> {
        fmt.write_str(&format!("Entry {{ type_: {:?}, count: {:?}, offset: {:?} }}",
            self.type_,
            self.count,
            &self.offset
        ))
    }
}

impl Entry {
    pub fn new(type_: Type, count: u32, offset: [u8; 4]) -> Entry {
        Entry {
            type_: type_,
            count: count,
            offset: offset
        }
    }

    /// Returns a mem_reader for the offset/value field
    fn r(&self, byte_order: ByteOrder) -> SmartReader<io::Cursor<Vec<u8>>> {
        SmartReader::wrap(
            io::Cursor::new(self.offset.to_vec()),
            byte_order
        )
    }

    pub fn val<R: Read + Seek>(&self, decoder: &mut super::TIFFDecoder<R>)
    -> ::image::ImageResult<Value> {
        let bo = decoder.byte_order();
        match (self.type_, self.count) {
            // TODO check if this could give wrong results
            // at a different endianess of file/computer.
            (Type::BYTE, 1) => Ok(Unsigned(u32::from(self.offset[0]))),
            (Type::SHORT, 1) => Ok(Unsigned(u32::from(self.r(bo).read_u16()?))),
            (Type::SHORT, 2) => {
                let mut r = self.r(bo);
                Ok(List(vec![
                    Unsigned(u32::from(r.read_u16()?)),
                    Unsigned(u32::from(r.read_u16()?))
                ]))
            },
            (Type::SHORT, n) => {
                let mut v = Vec::with_capacity(n as usize);
                try!(decoder.goto_offset(try!(self.r(bo).read_u32())));
                for _ in 0 .. n {
                    v.push(Unsigned(u32::from(decoder.read_short()?)))
                }
                Ok(List(v))
            },
            (Type::LONG, 1) => Ok(Unsigned(try!(self.r(bo).read_u32()))),
            (Type::LONG, n) => {
                let mut v = Vec::with_capacity(n as usize);
                try!(decoder.goto_offset(try!(self.r(bo).read_u32())));
                for _ in 0 .. n {
                    v.push(Unsigned(try!(decoder.read_long())))
                }
                Ok(List(v))
            }
            _ => Err(::image::ImageError::UnsupportedError("Unsupported data type.".to_string()))
        }
    }
}

/// Type representing an Image File Directory
pub type Directory = HashMap<Tag, Entry>;


text:
package com.wemote.sdk.wechat.util.xml;

import com.thoughtworks.xstream.XStream;

/**
 * @author: jayon.xu@gmail.com
 */
public class XMLUtils {

    private XMLUtils() {
    }

    /**
     * XStream,使其支持CDATA块
     */
    private static XStream xstream = XStreamInitializer.getInstance();
    /*private static XStream xstream = new XStream(new XppDriver() {
        public HierarchicalStreamWriter createWriter(Writer out) {
            return new PrettyPrintWriter(out) {
                // 对所有xml节点的转换都增加CDATA标记
                boolean cdata = true;

                protected void writeText(QuickWriter writer, String text) {
                    if (cdata) {
                        writer.write("<![CDATA[");
                        writer.write(text);
                        writer.write("]]>");
                    } else {
                        writer.write(text);
                    }
                }
            };
        }
    });*/

    /**
     * java 转换成xml
     *
     * @param obj 对象实例
     * @return String xml字符串
     */
    public static String toXML(Object obj) {
        xstream.processAnnotations(obj.getClass());
        return xstream.toXML(obj);
    }

    /**
     * 将传入xml文本转换成Java对象
     * 调用的方法实例:PersonBean person=XmlUtil.toBean(xmlStr, PersonBean.class);
     *
     * @param xmlStr xml字符串
     * @param cls    xml对应的class类
     * @return T xml对应的class类的实例对象
     */
    @SuppressWarnings("unchecked")
    public static <T> T toBean(String xmlStr, Class<T> cls) {
        //XStream xstream = new XStream(new DomDriver());
        xstream.processAnnotations(cls);
        return (T) xstream.fromXML(xmlStr);
    }
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;

namespace LionFire.Reflection.Fasterflect
{
    public static class FasterflectExtensions
    {
        public static IList<Type> TypesWith(this Assembly assembly, Type attributeType)
        {
            var list = new List<Type>();

            foreach(var type in assembly.GetTypes())
            {
                var attrs = type.GetCustomAttributes(attributeType,false); // REVIEW inherit parameter
                if (attrs != null && attrs.Any()) list.Add(type);
            }
            return list;
        }
        public static IList<Type> TypesWith<AttributeType>(this Assembly assembly)
            where AttributeType : Attribute
        {
            var list = new List<Type>();

            foreach (var type in assembly.GetTypes())
            {
                var attrs = type.GetCustomAttributes<AttributeType>();
                if (attrs != null && attrs.Any()) list.Add(type);
            }
            return list;
        }

    }
}


text: Sample project with features similar to the `../jquery` sample project.


text:
/**
 * Module dependencies.
 */

var debug = require('debug')('koa:application');
var onSocketError = require('on-socket-error');
var Emitter = require('events').EventEmitter;
var compose = require('koa-compose');
var context = require('./context');
var request = require('./request');
var response = require('./response');
var Cookies = require('cookies');
var Keygrip = require('keygrip');
var accepts = require('accepts');
var assert = require('assert');
var http = require('http');
var co = require('co');

/**
 * Application prototype.
 */

var app = Application.prototype;

/**
 * Expose `Application`.
 */

exports = module.exports = Application;

/**
 * Initialize a new `Application`.
 *
 * @api public
 */

function Application() {
  if (!(this instanceof Application)) return new Application;
  this.env = process.env.NODE_ENV || 'development';
  this.on('error', this.onerror);
  this.outputErrors = 'test' != this.env;
  this.subdomainOffset = 2;
  this.poweredBy = true;
  this.jsonSpaces = 2;
  this.middleware = [];
  this.context = Object.create(context);
  this.request = Object.create(request);
  this.response = Object.create(response);
}

/**
 * Inherit from `Emitter.prototype`.
 */

Application.prototype.__proto__ = Emitter.prototype;

/**
 * Shorthand for:
 *
 *    http.createServer(app.callback()).listen(...)
 *
 * @param {Mixed} ...
 * @return {Server}
 * @api public
 */

app.listen = function(){
  debug('listen');
  var server = http.createServer(this.callback());
  return server.listen.apply(server, arguments);
};

/**
 * Use the given middleware `fn`.
 *
 * @param {GeneratorFunction} fn
 * @return {Application} self
 * @api public
 */

app.use = function(fn){
  assert('GeneratorFunction' == fn.constructor.name, 'app.use() requires a generator function');
  debug('use %s', fn._name || fn.name || '-');
  this.middleware.push(fn);
  return this;
};

/**
 * Return a request handler callback
 * for node's native http server.
 *
 * @return {Function}
 * @api public
 */

app.callback = function(){
  var mw = [respond].concat(this.middleware);
  var gen = compose(mw);
  var fn = co(gen);
  var self = this;

  return function(req, res){
    var ctx = self.createContext(req, res);
    onSocketError(ctx, ctx.onerror);
    fn.call(ctx, ctx.onerror);
  }
};

/**
 * Set signed cookie keys.
 *
 * These are passed to [KeyGrip](https://github.com/jed/keygrip),
 * however you may also pass your own `KeyGrip` instance. For
 * example the following are acceptable:
 *
 *   app.keys = ['im a newer secret', 'i like turtle'];
 *   app.keys = new KeyGrip(['im a newer secret', 'i like turtle'], 'sha256');
 *
 * @param {Array|KeyGrip} keys
 * @api public
 */

app.__defineSetter__('keys', function(keys){
  var ok = Array.isArray(keys) || keys instanceof Keygrip;
  debug('keys %j', keys);
  if (!ok) throw new TypeError('app.keys must be an array or Keygrip');
  if (!(keys instanceof Keygrip)) keys = new Keygrip(keys);
  this._keys = keys;
});

/**
 * Get `Keygrip` instance.
 *
 * @return {Keygrip}
 * @api public
 */

app.__defineGetter__('keys', function(){
  return this._keys;
});

/**
 * Initialize a new context.
 *
 * @api private
 */

app.createContext = function(req, res){
  var context = Object.create(this.context);
  var request = context.request = Object.create(this.request);
  var response = context.response = Object.create(this.response);
  context.app = request.app = response.app = this;
  context.req = request.req = response.req = req;
  context.res = request.res = response.res = res;
  request.ctx = response.ctx = context;
  request.response = response;
  response.request = request;
  context.onerror = context.onerror.bind(context);
  context.originalUrl = request.originalUrl = req.url;
  context.cookies = new Cookies(req, res, this.keys);
  context.accept = request.accept = accepts(req);
  return context;
};

/**
 * Default error handler.
 *
 * @param {Error} err
 * @api private
 */

app.onerror = function(err){
  if (!this.outputErrors) return;
  if (404 == err.status) return;
  console.error(err.stack);
};

/**
 * Response middleware.
 */

function *respond(next){
  if (this.app.poweredBy) this.set('X-Powered-By', 'koa');

  yield *next;

  var res = this.res;
  if (res.headersSent || !res.socket.writable) return;

  var body = this.body;
  var status = this.status = this.status || 404;
  var head = 'HEAD' == this.method;
  var noContent = ~[204, 205, 304].indexOf(status);

  // ignore body
  if (noContent) return res.end();

  // status body
  if (null == body) {
    this.type = 'text';
    body = http.STATUS_CODES[status];
  }

  // Buffer body
  if (Buffer.isBuffer(body)) {
    if (head) return res.end();
    return res.end(body);
  }

  // string body
  if ('string' == typeof body) {
    if (head) return res.end();
    return res.end(body);
  }

  // Stream body
  if ('function' == typeof body.pipe) {
    if (!~body.listeners('error').indexOf(this.onerror)) body.on('error', this.onerror);

    if (head) {
      if (body.close) body.close();
      return res.end();
    }

    return body.pipe(res);
  }

  // body: json
  body = JSON.stringify(body, null, this.app.jsonSpaces);
  this.length = Buffer.byteLength(body);
  if (head) return res.end();
  res.end(body);
}


text:
package main

import (
	"crypto/hmac"
	"crypto/sha256"
	"encoding/base64"
	"fmt"
	"log"
	"time"

	"github.com/howeyc/gopass"
	"gopkg.in/jcelliott/turnpike.v2"
)

var password []byte

func exampleAuthFunc(hello map[string]interface{}, c map[string]interface{}) (string, map[string]interface{}, error) {
	challenge, ok := c["challenge"].(string)
	if !ok {
		log.Fatal("no challenge data recieved")
	}
	mac := hmac.New(sha256.New, password)
	mac.Write([]byte(challenge))
	signature := mac.Sum(nil)
	return base64.StdEncoding.EncodeToString(signature), nil, nil
}

func main() {
	turnpike.Debug()
	fmt.Println("Hint: the password is 'password'")
	fmt.Print("Password: ")
	var err error
	password, err = gopass.GetPasswd()
	if err != nil {
		log.Fatal(err)
	}

	c, err := turnpike.NewWebsocketClient(turnpike.JSON, "ws://localhost:8000/ws", nil, nil, nil)
	if err != nil {
		log.Fatal(err)
	}
	c.Auth = map[string]turnpike.AuthFunc{"example-auth": exampleAuthFunc}
	_, err = c.JoinRealm("turnpike.examples", nil)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println("Connected with auth")
	time.Sleep(3 * time.Second)
	fmt.Println("Disconnecting")
	c.Close()
}


text:
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="MemberFragmentBuilder.cs" company="Bijectiv">
//   The MIT License (MIT)
//
//   Copyright (c) 2014 Brian Tyler
//
//   Permission is hereby granted, free of charge, to any person obtaining a copy
//   of this software and associated documentation files (the "Software"), to deal
//   in the Software without restriction, including without limitation the rights
//   to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
//   copies of the Software, and to permit persons to whom the Software is
//   furnished to do so, subject to the following conditions:
//
//   The above copyright notice and this permission notice shall be included in
//   all copies or substantial portions of the Software.
//
//   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
//   IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
//   FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
//   AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
//   LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
//   OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
//   THE SOFTWARE.
// </copyright>
// <summary>
//   Defines the MemberFragmentBuilder type.
// </summary>
// --------------------------------------------------------------------------------------------------------------------

namespace Bijectiv.Configuration
{
    using System;
    using System.Diagnostics.CodeAnalysis;
    using System.Linq.Expressions;

    using JetBrains.Annotations;

    /// <summary>
    /// A builder of <see cref="MemberFragment"/> instances.
    /// </summary>
    /// <typeparam name="TSource">
    /// The source type.
    /// </typeparam>
    /// <typeparam name="TTarget">
    /// The target type.
    /// </typeparam>
    /// <typeparam name="TMember">
    /// The type of the target member referenced by the fragment.
    /// </typeparam>
    [SuppressMessage("Microsoft.Design", "CA1005:AvoidExcessiveParametersOnGenericTypes",
        Justification = "By design.")]
    public class MemberFragmentBuilder<TSource, TTarget, TMember>
        : IMemberFragmentBuilder<TSource, TTarget, TMember>
    {
        /// <summary>
        /// The <see cref="InjectionDefinition"/> builder that spawned this instance.
        /// </summary>
        private readonly IInjectionDefinitionBuilder<TSource, TTarget> builder;

        /// <summary>
        /// The fragment that is being built.
        /// </summary>
        private readonly MemberFragment fragment;

        /// <summary>
        /// Initialises a new instance of the <see cref="MemberFragmentBuilder{TSource,TTarget,TMember}"/> class.
        /// </summary>
        /// <param name="builder">
        /// The <see cref="InjectionDefinition"/> builder that is spawning this instance.
        /// </param>
        /// <param name="fragment">
        /// The fragment that is being built.
        /// </param>
        /// <exception cref="ArgumentNullException">
        /// Thrown when any parameter is null.
        /// </exception>
        public MemberFragmentBuilder(
            [NotNull] IInjectionDefinitionBuilder<TSource, TTarget> builder,
            [NotNull] MemberFragment fragment)
        {
            if (builder == null)
            {
                throw new ArgumentNullException("builder");
            }

            if (fragment == null)
            {
                throw new ArgumentNullException("fragment");
            }

            this.builder = builder;
            this.fragment = fragment;
        }

        /// <summary>
        /// Gets the <see cref="InjectionDefinition"/> builder that spawned this instance.
        /// </summary>
        public IInjectionDefinitionBuilder<TSource, TTarget> Builder
        {
            get { return this.builder; }
        }

        /// <summary>
        /// Gets the fragment that is being built.
        /// </summary>
        public MemberFragment Fragment
        {
            get { return this.fragment; }
        }

        /// <summary>
        /// Registers a condition that must be met for the member to be injected.
        /// </summary>
        /// <param name="predicate">
        /// The predicate that defines the condition.
        /// </param>
        /// <returns>
        /// An object that allows further configuration of the injection.
        /// </returns>
        /// <exception cref="ArgumentNullException">
        /// Thrown when any parameter is null.
        /// </exception>
        public virtual IMemberFragmentBuilder<TSource, TTarget, TMember> Condition(
            Func<IInjectionParameters<TSource, TTarget>, bool> predicate)
        {
            if (predicate == null)
            {
                throw new ArgumentNullException("predicate");
            }

            this.Fragment.Add(
                new PredicateConditionMemberShard(
                    typeof(TSource),
                    typeof(TTarget),
                    this.Fragment.Member,
                    predicate));

            return this;
        }

        /// <summary>
        /// Ignores the member.
        /// </summary>
        /// <returns>
        /// An object that allows further configuration of the injection.
        /// </returns>
        public virtual IInjectionDefinitionBuilder<TSource, TTarget> Ignore()
        {
            this.Condition(p => false);
            return this.Builder;
        }

        /// <summary>
        /// Injects a value into the member using the run-time type of <paramref name="value"/> to determine how to
        /// inject it into the target member.
        /// </summary>
        /// <param name="value">
        /// The value.
        /// </param>
        /// <returns>
        /// An object that allows further configuration of the injection.
        /// </returns>
        public virtual IInjectionDefinitionBuilder<TSource, TTarget> InjectValue(object value)
        {
            if (value == null)
            {
                throw new ArgumentNullException(
                    "value",
                    "To set the member to NULL use AssignValue(null) instead.");
            }

            this.Fragment.Add(
                new ValueSourceMemberShard(
                    typeof(TSource),
                    typeof(TTarget),
                    this.Fragment.Member,
                    value,
                    true));

            return this.Builder;
        }

        /// <summary>
        /// Injects the result of an <paramref name="expression"/>, that takes the source object as input, into
        /// the member using the run-time type of the <paramref name="expression"/> result to determine how to inject
        /// it into the target member.
        /// </summary>
        /// <typeparam name="TResult">
        /// The type of the result of the expression; should be automatically inferred from the
        /// <paramref name="expression"/>.
        /// </typeparam>
        /// <param name="expression">
        /// The expression.
        /// </param>
        /// <returns>
        /// An object that allows further configuration of the injection.
        /// </returns>
        public virtual IInjectionDefinitionBuilder<TSource, TTarget> InjectSource<TResult>(
            [NotNull] Expression<Func<TSource, TResult>> expression)
        {
            if (expression == null)
            {
                throw new ArgumentNullException("expression");
            }

            this.Fragment.Add(
                new ExpressionSourceMemberShard(
                    typeof(TSource),
                    typeof(TTarget),
                    this.Fragment.Member,
                    expression,
                    true));

            return this.Builder;
        }

        /// <summary>
        /// Injects the result of a delegate, that takes <see cref="IInjectionParameters{TSource,TTarget}"/> as input, into
        /// the member using the run-time type of the delegate result to determine how to inject it
        /// into the target member.
        /// </summary>
        /// <typeparam name="TResult">
        /// The type of the result of the delegate; should be automatically inferred from the <paramref name="func"/>.
        /// </typeparam>
        /// <param name="func">
        /// The delegate from which to inject.
        /// </param>
        /// <returns>
        /// An object that allows further configuration of the injection.
        /// </returns>
        public virtual IInjectionDefinitionBuilder<TSource, TTarget> InjectDelegate<TResult>(
            [NotNull] Func<IInjectionParameters<TSource, TTarget>, TResult> func)
        {
            if (func == null)
            {
                throw new ArgumentNullException("func");
            }

            this.Fragment.Add(
                new DelegateSourceMemberShard(
                    typeof(TSource),
                    typeof(TTarget),
                    this.Fragment.Member,
                    func,
                    true));

            return this.Builder;
        }

        /// <summary>
        /// Assigns a value directly to the member.
        /// </summary>
        /// <param name="value">
        /// The value.
        /// </param>
        /// <returns>
        /// An object that allows further configuration of the injection.
        /// </returns>
        public virtual IInjectionDefinitionBuilder<TSource, TTarget> AssignValue(TMember value)
        {
            this.Fragment.Add(
                new ValueSourceMemberShard(
                    typeof(TSource),
                    typeof(TTarget),
                    this.Fragment.Member,
                    value,
                    false));

            return this.Builder;
        }

        /// <summary>
        /// Assigns the result of an <paramref name="expression"/>, that takes the source as input, directly to the
        /// member.
        /// </summary>
        /// <param name="expression">
        /// The expression.
        /// </param>
        /// <returns>
        /// An object that allows further configuration of the injection.
        /// </returns>
        public IInjectionDefinitionBuilder<TSource, TTarget> AssignSource(
            [NotNull] Expression<Func<TSource, TMember>> expression)
        {
            if (expression == null)
            {
                throw new ArgumentNullException("expression");
            }

            this.Fragment.Add(
                new ExpressionSourceMemberShard(
                    typeof(TSource),
                    typeof(TTarget),
                    this.Fragment.Member,
                    expression,
                    false));

            return this.Builder;
        }

        /// <summary>
        /// Assigns the result of a delegate, that takes  <see cref="IInjectionParameters{TSource,TTarget}"/> as input,
        /// directly to the member.
        /// </summary>
        /// <param name="func">
        /// The delegate from which to assign.
        /// </param>
        /// <returns>
        /// An object that allows further configuration of the injection.
        /// </returns>
        public virtual IInjectionDefinitionBuilder<TSource, TTarget> AssignDelegate(
            [NotNull] Func<IInjectionParameters<TSource, TTarget>, TMember> func)
        {
            if (func == null)
            {
                throw new ArgumentNullException("func");
            }

            this.Fragment.Add(
                new DelegateSourceMemberShard(
                    typeof(TSource),
                    typeof(TTarget),
                    this.Fragment.Member,
                    func,
                    false));

            return this.Builder;
        }
    }
}