Dataset Preview
The full dataset viewer is not available (click to read why). Only showing a preview of the rows.
The dataset generation failed
Error code: DatasetGenerationError
Exception: ArrowInvalid
Message: JSON parse error: Missing a closing quotation mark in string. in row 566
Traceback: Traceback (most recent call last):
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/packaged_modules/json/json.py", line 145, in _generate_tables
dataset = json.load(f)
File "/usr/local/lib/python3.9/json/__init__.py", line 293, in load
return loads(fp.read(),
File "/usr/local/lib/python3.9/json/__init__.py", line 346, in loads
return _default_decoder.decode(s)
File "/usr/local/lib/python3.9/json/decoder.py", line 340, in decode
raise JSONDecodeError("Extra data", s, end)
json.decoder.JSONDecodeError: Extra data: line 2 column 1 (char 686)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/builder.py", line 1995, in _prepare_split_single
for _, table in generator:
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/packaged_modules/json/json.py", line 148, in _generate_tables
raise e
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/packaged_modules/json/json.py", line 122, in _generate_tables
pa_table = paj.read_json(
File "pyarrow/_json.pyx", line 308, in pyarrow._json.read_json
File "pyarrow/error.pxi", line 154, in pyarrow.lib.pyarrow_internal_check_status
File "pyarrow/error.pxi", line 91, in pyarrow.lib.check_status
pyarrow.lib.ArrowInvalid: JSON parse error: Missing a closing quotation mark in string. in row 566
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/src/services/worker/src/worker/job_runners/config/parquet_and_info.py", line 1529, in compute_config_parquet_and_info_response
parquet_operations = convert_to_parquet(builder)
File "/src/services/worker/src/worker/job_runners/config/parquet_and_info.py", line 1154, in convert_to_parquet
builder.download_and_prepare(
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/builder.py", line 1027, in download_and_prepare
self._download_and_prepare(
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/builder.py", line 1122, in _download_and_prepare
self._prepare_split(split_generator, **prepare_split_kwargs)
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/builder.py", line 1882, in _prepare_split
for job_id, done, content in self._prepare_split_single(
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/builder.py", line 2038, in _prepare_split_single
raise DatasetGenerationError("An error occurred while generating the dataset") from e
datasets.exceptions.DatasetGenerationError: An error occurred while generating the datasetNeed help to make the dataset viewer work? Make sure to review how to configure the dataset viewer, and open a discussion for direct support.
text
string | meta
dict |
|---|---|
Robot Architecture
After working on the board's communication, is time to build the architecture.
|
{
"content_hash": "e143124490768b650d2cb6ef72d4fe4b",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 78,
"avg_line_length": 33,
"alnum_prop": 0.8181818181818182,
"repo_name": "simoesusp/PatientSimulator",
"id": "801a1c8795ba50f164055cfdd56859a8ba154bc0",
"size": "99",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "MarceloForesto/RobotArchitecture/readme.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "28595"
},
{
"name": "C++",
"bytes": "14665"
},
{
"name": "Java",
"bytes": "1426"
}
]
}
|
title: calicoctl create
---
This sections describes the `calicoctl create` command.
Read the [calicoctl command line interface user reference]({{site.baseurl}}/{{page.version}}/reference/calicoctl/)
for a full list of calicoctl commands.
> **Note**: The available actions for a specific resource type may be
> limited based on the datastore used for {{site.prodname}} (etcdv3 / Kubernetes API).
> Please refer to the
> [Resources section]({{site.baseurl}}/{{page.version}}/reference/calicoctl/resources/)
> for details about each resource type.
{: .alert .alert-info}
## Displaying the help text for 'calicoctl create' command
Run `calicoctl create --help` to display the following help menu for the
command.
```
Usage:
calicoctl create --filename=<FILENAME> [--skip-exists] [--config=<CONFIG>] [--namespace=<NS>]
Examples:
# Create a policy using the data in policy.yaml.
calicoctl create -f ./policy.yaml
# Create a policy based on the JSON passed into stdin.
cat policy.json | calicoctl create -f -
Options:
-h --help Show this screen.
-f --filename=<FILENAME> Filename to use to create the resource. If set to
"-" loads from stdin.
--skip-exists Skip over and treat as successful any attempts to
create an entry that already exists.
-c --config=<CONFIG> Path to the file containing connection
configuration in YAML or JSON format.
[default: /etc/calico/calicoctl.cfg]
-n --namespace=<NS> Namespace of the resource.
Only applicable to NetworkPolicy and WorkloadEndpoint.
Uses the default namespace if not specified.
Description:
The create command is used to create a set of resources by filename or stdin.
JSON and YAML formats are accepted.
Valid resource types are:
* bgpConfiguration
* bgpPeer
* felixConfiguration
* globalNetworkPolicy
* hostEndpoint
* ipPool
* networkPolicy
* node
* profile
* workloadEndpoint
Attempting to create a resource that already exists is treated as a
terminating error unless the --skip-exists flag is set. If this flag is set,
resources that already exist are skipped.
The output of the command indicates how many resources were successfully
created, and the error reason if an error occurred. If the --skip-exists
flag is set then skipped resources are included in the success count.
The resources are created in the order they are specified. In the event of a
failure creating a specific resource it is possible to work out which
resource failed based on the number of resources successfully created.
```
### Examples
```
# Create a set of resources (of mixed type) using the data in resources.yaml.
# Results indicate that 8 resources were successfully created.
$ calicoctl create -f ./resources.yaml
Successfully created 8 resource(s)
# Create the same set of resources reading from stdin.
# Results indicate failure because the first resource (in this case a Profile)
# already exists.
$ cat resources.yaml | calicoctl apply -f -
Failed to create any resources: resource already exists: Profile(name=profile1)
```
### Options
```
-f --filename=<FILENAME> Filename to use to create the resource. If set to
"-" loads from stdin.
--skip-exists Skip over and treat as successful any attempts to
create an entry that already exists.
-n --namespace=<NS> Namespace of the resource.
Only applicable to NetworkPolicy and WorkloadEndpoint.
Uses the default namespace if not specified.
```
### General options
```
-c --config=<CONFIG> Path to the file containing connection
configuration in YAML or JSON format.
[default: /etc/calico/calicoctl.cfg]
```
## See also
- [Resources]({{site.baseurl}}/{{page.version}}/reference/calicoctl/resources/) for details on all valid resources, including file format
and schema
- [NetworkPolicy]({{site.baseurl}}/{{page.version}}/reference/calicoctl/resources/networkpolicy) for details on the {{site.prodname}} selector-based policy model
- [calicoctl configuration]({{site.baseurl}}/{{page.version}}/reference/calicoctl/setup) for details on configuring `calicoctl` to access
the {{site.prodname}} datastore.
|
{
"content_hash": "79ae3f49ba266579bd61fee8319ec7dd",
"timestamp": "",
"source": "github",
"line_count": 117,
"max_line_length": 162,
"avg_line_length": 38.427350427350426,
"alnum_prop": 0.6812722419928826,
"repo_name": "heschlie/calico",
"id": "5815d3e27aa6d7cd05e16aea9dbb2fff4eb9badc",
"size": "4500",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "master/reference/calicoctl/commands/create.md",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "6541"
},
{
"name": "Go",
"bytes": "79680"
},
{
"name": "HTML",
"bytes": "42626"
},
{
"name": "JavaScript",
"bytes": "1272"
},
{
"name": "Makefile",
"bytes": "37094"
},
{
"name": "Python",
"bytes": "303537"
},
{
"name": "Ruby",
"bytes": "206537"
},
{
"name": "Shell",
"bytes": "28229"
}
]
}
|
{% extends 'catalog/base.html' %}
{% load static %}
{% block content %}
<div class="categories">
{% for category in halo_group %}
<a href="{% url 'category' category.tag %}" title="{{ category.name }}">
<img src="{{ category.icon.url }}" alt="{{ category.name }}"/>
</a>
{% endfor %}
</div>
<div class="categories reports">
{% for report in report_group %}
<a href="{% url 'report' report.tag %}" title="{{ report.name }}">
<img src="{{ report.icon.url }}" alt="{{ report.name }}"/>
</a>
{% endfor %}
<br>
{% for category in other_group %}
<a href="{% url 'category' category.tag %}" title="{{ category.name }}">
<img src="{{ category.icon.url }}" alt="{{ category.name }}"/>
</a>
{% endfor %}
<a href="{% url 'about' %}" title="About the Site">
<img src="{% static 'catalog/img/about.jpg' %}" alt="About the Site">
</a>
</div>
{% endblock %}
|
{
"content_hash": "7b89b3c04ca9fbd4a0f9413922bd9f70",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 78,
"avg_line_length": 34.357142857142854,
"alnum_prop": 0.5166320166320166,
"repo_name": "bgalbraith/nincatalog",
"id": "f534ec641a7fd5615536e52450815d8aacb091ce",
"size": "962",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "catalog/templates/catalog/index.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "3647"
},
{
"name": "HTML",
"bytes": "10747"
},
{
"name": "Python",
"bytes": "41699"
}
]
}
|
package com.soomla.rewards;
import com.soomla.SoomlaUtils;
import org.json.JSONException;
import org.json.JSONObject;
/**
* A specific type of <code>Reward</code> that represents a badge
* with an icon. For example: when the user achieves a top score,
* the user can earn a "Highest Score" badge reward.
*
* Created by refaelos on 13/05/14.
*/
public class BadgeReward extends Reward {
/**
* Constructor
*
* @param rewardId see parent
* @param name see parent
*/
public BadgeReward(String rewardId, String name) {
super(rewardId, name);
}
/**
* Constructor
*
* @param rewardId see parent
* @param name see parent
* @param iconUrl the URL of the badge's icon
*/
public BadgeReward(String rewardId, String name, String iconUrl) {
super(rewardId, name);
mIconUrl = iconUrl;
}
/**
* Constructor.
* Generates an instance of <code>BadgeReward</code> from the given <code>JSONObject</code>.
*
* @param jsonObject A JSONObject representation of the wanted <code>BadgeReward</code>.
* @throws JSONException
*/
public BadgeReward(JSONObject jsonObject) throws JSONException {
super(jsonObject);
try {
mIconUrl = jsonObject.getString(com.soomla.data.JSONConsts.SOOM_REWARD_ICONURL);
} catch (JSONException ignored) {
SoomlaUtils.LogError(TAG, "An error occurred while generating JSON object.");
}
}
/**
* Converts the current <code>BadgeReward</code> to a JSONObject.
*
* @return A <code>JSONObject</code> representation of the current <code>BadgeReward</code>.
*/
@Override
public JSONObject toJSONObject(){
JSONObject jsonObject = super.toJSONObject();
try {
jsonObject.put(com.soomla.data.JSONConsts.SOOM_REWARD_ICONURL, mIconUrl);
} catch (JSONException e) {
SoomlaUtils.LogError(TAG, "An error occurred while generating JSON object.");
}
return jsonObject;
}
@Override
protected boolean giveInner() {
// nothing to do here... the parent Reward gives in storage
return true;
}
@Override
protected boolean takeInner() {
// nothing to do here... the parent Reward takes in storage
return true;
}
/** Setters and Getters **/
public String getIconUrl() {
return mIconUrl;
}
public void setIconUrl(String iconUrl) {
mIconUrl = iconUrl;
}
/** Private Members **/
private static final String TAG = "SOOMLA BadgeReward";
private String mIconUrl;
}
|
{
"content_hash": "2324a4535a797ad2ebff651f82a931f3",
"timestamp": "",
"source": "github",
"line_count": 103,
"max_line_length": 96,
"avg_line_length": 25.864077669902912,
"alnum_prop": 0.6298798798798799,
"repo_name": "Senspark/ee-x",
"id": "e9c6ff022f8a202d917799a3da35594a8deb8517",
"size": "3268",
"binary": false,
"copies": "4",
"ref": "refs/heads/master",
"path": "src/android/soomla_store/src/main/java/com/soomla/rewards/BadgeReward.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "419"
},
{
"name": "C#",
"bytes": "393129"
},
{
"name": "C++",
"bytes": "1135160"
},
{
"name": "CMake",
"bytes": "3291"
},
{
"name": "GLSL",
"bytes": "1123"
},
{
"name": "Java",
"bytes": "525087"
},
{
"name": "Kotlin",
"bytes": "363522"
},
{
"name": "Makefile",
"bytes": "4246"
},
{
"name": "Objective-C",
"bytes": "71506"
},
{
"name": "Objective-C++",
"bytes": "7707"
},
{
"name": "Ruby",
"bytes": "19339"
},
{
"name": "Shell",
"bytes": "3676"
},
{
"name": "Swift",
"bytes": "248826"
},
{
"name": "TypeScript",
"bytes": "159777"
}
]
}
|
<!DOCTYPE html>
<html xmlns:msxsl="urn:schemas-microsoft-com:xslt">
<head>
<meta content="en-us" http-equiv="Content-Language" />
<meta content="text/html; charset=utf-16" http-equiv="Content-Type" />
<title _locid="PortabilityAnalysis0">.NET Portability Report</title>
<style>
/* Body style, for the entire document */
body {
background: #F3F3F4;
color: #1E1E1F;
font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
padding: 0;
margin: 0;
}
/* Header1 style, used for the main title */
h1 {
padding: 10px 0px 10px 10px;
font-size: 21pt;
background-color: #E2E2E2;
border-bottom: 1px #C1C1C2 solid;
color: #201F20;
margin: 0;
font-weight: normal;
}
/* Header2 style, used for "Overview" and other sections */
h2 {
font-size: 18pt;
font-weight: normal;
padding: 15px 0 5px 0;
margin: 0;
}
/* Header3 style, used for sub-sections, such as project name */
h3 {
font-weight: normal;
font-size: 15pt;
margin: 0;
padding: 15px 0 5px 0;
background-color: transparent;
}
h4 {
font-weight: normal;
font-size: 12pt;
margin: 0;
padding: 0 0 0 0;
background-color: transparent;
}
/* Color all hyperlinks one color */
a {
color: #1382CE;
}
/* Paragraph text (for longer informational messages) */
p {
font-size: 10pt;
}
/* Table styles */
table {
border-spacing: 0 0;
border-collapse: collapse;
font-size: 10pt;
}
table th {
background: #E7E7E8;
text-align: left;
text-decoration: none;
font-weight: normal;
padding: 3px 6px 3px 6px;
}
table td {
vertical-align: top;
padding: 3px 6px 5px 5px;
margin: 0px;
border: 1px solid #E7E7E8;
background: #F7F7F8;
}
.NoBreakingChanges {
color: darkgreen;
font-weight:bold;
}
.FewBreakingChanges {
color: orange;
font-weight:bold;
}
.ManyBreakingChanges {
color: red;
font-weight:bold;
}
.BreakDetails {
margin-left: 30px;
}
.CompatMessage {
font-style: italic;
font-size: 10pt;
}
.GoodMessage {
color: darkgreen;
}
/* Local link is a style for hyperlinks that link to file:/// content, there are lots so color them as 'normal' text until the user mouse overs */
.localLink {
color: #1E1E1F;
background: #EEEEED;
text-decoration: none;
}
.localLink:hover {
color: #1382CE;
background: #FFFF99;
text-decoration: none;
}
/* Center text, used in the over views cells that contain message level counts */
.textCentered {
text-align: center;
}
/* The message cells in message tables should take up all avaliable space */
.messageCell {
width: 100%;
}
/* Padding around the content after the h1 */
#content {
padding: 0px 12px 12px 12px;
}
/* The overview table expands to width, with a max width of 97% */
#overview table {
width: auto;
max-width: 75%;
}
/* The messages tables are always 97% width */
#messages table {
width: 97%;
}
/* All Icons */
.IconSuccessEncoded, .IconInfoEncoded, .IconWarningEncoded, .IconErrorEncoded {
min-width: 18px;
min-height: 18px;
background-repeat: no-repeat;
background-position: center;
}
/* Success icon encoded */
.IconSuccessEncoded {
/* Note: Do not delete the comment below. It is used to verify the correctness of the encoded image resource below before the product is released */
/* [---XsltValidateInternal-Base64EncodedImage:IconSuccess#Begin#background-image: url(data:image/png;base64,#Separator#);#End#] */
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABPElEQVR4Xp1Tv0vDUBi8FqeA4NpBcBLcWnQSApncOnTo4FSnjP0DsnXpH5CxiwbHDg4Zuj4oOEXiJgiC4FDcCkLWmIMc1Pfw+eMgQ77v3Xf3Pe51YKGqqisAEwCR1TIAsiAIblSo6xrdHeJR85Xle3mdmCQKb0PsfqyxxzM8K15HZADl/H5+sHpZwYfxyRjTs+kWwKBx8yoHd2mRiuzF8mkJniWH/13u3Fjrs/EdhsdDFHGB/DLXEJBDLh1MWPAhPo1BLB4WX5yQywHR+m3tVe/t97D52CB/ziG0nIgD/qDuYg8WuCcVZ2YGwlJ3YDugkpR/VNcAEx6GEKhERSr71FuO4YCM4XBdwKvecjIlkSnsO0Hyp/GxSeJAdzBKzpOtnPwyyiPdAZhpZptT04tU+zk7s8czeges//s5C5+CwqrR4/gw+AAAAABJRU5ErkJggg==);
}
/* Information icon encoded */
.IconInfoEncoded {
/* Note: Do not delete the comment below. It is used to verify the correctness of the encoded image resource below before the product is released */
/* [---XsltValidateInternal-Base64EncodedImage:IconInformation#Begin#background-image: url(data:image/png;base64,#Separator#);#End#] */
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABHElEQVR4Xs2TsUoDQRRF7wwoziokjZUKadInhdhukR9YP8DMX1hYW+QvdsXa/QHBbcXC7W0CamWTQnclFutceIQJwwaWNLlwm5k5d94M76mmaeCrrmsLYOocY12FcxZFUeozCqKqqgYA8uevv1H6VuPxcwlfk5N92KHBxfFeCSAxxswlYAW/Xr989x/mv9gkhtyMDhcAxgzRsp7flj8B/HF1RsMXq+NZMkopaHe7lbKxQUEIGbKsYNoGn969060hZBkQex/W8oRQwsQaW2o3Ago2SVcJUzAgY3N0lTCZZm+zPS8HB51gMmS1DEYyOz9acKO1D8JWTlafKIMxdhvlfdyT94Vv5h7P8Ky7nQzACmhvKq3zk3PjW9asz9D/1oigecsioooAAAAASUVORK5CYII=);
}
/* Warning icon encoded */
.IconWarningEncoded {
/* Note: Do not delete the comment below. It is used to verify the correctness of the encoded image resource below before the product is released */
/* [---XsltValidateInternal-Base64EncodedImage:IconWarning#Begin#background-image: url(data:image/png;base64,#Separator#);#End#] */
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAAx0lEQVR4XpWSMQ7CMAxFf4xAyBMLCxMrO8dhaBcuwdCJS3RJBw7SA/QGTCxdWJgiQYWKXJWKIXHIlyw5lqr34tQgEOdcBsCOx5yZK3hCCKdYXneQkh4pEfqzLfu+wVDSyyzFoJjfz9NB+pAF+eizx2Vruts0k15mPgvS6GYvpVtQhB61IB/dk6AF6fS4Ben0uIX5odtFe8Q/eW1KvFeH4e8khT6+gm5B+t3juyDt7n0jpe+CANTd+oTUjN/U3yVaABnSUjFz/gFq44JaVSCXeQAAAABJRU5ErkJggg==);
}
/* Error icon encoded */
.IconErrorEncoded {
/* Note: Do not delete the comment below. It is used to verify the correctness of the encoded image resource below before the product is released */
/* [---XsltValidateInternal-Base64EncodedImage:IconError#Begin#background-image: url(data:image/png;base64,#Separator#);#End#] */
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABQElEQVR4XqWTvUoEQRCE6wYPZUA80AfwAQz23uCMjA7MDRQEIzPBVEyNTQUFIw00vcQTTMzuAh/AxEQQT8HF/3G/oGGnEUGuoNnd6qoZuqltyKEsyzVJq5I6rnUp6SjGeGhESikzzlc1eL7opfuVbrqbU1Zw9NCgtQMaZpY0eNnaaL2fHusvTK5vKu7sjSS1Y4y3QUA6K3e3Mau5UFDyMP7tYF9o8cAHZv68vipoIJg971PZIZ5HiwdvYGGvFVFHmGmZ2MxwmQYPXubPl9Up0tfoMQGetXd6mRbvhBw+boZ6WF7Mbv1+GsHRk0fQmPAH1GfmZirbCfDJ61tw3Px8/8pZsPAG4jlVhcPgZ7adwNWBB68lkRQWFiTgFlbnLY3DGGM7izIJIyT/jjIvEJw6fdJTc6krDzh6aMwMP9bvDH4ADSsa9uSWVJkAAAAASUVORK5CYII=);
}
</style>
</head>
<body>
<h1 _locid="PortabilityReport">.NET Portability Report</h1>
<div id="content">
<div id="submissionId" style="font-size:8pt;">
<p>
<i>
Submission Id
457bc75e-b295-439f-af3f-d1237cfcd9b8
</i>
</p>
</div>
<h2 _locid="SummaryTitle">
<a name="Portability Summary"></a>Portability Summary
</h2>
<div id="summary">
<table>
<tbody>
<tr>
<th>Assembly</th>
<th>ASP.NET 5,Version=v1.0</th>
<th>Windows,Version=v8.1</th>
<th>.NET Framework,Version=v4.6</th>
<th>Windows Phone,Version=v8.1</th>
</tr>
<tr>
<td><strong><a href="#LightHouse.Security">LightHouse.Security</a></strong></td>
<td class="text-center">100.00 %</td>
<td class="text-center">100.00 %</td>
<td class="text-center">100.00 %</td>
<td class="text-center">100.00 %</td>
</tr>
</tbody>
</table>
</div>
<div id="details">
</div>
</div>
</body>
</html>
|
{
"content_hash": "e8e45b26c539e18ad3f5d4d80fb77cd1",
"timestamp": "",
"source": "github",
"line_count": 240,
"max_line_length": 562,
"avg_line_length": 40.22083333333333,
"alnum_prop": 0.5738112503884802,
"repo_name": "kuhlenh/port-to-core",
"id": "00922323d2a944cf007befeb308b2f93ca33d774",
"size": "9653",
"binary": false,
"copies": "1",
"ref": "refs/heads/gh-pages",
"path": "Reports/li/lighthouse.application.mobile.2.4.2/LightHouse.Security-MonoAndroid10.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "HTML",
"bytes": "2323514650"
}
]
}
|
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>new (UnsafeFuncRewriter)</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
</head>
<body class="standalone-code">
<pre><span class="ruby-comment cmt"># File lib/bud/rewrite.rb, line 354</span>
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">bud_instance</span>)
<span class="ruby-keyword kw">super</span>()
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">require_empty</span> = <span class="ruby-keyword kw">false</span>
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">expected</span> = <span class="ruby-constant">Sexp</span>
<span class="ruby-ivar">@bud_instance</span> = <span class="ruby-identifier">bud_instance</span>
<span class="ruby-ivar">@unsafe_func_called</span> = <span class="ruby-keyword kw">false</span>
<span class="ruby-ivar">@elem_stack</span> = []
<span class="ruby-keyword kw">end</span></pre>
</body>
</html>
|
{
"content_hash": "5d3d0d05f1d6bc9e304132135ffd0f44",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 141,
"avg_line_length": 56.69565217391305,
"alnum_prop": 0.6779141104294478,
"repo_name": "chenguangshen/ContextAwareDataflow",
"id": "ef516202ce2a5a0f82f6041d595e3e38291557d4",
"size": "1304",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Gems/doc/bud-0.9.6/rdoc/classes/UnsafeFuncRewriter.src/M000006.html",
"mode": "33188",
"license": "bsd-3-clause",
"language": []
}
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (version 1.7.0_65) on Thu Jan 22 19:02:37 GMT 2015 -->
<meta http-equiv="Content-Type" content="text/html" charset="UTF-8">
<title>Uses of Class org.apache.taverna.scufl2.translator.t2flow.defaultdispatchstack.FailoverParser (Apache Taverna Language APIs (Scufl2, Databundle) 0.16.1-incubating-SNAPSHOT API)</title>
<meta name="date" content="2015-01-22">
<link rel="stylesheet" type="text/css" href="../../../../../../../../stylesheet.css" title="Style">
</head>
<body>
<script type="text/javascript"><!--
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Uses of Class org.apache.taverna.scufl2.translator.t2flow.defaultdispatchstack.FailoverParser (Apache Taverna Language APIs (Scufl2, Databundle) 0.16.1-incubating-SNAPSHOT API)";
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar_top">
<!-- -->
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../../../../overview-summary.html">Overview</a></li>
<li><a href="../package-summary.html">Package</a></li>
<li><a href="../../../../../../../../org/apache/taverna/scufl2/translator/t2flow/defaultdispatchstack/FailoverParser.html" title="class in org.apache.taverna.scufl2.translator.t2flow.defaultdispatchstack">Class</a></li>
<li class="navBarCell1Rev">Use</li>
<li><a href="../package-tree.html">Tree</a></li>
<li><a href="../../../../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="../../../../../../../../index.html?org/apache/taverna/scufl2/translator/t2flow/defaultdispatchstack/class-use/FailoverParser.html" target="_top">Frames</a></li>
<li><a href="FailoverParser.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip-navbar_top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<div class="header">
<h2 title="Uses of Class org.apache.taverna.scufl2.translator.t2flow.defaultdispatchstack.FailoverParser" class="title">Uses of Class<br>org.apache.taverna.scufl2.translator.t2flow.defaultdispatchstack.FailoverParser</h2>
</div>
<div class="classUseContainer">No usage of org.apache.taverna.scufl2.translator.t2flow.defaultdispatchstack.FailoverParser</div>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar_bottom">
<!-- -->
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../../../../overview-summary.html">Overview</a></li>
<li><a href="../package-summary.html">Package</a></li>
<li><a href="../../../../../../../../org/apache/taverna/scufl2/translator/t2flow/defaultdispatchstack/FailoverParser.html" title="class in org.apache.taverna.scufl2.translator.t2flow.defaultdispatchstack">Class</a></li>
<li class="navBarCell1Rev">Use</li>
<li><a href="../package-tree.html">Tree</a></li>
<li><a href="../../../../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="../../../../../../../../index.html?org/apache/taverna/scufl2/translator/t2flow/defaultdispatchstack/class-use/FailoverParser.html" target="_top">Frames</a></li>
<li><a href="FailoverParser.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip-navbar_bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>Copyright © 2015 <a href="http://www.apache.org/">The Apache Software Foundation</a>. All rights reserved.</small></p>
</body>
</html>
|
{
"content_hash": "ac72aa39f439ca7713c1fbb587879d6c",
"timestamp": "",
"source": "github",
"line_count": 117,
"max_line_length": 221,
"avg_line_length": 43.72649572649573,
"alnum_prop": 0.6346755277560594,
"repo_name": "stain/incubator-taverna-site",
"id": "d18f43bb3fb7244b451ec57b529b0c135e49d7a9",
"size": "5116",
"binary": false,
"copies": "1",
"ref": "refs/heads/trunk",
"path": "src/site/resources/javadoc/taverna-language/org/apache/taverna/scufl2/translator/t2flow/defaultdispatchstack/class-use/FailoverParser.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ApacheConf",
"bytes": "3813"
},
{
"name": "CSS",
"bytes": "10003"
},
{
"name": "Clojure",
"bytes": "49413"
},
{
"name": "HTML",
"bytes": "82818"
},
{
"name": "M",
"bytes": "1705"
},
{
"name": "Perl",
"bytes": "3148"
},
{
"name": "Python",
"bytes": "31455"
},
{
"name": "Shell",
"bytes": "374"
}
]
}
|
<?xml version="1.0" encoding="UTF-8"?>
<project name="gdata-scala-client" default="build" basedir=".">
<property environment="env"/>
<!-- Prevents system classpath from being used -->
<property name="build.sysclasspath" value="ignore"/>
<!-- PROPERTIES -->
<property name="source.dir" value="src"/>
<property name="tests.dir" value="tests"/>
<property name="testdata.dir" value="test-data"/>
<property name="samples.dir" value="samples"/>
<property name="lib.dir" value="lib"/>
<property name="junit.jar" value="${lib.dir}/junit-4.4.jar"/>
<property name="xmldiff.jar" value="${lib.dir}/xmldiff-0.3.jar"/>
<property file="./build.properties"/>
<!-- the following properties can be set in the above property file -->
<property name="scala.dir" value="${env.SCALA_HOME}"/>
<property name="build.dir" value="classes"/>
<property name="instr.dir" location="classes-instr"/>
<property name="docs.dir" value="docs/api"/>
<property name="dists.dir" value="dists"/>
<property name="version" value="0.2"/>
<property name="coverage.dir" value="coverage"/>
<!-- directory that contains emma.jar and emma_ant.jar: -->
<available property="emma.available" file="${emma.dir}" type="dir"/>
<!-- path element used by EMMA taskdef below: -->
<property name="instrument" value="false"/>
<path id="emma.lib">
<pathelement location="${emma.dir}/emma.jar"/>
<pathelement location="${emma.dir}/emma_ant.jar"/>
</path>
<!-- this loads <emma> and <emmajava> custom tasks: -->
<target name="emma_init" if="emma.available">
<taskdef resource="emma_ant.properties" classpathref="emma.lib"/>
</target>
<!--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-->
<!-- INITIALISATION -->
<target name="init">
<available file="${scala.dir}" property="scala.present"/>
<fail
message="Installed Scala distribution could not be found."
unless="scala.present"
/>
<property name="scala-library.jar" value="${scala.dir}/lib/scala-library.jar"/>
<property name="scala-compiler.jar" value="${scala.dir}/lib/scala-compiler.jar"/>
<fail message="Scala library '${scala-library.jar}' is not available">
<condition><not><and>
<available classname="scala.Predef"
classpath="${scala-library.jar}"/>
<available classname="scala.collection.immutable.List"
classpath="${scala-library.jar}"/>
</and></not></condition>
</fail>
<fail message="Scala library '${scala-compiler.jar}' is not available">
<condition><not><and>
<available classname="scala.tools.ant.Scalac"
classpath="${scala-compiler.jar}:${scala-library.jar}"/>
<available classname="scala.tools.nsc.Main"
classpath="${scala-compiler.jar}:${scala-library.jar}"/>
</and></not></condition>
</fail>
<path id="scala.classpath">
<pathelement location="${scala-library.jar}"/>
<pathelement location="${scala-compiler.jar}"/>
</path>
<taskdef resource="scala/tools/ant/antlib.xml">
<classpath>
<path refid="scala.classpath"/>
</classpath>
</taskdef>
<path id="build.classpath">
<pathelement location="${scala-library.jar}"/>
<pathelement location="${build.dir}"/>
</path>
<path id="test.classpath">
<pathelement location="${scala-library.jar}"/>
<pathelement location="${build.dir}"/>
<pathelement location="${junit.jar}"/>
<pathelement location="${xmldiff.jar}"/>
<pathelement location="${testdata.dir}"/>
<pathelement location="${emma.dir}/emma.jar"/>
</path>
</target>
<!-- BUILD -->
<target name="build.combinators" depends="init">
<mkdir dir="${build.dir}"/>
<scalac
target="jvm-1.5"
debuginfo="line"
srcdir="${source.dir}"
includes="com/google/xml/**/*.scala"
destdir="${build.dir}"
classpathref="build.classpath"/>
</target>
<target name="build.samples" depends="init,build"
description="Build sample applications.">
<echo level="verbose" message="build.dir=${build.dir}"/>
<mkdir dir="${build.dir}"/>
<scalac
target="jvm-1.5"
debuginfo="line"
srcdir="${samples.dir}"
includes="**/*.scala"
destdir="${build.dir}"
classpathref="build.classpath"
/>
</target>
<target name="build" depends="init,build.combinators"
description="Build project.">
<echo level="verbose" message="build.dir=${build.dir}"/>
<mkdir dir="${build.dir}"/>
<scalac
target="jvm-1.5"
debuginfo="line"
srcdir="${source.dir}"
includes="**/*.scala"
destdir="${build.dir}"
classpathref="build.classpath"
/>
</target>
<target name="build.test" depends="init,build">
<echo level="verbose" message="build.dir=${build.dir}"/>
<scalac
target="jvm-1.5"
debuginfo="line"
srcdir="${tests.dir}"
includes="**/*.scala"
destdir="${build.dir}"
classpathref="test.classpath"
/>
</target>
<target name="instrument" depends="init, build.test, emma_init" if="emma.available">
<mkdir dir="${instr.dir}"/>
<emma enabled="${emma.available}">
<instr destdir="${instr.dir}" metadatafile="${coverage.dir}/coverage.emma">
<instrpath>
<pathelement path="${build.dir}"/>
</instrpath>
</instr>
</emma>
</target>
<target name="test" depends="instrument,test.feeds,test.functional"
description="Run all tests, including functional tests.">
<junit fork="true">
<test name="com.google.xml.combinators.PicklerTest"/>
<test name="com.google.xml.combinators.PicklerPermuteTest"/>
<test name="com.google.xml.combinators.GDataCoreTest"/>
<test name="com.google.gdata.data.util.DateTimeTest"/>
<test name="com.google.gdata.data.util.NormalPlayTimeTest"/>
<test name="com.google.gdata.QueryTest"/>
<test name="com.google.gdata.data.media.ContentTest"/>
<formatter type="plain" usefile="false"/>
<classpath>
<pathelement location="${instr.dir}"/>
<path refid="test.classpath"/>
</classpath>
<jvmarg value="-Demma.coverage.out.file=${coverage.dir}/coverage.emma"/>
<jvmarg value="-Demma.coverage.out.merge=true"/>
</junit>
</target>
<target name="test.feeds" depends="build.test, instrument"
description="Run feed tests. They run offline, using saved XML feeds.">
<junit fork="true">
<test name="com.google.gdata.youtube.YouTubeFeedsTest"/>
<test name="com.google.gdata.calendar.CalendarFeedsTest"/>
<formatter type="plain" usefile="false"/>
<classpath>
<pathelement location="${instr.dir}"/>
<path refid="test.classpath"/>
</classpath>
<jvmarg value="-Demma.coverage.out.file=${coverage.dir}/coverage.emma"/>
<jvmarg value="-Demma.coverage.out.merge=true"/>
</junit>
</target>
<target name="test.functional" depends="build.test, instrument"
description="Run functional tests. They require a valid internet connection and may take longer.">
<junit fork="true">
<test name="com.google.gdata.calendar.CalendarFunctionalTest"/>
<formatter type="plain" usefile="false"/>
<classpath>
<pathelement location="${instr.dir}"/>
<path refid="test.classpath"/>
</classpath>
<jvmarg value="-Demma.coverage.out.file=${coverage.dir}/coverage.emma"/>
<jvmarg value="-Demma.coverage.out.merge=true"/>
</junit>
</target>
<target name="coverage" depends="test"
description="Generate HTML reports on test coverage (requires emma).">
<fail unless="emma.available"
message="emma not found. Test coverage is not available.
Set the emma.dir property to point to your emma instalation."/>
<mkdir dir="${coverage.dir}"/>
<emma enabled="true">
<report sourcepath="${source.dir}">
<fileset dir="${coverage.dir}" >
<include name="*.emma" />
</fileset>
<txt outfile="${coverage.dir}/coverage.txt" />
<html outfile="${coverage.dir}/coverage.html" />
</report>
</emma>
</target>
<target name="dist" depends="build"
description="Pack a distribution">
<echo level="verbose" message="dist.dir=${dists.dir}"/>
<mkdir dir="${dists.dir}"/>
<jar basedir="${build.dir}" destfile="${dists.dir}/gdata-scala-client-${version}.jar"/>
<zip destfile="${dists.dir}/gdata-scala-client-${version}-src.zip">
<fileset dir="." includes="lib/**/*,src/**/*,tests/**/*,test-data/**/*,build.xml,COPYING,README.txt"/>
</zip>
</target>
<!-- DOCS -->
<target name="docs" depends="init"
description="Build API scaladocs.">
<mkdir dir="${docs.dir}"/>
<scaladoc
srcdir="${source.dir}"
destdir="${docs.dir}"
deprecation="yes" unchecked="yes"
windowtitle="GData Scala Client Library Documentation"
doctitle="GData Scala Client"
classpathref="build.classpath">
<include name="**/*.scala"/>
</scaladoc>
</target>
<!-- CLEAN -->
<macrodef name="remove">
<attribute name="dir"/>
<sequential>
<delete dir="@{dir}" includeemptydirs="yes" quiet="yes"
failonerror="no" defaultexcludes="true"/>
</sequential>
</macrodef>
<target name="clean" description="Remove generated files (except dists directory).">
<remove dir="${build.dir}"/>
<remove dir="${docs.dir}"/>
<remove dir="${coverage.dir}"/>
<remove dir="${instr.dir}"/>
</target>
</project>
|
{
"content_hash": "c54e74db5e558a14d8054014b8071b60",
"timestamp": "",
"source": "github",
"line_count": 275,
"max_line_length": 108,
"avg_line_length": 35.014545454545456,
"alnum_prop": 0.6150171357357981,
"repo_name": "jeppenejsum/gdata-scala-client",
"id": "626bcb56164397d8cc238ed2d8cbc051b6a59238",
"size": "9629",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "build.xml",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Scala",
"bytes": "352050"
},
{
"name": "Shell",
"bytes": "570"
}
]
}
|
package org.apache.ignite.internal.processors.cache.index;
import java.util.ArrayList;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.UUID;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.ThreadLocalRandom;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicInteger;
import javax.cache.CacheException;
import org.apache.ignite.Ignite;
import org.apache.ignite.IgniteCache;
import org.apache.ignite.IgniteCheckedException;
import org.apache.ignite.IgniteException;
import org.apache.ignite.Ignition;
import org.apache.ignite.binary.BinaryObject;
import org.apache.ignite.cache.CacheAtomicityMode;
import org.apache.ignite.cache.CacheMode;
import org.apache.ignite.cache.QueryEntity;
import org.apache.ignite.cache.QueryIndex;
import org.apache.ignite.cache.query.SqlFieldsQuery;
import org.apache.ignite.cluster.ClusterNode;
import org.apache.ignite.cluster.ClusterState;
import org.apache.ignite.configuration.CacheConfiguration;
import org.apache.ignite.configuration.IgniteConfiguration;
import org.apache.ignite.internal.IgniteClientReconnectAbstractTest;
import org.apache.ignite.internal.IgniteEx;
import org.apache.ignite.internal.IgniteInternalFuture;
import org.apache.ignite.internal.managers.discovery.CustomEventListener;
import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion;
import org.apache.ignite.internal.processors.cache.GridCacheContext;
import org.apache.ignite.internal.processors.query.GridQueryProcessor;
import org.apache.ignite.internal.processors.query.h2.IgniteH2Indexing;
import org.apache.ignite.internal.processors.query.schema.SchemaOperationException;
import org.apache.ignite.internal.processors.query.schema.message.SchemaFinishDiscoveryMessage;
import org.apache.ignite.internal.util.typedef.G;
import org.apache.ignite.internal.util.typedef.T2;
import org.apache.ignite.internal.util.typedef.X;
import org.apache.ignite.internal.util.typedef.internal.U;
import org.apache.ignite.transactions.TransactionSerializationException;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameter;
import org.junit.runners.Parameterized.Parameters;
/**
* Test different scnerarions on concurrent enabling indexing.
*/
@RunWith(Parameterized.class)
public class DynamicEnableIndexingConcurrentSelfTest extends DynamicEnableIndexingAbstractTest {
/** Test parameters. */
@Parameters(name = "cacheMode={0},atomicityMode={1}")
public static Iterable<Object[]> params() {
CacheMode[] cacheModes = new CacheMode[] {CacheMode.PARTITIONED, CacheMode.REPLICATED};
CacheAtomicityMode[] atomicityModes = new CacheAtomicityMode[] {
CacheAtomicityMode.ATOMIC,
CacheAtomicityMode.TRANSACTIONAL,
CacheAtomicityMode.TRANSACTIONAL_SNAPSHOT
};
List<Object[]> res = new ArrayList<>();
for (CacheMode cacheMode : cacheModes) {
for (CacheAtomicityMode atomicityMode : atomicityModes)
res.add(new Object[] {cacheMode, atomicityMode});
}
return res;
}
/** Latches to block certain index operations. */
private static final ConcurrentHashMap<UUID, T2<CountDownLatch, CountDownLatch>> BLOCKS =
new ConcurrentHashMap<>();
/** Name field index name. */
private static final String NAME_FIELD_IDX_NAME = "name_idx";
/** Large number of entries. */
private static final int LARGE_NUM_ENTRIES = 100_000;
/** */
@Parameter(0)
public CacheMode cacheMode;
/** */
@Parameter(1)
public CacheAtomicityMode atomicityMode;
/** {@inheritDoc} */
@Override protected void beforeTest() throws Exception {
super.beforeTest();
}
/** {@inheritDoc} */
@Override protected void afterTest() throws Exception {
GridQueryProcessor.idxCls = null;
for (T2<CountDownLatch, CountDownLatch> block : BLOCKS.values())
block.get1().countDown();
BLOCKS.clear();
stopAllGrids();
super.afterTest();
}
/**
* Test pending operation when coordinator change.
*/
@Test
public void testCoordinatorChange() throws Exception {
// Start servers.
IgniteEx srv1 = ignitionStart(serverConfiguration(1));
ignitionStart(serverConfiguration(2));
ignitionStart(serverConfiguration(3));
ignitionStart(serverConfiguration(4));
// Start client.
IgniteEx cli = ignitionStart(clientConfiguration(5));
cli.cluster().state(ClusterState.ACTIVE);
createCache(cli);
loadData(cli, 0, NUM_ENTRIES);
// Test migration between normal servers.
UUID id1 = srv1.cluster().localNode().id();
CountDownLatch idxLatch = blockIndexing(id1);
IgniteInternalFuture<?> tblFut = enableIndexing(cli);
idxLatch.await();
Ignition.stop(srv1.name(), true);
unblockIndexing(id1);
tblFut.get();
for (Ignite g: G.allGrids()) {
assertTrue(query(g, SELECT_ALL_QUERY).size() >= 3 * NUM_ENTRIES / 4 );
performQueryingIntegrityCheck(g);
checkQueryParallelism((IgniteEx)g, cacheMode);
}
}
/** */
@Test
public void testClientReconnect() throws Exception {
// Start servers.
IgniteEx srv1 = ignitionStart(serverConfiguration(1));
ignitionStart(serverConfiguration(2));
ignitionStart(serverConfiguration(3));
ignitionStart(serverConfiguration(4));
// Start client.
IgniteEx cli = ignitionStart(clientConfiguration(5));
cli.cluster().state(ClusterState.ACTIVE);
createCache(cli);
loadData(cli, 0, NUM_ENTRIES);
// Reconnect client and enable indexing before client connects.
IgniteClientReconnectAbstractTest.reconnectClientNode(log, cli, srv1, () -> {
try {
enableIndexing(srv1).get();
}
catch (IgniteCheckedException e) {
throw new IgniteException("Failed to enable indexing", e);
}
});
assertEquals(NUM_ENTRIES, query(cli, SELECT_ALL_QUERY).size());
for (Ignite g: G.allGrids()) {
assertEquals(NUM_ENTRIES, query(g, SELECT_ALL_QUERY).size());
performQueryingIntegrityCheck(g);
checkQueryParallelism((IgniteEx)g, cacheMode);
}
}
/** */
@Test
public void testNodeJoinOnPendingOperation() throws Exception {
CountDownLatch finishLatch = new CountDownLatch(3);
IgniteEx srv1 = ignitionStart(serverConfiguration(1), finishLatch);
srv1.cluster().state(ClusterState.ACTIVE);
createCache(srv1);
loadData(srv1, 0, NUM_ENTRIES);
CountDownLatch idxLatch = blockIndexing(srv1);
IgniteInternalFuture<?> tblFut = enableIndexing(srv1);
U.await(idxLatch);
ignitionStart(serverConfiguration(2), finishLatch);
ignitionStart(serverConfiguration(3), finishLatch);
awaitPartitionMapExchange();
assertFalse(tblFut.isDone());
unblockIndexing(srv1);
tblFut.get();
U.await(finishLatch);
for (Ignite g: G.allGrids()) {
assertEquals(NUM_ENTRIES, query(g, SELECT_ALL_QUERY).size());
performQueryingIntegrityCheck(g);
checkQueryParallelism((IgniteEx)g, cacheMode);
}
}
/** Test chaining schema operation with enable indexing. */
@Test
public void testOperationChaining() throws Exception {
IgniteEx srv1 = ignitionStart(serverConfiguration(1));
ignitionStart(serverConfiguration(2));
ignitionStart(serverConfiguration(3, true));
ignitionStart(clientConfiguration(4));
srv1.cluster().state(ClusterState.ACTIVE);
createCache(srv1);
loadData(srv1, 0, NUM_ENTRIES);
CountDownLatch idxLatch = blockIndexing(srv1);
IgniteInternalFuture<?> tblFut = enableIndexing(srv1);
QueryIndex idx = new QueryIndex();
idx.setName(NAME_FIELD_IDX_NAME.toUpperCase());
idx.setFieldNames(Collections.singletonList(NAME_FIELD_NAME.toUpperCase()), true);
IgniteInternalFuture<?> idxFut1 = srv1.context().query().dynamicIndexCreate(POI_CACHE_NAME, POI_SCHEMA_NAME,
POI_TABLE_NAME, idx, false, 0);
idxLatch.await();
// Add more nodes.
ignitionStart(serverConfiguration(5));
ignitionStart(serverConfiguration(6, true));
ignitionStart(clientConfiguration(7));
assertFalse(tblFut.isDone());
assertFalse(idxFut1.isDone());
unblockIndexing(srv1);
idxFut1.get();
for (Ignite g: G.allGrids()) {
assertEquals(NUM_ENTRIES, query(g, SELECT_ALL_QUERY).size());
performQueryingIntegrityCheck(g);
checkQueryParallelism((IgniteEx)g, cacheMode);
IgniteCache<Object, Object> cache = g.cache(POI_CACHE_NAME);
assertIndexUsed(cache, "SELECT * FROM " + POI_TABLE_NAME + " WHERE name = 'POI_100'", NAME_FIELD_IDX_NAME);
List<List<?>> res = cache.query(new SqlFieldsQuery("SELECT " + ID_FIELD_NAME + " FROM " + POI_TABLE_NAME +
" WHERE name = 'POI_100'").setSchema(POI_SCHEMA_NAME)).getAll();
assertEquals(1, res.size());
assertEquals(100, res.get(0).get(0));
}
}
/** Enable indexing on ongoing rebalance. */
@Test
public void testConcurrentRebalance() throws Exception {
// Start cache and populate it with data.
IgniteEx srv1 = ignitionStart(serverConfiguration(1));
Ignite srv2 = ignitionStart(serverConfiguration(2));
srv1.cluster().state(ClusterState.ACTIVE);
createCache(srv1);
loadData(srv1, 0, LARGE_NUM_ENTRIES);
// Start index operation in blocked state.
CountDownLatch idxLatch1 = blockIndexing(srv1);
CountDownLatch idxLatch2 = blockIndexing(srv2);
IgniteInternalFuture<?> tblFut = enableIndexing(srv1);
U.await(idxLatch1);
U.await(idxLatch2);
// Start two more nodes and unblock index operation in the middle.
ignitionStart(serverConfiguration(3));
unblockIndexing(srv1);
unblockIndexing(srv2);
ignitionStart(serverConfiguration(4));
awaitPartitionMapExchange();
tblFut.get();
for (Ignite g: G.allGrids()) {
assertEquals(LARGE_NUM_ENTRIES, query(g, SELECT_ALL_QUERY).size());
performQueryingIntegrityCheck(g);
checkQueryParallelism((IgniteEx)g, cacheMode);
}
}
/** Test concurrent put remove when enabling indexing. */
@Test
public void testConcurrentPutRemove() throws Exception {
CountDownLatch finishLatch = new CountDownLatch(4);
// Start several nodes.
IgniteEx srv1 = ignitionStart(serverConfiguration(1), finishLatch);
ignitionStart(serverConfiguration(2), finishLatch);
ignitionStart(serverConfiguration(3), finishLatch);
ignitionStart(serverConfiguration(4), finishLatch);
srv1.cluster().state(ClusterState.ACTIVE);
createCache(srv1);
loadData(srv1, 0, LARGE_NUM_ENTRIES);
// Start data change operations from several threads.
final AtomicBoolean stopped = new AtomicBoolean();
final CountDownLatch iterations = new CountDownLatch(1000);
IgniteInternalFuture<?> task = multithreadedAsync(() -> {
while (!stopped.get()) {
Ignite node = grid(ThreadLocalRandom.current().nextInt(1, 5));
ThreadLocalRandom rnd = ThreadLocalRandom.current();
int i = rnd.nextInt(0, LARGE_NUM_ENTRIES);
BinaryObject val = node.binary().builder(POI_CLASS_NAME)
.setField(NAME_FIELD_NAME, "POI_" + i, String.class)
.setField(LATITUDE_FIELD_NAME, rnd.nextDouble(), Double.class)
.setField(LONGITUDE_FIELD_NAME, rnd.nextDouble(), Double.class)
.build();
IgniteCache<Object, BinaryObject> cache = node.cache(POI_CACHE_NAME).withKeepBinary();
try {
if (ThreadLocalRandom.current().nextBoolean())
cache.put(i, val);
else
cache.remove(i);
}
catch (CacheException e) {
if (!X.hasCause(e, TransactionSerializationException.class))
throw e;
}
finally {
iterations.countDown();
}
}
return null;
}, 4);
// Do some work.
iterations.await(2, TimeUnit.SECONDS);
enableIndexing(srv1).get();
// Stop updates once index is ready.
stopped.set(true);
task.get();
finishLatch.await();
// Perform integrity check.
IgniteCache<Object, Object> cache = srv1.cache(POI_CACHE_NAME).withKeepBinary();
query(srv1, SELECT_ALL_QUERY).forEach(res -> {
BinaryObject val = (BinaryObject)cache.get(res.get(0));
assertNotNull(val);
assertEquals(val.field(NAME_FIELD_NAME), res.get(1));
assertEquals(val.field(LATITUDE_FIELD_NAME), res.get(2));
assertEquals(val.field(LONGITUDE_FIELD_NAME), res.get(3));
});
}
/** Test concurrent enabling indexing. Only one attempt should succeed. */
@Test
public void testConcurrentEnableIndexing() throws Exception {
// Start several nodes.
IgniteEx srv1 = ignitionStart(serverConfiguration(1));
ignitionStart(serverConfiguration(2));
ignitionStart(clientConfiguration(3));
ignitionStart(clientConfiguration(4));
srv1.cluster().state(ClusterState.ACTIVE);
createCache(srv1);
loadData(srv1, 0, LARGE_NUM_ENTRIES);
// Start enable indexing from several threads.
final AtomicBoolean stopped = new AtomicBoolean();
final AtomicInteger success = new AtomicInteger();
final CountDownLatch iterations = new CountDownLatch(1000);
IgniteInternalFuture<?> task = multithreadedAsync(() -> {
while (!stopped.get()) {
IgniteEx node = grid(ThreadLocalRandom.current().nextInt(1, 4));
try {
Thread.sleep(100);
}
catch (InterruptedException e) {
Thread.currentThread().interrupt();
break;
}
enableIndexing(node).chain((fut) -> {
try {
fut.get();
success.incrementAndGet();
}
catch (IgniteCheckedException e) {
assertTrue(e.hasCause(SchemaOperationException.class));
SchemaOperationException opEx = e.getCause(SchemaOperationException.class);
assertEquals(SchemaOperationException.CODE_CACHE_ALREADY_INDEXED, opEx.code());
assertEquals("Cache is already indexed: " + POI_CACHE_NAME, opEx.getMessage());
}
return null;
});
iterations.countDown();
}
return null;
}, 4);
// Do attempts.
iterations.await(2, TimeUnit.SECONDS);
// Start more server nodes..
ignitionStart(serverConfiguration(5));
ignitionStart(serverConfiguration(6));
// Stop task.
stopped.set(true);
task.get();
// Check that only one successful attempt.
assertEquals(1, success.get());
awaitPartitionMapExchange();
for (Ignite g: G.allGrids()) {
assertEquals(LARGE_NUM_ENTRIES, query(g, SELECT_ALL_QUERY).size());
performQueryingIntegrityCheck(g);
checkQueryParallelism((IgniteEx)g, cacheMode);
}
}
/** */
private IgniteInternalFuture<?> enableIndexing(IgniteEx node) {
Integer parallelism = cacheMode == CacheMode.PARTITIONED ? QUERY_PARALLELISM : null;
return node.context().query().dynamicAddQueryEntity(POI_CACHE_NAME, POI_SCHEMA_NAME, queryEntity(), parallelism,
false);
}
/** */
private QueryEntity queryEntity() {
LinkedHashMap<String, String> fields = new LinkedHashMap<>();
fields.put(ID_FIELD_NAME, Integer.class.getName());
fields.put(NAME_FIELD_NAME, String.class.getName());
fields.put(LATITUDE_FIELD_NAME, Double.class.getName());
fields.put(LONGITUDE_FIELD_NAME, Double.class.getName());
return new QueryEntity()
.setKeyType(Integer.class.getName())
.setKeyFieldName(ID_FIELD_NAME)
.setValueType(POI_CLASS_NAME)
.setTableName(POI_TABLE_NAME)
.setFields(fields);
}
/** */
private void createCache(IgniteEx node) throws Exception {
CacheConfiguration<?, ?> ccfg = testCacheConfiguration(POI_CACHE_NAME, cacheMode, atomicityMode);
node.context().cache().dynamicStartCache(ccfg, POI_CACHE_NAME, null, true, true, true).get();
}
/** */
private static void awaitIndexing(UUID nodeId) {
T2<CountDownLatch, CountDownLatch> blocker = BLOCKS.get(nodeId);
if (blocker != null) {
blocker.get2().countDown();
while (true) {
try {
blocker.get1().await();
break;
}
catch (InterruptedException e) {
Thread.currentThread().interrupt();
}
}
}
}
/** */
private static CountDownLatch blockIndexing(Ignite node) {
UUID nodeId = ((IgniteEx)node).localNode().id();
return blockIndexing(nodeId);
}
/** */
private static CountDownLatch blockIndexing(UUID nodeId) {
assertFalse(BLOCKS.containsKey(nodeId));
CountDownLatch idxLatch = new CountDownLatch(1);
BLOCKS.put(nodeId, new T2<>(new CountDownLatch(1), idxLatch));
return idxLatch;
}
/** */
private static void unblockIndexing(Ignite node) {
UUID nodeId = ((IgniteEx)node).localNode().id();
unblockIndexing(nodeId);
}
/** */
private static void unblockIndexing(UUID nodeId) {
T2<CountDownLatch, CountDownLatch> blocker = BLOCKS.remove(nodeId);
assertNotNull(blocker);
blocker.get1().countDown();
}
/** */
private IgniteEx ignitionStart(IgniteConfiguration cfg) throws Exception {
return ignitionStart(cfg, null);
}
/**
* Spoof blocking indexing class and start new node.
* @param cfg Node configuration.
* @param latch Latch to await schema operation finish.
* @return New node.
* @throws Exception If failed.
*/
private IgniteEx ignitionStart(IgniteConfiguration cfg, final CountDownLatch latch) throws Exception {
GridQueryProcessor.idxCls = BlockingIndexing.class;
IgniteEx node = startGrid(cfg);
if (latch != null) {
node.context().discovery().setCustomEventListener(SchemaFinishDiscoveryMessage.class,
new CustomEventListener<SchemaFinishDiscoveryMessage>() {
@Override public void onCustomEvent(
AffinityTopologyVersion topVer,
ClusterNode snd,
SchemaFinishDiscoveryMessage msg
) {
latch.countDown();
}
});
}
return node;
}
/**
* Blocking indexing processor.
*/
private static class BlockingIndexing extends IgniteH2Indexing {
/** {@inheritDoc} */
@Override public IgniteInternalFuture<?> rebuildIndexesFromHash(GridCacheContext cctx) {
awaitIndexing(ctx.localNodeId());
return super.rebuildIndexesFromHash(cctx);
}
}
}
|
{
"content_hash": "b69c864d4af52983c002d9891c904389",
"timestamp": "",
"source": "github",
"line_count": 621,
"max_line_length": 120,
"avg_line_length": 32.97423510466989,
"alnum_prop": 0.6274356595204376,
"repo_name": "SomeFire/ignite",
"id": "bdaa1ba4d10f792f0b0f7cd4a672603d3ea42433",
"size": "21279",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/DynamicEnableIndexingConcurrentSelfTest.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "61105"
},
{
"name": "C",
"bytes": "5286"
},
{
"name": "C#",
"bytes": "6461926"
},
{
"name": "C++",
"bytes": "3681449"
},
{
"name": "CSS",
"bytes": "281251"
},
{
"name": "Dockerfile",
"bytes": "16105"
},
{
"name": "Groovy",
"bytes": "15081"
},
{
"name": "HTML",
"bytes": "821135"
},
{
"name": "Java",
"bytes": "42676141"
},
{
"name": "JavaScript",
"bytes": "1785625"
},
{
"name": "M4",
"bytes": "21724"
},
{
"name": "Makefile",
"bytes": "121296"
},
{
"name": "PHP",
"bytes": "486991"
},
{
"name": "PLpgSQL",
"bytes": "623"
},
{
"name": "PowerShell",
"bytes": "12208"
},
{
"name": "Python",
"bytes": "342274"
},
{
"name": "Scala",
"bytes": "1386030"
},
{
"name": "Shell",
"bytes": "612951"
},
{
"name": "TSQL",
"bytes": "6130"
},
{
"name": "TypeScript",
"bytes": "476855"
}
]
}
|
namespace {
// Layout constants.
const int kExtensionListPadding = 10;
const int kInsetBottomRight = 13;
const int kInsetLeft = 14;
const int kInsetTop = 9;
const int kHeadlineMessagePadding = 4;
const int kHeadlineRowPadding = 10;
const int kMessageBubblePadding = 11;
// How long to wait until showing the bubble (in seconds).
int g_bubble_appearance_wait_time = 5;
} // namespace
namespace extensions {
ExtensionMessageBubbleView*
ExtensionMessageBubbleView::active_bubble_for_testing_ = nullptr;
ExtensionMessageBubbleView::ExtensionMessageBubbleView(
views::View* anchor_view,
views::BubbleBorder::Arrow arrow_location,
scoped_ptr<extensions::ExtensionMessageBubbleController> controller)
: BubbleDelegateView(anchor_view, arrow_location),
controller_(std::move(controller)),
anchor_view_(anchor_view),
headline_(NULL),
learn_more_(NULL),
dismiss_button_(NULL),
link_clicked_(false),
action_taken_(false),
weak_factory_(this) {
DCHECK(anchor_view->GetWidget());
set_close_on_deactivate(controller_->CloseOnDeactivate());
set_close_on_esc(true);
// Compensate for built-in vertical padding in the anchor view's image.
set_anchor_view_insets(gfx::Insets(5, 0, 5, 0));
}
void ExtensionMessageBubbleView::Show() {
// Not showing the bubble right away (during startup) has a few benefits:
// We don't have to worry about focus being lost due to the Omnibox (or to
// other things that want focus at startup). This allows Esc to work to close
// the bubble and also solves the keyboard accessibility problem that comes
// with focus being lost (we don't have a good generic mechanism of injecting
// bubbles into the focus cycle). Another benefit of delaying the show is
// that fade-in works (the fade-in isn't apparent if the the bubble appears at
// startup).
base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(
FROM_HERE, base::Bind(&ExtensionMessageBubbleView::ShowBubble,
weak_factory_.GetWeakPtr()),
base::TimeDelta::FromSeconds(g_bubble_appearance_wait_time));
}
void ExtensionMessageBubbleView::OnWidgetDestroying(views::Widget* widget) {
if (active_bubble_for_testing_ == this)
active_bubble_for_testing_ = nullptr;
// To catch Esc, we monitor destroy message. Unless the link has been clicked,
// we assume Dismiss was the action taken.
if (!link_clicked_ && !action_taken_) {
bool closed_on_deactivation = close_reason() == CloseReason::DEACTIVATION;
controller_->OnBubbleDismiss(closed_on_deactivation);
}
}
void ExtensionMessageBubbleView::set_bubble_appearance_wait_time_for_testing(
int time_in_seconds) {
g_bubble_appearance_wait_time = time_in_seconds;
}
////////////////////////////////////////////////////////////////////////////////
// ExtensionMessageBubbleView - private.
ExtensionMessageBubbleView::~ExtensionMessageBubbleView() {}
void ExtensionMessageBubbleView::ShowBubble() {
active_bubble_for_testing_ = this;
// Since we delay in showing the bubble, the applicable extension(s) may
// have been removed.
if (controller_->ShouldShow()) {
controller_->OnShown();
GetWidget()->Show();
} else {
GetWidget()->Close();
}
}
void ExtensionMessageBubbleView::Init() {
ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
views::GridLayout* layout = views::GridLayout::CreatePanel(this);
layout->SetInsets(kInsetTop, kInsetLeft,
kInsetBottomRight, kInsetBottomRight);
SetLayoutManager(layout);
ExtensionMessageBubbleController::Delegate* delegate =
controller_->delegate();
const int headline_column_set_id = 0;
views::ColumnSet* top_columns = layout->AddColumnSet(headline_column_set_id);
top_columns->AddColumn(views::GridLayout::LEADING, views::GridLayout::CENTER,
0, views::GridLayout::USE_PREF, 0, 0);
top_columns->AddPaddingColumn(1, 0);
layout->StartRow(0, headline_column_set_id);
headline_ = new views::Label(delegate->GetTitle(),
rb.GetFontList(ui::ResourceBundle::MediumFont));
layout->AddView(headline_);
layout->AddPaddingRow(0, kHeadlineRowPadding);
const int text_column_set_id = 1;
views::ColumnSet* upper_columns = layout->AddColumnSet(text_column_set_id);
upper_columns->AddColumn(
views::GridLayout::LEADING, views::GridLayout::LEADING,
0, views::GridLayout::USE_PREF, 0, 0);
layout->StartRow(0, text_column_set_id);
views::Label* message = new views::Label();
message->SetMultiLine(true);
message->SetHorizontalAlignment(gfx::ALIGN_LEFT);
message->SetText(delegate->GetMessageBody(
anchor_view_->id() == VIEW_ID_BROWSER_ACTION,
controller_->GetExtensionIdList().size()));
message->SizeToFit(views::Widget::GetLocalizedContentsWidth(
IDS_EXTENSION_WIPEOUT_BUBBLE_WIDTH_CHARS));
layout->AddView(message);
if (delegate->ShouldShowExtensionList()) {
const int extension_list_column_set_id = 2;
views::ColumnSet* middle_columns =
layout->AddColumnSet(extension_list_column_set_id);
middle_columns->AddPaddingColumn(0, kExtensionListPadding);
middle_columns->AddColumn(
views::GridLayout::LEADING, views::GridLayout::CENTER,
0, views::GridLayout::USE_PREF, 0, 0);
layout->StartRowWithPadding(0, extension_list_column_set_id,
0, kHeadlineMessagePadding);
views::Label* extensions = new views::Label();
extensions->SetMultiLine(true);
extensions->SetHorizontalAlignment(gfx::ALIGN_LEFT);
extensions->SetText(controller_->GetExtensionListForDisplay());
extensions->SizeToFit(views::Widget::GetLocalizedContentsWidth(
IDS_EXTENSION_WIPEOUT_BUBBLE_WIDTH_CHARS));
layout->AddView(extensions);
}
base::string16 action_button = delegate->GetActionButtonLabel();
const int action_row_column_set_id = 3;
views::ColumnSet* bottom_columns =
layout->AddColumnSet(action_row_column_set_id);
bottom_columns->AddColumn(views::GridLayout::LEADING,
views::GridLayout::CENTER, 0, views::GridLayout::USE_PREF, 0, 0);
bottom_columns->AddPaddingColumn(1, 0);
bottom_columns->AddColumn(views::GridLayout::TRAILING,
views::GridLayout::CENTER, 0, views::GridLayout::USE_PREF, 0, 0);
if (!action_button.empty()) {
bottom_columns->AddColumn(views::GridLayout::TRAILING,
views::GridLayout::CENTER, 0, views::GridLayout::USE_PREF, 0, 0);
}
layout->StartRowWithPadding(0, action_row_column_set_id,
0, kMessageBubblePadding);
learn_more_ = new views::Link(delegate->GetLearnMoreLabel());
learn_more_->set_listener(this);
layout->AddView(learn_more_);
if (!action_button.empty()) {
action_button_ = new views::LabelButton(this, action_button);
action_button_->SetStyle(views::Button::STYLE_BUTTON);
layout->AddView(action_button_);
}
dismiss_button_ = new views::LabelButton(this,
delegate->GetDismissButtonLabel());
dismiss_button_->SetStyle(views::Button::STYLE_BUTTON);
layout->AddView(dismiss_button_);
}
void ExtensionMessageBubbleView::ButtonPressed(views::Button* sender,
const ui::Event& event) {
action_taken_ = true;
if (sender == action_button_) {
controller_->OnBubbleAction();
} else {
DCHECK_EQ(dismiss_button_, sender);
controller_->OnBubbleDismiss(false); // Not closed by deactivation.
}
GetWidget()->Close();
}
void ExtensionMessageBubbleView::LinkClicked(views::Link* source,
int event_flags) {
DCHECK_EQ(learn_more_, source);
link_clicked_ = true;
controller_->OnLinkClicked();
GetWidget()->Close();
}
void ExtensionMessageBubbleView::GetAccessibleState(
ui::AXViewState* state) {
state->role = ui::AX_ROLE_ALERT;
}
void ExtensionMessageBubbleView::ViewHierarchyChanged(
const ViewHierarchyChangedDetails& details) {
if (details.is_add && details.child == this)
NotifyAccessibilityEvent(ui::AX_EVENT_ALERT, true);
}
} // namespace extensions
|
{
"content_hash": "740d62ff2253c15267e6f636979c7ad2",
"timestamp": "",
"source": "github",
"line_count": 217,
"max_line_length": 80,
"avg_line_length": 37.32258064516129,
"alnum_prop": 0.6929250524756143,
"repo_name": "highweb-project/highweb-webcl-html5spec",
"id": "698a6c31ec4ac98fe9d052f9e63a5c23dd376a3e",
"size": "9007",
"binary": false,
"copies": "1",
"ref": "refs/heads/highweb-20160310",
"path": "chrome/browser/ui/views/extensions/extension_message_bubble_view.cc",
"mode": "33188",
"license": "bsd-3-clause",
"language": []
}
|
package com.google.code.validationframework.base.transformer.collection;
import com.google.code.validationframework.api.transform.Transformer;
import java.util.ArrayList;
import java.util.Collection;
public class ToListTransformer<E, I extends Collection<E>> implements Transformer<I, ArrayList<E>> {
/**
* @see Transformer#transform(Object)
*/
@SuppressWarnings("unchecked")
@Override
public ArrayList<E> transform(I input) {
ArrayList<E> list;
if (input == null) {
list = null;
} else if (input instanceof ArrayList<?>) {
list = (ArrayList<E>) input;
} else {
list = new ArrayList<E>(input);
}
return list;
}
}
|
{
"content_hash": "772ddf4d6aaf4b2b318fbf84692d83d8",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 100,
"avg_line_length": 24.5,
"alnum_prop": 0.6299319727891156,
"repo_name": "padrig64/ValidationFramework",
"id": "ef4ea8c20cad75785b89251ede3a28d097257020",
"size": "2117",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "validationframework-experimental/src/main/java/com/google/code/validationframework/base/transformer/collection/ToListTransformer.java",
"mode": "33188",
"license": "bsd-2-clause",
"language": [
{
"name": "Java",
"bytes": "1890396"
}
]
}
|
namespace NetBike.Xml.Converters.Objects.Generators
{
using System;
using System.Collections.Generic;
using System.Linq.Expressions;
internal sealed class XmlConvertMethod
{
private readonly Type valueType;
private readonly LambdaExpression parseExpression;
private readonly LambdaExpression toStringExpression;
public XmlConvertMethod(Type valueType, LambdaExpression parseExpression, LambdaExpression toStringExpression)
{
this.valueType = valueType;
this.parseExpression = parseExpression;
this.toStringExpression = toStringExpression;
}
public static IEnumerable<XmlConvertMethod> GetMethods(XmlSerializerSettings settings)
{
if (settings == null)
{
throw new ArgumentNullException(nameof(settings));
}
throw new NotImplementedException();
}
}
}
|
{
"content_hash": "b5d40bcdfb817fb237567cf90118807f",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 118,
"avg_line_length": 31.666666666666668,
"alnum_prop": 0.6652631578947369,
"repo_name": "netbike/netbike.xml",
"id": "61ffe72a96ef4d18ac08712524f13b20a23ce87c",
"size": "952",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "NetBike.Xml/Converters/Objects/Generators/XmlConvertMethod.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "279795"
}
]
}
|
<?xml version="1.0" encoding="utf-8"?>
<resources>
<dimen name="checkbox_drawable_left_padding">45dp</dimen>
<dimen name="pager_margin">1dp</dimen>
<dimen name="actionbar_elevation">4dp</dimen>
</resources>
|
{
"content_hash": "8c6f636d2275134932d4d8dd3badafc1",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 61,
"avg_line_length": 36.5,
"alnum_prop": 0.684931506849315,
"repo_name": "NasaGeek/utexas-utilities",
"id": "da271a07d127d85ebc598b94c6528e12f0d17d29",
"size": "219",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/src/main/res/values/dimen.xml",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "HTML",
"bytes": "58897"
},
{
"name": "Java",
"bytes": "345638"
},
{
"name": "Python",
"bytes": "4368"
},
{
"name": "Shell",
"bytes": "78"
}
]
}
|
namespace Microsoft.Azure.Devices.Client
{
static class CustomHeaderConstants
{
/// <summary>
/// Used in message responses and feedback
/// Specifies the tracing correlation Id for the request; the resource provider *must* log this
/// so that end-to-end requests can be correlated across Azure.
/// </summary>
public const string CorrelationId = "iothub-correlationid";
/// <summary>
/// [Required for two way requests] Used to correlate two-way communication.
/// Format: A case-sensitive string ( up to 128 char long) of ASCII 7-bit alphanumeric chars
/// + {'-', ':', '/', '\', '.', '+', '%', '_', '#', '*', '?', '!', '(', ')', ',', '=', '@', ';', '$', '''}.
/// Non-alphanumeric characters are from URN RFC.
/// </summary>
public const string MessageId = "iothub-messageid";
/// <summary>
/// [Required] Destination of the message
/// </summary>
public const string To = "iothub-to";
/// <summary>
/// Time when the Message was received by the server
/// </summary>
public const string EnqueuedTime = "iothub-enqueuedtime";
/// <summary>
/// Number of times the message has been previously delivered
/// </summary>
public const string DeliveryCount = "iothub-deliverycount";
/// <summary>
/// [Optional] The time when this message is considered expired
/// </summary>
public const string ExpiryTimeUtc = "iothub-expiry";
/// <summary>
/// [Required in feedback messages] Used to specify the origin of messages generated by IOT hub. Possible value: “{hub name}/”
/// </summary>
public const string UserId = "iothub-userid";
/// <summary>
/// [Optional] Used to specify the role of the message in the communication pattern.
/// Possible values:
/// “d2c”: event message (device to cloud)
/// “c2d”: notification
/// “d2creq”: inquiry request
/// “d2cres”: inquiry response
/// “c2dreq”: command request
/// “c2dres”: command response
/// </summary>
public const string Operation = "iothub-operation";
/// <summary>
/// [Optional] Used to specify the feedback required for the consumption of the message by the device.
/// Possible values:
/// “none”: no feedback
/// “positive”: receive a feedback message if the message was consumed
/// “negative”: receive a feedback message if the message expired without being completed by the device
/// “full”: both positive and negative
/// </summary>
public const string Ack = "iothub-ack";
/// <summary>
/// The lock token of the retrieved message
/// </summary>
public const string MessageLockToken = "iothub-messagelocktoken";
/// <summary>
/// Amount of time in seconds to lock message before abandoning the lock and allowing the message to be retrieved again
/// </summary>
public const string MessageLockTimeout = "iothub-messagelocktimeout";
/// <summary>
/// iothub-sequencenumber
/// A monotonically increasing identifier for each message
/// </summary>
public const string SequenceNumber = "iothub-sequencenumber";
/// <summary>
/// iothub-servicetrackingid
/// A tracking id to help trace errors on the service
/// </summary>
public const string TrackingId = "iothub-servicetrackingid";
/// <summary>
/// Prefix for all Application property Http Headers
/// </summary>
public const string HttpAppPropertyPrefix = "iothub-app-";
/// <summary>
/// Internal HTTP custom headers
/// </summary>
public const string HttpIotHubName = "iothub-name";
public const string HttpIotHub = "iothub-metadata";
public const string HttpDevice = "iothub-devicemetadata";
/// <summary>
/// x-ms-client-ip-address
/// Set to the client IP address used in the request; this is required since the resource provider
/// will not have access to the client IP.
/// </summary>
public const string ClientIpAddress = "x-ms-client-ip-address";
/// <summary>
/// x-ms-client-principal-name
/// Set to the principal ID / UPN of the client JWT making the request.
/// </summary>
public const string PrincipalName = "x-ms-client-principal-name";
/// <summary>
/// x-ms-client-tenant-id
/// Set to the tenant ID of the client JWT making the request.
/// </summary>
public const string ClientTenantId = "x-ms-client-tenant-id";
/// <summary>
/// x-ms-client-audience
/// Set to the tenant ID of the client JWT making the request.
/// </summary>
public const string ClientAudience = "x-ms-client-audience";
/// <summary>
/// x-ms-client-issuer
/// Set to the issuer of the client JWT making the request.
/// </summary>
public const string ClientIssuer = "x-ms-client-issuer";
/// <summary>
/// x-ms-client-object-id
/// Set to the object Id of the client JWT making the request.
/// </summary>
public const string ClientObjectId = "x-ms-client-object-id";
/// <summary>
/// x-ms-client-app-id
/// Set to the app Id of the client JWT making the request.
/// </summary>
public const string ClientAppId = "x-ms-client-app-id";
/// <summary>
/// x-ms-client-request-id
/// Caller-specified request ID, in the form of a GUID with no decoration such as curly braces
/// (e.g. client-request-id: 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0).
/// A caller-defined value that identifies the given request. If specified, this will be
/// included in response information as a way to map the request.
/// If the caller provides this header – the resource provider *must* log this with their
/// traces to facilitate tracing a single request.
/// </summary>
public const string ClientRequestId = "x-ms-client-request-id";
/// <summary>
/// x-ms-return-client-request-id
/// Optional
/// True or false and indicates if a client-request-id should be provided.
/// </summary>
public const string ReturnClientRequestId = "x-ms-return-client-request-id";
/// <summary>
/// x-ms-activity-id
/// The value that is used to pass activityID in REST API between services
/// </summary>
public const string ActivityId = "x-ms-activity-id";
/// <summary>
/// api-version
/// Specifies the version of the protocol used to make this request.
/// </summary>
public const string ApiVersion = "api-version";
/// <summary>
/// Azure-AsyncOperation
/// Set to the URL where the result of the long running operation can be checked; to optionally be used in addition to the Location header.
/// </summary>
public const string MicrosoftAsyncOperationHeaderName = "Azure-AsyncOperation";
/// <summary>
/// x-ms-request-id
/// A unique identifier for the current operation, service generated.
/// All the resource providers *must* return this value in the response headers to facilitate debugging.
/// </summary>
public const string RequestId = "x-ms-request-id";
}
}
|
{
"content_hash": "7b9303696c8b761a9508b802bb6eee23",
"timestamp": "",
"source": "github",
"line_count": 189,
"max_line_length": 147,
"avg_line_length": 41.17460317460318,
"alnum_prop": 0.5908506810588537,
"repo_name": "fsautomata/azure-iot-sdks",
"id": "de4d9f667b3968de7c9131d0383f0038a8b25984",
"size": "7980",
"binary": false,
"copies": "4",
"ref": "refs/heads/master",
"path": "csharp/Microsoft.Azure.Devices.Client/Common/WebApi/CustomHeaderConstants.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "56352"
},
{
"name": "C",
"bytes": "2974959"
},
{
"name": "C#",
"bytes": "717741"
},
{
"name": "C++",
"bytes": "4588389"
},
{
"name": "CSS",
"bytes": "577322"
},
{
"name": "HTML",
"bytes": "3250496"
},
{
"name": "Java",
"bytes": "573285"
},
{
"name": "JavaScript",
"bytes": "4455754"
},
{
"name": "Makefile",
"bytes": "394"
},
{
"name": "PowerShell",
"bytes": "17207"
},
{
"name": "Shell",
"bytes": "17104"
}
]
}
|
namespace v8 {
namespace internal {
namespace compiler {
class JSGraph;
class CommonOperatorBuilder;
class Node;
class ControlReducer {
public:
// Perform branch folding and dead code elimination on the graph.
static void ReduceGraph(Zone* zone, JSGraph* graph,
CommonOperatorBuilder* builder);
// Trim nodes in the graph that are not reachable from end.
static void TrimGraph(Zone* zone, JSGraph* graph);
// Testing interface.
static Node* ReducePhiForTesting(JSGraph* graph,
CommonOperatorBuilder* builder, Node* node);
static Node* ReduceBranchForTesting(JSGraph* graph,
CommonOperatorBuilder* builder,
Node* node);
static Node* ReduceMergeForTesting(JSGraph* graph,
CommonOperatorBuilder* builder,
Node* node);
};
}
}
} // namespace v8::internal::compiler
#endif // V8_COMPILER_CONTROL_REDUCER_H_
|
{
"content_hash": "bc90818c3a52b7ed10f560b4d93e50b8",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 79,
"avg_line_length": 32.375,
"alnum_prop": 0.609073359073359,
"repo_name": "razvanphp/arangodb",
"id": "e25bb8820291bd8d784c1d415953d71412d8aa31",
"size": "1283",
"binary": false,
"copies": "40",
"ref": "refs/heads/devel",
"path": "3rdParty/V8-3.31.74.1/src/compiler/control-reducer.h",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Ada",
"bytes": "89080"
},
{
"name": "AppleScript",
"bytes": "1429"
},
{
"name": "Assembly",
"bytes": "142084"
},
{
"name": "Batchfile",
"bytes": "9186"
},
{
"name": "Bison",
"bytes": "33480"
},
{
"name": "C",
"bytes": "1734387"
},
{
"name": "C#",
"bytes": "55625"
},
{
"name": "C++",
"bytes": "64113219"
},
{
"name": "CLIPS",
"bytes": "5291"
},
{
"name": "CMake",
"bytes": "96668"
},
{
"name": "CSS",
"bytes": "1374222"
},
{
"name": "CoffeeScript",
"bytes": "94"
},
{
"name": "DIGITAL Command Language",
"bytes": "27303"
},
{
"name": "Emacs Lisp",
"bytes": "15477"
},
{
"name": "Go",
"bytes": "1018005"
},
{
"name": "Groff",
"bytes": "263567"
},
{
"name": "HTML",
"bytes": "321370"
},
{
"name": "JavaScript",
"bytes": "56270493"
},
{
"name": "LLVM",
"bytes": "39039"
},
{
"name": "Lua",
"bytes": "14392"
},
{
"name": "Makefile",
"bytes": "177375"
},
{
"name": "Module Management System",
"bytes": "1545"
},
{
"name": "NSIS",
"bytes": "26909"
},
{
"name": "Objective-C",
"bytes": "38849"
},
{
"name": "Objective-C++",
"bytes": "1857"
},
{
"name": "Pascal",
"bytes": "117802"
},
{
"name": "Perl",
"bytes": "227888"
},
{
"name": "Protocol Buffer",
"bytes": "5837"
},
{
"name": "Python",
"bytes": "3479391"
},
{
"name": "Ruby",
"bytes": "988571"
},
{
"name": "SAS",
"bytes": "1847"
},
{
"name": "Scheme",
"bytes": "19885"
},
{
"name": "Shell",
"bytes": "457713"
}
]
}
|
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("06. Print Numbers")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("06. Print Numbers")]
[assembly: AssemblyCopyright("Copyright © 2016")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("317f3295-a9f3-4b77-82d7-433fb8e6f0cf")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
|
{
"content_hash": "b2160fe897b4e85b4d183218b0a8fc48",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 84,
"avg_line_length": 39.083333333333336,
"alnum_prop": 0.7427149964463398,
"repo_name": "beBoss/Telerik",
"id": "f30ebd217b7905d70079dce350db12cef4a054b6",
"size": "1410",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "CSharp-Part-1/Intro-Programming-Homework/06. Print Numbers/Properties/AssemblyInfo.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "22251"
}
]
}
|
package me.icymint.sloth.core.module;
|
{
"content_hash": "7ce3ff66a1eb1c1226fa50b3a5c18de5",
"timestamp": "",
"source": "github",
"line_count": 2,
"max_line_length": 37,
"avg_line_length": 19,
"alnum_prop": 0.8157894736842105,
"repo_name": "leptonyu/sloth",
"id": "739071441209a776bf0b6e1e58a597a39da59a46",
"size": "630",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "sloth-core/src/main/java/me/icymint/sloth/core/module/package-info.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "HTML",
"bytes": "5700"
},
{
"name": "Java",
"bytes": "118198"
}
]
}
|
<?
// This unit test tests, if the Registration and Activation process provided
// by Yum works
Yii::import('application.modules.user.models.*');
Yii::import('application.modules.user.controllers.*');
class RegistrationTest extends CDbTestCase
{
public $fixtures=array();
public function testRegistration() {
Yii::app()->controller = new YumRegistrationController('registration');
$user = new YumRegistrationForm;
$user->username = 'no whitespaces allowed';
$this->assertFalse($user->validate());
$user->username = 'allowed';
$user->password = 'notthesame';
$user->password = 'emasehtton';
$this->assertFalse($user->validate());
$user->setAttributes(array(
'username' => 'A_Testuser',
'password' => 'hiddenpassword1',
'verifyPassword' => 'hiddenpassword1',
));
$this->assertTrue($user->validate());
$profile = new YumRegistrationForm;
$profile->setAttributes(array(
'firstname' => 'My first Name !"§$%&/()=',
'lastname' => 'My last Name !"§$%&/()=<? die() ?>',
'password' => 'hiddenpassword1',
'verifyPassword' => 'hiddenpassword1',
));
$profile->setAttributes($user->getAttributes());
$this->assertTrue($profile->validate());
// it is good that $_POST is bloated here because we want to test if
// only safe Attributes are being assigned:
$_POST['YumRegistrationForm'] = $user->getAttributes();
$_POST['YumProfile'] = $profile->getAttributes();
}
}
|
{
"content_hash": "3e0028e685d7a2215c63b329318903dd",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 77,
"avg_line_length": 30.122448979591837,
"alnum_prop": 0.6490514905149052,
"repo_name": "wantzjt/yii-user-management-facebook",
"id": "8fd822341f638d3bc93251b392be4d67ad20df7c",
"size": "1478",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "testdrive/protected/modules/user/tests/unit/RegistrationTest.php",
"mode": "33188",
"license": "bsd-3-clause",
"language": []
}
|
## cpp-flatten
An header-only C++98 (or better) library that provides an STL-like function that
flattens nested sequences.
### Synopsis
This library consists of one header file (`flatten.hpp`) which provides one
user-visible template function:
template<class T, class InputIterator, class OutputIterator>
void flatten(InputIterator begin, InputIterator end, OutputIterator out);
Given an iterator to an arbitrarily nested sequence, the function will produce
a flat sequence with values of type T. For example:
`````cpp
typedef std::vector<int> IntList;
typedef std::vector<IntList> IntListList;
typedef std::vector<IntList> IntListListList;
/* Using C++11's initialization syntax for simplicity. */
IntListListList values
{
{ { 1, 2, 3 }, { 4, 5, 6 }, { } },
{ { 7 }, { 8 }, { 9 } }
};
std::ostream_iterator<int> out(std::cout, " ");
flatten::flatten<int>(values.begin(), values.end(), out);
`````
When run, this snippet will print this sequence to std::out:
`````cpp
1 2 3 4 5 6 7 8 9
`````
You can use a std::back\_inserter to convert to flattened list:
`````cpp
template<class NestedList>
std::vector<int> flatten_vector(const NestedList& in)
{
std::vector<int> result;
flatten::flatten<int>(in.begin(), in.end(), std::back_inserter(result));
return result;
}
`````
`flatten` also supports flattening the values (though not the keys) in a map:
`````cpp
std::multimap<int, int> values = { { 1, 2 }, { 1, 3 }, { 2, 4} };
std::ostream_iterator<int> out(std::cout, " ");
flatten::flatten<int>(values.begin(), values.end(), out);
`````
Produces:
`````cpp
2 3 4
`````
Finally, `flatten` doesn't have to flatten a list entirely. Calling `flatten`
with `T = some list type` works too:
`````cpp
IntListListList values = { /* */ };
IntListList flattened;
flatten::flatten<IntList>(
values.begin(),
values.end(),
std::back_inserter(flattened)
);
`````
### Installation
Flatten is a header-only library, so all you really need to do is copy
flatten.hpp to wherever's convenient. However, if you'd like to install
it into your system includes, you can install flatten with CMake. For
instance, on a Debian system:
`````bash
$ cmake <path-to-flatten-repo>
$ make
$ sudo make install
`````
The library also provides some unit tests, which require that the boost
unit test framework libraries be installed on your system. You can build
and run the unit tests with CMake:
`````bash
$ cmake <path-to-flatten-repo>
$ make check
`````
If you run into issues, make sure CMake can find your CppUnit library
and headers. Otherwise...
### Reporting Bugs
If you run into issues (bugs, compilation errors, unit test failures, etc.),
feel free to create an issue in GitHub's issue tracker. Please provide any
relevant details, like:
- your compiler,
- your compiler version,
- your compilation flags,
- the error messages or incorrect results you're seeing,
- your CMake version (if applicable),
- anything else you think is relevant.
|
{
"content_hash": "7b03714669761a57eae81ba13e9e2986",
"timestamp": "",
"source": "github",
"line_count": 110,
"max_line_length": 80,
"avg_line_length": 27.154545454545456,
"alnum_prop": 0.6993639102778708,
"repo_name": "Fifty-Nine/cpp-flatten",
"id": "38113335ca0f1a979182d0cf1685f965092a953e",
"size": "2987",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "README.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C++",
"bytes": "6169"
}
]
}
|
package org.apache.activemq.artemis.jms.tests;
import javax.jms.Connection;
import javax.jms.ConnectionMetaData;
import javax.jms.ExceptionListener;
import javax.jms.JMSException;
import javax.jms.QueueConnection;
import javax.jms.QueueConnectionFactory;
import javax.jms.ServerSessionPool;
import javax.jms.Session;
import javax.jms.TopicConnection;
import org.apache.activemq.artemis.jms.tests.util.ProxyAssertSupport;
import org.junit.Assert;
import org.junit.Test;
/**
* Connection tests. Contains all connection tests, except tests relating to closing a connection,
* which go to ConnectionClosedTest.
*/
public class ConnectionTest extends JMSTestCase {
private static final JmsTestLogger log = JmsTestLogger.LOGGER;
@Test
public void testManyConnections() throws Exception {
for (int i = 0; i < 100; i++) {
Connection conn = createConnection();
conn.close();
}
}
//
// Note: All tests related to closing a Connection should go to ConnectionClosedTest
//
@Test
public void testGetClientID() throws Exception {
Connection connection = createConnection();
String clientID = connection.getClientID();
// We don't currently set client ids on the server, so this should be null.
// In the future we may provide connection factories that set a specific client id
// so this may change
ProxyAssertSupport.assertNull(clientID);
connection.close();
}
@Test
public void testSetClientID() throws Exception {
Connection connection = createConnection();
final String clientID = "my-test-client-id";
connection.setClientID(clientID);
ProxyAssertSupport.assertEquals(clientID, connection.getClientID());
Connection connection2 = createConnection();
try {
connection2.setClientID(clientID);
Assert.fail("setClientID was expected to throw an exception");
} catch (JMSException e) {
// expected
}
connection.close();
connection2.setClientID(clientID);
}
@Test
public void testSetClientIdAfterStop() throws Exception {
try (Connection connection = createConnection()) {
connection.stop();
connection.setClientID("clientId");
}
}
@Test
public void testSetClientAfterStart() throws Exception {
Connection connection = null;
try {
connection = createConnection();
// we startthe connection
connection.start();
// an attempt to set the client ID now should throw an IllegalStateException
connection.setClientID("testSetClientID_2");
ProxyAssertSupport.fail("Should throw a javax.jms.IllegalStateException");
} catch (javax.jms.IllegalStateException e) {
} catch (JMSException e) {
ProxyAssertSupport.fail("Should raise a javax.jms.IllegalStateException, not a " + e);
} catch (java.lang.IllegalStateException e) {
ProxyAssertSupport.fail("Should raise a javax.jms.IllegalStateException, not a java.lang.IllegalStateException");
} finally {
if (connection != null) {
connection.close();
}
}
}
@Test
public void testSetClientIDFail() throws Exception {
final String clientID = "my-test-client-id";
// Setting a client id must be the first thing done to the connection
// otherwise a javax.jms.IllegalStateException must be thrown
Connection connection = createConnection();
connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
try {
connection.setClientID(clientID);
ProxyAssertSupport.fail();
} catch (javax.jms.IllegalStateException e) {
ConnectionTest.log.trace("Caught exception ok");
}
connection.close();
// TODO: This will probably go away, remove it enterily after we
// make sure this rule can go away
// connection = createConnection();
// connection.getClientID();
// try
// {
// connection.setClientID(clientID);
// ProxyAssertSupport.fail();
// }
// catch (javax.jms.IllegalStateException e)
// {
// }
// connection.close();
}
@Test
public void testGetMetadata() throws Exception {
Connection connection = createConnection();
ConnectionMetaData metaData = connection.getMetaData();
// TODO - need to check whether these are same as current version
metaData.getJMSMajorVersion();
metaData.getJMSMinorVersion();
metaData.getJMSProviderName();
metaData.getJMSVersion();
metaData.getJMSXPropertyNames();
metaData.getProviderMajorVersion();
metaData.getProviderMinorVersion();
metaData.getProviderVersion();
connection.close();
}
@Test
public void testSetClientIdAfterGetMetadata() throws Exception {
try (Connection connection = createConnection()) {
connection.getMetaData();
connection.setClientID("clientId");
}
}
/**
* Test creation of QueueSession
*/
@Test
public void testQueueConnection1() throws Exception {
QueueConnection qc = queueCf.createQueueConnection();
qc.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
qc.close();
}
/**
* Test creation of TopicSession
*/
@Test
public void testTopicConnection() throws Exception {
TopicConnection tc = topicCf.createTopicConnection();
tc.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
}
/**
* Test ExceptionListener stuff
*/
@Test
public void testExceptionListener() throws Exception {
Connection conn = createConnection();
ExceptionListener listener1 = new MyExceptionListener();
conn.setExceptionListener(listener1);
ExceptionListener listener2 = conn.getExceptionListener();
ProxyAssertSupport.assertNotNull(listener2);
ProxyAssertSupport.assertEquals(listener1, listener2);
conn.close();
// Ensure setting / getting exception listener can occur before setting clientid.
final String clientID = "my-test-client-id";
Connection connection = createConnection();
ExceptionListener listener = connection.getExceptionListener();
try {
connection.setClientID(clientID);
} catch (javax.jms.IllegalStateException e) {
ProxyAssertSupport.fail();
}
connection.close();
connection = createConnection();
connection.setExceptionListener(listener);
try {
connection.setClientID(clientID);
} catch (javax.jms.IllegalStateException e) {
ProxyAssertSupport.fail();
}
connection.close();
}
// This test is to check netty issue in https://jira.jboss.org/jira/browse/JBMESSAGING-1618
@Test
public void testConnectionListenerBug() throws Exception {
for (int i = 0; i < 1000; i++) {
Connection conn = createConnection();
MyExceptionListener listener = new MyExceptionListener();
conn.setExceptionListener(listener);
conn.close();
}
}
/**
* This test is similar to a JORAM Test...
* (UnifiedTest::testCreateDurableConnectionConsumerOnQueueConnection)
*
* @throws Exception
*/
@Test
public void testDurableSubscriberOnQueueConnection() throws Exception {
QueueConnection queueConnection = ((QueueConnectionFactory) queueCf).createQueueConnection();
try {
queueConnection.createDurableConnectionConsumer(ActiveMQServerTestCase.topic1, "subscriptionName", "", (ServerSessionPool) null, 1);
ProxyAssertSupport.fail("Should throw a javax.jms.IllegalStateException");
} catch (javax.jms.IllegalStateException e) {
} catch (java.lang.IllegalStateException e) {
ProxyAssertSupport.fail("Should throw a javax.jms.IllegalStateException");
} catch (JMSException e) {
ProxyAssertSupport.fail("Should throw a javax.jms.IllegalStateException, not a " + e);
} finally {
queueConnection.close();
}
}
static class MyExceptionListener implements ExceptionListener {
JMSException exceptionReceived;
@Override
public void onException(final JMSException exception) {
exceptionReceived = exception;
ConnectionTest.log.trace("Received exception");
}
}
}
|
{
"content_hash": "743910b9055471d44c65ad59f4629976",
"timestamp": "",
"source": "github",
"line_count": 281,
"max_line_length": 141,
"avg_line_length": 30.09964412811388,
"alnum_prop": 0.6700165523764483,
"repo_name": "TomRoss/activemq-artemis",
"id": "e04d3f8bc12770e26751a5aa5ac103aba88fc5c8",
"size": "9257",
"binary": false,
"copies": "2",
"ref": "refs/heads/main",
"path": "tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/ConnectionTest.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "8132"
},
{
"name": "CSS",
"bytes": "66347"
},
{
"name": "Groovy",
"bytes": "184218"
},
{
"name": "HTML",
"bytes": "28681"
},
{
"name": "Java",
"bytes": "30839394"
},
{
"name": "JavaScript",
"bytes": "269995"
},
{
"name": "Shell",
"bytes": "66201"
}
]
}
|
package org.jsuffixarrays;
/**
* An algorithm that can produce a <i>suffix array</i> for a sequence of integer symbols.
*
* @see #buildSuffixArray(int[], int, int)
*/
public interface ISuffixArrayBuilder
{
/**
* Computes suffix array for sequence of symbols (integers). The processed sequence is
* a subsequence of <code>input</code> determined by <code>start</code> and
* <code>length</code> parameters.
* <p>
* Concrete implementations may have additional requirements and constraints
* concerning the input. For example, it is quite common that extra cells are required
* after <code>start + length</code> to store special marker symbols. Also, some
* algorithms may require non-negative symbols in the input. For such constrained
* algorithms, use various decorators and adapters available in this package.
*
* @param input A sequence of input symbols, int-coded.
* @param start The starting index (inclusive) in <code>input</code>.
* @param length Number of symbols to process.
* @return An array of indices such that the suffix of <code>input</code> at index
* <code>result[i]</code> is lexicographically larger or equal to any other
* suffix that precede it. Note that the output array may be larger than
* <code>input.length</code>, in which case only the first
* <code>input.length</code> elements are of relevance.
* <p>
* The returned array contains suffix indexes starting from 0 (so
* <code>start</code> needs to be added manually to access a given suffix in
* <code>input</code>).
*/
int [] buildSuffixArray(int [] input, int start, int length);
}
|
{
"content_hash": "06f049d5263f8992cbddb373fbc8f03c",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 90,
"avg_line_length": 51.114285714285714,
"alnum_prop": 0.655673560648407,
"repo_name": "carrotsearch/jsuffixarrays",
"id": "402dfbdce4fc3e5b508b8bc61e71d54d11ef42a8",
"size": "1789",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/main/java/org/jsuffixarrays/ISuffixArrayBuilder.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "271300"
}
]
}
|
(function(){
String.prototype.trim = function() { return this.replace(/^\s+|\s+$/, ''); };
// document node prototype
function docNode(etype, document) {
this.ownerDocument = document;
this.nodeType = etype;
this.tagName = '';
this.nodeValue = '';
this.index = 0;
this.attributes = {};
this.parentIndex = 0;
// DOM attributes
this.parentNode = null;
this.childNodes = null;
this.firstChild = null;
this.lastChild = null;
this.nextSibling = null;
this.previousSibling = null;
// render temp
this.blockX = 0; // render origin
this.blockY = 0;
this.renderX = 0; // render position
this.renderY = 0;
this.renderWidth = 0; // rendered size (propagates backwards)
this.renderHeight = 0;
}
function docHTML()
{
this.nodes = [];
this.body = null;
this.title = null;
}
// Iterator for nodes
// Returns node in which func returns false, or null
docNode.prototype.iterateNodes = function(func) {
var nodeList = this.ownerDocument.nodes;
var len = nodeList.length;
var curStack = this.index;
for (var i=this.index+1; i<len; i++) {
var node = nodeList[i];
if (node.parentIndex < curStack)
break;
if (!func.call(null, node)) {
return node;
}
}
return null;
}
docNode.prototype.getFirstElementByTagName = function(tag) {
var selectAll = tag == '*';
return this.iterateNodes(function(node){
return !(selectAll || node.tagName == tag);
});
}
// Helpful element functions
docNode.prototype.getElementsByTagName = function(tag) {
var selectAll = tag == '*';
var list = [];
this.iterateNodes(function(node){
if (selectAll || node.tagName == tag)
list.push(node);
return true;
});
return list;
}
docNode.prototype.getElementsByName = function(name) {
var list = [];
this.iterateNodes(function(node){
if (selectAll || node.attr.name == name)
list.push(node);
return true;
});
return list;
}
docNode.prototype.getElementById = function(id) {
return this.iterateNodes(function(node){
return node.attributes.id != id;
});
}
docNode.prototype.getAttribute = function(name) {
return this.attributes(name);
}
docNode.prototype.setAttribute = function(name, value) {
this.attributes[name] = value;
}
// Finds main body tag in document
function findBody(nodeList) {
var len = nodeList.length;
for (var i=0; i<len; i++) {
var obj = nodeList[i];
if (obj.nodeType == 9)
return obj;
}
return 0;
}
// Finds an indexed node in list
function findNodeID(list, id) {
var len = list.length;
for (var i=len-1; i > -1; i--) {
if (list[i].index == id)
return i;
}
return -1;
}
// Pops node stack down to idx
function popToNodeStack(nodeStack, idx) {
var closedNodeIDX = findNodeID(nodeStack, idx);
if (closedNodeIDX >= 0) {
return nodeStack.slice(0, closedNodeIDX+1);
}
return nodeStack;
}
// Finds last open tagName in list
function findOpenNode(list, tagName) {
var len = list.length;
for (var i=len-1; i > -1; i--) {
//debugLog(list[i].tagName + '==' + tagName);
if (list[i].tagName == tagName)
return i;
}
return -1;
}
// Lays out elements on page
function layout(body, nodeList) {
var len = nodeList.length;
var nodeStack = [];
var ctx = document.getElementById('output').getContext("2d");
// initial style
ctx.font = "12pt Arial";
ctx.textAlign = "left";
ctx.textBaseline = "top";
ctx.fillStyle = "rgb(0, 0, 0, 1.0)";
ctx.strokeStyle = "rgb(1, 0, 0, 1.0)";
var curNode = body;
nodeStack.push(body);
for (var i=body.index+1; i<len; i++) {
var obj = nodeList[i];
debugLog("[" + i + "]" + obj.tagName + "=" + obj.nodeValue + ' @ P[' + obj.parentIndex + '] START=' + (curNode.blockX+curNode.renderWidth));
// End of body?
if (obj.parentIndex < body.index) {
break;
}
// NOTE: ideally should figure out a better way of styling!
var doBreak = false;
// Update stack (in case [tag][content][tag]...)
if (obj.parentIndex < curNode.index) {
var closedNodeIDX = findNodeID(nodeStack, obj.parentIndex);
//debugLog('POP STACK');
// Increment width on all nodes up to closing index
for (var j=nodeStack.length-2; j >= closedNodeIDX; j--) {
// TODO: obviously better handling
var node = nodeStack[j+1];
var parentNode = nodeStack[j];
if (parentNode.blockX + parentNode.renderWidth < node.blockX + node.renderWidth)
parentNode.renderWidth = node.blockX + node.renderWidth - parentNode.blockX;
if (parentNode.blockY + parentNode.renderHeight < node.blockY + node.renderHeight)
parentNode.renderHeight = node.blockY + node.renderHeight - parentNode.blockY;
parentNode.renderX = node.blockX + node.renderWidth;
debugLog(" [" + nodeStack[j].index + "] += " + nodeStack[j+1].index);
}
// Test break on P
// TODO: style lookup
if (nodeStack[closedNodeIDX+1].tagName == 'P') {
doBreak = true;
}
nodeStack = popToNodeStack(nodeStack, obj.parentIndex);
curNode = nodeStack[nodeStack.length-1];
}
// Content node?
if (obj.nodeType == 3) {
if (curNode.tagName == 'B')
ctx.font = "bold 12pt Arial";
else
ctx.font = "12pt Arial";
var renderMetrics = ctx.measureText(obj.nodeValue);
//debugLog("ADD ONTO " + curNode.tagName + "," + curNode.index);
debugLog(' R AT ' + curNode.renderX + '[' + curNode.index + ']');
// Plot position in current node render pos
obj.renderX = curNode.renderX;
obj.renderY = curNode.renderY;
obj.renderWidth = renderMetrics.width;
// Increment current node render pos
curNode.renderX += obj.renderWidth;
var delta = curNode.renderX - (curNode.blockX + curNode.renderWidth);
if (delta > 0)
curNode.renderWidth += delta;
curNode.renderHeight = 14;
} else {
// Sanity check
if (obj.parentIndex > curNode.index) {
debugLog("!!Parse oddity");
continue;
}
// Add new node on stack
nodeStack.push(obj);
// Set block origin
if (doBreak) {
obj.blockX = curNode.blockX;
obj.blockY = curNode.renderY + curNode.renderHeight;
} else {
obj.blockX = curNode.renderX;
obj.blockY = curNode.renderY;
}
// Set block render pos
obj.renderX = obj.blockX;
obj.renderY = obj.blockY;
curNode = obj;
}
}
debugLog("LAYOUT:");
debugLog(nodeList);
return nodeList;
}
function debugLog(line) {
if (window.console)
console.log(line);
}
// Renders parsed document
function render(doc) {
var nodeList = doc.nodes;
var len = nodeList.length;
var curX = 0;
var curY = 0;
var styleStack = [];
var nodeStack = [];
var ctx = document.getElementById('output').getContext("2d");
ctx.font = "12pt Arial";
ctx.textAlign = "left";
ctx.textBaseline = "top";
ctx.fillStyle = "rgb(0, 0, 0, 1.0)";
var body = doc.body;
// pre-process layout
nodeList = layout(body, nodeList);
// Iterate nodes
var curNode = body;
for (var i=body.index+1; i<len; i++) {
var obj = nodeList[i];
// End of body?
if (obj.parentIndex < body.index)
break;
// DEBUG
//if (obj.tagName == 'P')
// ctx.strokeRect(obj.blockX, obj.blockY, obj.renderWidth, 12);
// Update stack (in case [tag][content][tag]...)
if (obj.parentIndex < curNode.index) {
nodeStack = popToNodeStack(nodeStack, obj.parentIndex);
curNode = nodeStack[nodeStack.length-1];
}
// Content node?
if (obj.nodeType == 3) {
// TODO: style lookup
if (curNode.tagName == 'B')
ctx.font = "bold 12pt Arial";
else
ctx.font = "12pt Arial";
// Render current style
ctx.fillText(obj.nodeValue, obj.renderX, obj.renderY);
debugLog(obj.nodeValue + " at " + obj.renderX + "," + obj.renderY);
} else {
if (obj.parentIndex > curNode.index) // sanity check
continue;
// New node
nodeStack.push(obj);
curNode = obj;
}
}
}
// Populates DOM attributes
/*
parentNode
The parent of this node.
childNodes
A NodeList that contains all children of this node.
firstChild
The first child of this node.
lastChild
The last child of this node.
previousSibling
The node immediately preceding this node.
nextSibling
The node immediately following this node.
attributes
A NamedNodeMap containing the attributes of this node (if it is an Element) or null otherwise.
ownerDocument
*/
function populateDOM(root)
{
var nodeStack = [];
var curNode = root;
var lastNode = null;
/*
BODY[ch=[P,P], fc=P, lc=P]
P [pn=BODY, cn=P, ln=P, ch=[B,TX,B], fc=B, lc=B, ns=P]
B [pn=P, cn=B, ns=TX]
TX [cn=TX, ps=B, pn=P, ns=B]
B [cn=B, ps=TX, pn=P]
P [cn=P, ps=P, pn=BODY]
*/
root.iterateNodes(function(node){
// Reset children
node.childNodes = null;
node.firstChild = null;
node.lastChild = null;
node.previousSibling = null;
node.nextSibling = null;
if (node.parentIndex < curNode.index) {
// Closed nodes
nodeStack = popToNodeStack(nodeStack, node.parentIndex);
curNode = nodeStack[nodeStack.length-1];
}
// Set children of parents
if (curNode.childNodes == null) {
curNode.childNodes = [node];
curNode.firstChild = node;
} else {
curNode.childNodes.push(node);
}
// Set siblings
if (curNode.lastChild) {
curNode.lastChild.nextSibling = node;
node.previousSibling = curNode.lastChild;
}
curNode.lastChild = node;
node.parentNode = curNode;
// Update stack
if (node.parentIndex >= curNode.index) {
// Open nodes
nodeStack.push(node);
curNode = node;
}
lastNode = node;
return true;
});
}
// Functions to make basic content nodes
function addContentNode(document, content, parent)
{
var anon = new docNode(3, document);
if (parent.tagName == 'SPAN')
anon.nodeValue = content;
else
anon.nodeValue = content.trim();
anon.index = document.nodes.length;
anon.parentIndex = parent.index;
document.nodes.push(anon);
return anon;
}
function addRootNode(document, content, parent)
{
var anon = new docNode(1, document);
anon.nodeValue = content;
anon.index = document.nodes.length;
anon.parentIndex = -1;
document.nodes.push(anon);
return anon;
}
function addDocAttrNode(document, content, parent)
{
var anon = new docNode(2, document);
anon.nodeValue = content.trim();
anon.index = document.nodes.length;
anon.parentIndex = parent.index;
document.nodes.push(anon);
return anon;
}
function addBodyNode(document, content, parent)
{
var anon = new docNode(9, document);
anon.nodeValue = content.trim();
anon.index = document.nodes.length;
anon.parentIndex = parent.index;
document.nodes.push(anon);
return anon;
}
function addDummyNode(document, content, parent)
{
var anon = new docNode(1, document);
anon.nodeType = 0;
anon.nodeValue = content.trim();
anon.index = document.nodes.length;
anon.parentIndex = parent.index;
document.nodes.push(anon);
return anon;
}
var makeTagFuncs = {
'HTML': addRootNode,
'TITLE': addDocAttrNode,
'BODY': addBodyNode,
'P': addDummyNode,
'B': addDummyNode,
'SPAN': addDummyNode,
};
var HTMLCommentStrip = new RegExp("<![^>]*>"); // a bit simple, but works for now
// Parses document
//
// e.g. "<html><head><title></title></head><body><p class="top">FOO <b>woo</b></p><p>Foo 2</p></body></html>"
//
// [["html", "", 0, -1],
// ["head", "", 1, 0],
// ["title", "", 2, 1],
// ["body", "", 3, 0],
// ["p", "FOO ", 4, 3],
// ["b", "woo", 5, 4],
// ["p", "Foo 2", 6, 3],
// ]
//
function parse(doc) {
var tagParse = new RegExp("</?([A-Za-z]*)( ([a-zA-Z0-9_-]*=(\".*\")|('.*') ?)*)?>", "");
var rawDoc = doc.replace(HTMLCommentStrip, "");
var startIDX = 0;
var curStr = doc;
var nodeStack = [];
var genDoc = new docHTML();
var len = rawDoc.length;
var topNode = null;
// Search for tags...
while (startIDX != -1 && startIDX < len) {
var searchStr = rawDoc.substr(startIDX);
var nextTag = searchStr.search(tagParse);
//debugLog("SS:" + searchStr);
if (nextTag != -1) {
// Found tag, start wih content + name
var content = searchStr.substr(0, nextTag); // existing node content
searchStr = searchStr.substr(nextTag);
var tagName = searchStr.match("</?([A-Za-z]*)")[1].toUpperCase();
var isClosing = searchStr.indexOf('/') == 1;
//debugLog("Found tag " + tagName);
//debugLog("CONTENT:" + content);
//debugLog("CLOSING:" + isClosing);
// Advance next search pos
startIDX += nextTag + searchStr.indexOf('>') + 1;
// Insert content node
if (topNode != 0 && content.length > 0) {
addContentNode(genDoc, content, topNode);
}
// Open or close nodes
if (!isClosing) {
// Add node
var tagFunc = makeTagFuncs[tagName];
if (tagFunc)
topNode = tagFunc(genDoc, tagName, topNode);
else
topNode = addDummyNode(genDoc, tagName, topNode)
topNode.tagName = tagName;
// Parse attributes
var rg = new RegExp("([A-Za-z0-9_-]*)=((?:\"[^\"]*)|(?:'[^']*))", "g");
var scans = searchStr.substr(1, searchStr.indexOf('>')-1);
var attrs = null;
while ((attrs = rg.exec(scans)) != null) {
topNode.attributes[attrs[1]] = attrs[2].substr(1);
}
nodeStack.push(topNode);
} else {
// Close matching node
var closedNodeIDX = findOpenNode(nodeStack, tagName);
//debugLog("CLOSED IDX==" + closedNodeIDX);
//debugLog(nodeStack);
if (closedNodeIDX >= 0) {
nodeStack = nodeStack.slice(0, closedNodeIDX);
}
if (nodeStack.length > 0)
topNode = nodeStack[nodeStack.length-1];
else
topNode = null;
continue;
}
} else // no more tags
break;
}
debugLog("Generated Doc:");
debugLog(genDoc);
// Find useful data
genDoc.body = findBody(genDoc.nodes);
genDoc.head = genDoc.nodes[0].getFirstElementByTagName('HEAD');
if (genDoc.head) {
var title = genDoc.nodes[0].getFirstElementByTagName('TITLE');
if (title) {
title = title.getFirstElementByTagName('*');
if (title)
genDoc.title = title.nodeValue;
}
}
return genDoc;
}
// CSS Parser
var CSSCommentStrip = new RegExp("/\\*[^\\*]*\\*/");
function stripCSSComments(str) {
return str.replace(CSSCommentStrip, "");
}
function parseCSSSelectors(doc) {
// chunker taken from sizzle, (C) Copyright 2009, The Dojo Foundation
var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g;
var selectorList = [];
var elements = [];
var nextElement;
var lastElement = null;
var matchParent = false;
var matchSibling = false;
while ((nextElement = chunker.exec(doc)) != null) {
// TODO: hook into an existing CSS selector lib
var rule = nextElement[1];
elements.push(rule);
if (nextElement[2] && nextElement[2].substr(0,1) == ',') {
// Selector ended
selectorList.push(elements);
elements = [];
}
}
// Final element?
if (elements.length != 0)
selectorList.push(elements);
return selectorList;
}
function parseCSSProperties(doc) {
var nameParse = new RegExp("([A-Za-z0-9\-_]+):", "g");
var propParse = /((?:'[^']*')|(?:"[^"]*")|[^;}])*/;
var propertyList = {};
var nextName;
while ((nextName = nameParse.exec(doc)) != null) {
var name = nextName[1];
var foundProp = propParse.exec(doc.substr(nameParse.lastIndex));
propertyList[name] = foundProp[0]; // TODO: parse value -> values
nextName.lastIndex = foundProp.index + foundProp[0].length + 1;
}
return propertyList;
}
function parseCSS(doc) {
var rawDoc = stripCSSComments(doc);
var blockParse = /(?:(@[a-zA-z]+)\s((?:[A-Za-z]+)|(?:'[^']*')|(?:"[^"]*")|(?:(?:[A-Za-z]*)\([^\)]*\)));)|({[^{]*})/g;
var startIDX = 0;
var len = rawDoc.length;
// TODO: handle blocks better
while (startIDX != -1 && startIDX < len) {
var nextBlock = blockParse.exec(rawDoc);
if (nextBlock != null) {
if (nextBlock[1]) {
// key [1]
// value [2]
// TODO
console.log("RULE: " + nextBlock[1] + ',' + nextBlock[2]);
} else if (nextBlock[3]) {
// Normal selector block
var selectors = parseCSSSelectors(rawDoc.substr(startIDX, nextBlock.index-startIDX));
var blockStr = rawDoc.substr(nextBlock.index+1, blockParse.lastIndex-nextBlock.index-1);
debugLog("BLOCK:"+blockStr);
var properties = parseCSSProperties(blockStr);
debugLog('++');
debugLog(selectors);
debugLog("--");
debugLog(properties);
debugLog('++');
}
startIDX = blockParse.lastIndex;
} else
break;
}
}
// Parse and load a sample document
var doc = "<html><head><title>Test</title></head><body><!-- Begin test --><p class=\"woo\" id=\"render\" style=\"display:none;\">Rendering <b>HTML</b>...</p><p><span>In <b>Canvas</b></span>!</p><p>0_0</p></body></html>";
var parsedDoc = parse(doc);
populateDOM(parsedDoc.nodes[0]);
render(parsedDoc);
debugLog("Node function test");
debugLog(parsedDoc.nodes[0].getElementsByTagName('BODY'));
debugLog(parsedDoc.nodes[0].getElementById('render'));
debugLog(parsedDoc.nodes[0].getElementById('render').getElementsByTagName('*'));
debugLog(parsedDoc.nodes[0].getElementsByTagName('*'));
// Test parse CSS
debugLog("Parse css test");
parseCSS("@test testValue; div[foo=lol][goo=boo] > p { foo: 1; woo:\"goo\"; } .wii { text-align: center }");
}());
|
{
"content_hash": "6fa3d9c645503aea360e674cff51e6dc",
"timestamp": "",
"source": "github",
"line_count": 695,
"max_line_length": 221,
"avg_line_length": 25.618705035971225,
"alnum_prop": 0.6109519797809604,
"repo_name": "jamesu/htmlcanvas",
"id": "ab14e7b7c3280262c8415be0400b8c4bb5887087",
"size": "17893",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "html_canvas.js",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "JavaScript",
"bytes": "17893"
}
]
}
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_51) on Thu Oct 10 10:10:40 EDT 2013 -->
<TITLE>
UriFactory
</TITLE>
<META NAME="date" CONTENT="2013-10-10">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="UriFactory";
}
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<HR>
<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/UriFactory.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../com/sola/instagram/io/RequestResponse.html" title="class in com.sola.instagram.io"><B>PREV CLASS</B></A>
<A HREF="../../../../com/sola/instagram/io/UriFactory.Auth.html" title="class in com.sola.instagram.io"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../index.html?com/sola/instagram/io/UriFactory.html" target="_top"><B>FRAMES</B></A>
<A HREF="UriFactory.html" target="_top"><B>NO FRAMES</B></A>
<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY: <A HREF="#nested_class_summary">NESTED</A> | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#methods_inherited_from_class_java.lang.Object">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | METHOD</FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->
<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
com.sola.instagram.io</FONT>
<BR>
Class UriFactory</H2>
<PRE>
java.lang.Object
<IMG SRC="../../../../resources/inherit.gif" ALT="extended by "><B>com.sola.instagram.io.UriFactory</B>
</PRE>
<HR>
<DL>
<DT><PRE>public class <B>UriFactory</B><DT>extends java.lang.Object</DL>
</PRE>
<P>
<HR>
<P>
<!-- ======== NESTED CLASS SUMMARY ======== -->
<A NAME="nested_class_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Nested Class Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> class</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../com/sola/instagram/io/UriFactory.Auth.html" title="class in com.sola.instagram.io">UriFactory.Auth</A></B></CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> class</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../com/sola/instagram/io/UriFactory.Comments.html" title="class in com.sola.instagram.io">UriFactory.Comments</A></B></CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> class</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../com/sola/instagram/io/UriFactory.Likes.html" title="class in com.sola.instagram.io">UriFactory.Likes</A></B></CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> class</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../com/sola/instagram/io/UriFactory.Locations.html" title="class in com.sola.instagram.io">UriFactory.Locations</A></B></CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> class</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../com/sola/instagram/io/UriFactory.Media.html" title="class in com.sola.instagram.io">UriFactory.Media</A></B></CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> class</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../com/sola/instagram/io/UriFactory.Relationships.html" title="class in com.sola.instagram.io">UriFactory.Relationships</A></B></CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> class</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../com/sola/instagram/io/UriFactory.Tags.html" title="class in com.sola.instagram.io">UriFactory.Tags</A></B></CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> class</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../com/sola/instagram/io/UriFactory.Users.html" title="class in com.sola.instagram.io">UriFactory.Users</A></B></CODE>
<BR>
</TD>
</TR>
</TABLE>
<!-- =========== FIELD SUMMARY =========== -->
<A NAME="field_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Field Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../com/sola/instagram/io/UriFactory.html#API_ROOT">API_ROOT</A></B></CODE>
<BR>
</TD>
</TR>
</TABLE>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<A NAME="constructor_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Constructor Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../../com/sola/instagram/io/UriFactory.html#UriFactory()">UriFactory</A></B>()</CODE>
<BR>
</TD>
</TR>
</TABLE>
<!-- ========== METHOD SUMMARY =========== -->
<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Method Summary</B></FONT></TH>
</TR>
</TABLE>
<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE>equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD>
</TR>
</TABLE>
<P>
<!-- ============ FIELD DETAIL =========== -->
<A NAME="field_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Field Detail</B></FONT></TH>
</TR>
</TABLE>
<A NAME="API_ROOT"><!-- --></A><H3>
API_ROOT</H3>
<PRE>
public static final java.lang.String <B>API_ROOT</B></PRE>
<DL>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#com.sola.instagram.io.UriFactory.API_ROOT">Constant Field Values</A></DL>
</DL>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<A NAME="constructor_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Constructor Detail</B></FONT></TH>
</TR>
</TABLE>
<A NAME="UriFactory()"><!-- --></A><H3>
UriFactory</H3>
<PRE>
public <B>UriFactory</B>()</PRE>
<DL>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/UriFactory.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../com/sola/instagram/io/RequestResponse.html" title="class in com.sola.instagram.io"><B>PREV CLASS</B></A>
<A HREF="../../../../com/sola/instagram/io/UriFactory.Auth.html" title="class in com.sola.instagram.io"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../index.html?com/sola/instagram/io/UriFactory.html" target="_top"><B>FRAMES</B></A>
<A HREF="UriFactory.html" target="_top"><B>NO FRAMES</B></A>
<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY: <A HREF="#nested_class_summary">NESTED</A> | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#methods_inherited_from_class_java.lang.Object">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | METHOD</FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<HR>
</BODY>
</HTML>
|
{
"content_hash": "b3eafc4062b323b286d5f96b14266122",
"timestamp": "",
"source": "github",
"line_count": 333,
"max_line_length": 251,
"avg_line_length": 40.990990990990994,
"alnum_prop": 0.6246886446886447,
"repo_name": "aie108/Instagram-Java",
"id": "0a50b51069df7e5542cae64d0686d0a160075ad6",
"size": "13650",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "doc/com/sola/instagram/io/UriFactory.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "261614"
}
]
}
|
/**
* Header file for application.cc
*
* PyramidPointRendererPlugin interface independent layer
*
* Author: Ricardo Marroquim
*
* Data created: 20-12-07
*
**/
#ifndef SPLATPYRAMIDPLUGIN_H
#define SPLATPYRAMIDPLUGIN_H
//OpenGL and GLUT includes
// Standard headers
#include <iostream>
#include <fstream>
#include <vector>
#include <string>
#include <stack>
#include <cassert>
using namespace std;
//IO includes
#include <sstream>
#include <iomanip>
#include <cmath>
#include <list>
#include <vector>
#include <QObject>
#include <QAction>
#include <QString>
#include <GL/glew.h>
#include <common/interfaces.h>
#include <vcg/math/matrix44.h>
#include <meshlab/glarea.h>
#include "pyramid_point_renderer_base.h"
#include "pyramid_point_renderer.h"
#include "pyramid_point_renderer_color.h"
//#include "pyramid_point_renderer_er.h"
#include "shaderStructs.h"
#include "dialog.h"
class PyramidPointRendererPlugin : public QObject, public MeshRenderInterface
{
Q_OBJECT
Q_INTERFACES(MeshRenderInterface)
bool mIsSupported;
QList <QAction *> actionList;
void createPointRenderer( void );
void drawPoints ( void );
public :
// PyramidPointRendererPlugin( GLint default_mode = PYRAMID_POINTS );
PyramidPointRendererPlugin();
~PyramidPointRendererPlugin();
//void draw ( void );
void reshape ( int w, int h );
void changeRendererType ( int type );
void changeMaterial( int mat );
int getNumberPoints ( void );
void setGpuMask ( int m );
void setPerVertexColor ( bool b );
void setAutoRotate ( bool r );
void setBackFaceCulling ( bool c );
void setEllipticalWeight ( bool b );
void setQualityPerVertex ( bool c );
void setQualityThreshold ( double q );
void setReconstructionFilter ( double s );
void setPrefilter ( double s );
void setDepthTest ( bool d );
void increaseSelected ( void );
void decreaseSelected ( void );
/// Implementations from inherited class
QList<QAction *> actions ()
{
if(actionList.isEmpty()) initActionList();
return actionList;
}
void initActionList();
Dialog *sDialog;
// virtual bool isSupported() {return mIsSupported;}
virtual bool isSupported() {return true;}
virtual void Init(QAction *a, MeshDocument &m, RenderMode &rm, QGLWidget *gla);
virtual void Render(QAction *a, MeshDocument &md, RenderMode &rm, QGLWidget *gla);
// virtual void Draw(QAction *, MeshModel &, RenderMode &, QGLWidget *) {}
virtual int passNum() { return 1; }
private :
// Generic class, is instanced as one of the inherited classes (rendering algorithms)
PointBasedRenderer *point_based_render;
int canvas_width, canvas_height;
int windows_width, windows_height;
float clipRatioNear, clipRatioFar;
float fov;
float scale_factor;
// Lists of objects (usually one ply file is associated to one object in list)
vector<Object> objects;
// Determines which rendering class to use (Pyramid points, with color per vertex, templates version ...)
// see objects.h for the complete list (point_render_type_enum).
GLint render_mode;
// Flags on/off
bool show_points;
bool rotating;
int selected;
/***** Frames per second and Surfels per second vars ******/
double sps, fps;
int fps_loop;
double start_time, end_time;
int timing_profile;
/*************************************/
};
#endif
|
{
"content_hash": "388338ad3df331751c5b19cb1142d3f4",
"timestamp": "",
"source": "github",
"line_count": 146,
"max_line_length": 107,
"avg_line_length": 22.965753424657535,
"alnum_prop": 0.7038473009245452,
"repo_name": "hlzz/dotfiles",
"id": "e61cc7e034450a6dcdb5015465e3424ffaeded43",
"size": "3353",
"binary": false,
"copies": "5",
"ref": "refs/heads/master",
"path": "graphics/meshlab/src/plugins_experimental/render_splatpyramid/splat_pyramid.h",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "AppleScript",
"bytes": "1240"
},
{
"name": "Arc",
"bytes": "38"
},
{
"name": "Assembly",
"bytes": "449468"
},
{
"name": "Batchfile",
"bytes": "16152"
},
{
"name": "C",
"bytes": "102303195"
},
{
"name": "C++",
"bytes": "155056606"
},
{
"name": "CMake",
"bytes": "7200627"
},
{
"name": "CSS",
"bytes": "179330"
},
{
"name": "Cuda",
"bytes": "30026"
},
{
"name": "D",
"bytes": "2152"
},
{
"name": "Emacs Lisp",
"bytes": "14892"
},
{
"name": "FORTRAN",
"bytes": "5276"
},
{
"name": "Forth",
"bytes": "3637"
},
{
"name": "GAP",
"bytes": "14495"
},
{
"name": "GLSL",
"bytes": "438205"
},
{
"name": "Gnuplot",
"bytes": "327"
},
{
"name": "Groff",
"bytes": "518260"
},
{
"name": "HLSL",
"bytes": "965"
},
{
"name": "HTML",
"bytes": "2003175"
},
{
"name": "Haskell",
"bytes": "10370"
},
{
"name": "IDL",
"bytes": "2466"
},
{
"name": "Java",
"bytes": "219109"
},
{
"name": "JavaScript",
"bytes": "1618007"
},
{
"name": "Lex",
"bytes": "119058"
},
{
"name": "Lua",
"bytes": "23167"
},
{
"name": "M",
"bytes": "1080"
},
{
"name": "M4",
"bytes": "292475"
},
{
"name": "Makefile",
"bytes": "7112810"
},
{
"name": "Matlab",
"bytes": "1582"
},
{
"name": "NSIS",
"bytes": "34176"
},
{
"name": "Objective-C",
"bytes": "65312"
},
{
"name": "Objective-C++",
"bytes": "269995"
},
{
"name": "PAWN",
"bytes": "4107117"
},
{
"name": "PHP",
"bytes": "2690"
},
{
"name": "Pascal",
"bytes": "5054"
},
{
"name": "Perl",
"bytes": "485508"
},
{
"name": "Pike",
"bytes": "1338"
},
{
"name": "Prolog",
"bytes": "5284"
},
{
"name": "Python",
"bytes": "16799659"
},
{
"name": "QMake",
"bytes": "89858"
},
{
"name": "Rebol",
"bytes": "291"
},
{
"name": "Ruby",
"bytes": "21590"
},
{
"name": "Scilab",
"bytes": "120244"
},
{
"name": "Shell",
"bytes": "2266191"
},
{
"name": "Slash",
"bytes": "1536"
},
{
"name": "Smarty",
"bytes": "1368"
},
{
"name": "Swift",
"bytes": "331"
},
{
"name": "Tcl",
"bytes": "1911873"
},
{
"name": "TeX",
"bytes": "11981"
},
{
"name": "Verilog",
"bytes": "3893"
},
{
"name": "VimL",
"bytes": "595114"
},
{
"name": "XSLT",
"bytes": "62675"
},
{
"name": "Yacc",
"bytes": "307000"
},
{
"name": "eC",
"bytes": "366863"
}
]
}
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Quarks</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.77.1">
<link rel="home" href="index.html" title="GLib Reference Manual">
<link rel="up" href="glib-data-types.html" title="GLib Data Types">
<link rel="prev" href="glib-N-ary-Trees.html" title="N-ary Trees">
<link rel="next" href="glib-Keyed-Data-Lists.html" title="Keyed Data Lists">
<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
<tr valign="middle">
<td><a accesskey="p" href="glib-N-ary-Trees.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="glib-data-types.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">GLib Reference Manual</th>
<td><a accesskey="n" href="glib-Keyed-Data-Lists.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts">
<a href="#glib-Quarks.synopsis" class="shortcut">Top</a>
|
<a href="#glib-Quarks.description" class="shortcut">Description</a>
</td></tr>
</table>
<div class="refentry">
<a name="glib-Quarks"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="glib-Quarks.top_of_page"></a>Quarks</span></h2>
<p>Quarks — a 2-way association between a string and a
unique integer identifier</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv">
<a name="glib-Quarks.synopsis"></a><h2>Synopsis</h2>
<pre class="synopsis">
#include <glib.h>
typedef <a class="link" href="glib-Quarks.html#GQuark" title="GQuark">GQuark</a>;
#define <a class="link" href="glib-Quarks.html#G-DEFINE-QUARK:CAPS" title="G_DEFINE_QUARK()">G_DEFINE_QUARK</a> (QN,
q_n)
<a class="link" href="glib-Quarks.html#GQuark" title="GQuark"><span class="returnvalue">GQuark</span></a> <a class="link" href="glib-Quarks.html#g-quark-from-string" title="g_quark_from_string ()">g_quark_from_string</a> (<em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *string</code></em>);
<a class="link" href="glib-Quarks.html#GQuark" title="GQuark"><span class="returnvalue">GQuark</span></a> <a class="link" href="glib-Quarks.html#g-quark-from-static-string" title="g_quark_from_static_string ()">g_quark_from_static_string</a> (<em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *string</code></em>);
const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> * <a class="link" href="glib-Quarks.html#g-quark-to-string" title="g_quark_to_string ()">g_quark_to_string</a> (<em class="parameter"><code><a class="link" href="glib-Quarks.html#GQuark" title="GQuark"><span class="type">GQuark</span></a> quark</code></em>);
<a class="link" href="glib-Quarks.html#GQuark" title="GQuark"><span class="returnvalue">GQuark</span></a> <a class="link" href="glib-Quarks.html#g-quark-try-string" title="g_quark_try_string ()">g_quark_try_string</a> (<em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *string</code></em>);
const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> * <a class="link" href="glib-Quarks.html#g-intern-string" title="g_intern_string ()">g_intern_string</a> (<em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *string</code></em>);
const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> * <a class="link" href="glib-Quarks.html#g-intern-static-string" title="g_intern_static_string ()">g_intern_static_string</a> (<em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *string</code></em>);
</pre>
</div>
<div class="refsect1">
<a name="glib-Quarks.description"></a><h2>Description</h2>
<p>
Quarks are associations between strings and integer identifiers.
Given either the string or the <a class="link" href="glib-Quarks.html#GQuark" title="GQuark"><span class="type">GQuark</span></a> identifier it is possible to
retrieve the other.
</p>
<p>
Quarks are used for both <a class="link" href="glib-Datasets.html" title="Datasets">Datasets</a> and <a class="link" href="glib-Keyed-Data-Lists.html" title="Keyed Data Lists">Keyed Data Lists</a>.
</p>
<p>
To create a new quark from a string, use <a class="link" href="glib-Quarks.html#g-quark-from-string" title="g_quark_from_string ()"><code class="function">g_quark_from_string()</code></a> or
<a class="link" href="glib-Quarks.html#g-quark-from-static-string" title="g_quark_from_static_string ()"><code class="function">g_quark_from_static_string()</code></a>.
</p>
<p>
To find the string corresponding to a given <a class="link" href="glib-Quarks.html#GQuark" title="GQuark"><span class="type">GQuark</span></a>, use
<a class="link" href="glib-Quarks.html#g-quark-to-string" title="g_quark_to_string ()"><code class="function">g_quark_to_string()</code></a>.
</p>
<p>
To find the <a class="link" href="glib-Quarks.html#GQuark" title="GQuark"><span class="type">GQuark</span></a> corresponding to a given string, use
<a class="link" href="glib-Quarks.html#g-quark-try-string" title="g_quark_try_string ()"><code class="function">g_quark_try_string()</code></a>.
</p>
<p>
Another use for the string pool maintained for the quark functions
is string interning, using <a class="link" href="glib-Quarks.html#g-intern-string" title="g_intern_string ()"><code class="function">g_intern_string()</code></a> or
<a class="link" href="glib-Quarks.html#g-intern-static-string" title="g_intern_static_string ()"><code class="function">g_intern_static_string()</code></a>. An interned string is a canonical
representation for a string. One important advantage of interned
strings is that they can be compared for equality by a simple
pointer comparison, rather than using <code class="function">strcmp()</code>.
</p>
</div>
<div class="refsect1">
<a name="glib-Quarks.details"></a><h2>Details</h2>
<div class="refsect2">
<a name="GQuark"></a><h3>GQuark</h3>
<pre class="programlisting">typedef guint32 GQuark;
</pre>
<p>
A GQuark is a non-zero integer which uniquely identifies a
particular string. A GQuark value of zero is associated to <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a>.
</p>
</div>
<hr>
<div class="refsect2">
<a name="G-DEFINE-QUARK:CAPS"></a><h3>G_DEFINE_QUARK()</h3>
<pre class="programlisting">#define G_DEFINE_QUARK(QN, q_n)</pre>
<p>
A convenience macro which defines a function returning the
<a class="link" href="glib-Quarks.html#GQuark" title="GQuark"><span class="type">GQuark</span></a> for the name <em class="parameter"><code>QN</code></em>. The function will be named
<em class="parameter"><code>q_n</code></em><code class="function">_quark()</code>.
Note that the quark name will be stringified automatically in the
macro, so you shouldn't use double quotes.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>QN</code></em> :</span></p></td>
<td>the name to return a <a class="link" href="glib-Quarks.html#GQuark" title="GQuark"><span class="type">GQuark</span></a> for</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>q_n</code></em> :</span></p></td>
<td>prefix for the function name</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.34</p>
</div>
<hr>
<div class="refsect2">
<a name="g-quark-from-string"></a><h3>g_quark_from_string ()</h3>
<pre class="programlisting"><a class="link" href="glib-Quarks.html#GQuark" title="GQuark"><span class="returnvalue">GQuark</span></a> g_quark_from_string (<em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *string</code></em>);</pre>
<p>
Gets the <a class="link" href="glib-Quarks.html#GQuark" title="GQuark"><span class="type">GQuark</span></a> identifying the given string. If the string does
not currently have an associated <a class="link" href="glib-Quarks.html#GQuark" title="GQuark"><span class="type">GQuark</span></a>, a new <a class="link" href="glib-Quarks.html#GQuark" title="GQuark"><span class="type">GQuark</span></a> is created,
using a copy of the string.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>string</code></em> :</span></p></td>
<td>a string. <span class="annotation">[<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>the <a class="link" href="glib-Quarks.html#GQuark" title="GQuark"><span class="type">GQuark</span></a> identifying the string, or 0 if <em class="parameter"><code>string</code></em> is
<a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a>.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="g-quark-from-static-string"></a><h3>g_quark_from_static_string ()</h3>
<pre class="programlisting"><a class="link" href="glib-Quarks.html#GQuark" title="GQuark"><span class="returnvalue">GQuark</span></a> g_quark_from_static_string (<em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *string</code></em>);</pre>
<p>
Gets the <a class="link" href="glib-Quarks.html#GQuark" title="GQuark"><span class="type">GQuark</span></a> identifying the given (static) string. If the
string does not currently have an associated <a class="link" href="glib-Quarks.html#GQuark" title="GQuark"><span class="type">GQuark</span></a>, a new <a class="link" href="glib-Quarks.html#GQuark" title="GQuark"><span class="type">GQuark</span></a>
is created, linked to the given string.
</p>
<p>
Note that this function is identical to <a class="link" href="glib-Quarks.html#g-quark-from-string" title="g_quark_from_string ()"><code class="function">g_quark_from_string()</code></a> except
that if a new <a class="link" href="glib-Quarks.html#GQuark" title="GQuark"><span class="type">GQuark</span></a> is created the string itself is used rather
than a copy. This saves memory, but can only be used if the string
will <span class="emphasis"><em>always</em></span> exist. It can be used with
statically allocated strings in the main program, but not with
statically allocated memory in dynamically loaded modules, if you
expect to ever unload the module again (e.g. do not use this
function in GTK+ theme engines).
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>string</code></em> :</span></p></td>
<td>a string. <span class="annotation">[<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>the <a class="link" href="glib-Quarks.html#GQuark" title="GQuark"><span class="type">GQuark</span></a> identifying the string, or 0 if <em class="parameter"><code>string</code></em> is
<a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a>.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="g-quark-to-string"></a><h3>g_quark_to_string ()</h3>
<pre class="programlisting">const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> * g_quark_to_string (<em class="parameter"><code><a class="link" href="glib-Quarks.html#GQuark" title="GQuark"><span class="type">GQuark</span></a> quark</code></em>);</pre>
<p>
Gets the string associated with the given <a class="link" href="glib-Quarks.html#GQuark" title="GQuark"><span class="type">GQuark</span></a>.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>quark</code></em> :</span></p></td>
<td>a <a class="link" href="glib-Quarks.html#GQuark" title="GQuark"><span class="type">GQuark</span></a>.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>the string associated with the <a class="link" href="glib-Quarks.html#GQuark" title="GQuark"><span class="type">GQuark</span></a>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="g-quark-try-string"></a><h3>g_quark_try_string ()</h3>
<pre class="programlisting"><a class="link" href="glib-Quarks.html#GQuark" title="GQuark"><span class="returnvalue">GQuark</span></a> g_quark_try_string (<em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *string</code></em>);</pre>
<p>
Gets the <a class="link" href="glib-Quarks.html#GQuark" title="GQuark"><span class="type">GQuark</span></a> associated with the given string, or 0 if string is
<a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a> or it has no associated <a class="link" href="glib-Quarks.html#GQuark" title="GQuark"><span class="type">GQuark</span></a>.
</p>
<p>
If you want the GQuark to be created if it doesn't already exist,
use <a class="link" href="glib-Quarks.html#g-quark-from-string" title="g_quark_from_string ()"><code class="function">g_quark_from_string()</code></a> or <a class="link" href="glib-Quarks.html#g-quark-from-static-string" title="g_quark_from_static_string ()"><code class="function">g_quark_from_static_string()</code></a>.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>string</code></em> :</span></p></td>
<td>a string. <span class="annotation">[<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>the <a class="link" href="glib-Quarks.html#GQuark" title="GQuark"><span class="type">GQuark</span></a> associated with the string, or 0 if <em class="parameter"><code>string</code></em> is
<a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a> or there is no <a class="link" href="glib-Quarks.html#GQuark" title="GQuark"><span class="type">GQuark</span></a> associated with it.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="g-intern-string"></a><h3>g_intern_string ()</h3>
<pre class="programlisting">const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> * g_intern_string (<em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *string</code></em>);</pre>
<p>
Returns a canonical representation for <em class="parameter"><code>string</code></em>. Interned strings
can be compared for equality by comparing the pointers, instead of
using <code class="function">strcmp()</code>.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>string</code></em> :</span></p></td>
<td>a string. <span class="annotation">[<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>a canonical representation for the string</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.10</p>
</div>
<hr>
<div class="refsect2">
<a name="g-intern-static-string"></a><h3>g_intern_static_string ()</h3>
<pre class="programlisting">const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> * g_intern_static_string (<em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *string</code></em>);</pre>
<p>
Returns a canonical representation for <em class="parameter"><code>string</code></em>. Interned strings
can be compared for equality by comparing the pointers, instead of
using <code class="function">strcmp()</code>. <a class="link" href="glib-Quarks.html#g-intern-static-string" title="g_intern_static_string ()"><code class="function">g_intern_static_string()</code></a> does not copy the string,
therefore <em class="parameter"><code>string</code></em> must not be freed or modified.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>string</code></em> :</span></p></td>
<td>a static string. <span class="annotation">[<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>a canonical representation for the string</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.10</p>
</div>
</div>
</div>
<div class="footer">
<hr>
Generated by GTK-Doc V1.18</div>
</body>
</html>
|
{
"content_hash": "99df2361d1485f2ae84229e45f9e4206",
"timestamp": "",
"source": "github",
"line_count": 311,
"max_line_length": 421,
"avg_line_length": 62.02893890675241,
"alnum_prop": 0.6747187807786014,
"repo_name": "jonnyniv/boost_converter",
"id": "841280220561250494eb3557e832be87b12847ab",
"size": "19309",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "host/gui/GTK+/share/gtk-doc/html/glib/glib-Quarks.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "6868671"
},
{
"name": "C++",
"bytes": "299318"
},
{
"name": "CSS",
"bytes": "88298"
},
{
"name": "Objective-C",
"bytes": "101093"
},
{
"name": "Python",
"bytes": "263072"
},
{
"name": "Shell",
"bytes": "20030"
},
{
"name": "XSLT",
"bytes": "7232"
}
]
}
|
<?xml version="1.0" encoding="UTF-8"?>
<!--
#%L
jambeth-test
%%
Copyright (C) 2017 Koch Softwaredevelopment
%%
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
#L%
-->
<entity-mappings xmlns="http://schema.kochdev.com/ambeth/ambeth_orm_1_2">
<entity class="com.koch.ambeth.model.BlobObject">
<table name="BLOB_OBJECT" />
<attributes>
<basic name="Content" />
</attributes>
</entity>
</entity-mappings>
|
{
"content_hash": "7e0c18f40ed31a9fba8b54be6af9fedb",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 73,
"avg_line_length": 29.322580645161292,
"alnum_prop": 0.7260726072607261,
"repo_name": "Dennis-Koch/ambeth",
"id": "ac0d91a74e61b51296d58bdf680fcb789e268938",
"size": "909",
"binary": false,
"copies": "1",
"ref": "refs/heads/develop",
"path": "jambeth/jambeth-test/src/test/java/com/koch/ambeth/persistence/jdbc/lob/blob_orm.xml",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ASP",
"bytes": "2866"
},
{
"name": "Batchfile",
"bytes": "3505"
},
{
"name": "C#",
"bytes": "4180068"
},
{
"name": "HTML",
"bytes": "2889"
},
{
"name": "Java",
"bytes": "8556639"
},
{
"name": "PLSQL",
"bytes": "11227"
}
]
}
|
<?xml version="1.0" encoding="UTF-8"?>
<shortcuts>
<shortcut>
<label>20386</label>
<label2>32014</label2>
<icon>DefaultRecentlyAddedMovies.png</icon>
<thumb />
<action>ActivateWindow(Videos,videodb://recentlyaddedmovies/,return)</action>
</shortcut>
<shortcut>
<label>20434</label>
<label2>342</label2>
<icon>DefaultSets.png</icon>
<thumb />
<action>ActivateWindow(Videos,videodb://movies/sets/,return)</action>
</shortcut>
<shortcut>
<label>369</label>
<label2>342</label2>
<icon>DefaultMovieTitle.png</icon>
<thumb />
<action>ActivateWindow(Videos,videodb://movies/titles/,return)</action>
</shortcut>
<shortcut>
<label>135</label>
<label2>342</label2>
<icon>DefaultGenre.png</icon>
<thumb />
<action>ActivateWindow(Videos,videodb://movies/genres/,return)</action>
</shortcut>
<shortcut>
<label>562</label>
<label2>342</label2>
<icon>DefaultYear.png</icon>
<thumb />
<action>ActivateWindow(Videos,videodb://movies/years/,return)</action>
</shortcut>
<shortcut>
<label>344</label>
<label2>342</label2>
<icon>DefaultActor.png</icon>
<thumb />
<action>ActivateWindow(Videos,videodb://movies/actors/,return)</action>
</shortcut>
</shortcuts>
|
{
"content_hash": "4997634763cceea26b3e7ed557b130e2",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 79,
"avg_line_length": 26.933333333333334,
"alnum_prop": 0.6955445544554455,
"repo_name": "aplicatii-romanesti/allinclusive-kodi-pi",
"id": "467961681aa4704584889b7885827872056de1c1",
"size": "1212",
"binary": false,
"copies": "25",
"ref": "refs/heads/master",
"path": ".kodi/addons/script.skinshortcuts/resources/shortcuts/movies.DATA.xml",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Perl",
"bytes": "6178"
},
{
"name": "Python",
"bytes": "8657978"
},
{
"name": "Shell",
"bytes": "198"
}
]
}
|
from indico.core.db import db
from indico.util.string import return_ascii
class Photo(db.Model):
__tablename__ = 'photos'
__table_args__ = {'schema': 'roombooking'}
id = db.Column(
db.Integer,
primary_key=True
)
data = db.Column(
db.LargeBinary,
nullable=True
)
# relationship backrefs:
# - room (Room.photo)
@return_ascii
def __repr__(self):
return u'<Photo({0})>'.format(self.id)
|
{
"content_hash": "2390081462b1f5ad3f4e5e1b4858c25e",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 46,
"avg_line_length": 20.304347826086957,
"alnum_prop": 0.576017130620985,
"repo_name": "mic4ael/indico",
"id": "15d64bb9d3ba6151413a42d6dedf6c92136c7fe0",
"size": "681",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "indico/modules/rb/models/photos.py",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "553825"
},
{
"name": "HTML",
"bytes": "1375160"
},
{
"name": "JavaScript",
"bytes": "1852830"
},
{
"name": "Mako",
"bytes": "1340"
},
{
"name": "Python",
"bytes": "4612709"
},
{
"name": "Shell",
"bytes": "2665"
},
{
"name": "TeX",
"bytes": "23292"
},
{
"name": "XSLT",
"bytes": "1504"
}
]
}
|
import time
import msgpack
VALID_IDENTIFIER_SET = set(list('abcdefghijklmnopqrstuvwxyz0123456789_-'))
def is_valid_identifier(identifier):
"""Checks if the given identifier is valid or not. A valid
identifier may consists of the following characters with a
maximum length of 100 characters, minimum of 1 character.
Valid characters for an identifier,
- A to Z
- a to z
- 0 to 9
- _ (underscore)
- - (hypen)
"""
if not isinstance(identifier, basestring):
return False
if len(identifier) > 100 or len(identifier) < 1:
return False
condensed_form = set(list(identifier.lower()))
return condensed_form.issubset(VALID_IDENTIFIER_SET)
def is_valid_interval(interval):
"""Checks if the given interval is valid. A valid interval
is always a positive, non-zero integer value.
"""
if not isinstance(interval, (int, long)):
return False
if interval <= 0:
return False
return True
def is_valid_requeue_limit(requeue_limit):
"""Checks if the given requeue limit is valid.
A valid requeue limit is always greater than
or equal to -1.
"""
if not isinstance(requeue_limit, (int, long)):
return False
if requeue_limit <= -2:
return False
return True
def serialize_payload(payload):
"""Tries to serialize the payload using msgpack. If it is
not serializable, raises a TypeError.
"""
return msgpack.packb(payload)
def deserialize_payload(payload):
"""Tries to deserialize the payload using msgpack.
"""
return msgpack.unpackb(payload)
def generate_epoch():
"""Generates an unix epoch in ms.
"""
return int(time.time() * 1000)
|
{
"content_hash": "2426ce56b2eda18f36987e56810015f4",
"timestamp": "",
"source": "github",
"line_count": 72,
"max_line_length": 74,
"avg_line_length": 24.208333333333332,
"alnum_prop": 0.6551921973608721,
"repo_name": "phalgun/sharq",
"id": "d3cbc1601e2628492af0ecc8529e4d4bfd2791df",
"size": "1829",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "sharq/utils.py",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Lua",
"bytes": "12521"
},
{
"name": "Makefile",
"bytes": "354"
},
{
"name": "Python",
"bytes": "117710"
}
]
}
|
End of preview.
No dataset card yet
- Downloads last month
- 3