text:
package com.agsw.FabricView.DrawableObjects;

import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Matrix;
import android.graphics.Rect;
import android.graphics.RectF;

/**
 * Created by emmanuel.proulx on 2017-08-27.
 */

public class CScale extends CTransform {
    public static final int MINIMUM_SIZE = 10;
    private float mFactor = 0.0f;

    /**
     * Constructor.
     * You must call setDirection after calling this constructor.
     * @param drawable The object this scaling affects.
     * @param x The center of scale.
     * @param y The center of scale.
     */
    public CScale(CDrawable drawable, int x, int y) {
        this(drawable, 1, x, y);
    }

    /**
     * Constructor.
     * @param drawable The object this scaling affects.
     * @param factor The scaling amount. Set to number between 0 and 1 to shrink, or above 1 to grow.
     * @param x The center of scale.
     * @param y The center of scale.
     */
    public CScale(CDrawable drawable, float factor, int x, int y) {
        setDrawable(drawable);
        mFactor = factor;
        setXcoords(x);
        setYcoords(y);
    }

    /**
     * @return The scaling factor.
     */
    public float getFactor() {
        return mFactor;
    }

    /**
     * Setter for the scaling factor.
     * @param factor The new scaling factor. Set to number between 0 and 1 to shrink, or above 1 to grow.
     */
    public void setFactor(float factor, float maxSize) {
        Rect rect = getDrawable().getLastBounds();

        float oldSize = Math.min(rect.width(), rect.height());
        float newSize = oldSize * factor;
        if(newSize < MINIMUM_SIZE) {
            mFactor = MINIMUM_SIZE/oldSize;
        }
        else if (newSize > maxSize) {
            mFactor = maxSize / oldSize;
        }
        else {
            mFactor = factor;
        }
    }

    @Override
    public void draw(Canvas canvas) {
        throw new UnsupportedOperationException("Don't call draw() directly on this class.");
    }

//    @Override
//    public Canvas applyTransform(Canvas canvas) {
//        Bitmap bitmap = Bitmap.createBitmap(getDrawable().getWidth(), getDrawable().getHeight(), Bitmap.Config.ARGB_8888);
//        Canvas temp = new Canvas(bitmap);
//        getDrawable().draw(temp);
//        temp.scale(mFactor, mFactor);
//        return temp;
//    }

    @Override
    public void applyTransform(Matrix m) {
        if(mFactor == 1) {
            //No scaling
            return;
        }

        m.postScale(mFactor, mFactor);
        float x = (getXcoords()*mFactor)/2;
        float y = (getYcoords()*mFactor)/2;
        m.postTranslate(-x, -y);
    }

    @Override
    public boolean equals(Object obj) {
        if(this == obj) {
            return true;
        }

        if (!(obj instanceof CScale)) {
            return false;
        }
        CScale other = (CScale) obj;
        if(other.getDrawable() == null && this.getDrawable() == null) {
            return true;
        }
        if(!getDrawable().equals(other.getDrawable())) {
            return false;
        }
        return other.mFactor == this.mFactor;
    }

}


text:
<!DOCTYPE HTML>

  <base href="">

  <title>vsked导航测试</title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">
	<meta http-equiv="keywords" content="">
	<meta http-equiv="description" content="">
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>

  <link rel="stylesheet" type="text/css" href="../css/allStyle.css">

单击这儿

redpajama_set_name: RedPajamaGithub


text:
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.appservice.models;

import com.azure.core.annotation.Fluent;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;

/** Container App Dapr configuration. */
@Fluent
public final class Dapr {
    /*
     * Boolean indicating if the Dapr side car is enabled
     */
    @JsonProperty(value = "enabled")
    private Boolean enabled;

    /*
     * Dapr application identifier
     */
    @JsonProperty(value = "appId")
    private String appId;

    /*
     * Port on which the Dapr side car
     */
    @JsonProperty(value = "appPort")
    private Integer appPort;

    /*
     * Collection of Dapr components
     */
    @JsonProperty(value = "components")
    private List<DaprComponent> components;

    /**
     * Get the enabled property: Boolean indicating if the Dapr side car is enabled.
     *
     * @return the enabled value.
     */
    public Boolean enabled() {
        return this.enabled;
    }

    /**
     * Set the enabled property: Boolean indicating if the Dapr side car is enabled.
     *
     * @param enabled the enabled value to set.
     * @return the Dapr object itself.
     */
    public Dapr withEnabled(Boolean enabled) {
        this.enabled = enabled;
        return this;
    }

    /**
     * Get the appId property: Dapr application identifier.
     *
     * @return the appId value.
     */
    public String appId() {
        return this.appId;
    }

    /**
     * Set the appId property: Dapr application identifier.
     *
     * @param appId the appId value to set.
     * @return the Dapr object itself.
     */
    public Dapr withAppId(String appId) {
        this.appId = appId;
        return this;
    }

    /**
     * Get the appPort property: Port on which the Dapr side car.
     *
     * @return the appPort value.
     */
    public Integer appPort() {
        return this.appPort;
    }

    /**
     * Set the appPort property: Port on which the Dapr side car.
     *
     * @param appPort the appPort value to set.
     * @return the Dapr object itself.
     */
    public Dapr withAppPort(Integer appPort) {
        this.appPort = appPort;
        return this;
    }

    /**
     * Get the components property: Collection of Dapr components.
     *
     * @return the components value.
     */
    public List<DaprComponent> components() {
        return this.components;
    }

    /**
     * Set the components property: Collection of Dapr components.
     *
     * @param components the components value to set.
     * @return the Dapr object itself.
     */
    public Dapr withComponents(List<DaprComponent> components) {
        this.components = components;
        return this;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (components() != null) {
            components().forEach(e -> e.validate());
        }
    }
}


text:
<?php

use mobilejazz\yii2\cms\backend\assets\BackendAsset;
use yii\bootstrap\Alert;
use yii\helpers\ArrayHelper;
use yii\helpers\Html;

/* @var $this \yii\web\View */
/* @var $content string */

$bundle = BackendAsset::register($this);

$this->params[ 'body-class' ] = array_key_exists('body-class', $this->params) ? $this->params[ 'body-class' ] : null;
?>

<?php $this->beginPage() ?>
    <!DOCTYPE html>
    <html lang="<?php echo Yii::$app->language ?>">
    <head>
        <meta charset="<?php echo Yii::$app->charset ?>">
        <meta content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no' name='viewport'>

        <?php echo Html::csrfMetaTags() ?>
        <title><?php echo Html::encode($this->title) ?></title>
        <?php $this->head() ?>

    </head>
    <?php echo Html::beginTag('body', [
        'class' => implode(' ', [
            ArrayHelper::getValue($this->params, 'body-class'),
            'login-page',
        ]),
    ]) ?>
    <?php $this->beginBody() ?>
    <?php if (Yii::$app->session->hasFlash('info')): ?>
        <?php echo Alert::widget([
            'body'    => ArrayHelper::getValue(Yii::$app->session->getFlash('info'), 'body'),
            'options' => ArrayHelper::getValue(Yii::$app->session->getFlash('info'), 'options'),
        ]) ?>
    <?php endif; ?>
    <?php echo $content ?>
    <?php $this->endBody() ?>
    <?php echo Html::endTag('body') ?>
    </html>
<?php $this->endPage() ?>


text:
This example demonstrates how separately hosted 3rd party web-apps can be seamlessly integrated into TestRail.

The plugin will recreate an "Add test case" form according to your setup and allow you to create a new test case. Since this is just a proof of concept, there's no corner case handling, only primitive validation, the code is horrid, and things may break painfully.

For more information see [the post on Gurock forum](https://discuss.gurock.com/t/ui-script-plugin-poc-testrail-plugins-working-demo/1908).

The plugin is hosted [here (GitHub pages)](https://actinarium.github.io/testrail-plugin-demo/).
Host UI script for TestRail can be found [here (Gist)](https://gist.github.com/Actine/e26325f93b0ff9d98029).

I don't collect any data — this page communicates with nothing but your TestRail (or at least not under my governance).


text:
import { AxiosResponse } from 'axios';

export enum StacksActionTypes {
  FETCH_REQUEST = '@@stacks/FETCH_REQUEST',
  FETCH_SUCCESS = '@@stacks/FETCH_SUCCESS',
  FETCH_ERROR = '@@stacks/FETCH_ERROR',
}

export interface IStacksState {
  readonly data: string;
  readonly errors?: AxiosResponse;
  readonly loading: boolean;
  readonly response?: AxiosResponse;
}


text:
package org.dynmap.forge_1_17_1;

import java.util.List;

import org.dynmap.DynmapChunk;
import org.dynmap.Log;
import org.dynmap.common.chunk.GenericChunk;
import org.dynmap.common.chunk.GenericChunkCache;
import org.dynmap.common.chunk.GenericMapChunkCache;

import net.minecraft.nbt.CompoundTag;
import net.minecraft.server.level.ServerChunkCache;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.world.level.ChunkPos;
import net.minecraft.world.level.chunk.ChunkAccess;
import net.minecraft.world.level.chunk.ChunkStatus;
import net.minecraft.world.level.chunk.storage.ChunkSerializer;

/**
 * Container for managing chunks - dependent upon using chunk snapshots, since
 * rendering is off server thread
 */
public class ForgeMapChunkCache extends GenericMapChunkCache {
	private ServerLevel w;
	private ServerChunkCache cps;
	/**
	 * Construct empty cache
	 */
	public ForgeMapChunkCache(GenericChunkCache cc) {
		super(cc);
	}

	// Load generic chunk from existing and already loaded chunk
	protected GenericChunk getLoadedChunk(DynmapChunk chunk) {
		GenericChunk gc = null;
		ChunkAccess ch = cps.getChunk(chunk.x, chunk.z, ChunkStatus.FULL, false);
		if (ch != null) {
			CompoundTag nbt = ChunkSerializer.write(w, ch);
			if (nbt != null) {
				gc = parseChunkFromNBT(new NBT.NBTCompound(nbt));
			}
		}
		return gc;
	}
	// Load generic chunk from unloaded chunk
	protected GenericChunk loadChunk(DynmapChunk chunk) {
		GenericChunk gc = null;
		CompoundTag nbt = readChunk(chunk.x, chunk.z);
		// If read was good
		if (nbt != null) {
			gc = parseChunkFromNBT(new NBT.NBTCompound(nbt));
		}
		return gc;
	}

	public void setChunks(ForgeWorld dw, List<DynmapChunk> chunks) {
		this.w = dw.getWorld();
		if (dw.isLoaded()) {
			/* Check if world's provider is ServerChunkProvider */
			cps = this.w.getChunkSource();
		}
		super.setChunks(dw, chunks);
	}

	private CompoundTag readChunk(int x, int z) {
		try {
			return cps.chunkMap.readChunk(new ChunkPos(x, z));
		} catch (Exception exc) {
			Log.severe(String.format("Error reading chunk: %s,%d,%d", dw.getName(), x, z), exc);
			return null;
		}
	}
}


text:
#ifndef ML_DMPDEFAULT_H__
#define ML_DMPDEFAULT_H__

/**
 * @defgroup DEFAULT
 * @brief Default DMP assembly listing header file
 *
 * @{
 *      @file     inv_setup_dmp.c
 *      @brief    Default DMP assembly listing header file
 */

#ifdef __cplusplus
extern "C"
{
#endif
    inv_error_t inv_setup_dmp(void);

#ifdef __cplusplus
}
#endif

#endif // ML_DMPDEFAULT_H__


text:
#include <cmath>

#include <folly/portability/GTest.h>
#include <thrift/lib/cpp/DistinctTable.h>

namespace apache {
namespace thrift {

template <class T>
struct AllSamePolicy : BaseDistinctTablePolicy<T> {
  struct Hash {
    size_t operator()(const T&) const { return 0; }
  };

  struct Equal {
    bool operator()(const T&, const T&) const { return true; }
  };
};

template <class T>
struct OneByteIndexPolicy : BaseDistinctTablePolicy<T> {
  template <class Hash, class Equal>
  using Index = std::unordered_set<uint8_t, Hash, Equal>;
};

TEST(DistinctTable, Basic) {
  std::vector<std::string> words;
  DistinctTable<std::string> wordTable(&words);

  EXPECT_EQ(0, wordTable.add("hi"));
  EXPECT_EQ(1, wordTable.add("bye"));
  EXPECT_EQ(0, wordTable.add("hi"));
  EXPECT_EQ(2, wordTable.add("what"));
  EXPECT_EQ(1, wordTable.add("bye"));
  EXPECT_EQ(2, wordTable.add("what"));
  EXPECT_EQ(0, wordTable.add("hi"));
  EXPECT_EQ("hi", words[0]);
  EXPECT_EQ("bye", words[1]);
  EXPECT_EQ("what", words[2]);
  EXPECT_EQ(3, words.size());
}

TEST(DistinctTable, AllSamePolicy) {
  std::vector<std::string> words;
  DistinctTable<std::string, AllSamePolicy> wordTable(&words);

  EXPECT_EQ(0, wordTable.add("hi"));
  // Null hash/equal functions think everything is the same
  EXPECT_EQ(0, wordTable.add("bye"));
  EXPECT_EQ(0, wordTable.add("hi"));
}

TEST(DistinctTable, ByteIndexPolicy) {
  std::vector<double> nums;
  DistinctTable<double, OneByteIndexPolicy> numTable(&nums);

  for (int i = 0; i < 500; ++i) {
    if (i < 256) {
      EXPECT_EQ(i, numTable.add(sqrt(i)));
    } else {
      EXPECT_LT(numTable.add(sqrt(i)), 256);
    }
  }
}

} // namespace thrift
} // namespace apache


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

<title>ParsePosition (Java Platform SE 8 )</title>
<meta name="date" content="2014-12-17">
<meta name="keywords" content="java.text.ParsePosition class">
<meta name="keywords" content="getIndex()">
<meta name="keywords" content="setIndex()">
<meta name="keywords" content="setErrorIndex()">
<meta name="keywords" content="getErrorIndex()">
<meta name="keywords" content="equals()">
<meta name="keywords" content="hashCode()">
<meta name="keywords" content="toString()">
<link rel="stylesheet" type="text/css" href="../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Java™ Platform
Standard Ed. 8

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

compact1, compact2, compact3

java.text

Class ParsePosition

java.lang.Object

java.text.ParsePosition

public class ParsePosition
extends Object

ParsePosition is a simple class used by Format
 and its subclasses to keep track of the current position during parsing.
 The parseObject method in the various Format
 classes requires a ParsePosition object as an argument.

 By design, as you parse through a string with different formats,
 you can use the same ParsePosition, since the index parameter
 records the current position.

See Also:

Format

Constructor Summary

Constructors

Constructor and Description

ParsePosition(int index)

Create a new ParsePosition with the given initial index.

Method Summary

All Methods Instance Methods Concrete Methods

Modifier and Type
Method and Description

boolean
equals(Object obj)

Overrides equals

int
getErrorIndex()

Retrieve the index at which an error occurred, or -1 if the
 error index has not been set.

int
getIndex()

Retrieve the current parse position.

int
hashCode()

Returns a hash code for this ParsePosition.

void
setErrorIndex(int ei)

Set the index at which a parse error occurred.

void
setIndex(int index)

Set the current parse position.

String
toString()

Return a string representation of this ParsePosition.

Methods inherited from class java.lang.Object

clone, finalize, getClass, notify, notifyAll, wait, wait, wait

Constructor Detail

ParsePosition

public ParsePosition(int index)

Create a new ParsePosition with the given initial index.

Parameters:

index - initial index

Method Detail

getIndex

public int getIndex()

Retrieve the current parse position.  On input to a parse method, this
 is the index of the character at which parsing will begin; on output, it
 is the index of the character following the last character parsed.

Returns:

the current parse position

setIndex

public void setIndex(int index)

Set the current parse position.

Parameters:

index - the current parse position

setErrorIndex

public void setErrorIndex(int ei)

Set the index at which a parse error occurred.  Formatters
 should set this before returning an error code from their
 parseObject method.  The default value is -1 if this is not set.

Parameters:

ei - the index at which an error occurred

Since:

1.2

getErrorIndex

public int getErrorIndex()

Retrieve the index at which an error occurred, or -1 if the
 error index has not been set.

Returns:

the index at which an error occurred

Since:

1.2

equals

public boolean equals(Object obj)

Overrides equals

Overrides:

equals in class Object

Parameters:

obj - the reference object with which to compare.

Returns:

true if this object is the same as the obj
          argument; false otherwise.

See Also:

Object.hashCode(),
HashMap

hashCode

public int hashCode()

Returns a hash code for this ParsePosition.

Overrides:

hashCode in class Object

Returns:

a hash code value for this object

See Also:

Object.equals(java.lang.Object),
System.identityHashCode(java.lang.Object)

toString

public String toString()

Return a string representation of this ParsePosition.

Overrides:

toString in class Object

Returns:

a string representation of this object

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Java™ Platform
Standard Ed. 8

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

 Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
 Copyright © 1993, 2015, Oracle and/or its affiliates.  All rights reserved.


text:
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent">
    <com.github.florent37.materialviewpager.header.MaterialViewPagerImageHeader
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@id/materialviewpager_imageHeader"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:adjustViewBounds="true"
        android:scaleType="centerCrop" />
    <View
        android:id="@id/materialviewpager_headerImageDarkLayer"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="@android:color/black"/>
</FrameLayout>


text:
package com.amazonaws.hal.client;

import com.amazonaws.AmazonClientException;
import com.amazonaws.AmazonServiceException;
import com.amazonaws.AmazonWebServiceClient;
import com.amazonaws.AmazonWebServiceResponse;
import com.amazonaws.ClientConfiguration;
import com.amazonaws.DefaultRequest;
import com.amazonaws.Request;
import com.amazonaws.Response;
import com.amazonaws.auth.AWSCredentials;
import com.amazonaws.auth.AWSCredentialsProvider;
import com.amazonaws.http.ExecutionContext;
import com.amazonaws.http.HttpMethodName;
import com.amazonaws.http.HttpResponseHandler;
import com.amazonaws.http.JsonErrorResponseHandler;
import com.amazonaws.http.JsonResponseHandler;
import com.amazonaws.transform.JsonErrorUnmarshaller;
import com.amazonaws.transform.VoidJsonUnmarshaller;
import com.amazonaws.util.AWSRequestMetrics;
import com.amazonaws.util.StringInputStream;
import com.amazonaws.util.json.JSONObject;

import java.lang.reflect.Proxy;
import java.net.URLDecoder;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import static com.amazonaws.http.HttpMethodName.GET;
import static com.amazonaws.http.HttpMethodName.PATCH;
import static com.amazonaws.http.HttpMethodName.POST;
import static com.amazonaws.http.HttpMethodName.PUT;
import static com.amazonaws.http.HttpMethodName.DELETE;

/**
 * The HalClient is a lower-level class for interacting with a HAL-based API.  Preferably, a set of interface
 * classes that describe the interaction with the service is used, and this class is only used behind the
 * scenes.
 */
public class HalClient extends AmazonWebServiceClient {

    //-------------------------------------------------------------
    // Variables - Private
    //-------------------------------------------------------------

    private AWSCredentialsProvider awsCredentialsProvider;
    private Map<String, Object> resourceCache;
    private HttpResponseHandler<AmazonServiceException> errorResponseHandler;

    //-------------------------------------------------------------
    // Constructors
    //-------------------------------------------------------------

    public HalClient(ClientConfiguration clientConfiguration, String endpoint, String serviceName,
                     AWSCredentialsProvider awsCredentialsProvider, Map<String, Object> resourceCache,
                     HttpResponseHandler<AmazonServiceException> errorResponseHandler) {
        super(clientConfiguration);

        this.setServiceNameIntern(serviceName);
        this.setEndpoint(endpoint);
        this.awsCredentialsProvider = awsCredentialsProvider;
        this.resourceCache = resourceCache;
        this.errorResponseHandler = errorResponseHandler;
        this.addRequestHandler(new AcceptHalJsonRequestHandler());
    }

    //-------------------------------------------------------------
    // Methods - Public
    //-------------------------------------------------------------

    public <T> T getResource(Class<T> resourceClass, String resourcePath) {
        return getResource(null, resourceClass, resourcePath, false);
    }

    public <T> T postResource(Class<T> resourceClass, String resourcePath, Object representation) {
        OptionalJsonResponseHandler<HalResource> responseHandler = getResponseHandler(resourceClass);
        HalResource halResource = invoke(POST, resourcePath, representation, responseHandler);
        Object cachedResource = resourceCache.get(resourcePath);

        String halResourcePath = getHalResourcePath(halResource, responseHandler);

        // Check if the cached resource we just POSTed to is the same resource we got back.  If yes, update the existing proxy's
        // invocation handler with the new data and return it.  If no, the target was likely a collection resource.  We leave the
        // cached data as is, letting the caching strategy update it when needed.
        // TODO: Review collection cache clearing strategy.
        if (cachedResource != null && resourcePath.equals(halResourcePath)) {
            HalResourceInvocationHandler invocationHandler = (HalResourceInvocationHandler) Proxy.getInvocationHandler(cachedResource);

            invocationHandler.resourceUpdated(halResource);
            // TODO: follow embedded resources and call resourceUpdated()

            return resourceClass.cast(cachedResource);
        }

        return halResource == null ? null : createAndCacheResource(resourceClass, resourcePath, halResource);
    }

    public <T> T putResource(Class<T> resourceClass, String resourcePath, Object representation) {
        OptionalJsonResponseHandler<HalResource> responseHandler = getResponseHandler(resourceClass);
        HalResource halResource = invoke(PUT, resourcePath, representation,responseHandler);
        Object cachedResource = resourceCache.get(resourcePath);

        // Per RFC2616, section 9.6 PUT, the cached resource should refer to the same resource we just received, so we update the
        // existing proxy's invocation handler with the new data.
        if (cachedResource != null) {
            HalResourceInvocationHandler invocationHandler = (HalResourceInvocationHandler) Proxy.getInvocationHandler(cachedResource);

            invocationHandler.resourceUpdated(halResource);
            // TODO: follow embedded resources and call resourceUpdated()

            return resourceClass.cast(cachedResource);
        }

        return halResource == null ? null : createAndCacheResource(resourceClass, resourcePath, halResource);
    }

    public <T> T deleteResource(Class<T> resourceClass, String resourcePath) {
        OptionalJsonResponseHandler<HalResource> responseHandler = getResponseHandler(resourceClass);
        HalResource halResource = invoke(DELETE, resourcePath, null, responseHandler);
        Object cachedResource = resourceCache.get(resourcePath);

        // Per RFC2616, section 9.7 DELETE, the resource should be removed from the cache.  We additionally clear the cached
        // resource in case references to the proxy exist elsewhere.
        if (cachedResource != null) {
            HalResourceInvocationHandler invocationHandler = (HalResourceInvocationHandler) Proxy.getInvocationHandler(cachedResource);

            invocationHandler.resourceUpdated(null);

            resourceCache.remove(resourcePath);
            // TODO: follow embedded resources and call remove() and resourceUpdated()
        }

        return halResource == null ? null : createResource(resourceClass, resourcePath, halResource);
    }

    public <T> T patchResource(Class<T> resourceClass, String resourcePath, Object representation) {
        OptionalJsonResponseHandler<HalResource> responseHandler = getResponseHandler(resourceClass);
        HalResource halResource = invoke(PATCH, resourcePath, representation, responseHandler);
        Object cachedResource = resourceCache.get(resourcePath);

        String halResourcePath = getHalResourcePath(halResource, responseHandler);

        // Check if the cached resource we just PATCHed to is the same resource we got back.  If yes, update the existing proxy's
        // invocation handler with the new data and return it.
        // TODO: Handle multi-resource patches (e.g. child resources of the current resource)
        // TODO: Review collection cache clearing strategy.
        if (cachedResource != null && resourcePath.equals(halResourcePath)) {
            HalResourceInvocationHandler invocationHandler = (HalResourceInvocationHandler) Proxy.getInvocationHandler(cachedResource);

            invocationHandler.resourceUpdated(halResource);
            // TODO: follow embedded resources and call resourceUpdated()

            return resourceClass.cast(cachedResource);
        }

        return halResource == null ? null : createAndCacheResource(resourceClass, resourcePath, halResource);
    }

    //-------------------------------------------------------------
    // Methods - Package
    //-------------------------------------------------------------

    <T> T getResource(HalResource sourceResource, Class<T> resourceClass, String resourcePath, boolean lazy) {
        if (resourceCache.containsKey(resourcePath)) {
            return resourceClass.cast(resourceCache.get(resourcePath));
        }

        HalResource halResource;

        if (sourceResource != null && sourceResource.getEmbedded().containsKey(resourcePath)) {
            halResource = sourceResource.getEmbedded().get(resourcePath);
        } else if (lazy) {
            halResource = null;
        } else {
            halResource = getHalResource(resourcePath);
        }

        return createAndCacheResource(resourceClass, resourcePath, halResource);
    }

    HalResource getHalResource(String resourcePath) {
        JsonResponseHandler<HalResource> responseHandler = new JsonResponseHandler<>(HalJsonResourceUnmarshaller.getInstance());

        return invoke(GET, resourcePath, null, responseHandler);
    }

    //-------------------------------------------------------------
    // Methods - Private
    //-------------------------------------------------------------

    private <T> T invoke(HttpMethodName httpMethodName, String resourcePath, Object representation,
                         HttpResponseHandler<AmazonWebServiceResponse<T>> responseHandler)
            throws AmazonClientException {
        ExecutionContext executionContext = createExecutionContext();
        AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();

        awsRequestMetrics.startEvent(AWSRequestMetrics.Field.RequestMarshallTime.name());
        Request request = buildRequest(httpMethodName, resourcePath, representation);
        awsRequestMetrics.endEvent(AWSRequestMetrics.Field.RequestMarshallTime.name());

        awsRequestMetrics.startEvent(AWSRequestMetrics.Field.CredentialsRequestTime.name());
        AWSCredentials credentials = awsCredentialsProvider.getCredentials();
        awsRequestMetrics.endEvent(AWSRequestMetrics.Field.CredentialsRequestTime.name());

        executionContext.setCredentials(credentials);

        awsRequestMetrics.startEvent(AWSRequestMetrics.Field.ClientExecuteTime.name());
        Response<T> response = client.execute(request, responseHandler, errorResponseHandler, executionContext);
        awsRequestMetrics.endEvent(AWSRequestMetrics.Field.ClientExecuteTime.name());

        awsRequestMetrics.log();

        return response.getAwsResponse();
    }

    private Request buildRequest(HttpMethodName httpMethodName, String resourcePath, Object representation) {
        Request request = new DefaultRequest(null);

        request.setHttpMethod(httpMethodName);
        request.setEndpoint(endpoint);

        populateResourcePathAndParameters(request, resourcePath);

        if (representation != null) {
            assignContent(request, representation);
        }

        return request;
    }

    private void populateResourcePathAndParameters(Request request, String resourcePath) {
        int questionIndex = resourcePath.indexOf("?");

        if (questionIndex < 0) {
            request.setResourcePath(resourcePath);

            return;
        }

        request.setResourcePath(resourcePath.substring(0, questionIndex));

        for (String parameterPair : resourcePath.substring(questionIndex + 1).split("&")) {
            int equalIndex = parameterPair.indexOf("=");

            if (equalIndex < 0) { // key with no value
                //noinspection deprecation
                request.addParameter(URLDecoder.decode(parameterPair), null);
            } else { // key=value
                //noinspection deprecation
                request.addParameter(URLDecoder.decode(parameterPair.substring(0, equalIndex)),
                                     URLDecoder.decode(parameterPair.substring(equalIndex + 1)));
            }
        }
    }

    private void assignContent(Request request, Object representation) {
        String contentString = new JSONObject(representation).toString();

        if (contentString == null) {
            throw new AmazonClientException("Unable to marshall representation to JSON: " + representation);
        }

        try {
            byte[] contentBytes = contentString.getBytes("UTF-8");

            request.setContent(new StringInputStream(contentString));
            request.addHeader("Content-Length", Integer.toString(contentBytes.length));
            request.addHeader("Content-Type", "application/json");
        } catch(Throwable t) {
            throw new AmazonClientException("Unable to marshall request to JSON: " + t.getMessage(), t);
        }
    }

    private <T> OptionalJsonResponseHandler<HalResource> getResponseHandler(Class<T> resourceClass) {
        if (resourceClass.equals(Void.class) || resourceClass.equals(void.class)) {
            return new OptionalJsonResponseHandler<>(new VoidJsonUnmarshaller<HalResource>());
        }

        return new OptionalJsonResponseHandler<>(HalJsonResourceUnmarshaller.getInstance());
    }

    private <T> T createAndCacheResource(Class<T> resourceClass, String resourcePath, HalResource halResource) {
        T t = createResource(resourceClass, resourcePath, halResource);

        resourceCache.put(resourcePath, t);

        return t;
    }

    private <T> T createResource(Class<T> resourceClass, String resourcePath, HalResource halResource) {
        Object proxy = Proxy.newProxyInstance(resourceClass.getClassLoader(),
                                              new Class<?>[] { resourceClass },
                                              new HalResourceInvocationHandler(halResource, resourcePath, this));

        return resourceClass.cast(proxy);
    }

    private String getHalResourcePath(HalResource halResource, OptionalJsonResponseHandler<HalResource> responseHandler) {
        String resourcePath;

        if (halResource != null && halResource.isDefined()) {
            resourcePath = halResource._getSelfHref();
        } else {
            String endpointString = endpoint.toString();
            String location = responseHandler.getLocation();

            // Will throw an NPE if no location is present.  This is okay, since it means we don't know what this resource is
            // or where to find it.
            if (location.startsWith(endpointString)) {
                resourcePath = location.substring(endpointString.length());
            } else {
                resourcePath = location;
            }
        }

        return resourcePath;
    }
}


text:
/* TODO: We use gdk_cairo_create() and others, which are deprecated */
#define GDK_DISABLE_DEPRECATION_WARNINGS

#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <gst/gst.h>
#include <gtk/gtk.h>

#define NBANDS 10

static GtkWidget *drawingarea = NULL;
static guint spect_height = 128;
static guint spect_bands = 256;
static gfloat height_scale = 2.0;

static void
on_window_destroy (GObject * object, gpointer user_data)
{
  drawingarea = NULL;
  gtk_main_quit ();
}

static gboolean
on_configure_event (GtkWidget * widget, GdkEventConfigure * event,
    gpointer user_data)
{
  GstElement *spectrum = GST_ELEMENT (user_data);

  /*GST_INFO ("%d x %d", event->width, event->height); */
  spect_height = event->height;
  height_scale = event->height / 64.0;
  spect_bands = event->width;

  g_object_set (G_OBJECT (spectrum), "bands", spect_bands, NULL);
  return FALSE;
}

/* control gains */
static void
on_gain_changed (GtkRange * range, gpointer user_data)
{
  GstObject *band = GST_OBJECT (user_data);
  gdouble value = gtk_range_get_value (range);

  g_object_set (band, "gain", value, NULL);
}

/* control bandwidths */
static void
on_bandwidth_changed (GtkRange * range, gpointer user_data)
{
  GstObject *band = GST_OBJECT (user_data);
  gdouble value = gtk_range_get_value (range);

  g_object_set (band, "bandwidth", value, NULL);
}

/* control frequency */
static void
on_freq_changed (GtkRange * range, gpointer user_data)
{
  GstObject *band = GST_OBJECT (user_data);
  gdouble value = gtk_range_get_value (range);

  /* hbox */
  GtkWidget *parent = gtk_widget_get_parent (GTK_WIDGET (range));

  /* frame */
  GtkWidget *parent_parent = gtk_widget_get_parent (parent);
  gchar *label = g_strdup_printf ("%d Hz", (int) (value + 0.5));

  gtk_frame_set_label (GTK_FRAME (parent_parent), label);
  g_free (label);

  g_object_set (band, "freq", value, NULL);
}

/* draw frequency spectrum as a bunch of bars */
static void
draw_spectrum (gfloat * data)
{
  gint i;
  GdkRectangle rect = { 0, 0, spect_bands, spect_height };
  cairo_t *cr;

  if (!drawingarea)
    return;

  gdk_window_begin_paint_rect (gtk_widget_get_window (drawingarea), &rect);
  cr = gdk_cairo_create (gtk_widget_get_window (drawingarea));

  cairo_set_source_rgb (cr, 0, 0, 0);
  cairo_rectangle (cr, 0, 0, spect_bands, spect_height);
  cairo_fill (cr);
  for (i = 0; i < spect_bands; i++) {
    cairo_set_source_rgb (cr, 1, 1, 1);
    cairo_rectangle (cr, i, -data[i], 1, spect_height + data[i]);
    cairo_fill (cr);
  }
  cairo_destroy (cr);

  gdk_window_end_paint (gtk_widget_get_window (drawingarea));
}

static void
dynamic_link (GstPadTemplate * templ, GstPad * newpad, gpointer user_data)
{
  GstPad *target = GST_PAD (user_data);

  gst_pad_link (newpad, target);
  gst_object_unref (target);
}

/* receive spectral data from element message */
static gboolean
message_handler (GstBus * bus, GstMessage * message, gpointer data)
{
  if (message->type == GST_MESSAGE_ELEMENT) {
    const GstStructure *s = gst_message_get_structure (message);
    const gchar *name = gst_structure_get_name (s);

    if (strcmp (name, "spectrum") == 0) {
      gfloat *spect = g_new (gfloat, spect_bands);
      const GValue *list;
      const GValue *value;
      guint i;

      list = gst_structure_get_value (s, "magnitude");
      for (i = 0; i < spect_bands; ++i) {
        value = gst_value_list_get_value (list, i);
        spect[i] = height_scale * g_value_get_float (value);
      }
      draw_spectrum (spect);
      g_free (spect);
    }
  }
  return TRUE;
}

int
main (int argc, char *argv[])
{
  GstElement *bin;
  GstElement *decodebin, *decconvert;
  GstElement *capsfilter, *equalizer, *spectrum, *sinkconvert, *sink;
  GstCaps *caps;
  GstBus *bus;
  GtkWidget *appwindow, *vbox, *hbox, *scale;
  int i, num_bands = NBANDS;

  GOptionEntry options[] = {
    {"bands", 'b', 0, G_OPTION_ARG_INT, &num_bands,
        "Number of bands", NULL},
    {NULL}
  };
  GOptionContext *ctx;
  GError *err = NULL;

  ctx = g_option_context_new ("- demo of audio equalizer");
  g_option_context_add_main_entries (ctx, options, NULL);
  g_option_context_add_group (ctx, gst_init_get_option_group ());
  g_option_context_add_group (ctx, gtk_get_option_group (TRUE));

  if (!g_option_context_parse (ctx, &argc, &argv, &err)) {
    g_print ("Error initializing: %s\n", err->message);
    g_option_context_free (ctx);
    g_clear_error (&err);
    exit (1);
  }
  g_option_context_free (ctx);

  if (argc < 2) {
    g_print ("Usage: %s <uri to play>\n", argv[0]);
    g_print ("    For optional arguments: --help\n");
    exit (-1);
  }

  gst_init (&argc, &argv);
  gtk_init (&argc, &argv);

  bin = gst_pipeline_new ("bin");

  /* Uri decoding */
  decodebin = gst_element_factory_make ("uridecodebin", "decoder");
  g_object_set (G_OBJECT (decodebin), "uri", argv[1], NULL);

  /* Force float32 samples */
  decconvert = gst_element_factory_make ("audioconvert", "decconvert");
  capsfilter = gst_element_factory_make ("capsfilter", "capsfilter");
  caps =
      gst_caps_new_simple ("audio/x-raw", "format", G_TYPE_STRING, "F32LE",
      NULL);
  g_object_set (capsfilter, "caps", caps, NULL);

  equalizer = gst_element_factory_make ("equalizer-nbands", "equalizer");
  g_object_set (G_OBJECT (equalizer), "num-bands", num_bands, NULL);

  spectrum = gst_element_factory_make ("spectrum", "spectrum");
  g_object_set (G_OBJECT (spectrum), "bands", spect_bands, "threshold", -80,
      "post-messages", TRUE, "interval", 500 * GST_MSECOND, NULL);

  sinkconvert = gst_element_factory_make ("audioconvert", "sinkconvert");

  sink = gst_element_factory_make ("autoaudiosink", "sink");

  gst_bin_add_many (GST_BIN (bin), decodebin, decconvert, capsfilter, equalizer,
      spectrum, sinkconvert, sink, NULL);
  if (!gst_element_link_many (decconvert, capsfilter, equalizer, spectrum,
          sinkconvert, sink, NULL)) {
    fprintf (stderr, "can't link elements\n");
    exit (1);
  }

  /* Handle dynamic pads */
  g_signal_connect (G_OBJECT (decodebin), "pad-added",
      G_CALLBACK (dynamic_link), gst_element_get_static_pad (decconvert,
          "sink"));

  bus = gst_element_get_bus (bin);
  gst_bus_add_watch (bus, message_handler, NULL);
  gst_object_unref (bus);

  appwindow = gtk_window_new (GTK_WINDOW_TOPLEVEL);
  gtk_window_set_title (GTK_WINDOW (appwindow), "Equalizer Demo");
  g_signal_connect (G_OBJECT (appwindow), "destroy",
      G_CALLBACK (on_window_destroy), NULL);
  vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);

  drawingarea = gtk_drawing_area_new ();
  gtk_widget_set_size_request (drawingarea, spect_bands, spect_height);
  g_signal_connect (G_OBJECT (drawingarea), "configure-event",
      G_CALLBACK (on_configure_event), (gpointer) spectrum);
  gtk_box_pack_start (GTK_BOX (vbox), drawingarea, TRUE, TRUE, 0);

  hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 20);

  for (i = 0; i < num_bands; i++) {
    GObject *band;
    gdouble freq;
    gdouble bw;
    gdouble gain;
    gchar *label;
    GtkWidget *frame, *scales_hbox;

    band = gst_child_proxy_get_child_by_index (GST_CHILD_PROXY (equalizer), i);
    g_assert (band != NULL);
    g_object_get (band, "freq", &freq, NULL);
    g_object_get (band, "bandwidth", &bw, NULL);
    g_object_get (band, "gain", &gain, NULL);

    label = g_strdup_printf ("%d Hz", (int) (freq + 0.5));
    frame = gtk_frame_new (label);
    g_free (label);

    scales_hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);

    /* Create gain scale */
    scale = gtk_scale_new_with_range (GTK_ORIENTATION_VERTICAL,
        -24.0, 12.0, 0.5);
    gtk_scale_set_draw_value (GTK_SCALE (scale), TRUE);
    gtk_scale_set_value_pos (GTK_SCALE (scale), GTK_POS_TOP);
    gtk_range_set_value (GTK_RANGE (scale), gain);
    gtk_widget_set_size_request (scale, 35, 150);
    g_signal_connect (G_OBJECT (scale), "value-changed",
        G_CALLBACK (on_gain_changed), (gpointer) band);
    gtk_box_pack_start (GTK_BOX (scales_hbox), scale, FALSE, FALSE, 0);

    /* Create bandwidth scale */
    scale = gtk_scale_new_with_range (GTK_ORIENTATION_VERTICAL,
        0.0, 20000.0, 5.0);
    gtk_scale_set_draw_value (GTK_SCALE (scale), TRUE);
    gtk_scale_set_value_pos (GTK_SCALE (scale), GTK_POS_TOP);
    gtk_range_set_value (GTK_RANGE (scale), bw);
    gtk_widget_set_size_request (scale, 45, 150);
    g_signal_connect (G_OBJECT (scale), "value-changed",
        G_CALLBACK (on_bandwidth_changed), (gpointer) band);
    gtk_box_pack_start (GTK_BOX (scales_hbox), scale, TRUE, TRUE, 0);

    /* Create frequency scale */
    scale = gtk_scale_new_with_range (GTK_ORIENTATION_VERTICAL,
        20.0, 20000.0, 5.0);
    gtk_scale_set_draw_value (GTK_SCALE (scale), TRUE);
    gtk_scale_set_value_pos (GTK_SCALE (scale), GTK_POS_TOP);
    gtk_range_set_value (GTK_RANGE (scale), freq);
    gtk_widget_set_size_request (scale, 45, 150);
    g_signal_connect (G_OBJECT (scale), "value-changed",
        G_CALLBACK (on_freq_changed), (gpointer) band);
    gtk_box_pack_start (GTK_BOX (scales_hbox), scale, TRUE, TRUE, 0);

    gtk_container_add (GTK_CONTAINER (frame), scales_hbox);

    gtk_box_pack_start (GTK_BOX (hbox), frame, TRUE, TRUE, 0);
  }

  gtk_box_pack_start (GTK_BOX (vbox), hbox, TRUE, TRUE, 0);

  gtk_container_add (GTK_CONTAINER (appwindow), vbox);
  gtk_widget_show_all (appwindow);

  gst_element_set_state (bin, GST_STATE_PLAYING);
  gtk_main ();
  gst_element_set_state (bin, GST_STATE_NULL);

  gst_object_unref (bin);

  return 0;
}


text:
/*
decrypt0r.c
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <include/firmware_tools.h>

int main(int argc, char const *argv[])
{
	int choice_of_your_life;

	system("clear");
	ipswDownloader();
	system("clear");
	swag_logo();
	printf("Choose what you want to do\n");
	printf(" 1) Decrypt Root Filesystem\n");
	printf(" 2) Decrypt Ramdisk\n");
	printf(" 3) Decrypt IMG3/IMG4 File\n");
	printf(" 4) Decrypt DFU File\n");
	printf(" 5) Decrypt Kernelcache\n");
	printf(" 6) Grab Keybags\n");
	printf(" 7) Patch iBEC/iBSS\n");
	printf("> ");
	choice_of_your_life = fgetn();

	switch (choice_of_your_life)
	{
		case 1 : rootfs(); break;
		case 2 : Ramdisk(); break;
		case 3 : IMGfile(); break;
		case 4 : DFU_file(); break;
		case 5 : kernelcache(); break;
		case 6 : get_keybags(); break;
		case 7 : patcher(); break;
		default : printf("No option available yet\n");
	}
	return 0;
}


text:
package org.locationtech.geomesa.kudu.tools.status

import com.beust.jcommander.Parameters
import org.locationtech.geomesa.kudu.data.KuduDataStore
import org.locationtech.geomesa.kudu.tools.KuduDataStoreCommand
import org.locationtech.geomesa.kudu.tools.KuduDataStoreCommand.KuduParams
import org.locationtech.geomesa.kudu.tools.status.KuduGetSftConfigCommand.KuduGetSftConfigParameters
import org.locationtech.geomesa.tools.status.{GetSftConfigCommand, GetSftConfigParams}

class KuduGetSftConfigCommand extends GetSftConfigCommand[KuduDataStore] with KuduDataStoreCommand {
  override val params = new KuduGetSftConfigParameters
}

object KuduGetSftConfigCommand {
  @Parameters(commandDescription = "Get the SimpleFeatureType definition of a schema")
  class KuduGetSftConfigParameters extends GetSftConfigParams with KuduParams
}


text:
package org.apache.eagle.storage.jdbc.conn;

/**
 * An interface for abstract StatementExecutor from detailed implementation
 *
 * @since 3/29/15
 */
public interface StatementExecutor {
    /**
     * Initialize statement for action like SELECT
     *
     * @param config
     */
    void init(ConnectionConfig config);

    /**
     * Initialize statement for action like CREATE, UPDATE, DELETE which need table name
     *
     * @param config connection config
     * @param tableName
     */
    void init(ConnectionConfig config,String tableName);
    /**
     * @return customized primary key builder if no built-in primary key generation method like auto-increment and so on.
     */
    PrimaryKeyBuilder<String> getPrimaryKeyBuilder();
}


text:
'use strict';

var isObject = require('lodash.isobject');
var parseInt = require('lodash.parseint');

exports = module.exports = function (val, max) {
  val = isObject(val) ? NaN : parseInt(val.toString());

  return !isNaN(val) && val >= max;
};

exports.message = 'is too big';


text:
class AddImage
  include ActiveModel::Validations
  attr_reader :image, :application_id, :group_id, :item_id

  validates :image, presence: true
  validates :application_id, presence: true
  validates :group_id, presence: true, numericality: true
  validates :item_id, presence: true, numericality: true

  def initialize(params)
    @image = params[:image]
    @application_id = params[:application_id]
    @group_id = params[:group_id]
    @item_id = params[:item_id]
  end

  def upload!
    if valid?
      copy_image
      convert_image
      true
    else
      false
    end
  end

  def filepath
    File.join(basepath, filename)
  end

  def image_set
    @image_set ||= ImageSet.new(filepath)
  end

  private
    def filename
      image.original_filename
    end

    def basepath
      File.join(application_path, group_path, item_path)
    end

    def application_path
      application_id
    end

    def group_path
      id_partition(group_id)
    end

    def item_path
      id_partition(item_id)
    end

    def id_partition(id)
      ("%06d" % id).scan(/\d{3}/).join("/")
    end

    def copy_image
      CopyImage.call(image, image_set)
    end

    def convert_image
      ConvertImage.call(image_set)
    end
end


text:
Polipo configurations:

```
# config file for polipo @ ~/.polipo

proxyAddress = "0.0.0.0"
proxyPort = 8119
allowedClients = 127.0.0.1, 10.0.1.0/24
allowedPorts = 1-65535
tunnelAllowedPorts = 1-65535
proxyName = "localhost"
cacheIsShared = false
socksParentProxy = "127.0.0.1:8080"
socksProxyType = socks5
# chunkHighMark = 33554432
# diskCacheRoot = ""
# localDocumentRoot = ""
disableLocalInterface = true
disableConfiguration = true
dnsUseGethostbyname = yes
disableVia = true
censoredHeaders = from,accept-language,x-pad,link
censorReferer = maybe
# maxConnectionAge = 5m
# maxConnectionRequests = 120
# serverMaxSlots = 8
# serverSlots = 2
```

## Reload Polipo

```
launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.polipo.plist
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.polipo.plist
```

## Emtpy Polipo cache via Cron

```
0 5,16 * * * bash ~/Dropbox/Mac/Backups/Scripts/cleanup-polipo.sh
```

In `cleanup-polipo.sh`:

```bash
# MAILTO=""
# Run everyday at 5:00 AM and 4:00 PM
# 0 5,16 * * * bash ~/Documents/Backups/Scripts/cleanup-polipo.sh
# 0 5,16 * * * bash ~/Dropbox/Mac/Backups/Scripts/cleanup-polipo.sh

polipo -x
```

## References

- Source: http://bao3.blogspot.jp/2012/01/apn-proxy-apn.html


text:
'use strict';

const Npo = require('../model/npo');

module.exports = exports = {};

exports.createNpo = function(body, user) {

  body.userID = user._id;
  return new Npo(body).save()
  .then(npo => npo)
  .catch(err => body.status(err.status).send(err.message));
};

exports.fetchNpo = function(id, res) {

  return Npo.findById(id)
  .then( npo => npo)
  .catch(err => res.status(err.status).send(err.message));
};

exports.fetchAllNpos = function(res) {
  return Npo.find()
  .then(npos => npos)
  .catch(err => res.status(err.status).send(err.message));
};

exports.updateNpo = function(req, res, id) {
  return Npo.findByIdAndUpdate(id, req.body, {new:true})
  .then(npo => npo)
  .catch(err => res.status(err.status).send(err.message));
};

exports.deleteNpo = function(req,res, id) {
  Npo.findByIdAndRemove(id)
  .then(() => res.status(204).send())
  .catch(err => res.send(err.message));
};


text:
@implementation UILabel (NERChainable)

- (NERChainableUILabelObjectBlock)str {
    NER_OBJECT_BLOCK([NERUtils setTextWithStringObject:value forView:self]);
}

- (NERChainableUILabelObjectBlock)fnt {
    NER_OBJECT_BLOCK(self.font = Fnt(value));
}

- (NERChainableUILabelObjectBlock)color {
    NER_OBJECT_BLOCK(self.textColor = Color(value));
}

- (NERChainableUILabelObjectBlock)highColor {
    NER_OBJECT_BLOCK(self.highlightedTextColor = Color(value));
}

- (NERChainableUILabelIntBlock)lines {
    NER_INT_BLOCK(self.numberOfLines = value);
}

- (NERChainableUILabelFloatBlock)lineGap {
    NER_FLOAT_BLOCK(self.nerLineGap = value);
}

- (NERChainableUILabelFloatBlock)preferWidth {
    NER_FLOAT_BLOCK(self.preferredMaxLayoutWidth = value);
}

- (NERChainableUILabelCallbackBlock)onLink {
    NER_CALLBACK_BLOCK(
                       self.userInteractionEnabled = YES;

                       if (NER_IS_BLOCK(object)) {
                           self.nerLinkHandler = object;

                       } else {
                           self.nerLinkHandler = ^(id text, NSRange range) {
                               id rangeValue = [NSValue valueWithRange:range];
                               SEL action = NSSelectorFromString(object);
                               [weakTarget performSelector:action withObject:text withObject:rangeValue];
                           };
                       }
                       );
}

- (instancetype)multiline {
    self.numberOfLines = 0;
    return self;
}

- (instancetype)leftAlignment {
    self.textAlignment = NSTextAlignmentLeft;
    return self;
}

- (instancetype)centerAlignment {
    self.textAlignment = NSTextAlignmentCenter;
    return self;
}

- (instancetype)rightAlignment {
    self.textAlignment = NSTextAlignmentRight;
    return self;
}

- (instancetype)justifiedAlignment {
    self.textAlignment = NSTextAlignmentJustified;
    return self;
}

@end


text:
import React from 'react';
import Layout from '../../components/Layout';
import RegisterStudent from './RegisterStudent';

const title = 'EdHunter - Регистрация для студентов';

function action() {
  return {
    chunks: ['student'],
    title,
    component: (
      <Layout>
        <RegisterStudent title={title} />
      </Layout>
    ),
  };
}

export default action;


text:
package io.freefair.gradle.plugin.codegenerator;

import org.gradle.api.Plugin;
import org.gradle.api.Project;
import org.gradle.api.artifacts.Configuration;
import org.gradle.api.file.Directory;
import org.gradle.api.plugins.JavaPlugin;
import org.gradle.api.plugins.JavaPluginExtension;
import org.gradle.api.provider.Provider;
import org.gradle.api.tasks.TaskProvider;

import java.io.File;

/**
 * @author Dennis Fricke
 * @author Lars Grefer
 */
public class CodeGeneratorPlugin implements Plugin<Project> {

    @Override
    public void apply(Project project) {
        CodeGeneratorConfiguration codeGenerator = project.getExtensions().create("codeGenerator", CodeGeneratorConfiguration.class, project.getObjects());
        Configuration codeGeneratorConfiguration = project.getConfigurations().create("codeGenerator");

        project.getPlugins().apply(JavaPlugin.class);

        JavaPluginExtension plugin = project.getExtensions().getByType(JavaPluginExtension.class);
        plugin.getSourceSets().all(sourceSet -> {
            String outputDir = "generated/sources/codeGenerator/java/" + sourceSet.getName();
            Provider<Directory> outputDirFile = project.getLayout().getBuildDirectory().dir(outputDir);
            project.getLogger().debug("Using output dir {}", outputDir);

            File inputDir = new File(project.getProjectDir() + "/src/code-generator/" + sourceSet.getName());
            sourceSet.getJava().srcDir(inputDir);
            sourceSet.getJava().srcDir(outputDirFile);

            project.getLogger().debug("Using input dir {}", inputDir);

            String taskName = sourceSet.getTaskName("generate", "Code");

            TaskProvider<GenerateCodeTask> generate = project.getTasks().register(taskName, GenerateCodeTask.class, s -> {
                s.setGroup("generate");
                s.getOutputDir().set(outputDirFile);
                if (inputDir.isDirectory()) {
                    s.getInputDir().set(inputDir);
                }
                s.getSourceSet().set(sourceSet.getName());
                s.getCodeGeneratorClasspath().from(codeGeneratorConfiguration);
                s.getConfigurationValues().set(codeGenerator.getConfigurationValues());
                s.dependsOn(codeGeneratorConfiguration);
            });
            project.getTasks().named(sourceSet.getCompileJavaTaskName(), t -> t.dependsOn(generate));
        });
    }
}


text:
from numba import cuda, njit
from numba.core.extending import overload
from numba.cuda.testing import CUDATestCase, skip_on_cudasim, unittest

import numpy as np

# Dummy function definitions to overload

def generic_func_1():
    pass

def cuda_func_1():
    pass

def generic_func_2():
    pass

def cuda_func_2():
    pass

def generic_calls_generic():
    pass

def generic_calls_cuda():
    pass

def cuda_calls_generic():
    pass

def cuda_calls_cuda():
    pass

def target_overloaded():
    pass

def generic_calls_target_overloaded():
    pass

def cuda_calls_target_overloaded():
    pass

def target_overloaded_calls_target_overloaded():
    pass

# To recognise which functions are resolved for a call, we identify each with a
# prime number. Each function called multiplies a value by its prime (starting
# with the value 1), and we can check that the result is as expected based on
# the final value after all multiplications.

GENERIC_FUNCTION_1 = 2
CUDA_FUNCTION_1 = 3
GENERIC_FUNCTION_2 = 5
CUDA_FUNCTION_2 = 7
GENERIC_CALLS_GENERIC = 11
GENERIC_CALLS_CUDA = 13
CUDA_CALLS_GENERIC = 17
CUDA_CALLS_CUDA = 19
GENERIC_TARGET_OL = 23
CUDA_TARGET_OL = 29
GENERIC_CALLS_TARGET_OL = 31
CUDA_CALLS_TARGET_OL = 37
GENERIC_TARGET_OL_CALLS_TARGET_OL = 41
CUDA_TARGET_OL_CALLS_TARGET_OL = 43

# Overload implementations

@overload(generic_func_1, target='generic')
def ol_generic_func_1(x):
    def impl(x):
        x[0] *= GENERIC_FUNCTION_1
    return impl

@overload(cuda_func_1, target='cuda')
def ol_cuda_func_1(x):
    def impl(x):
        x[0] *= CUDA_FUNCTION_1
    return impl

@overload(generic_func_2, target='generic')
def ol_generic_func_2(x):
    def impl(x):
        x[0] *= GENERIC_FUNCTION_2
    return impl

@overload(cuda_func_2, target='cuda')
def ol_cuda_func(x):
    def impl(x):
        x[0] *= CUDA_FUNCTION_2
    return impl

@overload(generic_calls_generic, target='generic')
def ol_generic_calls_generic(x):
    def impl(x):
        x[0] *= GENERIC_CALLS_GENERIC
        generic_func_1(x)
    return impl

@overload(generic_calls_cuda, target='generic')
def ol_generic_calls_cuda(x):
    def impl(x):
        x[0] *= GENERIC_CALLS_CUDA
        cuda_func_1(x)
    return impl

@overload(cuda_calls_generic, target='cuda')
def ol_cuda_calls_generic(x):
    def impl(x):
        x[0] *= CUDA_CALLS_GENERIC
        generic_func_1(x)
    return impl

@overload(cuda_calls_cuda, target='cuda')
def ol_cuda_calls_cuda(x):
    def impl(x):
        x[0] *= CUDA_CALLS_CUDA
        cuda_func_1(x)
    return impl

@overload(target_overloaded, target='generic')
def ol_target_overloaded_generic(x):
    def impl(x):
        x[0] *= GENERIC_TARGET_OL
    return impl

@overload(target_overloaded, target='cuda')
def ol_target_overloaded_cuda(x):
    def impl(x):
        x[0] *= CUDA_TARGET_OL
    return impl

@overload(generic_calls_target_overloaded, target='generic')
def ol_generic_calls_target_overloaded(x):
    def impl(x):
        x[0] *= GENERIC_CALLS_TARGET_OL
        target_overloaded(x)
    return impl

@overload(cuda_calls_target_overloaded, target='cuda')
def ol_cuda_calls_target_overloaded(x):
    def impl(x):
        x[0] *= CUDA_CALLS_TARGET_OL
        target_overloaded(x)
    return impl

@overload(target_overloaded_calls_target_overloaded, target='generic')
def ol_generic_calls_target_overloaded_generic(x):
    def impl(x):
        x[0] *= GENERIC_TARGET_OL_CALLS_TARGET_OL
        target_overloaded(x)
    return impl

@overload(target_overloaded_calls_target_overloaded, target='cuda')
def ol_generic_calls_target_overloaded_cuda(x):
    def impl(x):
        x[0] *= CUDA_TARGET_OL_CALLS_TARGET_OL
        target_overloaded(x)
    return impl

@skip_on_cudasim('Overloading not supported in cudasim')
class TestOverload(CUDATestCase):
    def check_overload(self, kernel, expected):
        x = np.ones(1, dtype=np.int32)
        cuda.jit(kernel)[1, 1](x)
        self.assertEqual(x[0], expected)

    def check_overload_cpu(self, kernel, expected):
        x = np.ones(1, dtype=np.int32)
        njit(kernel)(x)
        self.assertEqual(x[0], expected)

    def test_generic(self):
        def kernel(x):
            generic_func_1(x)

        expected = GENERIC_FUNCTION_1
        self.check_overload(kernel, expected)

    def test_cuda(self):
        def kernel(x):
            cuda_func_1(x)

        expected = CUDA_FUNCTION_1
        self.check_overload(kernel, expected)

    def test_generic_and_cuda(self):
        def kernel(x):
            generic_func_1(x)
            cuda_func_1(x)

        expected = GENERIC_FUNCTION_1 * CUDA_FUNCTION_1
        self.check_overload(kernel, expected)

    def test_call_two_generic_calls(self):
        def kernel(x):
            generic_func_1(x)
            generic_func_2(x)

        expected = GENERIC_FUNCTION_1 * GENERIC_FUNCTION_2
        self.check_overload(kernel, expected)

    def test_call_two_cuda_calls(self):
        def kernel(x):
            cuda_func_1(x)
            cuda_func_2(x)

        expected = CUDA_FUNCTION_1 * CUDA_FUNCTION_2
        self.check_overload(kernel, expected)

    def test_generic_calls_generic(self):
        def kernel(x):
            generic_calls_generic(x)

        expected = GENERIC_CALLS_GENERIC * GENERIC_FUNCTION_1
        self.check_overload(kernel, expected)

    def test_generic_calls_cuda(self):
        def kernel(x):
            generic_calls_cuda(x)

        expected = GENERIC_CALLS_CUDA * CUDA_FUNCTION_1
        self.check_overload(kernel, expected)

    def test_cuda_calls_generic(self):
        def kernel(x):
            cuda_calls_generic(x)

        expected = CUDA_CALLS_GENERIC * GENERIC_FUNCTION_1
        self.check_overload(kernel, expected)

    def test_cuda_calls_cuda(self):
        def kernel(x):
            cuda_calls_cuda(x)

        expected = CUDA_CALLS_CUDA * CUDA_FUNCTION_1
        self.check_overload(kernel, expected)

    def test_call_target_overloaded(self):
        def kernel(x):
            target_overloaded(x)

        expected = CUDA_TARGET_OL
        self.check_overload(kernel, expected)

    def test_generic_calls_target_overloaded(self):
        def kernel(x):
            generic_calls_target_overloaded(x)

        expected = GENERIC_CALLS_TARGET_OL * CUDA_TARGET_OL
        self.check_overload(kernel, expected)

    def test_cuda_calls_target_overloaded(self):
        def kernel(x):
            cuda_calls_target_overloaded(x)

        expected = CUDA_CALLS_TARGET_OL * CUDA_TARGET_OL
        self.check_overload(kernel, expected)

    def test_target_overloaded_calls_target_overloaded(self):
        def kernel(x):
            target_overloaded_calls_target_overloaded(x)

        # Check the CUDA overloads are used on CUDA
        expected = CUDA_TARGET_OL_CALLS_TARGET_OL * CUDA_TARGET_OL
        self.check_overload(kernel, expected)

        # Also check that the CPU overloads are used on the CPU
        expected = GENERIC_TARGET_OL_CALLS_TARGET_OL * GENERIC_TARGET_OL
        self.check_overload_cpu(kernel, expected)

if __name__ == '__main__':
    unittest.main()


text:
'use strict';

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

var _createBaseForm = require('./createBaseForm');

var _createBaseForm2 = _interopRequireDefault(_createBaseForm);

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

var mixin = exports.mixin = {
  getForm: function getForm() {
    return {
      getFieldsValue: this.getFieldsValue,
      getFieldValue: this.getFieldValue,
      getFieldInstance: this.getFieldInstance,
      setFieldsValue: this.setFieldsValue,
      setFields: this.setFields,
      setFieldsInitialValue: this.setFieldsInitialValue,
      getFieldDecorator: this.getFieldDecorator,
      getFieldProps: this.getFieldProps,
      getFieldsError: this.getFieldsError,
      getFieldError: this.getFieldError,
      isFieldValidating: this.isFieldValidating,
      isFieldsValidating: this.isFieldsValidating,
      isFieldsTouched: this.isFieldsTouched,
      isFieldTouched: this.isFieldTouched,
      isSubmitting: this.isSubmitting,
      submit: this.submit,
      validateFields: this.validateFields,
      resetFields: this.resetFields
    };
  }
};

function createForm(options) {
  return (0, _createBaseForm2["default"])(options, [mixin]);
}

exports["default"] = createForm;


text:
<?php

namespace Wedeto\Application;

/**
 * TerminateRequest is an instruction that the current script wants to
 * terminate the script. The constructor should provide a reason why
 * the script should terminate.
 */
final class TerminateRequest extends \Exception
{}


text:
@implementation FZRMutationFactory

+ (id <FZRMutation>)builtinDeleteNodeMutation {
    return [FZRDeleteNodeMutation new];
}

+ (NSArray *)builtinReplacementNodeMutations {
    NSArray *replacements = [FZRNodeReplacement builtinReplacements];
    NSMutableArray *mutations = [NSMutableArray arrayWithCapacity:replacements.count];

    for (FZRNodeReplacement *replacement in replacements) {
        id<FZRMutation> mutation = [self replaceNodeMutationWithReplacement:replacement];
        [mutations addObject:mutation];
    }

    return mutations.copy;
}

+ (NSArray <id <FZRMutation>> *)builtinMutations {
    NSArray *mutations = [FZRMutationFactory builtinReplacementNodeMutations];

    mutations = [mutations arrayByAddingObject:[FZRMutationFactory builtinDeleteNodeMutation]];

    return mutations;
}

+ (id <FZRMutation>)replaceNodeMutationWithReplacement:(FZRNodeReplacement *)replacement {
    return [FZRReplaceNodeMutation mutationWithReplacement:replacement];
}

@end


text:
namespace ngraph
{
    namespace onnx_import
    {
        namespace op
        {
            namespace set_1
            {
                OutputVector prelu(const Node& node);
            }
        }
    }
}


text:
<?php
/**
 * This file is part of the Commander project.
 *
 * @author Daniel Schröder <daniel.schroeder@gravitymedia.de>
 */

namespace Gravitymedia\CommanderTest\Console\Helper;

use GravityMedia\Commander\Console\Helper\ConfigLoaderHelper;
use GravityMedia\Commander\Console\Helper\ConfigLoaderHelperFactory;

/**
 * Config loader helper factory test class.
 *
 * @package GravityMedia\CommanderTest\Console\Helper
 *
 * @covers  GravityMedia\Commander\Console\Helper\ConfigLoaderHelperFactory
 * @uses    GravityMedia\Commander\Console\Helper\ConfigLoaderHelper
 * @uses    GravityMedia\Commander\Config\Loader
 * @uses    GravityMedia\Commander\Config\LoaderFactory
 * @uses    GravityMedia\Commander\Config\Serializer
 * @uses    GravityMedia\Commander\Config\SerializerFactory
 */
class ConfigLoaderHelperFactoryTest extends \PHPUnit_Framework_TestCase
{
    /**
     * Test that a config loader helper can be created.
     */
    public function testConfigLoaderHelperFactory()
    {
        $container = require __DIR__ . '/../../../../config/container.config.php';

        $factory = new ConfigLoaderHelperFactory();

        $this->assertInstanceOf(ConfigLoaderHelper::class, $factory->__invoke($container, ConfigLoaderHelper::class));
    }
}


text:
package com.iluwatar.combinator;

import org.junit.Test;

import static org.junit.Assert.*;

public class CombinatorAppTest {

  @Test
  public void main() {
    CombinatorApp.main(new String[]{});
  }
}


text:
<?xml version="1.0"?>
<exslt:function xmlns:exslt="http://exslt.org/documentation"
                version="1" module="set" status="stable">

<exslt:name>leading</exslt:name>

<rdf:Description xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
                 xmlns:dc="http://purl.org/dc/elements/1.1/"
                 ID="set:leading">
   <dc:subject>EXSLT</dc:subject>
   <dc:subject>set</dc:subject>
   <dc:subject>leading</dc:subject>
   <dc:rights>public domain</dc:rights>
   <exslt:revision>
      <rdf:Description xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
                       xmlns:dc="http://purl.org/dc/elements/1.1/"
                       ID="set:leading.1">
         <exslt:version>1</exslt:version>
         <dc:creator email="mail@jenitennison.com"
                     url="http://www.jenitennison.com">Jeni Tennison</dc:creator>
         <dc:date>2001-03-28</dc:date>
         <dc:description>Returns the nodes in one node set that come before a particular node.</dc:description>
      </rdf:Description>
   </exslt:revision>
   <exslt:revision>
      <rdf:Description xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
                       xmlns:dc="http://purl.org/dc/elements/1.1/"
                       ID="set:leading.1.1">
         <exslt:version>1.1</exslt:version>
         <dc:creator email="mail@jenitennison.com"
                     url="http://www.jenitennison.com">Jeni Tennison</dc:creator>
         <dc:date>2001-05-08</dc:date>
         <dc:description>Added a description of how the template-equivalent to the function works.</dc:description>
      </rdf:Description>
   </exslt:revision>
   <exslt:revision>
      <rdf:Description xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
                       xmlns:dc="http://purl.org/dc/elements/1.1/"
                       ID="set:leading.1.2">
         <exslt:version>1.2</exslt:version>
         <dc:creator email="mail@jenitennison.com"
                     url="http://www.jenitennison.com">Jeni Tennison</dc:creator>
         <dc:date>2001-05-22</dc:date>
         <dc:description xmlns="http://www.w3.org/1999/xhtml">

Added vendor implementations in Saxon and 4XSLT

Changed status to stable

         </dc:description>
      </rdf:Description>
   </exslt:revision>
   <exslt:revision>
      <rdf:Description xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
                       xmlns:dc="http://purl.org/dc/elements/1.1/"
                       ID="set:leading.1.3">
         <exslt:version>1.3</exslt:version>
         <dc:creator email="mail@jenitennison.com"
                     url="http://www.jenitennison.com">Jeni Tennison</dc:creator>
         <dc:date>2001-06-11</dc:date>
         <dc:description xmlns="http://www.w3.org/1999/xhtml">
            Added vendor implementation in jd.xslt.
         </dc:description>
      </rdf:Description>
   </exslt:revision>
   <exslt:revision>
      <rdf:Description xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
                       xmlns:dc="http://purl.org/dc/elements/1.1/"
                       ID="set:leading.1.4">
         <exslt:version>1.4</exslt:version>
         <dc:creator email="mail@jenitennison.com"
                     url="http://www.jenitennison.com">Jeni Tennison</dc:creator>
         <dc:date>2001-08-23</dc:date>
         <dc:description xmlns="http://www.w3.org/1999/xhtml">
            Added vendor implementation in libxslt.
         </dc:description>
      </rdf:Description>
   </exslt:revision>
   <exslt:revision>
      <rdf:Description xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
                       xmlns:dc="http://purl.org/dc/elements/1.1/"
                       ID="set:leading.1.5">
         <exslt:version>1.5</exslt:version>
         <dc:creator email="craig.stewart@nottingham.ac.uk"
                     url="">Craig Stewart</dc:creator>
         <dc:date>2002-08-20</dc:date>
         <dc:description xmlns="http://www.w3.org/1999/xhtml">Added Xalan-J implementation to the list.</dc:description>
      </rdf:Description>
   </exslt:revision>
   <exslt:revision>
      <rdf:Description xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
                       xmlns:dc="http://purl.org/dc/elements/1.1/"
                       ID="set:leading.1.6">
         <exslt:version>1.6</exslt:version>
         <dc:creator email="craig.stewart@nottingham.ac.uk"
                     url="">Craig Stewart</dc:creator>
         <dc:date>2002-11-12</dc:date>
         <dc:description xmlns="http://www.w3.org/1999/xhtml">Updated 4XSLT version to 0.12.0a3.</dc:description>
      </rdf:Description>
   </exslt:revision>
</rdf:Description>

<exslt:doc xmlns="">

      <para>
         The <function>set:leading</function> function returns the nodes in the node set passed as the first argument that precede, in document order, the first node in the node set passed as the second argument.  If the first node in the second node set is not contained in the first node set, then an empty node set is returned.  If the second node set is empty, then the first node set is returned.
      </para>
      <para>
         The <literal>set:leading</literal> template applies templates to these nodes in <literal>set:leading</literal> mode.  By default, the nodes are copied by this template, so that a result tree fragment consisting of the nodes is returned.
      </para>

</exslt:doc>

<exslt:definition>
   <exslt:return type="node-set" />
   <exslt:arg name="nodes" type="node-set" default="/.." />
   <exslt:arg name="node" type="node-set" default="/.." />
</exslt:definition>

<exslt:implementations>
   <exslt:vendor-implementation
           version="1"
           vendor="4XSLT, from 4Suite."
           vendor-url="http://4Suite.org"
           vendor-version="0.12.0a3" />
   <exslt:vendor-implementation
           version="1"
           vendor="SAXON from Michael Kay"
           vendor-url="http://users.iclway.co.uk/mhkay/saxon/index.html"
           vendor-version="6.3" />
   <exslt:vendor-implementation
           version="1"
           vendor="jd.xslt from Johannes Döbler"
           vendor-url="http://www.aztecrider.com/xslt/"
           vendor-version="1.0.9" />
   <exslt:vendor-implementation
           version="1"
           vendor="libxslt from Daniel Veillard; implementation by Thomas Broyer"
           vendor-url="http://xmlsoft.org/XSLT/"
           vendor-version="1.0.19" />
   <exslt:vendor-implementation
           version="1"
           vendor="Xalan-J from Apache"
           vendor-url="http://xml.apache.org/xalan-j"
           vendor-version="2.4.D1" />
   <exslt:implementation language="exslt:xslt" version="1" src="set.leading.template.xsl" />
   <exslt:implementation language="exslt:exslt" version="1" src="set.leading.function.xsl" />
</exslt:implementations>

<exslt:use-cases>
   <exslt:use-case type="example" data="set.leading.data.1.xml"
                   xslt="set.leading.1.xsl"
                   result="set.leading.result.1.xml">
      <rdf:Description xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
                       xmlns:dc="http://purl.org/dc/elements/1.1/"
                       ID="set:leading.use-case.1">
         <dc:subject>EXSLT</dc:subject>
         <dc:subject>sets</dc:subject>
         <dc:subject>leading</dc:subject>
         <dc:subject>use case</dc:subject>
         <exslt:revision>
            <rdf:Description xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
                             xmlns:dc="http://purl.org/dc/elements/1.1/"
                             ID="set:leading.use-case.1.1">
               <exslt:version>1</exslt:version>
               <dc:creator email="mhkay@iclway.co.uk">Mike Kay</dc:creator>
               <dc:date>2001-04-28</dc:date>
               <dc:description>Tests functionality of set:leading().</dc:description>
            </rdf:Description>
         </exslt:revision>
      </rdf:Description>
   </exslt:use-case>
</exslt:use-cases>

</exslt:function>