text:
The MinIO Admin Golang Client SDK provides APIs to manage MinIO services.

This quickstart guide will show you how to install the MinIO Admin client SDK, connect to MinIO admin service, and provide a walkthrough of a simple file uploader.

This document assumes that you have a working [Golang setup](https://golang.org/doc/install).

## Initialize MinIO Admin Client object.

##  MinIO

```go

package main

import (
    "fmt"

    "github.com/minio/minio/pkg/madmin"
)

func main() {
    // Use a secure connection.
    ssl := true

    // Initialize minio client object.
    mdmClnt, err := madmin.New("your-minio.example.com:9000", "YOUR-ACCESSKEYID", "YOUR-SECRETKEY", ssl)
    if err != nil {
        fmt.Println(err)
        return
    }

    // Fetch service status.
    st, err := mdmClnt.ServerInfo()
    if err != nil {
        fmt.Println(err)
        return
    }
	for _, peerInfo := range serversInfo {
		log.Printf("Node: %s, Info: %v\n", peerInfo.Addr, peerInfo.Data)
	}
}

```

| Service operations                  | Info operations               | Healing operations | Config operations         |
|:------------------------------------|:------------------------------|:-------------------|:--------------------------|
| [`ServiceTrace`](#ServiceTrace)     | [`ServerInfo`](#ServerInfo)   | [`Heal`](#Heal)    | [`GetConfig`](#GetConfig) |
| [`ServiceStop`](#ServiceStop)       | [`StorageInfo`](#StorageInfo) |                    | [`SetConfig`](#SetConfig) |
| [`ServiceRestart`](#ServiceRestart) |                               |                    |                           |

| Top operations          | IAM operations                        | Misc                                              | KMS                             |
|:------------------------|:--------------------------------------|:--------------------------------------------------|:--------------------------------|
| [`TopLocks`](#TopLocks) | [`AddUser`](#AddUser)                 | [`StartProfiling`](#StartProfiling)               | [`GetKeyStatus`](#GetKeyStatus) |
|                         | [`SetUserPolicy`](#SetUserPolicy)     | [`DownloadProfilingData`](#DownloadProfilingData) |                                 |
|                         | [`ListUsers`](#ListUsers)             | [`ServerUpdate`](#ServerUpdate)                   |                                 |
|                         | [`AddCannedPolicy`](#AddCannedPolicy) |                                                   |                                 |

## 1. Constructor

### New(endpoint string, accessKeyID string, secretAccessKey string, ssl bool) (*AdminClient, error)
Initializes a new admin client object.

__Parameters__

| Param             | Type     | Description                                               |
|:------------------|:---------|:----------------------------------------------------------|
| `endpoint`        | _string_ | MinIO endpoint.                                           |
| `accessKeyID`     | _string_ | Access key for the object storage endpoint.               |
| `secretAccessKey` | _string_ | Secret key for the object storage endpoint.               |
| `ssl`             | _bool_   | Set this value to 'true' to enable secure (HTTPS) access. |

## 2. Service operations

### ServiceStatus(ctx context.Context) (ServiceStatusMetadata, error)
Fetch service status, replies disk space used, backend type and total disks offline/online (applicable in distributed mode).

| Param           | Type                    | Description                                                |
|-----------------|-------------------------|------------------------------------------------------------|
| `serviceStatus` | _ServiceStatusMetadata_ | Represents current server status info in following format: |

| Param                       | Type            | Description                        |
|-----------------------------|-----------------|------------------------------------|
| `st.ServerVersion.Version`  | _string_        | Server version.                    |
| `st.ServerVersion.CommitID` | _string_        | Server commit id.                  |
| `st.Uptime`                 | _time.Duration_ | Server uptime duration in seconds. |

 __Example__

 ```go

	st, err := madmClnt.ServiceStatus(context.Background())
	if err != nil {
		log.Fatalln(err)
	}
	log.Printf("%#v\n", st)

 ```

### ServiceRestart(ctx context.Context) error
Sends a service action restart command to MinIO server.

 __Example__

```go
   // To restart the service, restarts all servers in the cluster.
   err := madmClnt.ServiceRestart(context.Background())
   if err != nil {
       log.Fatalln(err)
   }
   log.Println("Success")
```

### ServiceStop(ctx context.Context) error
Sends a service action stop command to MinIO server.

 __Example__

```go
   // To stop the service, stops all servers in the cluster.
   err := madmClnt.ServiceStop(context.Background())
   if err != nil {
       log.Fatalln(err)
   }
   log.Println("Success")
```

### ServiceTrace(ctx context.Context, allTrace bool, doneCh <-chan struct{}) <-chan TraceInfo
Enable HTTP request tracing on all nodes in a MinIO cluster

__Example__

``` go
    doneCh := make(chan struct{})
    defer close(doneCh)
    // listen to all trace including internal API calls
    allTrace := true
    // Start listening on all trace activity.
    traceCh := madmClnt.ServiceTrace(context.Background(), allTrace, doneCh)
    for traceInfo := range traceCh {
        fmt.Println(traceInfo.String())
    }
```

## 3. Info operations

### ServerInfo(ctx context.Context) ([]ServerInfo, error)
Fetches information for all cluster nodes, such as server properties, storage information, network statistics, etc.

| Param                            | Type               | Description                                                        |
|----------------------------------|--------------------|--------------------------------------------------------------------|
| `si.Addr`                        | _string_           | Address of the server the following information is retrieved from. |
| `si.ConnStats`                   | _ServerConnStats_  | Connection statistics from the given server.                       |
| `si.HTTPStats`                   | _ServerHTTPStats_  | HTTP connection statistics from the given server.                  |
| `si.Properties`                  | _ServerProperties_ | Server properties such as region, notification targets.            |

| Param                       | Type            | Description                                        |
|-----------------------------|-----------------|----------------------------------------------------|
| `ServerProperties.Uptime`   | _time.Duration_ | Total duration in seconds since server is running. |
| `ServerProperties.Version`  | _string_        | Current server version.                            |
| `ServerProperties.CommitID` | _string_        | Current server commitID.                           |
| `ServerProperties.Region`   | _string_        | Configured server region.                          |
| `ServerProperties.SQSARN`   | _[]string_      | List of notification target ARNs.                  |

| Param                              | Type     | Description                         |
|------------------------------------|----------|-------------------------------------|
| `ServerConnStats.TotalInputBytes`  | _uint64_ | Total bytes received by the server. |
| `ServerConnStats.TotalOutputBytes` | _uint64_ | Total bytes sent by the server.     |

| Param                                | Type                    | Description                                             |
|--------------------------------------|-------------------------|---------------------------------------------------------|
| `ServerHTTPStats.TotalHEADStats`     | _ServerHTTPMethodStats_ | Total statistics regarding HEAD operations              |
| `ServerHTTPStats.SuccessHEADStats`   | _ServerHTTPMethodStats_ | Total statistics regarding successful HEAD operations   |
| `ServerHTTPStats.TotalGETStats`      | _ServerHTTPMethodStats_ | Total statistics regarding GET operations               |
| `ServerHTTPStats.SuccessGETStats`    | _ServerHTTPMethodStats_ | Total statistics regarding successful GET operations    |
| `ServerHTTPStats.TotalPUTStats`      | _ServerHTTPMethodStats_ | Total statistics regarding PUT operations               |
| `ServerHTTPStats.SuccessPUTStats`    | _ServerHTTPMethodStats_ | Total statistics regarding successful PUT operations    |
| `ServerHTTPStats.TotalPOSTStats`     | _ServerHTTPMethodStats_ | Total statistics regarding POST operations              |
| `ServerHTTPStats.SuccessPOSTStats`   | _ServerHTTPMethodStats_ | Total statistics regarding successful POST operations   |
| `ServerHTTPStats.TotalDELETEStats`   | _ServerHTTPMethodStats_ | Total statistics regarding DELETE operations            |
| `ServerHTTPStats.SuccessDELETEStats` | _ServerHTTPMethodStats_ | Total statistics regarding successful DELETE operations |

| Param                               | Type     | Description                                     |
|-------------------------------------|----------|-------------------------------------------------|
| `ServerHTTPMethodStats.Count`       | _uint64_ | Total number of operations.                     |
| `ServerHTTPMethodStats.AvgDuration` | _string_ | Average duration of Count number of operations. |

| Param                | Type     | Description                                           |
|----------------------|----------|-------------------------------------------------------|
| `DriveInfo.UUID`     | _string_ | Unique ID for each disk provisioned by server format. |
| `DriveInfo.Endpoint` | _string_ | Endpoint location of the remote/local disk.           |
| `DriveInfo.State`    | _string_ | Current state of the disk at endpoint.                |

 __Example__

 ```go

	serversInfo, err := madmClnt.ServerInfo(context.Background())
	if err != nil {
		log.Fatalln(err)
	}

	for _, peerInfo := range serversInfo {
		log.Printf("Node: %s, Info: %v\n", peerInfo.Addr, peerInfo.Data)
	}

 ```

### StorageInfo(ctx context.Context) (StorageInfo, error)

Fetches Storage information for all cluster nodes.

| Param                   | Type       | Description                                 |
|-------------------------|------------|---------------------------------------------|
| `storageInfo.Used`      | _[]int64_  | Used disk spaces.                           |
| `storageInfo.Total`     | _[]int64_  | Total disk spaces.                          |
| `storageInfo.Available` | _[]int64_  | Available disk spaces.                      |
| `StorageInfo.Backend`   | _struct{}_ | Represents backend type embedded structure. |

| Param                      | Type            | Description                                                                                |
|----------------------------|-----------------|--------------------------------------------------------------------------------------------------------------------------|
| `Backend.Type`             | _BackendType_   | Type of backend used by the server currently only FS or Erasure.                                                         |
| `Backend.OnlineDisks`      | _BackendDisks_  | Total number of disks online per node (only applies to Erasure backend) represented in map[string]int, is empty for FS.  |
| `Backend.OfflineDisks`     | _BackendDisks_  | Total number of disks offline per node (only applies to Erasure backend) represented in map[string]int, is empty for FS. |
| `Backend.StandardSCData`   | _int_           | Data disks set for standard storage class, is empty for FS.                                                              |
| `Backend.StandardSCParity` | _int_           | Parity disks set for standard storage class, is empty for FS.                                                            |
| `Backend.RRSCData`         | _int_           | Data disks set for reduced redundancy storage class, is empty for FS.                                                    |
| `Backend.RRSCParity`       | _int_           | Parity disks set for reduced redundancy storage class, is empty for FS.                                                  |
| `Backend.Sets`             | _[][]DriveInfo_ | Represents topology of drives in erasure coded sets.                                                                     |

__Example__

 ```go

	storageInfo, err := madmClnt.StorageInfo(context.Background())
	if err != nil {
		log.Fatalln(err)
	}

    log.Println(storageInfo)

 ```

## 5. Heal operations

### Heal(ctx context.Context, bucket, prefix string, healOpts HealOpts, clientToken string, forceStart bool, forceStop bool) (start HealStartSuccess, status HealTaskStatus, err error)

Start a heal sequence that scans data under given (possible empty)
`bucket` and `prefix`. The `recursive` bool turns on recursive
traversal under the given path. `dryRun` does not mutate on-disk data,
but performs data validation.

Two heal sequences on overlapping paths may not be initiated.

The progress of a heal should be followed using the same API `Heal`
by providing the `clientToken` previously obtained from a `Heal`
API. The server accumulates results of the heal traversal and waits
for the client to receive and acknowledge them using the status
request by providing `clientToken`.

__Example__

``` go

    opts := madmin.HealOpts{
            Recursive: true,
            DryRun:    false,
    }
    forceStart := false
    forceStop := false
    healPath, err := madmClnt.Heal(context.Background(), "", "", opts, "", forceStart, forceStop)
    if err != nil {
        log.Fatalln(err)
    }
    log.Printf("Heal sequence started at %s", healPath)

```

#### HealStartSuccess structure

| Param             | Type        | Description                                                                                |
|-------------------|-------------|----------------------------------------------------------------------------------------------------------------------------------|
| `s.ClientToken`   | _string_    | A unique token for a successfully started heal operation, this token is used to request realtime progress of the heal operation. |
| `s.ClientAddress` | _string_    | Address of the client which initiated the heal operation, the client address has the form "host:port".                           |
| `s.StartTime`     | _time.Time_ | Time when heal was initially started.                                                                                |

#### HealTaskStatus structure

| Param             | Type               | Description                                       |
|-------------------|--------------------|---------------------------------------------------|
| `s.Summary`       | _string_           | Short status of heal sequence                     |
| `s.FailureDetail` | _string_           | Error message in case of heal sequence failure    |
| `s.HealSettings`  | _HealOpts_         | Contains the booleans set in the `HealStart` call |
| `s.Items`         | _[]HealResultItem_ | Heal records for actions performed by server      |

#### HealResultItem structure

| Param                  | Type           | Description                                                     |
|------------------------|----------------|-----------------------------------------------------------------|
| `ResultIndex`          | _int64_        | Index of the heal-result record                                 |
| `Type`                 | _HealItemType_ | Represents kind of heal operation in the heal record            |
| `Bucket`               | _string_       | Bucket name                                                     |
| `Object`               | _string_       | Object name                                                     |
| `Detail`               | _string_       | Details about heal operation                                    |
| `DiskInfo.AvailableOn` | _[]int_        | List of disks on which the healed entity is present and healthy |
| `DiskInfo.HealedOn`    | _[]int_        | List of disks on which the healed entity was restored           |

## 6. Config operations

### GetConfig(ctx context.Context) ([]byte, error)
Get current `config.json` of a MinIO server.

__Example__

``` go
    configBytes, err := madmClnt.GetConfig(context.Background())
    if err != nil {
        log.Fatalf("failed due to: %v", err)
    }

    // Pretty-print config received as json.
    var buf bytes.Buffer
    err = json.Indent(buf, configBytes, "", "\t")
    if err != nil {
        log.Fatalf("failed due to: %v", err)
    }

    log.Println("config received successfully: ", string(buf.Bytes()))
```

### SetConfig(ctx context.Context, config io.Reader) error
Set a new `config.json` for a MinIO server.

__Example__

``` go
    config := bytes.NewReader([]byte(`config.json contents go here`))
    if err := madmClnt.SetConfig(context.Background(), config); err != nil {
        log.Fatalf("failed due to: %v", err)
    }
    log.Println("SetConfig was successful")
```

## 7. Top operations

### TopLocks(ctx context.Context) (LockEntries, error)
Get the oldest locks from MinIO server.

__Example__

``` go
    locks, err := madmClnt.TopLocks(context.Background())
    if err != nil {
        log.Fatalf("failed due to: %v", err)
    }

    out, err := json.Marshal(locks)
    if err != nil {
        log.Fatalf("Marshal failed due to: %v", err)
    }

    log.Println("TopLocks received successfully: ", string(out))
```

## 8. IAM operations

### AddCannedPolicy(ctx context.Context, policyName string, policy *iampolicy.Policy) error
Create a new canned policy on MinIO server.

__Example__

```
	policy, err := iampolicy.ParseConfig(strings.NewReader(`{"Version": "2012-10-17","Statement": [{"Action": ["s3:GetObject"],"Effect": "Allow","Resource": ["arn:aws:s3:::my-bucketname/*"],"Sid": ""}]}`))
    if err != nil {
        log.Fatalln(err)
    }

    if err = madmClnt.AddCannedPolicy(context.Background(), "get-only", policy); err != nil {
		log.Fatalln(err)
	}
```

### AddUser(ctx context.Context, user string, secret string) error
Add a new user on a MinIO server.

__Example__

``` go
	if err = madmClnt.AddUser(context.Background(), "newuser", "newstrongpassword"); err != nil {
		log.Fatalln(err)
	}
```

### SetUserPolicy(ctx context.Context, user string, policyName string) error
Enable a canned policy `get-only` for a given user on MinIO server.

__Example__

``` go
	if err = madmClnt.SetUserPolicy(context.Background(), "newuser", "get-only"); err != nil {
		log.Fatalln(err)
	}
```

### ListUsers(ctx context.Context) (map[string]UserInfo, error)
Lists all users on MinIO server.

__Example__

``` go
	users, err := madmClnt.ListUsers(context.Background());
    if err != nil {
		log.Fatalln(err)
	}
    for k, v := range users {
        fmt.Printf("User %s Status %s\n", k, v.Status)
    }
```

## 9. Misc operations

### ServerUpdate(ctx context.Context, updateURL string) (ServerUpdateStatus, error)
Sends a update command to MinIO server, to update MinIO server to latest release. In distributed setup it updates all servers atomically.

 __Example__

```go
   // Updates all servers and restarts all the servers in the cluster.
   // optionally takes an updateURL, which is used to update the binary.
   us, err := madmClnt.ServerUpdate(context.Background(), updateURL)
   if err != nil {
       log.Fatalln(err)
   }
   if us.CurrentVersion != us.UpdatedVersion {
       log.Printf("Updated server version from %s to %s successfully", us.CurrentVersion, us.UpdatedVersion)
   }
```

### StartProfiling(ctx context.Context, profiler string) error
Ask all nodes to start profiling using the specified profiler mode

__Example__

``` go
    startProfilingResults, err = madmClnt.StartProfiling(context.Background(), "cpu")
    if err != nil {
            log.Fatalln(err)
    }
    for _, result := range startProfilingResults {
        if !result.Success {
            log.Printf("Unable to start profiling on node `%s`, reason = `%s`\n", result.NodeName, result.Error)
        } else {
            log.Printf("Profiling successfully started on node `%s`\n", result.NodeName)
        }
    }

```

### DownloadProfilingData(ctx context.Context) ([]byte, error)
Download profiling data of all nodes in a zip format.

__Example__

``` go
    profilingData, err := madmClnt.DownloadProfilingData(context.Background())
    if err != nil {
            log.Fatalln(err)
    }

    profilingFile, err := os.Create("/tmp/profiling-data.zip")
    if err != nil {
            log.Fatal(err)
    }

    if _, err := io.Copy(profilingFile, profilingData); err != nil {
            log.Fatal(err)
    }

    if err := profilingFile.Close(); err != nil {
            log.Fatal(err)
    }

    if err := profilingData.Close(); err != nil {
            log.Fatal(err)
    }

    log.Println("Profiling data successfully downloaded.")
```

## 11. KMS

### GetKeyStatus(ctx context.Context, keyID string) (*KMSKeyStatus, error)
Requests status information about one particular KMS master key
from a MinIO server. The keyID is optional and the server will
use the default master key (configured via `MINIO_KMS_VAULT_KEY_NAME`
or `MINIO_KMS_MASTER_KEY`) if the keyID is empty.

__Example__

``` go
    keyInfo, err := madmClnt.GetKeyStatus(context.Background(), "my-minio-key")
    if err != nil {
       log.Fatalln(err)
    }
    if keyInfo.EncryptionErr != "" {
       log.Fatalf("Failed to perform encryption operation using '%s': %v\n", keyInfo.KeyID, keyInfo.EncryptionErr)
    }
    if keyInfo.UpdateErr != "" {
       log.Fatalf("Failed to perform key re-wrap operation using '%s': %v\n", keyInfo.KeyID, keyInfo.UpdateErr)
    }
    if keyInfo.DecryptionErr != "" {
       log.Fatalf("Failed to perform decryption operation using '%s': %v\n", keyInfo.KeyID, keyInfo.DecryptionErr)
    }
```


text:
<?php

namespace JSAppBundle\Entity;

use Doctrine\ORM\Mapping as ORM;
use JSAppBundle\Tools\Tools;
use Symfony\Component\HttpFoundation\File\File;

/**
 * Fichier
 *
 * @ORM\Table(name="fichier", indexes={@ORM\Index(name="FK_fichier_avoir_type", columns={"typ_id"}),
 * @ORM\Index(name="FK_fichier_commentaire", columns={"rev_id"}),
 * @ORM\Index(name="FK_fichiers_joint", columns={"art_id"})})
 * @ORM\Entity(repositoryClass="JSAppBundle\Dao\FichierRepository")
 * @ORM\HasLifecycleCallbacks
 */
class Fichier
{
    const DIRECTORY = "fichiers";
    /**
     * @var integer
     *
     * @ORM\Column(name="id", type="integer", nullable=false)
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="IDENTITY")
     */
    private $id;

    /**
     * @var string
     *
     * @ORM\Column(name="url", type="string", length=254, nullable=true)
     */
    private $url;

    /**
     * @var string
     *
     * @ORM\Column(name="description", type="string", length=254, nullable=true)
     */
    private $description;

    /**
     * @var Article
     *
     * @ORM\ManyToOne(targetEntity="Article")
     * @ORM\JoinColumns({
     *   @ORM\JoinColumn(name="art_id", referencedColumnName="id")
     * })
     */
    private $article;

    /**
     * @var Typefichier
     *
     * @ORM\ManyToOne(targetEntity="Typefichier")
     * @ORM\JoinColumns({
     *   @ORM\JoinColumn(name="typ_id", referencedColumnName="id")
     * })
     */
    private $typeFichier;

    /**
     * @var Review
     *
     * @ORM\ManyToOne(targetEntity="Review")
     * @ORM\JoinColumns({
     *   @ORM\JoinColumn(name="rev_id", referencedColumnName="id")
     * })
     */
    private $review;

    /**
     * @var File
     */
    public $fichier;

    /**
     * @return int
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * @param int $id
     */
    public function setId($id)
    {
        $this->id = $id;
    }

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

    /**
     * @param string $url
     */
    public function setUrl($url)
    {
        $this->url = $url;
    }

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

    /**
     * @param string $description
     */
    public function setDescription($description)
    {
        $this->description = $description;
    }

    /**
     * @return Article
     */
    public function getArticle()
    {
        return $this->article;
    }

    /**
     * @param Article $article
     */
    public function setArticle($article)
    {
        $this->article = $article;
    }

    /**
     * @return Typefichier
     */
    public function getTypeFichier()
    {
        return $this->typeFichier;
    }

    /**
     * @param Typefichier $typeFichier
     */
    public function setTypeFichier($typeFichier)
    {
        $this->typeFichier = $typeFichier;
    }

    /**
     * @return Review
     */
    public function getReview()
    {
        return $this->review;
    }

    /**
     * @param Review $review
     */
    public function setReview($review)
    {
        $this->review = $review;
    }

    /**
     * @ORM\PostLoad()
     */
    public function setImageUrl()
    {

        $rootDir = Tools::getUploadRootDir();

        $dir = Fichier::DIRECTORY;

        $fichierDir = Tools::createDir($rootDir, $dir, $this->getId());

        $nbFichier = Tools::countFileInDir($fichierDir);

        if ($nbFichier == 0) {
            $this->url = Tools::getWebPath($dir . '/default.png');
        } else {
            $files = glob($fichierDir . DIRECTORY_SEPARATOR . "*.*");
            if ($files && count($files) > 0) {
                $firstFile = $files[0];
                $index = strripos($firstFile, DIRECTORY_SEPARATOR) + 1;
                $this->url = Tools::getWebPath($dir . '/' . $this->getId() . '/' . substr($firstFile, $index));
            } else {
                $this->url = Tools::getWebPath($dir . '/default.png');
            }
        }
    }

    /**
     * @ORM\PostPersist()
     */
    public function postPersist()
    {
        $this->upload();
    }

    /**
     * @ORM\PostUpdate()
     */
    public function upload()
    {

        if (null === $this->fichier) {
            echo "uploading images: No files to upload";
            return;
        }

        $dir = Fichier::DIRECTORY;

        echo "uploading images: Image set";
        $rootDir = Tools::getUploadRootDir();
        $fichierDir = Tools::createDir($rootDir, $dir, $this->getId());
        Tools::deleteFiles($fichierDir);
        $nbFichier = Tools::countFileInDir($fichierDir);
        $nbFichier++;
        $nomFichier = $nbFichier . '.' . $this->fichier->guessExtension();
        $this->fichier->move($fichierDir, $nomFichier);
        unset($this->fichier);
        $this->fichier = null;
        $this->setImageUrl();
    }

    public function __clone()
    {
        $file=new File($this->url);
        $this->fichier=$file;
        $this->id=null;
    }

}

redpajama_set_name: RedPajamaGithub


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="generator" content="rustdoc">
    <meta name="description" content="Source to the Rust file `C:/bot/slave/nightly-dist-rustc-win-64/build/src/librustc_typeck\coherence\overlap.rs`.">
    <meta name="keywords" content="rust, rustlang, rust-lang">

    <title>overlap.rs.html -- source</title>

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

    <link rel="shortcut icon" href="http://www.rust-lang.org/favicon.ico">

        <form class="search-form js-only">

                <input class="search-input" name="search"
                       autocomplete="off"
                       placeholder="Click or press 'S' to search, '?' for more options..."
                       type="search">

        </form>

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159

// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.

//! Overlap: No two impls for the same trait are implemented for the
//! same type.

use middle::traits;
use middle::ty;
use middle::infer::{self, new_infer_ctxt};
use syntax::ast::{DefId};
use syntax::ast::{LOCAL_CRATE};
use syntax::ast;
use syntax::ast_util;
use syntax::visit;
use syntax::codemap::Span;
use util::nodemap::DefIdMap;
use util::ppaux::Repr;

pub fn check(tcx: &ty::ctxt) {
    let mut overlap = OverlapChecker { tcx: tcx, default_impls: DefIdMap() };
    overlap.check_for_overlapping_impls();

    // this secondary walk specifically checks for impls of defaulted
    // traits, for which additional overlap rules exist
    visit::walk_crate(&mut overlap, tcx.map.krate());
}

struct OverlapChecker<'cx, 'tcx:'cx> {
    tcx: &'cx ty::ctxt<'tcx>,

    // maps from a trait def-id to an impl id
    default_impls: DefIdMap<ast::NodeId>,
}

impl<'cx, 'tcx> OverlapChecker<'cx, 'tcx> {
    fn check_for_overlapping_impls(&self) {
        debug!("check_for_overlapping_impls");

        // Collect this into a vector to avoid holding the
        // refcell-lock during the
        // check_for_overlapping_impls_of_trait() check, since that
        // check can populate this table further with impls from other
        // crates.
        let trait_def_ids: Vec<(ast::DefId, Vec<ast::DefId>)> =
            self.tcx.trait_impls.borrow().iter().map(|(&k, v)| {
                // FIXME -- it seems like this method actually pushes
                // duplicate impls onto the list
                ty::populate_implementations_for_trait_if_necessary(self.tcx, k);
                (k, v.borrow().clone())
            }).collect();

        for &(trait_def_id, ref impls) in &trait_def_ids {
            self.check_for_overlapping_impls_of_trait(trait_def_id, impls);
        }
    }

    fn check_for_overlapping_impls_of_trait(&self,
                                            trait_def_id: ast::DefId,
                                            trait_impls: &Vec<ast::DefId>)
    {
        debug!("check_for_overlapping_impls_of_trait(trait_def_id={})",
               trait_def_id.repr(self.tcx));

        for (i, &impl1_def_id) in trait_impls.iter().enumerate() {
            if impl1_def_id.krate != ast::LOCAL_CRATE {
                // we don't need to check impls if both are external;
                // that's the other crate's job.
                continue;
            }

            for &impl2_def_id in &trait_impls[(i+1)..] {
                self.check_if_impls_overlap(trait_def_id,
                                            impl1_def_id,
                                            impl2_def_id);
            }
        }
    }

    fn check_if_impls_overlap(&self,
                              trait_def_id: ast::DefId,
                              impl1_def_id: ast::DefId,
                              impl2_def_id: ast::DefId)
    {
        assert_eq!(impl1_def_id.krate, ast::LOCAL_CRATE);

        debug!("check_if_impls_overlap({}, {}, {})",
               trait_def_id.repr(self.tcx),
               impl1_def_id.repr(self.tcx),
               impl2_def_id.repr(self.tcx));

        let infcx = infer::new_infer_ctxt(self.tcx);
        if !traits::overlapping_impls(&infcx, impl1_def_id, impl2_def_id) {
            return;
        }

        self.report_overlap_error(trait_def_id, impl1_def_id, impl2_def_id);
    }

    fn report_overlap_error(&self, trait_def_id: ast::DefId,
                            impl1: ast::DefId, impl2: ast::DefId) {

        span_err!(self.tcx.sess, self.span_of_impl(impl1), E0119,
                  "conflicting implementations for trait `{}`",
                  ty::item_path_str(self.tcx, trait_def_id));

        self.report_overlap_note(impl1, impl2);
    }

    fn report_overlap_note(&self, impl1: ast::DefId, impl2: ast::DefId) {

        if impl2.krate == ast::LOCAL_CRATE {
            span_note!(self.tcx.sess, self.span_of_impl(impl2),
                       "note conflicting implementation here");
        } else {
            let crate_store = &self.tcx.sess.cstore;
            let cdata = crate_store.get_crate_data(impl2.krate);
            span_note!(self.tcx.sess, self.span_of_impl(impl1),
                       "conflicting implementation in crate `{}`",
                       cdata.name);
        }
    }

    fn span_of_impl(&self, impl_did: ast::DefId) -> Span {
        assert_eq!(impl_did.krate, ast::LOCAL_CRATE);
        self.tcx.map.span(impl_did.node)
    }
}

impl<'cx, 'tcx,'v> visit::Visitor<'v> for OverlapChecker<'cx, 'tcx> {
    fn visit_item(&mut self, item: &'v ast::Item) {
        match item.node {
            ast::ItemDefaultImpl(_, _) => {
                // look for another default impl; note that due to the
                // general orphan/coherence rules, it must always be
                // in this crate.
                let impl_def_id = ast_util::local_def(item.id);
                let trait_ref = ty::impl_trait_ref(self.tcx, impl_def_id).unwrap();
                let prev_default_impl = self.default_impls.insert(trait_ref.def_id, item.id);
                match prev_default_impl {
                    Some(prev_id) => {
                        self.report_overlap_error(trait_ref.def_id,
                                                  impl_def_id,
                                                  ast_util::local_def(prev_id));
                    }
                    None => { }
                }
            }
            _ => {}
        }
    }
}

Keyboard shortcuts

?

Show this help dialog

S

Focus the search field

⇤

Move up in search results

⇥

Move down in search results

⏎

Go to active search result

Search tricks

                Prefix searches with a type followed by a colon (e.g.
                fn:) to restrict the search to a given type.

                Accepted types are: fn, mod,
                struct, enum,
                trait, typedef (or
                tdef).


text:
<!DOCTYPE html>

    <meta charset="UTF-8">
    <title>Docker Web Arch</title>

docker-web-arch

Hello!

This is your first time to use this archetype. You can change this page from /srv/www directory.

To see your PHP information here. To access rockmongo here.

Time: <?php echo date('d/m/Y H:i:s') ?>


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
    <title>Features</title>
    <link rel="root" href=""/>
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css">
    <link rel="stylesheet" type="text/css" href="../../css/jquery-ui-redmond.css"/>
    <link rel="stylesheet" type="text/css" href="../../css/style.css"/>
    <link rel="stylesheet" type="text/css" href="../../css/style-vis.css"/>
    <link rel="stylesheet" type="text/css" href="../../css/hint.css"/>

          home

          issue tracker

          <gcse:search></gcse:search>

        This page still pertains to UD version 1.

            It appears that you have Javascript disabled.
            Please consider enabling Javascript for this page to see the visualizations.

Features

Lexical features

          PronType

          NumType

          Poss

          Reflex

          +Abbr

          +Derivation

          +Style

          +Typo

          +Foreign

Inflectional features

          Nominal
          Verbal

          Gender
          VerbForm

          Animacy
          +InfForm

          Number
          +PartForm

          Case
          Mood

          Definite
          Tense

          Degree
          Aspect

          +Number[psor]
          Voice

          +Person[psor]
          Person

          Polarity

          +Connegative

© 2014–2021
            Universal Dependencies contributors.
            Site powered by Annodoc and brat
.


text:
package br.com.cominotti.olympics_api.server.infrastructure.persistence.repositories;

import br.com.cominotti.olympics_api.server.domain.model.Competitor;
import org.apache.deltaspike.data.api.EntityRepository;
import org.apache.deltaspike.data.api.Repository;

@Repository
public interface CompetitorRepository extends EntityRepository<Competitor, Integer> {

}


text:
public class QuizString {
    public static void main(String[] args) {
        String string1 = new String("Hallo");
        String string2 = new String("Hallo");
        if (string1 == string2) {
            System.out.println("string1 und string2 sind das selbe Objekt.");
        } else {
            System.out.println("string1 und string2 sind verschiedene Objekte.");
        }

        String string3 = "Hallo";
        String string4 = "Hallo";
        if (string3 == string4) {
            System.out.println("string3 und string4 sind das selbe Objekt.");
        } else {
            System.out.println("string3 und string4 sind verschiedene Objekte.");
        }
    }
}


text:
package com.ge.snowizard.core;

import static com.google.common.base.Preconditions.checkNotNull;
import static com.google.common.base.Preconditions.checkArgument;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.atomic.AtomicLong;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.codahale.metrics.Counter;
import com.codahale.metrics.MetricRegistry;
import com.ge.snowizard.exceptions.InvalidSystemClock;
import com.ge.snowizard.exceptions.InvalidUserAgentError;

public class IdWorker {

    private static final Logger LOGGER = LoggerFactory
            .getLogger(IdWorker.class);
    private static final Pattern AGENT_PATTERN = Pattern
            .compile("([a-zA-Z][a-zA-Z0-9\\-]*)");

    public static final long TWEPOCH = 1288834974657L;

    private static final long WORKER_ID_BITS = 5L;
    private static final long DATACENTER_ID_BITS = 5L;
    private static final long MAX_WORKER_ID = -1L ^ (-1L << WORKER_ID_BITS);
    private static final long MAX_DATACENTER_ID = -1L
            ^ (-1L << DATACENTER_ID_BITS);
    private static final long SEQUENCE_BITS = 12L;

    private static final long WORKER_ID_SHIFT = SEQUENCE_BITS;
    private static final long DATACENTER_ID_SHIFT = SEQUENCE_BITS
            + WORKER_ID_BITS;
    private static final long TIMESTAMP_LEFT_SHIFT = SEQUENCE_BITS
            + WORKER_ID_BITS + DATACENTER_ID_BITS;
    private static final long SEQUENCE_MASK = -1L ^ (-1L << SEQUENCE_BITS);

    private final MetricRegistry registry;
    private final Counter idsCounter;
    private final Counter exceptionsCounter;
    private final Map<String, Counter> agentCounters = new ConcurrentHashMap<String, Counter>();
    private final int workerId;
    private final int datacenterId;
    private final boolean validateUserAgent;

    private final AtomicLong lastTimestamp = new AtomicLong(-1L);
    private final AtomicLong sequence;

    /**
     * Constructor
     *
     * @param workerId
     *            Worker ID
     * @param datacenterId
     *            Datacenter ID
     */
    public IdWorker(final int workerId, final int datacenterId) {
        this(workerId, datacenterId, 0L, true, new MetricRegistry());
    }

    /**
     * Constructor
     *
     * @param workerId
     *            Worker ID
     * @param datacenterId
     *            Datacenter ID
     * @param startSequence
     *            Starting sequence number
     */
    public IdWorker(final int workerId, final int datacenterId,
            final long startSequence) {
        this(workerId, datacenterId, startSequence, true, new MetricRegistry());
    }

    /**
     * Constructor
     *
     * @param workerId
     *            Worker ID
     * @param datacenterId
     *            Datacenter ID
     * @param validateUserAgent
     *            Whether to validate the User-Agent headers or not
     */
    public IdWorker(final int workerId, final int datacenterId,
            final boolean validateUserAgent) {
        this(workerId, datacenterId, 0L, validateUserAgent,
                new MetricRegistry());
    }

    /**
     * Constructor
     *
     * @param workerId
     *            Worker ID
     * @param datacenterId
     *            Datacenter ID
     * @param startSequence
     *            Starting sequence number
     * @param validateUserAgent
     *            Whether to validate the User-Agent headers or not
     */
    public IdWorker(final int workerId, final int datacenterId,
            final long startSequence, final boolean validateUserAgent) {
        this(workerId, datacenterId, startSequence, validateUserAgent,
                new MetricRegistry());
    }

    /**
     * Constructor
     *
     * @param workerId
     *            Worker ID
     * @param datacenterId
     *            Datacenter ID
     * @param startSequence
     *            Starting sequence number
     * @param validateUserAgent
     *            Whether to validate the User-Agent headers or not
     * @param registry
     *            Metric Registry
     */
    public IdWorker(final int workerId, final int datacenterId,
            final long startSequence, final boolean validateUserAgent,
            final MetricRegistry registry) {

        checkNotNull(workerId);
        checkArgument(workerId >= 0, String.format(
                "worker Id can't be greater than %d or less than 0",
                MAX_WORKER_ID));
        checkArgument(workerId <= MAX_WORKER_ID, String.format(
                "worker Id can't be greater than %d or less than 0",
                MAX_WORKER_ID));

        checkNotNull(datacenterId);
        checkArgument(datacenterId >= 0, String.format(
                "datacenter Id can't be greater than %d or less than 0",
                MAX_DATACENTER_ID));
        checkArgument(datacenterId <= MAX_DATACENTER_ID, String.format(
                "datacenter Id can't be greater than %d or less than 0",
                MAX_DATACENTER_ID));

        checkNotNull(startSequence);

        this.workerId = workerId;
        this.datacenterId = datacenterId;
        this.validateUserAgent = validateUserAgent;
        this.registry = registry;

        LOGGER.info(
                "worker starting. timestamp left shift {}, datacenter id bits {}, worker id bits {}, sequence bits {}, workerid {}",
                TIMESTAMP_LEFT_SHIFT, DATACENTER_ID_BITS, WORKER_ID_BITS,
                SEQUENCE_BITS, workerId);

        sequence = new AtomicLong(startSequence);

        exceptionsCounter = registry.counter(MetricRegistry.name(
                IdWorker.class, "exceptions"));
        idsCounter = registry.counter(MetricRegistry.name(IdWorker.class,
                "ids_generated"));
    }

    /**
     * Get the next ID for a given user-agent
     *
     * @param agent
     *            User Agent
     * @return Generated ID
     * @throws InvalidUserAgentError
     *             When the user agent is invalid
     * @throws InvalidSystemClock
     *             When the system clock is moving backward
     */
    public long getId(final String agent) throws InvalidUserAgentError,
            InvalidSystemClock {
        if (!isValidUserAgent(agent)) {
            exceptionsCounter.inc();
            throw new InvalidUserAgentError();
        }

        final long id = nextId();
        genCounter(agent);

        return id;
    }

    /**
     * Return the worker ID
     *
     * @return Worker ID
     */
    public int getWorkerId() {
        return this.workerId;
    }

    /**
     * Return the data center ID
     *
     * @return Datacenter ID
     */
    public int getDatacenterId() {
        return this.datacenterId;
    }

    /**
     * Return the current system time in milliseconds.
     *
     * @return Current system time in milliseconds
     */
    public long getTimestamp() {
        return System.currentTimeMillis();
    }

    /**
     * Return the current sequence position
     *
     * @return Current sequence position
     */
    public long getSequence() {
        return sequence.get();
    }

    /**
     * Set the sequence to a given value
     *
     * @param value
     *            New sequence value
     */
    public void setSequence(final long value) {
        this.sequence.set(value);
    }

    /**
     * Get the next ID
     *
     * @return Next ID
     * @throws InvalidSystemClock
     *             When the clock is moving backward
     */
    public synchronized long nextId() throws InvalidSystemClock {
        long timestamp = timeGen();
        long curSequence = 0L;

        final long prevTimestamp = lastTimestamp.get();

        if (timestamp < prevTimestamp) {
            exceptionsCounter.inc();
            LOGGER.error(
                    "clock is moving backwards. Rejecting requests until {}",
                    prevTimestamp);
            throw new InvalidSystemClock(
                    String.format(
                            "Clock moved backwards. Refusing to generate id for %d milliseconds",
                            (prevTimestamp - timestamp)));
        }

        if (prevTimestamp == timestamp) {
            curSequence = sequence.incrementAndGet() & SEQUENCE_MASK;
            if (curSequence == 0) {
                timestamp = tilNextMillis(prevTimestamp);
            }
        } else {
            curSequence = 0L;
            sequence.set(0L);
        }

        lastTimestamp.set(timestamp);
        final long id = ((timestamp - TWEPOCH) << TIMESTAMP_LEFT_SHIFT)
                | (datacenterId << DATACENTER_ID_SHIFT)
                | (workerId << WORKER_ID_SHIFT) | curSequence;

        LOGGER.trace(
                "prevTimestamp = {}, timestamp = {}, sequence = {}, id = {}",
                prevTimestamp, timestamp, sequence, id);

        return id;
    }

    /**
     * Return the next time in milliseconds
     *
     * @param lastTimestamp
     *            Last timestamp
     * @return Next timestamp in milliseconds
     */
    protected long tilNextMillis(final long lastTimestamp) {
        long timestamp = timeGen();
        while (timestamp <= lastTimestamp) {
            timestamp = timeGen();
        }
        return timestamp;
    }

    /**
     * Generate a new timestamp (currently in milliseconds)
     *
     * @return current timestamp in milliseconds
     */
    protected long timeGen() {
        return System.currentTimeMillis();
    }

    /**
     * Check whether the user agent is valid
     *
     * @param agent
     *            User-Agent
     * @return True if the user agent is valid
     */
    public boolean isValidUserAgent(final String agent) {
        if (!validateUserAgent) {
            return true;
        }
        final Matcher matcher = AGENT_PATTERN.matcher(agent);
        return matcher.matches();
    }

    /**
     * Update the counters for a given user agent
     *
     * @param agent
     *            User-Agent
     */
    protected void genCounter(final String agent) {
        idsCounter.inc();
        if (!agentCounters.containsKey(agent)) {
            agentCounters.put(agent, registry.counter(MetricRegistry.name(
                    IdWorker.class, "ids_generated_" + agent)));
        }
        agentCounters.get(agent).inc();
    }
}


text:
using System;
using SortData;
using System.Diagnostics;
using _2._1._26;

var a = DataManager.GetUnsortedData(); // 获得 32 K 数据
var b = DataManager.GetUnsortedData();
// 耗时 1714 毫秒(@Surface Pro 3 i7 512G)
var sort = new InsertionSort();
var stopwatch = Stopwatch.StartNew();
sort.Sort(a);
Console.WriteLine(stopwatch.ElapsedMilliseconds);
// 耗时 9740 毫秒(@Surface Pro 3 i7 512G)
var sortOrigin = new Sort.InsertionSort();
stopwatch.Restart();
sortOrigin.Sort(b);
Console.WriteLine(stopwatch.ElapsedMilliseconds);


text:
package org.axhm3a.jme3boilerplate;

import android.os.Bundle;
import com.jme3.app.AndroidHarness;

public class AndroidMain extends AndroidHarness {
    public AndroidMain() {
        appClass = "org.axhm3a.jme3boilerplate.Main";
    }

    /**
     * Called when the activity is first created.
     */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
    }
}


text:
package simenv

import (
	"strconv"
	"sync"
)

/*
CurrentTick представляет из себя число, которое синхронизируется с SimEnv и
всегда содержит актуальное значение tick'а.

В первую очередь информация о наступлении
нового тика поступает в эти сущности, поэтому значение в нем может на единицу опережать
значения подконтрольных SimEnv'у Agent'ов.

Единственный корректный способ инициализоровать эту структуру - это использовать
cоответсвующий метод SimEnv'а.
*/
type CurrentTick struct {
	tick  int
	mutex *sync.Mutex
}

func (ct *CurrentTick) connect(ch chan int) {
	for {
		nextVal := <-ch
		if nextVal == -1 {
			break
		}
		ct.mutex.Lock()
		ct.tick = nextVal
		ct.mutex.Unlock()
	}
}

func (ct CurrentTick) String() string {
	return strconv.Itoa(ct.tick)
}

// Int возвращает номер текущего тика
func (ct *CurrentTick) Int() int {
	ct.mutex.Lock()
	defer ct.mutex.Unlock()
	return ct.tick
}


text:
chebpy
======

The begins of a python implementation of Chefun and Chefun2 in python


text:
package com.compositesw.services.system.admin.resource;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
import com.compositesw.services.system.util.common.AttributeList;
import com.compositesw.services.system.util.common.BaseRequest;
import com.compositesw.services.system.util.common.DetailLevel;

/**
 *
Java class for getDataSourceChildResourcesRequest complex type.
 *
 *
The following schema fragment specifies the expected content contained within this class.
 *
 *

 * <complexType name="getDataSourceChildResourcesRequest">
 *   <complexContent>
 *     <extension base="{http://www.compositesw.com/services/system/util/common}baseRequest">
 *       <sequence>
 *         <element name="path" type="{http://www.w3.org/2001/XMLSchema}string"/>
 *         <element name="dsPath" type="{http://www.w3.org/2001/XMLSchema}string"/>
 *         <element name="detail" type="{http://www.compositesw.com/services/system/util/common}detailLevel"/>
 *         <element name="attributes" type="{http://www.compositesw.com/services/system/util/common}attributeList" minOccurs="0"/>
 *       </sequence>
 *     </extension>
 *   </complexContent>
 * </complexType>
 *

 *
 *
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "getDataSourceChildResourcesRequest", propOrder = {
    "path",
    "dsPath",
    "detail",
    "attributes"
})
public class GetDataSourceChildResourcesRequest
    extends BaseRequest
{

    @XmlElement(required = true)
    protected String path;
    @XmlElement(required = true)
    protected String dsPath;
    @XmlElement(required = true)
    protected DetailLevel detail;
    protected AttributeList attributes;

    /**
     * Gets the value of the path property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getPath() {
        return path;
    }

    /**
     * Sets the value of the path property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setPath(String value) {
        this.path = value;
    }

    /**
     * Gets the value of the dsPath property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getDsPath() {
        return dsPath;
    }

    /**
     * Sets the value of the dsPath property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setDsPath(String value) {
        this.dsPath = value;
    }

    /**
     * Gets the value of the detail property.
     *
     * @return
     *     possible object is
     *     {@link DetailLevel }
     *
     */
    public DetailLevel getDetail() {
        return detail;
    }

    /**
     * Sets the value of the detail property.
     *
     * @param value
     *     allowed object is
     *     {@link DetailLevel }
     *
     */
    public void setDetail(DetailLevel value) {
        this.detail = value;
    }

    /**
     * Gets the value of the attributes property.
     *
     * @return
     *     possible object is
     *     {@link AttributeList }
     *
     */
    public AttributeList getAttributes() {
        return attributes;
    }

    /**
     * Sets the value of the attributes property.
     *
     * @param value
     *     allowed object is
     *     {@link AttributeList }
     *
     */
    public void setAttributes(AttributeList value) {
        this.attributes = value;
    }

}


text:
import csv

# Fonde, in un unico file csv, le colonne di due file csv. I due file vengono fusi sulla
# base di un confronto sul campo 'PostId'.
#
# Esempio: i due file che vogliono fondere hanno, uno i campi PostId e Body e l'altro i
# campi PostId, SentimentNegativeScore e SentimentPositiveScore. Il file risultante
# conterra' PostId, Body, SentimentNegativeScore e SentimentPositiveScore. Inoltre ogni
# istanza, del primo e del secondo file, saranno allineate sulla base del confronto
# su PostId. In particolare, due istanze, provenienti dai due file, verranno allineate
# se i due PostId sono uguali.
#
# parametri:
#	file_name_input: nome del file che si vuole fondere, deve contenere almeno il campo:
#				- 'PostId'
#	file_name_metric: nome del file che si vuole fondere, deve contenere almeno il campo:
#				- 'PostId'
#	output_file: nome del file su cui scrivere, conterra' i campi:
#				- 'PostId'
#				- tutti i campi di file_name_input
#				- tutti i campi di file_name_metric
def merge(file_name_input, file_name_metric, output_file):
	dict_reader_1 = csv.DictReader(open(file_name_input, 'r'), delimiter=';') # DELIMITER
	dict_reader_2 = csv.DictReader(open(file_name_metric, 'r'), delimiter=';') # DELIMITER

	head = dict_reader_1.fieldnames
	head_2 = dict_reader_2.fieldnames
	for h in head_2:
		if h != 'PostId':
			head.append(h)

	dict_writer = csv.DictWriter(open(output_file, 'w'), delimiter=';', fieldnames=head) # DELIMITER
	dict_writer.writerow(dict((fn,fn) for fn in head)) #Scrive gli header

	for row_1 in dict_reader_1:
		for row_2 in dict_reader_2:
			if row_2['PostId'] == row_1['PostId']:
				for h in head_2:
					if h != 'PostId':
						row_1[h] = row_2[h]
				break

		dict_writer.writerow(row_1)

	return 'Done'


text:
/**
* \file CircleGesture.h
*/

/******************************************************************************/
#pragma once

/******************************************************************************/
#include <windows.h>
#include "GestureBase.h"

/******************************************************************************/
/**
* Circle gestures are defined by centre point, radius, start and end angles,
* direction, tolerance and sensitivity. See constructor for details.
*/
class CCircleGesture: public CGestureBase
{
private:
	POINT ptCentre;		///< Centre of gesture
	int nRadius;		///< Radius of gesture

	int nRegions;		///< Number of regions covering gesture
	CCircleRegion **ppRegions;	///< Pointer to array of circluar regions covering the gesture

	int nSensitivity;	///< Sensitivity factor, see constructor for details

	HPEN hLinePen;		// Pen for drawing diagnostics

public:
	/**
	* Constructor for a circle gesture. Creates an array of circular sub-regions which span
	* the gesture path.
	* \param centre The centre of the gesture path
	* \param radius The radius of the gesture path
	* \param start_angle The starting angle of the gesture in degrees. Zero degrees is a horizontal line from the centre (i.e. at 3 o'clock).
	* \param end_angle The ending angle of the gesture in degrees. Zero degrees is a horizontal line from the centre (i.e. at 3 o'clock).
	* \param tolerance How close to the gesture path the mouse track must be; translates to the radius of the circluar regions covering the path.
	* \param sensitivity Minimum percentage of regions which must be crossed by the mouse track.
	*/
CCircleGesture::CCircleGesture (POINT centre, int radius, int start_angle, int end_angle,
		int tolerance, int sensitivity);
	~CCircleGesture ();

	void HandleMouseTrack (int npoints, POINT *ppoints);
	void Render (HDC hdc);
};


text:
ACCEPTED

#### According to
International Plant Names Index

#### Published in
null

#### Original name
Astroloma macrocalyx Sond.

### Remarks
null


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Polyblastia transwaalensis Müll. Arg.

### Remarks
null


text:
{{lang 'account.orders.details.order_contents'}}

    {{#each order.items}}
        {{#if shipping_rows.length}}
            {{#each shipping_rows}}

{{lang 'account.orders.details.ship_to_multi' street=address city=city state=state zip=zip country=country}}

            {{/each}}
        {{/if}}

                {{#if show_reorder}}
                    <input class="form-checkbox" type="checkbox" id="account-product-id-{{order_product_id}}" value="{{order_product_id}}">

                        Checkbox {{order_product_id}} label

                {{/if}}

                {{#if type '===' 'giftcertificate'}}

                {{else}}

                {{/if}}
                {{#unless refunded}}
                    {{#if download_url}}

                            {{lang 'account.orders.details.download_items'}}

                                <svg>
                                    <use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#icon-arrow-down"></use>
                                </svg>

                    {{/if}}
                {{/unless}}

                {{price.formatted}}

{{quantity}} × {{name}}

                {{#if brand}}

{{brand.name}}

                {{/if}}
                {{#if options}}

                    {{#each options}}

{{name}}:

{{value}}

                    {{/each}}

                {{/if}}
                {{#if gift_wrapping_name}}

{{lang 'account.orders.gift_wrapping'}}

{{gift_wrapping_name}}

                {{/if}}
                {{#if event_date}}

                            {{event_date.name}}:

                            {{event_date.date}}

                {{/if}}
                {{#if refunded}}

{{lang 'account.orders.refunded_quantity' qty=refunded_qty}}

                {{else}}
                    {{#if refunded_qty}}

{{lang 'account.orders.refunded_quantity' qty=refunded_qty}}

                    {{/if}}
                {{/if}}
                {{#if reorder_message}}

{{{reorder_message}}}

                {{/if}}

    {{/each}}


text:
/*
 * @test
 * @bug 5036565
 * @summary Annotations definitions are allowed using -source 1.4 but not annotations
 * @author gafter
 *
 * @compile/fail -source 1.4 MixedSource.java
 */

package mixed.source;

@interface foo {}


text:
.. _`pip install`:

===========
pip install
===========

Usage
=====

.. tab:: Unix/macOS

   .. pip-command-usage:: install "python -m pip"

.. tab:: Windows

   .. pip-command-usage:: install "py -m pip"

Description
===========

.. pip-command-description:: install

Overview
--------

pip install has several stages:

1. Identify the base requirements. The user supplied arguments are processed
   here.
2. Resolve dependencies. What will be installed is determined here.
3. Build wheels. All the dependencies that can be are built into wheels.
4. Install the packages (and uninstall anything being upgraded/replaced).

Note that ``pip install`` prefers to leave the installed version as-is
unless ``--upgrade`` is specified.

Argument Handling
-----------------

When looking at the items to be installed, pip checks what type of item
each is, in the following order:

1. Project or archive URL.
2. Local directory (which must contain a ``setup.py``, or pip will report
   an error).
3. Local file (a sdist or wheel format archive, following the naming
   conventions for those formats).
4. A requirement, as specified in :pep:`440`.

Each item identified is added to the set of requirements to be satisfied by
the install.

Working Out the Name and Version
--------------------------------

For each candidate item, pip needs to know the project name and version. For
wheels (identified by the ``.whl`` file extension) this can be obtained from
the filename, as per the Wheel spec. For local directories, or explicitly
specified sdist files, the ``setup.py egg_info`` command is used to determine
the project metadata. For sdists located via an index, the filename is parsed
for the name and project version (this is in theory slightly less reliable
than using the ``egg_info`` command, but avoids downloading and processing
unnecessary numbers of files).

Any URL may use the ``#egg=name`` syntax (see :doc:`../topics/vcs-support`) to
explicitly state the project name.

Satisfying Requirements
-----------------------

Once pip has the set of requirements to satisfy, it chooses which version of
each requirement to install using the simple rule that the latest version that
satisfies the given constraints will be installed (but see :ref:`here <Pre Release Versions>`
for an exception regarding pre-release versions). Where more than one source of
the chosen version is available, it is assumed that any source is acceptable
(as otherwise the versions would differ).

Obtaining information about what was installed
----------------------------------------------

The install command has a ``--report`` option that will generate a JSON report of what
pip has installed. In combination with the ``--dry-run`` and ``--ignore-installed`` it
can be used to *resolve* a set of requirements without actually installing them.

The report can be written to a file, or to standard output (using ``--report -`` in
combination with ``--quiet``).

The format of the JSON report is described in :doc:`../reference/installation-report`.

Installation Order
------------------

.. note::

   This section is only about installation order of runtime dependencies, and
   does not apply to build dependencies (those are specified using PEP 518).

As of v6.1.0, pip installs dependencies before their dependents, i.e. in
"topological order."  This is the only commitment pip currently makes related
to order.  While it may be coincidentally true that pip will install things in
the order of the install arguments or in the order of the items in a
requirements file, this is not a promise.

In the event of a dependency cycle (aka "circular dependency"), the current
implementation (which might possibly change later) has it such that the first
encountered member of the cycle is installed last.

For instance, if quux depends on foo which depends on bar which depends on baz,
which depends on foo:

.. tab:: Unix/macOS

   .. code-block:: console

      $ python -m pip install quux
      ...
      Installing collected packages baz, bar, foo, quux

      $ python -m pip install bar
      ...
      Installing collected packages foo, baz, bar

.. tab:: Windows

   .. code-block:: console

      C:\> py -m pip install quux
      ...
      Installing collected packages baz, bar, foo, quux

      C:\> py -m pip install bar
      ...
      Installing collected packages foo, baz, bar

Prior to v6.1.0, pip made no commitments about install order.

The decision to install topologically is based on the principle that
installations should proceed in a way that leaves the environment usable at each
step. This has two main practical benefits:

1. Concurrent use of the environment during the install is more likely to work.
2. A failed install is less likely to leave a broken environment.  Although pip
   would like to support failure rollbacks eventually, in the mean time, this is
   an improvement.

Although the new install order is not intended to replace (and does not replace)
the use of ``setup_requires`` to declare build dependencies, it may help certain
projects install from sdist (that might previously fail) that fit the following
profile:

1. They have build dependencies that are also declared as install dependencies
   using ``install_requires``.
2. ``python setup.py egg_info`` works without their build dependencies being
   installed.
3. For whatever reason, they don't or won't declare their build dependencies using
   ``setup_requires``.

.. _`0-requirements-file-format`:
.. rubric:: Requirements File Format

This section has been moved to :doc:`../reference/requirements-file-format`.

.. _`0-requirement-specifiers`:
.. rubric:: Requirement Specifiers

This section has been moved to :doc:`../reference/requirement-specifiers`.

.. _`0-per-requirement-overrides`:
.. rubric:: Per-requirement Overrides

This is now covered in :doc:`../reference/requirements-file-format`.

.. _`Pre Release Versions`:

Pre-release Versions
--------------------

Starting with v1.4, pip will only install stable versions as specified by
`pre-releases`_ by default. If a version cannot be parsed as a compliant :pep:`440`
version then it is assumed to be a pre-release.

If a Requirement specifier includes a pre-release or development version
(e.g. ``>=0.0.dev0``) then pip will allow pre-release and development versions
for that requirement. This does not include the != flag.

The ``pip install`` command also supports a :ref:`--pre <install_--pre>` flag
that enables installation of pre-releases and development releases.

.. _pre-releases: https://www.python.org/dev/peps/pep-0440/#handling-of-pre-releases

.. _`0-vcs-support`:
.. rubric:: VCS Support

This is now covered in :doc:`../topics/vcs-support`.

Finding Packages
----------------

pip searches for packages on `PyPI`_ using the
`HTTP simple interface <https://pypi.org/simple/>`_,
which is documented `here <https://packaging.python.org/specifications/simple-repository-api/>`_
and `there <https://www.python.org/dev/peps/pep-0503/>`_.

pip offers a number of package index options for modifying how packages are
found.

pip looks for packages in a number of places: on PyPI (if not disabled via
``--no-index``), in the local filesystem, and in any additional repositories
specified via ``--find-links`` or ``--index-url``. There is no ordering in
the locations that are searched. Rather they are all checked, and the "best"
match for the requirements (in terms of version number - see :pep:`440` for
details) is selected.

See the :ref:`pip install Examples<pip install Examples>`.

.. _`0-ssl certificate verification`:
.. rubric:: SSL Certificate Verification

This is now covered in :doc:`../topics/https-certificates`.

.. _`0-caching`:
.. rubric:: Caching

This is now covered in :doc:`../topics/caching`.

.. _`0-wheel-cache`:
.. rubric:: Wheel Cache

This is now covered in :doc:`../topics/caching`.

.. _`0-hash-checking-mode`:
.. rubric:: Hash checking mode

This is now covered in :doc:`../topics/secure-installs`.

.. _`0-local-project-installs`:
.. rubric:: Local Project Installs

This is now covered in :doc:`../topics/local-project-installs`.

.. _`0-editable-installs`:
.. rubric:: Editable installs

This is now covered in :doc:`../topics/local-project-installs`.

.. _`0-build-system-interface`:
.. rubric:: Build System Interface

This is now covered in :doc:`../reference/build-system/index`.

.. _`pip install Options`:

Options
=======

.. pip-command-options:: install

.. pip-index-options:: install

.. _`pip install Examples`:

Examples
========

#. Install ``SomePackage`` and its dependencies from `PyPI`_ using :ref:`Requirement Specifiers`

   .. tab:: Unix/macOS

      .. code-block:: shell

         python -m pip install SomePackage            # latest version
         python -m pip install SomePackage==1.0.4     # specific version
         python -m pip install 'SomePackage>=1.0.4'   # minimum version

   .. tab:: Windows

      .. code-block:: shell

         py -m pip install SomePackage            # latest version
         py -m pip install SomePackage==1.0.4     # specific version
         py -m pip install 'SomePackage>=1.0.4'   # minimum version

#. Install a list of requirements specified in a file.  See the :ref:`Requirements files <Requirements Files>`.

   .. tab:: Unix/macOS

      .. code-block:: shell

         python -m pip install -r requirements.txt

   .. tab:: Windows

      .. code-block:: shell

         py -m pip install -r requirements.txt

#. Upgrade an already installed ``SomePackage`` to the latest from PyPI.

   .. tab:: Unix/macOS

      .. code-block:: shell

         python -m pip install --upgrade SomePackage

   .. tab:: Windows

      .. code-block:: shell

         py -m pip install --upgrade SomePackage

    .. note::

      This will guarantee an update to ``SomePackage`` as it is a direct
      requirement, and possibly upgrade dependencies if their installed
      versions do not meet the minimum requirements of ``SomePackage``.
      Any non-requisite updates of its dependencies (indirect requirements)
      will be affected by the ``--upgrade-strategy`` command.

#. Install a local project in "editable" mode. See the section on :ref:`Editable Installs <editable-installs>`.

   .. tab:: Unix/macOS

      .. code-block:: shell

         python -m pip install -e .                # project in current directory
         python -m pip install -e path/to/project  # project in another directory

   .. tab:: Windows

      .. code-block:: shell

         py -m pip install -e .                 # project in current directory
         py -m pip install -e path/to/project   # project in another directory

#. Install a project from VCS

   .. tab:: Unix/macOS

      .. code-block:: shell

         python -m pip install SomeProject@git+https://git.repo/some_pkg.git@1.3.1

   .. tab:: Windows

      .. code-block:: shell

         py -m pip install SomeProject@git+https://git.repo/some_pkg.git@1.3.1

#. Install a project from VCS in "editable" mode. See the sections on :doc:`../topics/vcs-support` and :ref:`Editable Installs <editable-installs>`.

   .. tab:: Unix/macOS

      .. code-block:: shell

         python -m pip install -e git+https://git.repo/some_pkg.git#egg=SomePackage          # from git
         python -m pip install -e hg+https://hg.repo/some_pkg.git#egg=SomePackage            # from mercurial
         python -m pip install -e svn+svn://svn.repo/some_pkg/trunk/#egg=SomePackage         # from svn
         python -m pip install -e git+https://git.repo/some_pkg.git@feature#egg=SomePackage  # from 'feature' branch
         python -m pip install -e "git+https://git.repo/some_repo.git#egg=subdir&subdirectory=subdir_path" # install a python package from a repo subdirectory

   .. tab:: Windows

      .. code-block:: shell

         py -m pip install -e git+https://git.repo/some_pkg.git#egg=SomePackage          # from git
         py -m pip install -e hg+https://hg.repo/some_pkg.git#egg=SomePackage            # from mercurial
         py -m pip install -e svn+svn://svn.repo/some_pkg/trunk/#egg=SomePackage         # from svn
         py -m pip install -e git+https://git.repo/some_pkg.git@feature#egg=SomePackage  # from 'feature' branch
         py -m pip install -e "git+https://git.repo/some_repo.git#egg=subdir&subdirectory=subdir_path" # install a python package from a repo subdirectory

#. Install a package with `extras`_.

   .. tab:: Unix/macOS

      .. code-block:: shell

         python -m pip install SomePackage[PDF]
         python -m pip install "SomePackage[PDF] @ git+https://git.repo/SomePackage@main#subdirectory=subdir_path"
         python -m pip install .[PDF]  # project in current directory
         python -m pip install SomePackage[PDF]==3.0
         python -m pip install SomePackage[PDF,EPUB]  # multiple extras

   .. tab:: Windows

      .. code-block:: shell

         py -m pip install SomePackage[PDF]
         py -m pip install "SomePackage[PDF] @ git+https://git.repo/SomePackage@main#subdirectory=subdir_path"
         py -m pip install .[PDF]  # project in current directory
         py -m pip install SomePackage[PDF]==3.0
         py -m pip install SomePackage[PDF,EPUB]  # multiple extras

#. Install a particular source archive file.

   .. tab:: Unix/macOS

      .. code-block:: shell

         python -m pip install ./downloads/SomePackage-1.0.4.tar.gz
         python -m pip install http://my.package.repo/SomePackage-1.0.4.zip

   .. tab:: Windows

      .. code-block:: shell

         py -m pip install ./downloads/SomePackage-1.0.4.tar.gz
         py -m pip install http://my.package.repo/SomePackage-1.0.4.zip

#. Install a particular source archive file following :pep:`440` direct references.

   .. tab:: Unix/macOS

      .. code-block:: shell

         python -m pip install SomeProject@http://my.package.repo/SomeProject-1.2.3-py33-none-any.whl
         python -m pip install "SomeProject @ http://my.package.repo/SomeProject-1.2.3-py33-none-any.whl"
         python -m pip install SomeProject@http://my.package.repo/1.2.3.tar.gz

   .. tab:: Windows

      .. code-block:: shell

         py -m pip install SomeProject@http://my.package.repo/SomeProject-1.2.3-py33-none-any.whl
         py -m pip install "SomeProject @ http://my.package.repo/SomeProject-1.2.3-py33-none-any.whl"
         py -m pip install SomeProject@http://my.package.repo/1.2.3.tar.gz

#. Install from alternative package repositories.

   Install from a different index, and not `PyPI`_

   .. tab:: Unix/macOS

      .. code-block:: shell

         python -m pip install --index-url http://my.package.repo/simple/ SomePackage

   .. tab:: Windows

      .. code-block:: shell

         py -m pip install --index-url http://my.package.repo/simple/ SomePackage

   Install from a local flat directory containing archives (and don't scan indexes):

   .. tab:: Unix/macOS

      .. code-block:: shell

         python -m pip install --no-index --find-links=file:///local/dir/ SomePackage
         python -m pip install --no-index --find-links=/local/dir/ SomePackage
         python -m pip install --no-index --find-links=relative/dir/ SomePackage

   .. tab:: Windows

      .. code-block:: shell

         py -m pip install --no-index --find-links=file:///local/dir/ SomePackage
         py -m pip install --no-index --find-links=/local/dir/ SomePackage
         py -m pip install --no-index --find-links=relative/dir/ SomePackage

   Search an additional index during install, in addition to `PyPI`_

   .. warning::

       Using this option to search for packages which are not in the main
       repository (such as private packages) is unsafe, per a security
       vulnerability called
       `dependency confusion <https://azure.microsoft.com/en-us/resources/3-ways-to-mitigate-risk-using-private-package-feeds/>`_:
       an attacker can claim the package on the public repository in a way that
       will ensure it gets chosen over the private package.

   .. tab:: Unix/macOS

      .. code-block:: shell

         python -m pip install --extra-index-url http://my.package.repo/simple SomePackage

   .. tab:: Windows

      .. code-block:: shell

         py -m pip install --extra-index-url http://my.package.repo/simple SomePackage

#. Find pre-release and development versions, in addition to stable versions.  By default, pip only finds stable versions.

   .. tab:: Unix/macOS

      .. code-block:: shell

         python -m pip install --pre SomePackage

   .. tab:: Windows

      .. code-block:: shell

         py -m pip install --pre SomePackage

#. Install packages from source.

   Do not use any binary packages

   .. tab:: Unix/macOS

      .. code-block:: shell

         python -m pip install SomePackage1 SomePackage2 --no-binary :all:

   .. tab:: Windows

      .. code-block:: shell

         py -m pip install SomePackage1 SomePackage2 --no-binary :all:

   Specify ``SomePackage1`` to be installed from source:

   .. tab:: Unix/macOS

      .. code-block:: shell

         python -m pip install SomePackage1 SomePackage2 --no-binary SomePackage1

   .. tab:: Windows

      .. code-block:: shell

         py -m pip install SomePackage1 SomePackage2 --no-binary SomePackage1

.. _extras: https://www.python.org/dev/peps/pep-0508/#extras
.. _PyPI: https://pypi.org/


text:
/* jshint multistr: true */

angular.module('Mac').
/**
 * @ngdoc constant
 * @name macTooltipDefaults
 * @description
 * Default values for mac-tooltip
 */
constant('macTooltipDefaults', {
  direction: 'top',
  trigger: 'hover',
  inside: false,
  class: 'visible'
}).

/**
 * @ngdoc constant
 * @name macTimeDefaults
 * @description
 * Default values for mac-time
 */
constant('macTimeDefaults', {
  default: '12:00 AM',
  placeholder: '--:--'
}).

/**
 * @ngdoc constant
 * @name scrollSpyDefaults
 * @description
 * Default values for mac-scroll-spy
 */
constant('scrollSpyDefaults', {
  offset: 0,
  highlightClass: 'active'
}).

/**
 * @ngdoc constant
 * @name macPopoverDefaults
 * @description
 * Default values for mac-popover
 */
constant('macPopoverDefaults', {
  trigger: {
    offsetY: 0,
    offsetX: 0,
    trigger: 'click',
    container: null
  },
  element: {
    footer: false,
    header: false,
    title: '',
    direction: 'above left',
    refreshOn: ''
  },
  template: "
\

\

\

{{macPopoverTitle}}
\

\

\

"
}).

/**
 * @ngdoc constant
 * @name macModalDefaults
 * @description
 * Default values for mac-modal
 */
constant('macModalDefaults', {
  keyboard: false,
  overlayClose: false,
  resize: false,
  position: true,
  open: angular.noop,
  topOffset: 20,
  attributes: {},
  beforeShow: angular.noop,
  afterShow: angular.noop,
  beforeHide: angular.noop,
  afterHide: angular.noop,
  template: "
\

\
      \

\

\

"
}).

/**
 * @ngdoc constant
 * @name macAffixDefaults
 * @description
 * Default values for mac-affix
 */
constant('macAffixDefaults', {
  top: 0,
  bottom: 0,
  disabled: false,
  classes: "affix affix-top affix-bottom"
});


text:
package uva.tomo100;
//uva 10004.
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.IOException;

import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.LinkedList;
import java.util.Locale;
import java.util.StringTokenizer;;

public class Bicoloring {
	static BufferedReader input;

	static StringTokenizer _stk;

	static String readln() throws IOException {
		String l = input.readLine();
		if (l != null)
			_stk = new StringTokenizer(l, " ");
		return l;
	}

	static String next() {
		return _stk.nextToken();
	}

	static int nextInt() {
		return Integer.parseInt(next());
	}

	static void dbg(Object... o) {
		System.out.println(Arrays.deepToString(o));
	}

	// static PrintWriter output = new PrintWriter(new BufferedWriter(new
	// OutputStreamWriter(System.out)));

	public static void main(String[] args) throws IOException {
		Locale.setDefault(Locale.US);
//		 input=new BufferedReader(new InputStreamReader(System.in));
		input = new BufferedReader(new FileReader("Bicoloring"));

		while (true) {
			readln();
			V = nextInt();
			if (V == 0) {
				break;
			}
			AdjList = new LinkedList[V];
			for (int i = 0; i < V; i++) {
				AdjList[i] = new LinkedList<Edge1>();
			}

			readln();
			edges = nextInt();
			for (int i = 0; i < edges; i++) {
				readln();
				a = nextInt();
				b = nextInt();
				AdjList[a].add(new Edge1(b, 0));
				AdjList[b].add(new Edge1(a, 0));
			}

			BFSBipSimple(0);

			if (isBipartite) {
				System.out.println("BICOLORABLE.");
			} else {
				System.out.println("NOT BICOLORABLE.");
			}

		}
	}

	static int V, E, a, b, edges;

	static LinkedList<Edge1>[] AdjList;
	static boolean isBipartite;

	public static void BFSBipSimple(int s) {

		int[] dist = new int[V];
		Arrays.fill(dist, -1); // to store parent information
		dist[s] = 0; // distance to source is 0 (default)
		LinkedList<Integer> q = new LinkedList<Integer>();

		q.offer(s);// start from source
		isBipartite = true; // un boolean para ver bipartite

		while (!q.isEmpty()) {
			int u = q.poll();// queue: layer by layer!
			// if(u==fin) return respuesta;//para cuando se esta buscando una
			// solucion
			// reverseMapper maps index to actual vertex label
			for (int j = 0; j < AdjList[u].size(); j++) {
				Edge1 v = AdjList[u].get(j); // for each neighbors of u
				if (dist[v.to] == -1) {
					dist[v.to] = 1 - dist[u];// solo le pongo el color
					q.offer(v.to);
				} else if (dist[v.to] == dist[u])
					isBipartite = false;
			}
		}
	}
}

class Edge1 {
	Integer to, value;

	public Edge1(Integer f, Integer s) {
		to = f;
		value = s;
	}
}


text:
title: A Time to Seek, and a Time To Lose
authorId: The Utopian
createdAt: 2016-08-01T20:08:00-07:00
category: Faith
---

*"Give me only your love and your grace. With this I am rich enough, and
I have no more to ask."*

—St. Ignatius of Loyola

Ecclesiastes was read in church today – which is never on the greatest
hits list: "vanity of vanities" and all that. It's sort of a dour start
to the week. But in many ways, this is what's striking to me about the
book. Because one of the purposes of faith is that it's supposed to
answer for us the hard question of purpose and death: What makes my life
matter if I know I'm not going to be here to see it all through. And
faith does answer this to some degree: we have Christ, we have eternity,
and we know that we'll be with our loved ones forever, at least if God
in His mercy and grace allows. But that doesn't explain my emotional
reaction to the message. And I think that's for one of two reasons, or
perhaps some of both: (1) there's either some doubt that I have that my
faith is true, or (2) that for all that I may believe that my hope lies
in eternity, there are a whole slew of things in life that still matter
to me that I, perhaps for good reason, would morn to lose.

Doubt, I think is never going to be entirely absent from our life on
earth: True faith is impossible in the presence of certainty. (Though,
perhaps the writer of Hebrews disagrees). And maybe this is a good
thing: Seeking the Divine even in the face of difficulty, including the
difficulty of knowing truth, makes that faith more meaningful and pure.
For this reason, our Lord blesses us today as "those who have not seen
and yet have come to believe." But it also means the problem of meaning
is never far from us. Maybe this also is a good thing? The need for
meaning is one of the sparks that draws us to faith, when we feel far
away from God it forces us to re-examine our life to align more closely
with the Gospel, and in that reflection it also draws us to look towards
others – even if the feeling is uncomfortable.

Which of course, is the second reason I find Ecclesiastes to be
challenging (other than my version not translating "Qoheleth" into
"Teacher"): Much of my life, particularly as a young attorney, is
devoted to hard work – defined by it even. Perhaps to drive the point
home, today's Gospel was the story in Luke 12 of the rich man whose
bountiful harvest was left after his life was demanded of him in the
night. Hard work, of course, is inevitable and desirable: much good can
come from trying to accomplish something for my client and my community
that will be meaningful – perhaps even lasting. Unlike St. Ignatius,
many of us can't spend much of our lives living in a cave, but where
"your treasure is, there your heart will be also." And there's no doubt,
that as a young professional, while I may also wish to help others, I
also very much want to have earthly treasure, comfort, and rest: These
are good things and are much preferable to suffering. But after too much
of them, and after perhaps too little service, Qoheleth ends up back on
the reading list.


text:
package de.unistuttgart.iaas.chor.integration.event.registry.domain.util;

import java.util.List;

import de.unistuttgart.iaas.chor.integration.event.registry.domain.ActivityInstance;

public class Tuple {

	private List<ActivityInstance> activityInstances;
	private boolean completeRewind;

	public List<ActivityInstance> getActivityInstances() {
		return activityInstances;
	}

	public void setActivityInstances(List<ActivityInstance> activityInstances) {
		this.activityInstances = activityInstances;
	}

	public boolean isCompleteRewind() {
		return completeRewind;
	}

	public void setCompleteRewind(boolean completeRewind) {
		this.completeRewind = completeRewind;
	}

}


text:
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
	<item android:left="-300dp"
		  android:right="-300dp">
		<rotate
			android:drawable="@drawable/dash_line_divider_horizontal"
			android:fromDegrees="90"
			android:toDegrees="90"
			android:visible="true"/>
	</item>
</layer-list>


text:
from pyramid.security import NO_PERMISSION_REQUIRED, Authenticated

from kinto.core import Service

hello = Service(name="hello", path='/', description="Welcome")

@hello.get(permission=NO_PERMISSION_REQUIRED)
def get_hello(request):
    """Return information regarding the current instance."""
    settings = request.registry.settings
    project_name = settings['project_name']
    project_version = settings['project_version']
    data = dict(
        project_name=project_name,
        project_version=project_version,
        http_api_version=settings['http_api_version'],
        project_docs=settings['project_docs'],
        url=request.route_url(hello.name)
    )

    eos = get_eos(request)
    if eos:
        data['eos'] = eos

    data['settings'] = {}
    public_settings = request.registry.public_settings
    for setting in list(public_settings):
        data['settings'][setting] = settings[setting]

    # If current user is authenticated, add user info:
    # (Note: this will call authenticated_userid() with multiauth+groupfinder)
    if Authenticated in request.effective_principals:
        data['user'] = request.get_user_info()

    # Application can register and expose arbitrary capabilities.
    data['capabilities'] = request.registry.api_capabilities

    return data

def get_eos(request):
    return request.registry.settings['eos']


text:
from copy import deepcopy

from typecast.value import String, Boolean, Integer, Float, Decimal
from typecast.date import DateTime, Date
from typecast.guess import TypeGuesser, GUESS_TYPES
from typecast.converter import ConverterError  # noqa
from typecast.name import name  # noqa

CONVERTERS = [String, Boolean, Integer, Float, Decimal, DateTime, Date]

TYPES = {
    'any': String,
    'string': String,
    'text': String,
    'integer': Integer,
    'number': Float,
    'float': Float,
    'double': Float,
    'decimal': Decimal,
    'date': Date,
    'datetime': DateTime,
    'date-time': DateTime,
    'boolean': Boolean,
    'bool': Boolean
}

def _field_options(field, opts):
    if isinstance(field, dict):
        _extra = opts
        opts = deepcopy(field)
        opts.update(_extra)
        field = opts.get('type')
    return field, opts

def converter(type_name):
    """Get a given converter by name, or raise an exception."""
    converter = TYPES.get(type_name)
    if converter is None:
        raise ConverterError('Unknown converter: %r' % type_name)
    return converter()

def cast(type_name, value, **opts):
    """Convert a given string to the type indicated by ``type_name``.

    If ``None`` is passed in, it will always be returned.
    Optional arguments can include ``true_values`` and ``false_values`` to
    describe boolean types, and ``format`` for dates.
    """
    type_name, opts = _field_options(type_name, opts)
    return converter(type_name).cast(value, **opts)

def stringify(type_name, value, **opts):
    """Generate a string representation of the data in ``value``.

    Based on the converter specified by ``type_name``. This is
    guaranteed to yield a form which can easily be parsed by ``cast()``.
    """
    type_name, opts = _field_options(type_name, opts)
    return converter(type_name).stringify(value, **opts)

def instances():
    """Yield a set of possible configurations for the various types.

    This can be used to perform type-guessing by checking the applicability
    of each converter against a set of sample data.
    """
    for converter in CONVERTERS:
        for inst in converter.instances():
            yield inst

def guesser(types=GUESS_TYPES, strict=False):
    """Create a type guesser for multiple values."""
    return TypeGuesser(types=types, strict=strict)


text:
namespace helper
{

}


text:
namespace IECoreMaya
{

/// The TransientParameterisedHolderNode is a special type of ParameterisedHolderNode which only exists for the purposes of being
/// able to create Attribute Editor panels out of "thin air". One of thse node types can be created temporarily for this purpose,
/// having the same lifespan as the UI's containing layout.
class IECOREMAYA_API TransientParameterisedHolderNode : public ParameterisedHolderNode
{
	public:

		TransientParameterisedHolderNode();
		virtual ~TransientParameterisedHolderNode();

		static void *creator();
		static MStatus initialize();

		/// This is a template class instantiated into many different
		/// classes, so we specialise these in the implementation.
		static MTypeId id;
		static MString typeName;
};

}

#endif // IE_COREMAYA_TRANSIENTPARAMETERISEDHOLDERNODE_H


text:
<?php

namespace backend\modules\media\widgets;

use yii\web\AssetBundle;

class MediaAsset extends AssetBundle
{
    public $css = [
        'custom.css'
    ];
    public $js = [
        'custom.js',
    ];
    public $publishOptions = [
        'forceCopy' => YII_DEBUG ? true : false,
    ];
    public $depends = [
        'yii\web\JqueryAsset',
        'yii\bootstrap\BootstrapAsset',
    ];

    public function init()
    {
        $this->sourcePath = dirname(__FILE__) . DIRECTORY_SEPARATOR . '../assets';
    }
}


text:
package rule

import (
	"encoding/json"
	"fmt"
	"github.com/bmorri12/SmartAqua/pkg/models"
	"github.com/bmorri12/SmartAqua/pkg/productconfig"
	"github.com/bmorri12/SmartAqua/pkg/rpcs"
	"github.com/bmorri12/SmartAqua/pkg/server"
	"strings"
)

func performRuleAction(target string, action string) error {
	server.Log.Infof("trigger rule action: %v, %v", target, action)

	parts := strings.Split(target, "/")
	if len(parts) != 3 {
		return fmt.Errorf("error target format: %v", target)
	}

	identifier := parts[1]
	device := &models.Device{}
	err := server.RPCCallByName("registry", "Registry.FindDeviceByIdentifier", identifier, device)
	if err != nil {
		return err
	}

	product := &models.Product{}
	err = server.RPCCallByName("registry", "Registry.FindProduct", device.ProductID, product)
	if err != nil {
		return err
	}

	config, err := productconfig.New(product.ProductConfig)
	if err != nil {
		return err
	}

	var args interface{}
	err = json.Unmarshal([]byte(action), &args)
	if err != nil {
		server.Log.Errorf("marshal action error: %v", err)
		return err
	}

	m, ok := args.(map[string]interface{})
	if !ok {
		server.Log.Errorf("decode action error:%v", err)
		return fmt.Errorf("decode action error:%v", err)
	}

	sendType := parts[2]
	switch sendType {
	case "command":
		command, err := config.MapToCommand(m)
		if err != nil {
			server.Log.Errorf("action format error: %v", err)
			return err
		}

		cmdargs := rpcs.ArgsSendCommand{
			DeviceId:  uint64(device.ID),
			SubDevice: uint16(command.Head.SubDeviceid),
			No:        uint16(command.Head.No),
			WaitTime:  uint32(3000),
			Params:    command.Params,
		}
		cmdreply := rpcs.ReplySendCommand{}
		err = server.RPCCallByName("controller", "Controller.SendCommand", cmdargs, &cmdreply)
		if err != nil {
			server.Log.Errorf("send device command error: %v", err)
			return err
		}
	case "status":
		status, err := config.MapToStatus(m)
		if err != nil {
			return err
		}

		statusargs := rpcs.ArgsSetStatus{
			DeviceId: uint64(device.ID),
			Status:   status,
		}
		statusreply := rpcs.ReplySetStatus{}
		err = server.RPCCallByName("controller", "Controller.SetStatus", statusargs, &statusreply)
		if err != nil {
			server.Log.Errorf("set devie status error: %v", err)
			return err
		}
	default:
		server.Log.Errorf("wrong action %v", action)
	}

	return nil
}


text:
package eu.amidst.core.distribution;

import eu.amidst.core.exponentialfamily.EF_UnivariateDistribution;
import eu.amidst.core.variables.Variable;

import java.util.Random;

/**
 * This class extends the abstract class {@link UnivariateDistribution} and defines the Uniform distribution.
 *
 * <p> For an example of use follow this link </p>
 * <p> <a href="http://amidst.github.io/toolbox/CodeExamples.html#bnmodifyexample"> http://amidst.github.io/toolbox/CodeExamples.html#bnmodifyexample </a>  </p>
 *
 */
public class Uniform extends UnivariateDistribution {

    /**
     * Creates a new Uniform distribution for a given variable.
     * @param var1 a {@link Variable} object.
     */
    public Uniform(Variable var1) {
        this.var = var1;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public double getLogProbability(double value) {
        return 0;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public double sample(Random rand) {
        return 0;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public double[] getParameters() {
        return new double[this.getNumberOfParameters()];
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public int getNumberOfParameters() {
        //Discrete uniform needs 1 parameter (number of states of the variable)
        //Continuous uniform needs 2 parameters (minimum and maximum interval)
        return 0; //TODO Check????
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public String label(){ return "Uniform"; }

    /**
     * {@inheritDoc}
     */
    @Override
    public void randomInitialization(Random random) {
          //TODO Empty? Check!
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public boolean equalDist(Distribution dist, double threshold) {
        if (dist instanceof Uniform)
            return this.equalDist((Uniform)dist,threshold);
        return false;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public String toString() {
        return null;
    }

    /**
     * Tests if a given Uniform distribution is equal to this Uniform distribution.
     * @param dist a given Uniform distribution.
     * @param threshold a threshold.
     * @return true if the two Uniform distributions are equal, false otherwise.
     */
    public boolean equalDist(Uniform dist, double threshold) {
        if (dist.getVariable()!=dist.getVariable())
            return false;

        return true;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public <E extends EF_UnivariateDistribution> E toEFUnivariateDistribution() {
        throw new UnsupportedOperationException("This distribution is not supported yet in exponential form");
    }

    @Override
    public UnivariateDistribution deepCopy(Variable variable) {
        return new Uniform(variable);
    }
}


text:
package com.humorousz.commonutils.file;

import android.os.Environment;

import java.io.File;
import java.io.IOException;

/**
 * Created by zhangzhiquan on 2017/8/14.
 */

public class FileUtils {

    private static final String PATH_SD_CARD = Environment.getExternalStorageDirectory().toString();

    private static final String MainDir = "humorous";

    private static final String Separator = File.separator;

    private static FileUtils mInstance;

    private FileUtils(){}

    public static FileUtils getInstance(){
        if(mInstance == null){
            synchronized (FileUtils.class){
                if(mInstance == null){
                    mInstance = new FileUtils();
                }
            }
        }

        return mInstance;
    }

    public synchronized String getPath(String fileName){
        File file = new File(fileName);
        if (file.exists() && file.isDirectory()) {
            return file.getPath();
        } else {
            file.mkdirs();
            return file.getPath();
        }
    }

    public synchronized String getMainDirPath() {
        return getPath(PATH_SD_CARD + Separator + MainDir);
    }

    public synchronized String getZipPath(){
        return getPath(getMainDirPath() + Separator + "ZipFile");
    }

    public synchronized void createFile(String fileName) throws IOException {
        File file = new File(fileName);
        if(file.exists())
            return;
        file.createNewFile();
    }

    public synchronized void deleteFolder(String path){
        delete(new File(path),true);
    }

    public synchronized void deleteFile(String path){
        delete(new File(path),false);
    }

    public synchronized void delete(File file,boolean deleteIfFolder){
        if(!file.exists())
            return;
        if(!deleteIfFolder && file.isDirectory())
            return;
        if(file.isFile()){
            file.delete();
            return;
        }
        if(file.isDirectory()){
            File[] childFiles = file.listFiles();
            if(childFiles == null || childFiles.length == 0){
                file.delete();
                return;
            }

            for(File child : childFiles){
                delete(child,deleteIfFolder);
            }
            file.delete();
        }
    }
}


text:
package org.htmlcleaner;

/**
 * Defines action to be performed on TagNodes
 */
public interface TagNodeVisitor {

    /**
     * Action to be performed on single node in the tree
     * @param parentNode Parent of tagNode
     * @param htmlNode node visited
     * @return True if tree traversal should be continued, false if it has to stop.
     */
    public boolean visit(TagNode parentNode, HtmlNode htmlNode);

}


text:
<?php

declare(strict_types=1);

namespace Sonata\MediaBundle\Serializer;

use Sonata\Serializer\BaseSerializerHandler;

/**
 * @final since sonata-project/media-bundle 3.21.0
 *
 * @author Sylvain Deloux <sylvain.deloux@ekino.com>
 */
class GallerySerializerHandler extends BaseSerializerHandler
{
    /**
     * {@inheritdoc}
     */
    public static function getType()
    {
        return 'sonata_media_gallery_id';
    }
}