Dataset Preview
Duplicate
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:    TypeError
Message:      Couldn't cast array of type
struct<content_hash: string, timestamp: string, source: string, line_count: int64, max_line_length: int64, avg_line_length: double, alnum_prop: double, repo_name: string, id: string, size: string, binary: bool, copies: string, ref: string, path: string, mode: string, license: string, language: list<item: struct<name: string, bytes: string>>, symlink_target: string>
to
{'content_hash': Value(dtype='string', id=None), 'timestamp': Value(dtype='string', id=None), 'source': Value(dtype='string', id=None), 'line_count': Value(dtype='int64', id=None), 'max_line_length': Value(dtype='int64', id=None), 'avg_line_length': Value(dtype='float64', id=None), 'alnum_prop': Value(dtype='float64', id=None), 'repo_name': Value(dtype='string', id=None), 'id': Value(dtype='string', id=None), 'size': Value(dtype='string', id=None), 'binary': Value(dtype='bool', id=None), 'copies': Value(dtype='string', id=None), 'ref': Value(dtype='string', id=None), 'path': Value(dtype='string', id=None), 'mode': Value(dtype='string', id=None), 'license': Value(dtype='string', id=None), 'language': [{'name': Value(dtype='string', id=None), 'bytes': Value(dtype='string', id=None)}]}
Traceback:    Traceback (most recent call last):
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/builder.py", line 2011, in _prepare_split_single
                  writer.write_table(table)
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/arrow_writer.py", line 585, in write_table
                  pa_table = table_cast(pa_table, self._schema)
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/table.py", line 2302, in table_cast
                  return cast_table_to_schema(table, schema)
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/table.py", line 2261, in cast_table_to_schema
                  arrays = [cast_array_to_feature(table[name], feature) for name, feature in features.items()]
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/table.py", line 2261, in <listcomp>
                  arrays = [cast_array_to_feature(table[name], feature) for name, feature in features.items()]
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/table.py", line 1802, in wrapper
                  return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks])
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/table.py", line 1802, in <listcomp>
                  return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks])
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/table.py", line 2122, in cast_array_to_feature
                  raise TypeError(f"Couldn't cast array of type\n{_short_str(array.type)}\nto\n{_short_str(feature)}")
              TypeError: Couldn't cast array of type
              struct<content_hash: string, timestamp: string, source: string, line_count: int64, max_line_length: int64, avg_line_length: double, alnum_prop: double, repo_name: string, id: string, size: string, binary: bool, copies: string, ref: string, path: string, mode: string, license: string, language: list<item: struct<name: string, bytes: string>>, symlink_target: string>
              to
              {'content_hash': Value(dtype='string', id=None), 'timestamp': Value(dtype='string', id=None), 'source': Value(dtype='string', id=None), 'line_count': Value(dtype='int64', id=None), 'max_line_length': Value(dtype='int64', id=None), 'avg_line_length': Value(dtype='float64', id=None), 'alnum_prop': Value(dtype='float64', id=None), 'repo_name': Value(dtype='string', id=None), 'id': Value(dtype='string', id=None), 'size': Value(dtype='string', id=None), 'binary': Value(dtype='bool', id=None), 'copies': Value(dtype='string', id=None), 'ref': Value(dtype='string', id=None), 'path': Value(dtype='string', id=None), 'mode': Value(dtype='string', id=None), 'license': Value(dtype='string', id=None), 'language': [{'name': Value(dtype='string', id=None), 'bytes': Value(dtype='string', id=None)}]}
              
              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 dataset

Need 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
An Instagram like share sheet for anything you copy ![alt tag](https://raw.githubusercontent.com/mikemilla/copyshare/master/screen_shot_1.png) ![alt tag](https://raw.githubusercontent.com/mikemilla/copyshare/master/screen_shot_2.png) ![alt tag](https://raw.githubusercontent.com/mikemilla/copyshare/master/screen_shot_3.png) ## Download https://play.google.com/store/apps/details?id=com.mikemilla.copyshare ## Contact Michael Miller - mail@mikemilla.com - http://mikemilla.com - https://dribbble.com/mikemilla ## License Code released under [the MIT license](http://choosealicense.com/licenses/mit/)
{ "content_hash": "abdece35ff9c013f02a5155c6a6240de", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 90, "avg_line_length": 26.52173913043478, "alnum_prop": 0.7704918032786885, "repo_name": "mikemilla/copyshare", "id": "6e35060cbad4358d3b5dbf6a1b30e95651b0787c", "size": "623", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "README.md", "mode": "33188", "license": "mit", "language": [ { "name": "Java", "bytes": "88484" } ] }
#define IKS_SUCCESS 0 //caso não houver nenhum tipo de erro /* Verificação de declarações */ #define IKS_ERROR_UNDECLARED 1 //identificador não declarado #define IKS_ERROR_DECLARED 2 //identificador já declarado /* Uso correto de identificadores */ #define IKS_ERROR_VARIABLE 3 //identificador deve ser utilizado como variável #define IKS_ERROR_VECTOR 4 //identificador deve ser utilizado como vetor #define IKS_ERROR_FUNCTION 5 //identificador deve ser utilizado como função /* Tipos e tamanho de dados */ #define IKS_ERROR_WRONG_TYPE 6 //tipos incompatíveis #define IKS_ERROR_STRING_TO_X 7 //coerção impossível do tipo string #define IKS_ERROR_CHAR_TO_X 8 //coerção impossível do tipo char /* Argumentos e parâmetros */ #define IKS_ERROR_MISSING_ARGS 9 //faltam argumentos #define IKS_ERROR_EXCESS_ARGS 10 //sobram argumentos #define IKS_ERROR_WRONG_TYPE_ARGS 11 //argumentos incompatíveis /* Verificação de tipos em comandos */ #define IKS_ERROR_WRONG_PAR_INPUT 12 //parâmetro não é identificador #define IKS_ERROR_WRONG_PAR_OUTPUT 13 //parâmetro não é literal string ou expressão #define IKS_ERROR_WRONG_PAR_RETURN 14 //parâmetro não é expressão compatível com tipo do retorno
{ "content_hash": "4ce7e665930389a8c867464fc657d2f8", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 96, "avg_line_length": 49.04, "alnum_prop": 0.7569331158238173, "repo_name": "lgkern/MyLittleCompiler", "id": "7ef57c1d6ebe95bdd81426fffe19eb809872f26d", "size": "1259", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "tests/e4/input/errors.h", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "70080" }, { "name": "CMake", "bytes": "2162" }, { "name": "Lex", "bytes": "2470" }, { "name": "Perl", "bytes": "67438" }, { "name": "Python", "bytes": "14230" }, { "name": "Shell", "bytes": "8307" }, { "name": "Yacc", "bytes": "16212" } ] }
import React from 'react'; import cx from 'classnames'; import withStyles from 'isomorphic-style-loader/lib/withStyles'; import s from './Navigation.css'; import Link from '../Link'; import { connect } from 'react-redux'; class Navigation extends React.Component { render() { const { username } = this.props; return username ? ( <div className={s.root} role="navigation"> <Link className={s.link} to="/">Home</Link> <Link className={s.link} to="/recentwins">Recent Wins</Link> <Link className={s.link} to="/yourwins">Your Winboard</Link> <Link className={s.link} to="/profile"><i className="fa fa-cog fa-fw" aria-hidden="true"></i></Link> <a className={s.link} href="/logout"><i className="fa fa-sign-out fa-fw" aria-hidden="true"></i></a> </div> ) : ( <div className={s.root} role="navigation"> <Link className={s.link} to="/login">Log in</Link> <span className={s.spacer}>or</span> <Link className={cx(s.link, s.highlight)} to="/register">Sign up</Link> </div> ) } } function mapStateToProps(state) { if(state.user){ return { username: state.user.email } } return {} } export default connect(mapStateToProps)(withStyles(s)(Navigation));
{ "content_hash": "cfae97be3bca71e037739f8286244b2a", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 112, "avg_line_length": 30.333333333333332, "alnum_prop": 0.6271585557299842, "repo_name": "zsu13579/pinterest-apollo", "id": "be85eb4105c21bdf8bdd48587c8ec227ad54d439", "size": "1538", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/components/Navigation/Navigation.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "17238" }, { "name": "JavaScript", "bytes": "102923" } ] }
<?xml version="1.0" encoding="utf-8"?> <!-- ~ Copyright (C) 2020 The Dagger Authors. ~ ~ 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. --> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="dagger.hilt.android.simple.feature"> <application> <activity android:name=".FeatureActivity" android:theme="@style/Theme.AppCompat.Light" android:exported="true"/> </application> </manifest>
{ "content_hash": "bf512e2d87255997c50654dced1be419", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 76, "avg_line_length": 37.11538461538461, "alnum_prop": 0.7046632124352331, "repo_name": "dushmis/dagger", "id": "fe583e5514a962516dc8931cfba8bfb9996b022e", "size": "965", "binary": false, "copies": "4", "ref": "refs/heads/master", "path": "javatests/artifacts/hilt-android/simple/feature/src/main/AndroidManifest.xml", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "1289133" }, { "name": "Shell", "bytes": "2962" } ] }
package servicemap // Copyright (c) Microsoft and contributors. All rights reserved. // // 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. // // Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. import ( "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" "github.com/Azure/go-autorest/autorest/date" "github.com/Azure/go-autorest/autorest/validation" "net/http" ) // MachinesClient is the service Map API Reference type MachinesClient struct { ManagementClient } // NewMachinesClient creates an instance of the MachinesClient client. func NewMachinesClient(subscriptionID string) MachinesClient { return NewMachinesClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewMachinesClientWithBaseURI creates an instance of the MachinesClient // client. func NewMachinesClientWithBaseURI(baseURI string, subscriptionID string) MachinesClient { return MachinesClient{NewWithBaseURI(baseURI, subscriptionID)} } // Get returns the specified machine. // // resourceGroupName is resource group name within the specified // subscriptionId. workspaceName is oMS workspace containing the resources of // interest. machineName is machine resource name. timestamp is uTC date and // time specifying a time instance relative to which to evaluate the machine // resource. When not specified, the service uses DateTime.UtcNow. func (client MachinesClient) Get(resourceGroupName string, workspaceName string, machineName string, timestamp *date.Time) (result Machine, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 64, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `[a-zA-Z0-9_-]+`, Chain: nil}}}, {TargetValue: workspaceName, Constraints: []validation.Constraint{{Target: "workspaceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, {Target: "workspaceName", Name: validation.MinLength, Rule: 3, Chain: nil}, {Target: "workspaceName", Name: validation.Pattern, Rule: `[a-zA-Z0-9_][a-zA-Z0-9_-]+[a-zA-Z0-9_]`, Chain: nil}}}, {TargetValue: machineName, Constraints: []validation.Constraint{{Target: "machineName", Name: validation.MaxLength, Rule: 64, Chain: nil}, {Target: "machineName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { return result, validation.NewErrorWithValidationError(err, "servicemap.MachinesClient", "Get") } req, err := client.GetPreparer(resourceGroupName, workspaceName, machineName, timestamp) if err != nil { err = autorest.NewErrorWithError(err, "servicemap.MachinesClient", "Get", nil, "Failure preparing request") return } resp, err := client.GetSender(req) if err != nil { result.Response = autorest.Response{Response: resp} err = autorest.NewErrorWithError(err, "servicemap.MachinesClient", "Get", resp, "Failure sending request") return } result, err = client.GetResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "servicemap.MachinesClient", "Get", resp, "Failure responding to request") } return } // GetPreparer prepares the Get request. func (client MachinesClient) GetPreparer(resourceGroupName string, workspaceName string, machineName string, timestamp *date.Time) (*http.Request, error) { pathParameters := map[string]interface{}{ "machineName": autorest.Encode("path", machineName), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), "workspaceName": autorest.Encode("path", workspaceName), } const APIVersion = "2015-11-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } if timestamp != nil { queryParameters["timestamp"] = autorest.Encode("query", *timestamp) } preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/features/serviceMap/machines/{machineName}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare(&http.Request{}) } // GetSender sends the Get request. The method will close the // http.Response Body if it receives an error. func (client MachinesClient) GetSender(req *http.Request) (*http.Response, error) { return autorest.SendWithSender(client, req) } // GetResponder handles the response to the Get request. The method always // closes the http.Response Body. func (client MachinesClient) GetResponder(resp *http.Response) (result Machine, err error) { err = autorest.Respond( resp, client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } // GetLiveness obtains the liveness status of the machine during the specified // time interval. // // resourceGroupName is resource group name within the specified // subscriptionId. workspaceName is oMS workspace containing the resources of // interest. machineName is machine resource name. startTime is uTC date and // time specifying the start time of an interval. When not specified the // service uses DateTime.UtcNow - 10m endTime is uTC date and time specifying // the end time of an interval. When not specified the service uses // DateTime.UtcNow func (client MachinesClient) GetLiveness(resourceGroupName string, workspaceName string, machineName string, startTime *date.Time, endTime *date.Time) (result Liveness, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 64, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `[a-zA-Z0-9_-]+`, Chain: nil}}}, {TargetValue: workspaceName, Constraints: []validation.Constraint{{Target: "workspaceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, {Target: "workspaceName", Name: validation.MinLength, Rule: 3, Chain: nil}, {Target: "workspaceName", Name: validation.Pattern, Rule: `[a-zA-Z0-9_][a-zA-Z0-9_-]+[a-zA-Z0-9_]`, Chain: nil}}}, {TargetValue: machineName, Constraints: []validation.Constraint{{Target: "machineName", Name: validation.MaxLength, Rule: 64, Chain: nil}, {Target: "machineName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { return result, validation.NewErrorWithValidationError(err, "servicemap.MachinesClient", "GetLiveness") } req, err := client.GetLivenessPreparer(resourceGroupName, workspaceName, machineName, startTime, endTime) if err != nil { err = autorest.NewErrorWithError(err, "servicemap.MachinesClient", "GetLiveness", nil, "Failure preparing request") return } resp, err := client.GetLivenessSender(req) if err != nil { result.Response = autorest.Response{Response: resp} err = autorest.NewErrorWithError(err, "servicemap.MachinesClient", "GetLiveness", resp, "Failure sending request") return } result, err = client.GetLivenessResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "servicemap.MachinesClient", "GetLiveness", resp, "Failure responding to request") } return } // GetLivenessPreparer prepares the GetLiveness request. func (client MachinesClient) GetLivenessPreparer(resourceGroupName string, workspaceName string, machineName string, startTime *date.Time, endTime *date.Time) (*http.Request, error) { pathParameters := map[string]interface{}{ "machineName": autorest.Encode("path", machineName), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), "workspaceName": autorest.Encode("path", workspaceName), } const APIVersion = "2015-11-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } if startTime != nil { queryParameters["startTime"] = autorest.Encode("query", *startTime) } if endTime != nil { queryParameters["endTime"] = autorest.Encode("query", *endTime) } preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/features/serviceMap/machines/{machineName}/liveness", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare(&http.Request{}) } // GetLivenessSender sends the GetLiveness request. The method will close the // http.Response Body if it receives an error. func (client MachinesClient) GetLivenessSender(req *http.Request) (*http.Response, error) { return autorest.SendWithSender(client, req) } // GetLivenessResponder handles the response to the GetLiveness request. The method always // closes the http.Response Body. func (client MachinesClient) GetLivenessResponder(resp *http.Response) (result Liveness, err error) { err = autorest.Respond( resp, client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } // ListByWorkspace returns a collection of machines matching the specified // conditions. The returned collection represents either machines that are // active/live during the specified interval of time (`live=true` and // `startTime`/`endTime` are specified) or that are known to have existed at or // some time prior to the specified point in time (`live=false` and `timestamp` // is specified). // // resourceGroupName is resource group name within the specified // subscriptionId. workspaceName is oMS workspace containing the resources of // interest. live is specifies whether to return live resources (true) or // inventory resources (false). Defaults to **true**. When retrieving live // resources, the start time (`startTime`) and end time (`endTime`) of the // desired interval should be included. When retrieving inventory resources, an // optional timestamp (`timestamp`) parameter can be specified to return the // version of each resource closest (not-after) that timestamp. startTime is // uTC date and time specifying the start time of an interval. When not // specified the service uses DateTime.UtcNow - 10m endTime is uTC date and // time specifying the end time of an interval. When not specified the service // uses DateTime.UtcNow timestamp is uTC date and time specifying a time // instance relative to which to evaluate each machine resource. Only applies // when `live=false`. When not specified, the service uses DateTime.UtcNow. top // is page size to use. When not specified, the default page size is 100 // records. func (client MachinesClient) ListByWorkspace(resourceGroupName string, workspaceName string, live *bool, startTime *date.Time, endTime *date.Time, timestamp *date.Time, top *int32) (result MachineCollection, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 64, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `[a-zA-Z0-9_-]+`, Chain: nil}}}, {TargetValue: workspaceName, Constraints: []validation.Constraint{{Target: "workspaceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, {Target: "workspaceName", Name: validation.MinLength, Rule: 3, Chain: nil}, {Target: "workspaceName", Name: validation.Pattern, Rule: `[a-zA-Z0-9_][a-zA-Z0-9_-]+[a-zA-Z0-9_]`, Chain: nil}}}, {TargetValue: top, Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMaximum, Rule: 200, Chain: nil}, {Target: "top", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewErrorWithValidationError(err, "servicemap.MachinesClient", "ListByWorkspace") } req, err := client.ListByWorkspacePreparer(resourceGroupName, workspaceName, live, startTime, endTime, timestamp, top) if err != nil { err = autorest.NewErrorWithError(err, "servicemap.MachinesClient", "ListByWorkspace", nil, "Failure preparing request") return } resp, err := client.ListByWorkspaceSender(req) if err != nil { result.Response = autorest.Response{Response: resp} err = autorest.NewErrorWithError(err, "servicemap.MachinesClient", "ListByWorkspace", resp, "Failure sending request") return } result, err = client.ListByWorkspaceResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "servicemap.MachinesClient", "ListByWorkspace", resp, "Failure responding to request") } return } // ListByWorkspacePreparer prepares the ListByWorkspace request. func (client MachinesClient) ListByWorkspacePreparer(resourceGroupName string, workspaceName string, live *bool, startTime *date.Time, endTime *date.Time, timestamp *date.Time, top *int32) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), "workspaceName": autorest.Encode("path", workspaceName), } const APIVersion = "2015-11-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } if live != nil { queryParameters["live"] = autorest.Encode("query", *live) } if startTime != nil { queryParameters["startTime"] = autorest.Encode("query", *startTime) } if endTime != nil { queryParameters["endTime"] = autorest.Encode("query", *endTime) } if timestamp != nil { queryParameters["timestamp"] = autorest.Encode("query", *timestamp) } if top != nil { queryParameters["$top"] = autorest.Encode("query", *top) } preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/features/serviceMap/machines", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare(&http.Request{}) } // ListByWorkspaceSender sends the ListByWorkspace request. The method will close the // http.Response Body if it receives an error. func (client MachinesClient) ListByWorkspaceSender(req *http.Request) (*http.Response, error) { return autorest.SendWithSender(client, req) } // ListByWorkspaceResponder handles the response to the ListByWorkspace request. The method always // closes the http.Response Body. func (client MachinesClient) ListByWorkspaceResponder(resp *http.Response) (result MachineCollection, err error) { err = autorest.Respond( resp, client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } // ListByWorkspaceNextResults retrieves the next set of results, if any. func (client MachinesClient) ListByWorkspaceNextResults(lastResults MachineCollection) (result MachineCollection, err error) { req, err := lastResults.MachineCollectionPreparer() if err != nil { return result, autorest.NewErrorWithError(err, "servicemap.MachinesClient", "ListByWorkspace", nil, "Failure preparing next results request") } if req == nil { return } resp, err := client.ListByWorkspaceSender(req) if err != nil { result.Response = autorest.Response{Response: resp} return result, autorest.NewErrorWithError(err, "servicemap.MachinesClient", "ListByWorkspace", resp, "Failure sending next results request") } result, err = client.ListByWorkspaceResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "servicemap.MachinesClient", "ListByWorkspace", resp, "Failure responding to next results request") } return } // ListConnections returns a collection of connections terminating or // originating at the specified machine // // resourceGroupName is resource group name within the specified // subscriptionId. workspaceName is oMS workspace containing the resources of // interest. machineName is machine resource name. startTime is uTC date and // time specifying the start time of an interval. When not specified the // service uses DateTime.UtcNow - 10m endTime is uTC date and time specifying // the end time of an interval. When not specified the service uses // DateTime.UtcNow func (client MachinesClient) ListConnections(resourceGroupName string, workspaceName string, machineName string, startTime *date.Time, endTime *date.Time) (result ConnectionCollection, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 64, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `[a-zA-Z0-9_-]+`, Chain: nil}}}, {TargetValue: workspaceName, Constraints: []validation.Constraint{{Target: "workspaceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, {Target: "workspaceName", Name: validation.MinLength, Rule: 3, Chain: nil}, {Target: "workspaceName", Name: validation.Pattern, Rule: `[a-zA-Z0-9_][a-zA-Z0-9_-]+[a-zA-Z0-9_]`, Chain: nil}}}, {TargetValue: machineName, Constraints: []validation.Constraint{{Target: "machineName", Name: validation.MaxLength, Rule: 64, Chain: nil}, {Target: "machineName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { return result, validation.NewErrorWithValidationError(err, "servicemap.MachinesClient", "ListConnections") } req, err := client.ListConnectionsPreparer(resourceGroupName, workspaceName, machineName, startTime, endTime) if err != nil { err = autorest.NewErrorWithError(err, "servicemap.MachinesClient", "ListConnections", nil, "Failure preparing request") return } resp, err := client.ListConnectionsSender(req) if err != nil { result.Response = autorest.Response{Response: resp} err = autorest.NewErrorWithError(err, "servicemap.MachinesClient", "ListConnections", resp, "Failure sending request") return } result, err = client.ListConnectionsResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "servicemap.MachinesClient", "ListConnections", resp, "Failure responding to request") } return } // ListConnectionsPreparer prepares the ListConnections request. func (client MachinesClient) ListConnectionsPreparer(resourceGroupName string, workspaceName string, machineName string, startTime *date.Time, endTime *date.Time) (*http.Request, error) { pathParameters := map[string]interface{}{ "machineName": autorest.Encode("path", machineName), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), "workspaceName": autorest.Encode("path", workspaceName), } const APIVersion = "2015-11-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } if startTime != nil { queryParameters["startTime"] = autorest.Encode("query", *startTime) } if endTime != nil { queryParameters["endTime"] = autorest.Encode("query", *endTime) } preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/features/serviceMap/machines/{machineName}/connections", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare(&http.Request{}) } // ListConnectionsSender sends the ListConnections request. The method will close the // http.Response Body if it receives an error. func (client MachinesClient) ListConnectionsSender(req *http.Request) (*http.Response, error) { return autorest.SendWithSender(client, req) } // ListConnectionsResponder handles the response to the ListConnections request. The method always // closes the http.Response Body. func (client MachinesClient) ListConnectionsResponder(resp *http.Response) (result ConnectionCollection, err error) { err = autorest.Respond( resp, client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } // ListConnectionsNextResults retrieves the next set of results, if any. func (client MachinesClient) ListConnectionsNextResults(lastResults ConnectionCollection) (result ConnectionCollection, err error) { req, err := lastResults.ConnectionCollectionPreparer() if err != nil { return result, autorest.NewErrorWithError(err, "servicemap.MachinesClient", "ListConnections", nil, "Failure preparing next results request") } if req == nil { return } resp, err := client.ListConnectionsSender(req) if err != nil { result.Response = autorest.Response{Response: resp} return result, autorest.NewErrorWithError(err, "servicemap.MachinesClient", "ListConnections", resp, "Failure sending next results request") } result, err = client.ListConnectionsResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "servicemap.MachinesClient", "ListConnections", resp, "Failure responding to next results request") } return } // ListMachineGroupMembership returns a collection of machine groups this // machine belongs to. // // resourceGroupName is resource group name within the specified // subscriptionId. workspaceName is oMS workspace containing the resources of // interest. machineName is machine resource name. func (client MachinesClient) ListMachineGroupMembership(resourceGroupName string, workspaceName string, machineName string) (result MachineGroupCollection, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 64, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `[a-zA-Z0-9_-]+`, Chain: nil}}}, {TargetValue: workspaceName, Constraints: []validation.Constraint{{Target: "workspaceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, {Target: "workspaceName", Name: validation.MinLength, Rule: 3, Chain: nil}, {Target: "workspaceName", Name: validation.Pattern, Rule: `[a-zA-Z0-9_][a-zA-Z0-9_-]+[a-zA-Z0-9_]`, Chain: nil}}}, {TargetValue: machineName, Constraints: []validation.Constraint{{Target: "machineName", Name: validation.MaxLength, Rule: 64, Chain: nil}, {Target: "machineName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { return result, validation.NewErrorWithValidationError(err, "servicemap.MachinesClient", "ListMachineGroupMembership") } req, err := client.ListMachineGroupMembershipPreparer(resourceGroupName, workspaceName, machineName) if err != nil { err = autorest.NewErrorWithError(err, "servicemap.MachinesClient", "ListMachineGroupMembership", nil, "Failure preparing request") return } resp, err := client.ListMachineGroupMembershipSender(req) if err != nil { result.Response = autorest.Response{Response: resp} err = autorest.NewErrorWithError(err, "servicemap.MachinesClient", "ListMachineGroupMembership", resp, "Failure sending request") return } result, err = client.ListMachineGroupMembershipResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "servicemap.MachinesClient", "ListMachineGroupMembership", resp, "Failure responding to request") } return } // ListMachineGroupMembershipPreparer prepares the ListMachineGroupMembership request. func (client MachinesClient) ListMachineGroupMembershipPreparer(resourceGroupName string, workspaceName string, machineName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "machineName": autorest.Encode("path", machineName), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), "workspaceName": autorest.Encode("path", workspaceName), } const APIVersion = "2015-11-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/features/serviceMap/machines/{machineName}/machineGroups", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare(&http.Request{}) } // ListMachineGroupMembershipSender sends the ListMachineGroupMembership request. The method will close the // http.Response Body if it receives an error. func (client MachinesClient) ListMachineGroupMembershipSender(req *http.Request) (*http.Response, error) { return autorest.SendWithSender(client, req) } // ListMachineGroupMembershipResponder handles the response to the ListMachineGroupMembership request. The method always // closes the http.Response Body. func (client MachinesClient) ListMachineGroupMembershipResponder(resp *http.Response) (result MachineGroupCollection, err error) { err = autorest.Respond( resp, client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } // ListMachineGroupMembershipNextResults retrieves the next set of results, if any. func (client MachinesClient) ListMachineGroupMembershipNextResults(lastResults MachineGroupCollection) (result MachineGroupCollection, err error) { req, err := lastResults.MachineGroupCollectionPreparer() if err != nil { return result, autorest.NewErrorWithError(err, "servicemap.MachinesClient", "ListMachineGroupMembership", nil, "Failure preparing next results request") } if req == nil { return } resp, err := client.ListMachineGroupMembershipSender(req) if err != nil { result.Response = autorest.Response{Response: resp} return result, autorest.NewErrorWithError(err, "servicemap.MachinesClient", "ListMachineGroupMembership", resp, "Failure sending next results request") } result, err = client.ListMachineGroupMembershipResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "servicemap.MachinesClient", "ListMachineGroupMembership", resp, "Failure responding to next results request") } return } // ListPorts returns a collection of live ports on the specified machine during // the specified time interval. // // resourceGroupName is resource group name within the specified // subscriptionId. workspaceName is oMS workspace containing the resources of // interest. machineName is machine resource name. startTime is uTC date and // time specifying the start time of an interval. When not specified the // service uses DateTime.UtcNow - 10m endTime is uTC date and time specifying // the end time of an interval. When not specified the service uses // DateTime.UtcNow func (client MachinesClient) ListPorts(resourceGroupName string, workspaceName string, machineName string, startTime *date.Time, endTime *date.Time) (result PortCollection, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 64, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `[a-zA-Z0-9_-]+`, Chain: nil}}}, {TargetValue: workspaceName, Constraints: []validation.Constraint{{Target: "workspaceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, {Target: "workspaceName", Name: validation.MinLength, Rule: 3, Chain: nil}, {Target: "workspaceName", Name: validation.Pattern, Rule: `[a-zA-Z0-9_][a-zA-Z0-9_-]+[a-zA-Z0-9_]`, Chain: nil}}}, {TargetValue: machineName, Constraints: []validation.Constraint{{Target: "machineName", Name: validation.MaxLength, Rule: 64, Chain: nil}, {Target: "machineName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { return result, validation.NewErrorWithValidationError(err, "servicemap.MachinesClient", "ListPorts") } req, err := client.ListPortsPreparer(resourceGroupName, workspaceName, machineName, startTime, endTime) if err != nil { err = autorest.NewErrorWithError(err, "servicemap.MachinesClient", "ListPorts", nil, "Failure preparing request") return } resp, err := client.ListPortsSender(req) if err != nil { result.Response = autorest.Response{Response: resp} err = autorest.NewErrorWithError(err, "servicemap.MachinesClient", "ListPorts", resp, "Failure sending request") return } result, err = client.ListPortsResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "servicemap.MachinesClient", "ListPorts", resp, "Failure responding to request") } return } // ListPortsPreparer prepares the ListPorts request. func (client MachinesClient) ListPortsPreparer(resourceGroupName string, workspaceName string, machineName string, startTime *date.Time, endTime *date.Time) (*http.Request, error) { pathParameters := map[string]interface{}{ "machineName": autorest.Encode("path", machineName), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), "workspaceName": autorest.Encode("path", workspaceName), } const APIVersion = "2015-11-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } if startTime != nil { queryParameters["startTime"] = autorest.Encode("query", *startTime) } if endTime != nil { queryParameters["endTime"] = autorest.Encode("query", *endTime) } preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/features/serviceMap/machines/{machineName}/ports", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare(&http.Request{}) } // ListPortsSender sends the ListPorts request. The method will close the // http.Response Body if it receives an error. func (client MachinesClient) ListPortsSender(req *http.Request) (*http.Response, error) { return autorest.SendWithSender(client, req) } // ListPortsResponder handles the response to the ListPorts request. The method always // closes the http.Response Body. func (client MachinesClient) ListPortsResponder(resp *http.Response) (result PortCollection, err error) { err = autorest.Respond( resp, client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } // ListPortsNextResults retrieves the next set of results, if any. func (client MachinesClient) ListPortsNextResults(lastResults PortCollection) (result PortCollection, err error) { req, err := lastResults.PortCollectionPreparer() if err != nil { return result, autorest.NewErrorWithError(err, "servicemap.MachinesClient", "ListPorts", nil, "Failure preparing next results request") } if req == nil { return } resp, err := client.ListPortsSender(req) if err != nil { result.Response = autorest.Response{Response: resp} return result, autorest.NewErrorWithError(err, "servicemap.MachinesClient", "ListPorts", resp, "Failure sending next results request") } result, err = client.ListPortsResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "servicemap.MachinesClient", "ListPorts", resp, "Failure responding to next results request") } return } // ListProcesses returns a collection of processes on the specified machine // matching the specified conditions. The returned collection represents either // processes that are active/live during the specified interval of time // (`live=true` and `startTime`/`endTime` are specified) or that are known to // have existed at or some time prior to the specified point in time // (`live=false` and `timestamp` is specified). // // resourceGroupName is resource group name within the specified // subscriptionId. workspaceName is oMS workspace containing the resources of // interest. machineName is machine resource name. live is specifies whether to // return live resources (true) or inventory resources (false). Defaults to // **true**. When retrieving live resources, the start time (`startTime`) and // end time (`endTime`) of the desired interval should be included. When // retrieving inventory resources, an optional timestamp (`timestamp`) // parameter can be specified to return the version of each resource closest // (not-after) that timestamp. startTime is uTC date and time specifying the // start time of an interval. When not specified the service uses // DateTime.UtcNow - 10m endTime is uTC date and time specifying the end time // of an interval. When not specified the service uses DateTime.UtcNow // timestamp is uTC date and time specifying a time instance relative to which // to evaluate all process resource. Only applies when `live=false`. When not // specified, the service uses DateTime.UtcNow. func (client MachinesClient) ListProcesses(resourceGroupName string, workspaceName string, machineName string, live *bool, startTime *date.Time, endTime *date.Time, timestamp *date.Time) (result ProcessCollection, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 64, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `[a-zA-Z0-9_-]+`, Chain: nil}}}, {TargetValue: workspaceName, Constraints: []validation.Constraint{{Target: "workspaceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, {Target: "workspaceName", Name: validation.MinLength, Rule: 3, Chain: nil}, {Target: "workspaceName", Name: validation.Pattern, Rule: `[a-zA-Z0-9_][a-zA-Z0-9_-]+[a-zA-Z0-9_]`, Chain: nil}}}, {TargetValue: machineName, Constraints: []validation.Constraint{{Target: "machineName", Name: validation.MaxLength, Rule: 64, Chain: nil}, {Target: "machineName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { return result, validation.NewErrorWithValidationError(err, "servicemap.MachinesClient", "ListProcesses") } req, err := client.ListProcessesPreparer(resourceGroupName, workspaceName, machineName, live, startTime, endTime, timestamp) if err != nil { err = autorest.NewErrorWithError(err, "servicemap.MachinesClient", "ListProcesses", nil, "Failure preparing request") return } resp, err := client.ListProcessesSender(req) if err != nil { result.Response = autorest.Response{Response: resp} err = autorest.NewErrorWithError(err, "servicemap.MachinesClient", "ListProcesses", resp, "Failure sending request") return } result, err = client.ListProcessesResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "servicemap.MachinesClient", "ListProcesses", resp, "Failure responding to request") } return } // ListProcessesPreparer prepares the ListProcesses request. func (client MachinesClient) ListProcessesPreparer(resourceGroupName string, workspaceName string, machineName string, live *bool, startTime *date.Time, endTime *date.Time, timestamp *date.Time) (*http.Request, error) { pathParameters := map[string]interface{}{ "machineName": autorest.Encode("path", machineName), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), "workspaceName": autorest.Encode("path", workspaceName), } const APIVersion = "2015-11-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } if live != nil { queryParameters["live"] = autorest.Encode("query", *live) } if startTime != nil { queryParameters["startTime"] = autorest.Encode("query", *startTime) } if endTime != nil { queryParameters["endTime"] = autorest.Encode("query", *endTime) } if timestamp != nil { queryParameters["timestamp"] = autorest.Encode("query", *timestamp) } preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/features/serviceMap/machines/{machineName}/processes", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare(&http.Request{}) } // ListProcessesSender sends the ListProcesses request. The method will close the // http.Response Body if it receives an error. func (client MachinesClient) ListProcessesSender(req *http.Request) (*http.Response, error) { return autorest.SendWithSender(client, req) } // ListProcessesResponder handles the response to the ListProcesses request. The method always // closes the http.Response Body. func (client MachinesClient) ListProcessesResponder(resp *http.Response) (result ProcessCollection, err error) { err = autorest.Respond( resp, client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } // ListProcessesNextResults retrieves the next set of results, if any. func (client MachinesClient) ListProcessesNextResults(lastResults ProcessCollection) (result ProcessCollection, err error) { req, err := lastResults.ProcessCollectionPreparer() if err != nil { return result, autorest.NewErrorWithError(err, "servicemap.MachinesClient", "ListProcesses", nil, "Failure preparing next results request") } if req == nil { return } resp, err := client.ListProcessesSender(req) if err != nil { result.Response = autorest.Response{Response: resp} return result, autorest.NewErrorWithError(err, "servicemap.MachinesClient", "ListProcesses", resp, "Failure sending next results request") } result, err = client.ListProcessesResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "servicemap.MachinesClient", "ListProcesses", resp, "Failure responding to next results request") } return }
{ "content_hash": "6155a50b45a5d4e4d006eef21ad07d5f", "timestamp": "", "source": "github", "line_count": 846, "max_line_length": 240, "avg_line_length": 47.47872340425532, "alnum_prop": 0.7594791744466851, "repo_name": "apcera/libretto", "id": "ca1fa113f37ca91efbce814b97ce0e2770926550", "size": "40167", "binary": false, "copies": "29", "ref": "refs/heads/master", "path": "vendor/github.com/Azure/azure-sdk-for-go/arm/service-map/machines.go", "mode": "33261", "license": "apache-2.0", "language": [ { "name": "Go", "bytes": "256030" } ] }
import * as tld from 'tldjs'; tld.tldExists('google.com'); // returns `true` tld.tldExists('google.local'); // returns `false` (not an explicit registered TLD) tld.tldExists('com'); // returns `true` tld.tldExists('uk'); // returns `true` tld.tldExists('co.uk'); // returns `true` (because `uk` is a valid TLD) tld.tldExists('amazon.fancy.uk'); // returns `true` (still because `uk` is a valid TLD) tld.tldExists('amazon.co.uk'); // returns `true` (still because `uk` is a valid TLD) tld.tldExists('https://user:password@example.co.uk:8080/some/path?and&query#hash'); // returns `true` tld.getDomain('google.com'); // returns `google.com` tld.getDomain('fr.google.com'); // returns `google.com` tld.getDomain('fr.google.google'); // returns `google.google` tld.getDomain('foo.google.co.uk'); // returns `google.co.uk` tld.getDomain('t.co'); // returns `t.co` tld.getDomain('fr.t.co'); // returns `t.co` tld.getDomain('https://user:password@example.co.uk:8080/some/path?and&query#hash'); // returns `example.co.uk` tld.getSubdomain('google.com'); // returns `` tld.getSubdomain('fr.google.com'); // returns `fr` tld.getSubdomain('google.co.uk'); // returns `` tld.getSubdomain('foo.google.co.uk'); // returns `foo` tld.getSubdomain('moar.foo.google.co.uk'); // returns `moar.foo` tld.getSubdomain('t.co'); // returns `` tld.getSubdomain('fr.t.co'); // returns `fr` tld.getSubdomain('https://user:password@example.co.uk:8080/some/path?and&query#hash'); // returns `` tld.getPublicSuffix('google.com'); // returns `com` tld.getPublicSuffix('fr.google.com'); // returns `com` tld.getPublicSuffix('google.co.uk'); // returns `co.uk` tld.getPublicSuffix('s3.amazonaws.com'); // returns `s3.amazonaws.com` tld.isValidHostname('google.com'); // returns `true` tld.isValidHostname('.google.com'); // returns `false` tld.isValidHostname('my.fake.domain'); // returns `true` tld.isValidHostname('localhost'); // returns `false` tld.isValidHostname('https://user:password@example.co.uk:8080/some/path?and&query#hash'); // returns `true` tld.extractHostname('https://www.npmjs.com/package/tldjs') // returns 'www.npmjs.com' tld.parse('https://spark-public.s3.amazonaws.com/dataanalysis/loansData.csv'); // { hostname: 'spark-public.s3.amazonaws.com', // isValid: true, // isIp: false, // tldExists: true, // publicSuffix: 's3.amazonaws.com', // domain: 'spark-public.s3.amazonaws.com', // subdomain: '' // } tld.parse('gopher://domain.unknown/'); // { hostname: 'domain.unknown', // isValid: true, // isIp: false, // tldExists: false, // publicSuffix: 'unknown', // domain: 'domain.unknown', // subdomain: '' // } tld.parse('https://192.168.0.0') // { hostname: '192.168.0.0', // isValid: true, // isIp: true, // tldExists: false, // publicSuffix: null, // domain: null, // subdomain: null // } tld.getDomain('localhost'); // returns null tld.getSubdomain('vhost.localhost'); // returns null const tld2 = tld.fromUserSettings({ validHosts: ['localhost'] }); tld2.getDomain('localhost'); // returns 'localhost' tld2.getSubdomain('vhost.localhost'); // returns 'vhost'
{ "content_hash": "95da13fbce2f95bb2c8b16969c0a2310", "timestamp": "", "source": "github", "line_count": 78, "max_line_length": 110, "avg_line_length": 40.05128205128205, "alnum_prop": 0.6763764404609475, "repo_name": "mcliment/DefinitelyTyped", "id": "e6eea6e0d6e314048f228239bf45b99dd5140aa6", "size": "3124", "binary": false, "copies": "74", "ref": "refs/heads/master", "path": "types/tldjs/tldjs-tests.ts", "mode": "33188", "license": "mit", "language": [ { "name": "CoffeeScript", "bytes": "15" }, { "name": "Protocol Buffer", "bytes": "678" }, { "name": "TypeScript", "bytes": "17214021" } ] }
Various small tools that I use to make my life easier. Currently contains: * `ftc` - a short script to print all the files in a particular directory + subdirectories which contain a particular string. * `ytsrt.py` - a short program for converting YouTube XML subtitles into SRT format. * `intsum`, `fpsum`, `fpmean` - tiny F77 programs which sum/mean all the numbers from `stdin` and put the output on `stdout`. `intsum` does integer math, `fpsum`/`fpmean` double precision floating point. * `dir` - a shell wrapper to be more like the behaviour of DOS `dir` (WRT pagination, order) than GNU `dir`. * `bt.py` - an extremely basic tool to control Banshee from a console. * `amstrad2unix` - a command-line tool to convert files copied from Amstrad NC series computers to Unix/Linux format. * `unicode_pretty.hy` - a command-line tool to convert ASCII strings into pretty unicode text, e.g. 𝔅𝔩𝔞𝔠𝔨𝔩𝔢𝔱𝔱𝔢𝔯. * `python*-wrapper.sh` - commands to launch a python 2/3 interpreter with the "recommended" environment on UCL RC resources, regardless of python modules loaded. * `fortwrangler`/`fortwrangler.py` - convert non-compliant free format Fortran code to the correct line length. * `ADdate`/`addate.py` - convert Active Directory dates into either text or Unix epochs.
{ "content_hash": "d0b9deba7f6f0d8f0c85f61772e0f5ff", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 205, "avg_line_length": 55.91304347826087, "alnum_prop": 0.7472783825816485, "repo_name": "owainkenwayucl/utils", "id": "e555e7b8c728c0870219e262821b168c75139b9c", "size": "1327", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "README.md", "mode": "33188", "license": "mit", "language": [ { "name": "Fortran", "bytes": "4016" }, { "name": "Hy", "bytes": "7983" }, { "name": "MATLAB", "bytes": "333" }, { "name": "Makefile", "bytes": "296" }, { "name": "Python", "bytes": "14382" }, { "name": "Shell", "bytes": "3756" } ] }
package org.springframework.boot.actuate.autoconfigure; import java.util.Map; import java.util.Properties; import org.junit.After; import org.junit.Test; import org.springframework.boot.actuate.info.BuildInfoContributor; import org.springframework.boot.actuate.info.GitInfoContributor; import org.springframework.boot.actuate.info.Info; import org.springframework.boot.actuate.info.InfoContributor; import org.springframework.boot.info.BuildProperties; import org.springframework.boot.info.GitProperties; import org.springframework.boot.test.util.EnvironmentTestUtils; import org.springframework.context.annotation.AnnotationConfigApplicationContext; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import static org.assertj.core.api.Assertions.assertThat; /** * Tests for {@link InfoContributorAutoConfiguration}. * * @author Stephane Nicoll */ public class InfoContributorAutoConfigurationTests { private AnnotationConfigApplicationContext context; @After public void close() { if (this.context != null) { this.context.close(); } } @Test public void disableEnvContributor() { load("management.info.env.enabled:false"); Map<String, InfoContributor> beans = this.context .getBeansOfType(InfoContributor.class); assertThat(beans).hasSize(0); } @Test public void defaultInfoContributorsDisabled() { load("management.info.defaults.enabled:false"); Map<String, InfoContributor> beans = this.context .getBeansOfType(InfoContributor.class); assertThat(beans).hasSize(0); } @Test public void defaultInfoContributorsDisabledWithCustomOne() { load(CustomInfoContributorConfiguration.class, "management.info.defaults.enabled:false"); Map<String, InfoContributor> beans = this.context .getBeansOfType(InfoContributor.class); assertThat(beans).hasSize(1); assertThat(this.context.getBean("customInfoContributor")) .isSameAs(beans.values().iterator().next()); } @SuppressWarnings("unchecked") @Test public void gitPropertiesDefaultMode() { load(GitPropertiesConfiguration.class); Map<String, InfoContributor> beans = this.context .getBeansOfType(InfoContributor.class); assertThat(beans).containsKeys("gitInfoContributor"); Map<String, Object> content = invokeContributor( this.context.getBean("gitInfoContributor", InfoContributor.class)); Object git = content.get("git"); assertThat(git).isInstanceOf(Map.class); Map<String, Object> gitInfo = (Map<String, Object>) git; assertThat(gitInfo).containsOnlyKeys("branch", "commit"); } @SuppressWarnings("unchecked") @Test public void gitPropertiesFullMode() { load(GitPropertiesConfiguration.class, "management.info.git.mode=full"); Map<String, Object> content = invokeContributor( this.context.getBean("gitInfoContributor", InfoContributor.class)); Object git = content.get("git"); assertThat(git).isInstanceOf(Map.class); Map<String, Object> gitInfo = (Map<String, Object>) git; assertThat(gitInfo).containsOnlyKeys("branch", "commit", "foo"); assertThat(gitInfo.get("foo")).isEqualTo("bar"); } @Test public void customGitInfoContributor() { load(CustomGitInfoContributorConfiguration.class); assertThat(this.context.getBean(GitInfoContributor.class)) .isSameAs(this.context.getBean("customGitInfoContributor")); } @SuppressWarnings("unchecked") @Test public void buildProperties() { load(BuildPropertiesConfiguration.class); Map<String, InfoContributor> beans = this.context .getBeansOfType(InfoContributor.class); assertThat(beans).containsKeys("buildInfoContributor"); Map<String, Object> content = invokeContributor( this.context.getBean("buildInfoContributor", InfoContributor.class)); Object build = content.get("build"); assertThat(build).isInstanceOf(Map.class); Map<String, Object> buildInfo = (Map<String, Object>) build; assertThat(buildInfo).containsOnlyKeys("group", "artifact", "foo"); assertThat(buildInfo.get("foo")).isEqualTo("bar"); } @Test public void customBuildInfoContributor() { load(CustomBuildInfoContributorConfiguration.class); assertThat(this.context.getBean(BuildInfoContributor.class)) .isSameAs(this.context.getBean("customBuildInfoContributor")); } private Map<String, Object> invokeContributor(InfoContributor contributor) { Info.Builder builder = new Info.Builder(); contributor.contribute(builder); return builder.build().getDetails(); } private void load(String... environment) { load(null, environment); } private void load(Class<?> config, String... environment) { AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(); if (config != null) { context.register(config); } context.register(InfoContributorAutoConfiguration.class); EnvironmentTestUtils.addEnvironment(context, environment); context.refresh(); this.context = context; } @Configuration static class GitPropertiesConfiguration { @Bean public GitProperties gitProperties() { Properties properties = new Properties(); properties.put("branch", "master"); properties.put("commit.id", "abcdefg"); properties.put("foo", "bar"); return new GitProperties(properties); } } @Configuration static class BuildPropertiesConfiguration { @Bean public BuildProperties buildProperties() { Properties properties = new Properties(); properties.put("group", "com.example"); properties.put("artifact", "demo"); properties.put("foo", "bar"); return new BuildProperties(properties); } } @Configuration static class CustomInfoContributorConfiguration { @Bean public InfoContributor customInfoContributor() { return new InfoContributor() { @Override public void contribute(Info.Builder builder) { } }; } } @Configuration static class CustomGitInfoContributorConfiguration { @Bean public GitInfoContributor customGitInfoContributor() { return new GitInfoContributor(new GitProperties(new Properties())); } } @Configuration static class CustomBuildInfoContributorConfiguration { @Bean public BuildInfoContributor customBuildInfoContributor() { return new BuildInfoContributor(new BuildProperties(new Properties())); } } }
{ "content_hash": "71c826047a0368a2ebed0fed0fb370dd", "timestamp": "", "source": "github", "line_count": 208, "max_line_length": 88, "avg_line_length": 30.08653846153846, "alnum_prop": 0.763183125599233, "repo_name": "candrews/spring-boot", "id": "881365ec36dda1e7ad8097363d62fe4554ac7c1b", "size": "6878", "binary": false, "copies": "35", "ref": "refs/heads/master", "path": "spring-boot-actuator/src/test/java/org/springframework/boot/actuate/autoconfigure/InfoContributorAutoConfigurationTests.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "6954" }, { "name": "CSS", "bytes": "5769" }, { "name": "FreeMarker", "bytes": "2134" }, { "name": "Groovy", "bytes": "47478" }, { "name": "HTML", "bytes": "74097" }, { "name": "Java", "bytes": "9867993" }, { "name": "JavaScript", "bytes": "37789" }, { "name": "Ruby", "bytes": "1307" }, { "name": "SQLPL", "bytes": "60255" }, { "name": "Shell", "bytes": "21449" }, { "name": "Smarty", "bytes": "3276" }, { "name": "XSLT", "bytes": "34105" } ] }
package org.spongepowered.api.entity.living.animal; import org.spongepowered.api.entity.living.Ageable; /** * Represents an Animal, such as a Cow. */ public interface Animal extends Ageable { }
{ "content_hash": "fd65f139fc17fa07610784cd0bde98fe", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 51, "avg_line_length": 18.181818181818183, "alnum_prop": 0.755, "repo_name": "frogocomics/SpongeAPI", "id": "2cb4c052219e98b523804c212a8d1c5eef56bad5", "size": "1450", "binary": false, "copies": "19", "ref": "refs/heads/master", "path": "src/main/java/org/spongepowered/api/entity/living/animal/Animal.java", "mode": "33188", "license": "mit", "language": [ { "name": "Java", "bytes": "3168083" }, { "name": "Shell", "bytes": "77" } ] }
package org.jetbrains.plugins.groovy.refactoring.introduce.variable; import com.intellij.openapi.help.HelpManager; import com.intellij.openapi.project.Project; import com.intellij.openapi.ui.DialogWrapper; import com.intellij.openapi.ui.ValidationInfo; import com.intellij.psi.PsiType; import com.intellij.refactoring.HelpID; import com.intellij.refactoring.ui.NameSuggestionsField; import com.intellij.util.ui.GridBag; import com.intellij.util.ui.UIUtil; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.jetbrains.plugins.groovy.GroovyFileType; import org.jetbrains.plugins.groovy.lang.psi.api.statements.expressions.GrExpression; import org.jetbrains.plugins.groovy.lang.psi.impl.GroovyNamesUtil; import org.jetbrains.plugins.groovy.refactoring.GroovyRefactoringBundle; import org.jetbrains.plugins.groovy.refactoring.introduce.GrIntroduceContext; import org.jetbrains.plugins.groovy.refactoring.introduce.GrIntroduceDialog; import org.jetbrains.plugins.groovy.refactoring.ui.GrTypeComboBox; import org.jetbrains.plugins.groovy.settings.GroovyApplicationSettings; import javax.swing.*; import java.awt.*; import java.util.LinkedHashSet; public class GroovyIntroduceVariableDialog extends DialogWrapper implements GrIntroduceDialog<GroovyIntroduceVariableSettings> { private static final String REFACTORING_NAME = GroovyRefactoringBundle.message("introduce.variable.title"); private final Project myProject; private final GrExpression myExpression; private final int myOccurrencesCount; private final GrIntroduceVariableHandler.Validator myValidator; private final GrIntroduceContext myContext; private NameSuggestionsField myNameField; private JCheckBox myCbIsFinal; private JCheckBox myCbReplaceAllOccurrences; private GrTypeComboBox myTypeComboBox; public GroovyIntroduceVariableDialog(GrIntroduceContext context, GrIntroduceVariableHandler.Validator validator) { super(context.getProject(), true); myContext = context; myProject = context.getProject(); myExpression = context.getStringPart() != null ? context.getStringPart().getLiteral() : context.getExpression(); myOccurrencesCount = context.getOccurrences().length; myValidator = validator; init(); } @Override protected void init() { super.init(); setModal(true); setTitle(REFACTORING_NAME); myCbReplaceAllOccurrences.setFocusable(false); myCbIsFinal.setFocusable(false); myCbIsFinal.setSelected(GroovyApplicationSettings.getInstance().INTRODUCE_LOCAL_CREATE_FINALS); // Replace occurrences if (myOccurrencesCount > 1) { myCbReplaceAllOccurrences.setSelected(false); myCbReplaceAllOccurrences.setEnabled(true); myCbReplaceAllOccurrences.setText(myCbReplaceAllOccurrences.getText() + " (" + myOccurrencesCount + " occurrences)"); } else { myCbReplaceAllOccurrences.setSelected(false); myCbReplaceAllOccurrences.setEnabled(false); } pack(); } @Override @Nullable protected JComponent createCenterPanel() { JPanel contentPane = new JPanel(new BorderLayout()); contentPane.add(createNamePanel(), BorderLayout.CENTER); contentPane.add(createCBPanel(), BorderLayout.SOUTH); return contentPane; } @Override protected ValidationInfo doValidate() { String text = getEnteredName(); if (!GroovyNamesUtil.isIdentifier(text)) { return new ValidationInfo(GroovyRefactoringBundle.message("name.is.wrong", text), myNameField); } return null; } private JPanel createCBPanel() { final JPanel panel = new JPanel(new FlowLayout()); myCbIsFinal = new JCheckBox(UIUtil.replaceMnemonicAmpersand("Declare &final")); panel.add(myCbIsFinal); myCbReplaceAllOccurrences = new JCheckBox(UIUtil.replaceMnemonicAmpersand("Replace &all occurrences")); panel.add(myCbReplaceAllOccurrences); return panel; } private JPanel createNamePanel() { final GridBag c = new GridBag().setDefaultAnchor(GridBagConstraints.WEST).setDefaultInsets(1, 1, 1, 1); final JPanel namePanel = new JPanel(new GridBagLayout()); final JLabel typeLabel = new JLabel(UIUtil.replaceMnemonicAmpersand("&Type:")); c.nextLine().next().weightx(0).fillCellNone(); namePanel.add(typeLabel, c); myTypeComboBox = GrTypeComboBox.createTypeComboBoxFromExpression(myExpression, GroovyApplicationSettings.getInstance().INTRODUCE_LOCAL_SELECT_DEF); c.next().weightx(1).fillCellHorizontally(); namePanel.add(myTypeComboBox, c); typeLabel.setLabelFor(myTypeComboBox); final JLabel nameLabel = new JLabel(UIUtil.replaceMnemonicAmpersand("&Name:")); c.nextLine().next().weightx(0).fillCellNone(); namePanel.add(nameLabel, c); myNameField = setUpNameComboBox(); c.next().weightx(1).fillCellHorizontally(); namePanel.add(myNameField, c); nameLabel.setLabelFor(myNameField); GrTypeComboBox.registerUpDownHint(myNameField, myTypeComboBox); return namePanel; } @Nullable protected String getEnteredName() { return myNameField.getEnteredName(); } protected boolean isReplaceAllOccurrences() { return myCbReplaceAllOccurrences.isSelected(); } private boolean isDeclareFinal() { return myCbIsFinal.isSelected(); } @Nullable private PsiType getSelectedType() { return myTypeComboBox.getSelectedType(); } private NameSuggestionsField setUpNameComboBox() { LinkedHashSet<String> names = suggestNames(); return new NameSuggestionsField(names.toArray(new String[names.size()]), myProject, GroovyFileType.GROOVY_FILE_TYPE); } @Override public JComponent getPreferredFocusedComponent() { return myNameField; } @Override protected void doOKAction() { if (!myValidator.isOK(this)) { return; } if (myCbIsFinal.isEnabled()) { GroovyApplicationSettings.getInstance().INTRODUCE_LOCAL_CREATE_FINALS = myCbIsFinal.isSelected(); } GroovyApplicationSettings.getInstance().INTRODUCE_LOCAL_SELECT_DEF = (myTypeComboBox.getSelectedType() == null); super.doOKAction(); } @Override protected void doHelpAction() { HelpManager.getInstance().invokeHelp(HelpID.INTRODUCE_VARIABLE); } private void createUIComponents() { } @Override public GroovyIntroduceVariableSettings getSettings() { return new MyGroovyIntroduceVariableSettings(this); } @NotNull @Override public LinkedHashSet<String> suggestNames() { return new GrVariableNameSuggester(myContext, myValidator).suggestNames(); } private static class MyGroovyIntroduceVariableSettings implements GroovyIntroduceVariableSettings { String myEnteredName; boolean myIsReplaceAllOccurrences; boolean myIsDeclareFinal; PsiType mySelectedType; public MyGroovyIntroduceVariableSettings(GroovyIntroduceVariableDialog dialog) { myEnteredName = dialog.getEnteredName(); myIsReplaceAllOccurrences = dialog.isReplaceAllOccurrences(); myIsDeclareFinal = dialog.isDeclareFinal(); mySelectedType = dialog.getSelectedType(); } @Override public String getName() { return myEnteredName; } @Override public boolean replaceAllOccurrences() { return myIsReplaceAllOccurrences; } @Override public boolean isDeclareFinal() { return myIsDeclareFinal; } @Override public PsiType getSelectedType() { return mySelectedType; } } }
{ "content_hash": "cd87f0dcfd7d4d3ee76dd15a89f3199a", "timestamp": "", "source": "github", "line_count": 226, "max_line_length": 151, "avg_line_length": 32.942477876106196, "alnum_prop": 0.7598388179986568, "repo_name": "supersven/intellij-community", "id": "d6b3dc96812639181d4a8fa6b7971ed399b5dfde", "size": "8045", "binary": false, "copies": "54", "ref": "refs/heads/master", "path": "plugins/groovy/src/org/jetbrains/plugins/groovy/refactoring/introduce/variable/GroovyIntroduceVariableDialog.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "AMPL", "bytes": "20665" }, { "name": "AspectJ", "bytes": "182" }, { "name": "Batchfile", "bytes": "63518" }, { "name": "C", "bytes": "214180" }, { "name": "C#", "bytes": "1538" }, { "name": "C++", "bytes": "190455" }, { "name": "CSS", "bytes": "111474" }, { "name": "CoffeeScript", "bytes": "1759" }, { "name": "Cucumber", "bytes": "14382" }, { "name": "Erlang", "bytes": "10" }, { "name": "FLUX", "bytes": "57" }, { "name": "Groff", "bytes": "35232" }, { "name": "Groovy", "bytes": "2246890" }, { "name": "HTML", "bytes": "1728897" }, { "name": "J", "bytes": "5050" }, { "name": "Java", "bytes": "149653469" }, { "name": "JavaScript", "bytes": "125292" }, { "name": "Kotlin", "bytes": "671244" }, { "name": "Lex", "bytes": "166177" }, { "name": "Makefile", "bytes": "2352" }, { "name": "NSIS", "bytes": "86287" }, { "name": "Objective-C", "bytes": "28878" }, { "name": "Perl6", "bytes": "26" }, { "name": "Protocol Buffer", "bytes": "6570" }, { "name": "Python", "bytes": "21469995" }, { "name": "Ruby", "bytes": "1213" }, { "name": "Scala", "bytes": "11698" }, { "name": "Shell", "bytes": "63203" }, { "name": "Smalltalk", "bytes": "64" }, { "name": "TeX", "bytes": "60798" }, { "name": "TypeScript", "bytes": "6152" }, { "name": "XSLT", "bytes": "113040" } ] }
namespace content { class MediaPlayerManagerAndroid; // Native mirror of ContentVideoView.java. This class is responsible for // creating the Java video view and pass all the player status change to // it. It accepts media control from Java class, and forwards it to // MediaPlayerManagerAndroid. class ContentVideoView { public: // Construct a ContentVideoView object. The |manager| will handle all the // playback controls from the Java class. explicit ContentVideoView(MediaPlayerManagerAndroid* manager); ~ContentVideoView(); static bool RegisterContentVideoView(JNIEnv* env); // Getter method called by the Java class to get the media information. int GetVideoWidth(JNIEnv*, jobject obj) const; int GetVideoHeight(JNIEnv*, jobject obj) const; int GetDurationInMilliSeconds(JNIEnv*, jobject obj) const; int GetCurrentPosition(JNIEnv*, jobject obj) const; bool IsPlaying(JNIEnv*, jobject obj); void UpdateMediaMetadata(JNIEnv*, jobject obj); // Method to create and destroy the Java view. void DestroyContentVideoView(); void CreateContentVideoView(); // Called when the Java fullscreen view is destroyed. If // |release_media_player| is true, |manager_| needs to release the player // as we are quitting the app. void ExitFullscreen(JNIEnv*, jobject, jboolean release_media_player); // Media control method called by the Java class. void SeekTo(JNIEnv*, jobject obj, jint msec); void Play(JNIEnv*, jobject obj); void Pause(JNIEnv*, jobject obj); // Called by the Java class to pass the surface object to the player. void SetSurface(JNIEnv*, jobject obj, jobject surface); // Method called by |manager_| to inform the Java class about player status // change. void UpdateMediaMetadata(); void OnMediaPlayerError(int errorType); void OnVideoSizeChanged(int width, int height); void OnBufferingUpdate(int percent); void OnPlaybackComplete(); private: // Object that manages the fullscreen media player. It is responsible for // handling all the playback controls. MediaPlayerManagerAndroid* manager_; // Reference to the Java object. base::android::ScopedJavaGlobalRef<jobject> j_content_video_view_; DISALLOW_COPY_AND_ASSIGN(ContentVideoView); }; } // namespace content #endif // CONTENT_BROWSER_ANDROID_CONTENT_VIDEO_VIEW_H_
{ "content_hash": "587f972531a34d9e34837236648cdf6d", "timestamp": "", "source": "github", "line_count": 64, "max_line_length": 77, "avg_line_length": 36.265625, "alnum_prop": 0.7570012925463162, "repo_name": "plxaye/chromium", "id": "deb5ffc7f11c91edb3a226ab7cf8395c49fec9de", "size": "2787", "binary": false, "copies": "9", "ref": "refs/heads/master", "path": "src/content/browser/android/content_video_view.h", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "ASP", "bytes": "853" }, { "name": "AppleScript", "bytes": "6973" }, { "name": "Arduino", "bytes": "464" }, { "name": "Assembly", "bytes": "1176633" }, { "name": "Awk", "bytes": "9519" }, { "name": "C", "bytes": "75195981" }, { "name": "C#", "bytes": "36335" }, { "name": "C++", "bytes": "172360762" }, { "name": "CSS", "bytes": "740648" }, { "name": "Dart", "bytes": "12620" }, { "name": "Emacs Lisp", "bytes": "12454" }, { "name": "F#", "bytes": "381" }, { "name": "Java", "bytes": "3671513" }, { "name": "JavaScript", "bytes": "16204541" }, { "name": "Max", "bytes": "39069" }, { "name": "Mercury", "bytes": "10299" }, { "name": "Objective-C", "bytes": "1133728" }, { "name": "Objective-C++", "bytes": "5771619" }, { "name": "PHP", "bytes": "97817" }, { "name": "Perl", "bytes": "166372" }, { "name": "Python", "bytes": "11650532" }, { "name": "Ragel in Ruby Host", "bytes": "3641" }, { "name": "Rebol", "bytes": "262" }, { "name": "Ruby", "bytes": "14575" }, { "name": "Shell", "bytes": "1426780" }, { "name": "Tcl", "bytes": "277077" }, { "name": "TeX", "bytes": "43554" }, { "name": "VimL", "bytes": "4953" }, { "name": "XSLT", "bytes": "13493" }, { "name": "nesC", "bytes": "14650" } ] }
/* Tile view of BlobItem */ .cam-blobitem { display: inline-block; } .cam-blobitem>a { text-decoration: none; } .cam-blobitem-thumbclip { position: relative; overflow: hidden; } .cam-blobitem-thumb { display: block; position: relative; } .cam-blobitemcontainer-50 .cam-blobitem-thumbtitle { font-size: 10px; } .cam-blobitemcontainer-75 .cam-blobitem-thumbtitle { font-size: 12px; } .cam-blobitemcontainer-100 .cam-blobitem-thumbtitle { font-size: 12px; } .cam-blobitemcontainer-150 .cam-blobitem-thumbtitle { font-size: 13px; } .cam-blobitemcontainer-200 .cam-blobitem-thumbtitle { font-size: 14px; } .cam-blobitemcontainer-250 .cam-blobitem-thumbtitle { font-size: 14px; } .cam-blobitem-thumbtitle { color: #222; font-size: 0.8em; overflow: hidden; padding: 0 1ex; text-align: center; text-overflow: ellipsis; display: block; } .cam-blobitem.cam-dropactive { border: 1px solid #acf!important; outline: 1px solid #acf!important; background: #e5efff; } .cam-blobitem .checkmark { background-image: url('checkmark-black-25.png'); background-size: 100% 100%; cursor: pointer; height: 25px; left: 5px; opacity: 0; position: absolute; top: 5px; transition: opacity 0.2s ease; width: 25px; } .cam-blobitem.goog-control-disabled .checkmark { display: none; } .cam-blobitem.goog-control-hover .checkmark { opacity: 0.6; } .cam-blobitem.goog-control-hover .checkmark:hover { opacity: 1!important; } .cam-blobitem.goog-control-checked .checkmark { opacity: 1!important; } .cam-blobitem.goog-control-checked .checkmark { background-image: url('checkmark-blue-25.png'); }
{ "content_hash": "ca964abaded87d20ee2d069ab612b441", "timestamp": "", "source": "github", "line_count": 91, "max_line_length": 53, "avg_line_length": 18.142857142857142, "alnum_prop": 0.7044215626892792, "repo_name": "jakubbrzeski/camlistore", "id": "bc72b72903721f9a185ae4d2fcbc717022237a6a", "size": "1651", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "server/camlistored/ui/blob_item.css", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C", "bytes": "217" }, { "name": "C++", "bytes": "5104" }, { "name": "CSS", "bytes": "33508" }, { "name": "Go", "bytes": "4243424" }, { "name": "Java", "bytes": "89497" }, { "name": "JavaScript", "bytes": "1611314" }, { "name": "Objective-C", "bytes": "22253" }, { "name": "Perl", "bytes": "33580" }, { "name": "Python", "bytes": "258905" }, { "name": "Racket", "bytes": "50" }, { "name": "Shell", "bytes": "3732" } ] }
#import <UIKit/UIKit.h> #import <ParseUI/PFImageView.h> /*! The `PFTableViewCell` class represents a table view cell which can download and display remote images stored on Parse. When used in a <PFQueryTableViewController> - downloading and displaying of the remote images are automatically managed by the <PFQueryTableViewController>. */ @interface PFTableViewCell : UITableViewCell /*! @abstract The imageView of the table view cell. @see PFImageView */ @property (nonatomic, strong, readonly) PFImageView *imageView; @end
{ "content_hash": "88447b9fa8dd1ac1c81e094046473b4a", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 119, "avg_line_length": 24.545454545454547, "alnum_prop": 0.7722222222222223, "repo_name": "Bizzi-Body/Parse-2-Bonus", "id": "1d2aa71eea8837218f9392615f6f2e4db581db30", "size": "1648", "binary": false, "copies": "42", "ref": "refs/heads/master", "path": "Parse2/Parse/ParseUI.framework/Headers/PFTableViewCell.h", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "1496" }, { "name": "Objective-C", "bytes": "283478" }, { "name": "Swift", "bytes": "5215" } ] }
namespace MassTransit.Context { using System; using Internals.Reflection; public class CorrelatedBySetCorrelationId<T> : ISetCorrelationId<T> where T : class, CorrelatedBy<Guid> { readonly ReadOnlyProperty<CorrelatedBy<Guid>, Guid> _property; public CorrelatedBySetCorrelationId() { var propertyInfo = typeof(CorrelatedBy<Guid>).GetProperty("CorrelationId"); _property = new ReadOnlyProperty<CorrelatedBy<Guid>, Guid>(propertyInfo); } public void SetCorrelationId(SendContext<T> context) { var message = (CorrelatedBy<Guid>)context.Message; var correlationId = _property.Get(message); if (correlationId != Guid.Empty) context.CorrelationId = correlationId; } } }
{ "content_hash": "6c40cc27e9d771cb7229bef155bb3130", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 87, "avg_line_length": 29.79310344827586, "alnum_prop": 0.6122685185185185, "repo_name": "D3-LucaPiombino/MassTransit", "id": "247c902a7dd228295b3c0e06b278728d578453d7", "size": "1515", "binary": false, "copies": "2", "ref": "refs/heads/develop", "path": "src/MassTransit/Context/CorrelatedBySetCorrelationId.cs", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "1897" }, { "name": "C#", "bytes": "4284861" }, { "name": "F#", "bytes": "14240" }, { "name": "PowerShell", "bytes": "3099" } ] }
namespace Amazon.Ssm; public sealed class RegisterTaskWithMaintenanceWindowResponse { }
{ "content_hash": "fa7cab2ed0f48163b3a4b2786586ee86", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 61, "avg_line_length": 19, "alnum_prop": 0.8, "repo_name": "carbon/Amazon", "id": "3701a44b6febc53b2e2e0c2ab052f5e82b198c6a", "size": "97", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/Amazon.Ssm/Actions/RegisterTaskWithMaintenanceWindowResponse.cs", "mode": "33261", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "228" }, { "name": "C#", "bytes": "1031471" }, { "name": "PowerShell", "bytes": "1533" } ] }
'use strict'; var globalOptions = require('../options'); var helpers = require('../helpers'); function networkFirst(request, values, options) { options = options || {}; var cacheOptions = options.cache || globalOptions.cache; var cacheQueryOptions = cacheOptions.queryOptions; var successResponses = options.successResponses || globalOptions.successResponses; // This will bypass options.networkTimeout if it's set to a false-y value like // 0, but that's the sane thing to do anyway. var networkTimeoutSeconds = options.networkTimeoutSeconds || globalOptions.networkTimeoutSeconds; helpers.debug('Strategy: network first [' + request.url + ']', options); return helpers.openCache(options).then(function(cache) { var timeoutId; var promises = []; var originalResponse; if (networkTimeoutSeconds) { var cacheWhenTimedOutPromise = new Promise(function(resolve) { timeoutId = setTimeout(function() { cache.match(request, cacheQueryOptions).then(function(response) { // Only resolve this promise if there's a valid response in the // cache. This ensures that we won't time out a network request // unless there's a cached entry to fallback on, which is arguably // the preferable behavior. var now = Date.now(); var maxAgeSeconds = cacheOptions.maxAgeSeconds; if (helpers.isResponseFresh(response, maxAgeSeconds, now)) { resolve(response); } }); }, networkTimeoutSeconds * 1000); }); promises.push(cacheWhenTimedOutPromise); } var networkPromise = helpers.fetchAndCache(request, options) .then(function(response) { // We've got a response, so clear the network timeout if there is one. if (timeoutId) { clearTimeout(timeoutId); } if (successResponses.test(response.status)) { return response; } helpers.debug('Response was an HTTP error: ' + response.statusText, options); originalResponse = response; throw new Error('Bad response'); }).catch(function(error) { helpers.debug('Network or response error, fallback to cache [' + request.url + ']', options); return cache.match(request, cacheQueryOptions).then(function(response) { // If there's a match in the cache, resolve with that. if (response) { return response; } // If we have a Response object from the previous fetch, then resolve // with that, even though it corresponds to an error status code. if (originalResponse) { return originalResponse; } // If we don't have a Response object from the previous fetch, likely // due to a network failure, then reject with the failure error. throw error; }); }); promises.push(networkPromise); return Promise.race(promises); }); } module.exports = networkFirst;
{ "content_hash": "3f31257b2b9bce1b0a204d6d0b5700a8", "timestamp": "", "source": "github", "line_count": 84, "max_line_length": 80, "avg_line_length": 36.55952380952381, "alnum_prop": 0.633669814392706, "repo_name": "DrDanL/leightley-ghost-theme", "id": "da01e436dd3d7ff250b96500958ab3c3864d4561", "size": "3659", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "assets/dist/lib/strategies/networkFirst.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "38327" }, { "name": "HTML", "bytes": "35418" }, { "name": "JavaScript", "bytes": "6415" } ] }
""" Created from the demonstration of the pythonaes package. Copyright (c) 2010, Adam Newman http://www.caller9.com/ Licensed under the MIT license http://www.opensource.org/licenses/mit-license.php """ import sys from aespython import key_expander, aes_cipher, cbc_mode def decryptData(data, password = None, keyLength = None, mode = 'CBC'): ''' Method added for peepdf ''' decryptedData = '' if keyLength == None: keyLength = len(password)*8 if keyLength not in [128, 192, 256]: return (-1, 'Bad length key in AES decryption process') iv = map(ord, data[:16]) key = map(ord, password) data = data[16:] if len(data) % 16 != 0: data = data[:-(len(data)%16)] keyExpander = key_expander.KeyExpander(keyLength) expandedKey = keyExpander.expand(key) aesCipher = aes_cipher.AESCipher(expandedKey) if mode == 'CBC': aesMode = cbc_mode.CBCMode(aesCipher, 16) aesMode.set_iv(iv) for i in range(0,len(data),16): ciphertext = map(ord,data[i:i+16]) decryptedBytes = aesMode.decrypt_block(ciphertext) for byte in decryptedBytes: decryptedData += chr(byte) return (0, decryptedData)
{ "content_hash": "3377055a50140f16b6f7e739911f8f73", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 81, "avg_line_length": 32.945945945945944, "alnum_prop": 0.6423297785069729, "repo_name": "MeteorAdminz/viper", "id": "a034dcdf6188807b4da4c9288d2d3129125e5dcd", "size": "2152", "binary": false, "copies": "39", "ref": "refs/heads/master", "path": "viper/modules/peepdf/aes.py", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "CSS", "bytes": "1306" }, { "name": "JavaScript", "bytes": "9205" }, { "name": "Makefile", "bytes": "436" }, { "name": "Python", "bytes": "1577731" }, { "name": "Smarty", "bytes": "28258" } ] }
<?php defined('C5_EXECUTE') or die("Access Denied."); /* @var Area $a */ $btl = new BlockTypeList(); $blockTypes = $btl->get(); $handles = ''; $ap = new Permissions($a); $class = 'ccm-area'; if ($a->isGlobalArea()) { $class .= ' ccm-global-area'; } $c = Page::getCurrentPage(); $css = $c->getAreaCustomStyle($a); if (is_object($css)) { $class .= ' ' . $css->getContainerClass(); } foreach ($blockTypes as $bt) { if ($ap->canAddBlockToArea($bt)) { $handles .= $bt->getBlockTypeHandle() . ' '; } } if ($ap->canAddLayout()) { $handles .= BLOCK_HANDLE_LAYOUT_PROXY . ' '; $handles .= BLOCK_HANDLE_CONTAINER_PROXY . ' '; } if ($ap->canAddStack()) { $handles .= 'stack '; } $c = Page::getCurrentPage(); if ($c->isMasterCollection()) { $handles .= BLOCK_HANDLE_PAGE_TYPE_OUTPUT_PROXY . ' '; } $pt = $c->getCollectionThemeObject(); $gf = $pt->getThemeGridFrameworkObject(); ?> <div id="a<?= $a->getAreaID() ?>" data-maximum-blocks="<?= $a->getMaximumBlocks() ?>" data-accepts-block-types="<?= trim($handles) ?>" data-area-id="<?= $a->getAreaID() ?>" data-cID="<?= $a->getCollectionID() ?>" data-area-handle="<?= h($a->getAreaHandle()) ?>" data-area-display-name="<?= h($a->getAreaDisplayName()) ?>" data-area-menu-handle="<?= $a->getAreaID() ?>" data-area-enable-grid-container="<?= $a->isGridContainerEnabled() ?>" data-launch-area-menu="area-menu-a<?= $a->getAreaID() ?>" data-area-custom-templates='<?=json_encode($a->getAreaCustomTemplates(), ENT_QUOTES)?>' class="<?= $class ?>"> <?php unset($class); ?> <script type="text/template" role="area-block-wrapper"> <?php if ($pt->supportsGridFramework() && $a->isGridContainerEnabled()) { echo $gf->getPageThemeGridFrameworkContainerStartHTML(); echo $gf->getPageThemeGridFrameworkRowStartHTML(); printf( '<div class="%s">', $gf->getPageThemeGridFrameworkColumnClassesForSpan($gf->getPageThemeGridFrameworkNumColumns()) ); ?> <div class='block'></div> </div> <?php echo $gf->getPageThemeGridFrameworkRowEndHTML(); echo $gf->getPageThemeGridFrameworkContainerEndHTML(); } else { ?> <div class='block'></div> <?php } ?> </script> <div class="ccm-area-block-list">
{ "content_hash": "2411b664229c50670b1945c0c38086de", "timestamp": "", "source": "github", "line_count": 82, "max_line_length": 110, "avg_line_length": 29.878048780487806, "alnum_prop": 0.5636734693877551, "repo_name": "concrete5/concrete5", "id": "5adaed347af2693bec5f5638f51324a6698e37c8", "size": "2450", "binary": false, "copies": "10", "ref": "refs/heads/develop", "path": "concrete/elements/block_area_header.php", "mode": "33188", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "74" }, { "name": "CSS", "bytes": "140170" }, { "name": "HTML", "bytes": "312828" }, { "name": "Hack", "bytes": "45" }, { "name": "JavaScript", "bytes": "915053" }, { "name": "Less", "bytes": "472475" }, { "name": "PHP", "bytes": "15060224" }, { "name": "PowerShell", "bytes": "4292" }, { "name": "SCSS", "bytes": "788558" }, { "name": "Shell", "bytes": "31663" } ] }
<!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.5.0_22) on Tue Sep 18 20:44:16 GMT+01:00 2012 --> <META http-equiv="Content-Type" content="text/html; charset=UTF-8"> <TITLE> Uses of Interface org.apache.http.nio.reactor.ConnectingIOReactor (HttpComponents Core 4.2.2 API) </TITLE> <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../../stylesheet.css" TITLE="Style"> <SCRIPT type="text/javascript"> function windowTitle() { parent.document.title="Uses of Interface org.apache.http.nio.reactor.ConnectingIOReactor (HttpComponents Core 4.2.2 API)"; } </SCRIPT> <NOSCRIPT> </NOSCRIPT> </HEAD> <BODY BGCOLOR="white" onload="windowTitle();"> <!-- ========= 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>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../org/apache/http/nio/reactor/ConnectingIOReactor.html" title="interface in org.apache.http.nio.reactor"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;PREV&nbsp; &nbsp;NEXT</FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../../index.html?org/apache/http/nio/reactor/class-use/ConnectingIOReactor.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="ConnectingIOReactor.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<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> </TABLE> <A NAME="skip-navbar_top"></A> <!-- ========= END OF TOP NAVBAR ========= --> <HR> <CENTER> <H2> <B>Uses of Interface<br>org.apache.http.nio.reactor.ConnectingIOReactor</B></H2> </CENTER> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> Packages that use <A HREF="../../../../../../org/apache/http/nio/reactor/ConnectingIOReactor.html" title="interface in org.apache.http.nio.reactor">ConnectingIOReactor</A></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><A HREF="#org.apache.http.impl.nio.pool"><B>org.apache.http.impl.nio.pool</B></A></TD> <TD>Basic implementations for interfaces in <A HREF="../../../../../../org/apache/http/nio/pool/package-summary.html"><CODE>org.apache.http.nio.pool</CODE></A>.&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><A HREF="#org.apache.http.impl.nio.reactor"><B>org.apache.http.impl.nio.reactor</B></A></TD> <TD>Default implementations for interfaces in <A HREF="../../../../../../org/apache/http/nio/package-summary.html"><CODE>org.apache.http.nio</CODE></A> including default I/O reactor implementations and support for SSL/TLS transport security.&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><A HREF="#org.apache.http.nio.pool"><B>org.apache.http.nio.pool</B></A></TD> <TD>Asynchronous (non-blocking) connection pool components.&nbsp;</TD> </TR> </TABLE> &nbsp; <P> <A NAME="org.apache.http.impl.nio.pool"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> Uses of <A HREF="../../../../../../org/apache/http/nio/reactor/ConnectingIOReactor.html" title="interface in org.apache.http.nio.reactor">ConnectingIOReactor</A> in <A HREF="../../../../../../org/apache/http/impl/nio/pool/package-summary.html">org.apache.http.impl.nio.pool</A></FONT></TH> </TR> </TABLE> &nbsp; <P> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left" COLSPAN="2">Constructors in <A HREF="../../../../../../org/apache/http/impl/nio/pool/package-summary.html">org.apache.http.impl.nio.pool</A> with parameters of type <A HREF="../../../../../../org/apache/http/nio/reactor/ConnectingIOReactor.html" title="interface in org.apache.http.nio.reactor">ConnectingIOReactor</A></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><B><A HREF="../../../../../../org/apache/http/impl/nio/pool/BasicNIOConnPool.html#BasicNIOConnPool(org.apache.http.nio.reactor.ConnectingIOReactor, org.apache.http.params.HttpParams)">BasicNIOConnPool</A></B>(<A HREF="../../../../../../org/apache/http/nio/reactor/ConnectingIOReactor.html" title="interface in org.apache.http.nio.reactor">ConnectingIOReactor</A>&nbsp;ioreactor, <A HREF="../../../../../../org/apache/http/params/HttpParams.html" title="interface in org.apache.http.params">HttpParams</A>&nbsp;params)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><B><A HREF="../../../../../../org/apache/http/impl/nio/pool/BasicNIOConnPool.html#BasicNIOConnPool(org.apache.http.nio.reactor.ConnectingIOReactor, org.apache.http.nio.pool.NIOConnFactory, org.apache.http.params.HttpParams)">BasicNIOConnPool</A></B>(<A HREF="../../../../../../org/apache/http/nio/reactor/ConnectingIOReactor.html" title="interface in org.apache.http.nio.reactor">ConnectingIOReactor</A>&nbsp;ioreactor, <A HREF="../../../../../../org/apache/http/nio/pool/NIOConnFactory.html" title="interface in org.apache.http.nio.pool">NIOConnFactory</A>&lt;<A HREF="../../../../../../org/apache/http/HttpHost.html" title="class in org.apache.http">HttpHost</A>,<A HREF="../../../../../../org/apache/http/nio/NHttpClientConnection.html" title="interface in org.apache.http.nio">NHttpClientConnection</A>&gt;&nbsp;connFactory, <A HREF="../../../../../../org/apache/http/params/HttpParams.html" title="interface in org.apache.http.params">HttpParams</A>&nbsp;params)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> </TABLE> &nbsp; <P> <A NAME="org.apache.http.impl.nio.reactor"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> Uses of <A HREF="../../../../../../org/apache/http/nio/reactor/ConnectingIOReactor.html" title="interface in org.apache.http.nio.reactor">ConnectingIOReactor</A> in <A HREF="../../../../../../org/apache/http/impl/nio/reactor/package-summary.html">org.apache.http.impl.nio.reactor</A></FONT></TH> </TR> </TABLE> &nbsp; <P> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left" COLSPAN="2">Classes in <A HREF="../../../../../../org/apache/http/impl/nio/reactor/package-summary.html">org.apache.http.impl.nio.reactor</A> that implement <A HREF="../../../../../../org/apache/http/nio/reactor/ConnectingIOReactor.html" title="interface in org.apache.http.nio.reactor">ConnectingIOReactor</A></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;class</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../../org/apache/http/impl/nio/reactor/DefaultConnectingIOReactor.html" title="class in org.apache.http.impl.nio.reactor">DefaultConnectingIOReactor</A></B></CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Default implementation of <A HREF="../../../../../../org/apache/http/nio/reactor/ConnectingIOReactor.html" title="interface in org.apache.http.nio.reactor"><CODE>ConnectingIOReactor</CODE></A>.</TD> </TR> </TABLE> &nbsp; <P> <A NAME="org.apache.http.nio.pool"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> Uses of <A HREF="../../../../../../org/apache/http/nio/reactor/ConnectingIOReactor.html" title="interface in org.apache.http.nio.reactor">ConnectingIOReactor</A> in <A HREF="../../../../../../org/apache/http/nio/pool/package-summary.html">org.apache.http.nio.pool</A></FONT></TH> </TR> </TABLE> &nbsp; <P> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left" COLSPAN="2">Constructors in <A HREF="../../../../../../org/apache/http/nio/pool/package-summary.html">org.apache.http.nio.pool</A> with parameters of type <A HREF="../../../../../../org/apache/http/nio/reactor/ConnectingIOReactor.html" title="interface in org.apache.http.nio.reactor">ConnectingIOReactor</A></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><B><A HREF="../../../../../../org/apache/http/nio/pool/AbstractNIOConnPool.html#AbstractNIOConnPool(org.apache.http.nio.reactor.ConnectingIOReactor, org.apache.http.nio.pool.NIOConnFactory, int, int)">AbstractNIOConnPool</A></B>(<A HREF="../../../../../../org/apache/http/nio/reactor/ConnectingIOReactor.html" title="interface in org.apache.http.nio.reactor">ConnectingIOReactor</A>&nbsp;ioreactor, <A HREF="../../../../../../org/apache/http/nio/pool/NIOConnFactory.html" title="interface in org.apache.http.nio.pool">NIOConnFactory</A>&lt;<A HREF="../../../../../../org/apache/http/nio/pool/AbstractNIOConnPool.html" title="type parameter in AbstractNIOConnPool">T</A>,<A HREF="../../../../../../org/apache/http/nio/pool/AbstractNIOConnPool.html" title="type parameter in AbstractNIOConnPool">C</A>&gt;&nbsp;connFactory, int&nbsp;defaultMaxPerRoute, int&nbsp;maxTotal)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> </TABLE> &nbsp; <P> <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>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../org/apache/http/nio/reactor/ConnectingIOReactor.html" title="interface in org.apache.http.nio.reactor"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;PREV&nbsp; &nbsp;NEXT</FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../../index.html?org/apache/http/nio/reactor/class-use/ConnectingIOReactor.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="ConnectingIOReactor.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<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> </TABLE> <A NAME="skip-navbar_bottom"></A> <!-- ======== END OF BOTTOM NAVBAR ======= --> <HR> Copyright &#169; 2005-2012 <a href="http://www.apache.org/">The Apache Software Foundation</a>. All Rights Reserved. </BODY> </HTML>
{ "content_hash": "e8ebab9873409f22b928eb26c9144480", "timestamp": "", "source": "github", "line_count": 246, "max_line_length": 442, "avg_line_length": 57.073170731707314, "alnum_prop": 0.6512108262108263, "repo_name": "windyuuy/opera", "id": "5feb4f3835ab78ccd533a1f4ffeee69bb6ec5239", "size": "14040", "binary": false, "copies": "5", "ref": "refs/heads/master", "path": "chromium/src/third_party/httpcomponents-core/binary-distribution/javadoc/org/apache/http/nio/reactor/class-use/ConnectingIOReactor.html", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "ApacheConf", "bytes": "25707" }, { "name": "AppleScript", "bytes": "6973" }, { "name": "Assembly", "bytes": "51642" }, { "name": "Batchfile", "bytes": "35942" }, { "name": "C", "bytes": "4303018" }, { "name": "C#", "bytes": "35203" }, { "name": "C++", "bytes": "207333360" }, { "name": "CMake", "bytes": "25089" }, { "name": "CSS", "bytes": "681256" }, { "name": "Dart", "bytes": "24294" }, { "name": "Emacs Lisp", "bytes": "25534" }, { "name": "Groff", "bytes": "5283" }, { "name": "HTML", "bytes": "10400943" }, { "name": "IDL", "bytes": "836" }, { "name": "Java", "bytes": "2821184" }, { "name": "JavaScript", "bytes": "14563996" }, { "name": "Lua", "bytes": "13749" }, { "name": "Makefile", "bytes": "55521" }, { "name": "Objective-C", "bytes": "1211523" }, { "name": "Objective-C++", "bytes": "6221908" }, { "name": "PHP", "bytes": "61320" }, { "name": "Perl", "bytes": "82949" }, { "name": "Protocol Buffer", "bytes": "280464" }, { "name": "Python", "bytes": "12627773" }, { "name": "Rebol", "bytes": "262" }, { "name": "Ruby", "bytes": "937" }, { "name": "Scheme", "bytes": "10604" }, { "name": "Shell", "bytes": "894814" }, { "name": "VimL", "bytes": "4953" }, { "name": "XSLT", "bytes": "418" }, { "name": "nesC", "bytes": "14650" } ] }
require 'geocoder/lookups/base' require "geocoder/results/baidu" module Geocoder::Lookup class Baidu < Base def name "Baidu" end def required_api_key_parts ["key"] end def query_url(query) "#{protocol}://api.map.baidu.com/geocoder/v2/?" + url_query_string(query) end # HTTP only def supported_protocols [:http] end private # --------------------------------------------------------------- def results(query, reverse = false) return [] unless doc = fetch_data(query) case doc['status'] when 0 return [doc['result']] unless doc['result'].blank? when 1, 3, 4 raise_error(Geocoder::Error, "server error.") || Geocoder.log(:warn, "Baidu Geocoding API error: server error.") when 2 raise_error(Geocoder::InvalidRequest, "invalid request.") || Geocoder.log(:warn, "Baidu Geocoding API error: invalid request.") when 5 raise_error(Geocoder::InvalidApiKey, "invalid api key") || Geocoder.log(:warn, "Baidu Geocoding API error: invalid api key.") when 101, 102, 200..299 raise_error(Geocoder::RequestDenied, "request denied") || Geocoder.log(:warn, "Baidu Geocoding API error: request denied.") when 300..399 raise_error(Geocoder::OverQueryLimitError, "over query limit.") || Geocoder.log(:warn, "Baidu Geocoding API error: over query limit.") end return [] end def query_url_params(query) { (query.reverse_geocode? ? :location : :address) => query.sanitized_text, :ak => configuration.api_key, :output => "json" }.merge(super) end end end
{ "content_hash": "d415fd83c5635e2ab497d632230867f5", "timestamp": "", "source": "github", "line_count": 59, "max_line_length": 80, "avg_line_length": 29.10169491525424, "alnum_prop": 0.5824111822947, "repo_name": "mehlah/geocoder", "id": "65d38da08a7daf2bfeb6e1850cec94c0b786ccd8", "size": "1717", "binary": false, "copies": "23", "ref": "refs/heads/master", "path": "lib/geocoder/lookups/baidu.rb", "mode": "33188", "license": "mit", "language": [ { "name": "Groff", "bytes": "1892" }, { "name": "Ruby", "bytes": "262385" } ] }
.myAppDemoWT .myCustomButton.sapMBtn { margin-right: 0.125rem } html[dir="rtl"] .myAppDemoWT .myCustomButton.sapMBtn { margin-left: 0.125rem; margin-right: 0 } .myAppDemoWT .myCustomText { font-weight: bold; }
{ "content_hash": "99023f34643d62d1eb35423d23d43f2a", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 54, "avg_line_length": 19.90909090909091, "alnum_prop": 0.7214611872146118, "repo_name": "kobohuong/dict-app", "id": "b988ab983fbfb0a4cc39b0fbb6323a0f0927d59b", "size": "219", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "css/styles.css", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "2524" }, { "name": "HTML", "bytes": "2267" }, { "name": "JavaScript", "bytes": "13367" }, { "name": "TypeScript", "bytes": "2127" } ] }
namespace vgui { typedef ButtonCode_t KeyCode; } #endif // KEYCODE_H
{ "content_hash": "984f7e509f05be6dee9d33c5ad62c6d0", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 29, "avg_line_length": 11.666666666666666, "alnum_prop": 0.7285714285714285, "repo_name": "jonathonracz/swarm-deferred-src", "id": "61025e7dcd97b50fb6ae4e85b6bbbc372fbfbdbc", "size": "562", "binary": false, "copies": "17", "ref": "refs/heads/master", "path": "public/vgui/KeyCode.h", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "9070" }, { "name": "C", "bytes": "514308" }, { "name": "C++", "bytes": "39138330" }, { "name": "Objective-C", "bytes": "69969" }, { "name": "Perl", "bytes": "93492" }, { "name": "Squirrel", "bytes": "4289" } ] }
/***************************************************************************** * * See the following URL for configuration information. * http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_UDP/UDP_IP_Configuration.shtml * *****************************************************************************/ #ifndef FREERTOS_IP_CONFIG_H #define FREERTOS_IP_CONFIG_H /* The IP stack executes it its own task (although any application task can make use of its services through the published sockets API). ipconfigUDP_TASK_PRIORITY sets the priority of the task that executes the IP stack. The priority is a standard FreeRTOS task priority so can take any value from 0 (the lowest priority) to (configMAX_PRIORITIES - 1) (the highest priority). configMAX_PRIORITIES is a standard FreeRTOS configuration parameter defined in FreeRTOSConfig.h, not FreeRTOSIPConfig.h. Consideration needs to be given as to the priority assigned to the task executing the IP stack relative to the priority assigned to tasks that use the IP stack. */ #define ipconfigUDP_TASK_PRIORITY ( configMAX_PRIORITIES - 2 ) /* The size, in words (not bytes), of the stack allocated to the FreeRTOS+UDP task. This setting is less important when the FreeRTOS Win32 simulator is used as the Win32 simulator only stores a fixed amount of information on the task stack. FreeRTOS includes optional stack overflow detection, see: http://www.freertos.org/Stacks-and-stack-overflow-checking.html */ #define ipconfigUDP_TASK_STACK_SIZE_WORDS ( configMINIMAL_STACK_SIZE * 3 ) /* ipconfigRAND32() is called by the IP stack to generate a random number that is then used as a DHCP transaction number. Random number generation is performed via this macro to allow applications to use their own random number generation method. For example, it might be possible to generate a random number by sampling noise on an analogue input. */ #define ipconfigRAND32() 1 /* If ipconfigUSE_NETWORK_EVENT_HOOK is set to 1 then FreeRTOS+UDP will call the network event hook at the appropriate times. If ipconfigUSE_NETWORK_EVENT_HOOK is not set to 1 then the network event hook will never be called. See http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_UDP/API/vApplicationIPNetworkEventHook.shtml */ #define ipconfigUSE_NETWORK_EVENT_HOOK 1 /* Sockets have a send block time attribute. If FreeRTOS_sendto() is called but a network buffer cannot be obtained then the calling task is held in the Blocked state (so other tasks can continue to executed) until either a network buffer becomes available or the send block time expires. If the send block time expires then the send operation is aborted. The maximum allowable send block time is capped to the value set by ipconfigMAX_SEND_BLOCK_TIME_TICKS. Capping the maximum allowable send block time prevents prevents a deadlock occurring when all the network buffers are in use and the tasks that process (and subsequently free) the network buffers are themselves blocked waiting for a network buffer. ipconfigMAX_SEND_BLOCK_TIME_TICKS is specified in RTOS ticks. A time in milliseconds can be converted to a time in ticks by dividing the time in milliseconds by portTICK_RATE_MS. */ #define ipconfigMAX_SEND_BLOCK_TIME_TICKS ( 20 / portTICK_RATE_MS ) /* If ipconfigUSE_DHCP is 1 then FreeRTOS+UDP will attempt to retrieve an IP address, netmask, DNS server address and gateway address from a DHCP server. If ipconfigUSE_DHCP is 0 then FreeRTOS+UDP will use a static IP address. The stack will revert to using the static IP address even when ipconfigUSE_DHCP is set to 1 if a valid configuration cannot be obtained from a DHCP server for any reason. The static configuration used is that passed into the stack by the FreeRTOS_IPInit() function call. */ #define ipconfigUSE_DHCP 1 /* When ipconfigUSE_DHCP is set to 1, DHCP requests will be sent out at increasing time intervals until either a reply is received from a DHCP server and accepted, or the interval between transmissions reaches ipconfigMAXIMUM_DISCOVER_TX_PERIOD. The IP stack will revert to using the static IP address passed as a parameter to FreeRTOS_IPInit() if the re-transmission time interval reaches ipconfigMAXIMUM_DISCOVER_TX_PERIOD without a DHCP reply being received. */ #ifdef _WINDOWS_ /* The windows simulated time is not real time so the max delay is much shorter. */ #define ipconfigMAXIMUM_DISCOVER_TX_PERIOD ( 999 / portTICK_RATE_MS ) #else #define ipconfigMAXIMUM_DISCOVER_TX_PERIOD ( 120000 / portTICK_RATE_MS ) #endif /* _WINDOWS_ */ /* The ARP cache is a table that maps IP addresses to MAC addresses. The IP stack can only send a UDP message to a remove IP address if it knowns the MAC address associated with the IP address, or the MAC address of the router used to contact the remote IP address. When a UDP message is received from a remote IP address the MAC address and IP address are added to the ARP cache. When a UDP message is sent to a remote IP address that does not already appear in the ARP cache then the UDP message is replaced by a ARP message that solicits the required MAC address information. ipconfigARP_CACHE_ENTRIES defines the maximum number of entries that can exist in the ARP table at any one time. */ #define ipconfigARP_CACHE_ENTRIES 6 /* ARP requests that do not result in an ARP response will be re-transmitted a maximum of ipconfigMAX_ARP_RETRANSMISSIONS times before the ARP request is aborted. */ #define ipconfigMAX_ARP_RETRANSMISSIONS ( 5 ) /* ipconfigMAX_ARP_AGE defines the maximum time between an entry in the ARP table being created or refreshed and the entry being removed because it is stale. New ARP requests are sent for ARP cache entries that are nearing their maximum age. ipconfigMAX_ARP_AGE is specified in tens of seconds, so a value of 150 is equal to 1500 seconds (or 25 minutes). */ #define ipconfigMAX_ARP_AGE 150 /* Implementing FreeRTOS_inet_addr() necessitates the use of string handling routines, which are relatively large. To save code space the full FreeRTOS_inet_addr() implementation is made optional, and a smaller and faster alternative called FreeRTOS_inet_addr_quick() is provided. FreeRTOS_inet_addr() takes an IP in decimal dot format (for example, "192.168.0.1") as its parameter. FreeRTOS_inet_addr_quick() takes an IP address as four separate numerical octets (for example, 192, 168, 0, 1) as its parameters. If ipconfigINCLUDE_FULL_INET_ADDR is set to 1 then both FreeRTOS_inet_addr() and FreeRTOS_indet_addr_quick() are available. If ipconfigINCLUDE_FULL_INET_ADDR is not set to 1 then only FreeRTOS_indet_addr_quick() is available. */ #define ipconfigINCLUDE_FULL_INET_ADDR 1 /* ipconfigNUM_NETWORK_BUFFERS defines the total number of network buffer that are available to the IP stack. The total number of network buffers is limited to ensure the total amount of RAM that can be consumed by the IP stack is capped to a pre-determinable value. */ #define ipconfigNUM_NETWORK_BUFFERS 10 /* A FreeRTOS queue is used to send events from application tasks to the IP stack. ipconfigEVENT_QUEUE_LENGTH sets the maximum number of events that can be queued for processing at any one time. The event queue must be a minimum of 5 greater than the total number of network buffers. */ #define ipconfigEVENT_QUEUE_LENGTH ( ipconfigNUM_NETWORK_BUFFERS + 5 ) /* The address of a socket is the combination of its IP address and its port number. FreeRTOS_bind() is used to manually allocate a port number to a socket (to 'bind' the socket to a port), but manual binding is not normally necessary for client sockets (those sockets that initiate outgoing connections rather than wait for incoming connections on a known port number). If ipconfigALLOW_SOCKET_SEND_WITHOUT_BIND is set to 1 then calling FreeRTOS_sendto() on a socket that has not yet been bound will result in the IP stack automatically binding the socket to a port number from the range socketAUTO_PORT_ALLOCATION_START_NUMBER to 0xffff. If ipconfigALLOW_SOCKET_SEND_WITHOUT_BIND is set to 0 then calling FreeRTOS_sendto() on a socket that has not yet been bound will result in the send operation being aborted. */ #define ipconfigALLOW_SOCKET_SEND_WITHOUT_BIND 1 /* Defines the Time To Live (TTL) values used in outgoing UDP packets. */ #define updconfigIP_TIME_TO_LIVE 128 /* If ipconfigCAN_FRAGMENT_OUTGOING_PACKETS is set to 1 then UDP packets that contain more data than will fit in a single network frame will be fragmented across multiple IP packets. Also see the ipconfigNETWORK_MTU setting. If ipconfigCAN_FRAGMENT_OUTGOING_PACKETS is 1 then (ipconfigNETWORK_MTU - 28) must be divisible by 8. Setting ipconfigCAN_FRAGMENT_OUTGOING_PACKETS to 1 will increase both the code size and execution time. */ #define ipconfigCAN_FRAGMENT_OUTGOING_PACKETS 0 /* The MTU is the maximum number of bytes the payload of a network frame can contain. For normal Ethernet V2 frames the maximum MTU is 1500. Setting a lower value can save RAM, depending on the buffer management scheme used. If ipconfigCAN_FRAGMENT_OUTGOING_PACKETS is 1 then (ipconfigNETWORK_MTU - 28) must be divisible by 8. */ #define ipconfigNETWORK_MTU 586 /* Set ipconfigUSE_DNS to 1 to include a basic DNS client/resolver. DNS is used through the FreeRTOS_gethostbyname() API function. */ #define ipconfigUSE_DNS 1 /* If ipconfigREPLY_TO_INCOMING_PINGS is set to 1 then the IP stack will generate replies to incoming ICMP echo (ping) requests. */ #define ipconfigREPLY_TO_INCOMING_PINGS 1 /* If ipconfigSUPPORT_OUTGOING_PINGS is set to 1 then the FreeRTOS_SendPingRequest() API function is available. */ #define ipconfigSUPPORT_OUTGOING_PINGS 1 /* Used for stack testing only, and must be implemented in the network interface. */ #define updconfigLOOPBACK_ETHERNET_PACKETS 0 /* If ipconfigFILTER_OUT_NON_ETHERNET_II_FRAMES is set to 1 then Ethernet frames that are not in Ethernet II format will be dropped. This option is included for potential future IP stack developments. */ #define ipconfigFILTER_OUT_NON_ETHERNET_II_FRAMES 1 /* If ipconfigETHERNET_DRIVER_FILTERS_FRAME_TYPES is set to 1 then it is the responsibility of the Ethernet interface to filter out packets that are of no interest. If the Ethernet interface does not implement this functionality, then set ipconfigETHERNET_DRIVER_FILTERS_FRAME_TYPES to 0 to have the IP stack perform the filtering instead (it is much less efficient for the stack to do it because the packet will already have been passed into the stack). If the Ethernet driver does all the necessary filtering in hardware then software filtering can be removed by using a value other than 1 or 0. */ #define ipconfigETHERNET_DRIVER_FILTERS_FRAME_TYPES 2 /* The example IP trace macros are included here so the definitions are available in all the FreeRTOS+UDP source files. */ #include "DemoIPTrace.h" #endif /* FREERTOS_IP_CONFIG_H */
{ "content_hash": "f87e3cb5a9d62eaf7e5b9d08d52a2115", "timestamp": "", "source": "github", "line_count": 197, "max_line_length": 96, "avg_line_length": 56.38578680203046, "alnum_prop": 0.7638638818869283, "repo_name": "shengwen1997/stm32_pratice", "id": "2dd1ae19367c145a16de5f2d4c440759131ed9e5", "size": "12881", "binary": false, "copies": "17", "ref": "refs/heads/master", "path": "firmware/freertos/create_task/lib/FreeRTOSV8.2.3/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/FreeRTOSIPConfig.h", "mode": "33188", "license": "mit", "language": [ { "name": "Assembly", "bytes": "414380" }, { "name": "C", "bytes": "9528935" }, { "name": "C++", "bytes": "56339" }, { "name": "CSS", "bytes": "15658" }, { "name": "JavaScript", "bytes": "22190" }, { "name": "Shell", "bytes": "1138" } ] }
<?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="oval"> <corners android:radius="10dip"/> <stroke android:color="@color/secondary_color" android:width="5dip"/> <solid android:color="@color/primary_color"/> </shape>
{ "content_hash": "fd07679a11bb04049c74d8e76fa4b4a3", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 71, "avg_line_length": 29.8, "alnum_prop": 0.697986577181208, "repo_name": "msdgwzhy6/TuentiTV", "id": "6491128240246a54383850b069c0ccc7e48328a6", "size": "298", "binary": false, "copies": "5", "ref": "refs/heads/master", "path": "app/src/main/res/drawable/add_account_background.xml", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "132325" } ] }
import { IconDefinition, IconPrefix, IconName } from "@fortawesome/fontawesome-common-types"; export const definition: IconDefinition; export const faSortNumericUp: IconDefinition; export const prefix: IconPrefix; export const iconName: IconName; export const width: number; export const height: number; export const ligatures: string[]; export const unicode: string; export const svgPathData: string;
{ "content_hash": "4c56e9d72b8443c2d50a3dd7568c4536", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 93, "avg_line_length": 40.1, "alnum_prop": 0.8154613466334164, "repo_name": "Hendrik44/pi-weather-app", "id": "364e1734ba27c852f3dbea9f8a8c4ca635bfde02", "size": "401", "binary": false, "copies": "24", "ref": "refs/heads/master", "path": "Carthage/Checkouts/FontAwesome.swift/FortAwesome/Font-Awesome/js-packages/@fortawesome/free-solid-svg-icons/faSortNumericUp.d.ts", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "104" }, { "name": "HTML", "bytes": "649" }, { "name": "Swift", "bytes": "52465" } ] }
<?xml version="1.0"?> <!DOCTYPE document [ <!ENTITY project SYSTEM "project.xml"> ]> <document url="installation.html"> &project; <properties> <author email="craigmcc@apache.org">Craig R. McClanahan</author> <author email="yoavs@apache.org">Yoav Shapira</author> <author email="jfclere@apache.org">Jean-Frederic Clere</author> <title>Installation</title> </properties> <body> <section name="Installation"> <p>In order to use AS7 (JBossWeb) for developing web applications, you must first install it (and the software it depends on). The required steps are outlined in the following subsections.</p> <subsection name="JDK"> <p>AS7 was designed to run on J2SE 6.0. </p> <p>Compatible JDKs for many platforms (or links to where they can be found) are available at <a href="http://java.sun.com/j2se/">http://java.sun.com/j2se/</a>.</p> </subsection> <subsection name="AS7"> <p>Binary downloads of the <strong>AS7</strong> server are available from <a href="http://www.jboss.org/jbossas/downloads/">JBoss Application Server downloads</a>. This manual assumes you are using the most recent release of AS7. Detailed instructions for downloading and installing AS7 are available <a href="https://docs.jboss.org/author/display/AS7/Getting+Started+Developing+Applications+Guide#GettingStartedDevelopingApplicationsGuide-GettingstartedwithJBossAS7">here</a>.</p> </subsection> <subsection name="Ant"> <p>Binary downloads of the <strong>Ant</strong> build tool are available from <a href="http://ant.apache.org/bindownload.cgi">http://ant.apache.org/bindownload.cgi</a>. This manual assumes you are using Ant 1.4 or later. The instructions should also be compatible with later versions, but this has not been tested.</p> <p>Download and install Ant from the distribution directory mentioned above. Then, add the <code>bin</code> directory of the Ant distribution to your <code>PATH</code> environment variable, following the standard practices for your operating system platform. Once you have done this, you will be able to execute the <code>ant</code> shell command directly.</p> </subsection> <subsection name="CVS"> <p>Besides the required tools described above, you are strongly encouraged to download and install a <em>source code control</em> system, such as the <strong>Concurrent Version System</strong> (CVS), to maintain historical versions of the source files that make up your web application. Besides the server, you will also need appropriate client tools to check out source code files, and check in modified versions.</p> <p>Detailed instructions for installing and using source code control applications is beyond the scope of this manual. However, CVS server and client tools for many platforms (along with documentation) can be downloaded from <a href="http://www.cvshome.org">http://www.cvshome.org</a>.</p> </subsection> </section> </body> </document>
{ "content_hash": "5e0b6ae0f2225f63c269340789e6617c", "timestamp": "", "source": "github", "line_count": 84, "max_line_length": 198, "avg_line_length": 34.75, "alnum_prop": 0.7567660157588215, "repo_name": "whitingjr/JbossWeb_7_2_0", "id": "29435fb2f576103197cf336e13e5e549f9eb3299", "size": "2919", "binary": false, "copies": "6", "ref": "refs/heads/master", "path": "webapps/docs/appdev/installation.xml", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "7394431" }, { "name": "XML", "bytes": "13501" } ] }
*Topic automatically generated on: 2015-06-03* Adds a webpart to a web part page in a specified zone ##Syntax ```powershell Add-SPOWebPartToWebPartPage -Path <String> -PageUrl <String> -ZoneId <String> -ZoneIndex <Int32> [-Web <WebPipeBind>] ``` ```powershell Add-SPOWebPartToWebPartPage -Xml <String> -PageUrl <String> -ZoneId <String> -ZoneIndex <Int32> [-Web <WebPipeBind>] ``` ##Parameters Parameter|Type|Required|Description ---------|----|--------|----------- |PageUrl|String|True|| |Path|String|True|| |Web|WebPipeBind|False|The web to apply the command to. Omit this parameter to use the current web.| |Xml|String|True|| |ZoneId|String|True|| |ZoneIndex|Int32|True|| <!-- Ref: AF25CB5A96597A73DE3C6224A3A5E82E -->
{ "content_hash": "0e36050a47ea5176568a84fd782315f6", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 117, "avg_line_length": 30.25, "alnum_prop": 0.7107438016528925, "repo_name": "chrisobriensp/PnP", "id": "95f6c4b8b9dfeb8fdcd4d7f1753efbeb57d599d2", "size": "755", "binary": false, "copies": "16", "ref": "refs/heads/master", "path": "Solutions/PowerShell.Commands/Documentation/AddSPOWebPartToWebPartPage.md", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "ASP", "bytes": "284049" }, { "name": "Batchfile", "bytes": "565" }, { "name": "C#", "bytes": "7577567" }, { "name": "CSS", "bytes": "179178" }, { "name": "Cucumber", "bytes": "13062" }, { "name": "HTML", "bytes": "112828" }, { "name": "JavaScript", "bytes": "1690723" }, { "name": "PowerShell", "bytes": "8256" }, { "name": "XSLT", "bytes": "9717" } ] }
/** * This shim replaces lodash template functions with Handlebars.js * (not needed if templates are pre-compiled) **/<% if (moduleFormat === 'amd') { %> define(function(require) {<% } %> 'use strict'; var Marionette = require('backbone.marionette'); var Handlebars = require('handlebars'); //Override MarionetteJS template retrieval & compilation to use Handlebars.js Marionette.TemplateCache.prototype.loadTemplate = function(rawTemplate) { // Pass straight through to compileTemplate function return rawTemplate; }; Marionette.TemplateCache.prototype.compileTemplate = function(rawTemplate) { //If you use pre-compiled Handlebars templates, you can simply return rawTemplate return Handlebars.compile(rawTemplate); };<% if (moduleFormat === 'amd') { %> });<% } %>
{ "content_hash": "8e4f462d835d85b56fb8ddc07c36be07", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 89, "avg_line_length": 41.75, "alnum_prop": 0.6910179640718563, "repo_name": "omahajs/generator-omaha", "id": "9744e668c3a15c2a1a11c92ce5bb204bb7676f2c", "size": "835", "binary": false, "copies": "4", "ref": "refs/heads/master", "path": "src/webapp/templates/shims/mn.handlebars.templates.shim.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "9730" }, { "name": "Dockerfile", "bytes": "267" }, { "name": "HTML", "bytes": "3662" }, { "name": "JavaScript", "bytes": "319760" }, { "name": "Rust", "bytes": "2492" }, { "name": "Shell", "bytes": "2087" } ] }
// // Copyright (C) OpenSim Ltd. // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public License // along with this program; if not, see <http://www.gnu.org/licenses/>. // #ifndef __INET_MEDIUMCANVASVISUALIZER_H #define __INET_MEDIUMCANVASVISUALIZER_H #include "inet/common/figures/HeatMapFigure.h" #include "inet/common/figures/TrailFigure.h" #include "inet/common/geometry/common/CanvasProjection.h" #include "inet/physicallayer/contract/packetlevel/IRadioFrame.h" #include "inet/physicallayer/contract/packetlevel/IReceptionDecision.h" #include "inet/physicallayer/contract/packetlevel/ITransmission.h" #include "inet/visualizer/base/MediumVisualizerBase.h" #include "inet/visualizer/scene/NetworkNodeCanvasVisualizer.h" #include "inet/visualizer/util/AnimationSpeedInterpolator.h" namespace inet { namespace visualizer { class INET_API MediumCanvasVisualizer : public MediumVisualizerBase { protected: /** @name Parameters */ //@{ double zIndex = NaN; const CanvasProjection *canvasProjection = nullptr; SignalShape signalShape = SIGNAL_SHAPE_RING; double signalOpacity = NaN; int signalRingCount = -1; double signalRingSize = NaN; double signalFadingDistance = NaN; double signalFadingFactor = NaN; int signalWaveCount = -1; double signalWaveLength = NaN; double signalWaveWidth = NaN; double signalWaveFadingAnimationSpeedFactor = NaN; bool displayCommunicationHeat = false; int communicationHeatMapSize = 100; //@} /** @name Internal state */ //@{ enum SignalInProgress { SIP_NONE, SIP_PROPAGATION, SIP_TRANSMISSION, }; SignalInProgress lastSignalInProgress = SIP_NONE; AnimationSpeedInterpolator animationSpeedInterpolator; NetworkNodeCanvasVisualizer *networkNodeVisualizer = nullptr; /** * The list of ongoing transmissions. */ std::vector<const ITransmission *> transmissions; /** * The list of transmission figures. */ std::map<const IRadio *, cFigure *> transmissionFigures; /** * The list of reception figures. */ std::map<const IRadio *, cFigure *> receptionFigures; /** * The propagating signal figures. */ std::map<const ITransmission *, cFigure *> signalFigures; //@} /** @name Figures */ //@{ /** * The layer figure that contains the figures representing the ongoing communications. */ cGroupFigure *signalLayer = nullptr; /** * The heat map figure that shows the recent successful communications. */ HeatMapFigure *communicationHeat = nullptr; //@} protected: virtual void initialize(int stage) override; virtual void refreshDisplay() const override; virtual void setAnimationSpeed(); virtual cFigure *getTransmissionFigure(const IRadio *radio) const; virtual void setTransmissionFigure(const IRadio *radio, cFigure *figure); virtual cFigure *removeTransmissionFigure(const IRadio *radio); virtual cFigure *getReceptionFigure(const IRadio *radio) const; virtual void setReceptionFigure(const IRadio *radio, cFigure *figure); virtual cFigure *removeReceptionFigure(const IRadio *radio); virtual cFigure *getSignalFigure(const ITransmission *transmission) const; virtual void setSignalFigure(const ITransmission *transmission, cFigure *figure); virtual cFigure *removeSignalFigure(const ITransmission *transmission); virtual cGroupFigure *createSignalFigure(const ITransmission *transmission) const; virtual void refreshSignalFigure(const ITransmission *transmission) const; virtual void radioAdded(const IRadio *radio) override; virtual void radioRemoved(const IRadio *radio) override; virtual void transmissionAdded(const ITransmission *transmission) override; virtual void transmissionRemoved(const ITransmission *transmission) override; virtual void transmissionStarted(const ITransmission *transmission) override; virtual void transmissionEnded(const ITransmission *transmission) override; virtual void receptionStarted(const IReception *reception) override; virtual void receptionEnded(const IReception *reception) override; }; } // namespace visualizer } // namespace inet #endif // ifndef __INET_MEDIUMCANVASVISUALIZER_H
{ "content_hash": "0868fdccd398854ee19dc2a7e5d1c4a4", "timestamp": "", "source": "github", "line_count": 133, "max_line_length": 90, "avg_line_length": 36.35338345864662, "alnum_prop": 0.7394002068252327, "repo_name": "LarryNguyen/ECSimpp", "id": "0bb3f9cffe833c2de2dfc387f8eb68080c60d4ed", "size": "4835", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "INET_EC/visualizer/physicallayer/MediumCanvasVisualizer.h", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C", "bytes": "61045" }, { "name": "C++", "bytes": "18067164" }, { "name": "Lex", "bytes": "13424" }, { "name": "Makefile", "bytes": "6640" }, { "name": "Objective-C", "bytes": "4651" }, { "name": "Shell", "bytes": "173" }, { "name": "Yacc", "bytes": "67181" } ] }
/** * Generated with Acceleo */ package org.wso2.developerstudio.eclipse.gmf.esb.providers; import java.util.List; import org.eclipse.emf.ecore.EObject; import org.eclipse.emf.eef.runtime.api.component.IPropertiesEditionComponent; import org.eclipse.emf.eef.runtime.context.PropertiesEditingContext; import org.eclipse.emf.eef.runtime.impl.utils.EEFUtils; import org.eclipse.emf.eef.runtime.providers.PropertiesEditingProvider; import org.eclipse.emf.eef.runtime.providers.impl.PropertiesEditingProviderImpl; import org.eclipse.jface.viewers.IFilter; import org.wso2.developerstudio.eclipse.gmf.esb.AggregateMediatorOnCompleteOutputConnector; import org.wso2.developerstudio.eclipse.gmf.esb.EsbPackage; import org.wso2.developerstudio.eclipse.gmf.esb.components.AggregateMediatorOnCompleteOutputConnectorPropertiesEditionComponent; /** * * */ public class AggregateMediatorOnCompleteOutputConnectorPropertiesEditionProvider extends PropertiesEditingProviderImpl { /** * Constructor without provider for super types. */ public AggregateMediatorOnCompleteOutputConnectorPropertiesEditionProvider() { super(); } /** * Constructor with providers for super types. * @param superProviders providers to use for super types. */ public AggregateMediatorOnCompleteOutputConnectorPropertiesEditionProvider(List<PropertiesEditingProvider> superProviders) { super(superProviders); } /** * {@inheritDoc} * @see org.eclipse.emf.eef.runtime.providers.PropertiesEditingProvider#provides(org.eclipse.emf.eef.runtime.context.PropertiesEditingContext) * */ public boolean provides(PropertiesEditingContext editingContext) { return (editingContext.getEObject() instanceof AggregateMediatorOnCompleteOutputConnector) && (EsbPackage.Literals.AGGREGATE_MEDIATOR_ON_COMPLETE_OUTPUT_CONNECTOR == editingContext.getEObject().eClass()); } /** * {@inheritDoc} * @see org.eclipse.emf.eef.runtime.providers.PropertiesEditingProvider#provides(org.eclipse.emf.eef.runtime.context.PropertiesEditingContext, java.lang.String) * */ public boolean provides(PropertiesEditingContext editingContext, String part) { return (editingContext.getEObject() instanceof AggregateMediatorOnCompleteOutputConnector) && (AggregateMediatorOnCompleteOutputConnectorPropertiesEditionComponent.BASE_PART.equals(part)); } /** * {@inheritDoc} * @see org.eclipse.emf.eef.runtime.providers.PropertiesEditingProvider#provides(org.eclipse.emf.eef.runtime.context.PropertiesEditingContext, java.lang.Class) * */ @SuppressWarnings("rawtypes") public boolean provides(PropertiesEditingContext editingContext, java.lang.Class refinement) { return (editingContext.getEObject() instanceof AggregateMediatorOnCompleteOutputConnector) && (refinement == AggregateMediatorOnCompleteOutputConnectorPropertiesEditionComponent.class); } /** * {@inheritDoc} * @see org.eclipse.emf.eef.runtime.providers.PropertiesEditingProvider#provides(org.eclipse.emf.eef.runtime.context.PropertiesEditingContext, java.lang.String, java.lang.Class) * */ @SuppressWarnings("rawtypes") public boolean provides(PropertiesEditingContext editingContext, String part, java.lang.Class refinement) { return (editingContext.getEObject() instanceof AggregateMediatorOnCompleteOutputConnector) && ((AggregateMediatorOnCompleteOutputConnectorPropertiesEditionComponent.BASE_PART.equals(part) && refinement == AggregateMediatorOnCompleteOutputConnectorPropertiesEditionComponent.class)); } /** * {@inheritDoc} * @see org.eclipse.emf.eef.runtime.providers.PropertiesEditingProvider#getPropertiesEditingComponent(org.eclipse.emf.eef.runtime.context.PropertiesEditingContext, java.lang.String) * */ public IPropertiesEditionComponent getPropertiesEditingComponent(PropertiesEditingContext editingContext, String mode) { if (editingContext.getEObject() instanceof AggregateMediatorOnCompleteOutputConnector) { return new AggregateMediatorOnCompleteOutputConnectorPropertiesEditionComponent(editingContext, editingContext.getEObject(), mode); } return super.getPropertiesEditingComponent(editingContext, mode); } /** * {@inheritDoc} * @see org.eclipse.emf.eef.runtime.providers.PropertiesEditingProvider#getPropertiesEditingComponent(org.eclipse.emf.eef.runtime.context.PropertiesEditingContext, java.lang.String, java.lang.String) * */ public IPropertiesEditionComponent getPropertiesEditingComponent(PropertiesEditingContext editingContext, String mode, String part) { if (editingContext.getEObject() instanceof AggregateMediatorOnCompleteOutputConnector) { if (AggregateMediatorOnCompleteOutputConnectorPropertiesEditionComponent.BASE_PART.equals(part)) return new AggregateMediatorOnCompleteOutputConnectorPropertiesEditionComponent(editingContext, editingContext.getEObject(), mode); } return super.getPropertiesEditingComponent(editingContext, mode, part); } /** * {@inheritDoc} * @see org.eclipse.emf.eef.runtime.providers.PropertiesEditingProvider#getPropertiesEditingComponent(org.eclipse.emf.eef.runtime.context.PropertiesEditingContext, java.lang.String, java.lang.String, java.lang.Class) */ @SuppressWarnings("rawtypes") public IPropertiesEditionComponent getPropertiesEditingComponent(PropertiesEditingContext editingContext, String mode, String part, java.lang.Class refinement) { if (editingContext.getEObject() instanceof AggregateMediatorOnCompleteOutputConnector) { if (AggregateMediatorOnCompleteOutputConnectorPropertiesEditionComponent.BASE_PART.equals(part) && refinement == AggregateMediatorOnCompleteOutputConnectorPropertiesEditionComponent.class) return new AggregateMediatorOnCompleteOutputConnectorPropertiesEditionComponent(editingContext, editingContext.getEObject(), mode); } return super.getPropertiesEditingComponent(editingContext, mode, part, refinement); } /** * Provides the filter used by the plugin.xml to assign part forms. */ public static class EditionFilter implements IFilter { /** * {@inheritDoc} * * @see org.eclipse.jface.viewers.IFilter#select(java.lang.Object) */ public boolean select(Object toTest) { EObject eObj = EEFUtils.resolveSemanticObject(toTest); return eObj != null && EsbPackage.Literals.AGGREGATE_MEDIATOR_ON_COMPLETE_OUTPUT_CONNECTOR == eObj.eClass(); } } }
{ "content_hash": "b920eaf870eb4f7f3066ce0c72ad82b2", "timestamp": "", "source": "github", "line_count": 143, "max_line_length": 284, "avg_line_length": 44.33566433566433, "alnum_prop": 0.8132492113564669, "repo_name": "wso2/devstudio-tooling-esb", "id": "f49b2c8892b85f3dfed1d526b8a9b3da0ba624a1", "size": "6340", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "plugins/org.wso2.developerstudio.eclipse.gmf.esb.edit/src-gen/org/wso2/developerstudio/eclipse/gmf/esb/providers/AggregateMediatorOnCompleteOutputConnectorPropertiesEditionProvider.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "41098" }, { "name": "HTML", "bytes": "731356" }, { "name": "Java", "bytes": "77354104" }, { "name": "JavaScript", "bytes": "475592" }, { "name": "Shell", "bytes": "7727" } ] }
<?xml version="1.0" encoding="utf-8"?> <resources> <style name="Anim_style2" parent="android:style/Theme.Holo.Light.NoActionBar"> <item name="android:windowAnimationStyle">@style/AnimFade</item> </style> <style name="horizontal_slide" parent="android:style/Theme.Holo.Light.NoActionBar"> <item name="android:windowAnimationStyle">@style/AnimFade2</item> </style> <style name="nornal_style" parent="android:style/Theme.Holo.Light.NoActionBar"></style> </resources>
{ "content_hash": "ed9960c8263c81486c51076311539e69", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 91, "avg_line_length": 35.92857142857143, "alnum_prop": 0.7037773359840954, "repo_name": "turoDog/KTalk", "id": "b1947f1d206e2e7391cc8aac2620505821f07d12", "size": "503", "binary": false, "copies": "24", "ref": "refs/heads/master", "path": "easeui/res/values-v11/ease_styles.xml", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "547821" }, { "name": "Shell", "bytes": "608" } ] }
@interface EXPExpectFBSnapshotTest() @property (nonatomic, strong) NSString *referenceImagesDirectory; @end @implementation EXPExpectFBSnapshotTest + (id)instance { static EXPExpectFBSnapshotTest *instance = nil; static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ instance = [[self alloc] init]; }); return instance; } + (BOOL)compareSnapshotOfViewOrLayer:(id)viewOrLayer snapshot:(NSString *)snapshot testCase:(id)testCase record:(BOOL)record referenceDirectory:(NSString *)referenceDirectory error:(NSError **)error { FBSnapshotTestController *snapshotController = [[FBSnapshotTestController alloc] initWithTestClass:[testCase class]]; snapshotController.renderAsLayer = YES; snapshotController.recordMode = record; snapshotController.referenceImagesDirectory = referenceDirectory; if (! snapshotController.referenceImagesDirectory) { [NSException raise:@"Missing value for referenceImagesDirectory" format:@"Call [[EXPExpectFBSnapshotTest instance] setReferenceImagesDirectory"]; } return [snapshotController compareSnapshotOfViewOrLayer:viewOrLayer selector:NSSelectorFromString(snapshot) identifier:nil error:error]; } + (NSString *)combinedError:(NSString *)message test:(NSString *)test error:(NSError *)error { NSAssert(message, @"missing message"); NSAssert(test, @"missing test name"); NSMutableArray *ary = [NSMutableArray array]; [ary addObject:[NSString stringWithFormat:@"%@ %@", message, test]]; for(NSString *key in error.userInfo.keyEnumerator) { [ary addObject:[NSString stringWithFormat:@" %@: %@", key, [error.userInfo valueForKey:key]]]; } return [ary componentsJoinedByString:@"\n"]; } @end void setGlobalReferenceImageDir(char *reference) { NSString *referenceImagesDirectory = [NSString stringWithFormat:@"%s", reference]; [[EXPExpectFBSnapshotTest instance] setReferenceImagesDirectory:referenceImagesDirectory]; }; @interface EXPExpect(ReferenceDirExtension) - (NSString *)_getDefaultReferenceDirectory; @end @implementation EXPExpect(ReferenceDirExtension) - (NSString *)_getDefaultReferenceDirectory { NSString *globalReference = [[EXPExpectFBSnapshotTest instance] referenceImagesDirectory]; if (globalReference) { return globalReference; } // Search the test file's path to find the first folder with the substring "tests" // then append "/ReferenceImages" and use that NSString *testFileName = [NSString stringWithCString:self.fileName encoding:NSUTF8StringEncoding]; NSArray *pathComponents = [testFileName pathComponents]; for (NSString *folder in pathComponents) { if ([folder.lowercaseString rangeOfString:@"tests"].location != NSNotFound) { NSArray *folderPathComponents = [pathComponents subarrayWithRange:NSMakeRange(0, [pathComponents indexOfObject:folder] + 1)]; return [NSString stringWithFormat:@"%@/ReferenceImages", [folderPathComponents componentsJoinedByString:@"/"]]; } } [NSException raise:@"Could not infer reference image folder" format:@"You should provide a reference dir using setGlobalReferenceImageDir(FB_REFERENCE_IMAGE_DIR);"]; return nil; } @end // If you're bringing in Speca via CocoaPods // use the test path to get the test's image file URL #ifdef COCOAPODS_POD_AVAILABLE_Specta #import <Specta/Specta.h> #import <Specta/SpectaUtility.h> #import <Specta/SPTExample.h> NSString *sanitizedTestPath(); NSString *sanitizedTestPath(){ id compiledExample = [[NSThread currentThread] threadDictionary][@"SPTCurrentSpec"]; // SPTSpec NSString *name; if ([compiledExample respondsToSelector:@selector(name)]) { // Specta 0.3 syntax name = [compiledExample performSelector:@selector(name)]; } else if ([compiledExample respondsToSelector:@selector(fileName)]) { // Specta 0.2 syntax name = [compiledExample performSelector:@selector(fileName)]; } name = [[[[name componentsSeparatedByString:@" test_"] lastObject] stringByReplacingOccurrencesOfString:@"__" withString:@"_"] stringByReplacingOccurrencesOfString:@"]" withString:@""]; return name; } EXPMatcherImplementationBegin(haveValidSnapshot, (void)){ __block NSError *error = nil; match(^BOOL{ NSString *referenceImageDir = [self _getDefaultReferenceDirectory]; NSString *name = sanitizedTestPath(); if ([actual isKindOfClass:UIViewController.class]) { [actual beginAppearanceTransition:YES animated:NO]; [actual endAppearanceTransition]; actual = [actual view]; } return [EXPExpectFBSnapshotTest compareSnapshotOfViewOrLayer:actual snapshot:name testCase:[self testCase] record:NO referenceDirectory:referenceImageDir error:&error]; }); failureMessageForTo(^NSString *{ return [EXPExpectFBSnapshotTest combinedError:@"expected a matching snapshot in" test:sanitizedTestPath() error:error]; }); failureMessageForNotTo(^NSString *{ return [EXPExpectFBSnapshotTest combinedError:@"expected to not have a matching snapshot in" test:sanitizedTestPath() error:error]; }); } EXPMatcherImplementationEnd EXPMatcherImplementationBegin(recordSnapshot, (void)) { __block NSError *error = nil; BOOL actualIsViewLayerOrViewController = ([actual isKindOfClass:UIView.class] || [actual isKindOfClass:CALayer.class] || [actual isKindOfClass:UIViewController.class]); prerequisite(^BOOL{ return actualIsViewLayerOrViewController; }); match(^BOOL{ NSString *referenceImageDir = [self _getDefaultReferenceDirectory]; // For view controllers do the viewWill/viewDid dance, then pass view through if ([actual isKindOfClass:UIViewController.class]) { [actual beginAppearanceTransition:YES animated:NO]; [actual endAppearanceTransition]; actual = [actual view]; } [EXPExpectFBSnapshotTest compareSnapshotOfViewOrLayer:actual snapshot:sanitizedTestPath() testCase:[self testCase] record:YES referenceDirectory:referenceImageDir error:&error]; return NO; }); failureMessageForTo(^NSString *{ if (!actualIsViewLayerOrViewController) { return [EXPExpectFBSnapshotTest combinedError:@"Expected a View, Layer or View Controller." test:sanitizedTestPath() error:nil]; } if (error) { return [EXPExpectFBSnapshotTest combinedError:@"expected to record a snapshot in" test:sanitizedTestPath() error:error]; } else { return [NSString stringWithFormat:@"snapshot %@ successfully recorded, replace recordSnapshot with a check", sanitizedTestPath()]; } }); failureMessageForNotTo(^NSString *{ if (error) { return [EXPExpectFBSnapshotTest combinedError:@"expected to record a snapshot in" test:sanitizedTestPath() error:error]; } else { return [NSString stringWithFormat:@"snapshot %@ successfully recorded, replace recordSnapshot with a check", sanitizedTestPath()]; } }); } EXPMatcherImplementationEnd #else // If you don't have Speca stub the functions EXPMatcherImplementationBegin(haveValidSnapshot, (void)){ prerequisite(^BOOL{ return NO; }); failureMessageForTo(^NSString *{ return @"you need Specta installed via CocoaPods to use haveValidSnapshot, use haveValidSnapshotNamed instead"; }); failureMessageForNotTo(^NSString *{ return @"you need Specta installed via CocoaPods to use haveValidSnapshot, use haveValidSnapshotNamed instead"; }); } EXPMatcherImplementationEnd EXPMatcherImplementationBegin(recordSnapshot, (void)) { __block NSError *error = nil; prerequisite(^BOOL{ return NO; }); failureMessageForTo(^NSString *{ return @"you need Specta installed via CocoaPods to use recordSnapshot, use recordSnapshotNamed instead"; }); failureMessageForNotTo(^NSString *{ return @"you need Specta installed via CocoaPods to use recordSnapshot, use recordSnapshotNamed instead"; }); } EXPMatcherImplementationEnd #endif EXPMatcherImplementationBegin(haveValidSnapshotNamed, (NSString *snapshot)){ BOOL snapshotIsNil = (snapshot == nil); __block NSError *error = nil; prerequisite(^BOOL{ return !(snapshotIsNil); }); match(^BOOL{ NSString *referenceImageDir = [self _getDefaultReferenceDirectory]; if ([actual isKindOfClass:UIViewController.class]) { [actual beginAppearanceTransition:YES animated:NO]; [actual endAppearanceTransition]; actual = [actual view]; } return [EXPExpectFBSnapshotTest compareSnapshotOfViewOrLayer:actual snapshot:snapshot testCase:[self testCase] record:NO referenceDirectory:referenceImageDir error:&error]; }); failureMessageForTo(^NSString *{ return [EXPExpectFBSnapshotTest combinedError:@"expected a matching snapshot named" test:snapshot error:error]; }); failureMessageForNotTo(^NSString *{ return [EXPExpectFBSnapshotTest combinedError:@"expected not to have a matching snapshot named" test:snapshot error:error]; }); } EXPMatcherImplementationEnd EXPMatcherImplementationBegin(recordSnapshotNamed, (NSString *snapshot)) { BOOL snapshotExists = (snapshot != nil); BOOL actualIsViewLayerOrViewController = ([actual isKindOfClass:UIView.class] || [actual isKindOfClass:CALayer.class] || [actual isKindOfClass:UIViewController.class]); __block NSError *error = nil; id actualRef = actual; prerequisite(^BOOL{ return actualRef && snapshotExists && actualIsViewLayerOrViewController; }); match(^BOOL{ NSString *referenceImageDir = [self _getDefaultReferenceDirectory]; // For view controllers do the viewWill/viewDid dance, then pass view through if ([actual isKindOfClass:UIViewController.class]) { [actual beginAppearanceTransition:YES animated:NO]; [actual endAppearanceTransition]; actual = [actual view]; } [EXPExpectFBSnapshotTest compareSnapshotOfViewOrLayer:actual snapshot:snapshot testCase:[self testCase] record:YES referenceDirectory:referenceImageDir error:&error]; return NO; }); failureMessageForTo(^NSString *{ if (!actualIsViewLayerOrViewController) { return [EXPExpectFBSnapshotTest combinedError:@"Expected a View, Layer or View Controller." test:snapshot error:nil]; } if (error) { return [EXPExpectFBSnapshotTest combinedError:@"expected to record a matching snapshot named" test:snapshot error:error]; } else { return [NSString stringWithFormat:@"snapshot %@ successfully recorded, replace recordSnapshot with a check", snapshot]; } }); failureMessageForNotTo(^NSString *{ if (!actualIsViewLayerOrViewController) { return [EXPExpectFBSnapshotTest combinedError:@"Expected a View, Layer or View Controller." test:snapshot error:nil]; } if (error) { return [EXPExpectFBSnapshotTest combinedError:@"expected to record a matching snapshot named" test:snapshot error:error]; } else { return [NSString stringWithFormat:@"snapshot %@ successfully recorded, replace recordSnapshot with a check", snapshot]; } }); } EXPMatcherImplementationEnd
{ "content_hash": "a88550c2c83751bac9843d15d70b2e22", "timestamp": "", "source": "github", "line_count": 307, "max_line_length": 198, "avg_line_length": 38.0228013029316, "alnum_prop": 0.7053028356035295, "repo_name": "OspreyRen/TSMessages", "id": "6e6798928960b0df97590f23bf5e01df6eed0ebf", "size": "11961", "binary": false, "copies": "70", "ref": "refs/heads/master", "path": "Example/Pods/Expecta+Snapshots/EXPMatchers+FBSnapshotTest.m", "mode": "33261", "license": "mit", "language": [ { "name": "C", "bytes": "3345" }, { "name": "C++", "bytes": "642" }, { "name": "Objective-C", "bytes": "231669" }, { "name": "Ruby", "bytes": "3448" }, { "name": "Shell", "bytes": "11010" } ] }
module Selenium module WebDriver module SpecSupport class TestEnvironment attr_accessor :unguarded attr_reader :driver def initialize @create_driver_error = nil @create_driver_error_count = 0 # TODO: get rid of ENV @driver = (ENV['WD_SPEC_DRIVER'] || raise("must set WD_SPEC_DRIVER")).to_sym end def browser if driver == :remote # TODO: get rid of ENV (ENV['WD_REMOTE_BROWSER'] || :firefox).to_sym else driver end end def driver_instance @driver_instance ||= new_driver_instance end def reset_driver! quit_driver @driver_instance = new_driver_instance end def quit_driver if @driver_instance @driver_instance.quit @driver_instance = nil end end def new_driver_instance check_for_previous_error create_driver end def app_server @app_server ||= ( s = RackServer.new(root.join("common/src/web").to_s) s.start s ) end def remote_server @remote_server ||= ( Selenium::Server.new(remote_server_jar, :port => PortProber.above(4444), :log => !!$DEBUG, :background => true, :timeout => 60 ) ) end def remote_server_jar @remote_server_jar ||= root.join("build/java/server/test/org/openqa/selenium/server-with-tests-standalone.jar").to_s end def quit app_server.stop if defined?(@remote_server) @remote_server.stop end @driver_instance = @app_server = @remote_server = nil ensure Guards.report end def unguarded? @unguarded ||= false end def native_events? @native_events ||= !!ENV['native'] end def url_for(filename) url = app_server.where_is filename url.sub!("127.0.0.1", "10.0.2.2") if browser == :android url end def root @root ||= Pathname.new("../../../../../../../").expand_path(__FILE__) end private def create_driver instance = case driver when :remote create_remote_driver when :firefox create_firefox_driver when :chrome create_chrome_driver when :iphone create_iphone_driver when :safari create_safari_driver when :phantomjs create_phantomjs_driver else WebDriver::Driver.for driver end @create_driver_error_count -= 1 unless @create_driver_error_count == 0 instance rescue => ex @create_driver_error = ex @create_driver_error_count += 1 raise ex end def remote_capabilities caps = WebDriver::Remote::Capabilities.send(ENV['WD_REMOTE_BROWSER'] || 'firefox') caps.javascript_enabled = true caps.css_selectors_enabled = true caps end MAX_ERRORS = 4 class DriverInstantiationError < StandardError end def check_for_previous_error return unless @create_driver_error && @create_driver_error_count >= MAX_ERRORS msg = "previous #{@create_driver_error_count} instantiations of driver #{driver.inspect} failed, not trying again" msg << " (#{@create_driver_error.message})" raise DriverInstantiationError, msg, @create_driver_error.backtrace end def create_remote_driver WebDriver::Driver.for(:remote, :desired_capabilities => remote_capabilities, :url => ENV['WD_REMOTE_URL'] || remote_server.webdriver_url, :http_client => keep_alive_client || http_client ) end def create_firefox_driver if native_events? profile = WebDriver::Firefox::Profile.new profile.native_events = true WebDriver::Driver.for :firefox, :profile => profile else WebDriver::Driver.for :firefox end end def create_chrome_driver binary = ENV['chrome_binary'] if binary WebDriver::Chrome.path = binary end server = ENV['chromedriver'] || ENV['chrome_server'] if server WebDriver::Chrome.driver_path = server end args = [] args << "--no-sandbox" if ENV['TRAVIS'] WebDriver::Driver.for :chrome, :native_events => native_events?, :args => args # :http_client => keep_alive_client || http_client end def create_phantomjs_driver binary = ENV['phantomjs_binary'] if binary WebDriver::PhantomJS.path = binary end WebDriver::Driver.for :phantomjs end def create_iphone_driver url = ENV['iphone_url'] if url WebDriver::Driver.for :iphone, :url => url else WebDriver::Driver.for :iphone end end def create_safari_driver if ENV['timeout'] WebDriver::Driver.for :safari, :timeout => Integer(ENV['timeout']) else WebDriver::Driver.for :safari end end def keep_alive_client require 'selenium/webdriver/remote/http/persistent' STDERR.puts "INFO: using net-http-persistent" Selenium::WebDriver::Remote::Http::Persistent.new rescue LoadError # net-http-persistent not available end def http_client Selenium::WebDriver::Remote::Http::Default.new end end # TestEnvironment end # SpecSupport end # WebDriver end # Selenium
{ "content_hash": "fd267d87f6ba595dae7ead3d51d89cf5", "timestamp": "", "source": "github", "line_count": 234, "max_line_length": 126, "avg_line_length": 27.311965811965813, "alnum_prop": 0.5019558754498513, "repo_name": "gotcha/selenium", "id": "aa0061043cdcf9ee7b9d4d3ff8891d3d7d41d879", "size": "7199", "binary": false, "copies": "10", "ref": "refs/heads/master", "path": "rb/spec/integration/selenium/webdriver/spec_support/test_environment.rb", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "ASP", "bytes": "825" }, { "name": "AppleScript", "bytes": "2614" }, { "name": "Batchfile", "bytes": "307" }, { "name": "C", "bytes": "59599" }, { "name": "C#", "bytes": "2672029" }, { "name": "C++", "bytes": "1703983" }, { "name": "CSS", "bytes": "25162" }, { "name": "HTML", "bytes": "1863503" }, { "name": "Java", "bytes": "5258756" }, { "name": "JavaScript", "bytes": "5100720" }, { "name": "Makefile", "bytes": "4655" }, { "name": "Python", "bytes": "663221" }, { "name": "Ragel in Ruby Host", "bytes": "3086" }, { "name": "Ruby", "bytes": "956635" }, { "name": "Shell", "bytes": "1031" }, { "name": "XSLT", "bytes": "1047" } ] }
package io.seldon.general; import io.seldon.api.resource.ResourceBean; public class ItemType extends ResourceBean { /** * is there a reason this shouldn't act like a bean? */ private Integer typeId; private String name; private Integer linkType; private Boolean semantic; public ItemType() {} public ItemType(Integer typeId, String name) { super(); this.typeId = typeId; this.name = name; } public int getTypeId() { return typeId; } public void setTypeId(Integer typeId) { this.typeId = typeId; } public String getName() { return name; } public void setName(String name) { this.name = name; } public Integer getLinkType() { return linkType; } public void setLinkType(Integer linkType) { this.linkType = linkType; } public Boolean getSemantic() { return semantic; } public void setSemantic(Boolean semantic) { this.semantic = semantic; } @Override public String toKey() { return typeId.toString(); } }
{ "content_hash": "87dd46cbbf562eac1476e187030c3597", "timestamp": "", "source": "github", "line_count": 62, "max_line_length": 53, "avg_line_length": 15.806451612903226, "alnum_prop": 0.6928571428571428, "repo_name": "SeldonIO/seldon-server", "id": "94380e7b4afb04ab6ff4adf54a91fbf10d707c60", "size": "1921", "binary": false, "copies": "14", "ref": "refs/heads/master", "path": "server/src/io/seldon/general/ItemType.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "1926357" }, { "name": "JavaScript", "bytes": "48430" }, { "name": "Jupyter Notebook", "bytes": "112349" }, { "name": "Makefile", "bytes": "56033" }, { "name": "Python", "bytes": "595373" }, { "name": "Ruby", "bytes": "423" }, { "name": "Scala", "bytes": "378790" }, { "name": "Shell", "bytes": "122552" } ] }
package org.renjin.primitives; import org.renjin.eval.Context; import org.renjin.eval.EvalException; import org.renjin.primitives.annotations.processor.ArgumentException; import org.renjin.primitives.annotations.processor.ArgumentIterator; import org.renjin.primitives.annotations.processor.WrapperRuntime; import org.renjin.sexp.BuiltinFunction; import org.renjin.sexp.Environment; import org.renjin.sexp.FunctionCall; import org.renjin.sexp.PairList; import org.renjin.sexp.SEXP; import org.renjin.sexp.StringVector; import org.renjin.sexp.Vector; public class R$primitive$attr$assign extends BuiltinFunction { public R$primitive$attr$assign() { super("attr<-"); } public SEXP apply(Context context, Environment environment, FunctionCall call, PairList args) { try { ArgumentIterator argIt = new ArgumentIterator(context, environment, args); SEXP s0 = argIt.evalNext(); SEXP s1 = argIt.evalNext(); SEXP s2 = argIt.evalNext(); if (!argIt.hasNext()) { return this.doApply(context, environment, s0, s1, s2); } throw new EvalException("attr<-: too many arguments, expected at most 3."); } catch (ArgumentException e) { throw new EvalException(context, "Invalid argument: %s. Expected:\n\tattr<-(any, character(1), any)", e.getMessage()); } catch (EvalException e) { e.initContext(context); throw e; } catch (RuntimeException e) { throw e; } catch (Exception e) { throw new EvalException(e); } } public static SEXP doApply(Context context, Environment environment, FunctionCall call, String[] argNames, SEXP[] args) { try { if ((args.length) == 3) { return doApply(context, environment, args[ 0 ], args[ 1 ], args[ 2 ]); } } catch (EvalException e) { e.initContext(context); throw e; } catch (RuntimeException e) { throw e; } catch (Exception e) { throw new EvalException(e); } throw new EvalException("attr<-: max arity is 3"); } public SEXP apply(Context context, Environment environment, FunctionCall call, String[] argNames, SEXP[] args) { return R$primitive$attr$assign.doApply(context, environment, call, argNames, args); } public static SEXP doApply(Context context, Environment environment, SEXP arg0, SEXP arg1, SEXP arg2) throws Exception { if (((arg0 instanceof SEXP)&&((arg1 instanceof Vector)&&StringVector.VECTOR_TYPE.isWiderThanOrEqualTo(((Vector) arg1))))&&(arg2 instanceof SEXP)) { return Attributes.setAttribute(((SEXP) arg0), WrapperRuntime.convertToString(arg1), ((SEXP) arg2)); } else { throw new EvalException(String.format("Invalid argument:\n\tattr<-(%s, %s, %s)\n\tExpected:\n\tattr<-(any, character(1), any)", arg0 .getTypeName(), arg1 .getTypeName(), arg2 .getTypeName())); } } }
{ "content_hash": "432ebcbbdcd2063de05decbe8363c0fb", "timestamp": "", "source": "github", "line_count": 77, "max_line_length": 204, "avg_line_length": 39.96103896103896, "alnum_prop": 0.6392590185245369, "repo_name": "bedatadriven/renjin-statet", "id": "8a24efa50f34f7d108cff27f0ae9f481899e8877", "size": "3078", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "org.renjin.core/src-gen/org/renjin/primitives/R$primitive$attr$assign.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "4900103" } ] }
<?php namespace Concrete\Core\Permission\Access; use Database; use Page; use PermissionKey; class AddBlockBlockTypeAccess extends BlockTypeAccess { public function duplicate($newPA = false) { $newPA = parent::duplicate($newPA); $db = Database::connection(); $r = $db->executeQuery('select * from BlockTypePermissionBlockTypeAccessList where paID = ?', array($this->getPermissionAccessID())); while ($row = $r->FetchRow()) { $v = array($row['peID'], $newPA->getPermissionAccessID(), $row['permission']); $db->executeQuery('insert into BlockTypePermissionBlockTypeAccessList (peID, paID, permission) values (?, ?, ?)', $v); } $r = $db->executeQuery('select * from BlockTypePermissionBlockTypeAccessListCustom where paID = ?', array($this->getPermissionAccessID())); while ($row = $r->FetchRow()) { $v = array($row['peID'], $newPA->getPermissionAccessID(), $row['btID']); $db->executeQuery('insert into BlockTypePermissionBlockTypeAccessListCustom (peID, paID, btID) values (?, ?, ?)', $v); } return $newPA; } public function save($args = array()) { parent::save(); $db = Database::connection(); $db->executeQuery('delete from BlockTypePermissionBlockTypeAccessList where paID = ?', array($this->getPermissionAccessID())); $db->executeQuery('delete from BlockTypePermissionBlockTypeAccessListCustom where paID = ?', array($this->getPermissionAccessID())); if (is_array($args['blockTypesIncluded'])) { foreach ($args['blockTypesIncluded'] as $peID => $permission) { $v = array($this->getPermissionAccessID(), $peID, $permission); $db->executeQuery('insert into BlockTypePermissionBlockTypeAccessList (paID, peID, permission) values (?, ?, ?)', $v); } } if (is_array($args['blockTypesExcluded'])) { foreach ($args['blockTypesExcluded'] as $peID => $permission) { $v = array($this->getPermissionAccessID(), $peID, $permission); $db->executeQuery('insert into BlockTypePermissionBlockTypeAccessList (paID, peID, permission) values (?, ?, ?)', $v); } } if (is_array($args['btIDInclude'])) { foreach ($args['btIDInclude'] as $peID => $btIDs) { foreach ($btIDs as $btID) { $v = array($this->getPermissionAccessID(), $peID, $btID); $db->executeQuery('insert into BlockTypePermissionBlockTypeAccessListCustom (paID, peID, btID) values (?, ?, ?)', $v); } } } if (is_array($args['btIDExclude'])) { foreach ($args['btIDExclude'] as $peID => $btIDs) { foreach ($btIDs as $btID) { $v = array($this->getPermissionAccessID(), $peID, $btID); $db->executeQuery('insert into BlockTypePermissionBlockTypeAccessListCustom (paID, peID, btID) values (?, ?, ?)', $v); } } } } public function getAccessListItems($accessType = PermissionKey::ACCESS_TYPE_INCLUDE, $filterEntities = array()) { $db = Database::connection(); $list = parent::getAccessListItems($accessType, $filterEntities); foreach ($list as $l) { $pe = $l->getAccessEntityObject(); if (isset($this->permissionObjectToCheck) && ($this->permissionObjectToCheck instanceof Page) && ($l->getAccessType() == PermissionKey::ACCESS_TYPE_INCLUDE)) { $permission = 'A'; } else { $permission = $db->fetchColumn('select permission from BlockTypePermissionBlockTypeAccessList where paID = ? and peID = ?', array($l->getPermissionAccessID(), $pe->getAccessEntityID())); if ($permission != 'N' && $permission != 'C') { $permission = 'A'; } } $l->setBlockTypesAllowedPermission($permission); if ($permission == 'C') { $btIDs = $db->GetCol('select btID from BlockTypePermissionBlockTypeAccessListCustom where paID = ? and peID = ?', array($l->getPermissionAccessID(), $pe->getAccessEntityID())); $l->setBlockTypesAllowedArray($btIDs); } } return $list; } }
{ "content_hash": "fac787280c5116f4c56d630febf6f3eb", "timestamp": "", "source": "github", "line_count": 91, "max_line_length": 202, "avg_line_length": 48.175824175824175, "alnum_prop": 0.582344890510949, "repo_name": "bfrable/nwds", "id": "1f40b2a47d5ce4e27facc1a97f2311417a221240", "size": "4384", "binary": false, "copies": "15", "ref": "refs/heads/master", "path": "concrete/src/Permission/Access/AddBlockBlockTypeAccess.php", "mode": "33188", "license": "mit", "language": [ { "name": "ActionScript", "bytes": "169013" }, { "name": "Batchfile", "bytes": "41" }, { "name": "CSS", "bytes": "495504" }, { "name": "JavaScript", "bytes": "742653" }, { "name": "PHP", "bytes": "6318255" }, { "name": "Shell", "bytes": "355" } ] }
package cc.mallet.grmm.test; import junit.framework.*; import java.util.List; import java.util.ArrayList; import cc.mallet.grmm.inference.Inferencer; import cc.mallet.grmm.inference.TRP; import cc.mallet.grmm.types.*; import cc.mallet.util.Randoms; /** * $Id: TestAbstractBeliefPropagation.java,v 1.1 2007/10/22 21:37:40 mccallum Exp $ */ public class TestAbstractBeliefPropagation extends TestCase { public TestAbstractBeliefPropagation (String name) { super (name); } /** * @return a <code>TestSuite</code> */ public static TestSuite suite () { return new TestSuite (TestAbstractBeliefPropagation.class); } public void testBadVariable () { FactorGraph fg = createBoltzmannChain (5); Assignment assn = fg.sampleContinuousVars (new Randoms (23423)); FactorGraph sliced = (FactorGraph) fg.slice (assn); Inferencer bp = new TRP (); bp.computeMarginals (sliced); try { bp.lookupMarginal (new Variable (2)); fail ("Expected exception"); } catch (IllegalArgumentException e) { // expected System.out.println ("OK: As expected, got exception "+e); } } static FactorGraph createBoltzmannChain (int len) { Randoms r = new Randoms (3241321); List<Variable> vars = new ArrayList<Variable> (); for (int i = 0; i < len; i++) { Variable x_i = new Variable (2); x_i.setLabel ("X_"+i); vars.add (x_i); } List<Factor> factors = new ArrayList<Factor> (vars.size ()); // node factors for (int i = 0; i < len; i++) { double u = r.nextUniform (-4.0, 4.0); factors.add (new BoltzmannUnaryFactor (vars.get (i), u)); } // edge factors for (int i = 0; i < len-1; i++) { Variable alpha = new Variable (Variable.CONTINUOUS); alpha.setLabel ("ALPHA_"+i); factors.add (new UniformFactor (alpha, -4.0, 4.0)); factors.add (new PottsTableFactor (vars.get (i), vars.get(i+1), alpha)); } return new FactorGraph (factors); } public static void main (String[] args) { TestSuite theSuite; if (args.length > 0) { theSuite = new TestSuite (); for (int i = 0; i < args.length; i++) { theSuite.addTest (new TestAbstractBeliefPropagation (args[i])); } } else { theSuite = (TestSuite) suite (); } junit.textui.TestRunner.run (theSuite); } }
{ "content_hash": "af3282f34457ff201986840c81406a5f", "timestamp": "", "source": "github", "line_count": 97, "max_line_length": 83, "avg_line_length": 24.515463917525775, "alnum_prop": 0.6291000841042893, "repo_name": "xiaohan2012/lst", "id": "e565a59ff127bcbb1be72606149b50dfd003b25d", "size": "2794", "binary": false, "copies": "39", "ref": "refs/heads/master", "path": "external/mallet-2.0.8RC3/src/cc/mallet/grmm/test/TestAbstractBeliefPropagation.java", "mode": "33188", "license": "mit", "language": [ { "name": "HTML", "bytes": "23944" }, { "name": "JavaScript", "bytes": "12920" }, { "name": "Makefile", "bytes": "480" }, { "name": "Python", "bytes": "326635" }, { "name": "Shell", "bytes": "27798" } ] }
import {StyleSheet} from 'react-native'; import {paragraph} from '../app/app.style'; export default StyleSheet.create({ container: { flex: 1, alignItems: 'center', flexDirection: 'row' }, input: { ...paragraph, paddingRight: 20, flex: 1 }, inputCompleted: { color: '#CDCDCD' }, checkbox: { width: 30, height: 30, marginRight: 20, marginLeft: 20 } });
{ "content_hash": "476fc05bdf7c670dcda57fdd8ae0181b", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 43, "avg_line_length": 17.166666666666668, "alnum_prop": 0.587378640776699, "repo_name": "nason/este", "id": "67ac7a1a9d814337b61f7a2b5f25c2ab975a0911", "size": "412", "binary": false, "copies": "8", "ref": "refs/heads/master", "path": "native/src/todos/todo.style.js", "mode": "33261", "license": "mit", "language": [ { "name": "CSS", "bytes": "2187" }, { "name": "JavaScript", "bytes": "87251" }, { "name": "Objective-C", "bytes": "3437" } ] }
package kensyu2016; import java.text.DecimalFormat; import java.text.NumberFormat; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; import java.util.GregorianCalendar; public class DateMain { public static void main(String[] args) { System.out.println(new Date()); System.out.println(new Date(0)); System.out.println(new Date().getTime()); System.out.println(System.currentTimeMillis()); Calendar c = new GregorianCalendar(); c.add(Calendar.DATE, 90); System.out.println(c); System.out.println(c.get(Calendar.YEAR)); System.out.println(c.get(Calendar.MONTH) + 1); System.out.println(c.get(Calendar.DATE)); SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss.SSS"); System.out.println(sdf.format(c.getTime())); DecimalFormat df = new DecimalFormat("#,##0"); System.out.println(df.format(100)); System.out.println(df.format(1000000)); NumberFormat nf1 = NumberFormat.getNumberInstance(); System.out.println(nf1.format(1000)); NumberFormat nf2 = NumberFormat.getCurrencyInstance(); System.out.println(nf2.format(1000)); NumberFormat nf3 = NumberFormat.getPercentInstance(); System.out.println(nf3.format(0.12)); } }
{ "content_hash": "8d40d6d0cfc026717c866432e0dc5148", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 73, "avg_line_length": 33.611111111111114, "alnum_prop": 0.7413223140495868, "repo_name": "hiuchida/exam", "id": "362a2314f37d13bee9b79f64ed3105a06035929a", "size": "1210", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "java/kensyu2016/DateMain.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "7478" }, { "name": "C", "bytes": "30041" }, { "name": "Java", "bytes": "650423" }, { "name": "Shell", "bytes": "6927" } ] }
<?php namespace Symfony\Bridge\Doctrine\DependencyInjection\CompilerPass; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; use Symfony\Component\Config\Resource\FileResource; /** * Registers additional validators * * @author Benjamin Eberlei <kontakt@beberlei.de> */ class DoctrineValidationPass implements CompilerPassInterface { /** * @var string */ private $managerType; public function __construct($managerType) { $this->managerType = $managerType; } /** * {@inheritDoc} */ public function process(ContainerBuilder $container) { $this->updateValidatorMappingFiles($container, 'xml', 'xml'); $this->updateValidatorMappingFiles($container, 'yaml', 'yml'); } /** * Gets the validation mapping files for the format and extends them with * files matching a doctrine search pattern (Resources/config/validation.orm.xml) * * @param ContainerBuilder $container * @param string $mapping * @param string $extension */ private function updateValidatorMappingFiles(ContainerBuilder $container, $mapping, $extension) { if (!$container->hasParameter('validator.mapping.loader.'.$mapping.'_files_loader.mapping_files')) { return; } $files = $container->getParameter('validator.mapping.loader.'.$mapping.'_files_loader.mapping_files'); $validationPath = 'Resources/config/validation.'.$this->managerType.'.'.$extension; foreach ($container->getParameter('kernel.bundles') as $bundle) { $reflection = new \ReflectionClass($bundle); if (is_file($file = dirname($reflection->getFilename()).'/'.$validationPath)) { $files[] = realpath($file); $container->addResource(new FileResource($file)); } } $container->setParameter('validator.mapping.loader.'.$mapping.'_files_loader.mapping_files', $files); } }
{ "content_hash": "7e98ad5b90b4d4ab3deeb6e3b1f49393", "timestamp": "", "source": "github", "line_count": 64, "max_line_length": 110, "avg_line_length": 33.40625, "alnum_prop": 0.6361085126286249, "repo_name": "javieralfaya/tuitty", "id": "1372f73dac84d40c46319afe958efded87e8ce77", "size": "2374", "binary": false, "copies": "10", "ref": "refs/heads/master", "path": "vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/DependencyInjection/CompilerPass/DoctrineValidationPass.php", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "18385" }, { "name": "PHP", "bytes": "108817" }, { "name": "Shell", "bytes": "188" } ] }
bpsnip_gateway_api_gamma_support_install_experimental_crds() { kubectl kustomize "github.com/kubernetes-sigs/gateway-api/config/crd/experimental?ref=v0.5.1" | kubectl apply -f - }
{ "content_hash": "5f25db19ffb8740f1cdabe1062bfe132", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 114, "avg_line_length": 60, "alnum_prop": 0.7833333333333333, "repo_name": "istio/istio.io", "id": "b619096295e2a8d29d967a728b49fc9252d783d1", "size": "1190", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "content/en/boilerplates/snips/gateway-api-gamma-support.sh", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "70128" }, { "name": "Go", "bytes": "39192" }, { "name": "HTML", "bytes": "866919838" }, { "name": "JavaScript", "bytes": "372035" }, { "name": "Makefile", "bytes": "18567" }, { "name": "Python", "bytes": "8488" }, { "name": "Ruby", "bytes": "634" }, { "name": "SCSS", "bytes": "117075" }, { "name": "Shell", "bytes": "8934097" }, { "name": "TypeScript", "bytes": "75683" } ] }
package cucumber.api.guice; import cucumber.runtime.java.guice.ScenarioScope; import cucumber.runtime.java.guice.impl.SequentialScenarioScope; /** * Provides a convenient <code>cucumber.runtime.java.guice.ScenarioScope</code> instance for use when declaring bindings * in implementations of <code>com.google.inject.Module</code>. */ public class CucumberScopes { public static final ScenarioScope SCENARIO = new SequentialScenarioScope(); }
{ "content_hash": "4da5a82cb9617c0250f7a9dc85a8bbc1", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 120, "avg_line_length": 37.5, "alnum_prop": 0.7977777777777778, "repo_name": "rlagunov-anaplan/cucumber-jvm", "id": "b9dac0041534c14254448d17dfaf69de9118460f", "size": "450", "binary": false, "copies": "24", "ref": "refs/heads/master", "path": "guice/src/main/java/cucumber/api/guice/CucumberScopes.java", "mode": "33188", "license": "mit", "language": [ { "name": "API Blueprint", "bytes": "2003" }, { "name": "Clojure", "bytes": "8055" }, { "name": "Cucumber", "bytes": "18779" }, { "name": "Gosu", "bytes": "552" }, { "name": "Groovy", "bytes": "4652" }, { "name": "HTML", "bytes": "10212" }, { "name": "Java", "bytes": "1153724" }, { "name": "JavaScript", "bytes": "3815" }, { "name": "Python", "bytes": "3028" }, { "name": "Ruby", "bytes": "8674" }, { "name": "Scala", "bytes": "42250" }, { "name": "Shell", "bytes": "192" } ] }
package br.com.ime.ocrDoacao.dao; import javax.persistence.EntityManager; import br.com.caelum.vraptor.ioc.Component; import br.com.ime.ocrDoacao.model.NotaFiscal; @Component public class NotaFiscalDao { private EntityManager em; public NotaFiscalDao(EntityManager em) { this.em = em; } public void adicionaNotaFiscal(NotaFiscal nf) { em.persist(nf); } }
{ "content_hash": "3f65a71ccb9db19d0c9d4f623de7c31d", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 48, "avg_line_length": 18.8, "alnum_prop": 0.7553191489361702, "repo_name": "mxball/ocrDoacao", "id": "8c0e23e9733fb4d92d99bc77ff9d56ba84c4dbf2", "size": "376", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/main/java/br/com/ime/ocrDoacao/dao/NotaFiscalDao.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "784" }, { "name": "Java", "bytes": "13520" } ] }
End of preview.

No dataset card yet

Downloads last month
4