text:
package io.fabric8.maven.docker.model;

import java.time.Instant;
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;

import com.google.common.base.Joiner;
import com.google.gson.JsonObject;

public class ContainerDetails implements Container {

    static final String CONFIG = "Config";
    static final String CREATED = "Created";
    static final String HOST_IP = "HostIp";
    static final String HOST_PORT = "HostPort";
    static final String ID = "Id";
    static final String IMAGE = "Image";
    static final String LABELS = "Labels";
    static final String NAME = "Name";
    static final String IP = "IPAddress";
    static final String HOST_CONFIG = "HostConfig";
    static final String NETWORK_MODE = "NetworkMode";
    static final String NETWORK_SETTINGS = "NetworkSettings";
    static final String NETWORKS = "Networks";
    static final String PORTS = "Ports";
    static final String SLASH = "/";
    static final String STATE = "State";
    static final String HEALTH = "Health";
    static final String STATUS = "Status";
    static final String HEALTH_STATUS_HEALTHY = "healthy";
    static final String HEALTHCHECK = "Healthcheck";
    static final String TEST = "Test";

    private static final String EXIT_CODE = "ExitCode";
    private static final String RUNNING = "Running";

    private final JsonObject json;

    public ContainerDetails(JsonObject json) {
        this.json = json;
    }

    @Override
    public long getCreated() {
        String date = json.get(CREATED).getAsString();
        Instant instant = Instant.parse(date);
        return instant.toEpochMilli();
    }

    @Override
    public String getId() {
        // only need first 12 to id a container
        return json.get(ID).getAsString().substring(0, 12);
    }

    @Override
    public String getImage() {
        // ID: json.getString("Image");
        return json.getAsJsonObject(CONFIG).get(IMAGE).getAsString();
    }

    @Override
    public Map<String, String> getLabels() {
        JsonObject config = json.getAsJsonObject(CONFIG);
        return config.has(LABELS) ?
                mapLabels(config.getAsJsonObject(LABELS)) :
                Collections.<String, String>emptyMap();
    }

    @Override
    public String getName() {
        String name = json.get(NAME).getAsString();

        if (name.startsWith(SLASH)) {
            name = name.substring(1);
        }
        return name;
    }

    @Override
    public String getIPAddress() {
        if (json.has(NETWORK_SETTINGS) && !json.get(NETWORK_SETTINGS).isJsonNull()) {
            JsonObject networkSettings = json.getAsJsonObject(NETWORK_SETTINGS);
            if (!networkSettings.get(IP).isJsonNull()) {
                return networkSettings.get(IP).getAsString();
            }
        }
        return null;
    }

		@Override
		public String getNetworkMode() {
			if (json.has(HOST_CONFIG) && !json.get(HOST_CONFIG).isJsonNull()) {
				final JsonObject hostConfig = json.getAsJsonObject(HOST_CONFIG);
				if (!hostConfig.get(NETWORK_MODE).isJsonNull()) {
          return hostConfig.get(NETWORK_MODE).getAsString();
				}
			}
			return null;
		}

    @Override
    public Map<String, String> getCustomNetworkIpAddresses() {
        if (json.has(NETWORK_SETTINGS) && !json.get(NETWORK_SETTINGS).isJsonNull()) {
            JsonObject networkSettings = json.getAsJsonObject(NETWORK_SETTINGS);
            if (networkSettings.has(NETWORKS) && !networkSettings.get(NETWORKS).isJsonNull()) {
                return extractNetworks(networkSettings);
            }
        }
        return null;
    }

    private Map<String, String> extractNetworks(JsonObject networkSettings) {
        JsonObject networks = networkSettings.getAsJsonObject(NETWORKS);
        Set<String> keys = networks.keySet();
        if (keys == null || keys.isEmpty()) {
            return null;
        }
        Map<String, String> results = new HashMap<>();
        for (String key : keys) {
            JsonObject net = networks.getAsJsonObject(key);
            if (net.has(IP) && !net.get(IP).isJsonNull()) {
                results.put(key, net.get(IP).getAsString());
            }
        }

        return results;
    }

    @Override
    public Map<String, PortBinding> getPortBindings() {
        if (json.has(NETWORK_SETTINGS) && !json.get(NETWORK_SETTINGS).isJsonNull()) {
            JsonObject networkSettings = json.getAsJsonObject(NETWORK_SETTINGS);
            if (networkSettings.has(PORTS) && !networkSettings.get(PORTS).isJsonNull()) {
                return createPortBindings(networkSettings.getAsJsonObject(PORTS));
            }
        }

        return new HashMap<>();
    }

    @Override
    public boolean isRunning() {
        JsonObject state = json.getAsJsonObject(STATE);
        return state.get(RUNNING).getAsBoolean();
    }

    @Override
    public Integer getExitCode() {
        if (isRunning()) {
            return null;
        }
        JsonObject state = json.getAsJsonObject(STATE);
        return state.get(EXIT_CODE).getAsInt();
    }

    public boolean isHealthy() {
        final JsonObject state = json.getAsJsonObject(STATE);
        // always indicate healthy for docker hosts that do not support health checks.
        return !state.has(HEALTH) || HEALTH_STATUS_HEALTHY.equals(state.getAsJsonObject(HEALTH).get(STATUS).getAsString());
    }

    public String getHealthcheck() {
        if (!json.getAsJsonObject(CONFIG).has(HEALTHCHECK) ||
            !json.getAsJsonObject(CONFIG).getAsJsonObject(HEALTHCHECK).has(TEST)) {
            return null;
        }

        return Joiner.on(", ").join(json.getAsJsonObject(CONFIG).getAsJsonObject(HEALTHCHECK).getAsJsonArray(TEST));
    }

    private void addPortMapping(String port, JsonObject hostConfig, Map<String, PortBinding> portBindings) {
        String hostIp = hostConfig.get(HOST_IP).getAsString();
        Integer hostPort = Integer.valueOf(hostConfig.get(HOST_PORT).getAsInt());

        addPortMapping(port, new PortBinding(hostPort, hostIp), portBindings);
    }

    private void addPortMapping(String port, PortBinding binding, Map<String, PortBinding> portBindings) {
        if (port.indexOf('/') == -1) {
            port = port + "/tcp";
        }

        portBindings.put(port, binding);
    }

    private Map<String, PortBinding> createPortBindings(JsonObject ports) {
        Map<String, PortBinding> portBindings = new HashMap<>();

        for (Object obj : ports.keySet()) {
            String port = obj.toString();
            if (ports.get(port).isJsonNull()) {
                addPortMapping(port, (PortBinding) null, portBindings);
            } else {
                // use the first entry in the array
                JsonObject hostConfig = ports.getAsJsonArray(port).get(0).getAsJsonObject();
                addPortMapping(port, hostConfig, portBindings);
            }
        }

        return portBindings;
    }

    private Map<String, String> mapLabels(JsonObject labels) {
        int length = labels.size();
        Map<String, String> mapped = new HashMap<>(length);

        Iterator<String> iterator = labels.keySet().iterator();
        while (iterator.hasNext()) {
            String key = iterator.next();
            mapped.put(key, labels.get(key).getAsString());
        }

        return mapped;
    }
}


text:
import os

try:
    HOME = os.environ['HOME']
except KeyError:
    HOME = os.environ['HOMEDRIVE']

# set the image save directory
IMAGE_FILE_DIR = os.path.join(HOME, 'images')

# set the request config
REQ_TIMEOUT = 25

START_PAGE = 650 # when set this you should go to jiandan.com to see the max tab value
PAGE_DELTA = 10

# set jiandan http concurrent load
HTTP_CONCURRENT_LOAD = 1000 # no more than 1024

redpajama_set_name: RedPajamaGithub


text:
<?php
    $title = "Love Butter";
    $desc = "Giddy YoYo, Your source for the best in Organic foods, chocolate and sprouts. Our Cacao is 100% raw and brought all the way from Ecuador.";
    $can = "http://www.giddyyoyo.com/";
    $robots = "index, follow, noodp, noydir";
    $page = "Love Butter";
    $background = "love-butter-large.jpg";

include('includes/header.php'); ?>

Raw Love Butter

Previous Page

For whatever
               you're into.

Our Raw Love Butter is a full body moisturizer that easily absorbs into the skin and smells like chocolate - Yum!

Perfect for use all year-round; from effectively moisturizing dry, cracked skin in the cold winter months, to post summer sun moisturizing- soothing and healing those inevitable sunburns... Giddy's got you covered! It melts easily at body temperature and has a silky/creamy consistency making it perfectfor use as a massage oil and lubricant**. Spread it on and get it on!

Raw edible Moisturizer, Lubricant, Massage Oil & Sunscreen

Important Facts:

Raw, edible, organic and vegan body lotion.

Skin and hair moisturizer

Low SPF Sunscreen and after-sun moisturizer

Massage oil and personal lubricant

Etc...

Ingredients: Certified Organic GY Cacao Butter, Certified Organic Coconut Oil, Rallis Certified Organic "Ice Pressed "Olive Oil, Raw Ground Vanilla Beans.

**WARNING - Because this is an oil based lubricant it maycompromise the integrity of condoms.

Next Page

<?php include('includes/footer.php'); ?>


text:
*range* is a command line program run from a shell like Bash. You can find compiled
version in the [releases](https://github.com/rsdoiel/range/releases/latest)
in the Github repository in a zip file named *range-binary-release.zip*. Inside
the zip file look for the directory that matches your computer and copy that someplace
defined in your path (e.g. $HOME/bin).

Compiled versions are available for Mac OS X (amd64 processor), Linux (amd64), Windows
(amd64) and Rapsberry Pi (both ARM6 and ARM7)

## Mac OS X

1. Go to [github.com/rsdoiel/range/releases/latest](https://github.com/rsdoiel/range/releases/latest)
2. Click on the green "range-binary-release.zip" link and download
3. Open a finder window and find the downloaded file and unzip it (e.g. range-binary-release.zip)
4. Look in the unziped folder and find dist/macosx-amd64/range
5. Drag (or copy) the *range* to a "bin" directory in your path
6. Open and "Terminal" and run `range -h`

## Windows

1. Go to [github.com/rsdoiel/range/releases/latest](https://github.com/rsdoiel/range/releases/latest)
2. Click on the green "range-binary-release.zip" link and download
3. Open the file manager find the downloaded file and unzip it (e.g. range-binary-release.zip)
4. Look in the unziped folder and find dist/windows-amd64/range.exe
5. Drag (or copy) the *range.exe* to a "bin" directory in your path
6. Open Bash and and run `range -h`

## Linux

1. Go to [github.com/rsdoiel/range/releases/latest](https://github.com/rsdoiel/range/releases/latest)
2. Click on the green "range-binary-release.zip" link and download
3. find the downloaded zip file and unzip it (e.g. unzip ~/Downloads/range-binary-release.zip)
4. In the unziped directory and find for dist/linux-amd64/range
5. copy the *range* to a "bin" directory (e.g. cp ~/Downloads/range-binary-release/dist/linux-amd64/range ~/bin/)
6. From the shell prompt run `range -h`

## Raspberry Pi

If you are using a Raspberry Pi 2 or later use the ARM7 binary, ARM6 is only for the first generaiton Raspberry Pi.

1. Go to [github.com/rsdoiel/range/releases/latest](https://github.com/rsdoiel/range/releases/latest)
2. Click on the green "range-binary-release.zip" link and download
3. find the downloaded zip file and unzip it (e.g. unzip ~/Downloads/range-binary-release.zip)
4. In the unziped directory and find for dist/raspberrypi-arm7/range
5. copy the *range* to a "bin" directory (e.g. cp ~/Downloads/range-binary-release/dist/raspberrypi-arm7/range ~/bin/)
    + if you are using an original Raspberry Pi you should copy the ARM6 version instead
6. From the shell prompt run `range -h`


text:
namespace BrowserAutomationStudioFramework
{
    class ENGINESHARED_EXPORT Helper : public IHelper
    {
        Q_OBJECT
    public:
        explicit Helper(QObject *parent = 0);

    signals:

    public slots:
        virtual QString md5(const QString& data);
        virtual QString base64_encode(const QString& data);
        virtual QString base64_decode(const QString& data);
        virtual QString file_read(const QString& filename);
        virtual QString file_read_base64(const QString& filename);
        virtual void file_write_base64(const QString& filename, const QString& data);
        virtual void file_append_base64(const QString& filename, const QString& data);
        virtual void file_write(const QString& filename, const QString& data);
        virtual void file_append(const QString& filename, const QString& data);
        virtual void directory_create(const QString& dir);

        virtual QString directory_of(const QString& file);
        virtual QString filename_of(const QString& file);
        virtual QString combine_path(const QString& path1,const QString& path2);
        virtual QString encode_string(const QString& string,const QString& codec);
        virtual QList<int> image_get_dimension(const QString& image_data_base64);
        virtual QString image_central_crop(const QString& image_data_base64, int x, int y);
        virtual QString date_format(const QDateTime& date, const QString & format);

        virtual QString oauth1_header(const QString& auth_token,const QString& consumer_secret_key, const QString& consumer_public_key, const QString& url, const QString& method, const QString& realm, QVariantMap params);
    };
}

#endif // HELPER_H


text:
package org.quartz.classloading;

import java.io.InputStream;
import java.lang.reflect.AccessibleObject;
import java.lang.reflect.Method;
import java.net.URL;

/**
 * A ClassLoadHelper that simply calls Class.forName(..).
 *
 * @see org.quartz.classloading.ClassLoadHelper
 * @see org.quartz.classloading.ThreadContextClassLoadHelper
 * @see org.quartz.classloading.CascadingClassLoadHelper
 * @see org.quartz.classloading.LoadingLoaderClassLoadHelper
 * @author jhouse
 * @author pl47ypus
 */
class SimpleClassLoadHelper implements ClassLoadHelper {

  /*
   * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Interface.
   * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   */

  /**
   * Called to give the ClassLoadHelper a chance to initialize itself, including the opportunity to "steal" the class loader off of the calling
   * thread, which is the thread that is initializing Quartz.
   */
  @Override
  public void initialize() {

  }

  /**
   * Return the class with the given name.
   */
  @Override
  public Class loadClass(String name) throws ClassNotFoundException {

    return Class.forName(name);
  }

  /**
   * Finds a resource with a given name. This method returns null if no resource with this name is found.
   *
   * @param name name of the desired resource
   * @return a java.net.URL object
   */
  @Override
  public URL getResource(String name) {

    return getClassLoader().getResource(name);
  }

  /**
   * Finds a resource with a given name. This method returns null if no resource with this name is found.
   *
   * @param name name of the desired resource
   * @return a java.io.InputStream object
   */
  @Override
  public InputStream getResourceAsStream(String name) {

    return getClassLoader().getResourceAsStream(name);
  }

  /**
   * Enable sharing of the class-loader with 3rd party.
   *
   * @return the class-loader user be the helper.
   */
  @Override
  public ClassLoader getClassLoader() {

    // To follow the same behavior of Class.forName(...) I had to play
    // dirty (Supported by Sun, IBM & BEA JVMs)
    try {
      // Get a reference to this class' class-loader
      ClassLoader cl = this.getClass().getClassLoader();
      // Create a method instance representing the protected
      // getCallerClassLoader method of class ClassLoader
      Method mthd = ClassLoader.class.getDeclaredMethod("getCallerClassLoader", new Class[0]);
      // Make the method accessible.
      AccessibleObject.setAccessible(new AccessibleObject[] { mthd }, true);
      // Try to get the caller's class-loader
      return (ClassLoader) mthd.invoke(cl, new Object[0]);
    } catch (Exception all) {
      // Use this class' class-loader
      return this.getClass().getClassLoader();
    }
  }

}


text:
<?php

declare(strict_types=1);

namespace Biplane\YandexDirect\Api\V5\Contract;

use AllowDynamicProperties;

/**
 * Auto-generated code.
 */
#[AllowDynamicProperties]
class Search
{
//    Can be omitted.
//    protected $Bid = null;

//    Can be omitted.
//    protected $AuctionBids = null;

    /**
     * @return static
     */
    public static function create()
    {
        return new static();
    }

    public function getBid(): ?int
    {
        return $this->Bid ?? null;
    }

    /**
     * @return $this
     */
    public function setBid(?int $value = null)
    {
        $this->Bid = $value;

        return $this;
    }

    public function getAuctionBids(): ?AuctionBids
    {
        return $this->AuctionBids ?? null;
    }

    /**
     * @return $this
     */
    public function setAuctionBids(?AuctionBids $value = null)
    {
        $this->AuctionBids = $value;

        return $this;
    }
}


text:
FILE(REMOVE_RECURSE
  "CMakeFiles/_run_tests_amcl_rostest"
)

# Per-language clean rules from dependency scanning.
FOREACH(lang)
  INCLUDE(CMakeFiles/_run_tests_amcl_rostest.dir/cmake_clean_${lang}.cmake OPTIONAL)
ENDFOREACH(lang)


text:
package pt.ist.rest.domain;

import pt.ist.rest.exception.core.invalidkey.InvalidDishException;

/**
 * Mantém o conjunto dos pratos encomendados por um cliente. Pode ser usada como um
 * registo de de uma determinada compra já feita (paga) por um cliente ou como tabuleiro
 * de compras, onde o cliente ainda não pagou o que pretende encomendar e pode alterar os
 * pratos já adicionados ao tabuleiro ou acrescentar novos. Cada compra possui um
 * identificador único.
 */
public class Compra extends
        Compra_Base {

    /**
     * Cria uma nova compra sem pratos associados à sua compra.
     *
     * @param id O id da compra.
     */
    public Compra(int id) {
        super();
        this.setId(id);
    }

    /**
     * Checks if is finalizada.
     *
     * @return true, if is finalizada
     */
    public boolean isFinalizada() {
        return getIsFinalizada();
    }

    /*
     * (non-Javadoc)
     *
     * @see pt.ist.rest.domain.Compra_Base#getTotalCompra()
     */
    @Override
    public int getTotalCompra() {
        if (this.isFinalizada()) {
            return super.getTotalCompra();
        } else {
            int total = 0;
            for (QuantidadePrato qP : this.getQuantidadePrato()) {
                total += qP.getPrecoTotal();
            }
            return total;
        }
    }

    /**
     * Finaliza a encomenda.
     */
    public void finalizaEncomenda() {
        if (!isFinalizada()) {
            int total = 0;
            for (QuantidadePrato qp : this.getQuantidadePrato()) {
                total += qp.getPrecoTotal();
            }

            this.setTotalCompra(total);
            this.setIsFinalizada(true);
        }
    }

    /**
     * Auxilia a alteração da quantidade de um prato dentro do tabuleiro. Procura e
     * retorna a QuantidadePrato do tabuleiro de compras para alterar a quantidade do
     * prato.
     *
     * @param p O prato do tabuleiro do qual se quer encontrar a QuantidadePrato.
     * @return A QuantidadePrato associada ao prato passado. Caso não encontre, retorna
     *         null e não lança uma excepção por não ter sido encontrado.
     */
    private QuantidadePrato findQuantidadePrato(Prato p) {
        if (hasAnyQuantidadePrato()) {
            for (QuantidadePrato q : getQuantidadePrato()) {
                if (q.getPrato().equals(p)
                        && q.getPrato().getRestaurante().getNome()
                                .equals(p.getRestaurante().getNome())) {
                    return q;
                }
            }
        }

        return null;
    }

    /**
     * Compra a quantidade recebida do prato indicado. Verifica se o prato já existe no
     * tabuleiro e, caso exista, limita-se a alterar a quantidade encomendada. Caso
     * contrário, acrescenta o prato com a quantidade indicada ao tabuleiro.
     *
     * @param quantPrato Quantidade do Prato a adicionar à compra
     */
    @Override
    public void addQuantidadePrato(QuantidadePrato quantPrato) {
        final QuantidadePrato qp = findQuantidadePrato(quantPrato.getPrato());
        if (qp == null) {
            if (quantPrato.getQuantidade() <= 0) {
                throw new InvalidDishException(
                        "Só pode adicionar um novo prato com quantidade positiva ao tabuleiro");
            }
            super.addQuantidadePrato(quantPrato);

        } else {
            if (quantPrato.getQuantidade() > 0) {
                assert qp.getQuantidade() < Integer.MAX_VALUE - qp.getQuantidade() : "quantidade deu overflow de inteiros";
            } else {
                assert qp.getQuantidade() > Integer.MIN_VALUE - qp.getQuantidade() : "quantidade deu underflow de inteiros";
            }

            qp.setQuantidade(qp.getQuantidade() + quantPrato.getQuantidade());
            if (qp.getQuantidade() < 1) {
                removeQuantidadePrato(qp);
            }
        }
    }

    /*
     * (non-Javadoc)
     *
     * @see pt.ist.fenixframework.pstm.AbstractDomainObject#toString()
     */
    @Override
    public String toString() {
        StringBuilder string = new StringBuilder();

        for (QuantidadePrato qp : this.getQuantidadePrato()) {
            string.append(qp.toString());
        }
        string.append("\n\t\t\t");
        string.append("Preço total -> " + this.getTotalCompra());
        string.append(" Saldo disponível -> " + this.getCliente().getSaldo());
        return string.toString();
    }

    //CHECKSTYLE:OFF para evitar queixar-se de não fazer override ao equals de Object e de não usar hashcodes
    /**
     * Equals.
     *
     * @param obj the obj
     * @return true, if successful
     */
    public boolean equals(Compra obj) {
        if (obj == null) {
            return false;
        }

        if (this.getId() == obj.getId()) {

            final Cliente thisC = this.getCliente();
            final Cliente otherC = obj.getCliente();

            assert this.getIsFinalizada() == obj.getIsFinalizada() : "@equals Compra: id igual mas finalizada diferente: \n\t"
                    + '('
                    + this.getId()
                    + " - "
                    + this.getIsFinalizada()
                    + '/'
                    + obj.getIsFinalizada() + ")\n";
            assert thisC.equals(otherC) : "@equals Compra: id igual mas cliente diferente: \n\t"
                    + '(' + this.getId() + " - " + thisC.toString() + '/' + otherC.toString()
                    + ")\n";
            assert this.getQuantidadePrato().equals(obj.getQuantidadePrato()) : "@equals Compra: id igual mas lista quantidadePrato diferente: \n\t"
                    + '('
                    + this.getId()
                    + " - "
                    + this.getQuantidadePrato().toString()
                    + '/'
                    + obj.getQuantidadePrato().toString() + ")\n";

            return true;
        }

        return false;
    }

}


text:
package do

import (
	"context"
	"errors"
	"fmt"
	"io/ioutil"
	"net/http"
	"os"
	"strconv"
	"strings"

	"golang.org/x/oauth2"

	"github.com/digitalocean/godo"
	corev1 "k8s.io/api/core/v1"
	"k8s.io/kops/pkg/nodeidentity"
)

// nodeIdentifier identifies a node from DO
type nodeIdentifier struct {
	doClient *godo.Client
}

const (
	dropletRegionMetadataURL    = "http://169.254.169.254/metadata/v1/region"
	dropletTagInstanceGroupName = "kops-instancegroup"
)

// TokenSource implements oauth2.TokenSource
type TokenSource struct {
	AccessToken string
}

// Token() returns oauth2.Token
func (t *TokenSource) Token() (*oauth2.Token, error) {
	token := &oauth2.Token{
		AccessToken: t.AccessToken,
	}
	return token, nil
}

// New creates and returns a nodeidentity.LegacyIdentifier for Nodes running on DO
func New() (nodeidentity.LegacyIdentifier, error) {
	region, err := getMetadataRegion()
	if err != nil {
		return nil, fmt.Errorf("failed to get droplet region: %s", err)
	}

	godoClient, err := NewCloud(region)
	if err != nil {
		return nil, fmt.Errorf("failed to initialize digitalocean cloud: %s", err)
	}

	return &nodeIdentifier{
		doClient: godoClient,
	}, nil
}

func getMetadataRegion() (string, error) {
	return getMetadata(dropletRegionMetadataURL)
}

// NewCloud returns a Cloud, expecting the env var DIGITALOCEAN_ACCESS_TOKEN
// NewCloud will return an err if DIGITALOCEAN_ACCESS_TOKEN is not defined
func NewCloud(region string) (*godo.Client, error) {
	accessToken := os.Getenv("DIGITALOCEAN_ACCESS_TOKEN")
	if accessToken == "" {
		return nil, errors.New("DIGITALOCEAN_ACCESS_TOKEN is required")
	}

	tokenSource := &TokenSource{
		AccessToken: accessToken,
	}

	oauthClient := oauth2.NewClient(context.TODO(), tokenSource)
	client := godo.NewClient(oauthClient)

	return client, nil
}

func getMetadata(url string) (string, error) {
	resp, err := http.Get(url)
	if err != nil {
		return "", fmt.Errorf("failed to get metadata URL %s: %v", url, err)
	}

	defer resp.Body.Close()

	if resp.StatusCode != http.StatusOK {
		return "", fmt.Errorf("droplet metadata returned non-200 status code: %d", resp.StatusCode)
	}

	bodyBytes, err := ioutil.ReadAll(resp.Body)
	if err != nil {
		return "", fmt.Errorf("failed to read metadata information %s: %v", url, err)
	}

	return string(bodyBytes), nil
}

// IdentifyNode queries DO for the node identity information
func (i *nodeIdentifier) IdentifyNode(ctx context.Context, node *corev1.Node) (*nodeidentity.LegacyInfo, error) {
	providerID := node.Spec.ProviderID

	if providerID == "" {
		return nil, errors.New("provider ID cannot be empty")
	}

	const prefix = "digitalocean://"

	if !strings.HasPrefix(providerID, prefix) {
		return nil, fmt.Errorf("provider ID %q is missing prefix %q", providerID, prefix)
	}

	provIDNum := strings.TrimPrefix(providerID, prefix)
	if provIDNum == "" {
		return nil, errors.New("provider ID number cannot be empty")
	}

	dropletID, err := strconv.Atoi(provIDNum)
	if err != nil {
		return nil, fmt.Errorf("failed to convert provider ID number %q: %s", dropletID, err)
	}

	kopsGroup, err := i.getInstanceGroup(dropletID)
	if err != nil {
		return nil, err
	}

	info := &nodeidentity.LegacyInfo{}
	info.InstanceGroup = kopsGroup

	return info, nil
}

func (i *nodeIdentifier) getInstanceGroup(instanceID int) (string, error) {

	ctx := context.TODO()
	droplet, _, err := i.doClient.Droplets.Get(ctx, instanceID)
	if err != nil {
		return "", fmt.Errorf("failed to retrieve droplet via api for dropletid = %d. Error = %v", instanceID, err)
	}

	for _, dropletTag := range droplet.Tags {
		if strings.Contains(dropletTag, dropletTagInstanceGroupName) {
			instancegrouptag := strings.SplitN(dropletTag, ":", 2)
			if len(instancegrouptag) < 2 {
				return "", fmt.Errorf("failed to parse droplet tag %q: expected colon-separated key/value pair", dropletTag)
			}
			instancegroupvalue := instancegrouptag[1]
			return instancegroupvalue, nil
		}
	}

	return "", errors.New("could not find tag 'kops-instancegroup' from instance metadata")
}


text:
import os
import sys

try:
    from setuptools import setup
except ImportError:
    from distutils.core import setup

if sys.argv[-1] == 'publish':
    os.system('python setup.py sdist upload')
    sys.exit()

readme = open('README.rst').read()
history = open('HISTORY.rst').read().replace('.. :changelog:', '')

setup(
    name='txbalanced',
    version='0.1.3',
    description='Balanced Payments library Twisted style',
    long_description=readme + '\n\n' + history,
    author='Trenton Broughton',
    author_email='trenton@devpie.com',
    url='https://github.com/trenton42/txbalanced',
    packages=[
        'txbalanced',
    ],
    package_dir={'txbalanced': 'txbalanced'},
    include_package_data=True,
    install_requires=[
        'treq',
        'python-dateutil',
        'pyopenssl',
        'wrapt'
    ],
    license="BSD",
    zip_safe=False,
    keywords='txbalanced',
    classifiers=[
        'Development Status :: 2 - Pre-Alpha',
        'Intended Audience :: Developers',
        'License :: OSI Approved :: BSD License',
        'Natural Language :: English',
        "Programming Language :: Python :: 2",
        'Programming Language :: Python :: 2.6',
        'Programming Language :: Python :: 2.7',
        'Programming Language :: Python :: 3',
        'Programming Language :: Python :: 3.3',
    ],
    test_suite='tests',
)


text:
package org.deidentifier.arx.metric;

import java.util.Set;

import org.deidentifier.arx.ARXConfiguration;
import org.deidentifier.arx.DataDefinition;
import org.deidentifier.arx.criteria.DPresence;
import org.deidentifier.arx.framework.check.groupify.HashGroupify;
import org.deidentifier.arx.framework.check.groupify.HashGroupifyEntry;
import org.deidentifier.arx.framework.data.Data;
import org.deidentifier.arx.framework.data.DataManager;
import org.deidentifier.arx.framework.data.GeneralizationHierarchy;
import org.deidentifier.arx.framework.lattice.Transformation;

/**
 * This class provides an implementation of the DM* metric (monotonic variant of
 * the Discernability Metric).
 *
 * @author Fabian Prasser
 * @author Florian Kohlmayer
 */
public class MetricDMStar extends MetricDefault {

    /** SVUID. */
    private static final long serialVersionUID = -3324788439890959974L;

    /** Number of tuples. */
    private double            rowCount         = 0;

    /**
     * Creates a new instance.
     */
    protected MetricDMStar() {
        super(true, false);
    }

    @Override
    public InformationLoss<?> createMaxInformationLoss() {
        if (rowCount == 0) {
            throw new IllegalStateException("Metric must be initialized first");
        } else {
            return new InformationLossDefault(rowCount * rowCount);
        }
    }

    @Override
    public InformationLoss<?> createMinInformationLoss() {
        if (rowCount == 0) {
            throw new IllegalStateException("Metric must be initialized first");
        } else {
            return new InformationLossDefault(rowCount);
        }
    }

    @Override
    public String toString() {
        return "Monotonic Discernability";
    }

    @Override
    protected InformationLossWithBound<InformationLossDefault> getInformationLossInternal(Transformation node, HashGroupifyEntry entry) {
        return new InformationLossDefaultWithBound(entry.count, entry.count);
    }

    @Override
    protected InformationLossWithBound<InformationLossDefault> getInformationLossInternal(final Transformation node, final HashGroupify g) {

        if (node.getLowerBound() != null) {
            return new InformationLossWithBound<InformationLossDefault>((InformationLossDefault) node.getLowerBound(),
                                                                        (InformationLossDefault) node.getLowerBound());
        }

        double value = 0;
        HashGroupifyEntry m = g.getFirstEquivalenceClass();
        while (m != null) {
            if (m.count > 0) {
                value += (double) m.count * (double) m.count;
            }
            m = m.nextOrdered;
        }
        return new InformationLossDefaultWithBound(value, value);
    }

    @Override
    protected InformationLossDefault getLowerBoundInternal(Transformation node) {
        return null;
    }

    @Override
    protected InformationLossDefault getLowerBoundInternal(Transformation node,
                                                           HashGroupify groupify) {
        return getInformationLossInternal(node, groupify).getInformationLoss();
    }

    /**
     * Returns the current row count.
     *
     * @return
     */
    protected double getRowCount() {
        return this.rowCount;
    }

    @Override
    protected void initializeInternal(final DataManager manager,
                                      final DataDefinition definition,
                                      final Data input,
                                      final GeneralizationHierarchy[] hierarchies,
                                      final ARXConfiguration config) {
        super.initializeInternal(manager, definition, input, hierarchies, config);
        if (config.containsCriterion(DPresence.class)) {
            Set<DPresence> crits = config.getCriteria(DPresence.class);
            if (crits.size() > 1) {
                throw new IllegalArgumentException("Only one d-presence criterion supported!");
            }
            for (DPresence dPresence : crits) {
                rowCount = dPresence.getSubset().getArray().length;
            }
        } else {
            rowCount = input.getDataLength();
        }
    }
}


text:
namespace mozc {

namespace commands {
class KeyEvent;
}

namespace keymap {

template <typename T>
class KeyMap : public KeyMapInterface<typename T::Commands> {
 public:
  typedef typename T::Commands CommandsType;

  bool GetCommand(const commands::KeyEvent &key_event,
                  CommandsType *command) const override;
  bool AddRule(const commands::KeyEvent &key_event,
               CommandsType command) override;
  void Clear();

 private:
  typedef std::map<KeyInformation, CommandsType> KeyToCommandMap;
  KeyToCommandMap keymap_;
};

// A manager of key mapping rule for a SessionKeymap.
// When running as a decoder, an instance is always tied to
// an immutable `SessionKeymap`, which is set by the constructors.
class KeyMapManager {
 public:
  // Default ctor for GUI config editor. keymap is NONE.
  KeyMapManager();
  // Decoder should explicitly set the keymap.
  explicit KeyMapManager(config::Config::SessionKeymap keymap);
  ~KeyMapManager();

  config::Config::SessionKeymap GetKeymap() const { return keymap_; }

  // Reloads the key map by using given configuration.
  // `keymap_` is immutable so `config.session_keymap` must be identical to it.
  // Right now `config.custom_keymap_table` is the only reloaded content.
  bool ReloadConfig(const config::Config &config);

  bool GetCommandDirect(const commands::KeyEvent &key_event,
                        DirectInputState::Commands *command) const;

  bool GetCommandPrecomposition(const commands::KeyEvent &key_event,
                                PrecompositionState::Commands *command) const;

  bool GetCommandComposition(const commands::KeyEvent &key_event,
                             CompositionState::Commands *command) const;

  bool GetCommandConversion(const commands::KeyEvent &key_event,
                            ConversionState::Commands *command) const;

  bool GetCommandZeroQuerySuggestion(
      const commands::KeyEvent &key_event,
      PrecompositionState::Commands *command) const;

  bool GetCommandSuggestion(const commands::KeyEvent &key_event,
                            CompositionState::Commands *command) const;

  bool GetCommandPrediction(const commands::KeyEvent &key_event,
                            ConversionState::Commands *command) const;

  bool GetNameFromCommandDirect(DirectInputState::Commands command,
                                std::string *name) const;
  bool GetNameFromCommandPrecomposition(PrecompositionState::Commands command,
                                        std::string *name) const;
  bool GetNameFromCommandComposition(CompositionState::Commands command,
                                     std::string *name) const;
  bool GetNameFromCommandConversion(ConversionState::Commands command,
                                    std::string *name) const;

  // Get command names
  void GetAvailableCommandNameDirect(
      absl::btree_set<std::string> *command_names) const;
  void GetAvailableCommandNamePrecomposition(
      absl::btree_set<std::string> *command_names) const;
  void GetAvailableCommandNameComposition(
      absl::btree_set<std::string> *command_names) const;
  void GetAvailableCommandNameConversion(
      absl::btree_set<std::string> *command_names) const;
  void GetAvailableCommandNameZeroQuerySuggestion(
      absl::btree_set<std::string> *command_names) const;
  void GetAvailableCommandNameSuggestion(
      absl::btree_set<std::string> *command_names) const;
  void GetAvailableCommandNamePrediction(
      absl::btree_set<std::string> *command_names) const;

  // Return the file name bound with the keymap enum.
  static const char *GetKeyMapFileName(config::Config::SessionKeymap keymap);

 private:
  friend class KeyMapTest;
  FRIEND_TEST(KeyMapTest, AddRule);
  FRIEND_TEST(KeyMapTest, DefaultKeyBindings);
  FRIEND_TEST(KeyMapTest, LoadStreamWithErrors);
  FRIEND_TEST(KeyMapTest, AddCommand);
  FRIEND_TEST(KeyMapTest, ZeroQuerySuggestion);

  void Reset();
  void InitCommandData();
  bool Initialize();

  bool LoadFile(const char *filename);
  bool LoadStream(std::istream *ifs);
  bool LoadStreamWithErrors(std::istream *ifs,
                            std::vector<std::string> *errors);

  // Add a command bound with state and key_event.
  bool AddCommand(const std::string &state_name,
                  const std::string &key_event_name,
                  const std::string &command_name);

  bool ParseCommandDirect(const std::string &command_string,
                          DirectInputState::Commands *command) const;
  bool ParseCommandPrecomposition(const std::string &command_string,
                                  PrecompositionState::Commands *command) const;
  bool ParseCommandComposition(const std::string &command_string,
                               CompositionState::Commands *command) const;
  bool ParseCommandConversion(const std::string &command_string,
                              ConversionState::Commands *command) const;
  void RegisterDirectCommand(const std::string &command_string,
                             DirectInputState::Commands command);
  void RegisterPrecompositionCommand(const std::string &command_string,
                                     PrecompositionState::Commands command);
  void RegisterCompositionCommand(const std::string &command_string,
                                  CompositionState::Commands command);
  void RegisterConversionCommand(const std::string &command_string,
                                 ConversionState::Commands command);

  static const bool kInputModeXCommandSupported;

  // The SessionKeymap which this instance represents.
  const config::Config::SessionKeymap keymap_;
  std::map<std::string, DirectInputState::Commands> command_direct_map_;
  std::map<std::string, PrecompositionState::Commands>
      command_precomposition_map_;
  std::map<std::string, CompositionState::Commands> command_composition_map_;
  std::map<std::string, ConversionState::Commands> command_conversion_map_;

  std::map<DirectInputState::Commands, std::string> reverse_command_direct_map_;
  std::map<PrecompositionState::Commands, std::string>
      reverse_command_precomposition_map_;
  std::map<CompositionState::Commands, std::string>
      reverse_command_composition_map_;
  std::map<ConversionState::Commands, std::string>
      reverse_command_conversion_map_;

  // Status should be out of keymap.
  keymap::KeyMap<keymap::DirectInputState> keymap_direct_;
  keymap::KeyMap<keymap::PrecompositionState> keymap_precomposition_;
  keymap::KeyMap<keymap::CompositionState> keymap_composition_;
  keymap::KeyMap<keymap::ConversionState> keymap_conversion_;

  // enabled only if zero query suggestion is shown. Otherwise, inherit from
  // keymap_precomposition
  keymap::KeyMap<keymap::PrecompositionState> keymap_zero_query_suggestion_;

  // enabled only if suggestion is shown. Otherwise, inherit from
  // keymap_composition
  keymap::KeyMap<keymap::CompositionState> keymap_suggestion_;

  // enabled only if prediction is shown. Otherwise, inherit from
  // keymap_conversion
  keymap::KeyMap<keymap::ConversionState> keymap_prediction_;

  DISALLOW_COPY_AND_ASSIGN(KeyMapManager);
};

}  // namespace keymap
}  // namespace mozc

#endif  // MOZC_SESSION_INTERNAL_KEYMAP_H_


text:
package haxe.lang;
import haxe.root.*;

@SuppressWarnings(value={"rawtypes", "unchecked"})
public  class DynamicObject extends haxe.lang.HxObject
{
	public    DynamicObject(haxe.lang.EmptyObject empty)
	{
		super(haxe.lang.EmptyObject.EMPTY);
	}

	public    DynamicObject()
	{
		haxe.lang.DynamicObject.__hx_ctor_haxe_lang_DynamicObject(((haxe.lang.DynamicObject) (this) ));
	}

	public    DynamicObject(haxe.root.Array<java.lang.String> __hx_hashes, haxe.root.Array<java.lang.Object> __hx_dynamics, haxe.root.Array<java.lang.String> __hx_hashes_f, haxe.root.Array<java.lang.Object> __hx_dynamics_f)
	{
		haxe.lang.DynamicObject.__hx_ctor_haxe_lang_DynamicObject(((haxe.lang.DynamicObject) (this) ), ((haxe.root.Array<java.lang.String>) (__hx_hashes) ), ((haxe.root.Array<java.lang.Object>) (__hx_dynamics) ), ((haxe.root.Array<java.lang.String>) (__hx_hashes_f) ), ((haxe.root.Array<java.lang.Object>) (__hx_dynamics_f) ));
	}

	public static   void __hx_ctor_haxe_lang_DynamicObject(haxe.lang.DynamicObject __temp_me12)
	{
		__temp_me12.__hx_hashes = new haxe.root.Array<java.lang.String>(new java.lang.String[]{});
		__temp_me12.__hx_dynamics = new haxe.root.Array<java.lang.Object>(new java.lang.Object[]{});
		__temp_me12.__hx_hashes_f = new haxe.root.Array<java.lang.String>(new java.lang.String[]{});
		__temp_me12.__hx_dynamics_f = new haxe.root.Array<java.lang.Object>(new java.lang.Object[]{});
	}

	public static   void __hx_ctor_haxe_lang_DynamicObject(haxe.lang.DynamicObject __temp_me11, haxe.root.Array<java.lang.String> __hx_hashes, haxe.root.Array<java.lang.Object> __hx_dynamics, haxe.root.Array<java.lang.String> __hx_hashes_f, haxe.root.Array<java.lang.Object> __hx_dynamics_f)
	{
		__temp_me11.__hx_hashes = __hx_hashes;
		__temp_me11.__hx_dynamics = __hx_dynamics;
		__temp_me11.__hx_hashes_f = __hx_hashes_f;
		__temp_me11.__hx_dynamics_f = __hx_dynamics_f;
	}

	public static   java.lang.Object __hx_createEmpty()
	{
		return new haxe.lang.DynamicObject(((haxe.lang.EmptyObject) (haxe.lang.EmptyObject.EMPTY) ));
	}

	public static   java.lang.Object __hx_create(haxe.root.Array arr)
	{
		return new haxe.lang.DynamicObject(((haxe.root.Array<java.lang.String>) (arr.__get(0)) ), ((haxe.root.Array<java.lang.Object>) (arr.__get(1)) ), ((haxe.root.Array<java.lang.String>) (arr.__get(2)) ), ((haxe.root.Array<java.lang.Object>) (arr.__get(3)) ));
	}

	@Override public   java.lang.String toString()
	{
		haxe.lang.Function ts = ((haxe.lang.Function) (haxe.lang.Runtime.getField(this, "toString", false)) );
		if (( ts != null ))
		{
			return haxe.lang.Runtime.toString(ts.__hx_invoke0_o());
		}

		haxe.root.StringBuf ret = new haxe.root.StringBuf();
		ret.add("{");
		boolean first = true;
		{
			int _g = 0;
			haxe.root.Array<java.lang.String> _g1 = haxe.root.Reflect.fields(this);
			while (( _g < _g1.length ))
			{
				java.lang.String f = _g1.__get(_g);
				 ++ _g;
				if (first)
				{
					first = false;
				}
				 else
				{
					ret.add(",");
				}

				ret.add(" ");
				ret.add(f);
				ret.add(" : ");
				ret.add(haxe.root.Reflect.field(this, f));
			}

		}

		if ( ! (first) )
		{
			ret.add(" ");
		}

		ret.add("}");
		return ret.toString();
	}

	@Override public   boolean __hx_deleteField(java.lang.String field)
	{
		int res = haxe.lang.FieldLookup.findHash(field, this.__hx_hashes);
		if (( res >= 0 ))
		{
			this.__hx_hashes.splice(res, 1);
			this.__hx_dynamics.splice(res, 1);
			return true;
		}
		 else
		{
			res = haxe.lang.FieldLookup.findHash(field, this.__hx_hashes_f);
			if (( res >= 0 ))
			{
				this.__hx_hashes_f.splice(res, 1);
				this.__hx_dynamics_f.splice(res, 1);
				return true;
			}

		}

		return false;
	}

	public  haxe.root.Array<java.lang.String> __hx_hashes = new haxe.root.Array<java.lang.String>(new java.lang.String[]{});

	public  haxe.root.Array<java.lang.Object> __hx_dynamics = new haxe.root.Array<java.lang.Object>(new java.lang.Object[]{});

	public  haxe.root.Array<java.lang.String> __hx_hashes_f = new haxe.root.Array<java.lang.String>(new java.lang.String[]{});

	public  haxe.root.Array<java.lang.Object> __hx_dynamics_f = new haxe.root.Array<java.lang.Object>(new java.lang.Object[]{});

	@Override public   java.lang.Object __hx_lookupField(java.lang.String field, boolean throwErrors, boolean isCheck)
	{
		int res = haxe.lang.FieldLookup.findHash(field, this.__hx_hashes);
		if (( res >= 0 ))
		{
			return this.__hx_dynamics.__get(res);
		}
		 else
		{
			res = haxe.lang.FieldLookup.findHash(field, this.__hx_hashes_f);
			if (( res >= 0 ))
			{
				return ((double) (haxe.lang.Runtime.toDouble(this.__hx_dynamics_f.__get(res))) );
			}

		}

		if (isCheck)
		{
			return haxe.lang.Runtime.undefined;
		}
		 else
		{
			return null;
		}

	}

	@Override public   double __hx_lookupField_f(java.lang.String field, boolean throwErrors)
	{
		int res = haxe.lang.FieldLookup.findHash(field, this.__hx_hashes_f);
		if (( res >= 0 ))
		{
			return ((double) (haxe.lang.Runtime.toDouble(this.__hx_dynamics_f.__get(res))) );
		}
		 else
		{
			res = haxe.lang.FieldLookup.findHash(field, this.__hx_hashes);
			if (( res >= 0 ))
			{
				return ((double) (haxe.lang.Runtime.toDouble(this.__hx_dynamics.__get(res))) );
			}

		}

		return 0.0;
	}

	@Override public   java.lang.Object __hx_lookupSetField(java.lang.String field, java.lang.Object value)
	{
		int res = haxe.lang.FieldLookup.findHash(field, this.__hx_hashes);
		if (( res >= 0 ))
		{
			return this.__hx_dynamics.__set(res, value);
		}
		 else
		{
			int res2 = haxe.lang.FieldLookup.findHash(field, this.__hx_hashes_f);
			if (( res2 >= 0 ))
			{
				this.__hx_hashes_f.splice(res2, 1);
				this.__hx_dynamics_f.splice(res2, 1);
			}

		}

		this.__hx_hashes.insert( ~ (res) , field);
		this.__hx_dynamics.insert( ~ (res) , value);
		return value;
	}

	@Override public   double __hx_lookupSetField_f(java.lang.String field, double value)
	{
		int res = haxe.lang.FieldLookup.findHash(field, this.__hx_hashes_f);
		if (( res >= 0 ))
		{
			return ((double) (haxe.lang.Runtime.toDouble(this.__hx_dynamics_f.__set(res, value))) );
		}
		 else
		{
			int res2 = haxe.lang.FieldLookup.findHash(field, this.__hx_hashes);
			if (( res2 >= 0 ))
			{
				this.__hx_hashes.splice(res2, 1);
				this.__hx_dynamics.splice(res2, 1);
			}

		}

		this.__hx_hashes_f.insert( ~ (res) , field);
		this.__hx_dynamics_f.insert( ~ (res) , value);
		return value;
	}

	@Override public   void __hx_getFields(haxe.root.Array<java.lang.String> baseArr)
	{
		{
			{
				java.lang.Object __temp_iterator15 = this.__hx_hashes.iterator();
				while (haxe.lang.Runtime.toBool(haxe.lang.Runtime.callField(__temp_iterator15, "hasNext", null)))
				{
					java.lang.String __temp_field14 = haxe.lang.Runtime.toString(haxe.lang.Runtime.callField(__temp_iterator15, "next", null));
					baseArr.push(__temp_field14);
				}

			}

			{
				java.lang.Object __temp_iterator16 = this.__hx_hashes_f.iterator();
				while (haxe.lang.Runtime.toBool(haxe.lang.Runtime.callField(__temp_iterator16, "hasNext", null)))
				{
					java.lang.String __temp_field13 = haxe.lang.Runtime.toString(haxe.lang.Runtime.callField(__temp_iterator16, "next", null));
					baseArr.push(__temp_field13);
				}

			}

			super.__hx_getFields(baseArr);
		}

	}

}


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

<TITLE>
org.apache.jmeter.testbeans.gui (Apache JMeter API)
</TITLE>

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../stylesheet.css" TITLE="Style">

org.apache.jmeter.testbeans.gui

Interfaces

SharedCustomizer

TestBeanPropertyEditor

Classes

BooleanPropertyEditor

FileEditor

GenericTestBeanCustomizer

IntegerPropertyEditor

LongPropertyEditor

PasswordEditor

TableEditor

TestBeanGUI

TextAreaEditor

Enums

TypeEditor


text:
#pragma once

#include "basetopo.h"

//=============================================================================
// Classes
//=============================================================================

///////////////////////////////////////////////////////////////////////////////
// CMiniportTopology
//

class CMiniportTopology :
    public CMiniportTopologyRPIWAV,
    public IMiniportTopology,
    public CUnknown
{
  private:
    eDeviceType             m_DeviceType;
    union {
        PVOID               m_DeviceContext;
    };

public:
    DECLARE_STD_UNKNOWN();
    CMiniportTopology
    (
        _In_opt_    PUNKNOWN                UnknownOuter,
        _In_        PCFILTER_DESCRIPTOR    *FilterDesc,
        _In_        USHORT                  DeviceMaxChannels,
        _In_        eDeviceType             DeviceType,
        _In_opt_    PVOID                   DeviceContext
    )
    : CUnknown(UnknownOuter),
      CMiniportTopologyRPIWAV(FilterDesc, DeviceMaxChannels),
      m_DeviceType(DeviceType),
      m_DeviceContext(DeviceContext)
    {
    }

    ~CMiniportTopology();

    IMP_IMiniportTopology;

    NTSTATUS PropertyHandlerJackDescription
    (
        _In_        PPCPROPERTY_REQUEST                      PropertyRequest,
        _In_        ULONG                                    NumJackDescriptions,
        _In_reads_(NumJackDescriptions) PKSJACK_DESCRIPTION *JackDescriptions
    );

    NTSTATUS PropertyHandlerJackDescription2
    (
        _In_        PPCPROPERTY_REQUEST                      PropertyRequest,
        _In_        ULONG                                    NumJackDescriptions,
        _In_reads_(NumJackDescriptions) PKSJACK_DESCRIPTION *  JackDescriptions,
        _In_        DWORD                                    JackCapabilities
    );

};

typedef CMiniportTopology *PCMiniportTopology;


text:
Developer setup
===============

A detailed guide on how to set up this project for development can be found in
the README.rst:

.. include:: ../../README.rst


text:
package org.springframework.security.oauth2.provider.code;

import java.util.concurrent.ConcurrentHashMap;

/**
 * Implementation of authorization code services that stores the codes and authentication in memory.
 *
 * @author Ryan Heaton
 * @author Dave Syer
 */
public class InMemoryAuthorizationCodeServices extends RandomValueAuthorizationCodeServices {

	protected final ConcurrentHashMap<String, AuthorizationRequestHolder> authorizationCodeStore = new ConcurrentHashMap<String, AuthorizationRequestHolder>();

	@Override
	protected void store(String code, AuthorizationRequestHolder authentication) {
		this.authorizationCodeStore.put(code, authentication);
	}

	@Override
	public AuthorizationRequestHolder remove(String code) {
		AuthorizationRequestHolder auth = this.authorizationCodeStore.remove(code);
		return auth;
	}

}


text:
package cfsb

import (
	"fmt"

	"github.com/starkandwayne/rdpgd/log"
	"github.com/starkandwayne/rdpgd/pg"
)

type PlanDetails struct {
	Cost        string              `json:"cost"`
	Bullets     []map[string]string `json:"bullets"`
	DisplayName string              `json:"displayname"`
}

type Plan struct {
	PlanID      string      `db:"plan_id" json:"id"`
	Name        string      `db:"name" json:"name"`
	Description string      `db:"description" json:"description"`
	Metadata    PlanDetails `json:"metadata"`
	MgmtDbUri   string      `json:""`
}

func FindPlan(planID string) (plan *Plan, err error) {
	p := pg.NewPG(`127.0.0.1`, pbPort, `rdpg`, `rdpg`, pgPass)
	db, err := p.Connect()
	if err != nil {
		log.Error(fmt.Sprintf("cfsb#FindPlan(%s) ! %s", planID, err))
		return
	}
	defer db.Close()

	plan = &Plan{}
	sq := fmt.Sprintf(`SELECT plan_id,name,description FROM cfsb.plans WHERE id='%s' LIMIT 1;`, planID)
	log.Trace(fmt.Sprintf("cfsb.FindPlan(%s) > %s", planID, sq))
	err = db.Get(&plan, sq, planID)
	if err != nil {
		log.Error(fmt.Sprintf("cfsb.FindPlan(%s) %s", planID, err))
	}
	return plan, err
}


text:
package com.amazonaws.services.waf.model;

import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;

/**
 *

 * A complex type that contains XssMatchTuple objects, which specify the parts of web requests that you
 * want AWS WAF to inspect for cross-site scripting attacks and, if you want AWS WAF to inspect a header, the name of
 * the header. If a XssMatchSet contains more than one XssMatchTuple object, a request needs
 * to include cross-site scripting attacks in only one of the specified parts of the request to be considered a match.
 *

 *
 * @see AWS API
 *      Documentation
 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class XssMatchSet implements Serializable, Cloneable, StructuredPojo {

    /**
     *

     * A unique identifier for an XssMatchSet. You use XssMatchSetId to get information about
     * an XssMatchSet (see GetXssMatchSet), update an XssMatchSet (see
     * UpdateXssMatchSet), insert an XssMatchSet into a Rule or delete one from a
     * Rule (see UpdateRule), and delete an XssMatchSet from AWS WAF (see
     * DeleteXssMatchSet).
     *

     *

     * XssMatchSetId is returned by CreateXssMatchSet and by ListXssMatchSets.
     *

     */
    private String xssMatchSetId;
    /**
     *

     * The name, if any, of the XssMatchSet.
     *

     */
    private String name;
    /**
     *

     * Specifies the parts of web requests that you want to inspect for cross-site scripting attacks.
     *

     */
    private java.util.List<XssMatchTuple> xssMatchTuples;

    /**
     *

     * A unique identifier for an XssMatchSet. You use XssMatchSetId to get information about
     * an XssMatchSet (see GetXssMatchSet), update an XssMatchSet (see
     * UpdateXssMatchSet), insert an XssMatchSet into a Rule or delete one from a
     * Rule (see UpdateRule), and delete an XssMatchSet from AWS WAF (see
     * DeleteXssMatchSet).
     *

     *

     * XssMatchSetId is returned by CreateXssMatchSet and by ListXssMatchSets.
     *

     *
     * @param xssMatchSetId
     *        A unique identifier for an XssMatchSet. You use XssMatchSetId to get information
     *        about an XssMatchSet (see GetXssMatchSet), update an XssMatchSet (see
     *        UpdateXssMatchSet), insert an XssMatchSet into a Rule or delete one from
     *        a Rule (see UpdateRule), and delete an XssMatchSet from AWS WAF (see
     *        DeleteXssMatchSet).

     *

     *        XssMatchSetId is returned by CreateXssMatchSet and by ListXssMatchSets.
     */

    public void setXssMatchSetId(String xssMatchSetId) {
        this.xssMatchSetId = xssMatchSetId;
    }

    /**
     *

     * A unique identifier for an XssMatchSet. You use XssMatchSetId to get information about
     * an XssMatchSet (see GetXssMatchSet), update an XssMatchSet (see
     * UpdateXssMatchSet), insert an XssMatchSet into a Rule or delete one from a
     * Rule (see UpdateRule), and delete an XssMatchSet from AWS WAF (see
     * DeleteXssMatchSet).
     *

     *

     * XssMatchSetId is returned by CreateXssMatchSet and by ListXssMatchSets.
     *

     *
     * @return A unique identifier for an XssMatchSet. You use XssMatchSetId to get
     *         information about an XssMatchSet (see GetXssMatchSet), update an
     *         XssMatchSet (see UpdateXssMatchSet), insert an XssMatchSet into a
     *         Rule or delete one from a Rule (see UpdateRule), and delete an
     *         XssMatchSet from AWS WAF (see DeleteXssMatchSet).

     *

     *         XssMatchSetId is returned by CreateXssMatchSet and by ListXssMatchSets.
     */

    public String getXssMatchSetId() {
        return this.xssMatchSetId;
    }

    /**
     *

     * A unique identifier for an XssMatchSet. You use XssMatchSetId to get information about
     * an XssMatchSet (see GetXssMatchSet), update an XssMatchSet (see
     * UpdateXssMatchSet), insert an XssMatchSet into a Rule or delete one from a
     * Rule (see UpdateRule), and delete an XssMatchSet from AWS WAF (see
     * DeleteXssMatchSet).
     *

     *

     * XssMatchSetId is returned by CreateXssMatchSet and by ListXssMatchSets.
     *

     *
     * @param xssMatchSetId
     *        A unique identifier for an XssMatchSet. You use XssMatchSetId to get information
     *        about an XssMatchSet (see GetXssMatchSet), update an XssMatchSet (see
     *        UpdateXssMatchSet), insert an XssMatchSet into a Rule or delete one from
     *        a Rule (see UpdateRule), and delete an XssMatchSet from AWS WAF (see
     *        DeleteXssMatchSet).

     *

     *        XssMatchSetId is returned by CreateXssMatchSet and by ListXssMatchSets.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public XssMatchSet withXssMatchSetId(String xssMatchSetId) {
        setXssMatchSetId(xssMatchSetId);
        return this;
    }

    /**
     *

     * The name, if any, of the XssMatchSet.
     *

     *
     * @param name
     *        The name, if any, of the XssMatchSet.
     */

    public void setName(String name) {
        this.name = name;
    }

    /**
     *

     * The name, if any, of the XssMatchSet.
     *

     *
     * @return The name, if any, of the XssMatchSet.
     */

    public String getName() {
        return this.name;
    }

    /**
     *

     * The name, if any, of the XssMatchSet.
     *

     *
     * @param name
     *        The name, if any, of the XssMatchSet.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public XssMatchSet withName(String name) {
        setName(name);
        return this;
    }

    /**
     *

     * Specifies the parts of web requests that you want to inspect for cross-site scripting attacks.
     *

     *
     * @return Specifies the parts of web requests that you want to inspect for cross-site scripting attacks.
     */

    public java.util.List<XssMatchTuple> getXssMatchTuples() {
        return xssMatchTuples;
    }

    /**
     *

     * Specifies the parts of web requests that you want to inspect for cross-site scripting attacks.
     *

     *
     * @param xssMatchTuples
     *        Specifies the parts of web requests that you want to inspect for cross-site scripting attacks.
     */

    public void setXssMatchTuples(java.util.Collection<XssMatchTuple> xssMatchTuples) {
        if (xssMatchTuples == null) {
            this.xssMatchTuples = null;
            return;
        }

        this.xssMatchTuples = new java.util.ArrayList<XssMatchTuple>(xssMatchTuples);
    }

    /**
     *

     * Specifies the parts of web requests that you want to inspect for cross-site scripting attacks.
     *

     *

     * NOTE: This method appends the values to the existing list (if any). Use
     * {@link #setXssMatchTuples(java.util.Collection)} or {@link #withXssMatchTuples(java.util.Collection)} if you want
     * to override the existing values.
     *

     *
     * @param xssMatchTuples
     *        Specifies the parts of web requests that you want to inspect for cross-site scripting attacks.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public XssMatchSet withXssMatchTuples(XssMatchTuple... xssMatchTuples) {
        if (this.xssMatchTuples == null) {
            setXssMatchTuples(new java.util.ArrayList<XssMatchTuple>(xssMatchTuples.length));
        }
        for (XssMatchTuple ele : xssMatchTuples) {
            this.xssMatchTuples.add(ele);
        }
        return this;
    }

    /**
     *

     * Specifies the parts of web requests that you want to inspect for cross-site scripting attacks.
     *

     *
     * @param xssMatchTuples
     *        Specifies the parts of web requests that you want to inspect for cross-site scripting attacks.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public XssMatchSet withXssMatchTuples(java.util.Collection<XssMatchTuple> xssMatchTuples) {
        setXssMatchTuples(xssMatchTuples);
        return this;
    }

    /**
     * Returns a string representation of this object; useful for testing and debugging.
     *
     * @return A string representation of this object.
     *
     * @see java.lang.Object#toString()
     */
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("{");
        if (getXssMatchSetId() != null)
            sb.append("XssMatchSetId: ").append(getXssMatchSetId()).append(",");
        if (getName() != null)
            sb.append("Name: ").append(getName()).append(",");
        if (getXssMatchTuples() != null)
            sb.append("XssMatchTuples: ").append(getXssMatchTuples());
        sb.append("}");
        return sb.toString();
    }

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

        if (obj instanceof XssMatchSet == false)
            return false;
        XssMatchSet other = (XssMatchSet) obj;
        if (other.getXssMatchSetId() == null ^ this.getXssMatchSetId() == null)
            return false;
        if (other.getXssMatchSetId() != null && other.getXssMatchSetId().equals(this.getXssMatchSetId()) == false)
            return false;
        if (other.getName() == null ^ this.getName() == null)
            return false;
        if (other.getName() != null && other.getName().equals(this.getName()) == false)
            return false;
        if (other.getXssMatchTuples() == null ^ this.getXssMatchTuples() == null)
            return false;
        if (other.getXssMatchTuples() != null && other.getXssMatchTuples().equals(this.getXssMatchTuples()) == false)
            return false;
        return true;
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;

        hashCode = prime * hashCode + ((getXssMatchSetId() == null) ? 0 : getXssMatchSetId().hashCode());
        hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode());
        hashCode = prime * hashCode + ((getXssMatchTuples() == null) ? 0 : getXssMatchTuples().hashCode());
        return hashCode;
    }

    @Override
    public XssMatchSet clone() {
        try {
            return (XssMatchSet) super.clone();
        } catch (CloneNotSupportedException e) {
            throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
        }
    }

    @com.amazonaws.annotation.SdkInternalApi
    @Override
    public void marshall(ProtocolMarshaller protocolMarshaller) {
        com.amazonaws.services.waf.model.waf_regional.transform.XssMatchSetMarshaller.getInstance().marshall(this, protocolMarshaller);
    }
}


text:
SELECT
	*
FROM Departments d

--5.Write a SQL query to find all department names.
SELECT
	d.Name
FROM Departments d

--6.Write a SQL query to find the salary of each employee.
SELECT
	e.FirstName
   ,e.Salary
FROM Employees e

--7.Write a SQL to find the full name of each employee.
SELECT
	e.FirstName + e.Lastname AS [Fullname]
FROM Employees e

--8.Write a SQL query to find the email addresses of each employee (by his first and last name).
-- Consider that the mail domain is telerik.com. Emails should look like "John.Doe@telerik.com". The produced column should be named "Full Email Addresses".
SELECT
	e.FirstName + '.' + e.Lastname + '@telerik.com' AS [Full Email Adress]
FROM Employees e

--9.Write a SQL query to find all different employee salaries.
SELECT DISTINCT
	e.Salary
FROM Employees e

--10.Write a SQL query to find all information about the employees whose job title is "Sales Representative".
SELECT
	*
FROM Employees e
WHERE e.JobTitle = 'Sales Representative'

--11.Write a SQL query to find the names of all employees whose first name starts with "SA".
SELECT
	e.FirstName
FROM Employees e
WHERE e.FirstName LIKE 'SA%'
ORDER BY e.FirstName

--12.Write a SQL query to find the names of all employees whose last name contains "ei".
SELECT
	e.FirstName + ' ' + e.Lastname
FROM Employees e
WHERE e.Lastname LIKE '%ei%'
ORDER BY e.Lastname

--13.Write a SQL query to find the salary of all employees whose salary is in the range [20000…30000].
SELECT
	e.FirstName
   ,e.Salary
FROM Employees e
WHERE Salary >= 20000
AND Salary <= 30000
ORDER BY Salary
--14.Write a SQL query to find the names of all employees whose salary is 25000, 14000, 12500 or 23600.
SELECT
	e.FirstName
   ,e.Salary
FROM Employees e
WHERE e.Salary IN (25000, 14000, 12500, 23600)
ORDER BY e.Salary

--15.Write a SQL query to find all employees that do not have manager.
SELECT
	e.FirstName
   ,e.Salary
FROM Employees e
WHERE e.ManagerID IS NULL

--16.Write a SQL query to find all employees that have salary more than 50000. Order them in decreasing order by salary.
SELECT TOP 5
	e.FirstName
   ,e.Salary
FROM Employees e
WHERE e.Salary > 50000
ORDER BY e.Salary DESC

--17.Write a SQL query to find the top 5 best paid employees.
SELECT TOP 5
	e.FirstName
   ,e.Salary
FROM Employees e
ORDER BY e.Salary DESC

--18.Write a SQL query to find all employees along with their address. Use inner join with ON clause.
SELECT
	e.FirstName
   ,a.AddressText
   ,t.Name
FROM Employees e
JOIN Addresses a
	ON e.AddressID = a.AddressID
JOIN Towns t
	ON a.TownID = t.TownID

--19.Write a SQL query to find all employees and their address. Use equijoins (conditions in the WHERE clause).
SELECT
	e.FirstName + ' ' + e.Lastname AS [Fullname]
   ,a.AddressText AS [Adress]
   ,t.Name AS [TownName]
FROM Employees e
	,Addresses a
	,Towns t
WHERE e.AddressID = a.AddressID
AND a.TownID = t.TownID

--20.Write a SQL query to find all employees along with their manager.
SELECT
	e.FirstName + ' ' + e.Lastname AS [Employee Name]
   ,m.FirstName + ' ' + m.Lastname AS [ManagerName]
FROM Employees e
JOIN Employees m
	ON e.ManagerID = m.EmployeeID

--21.Write a SQL query to find all employees, along with their manager and their address. Join the 3 tables: Employees e, Employees m and Addresses a.
SELECT
	e.FirstName + ' ' + e.Lastname AS [Employee FullName]
   ,m.FirstName + ' ' + m.Lastname AS [ManagerFullName]
   ,a.AddressText
FROM Employees e
	,Employees m
	,Addresses a
WHERE m.EmployeeID = e.ManagerID
AND e.AddressID = a.AddressID

SELECT
	e.FirstName
   ,m.FirstName
   ,a.AddressText
FROM Employees e
JOIN Employees m
	ON m.EmployeeID = e.ManagerID
JOIN Addresses a
	ON e.AddressID = a.AddressID
--22.Write a SQL query to find all departments and all town names as a single list. Use UNION.
SELECT
	d.Name
FROM Departments d
UNION
SELECT
	t.Name
FROM Towns t

--23.Write a SQL query to find all the employees and the manager for each of them along with the employees that do not have manager.
-- Use right outer join. Rewrite the query to use left outer join.
SELECT
	e.FirstName + ' ' + e.Lastname AS employeeFullname
   ,m.FirstName + ' ' + m.Lastname AS [ManagerFullName]
FROM Employees e
LEFT JOIN Employees m
	ON e.ManagerID = m.EmployeeID

SELECT
	e.FirstName + ' ' + e.Lastname AS [employeeFullName]
   ,m.FirstName + ' ' + m.Lastname AS [ManagerName]
FROM Employees m
RIGHT JOIN Employees e
	ON e.ManagerID = m.EmployeeID

--24.Write a SQL query to find the names of all employees from the departments "Sales" and "Finance" whose hire year is between 1995 and 2005.
SELECT
	e.FirstName + ' ' + e.Lastname
   ,d.Name
   ,e.HireDate
FROM Employees e
JOIN Departments d
	ON e.DepartmentID = d.DepartmentID
		AND d.Name IN ('Sales', 'Finance')
WHERE e.HireDate BETWEEN ('1995-1-1') AND ('2005-1-1')

--SQL Advance

--1.Write a SQL query to find the names and salaries of the employees that take the minimal salary in the company.
--Use a nested SELECT statement.
SELECT
	e.FirstName + ' ' + e.Lastname AS [Fullname]
   ,e.Salary
FROM Employees e
WHERE e.Salary = (SELECT
		MIN(e.Salary)
	FROM Employees e)

--2.Write a SQL query to find the names and salaries of the employees that have a salary
-- that is up to 10% higher than the minimal salary for the company.
SELECT
	e.FirstName + ' ' + e.Lastname AS [Fullname]
   ,e.Salary
FROM Employees e
WHERE e.Salary <= 1.10 * (SELECT
		MIN(e.Salary)
	FROM Employees e)

--3.Write a SQL query to find the full name, salary and department of the employees that take the minimal salary in their department.
--Use a nested SELECT statement.
SELECT
	e.FirstName + ' ' + e.Lastname AS [FullName]
   ,d.Name AS [DepartmentName]
FROM Employees e
JOIN Departments d
	ON e.DepartmentID = d.DepartmentID
WHERE e.Salary = (SELECT
		MIN(eTemp.Salary)
	FROM Employees eTemp
	WHERE eTemp.DepartmentID = d.DepartmentID)

--4.Write a SQL query to find the average salary in the department #1.
SELECT
	d.Name
   ,AVG(e.Salary) AS [AverageSalary]
FROM Employees e
JOIN Departments d
	ON e.DepartmentID = d.DepartmentID
WHERE e.DepartmentID = 1
GROUP BY d.Name

--5.Write a SQL query to find the average salary in the "Sales" department.
SELECT
	d.Name
   ,AVG(e.Salary) AS [AverageSalary]
FROM Employees e
JOIN Departments d
	ON e.DepartmentID = d.DepartmentID
WHERE d.Name = 'Sales'
GROUP BY d.Name

--6.Write a SQL query to find the number of employees in the "Sales" department.
SELECT
	d.Name AS [Departament Name]
   ,COUNT(*) AS [Employee number]
FROM Employees e
JOIN Departments d
	ON e.DepartmentID = d.DepartmentID
WHERE d.Name = 'Sales'
GROUP BY d.Name

--7.Write a SQL query to find the number of all employees that have manager.
SELECT
	e.FirstName + ' ' + e.Lastname
FROM Employees e
WHERE e.ManagerID IS NOT NULL

--8.Write a SQL query to find the number of all employees that have no manager.
SELECT
	e.FirstName + ' ' + e.Lastname
FROM Employees e
WHERE e.ManagerID IS NULL

--9.Write a SQL query to find all departments and the average salary for each of them.
SELECT
	d.Name AS [DepartmantName]
   ,AVG(e.Salary) AS [AverageSalary]
FROM Employees e
	,Departments d
WHERE d.DepartmentID = e.DepartmentID
GROUP BY d.Name

--10.Write a SQL query to find the count of all employees in each department and for each town.
SELECT
	t.Name AS Town
   ,d.Name AS Departament
   ,COUNT(e.EmployeeID) AS TotalEmployees
FROM Employees e
JOIN Departments d
	ON e.DepartmentID = d.DepartmentID
JOIN Addresses a
	ON e.AddressID = a.AddressID
JOIN Towns t
	ON a.TownID = t.TownID
GROUP BY t.Name
		,d.Name

--11.Write a SQL query to find all managers that have exactly 5 employees. Display their first name and last name.
SELECT
	m.FirstName + ' ' + m.Lastname AS [ManagerName]
   ,COUNT(e.EmployeeID) AS employeTotalNumber
FROM Employees e
JOIN Employees m
	ON m.EmployeeID = e.ManagerID
GROUP BY m.FirstName + ' ' + m.Lastname
HAVING COUNT(e.EmployeeID) = 5
--12.Write a SQL query to find all employees along with their managers. For employees that do not have manager display the value "(no manager)".
SELECT
	e.FirstName + ' ' + e.Lastname AS [Employee Name]
   ,ISNULL(m.FirstName + ' ' + m.Lastname, 'No Manager') AS [Manager Name]
FROM Employees e
LEFT JOIN Employees m
	ON e.ManagerID = m.EmployeeID

--13.Write a SQL query to find the names of all employees whose last name is exactly 5 characters long. Use the built-in LEN(str) function.
SELECT
	e.Lastname
FROM Employees e
WHERE LEN(e.Lastname) = 5

--14.Write a SQL query to display the current date and time in the following format "day.month.year hour:minutes:seconds:milliseconds".
SELECT
	CONVERT(NVARCHAR(50), GETDATE(), 104) + ' ' + CONVERT(NVARCHAR(50), GETDATE(), 114) AS [Current Time Now]

--15.Write a SQL statement to create a table Users. Users should have username, password, full name and last login time.

--Choose appropriate data types for the table fields. Define a primary key column with a primary key constraint.
--Define the primary key column as identity to facilitate inserting records.
--Define unique constraint to avoid repeating usernames.
--Define a check constraint to ensure the password is at least 5 characters long.
CREATE TABLE Users (
	Userid INT IDENTITY
   ,Username NVARCHAR(50) NOT NULL
   ,Password NVARCHAR(50) NOT NULL
   ,Fullname NVARCHAR(50) NOT NULL
   ,LastLogin DATETIME
   ,CONSTRAINT PK_USERS PRIMARY KEY (Userid)
   ,CONSTRAINT UK_Username UNIQUE (Username)
   ,CONSTRAINT CK_Password CHECK (LEN(Password) >= 5)
)

--16.Write a SQL statement to create a view that displays the users from the Users table that have been in the system today.
--Test if the view works correctly.
INSERT INTO Users (Username, Password, Fullname, LastLogin)
	VALUES ('CatWoman', 'someCat', 'BigPussy', GETDATE()), ('Batman', 'biggay', 'big mouse', GETDATE())
GO
CREATE VIEW [InfoForAllUsers]
AS
SELECT
	*
FROM Users
WHERE CONVERT(NVARCHAR(20), LastLogin, 104) = CONVERT(NVARCHAR(20), GETDATE(), 104)
GO

--17.Write a SQL statement to create a table Groups. Groups should have unique name (use unique constraint).
--Define primary key and identity column.
CREATE TABLE Groups (
	GroupId INT IDENTITY
   ,Name NVARCHAR(50) NOT NULL
   ,CONSTRAINT PK_Groups PRIMARY KEY (GroupId)
   ,CONSTRAINT UK_Name UNIQUE (Name)
)

--18.Write a SQL statement to add a column GroupID to the table Users.
--Fill some data in this new column and as well in the `Groups table.
--Write a SQL statement to add a foreign key constraint between tables Users and Groups tables.

--19.Write SQL statements to insert several records in the Users and Groups tables.

--20.Write SQL statements to update some of the records in the Users and Groups tables.

--21.Write SQL statements to delete some of the records from the Users and Groups tables.

--Transact SQL

--1.Create a database with two tables: Persons(Id(PK), FirstName, LastName, SSN) and Accounts(Id(PK), PersonId(FK), Balance).
--Insert few records for testing.
--Write a stored procedure that selects the full names of all persons.

CREATE DATABASE BankSystem

CREATE TABLE [BankSystem].[dbo].[People] (
	PersonID INT IDENTITY
   ,FirstName NVARCHAR(50)
   ,Lastname NVARCHAR(50)
   ,SSN NVARCHAR(50)
   ,CONSTRAINT PK_PersonID PRIMARY KEY (PersonID)
)

CREATE TABLE [BankSystem].[dbo].[Account] (
	AccountID INT IDENTITY
   ,PersonID INT NOT NULL
   ,Balance MONEY NOT NULL
   ,CONSTRAINT PK_AccountID PRIMARY KEY (AccountID)
   ,CONSTRAINT FK_Account_People_PersonID FOREIGN KEY (PersonID) REFERENCES [BankSystem].[dbo].[People] (PersonID)
)

INSERT INTO [BankSystem].[dbo].[People] (FirstName, Lastname, SSN)
	VALUES ('Ivan', 'Ivanov', '12345678'),
	('Pepa', 'Todora', '112244'),
	('Mitko', 'Kirqkov', '556677')

INSERT INTO [BankSystem].[dbo].[Account] (PersonID, Balance)
	VALUES (1, 333.55),
	(2, 2500.55),
	(3, 21000.300)

--2.Create a stored procedure that accepts a number as a parameter and returns all persons who have more money
--in their accounts than the supplied number.

GO
CREATE PROC usp_UsersWithMoreMoney @minMoney MONEY = 0
AS
	SELECT
		p.FirstName
	   ,p.Lastname
	   ,a.Balance
	FROM [BankSystem].[dbo].[People] p
	JOIN [BankSystem].[dbo].[Account] a
		ON p.PersonID = a.PersonID
	WHERE a.Balance > @minMoney
GO

CREATE PROC lessMoneyThanTenThousandExtension @maxMoney MONEY = 10000
AS
	SELECT
		p.FirstName + ' ' + p.Lastname AS [Fullname]
	   ,a.Balance AS [Balance]
	FROM People p
	JOIN Account a
		ON p.PersonID = a.PersonID
	WHERE a.Balance < @maxMoney

	--Test the procedure
	EXEC usp_UsersWithMoreMoney @minMoney = 2000
	EXEC lessMoneyThanTenThousandExtension @maxMoney = 50000

--3.Create a function that accepts as parameters – sum, yearly interest rate and number of months.
--It should calculate and return the new sum.
--Write a SELECT to test whether the function works as expected.
--sum = 12000 interest rate = 5.9% number of months = 5
GO
CREATE FUNCTION ufn_CalculateSumWithInterest (@sum MONEY, @yearInterest DECIMAL, @months INT) RETURNS MONEY
AS
BEGIN
RETURN (@sum + @sum*(@yearInterest/100)*@months/12)
END
GO

DECLARE @sum MONEY = (SELECT Balance FROM Account WHERE AccountID = 1)
PRINT dbo.ufn_CalculateSumWithInterest(@sum,5,5)


text:
package vanadis.common.io;

import java.io.IOException;

/**
 * A sensible, unchecked I/O exception.  Wraps the original IOException.
 */
public class IORuntimeException extends RuntimeException {

    private static final long serialVersionUID = -3235960585116007400L;

    public IORuntimeException(IOException e) {
        super(e);
    }

    public IORuntimeException(String msg, IOException e) {
        super(msg, e);
    }

    /**
     * The cause, with type narrowed to IOException.
     *
     * @return Cause
     */
    @Override
    public IOException getCause() {
        return (IOException)super.getCause();
    }
}


text:
<?php

require_once('AdminIndex.php');
require_once('SimpleLayout.php');
require_once('ModuleLoader.php');

$module_loader = new ModuleLoader();
$layout = new SimpleLayout();
$admin = new AdminIndex($layout, $module_loader);
$admin->run();
?>


text:
package com.yiya.utils;

import java.io.BufferedWriter;
import java.io.File;
import java.io.FileOutputStream;
import java.io.OutputStreamWriter;
import java.util.Properties;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.velocity.Template;
import org.apache.velocity.VelocityContext;
import org.apache.velocity.app.Velocity;
import org.apache.velocity.app.VelocityEngine;

/**
 *

 * 功能:详细的功能描述

 * 作者:罗泽军

 * 日期: 2011-7-22

 * 更新者:

 * 日期:

 * 更新内容:

 */
public class CommonPageParser {

	private static VelocityEngine ve;// = VelocityEngineUtil.getVelocityEngine();

	private static Properties properties;

	private final static String CONTENT_ENCODING ="UTF-8";

	private static final Log log = LogFactory.getLog(CommonPageParser.class);

	private static boolean isReplace = true;  //是否可以替换文件 true =可以替换,false =不可以替换

	public static void main(String[] args) {
	}

	static{
		try{
			//获取文件模板根路径
			String  templateBasePath = "D:\\Workspaces\\MyEclipse 8.6\\exhibition_hall\\template";//"F:\\360云盘\\YiYaWork\\YIYA_SERVICE\\template";//"Constant.WORK_TEMPLATE_PATH;

			Properties properties = new Properties();
			properties.setProperty(Velocity.RESOURCE_LOADER,"file");
			properties.setProperty("file.resource.loader.description","Velocity File Resource Loader");
			properties.setProperty(Velocity.FILE_RESOURCE_LOADER_PATH,  templateBasePath);
			properties.setProperty(Velocity.FILE_RESOURCE_LOADER_CACHE, "true");
	        properties.setProperty("file.resource.loader.modificationCheckInterval", "30");
	        properties.setProperty(Velocity.RUNTIME_LOG_LOGSYSTEM_CLASS,  "org.apache.velocity.runtime.log.Log4JLogChute");
	        properties.setProperty("runtime.log.logsystem.log4j.logger", "org.apache.velocity");
	        properties.setProperty("directive.set.null.allowed", "true");
			VelocityEngine velocityEngine = new VelocityEngine();
			velocityEngine.init(properties);
			ve = velocityEngine;
		}catch(Exception e){
			e.printStackTrace();
			log.error(e);
		}
	}

	/**
	 *

	 * 功能:生成页面文件

	 * 作者:罗泽军

	 * 日期: 2011-7-23

	 * @param context 内容上下文
	 * @param templateName 模板文件路径(相对路径)article\\article_main.html
	 * @param targetPage 生成页面文件路径(相对路径) vowo\index_1.html
	 */
	public static void WriterPage(VelocityContext context,String templateName,String fileDirPath,String targetFile){
		try{
			File file = new File(fileDirPath+targetFile);
			if(!file.exists()){
				new File(file.getParent()).mkdirs();
			}else{
				if(isReplace){
					log.info("替换文件"+file.getAbsolutePath());
				}else{
				}
			}

			Template template = ve.getTemplate(templateName, CONTENT_ENCODING);
			FileOutputStream fos = new FileOutputStream(file);
			BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(fos,CONTENT_ENCODING));
			template.merge(context, writer);
			writer.flush();
		    writer.close();
	    	fos.close();
	    	System.out.println("页面生成成功"+file.getAbsolutePath());
		}catch (Exception e) {
			log.error(e);
		}
	}

}


text:
<!DOCTYPE html>

    <title>Hyperion remote control</title>
    <meta charset="utf-8"/>
    <meta name="format-detection" content="telephone=no"/>
    <meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width"/>
    <link href="css/index.css" rel="stylesheet">
    <link rel="apple-touch-icon" href="res/icon_128.png">
    <meta name="apple-mobile-web-app-capable" content="yes">

                    <input type="range" value="1.00" min="0.00" max="1.00" step="0.02">



                    <input type="text" class="value" autocomplete="off" autocorrect="off" autocapitalize="off"/>



                Need server connection to fetch list.

                Need server connection to fetch list.



Color



Effects



Transform

n

Settings


text:
<title>SL.P.10.R.23.SL062003-13</title>

[1] Singh (common Indian last name) BJP (Bhartiya Janata Party - a political party in India) victory prize, award festival party election Congress political party in India, US Congress Modi (name)


text:
package net.dreamlu.easy.commons.owner;

import java.io.IOException;
import java.io.Serializable;
import java.net.URI;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
import java.util.Properties;
import java.util.concurrent.locks.ReentrantReadWriteLock;

import net.dreamlu.easy.commons.owner.loaders.Loader;
import net.dreamlu.easy.commons.owner.loaders.PropertiesLoader;
import net.dreamlu.easy.commons.owner.loaders.SystemLoader;

/**
 * This class is responsible of locating an appropriate Loader for a given URL (based the extension in the resource
 * name)and load the properties from it.
 *
 * @author Luigi R. Viggiano
 * @since 1.0.5
 */
class LoadersManager implements Serializable {
    private static final long serialVersionUID = -226703093706920069L;
    private final ReentrantReadWriteLock lock = new ReentrantReadWriteLock();
    private final List<Loader> loaders = new LinkedList<Loader>();

    LoadersManager() {
        registerLoader(new PropertiesLoader());
        registerLoader(new SystemLoader());
    }

    void load(Properties result, URI uri) throws IOException {
        Loader loader = findLoader(uri);
        loader.load(result, uri);
    }

    Loader findLoader(URI uri) {
        lock.readLock().lock();
        try {
            for (Loader loader : loaders)
                if (loader.accept(uri))
                    return loader;
            throw Util.unsupported("Can't resolve a Loader for the URL %s.", uri.toString());
        } finally {
            lock.readLock().unlock();
        }
    }

    final void registerLoader(Loader loader) {
        if (loader == null)
            throw new IllegalArgumentException("loader can't be null");
        lock.writeLock().lock();
        try {
            loaders.add(0, loader);
        } finally {
            lock.writeLock().unlock();
        }
    }

    void clear() {
        lock.writeLock().lock();
        try{
            loaders.clear();
        } finally {
            lock.writeLock().unlock();
        }
    }

    String[] defaultSpecs(String prefix) {
        lock.readLock().lock();
        try {
            List<String> defaultSpecs = new ArrayList<String>(loaders.size());
            for (Loader loader : loaders) {
                String spec = loader.defaultSpecFor(prefix);
                if (spec != null)
                    defaultSpecs.add(spec);
            }
            return defaultSpecs.toArray(new String[0]);
        } finally {
            lock.readLock().unlock();
        }
    }

}


text:
document.addEventListener('DOMContentLoaded', function() {
	disqus_shortname = document.getElementById('disqus_shortname').value.trim();
	disqus_identifier = document.getElementById('disqus_identifier').value.trim();
	//disqus_developer = 0; // 1 for testing
	disqus_url = window.location.origin + window.location.pathname;
	var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
	dsq.src = '//'+disqus_shortname+'.disqus.com/embed.js';
	(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
}, false);