text:
title: 'Documentation Components'
---
# WebPageTest Documentation Components

To help make it easier to include different content features, callouts, asides and more, the WebPageTest documentation includes a number of different components.

Below we show example markup for each of our key content components.

## Asides
Asides can be used to provide short-form information (2-3 lines, typically) to provide additional context to our readers.

We have a few different built-in asides.

### Notes
````markdown
::: note
This can provide supplementary information to the body of the document.
:::
````
::: note
This can provide supplementary information to the body of the document.
:::

### Caution
````markdown
::: caution
This can provide information about a common issue or complication so folks can avoid it.
:::
````
::: caution
This can provide information about a common issue or complication so folks can avoid it.
:::

### Warning
````markdown
::: warning
A warning aside tells folks explicitly not to do something.
:::
````
::: warning
A warning aside tells folks explicitly not to do something.
:::

### Key Term
````markdown
::: key-term
A key-term aside can be used to define a term that the reader may not know, but that is essential to understanding what they're reading.
:::
````
::: key-term
A key-term aside can be used to define a term that the reader may not know, but that is essential to understanding what they're reading.
:::

## Code
Code examples are a key part of our documentation, so we want to make it easy to include meanintful code examples.

### Inline code
Use single backticks to create inline code.

````markdown
You can pass your API key along with tests requests by using the `k` parameter.
````

You can pass your API key along with tests requests by using the `k` parameter.

### Code blocks

Use tripple backticcks to create a code block. Include the language name after the triple backticks to generate syntax highlighting.

````markdown
```html
<img src="lazy-image.png" loading="lazy" alt="" width="300" height="300">
```
````

For code blocks that don't need syntax highlighting (HTTP headers, WPT scripting language examples, etc), set the language to "text".

````markdown
```text
// bring up the login screen
navigate	http://webmail.aol.com

logData	1

// log in
setValue	name=loginId	someuser@aol.com
setValue	name=password	somepassword
submitForm	name=AOLLoginForm
```
````

### Code highlighting
Highlight individual lines of code in a code block by adding a slash and the zero-indexed line number after the language name. For example, here's what `text/6-7` looks like.

```text/6-7
// bring up the login screen
navigate	http://webmail.aol.com

logData	1

// log in
setValue	name=loginId	someuser@aol.com
setValue	name=password	somepassword
submitForm	name=AOLLoginForm
```

Highlighting removed lines can be accomplished by using a double slash. For example, here's `text//3`.

```text//3
// bring up the login screen
navigate	http://webmail.aol.com

logData	1

// log in
setValue	name=loginId	someuser@aol.com
setValue	name=password	somepassword
submitForm	name=AOLLoginForm
```

To show lines that changed, we can use the `language/lineAdded/lineRemoved` pattern. Here's `text/3/4`.

```text/4/3
// bring up the login screen
navigate	http://webmail.aol.com

logData	1
logData 0

// log in
setValue	name=loginId	someuser@aol.com
setValue	name=password	somepassword
submitForm	name=AOLLoginForm
```

### Code Tabs
When we're providing code samples, sometimes we'll need to use multiple languages (for example, showing the JSON and XML responses for the API). For that, we want to provide a tabbed interface so folks can toggle between the examples.

````markdown
::: code-tabs
```json
{
	"statusCode": 200,
	"statusText": "Ok",
	"data": {
		"testId": "210226_DiFK_f46266890a46bb1bff7a59a20ddc339c",
		"jsonUrl": "https://www.webpagetest.org/jsonResult.php?test=210226_DiFK_f46266890a46bb1bff7a59a20ddc339c",
		"xmlUrl": "https://www.webpagetest.org/xmlResult/210226_DiFK_f46266890a46bb1bff7a59a20ddc339c/",
		"userUrl": "https://www.webpagetest.org/result/210226_DiFK_f46266890a46bb1bff7a59a20ddc339c/",
		"summaryCSV": "https://www.webpagetest.org/result/210226_DiFK_f46266890a46bb1bff7a59a20ddc339c/page_data.csv",
		"detailCSV": "https://www.webpagetest.org/result/210226_DiFK_f46266890a46bb1bff7a59a20ddc339c/requests.csv"
	}
}
```

```xml
<response>
	<statusCode>200</statusCode>
	<statusText>Ok</statusText>
	<data>
		<testId>210226_DiFK_f46266890a46bb1bff7a59a20ddc339c</testId>
		<xmlUrl>https://www.webpagetest.org/xmlResult/210226_DiFK_f46266890a46bb1bff7a59a20ddc339c/</xmlUrl>
		<userUrl>https://www.webpagetest.org/result/210226_DiFK_f46266890a46bb1bff7a59a20ddc339c/</userUrl>
		<summaryCSV>https://www.webpagetest.org/result/210226_DiFK_f46266890a46bb1bff7a59a20ddc339c/page_data.csv</summaryCSV>
		<detailCSV>https://www.webpagetest.org/result/210226_DiFK_f46266890a46bb1bff7a59a20ddc339c/requests.csv</detailCSV>
		<jsonUrl>https://www.webpagetest.org/jsonResult.php?test=210226_DiFK_f46266890a46bb1bff7a59a20ddc339c</jsonUrl>
	</data>
</response>
```
:::
````
::: code-tabs
```json
{
	"statusCode": 200,
	"statusText": "Ok",
	"data": {
		"testId": "210226_DiFK_f46266890a46bb1bff7a59a20ddc339c",
		"jsonUrl": "https://www.webpagetest.org/jsonResult.php?test=210226_DiFK_f46266890a46bb1bff7a59a20ddc339c",
		"xmlUrl": "https://www.webpagetest.org/xmlResult/210226_DiFK_f46266890a46bb1bff7a59a20ddc339c/",
		"userUrl": "https://www.webpagetest.org/result/210226_DiFK_f46266890a46bb1bff7a59a20ddc339c/",
		"summaryCSV": "https://www.webpagetest.org/result/210226_DiFK_f46266890a46bb1bff7a59a20ddc339c/page_data.csv",
		"detailCSV": "https://www.webpagetest.org/result/210226_DiFK_f46266890a46bb1bff7a59a20ddc339c/requests.csv"
	}
}
```

```xml
<response>
	<statusCode>200</statusCode>
	<statusText>Ok</statusText>
	<data>
		<testId>210226_DiFK_f46266890a46bb1bff7a59a20ddc339c</testId>
		<xmlUrl>https://www.webpagetest.org/xmlResult/210226_DiFK_f46266890a46bb1bff7a59a20ddc339c/</xmlUrl>
		<userUrl>https://www.webpagetest.org/result/210226_DiFK_f46266890a46bb1bff7a59a20ddc339c/</userUrl>
		<summaryCSV>https://www.webpagetest.org/result/210226_DiFK_f46266890a46bb1bff7a59a20ddc339c/page_data.csv</summaryCSV>
		<detailCSV>https://www.webpagetest.org/result/210226_DiFK_f46266890a46bb1bff7a59a20ddc339c/requests.csv</detailCSV>
		<jsonUrl>https://www.webpagetest.org/jsonResult.php?test=210226_DiFK_f46266890a46bb1bff7a59a20ddc339c</jsonUrl>
	</data>
</response>
```
:::

## Lists

### API List
To list out the parameters of an API response, or the properties of a response object, we can use the `api-list` component.

````markdown
::: api-list
- `statusCode` (int)
The HTTP response status code for the submission. A 200 code indicates a succesful submission. Any errors will result in a status code of 400.
- `statusCode` (int)
The HTTP response status code for the submission. A 200 code indicates a succesful submission. Any errors will result in a status code of 400.
- `statusCode` (int)
The HTTP response status code for the submission. A 200 code indicates a succesful submission. Any errors will result in a status code of 400.
:::
````
::: api-list
- `statusCode` (int)
The HTTP response status code for the submission. A 200 code indicates a succesful submission. Any errors will result in a status code of 400.
- `statusCode` (int)
The HTTP response status code for the submission. A 200 code indicates a succesful submission. Any errors will result in a status code of 400.
- `statusCode` (int)
The HTTP response status code for the submission. A 200 code indicates a succesful submission. Any errors will result in a status code of 400.
:::

## Tables
We use regular markdown syntax for tables.

````markdown
| Status Code | Description                    |
|-------------|--------------------------------|
| 100         | Test started                   |
| 101         | Test is in the queue           |
| 102         | The test server is unreachable |
| 200         | The test is complete           |
| 400         | A test with the `testId` passed was not found |
| 401         | The `testId` is valid, but no test was found in the work queue |
| 402         | The test with the `testId` passed was cancelled |
````
| Status Code | Description                    |
|-------------|--------------------------------|
| 100         | Test started                   |
| 101         | Test is in the queue           |
| 102         | The test server is unreachable |
| 200         | The test is complete           |
| 400         | A test with the `testId` passed was not found |
| 401         | The `testId` is valid, but no test was found in the work queue |
| 402         | The test with the `testId` passed was cancelled |

To left-align the values in a column, add a colon (`:`) to the start of the head divider for that column.

````markdown
| Status Code | Description                    |
|-------------|:--------------------------------|
| 100         | Test started                   |
| 101         | Test is in the queue           |
| 102         | The test server is unreachable |
| 200         | The test is complete           |
| 400         | A test with the `testId` passed was not found |
| 401         | The `testId` is valid, but no test was found in the work queue |
| 402         | The test with the `testId` passed was cancelled |
````
| Status Code | Description                    |
|-------------|--------------------------------|
| 100         | Test started                   |
| 101         | Test is in the queue           |
| 102         | The test server is unreachable |
| 200         | The test is complete           |
| 400         | A test with the `testId` passed was not found |
| 401         | The `testId` is valid, but no test was found in the work queue |
| 402         | The test with the `testId` passed was cancelled |

To right-align the values in a column, add a color (`:`) to the end of the head divider for that column.

````markdown
| Status Code | Description                    |
|-------------|-------------------------------:|
| 100         | Test started                   |
| 101         | Test is in the queue           |
| 102         | The test server is unreachable |
| 200         | The test is complete           |
| 400         | A test with the `testId` passed was not found |
| 401         | The `testId` is valid, but no test was found in the work queue |
| 402         | The test with the `testId` passed was cancelled |
````
| Status Code | Description                    |
|-------------|-------------------------------:|
| 100         | Test started                   |
| 101         | Test is in the queue           |
| 102         | The test server is unreachable |
| 200         | The test is complete           |
| 400         | A test with the `testId` passed was not found |
| 401         | The `testId` is valid, but no test was found in the work queue |
| 402         | The test with the `testId` passed was cancelled |


text:
package com.veggie.src.java.core.account.employee;

import com.veggie.src.java.core.account.EmployeeAccount;

public class LibrarianAccount extends EmployeeAccount {

	public final String type = "LibrarianAccount";

	public LibrarianAccount(final String username, final String contactInformation, final int id, final int employeeId, final String password){
		super(username, contactInformation, id, employeeId, password);
		this.permissions = LIBRARIAN;
	}

	public String getType(){
		return type;
	}

	public String toString(){
		StringBuilder sb = new StringBuilder();
		sb.append("Username: " + getusername() + " ");
		sb.append("Account Type: " + getType() + " ");
		sb.append("Library ID: " + getEmployeeId());
		return sb.toString();
	}
}

redpajama_set_name: RedPajamaGithub


text:
<?php

declare(strict_types=1);

namespace ApiPlatform\Core\DataPersister;

/**
 * Chained data persisters.
 *
 * @author Baptiste Meyer <baptiste.meyer@gmail.com>
 */
final class ChainDataPersister implements ContextAwareDataPersisterInterface
{
    /**
     * @var iterable<DataPersisterInterface>
     *
     * @internal
     */
    public $persisters;

    /**
     * @param DataPersisterInterface[] $persisters
     */
    public function __construct(iterable $persisters)
    {
        $this->persisters = $persisters;
    }

    /**
     * {@inheritdoc}
     */
    public function supports($data, array $context = []): bool
    {
        foreach ($this->persisters as $persister) {
            if ($persister->supports($data, $context)) {
                return true;
            }
        }

        return false;
    }

    /**
     * {@inheritdoc}
     */
    public function persist($data, array $context = [])
    {
        foreach ($this->persisters as $persister) {
            if ($persister->supports($data, $context)) {
                $data = $persister->persist($data, $context) ?? $data;
                if ($persister instanceof ResumableDataPersisterInterface && $persister->resumable($context)) {
                    continue;
                }

                return $data;
            }
        }

        return $data;
    }

    /**
     * {@inheritdoc}
     */
    public function remove($data, array $context = [])
    {
        foreach ($this->persisters as $persister) {
            if ($persister->supports($data, $context)) {
                $persister->remove($data, $context);
                if ($persister instanceof ResumableDataPersisterInterface && $persister->resumable($context)) {
                    continue;
                }

                return;
            }
        }
    }
}


text:
package jfl.components;

import jfl.components.Message;
import java.util.*;
import org.json.*;

public class Logger {
    private HashMap<String,ArrayList<Message>>
            pmLogs=new HashMap(),
            channelLogs=new HashMap();

    private int maxLogSize=1000;

    public HashMap<String,ArrayList<Message>> getPMLogs() {
        return pmLogs;
    }

    public ArrayList<Message> getPMLog(String character) {
        return pmLogs.get(character);
    }

    public HashMap<String,ArrayList<Message>> getChannelLogs() {
        return channelLogs;
    }

    public ArrayList<Message> getChannelLog(String channel) {
        return channelLogs.get(channel);
    }

    public void logPM(String characterName,Message message) {
        addLog(pmLogs,characterName,message);
    }

    public void logChannelMessage(String channelName,Message message) {
        addLog(channelLogs,channelName,message);
    }

    private void addLog(HashMap<String,ArrayList<Message>> logs,String name,Message message) {
        if (!logs.containsKey(name))
            logs.put(name,new ArrayList());

        ArrayList<Message> messages=logs.get(name);

        if (messages.size()==maxLogSize)
            messages.remove(0);

        messages.add(message);
    }

    public static String logToString(ArrayList<Message> messages) {
        String logString="";

        for (Message message:messages)
            logString+=message.getFormattedTime()+"   "+message.getSender()+"   "+message.getContent()+"\n";

        return logString;
    }

    public JSONObject getJSONObject() {
        JSONObject obj=new JSONObject();
        obj.put("pm",getLogsAsJSON(pmLogs));
        obj.put("channel",getLogsAsJSON(channelLogs));
        return obj;
    }

    public static JSONObject getLogsAsJSON(HashMap<String,ArrayList<Message>> logs) {
        JSONObject obj=new JSONObject();

        for (Map.Entry entry : logs.entrySet()) {
            String key=(String)entry.getKey();
            ArrayList<Message>messages=(ArrayList<Message>)entry.getValue();

            JSONArray messageArray=new JSONArray();
            for (int i=0; i<messages.size(); i++)
                messageArray.put(i,messages.get(i).toJSONObject());

            obj.put(key,messageArray);
        }

        return obj;
    }
}


text:
.class Lcom/android/server/CertBlacklister$BlacklistObserver$1;
.super Ljava/lang/Thread;
.source "CertBlacklister.java"

# annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
    value = Lcom/android/server/CertBlacklister$BlacklistObserver;->writeBlacklist()V
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x0
    name = null
.end annotation

# instance fields
.field final synthetic this$1:Lcom/android/server/CertBlacklister$BlacklistObserver;

# direct methods
.method constructor <init>(Lcom/android/server/CertBlacklister$BlacklistObserver;Ljava/lang/String;)V
    .locals 0
    .param p1, "this$1"    # Lcom/android/server/CertBlacklister$BlacklistObserver;
    .param p2, "$anonymous0"    # Ljava/lang/String;

    .prologue
    .line 77
    iput-object p1, p0, Lcom/android/server/CertBlacklister$BlacklistObserver$1;->this$1:Lcom/android/server/CertBlacklister$BlacklistObserver;

    invoke-direct {p0, p2}, Ljava/lang/Thread;-><init>(Ljava/lang/String;)V

    return-void
.end method

# virtual methods
.method public run()V
    .locals 9

    .prologue
    .line 79
    iget-object v5, p0, Lcom/android/server/CertBlacklister$BlacklistObserver$1;->this$1:Lcom/android/server/CertBlacklister$BlacklistObserver;

    invoke-static {v5}, Lcom/android/server/CertBlacklister$BlacklistObserver;->-get1(Lcom/android/server/CertBlacklister$BlacklistObserver;)Ljava/io/File;

    move-result-object v6

    monitor-enter v6

    .line 80
    :try_start_0
    iget-object v5, p0, Lcom/android/server/CertBlacklister$BlacklistObserver$1;->this$1:Lcom/android/server/CertBlacklister$BlacklistObserver;

    invoke-virtual {v5}, Lcom/android/server/CertBlacklister$BlacklistObserver;->getValue()Ljava/lang/String;

    move-result-object v0

    .line 81
    .local v0, "blacklist":Ljava/lang/String;
    if-eqz v0, :cond_0

    .line 82
    const-string/jumbo v5, "CertBlacklister"

    const-string/jumbo v7, "Certificate blacklist changed, updating..."

    invoke-static {v5, v7}, Landroid/util/Slog;->i(Ljava/lang/String;Ljava/lang/String;)I
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    .line 83
    const/4 v2, 0x0

    .line 86
    .local v2, "out":Ljava/io/FileOutputStream;
    :try_start_1
    const-string/jumbo v5, "journal"

    const-string/jumbo v7, ""

    iget-object v8, p0, Lcom/android/server/CertBlacklister$BlacklistObserver$1;->this$1:Lcom/android/server/CertBlacklister$BlacklistObserver;

    invoke-static {v8}, Lcom/android/server/CertBlacklister$BlacklistObserver;->-get1(Lcom/android/server/CertBlacklister$BlacklistObserver;)Ljava/io/File;

    move-result-object v8

    invoke-static {v5, v7, v8}, Ljava/io/File;->createTempFile(Ljava/lang/String;Ljava/lang/String;Ljava/io/File;)Ljava/io/File;

    move-result-object v4

    .line 88
    .local v4, "tmp":Ljava/io/File;
    const/4 v5, 0x1

    const/4 v7, 0x0

    invoke-virtual {v4, v5, v7}, Ljava/io/File;->setReadable(ZZ)Z

    .line 90
    new-instance v3, Ljava/io/FileOutputStream;

    invoke-direct {v3, v4}, Ljava/io/FileOutputStream;-><init>(Ljava/io/File;)V
    :try_end_1
    .catch Ljava/io/IOException; {:try_start_1 .. :try_end_1} :catch_0
    .catchall {:try_start_1 .. :try_end_1} :catchall_1

    .line 91
    .end local v2    # "out":Ljava/io/FileOutputStream;
    .local v3, "out":Ljava/io/FileOutputStream;
    :try_start_2
    invoke-virtual {v0}, Ljava/lang/String;->getBytes()[B

    move-result-object v5

    invoke-virtual {v3, v5}, Ljava/io/FileOutputStream;->write([B)V

    .line 93
    invoke-static {v3}, Landroid/os/FileUtils;->sync(Ljava/io/FileOutputStream;)Z

    .line 95
    new-instance v5, Ljava/io/File;

    iget-object v7, p0, Lcom/android/server/CertBlacklister$BlacklistObserver$1;->this$1:Lcom/android/server/CertBlacklister$BlacklistObserver;

    invoke-static {v7}, Lcom/android/server/CertBlacklister$BlacklistObserver;->-get0(Lcom/android/server/CertBlacklister$BlacklistObserver;)Ljava/lang/String;

    move-result-object v7

    invoke-direct {v5, v7}, Ljava/io/File;-><init>(Ljava/lang/String;)V

    invoke-virtual {v4, v5}, Ljava/io/File;->renameTo(Ljava/io/File;)Z

    .line 96
    const-string/jumbo v5, "CertBlacklister"

    const-string/jumbo v7, "Certificate blacklist updated"

    invoke-static {v5, v7}, Landroid/util/Slog;->i(Ljava/lang/String;Ljava/lang/String;)I
    :try_end_2
    .catch Ljava/io/IOException; {:try_start_2 .. :try_end_2} :catch_1
    .catchall {:try_start_2 .. :try_end_2} :catchall_2

    .line 100
    :try_start_3
    invoke-static {v3}, Llibcore/io/IoUtils;->closeQuietly(Ljava/lang/AutoCloseable;)V
    :try_end_3
    .catchall {:try_start_3 .. :try_end_3} :catchall_0

    .end local v3    # "out":Ljava/io/FileOutputStream;
    .end local v4    # "tmp":Ljava/io/File;
    :cond_0
    :goto_0
    monitor-exit v6

    .line 78
    return-void

    .line 97
    .restart local v2    # "out":Ljava/io/FileOutputStream;
    :catch_0
    move-exception v1

    .line 98
    .end local v2    # "out":Ljava/io/FileOutputStream;
    .local v1, "e":Ljava/io/IOException;
    :goto_1
    :try_start_4
    const-string/jumbo v5, "CertBlacklister"

    const-string/jumbo v7, "Failed to write blacklist"

    invoke-static {v5, v7, v1}, Landroid/util/Slog;->e(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
    :try_end_4
    .catchall {:try_start_4 .. :try_end_4} :catchall_1

    .line 100
    :try_start_5
    invoke-static {v2}, Llibcore/io/IoUtils;->closeQuietly(Ljava/lang/AutoCloseable;)V
    :try_end_5
    .catchall {:try_start_5 .. :try_end_5} :catchall_0

    goto :goto_0

    .line 79
    .end local v0    # "blacklist":Ljava/lang/String;
    .end local v1    # "e":Ljava/io/IOException;
    :catchall_0
    move-exception v5

    monitor-exit v6

    throw v5

    .line 99
    .restart local v0    # "blacklist":Ljava/lang/String;
    :catchall_1
    move-exception v5

    .line 100
    :goto_2
    :try_start_6
    invoke-static {v2}, Llibcore/io/IoUtils;->closeQuietly(Ljava/lang/AutoCloseable;)V

    .line 99
    throw v5
    :try_end_6
    .catchall {:try_start_6 .. :try_end_6} :catchall_0

    .restart local v3    # "out":Ljava/io/FileOutputStream;
    .restart local v4    # "tmp":Ljava/io/File;
    :catchall_2
    move-exception v5

    move-object v2, v3

    .end local v3    # "out":Ljava/io/FileOutputStream;
    .local v2, "out":Ljava/io/FileOutputStream;
    goto :goto_2

    .line 97
    .end local v2    # "out":Ljava/io/FileOutputStream;
    .restart local v3    # "out":Ljava/io/FileOutputStream;
    :catch_1
    move-exception v1

    .restart local v1    # "e":Ljava/io/IOException;
    move-object v2, v3

    .end local v3    # "out":Ljava/io/FileOutputStream;
    .restart local v2    # "out":Ljava/io/FileOutputStream;
    goto :goto_1
.end method


text:
package org.ecg.refdata.datasource.entities.countryUnavailability;

import org.ecg.refdata.datasource.entities.commons.ReferenceDataAbstractDataTypeEntity;
import org.ecg.refdata.datasource.entities.commons.ReferenceDataPeriodicValidityAbstractItem;
import org.ecg.refdata.query.DictionaryItem;
import org.ecg.refdata.query.model.CountryUnavailability.SystemUnavailability;
import org.ecg.refdata.query.model.impl.CountryUnavailabilityImpl;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.DiscriminatorValue;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.OneToMany;
import javax.persistence.PrimaryKeyJoinColumn;
import javax.persistence.Table;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

@Entity()
@Table(name = "ref_country_unavailability_it")
@DiscriminatorValue(value = "CountryUnavailabilityItem")
@PrimaryKeyJoinColumn(name = "ref_item_mapping_id")
public class CountryUnavailabilityItem extends ReferenceDataPeriodicValidityAbstractItem {

    private static Log log = LogFactory.getLog(CountryUnavailabilityItem.class);
    private static final long serialVersionUID = 1L;
    /**
     * Country code.
     */
    @Column(name = "country_code", unique = false, nullable = true, length = 2)
    private String countryCode;

    /**
     * @serial Set of {@link SystemUnavailabilityItem}
     */
    @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "countryUnavailabilityItem", targetEntity = SystemUnavailabilityItem.class)
    private Set<SystemUnavailabilityItem> systemUnavailabilityItems = new HashSet<SystemUnavailabilityItem>();

    /**
     * for hibernate only
     */
    public CountryUnavailabilityItem() {
    }

    @Override
    public DictionaryItem getDictionaryItem(String locale) {
        List<SystemUnavailability> tsystemUnavailabilityItems = new ArrayList<SystemUnavailability>();
        for (SystemUnavailabilityItem systemUnavailabilityItem : systemUnavailabilityItems) {
            tsystemUnavailabilityItems.add(systemUnavailabilityItem.getSystemUnavailability());
        }
        return new CountryUnavailabilityImpl(countryCode, tsystemUnavailabilityItems);
    }

    public CountryUnavailabilityItem(ReferenceDataAbstractDataTypeEntity referenceDataTypeEntity) {
        super(referenceDataTypeEntity);
    }

    // SystemUnavailabilityItem
    public Set<SystemUnavailabilityItem> getSystemUnavailabilityItems() {
        return Collections.unmodifiableSet(systemUnavailabilityItems);
    }

    public boolean addSystemUnavailabilityItem(
            SystemUnavailabilityItem systemUnavailabilityItem) {
        return systemUnavailabilityItems
                .add(systemUnavailabilityItem);
    }

    public boolean removeSystemUnavailabilityItem(
            SystemUnavailabilityItem systemUnavailabilityItem) {
        return systemUnavailabilityItems
                .remove(systemUnavailabilityItem);
    }

    public void removeAllSystemUnavailabilityItems() {
        systemUnavailabilityItems.clear();
    }

    public String getCountryCode() {
        return countryCode;
    }

    public void setCountryCode(String countryCode) {
        this.countryCode = countryCode;
    }

}


text:
from datetime import datetime
import errno
import os
import select
import socket
import ssl
import sys

import gunicorn.http as http
import gunicorn.http.wsgi as wsgi
import gunicorn.util as util
import gunicorn.workers.base as base
from gunicorn import six

class SyncWorker(base.Worker):

    def run(self):
        # self.socket appears to lose its blocking status after
        # we fork in the arbiter. Reset it here.
        for s in self.sockets:
            s.setblocking(0)

        ready = self.sockets
        while self.alive:
            self.notify()

            # Accept a connection. If we get an error telling us
            # that no connection is waiting we fall down to the
            # select which is where we'll wait for a bit for new
            # workers to come give us some love.

            for sock in ready:
                try:
                    client, addr = sock.accept()
                    client.setblocking(1)
                    util.close_on_exec(client)
                    self.handle(sock, client, addr)

                    # Keep processing clients until no one is waiting. This
                    # prevents the need to select() for every client that we
                    # process.
                    continue

                except socket.error as e:
                    if e.args[0] not in (errno.EAGAIN, errno.ECONNABORTED,
                            errno.EWOULDBLOCK):
                        raise

            # If our parent changed then we shut down.
            if self.ppid != os.getppid():
                self.log.info("Parent changed, shutting down: %s", self)
                return

            try:
                self.notify()

                # if no timeout is given the worker will never wait and will
                # use the CPU for nothing. This minimal timeout prevent it.
                timeout = self.timeout or 0.5

                ret = select.select(self.sockets, [], self.PIPE, timeout)
                if ret[0]:
                    ready = ret[0]
                    continue
            except select.error as e:
                if e.args[0] == errno.EINTR:
                    ready = self.sockets
                    continue
                if e.args[0] == errno.EBADF:
                    if self.nr < 0:
                        ready = self.sockets
                        continue
                    else:
                        return
                raise

    def handle(self, listener, client, addr):
        req = None
        try:
            if self.cfg.is_ssl:
                client = ssl.wrap_socket(client, server_side=True,
                    **self.cfg.ssl_options)

            parser = http.RequestParser(self.cfg, client)
            req = six.next(parser)
            self.handle_request(listener, req, client, addr)
        except http.errors.NoMoreData as e:
            self.log.debug("Ignored premature client disconnection. %s", e)
        except StopIteration as e:
            self.log.debug("Closing connection. %s", e)
        except ssl.SSLError as e:
            if e.args[0] == ssl.SSL_ERROR_EOF:
                self.log.debug("ssl connection closed")
                client.close()
            else:
                self.log.debug("Error processing SSL request.")
                self.handle_error(req, client, addr, e)
        except socket.error as e:
            if e.args[0] not in (errno.EPIPE, errno.ECONNRESET):
                self.log.exception("Socket error processing request.")
            else:
                if e.args[0] == errno.ECONNRESET:
                    self.log.debug("Ignoring connection reset")
                else:
                    self.log.debug("Ignoring EPIPE")
        except Exception as e:
            self.handle_error(req, client, addr, e)
        finally:
            util.close(client)

    def handle_request(self, listener, req, client, addr):
        environ = {}
        resp = None
        try:
            self.cfg.pre_request(self, req)
            request_start = datetime.now()
            resp, environ = wsgi.create(req, client, addr,
                    listener.getsockname(), self.cfg)
            # Force the connection closed until someone shows
            # a buffering proxy that supports Keep-Alive to
            # the backend.
            resp.force_close()
            self.nr += 1
            if self.nr >= self.max_requests:
                self.log.info("Autorestarting worker after current request.")
                self.alive = False
            respiter = self.wsgi(environ, resp.start_response)
            try:
                if isinstance(respiter, environ['wsgi.file_wrapper']):
                    resp.write_file(respiter)
                else:
                    for item in respiter:
                        resp.write(item)
                resp.close()
                request_time = datetime.now() - request_start
                self.log.access(resp, req, environ, request_time)
            finally:
                if hasattr(respiter, "close"):
                    respiter.close()
        except socket.error:
            exc_info = sys.exc_info()
            # pass to next try-except level
            six.reraise(exc_info[0], exc_info[1], exc_info[2])
        except Exception:
            if resp and resp.headers_sent:
                # If the requests have already been sent, we should close the
                # connection to indicate the error.
                self.log.exception("Error handling request")
                try:
                    client.shutdown(socket.SHUT_RDWR)
                    client.close()
                except socket.error:
                    pass
                raise StopIteration()
            raise
        finally:
            try:
                self.cfg.post_request(self, req, environ, resp)
            except Exception:
                self.log.exception("Exception in post_request hook")


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>libhdfs: File Index</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">

Main Page | Data Structures | File List | Data Fields | Globals

libhdfs File List
Here is a list of all files with brief descriptions:

hdfs.h [code]

libhdfs -
Hadoop


text:
package com.google.code.linkedinapi.schema.impl;

import java.io.Serializable;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import com.google.code.linkedinapi.schema.Content;

@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
    "id",
    "title",
    "submittedUrl",
    "shortenedUrl",
    "submittedImageUrl",
    "description",
    "thumbnailUrl",
    "resolvedUrl",
    "eyebrowUrl"
})
@XmlRootElement(name = "content")
public class ContentImpl
    implements Serializable, Content
{

    private final static long serialVersionUID = 2461660169443089969L;
    @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
    protected String id;
    @XmlElement(required = true)
    protected String title;
    @XmlElement(name = "submitted-url", required = true)
    protected String submittedUrl;
    @XmlElement(name = "shortened-url")
    protected String shortenedUrl;
    @XmlElement(name = "submitted-image-url", required = true)
    protected String submittedImageUrl;
    protected String description;
    @XmlElement(name = "thumbnail-url")
    protected String thumbnailUrl;
    @XmlElement(name = "resolved-url")
    protected String resolvedUrl;
    @XmlElement(name = "eyebrow-url")
    protected String eyebrowUrl;

    public String getId() {
        return id;
    }

    public void setId(String value) {
        this.id = value;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String value) {
        this.title = value;
    }

    public String getSubmittedUrl() {
        return submittedUrl;
    }

    public void setSubmittedUrl(String value) {
        this.submittedUrl = value;
    }

    public String getShortenedUrl() {
        return shortenedUrl;
    }

    public void setShortenedUrl(String value) {
        this.shortenedUrl = value;
    }

    public String getSubmittedImageUrl() {
        return submittedImageUrl;
    }

    public void setSubmittedImageUrl(String value) {
        this.submittedImageUrl = value;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String value) {
        this.description = value;
    }

    public String getThumbnailUrl() {
        return thumbnailUrl;
    }

    public void setThumbnailUrl(String value) {
        this.thumbnailUrl = value;
    }

    public String getResolvedUrl() {
        return resolvedUrl;
    }

    public void setResolvedUrl(String value) {
        this.resolvedUrl = value;
    }

    public String getEyebrowUrl() {
        return eyebrowUrl;
    }

    public void setEyebrowUrl(String value) {
        this.eyebrowUrl = value;
    }

}


text:
package org.strangeforest.tcb.stats.model.records.details;

import com.fasterxml.jackson.annotation.*;

import static java.lang.String.*;

public class SeasonRangeIntegerRecordDetail extends SimpleRecordDetail<Integer> {

	private final int startSeason;
	private final int endSeason;

	public SeasonRangeIntegerRecordDetail(
		@JsonProperty("value") int value,
		@JsonProperty("start_season") int startSeason,
		@JsonProperty("end_season") int endSeason
	) {
		super(value);
		this.startSeason = startSeason;
		this.endSeason = endSeason;
	}

	public int getStartSeason() {
		return startSeason;
	}

	public int getEndSeason() {
		return endSeason;
	}

	@Override public String toDetailString() {
		return format("%1$d-%2$d", startSeason, endSeason);
	}
}


text:
package cn.edu.zjnu.acm.judge.controller.api;

import cn.edu.zjnu.acm.judge.Application;
import java.util.Locale;
import lombok.extern.slf4j.Slf4j;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.http.MediaType;
import org.springframework.security.test.context.support.WithMockUser;
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.test.context.web.WebAppConfiguration;
import org.springframework.test.web.servlet.MockMvc;
import org.springframework.test.web.servlet.MvcResult;
import org.springframework.transaction.annotation.Transactional;

import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;

@AutoConfigureMockMvc
@RunWith(SpringRunner.class)
@Slf4j
@SpringBootTest(classes = Application.class)
@Transactional
@WebAppConfiguration
@WithMockUser(roles = "ADMIN")
public class LocaleControllerTest {

    @Autowired
    private MockMvc mvc;

    /**
     * Test of current method, of class LocaleController.
     *
     * @see LocaleController#current(Locale)
     */
    @Test
    public void testCurrent() throws Exception {
        log.info("current");
        Locale locale = Locale.getDefault();
        MvcResult result = mvc.perform(get("/api/locales/current.json")
                .locale(locale))
                .andExpect(status().isOk())
                .andExpect(content().contentTypeCompatibleWith(MediaType.APPLICATION_JSON))
                .andReturn();
    }

    /**
     * Test of findOne method, of class LocaleController.
     *
     * @see LocaleController#findOne(String, boolean)
     */
    @Test
    public void testFindOne() throws Exception {
        log.info("findOne");
        String id = "en";
        boolean support = false;
        MvcResult result = mvc.perform(get("/api/locales/{id}.json", id)
                .param("support", Boolean.toString(support)))
                .andExpect(status().isOk())
                .andExpect(content().contentTypeCompatibleWith(MediaType.APPLICATION_JSON))
                .andReturn();
    }

    /**
     * Test of findAll method, of class LocaleController.
     *
     * @see LocaleController#findAll()
     */
    @Test
    public void testFindAll() throws Exception {
        log.info("findAll");
        MvcResult result = mvc.perform(get("/api/locales.json"))
                .andExpect(status().isOk())
                .andExpect(content().contentTypeCompatibleWith(MediaType.APPLICATION_JSON))
                .andReturn();
    }

    /**
     * Test of supported method, of class LocaleController.
     *
     * @see LocaleController#supported(boolean)
     */
    @Test
    public void testSupported() throws Exception {
        log.info("supported");
        boolean all = false;
        MvcResult result = mvc.perform(get("/api/locales.json").param("all", Boolean.toString(all)))
                .andExpect(status().isOk())
                .andExpect(content().contentTypeCompatibleWith(MediaType.APPLICATION_JSON))
                .andReturn();
    }

}


text:
local key = KEYS[1]
local arg = ARGV[1]
return "hello world:" .. key .. " " .. arg


text:
class WarehouseCompanyship < ActiveRecord::Base
  belongs_to :warehouse
  belongs_to :company
end


text:
import { GregorianCalendar } from './GregorianCalendar';
import { LeapDate } from './core';

export class GregorianDate extends LeapDate {
  constructor(jdn: number, year: number, month: number, day: number) {
    super(jdn, year, month, day, GregorianCalendar.isLeapYear(year));
  }
}


text:
<template name="rubricBuilder">

    {{#each rubric in rubricObject}}

                  <input type="text" name="rubric-aspect" placeholder="Aspect (e.g. {{randomExample(@index)}})" value="{{rubric.aspect}}" required pattern=".*\S+.*">

                  <button class="ui basic blue button duplicate-aspect" data-content="Duplicate this aspect"></button>
                  <button class="ui basic red button remove-aspect" data-content="Delete this aspect"></button>

            {{#each rubric.rows}}

                  <input type="text" name="criteria" placeholder="Criterion (e.g. {{randomCriterion(@index)}})" value="{{this.criteria}}">

                  <input type="number" name="criteria-value" placeholder="Mark (e.g. 10)" value="{{this.criteriaValue}}" required>

            {{/each}}

              <button class="ui fluid basic small button add-criterion" data-content="Add a criterion">Add row</button>

    {{/each}}

        <button class="ui primary button add-aspect">Add Aspect</button>

</template>


text:
package de.friemelay.am.ui.imageeditor;

import de.friemelay.am.ui.util.ImageUtil;
import de.friemelay.am.ui.util.WidgetFactory;
import javafx.event.ActionEvent;
import javafx.event.Event;
import javafx.event.EventHandler;
import javafx.geometry.Insets;
import javafx.scene.control.*;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import javafx.scene.input.Clipboard;
import javafx.scene.layout.BorderPane;
import javafx.stage.FileChooser;

import javax.imageio.ImageIO;
import java.awt.image.BufferedImage;
import java.io.*;
import java.sql.Blob;
import java.sql.SQLException;
import java.util.List;

/**
 *
 */
public class ImageTab extends Tab implements EventHandler<ActionEvent> {
  private ImageVariant variant;

  private Button addButton;
  private Button newButton;
  private Button removeButton;
  private Button pasteButton;

  private ImageEditor imageEditor;
  private ImageView imageView;

  public ImageTab(ImageEditor imageEditor, ImageVariant variant) {
    super(variant.toString());
    this.imageEditor = imageEditor;
    this.variant = variant;
    setClosable(imageEditor.getTabs().size() >= 1);

    setOnClosed(new EventHandler<Event>() {
      @Override
      public void handle(Event event) {
        variant.setName(null);
        variant.setImage(null);
        imageEditor.setDirty(true, variant);
      }
    });

    imageView = new ImageView();
    if(variant.getImage() != null) {
      imageView.setImage(ImageUtil.toImage(variant.getImage()));
    }

    ScrollPane centerScroller = new ScrollPane();
    centerScroller.setFitToWidth(true);
    BorderPane scrollRoot = new BorderPane();
    scrollRoot.setPadding(new Insets(5,5,5,5));
    scrollRoot.setCenter(imageView);
    centerScroller.setContent(scrollRoot);

    BorderPane main = new BorderPane();
    main.setCenter(centerScroller);
    setContent(main);

    ToolBar toolBar = new ToolBar();
    addButton = WidgetFactory.createButton(toolBar, "", "open.png", "Bilddatei öffnen", this);
    removeButton = WidgetFactory.createButton(toolBar, "", "remove.png", "Bild entfernen", this);
    toolBar.getItems().add(new Separator());
    newButton = WidgetFactory.createButton(toolBar, "", "plus.png", "Neues Bild hinzufügen", this);
    newButton.setDisable(imageEditor.getTabs().size()+1 == imageEditor.getMaxTabs());
    main.setTop(toolBar);
  }

  public void addImageVariant(File variant) {
    try {
      FileInputStream fileInputStream = new FileInputStream(variant);
      addImageVariant(variant.getName(), fileInputStream);
    } catch (FileNotFoundException e) {
      e.printStackTrace();
    }
  }

  public void addImageVariant(String name, Blob blob) {
    try {
      InputStream binaryStream = blob.getBinaryStream();
      addImageVariant(name, binaryStream);
    } catch (SQLException e) {
      e.printStackTrace();
    }
  }

  private void addImageVariant(String name, BufferedImage image) {
    variant.setName(name);
    variant.setImage(image);
    setText(variant.toString());
    imageView.setImage(ImageUtil.toImage(variant.getImage()));

    imageEditor.setDirty(true, variant);
  }

  private void addImageVariant(String name, InputStream in) {
    try {
      BufferedImage image = ImageIO.read(in);
      addImageVariant(name, image);
    } catch (IOException e) {
      e.printStackTrace();
    }

  }

  @Override
  public void handle(ActionEvent event) {
    if(event.getSource() == addButton) {
      FileChooser fileChooser = new FileChooser();
      fileChooser.setTitle("Bilddatei öffnen");
      fileChooser.setSelectedExtensionFilter(new FileChooser.ExtensionFilter("Dateityp", "*.png", ".jpg"));
      if(ImageEditor.lastLocation != null) {
        fileChooser.setInitialDirectory(ImageEditor.lastLocation);
      }
      File file = fileChooser.showOpenDialog(imageEditor.getStage());
      if(file != null) {
        ImageEditor.lastLocation = file.getParentFile();
        addImageVariant(file);
      }
    }
    else if(event.getSource() == newButton) {
      imageEditor.openTab("Bild", null);
    }
    else if(event.getSource() == removeButton) {
      variant.setImage(null);
      variant.setName(null);
      imageView.setImage(null);
      setText("Bild");
      imageEditor.setDirty(true, variant);
    }
    else if(event.getSource() == pasteButton) {
      Clipboard clipboard = Clipboard.getSystemClipboard();
      Image image = clipboard.getImage();
      if(image != null) {
        String name = "Aus Zwichenablage (" + imageEditor.getTabs().size() + ")";
        if(clipboard.getHtml() != null && clipboard.getHtml().startsWith("<img")) {
          String html = clipboard.getHtml();
          html = html.replaceAll("/>", "");
          html = html.substring(html.indexOf("src=")+5, html.length());
          name = html.substring(html.lastIndexOf("/")+1, html.indexOf("\""));
        }
        addImageVariant(name, ImageUtil.toBufferedImage(image));
      }
      List<File> files = clipboard.getFiles();
      if(files != null && !files.isEmpty()) {
        File file = files.get(0);
        if(file.getName().toLowerCase().endsWith(".jpg") || file.getName().toLowerCase().endsWith(".jpg")) {
          addImageVariant(file);
        }
      }
    }
  }

  public ImageVariant getVariant() {
    return variant;
  }

}


text:
#import "NSFormatter.h"

@class NSLocale;

@interface MKDistanceFormatter : NSFormatter
{
    NSLocale *_locale;
    unsigned long long _units;
    unsigned long long _unitStyle;
}

@property(nonatomic) unsigned long long unitStyle; // @synthesize unitStyle=_unitStyle;
@property(nonatomic) unsigned long long units; // @synthesize units=_units;
@property(copy, nonatomic) NSLocale *locale; // @synthesize locale=_locale;
- (_Bool)isPartialStringValid:(id *)arg1 proposedSelectedRange:(struct _NSRange *)arg2 originalString:(id)arg3 originalSelectedRange:(struct _NSRange)arg4 errorDescription:(id *)arg5;
- (_Bool)getObjectValue:(id *)arg1 forString:(id)arg2 errorDescription:(id *)arg3;
- (double)distanceFromString:(id)arg1;
- (id)stringForObjectValue:(id)arg1;
- (id)stringFromDistance:(double)arg1;
- (_Bool)_useMetric;
- (id)description;
- (void)dealloc;
- (id)init;

@end


text:
import sys
sys.path.insert(0, 'support_packages')
sys.path.insert(0, 'backend_python_files')

from google.appengine.api import users, memcache
from google.appengine.ext import ndb

# How to get backend python files and support packages into
# the worker.py file
# from backend_python_files import [insert package name]
# from support_packages import [insert package name]

DEFAULT_SCHEMA_NAME = 'default'

# --------------------------------------------------------------------------
# DataStore Models
#
# App Engine Data Store Models in this area
# use of stream_key is to immediately grab the index schema, unless
# another is needed.
#
# Each of the below models give a simplified view of some of the more common
# types of properties used in the data store.
# --------------------------------------------------------------------------

def stream_key(streambook_name=DEFAULT_SCHEMA_NAME):
    return ndb.Key('OTG', streambook_name)

class OTGModelUser(ndb.Model):
    user = ndb.UserProperty()
    name = ndb.StringProperty(indexed=True)
    added_date = ndb.DateTimeProperty(auto_now_add=True)

class OTGModelItems(ndb.Model):
    uniqueID = ndb.StringProperty(indexed=True)
    date = ndb.DateTimeProperty(auto_now_add=True)

# --------------------------------------------------------------------------
# Worker Role definitions and functions
# Memcache general strategy function
# Care must be taken, as stale cache values can cause odd behavior.
# --------------------------------------------------------------------------

def check_memcache_for_key(key):
    data = memcache.get(key)
    if data is not None:
        return data
    else:
        return None

def add_to_memcache(key, data, optional_time=60, optional_namespace=None):
    memcache.add(key, data, optional_time, min_compress_len=0, namespace=optional_namespace)

def get_memcache(key):
    data = check_memcache_for_key(key)

    if data is not None:
        return data
    else:
        return None

def set_memcache(key, data, optional_time=60, optional_namespace=None, optional_strategy=None):
    check_data = check_memcache_for_key(key)

    if check_data is not None:
        return "Already In Memcache"
    else:
        add_to_memcache(key, data, optional_time, optional_namespace)
        return True

# --------------------------------------------------------------------------
# Worker Role definitions and functions
# User functions
# --------------------------------------------------------------------------

"""
Register User: allows for the creation of a data store element with users.
For different users, retrieve specific user information using the user name
for additional web app functionality.
"""

def register_user(user):
    found_id = False
    # Check if the user exists already
    user_query = OTGModelUser.query(OTGModelUser.user == user)
    for key in user_query.iter(keys_only=True):
        if key:
            found_id = True
    if found_id:
        # user is already registered
        return
    else:
        # Access the main data store schema
        user_store = OTGModelUser(parent=stream_key(DEFAULT_SCHEMA_NAME))

        user_store.name = users.User.email(user)
        user_store.user = user
        user_store.put()


text:
package com.alnormous.geofencing.test.selection;

import java.util.ArrayList;
import java.util.List;

import org.junit.Assert;
import org.junit.Test;

import com.alnormous.geofencing.entities.Coordinate;
import com.alnormous.geofencing.entities.Fence;
import com.alnormous.geofencing.entities.FenceValidationException;
import com.vividsolutions.jts.geom.Envelope;

public class FenceTest {

	private Fence generateFence() throws FenceValidationException {

		/* -2   -1   0     1     2
		 * .    .    .     .     . 2
		 *                /|
		 * .    .        / |     . 1
		 *      /\__    /  |
		 * .   /    \_ /   |     . 0
		 *    /            |
		 * . |    1        |     . -1
		 *   /             |
		 * ./______________|     . -2
		 */
		List<Coordinate> points = new ArrayList<>();
		points.add(new Coordinate(-1.000, 1.000));
		points.add(new Coordinate(0.000,0.000));
		points.add(new Coordinate(1.000, 2.000));
		points.add(new Coordinate(1.000,-2.000));
		points.add(new Coordinate(-2.000, -2.000));

		Fence fence = new Fence(points, "fence1", "fence1");

		return fence;

	}

	@Test
	public void testPointsIn() throws Exception {
		Fence f = generateFence();
		Assert.assertTrue(f.contains(new Coordinate(0.000, -1.100))); // Inside shape
		Assert.assertTrue(f.contains(new Coordinate(-1.000, 0.999))); // Just inside
		Assert.assertTrue(f.contains(new Coordinate(0.499, -0.500))); // Just inside
	}

	@Test
	public void testPointsOut() throws Exception {
		Fence f = generateFence();
		Assert.assertFalse(f.contains(new Coordinate(0.000, 1.000))); // Definitely outside.
		Assert.assertFalse(f.contains(new Coordinate(-1.000, -2.010))); // Outside.
	}

	@Test
	public void testEnvelopeIn() throws Exception {
		Fence f = generateFence();
		Envelope envelope = new Envelope(new Coordinate(-1.000, -1.000), new Coordinate(-1.500, -1.500));
		Assert.assertTrue(f.contains(envelope)); // In
		Envelope envelope2 = new Envelope(new Coordinate(-2.000, 2.000), new Coordinate(-1.500, -1.800));
		Assert.assertFalse(f.contains(envelope2)); // Out
		Envelope envelope3 = new Envelope(new Coordinate(-2.000, 2.000), new Coordinate(0.000, 0.000));
		Assert.assertFalse(f.contains(envelope3)); // Overlaps, but doesn't contain.

	}

	@Test
	public void testEnvelopeOverlapping() throws Exception {
		Fence f = generateFence();
		Envelope envelope = new Envelope(new Coordinate(-1.000, -1.000), new Coordinate(-1.500, -1.500));
		Assert.assertTrue(f.overlapsOrContains(envelope)); // In
		Envelope envelope2 = new Envelope(new Coordinate(-2.000, 2.000), new Coordinate(-1.500, 1.800));
		Assert.assertFalse(f.overlapsOrContains(envelope2)); // Out
		Envelope envelope3 = new Envelope(new Coordinate(-2.000, 2.000), new Coordinate(0.000, 0.000));
		Assert.assertTrue(f.overlapsOrContains(envelope3)); // Overlaps, but doesn't contain.
	}

	@Test
	public void fenceTestOverlappingContainedWithin() throws Exception {
		List<Coordinate> points2 = new ArrayList<>();
		points2.add(new Coordinate(0.000,2.000));
		points2.add(new Coordinate(0.000, -2.000));
		points2.add(new Coordinate(2.000, -2.000));
		points2.add(new Coordinate(2.000, 2.000));
		Fence fence = new Fence(points2, "fence2", "fence2");
		Envelope envelope3 = new Envelope(new Coordinate(-3.000, 3.000), new Coordinate(3.000, -3.000));
		Assert.assertTrue(fence.overlapsOrContains(envelope3)); // Contained by envelope

	}

}


text:
namespace sw { namespace universal {

// core lns types and functions
template<unsigned nbits, unsigned rbits, typename bt, auto...x> class lns;
template<unsigned nbits, unsigned rbits, typename bt, auto...x> constexpr lns<nbits, rbits, bt, x...> abs(const lns<nbits, rbits, bt, x...>&);
template<unsigned nbits, unsigned rbits, typename bt, auto...x> lns<nbits, rbits, bt, x...> sqrt(const lns<nbits, rbits, bt, x...>&);

}} // namespace sw::universal


text:
#include <aws/elasticloadbalancingv2/model/RemoveTagsRequest.h>
#include <aws/core/utils/StringUtils.h>
#include <aws/core/utils/memory/stl/AWSStringStream.h>

using namespace Aws::ElasticLoadBalancingv2::Model;
using namespace Aws::Utils;

RemoveTagsRequest::RemoveTagsRequest() :
    m_resourceArnsHasBeenSet(false),
    m_tagKeysHasBeenSet(false)
{
}

Aws::String RemoveTagsRequest::SerializePayload() const
{
  Aws::StringStream ss;
  ss << "Action=RemoveTags&";
  if(m_resourceArnsHasBeenSet)
  {
    unsigned resourceArnsCount = 1;
    for(auto& item : m_resourceArns)
    {
      ss << "ResourceArns.member." << resourceArnsCount << "="
          << StringUtils::URLEncode(item.c_str()) << "&";
      resourceArnsCount++;
    }
  }

  if(m_tagKeysHasBeenSet)
  {
    unsigned tagKeysCount = 1;
    for(auto& item : m_tagKeys)
    {
      ss << "TagKeys.member." << tagKeysCount << "="
          << StringUtils::URLEncode(item.c_str()) << "&";
      tagKeysCount++;
    }
  }

  ss << "Version=2015-12-01";
  return ss.str();
}

void  RemoveTagsRequest::DumpBodyToUrl(Aws::Http::URI& uri ) const
{
  uri.SetQueryString(SerializePayload());
}


text:
<?php
namespace Berkman\CatalogBundle\Catalog;

class CatalogManager {

    private $catalogs = array();

    public function __construct(array $catalogIds = array())
    {
        foreach ($catalogIds as $catalogId) {
            $this->addCatalogById($catalogId);
        }
    }

    public function addCatalog($catalog)
    {
        $this->catalogs[] = $catalog;
    }

    public function addCatalogById($catalogId)
    {
        $className = '\\Berkman\\CatalogBundle\\Catalog\\Instances\\' . $catalogId;
        $this->addCatalog(new $className());
    }

    public function getCatalogs()
    {
        return $this->catalogs;
    }

    public function getCatalog($id)
    {
        $selectedCatalog = null;
        foreach ($this->catalogs as $catalog) {
            if ($catalog->getId() == $id) {
                $selectedCatalog = $catalog;
            }
        }
        if ($selectedCatalog === null) {
            $this->addCatalogById($id);
            $selectedCatalog = $this->getCatalog($id);
        }
        return $selectedCatalog;
    }
}


text:
import { photographerLink } from 'ember-weather/helpers/photographer-link';
import { module, test } from 'qunit';

module('Unit | Helper | photographer link');

// Replace this with your real tests.
test('it works', function(assert) {
  let result = photographerLink([42]);
  assert.ok(result);
});


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>CAEM Besançon École de musique - Accueil</title>
    <meta name="description" content="École de musique à Besançon" />
    <link href="http://fonts.googleapis.com/css?family=Quicksand:300,400,700" rel="stylesheet" type="text/css">
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">

    <link href="../assets/css/style.css" rel="stylesheet">

Suivez-nous sur    ou contactez-nous directement.

              Connexion

Accueil

                  ☰

Mon parcours musical

Tarifs & Inscriptions

Évenements

L'équipe


text:
package br.unisinos.siead.ds3.ticket;

import java.sql.SQLException;
import java.util.TimeZone;

public class Temp {

    public static void main(String args[]) throws SQLException {
        System.out.println(System.getenv("TICKET_DB_VENDOR"));
//        TimeZone tz = TimeZone.getDefault();
        TimeZone tz = TimeZone.getTimeZone("America/Sao_Paulo");
        System.out.println(tz);

        /*
         String HOST = System.getenv("OPENSHIFT_POSTGRESQL_DB_HOST");
         String PORT = System.getenv("OPENSHIFT_POSTGRESQL_DB_PORT");
         String USERNAME = System.getenv("OPENSHIFT_POSTGRESQL_DB_USERNAME");
         String PASSWORD = System.getenv("OPENSHIFT_POSTGRESQL_DB_PASSWORD");
         String DB_NAME = System.getenv("OPENSHIFT_APP_NAME");
         String FORNAME_URL = "org.postgresql.Driver";
         String URL = "jdbc://" + HOST + ":" + PORT + "/" + DB_NAME;
         Connection con = DriverManager.getConnection(URL, USERNAME, PASSWORD);
         */
    }
}


text:
desc 'Migration methods.'
command 'migration' do |g|
  g.desc 'For Enterprise Grid workspaces, map local user IDs to global user IDs'
  g.long_desc %( For Enterprise Grid workspaces, map local user IDs to global user IDs )
  g.command 'exchange' do |c|
    c.flag 'users', desc: 'A comma-separated list of user ids, up to 400 per request.'
    c.flag 'team_id', desc: 'Specify team_id starts with T in case of Org Token.'
    c.flag 'to_old', desc: 'Specify true to convert W global user IDs to workspace-specific U IDs. Defaults to false.'
    c.action do |_global_options, options, _args|
      puts JSON.dump($client.migration_exchange(options))
    end
  end
end


text:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html
	PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<title>Sequence Diagram Example: Lifeline Constraints</title>

<meta name="Generator" content="$Id: thread.pl,v 1.80 2013/12/20 08:42:32 dds Exp $" />
<meta name="Author" content="Diomidis Spinellis" />
<meta http-equiv="Content-Language" content="en" />
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<link rev="made" href="mailto:dds@aueb.gr" />
<link rel="ToC" href="index.html" />
<link rev="Subdocument" href="index.html" />
<link rel="previous" href="./uml-182.html" />
<link rel="next" href="./uml-71.html" />

<link href="./../noteres/notes.css" rel="stylesheet" type="text/css" id="the_css" />

Sequence Diagram Example: Lifeline Constraints

The following diagram, based on Figure 18-4 appearing on p. 252 of the
UML User Guide, illustrates constraints on an object's lifeline,
used both as genuine constraints, and to place a message label
on a particular position.
In addition, this diagram also uses nested activation.

Diagram

Diagram Source Code

# UML User Guide: Figure 18-4

.PS

copy "sequence.pic";

movewid = 0.5;

# Define the objects

object(S,"s:Caller");

object(W,":Switch");

pobject(C);

object(R,"r:Caller");

# Message sequences

step();

active(W);

async(); message(S,W,"liftReceiver"); sync();

active(S);

message(W,S,"setDialTone()");

async(); message(S,W,"*dialDigit(d)"); sync();

lconstraint(W,"{dialing.executionTime < 30s}");

active(W);

message(W,W,"routeCalls(s,n)");

inactive(W);

cmessage(W,C,"c:Convers");

active(C);

message(C,R,"ring()");

active(R);

async(); message(R,C,"liftReceiver"); sync();

message(C,W,"connect(r,s)");

message(W,S,"connect(r)");

# Specify label as a "constraint" to allign on W

message(W,R,""); lconstraint(W,"connect(s)");

step();

complete(S);

complete(W);

complete(C);

complete(R);

.PE

PreviousSequence Diagram Example: Create and Destroy

Contents

NextSequence Diagram Example: External Actor

 Last change: Tuesday, October 28, 2014 4:26 pm

 Unless otherwise expressly stated, all original material on this page
created by Diomidis Spinellis is licensed under a
Creative Commons Attribution-Share Alike 3.0 Greece License.


text:
require 'json_api_client'

module TestModels
  class Base < JsonApiClient::Resource
    def self.path(*)
      "api/v1/#{super}"
    end
  end
end


text:
/**
 * @fileOverview Defines the {@link CKEDITOR.lang} object, for the
 * Catalan language.
 */

/**#@+
   @type String
   @example
*/

/**
 * Contains the dictionary of language entries.
 * @namespace
 */
CKEDITOR.lang['ca'] =
{
	/**
	 * The language reading direction. Possible values are "rtl" for
	 * Right-To-Left languages (like Arabic) and "ltr" for Left-To-Right
	 * languages (like English).
	 * @default 'ltr'
	 */
	dir : 'ltr',

	/*
	 * Screenreader titles. Please note that screenreaders are not always capable
	 * of reading non-English words. So be careful while translating it.
	 */
	editorTitle : 'Rich text editor, %1', // MISSING
	editorHelp : 'Press ALT 0 for help', // MISSING

	// ARIA descriptions.
	toolbars	: 'Editor toolbars', // MISSING
	editor		: 'Editor de text enriquit',

	// Toolbar buttons without dialogs.
	source			: 'Codi font',
	newPage			: 'Nova pàgina',
	save			: 'Desa',
	preview			: 'Visualització prèvia',
	cut				: 'Retalla',
	copy			: 'Copia',
	paste			: 'Enganxa',
	print			: 'Imprimeix',
	underline		: 'Subratllat',
	bold			: 'Negreta',
	italic			: 'Cursiva',
	selectAll		: 'Selecciona-ho tot',
	removeFormat	: 'Elimina Format',
	strike			: 'Barrat',
	subscript		: 'Subíndex',
	superscript		: 'Superíndex',
	horizontalrule	: 'Insereix línia horitzontal',
	pagebreak		: 'Insereix salt de pàgina',
	pagebreakAlt		: 'Salt de pàgina',
	unlink			: 'Elimina l\'enllaç',
	undo			: 'Desfés',
	redo			: 'Refés',

	// Common messages and labels.
	common :
	{
		browseServer	: 'Veure servidor',
		url				: 'URL',
		protocol		: 'Protocol',
		upload			: 'Puja',
		uploadSubmit	: 'Envia-la al servidor',
		image			: 'Imatge',
		flash			: 'Flash',
		form			: 'Formulari',
		checkbox		: 'Casella de verificació',
		radio			: 'Botó d\'opció',
		textField		: 'Camp de text',
		textarea		: 'Àrea de text',
		hiddenField		: 'Camp ocult',
		button			: 'Botó',
		select			: 'Camp de selecció',
		imageButton		: 'Botó d\'imatge',
		notSet			: '<no definit>',
		id				: 'Id',
		name			: 'Nom',
		langDir			: 'Direcció de l\'idioma',
		langDirLtr		: 'D\'esquerra a dreta (LTR)',
		langDirRtl		: 'De dreta a esquerra (RTL)',
		langCode		: 'Codi d\'idioma',
		longDescr		: 'Descripció llarga de la URL',
		cssClass		: 'Classes del full d\'estil',
		advisoryTitle	: 'Títol consultiu',
		cssStyle		: 'Estil',
		ok				: 'D\'acord',
		cancel			: 'Cancel·la',
		close			: 'Tanca',
		preview			: 'Previsualitza',
		generalTab		: 'General',
		advancedTab		: 'Avançat',
		validateNumberFailed : 'Aquest valor no és un número.',
		confirmNewPage	: 'Els canvis en aquest contingut que no es desin es perdran. Esteu segur que voleu carregar una pàgina nova?',
		confirmCancel	: 'Algunes opcions s\'han canviat. Esteu segur que voleu tancar la finestra de diàleg?',
		options			: 'Opcions',
		target			: 'Destí',
		targetNew		: 'Nova finestra (_blank)',
		targetTop		: 'Finestra major (_top)',
		targetSelf		: 'Mateixa finestra (_self)',
		targetParent	: 'Finestra pare (_parent)',
		langDirLTR		: 'D\'esquerra a dreta (LTR)',
		langDirRTL		: 'De dreta a esquerra (RTL)',
		styles			: 'Estil',
		cssClasses		: 'Classes del full d\'estil',
		width			: 'Amplada',
		height			: 'Alçada',
		align			: 'Alineació',
		alignLeft		: 'Ajusta a l\'esquerra',
		alignRight		: 'Ajusta a la dreta',
		alignCenter		: 'Centre',
		alignTop		: 'Superior',
		alignMiddle		: 'Centre',
		alignBottom		: 'Inferior',
		invalidValue	: 'Invalid value.', // MISSING
		invalidHeight	: 'L\'alçada ha de ser un nombre.',
		invalidWidth	: 'L\'amplada ha de ser un nombre.',
		invalidCssLength	: 'Value specified for the "%1" field must be a positive number with or without a valid CSS measurement unit (px, %, in, cm, mm, em, ex, pt, or pc).', // MISSING
		invalidHtmlLength	: 'Value specified for the "%1" field must be a positive number with or without a valid HTML measurement unit (px or %).', // MISSING
		invalidInlineStyle	: 'Value specified for the inline style must consist of one or more tuples with the format of "name : value", separated by semi-colons.', // MISSING
		cssLengthTooltip	: 'Enter a number for a value in pixels or a number with a valid CSS unit (px, %, in, cm, mm, em, ex, pt, or pc).', // MISSING

		// Put the voice-only part of the label in the span.
		unavailable		: '%1, no disponible'
	},

	contextmenu :
	{
		options : 'Opcions del menú contextual'
	},

	// Special char dialog.
	specialChar		:
	{
		toolbar		: 'Insereix caràcter especial',
		title		: 'Selecciona el caràcter especial',
		options : 'Opcions de caràcters especials'
	},

	// Link dialog.
	link :
	{
		toolbar		: 'Insereix/Edita enllaç',
		other 		: '<altre>',
		menu		: 'Edita l\'enllaç',
		title		: 'Enllaç',
		info		: 'Informació de l\'enllaç',
		target		: 'Destí',
		upload		: 'Puja',
		advanced	: 'Avançat',
		type		: 'Tipus d\'enllaç',
		toUrl		: 'URL',
		toAnchor	: 'Àncora en aquesta pàgina',
		toEmail		: 'Correu electrònic',
		targetFrame		: '<marc>',
		targetPopup		: '<finestra emergent>',
		targetFrameName	: 'Nom del marc de destí',
		targetPopupName	: 'Nom finestra popup',
		popupFeatures	: 'Característiques finestra popup',
		popupResizable	: 'Redimensionable',
		popupStatusBar	: 'Barra d\'estat',
		popupLocationBar: 'Barra d\'adreça',
		popupToolbar	: 'Barra d\'eines',
		popupMenuBar	: 'Barra de menú',
		popupFullScreen	: 'Pantalla completa (IE)',
		popupScrollBars	: 'Barres d\'scroll',
		popupDependent	: 'Depenent (Netscape)',
		popupLeft		: 'Posició esquerra',
		popupTop		: 'Posició dalt',
		id				: 'Id',
		langDir			: 'Direcció de l\'idioma',
		langDirLTR		: 'D\'esquerra a dreta (LTR)',
		langDirRTL		: 'De dreta a esquerra (RTL)',
		acccessKey		: 'Clau d\'accés',
		name			: 'Nom',
		langCode			: 'Direcció de l\'idioma',
		tabIndex			: 'Index de Tab',
		advisoryTitle		: 'Títol consultiu',
		advisoryContentType	: 'Tipus de contingut consultiu',
		cssClasses		: 'Classes del full d\'estil',
		charset			: 'Conjunt de caràcters font enllaçat',
		styles			: 'Estil',
		rel			: 'Relationship', // MISSING
		selectAnchor		: 'Selecciona una àncora',
		anchorName		: 'Per nom d\'àncora',
		anchorId			: 'Per Id d\'element',
		emailAddress		: 'Adreça de correu electrònic',
		emailSubject		: 'Assumpte del missatge',
		emailBody		: 'Cos del missatge',
		noAnchors		: '(No hi ha àncores disponibles en aquest document)',
		noUrl			: 'Si us plau, escrigui l\'enllaç URL',
		noEmail			: 'Si us plau, escrigui l\'adreça correu electrònic'
	},

	// Anchor dialog
	anchor :
	{
		toolbar		: 'Insereix/Edita àncora',
		menu		: 'Propietats de l\'àncora',
		title		: 'Propietats de l\'àncora',
		name		: 'Nom de l\'àncora',
		errorName	: 'Si us plau, escriviu el nom de l\'ancora',
		remove		: 'Remove Anchor' // MISSING
	},

	// List style dialog
	list:
	{
		numberedTitle		: 'Numbered List Properties',
		bulletedTitle		: 'Bulleted List Properties',
		type				: 'Type',
		start				: 'Start',
		validateStartNumber				:'List start number must be a whole number.',
		circle				: 'Circle',
		disc				: 'Disc',
		square				: 'Square',
		none				: 'None',
		notset				: '<not set>',
		armenian			: 'Armenian numbering',
		georgian			: 'Georgian numbering (an, ban, gan, etc.)',
		lowerRoman			: 'Lower Roman (i, ii, iii, iv, v, etc.)',
		upperRoman			: 'Upper Roman (I, II, III, IV, V, etc.)',
		lowerAlpha			: 'Lower Alpha (a, b, c, d, e, etc.)',
		upperAlpha			: 'Upper Alpha (A, B, C, D, E, etc.)',
		lowerGreek			: 'Lower Greek (alpha, beta, gamma, etc.)',
		decimal				: 'Decimal (1, 2, 3, etc.)',
		decimalLeadingZero	: 'Decimal leading zero (01, 02, 03, etc.)'
	},

	// Find And Replace Dialog
	findAndReplace :
	{
		title				: 'Cerca i reemplaça',
		find				: 'Cerca',
		replace				: 'Reemplaça',
		findWhat			: 'Cerca:',
		replaceWith			: 'Remplaça amb:',
		notFoundMsg			: 'El text especificat no s\'ha trobat.',
		findOptions			: 'Find Options', // MISSING
		matchCase			: 'Distingeix majúscules/minúscules',
		matchWord			: 'Només paraules completes',
		matchCyclic			: 'Match cyclic',
		replaceAll			: 'Reemplaça-ho tot',
		replaceSuccessMsg	: '%1 ocurrència/es reemplaçada/es.'
	},

	// Table Dialog
	table :
	{
		toolbar		: 'Taula',
		title		: 'Propietats de la taula',
		menu		: 'Propietats de la taula',
		deleteTable	: 'Suprimeix la taula',
		rows		: 'Files',
		columns		: 'Columnes',
		border		: 'Mida vora',
		widthPx		: 'píxels',
		widthPc		: 'percentatge',
		widthUnit	: 'unitat d\'amplada',
		cellSpace	: 'Espaiat de cel·les',
		cellPad		: 'Encoixinament de cel·les',
		caption		: 'Títol',
		summary		: 'Resum',
		headers		: 'Capçaleres',
		headersNone		: 'Cap',
		headersColumn	: 'Primera columna',
		headersRow		: 'Primera fila',
		headersBoth		: 'Ambdues',
		invalidRows		: 'El nombre de files ha de ser un nombre major que 0.',
		invalidCols		: 'El nombre de columnes ha de ser un nombre major que 0.',
		invalidBorder	: 'El gruix de la vora ha de ser un nombre.',
		invalidWidth	: 'L\'amplada de la taula  ha de ser un nombre.',
		invalidHeight	: 'L\'alçada de la taula  ha de ser un nombre.',
		invalidCellSpacing	: 'L\'espaiat de cel·la  ha de ser un nombre.',
		invalidCellPadding	: 'L\'encoixinament de cel·la  ha de ser un nombre.',

		cell :
		{
			menu			: 'Cel·la',
			insertBefore	: 'Insereix abans',
			insertAfter		: 'Insereix després',
			deleteCell		: 'Suprimeix',
			merge			: 'Fusiona',
			mergeRight		: 'Fusiona a la dreta',
			mergeDown		: 'Fusiona avall',
			splitHorizontal	: 'Divideix horitzontalment',
			splitVertical	: 'Divideix verticalment',
			title			: 'Propietats de la cel·la',
			cellType		: 'Tipus de cel·la',
			rowSpan			: 'Expansió de files',
			colSpan			: 'Expansió de columnes',
			wordWrap		: 'Ajustar al contingut',
			hAlign			: 'Alineació Horizontal',
			vAlign			: 'Alineació Vertical',
			alignBaseline	: 'A la línia base',
			bgColor			: 'Color de fons',
			borderColor		: 'Color de la vora',
			data			: 'Dades',
			header			: 'Capçalera',
			yes				: 'Sí',
			no				: 'No',
			invalidWidth	: 'L\'amplada de cel·la ha de ser un nombre.',
			invalidHeight	: 'L\'alçada de cel·la ha de ser un nombre.',
			invalidRowSpan	: 'L\'expansió de files ha de ser un nombre enter.',
			invalidColSpan	: 'L\'expansió de columnes ha de ser un nombre enter.',
			chooseColor		: 'Trieu'
		},

		row :
		{
			menu			: 'Fila',
			insertBefore	: 'Insereix fila abans de',
			insertAfter		: 'Insereix fila darrera',
			deleteRow		: 'Suprimeix una fila'
		},

		column :
		{
			menu			: 'Columna',
			insertBefore	: 'Insereix columna abans de',
			insertAfter		: 'Insereix columna darrera',
			deleteColumn	: 'Suprimeix una columna'
		}
	},

	// Button Dialog.
	button :
	{
		title		: 'Propietats del botó',
		text		: 'Text (Valor)',
		type		: 'Tipus',
		typeBtn		: 'Botó',
		typeSbm		: 'Transmet formulari',
		typeRst		: 'Reinicia formulari'
	},

	// Checkbox and Radio Button Dialogs.
	checkboxAndRadio :
	{
		checkboxTitle : 'Propietats de la casella de verificació',
		radioTitle	: 'Propietats del botó d\'opció',
		value		: 'Valor',
		selected	: 'Seleccionat'
	},

	// Form Dialog.
	form :
	{
		title		: 'Propietats del formulari',
		menu		: 'Propietats del formulari',
		action		: 'Acció',
		method		: 'Mètode',
		encoding	: 'Codificació'
	},

	// Select Field Dialog.
	select :
	{
		title		: 'Propietats del camp de selecció',
		selectInfo	: 'Info',
		opAvail		: 'Opcions disponibles',
		value		: 'Valor',
		size		: 'Mida',
		lines		: 'Línies',
		chkMulti	: 'Permet múltiples seleccions',
		opText		: 'Text',
		opValue		: 'Valor',
		btnAdd		: 'Afegeix',
		btnModify	: 'Modifica',
		btnUp		: 'Amunt',
		btnDown		: 'Avall',
		btnSetValue : 'Selecciona per defecte',
		btnDelete	: 'Elimina'
	},

	// Textarea Dialog.
	textarea :
	{
		title		: 'Propietats de l\'àrea de text',
		cols		: 'Columnes',
		rows		: 'Files'
	},

	// Text Field Dialog.
	textfield :
	{
		title		: 'Propietats del camp de text',
		name		: 'Nom',
		value		: 'Valor',
		charWidth	: 'Amplada',
		maxChars	: 'Nombre màxim de caràcters',
		type		: 'Tipus',
		typeText	: 'Text',
		typePass	: 'Contrasenya'
	},

	// Hidden Field Dialog.
	hidden :
	{
		title	: 'Propietats del camp ocult',
		name	: 'Nom',
		value	: 'Valor'
	},

	// Image Dialog.
	image :
	{
		title		: 'Propietats de la imatge',
		titleButton	: 'Propietats del botó d\'imatge',
		menu		: 'Propietats de la imatge',
		infoTab		: 'Informació de la imatge',
		btnUpload	: 'Envia-la al servidor',
		upload		: 'Puja',
		alt			: 'Text alternatiu',
		lockRatio	: 'Bloqueja les proporcions',
		resetSize	: 'Restaura la mida',
		border		: 'Vora',
		hSpace		: 'Espaiat horit.',
		vSpace		: 'Espaiat vert.',
		alertUrl	: 'Si us plau, escriviu la URL de la imatge',
		linkTab		: 'Enllaç',
		button2Img	: 'Voleu transformar el botó d\'imatge seleccionat en una simple imatge?',
		img2Button	: 'Voleu transformar la imatge seleccionada en un botó d\'imatge?',
		urlMissing	: 'Falta la URL de la imatge.',
		validateBorder	: 'La vora ha de ser un nombre enter.',
		validateHSpace	: 'HSpace ha de ser un nombre enter.',
		validateVSpace	: 'VSpace ha de ser un nombre enter.'
	},

	// Flash Dialog
	flash :
	{
		properties		: 'Propietats del Flash',
		propertiesTab	: 'Propietats',
		title			: 'Propietats del Flash',
		chkPlay			: 'Reprodució automàtica',
		chkLoop			: 'Bucle',
		chkMenu			: 'Habilita menú Flash',
		chkFull			: 'Permetre la pantalla completa',
 		scale			: 'Escala',
		scaleAll		: 'Mostra-ho tot',
		scaleNoBorder	: 'Sense vores',
		scaleFit		: 'Mida exacta',
		access			: 'Accés a scripts',
		accessAlways	: 'Sempre',
		accessSameDomain: 'El mateix domini',
		accessNever		: 'Mai',
		alignAbsBottom	: 'Abs Bottom',
		alignAbsMiddle	: 'Abs Middle',
		alignBaseline	: 'Baseline',
		alignTextTop	: 'Text Top',
		quality			: 'Qualitat',
		qualityBest		: 'La millor',
		qualityHigh		: 'Alta',
		qualityAutoHigh	: 'Alta automàtica',
		qualityMedium	: 'Mitjana',
		qualityAutoLow	: 'Baixa automàtica',
		qualityLow		: 'Baixa',
		windowModeWindow: 'Finestra',
		windowModeOpaque: 'Opaca',
		windowModeTransparent : 'Transparent',
		windowMode		: 'Mode de la finestra',
		flashvars		: 'Variables de Flash',
		bgcolor			: 'Color de Fons',
		hSpace			: 'Espaiat horit.',
		vSpace			: 'Espaiat vert.',
		validateSrc		: 'Si us plau, escrigui l\'enllaç URL',
		validateHSpace	: 'L\'espaiat horitzonatal ha de ser un nombre.',
		validateVSpace	: 'L\'espaiat vertical ha de ser un nombre.'
	},

	// Speller Pages Dialog
	spellCheck :
	{
		toolbar			: 'Revisa l\'ortografia',
		title			: 'Comprova l\'ortografia',
		notAvailable	: 'El servei no es troba disponible ara.',
		errorLoading	: 'Error carregant el servidor: %s.',
		notInDic		: 'No és al diccionari',
		changeTo		: 'Reemplaça amb',
		btnIgnore		: 'Ignora',
		btnIgnoreAll	: 'Ignora-les totes',
		btnReplace		: 'Canvia',
		btnReplaceAll	: 'Canvia-les totes',
		btnUndo			: 'Desfés',
		noSuggestions	: 'Cap suggeriment',
		progress		: 'Verificació ortogràfica en curs...',
		noMispell		: 'Verificació ortogràfica acabada: no hi ha cap paraula mal escrita',
		noChanges		: 'Verificació ortogràfica: no s\'ha canviat cap paraula',
		oneChange		: 'Verificació ortogràfica: s\'ha canviat una paraula',
		manyChanges		: 'Verificació ortogràfica: s\'han canviat %1 paraules',
		ieSpellDownload	: 'Verificació ortogràfica no instal·lada. Voleu descarregar-ho ara?'
	},

	smiley :
	{
		toolbar	: 'Icona',
		title	: 'Insereix una icona',
		options : 'Opcions d\'emoticones'
	},

	elementsPath :
	{
		eleLabel : 'Elements path',
		eleTitle : '%1 element'
	},

	numberedlist	: 'Llista numerada',
	bulletedlist	: 'Llista de pics',
	indent			: 'Augmenta el sagnat',
	outdent			: 'Redueix el sagnat',

	justify :
	{
		left	: 'Alinea a l\'esquerra',
		center	: 'Centrat',
		right	: 'Alinea a la dreta',
		block	: 'Justificat'
	},

	blockquote : 'Bloc de cita',

	clipboard :
	{
		title		: 'Enganxa',
		cutError	: 'La seguretat del vostre navegador no permet executar automàticament les operacions de retallar. Si us plau, utilitzeu el teclat (Ctrl+X).',
		copyError	: 'La seguretat del vostre navegador no permet executar automàticament les operacions de copiar. Si us plau, utilitzeu el teclat (Ctrl+C).',
		pasteMsg	: 'Si us plau, enganxeu dins del següent camp utilitzant el teclat (Ctrl+V) i premeu OK.',
		securityMsg	: 'A causa de la configuració de seguretat del vostre navegador, l\'editor no pot accedir al porta-retalls directament. Enganxeu-ho un altre cop en aquesta finestra.',
		pasteArea	: 'Àrea d\'enganxat'
	},

	pastefromword :
	{
		confirmCleanup	: 'El text que voleu enganxar sembla provenir de Word. Voleu netejar aquest text abans que sigui enganxat?',
		toolbar			: 'Enganxa des del Word',
		title			: 'Enganxa des del Word',
		error			: 'No ha estat possible netejar les dades enganxades degut a un error intern'
	},

	pasteText :
	{
		button	: 'Enganxa com a text no formatat',
		title	: 'Enganxa com a text no formatat'
	},

	templates :
	{
		button			: 'Plantilles',
		title			: 'Plantilles de contingut',
		options : 'Opcions de plantilla',
		insertOption	: 'Reemplaça el contingut actual',
		selectPromptMsg	: 'Seleccioneu una plantilla per usar a l\'editor
(per defecte s\'elimina el contingut actual):',
		emptyListMsg	: '(No hi ha plantilles definides)'
	},

	showBlocks : 'Mostra els blocs',

	stylesCombo :
	{
		label		: 'Estil',
		panelTitle	: 'Estils de format',
		panelTitle1	: 'Estils de bloc',
		panelTitle2	: 'Estils incrustats',
		panelTitle3	: 'Estils d\'objecte'
	},

	format :
	{
		label		: 'Format',
		panelTitle	: 'Format',

		tag_p		: 'Normal',
		tag_pre		: 'Formatejat',
		tag_address	: 'Adreça',
		tag_h1		: 'Encapçalament 1',
		tag_h2		: 'Encapçalament 2',
		tag_h3		: 'Encapçalament 3',
		tag_h4		: 'Encapçalament 4',
		tag_h5		: 'Encapçalament 5',
		tag_h6		: 'Encapçalament 6',
		tag_div		: 'Normal (DIV)'
	},

	div :
	{
		title				: 'Crea un contenidor Div',
		toolbar				: 'Crea un contenidor Div',
		cssClassInputLabel	: 'Classes de la fulla d\'estils',
		styleSelectLabel	: 'Estil',
		IdInputLabel		: 'Id',
		languageCodeInputLabel	: ' Codi d\'idioma',
		inlineStyleInputLabel	: 'Estil en línia',
		advisoryTitleInputLabel	: 'Títol de guia',
		langDirLabel		: 'Direcció de l\'idioma',
		langDirLTRLabel		: 'D\'esquerra a dreta (LTR)',
		langDirRTLLabel		: 'De dreta a esquerra (RTL)',
		edit				: 'Edita Div',
		remove				: 'Elimina Div'
  	},

	iframe :
	{
		title		: 'Propietats IFrame',
		toolbar		: 'IFrame',
		noUrl		: 'Si us plau, introduïu la URL de l\'iframe URL',
		scrolling	: 'Activa les barrres de desplaçament',
		border		: 'Mostra la vora del marc'
	},

	font :
	{
		label		: 'Tipus de lletra',
		voiceLabel	: 'Tipus de lletra',
		panelTitle	: 'Tipus de lletra'
	},

	fontSize :
	{
		label		: 'Mida',
		voiceLabel	: 'Mida de la lletra',
		panelTitle	: 'Mida'
	},

	colorButton :
	{
		textColorTitle	: 'Color de Text',
		bgColorTitle	: 'Color de Fons',
		panelTitle		: 'Colors',
		auto			: 'Automàtic',
		more			: 'Més colors...'
	},

	colors :
	{
		'000' : 'Negre',
		'800000' : 'Granat',
		'8B4513' : 'Marró sella',
		'2F4F4F' : 'Gris pissarra fosca',
		'008080' : 'Blau xarxet',
		'000080' : 'Blau marí',
		'4B0082' : 'Indi',
		'696969' : 'Gris intens',
		'B22222' : 'Maó',
		'A52A2A' : 'Marró (web)',
		'DAA520' : 'Solidago',
		'006400' : 'Verd fosc',
		'40E0D0' : 'Turquesa',
		'0000CD' : 'Atzur',
		'800080' : 'Lila',
		'808080' : 'Gris',
		'F00' : 'Vermell',
		'FF8C00' : 'Taronja fosc',
		'FFD700' : 'Or',
		'008000' : 'Verd',
		'0FF' : 'Cian',
		'00F' : 'Blau',
		'EE82EE' : 'Lavanda rosat',
		'A9A9A9' : 'Gris clar',
		'FFA07A' : 'Salmó clar',
		'FFA500' : 'Taronja',
		'FFFF00' : 'Groc',
		'00FF00' : 'Verd llima',
		'AFEEEE' : 'Blau pàlid',
		'ADD8E6' : 'Blau clar',
		'DDA0DD' : 'Pruna',
		'D3D3D3' : 'Gris clar',
		'FFF0F5' : 'Lavanda rosat',
		'FAEBD7' : 'Blanc antic',
		'FFFFE0' : 'Groc clar',
		'F0FFF0' : 'Verd pàlid',
		'F0FFFF' : 'Blau cel pàlid',
		'F0F8FF' : 'Cian pàlid',
		'E6E6FA' : 'Lavanda',
		'FFF' : 'Blanc'
	},

	scayt :
	{
		title			: 'Spell Check As You Type',
		opera_title		: 'No és compatible amb l\'Opera',
		enable			: 'Habilitat l\'SCAYT',
		disable			: 'Deshabilita SCAYT',
		about			: 'Quant a l\'SCAYT',
		toggle			: 'Commuta l\'SCAYT',
		options			: 'Opcions',
		langs			: 'Idiomes',
		moreSuggestions	: 'Més suggerències',
		ignore			: 'Ignora',
		ignoreAll		: 'Ignora\'ls tots',
		addWord			: 'Afegeix una paraula',
		emptyDic		: 'El nom del diccionari no hauria d\'estar buit.',
		noSuggestions	: 'Cap suggeriment',
		optionsTab		: 'Opcions',
		allCaps			: 'Ignora paraules en majúscules',
		ignoreDomainNames : 'Ignora els noms de domini',
		mixedCase		: 'Ignora paraules amb majúscules i minúscules',
		mixedWithDigits	: 'Ignora paraules amb números ',

		languagesTab	: 'Idiomes',

		dictionariesTab	: 'Diccionaris',
		dic_field_name	: 'Nom del diccionari',
		dic_create		: 'Crea',
		dic_restore		: 'Restaura',
		dic_delete		: 'Elimina',
		dic_rename		: 'Canvia el nom',
		dic_info		: 'Inicialment el diccionari d\'usuari s\'emmagatzema en una galeta. De totes maneres, les galetes tenen la mida limitada. Quan el diccionari creix massa, llavors el diccionari es pot emmagatzemar al nostre servidor. Per desar el vostre diccionari personal al nostre servidor heu d.\'especificar un nom pel diccionari. Si ja heu desat un diccionari, teclegeu si us plau el seu nom i cliqueu el botó de restauració.',

		aboutTab		: 'Quant a'
	},

	about :
	{
		title		: 'Quant al CKEditor',
		dlgTitle	: 'Quant al CKEditor',
		help	: 'Check $1 for help.', // MISSING
		userGuide : 'CKEditor User\'s Guide', // MISSING
		moreInfo	: 'Per informació sobre llicències visiteu el web:',
		copy		: 'Copyright © $1. Tots els drets reservats.'
	},

	maximize : 'Maximitza',
	minimize : 'Minimitza',

	fakeobjects :
	{
		anchor		: 'Àncora',
		flash		: 'Animació Flash',
		iframe		: 'IFrame',
		hiddenfield	: 'Camp ocult',
		unknown		: 'Objecte desconegut'
	},

	resize : 'Arrossegueu per redimensionar',

	colordialog :
	{
		title		: 'Selecciona el color',
		options	:	'Opcions del color',
		highlight	: 'Destacat',
		selected	: 'Seleccionat',
		clear		: 'Neteja'
	},

	toolbarCollapse	: 'Redueix la barra d\'eines',
	toolbarExpand	: 'Amplia la barra d\'eines',

	toolbarGroups :
	{
		document : 'Document', // MISSING
		clipboard : 'Clipboard/Undo', // MISSING
		editing : 'Editing', // MISSING
		forms : 'Forms', // MISSING
		basicstyles : 'Basic Styles', // MISSING
		paragraph : 'Paragraph', // MISSING
		links : 'Links', // MISSING
		insert : 'Insert', // MISSING
		styles : 'Styles', // MISSING
		colors : 'Colors', // MISSING
		tools : 'Tools' // MISSING
	},

	bidi :
	{
		ltr : 'Direcció del text d\'esquerra a dreta',
		rtl : 'Direcció del text de dreta a esquerra'
	},

	docprops :
	{
		label : 'Propietats del document',
		title : 'Propietats del document',
		design : 'Design', // MISSING
		meta : 'Metadades',
		chooseColor : 'Trieu',
		other : '<altre>',
		docTitle :	'Títol de la pàgina',
		charset : 	'Codificació de conjunt de caràcters',
		charsetOther : 'Una altra codificació de caràcters',
		charsetASCII : 'ASCII', // MISSING
		charsetCE : 'Centreeuropeu',
		charsetCT : 'Xinès tradicional (Big5)',
		charsetCR : 'Ciríl·lic',
		charsetGR : 'Grec',
		charsetJP : 'Japonès',
		charsetKR : 'Coreà',
		charsetTR : 'Turc',
		charsetUN : 'Unicode (UTF-8)', // MISSING
		charsetWE : 'Europeu occidental',
		docType : 'Capçalera de tipus de document',
		docTypeOther : 'Un altra capçalera de tipus de document',
		xhtmlDec : 'Incloure declaracions XHTML',
		bgColor : 'Color de fons',
		bgImage : 'URL de la imatge de fons',
		bgFixed : 'Fons fixe',
		txtColor : 'Color de Text',
		margin : 'Marges de pàgina',
		marginTop : 'Cap',
		marginLeft : 'Esquerra',
		marginRight : 'Dreta',
		marginBottom : 'Peu',
		metaKeywords : 'Mots clau per a indexació (separats per coma)',
		metaDescription : 'Descripció del document',
		metaAuthor : 'Autor',
		metaCopyright : 'Copyright', // MISSING
		previewHtml : '
This is some sample text. You are using CKEditor.
' // MISSING
	}
};


text:
<?xml version="1.0" encoding="UTF-8"?>
<MetaDataObject xmlns="http://v8.1c.ru/8.3/MDClasses" xmlns:app="http://v8.1c.ru/8.2/managed-application/core" xmlns:cfg="http://v8.1c.ru/8.1/data/enterprise/current-config" xmlns:cmi="http://v8.1c.ru/8.2/managed-application/cmi" xmlns:ent="http://v8.1c.ru/8.1/data/enterprise" xmlns:lf="http://v8.1c.ru/8.2/managed-application/logform" xmlns:style="http://v8.1c.ru/8.1/data/ui/style" xmlns:sys="http://v8.1c.ru/8.1/data/ui/fonts/system" xmlns:v8="http://v8.1c.ru/8.1/data/core" xmlns:v8ui="http://v8.1c.ru/8.1/data/ui" xmlns:web="http://v8.1c.ru/8.1/data/ui/colors/web" xmlns:win="http://v8.1c.ru/8.1/data/ui/colors/windows" xmlns:xen="http://v8.1c.ru/8.3/xcf/enums" xmlns:xpr="http://v8.1c.ru/8.3/xcf/predef" xmlns:xr="http://v8.1c.ru/8.3/xcf/readable" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.2">
	<CommonModule uuid="d91441cf-d793-4dfa-9225-f0c16818edde">
		<Properties>
			<Name>РезервноеКопированиеИБГлобальный</Name>
			<Synonym>
				<v8:item>
					<v8:lang>ru</v8:lang>
					<v8:content>Резервное копирование ИБ глобальный</v8:content>
				</v8:item>
			</Synonym>
			<Comment/>
			<Global>true</Global>
			<ClientManagedApplication>true</ClientManagedApplication>
			<Server>false</Server>
			<ExternalConnection>false</ExternalConnection>
			<ClientOrdinaryApplication>true</ClientOrdinaryApplication>
			<ServerCall>false</ServerCall>
			<Privileged>false</Privileged>
			<ReturnValuesReuse>DontUse</ReturnValuesReuse>
		</Properties>
	</CommonModule>
</MetaDataObject>


text:
package chatty.gui.components.textpane;

import javax.swing.text.BoxView;
import javax.swing.text.Element;

/**
 * Starts adding text at the bottom instead of at the top.
 *
 * @author tduva
 */
class ChatBoxView extends BoxView {

    public ChatBoxView(Element elem, int axis) {
        super(elem,axis);
    }

    @Override
    protected void layoutMajorAxis(int targetSpan, int axis, int[] offsets, int[] spans) {

        super.layoutMajorAxis(targetSpan,axis,offsets,spans);
        int textBlockHeight = 0;
        int offset = 0;

        for (int i = 0; i < spans.length; i++) {

            textBlockHeight += spans[i];
        }
        offset = (targetSpan - textBlockHeight);
        //System.out.println(offset);
        for (int i = 0; i < offsets.length; i++) {
            offsets[i] += offset;
        }

    }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="?attr/clockSoftBackground"
    android:clickable="true"
    android:orientation="vertical">

    <include
        layout="@layout/include_navigation"
        android:layout_width="match_parent"
        android:layout_height="?attr/actionBarSize" />

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:gravity="center_horizontal"
        android:orientation="vertical"
        android:paddingBottom="16dp"
        android:paddingTop="16dp">

        <ImageView
            android:layout_width="90dp"
            android:layout_height="90dp"
            android:src="@mipmap/ic_face" />

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="10dp"
            android:gravity="center_horizontal"
            android:text="@string/describeOfMe"
            android:textColor="?attr/clockTextColor" />
    </LinearLayout>

    <ScrollView
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_weight="1">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical">

            <TextView
                android:id="@+id/mThankTopTxt"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:lineSpacingExtra="3dp"
                android:lineSpacingMultiplier="1.5"
                android:paddingBottom="16dp"
                android:paddingLeft="16dp"
                android:paddingRight="16dp"
                android:paddingTop="10dp"
                android:textSize="16sp" />

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="horizontal">

                <TextView
                    android:id="@+id/mThankLeftTxt"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:lineSpacingExtra="3dp"
                    android:lineSpacingMultiplier="1.5"
                    android:paddingBottom="16dp"
                    android:paddingLeft="16dp"
                    android:paddingRight="16dp"
                    android:textSize="16sp" />

                <TextView
                    android:id="@+id/mThankRightTxt"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:lineSpacingExtra="3dp"
                    android:lineSpacingMultiplier="1.5"
                    android:paddingBottom="16dp"
                    android:paddingLeft="16dp"
                    android:paddingRight="16dp"
                    android:textSize="16sp" />
            </LinearLayout>
        </LinearLayout>
    </ScrollView>
</LinearLayout>