text
stringlengths
2
1.04M
meta
dict
namespace Volt { AppTime* AppTime::instance = NULL; }
{ "content_hash": "35c2b44624a3682de242b2016119388e", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 34, "avg_line_length": 11.2, "alnum_prop": 0.6964285714285714, "repo_name": "aquach/volt", "id": "48a2badd7075036430ec4377214b7cc1fa543b14", "size": "88", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Volt/Game/AppTime.cpp", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "4546727" }, { "name": "C#", "bytes": "29997" }, { "name": "C++", "bytes": "3402343" }, { "name": "Objective-C", "bytes": "30760" }, { "name": "Python", "bytes": "136015" }, { "name": "Shell", "bytes": "775" } ], "symlink_target": "" }
/*globals angular */ (function(ndnd) { ndnd.controller('profileCtrl', [ '$state', '$mdDialog', 'user', 'heroes', 'sheets', function($state, $mdDialog, user, heroes, sheets) { var ctrl = this; ctrl.heroes = []; ctrl.selectedHero = null; ctrl.profile = user.profile; ctrl.createHero = createHero; ctrl.selectHero = selectHero; ctrl.deselectHero = deselectHero; ctrl.deleteHero = deleteHero; ctrl.editHero = editHero; ctrl.createSheet = createSheet; ctrl.selectSheet = selectSheet; loadHeroes(); function loadHeroes() { heroes.fetch().then(data => ctrl.heroes = data); } function createHero() { $state.go('ndnd.hero', { id: 'new' }); } function selectHero(hero) { ctrl.selectedHero = hero; loadSheets(hero._id); } function deselectHero() { ctrl.selectedHero = null; } function editHero(hero) { $state.go('ndnd.hero', { id: hero._id }); } function deleteHero(hero, $event) { var $index = ctrl.heroes.findIndex(h => h._id === hero._id); var confirm = $mdDialog.confirm() .title('Please confirm') .textContent(`Would you like to delete ${hero.name}?`) .ariaLabel('Confirm delete') .targetEvent($event) .ok('Yeah') .cancel('Nope'); $mdDialog.show(confirm).then(function() { ctrl.selectedHero = null; heroes.remove(hero._id).then(function() { ctrl.heroes.splice($index, 1); }); }); } function loadSheets(heroId) { ctrl.sheets = []; sheets.fetchByHero(heroId).then(data => ctrl.sheets = data); } function selectSheet() { } function createSheet() { } } ]); })(angular.module('ndnd'));
{ "content_hash": "7f415e1448e8e85915c9cc09c45d8e02", "timestamp": "", "source": "github", "line_count": 92, "max_line_length": 68, "avg_line_length": 21.065217391304348, "alnum_prop": 0.5309597523219814, "repo_name": "sh0uzama/ndnd", "id": "8b6a007166168a4635ff20fcb57fb7d64db5f0c0", "size": "1938", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "client/angular/ctrl/profile/profileCtrl.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "8806" }, { "name": "HTML", "bytes": "22379" }, { "name": "JavaScript", "bytes": "54298" } ], "symlink_target": "" }
using System; using Microsoft.EntityFrameworkCore; using Web.Models; namespace WebTests.ViewModels { public class BaseViewModelTest { protected ApplicationDbContext CreateDbContext() { var optionsBuilder = new DbContextOptionsBuilder<ApplicationDbContext>(); optionsBuilder.UseInMemoryDatabase(); var db = new ApplicationDbContext(optionsBuilder.Options); db.Libraries.Add(new Library { CreatedByUserId = "dbo", CreatedOn = DateTimeOffset.Now, ModifiedOn = DateTimeOffset.Now, Name = "Test Library", Status = StatusTypes.Active }); db.SaveChanges(); return db; } } }
{ "content_hash": "a0f17b4751ec2351cfc7deb35471a5b8", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 85, "avg_line_length": 25.322580645161292, "alnum_prop": 0.5808917197452229, "repo_name": "lruckman/DRS", "id": "741054e8b1365c293410850955555028aaeab945", "size": "787", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "test/WebTests/ViewModels/BaseViewModelTest.cs", "mode": "33188", "license": "mit", "language": [ { "name": "C#", "bytes": "219260" }, { "name": "CSS", "bytes": "6944" }, { "name": "HTML", "bytes": "24958" }, { "name": "JavaScript", "bytes": "1849" }, { "name": "TypeScript", "bytes": "60961" } ], "symlink_target": "" }
include(ExternalProject) find_package(Git REQUIRED) ExternalProject_Add( catch PREFIX ${CMAKE_BINARY_DIR}/external/catch GIT_REPOSITORY https://github.com/philsquared/Catch.git TIMEOUT 10 UPDATE_COMMAND ${GIT_EXECUTABLE} pull CONFIGURE_COMMAND "" BUILD_COMMAND "" INSTALL_COMMAND "" LOG_DOWNLOAD ON ) # Expose required variable (CATCH_INCLUDE_DIR) to parent scope ExternalProject_Get_Property(catch source_dir) message(STATUS "Catch source dir is: ${source_dir}") set(CATCH_INCLUDE_DIR ${source_dir}/include CACHE INTERNAL "Path to include folder for Catch")
{ "content_hash": "8f5c489b5a1d77a9f759002fec27e63f", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 94, "avg_line_length": 30, "alnum_prop": 0.7366666666666667, "repo_name": "KevinW1998/csv-reader-extended", "id": "4a7781bcdd805c76f55d6349e44845f389b0c7da", "size": "601", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "cmake/load_catch.cmake", "mode": "33188", "license": "mit", "language": [ { "name": "C++", "bytes": "48444" }, { "name": "CMake", "bytes": "1224" } ], "symlink_target": "" }
<?php /** * Ionize * * Default Email template for : System User Message * This email is send to the user when his account was changed by one Administrator * * IMPORTANT : * Because this template is used by the backend, it doesn't use Ionize's Tags * * Copy this file to /themes/<your_theme>/mail/contact/to_user.php * to replace it by yours. * * IMPORTANT : * Do not modify this file. * It will be overwritten when migrating to a new Ionize release. * */ ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title><ion:data:subject /></title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <meta http-equiv="Content-Language" content="<ion:current_lang />" /> <style type="text/css"> body{ color: #000; font-family: arial, verdana, sans-serif; font-size: 10pt; line-height: 1.2em; background-color: #fff; } h1{ display: block; color: #2563A1; font-family: arial, verdana, sans-serif; font-size: 14pt; text-align: left; line-height: 1.2em; margin-top: 0; font-weight: normal; } h2{ display: block; color: #2563A1; font-family: arial, verdana, sans-serif; font-size: 12pt; text-align: left; line-height: 1.2em; margin: 20px 0 0 0; font-weight: normal; } p{margin: 8px 0;} a:link, a:visited, a:active, a:hover{ color: #098ED1; text-decoration: underline; font-weight: normal; } a:hover { color: #2563A1; text-decoration: none; } </style> </head> <body> <table border="0" width="100%" cellpadding="0" cellspacing="0"> <tr> <td class="bg_fade"> <table border="0" width="880"> <tr> <td> <h1><?php echo lang('ionize_mail_user_intro', $username) ?></h1> <p><?php echo $message_intro ?></p> <p><?php echo $message ?></p> <h2><?php echo lang('ionize_mail_account_details') ?></h2> <p> <?php echo lang('ionize_label_firstname') ?>: <strong><?php echo $firstname ?></strong><br/> <?php echo lang('ionize_label_lastname') ?>: <strong><?php echo $lastname ?></strong><br/> <?php echo lang('ionize_label_email') ?>: <strong><?php echo $email ?></strong><br/> <?php echo lang('ionize_label_role') ?>: <strong><?php echo $role ?></strong><br/> </p> <p> <br/> <?php echo lang('ionize_mail_thank_you_for_using_our_website', Settings::get('site_title')) ?> </p> <p> <br/> <?php echo lang('ionize_mail_signature', Settings::get('site_title')) ?> </p> <p style="font-size: 8px;color: #444;"> <br/> <br/> <?php echo lang('ionize_mail_automatic_message_warning') ?> </p> </td> </tr> </table> </td> </tr> </table> </body> </html>
{ "content_hash": "3b1f8d7648baa09b37cec4323a78e11d", "timestamp": "", "source": "github", "line_count": 108, "max_line_length": 121, "avg_line_length": 27.453703703703702, "alnum_prop": 0.5763912310286677, "repo_name": "adamos42/ionize", "id": "c830b311f844679375635b7ccd87dd80d0590894", "size": "2965", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "application/views/mail/system/to_user.php", "mode": "33188", "license": "mit", "language": [ { "name": "ApacheConf", "bytes": "3289" }, { "name": "CSS", "bytes": "11386" }, { "name": "HTML", "bytes": "13825" }, { "name": "JavaScript", "bytes": "1964" }, { "name": "PHP", "bytes": "237791" }, { "name": "PLpgSQL", "bytes": "33975" } ], "symlink_target": "" }
from collections import OrderedDict import functools import os import re from typing import ( Dict, Mapping, MutableMapping, MutableSequence, Optional, Sequence, Tuple, Type, Union, cast, ) from google.api_core import client_options as client_options_lib from google.api_core import exceptions as core_exceptions from google.api_core import extended_operation, gapic_v1 from google.api_core import retry as retries from google.auth import credentials as ga_credentials # type: ignore from google.auth.exceptions import MutualTLSChannelError # type: ignore from google.auth.transport import mtls # type: ignore from google.auth.transport.grpc import SslCredentials # type: ignore from google.oauth2 import service_account # type: ignore import pkg_resources try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] except AttributeError: # pragma: NO COVER OptionalRetry = Union[retries.Retry, object] # type: ignore from google.api_core import extended_operation # type: ignore from google.cloud.compute_v1.services.images import pagers from google.cloud.compute_v1.types import compute from .transports.base import DEFAULT_CLIENT_INFO, ImagesTransport from .transports.rest import ImagesRestTransport class ImagesClientMeta(type): """Metaclass for the Images client. This provides class-level methods for building and retrieving support objects (e.g. transport) without polluting the client instance objects. """ _transport_registry = OrderedDict() # type: Dict[str, Type[ImagesTransport]] _transport_registry["rest"] = ImagesRestTransport def get_transport_class( cls, label: Optional[str] = None, ) -> Type[ImagesTransport]: """Returns an appropriate transport class. Args: label: The name of the desired transport. If none is provided, then the first transport in the registry is used. Returns: The transport class to use. """ # If a specific transport is requested, return that one. if label: return cls._transport_registry[label] # No transport is requested; return the default (that is, the first one # in the dictionary). return next(iter(cls._transport_registry.values())) class ImagesClient(metaclass=ImagesClientMeta): """The Images API.""" @staticmethod def _get_default_mtls_endpoint(api_endpoint): """Converts api endpoint to mTLS endpoint. Convert "*.sandbox.googleapis.com" and "*.googleapis.com" to "*.mtls.sandbox.googleapis.com" and "*.mtls.googleapis.com" respectively. Args: api_endpoint (Optional[str]): the api endpoint to convert. Returns: str: converted mTLS api endpoint. """ if not api_endpoint: return api_endpoint mtls_endpoint_re = re.compile( r"(?P<name>[^.]+)(?P<mtls>\.mtls)?(?P<sandbox>\.sandbox)?(?P<googledomain>\.googleapis\.com)?" ) m = mtls_endpoint_re.match(api_endpoint) name, mtls, sandbox, googledomain = m.groups() if mtls or not googledomain: return api_endpoint if sandbox: return api_endpoint.replace( "sandbox.googleapis.com", "mtls.sandbox.googleapis.com" ) return api_endpoint.replace(".googleapis.com", ".mtls.googleapis.com") DEFAULT_ENDPOINT = "compute.googleapis.com" DEFAULT_MTLS_ENDPOINT = _get_default_mtls_endpoint.__func__( # type: ignore DEFAULT_ENDPOINT ) @classmethod def from_service_account_info(cls, info: dict, *args, **kwargs): """Creates an instance of this client using the provided credentials info. Args: info (dict): The service account private key info. args: Additional arguments to pass to the constructor. kwargs: Additional arguments to pass to the constructor. Returns: ImagesClient: The constructed client. """ credentials = service_account.Credentials.from_service_account_info(info) kwargs["credentials"] = credentials return cls(*args, **kwargs) @classmethod def from_service_account_file(cls, filename: str, *args, **kwargs): """Creates an instance of this client using the provided credentials file. Args: filename (str): The path to the service account private key json file. args: Additional arguments to pass to the constructor. kwargs: Additional arguments to pass to the constructor. Returns: ImagesClient: The constructed client. """ credentials = service_account.Credentials.from_service_account_file(filename) kwargs["credentials"] = credentials return cls(*args, **kwargs) from_service_account_json = from_service_account_file @property def transport(self) -> ImagesTransport: """Returns the transport used by the client instance. Returns: ImagesTransport: The transport used by the client instance. """ return self._transport @staticmethod def common_billing_account_path( billing_account: str, ) -> str: """Returns a fully-qualified billing_account string.""" return "billingAccounts/{billing_account}".format( billing_account=billing_account, ) @staticmethod def parse_common_billing_account_path(path: str) -> Dict[str, str]: """Parse a billing_account path into its component segments.""" m = re.match(r"^billingAccounts/(?P<billing_account>.+?)$", path) return m.groupdict() if m else {} @staticmethod def common_folder_path( folder: str, ) -> str: """Returns a fully-qualified folder string.""" return "folders/{folder}".format( folder=folder, ) @staticmethod def parse_common_folder_path(path: str) -> Dict[str, str]: """Parse a folder path into its component segments.""" m = re.match(r"^folders/(?P<folder>.+?)$", path) return m.groupdict() if m else {} @staticmethod def common_organization_path( organization: str, ) -> str: """Returns a fully-qualified organization string.""" return "organizations/{organization}".format( organization=organization, ) @staticmethod def parse_common_organization_path(path: str) -> Dict[str, str]: """Parse a organization path into its component segments.""" m = re.match(r"^organizations/(?P<organization>.+?)$", path) return m.groupdict() if m else {} @staticmethod def common_project_path( project: str, ) -> str: """Returns a fully-qualified project string.""" return "projects/{project}".format( project=project, ) @staticmethod def parse_common_project_path(path: str) -> Dict[str, str]: """Parse a project path into its component segments.""" m = re.match(r"^projects/(?P<project>.+?)$", path) return m.groupdict() if m else {} @staticmethod def common_location_path( project: str, location: str, ) -> str: """Returns a fully-qualified location string.""" return "projects/{project}/locations/{location}".format( project=project, location=location, ) @staticmethod def parse_common_location_path(path: str) -> Dict[str, str]: """Parse a location path into its component segments.""" m = re.match(r"^projects/(?P<project>.+?)/locations/(?P<location>.+?)$", path) return m.groupdict() if m else {} @classmethod def get_mtls_endpoint_and_cert_source( cls, client_options: Optional[client_options_lib.ClientOptions] = None ): """Return the API endpoint and client cert source for mutual TLS. The client cert source is determined in the following order: (1) if `GOOGLE_API_USE_CLIENT_CERTIFICATE` environment variable is not "true", the client cert source is None. (2) if `client_options.client_cert_source` is provided, use the provided one; if the default client cert source exists, use the default one; otherwise the client cert source is None. The API endpoint is determined in the following order: (1) if `client_options.api_endpoint` if provided, use the provided one. (2) if `GOOGLE_API_USE_CLIENT_CERTIFICATE` environment variable is "always", use the default mTLS endpoint; if the environment variabel is "never", use the default API endpoint; otherwise if client cert source exists, use the default mTLS endpoint, otherwise use the default API endpoint. More details can be found at https://google.aip.dev/auth/4114. Args: client_options (google.api_core.client_options.ClientOptions): Custom options for the client. Only the `api_endpoint` and `client_cert_source` properties may be used in this method. Returns: Tuple[str, Callable[[], Tuple[bytes, bytes]]]: returns the API endpoint and the client cert source to use. Raises: google.auth.exceptions.MutualTLSChannelError: If any errors happen. """ if client_options is None: client_options = client_options_lib.ClientOptions() use_client_cert = os.getenv("GOOGLE_API_USE_CLIENT_CERTIFICATE", "false") use_mtls_endpoint = os.getenv("GOOGLE_API_USE_MTLS_ENDPOINT", "auto") if use_client_cert not in ("true", "false"): raise ValueError( "Environment variable `GOOGLE_API_USE_CLIENT_CERTIFICATE` must be either `true` or `false`" ) if use_mtls_endpoint not in ("auto", "never", "always"): raise MutualTLSChannelError( "Environment variable `GOOGLE_API_USE_MTLS_ENDPOINT` must be `never`, `auto` or `always`" ) # Figure out the client cert source to use. client_cert_source = None if use_client_cert == "true": if client_options.client_cert_source: client_cert_source = client_options.client_cert_source elif mtls.has_default_client_cert_source(): client_cert_source = mtls.default_client_cert_source() # Figure out which api endpoint to use. if client_options.api_endpoint is not None: api_endpoint = client_options.api_endpoint elif use_mtls_endpoint == "always" or ( use_mtls_endpoint == "auto" and client_cert_source ): api_endpoint = cls.DEFAULT_MTLS_ENDPOINT else: api_endpoint = cls.DEFAULT_ENDPOINT return api_endpoint, client_cert_source def __init__( self, *, credentials: Optional[ga_credentials.Credentials] = None, transport: Optional[Union[str, ImagesTransport]] = None, client_options: Optional[Union[client_options_lib.ClientOptions, dict]] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, ) -> None: """Instantiates the images client. Args: credentials (Optional[google.auth.credentials.Credentials]): The authorization credentials to attach to requests. These credentials identify the application to the service; if none are specified, the client will attempt to ascertain the credentials from the environment. transport (Union[str, ImagesTransport]): The transport to use. If set to None, a transport is chosen automatically. NOTE: "rest" transport functionality is currently in a beta state (preview). We welcome your feedback via an issue in this library's source repository. client_options (Optional[Union[google.api_core.client_options.ClientOptions, dict]]): Custom options for the client. It won't take effect if a ``transport`` instance is provided. (1) The ``api_endpoint`` property can be used to override the default endpoint provided by the client. GOOGLE_API_USE_MTLS_ENDPOINT environment variable can also be used to override the endpoint: "always" (always use the default mTLS endpoint), "never" (always use the default regular endpoint) and "auto" (auto switch to the default mTLS endpoint if client certificate is present, this is the default value). However, the ``api_endpoint`` property takes precedence if provided. (2) If GOOGLE_API_USE_CLIENT_CERTIFICATE environment variable is "true", then the ``client_cert_source`` property can be used to provide client certificate for mutual TLS transport. If not provided, the default SSL client certificate will be used if present. If GOOGLE_API_USE_CLIENT_CERTIFICATE is "false" or not set, no client certificate will be used. client_info (google.api_core.gapic_v1.client_info.ClientInfo): The client info used to send a user-agent string along with API requests. If ``None``, then default info will be used. Generally, you only need to set this if you're developing your own client library. Raises: google.auth.exceptions.MutualTLSChannelError: If mutual TLS transport creation failed for any reason. """ if isinstance(client_options, dict): client_options = client_options_lib.from_dict(client_options) if client_options is None: client_options = client_options_lib.ClientOptions() client_options = cast(client_options_lib.ClientOptions, client_options) api_endpoint, client_cert_source_func = self.get_mtls_endpoint_and_cert_source( client_options ) api_key_value = getattr(client_options, "api_key", None) if api_key_value and credentials: raise ValueError( "client_options.api_key and credentials are mutually exclusive" ) # Save or instantiate the transport. # Ordinarily, we provide the transport, but allowing a custom transport # instance provides an extensibility point for unusual situations. if isinstance(transport, ImagesTransport): # transport is a ImagesTransport instance. if credentials or client_options.credentials_file or api_key_value: raise ValueError( "When providing a transport instance, " "provide its credentials directly." ) if client_options.scopes: raise ValueError( "When providing a transport instance, provide its scopes " "directly." ) self._transport = transport else: import google.auth._default # type: ignore if api_key_value and hasattr( google.auth._default, "get_api_key_credentials" ): credentials = google.auth._default.get_api_key_credentials( api_key_value ) Transport = type(self).get_transport_class(transport) self._transport = Transport( credentials=credentials, credentials_file=client_options.credentials_file, host=api_endpoint, scopes=client_options.scopes, client_cert_source_for_mtls=client_cert_source_func, quota_project_id=client_options.quota_project_id, client_info=client_info, always_use_jwt_access=True, api_audience=client_options.api_audience, ) def delete_unary( self, request: Optional[Union[compute.DeleteImageRequest, dict]] = None, *, project: Optional[str] = None, image: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> compute.Operation: r"""Deletes the specified image. Args: request (Union[google.cloud.compute_v1.types.DeleteImageRequest, dict]): The request object. A request message for Images.Delete. See the method description for details. project (str): Project ID for this request. This corresponds to the ``project`` field on the ``request`` instance; if ``request`` is provided, this should not be set. image (str): Name of the image resource to delete. This corresponds to the ``image`` field on the ``request`` instance; if ``request`` is provided, this should not be set. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be sent along with the request as metadata. Returns: google.api_core.extended_operation.ExtendedOperation: An object representing a extended long-running operation. """ # Create or coerce a protobuf request object. # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([project, image]) if request is not None and has_flattened_params: raise ValueError( "If the `request` argument is set, then none of " "the individual field arguments should be set." ) # Minor optimization to avoid making a copy if the user passes # in a compute.DeleteImageRequest. # There's no risk of modifying the input as we've already verified # there are no flattened fields. if not isinstance(request, compute.DeleteImageRequest): request = compute.DeleteImageRequest(request) # If we have keyword arguments corresponding to fields on the # request, apply these. if project is not None: request.project = project if image is not None: request.image = image # Wrap the RPC method; this adds retry and timeout information, # and friendly error handling. rpc = self._transport._wrapped_methods[self._transport.delete] # Certain fields should be provided within the metadata header; # add these here. metadata = tuple(metadata) + ( gapic_v1.routing_header.to_grpc_metadata( ( ("project", request.project), ("image", request.image), ) ), ) # Send the request. response = rpc( request, retry=retry, timeout=timeout, metadata=metadata, ) # Done; return the response. return response def delete( self, request: Optional[Union[compute.DeleteImageRequest, dict]] = None, *, project: Optional[str] = None, image: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> extended_operation.ExtendedOperation: r"""Deletes the specified image. Args: request (Union[google.cloud.compute_v1.types.DeleteImageRequest, dict]): The request object. A request message for Images.Delete. See the method description for details. project (str): Project ID for this request. This corresponds to the ``project`` field on the ``request`` instance; if ``request`` is provided, this should not be set. image (str): Name of the image resource to delete. This corresponds to the ``image`` field on the ``request`` instance; if ``request`` is provided, this should not be set. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be sent along with the request as metadata. Returns: google.api_core.extended_operation.ExtendedOperation: An object representing a extended long-running operation. """ # Create or coerce a protobuf request object. # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([project, image]) if request is not None and has_flattened_params: raise ValueError( "If the `request` argument is set, then none of " "the individual field arguments should be set." ) # Minor optimization to avoid making a copy if the user passes # in a compute.DeleteImageRequest. # There's no risk of modifying the input as we've already verified # there are no flattened fields. if not isinstance(request, compute.DeleteImageRequest): request = compute.DeleteImageRequest(request) # If we have keyword arguments corresponding to fields on the # request, apply these. if project is not None: request.project = project if image is not None: request.image = image # Wrap the RPC method; this adds retry and timeout information, # and friendly error handling. rpc = self._transport._wrapped_methods[self._transport.delete] # Certain fields should be provided within the metadata header; # add these here. metadata = tuple(metadata) + ( gapic_v1.routing_header.to_grpc_metadata( ( ("project", request.project), ("image", request.image), ) ), ) # Send the request. response = rpc( request, retry=retry, timeout=timeout, metadata=metadata, ) operation_service = self._transport._global_operations_client operation_request = compute.GetGlobalOperationRequest() operation_request.project = request.project operation_request.operation = response.name get_operation = functools.partial(operation_service.get, operation_request) # Cancel is not part of extended operations yet. cancel_operation = lambda: None # Note: this class is an implementation detail to provide a uniform # set of names for certain fields in the extended operation proto message. # See google.api_core.extended_operation.ExtendedOperation for details # on these properties and the expected interface. class _CustomOperation(extended_operation.ExtendedOperation): @property def error_message(self): return self._extended_operation.http_error_message @property def error_code(self): return self._extended_operation.http_error_status_code response = _CustomOperation.make(get_operation, cancel_operation, response) # Done; return the response. return response def deprecate_unary( self, request: Optional[Union[compute.DeprecateImageRequest, dict]] = None, *, project: Optional[str] = None, image: Optional[str] = None, deprecation_status_resource: Optional[compute.DeprecationStatus] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> compute.Operation: r"""Sets the deprecation status of an image. If an empty request body is given, clears the deprecation status instead. Args: request (Union[google.cloud.compute_v1.types.DeprecateImageRequest, dict]): The request object. A request message for Images.Deprecate. See the method description for details. project (str): Project ID for this request. This corresponds to the ``project`` field on the ``request`` instance; if ``request`` is provided, this should not be set. image (str): Image name. This corresponds to the ``image`` field on the ``request`` instance; if ``request`` is provided, this should not be set. deprecation_status_resource (google.cloud.compute_v1.types.DeprecationStatus): The body resource for this request This corresponds to the ``deprecation_status_resource`` field on the ``request`` instance; if ``request`` is provided, this should not be set. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be sent along with the request as metadata. Returns: google.api_core.extended_operation.ExtendedOperation: An object representing a extended long-running operation. """ # Create or coerce a protobuf request object. # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([project, image, deprecation_status_resource]) if request is not None and has_flattened_params: raise ValueError( "If the `request` argument is set, then none of " "the individual field arguments should be set." ) # Minor optimization to avoid making a copy if the user passes # in a compute.DeprecateImageRequest. # There's no risk of modifying the input as we've already verified # there are no flattened fields. if not isinstance(request, compute.DeprecateImageRequest): request = compute.DeprecateImageRequest(request) # If we have keyword arguments corresponding to fields on the # request, apply these. if project is not None: request.project = project if image is not None: request.image = image if deprecation_status_resource is not None: request.deprecation_status_resource = deprecation_status_resource # Wrap the RPC method; this adds retry and timeout information, # and friendly error handling. rpc = self._transport._wrapped_methods[self._transport.deprecate] # Certain fields should be provided within the metadata header; # add these here. metadata = tuple(metadata) + ( gapic_v1.routing_header.to_grpc_metadata( ( ("project", request.project), ("image", request.image), ) ), ) # Send the request. response = rpc( request, retry=retry, timeout=timeout, metadata=metadata, ) # Done; return the response. return response def deprecate( self, request: Optional[Union[compute.DeprecateImageRequest, dict]] = None, *, project: Optional[str] = None, image: Optional[str] = None, deprecation_status_resource: Optional[compute.DeprecationStatus] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> extended_operation.ExtendedOperation: r"""Sets the deprecation status of an image. If an empty request body is given, clears the deprecation status instead. Args: request (Union[google.cloud.compute_v1.types.DeprecateImageRequest, dict]): The request object. A request message for Images.Deprecate. See the method description for details. project (str): Project ID for this request. This corresponds to the ``project`` field on the ``request`` instance; if ``request`` is provided, this should not be set. image (str): Image name. This corresponds to the ``image`` field on the ``request`` instance; if ``request`` is provided, this should not be set. deprecation_status_resource (google.cloud.compute_v1.types.DeprecationStatus): The body resource for this request This corresponds to the ``deprecation_status_resource`` field on the ``request`` instance; if ``request`` is provided, this should not be set. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be sent along with the request as metadata. Returns: google.api_core.extended_operation.ExtendedOperation: An object representing a extended long-running operation. """ # Create or coerce a protobuf request object. # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([project, image, deprecation_status_resource]) if request is not None and has_flattened_params: raise ValueError( "If the `request` argument is set, then none of " "the individual field arguments should be set." ) # Minor optimization to avoid making a copy if the user passes # in a compute.DeprecateImageRequest. # There's no risk of modifying the input as we've already verified # there are no flattened fields. if not isinstance(request, compute.DeprecateImageRequest): request = compute.DeprecateImageRequest(request) # If we have keyword arguments corresponding to fields on the # request, apply these. if project is not None: request.project = project if image is not None: request.image = image if deprecation_status_resource is not None: request.deprecation_status_resource = deprecation_status_resource # Wrap the RPC method; this adds retry and timeout information, # and friendly error handling. rpc = self._transport._wrapped_methods[self._transport.deprecate] # Certain fields should be provided within the metadata header; # add these here. metadata = tuple(metadata) + ( gapic_v1.routing_header.to_grpc_metadata( ( ("project", request.project), ("image", request.image), ) ), ) # Send the request. response = rpc( request, retry=retry, timeout=timeout, metadata=metadata, ) operation_service = self._transport._global_operations_client operation_request = compute.GetGlobalOperationRequest() operation_request.project = request.project operation_request.operation = response.name get_operation = functools.partial(operation_service.get, operation_request) # Cancel is not part of extended operations yet. cancel_operation = lambda: None # Note: this class is an implementation detail to provide a uniform # set of names for certain fields in the extended operation proto message. # See google.api_core.extended_operation.ExtendedOperation for details # on these properties and the expected interface. class _CustomOperation(extended_operation.ExtendedOperation): @property def error_message(self): return self._extended_operation.http_error_message @property def error_code(self): return self._extended_operation.http_error_status_code response = _CustomOperation.make(get_operation, cancel_operation, response) # Done; return the response. return response def get( self, request: Optional[Union[compute.GetImageRequest, dict]] = None, *, project: Optional[str] = None, image: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> compute.Image: r"""Returns the specified image. Gets a list of available images by making a list() request. Args: request (Union[google.cloud.compute_v1.types.GetImageRequest, dict]): The request object. A request message for Images.Get. See the method description for details. project (str): Project ID for this request. This corresponds to the ``project`` field on the ``request`` instance; if ``request`` is provided, this should not be set. image (str): Name of the image resource to return. This corresponds to the ``image`` field on the ``request`` instance; if ``request`` is provided, this should not be set. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be sent along with the request as metadata. Returns: google.cloud.compute_v1.types.Image: Represents an Image resource. You can use images to create boot disks for your VM instances. For more information, read Images. """ # Create or coerce a protobuf request object. # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([project, image]) if request is not None and has_flattened_params: raise ValueError( "If the `request` argument is set, then none of " "the individual field arguments should be set." ) # Minor optimization to avoid making a copy if the user passes # in a compute.GetImageRequest. # There's no risk of modifying the input as we've already verified # there are no flattened fields. if not isinstance(request, compute.GetImageRequest): request = compute.GetImageRequest(request) # If we have keyword arguments corresponding to fields on the # request, apply these. if project is not None: request.project = project if image is not None: request.image = image # Wrap the RPC method; this adds retry and timeout information, # and friendly error handling. rpc = self._transport._wrapped_methods[self._transport.get] # Certain fields should be provided within the metadata header; # add these here. metadata = tuple(metadata) + ( gapic_v1.routing_header.to_grpc_metadata( ( ("project", request.project), ("image", request.image), ) ), ) # Send the request. response = rpc( request, retry=retry, timeout=timeout, metadata=metadata, ) # Done; return the response. return response def get_from_family( self, request: Optional[Union[compute.GetFromFamilyImageRequest, dict]] = None, *, project: Optional[str] = None, family: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> compute.Image: r"""Returns the latest image that is part of an image family and is not deprecated. Args: request (Union[google.cloud.compute_v1.types.GetFromFamilyImageRequest, dict]): The request object. A request message for Images.GetFromFamily. See the method description for details. project (str): Project ID for this request. This corresponds to the ``project`` field on the ``request`` instance; if ``request`` is provided, this should not be set. family (str): Name of the image family to search for. This corresponds to the ``family`` field on the ``request`` instance; if ``request`` is provided, this should not be set. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be sent along with the request as metadata. Returns: google.cloud.compute_v1.types.Image: Represents an Image resource. You can use images to create boot disks for your VM instances. For more information, read Images. """ # Create or coerce a protobuf request object. # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([project, family]) if request is not None and has_flattened_params: raise ValueError( "If the `request` argument is set, then none of " "the individual field arguments should be set." ) # Minor optimization to avoid making a copy if the user passes # in a compute.GetFromFamilyImageRequest. # There's no risk of modifying the input as we've already verified # there are no flattened fields. if not isinstance(request, compute.GetFromFamilyImageRequest): request = compute.GetFromFamilyImageRequest(request) # If we have keyword arguments corresponding to fields on the # request, apply these. if project is not None: request.project = project if family is not None: request.family = family # Wrap the RPC method; this adds retry and timeout information, # and friendly error handling. rpc = self._transport._wrapped_methods[self._transport.get_from_family] # Certain fields should be provided within the metadata header; # add these here. metadata = tuple(metadata) + ( gapic_v1.routing_header.to_grpc_metadata( ( ("project", request.project), ("family", request.family), ) ), ) # Send the request. response = rpc( request, retry=retry, timeout=timeout, metadata=metadata, ) # Done; return the response. return response def get_iam_policy( self, request: Optional[Union[compute.GetIamPolicyImageRequest, dict]] = None, *, project: Optional[str] = None, resource: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> compute.Policy: r"""Gets the access control policy for a resource. May be empty if no such policy or resource exists. Args: request (Union[google.cloud.compute_v1.types.GetIamPolicyImageRequest, dict]): The request object. A request message for Images.GetIamPolicy. See the method description for details. project (str): Project ID for this request. This corresponds to the ``project`` field on the ``request`` instance; if ``request`` is provided, this should not be set. resource (str): Name or id of the resource for this request. This corresponds to the ``resource`` field on the ``request`` instance; if ``request`` is provided, this should not be set. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be sent along with the request as metadata. Returns: google.cloud.compute_v1.types.Policy: An Identity and Access Management (IAM) policy, which specifies access controls for Google Cloud resources. A Policy is a collection of bindings. A binding binds one or more members, or principals, to a single role. Principals can be user accounts, service accounts, Google groups, and domains (such as G Suite). A role is a named list of permissions; each role can be an IAM predefined role or a user-created custom role. For some types of Google Cloud resources, a binding can also specify a condition, which is a logical expression that allows access to a resource only if the expression evaluates to true. A condition can add constraints based on attributes of the request, the resource, or both. To learn which resources support conditions in their IAM policies, see the [IAM documentation](\ https://cloud.google.com/iam/help/conditions/resource-policies). **JSON example:** { "bindings": [ { "role": "roles/resourcemanager.organizationAdmin", "members": [ "user:mike@example.com", "group:admins@example.com", "domain:google.com", "serviceAccount:my-project-id@appspot.gserviceaccount.com" ] }, { "role": "roles/resourcemanager.organizationViewer", "members": [ "user:eve@example.com" ], "condition": { "title": "expirable access", "description": "Does not grant access after Sep 2020", "expression": "request.time < timestamp('2020-10-01T00:00:00.000Z')", } } ], "etag": "BwWWja0YfJA=", "version": 3 } **YAML example:** bindings: - members: - user:\ mike@example.com - group:\ admins@example.com - domain:google.com - serviceAccount:\ my-project-id@appspot.gserviceaccount.com role: roles/resourcemanager.organizationAdmin - members: - user:\ eve@example.com role: roles/resourcemanager.organizationViewer condition: title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') etag: BwWWja0YfJA= version: 3 For a description of IAM and its features, see the [IAM documentation](\ https://cloud.google.com/iam/docs/). """ # Create or coerce a protobuf request object. # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([project, resource]) if request is not None and has_flattened_params: raise ValueError( "If the `request` argument is set, then none of " "the individual field arguments should be set." ) # Minor optimization to avoid making a copy if the user passes # in a compute.GetIamPolicyImageRequest. # There's no risk of modifying the input as we've already verified # there are no flattened fields. if not isinstance(request, compute.GetIamPolicyImageRequest): request = compute.GetIamPolicyImageRequest(request) # If we have keyword arguments corresponding to fields on the # request, apply these. if project is not None: request.project = project if resource is not None: request.resource = resource # Wrap the RPC method; this adds retry and timeout information, # and friendly error handling. rpc = self._transport._wrapped_methods[self._transport.get_iam_policy] # Certain fields should be provided within the metadata header; # add these here. metadata = tuple(metadata) + ( gapic_v1.routing_header.to_grpc_metadata( ( ("project", request.project), ("resource", request.resource), ) ), ) # Send the request. response = rpc( request, retry=retry, timeout=timeout, metadata=metadata, ) # Done; return the response. return response def insert_unary( self, request: Optional[Union[compute.InsertImageRequest, dict]] = None, *, project: Optional[str] = None, image_resource: Optional[compute.Image] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> compute.Operation: r"""Creates an image in the specified project using the data included in the request. Args: request (Union[google.cloud.compute_v1.types.InsertImageRequest, dict]): The request object. A request message for Images.Insert. See the method description for details. project (str): Project ID for this request. This corresponds to the ``project`` field on the ``request`` instance; if ``request`` is provided, this should not be set. image_resource (google.cloud.compute_v1.types.Image): The body resource for this request This corresponds to the ``image_resource`` field on the ``request`` instance; if ``request`` is provided, this should not be set. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be sent along with the request as metadata. Returns: google.api_core.extended_operation.ExtendedOperation: An object representing a extended long-running operation. """ # Create or coerce a protobuf request object. # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([project, image_resource]) if request is not None and has_flattened_params: raise ValueError( "If the `request` argument is set, then none of " "the individual field arguments should be set." ) # Minor optimization to avoid making a copy if the user passes # in a compute.InsertImageRequest. # There's no risk of modifying the input as we've already verified # there are no flattened fields. if not isinstance(request, compute.InsertImageRequest): request = compute.InsertImageRequest(request) # If we have keyword arguments corresponding to fields on the # request, apply these. if project is not None: request.project = project if image_resource is not None: request.image_resource = image_resource # Wrap the RPC method; this adds retry and timeout information, # and friendly error handling. rpc = self._transport._wrapped_methods[self._transport.insert] # Certain fields should be provided within the metadata header; # add these here. metadata = tuple(metadata) + ( gapic_v1.routing_header.to_grpc_metadata((("project", request.project),)), ) # Send the request. response = rpc( request, retry=retry, timeout=timeout, metadata=metadata, ) # Done; return the response. return response def insert( self, request: Optional[Union[compute.InsertImageRequest, dict]] = None, *, project: Optional[str] = None, image_resource: Optional[compute.Image] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> extended_operation.ExtendedOperation: r"""Creates an image in the specified project using the data included in the request. Args: request (Union[google.cloud.compute_v1.types.InsertImageRequest, dict]): The request object. A request message for Images.Insert. See the method description for details. project (str): Project ID for this request. This corresponds to the ``project`` field on the ``request`` instance; if ``request`` is provided, this should not be set. image_resource (google.cloud.compute_v1.types.Image): The body resource for this request This corresponds to the ``image_resource`` field on the ``request`` instance; if ``request`` is provided, this should not be set. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be sent along with the request as metadata. Returns: google.api_core.extended_operation.ExtendedOperation: An object representing a extended long-running operation. """ # Create or coerce a protobuf request object. # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([project, image_resource]) if request is not None and has_flattened_params: raise ValueError( "If the `request` argument is set, then none of " "the individual field arguments should be set." ) # Minor optimization to avoid making a copy if the user passes # in a compute.InsertImageRequest. # There's no risk of modifying the input as we've already verified # there are no flattened fields. if not isinstance(request, compute.InsertImageRequest): request = compute.InsertImageRequest(request) # If we have keyword arguments corresponding to fields on the # request, apply these. if project is not None: request.project = project if image_resource is not None: request.image_resource = image_resource # Wrap the RPC method; this adds retry and timeout information, # and friendly error handling. rpc = self._transport._wrapped_methods[self._transport.insert] # Certain fields should be provided within the metadata header; # add these here. metadata = tuple(metadata) + ( gapic_v1.routing_header.to_grpc_metadata((("project", request.project),)), ) # Send the request. response = rpc( request, retry=retry, timeout=timeout, metadata=metadata, ) operation_service = self._transport._global_operations_client operation_request = compute.GetGlobalOperationRequest() operation_request.project = request.project operation_request.operation = response.name get_operation = functools.partial(operation_service.get, operation_request) # Cancel is not part of extended operations yet. cancel_operation = lambda: None # Note: this class is an implementation detail to provide a uniform # set of names for certain fields in the extended operation proto message. # See google.api_core.extended_operation.ExtendedOperation for details # on these properties and the expected interface. class _CustomOperation(extended_operation.ExtendedOperation): @property def error_message(self): return self._extended_operation.http_error_message @property def error_code(self): return self._extended_operation.http_error_status_code response = _CustomOperation.make(get_operation, cancel_operation, response) # Done; return the response. return response def list( self, request: Optional[Union[compute.ListImagesRequest, dict]] = None, *, project: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListPager: r"""Retrieves the list of custom images available to the specified project. Custom images are images you create that belong to your project. This method does not get any images that belong to other projects, including publicly-available images, like Debian 8. If you want to get a list of publicly-available images, use this method to make a request to the respective image project, such as debian-cloud or windows-cloud. Args: request (Union[google.cloud.compute_v1.types.ListImagesRequest, dict]): The request object. A request message for Images.List. See the method description for details. project (str): Project ID for this request. This corresponds to the ``project`` field on the ``request`` instance; if ``request`` is provided, this should not be set. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be sent along with the request as metadata. Returns: google.cloud.compute_v1.services.images.pagers.ListPager: Contains a list of images. Iterating over this object will yield results and resolve additional pages automatically. """ # Create or coerce a protobuf request object. # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([project]) if request is not None and has_flattened_params: raise ValueError( "If the `request` argument is set, then none of " "the individual field arguments should be set." ) # Minor optimization to avoid making a copy if the user passes # in a compute.ListImagesRequest. # There's no risk of modifying the input as we've already verified # there are no flattened fields. if not isinstance(request, compute.ListImagesRequest): request = compute.ListImagesRequest(request) # If we have keyword arguments corresponding to fields on the # request, apply these. if project is not None: request.project = project # Wrap the RPC method; this adds retry and timeout information, # and friendly error handling. rpc = self._transport._wrapped_methods[self._transport.list] # Certain fields should be provided within the metadata header; # add these here. metadata = tuple(metadata) + ( gapic_v1.routing_header.to_grpc_metadata((("project", request.project),)), ) # Send the request. response = rpc( request, retry=retry, timeout=timeout, metadata=metadata, ) # This method is paged; wrap the response in a pager, which provides # an `__iter__` convenience method. response = pagers.ListPager( method=rpc, request=request, response=response, metadata=metadata, ) # Done; return the response. return response def patch_unary( self, request: Optional[Union[compute.PatchImageRequest, dict]] = None, *, project: Optional[str] = None, image: Optional[str] = None, image_resource: Optional[compute.Image] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> compute.Operation: r"""Patches the specified image with the data included in the request. Only the following fields can be modified: family, description, deprecation status. Args: request (Union[google.cloud.compute_v1.types.PatchImageRequest, dict]): The request object. A request message for Images.Patch. See the method description for details. project (str): Project ID for this request. This corresponds to the ``project`` field on the ``request`` instance; if ``request`` is provided, this should not be set. image (str): Name of the image resource to patch. This corresponds to the ``image`` field on the ``request`` instance; if ``request`` is provided, this should not be set. image_resource (google.cloud.compute_v1.types.Image): The body resource for this request This corresponds to the ``image_resource`` field on the ``request`` instance; if ``request`` is provided, this should not be set. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be sent along with the request as metadata. Returns: google.api_core.extended_operation.ExtendedOperation: An object representing a extended long-running operation. """ # Create or coerce a protobuf request object. # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([project, image, image_resource]) if request is not None and has_flattened_params: raise ValueError( "If the `request` argument is set, then none of " "the individual field arguments should be set." ) # Minor optimization to avoid making a copy if the user passes # in a compute.PatchImageRequest. # There's no risk of modifying the input as we've already verified # there are no flattened fields. if not isinstance(request, compute.PatchImageRequest): request = compute.PatchImageRequest(request) # If we have keyword arguments corresponding to fields on the # request, apply these. if project is not None: request.project = project if image is not None: request.image = image if image_resource is not None: request.image_resource = image_resource # Wrap the RPC method; this adds retry and timeout information, # and friendly error handling. rpc = self._transport._wrapped_methods[self._transport.patch] # Certain fields should be provided within the metadata header; # add these here. metadata = tuple(metadata) + ( gapic_v1.routing_header.to_grpc_metadata( ( ("project", request.project), ("image", request.image), ) ), ) # Send the request. response = rpc( request, retry=retry, timeout=timeout, metadata=metadata, ) # Done; return the response. return response def patch( self, request: Optional[Union[compute.PatchImageRequest, dict]] = None, *, project: Optional[str] = None, image: Optional[str] = None, image_resource: Optional[compute.Image] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> extended_operation.ExtendedOperation: r"""Patches the specified image with the data included in the request. Only the following fields can be modified: family, description, deprecation status. Args: request (Union[google.cloud.compute_v1.types.PatchImageRequest, dict]): The request object. A request message for Images.Patch. See the method description for details. project (str): Project ID for this request. This corresponds to the ``project`` field on the ``request`` instance; if ``request`` is provided, this should not be set. image (str): Name of the image resource to patch. This corresponds to the ``image`` field on the ``request`` instance; if ``request`` is provided, this should not be set. image_resource (google.cloud.compute_v1.types.Image): The body resource for this request This corresponds to the ``image_resource`` field on the ``request`` instance; if ``request`` is provided, this should not be set. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be sent along with the request as metadata. Returns: google.api_core.extended_operation.ExtendedOperation: An object representing a extended long-running operation. """ # Create or coerce a protobuf request object. # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([project, image, image_resource]) if request is not None and has_flattened_params: raise ValueError( "If the `request` argument is set, then none of " "the individual field arguments should be set." ) # Minor optimization to avoid making a copy if the user passes # in a compute.PatchImageRequest. # There's no risk of modifying the input as we've already verified # there are no flattened fields. if not isinstance(request, compute.PatchImageRequest): request = compute.PatchImageRequest(request) # If we have keyword arguments corresponding to fields on the # request, apply these. if project is not None: request.project = project if image is not None: request.image = image if image_resource is not None: request.image_resource = image_resource # Wrap the RPC method; this adds retry and timeout information, # and friendly error handling. rpc = self._transport._wrapped_methods[self._transport.patch] # Certain fields should be provided within the metadata header; # add these here. metadata = tuple(metadata) + ( gapic_v1.routing_header.to_grpc_metadata( ( ("project", request.project), ("image", request.image), ) ), ) # Send the request. response = rpc( request, retry=retry, timeout=timeout, metadata=metadata, ) operation_service = self._transport._global_operations_client operation_request = compute.GetGlobalOperationRequest() operation_request.project = request.project operation_request.operation = response.name get_operation = functools.partial(operation_service.get, operation_request) # Cancel is not part of extended operations yet. cancel_operation = lambda: None # Note: this class is an implementation detail to provide a uniform # set of names for certain fields in the extended operation proto message. # See google.api_core.extended_operation.ExtendedOperation for details # on these properties and the expected interface. class _CustomOperation(extended_operation.ExtendedOperation): @property def error_message(self): return self._extended_operation.http_error_message @property def error_code(self): return self._extended_operation.http_error_status_code response = _CustomOperation.make(get_operation, cancel_operation, response) # Done; return the response. return response def set_iam_policy( self, request: Optional[Union[compute.SetIamPolicyImageRequest, dict]] = None, *, project: Optional[str] = None, resource: Optional[str] = None, global_set_policy_request_resource: Optional[ compute.GlobalSetPolicyRequest ] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> compute.Policy: r"""Sets the access control policy on the specified resource. Replaces any existing policy. Args: request (Union[google.cloud.compute_v1.types.SetIamPolicyImageRequest, dict]): The request object. A request message for Images.SetIamPolicy. See the method description for details. project (str): Project ID for this request. This corresponds to the ``project`` field on the ``request`` instance; if ``request`` is provided, this should not be set. resource (str): Name or id of the resource for this request. This corresponds to the ``resource`` field on the ``request`` instance; if ``request`` is provided, this should not be set. global_set_policy_request_resource (google.cloud.compute_v1.types.GlobalSetPolicyRequest): The body resource for this request This corresponds to the ``global_set_policy_request_resource`` field on the ``request`` instance; if ``request`` is provided, this should not be set. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be sent along with the request as metadata. Returns: google.cloud.compute_v1.types.Policy: An Identity and Access Management (IAM) policy, which specifies access controls for Google Cloud resources. A Policy is a collection of bindings. A binding binds one or more members, or principals, to a single role. Principals can be user accounts, service accounts, Google groups, and domains (such as G Suite). A role is a named list of permissions; each role can be an IAM predefined role or a user-created custom role. For some types of Google Cloud resources, a binding can also specify a condition, which is a logical expression that allows access to a resource only if the expression evaluates to true. A condition can add constraints based on attributes of the request, the resource, or both. To learn which resources support conditions in their IAM policies, see the [IAM documentation](\ https://cloud.google.com/iam/help/conditions/resource-policies). **JSON example:** { "bindings": [ { "role": "roles/resourcemanager.organizationAdmin", "members": [ "user:mike@example.com", "group:admins@example.com", "domain:google.com", "serviceAccount:my-project-id@appspot.gserviceaccount.com" ] }, { "role": "roles/resourcemanager.organizationViewer", "members": [ "user:eve@example.com" ], "condition": { "title": "expirable access", "description": "Does not grant access after Sep 2020", "expression": "request.time < timestamp('2020-10-01T00:00:00.000Z')", } } ], "etag": "BwWWja0YfJA=", "version": 3 } **YAML example:** bindings: - members: - user:\ mike@example.com - group:\ admins@example.com - domain:google.com - serviceAccount:\ my-project-id@appspot.gserviceaccount.com role: roles/resourcemanager.organizationAdmin - members: - user:\ eve@example.com role: roles/resourcemanager.organizationViewer condition: title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') etag: BwWWja0YfJA= version: 3 For a description of IAM and its features, see the [IAM documentation](\ https://cloud.google.com/iam/docs/). """ # Create or coerce a protobuf request object. # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any( [project, resource, global_set_policy_request_resource] ) if request is not None and has_flattened_params: raise ValueError( "If the `request` argument is set, then none of " "the individual field arguments should be set." ) # Minor optimization to avoid making a copy if the user passes # in a compute.SetIamPolicyImageRequest. # There's no risk of modifying the input as we've already verified # there are no flattened fields. if not isinstance(request, compute.SetIamPolicyImageRequest): request = compute.SetIamPolicyImageRequest(request) # If we have keyword arguments corresponding to fields on the # request, apply these. if project is not None: request.project = project if resource is not None: request.resource = resource if global_set_policy_request_resource is not None: request.global_set_policy_request_resource = ( global_set_policy_request_resource ) # Wrap the RPC method; this adds retry and timeout information, # and friendly error handling. rpc = self._transport._wrapped_methods[self._transport.set_iam_policy] # Certain fields should be provided within the metadata header; # add these here. metadata = tuple(metadata) + ( gapic_v1.routing_header.to_grpc_metadata( ( ("project", request.project), ("resource", request.resource), ) ), ) # Send the request. response = rpc( request, retry=retry, timeout=timeout, metadata=metadata, ) # Done; return the response. return response def set_labels_unary( self, request: Optional[Union[compute.SetLabelsImageRequest, dict]] = None, *, project: Optional[str] = None, resource: Optional[str] = None, global_set_labels_request_resource: Optional[ compute.GlobalSetLabelsRequest ] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> compute.Operation: r"""Sets the labels on an image. To learn more about labels, read the Labeling Resources documentation. Args: request (Union[google.cloud.compute_v1.types.SetLabelsImageRequest, dict]): The request object. A request message for Images.SetLabels. See the method description for details. project (str): Project ID for this request. This corresponds to the ``project`` field on the ``request`` instance; if ``request`` is provided, this should not be set. resource (str): Name or id of the resource for this request. This corresponds to the ``resource`` field on the ``request`` instance; if ``request`` is provided, this should not be set. global_set_labels_request_resource (google.cloud.compute_v1.types.GlobalSetLabelsRequest): The body resource for this request This corresponds to the ``global_set_labels_request_resource`` field on the ``request`` instance; if ``request`` is provided, this should not be set. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be sent along with the request as metadata. Returns: google.api_core.extended_operation.ExtendedOperation: An object representing a extended long-running operation. """ # Create or coerce a protobuf request object. # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any( [project, resource, global_set_labels_request_resource] ) if request is not None and has_flattened_params: raise ValueError( "If the `request` argument is set, then none of " "the individual field arguments should be set." ) # Minor optimization to avoid making a copy if the user passes # in a compute.SetLabelsImageRequest. # There's no risk of modifying the input as we've already verified # there are no flattened fields. if not isinstance(request, compute.SetLabelsImageRequest): request = compute.SetLabelsImageRequest(request) # If we have keyword arguments corresponding to fields on the # request, apply these. if project is not None: request.project = project if resource is not None: request.resource = resource if global_set_labels_request_resource is not None: request.global_set_labels_request_resource = ( global_set_labels_request_resource ) # Wrap the RPC method; this adds retry and timeout information, # and friendly error handling. rpc = self._transport._wrapped_methods[self._transport.set_labels] # Certain fields should be provided within the metadata header; # add these here. metadata = tuple(metadata) + ( gapic_v1.routing_header.to_grpc_metadata( ( ("project", request.project), ("resource", request.resource), ) ), ) # Send the request. response = rpc( request, retry=retry, timeout=timeout, metadata=metadata, ) # Done; return the response. return response def set_labels( self, request: Optional[Union[compute.SetLabelsImageRequest, dict]] = None, *, project: Optional[str] = None, resource: Optional[str] = None, global_set_labels_request_resource: Optional[ compute.GlobalSetLabelsRequest ] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> extended_operation.ExtendedOperation: r"""Sets the labels on an image. To learn more about labels, read the Labeling Resources documentation. Args: request (Union[google.cloud.compute_v1.types.SetLabelsImageRequest, dict]): The request object. A request message for Images.SetLabels. See the method description for details. project (str): Project ID for this request. This corresponds to the ``project`` field on the ``request`` instance; if ``request`` is provided, this should not be set. resource (str): Name or id of the resource for this request. This corresponds to the ``resource`` field on the ``request`` instance; if ``request`` is provided, this should not be set. global_set_labels_request_resource (google.cloud.compute_v1.types.GlobalSetLabelsRequest): The body resource for this request This corresponds to the ``global_set_labels_request_resource`` field on the ``request`` instance; if ``request`` is provided, this should not be set. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be sent along with the request as metadata. Returns: google.api_core.extended_operation.ExtendedOperation: An object representing a extended long-running operation. """ # Create or coerce a protobuf request object. # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any( [project, resource, global_set_labels_request_resource] ) if request is not None and has_flattened_params: raise ValueError( "If the `request` argument is set, then none of " "the individual field arguments should be set." ) # Minor optimization to avoid making a copy if the user passes # in a compute.SetLabelsImageRequest. # There's no risk of modifying the input as we've already verified # there are no flattened fields. if not isinstance(request, compute.SetLabelsImageRequest): request = compute.SetLabelsImageRequest(request) # If we have keyword arguments corresponding to fields on the # request, apply these. if project is not None: request.project = project if resource is not None: request.resource = resource if global_set_labels_request_resource is not None: request.global_set_labels_request_resource = ( global_set_labels_request_resource ) # Wrap the RPC method; this adds retry and timeout information, # and friendly error handling. rpc = self._transport._wrapped_methods[self._transport.set_labels] # Certain fields should be provided within the metadata header; # add these here. metadata = tuple(metadata) + ( gapic_v1.routing_header.to_grpc_metadata( ( ("project", request.project), ("resource", request.resource), ) ), ) # Send the request. response = rpc( request, retry=retry, timeout=timeout, metadata=metadata, ) operation_service = self._transport._global_operations_client operation_request = compute.GetGlobalOperationRequest() operation_request.project = request.project operation_request.operation = response.name get_operation = functools.partial(operation_service.get, operation_request) # Cancel is not part of extended operations yet. cancel_operation = lambda: None # Note: this class is an implementation detail to provide a uniform # set of names for certain fields in the extended operation proto message. # See google.api_core.extended_operation.ExtendedOperation for details # on these properties and the expected interface. class _CustomOperation(extended_operation.ExtendedOperation): @property def error_message(self): return self._extended_operation.http_error_message @property def error_code(self): return self._extended_operation.http_error_status_code response = _CustomOperation.make(get_operation, cancel_operation, response) # Done; return the response. return response def test_iam_permissions( self, request: Optional[Union[compute.TestIamPermissionsImageRequest, dict]] = None, *, project: Optional[str] = None, resource: Optional[str] = None, test_permissions_request_resource: Optional[ compute.TestPermissionsRequest ] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> compute.TestPermissionsResponse: r"""Returns permissions that a caller has on the specified resource. Args: request (Union[google.cloud.compute_v1.types.TestIamPermissionsImageRequest, dict]): The request object. A request message for Images.TestIamPermissions. See the method description for details. project (str): Project ID for this request. This corresponds to the ``project`` field on the ``request`` instance; if ``request`` is provided, this should not be set. resource (str): Name or id of the resource for this request. This corresponds to the ``resource`` field on the ``request`` instance; if ``request`` is provided, this should not be set. test_permissions_request_resource (google.cloud.compute_v1.types.TestPermissionsRequest): The body resource for this request This corresponds to the ``test_permissions_request_resource`` field on the ``request`` instance; if ``request`` is provided, this should not be set. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be sent along with the request as metadata. Returns: google.cloud.compute_v1.types.TestPermissionsResponse: """ # Create or coerce a protobuf request object. # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any( [project, resource, test_permissions_request_resource] ) if request is not None and has_flattened_params: raise ValueError( "If the `request` argument is set, then none of " "the individual field arguments should be set." ) # Minor optimization to avoid making a copy if the user passes # in a compute.TestIamPermissionsImageRequest. # There's no risk of modifying the input as we've already verified # there are no flattened fields. if not isinstance(request, compute.TestIamPermissionsImageRequest): request = compute.TestIamPermissionsImageRequest(request) # If we have keyword arguments corresponding to fields on the # request, apply these. if project is not None: request.project = project if resource is not None: request.resource = resource if test_permissions_request_resource is not None: request.test_permissions_request_resource = ( test_permissions_request_resource ) # Wrap the RPC method; this adds retry and timeout information, # and friendly error handling. rpc = self._transport._wrapped_methods[self._transport.test_iam_permissions] # Certain fields should be provided within the metadata header; # add these here. metadata = tuple(metadata) + ( gapic_v1.routing_header.to_grpc_metadata( ( ("project", request.project), ("resource", request.resource), ) ), ) # Send the request. response = rpc( request, retry=retry, timeout=timeout, metadata=metadata, ) # Done; return the response. return response def __enter__(self): return self def __exit__(self, type, value, traceback): """Releases underlying transport's resources. .. warning:: ONLY use as a context manager if the transport is NOT shared with other clients! Exiting the with block will CLOSE the transport and may cause errors in other clients! """ self.transport.close() try: DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( gapic_version=pkg_resources.get_distribution( "google-cloud-compute", ).version, ) except pkg_resources.DistributionNotFound: DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() __all__ = ("ImagesClient",)
{ "content_hash": "db1cdb113bc4e19afdea78a1a827b9d1", "timestamp": "", "source": "github", "line_count": 2142, "max_line_length": 120, "avg_line_length": 42.29925303454715, "alnum_prop": 0.5927928922244909, "repo_name": "googleapis/python-compute", "id": "3b29ad05e1dfe0923399c18b2d86b2b11f83ad88", "size": "91205", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "google/cloud/compute_v1/services/images/client.py", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Dockerfile", "bytes": "2050" }, { "name": "Python", "bytes": "32681847" }, { "name": "Shell", "bytes": "30663" } ], "symlink_target": "" }
package org.robolectric.shadows; import android.nfc.NdefMessage; import android.nfc.NdefRecord; import org.junit.Test; import org.junit.runner.RunWith; import org.robolectric.TestRunners; import static org.junit.Assert.assertSame; @RunWith(TestRunners.WithDefaults.class) public class NdefMessageTest { @Test public void getRecords() throws Exception { NdefRecord[] ndefRecords = {new NdefRecord("mumble".getBytes())}; NdefMessage ndefMessage = new NdefMessage(ndefRecords); assertSame(ndefMessage.getRecords(), ndefRecords); } }
{ "content_hash": "1b6cc51d3322553d3e9af949e8772606", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 73, "avg_line_length": 27.142857142857142, "alnum_prop": 0.7543859649122807, "repo_name": "daisy1754/robolectric", "id": "ef85670bfb1c0ca02c934fea4f8947c43bf42900", "size": "570", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "src/test/java/org/robolectric/shadows/NdefMessageTest.java", "mode": "33188", "license": "mit", "language": [ { "name": "Groovy", "bytes": "1592" }, { "name": "Java", "bytes": "2713616" }, { "name": "Ruby", "bytes": "1629" }, { "name": "Shell", "bytes": "5089" } ], "symlink_target": "" }
ACCEPTED #### According to International Plant Names Index #### Published in null #### Original name null ### Remarks null
{ "content_hash": "9d64a6e6f7e9f0a03d3de802af0eca74", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 31, "avg_line_length": 9.692307692307692, "alnum_prop": 0.7063492063492064, "repo_name": "mdoering/backbone", "id": "6871b8db11b18e7b77ff2128272522ab34862372", "size": "181", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Plantae/Magnoliophyta/Magnoliopsida/Solanales/Convolvulaceae/Convolvulus/Convolvulus serpiculans/README.md", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
HTTP Proxy Sample ================= Setup ----- ### Install the modules npm install ### Start the proxy npm start Try it ------ ### simple curl test curl localhost:8012 ### Notes Using the curl call (or browser refresh) repeatedly in quick succession to the proxy, this is what will happen: 1. The first call will be quota checked (ok), sent through proxy to the http server, and cached in memory. 2. The next calls will be returned by the cache in the proxy until it times out (1 second) 3. Once the cache expires, the next call will be quota checked (ok) and then send to http server. 4. The next calls will be again returned by the cache until it times out (1 second) 5. Once the cache expires, the next call will be quota checked and a quota exceeded error will be returned by the proxy.
{ "content_hash": "24d37d0484451cabbf8560c0a2ce6718", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 120, "avg_line_length": 28.06896551724138, "alnum_prop": 0.7137592137592138, "repo_name": "guywithnose/volos", "id": "123e05b1ec340d1ab51db858d7839100903a6192", "size": "814", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "samples/http-proxy/README.md", "mode": "33188", "license": "mit", "language": [ { "name": "JavaScript", "bytes": "397514" }, { "name": "Shell", "bytes": "4142" } ], "symlink_target": "" }
package me.dmillerw.minelua.lib.mapping; import com.google.common.base.Charsets; import com.google.common.collect.HashBiMap; import com.google.common.collect.Maps; import com.google.common.io.CharSource; import cpw.mods.fml.common.asm.transformers.deobf.LZMAInputSupplier; import org.apache.commons.io.IOUtils; import java.io.File; import java.io.IOException; import java.io.InputStream; import java.util.List; import java.util.Map; /** * @author dmillerw */ public class ObfuscationMapper { private static final String CLASS = "CL"; private static final String FIELD = "FD"; private static final String METHOD = "MD"; private static HashBiMap<String, String> classes = HashBiMap.create(); private static HashBiMap<FieldMapping, FieldMapping> fields = HashBiMap.create(); private static HashBiMap<MethodMapping, MethodMapping> methods = HashBiMap.create(); public static void initialize(File mcLocation, File coremodLocation, String deobfuscationFileName, boolean liveEnv) { Map<FieldMapping, FieldMapping> tempFields = Maps.newHashMap(); Map<MethodMapping, MethodMapping> tempMethods = Maps.newHashMap(); try { // We parse the SRG file first, as that contains the actual OBF to SRG mappings InputStream classData = ObfuscationMapper.class.getResourceAsStream(deobfuscationFileName); LZMAInputSupplier zis = new LZMAInputSupplier(classData); CharSource srgSource = zis.asCharSource(Charsets.UTF_8); List<String> srgList = srgSource.readLines(); for (String line : srgList) { String type = line.substring(0, line.indexOf(":")); if (CLASS.equals(type)) { String[] parts = line.substring(line.indexOf(":") + 2).split(" "); classes.put(parts[1], parts[0]); // Deobf is key, obf is value } else if (FIELD.equals(type)) { String[] parts = line.substring(line.indexOf(":") + 2).split(" "); String obf = parts[0]; String deobf = parts[1]; String[] obfParts = new String[2]; String[] deobfParts = new String[2]; obfParts[0] = obf.substring(0, obf.lastIndexOf("/")); // type obfParts[1] = obf.substring(obf.lastIndexOf("/") + 1); // field deobfParts[0] = deobf.substring(0, deobf.lastIndexOf("/")); // type deobfParts[1] = deobf.substring(deobf.lastIndexOf("/") + 1); // field FieldMapping obfMapping = new FieldMapping(obfParts[0], obfParts[1]); FieldMapping deobfMapping = new FieldMapping(deobfParts[0], deobfParts[1]); tempFields.put(deobfMapping, obfMapping); } else if (METHOD.equals(type)) { String[] parts = line.substring(line.indexOf(":") + 2).split(" "); String obf = parts[0]; String obfDesc = parts[1]; String deobf = parts[2]; String deobfDesc = parts[3]; String obfOwner = obf.substring(0, obf.lastIndexOf("/")); String obfName = obf.substring(obf.lastIndexOf("/") + 1); String deobfOwner = deobf.substring(0, deobf.lastIndexOf("/")); String deobfName = deobf.substring(deobf.lastIndexOf("/") + 1); MethodMapping obfMapping = new MethodMapping(obfOwner, obfName, obfDesc); MethodMapping deobfMapping = new MethodMapping(deobfOwner, deobfName, deobfDesc); tempMethods.put(deobfMapping, obfMapping); } } // From there, we go and parse through the included .csv files to get the DEOBF mappings InputStream fieldsInputStream = ObfuscationMapper.class.getResourceAsStream("fields.csv"); List<String> lines = IOUtils.readLines(fieldsInputStream); for (String line : lines) { if (line.startsWith("field")) { String[] parts = line.split(","); String srg = parts[0]; String deobf = parts[1]; for (Map.Entry<FieldMapping, FieldMapping> entry : tempFields.entrySet()) { if (entry.getKey().name.equals(srg)) { fields.put(new FieldMapping(entry.getKey().owner, deobf), entry.getValue()); } } } } InputStream methodsInputStream = ObfuscationMapper.class.getResourceAsStream("methods.csv"); lines = IOUtils.readLines(methodsInputStream); for (String line : lines) { if (line.startsWith("func")) { String[] parts = line.split(","); String srg = parts[0]; String deobf = parts[1]; for (Map.Entry<MethodMapping, MethodMapping> entry : tempMethods.entrySet()) { if (entry.getKey().name.equals(srg)) { methods.put(new MethodMapping(entry.getKey().owner, deobf, entry.getKey().desc), entry.getValue()); } } } } } catch (IOException ex) { ex.printStackTrace(); } } public static String mapType(String type) { String result = classes.get(type); return result != null ? result : type; } public static String mapField(String owner, String field) { FieldMapping fieldMapping = fields.get(new FieldMapping(owner, field)); return fieldMapping != null ? fieldMapping.name : field; } public static String mapMethod(String owner, String method, String desc) { MethodMapping methodMapping = methods.get(new MethodMapping(owner, method, desc)); return methodMapping != null ? methodMapping.name : method; } public static String unmapType(String type) { String result = classes.inverse().get(type); return result != null ? result : type; } public static String unmapField(String owner, String field) { FieldMapping fieldMapping = fields.inverse().get(new FieldMapping(owner, field)); return fieldMapping != null ? fieldMapping.name : field; } public static String unmapMethod(String owner, String method, String desc) { MethodMapping methodMapping = methods.inverse().get(new MethodMapping(owner, method, desc)); return methodMapping != null ? methodMapping.name : method; } }
{ "content_hash": "88b9c25eed94536454e85e841fd6520e", "timestamp": "", "source": "github", "line_count": 149, "max_line_length": 127, "avg_line_length": 45.053691275167786, "alnum_prop": 0.5873677938328616, "repo_name": "dmillerw/MineLua", "id": "5a994e98c03bbe0a8e521b8c839153ca7cc61122", "size": "6713", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/main/java/me/dmillerw/minelua/lib/mapping/ObfuscationMapper.java", "mode": "33188", "license": "mit", "language": [ { "name": "Java", "bytes": "24281" } ], "symlink_target": "" }
@card([ 'heading' => apply_filters('the_title', $post_title), 'context' => 'module.script' ]) @if (!$hideTitle && !empty($postTitle)) <div class="c-card__header"> @typography([ 'element' => 'h4', 'classList' => ['card-title'] ]) {!! $postTitle !!} @endtypography </div> @endif @include('partials.content') @image([ 'src' => $placeholder['url'], 'alt' => $placeholder['alt'], 'classList' => ['box-image', 'u-print-display--inline-block', 'u-display--none'] ]) @endimage @endcard
{ "content_hash": "676438212354ce9f4d2e53a55897b80b", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 88, "avg_line_length": 26.458333333333332, "alnum_prop": 0.47086614173228347, "repo_name": "helsingborg-stad/Modularity", "id": "aa0eed7d7e4bf78a7bd003fdd170bb71c63b9c14", "size": "635", "binary": false, "copies": "1", "ref": "refs/heads/3.0/develop", "path": "source/php/Module/Script/views/card.blade.php", "mode": "33188", "license": "mit", "language": [ { "name": "Blade", "bytes": "76820" }, { "name": "JavaScript", "bytes": "51347" }, { "name": "PHP", "bytes": "1168718" }, { "name": "SCSS", "bytes": "35577" } ], "symlink_target": "" }
description: Learn how to connect Docker containers together. keywords: - Examples, Usage, user guide, links, linking, docker, documentation, examples, names, name, container naming, port, map, network port, network menu: main: parent: smn_networking_def weight: -2 title: Legacy container links --- # Legacy container links The information in this section explains legacy container links within the Docker default bridge. This is a `bridge` network named `bridge` created automatically when you install Docker. Before the [Docker networks feature](../index.md), you could use the Docker link feature to allow containers to discover each other and securely transfer information about one container to another container. With the introduction of the Docker networks feature, you can still create links but they behave differently between default `bridge` network and [user defined networks](../work-with-networks.md#linking-containers-in-user-defined-networks) This section briefly discusses connecting via a network port and then goes into detail on container linking in default `bridge` network. ## Connect using network port mapping In [Run a simple application](../../../tutorials/usingdocker.md), you created a container that ran a Python Flask application: $ docker run -d -P training/webapp python app.py > **Note:** > Containers have an internal network and an IP address > (as we saw when we used the `docker inspect` command to show the container's > IP address in [Run a simple application](../../../tutorials/usingdocker.md) section). > Docker can have a variety of network configurations. You can see more > information on Docker networking [here](../index.md). When that container was created, the `-P` flag was used to automatically map any network port inside it to a random high port within an *ephemeral port range* on your Docker host. Next, when `docker ps` was run, you saw that port 5000 in the container was bound to port 49155 on the host. $ docker ps nostalgic_morse CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES bc533791f3f5 training/webapp:latest python app.py 5 seconds ago Up 2 seconds 0.0.0.0:49155->5000/tcp nostalgic_morse You also saw how you can bind a container's ports to a specific port using the `-p` flag. Here port 80 of the host is mapped to port 5000 of the container: $ docker run -d -p 80:5000 training/webapp python app.py And you saw why this isn't such a great idea because it constrains you to only one container on that specific port. Instead, you may specify a range of host ports to bind a container port to that is different than the default *ephemeral port range*: $ docker run -d -p 8000-9000:5000 training/webapp python app.py This would bind port 5000 in the container to a randomly available port between 8000 and 9000 on the host. There are also a few other ways you can configure the `-p` flag. By default the `-p` flag will bind the specified port to all interfaces on the host machine. But you can also specify a binding to a specific interface, for example only to the `localhost`. $ docker run -d -p 127.0.0.1:80:5000 training/webapp python app.py This would bind port 5000 inside the container to port 80 on the `localhost` or `127.0.0.1` interface on the host machine. Or, to bind port 5000 of the container to a dynamic port but only on the `localhost`, you could use: $ docker run -d -p 127.0.0.1::5000 training/webapp python app.py You can also bind UDP ports by adding a trailing `/udp`. For example: $ docker run -d -p 127.0.0.1:80:5000/udp training/webapp python app.py You also learned about the useful `docker port` shortcut which showed us the current port bindings. This is also useful for showing you specific port configurations. For example, if you've bound the container port to the `localhost` on the host machine, then the `docker port` output will reflect that. $ docker port nostalgic_morse 5000 127.0.0.1:49155 > **Note:** > The `-p` flag can be used multiple times to configure multiple ports. ## Connect with the linking system > **Note**: > This section covers the legacy link feature in the default `bridge` network. > Please refer to [linking containers in user-defined networks](../work-with-networks.md#linking-containers-in-user-defined-networks) > for more information on links in user-defined networks. Network port mappings are not the only way Docker containers can connect to one another. Docker also has a linking system that allows you to link multiple containers together and send connection information from one to another. When containers are linked, information about a source container can be sent to a recipient container. This allows the recipient to see selected data describing aspects of the source container. ### The importance of naming To establish links, Docker relies on the names of your containers. You've already seen that each container you create has an automatically created name; indeed you've become familiar with our old friend `nostalgic_morse` during this guide. You can also name containers yourself. This naming provides two useful functions: 1. It can be useful to name containers that do specific functions in a way that makes it easier for you to remember them, for example naming a container containing a web application `web`. 2. It provides Docker with a reference point that allows it to refer to other containers, for example, you can specify to link the container `web` to container `db`. You can name your container by using the `--name` flag, for example: $ docker run -d -P --name web training/webapp python app.py This launches a new container and uses the `--name` flag to name the container `web`. You can see the container's name using the `docker ps` command. $ docker ps -l CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES aed84ee21bde training/webapp:latest python app.py 12 hours ago Up 2 seconds 0.0.0.0:49154->5000/tcp web You can also use `docker inspect` to return the container's name. > **Note:** > Container names have to be unique. That means you can only call > one container `web`. If you want to re-use a container name you must delete > the old container (with `docker rm`) before you can create a new > container with the same name. As an alternative you can use the `--rm` > flag with the `docker run` command. This will delete the container > immediately after it is stopped. ## Communication across links Links allow containers to discover each other and securely transfer information about one container to another container. When you set up a link, you create a conduit between a source container and a recipient container. The recipient can then access select data about the source. To create a link, you use the `--link` flag. First, create a new container, this time one containing a database. $ docker run -d --name db training/postgres This creates a new container called `db` from the `training/postgres` image, which contains a PostgreSQL database. Now, you need to delete the `web` container you created previously so you can replace it with a linked one: $ docker rm -f web Now, create a new `web` container and link it with your `db` container. $ docker run -d -P --name web --link db:db training/webapp python app.py This will link the new `web` container with the `db` container you created earlier. The `--link` flag takes the form: --link <name or id>:alias Where `name` is the name of the container we're linking to and `alias` is an alias for the link name. You'll see how that alias gets used shortly. The `--link` flag also takes the form: --link <name or id> In which case the alias will match the name. You could have written the previous example as: $ docker run -d -P --name web --link db training/webapp python app.py Next, inspect your linked containers with `docker inspect`: {% raw %} $ docker inspect -f "{{ .HostConfig.Links }}" web {% endraw %} [/db:/web/db] You can see that the `web` container is now linked to the `db` container `web/db`. Which allows it to access information about the `db` container. So what does linking the containers actually do? You've learned that a link allows a source container to provide information about itself to a recipient container. In our example, the recipient, `web`, can access information about the source `db`. To do this, Docker creates a secure tunnel between the containers that doesn't need to expose any ports externally on the container; you'll note when we started the `db` container we did not use either the `-P` or `-p` flags. That's a big benefit of linking: we don't need to expose the source container, here the PostgreSQL database, to the network. Docker exposes connectivity information for the source container to the recipient container in two ways: * Environment variables, * Updating the `/etc/hosts` file. ### Environment variables Docker creates several environment variables when you link containers. Docker automatically creates environment variables in the target container based on the `--link` parameters. It will also expose all environment variables originating from Docker from the source container. These include variables from: * the `ENV` commands in the source container's Dockerfile * the `-e`, `--env` and `--env-file` options on the `docker run` command when the source container is started These environment variables enable programmatic discovery from within the target container of information related to the source container. > **Warning**: > It is important to understand that *all* environment variables originating > from Docker within a container are made available to *any* container > that links to it. This could have serious security implications if sensitive > data is stored in them. Docker sets an `<alias>_NAME` environment variable for each target container listed in the `--link` parameter. For example, if a new container called `web` is linked to a database container called `db` via `--link db:webdb`, then Docker creates a `WEBDB_NAME=/web/webdb` variable in the `web` container. Docker also defines a set of environment variables for each port exposed by the source container. Each variable has a unique prefix in the form: `<name>_PORT_<port>_<protocol>` The components in this prefix are: * the alias `<name>` specified in the `--link` parameter (for example, `webdb`) * the `<port>` number exposed * a `<protocol>` which is either TCP or UDP Docker uses this prefix format to define three distinct environment variables: * The `prefix_ADDR` variable contains the IP Address from the URL, for example `WEBDB_PORT_5432_TCP_ADDR=172.17.0.82`. * The `prefix_PORT` variable contains just the port number from the URL for example `WEBDB_PORT_5432_TCP_PORT=5432`. * The `prefix_PROTO` variable contains just the protocol from the URL for example `WEBDB_PORT_5432_TCP_PROTO=tcp`. If the container exposes multiple ports, an environment variable set is defined for each one. This means, for example, if a container exposes 4 ports that Docker creates 12 environment variables, 3 for each port. Additionally, Docker creates an environment variable called `<alias>_PORT`. This variable contains the URL of the source container's first exposed port. The 'first' port is defined as the exposed port with the lowest number. For example, consider the `WEBDB_PORT=tcp://172.17.0.82:5432` variable. If that port is used for both tcp and udp, then the tcp one is specified. Finally, Docker also exposes each Docker originated environment variable from the source container as an environment variable in the target. For each variable Docker creates an `<alias>_ENV_<name>` variable in the target container. The variable's value is set to the value Docker used when it started the source container. Returning back to our database example, you can run the `env` command to list the specified container's environment variables. ``` $ docker run --rm --name web2 --link db:db training/webapp env . . . DB_NAME=/web2/db DB_PORT=tcp://172.17.0.5:5432 DB_PORT_5432_TCP=tcp://172.17.0.5:5432 DB_PORT_5432_TCP_PROTO=tcp DB_PORT_5432_TCP_PORT=5432 DB_PORT_5432_TCP_ADDR=172.17.0.5 . . . ``` You can see that Docker has created a series of environment variables with useful information about the source `db` container. Each variable is prefixed with `DB_`, which is populated from the `alias` you specified above. If the `alias` were `db1`, the variables would be prefixed with `DB1_`. You can use these environment variables to configure your applications to connect to the database on the `db` container. The connection will be secure and private; only the linked `web` container will be able to talk to the `db` container. ### Important notes on Docker environment variables Unlike host entries in the [`/etc/hosts` file](dockerlinks.md#updating-the-etchosts-file), IP addresses stored in the environment variables are not automatically updated if the source container is restarted. We recommend using the host entries in `/etc/hosts` to resolve the IP address of linked containers. These environment variables are only set for the first process in the container. Some daemons, such as `sshd`, will scrub them when spawning shells for connection. ### Updating the `/etc/hosts` file In addition to the environment variables, Docker adds a host entry for the source container to the `/etc/hosts` file. Here's an entry for the `web` container: $ docker run -t -i --rm --link db:webdb training/webapp /bin/bash root@aed84ee21bde:/opt/webapp# cat /etc/hosts 172.17.0.7 aed84ee21bde . . . 172.17.0.5 webdb 6e5cdeb2d300 db You can see two relevant host entries. The first is an entry for the `web` container that uses the Container ID as a host name. The second entry uses the link alias to reference the IP address of the `db` container. In addition to the alias you provide, the linked container's name--if unique from the alias provided to the `--link` parameter--and the linked container's hostname will also be added in `/etc/hosts` for the linked container's IP address. You can ping that host now via any of these entries: root@aed84ee21bde:/opt/webapp# apt-get install -yqq inetutils-ping root@aed84ee21bde:/opt/webapp# ping webdb PING webdb (172.17.0.5): 48 data bytes 56 bytes from 172.17.0.5: icmp_seq=0 ttl=64 time=0.267 ms 56 bytes from 172.17.0.5: icmp_seq=1 ttl=64 time=0.250 ms 56 bytes from 172.17.0.5: icmp_seq=2 ttl=64 time=0.256 ms > **Note:** > In the example, you'll note you had to install `ping` because it was not included > in the container initially. Here, you used the `ping` command to ping the `db` container using its host entry, which resolves to `172.17.0.5`. You can use this host entry to configure an application to make use of your `db` container. > **Note:** > You can link multiple recipient containers to a single source. For > example, you could have multiple (differently named) web containers attached to your >`db` container. If you restart the source container, the linked containers `/etc/hosts` files will be automatically updated with the source container's new IP address, allowing linked communication to continue. $ docker restart db db $ docker run -t -i --rm --link db:db training/webapp /bin/bash root@aed84ee21bde:/opt/webapp# cat /etc/hosts 172.17.0.7 aed84ee21bde . . . 172.17.0.9 db # Related information
{ "content_hash": "2b5d0dde14dd5d0b9e3310d1f19d0e91", "timestamp": "", "source": "github", "line_count": 372, "max_line_length": 186, "avg_line_length": 42.21236559139785, "alnum_prop": 0.7500477615742215, "repo_name": "danix800/docker.github.io", "id": "6b88276cf4155dd4db7fa0895e6e438f11768246", "size": "15707", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "engine/userguide/networking/default_network/dockerlinks.md", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "514107" }, { "name": "HTML", "bytes": "1306485" }, { "name": "JavaScript", "bytes": "9975024" }, { "name": "Makefile", "bytes": "3441" }, { "name": "Ruby", "bytes": "4572" }, { "name": "Shell", "bytes": "6534" } ], "symlink_target": "" }
/** * Projectile project. */ /*jslint browser: true, devel: true, vars: true */ /* canvas details */ var width = 800; var height = 600; var canvas; var ctx; var frameRate = 1 / 40; /* seconds */ var frameDelay = frameRate * 1000; /* milli-seconds */ var loopTimer; var nrClicks = 0; /* controls the number of clicks done by the user on the canvas */ /* projectile details */ var projectile; var hitGround = false; /* to acknowledge if the projectile has stopped */ /** * creates a projectile */ function initializeProjectile(event) { "use strict"; /* mouse position co-ordinate X and Y */ var posX = event.clientX; var posY = event.clientY; /* projectile details */ var velocity = Math.floor(Math.random() * 11); /* random number between 0 and 10 */ var angle = Math.floor(Math.random() * 361); /* random number between 0 and 360 */ projectile = { position: {x: posX, y: posY}, velocity: {x: Math.cos(angle * (Math.PI / 180)) * velocity, y: -Math.sin(angle * (Math.PI / 180)) * velocity}, radius: 15, mass: 0.7, restitution: -0.6 }; console.log('projectile initial position: ' + projectile.position.x + ' (x), ' + projectile.position.y + ' (y)'); console.log('initial angle (counter clockwise): ' + angle + 'º, and initial velocity: ' + velocity); console.log('projectile initial velocity: ' + projectile.velocity.x + ' (v_x), ' + projectile.velocity.y + ' (v_y)'); } /** * draws the ball on the canvas */ function drawBall() { "use strict"; ctx.clearRect(0, 0, width, height); ctx.save(); ctx.beginPath(); ctx.arc(projectile.position.x, projectile.position.y, projectile.radius, 0, 2 * Math.PI, false); ctx.lineWidth = 1; ctx.fillStyle = 'grey'; ctx.fill(); ctx.closePath(); ctx.restore(); } /** * calculates the drag force * http://en.wikipedia.org/wiki/Drag_(physics) * Drag force: Fd = -1/2 * Cd * A * rho * v * v */ function calculateDragForce(component) { "use strict"; var Cd = 0.47; /* drag coefficient */ var rho = 1.22; /* density of the projectile */ var projectileArea = Math.PI * projectile.radius * projectile.radius / (10000); var drag = -0.5 * Cd * projectileArea * rho * component * component * component / Math.abs(component); return (isNaN(drag) ? 0 : drag); } /** * the rendering loop */ var loop = function () { "use strict"; if (!hitGround) { /* Calculate acceleration ( F = ma ) */ var ax = calculateDragForce(projectile.velocity.x) / projectile.mass; /* Integrate to get velocity */ projectile.velocity.x += ax * frameRate; projectile.velocity.y += 9.81 * frameRate; /* 9.81 is the gravity acceleration */ /* testing if the projectile already stopped */ if (Math.abs(projectile.velocity.x) <= 1.1 && projectile.position.y === canvas.height - projectile.radius && Math.abs(projectile.velocity.y) <= 0.50) { console.log('houston, we hit the ground to a full stop!'); projectile.velocity.x = 0; projectile.velocity.y = 0; hitGround = true; } /* Integrate to get position */ projectile.position.x += projectile.velocity.x * frameRate * 100; projectile.position.y += projectile.velocity.y * frameRate * 100; /* Handle collisions */ if (projectile.position.y > height - projectile.radius) { projectile.velocity.y *= projectile.restitution; projectile.position.y = height - projectile.radius; } if (projectile.position.x > width - projectile.radius) { projectile.velocity.x *= projectile.restitution; projectile.position.x = width - projectile.radius; } if (projectile.position.x < projectile.radius) { projectile.velocity.x *= projectile.restitution; projectile.position.x = projectile.radius; } /* draw the ball */ drawBall(); } }; /** * initializes the canvas */ function initializeCanvas() { "use strict"; canvas = document.getElementById('projectile'); ctx = canvas.getContext('2d'); } /** * requestAnimationFrame() by Miguel Rentes * Corrects all JSLint warnings and uses a browser-compatible requestAnimFrame() function * Based on Paul Irish's work - http://paulirish.com/2011/requestanimationframe-for-smart-animating/ * Also, please see https://gist.github.com/joelambert/1002116 */ window.requestAnimFrame = (function () { "use strict"; return window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function (callback) { window.setTimeout(callback, 1000 / 60); }; }()); /** * Behaves the same as setInterval except uses requestAnimationFrame() where possible for better performance * @param {function} fn The callback function * @param {int} delay The delay in milliseconds */ window.requestInterval = function (fn, delay) { "use strict"; if (!window.requestAnimationFrame && !window.webkitRequestAnimationFrame && !(window.mozRequestAnimationFrame && window.mozCancelRequestAnimationFrame) && // Firefox 5 ships without cancel support !window.oRequestAnimationFrame && !window.msRequestAnimationFrame) { return window.setInterval(fn, delay); } var start = new Date().getTime(); var handle = Object.create(null); function loop() { var current = new Date().getTime(); var delta = current - start; if (delta >= delay) { fn.call(); start = new Date().getTime(); } handle.value = window.requestAnimFrame(loop); } handle.value = window.requestAnimFrame(loop); return handle; }; /** * Behaves the same as clearInterval except uses cancelRequestAnimationFrame() where possible for better performance * @param {int|object} handle The callback function */ window.clearRequestInterval = function (handle) { "use strict"; if (window.cancelAnimationFrame) { window.cancelAnimationFrame(handle.value); } else if (window.webkitCancelAnimationFrame) { window.webkitCancelAnimationFrame(handle.value); } else if (window.webkitCancelRequestAnimationFrame) { window.webkitCancelRequestAnimationFrame(handle.value); } else if (window.mozCancelRequestAnimationFrame) { window.mozCancelRequestAnimationFrame(handle.value); } else if (window.oCancelRequestAnimationFrame) { window.oCancelRequestAnimationFrame(handle.value); } else if (window.msCancelRequestAnimationFrame) { window.msCancelRequestAnimationFrame(handle.value); } else { clearInterval(handle); } }; /** * Behaves the same as setTimeout except uses requestAnimationFrame() where possible for better performance * @param {function} fn The callback function * @param {int} delay The delay in milliseconds */ window.requestTimeout = function (fn, delay) { "use strict"; if (!window.requestAnimationFrame && !window.webkitRequestAnimationFrame && !(window.mozRequestAnimationFrame && window.mozCancelRequestAnimationFrame) && // Firefox 5 ships without cancel support !window.oRequestAnimationFrame && !window.msRequestAnimationFrame) { return window.setTimeout(fn, delay); } var start = new Date().getTime(), handle = Object.create(null); function loop() { var current = new Date().getTime(); var delta = current - start; if (delta >= delay) { fn.call(); } else { handle.value = window.requestAnimFrame(loop); } } handle.value = window.requestAnimFrame(loop); return handle; }; /** * Behaves the same as clearTimeout except uses cancelRequestAnimationFrame() where possible for better performance * @param {int|object} handle The callback function */ window.clearRequestTimeout = function (handle) { "use strict"; if (window.cancelAnimationFrame) { window.cancelAnimationFrame(handle.value); } else if (window.webkitCancelAnimationFrame) { window.webkitCancelAnimationFrame(handle.value); } else if (window.webkitCancelRequestAnimationFrame) { window.webkitCancelRequestAnimationFrame(handle.value); /* Support for legacy API */ } else if (window.mozCancelRequestAnimationFrame) { window.mozCancelRequestAnimationFrame(handle.value); } else if (window.oCancelRequestAnimationFrame) { window.oCancelRequestAnimationFrame(handle.value); } else if (window.msCancelRequestAnimationFrame) { window.msCancelRequestAnimationFrame(handle.value); } else { clearTimeout(handle); } }; /** * creates the projectile and enters the loop */ function startProjectile(event) { "use strict"; initializeProjectile(event); initializeCanvas(); loopTimer = window.requestInterval(loop, frameDelay); } /** * entry point for the projectile project */ function drawProjectile(event) { "use strict"; nrClicks += 1; if (nrClicks > 1 && hitGround === false) { alert('please wait for the projectile to stop.'); } else if (hitGround === true) { /* after projectile animation is completed */ hitGround = false; /* resets the hitGround var */ window.clearRequestInterval(loopTimer); startProjectile(event); } else { /* first projectile animation */ startProjectile(event); } }
{ "content_hash": "7e413845ddce7d25e905b672b041ab17", "timestamp": "", "source": "github", "line_count": 278, "max_line_length": 159, "avg_line_length": 34.884892086330936, "alnum_prop": 0.6511651886987008, "repo_name": "rentes/projectile.js", "id": "e090a172ab43d30d2a83c17300c9950fd5fb7cff", "size": "9699", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "projectile.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "78" }, { "name": "HTML", "bytes": "482" }, { "name": "JavaScript", "bytes": "10610" } ], "symlink_target": "" }
using System; using System.Collections; using System.Collections.Generic; using System.ComponentModel; using System.Drawing; using System.Linq; using System.Reflection; using System.Windows.Forms; using hw.DebugFormatter; using hw.Helper; using JetBrains.Annotations; namespace hw.Forms { public static class Extension { /// <summary> /// Creates a treenode.with a given title from an object /// </summary> /// <param name="nodeData"> </param> /// <param name="title"> </param> /// <param name="iconKey"> </param> /// <param name="isDefaultIcon"> </param> /// <param name="name"></param> /// <returns> </returns> public static TreeNode CreateNode( this object nodeData, string title = "", string iconKey = null, bool isDefaultIcon = false, string name = null) { var text = title + nodeData.GetAdditionalInfo(); var effectiveName = nodeData.GetName(name) ?? text; var result = new TreeNode(text) {Tag = nodeData, Name = effectiveName}; if(iconKey == null) iconKey = nodeData.GetIconKey(); if(isDefaultIcon) { var defaultIcon = nodeData.GetIconKey(); if(defaultIcon != null) iconKey = defaultIcon; } if(iconKey != null) { result.ImageKey = iconKey; result.SelectedImageKey = iconKey; } return result; } /// <summary> /// Creates a treenode.with a given title from an object (format: &lt;title&gt; = &lt;nodeData.ToString()&gt;) /// </summary> /// <param name="title"> The title. </param> /// <param name="iconKey"> The icon key. </param> /// <param name="isDefaultIcon"> if set to <c>true</c> [is default icon]. </param> /// <param name="nodeData"> The node data. Can be <see cref="IIconKeyProvider" /> </param> /// <param name="name"></param> /// <returns> </returns> /// created 06.02.2007 23:26 public static TreeNode CreateNamedNode( this object nodeData, string title, string iconKey = null, bool isDefaultIcon = false, string name = null) { return nodeData .CreateNode(title + " = ", iconKey, isDefaultIcon, name); } /// <summary> /// Creates a treenode.with a given title from an object (format: &lt;title&gt;: &lt;nodeData.ToString()&gt;) /// </summary> /// <param name="title"> The title. </param> /// <param name="iconKey"> The icon key. </param> /// <param name="isDefaultIcon"> if set to <c>true</c> [is default icon]. </param> /// <param name="nodeData"> The node data. Can be <see cref="IIconKeyProvider" /> </param> /// <param name="name"></param> /// <returns> </returns> /// created 06.02.2007 23:26 public static TreeNode CreateTaggedNode( this object nodeData, string title, string iconKey = null, bool isDefaultIcon = false, string name = null) { return nodeData .CreateNode(title + ": ", iconKey, isDefaultIcon, name); } static TreeNode[] InternalCreateNodes(IDictionary dictionary) { var result = new List<TreeNode>(); foreach(var element in dictionary) result.Add(CreateNumberedNode(element, result.Count, "ListItem")); return result.ToArray(); } static TreeNode CreateNumberedNode( object nodeData, int i, string iconKey, bool isDefaultIcon = false, string name = null) { return nodeData .CreateNode("[" + i + "] ", iconKey, isDefaultIcon, name ?? i.ToString()); } static TreeNode[] InternalCreateNodes(IList list) { var result = new List<TreeNode>(); foreach(var o in list) result.Add(CreateNumberedNode(o, result.Count, "ListItem", true)); return result.ToArray(); } static TreeNode[] InternalCreateNodes(DictionaryEntry dictionaryEntry) { return new[] { dictionaryEntry.Key.CreateTaggedNode("key", "Key", true), dictionaryEntry.Value.CreateTaggedNode("value") }; } /// <summary> /// Gets the name of the icon. /// </summary> /// <param name="nodeData"> The node data. </param> /// <returns> </returns> public static string GetIconKey(this object nodeData) { if(nodeData == null) return null; var ip = nodeData as IIconKeyProvider; if(ip != null) return ip.IconKey; if(nodeData is string) return "String"; if(nodeData is bool) return "Bool"; if(nodeData.GetType().IsPrimitive) return "Number"; if(nodeData is IDictionary) return "Dictionary"; if(nodeData is IList) return "List"; return null; } internal static string GetName([CanBeNull] this object nodeData, string name) { if(nodeData == null) return name; var additionalNodeInfoProvider = nodeData as INodeNameProvider; if(additionalNodeInfoProvider != null) return additionalNodeInfoProvider.Value(name); var attr = nodeData.GetType().GetAttribute<NodeNameAttribute>(true); if(attr != null) return nodeData.GetType().InvokeMember(attr.Property, BindingFlags.Default, null, nodeData, new object[] {name}).ToString(); return name; } [NotNull] internal static string GetAdditionalInfo([CanBeNull] this object nodeData) { if(nodeData == null) return "<null>"; var additionalNodeInfoProvider = nodeData as IAdditionalNodeInfoProvider; if(additionalNodeInfoProvider != null) return additionalNodeInfoProvider.AdditionalNodeInfo; var attr = nodeData.GetType().GetAttribute<AdditionalNodeInfoAttribute>(true); if(attr != null) return nodeData.GetType().GetProperty(attr.Property).GetValue(nodeData, null).ToString(); var il = nodeData as IList; if(il != null) return il.GetType().PrettyName() + "[" + ((IList) nodeData).Count + "]"; var nameSpace = nodeData.GetType().Namespace; if(nameSpace != null && nameSpace.StartsWith("System")) return nodeData.ToString(); return ""; } static TreeNode[] InternalCreateNodes(object target) { var result = new List<TreeNode>(); result.AddRange(CreateFieldNodes(target)); result.AddRange(CreatePropertyNodes(target)); return result.ToArray(); } public static TreeNode[] CreateNodes(this object target) { if(target == null) return new TreeNode[0]; var xn = target as ITreeNodeSupport; if(xn != null) return xn.CreateNodes().ToArray(); return CreateAutomaticNodes(target); } public static TreeNode[] CreateAutomaticNodes(this object target) { var xl = target as IList; if(xl != null) return InternalCreateNodes(xl); var xd = target as IDictionary; if(xd != null) return InternalCreateNodes(xd); if(target is DictionaryEntry) return InternalCreateNodes((DictionaryEntry) target); return InternalCreateNodes(target); } static TreeNode[] CreatePropertyNodes(object nodeData) { return nodeData .GetType() .GetProperties(DefaultBindingFlags) .Select(propertyInfo => CreateTreeNode(nodeData, propertyInfo)) .Where(treeNode => treeNode != null) .ToArray(); } static TreeNode[] CreateFieldNodes(object nodeData) { return nodeData .GetType() .GetFieldInfos() .Select(fieldInfo => CreateTreeNode(nodeData, fieldInfo)) .Where(treeNode => treeNode != null) .ToArray(); } static BindingFlags DefaultBindingFlags { get { return BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.FlattenHierarchy; } } static TreeNode CreateTreeNode(object nodeData, FieldInfo fieldInfo) { return CreateTreeNode( fieldInfo, () => Value(fieldInfo, nodeData)); } static TreeNode CreateTreeNode(object nodeData, PropertyInfo propertyInfo) { return CreateTreeNode( propertyInfo, () => Value(propertyInfo, nodeData)); } static object Value(FieldInfo fieldInfo, object nodeData) { return fieldInfo.GetValue(nodeData); } static object Value(PropertyInfo propertyInfo, object nodeData) { return propertyInfo.GetValue(nodeData, null); } static TreeNode CreateTreeNode(MemberInfo memberInfo, Func<object> getValue) { var attribute = memberInfo.GetAttribute<NodeAttribute>(true); if(attribute == null) return null; var value = CatchedEval(getValue); if(value == null) return null; var result = CreateNamedNode(value, memberInfo.Name, attribute.IconKey, name: attribute.Name); if(memberInfo.GetAttribute<SmartNodeAttribute>(true) == null) return result; return SmartNodeAttribute.Process(result); } static object CatchedEval(Func<object> value) { try { return value(); } catch(Exception e) { return e; } } static void CreateNodeList(TreeNodeCollection nodes, object target) { var treeNodes = CreateNodes(target); //Tracer.FlaggedLine(treeNodes.Dump()); //Tracer.ConditionalBreak(treeNodes.Length == 20,""); nodes.Clear(); nodes.AddRange(treeNodes); } public static void Connect(this TreeView treeView, object target) { Connect(target, treeView); } public static void Connect(this object target, TreeView treeView) { CreateNodeList(treeView.Nodes, target); AddSubNodes(treeView.Nodes); treeView.BeforeExpand += (sender, e) => BeforeExpand(e.Node.Nodes); } static void AddSubNodesAsync(TreeNodeCollection nodes) { lock(nodes) { var backgroundWorker = new BackgroundWorker(); backgroundWorker.DoWork += ((sender, e) => AddSubNodes(nodes)); backgroundWorker.RunWorkerAsync(); } } static void AddSubNodes(TreeNodeCollection nodes) { foreach(TreeNode node in nodes) CreateLazyNodeList(node); } internal static void CreateNodeList(this TreeNode node) { CreateNodeList(node.Nodes, node.Tag); } internal static void CreateLazyNodeList(this TreeNode node) { var probe = node.Tag as ITreeNodeProbeSupport; if(probe == null || probe.IsEmpty) { CreateNodeList(node); return; } node.Nodes.Clear(); node.Nodes.Add(new TreeNode {Tag = new LazyNode {Target = node.Tag}, Text = "<lazynode>"}); } public static void BeforeExpand(this TreeNodeCollection nodes) { LazyNodes(nodes); AddSubNodes(nodes); } static void LazyNodes(TreeNodeCollection nodes) { if(nodes.Count != 1) return; var lazyNode = nodes[0].Tag as LazyNode; if(lazyNode == null) return; CreateNodeList(nodes, lazyNode.Target); } /// <summary> /// Installs a <see cref="PositionConfig" /> for target /// </summary> /// <param name="target">the form that will be watched</param> /// <param name="getFileName"> /// function to obtain filename of configuration file. /// <para>It will be called each time the name is required. </para> /// <para>Default: Target.Name</para> /// </param> public static PositionConfig InstallPositionConfig(this Form target, Func<string> getFileName = null) { return new PositionConfig(getFileName) {Target = target}; } /// <summary> /// Turns collection into IEnumerable /// </summary> /// <param name="value"></param> /// <returns></returns> public static IEnumerable<TreeNode> _(this TreeNodeCollection value) { return value.Cast<TreeNode>(); } /// <summary> /// Turns collection into IEnumerable /// </summary> /// <param name="value"></param> /// <returns></returns> public static IEnumerable<Control> _(this Control.ControlCollection value) { return value.Cast<Control>(); } /// <summary> /// Flatten node hierarchy /// </summary> /// <param name="tree"></param> /// <returns></returns> public static IEnumerable<TreeNode> SelectHierachical(this TreeView tree) { return tree .Nodes ._() .SelectMany(n => n.SelectHierachical(nn => nn.Nodes._())); } /// <summary> /// Call a function or invoke it if required /// </summary> /// <typeparam name="T"></typeparam> /// <param name="control"></param> /// <param name="function"></param> /// <returns></returns> public static T ThreadCallGuard<T>(this Control control, Func<T> function) { if (control.InvokeRequired) return (T)control.Invoke(function); return function(); } /// <summary> /// Call an action or invoke it if required /// </summary> /// <typeparam name="T"></typeparam> /// <param name="control"></param> /// <param name="function"></param> /// <returns></returns> public static void ThreadCallGuard(this Control control, Action function) { if (control.InvokeRequired) control.Invoke(function); else function(); } public const int ShiftKey = 4; public const int AltKey = 32; public const int ControlKey = 8; public const int LeftMouseButton = 1; public const int RightMouseButton = 2; public const int MiddleMouseButton = 16; public static bool SetEffect<T>(this DragEventArgs e, Func<T, bool> getIsValid, DragDropEffects defaultEffect) { e.Effect = ObtainEffect(e, getIsValid, defaultEffect); return e.Effect != DragDropEffects.None; } public static DragDropEffects ObtainEffect<T>(DragEventArgs e, Func<T, bool> getIsValid, DragDropEffects defaultEffect) { if (e.IsValid(getIsValid)) { if (e.KeyState.HasBitSet(AltKey) && e.AllowedEffect.HasFlag(DragDropEffects.Link)) return DragDropEffects.Link; if (e.KeyState.HasBitSet(ShiftKey) && e.AllowedEffect.HasFlag(DragDropEffects.Move)) return DragDropEffects.Move; if (e.KeyState.HasBitSet(ControlKey) && e.AllowedEffect.HasFlag(DragDropEffects.Copy)) return DragDropEffects.Copy; if (e.AllowedEffect.HasFlag(defaultEffect)) return defaultEffect; } return DragDropEffects.None; } public static bool IsValid<T>(this DragEventArgs e, Func<T, bool> getIsValid) { return e.Data.GetDataPresent(typeof(T)) && getIsValid((T)e.Data.GetData(typeof(T))); } public static bool SetEffectCopy(this DragEventArgs e, bool isValid) { Tracer.Assert(e.AllowedEffect == DragDropEffects.Copy); e.Effect = isValid && e.KeyState.HasBitSet(ControlKey) ? DragDropEffects.Copy : DragDropEffects.None; return e.Effect != DragDropEffects.None; } public static Bitmap AsBitmap(this Control c) { var result = new Bitmap(c.Width, c.Height); c.DrawToBitmap(result, new Rectangle(0, 0, c.Width, c.Height)); return result; } public static Cursor ToCursor(this Control control, Point? hotSpot = null) { var iconInfo = new CursorUtil.IconInfo(control.AsBitmap()); if (hotSpot != null) iconInfo.HotSpot = hotSpot.Value; return iconInfo.Cursor; } } }
{ "content_hash": "93cf9958828dd70122a1853d9ae77387", "timestamp": "", "source": "github", "line_count": 501, "max_line_length": 171, "avg_line_length": 36.590818363273456, "alnum_prop": 0.5329478507527821, "repo_name": "hahoyer/HWsqlass.cs", "id": "8588d504ae31370c182f9e8a28774121a85efed1", "size": "18332", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/Taabus/hw/Forms/Extender.cs", "mode": "33188", "license": "mit", "language": [ { "name": "C#", "bytes": "1462695" } ], "symlink_target": "" }
Rails.application.config.session_store :cookie_store, key: '_createlink_session'
{ "content_hash": "166c757083e715a60a5b80b210b667f9", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 80, "avg_line_length": 81, "alnum_prop": 0.8024691358024691, "repo_name": "glaresky/createlink", "id": "f1c568021a5e0114614c00f015a65605055579bd", "size": "142", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "config/initializers/session_store.rb", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "2601" }, { "name": "CoffeeScript", "bytes": "633" }, { "name": "HTML", "bytes": "8380" }, { "name": "JavaScript", "bytes": "3678" }, { "name": "Ruby", "bytes": "26033" } ], "symlink_target": "" }
<?php namespace Metaregistrar\EPP; /** * The EPP Secdns Object * * This will hold the secdns data for a domain name * * * */ class eppSecdns { /** * * @var string */ private $keytag = ''; /** * * @var string */ private $siglife = ''; /** * * @var string */ private $digestType = ''; /** * * @var string */ private $digest = ''; /** * * @var string */ private $flags = ''; /** * * @var string */ private $protocol = '3'; /** * * @var string */ private $algorithm = ''; /** * * @var string */ private $pubkey = ''; /** * * @return void */ public function __construct() { } public function setKey($flags, $algorithm, $pubkey) { $this->setFlags($flags); $this->setAlgorithm($algorithm); $this->setPubkey($pubkey); } public function setData($keyTag, $digestType, $digest) { $this->setKeytag($keyTag); $this->setDigestType($digestType); $this->setDigest($digest); } /** * Gets the digest * @return string */ public function getDigest() { return $this->digest; } /** * Sets the digest * @param string $digest * @return void */ public function setDigest($digest) { $this->digest = $digest; } /** * Gets the digestType * @return string */ public function getDigestType() { return $this->digestType; } /** * Sets the digestType * @param string $digestType * @return void */ public function setDigestType($digestType) { $this->digestType = $digestType; } /** * Gets the siglife * @return string */ public function getSiglife() { return $this->siglife; } /** * Sets the siglife * @param string $siglife * @return void */ public function setSiglife($siglife) { $this->siglife = $siglife; } /** * Gets the keytag * @return string */ public function getKeytag() { return $this->keytag; } /** * Sets the keytag * @param string $keytag * @return void */ public function setKeytag($keytag) { $this->keytag = $keytag; } /** * Gets the protocol * @return string */ public function getProtocol() { return $this->protocol; } /** * Sets the protocol * @param string $protocol * @return void */ public function setProtocol($protocol) { $this->protocol = $protocol; } /** * Gets the flags * @return string */ public function getFlags() { return $this->flags; } /** * Sets the flags * @param string $flags * @return void */ public function setFlags($flags) { $this->flags = $flags; } /** * Gets the public key * @return string */ public function getPubkey() { return $this->pubkey; } /** * Sets the public key * @param string $pubkey * @return void */ public function setPubkey($pubkey) { $this->pubkey = $pubkey; } /** * Gets the algorithm * @return string */ public function getAlgorithm() { return $this->algorithm; } /** * Sets the algorithm * @param string $algorithm * @return void */ public function setAlgorithm($algorithm) { $this->algorithm = $algorithm; } // Copy data from a similar object to this one, with safeguards public function copy($object) { $this->setPubkey($object->getPubkey()); $this->setProtocol($object->getProtocol()); $this->setFlags($object->getFlags()); $this->setAlgorithm($object->getAlgorithm()); $this->setDigest($object->getDigest()); $this->setDigestType($object->getDigestType()); $this->setKeytag($object->getKeytag()); $this->setSiglife($object->getSiglife()); } public function equals($object) { $equals = true; if ($this->getPubkey() != $object->getPubkey()) { $equals = false; } if ($this->getProtocol() != $object->getProtocol()) { $equals = false; } if ($this->getFlags() != $object->getFlags()) { $equals = false; } if ($this->getAlgorithm() != $object->getAlgorithm()) { $equals = false; } if ($this->getDigest() != $object->getDigest()) { $equals = false; } if ($this->getDigestType() != $object->getDigestType()) { $equals = false; } if ($this->getKeytag() != $object->getKeytag()) { $equals = false; } if ($this->getSiglife() != $object->getSiglife()) { $equals = false; } return $equals; } }
{ "content_hash": "5d1010ce4f7e4e7276d35b1a75b3478c", "timestamp": "", "source": "github", "line_count": 258, "max_line_length": 67, "avg_line_length": 19.593023255813954, "alnum_prop": 0.49752720079129575, "repo_name": "aasiimweDataCare/sugarGirls", "id": "97d184a41e9daa527c47f0876a1300702aa05d3b", "size": "5055", "binary": false, "copies": "4", "ref": "refs/heads/master", "path": "application/third_party/PHPEpp/Protocols/EPP/eppExtensions/secDNS-1.1/eppData/eppSecdns.php", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "ApacheConf", "bytes": "613" }, { "name": "CSS", "bytes": "331402" }, { "name": "HTML", "bytes": "511727" }, { "name": "Java", "bytes": "99318" }, { "name": "JavaScript", "bytes": "1577601" }, { "name": "PHP", "bytes": "2453858" }, { "name": "PLpgSQL", "bytes": "875" } ], "symlink_target": "" }
ACCEPTED #### According to International Plant Names Index #### Published in null #### Original name null ### Remarks null
{ "content_hash": "85186283183c1b71a22d7856a1ba1300", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 31, "avg_line_length": 9.692307692307692, "alnum_prop": 0.7063492063492064, "repo_name": "mdoering/backbone", "id": "832c85fcef766ce33f83d152477ac37f21c799b2", "size": "190", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Plantae/Magnoliophyta/Magnoliopsida/Malpighiales/Violaceae/Viola/Viola escarapela/README.md", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
using UnityEngine; using UnityEditor.Callbacks; using UnityEditor; using System.Text; using System.IO; using System.Collections.Generic; using System.Collections; using System.Text.RegularExpressions; public class AndroidNativeJarBuildScript : MonoBehaviour { static string[] excludeFilesRegex= new string[] { @"^.*\.meta$", @"^.gitignore$", @"^\.DS_Store$", @"^.*\.bak$" }; #if UNITY_EDITOR public static void BuildJar() { CleanOldDependency(); PreReadyCompileEvn (); UpdateJavaSrcDirs (); //构建jdk-native.jar DoBuildJar (); } public static void CleanOldDependency(){ } public static void PreReadyCompileEvn(){ } static void UpdateJavaSrcDirs(){ string modulePath = System.IO.Path.Combine (Application.dataPath, "JDKLib/Editor/Android/jdkplugin/build_template.gradle"); string buildPath = System.IO.Path.Combine (Application.dataPath, "JDKLib/Editor/Android/jdkplugin/build.gradle"); string subModulesKey = "${SUB_MODULES}"; string addedModuleSrcs=""; // foreach (var moduleName in JDKModuleSettings.Instance.OpenedFields()) // { // addedModuleSrcs += "'src/main/"+moduleName+"',"; // } string fileText = System.IO.File.ReadAllText (modulePath); fileText = fileText.Replace (subModulesKey, addedModuleSrcs.Substring(0, addedModuleSrcs.Length-1)); System.IO.File.WriteAllText(buildPath, fileText); } static void DoBuildJar() { Debug.Log ("================== Build Android Native Jar =================="); Debug.Log ("building jar..."); EditorUtility.DisplayProgressBar( "正在构建JDK Native jar", "请等待1-2分钟,首次构建时间可能需要10+分钟", 0.8f); string path = Application.dataPath + "/JDKLib/Editor/Android/gradle_shell/"; System.Diagnostics.Process proc = new System.Diagnostics.Process(); proc.StartInfo.UseShellExecute = false; proc.StartInfo.CreateNoWindow = true; proc.StartInfo.RedirectStandardError = true; proc.EnableRaisingEvents=false; proc.StartInfo.FileName = "chmod"; proc.StartInfo.Arguments = "755 \"" + path + "build.sh\""; proc.Start(); string err = proc.StandardError.ReadToEnd(); proc.WaitForExit(); proc = new System.Diagnostics.Process(); proc.StartInfo.UseShellExecute = false; proc.StartInfo.CreateNoWindow = true; proc.StartInfo.RedirectStandardError = true; proc.EnableRaisingEvents=false; proc.StartInfo.FileName = path + "build.sh"; // if (Config.shareInstance.UseMSDK) { // proc.StartInfo.Arguments = "msdk"; // }else{ // proc.StartInfo.Arguments = "nonemsdk"; // } proc.Start(); err = proc.StandardError.ReadToEnd(); proc.WaitForExit(); EditorUtility.ClearProgressBar (); if (proc.ExitCode != 0) { UnityEngine.Debug.LogError ("error: " + err + " code: " + proc.ExitCode); throw new System.Exception ("jdk jar 构建失败"); } else { Debug.Log ("Build jar COMPLETE."); Debug.Log ("=============================================================="); } } static string _destinationPath=null; public static void CopyAndroidDirectory (string sourcePath, string destinationPath="",bool isLink = true) { } #endif }
{ "content_hash": "e92ac5409d0112343c30673496778eea", "timestamp": "", "source": "github", "line_count": 114, "max_line_length": 126, "avg_line_length": 29.13157894736842, "alnum_prop": 0.6374585968081903, "repo_name": "xclouder/u3d_autobuilder", "id": "88124e5eb2ccc80682b21d094e9252657de1c54f", "size": "3377", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Assets/AutoBuilder/Editor/AndroidBuilder/AndroidNativeJarBuildScript.cs", "mode": "33261", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "2394" }, { "name": "C#", "bytes": "24462" }, { "name": "HTML", "bytes": "875455" }, { "name": "Java", "bytes": "187" }, { "name": "Shell", "bytes": "6413" } ], "symlink_target": "" }
// // ======================================================================== // Copyright (c) 1995-2015 Mort Bay Consulting Pty. Ltd. // ------------------------------------------------------------------------ // All rights reserved. This program and the accompanying materials // are made available under the terms of the Eclipse Public License v1.0 // and Apache License v2.0 which accompanies this distribution. // // The Eclipse Public License is available at // http://www.eclipse.org/legal/epl-v10.html // // The Apache License v2.0 is available at // http://www.opensource.org/licenses/apache2.0.php // // You may elect to redistribute this code under either of these licenses. // ======================================================================== // package org.eclipse.jetty.util.ajax; import java.io.Externalizable; import java.io.IOException; import java.io.InputStream; import java.io.Reader; import java.lang.reflect.Array; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import java.util.Iterator; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; import org.eclipse.jetty.util.IO; import org.eclipse.jetty.util.Loader; import org.eclipse.jetty.util.QuotedStringTokenizer; import org.eclipse.jetty.util.TypeUtil; import org.eclipse.jetty.util.log.Log; import org.eclipse.jetty.util.log.Logger; /** * JSON Parser and Generator. * <p /> * This class provides some static methods to convert POJOs to and from JSON * notation. The mapping from JSON to java is: * * <pre> * object ==> Map * array ==> Object[] * number ==> Double or Long * string ==> String * null ==> null * bool ==> Boolean * </pre> * The java to JSON mapping is: * * <pre> * String --> string * Number --> number * Map --> object * List --> array * Array --> array * null --> null * Boolean--> boolean * Object --> string (dubious!) * </pre> * * The interface {@link JSON.Convertible} may be implemented by classes that * wish to externalize and initialize specific fields to and from JSON objects. * Only directed acyclic graphs of objects are supported. * <p /> * The interface {@link JSON.Generator} may be implemented by classes that know * how to render themselves as JSON and the {@link #toString(Object)} method * will use {@link JSON.Generator#addJSON(Appendable)} to generate the JSON. * The class {@link JSON.Literal} may be used to hold pre-generated JSON object. * <p /> * The interface {@link JSON.Convertor} may be implemented to provide static * converters for objects that may be registered with * {@link #registerConvertor(Class, Convertor)}. * These converters are looked up by class, interface and super class by * {@link #getConvertor(Class)}. * <p /> * If a JSON object has a "class" field, then a java class for that name is * loaded and the method {@link #convertTo(Class,Map)} is used to find a * {@link JSON.Convertor} for that class. * <p /> * If a JSON object has a "x-class" field then a direct lookup for a * {@link JSON.Convertor} for that class name is done (without loading the class). */ public class JSON { static final Logger LOG = Log.getLogger(JSON.class); public final static JSON DEFAULT = new JSON(); private Map<String, Convertor> _convertors = new ConcurrentHashMap<String, Convertor>(); private int _stringBufferSize = 1024; public JSON() { } /** * @return the initial stringBuffer size to use when creating JSON strings * (default 1024) */ public int getStringBufferSize() { return _stringBufferSize; } /** * @param stringBufferSize * the initial stringBuffer size to use when creating JSON * strings (default 1024) */ public void setStringBufferSize(int stringBufferSize) { _stringBufferSize = stringBufferSize; } /** * Register a {@link Convertor} for a class or interface. * * @param forClass * The class or interface that the convertor applies to * @param convertor * the convertor */ public static void registerConvertor(Class forClass, Convertor convertor) { DEFAULT.addConvertor(forClass,convertor); } public static JSON getDefault() { return DEFAULT; } @Deprecated public static void setDefault(JSON json) { } public static String toString(Object object) { StringBuilder buffer = new StringBuilder(DEFAULT.getStringBufferSize()); DEFAULT.append(buffer,object); return buffer.toString(); } public static String toString(Map object) { StringBuilder buffer = new StringBuilder(DEFAULT.getStringBufferSize()); DEFAULT.appendMap(buffer,object); return buffer.toString(); } public static String toString(Object[] array) { StringBuilder buffer = new StringBuilder(DEFAULT.getStringBufferSize()); DEFAULT.appendArray(buffer,array); return buffer.toString(); } /** * @param s * String containing JSON object or array. * @return A Map, Object array or primitive array parsed from the JSON. */ public static Object parse(String s) { return DEFAULT.parse(new StringSource(s),false); } /** * @param s * String containing JSON object or array. * @param stripOuterComment * If true, an outer comment around the JSON is ignored. * @return A Map, Object array or primitive array parsed from the JSON. */ public static Object parse(String s, boolean stripOuterComment) { return DEFAULT.parse(new StringSource(s),stripOuterComment); } /** * @param in * Reader containing JSON object or array. * @return A Map, Object array or primitive array parsed from the JSON. */ public static Object parse(Reader in) throws IOException { return DEFAULT.parse(new ReaderSource(in),false); } /** * @param in * Reader containing JSON object or array. * @param stripOuterComment * If true, an outer comment around the JSON is ignored. * @return A Map, Object array or primitive array parsed from the JSON. */ public static Object parse(Reader in, boolean stripOuterComment) throws IOException { return DEFAULT.parse(new ReaderSource(in),stripOuterComment); } /** * @deprecated use {@link #parse(Reader)} * @param in * Reader containing JSON object or array. * @return A Map, Object array or primitive array parsed from the JSON. */ @Deprecated public static Object parse(InputStream in) throws IOException { return DEFAULT.parse(new StringSource(IO.toString(in)),false); } /** * @deprecated use {@link #parse(Reader, boolean)} * @param in * Stream containing JSON object or array. * @param stripOuterComment * If true, an outer comment around the JSON is ignored. * @return A Map, Object array or primitive array parsed from the JSON. */ @Deprecated public static Object parse(InputStream in, boolean stripOuterComment) throws IOException { return DEFAULT.parse(new StringSource(IO.toString(in)),stripOuterComment); } /** * Convert Object to JSON * * @param object * The object to convert * @return The JSON String */ public String toJSON(Object object) { StringBuilder buffer = new StringBuilder(getStringBufferSize()); append(buffer,object); return buffer.toString(); } /** * Convert JSON to Object * * @param json * The json to convert * @return The object */ public Object fromJSON(String json) { Source source = new StringSource(json); return parse(source); } @Deprecated public void append(StringBuffer buffer, Object object) { append((Appendable)buffer,object); } /** * Append object as JSON to string buffer. * * @param buffer * the buffer to append to * @param object * the object to append */ public void append(Appendable buffer, Object object) { try { if (object == null) { buffer.append("null"); } // Most likely first else if (object instanceof Map) { appendMap(buffer,(Map)object); } else if (object instanceof String) { appendString(buffer,(String)object); } else if (object instanceof Number) { appendNumber(buffer,(Number)object); } else if (object instanceof Boolean) { appendBoolean(buffer,(Boolean)object); } else if (object.getClass().isArray()) { appendArray(buffer,object); } else if (object instanceof Character) { appendString(buffer,object.toString()); } else if (object instanceof Convertible) { appendJSON(buffer,(Convertible)object); } else if (object instanceof Generator) { appendJSON(buffer,(Generator)object); } else { // Check Convertor before Collection to support JSONCollectionConvertor Convertor convertor = getConvertor(object.getClass()); if (convertor != null) { appendJSON(buffer,convertor,object); } else if (object instanceof Collection) { appendArray(buffer,(Collection)object); } else { appendString(buffer,object.toString()); } } } catch (IOException e) { throw new RuntimeException(e); } } @Deprecated public void appendNull(StringBuffer buffer) { appendNull((Appendable)buffer); } public void appendNull(Appendable buffer) { try { buffer.append("null"); } catch (IOException e) { throw new RuntimeException(e); } } @Deprecated public void appendJSON(final StringBuffer buffer, final Convertor convertor, final Object object) { appendJSON((Appendable)buffer,convertor,object); } public void appendJSON(final Appendable buffer, final Convertor convertor, final Object object) { appendJSON(buffer,new Convertible() { public void fromJSON(Map object) { } public void toJSON(Output out) { convertor.toJSON(object,out); } }); } @Deprecated public void appendJSON(final StringBuffer buffer, Convertible converter) { appendJSON((Appendable)buffer,converter); } public void appendJSON(final Appendable buffer, Convertible converter) { ConvertableOutput out=new ConvertableOutput(buffer); converter.toJSON(out); out.complete(); } @Deprecated public void appendJSON(StringBuffer buffer, Generator generator) { generator.addJSON(buffer); } public void appendJSON(Appendable buffer, Generator generator) { generator.addJSON(buffer); } @Deprecated public void appendMap(StringBuffer buffer, Map<?,?> map) { appendMap((Appendable)buffer,map); } public void appendMap(Appendable buffer, Map<?,?> map) { try { if (map == null) { appendNull(buffer); return; } buffer.append('{'); Iterator<?> iter = map.entrySet().iterator(); while (iter.hasNext()) { Map.Entry<?,?> entry = (Map.Entry<?,?>)iter.next(); QuotedStringTokenizer.quote(buffer,entry.getKey().toString()); buffer.append(':'); append(buffer,entry.getValue()); if (iter.hasNext()) buffer.append(','); } buffer.append('}'); } catch (IOException e) { throw new RuntimeException(e); } } @Deprecated public void appendArray(StringBuffer buffer, Collection collection) { appendArray((Appendable)buffer,collection); } public void appendArray(Appendable buffer, Collection collection) { try { if (collection == null) { appendNull(buffer); return; } buffer.append('['); Iterator iter = collection.iterator(); boolean first = true; while (iter.hasNext()) { if (!first) buffer.append(','); first = false; append(buffer,iter.next()); } buffer.append(']'); } catch (IOException e) { throw new RuntimeException(e); } } @Deprecated public void appendArray(StringBuffer buffer, Object array) { appendArray((Appendable)buffer,array); } public void appendArray(Appendable buffer, Object array) { try { if (array == null) { appendNull(buffer); return; } buffer.append('['); int length = Array.getLength(array); for (int i = 0; i < length; i++) { if (i != 0) buffer.append(','); append(buffer,Array.get(array,i)); } buffer.append(']'); } catch (IOException e) { throw new RuntimeException(e); } } @Deprecated public void appendBoolean(StringBuffer buffer, Boolean b) { appendBoolean((Appendable)buffer,b); } public void appendBoolean(Appendable buffer, Boolean b) { try { if (b == null) { appendNull(buffer); return; } buffer.append(b?"true":"false"); } catch (IOException e) { throw new RuntimeException(e); } } @Deprecated public void appendNumber(StringBuffer buffer, Number number) { appendNumber((Appendable)buffer,number); } public void appendNumber(Appendable buffer, Number number) { try { if (number == null) { appendNull(buffer); return; } buffer.append(String.valueOf(number)); } catch (IOException e) { throw new RuntimeException(e); } } @Deprecated public void appendString(StringBuffer buffer, String string) { appendString((Appendable)buffer,string); } public void appendString(Appendable buffer, String string) { if (string == null) { appendNull(buffer); return; } QuotedStringTokenizer.quote(buffer,string); } // Parsing utilities protected String toString(char[] buffer, int offset, int length) { return new String(buffer,offset,length); } protected Map<String, Object> newMap() { return new HashMap<String, Object>(); } protected Object[] newArray(int size) { return new Object[size]; } protected JSON contextForArray() { return this; } protected JSON contextFor(String field) { return this; } protected Object convertTo(Class type, Map map) { if (type != null && Convertible.class.isAssignableFrom(type)) { try { Convertible conv = (Convertible)type.newInstance(); conv.fromJSON(map); return conv; } catch (Exception e) { throw new RuntimeException(e); } } Convertor convertor = getConvertor(type); if (convertor != null) { return convertor.fromJSON(map); } return map; } /** * Register a {@link Convertor} for a class or interface. * * @param forClass * The class or interface that the convertor applies to * @param convertor * the convertor */ public void addConvertor(Class forClass, Convertor convertor) { _convertors.put(forClass.getName(),convertor); } /** * Lookup a convertor for a class. * <p> * If no match is found for the class, then the interfaces for the class are * tried. If still no match is found, then the super class and it's * interfaces are tried recursively. * * @param forClass * The class * @return a {@link JSON.Convertor} or null if none were found. */ protected Convertor getConvertor(Class forClass) { Class cls = forClass; Convertor convertor = _convertors.get(cls.getName()); if (convertor == null && this != DEFAULT) convertor = DEFAULT.getConvertor(cls); while (convertor == null && cls != Object.class) { Class[] ifs = cls.getInterfaces(); int i = 0; while (convertor == null && ifs != null && i < ifs.length) convertor = _convertors.get(ifs[i++].getName()); if (convertor == null) { cls = cls.getSuperclass(); convertor = _convertors.get(cls.getName()); } } return convertor; } /** * Register a {@link JSON.Convertor} for a named class or interface. * * @param name * name of a class or an interface that the convertor applies to * @param convertor * the convertor */ public void addConvertorFor(String name, Convertor convertor) { _convertors.put(name,convertor); } /** * Lookup a convertor for a named class. * * @param name * name of the class * @return a {@link JSON.Convertor} or null if none were found. */ public Convertor getConvertorFor(String name) { Convertor convertor = _convertors.get(name); if (convertor == null && this != DEFAULT) convertor = DEFAULT.getConvertorFor(name); return convertor; } public Object parse(Source source, boolean stripOuterComment) { int comment_state = 0; // 0=no comment, 1="/", 2="/*", 3="/* *" -1="//" if (!stripOuterComment) return parse(source); int strip_state = 1; // 0=no strip, 1=wait for /*, 2= wait for */ Object o = null; while (source.hasNext()) { char c = source.peek(); // handle // or /* comment if (comment_state == 1) { switch (c) { case '/': comment_state = -1; break; case '*': comment_state = 2; if (strip_state == 1) { comment_state = 0; strip_state = 2; } } } // handle /* */ comment else if (comment_state > 1) { switch (c) { case '*': comment_state = 3; break; case '/': if (comment_state == 3) { comment_state = 0; if (strip_state == 2) return o; } else comment_state = 2; break; default: comment_state = 2; } } // handle // comment else if (comment_state < 0) { switch (c) { case '\r': case '\n': comment_state = 0; default: break; } } // handle unknown else { if (!Character.isWhitespace(c)) { if (c == '/') comment_state = 1; else if (c == '*') comment_state = 3; else if (o == null) { o = parse(source); continue; } } } source.next(); } return o; } public Object parse(Source source) { int comment_state = 0; // 0=no comment, 1="/", 2="/*", 3="/* *" -1="//" while (source.hasNext()) { char c = source.peek(); // handle // or /* comment if (comment_state == 1) { switch (c) { case '/': comment_state = -1; break; case '*': comment_state = 2; } } // handle /* */ comment else if (comment_state > 1) { switch (c) { case '*': comment_state = 3; break; case '/': if (comment_state == 3) comment_state = 0; else comment_state = 2; break; default: comment_state = 2; } } // handle // comment else if (comment_state < 0) { switch (c) { case '\r': case '\n': comment_state = 0; break; default: break; } } // handle unknown else { switch (c) { case '{': return parseObject(source); case '[': return parseArray(source); case '"': return parseString(source); case '-': return parseNumber(source); case 'n': complete("null",source); return null; case 't': complete("true",source); return Boolean.TRUE; case 'f': complete("false",source); return Boolean.FALSE; case 'u': complete("undefined",source); return null; case 'N': complete("NaN",source); return null; case '/': comment_state = 1; break; default: if (Character.isDigit(c)) return parseNumber(source); else if (Character.isWhitespace(c)) break; return handleUnknown(source,c); } } source.next(); } return null; } protected Object handleUnknown(Source source, char c) { throw new IllegalStateException("unknown char '" + c + "'(" + (int)c + ") in " + source); } protected Object parseObject(Source source) { if (source.next() != '{') throw new IllegalStateException(); Map<String, Object> map = newMap(); char next = seekTo("\"}",source); while (source.hasNext()) { if (next == '}') { source.next(); break; } String name = parseString(source); seekTo(':',source); source.next(); Object value = contextFor(name).parse(source); map.put(name,value); seekTo(",}",source); next = source.next(); if (next == '}') break; else next = seekTo("\"}",source); } String xclassname = (String)map.get("x-class"); if (xclassname != null) { Convertor c = getConvertorFor(xclassname); if (c != null) return c.fromJSON(map); LOG.warn("No Convertor for x-class '{}'", xclassname); } String classname = (String)map.get("class"); if (classname != null) { try { Class c = Loader.loadClass(JSON.class,classname); return convertTo(c,map); } catch (ClassNotFoundException e) { LOG.warn("No Class for '{}'", classname); } } return map; } protected Object parseArray(Source source) { if (source.next() != '[') throw new IllegalStateException(); int size = 0; ArrayList list = null; Object item = null; boolean coma = true; while (source.hasNext()) { char c = source.peek(); switch (c) { case ']': source.next(); switch (size) { case 0: return newArray(0); case 1: Object array = newArray(1); Array.set(array,0,item); return array; default: return list.toArray(newArray(list.size())); } case ',': if (coma) throw new IllegalStateException(); coma = true; source.next(); break; default: if (Character.isWhitespace(c)) source.next(); else { coma = false; if (size++ == 0) item = contextForArray().parse(source); else if (list == null) { list = new ArrayList(); list.add(item); item = contextForArray().parse(source); list.add(item); item = null; } else { item = contextForArray().parse(source); list.add(item); item = null; } } } } throw new IllegalStateException("unexpected end of array"); } protected String parseString(Source source) { if (source.next() != '"') throw new IllegalStateException(); boolean escape = false; StringBuilder b = null; final char[] scratch = source.scratchBuffer(); if (scratch != null) { int i = 0; while (source.hasNext()) { if (i >= scratch.length) { // we have filled the scratch buffer, so we must // use the StringBuffer for a large string b = new StringBuilder(scratch.length * 2); b.append(scratch,0,i); break; } char c = source.next(); if (escape) { escape = false; switch (c) { case '"': scratch[i++] = '"'; break; case '\\': scratch[i++] = '\\'; break; case '/': scratch[i++] = '/'; break; case 'b': scratch[i++] = '\b'; break; case 'f': scratch[i++] = '\f'; break; case 'n': scratch[i++] = '\n'; break; case 'r': scratch[i++] = '\r'; break; case 't': scratch[i++] = '\t'; break; case 'u': char uc = (char)((TypeUtil.convertHexDigit((byte)source.next()) << 12) + (TypeUtil.convertHexDigit((byte)source.next()) << 8) + (TypeUtil.convertHexDigit((byte)source.next()) << 4) + (TypeUtil.convertHexDigit((byte)source.next()))); scratch[i++] = uc; break; default: scratch[i++] = c; } } else if (c == '\\') { escape = true; } else if (c == '\"') { // Return string that fits within scratch buffer return toString(scratch,0,i); } else { scratch[i++] = c; } } // Missing end quote, but return string anyway ? if (b == null) return toString(scratch,0,i); } else b = new StringBuilder(getStringBufferSize()); // parse large string into string buffer final StringBuilder builder=b; while (source.hasNext()) { char c = source.next(); if (escape) { escape = false; switch (c) { case '"': builder.append('"'); break; case '\\': builder.append('\\'); break; case '/': builder.append('/'); break; case 'b': builder.append('\b'); break; case 'f': builder.append('\f'); break; case 'n': builder.append('\n'); break; case 'r': builder.append('\r'); break; case 't': builder.append('\t'); break; case 'u': char uc = (char)((TypeUtil.convertHexDigit((byte)source.next()) << 12) + (TypeUtil.convertHexDigit((byte)source.next()) << 8) + (TypeUtil.convertHexDigit((byte)source.next()) << 4) + (TypeUtil.convertHexDigit((byte)source.next()))); builder.append(uc); break; default: builder.append(c); } } else if (c == '\\') { escape = true; } else if (c == '\"') { break; } else { builder.append(c); } } return builder.toString(); } public Number parseNumber(Source source) { boolean minus = false; long number = 0; StringBuilder buffer = null; longLoop: while (source.hasNext()) { char c = source.peek(); switch (c) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': number = number * 10 + (c - '0'); source.next(); break; case '-': case '+': if (number != 0) throw new IllegalStateException("bad number"); minus = true; source.next(); break; case '.': case 'e': case 'E': buffer = new StringBuilder(16); if (minus) buffer.append('-'); buffer.append(number); buffer.append(c); source.next(); break longLoop; default: break longLoop; } } if (buffer == null) return minus ? -1 * number : number; doubleLoop: while (source.hasNext()) { char c = source.peek(); switch (c) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': case '-': case '.': case '+': case 'e': case 'E': buffer.append(c); source.next(); break; default: break doubleLoop; } } return new Double(buffer.toString()); } protected void seekTo(char seek, Source source) { while (source.hasNext()) { char c = source.peek(); if (c == seek) return; if (!Character.isWhitespace(c)) throw new IllegalStateException("Unexpected '" + c + " while seeking '" + seek + "'"); source.next(); } throw new IllegalStateException("Expected '" + seek + "'"); } protected char seekTo(String seek, Source source) { while (source.hasNext()) { char c = source.peek(); if (seek.indexOf(c) >= 0) { return c; } if (!Character.isWhitespace(c)) throw new IllegalStateException("Unexpected '" + c + "' while seeking one of '" + seek + "'"); source.next(); } throw new IllegalStateException("Expected one of '" + seek + "'"); } protected static void complete(String seek, Source source) { int i = 0; while (source.hasNext() && i < seek.length()) { char c = source.next(); if (c != seek.charAt(i++)) throw new IllegalStateException("Unexpected '" + c + " while seeking \"" + seek + "\""); } if (i < seek.length()) throw new IllegalStateException("Expected \"" + seek + "\""); } private final class ConvertableOutput implements Output { private final Appendable _buffer; char c = '{'; private ConvertableOutput(Appendable buffer) { _buffer = buffer; } public void complete() { try { if (c == '{') _buffer.append("{}"); else if (c != 0) _buffer.append("}"); } catch (IOException e) { throw new RuntimeException(e); } } public void add(Object obj) { if (c == 0) throw new IllegalStateException(); append(_buffer,obj); c = 0; } public void addClass(Class type) { try { if (c == 0) throw new IllegalStateException(); _buffer.append(c); _buffer.append("\"class\":"); append(_buffer,type.getName()); c = ','; } catch (IOException e) { throw new RuntimeException(e); } } public void add(String name, Object value) { try { if (c == 0) throw new IllegalStateException(); _buffer.append(c); QuotedStringTokenizer.quote(_buffer,name); _buffer.append(':'); append(_buffer,value); c = ','; } catch (IOException e) { throw new RuntimeException(e); } } public void add(String name, double value) { try { if (c == 0) throw new IllegalStateException(); _buffer.append(c); QuotedStringTokenizer.quote(_buffer,name); _buffer.append(':'); appendNumber(_buffer, value); c = ','; } catch (IOException e) { throw new RuntimeException(e); } } public void add(String name, long value) { try { if (c == 0) throw new IllegalStateException(); _buffer.append(c); QuotedStringTokenizer.quote(_buffer,name); _buffer.append(':'); appendNumber(_buffer, value); c = ','; } catch (IOException e) { throw new RuntimeException(e); } } public void add(String name, boolean value) { try { if (c == 0) throw new IllegalStateException(); _buffer.append(c); QuotedStringTokenizer.quote(_buffer,name); _buffer.append(':'); appendBoolean(_buffer,value?Boolean.TRUE:Boolean.FALSE); c = ','; } catch (IOException e) { throw new RuntimeException(e); } } } public interface Source { boolean hasNext(); char next(); char peek(); char[] scratchBuffer(); } public static class StringSource implements Source { private final String string; private int index; private char[] scratch; public StringSource(String s) { string = s; } public boolean hasNext() { if (index < string.length()) return true; scratch = null; return false; } public char next() { return string.charAt(index++); } public char peek() { return string.charAt(index); } @Override public String toString() { return string.substring(0,index) + "|||" + string.substring(index); } public char[] scratchBuffer() { if (scratch == null) scratch = new char[string.length()]; return scratch; } } public static class ReaderSource implements Source { private Reader _reader; private int _next = -1; private char[] scratch; public ReaderSource(Reader r) { _reader = r; } public void setReader(Reader reader) { _reader = reader; _next = -1; } public boolean hasNext() { getNext(); if (_next < 0) { scratch = null; return false; } return true; } public char next() { getNext(); char c = (char)_next; _next = -1; return c; } public char peek() { getNext(); return (char)_next; } private void getNext() { if (_next < 0) { try { _next = _reader.read(); } catch (IOException e) { throw new RuntimeException(e); } } } public char[] scratchBuffer() { if (scratch == null) scratch = new char[1024]; return scratch; } } /** * JSON Output class for use by {@link Convertible}. */ public interface Output { public void addClass(Class c); public void add(Object obj); public void add(String name, Object value); public void add(String name, double value); public void add(String name, long value); public void add(String name, boolean value); } /* ------------------------------------------------------------ */ /** * JSON Convertible object. Object can implement this interface in a similar * way to the {@link Externalizable} interface is used to allow classes to * provide their own serialization mechanism. * <p> * A JSON.Convertible object may be written to a JSONObject or initialized * from a Map of field names to values. * <p> * If the JSON is to be convertible back to an Object, then the method * {@link Output#addClass(Class)} must be called from within toJSON() * */ public interface Convertible { public void toJSON(Output out); public void fromJSON(Map object); } /** * Static JSON Convertor. * <p> * may be implemented to provide static convertors for objects that may be * registered with * {@link JSON#registerConvertor(Class, org.eclipse.jetty.util.ajax.JSON.Convertor)} * . These convertors are looked up by class, interface and super class by * {@link JSON#getConvertor(Class)}. Convertors should be used when the * classes to be converted cannot implement {@link Convertible} or * {@link Generator}. */ public interface Convertor { public void toJSON(Object obj, Output out); public Object fromJSON(Map object); } /** * JSON Generator. A class that can add it's JSON representation directly to * a StringBuffer. This is useful for object instances that are frequently * converted and wish to avoid multiple Conversions */ public interface Generator { public void addJSON(Appendable buffer); } /** * A Literal JSON generator A utility instance of {@link JSON.Generator} * that holds a pre-generated string on JSON text. */ public static class Literal implements Generator { private String _json; /** * Construct a literal JSON instance for use by * {@link JSON#toString(Object)}. If {@link Log#isDebugEnabled()} is * true, the JSON will be parsed to check validity * * @param json * A literal JSON string. */ public Literal(String json) { if (LOG.isDebugEnabled()) // TODO: Make this a configurable option on JSON instead! parse(json); _json = json; } @Override public String toString() { return _json; } public void addJSON(Appendable buffer) { try { buffer.append(_json); } catch(IOException e) { throw new RuntimeException(e); } } } }
{ "content_hash": "deb86031d9cff5760be8895db4ec2eab", "timestamp": "", "source": "github", "line_count": 1640, "max_line_length": 153, "avg_line_length": 27.996951219512194, "alnum_prop": 0.44706522922792113, "repo_name": "xmpace/jetty-read", "id": "1691296dede2844a2e1507d615c13e08a33e0ce0", "size": "45915", "binary": false, "copies": "1", "ref": "refs/heads/xiaomi-read", "path": "jetty-util/src/main/java/org/eclipse/jetty/util/ajax/JSON.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "398" }, { "name": "HTML", "bytes": "47647" }, { "name": "Java", "bytes": "10544935" }, { "name": "JavaScript", "bytes": "77396" }, { "name": "Shell", "bytes": "33886" } ], "symlink_target": "" }
A JavaScript implementation of the WHATWG DOM and HTML standards. This fork has no dependency on contextify. Be aware: **the global scope of Javascript is broken**: > To provide some additional context; when Brian started his work on > CloudBrowser, we realized that certain expectations with respect to > 'window' and the global scope didn't match the browsers. For > instance, 'window === this' wasn't true at top-level. Similarly, at > top-level or wherever 'this' refers to the global scope, the > assignable expressions 'a', 'this.a', and 'window.a' are all > equivalent - any assignment to either of these forms must be > immediately visible to all. In addition, if I recall it correctly, > functions that later called into the context of a window didn't work - > such as setTimeout(). > In short, it's absolutely essential for any JavaScript code that uses > callbacks, whether inlined or not. > - Godmar ## Install ```bash $ npm install jsdom-no-contextify ``` ## Human contact see: [mailing list](http://groups.google.com/group/jsdom) ## Easymode: `jsdom.env` `jsdom.env` is an API that allows you to throw a bunch of stuff at it, and it will generally do the right thing. You can use it with a URL ```js // Count all of the links from the Node.js build page var jsdom = require("jsdom"); jsdom.env( "http://nodejs.org/dist/", ["http://code.jquery.com/jquery.js"], function (errors, window) { console.log("there have been", window.$("a").length, "nodejs releases!"); } ); ``` or with raw HTML ```js // Run some jQuery on a html fragment var jsdom = require("jsdom"); jsdom.env( '<p><a class="the-link" href="https://github.com/tmpvar/jsdom">jsdom!</a></p>', ["http://code.jquery.com/jquery.js"], function (errors, window) { console.log("contents of a.the-link:", window.$("a.the-link").text()); } ); ``` or with a configuration object ```js // Print all of the news items on Hacker News var jsdom = require("jsdom"); jsdom.env({ url: "http://news.ycombinator.com/", scripts: ["http://code.jquery.com/jquery.js"], done: function (errors, window) { var $ = window.$; console.log("HN Links"); $("td.title:not(:last) a").each(function() { console.log(" -", $(this).text()); }); } }); ``` or with raw JavaScript source ```js // Print all of the news items on Hacker News var jsdom = require("jsdom"); var fs = require("fs"); var jquery = fs.readFileSync("./jquery.js", "utf-8"); jsdom.env({ url: "http://news.ycombinator.com/", src: [jquery], done: function (errors, window) { var $ = window.$; console.log("HN Links"); $("td.title:not(:last) a").each(function () { console.log(" -", $(this).text()); }); } }); ``` ### How it works The do-what-I-mean API is used like so: ```js jsdom.env(string, [scripts], [config], callback); ``` - `string`: may be a URL, file name, or HTML fragment - `scripts`: a string or array of strings, containing file names or URLs that will be inserted as `<script>` tags - `config`: see below - `callback`: takes two arguments - `errors`: either `null`, if nothing goes wrong, or an array of errors - `window`: a brand new `window`, if there were no loading errors _Example:_ ```js jsdom.env(html, function (errors, window) { // free memory associated with the window window.close(); }); ``` If you would like to specify a configuration object only: ```js jsdom.env(config); ``` - `config.html`: a HTML fragment - `config.file`: a file which jsdom will load HTML from; the resulting window's `location.href` will be a `file://` URL. - `config.url`: sets the resulting window's `location.href`; if `config.html` and `config.file` are not provided, jsdom will load HTML from this URL. - `config.scripts`: see `scripts` above. - `config.src`: an array of JavaScript strings that will be evaluated against the resulting document. Similar to `scripts`, but it accepts JavaScript instead of paths/URLs. - `config.jar`: a custom cookie jar, if desired; see [mikeal/request](https://github.com/mikeal/request) documentation. - `config.parsingMode`: either `"auto"`, `"html"`, or `"xml"`. The default is `"auto"`, which uses HTML behavior unless `config.url` responds with an XML `Content-Type`, or `config.file` contains a filename ending in `.xml` or `.xhtml`. Setting to `"xml"` will attempt to parse the document as an XHTML document. (jsdom is [currently only OK at doing that](https://github.com/tmpvar/jsdom/issues/885).) - `config.document`: - `referrer`: the new document will have this referrer. - `cookie`: manually set a cookie value, e.g. `'key=value; expires=Wed, Sep 21 2011 12:00:00 GMT; path=/'`. - `cookieDomain`: a cookie domain for the manually set cookie; defaults to `127.0.0.1`. - `config.headers`: an object giving any headers that will be used while loading the HTML from `config.url`, if applicable - `config.features`: see Flexibility section below. **Note**: the default feature set for `jsdom.env` does _not_ include fetching remote JavaScript and executing it. This is something that you will need to _carefully_ enable yourself. - `config.resourceLoader`: a function that intercepts subresource requests and allows you to re-route them, modify, or outright replace them with your own content. More below. - `config.done`, `config.loaded`, `config.created`: see below. Note that at least one of the callbacks (`done`, `loaded`, or `created`) is required, as is one of `html`, `file`, or `url`. ### Initialization lifecycle If you just want to load the document and execute it, the `done` callback shown above is the simplest. If anything goes wrong, either while loading the document and creating the window, or while executing any `<script>`s, the problem will show up in the `errors` array passed as the first argument. However, if you want more control over or insight into the initialization lifecycle, you'll want to use the `created` and/or `loaded` callbacks: #### `created(error, window)` The `created` callback is called as soon as the window is created, or if that process fails. You may access all `window` properties here; however, `window.document` is not ready for use yet, as the HTML has not been parsed. The primary use-case for `created` is to modify the window object (e.g. add new functions on built-in prototypes) before any scripts execute. You can also set an event handler for `'load'` or other events on the window if you wish. But the `loaded` callback, below, can be more useful, since it includes script errors. If the `error` argument is non-`null`, it will contain whatever loading error caused the window creation to fail; in that case `window` will not be passed. #### `loaded(errors, window)` The `loaded` callback is called along with the window's `'load'` event. This means it will only be called if creation succeeds without error. Note that by the time it has called, any external resources will have been downloaded, and any `<script>`s will have finished executing. If `errors` is non-`null`, it will contain an array of all JavaScript errors that occured during script execution. `window` will still be passed, however. #### `done(errors, window)` Now that you know about `created` and `loaded`, you can see that `done` is essentially both of them smashed together: - If window creation succeeds and no `<script>`s cause errors, then `errors` will be null, and `window` will be usable. - If window creation succeeds but there are script errors, then `errors` will be an array containing those errors, but `window` will still be usable. - If window creation fails, then `errors` will be an array containing the creation error, and `window` will not be passed. #### Migrating from before v1.0.0 If you used jsdom before v1.0.0, it only had a `done` callback, and it was kind of buggy, sometimes behaving one way, and sometimes another. Due to some excellent work by [@Sebmaster](https://github.com/Sebmaster) in [#792](https://github.com/tmpvar/jsdom/pull/792), we fixed it up into the above lifecycle. For more information on the migration, see [the wiki](https://github.com/tmpvar/jsdom/wiki/PR-792). #### Dealing with asynchronous script loading If you load scripts asynchronously, e.g. with a module loader like RequireJS, none of the above hooks will really give you what you want. There's nothing, either in jsdom or in browsers, to say "notify me after all asynchronous loads have completed." The solution is to use the mechanisms of the framework you are using to notify about this finishing up. E.g., with RequireJS, you could do ```js // On the Node side: var window = jsdom.jsdom(...).parentWindow; window.onModulesLoaded = function () { console.log("ready to roll!"); }; ``` ```html <!-- Inside the HTML you supply to jsdom --> <script> requirejs(["entry-module"], function () { window.onModulesLoaded(); }); </script> ``` For more details, see the discussion in [#640](https://github.com/tmpvar/jsdom/issues/640), especially [@matthewkastor](https://github.com/matthewkastor)'s [insightful comment](https://github.com/tmpvar/jsdom/issues/640#issuecomment-22216965). ### On running scripts and being safe By default, `jsdom.env` will not process and run external JavaScript, since our sandbox is not foolproof. That is, code running inside the DOM's `<script>`s can, if it tries hard enough, get access to the Node environment, and thus to your machine. If you want to (carefully!) enable running JavaScript, you can use `jsdom.jsdom`, `jsdom.jQueryify`, or modify the defaults passed to `jsdom.env`. ## For the hardcore: `jsdom.jsdom` The `jsdom.jsdom` method does less things automatically; it takes in only HTML source, and does not let you to separately supply script that it will inject and execute. It just gives you back a `document` object, with usable `document.parentWindow`, and starts asynchronously executing any `<script>`s included in the HTML source. You can listen for the `'load'` event to wait until scripts are done loading and executing, just like you would in a normal HTML page. Usage of the API generally looks like this: ```js var jsdom = require("jsdom").jsdom; var doc = jsdom(markup, options); var window = doc.parentWindow; ``` - `markup` is a HTML document to be parsed. You can also pass `undefined` to get the basic document, equivalent to what a browser will give if you open up an empty `.html` file. - `options`: see the explanation of the `config` object above. ### Flexibility One of the goals of jsdom is to be as minimal and light as possible. This section details how someone can change the behavior of `Document`s before they are created. These features are baked into the `DOMImplementation` that every `Document` has, and may be tweaked in two ways: 1. When you create a new `Document`, by overriding the configuration: ```js var jsdom = require("jsdom").jsdom; var doc = jsdom("<html><body></body></html>", { features: { FetchExternalResources : ["img"] } }); ``` Do note, that this will only affect the document that is currently being created. All other documents will use the defaults specified below (see: Default Features). 2. Before creating any documents, you can modify the defaults for all future documents: ```js require("jsdom").defaultDocumentFeatures = { FetchExternalResources: ["script"], ProcessExternalResources: false }; ``` #### External Resources Default features are extremely important for jsdom as they lower the configuration requirement and present developers a set of consistent default behaviors. The following sections detail the available features, their defaults, and the values that jsdom uses. `FetchExternalResources` - _Default_: `["script"]` - _Allowed_: `["script", "img", "css", "frame", "iframe", "link"]` or `false` - _Default for `jsdom.env`_: `false` Enables/disables fetching files over the file system/HTTP `ProcessExternalResources` - _Default_: `["script"]` - _Allowed_: `["script"]` or `false` - _Default for `jsdom.env`_: `false` Enables/disables JavaScript execution `SkipExternalResources` - _Default_: `false` (allow all) - _Allowed_: `/url to be skipped/` or `false` - _Example_: `/http:\/\/example.org/js/bad\.js/` Filters resource downloading and processing to disallow those matching the given regular expression #### Custom External Resource Loader jsdom lets you intercept subresource requests using `config.resourceLoader`. `config.resourceLoader` expects a function which is called for each subresource request with the following arguments: - `resource`: a vanilla JavaScript object with the following properties - `url`: a parsed URL object. - `cookie`: the content of the HTTP cookie header (`key=value` pairs separated by semicolons). - `cookieDomain`: the cookie domain as set in `config`, defaults to `127.0.0.1`. - `baseUrl`: the base URL used to resolve relative URLs. - `defaultFetch(callback)`: a convenience method to fetch the resource online. - `callback`: a function to be called with two arguments - `error`: either `null`, if nothing goes wrong, or an `Error` object. - `body`: a string representing the body of the resource. For example, fetching all JS files from a different directory and running them in strict mode: ```js var jsdom = require("jsdom"); jsdom.env({ url: "http://example.com/", resourceLoader: function (resource, callback) { var pathname = resource.url.pathname; if (/\.js$/.test(pathname)) { resource.url.pathname = pathname.replace("/js/", "/js/raw/"); resource.defaultFetch(function (err, body) { if (err) return callback(err); callback(null, '"use strict";\n' + body); }); } else { resource.defaultFetch(callback); } }, features: { FetchExternalResources: ["script"], ProcessExternalResources: ["script"], SkipExternalResources: false } }); ``` ### Canvas jsdom includes support for using the [canvas](https://npmjs.org/package/canvas) package to extend any `<canvas>` elements with the canvas API. To make this work, you need to include canvas as a dependency in your project, as a peer of jsdom. If jsdom can find the canvas package, it will use it, but if it's not present, then `<canvas>` elements will behave like `<div>`s. ## More Examples ### Creating a browser-like window object ```js var jsdom = require("jsdom").jsdom; var document = jsdom("hello world"); var window = document.parentWindow; console.log(window.document.documentElement.outerHTML); // output: "<html><head></head><body>hello world</body></html>" console.log(window.innerWidth); // output: 1024 console.log(typeof window.document.getElementsByClassName); // outputs: function ``` ### jQueryify ```js var jsdom = require("jsdom"); var window = jsdom.jsdom().parentWindow; jsdom.jQueryify(window, "http://code.jquery.com/jquery-2.1.1.js", function () { window.$("body").append('<div class="testing">Hello World, It works</div>'); console.log(window.$(".testing").text()); }); ``` ### Passing objects to scripts inside the page ```js var jsdom = require("jsdom").jsdom; var window = jsdom().parentWindow; window.__myObject = { foo: "bar" }; var scriptEl = window.document.createElement("script"); scriptEl.src = "anotherScript.js"; window.document.body.appendChild(scriptEl); // anotherScript.js will have the ability to read `window.__myObject`, even // though it originated in Node! ``` ### Serializing a document ```js var jsdom = require("jsdom").jsdom; var serializeDocument = require("jsdom").serializeDocument; var doc = jsdom("<!DOCTYPE html>hello"); serializeDocument(doc) === "<!DOCTYPE html><html><head></head><body>hello</body></html>"; doc.documentElement.outerHTML === "<html><head></head><body>hello</body></html>"; ``` ### Capturing Console Output #### Forward a window's console output to the Node.js console ```js var jsdom = require("jsdom"); var window = jsdom.jsdom().parentWindow; jsdom.getVirtualConsole(window).sendTo(console); ``` #### Get an event emitter for a window's console ```js var jsdom = require("jsdom"); var window = jsdom.jsdom().parentWindow; var virtualConsole = jsdom.getVirtualConsole(window); virtualConsole.on("log", function (message) { console.log("console.log called ->", message); }); ``` ## What Standards Does jsdom Support, Exactly? Our mission is to get something very close to a headless browser, with emphasis more on the DOM/HTML side of things than the CSS side. As such, our primary goals are supporting [The DOM Standard](http://dom.spec.whatwg.org/) and [The HTML Standard](http://www.whatwg.org/specs/web-apps/current-work/multipage/). We only support some subset of these so far; in particular we have the subset covered by the outdated DOM 2 spec family down pretty well. We're slowly including more and more from the modern DOM and HTML specs, including some `Node` APIs, `querySelector(All)`, attribute semantics, the history and URL APIs, and the HTML parsing algorithm. We also support some subset of the [CSSOM](http://dev.w3.org/csswg/cssom/), largely via [@chad3814](https://github.com/chad3814)'s excellent [cssstyle](https://www.npmjs.org/package/cssstyle) package. In general we want to make webpages run headlessly as best we can, and if there are other specs we should be incorporating, let us know. ## Contextify [Contextify](https://npmjs.org/package/contextify) is a dependency of jsdom, used for running `<script>` tags within the page. In other words, it allows jsdom, which is run in Node.js, to run strings of JavaScript in an isolated environment that pretends to be a browser environment instead of a server. You can see how this is an important feature. Unfortunately, doing this kind of magic requires C++. And in Node.js, using C++ from JavaScript means using "native modules." Native modules are compiled at installation time so that they work precisely for your machine; that is, you don't download a contextify binary from npm, but instead build one locally after downloading the source from npm. Getting C++ compiled within npm's installation system can be tricky, especially for Windows users. Thus, one of the most common problems with jsdom is trying to use it without the proper compilation tools installed. Here's what you need to compile Contextify, and thus to install jsdom: ### Windows - The latest version of [Node.js for Windows](http://nodejs.org/download/) - A copy of [Visual Studio Express 2013 for Windows Desktop](http://www.visualstudio.com/downloads/download-visual-studio-vs#d-express-windows-desktop) - A copy of [Python 2.7](http://www.python.org/download/), installed in the default location of `C:\Python27` - Set your system environment variable GYP_MSVS_VERSION like so (assuming you have Visual Studio 2013 installed): ```shell setx GYP_MSVS_VERSION 2013 ``` - Restart your command prompt window to ensure required path variables are present. There are some slight modifications to this that can work; for example other Visual Studio versions often work too. But it's tricky, so start with the basics! ### Mac - XCode needs to be installed - "Command line tools for XCode" need to be installed - Launch XCode once to accept the license, etc. and ensure it's properly installed ### Linux You'll need various build tools installed, like `make`, Python 2.7, and a compiler toolchain. How to install these will be specific to your distro, if you don't already have them.
{ "content_hash": "d3149cacc97673a8d747115744261f2f", "timestamp": "", "source": "github", "line_count": 450, "max_line_length": 651, "avg_line_length": 43.31777777777778, "alnum_prop": 0.7251833991689325, "repo_name": "crealogix/jsdom", "id": "3e9833c1e31833805d6609e83dbef74f78cf4710", "size": "19502", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "README.md", "mode": "33188", "license": "mit", "language": [ { "name": "JavaScript", "bytes": "3505309" }, { "name": "PHP", "bytes": "911" } ], "symlink_target": "" }
""" Ambrosio: A XMPP bot to serve us Copyright (C) 2014 Francisco Hidalgo This file is part of Ambrosio. See the file LICENSE for copying permission. """ from ambrosio.utils.kdb import * class Credentials(object): """ A class to add a credential service. To get the credentials, we use a KeePass format, if you want implement a new credential, implement a conditional to support them """ def __init__(self): """ Initializes a keepass syste, to get the credentials. The utilities are located in the utils directory, if you want add a new utility, add it in this directory. """ self.kdb = KDB()
{ "content_hash": "b10585cf08f2455fe1e748c727fb65eb", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 64, "avg_line_length": 24.75, "alnum_prop": 0.6421356421356421, "repo_name": "lammoth/ambrosio", "id": "7812b29faf41a0c69fd1f6140939bd4ea3be9c30", "size": "740", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "actions/credentials.py", "mode": "33188", "license": "mit", "language": [ { "name": "Python", "bytes": "9679" } ], "symlink_target": "" }
package org.springframework.boot.maven; import org.apache.maven.plugins.annotations.Parameter; /** * A model for a dependency to include or exclude. * * @author Stephane Nicoll * @author David Turanski * @since 1.2 */ abstract class FilterableDependency { /** * The groupId of the artifact to exclude. */ @Parameter(required = true) private String groupId; /** * The artifactId of the artifact to exclude. */ @Parameter(required = true) private String artifactId; /** * The classifier of the artifact to exclude. */ @Parameter private String classifier; public String getGroupId() { return this.groupId; } public void setGroupId(String groupId) { this.groupId = groupId; } public String getArtifactId() { return this.artifactId; } public void setArtifactId(String artifactId) { this.artifactId = artifactId; } public String getClassifier() { return this.classifier; } public void setClassifier(String classifier) { this.classifier = classifier; } }
{ "content_hash": "e46a26188b0952f87072e0e5e88d9a7d", "timestamp": "", "source": "github", "line_count": 58, "max_line_length": 54, "avg_line_length": 17.482758620689655, "alnum_prop": 0.7130177514792899, "repo_name": "lburgazzoli/spring-boot", "id": "9babbc075d8630eeccc8277144347f2cbcb94609", "size": "1635", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/FilterableDependency.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "6954" }, { "name": "CSS", "bytes": "5769" }, { "name": "FreeMarker", "bytes": "2134" }, { "name": "Groovy", "bytes": "49512" }, { "name": "HTML", "bytes": "69689" }, { "name": "Java", "bytes": "11602150" }, { "name": "JavaScript", "bytes": "37789" }, { "name": "Ruby", "bytes": "1307" }, { "name": "Shell", "bytes": "27916" }, { "name": "Smarty", "bytes": "3276" }, { "name": "XSLT", "bytes": "34105" } ], "symlink_target": "" }
FN="hgug4110b.db_3.2.3.tar.gz" URLS=( "https://bioconductor.org/packages/3.12/data/annotation/src/contrib/hgug4110b.db_3.2.3.tar.gz" "https://bioarchive.galaxyproject.org/hgug4110b.db_3.2.3.tar.gz" "https://depot.galaxyproject.org/software/bioconductor-hgug4110b.db/bioconductor-hgug4110b.db_3.2.3_src_all.tar.gz" "https://depot.galaxyproject.org/software/bioconductor-hgug4110b.db/bioconductor-hgug4110b.db_3.2.3_src_all.tar.gz" ) MD5="a9edcdbc121f22d4dec335a64598ff0e" # Use a staging area in the conda dir rather than temp dirs, both to avoid # permission issues as well as to have things downloaded in a predictable # manner. STAGING=$PREFIX/share/$PKG_NAME-$PKG_VERSION-$PKG_BUILDNUM mkdir -p $STAGING TARBALL=$STAGING/$FN SUCCESS=0 for URL in ${URLS[@]}; do curl $URL > $TARBALL [[ $? == 0 ]] || continue # Platform-specific md5sum checks. if [[ $(uname -s) == "Linux" ]]; then if md5sum -c <<<"$MD5 $TARBALL"; then SUCCESS=1 break fi else if [[ $(uname -s) == "Darwin" ]]; then if [[ $(md5 $TARBALL | cut -f4 -d " ") == "$MD5" ]]; then SUCCESS=1 break fi fi fi done if [[ $SUCCESS != 1 ]]; then echo "ERROR: post-link.sh was unable to download any of the following URLs with the md5sum $MD5:" printf '%s\n' "${URLS[@]}" exit 1 fi # Install and clean up R CMD INSTALL --library=$PREFIX/lib/R/library $TARBALL rm $TARBALL rmdir $STAGING
{ "content_hash": "aac65538c8ee70cbfb645d2fba29c8db", "timestamp": "", "source": "github", "line_count": 46, "max_line_length": 117, "avg_line_length": 30.73913043478261, "alnum_prop": 0.6760961810466761, "repo_name": "ostrokach/bioconda-recipes", "id": "40ce54293da8ef43ca2f32252351ce1e819ce813", "size": "1426", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "recipes/bioconductor-hgug4110b.db/post-link.sh", "mode": "33188", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "1805" }, { "name": "C", "bytes": "102655" }, { "name": "C++", "bytes": "486" }, { "name": "Fortran", "bytes": "1040" }, { "name": "Perl", "bytes": "88310" }, { "name": "Perl6", "bytes": "16" }, { "name": "Python", "bytes": "124959" }, { "name": "Shell", "bytes": "765144" } ], "symlink_target": "" }
@(title: String, repository: Option[service.RepositoryService.RepositoryInfo] = None)(body: Html)(implicit context: app.Context) @import context._ @import view.helpers._ <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>@title</title> <link rel="icon" href="@assets/common/images/favicon.png" type="image/vnd.microsoft.icon" /> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <!-- Le styles --> <link href="@assets/bootstrap/css/bootstrap.css" rel="stylesheet"> <link href="@assets/bootstrap/css/bootstrap-responsive.css" rel="stylesheet"> <!-- HTML5 shim, for IE6-8 support of HTML5 elements --> <!--[if lt IE 9]> <script src="@assets/bootstrap/js/html5shiv.js"></script> <![endif]--> <link href="@assets/datepicker/css/datepicker.css" rel="stylesheet"> <link href="@assets/colorpicker/css/bootstrap-colorpicker.css" rel="stylesheet"> <link href="@assets/google-code-prettify/prettify.css" type="text/css" rel="stylesheet"/> <link href="@assets/fancybox/jquery.fancybox.css" rel="stylesheet"> <link href="@assets/common/css/gitbucket.css" rel="stylesheet"> <script src="@assets/common/js/jquery-1.9.1.js"></script> <script src="@assets/common/js/dropzone.js"></script> <script src="@assets/common/js/validation.js"></script> <script src="@assets/common/js/gitbucket.js"></script> <script src="@assets/bootstrap/js/bootstrap.js"></script> <script src="@assets/datepicker/js/bootstrap-datepicker.js"></script> <script src="@assets/colorpicker/js/bootstrap-colorpicker.js"></script> <script src="@assets/google-code-prettify/prettify.js"></script> <script src="@assets/zclip/ZeroClipboard.min.js"></script> <script src="@assets/elastic/jquery.elastic.source.js"></script> <script src="@assets/fancybox/jquery.fancybox.js"></script> <script src="@assets/sketch/sketch.js"></script> </head> <body> <form id="search" action="@path/search" method="POST"> <div class="navbar"> <div class="navbar-inner"> <div class="container"> <button type="button" class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse"> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a class="brand" href="@path/"> <img src="@assets/common/images/gitbucket.png"/>GitBucket @defining(servlet.AutoUpdate.getCurrentVersion){ version => <span class="header-version">@version.majorVersion.@version.minorVersion</span> } </a> <div class="nav-collapse collapse pull-right header-menu"> @repository.map { repository => <input type="text" name="query" style="width: 300px; margin-bottom: 0px;" placeholder="Search this repository"/> <input type="hidden" name="owner" value="@repository.owner"/> <input type="hidden" name="repository" value="@repository.name"/> } @if(loginAccount.isDefined){ <a href="@url(loginAccount.get.userName)" class="username menu">@avatar(loginAccount.get.userName, 20) @loginAccount.get.userName</a> <a href="@path/new" class="menu" data-toggle="tooltip" data-placement="bottom" title="Create a new repo"><i class="icon-plus"></i></a> <a href="@url(loginAccount.get.userName)/_edit" class="menu" data-toggle="tooltip" data-placement="bottom" title="Account settings"><i class="icon-user"></i></a> @if(loginAccount.get.isAdmin){ <a href="@path/admin/users" class="menu" data-toggle="tooltip" data-placement="bottom" title="Administration"><i class="icon-wrench"></i></a> } <a href="@path/signout" class="menu-last" data-toggle="tooltip" data-placement="bottom" title="Sign out"><i class="icon-share-alt"></i></a> } else { <a href="@path/signin?redirect=@redirectUrl" class="btn btn-last">Sign in</a> } </div><!--/.nav-collapse --> </div> </div> </form> </div> <div class="container body"> @body </div> <script> $(function(){ $('#search').submit(function(){ return $.trim($(this).find('input[name=query]').val()) != ''; }); }); </script> </body> </html>
{ "content_hash": "7641890d7a406fc6c95b13d54c5fef9d", "timestamp": "", "source": "github", "line_count": 85, "max_line_length": 177, "avg_line_length": 52.917647058823526, "alnum_prop": 0.6100489106269453, "repo_name": "toshi-saito/gitbucket", "id": "68ee2f88957f49f897dbaa47b5d717d93c831854", "size": "4498", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/main/twirl/main.scala.html", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "30499" }, { "name": "Java", "bytes": "6553" }, { "name": "JavaScript", "bytes": "134614" }, { "name": "Scala", "bytes": "301723" }, { "name": "Shell", "bytes": "392" } ], "symlink_target": "" }
package hr.unidu.oop.p03; import java.util.Random; public class Inicijalizatori { //static inicijalizator se izvodi samo jednom, kada se stvori prvi objekt ovog tipa private static int broj; private int n; static { ispisiPoruku(); broj = 0; } // inicijalizator instance se izvodi kod stvaranja svakog objekta, neposredno prije // izvođenja programskogkoda konstruktora. { ispisiPoruku2(); n = 0; Inicijalizatori.broj++; } public Inicijalizatori() { // Konstruktor se izvodi kod stvaranja svakog objekta System.out.println("Stvoren objekt! " +broj); } private static void ispisiPoruku() { System.out.println("Ovo je obrada u static inicijalizatoru!"); } private void ispisiPoruku2() { System.out.println("Ovo je obrada u inicijalizatoru instance!"); } public static void main(String[] args) { Random r = new Random(); for(int i = 0; i < 10; ++i) { new Inicijalizatori(); } } }
{ "content_hash": "5130ed37f25ea9ada8e9855ec52a05c1", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 85, "avg_line_length": 25.054054054054053, "alnum_prop": 0.7065803667745415, "repo_name": "kzubrinic/oop", "id": "f4599ae19d8c9654aef6ed5baaf862294fb0f39d", "size": "928", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "oop/src/hr/unidu/oop/p03/Inicijalizatori.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "344016" } ], "symlink_target": "" }
"""This is a simple HTTP/FTP/TCP/UDP/BASIC_AUTH_PROXY/WEBSOCKET server used for testing Chrome. It supports several test URLs, as specified by the handlers in TestPageHandler. By default, it listens on an ephemeral port and sends the port number back to the originating process over a pipe. The originating process can specify an explicit port if necessary. It can use https if you specify the flag --https=CERT where CERT is the path to a pem file containing the certificate and private key that should be used. """ import base64 import BaseHTTPServer import cgi import hashlib import logging import minica import os import json import random import re import select import socket import SocketServer import ssl import struct import sys import threading import time import urllib import urlparse import zlib BASE_DIR = os.path.dirname(os.path.abspath(__file__)) ROOT_DIR = os.path.dirname(os.path.dirname(os.path.dirname(BASE_DIR))) # Temporary hack to deal with tlslite 0.3.8 -> 0.4.6 upgrade. # # TODO(davidben): Remove this when it has cycled through all the bots and # developer checkouts or when http://crbug.com/356276 is resolved. try: os.remove(os.path.join(ROOT_DIR, 'third_party', 'tlslite', 'tlslite', 'utils', 'hmac.pyc')) except Exception: pass # Append at the end of sys.path, it's fine to use the system library. sys.path.append(os.path.join(ROOT_DIR, 'third_party', 'pyftpdlib', 'src')) # Insert at the beginning of the path, we want to use our copies of the library # unconditionally. sys.path.insert(0, os.path.join(ROOT_DIR, 'third_party', 'pywebsocket', 'src')) sys.path.insert(0, os.path.join(ROOT_DIR, 'third_party', 'tlslite')) import mod_pywebsocket.standalone from mod_pywebsocket.standalone import WebSocketServer # import manually mod_pywebsocket.standalone.ssl = ssl import pyftpdlib.ftpserver import tlslite import tlslite.api import echo_message import testserver_base SERVER_HTTP = 0 SERVER_FTP = 1 SERVER_TCP_ECHO = 2 SERVER_UDP_ECHO = 3 SERVER_BASIC_AUTH_PROXY = 4 SERVER_WEBSOCKET = 5 # Default request queue size for WebSocketServer. _DEFAULT_REQUEST_QUEUE_SIZE = 128 class WebSocketOptions: """Holds options for WebSocketServer.""" def __init__(self, host, port, data_dir): self.request_queue_size = _DEFAULT_REQUEST_QUEUE_SIZE self.server_host = host self.port = port self.websock_handlers = data_dir self.scan_dir = None self.allow_handlers_outside_root_dir = False self.websock_handlers_map_file = None self.cgi_directories = [] self.is_executable_method = None self.allow_draft75 = False self.strict = True self.use_tls = False self.private_key = None self.certificate = None self.tls_client_auth = False self.tls_client_ca = None self.tls_module = 'ssl' self.use_basic_auth = False self.basic_auth_credential = 'Basic ' + base64.b64encode('test:test') class RecordingSSLSessionCache(object): """RecordingSSLSessionCache acts as a TLS session cache and maintains a log of lookups and inserts in order to test session cache behaviours.""" def __init__(self): self.log = [] def __getitem__(self, sessionID): self.log.append(('lookup', sessionID)) raise KeyError() def __setitem__(self, sessionID, session): self.log.append(('insert', sessionID)) class HTTPServer(testserver_base.ClientRestrictingServerMixIn, testserver_base.BrokenPipeHandlerMixIn, testserver_base.StoppableHTTPServer): """This is a specialization of StoppableHTTPServer that adds client verification.""" pass class OCSPServer(testserver_base.ClientRestrictingServerMixIn, testserver_base.BrokenPipeHandlerMixIn, BaseHTTPServer.HTTPServer): """This is a specialization of HTTPServer that serves an OCSP response""" def serve_forever_on_thread(self): self.thread = threading.Thread(target = self.serve_forever, name = "OCSPServerThread") self.thread.start() def stop_serving(self): self.shutdown() self.thread.join() class HTTPSServer(tlslite.api.TLSSocketServerMixIn, testserver_base.ClientRestrictingServerMixIn, testserver_base.BrokenPipeHandlerMixIn, testserver_base.StoppableHTTPServer): """This is a specialization of StoppableHTTPServer that add https support and client verification.""" def __init__(self, server_address, request_hander_class, pem_cert_and_key, ssl_client_auth, ssl_client_cas, ssl_client_cert_types, ssl_bulk_ciphers, ssl_key_exchanges, npn_protocols, record_resume_info, tls_intolerant, tls_intolerance_type, signed_cert_timestamps, fallback_scsv_enabled, ocsp_response, alert_after_handshake, disable_channel_id, disable_ems, token_binding_params): self.cert_chain = tlslite.api.X509CertChain() self.cert_chain.parsePemList(pem_cert_and_key) # Force using only python implementation - otherwise behavior is different # depending on whether m2crypto Python module is present (error is thrown # when it is). m2crypto uses a C (based on OpenSSL) implementation under # the hood. self.private_key = tlslite.api.parsePEMKey(pem_cert_and_key, private=True, implementations=['python']) self.ssl_client_auth = ssl_client_auth self.ssl_client_cas = [] self.ssl_client_cert_types = [] self.npn_protocols = npn_protocols self.signed_cert_timestamps = signed_cert_timestamps self.fallback_scsv_enabled = fallback_scsv_enabled self.ocsp_response = ocsp_response if ssl_client_auth: for ca_file in ssl_client_cas: s = open(ca_file).read() x509 = tlslite.api.X509() x509.parse(s) self.ssl_client_cas.append(x509.subject) for cert_type in ssl_client_cert_types: self.ssl_client_cert_types.append({ "rsa_sign": tlslite.api.ClientCertificateType.rsa_sign, "ecdsa_sign": tlslite.api.ClientCertificateType.ecdsa_sign, }[cert_type]) self.ssl_handshake_settings = tlslite.api.HandshakeSettings() # Enable SSLv3 for testing purposes. self.ssl_handshake_settings.minVersion = (3, 0) if ssl_bulk_ciphers is not None: self.ssl_handshake_settings.cipherNames = ssl_bulk_ciphers if ssl_key_exchanges is not None: self.ssl_handshake_settings.keyExchangeNames = ssl_key_exchanges if tls_intolerant != 0: self.ssl_handshake_settings.tlsIntolerant = (3, tls_intolerant) self.ssl_handshake_settings.tlsIntoleranceType = tls_intolerance_type if alert_after_handshake: self.ssl_handshake_settings.alertAfterHandshake = True if disable_channel_id: self.ssl_handshake_settings.enableChannelID = False if disable_ems: self.ssl_handshake_settings.enableExtendedMasterSecret = False self.ssl_handshake_settings.supportedTokenBindingParams = \ token_binding_params if record_resume_info: # If record_resume_info is true then we'll replace the session cache with # an object that records the lookups and inserts that it sees. self.session_cache = RecordingSSLSessionCache() else: self.session_cache = tlslite.api.SessionCache() testserver_base.StoppableHTTPServer.__init__(self, server_address, request_hander_class) def handshake(self, tlsConnection): """Creates the SSL connection.""" try: self.tlsConnection = tlsConnection tlsConnection.handshakeServer(certChain=self.cert_chain, privateKey=self.private_key, sessionCache=self.session_cache, reqCert=self.ssl_client_auth, settings=self.ssl_handshake_settings, reqCAs=self.ssl_client_cas, reqCertTypes=self.ssl_client_cert_types, nextProtos=self.npn_protocols, signedCertTimestamps= self.signed_cert_timestamps, fallbackSCSV=self.fallback_scsv_enabled, ocspResponse = self.ocsp_response) tlsConnection.ignoreAbruptClose = True return True except tlslite.api.TLSAbruptCloseError: # Ignore abrupt close. return True except tlslite.api.TLSError, error: print "Handshake failure:", str(error) return False class FTPServer(testserver_base.ClientRestrictingServerMixIn, pyftpdlib.ftpserver.FTPServer): """This is a specialization of FTPServer that adds client verification.""" pass class TCPEchoServer(testserver_base.ClientRestrictingServerMixIn, SocketServer.TCPServer): """A TCP echo server that echoes back what it has received.""" def server_bind(self): """Override server_bind to store the server name.""" SocketServer.TCPServer.server_bind(self) host, port = self.socket.getsockname()[:2] self.server_name = socket.getfqdn(host) self.server_port = port def serve_forever(self): self.stop = False self.nonce_time = None while not self.stop: self.handle_request() self.socket.close() class UDPEchoServer(testserver_base.ClientRestrictingServerMixIn, SocketServer.UDPServer): """A UDP echo server that echoes back what it has received.""" def server_bind(self): """Override server_bind to store the server name.""" SocketServer.UDPServer.server_bind(self) host, port = self.socket.getsockname()[:2] self.server_name = socket.getfqdn(host) self.server_port = port def serve_forever(self): self.stop = False self.nonce_time = None while not self.stop: self.handle_request() self.socket.close() class TestPageHandler(testserver_base.BasePageHandler): # Class variables to allow for persistence state between page handler # invocations rst_limits = {} fail_precondition = {} def __init__(self, request, client_address, socket_server): connect_handlers = [ self.RedirectConnectHandler, self.ServerAuthConnectHandler, self.DefaultConnectResponseHandler] get_handlers = [ self.NoCacheMaxAgeTimeHandler, self.NoCacheTimeHandler, self.CacheTimeHandler, self.CacheExpiresHandler, self.CacheProxyRevalidateHandler, self.CachePrivateHandler, self.CachePublicHandler, self.CacheSMaxAgeHandler, self.CacheMustRevalidateHandler, self.CacheMustRevalidateMaxAgeHandler, self.CacheNoStoreHandler, self.CacheNoStoreMaxAgeHandler, self.CacheNoTransformHandler, self.DownloadHandler, self.DownloadFinishHandler, self.EchoHeader, self.EchoHeaderCache, self.EchoAllHandler, self.ZipFileHandler, self.FileHandler, self.SetCookieHandler, self.SetManyCookiesHandler, self.ExpectAndSetCookieHandler, self.SetHeaderHandler, self.AuthBasicHandler, self.AuthDigestHandler, self.SlowServerHandler, self.ChunkedServerHandler, self.NoContentHandler, self.ServerRedirectHandler, self.CrossSiteRedirectHandler, self.ClientRedirectHandler, self.GetSSLSessionCacheHandler, self.SSLManySmallRecords, self.GetChannelID, self.GetClientCert, self.ClientCipherListHandler, self.CloseSocketHandler, self.RangeResetHandler, self.DefaultResponseHandler] post_handlers = [ self.EchoTitleHandler, self.EchoHandler, self.PostOnlyFileHandler, self.EchoMultipartPostHandler] + get_handlers put_handlers = [ self.EchoTitleHandler, self.EchoHandler] + get_handlers head_handlers = [ self.FileHandler, self.DefaultResponseHandler] self._mime_types = { 'crx' : 'application/x-chrome-extension', 'exe' : 'application/octet-stream', 'gif': 'image/gif', 'jpeg' : 'image/jpeg', 'jpg' : 'image/jpeg', 'js' : 'application/javascript', 'json': 'application/json', 'pdf' : 'application/pdf', 'txt' : 'text/plain', 'wav' : 'audio/wav', 'xml' : 'text/xml' } self._default_mime_type = 'text/html' testserver_base.BasePageHandler.__init__(self, request, client_address, socket_server, connect_handlers, get_handlers, head_handlers, post_handlers, put_handlers) def GetMIMETypeFromName(self, file_name): """Returns the mime type for the specified file_name. So far it only looks at the file extension.""" (_shortname, extension) = os.path.splitext(file_name.split("?")[0]) if len(extension) == 0: # no extension. return self._default_mime_type # extension starts with a dot, so we need to remove it return self._mime_types.get(extension[1:], self._default_mime_type) def NoCacheMaxAgeTimeHandler(self): """This request handler yields a page with the title set to the current system time, and no caching requested.""" if not self._ShouldHandleRequest("/nocachetime/maxage"): return False self.send_response(200) self.send_header('Cache-Control', 'max-age=0') self.send_header('Content-Type', 'text/html') self.end_headers() self.wfile.write('<html><head><title>%s</title></head></html>' % time.time()) return True def NoCacheTimeHandler(self): """This request handler yields a page with the title set to the current system time, and no caching requested.""" if not self._ShouldHandleRequest("/nocachetime"): return False self.send_response(200) self.send_header('Cache-Control', 'no-cache') self.send_header('Content-Type', 'text/html') self.end_headers() self.wfile.write('<html><head><title>%s</title></head></html>' % time.time()) return True def CacheTimeHandler(self): """This request handler yields a page with the title set to the current system time, and allows caching for one minute.""" if not self._ShouldHandleRequest("/cachetime"): return False self.send_response(200) self.send_header('Cache-Control', 'max-age=60') self.send_header('Content-Type', 'text/html') self.end_headers() self.wfile.write('<html><head><title>%s</title></head></html>' % time.time()) return True def CacheExpiresHandler(self): """This request handler yields a page with the title set to the current system time, and set the page to expire on 1 Jan 2099.""" if not self._ShouldHandleRequest("/cache/expires"): return False self.send_response(200) self.send_header('Expires', 'Thu, 1 Jan 2099 00:00:00 GMT') self.send_header('Content-Type', 'text/html') self.end_headers() self.wfile.write('<html><head><title>%s</title></head></html>' % time.time()) return True def CacheProxyRevalidateHandler(self): """This request handler yields a page with the title set to the current system time, and allows caching for 60 seconds""" if not self._ShouldHandleRequest("/cache/proxy-revalidate"): return False self.send_response(200) self.send_header('Content-Type', 'text/html') self.send_header('Cache-Control', 'max-age=60, proxy-revalidate') self.end_headers() self.wfile.write('<html><head><title>%s</title></head></html>' % time.time()) return True def CachePrivateHandler(self): """This request handler yields a page with the title set to the current system time, and allows caching for 3 seconds.""" if not self._ShouldHandleRequest("/cache/private"): return False self.send_response(200) self.send_header('Content-Type', 'text/html') self.send_header('Cache-Control', 'max-age=3, private') self.end_headers() self.wfile.write('<html><head><title>%s</title></head></html>' % time.time()) return True def CachePublicHandler(self): """This request handler yields a page with the title set to the current system time, and allows caching for 3 seconds.""" if not self._ShouldHandleRequest("/cache/public"): return False self.send_response(200) self.send_header('Content-Type', 'text/html') self.send_header('Cache-Control', 'max-age=3, public') self.end_headers() self.wfile.write('<html><head><title>%s</title></head></html>' % time.time()) return True def CacheSMaxAgeHandler(self): """This request handler yields a page with the title set to the current system time, and does not allow for caching.""" if not self._ShouldHandleRequest("/cache/s-maxage"): return False self.send_response(200) self.send_header('Content-Type', 'text/html') self.send_header('Cache-Control', 'public, s-maxage = 60, max-age = 0') self.end_headers() self.wfile.write('<html><head><title>%s</title></head></html>' % time.time()) return True def CacheMustRevalidateHandler(self): """This request handler yields a page with the title set to the current system time, and does not allow caching.""" if not self._ShouldHandleRequest("/cache/must-revalidate"): return False self.send_response(200) self.send_header('Content-Type', 'text/html') self.send_header('Cache-Control', 'must-revalidate') self.end_headers() self.wfile.write('<html><head><title>%s</title></head></html>' % time.time()) return True def CacheMustRevalidateMaxAgeHandler(self): """This request handler yields a page with the title set to the current system time, and does not allow caching event though max-age of 60 seconds is specified.""" if not self._ShouldHandleRequest("/cache/must-revalidate/max-age"): return False self.send_response(200) self.send_header('Content-Type', 'text/html') self.send_header('Cache-Control', 'max-age=60, must-revalidate') self.end_headers() self.wfile.write('<html><head><title>%s</title></head></html>' % time.time()) return True def CacheNoStoreHandler(self): """This request handler yields a page with the title set to the current system time, and does not allow the page to be stored.""" if not self._ShouldHandleRequest("/cache/no-store"): return False self.send_response(200) self.send_header('Content-Type', 'text/html') self.send_header('Cache-Control', 'no-store') self.end_headers() self.wfile.write('<html><head><title>%s</title></head></html>' % time.time()) return True def CacheNoStoreMaxAgeHandler(self): """This request handler yields a page with the title set to the current system time, and does not allow the page to be stored even though max-age of 60 seconds is specified.""" if not self._ShouldHandleRequest("/cache/no-store/max-age"): return False self.send_response(200) self.send_header('Content-Type', 'text/html') self.send_header('Cache-Control', 'max-age=60, no-store') self.end_headers() self.wfile.write('<html><head><title>%s</title></head></html>' % time.time()) return True def CacheNoTransformHandler(self): """This request handler yields a page with the title set to the current system time, and does not allow the content to transformed during user-agent caching""" if not self._ShouldHandleRequest("/cache/no-transform"): return False self.send_response(200) self.send_header('Content-Type', 'text/html') self.send_header('Cache-Control', 'no-transform') self.end_headers() self.wfile.write('<html><head><title>%s</title></head></html>' % time.time()) return True def EchoHeader(self): """This handler echoes back the value of a specific request header.""" return self.EchoHeaderHelper("/echoheader") def EchoHeaderCache(self): """This function echoes back the value of a specific request header while allowing caching for 16 hours.""" return self.EchoHeaderHelper("/echoheadercache") def EchoHeaderHelper(self, echo_header): """This function echoes back the value of the request header passed in.""" if not self._ShouldHandleRequest(echo_header): return False query_char = self.path.find('?') if query_char != -1: header_name = self.path[query_char+1:] self.send_response(200) self.send_header('Content-Type', 'text/plain') if echo_header == '/echoheadercache': self.send_header('Cache-control', 'max-age=60000') else: self.send_header('Cache-control', 'no-cache') # insert a vary header to properly indicate that the cachability of this # request is subject to value of the request header being echoed. if len(header_name) > 0: self.send_header('Vary', header_name) self.end_headers() if len(header_name) > 0: self.wfile.write(self.headers.getheader(header_name)) return True def ReadRequestBody(self): """This function reads the body of the current HTTP request, handling both plain and chunked transfer encoded requests.""" if self.headers.getheader('transfer-encoding') != 'chunked': length = int(self.headers.getheader('content-length')) return self.rfile.read(length) # Read the request body as chunks. body = "" while True: line = self.rfile.readline() length = int(line, 16) if length == 0: self.rfile.readline() break body += self.rfile.read(length) self.rfile.read(2) return body def EchoHandler(self): """This handler just echoes back the payload of the request, for testing form submission.""" if not self._ShouldHandleRequest("/echo"): return False _, _, _, _, query, _ = urlparse.urlparse(self.path) query_params = cgi.parse_qs(query, True) if 'status' in query_params: self.send_response(int(query_params['status'][0])) else: self.send_response(200) self.send_header('Content-Type', 'text/html') self.end_headers() self.wfile.write(self.ReadRequestBody()) return True def EchoTitleHandler(self): """This handler is like Echo, but sets the page title to the request.""" if not self._ShouldHandleRequest("/echotitle"): return False self.send_response(200) self.send_header('Content-Type', 'text/html') self.end_headers() request = self.ReadRequestBody() self.wfile.write('<html><head><title>') self.wfile.write(request) self.wfile.write('</title></head></html>') return True def EchoAllHandler(self): """This handler yields a (more) human-readable page listing information about the request header & contents.""" if not self._ShouldHandleRequest("/echoall"): return False self.send_response(200) self.send_header('Content-Type', 'text/html') self.end_headers() self.wfile.write('<html><head><style>' 'pre { border: 1px solid black; margin: 5px; padding: 5px }' '</style></head><body>' '<div style="float: right">' '<a href="/echo">back to referring page</a></div>' '<h1>Request Body:</h1><pre>') if self.command == 'POST' or self.command == 'PUT': qs = self.ReadRequestBody() params = cgi.parse_qs(qs, keep_blank_values=1) for param in params: self.wfile.write('%s=%s\n' % (param, params[param][0])) self.wfile.write('</pre>') self.wfile.write('<h1>Request Headers:</h1><pre>%s</pre>' % self.headers) self.wfile.write('</body></html>') return True def EchoMultipartPostHandler(self): """This handler echoes received multipart post data as json format.""" if not (self._ShouldHandleRequest("/echomultipartpost") or self._ShouldHandleRequest("/searchbyimage")): return False content_type, parameters = cgi.parse_header( self.headers.getheader('content-type')) if content_type == 'multipart/form-data': post_multipart = cgi.parse_multipart(self.rfile, parameters) elif content_type == 'application/x-www-form-urlencoded': raise Exception('POST by application/x-www-form-urlencoded is ' 'not implemented.') else: post_multipart = {} # Since the data can be binary, we encode them by base64. post_multipart_base64_encoded = {} for field, values in post_multipart.items(): post_multipart_base64_encoded[field] = [base64.b64encode(value) for value in values] result = {'POST_multipart' : post_multipart_base64_encoded} self.send_response(200) self.send_header("Content-type", "text/plain") self.end_headers() self.wfile.write(json.dumps(result, indent=2, sort_keys=False)) return True def DownloadHandler(self): """This handler sends a downloadable file with or without reporting the size (6K).""" if self.path.startswith("/download-unknown-size"): send_length = False elif self.path.startswith("/download-known-size"): send_length = True else: return False # # The test which uses this functionality is attempting to send # small chunks of data to the client. Use a fairly large buffer # so that we'll fill chrome's IO buffer enough to force it to # actually write the data. # See also the comments in the client-side of this test in # download_uitest.cc # size_chunk1 = 35*1024 size_chunk2 = 10*1024 self.send_response(200) self.send_header('Content-Type', 'application/octet-stream') self.send_header('Cache-Control', 'max-age=0') if send_length: self.send_header('Content-Length', size_chunk1 + size_chunk2) self.end_headers() # First chunk of data: self.wfile.write("*" * size_chunk1) self.wfile.flush() # handle requests until one of them clears this flag. self.server.wait_for_download = True while self.server.wait_for_download: self.server.handle_request() # Second chunk of data: self.wfile.write("*" * size_chunk2) return True def DownloadFinishHandler(self): """This handler just tells the server to finish the current download.""" if not self._ShouldHandleRequest("/download-finish"): return False self.server.wait_for_download = False self.send_response(200) self.send_header('Content-Type', 'text/html') self.send_header('Cache-Control', 'max-age=0') self.end_headers() return True def _ReplaceFileData(self, data, query_parameters): """Replaces matching substrings in a file. If the 'replace_text' URL query parameter is present, it is expected to be of the form old_text:new_text, which indicates that any old_text strings in the file are replaced with new_text. Multiple 'replace_text' parameters may be specified. If the parameters are not present, |data| is returned. """ query_dict = cgi.parse_qs(query_parameters) replace_text_values = query_dict.get('replace_text', []) for replace_text_value in replace_text_values: replace_text_args = replace_text_value.split(':') if len(replace_text_args) != 2: raise ValueError( 'replace_text must be of form old_text:new_text. Actual value: %s' % replace_text_value) old_text_b64, new_text_b64 = replace_text_args old_text = base64.urlsafe_b64decode(old_text_b64) new_text = base64.urlsafe_b64decode(new_text_b64) data = data.replace(old_text, new_text) return data def ZipFileHandler(self): """This handler sends the contents of the requested file in compressed form. Can pass in a parameter that specifies that the content length be C - the compressed size (OK), U - the uncompressed size (Non-standard, but handled), S - less than compressed (OK because we keep going), M - larger than compressed but less than uncompressed (an error), L - larger than uncompressed (an error) Example: compressedfiles/Picture_1.doc?C """ prefix = "/compressedfiles/" if not self.path.startswith(prefix): return False # Consume a request body if present. if self.command == 'POST' or self.command == 'PUT' : self.ReadRequestBody() _, _, url_path, _, query, _ = urlparse.urlparse(self.path) if not query in ('C', 'U', 'S', 'M', 'L'): return False sub_path = url_path[len(prefix):] entries = sub_path.split('/') file_path = os.path.join(self.server.data_dir, *entries) if os.path.isdir(file_path): file_path = os.path.join(file_path, 'index.html') if not os.path.isfile(file_path): print "File not found " + sub_path + " full path:" + file_path self.send_error(404) return True f = open(file_path, "rb") data = f.read() uncompressed_len = len(data) f.close() # Compress the data. data = zlib.compress(data) compressed_len = len(data) content_length = compressed_len if query == 'U': content_length = uncompressed_len elif query == 'S': content_length = compressed_len / 2 elif query == 'M': content_length = (compressed_len + uncompressed_len) / 2 elif query == 'L': content_length = compressed_len + uncompressed_len self.send_response(200) self.send_header('Content-Type', 'application/msword') self.send_header('Content-encoding', 'deflate') self.send_header('Connection', 'close') self.send_header('Content-Length', content_length) self.send_header('ETag', '\'' + file_path + '\'') self.end_headers() self.wfile.write(data) return True def FileHandler(self): """This handler sends the contents of the requested file. Wow, it's like a real webserver!""" prefix = self.server.file_root_url if not self.path.startswith(prefix): return False return self._FileHandlerHelper(prefix) def PostOnlyFileHandler(self): """This handler sends the contents of the requested file on a POST.""" prefix = urlparse.urljoin(self.server.file_root_url, 'post/') if not self.path.startswith(prefix): return False return self._FileHandlerHelper(prefix) def _FileHandlerHelper(self, prefix): request_body = '' if self.command == 'POST' or self.command == 'PUT': # Consume a request body if present. request_body = self.ReadRequestBody() _, _, url_path, _, query, _ = urlparse.urlparse(self.path) query_dict = cgi.parse_qs(query) expected_body = query_dict.get('expected_body', []) if expected_body and request_body not in expected_body: self.send_response(404) self.end_headers() self.wfile.write('') return True expected_headers = query_dict.get('expected_headers', []) for expected_header in expected_headers: header_name, expected_value = expected_header.split(':') if self.headers.getheader(header_name) != expected_value: self.send_response(404) self.end_headers() self.wfile.write('') return True sub_path = url_path[len(prefix):] entries = sub_path.split('/') file_path = os.path.join(self.server.data_dir, *entries) if os.path.isdir(file_path): file_path = os.path.join(file_path, 'index.html') if not os.path.isfile(file_path): print "File not found " + sub_path + " full path:" + file_path self.send_error(404) return True f = open(file_path, "rb") data = f.read() f.close() data = self._ReplaceFileData(data, query) old_protocol_version = self.protocol_version # If file.mock-http-headers exists, it contains the headers we # should send. Read them in and parse them. headers_path = file_path + '.mock-http-headers' if os.path.isfile(headers_path): f = open(headers_path, "r") # "HTTP/1.1 200 OK" response = f.readline() http_major, http_minor, status_code = re.findall( 'HTTP/(\d+).(\d+) (\d+)', response)[0] self.protocol_version = "HTTP/%s.%s" % (http_major, http_minor) self.send_response(int(status_code)) for line in f: header_values = re.findall('(\S+):\s*(.*)', line) if len(header_values) > 0: # "name: value" name, value = header_values[0] self.send_header(name, value) f.close() else: # Could be more generic once we support mime-type sniffing, but for # now we need to set it explicitly. range_header = self.headers.get('Range') if range_header and range_header.startswith('bytes='): # Note this doesn't handle all valid byte range_header values (i.e. # left open ended ones), just enough for what we needed so far. range_header = range_header[6:].split('-') start = int(range_header[0]) if range_header[1]: end = int(range_header[1]) else: end = len(data) - 1 self.send_response(206) content_range = ('bytes ' + str(start) + '-' + str(end) + '/' + str(len(data))) self.send_header('Content-Range', content_range) data = data[start: end + 1] else: self.send_response(200) self.send_header('Content-Type', self.GetMIMETypeFromName(file_path)) self.send_header('Accept-Ranges', 'bytes') self.send_header('Content-Length', len(data)) self.send_header('ETag', '\'' + file_path + '\'') self.end_headers() if (self.command != 'HEAD'): self.wfile.write(data) self.protocol_version = old_protocol_version return True def SetCookieHandler(self): """This handler just sets a cookie, for testing cookie handling.""" if not self._ShouldHandleRequest("/set-cookie"): return False query_char = self.path.find('?') if query_char != -1: cookie_values = self.path[query_char + 1:].split('&') else: cookie_values = ("",) self.send_response(200) self.send_header('Content-Type', 'text/html') for cookie_value in cookie_values: self.send_header('Set-Cookie', '%s' % cookie_value) self.end_headers() for cookie_value in cookie_values: self.wfile.write('%s' % cookie_value) return True def SetManyCookiesHandler(self): """This handler just sets a given number of cookies, for testing handling of large numbers of cookies.""" if not self._ShouldHandleRequest("/set-many-cookies"): return False query_char = self.path.find('?') if query_char != -1: num_cookies = int(self.path[query_char + 1:]) else: num_cookies = 0 self.send_response(200) self.send_header('', 'text/html') for _i in range(0, num_cookies): self.send_header('Set-Cookie', 'a=') self.end_headers() self.wfile.write('%d cookies were sent' % num_cookies) return True def ExpectAndSetCookieHandler(self): """Expects some cookies to be sent, and if they are, sets more cookies. The expect parameter specifies a required cookie. May be specified multiple times. The set parameter specifies a cookie to set if all required cookies are preset. May be specified multiple times. The data parameter specifies the response body data to be returned.""" if not self._ShouldHandleRequest("/expect-and-set-cookie"): return False _, _, _, _, query, _ = urlparse.urlparse(self.path) query_dict = cgi.parse_qs(query) cookies = set() if 'Cookie' in self.headers: cookie_header = self.headers.getheader('Cookie') cookies.update([s.strip() for s in cookie_header.split(';')]) got_all_expected_cookies = True for expected_cookie in query_dict.get('expect', []): if expected_cookie not in cookies: got_all_expected_cookies = False self.send_response(200) self.send_header('Content-Type', 'text/html') if got_all_expected_cookies: for cookie_value in query_dict.get('set', []): self.send_header('Set-Cookie', '%s' % cookie_value) self.end_headers() for data_value in query_dict.get('data', []): self.wfile.write(data_value) return True def SetHeaderHandler(self): """This handler sets a response header. Parameters are in the key%3A%20value&key2%3A%20value2 format.""" if not self._ShouldHandleRequest("/set-header"): return False query_char = self.path.find('?') if query_char != -1: headers_values = self.path[query_char + 1:].split('&') else: headers_values = ("",) self.send_response(200) self.send_header('Content-Type', 'text/html') for header_value in headers_values: header_value = urllib.unquote(header_value) (key, value) = header_value.split(': ', 1) self.send_header(key, value) self.end_headers() for header_value in headers_values: self.wfile.write('%s' % header_value) return True def AuthBasicHandler(self): """This handler tests 'Basic' authentication. It just sends a page with title 'user/pass' if you succeed.""" if not self._ShouldHandleRequest("/auth-basic"): return False username = userpass = password = b64str = "" expected_password = 'secret' realm = 'testrealm' set_cookie_if_challenged = False _, _, url_path, _, query, _ = urlparse.urlparse(self.path) query_params = cgi.parse_qs(query, True) if 'set-cookie-if-challenged' in query_params: set_cookie_if_challenged = True if 'password' in query_params: expected_password = query_params['password'][0] if 'realm' in query_params: realm = query_params['realm'][0] auth = self.headers.getheader('authorization') try: if not auth: raise Exception('no auth') b64str = re.findall(r'Basic (\S+)', auth)[0] userpass = base64.b64decode(b64str) username, password = re.findall(r'([^:]+):(\S+)', userpass)[0] if password != expected_password: raise Exception('wrong password') except Exception, e: # Authentication failed. self.send_response(401) self.send_header('WWW-Authenticate', 'Basic realm="%s"' % realm) self.send_header('Content-Type', 'text/html') if set_cookie_if_challenged: self.send_header('Set-Cookie', 'got_challenged=true') self.end_headers() self.wfile.write('<html><head>') self.wfile.write('<title>Denied: %s</title>' % e) self.wfile.write('</head><body>') self.wfile.write('auth=%s<p>' % auth) self.wfile.write('b64str=%s<p>' % b64str) self.wfile.write('username: %s<p>' % username) self.wfile.write('userpass: %s<p>' % userpass) self.wfile.write('password: %s<p>' % password) self.wfile.write('You sent:<br>%s<p>' % self.headers) self.wfile.write('</body></html>') return True # Authentication successful. (Return a cachable response to allow for # testing cached pages that require authentication.) old_protocol_version = self.protocol_version self.protocol_version = "HTTP/1.1" if_none_match = self.headers.getheader('if-none-match') if if_none_match == "abc": self.send_response(304) self.end_headers() elif url_path.endswith(".gif"): # Using chrome/test/data/google/logo.gif as the test image test_image_path = ['google', 'logo.gif'] gif_path = os.path.join(self.server.data_dir, *test_image_path) if not os.path.isfile(gif_path): self.send_error(404) self.protocol_version = old_protocol_version return True f = open(gif_path, "rb") data = f.read() f.close() self.send_response(200) self.send_header('Content-Type', 'image/gif') self.send_header('Cache-control', 'max-age=60000') self.send_header('Etag', 'abc') self.end_headers() self.wfile.write(data) else: self.send_response(200) self.send_header('Content-Type', 'text/html') self.send_header('Cache-control', 'max-age=60000') self.send_header('Etag', 'abc') self.end_headers() self.wfile.write('<html><head>') self.wfile.write('<title>%s/%s</title>' % (username, password)) self.wfile.write('</head><body>') self.wfile.write('auth=%s<p>' % auth) self.wfile.write('You sent:<br>%s<p>' % self.headers) self.wfile.write('</body></html>') self.protocol_version = old_protocol_version return True def GetNonce(self, force_reset=False): """Returns a nonce that's stable per request path for the server's lifetime. This is a fake implementation. A real implementation would only use a given nonce a single time (hence the name n-once). However, for the purposes of unittesting, we don't care about the security of the nonce. Args: force_reset: Iff set, the nonce will be changed. Useful for testing the "stale" response. """ if force_reset or not self.server.nonce_time: self.server.nonce_time = time.time() return hashlib.md5('privatekey%s%d' % (self.path, self.server.nonce_time)).hexdigest() def AuthDigestHandler(self): """This handler tests 'Digest' authentication. It just sends a page with title 'user/pass' if you succeed. A stale response is sent iff "stale" is present in the request path. """ if not self._ShouldHandleRequest("/auth-digest"): return False stale = 'stale' in self.path nonce = self.GetNonce(force_reset=stale) opaque = hashlib.md5('opaque').hexdigest() password = 'secret' realm = 'testrealm' auth = self.headers.getheader('authorization') pairs = {} try: if not auth: raise Exception('no auth') if not auth.startswith('Digest'): raise Exception('not digest') # Pull out all the name="value" pairs as a dictionary. pairs = dict(re.findall(r'(\b[^ ,=]+)="?([^",]+)"?', auth)) # Make sure it's all valid. if pairs['nonce'] != nonce: raise Exception('wrong nonce') if pairs['opaque'] != opaque: raise Exception('wrong opaque') # Check the 'response' value and make sure it matches our magic hash. # See http://www.ietf.org/rfc/rfc2617.txt hash_a1 = hashlib.md5( ':'.join([pairs['username'], realm, password])).hexdigest() hash_a2 = hashlib.md5(':'.join([self.command, pairs['uri']])).hexdigest() if 'qop' in pairs and 'nc' in pairs and 'cnonce' in pairs: response = hashlib.md5(':'.join([hash_a1, nonce, pairs['nc'], pairs['cnonce'], pairs['qop'], hash_a2])).hexdigest() else: response = hashlib.md5(':'.join([hash_a1, nonce, hash_a2])).hexdigest() if pairs['response'] != response: raise Exception('wrong password') except Exception, e: # Authentication failed. self.send_response(401) hdr = ('Digest ' 'realm="%s", ' 'domain="/", ' 'qop="auth", ' 'algorithm=MD5, ' 'nonce="%s", ' 'opaque="%s"') % (realm, nonce, opaque) if stale: hdr += ', stale="TRUE"' self.send_header('WWW-Authenticate', hdr) self.send_header('Content-Type', 'text/html') self.end_headers() self.wfile.write('<html><head>') self.wfile.write('<title>Denied: %s</title>' % e) self.wfile.write('</head><body>') self.wfile.write('auth=%s<p>' % auth) self.wfile.write('pairs=%s<p>' % pairs) self.wfile.write('You sent:<br>%s<p>' % self.headers) self.wfile.write('We are replying:<br>%s<p>' % hdr) self.wfile.write('</body></html>') return True # Authentication successful. self.send_response(200) self.send_header('Content-Type', 'text/html') self.end_headers() self.wfile.write('<html><head>') self.wfile.write('<title>%s/%s</title>' % (pairs['username'], password)) self.wfile.write('</head><body>') self.wfile.write('auth=%s<p>' % auth) self.wfile.write('pairs=%s<p>' % pairs) self.wfile.write('</body></html>') return True def SlowServerHandler(self): """Wait for the user suggested time before responding. The syntax is /slow?0.5 to wait for half a second.""" if not self._ShouldHandleRequest("/slow"): return False query_char = self.path.find('?') wait_sec = 1.0 if query_char >= 0: try: wait_sec = float(self.path[query_char + 1:]) except ValueError: pass time.sleep(wait_sec) self.send_response(200) self.send_header('Content-Type', 'text/plain') self.end_headers() self.wfile.write("waited %.1f seconds" % wait_sec) return True def ChunkedServerHandler(self): """Send chunked response. Allows to specify chunks parameters: - waitBeforeHeaders - ms to wait before sending headers - waitBetweenChunks - ms to wait between chunks - chunkSize - size of each chunk in bytes - chunksNumber - number of chunks Example: /chunked?waitBeforeHeaders=1000&chunkSize=5&chunksNumber=5 waits one second, then sends headers and five chunks five bytes each.""" if not self._ShouldHandleRequest("/chunked"): return False query_char = self.path.find('?') chunkedSettings = {'waitBeforeHeaders' : 0, 'waitBetweenChunks' : 0, 'chunkSize' : 5, 'chunksNumber' : 5} if query_char >= 0: params = self.path[query_char + 1:].split('&') for param in params: keyValue = param.split('=') if len(keyValue) == 2: try: chunkedSettings[keyValue[0]] = int(keyValue[1]) except ValueError: pass time.sleep(0.001 * chunkedSettings['waitBeforeHeaders']) self.protocol_version = 'HTTP/1.1' # Needed for chunked encoding self.send_response(200) self.send_header('Content-Type', 'text/plain') self.send_header('Connection', 'close') self.send_header('Transfer-Encoding', 'chunked') self.end_headers() # Chunked encoding: sending all chunks, then final zero-length chunk and # then final CRLF. for i in range(0, chunkedSettings['chunksNumber']): if i > 0: time.sleep(0.001 * chunkedSettings['waitBetweenChunks']) self.sendChunkHelp('*' * chunkedSettings['chunkSize']) self.wfile.flush() # Keep in mind that we start flushing only after 1kb. self.sendChunkHelp('') return True def NoContentHandler(self): """Returns a 204 No Content response.""" if not self._ShouldHandleRequest("/nocontent"): return False self.send_response(204) self.end_headers() return True def ServerRedirectHandler(self): """Sends a server redirect to the given URL. The syntax is '/server-redirect?http://foo.bar/asdf' to redirect to 'http://foo.bar/asdf'""" test_name = "/server-redirect" if not self._ShouldHandleRequest(test_name): return False query_char = self.path.find('?') if query_char < 0 or len(self.path) <= query_char + 1: self.sendRedirectHelp(test_name) return True dest = urllib.unquote(self.path[query_char + 1:]) self.send_response(301) # moved permanently self.send_header('Location', dest) self.send_header('Content-Type', 'text/html') self.end_headers() self.wfile.write('<html><head>') self.wfile.write('</head><body>Redirecting to %s</body></html>' % dest) return True def CrossSiteRedirectHandler(self): """Sends a server redirect to the given site. The syntax is '/cross-site/hostname/...' to redirect to //hostname/... It is used to navigate between different Sites, causing cross-site/cross-process navigations in the browser.""" test_name = "/cross-site" if not self._ShouldHandleRequest(test_name): return False params = urllib.unquote(self.path[(len(test_name) + 1):]) slash = params.find('/') if slash < 0: self.sendRedirectHelp(test_name) return True host = params[:slash] path = params[(slash+1):] dest = "//%s:%s/%s" % (host, str(self.server.server_port), path) self.send_response(301) # moved permanently self.send_header('Location', dest) self.send_header('Content-Type', 'text/html') self.end_headers() self.wfile.write('<html><head>') self.wfile.write('</head><body>Redirecting to %s</body></html>' % dest) return True def ClientRedirectHandler(self): """Sends a client redirect to the given URL. The syntax is '/client-redirect?http://foo.bar/asdf' to redirect to 'http://foo.bar/asdf'""" test_name = "/client-redirect" if not self._ShouldHandleRequest(test_name): return False query_char = self.path.find('?') if query_char < 0 or len(self.path) <= query_char + 1: self.sendRedirectHelp(test_name) return True dest = urllib.unquote(self.path[query_char + 1:]) self.send_response(200) self.send_header('Content-Type', 'text/html') self.end_headers() self.wfile.write('<html><head>') self.wfile.write('<meta http-equiv="refresh" content="0;url=%s">' % dest) self.wfile.write('</head><body>Redirecting to %s</body></html>' % dest) return True def GetSSLSessionCacheHandler(self): """Send a reply containing a log of the session cache operations.""" if not self._ShouldHandleRequest('/ssl-session-cache'): return False self.send_response(200) self.send_header('Content-Type', 'text/plain') self.end_headers() try: log = self.server.session_cache.log except AttributeError: self.wfile.write('Pass --https-record-resume in order to use' + ' this request') return True for (action, sessionID) in log: self.wfile.write('%s\t%s\n' % (action, bytes(sessionID).encode('hex'))) return True def SSLManySmallRecords(self): """Sends a reply consisting of a variety of small writes. These will be translated into a series of small SSL records when used over an HTTPS server.""" if not self._ShouldHandleRequest('/ssl-many-small-records'): return False self.send_response(200) self.send_header('Content-Type', 'text/plain') self.end_headers() # Write ~26K of data, in 1350 byte chunks for i in xrange(20): self.wfile.write('*' * 1350) self.wfile.flush() return True def GetChannelID(self): """Send a reply containing the hashed ChannelID that the client provided.""" if not self._ShouldHandleRequest('/channel-id'): return False self.send_response(200) self.send_header('Content-Type', 'text/plain') self.end_headers() channel_id = bytes(self.server.tlsConnection.channel_id) self.wfile.write(hashlib.sha256(channel_id).digest().encode('base64')) return True def GetClientCert(self): """Send a reply whether a client certificate was provided.""" if not self._ShouldHandleRequest('/client-cert'): return False self.send_response(200) self.send_header('Content-Type', 'text/plain') self.end_headers() cert_chain = self.server.tlsConnection.session.clientCertChain if cert_chain != None: self.wfile.write('got client cert with fingerprint: ' + cert_chain.getFingerprint()) else: self.wfile.write('got no client cert') return True def ClientCipherListHandler(self): """Send a reply containing the cipher suite list that the client provided. Each cipher suite value is serialized in decimal, followed by a newline.""" if not self._ShouldHandleRequest('/client-cipher-list'): return False self.send_response(200) self.send_header('Content-Type', 'text/plain') self.end_headers() cipher_suites = self.server.tlsConnection.clientHello.cipher_suites self.wfile.write('\n'.join(str(c) for c in cipher_suites)) return True def CloseSocketHandler(self): """Closes the socket without sending anything.""" if not self._ShouldHandleRequest('/close-socket'): return False self.wfile.close() return True def RangeResetHandler(self): """Send data broken up by connection resets every N (default 4K) bytes. Support range requests. If the data requested doesn't straddle a reset boundary, it will all be sent. Used for testing resuming downloads.""" def DataForRange(start, end): """Data to be provided for a particular range of bytes.""" # Offset and scale to avoid too obvious (and hence potentially # collidable) data. return ''.join([chr(y % 256) for y in range(start * 2 + 15, end * 2 + 15, 2)]) if not self._ShouldHandleRequest('/rangereset'): return False # HTTP/1.1 is required for ETag and range support. self.protocol_version = 'HTTP/1.1' _, _, url_path, _, query, _ = urlparse.urlparse(self.path) # Defaults size = 8000 # Note that the rst is sent just before sending the rst_boundary byte. rst_boundary = 4000 respond_to_range = True hold_for_signal = False rst_limit = -1 token = 'DEFAULT' fail_precondition = 0 send_verifiers = True # Parse the query qdict = urlparse.parse_qs(query, True) if 'size' in qdict: size = int(qdict['size'][0]) if 'rst_boundary' in qdict: rst_boundary = int(qdict['rst_boundary'][0]) if 'token' in qdict: # Identifying token for stateful tests. token = qdict['token'][0] if 'rst_limit' in qdict: # Max number of rsts for a given token. rst_limit = int(qdict['rst_limit'][0]) if 'bounce_range' in qdict: respond_to_range = False if 'hold' in qdict: # Note that hold_for_signal will not work with null range requests; # see TODO below. hold_for_signal = True if 'no_verifiers' in qdict: send_verifiers = False if 'fail_precondition' in qdict: fail_precondition = int(qdict['fail_precondition'][0]) # Record already set information, or set it. rst_limit = TestPageHandler.rst_limits.setdefault(token, rst_limit) if rst_limit != 0: TestPageHandler.rst_limits[token] -= 1 fail_precondition = TestPageHandler.fail_precondition.setdefault( token, fail_precondition) if fail_precondition != 0: TestPageHandler.fail_precondition[token] -= 1 first_byte = 0 last_byte = size - 1 # Does that define what we want to return, or do we need to apply # a range? range_response = False range_header = self.headers.getheader('range') if fail_precondition and self.headers.getheader('If-Range'): # Failing a precondition for an If-Range just means that we are going to # return the entire entity ignoring the Range header. respond_to_range = False if range_header and respond_to_range: mo = re.match("bytes=(\d*)-(\d*)", range_header) if mo.group(1): first_byte = int(mo.group(1)) if mo.group(2): last_byte = int(mo.group(2)) if last_byte > size - 1: last_byte = size - 1 range_response = True if last_byte < first_byte: return False if range_response: self.send_response(206) self.send_header('Content-Range', 'bytes %d-%d/%d' % (first_byte, last_byte, size)) else: self.send_response(200) self.send_header('Content-Type', 'application/octet-stream') self.send_header('Content-Length', last_byte - first_byte + 1) if send_verifiers: # If fail_precondition is non-zero, then the ETag for each request will be # different. etag = "%s%d" % (token, fail_precondition) self.send_header('ETag', etag) self.send_header('Last-Modified', 'Tue, 19 Feb 2013 14:32 EST') self.end_headers() if hold_for_signal: # TODO(rdsmith/phajdan.jr): http://crbug.com/169519: Without writing # a single byte, the self.server.handle_request() below hangs # without processing new incoming requests. self.wfile.write(DataForRange(first_byte, first_byte + 1)) first_byte = first_byte + 1 # handle requests until one of them clears this flag. self.server.wait_for_download = True while self.server.wait_for_download: self.server.handle_request() possible_rst = ((first_byte / rst_boundary) + 1) * rst_boundary if possible_rst >= last_byte or rst_limit == 0: # No RST has been requested in this range, so we don't need to # do anything fancy; just write the data and let the python # infrastructure close the connection. self.wfile.write(DataForRange(first_byte, last_byte + 1)) self.wfile.flush() return True # We're resetting the connection part way in; go to the RST # boundary and then send an RST. # Because socket semantics do not guarantee that all the data will be # sent when using the linger semantics to hard close a socket, # we send the data and then wait for our peer to release us # before sending the reset. data = DataForRange(first_byte, possible_rst) self.wfile.write(data) self.wfile.flush() self.server.wait_for_download = True while self.server.wait_for_download: self.server.handle_request() l_onoff = 1 # Linger is active. l_linger = 0 # Seconds to linger for. self.connection.setsockopt(socket.SOL_SOCKET, socket.SO_LINGER, struct.pack('ii', l_onoff, l_linger)) # Close all duplicates of the underlying socket to force the RST. self.wfile.close() self.rfile.close() self.connection.close() return True def DefaultResponseHandler(self): """This is the catch-all response handler for requests that aren't handled by one of the special handlers above. Note that we specify the content-length as without it the https connection is not closed properly (and the browser keeps expecting data).""" contents = "Default response given for path: " + self.path self.send_response(200) self.send_header('Content-Type', 'text/html') self.send_header('Content-Length', len(contents)) self.end_headers() if (self.command != 'HEAD'): self.wfile.write(contents) return True def RedirectConnectHandler(self): """Sends a redirect to the CONNECT request for www.redirect.com. This response is not specified by the RFC, so the browser should not follow the redirect.""" if (self.path.find("www.redirect.com") < 0): return False dest = "http://www.destination.com/foo.js" self.send_response(302) # moved temporarily self.send_header('Location', dest) self.send_header('Connection', 'close') self.end_headers() return True def ServerAuthConnectHandler(self): """Sends a 401 to the CONNECT request for www.server-auth.com. This response doesn't make sense because the proxy server cannot request server authentication.""" if (self.path.find("www.server-auth.com") < 0): return False challenge = 'Basic realm="WallyWorld"' self.send_response(401) # unauthorized self.send_header('WWW-Authenticate', challenge) self.send_header('Connection', 'close') self.end_headers() return True def DefaultConnectResponseHandler(self): """This is the catch-all response handler for CONNECT requests that aren't handled by one of the special handlers above. Real Web servers respond with 400 to CONNECT requests.""" contents = "Your client has issued a malformed or illegal request." self.send_response(400) # bad request self.send_header('Content-Type', 'text/html') self.send_header('Content-Length', len(contents)) self.end_headers() self.wfile.write(contents) return True # called by the redirect handling function when there is no parameter def sendRedirectHelp(self, redirect_name): self.send_response(200) self.send_header('Content-Type', 'text/html') self.end_headers() self.wfile.write('<html><body><h1>Error: no redirect destination</h1>') self.wfile.write('Use <pre>%s?http://dest...</pre>' % redirect_name) self.wfile.write('</body></html>') # called by chunked handling function def sendChunkHelp(self, chunk): # Each chunk consists of: chunk size (hex), CRLF, chunk body, CRLF self.wfile.write('%X\r\n' % len(chunk)) self.wfile.write(chunk) self.wfile.write('\r\n') class OCSPHandler(testserver_base.BasePageHandler): def __init__(self, request, client_address, socket_server): handlers = [self.OCSPResponse] self.ocsp_response = socket_server.ocsp_response testserver_base.BasePageHandler.__init__(self, request, client_address, socket_server, [], handlers, [], handlers, []) def OCSPResponse(self): self.send_response(200) self.send_header('Content-Type', 'application/ocsp-response') self.send_header('Content-Length', str(len(self.ocsp_response))) self.end_headers() self.wfile.write(self.ocsp_response) class TCPEchoHandler(SocketServer.BaseRequestHandler): """The RequestHandler class for TCP echo server. It is instantiated once per connection to the server, and overrides the handle() method to implement communication to the client. """ def handle(self): """Handles the request from the client and constructs a response.""" data = self.request.recv(65536).strip() # Verify the "echo request" message received from the client. Send back # "echo response" message if "echo request" message is valid. try: return_data = echo_message.GetEchoResponseData(data) if not return_data: return except ValueError: return self.request.send(return_data) class UDPEchoHandler(SocketServer.BaseRequestHandler): """The RequestHandler class for UDP echo server. It is instantiated once per connection to the server, and overrides the handle() method to implement communication to the client. """ def handle(self): """Handles the request from the client and constructs a response.""" data = self.request[0].strip() request_socket = self.request[1] # Verify the "echo request" message received from the client. Send back # "echo response" message if "echo request" message is valid. try: return_data = echo_message.GetEchoResponseData(data) if not return_data: return except ValueError: return request_socket.sendto(return_data, self.client_address) class BasicAuthProxyRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler): """A request handler that behaves as a proxy server which requires basic authentication. Only CONNECT, GET and HEAD is supported for now. """ _AUTH_CREDENTIAL = 'Basic Zm9vOmJhcg==' # foo:bar def parse_request(self): """Overrides parse_request to check credential.""" if not BaseHTTPServer.BaseHTTPRequestHandler.parse_request(self): return False auth = self.headers.getheader('Proxy-Authorization') if auth != self._AUTH_CREDENTIAL: self.send_response(407) self.send_header('Proxy-Authenticate', 'Basic realm="MyRealm1"') self.end_headers() return False return True def _start_read_write(self, sock): sock.setblocking(0) self.request.setblocking(0) rlist = [self.request, sock] while True: ready_sockets, _unused, errors = select.select(rlist, [], []) if errors: self.send_response(500) self.end_headers() return for s in ready_sockets: received = s.recv(1024) if len(received) == 0: return if s == self.request: other = sock else: other = self.request other.send(received) def _do_common_method(self): url = urlparse.urlparse(self.path) port = url.port if not port: if url.scheme == 'http': port = 80 elif url.scheme == 'https': port = 443 if not url.hostname or not port: self.send_response(400) self.end_headers() return if len(url.path) == 0: path = '/' else: path = url.path if len(url.query) > 0: path = '%s?%s' % (url.path, url.query) sock = None try: sock = socket.create_connection((url.hostname, port)) sock.send('%s %s %s\r\n' % ( self.command, path, self.protocol_version)) for header in self.headers.headers: header = header.strip() if (header.lower().startswith('connection') or header.lower().startswith('proxy')): continue sock.send('%s\r\n' % header) sock.send('\r\n') self._start_read_write(sock) except Exception: self.send_response(500) self.end_headers() finally: if sock is not None: sock.close() def do_CONNECT(self): try: pos = self.path.rfind(':') host = self.path[:pos] port = int(self.path[pos+1:]) except Exception: self.send_response(400) self.end_headers() try: sock = socket.create_connection((host, port)) self.send_response(200, 'Connection established') self.end_headers() self._start_read_write(sock) except Exception: self.send_response(500) self.end_headers() finally: sock.close() def do_GET(self): self._do_common_method() def do_HEAD(self): self._do_common_method() class ServerRunner(testserver_base.TestServerRunner): """TestServerRunner for the net test servers.""" def __init__(self): super(ServerRunner, self).__init__() self.__ocsp_server = None def __make_data_dir(self): if self.options.data_dir: if not os.path.isdir(self.options.data_dir): raise testserver_base.OptionError('specified data dir not found: ' + self.options.data_dir + ' exiting...') my_data_dir = self.options.data_dir else: # Create the default path to our data dir, relative to the exe dir. my_data_dir = os.path.join(BASE_DIR, "..", "..", "..", "..", "test", "data") #TODO(ibrar): Must use Find* funtion defined in google\tools #i.e my_data_dir = FindUpward(my_data_dir, "test", "data") return my_data_dir def create_server(self, server_data): port = self.options.port host = self.options.host # Work around a bug in Mac OS 10.6. Spawning a WebSockets server # will result in a call to |getaddrinfo|, which fails with "nodename # nor servname provided" for localhost:0 on 10.6. if self.options.server_type == SERVER_WEBSOCKET and \ host == "localhost" and \ port == 0: host = "127.0.0.1" if self.options.server_type == SERVER_HTTP: if self.options.https: pem_cert_and_key = None ocsp_der = None if self.options.cert_and_key_file: if not os.path.isfile(self.options.cert_and_key_file): raise testserver_base.OptionError( 'specified server cert file not found: ' + self.options.cert_and_key_file + ' exiting...') pem_cert_and_key = file(self.options.cert_and_key_file, 'r').read() else: # generate a new certificate and run an OCSP server for it. self.__ocsp_server = OCSPServer((host, 0), OCSPHandler) print ('OCSP server started on %s:%d...' % (host, self.__ocsp_server.server_port)) ocsp_state = None if self.options.ocsp == 'ok': ocsp_state = minica.OCSP_STATE_GOOD elif self.options.ocsp == 'revoked': ocsp_state = minica.OCSP_STATE_REVOKED elif self.options.ocsp == 'invalid': ocsp_state = minica.OCSP_STATE_INVALID elif self.options.ocsp == 'unauthorized': ocsp_state = minica.OCSP_STATE_UNAUTHORIZED elif self.options.ocsp == 'unknown': ocsp_state = minica.OCSP_STATE_UNKNOWN else: raise testserver_base.OptionError('unknown OCSP status: ' + self.options.ocsp_status) (pem_cert_and_key, ocsp_der) = minica.GenerateCertKeyAndOCSP( subject = "127.0.0.1", ocsp_url = ("http://%s:%d/ocsp" % (host, self.__ocsp_server.server_port)), ocsp_state = ocsp_state, serial = self.options.cert_serial) if self.options.ocsp_server_unavailable: # SEQUENCE containing ENUMERATED with value 3 (tryLater). self.__ocsp_server.ocsp_response = '30030a0103'.decode('hex') else: self.__ocsp_server.ocsp_response = ocsp_der for ca_cert in self.options.ssl_client_ca: if not os.path.isfile(ca_cert): raise testserver_base.OptionError( 'specified trusted client CA file not found: ' + ca_cert + ' exiting...') stapled_ocsp_response = None if self.options.staple_ocsp_response: stapled_ocsp_response = ocsp_der server = HTTPSServer((host, port), TestPageHandler, pem_cert_and_key, self.options.ssl_client_auth, self.options.ssl_client_ca, self.options.ssl_client_cert_type, self.options.ssl_bulk_cipher, self.options.ssl_key_exchange, self.options.npn_protocols, self.options.record_resume, self.options.tls_intolerant, self.options.tls_intolerance_type, self.options.signed_cert_timestamps_tls_ext.decode( "base64"), self.options.fallback_scsv, stapled_ocsp_response, self.options.alert_after_handshake, self.options.disable_channel_id, self.options.disable_extended_master_secret, self.options.token_binding_params) print 'HTTPS server started on https://%s:%d...' % \ (host, server.server_port) else: server = HTTPServer((host, port), TestPageHandler) print 'HTTP server started on http://%s:%d...' % \ (host, server.server_port) server.data_dir = self.__make_data_dir() server.file_root_url = self.options.file_root_url server_data['port'] = server.server_port elif self.options.server_type == SERVER_WEBSOCKET: # Launch pywebsocket via WebSocketServer. logger = logging.getLogger() logger.addHandler(logging.StreamHandler()) # TODO(toyoshim): Remove following os.chdir. Currently this operation # is required to work correctly. It should be fixed from pywebsocket side. os.chdir(self.__make_data_dir()) websocket_options = WebSocketOptions(host, port, '.') scheme = "ws" if self.options.cert_and_key_file: scheme = "wss" websocket_options.use_tls = True websocket_options.private_key = self.options.cert_and_key_file websocket_options.certificate = self.options.cert_and_key_file if self.options.ssl_client_auth: websocket_options.tls_client_cert_optional = False websocket_options.tls_client_auth = True if len(self.options.ssl_client_ca) != 1: raise testserver_base.OptionError( 'one trusted client CA file should be specified') if not os.path.isfile(self.options.ssl_client_ca[0]): raise testserver_base.OptionError( 'specified trusted client CA file not found: ' + self.options.ssl_client_ca[0] + ' exiting...') websocket_options.tls_client_ca = self.options.ssl_client_ca[0] print 'Trying to start websocket server on %s://%s:%d...' % \ (scheme, websocket_options.server_host, websocket_options.port) server = WebSocketServer(websocket_options) print 'WebSocket server started on %s://%s:%d...' % \ (scheme, host, server.server_port) server_data['port'] = server.server_port websocket_options.use_basic_auth = self.options.ws_basic_auth elif self.options.server_type == SERVER_TCP_ECHO: # Used for generating the key (randomly) that encodes the "echo request" # message. random.seed() server = TCPEchoServer((host, port), TCPEchoHandler) print 'Echo TCP server started on port %d...' % server.server_port server_data['port'] = server.server_port elif self.options.server_type == SERVER_UDP_ECHO: # Used for generating the key (randomly) that encodes the "echo request" # message. random.seed() server = UDPEchoServer((host, port), UDPEchoHandler) print 'Echo UDP server started on port %d...' % server.server_port server_data['port'] = server.server_port elif self.options.server_type == SERVER_BASIC_AUTH_PROXY: server = HTTPServer((host, port), BasicAuthProxyRequestHandler) print 'BasicAuthProxy server started on port %d...' % server.server_port server_data['port'] = server.server_port elif self.options.server_type == SERVER_FTP: my_data_dir = self.__make_data_dir() # Instantiate a dummy authorizer for managing 'virtual' users authorizer = pyftpdlib.ftpserver.DummyAuthorizer() # Define a new user having full r/w permissions authorizer.add_user('chrome', 'chrome', my_data_dir, perm='elradfmw') # Define a read-only anonymous user unless disabled if not self.options.no_anonymous_ftp_user: authorizer.add_anonymous(my_data_dir) # Instantiate FTP handler class ftp_handler = pyftpdlib.ftpserver.FTPHandler ftp_handler.authorizer = authorizer # Define a customized banner (string returned when client connects) ftp_handler.banner = ("pyftpdlib %s based ftpd ready." % pyftpdlib.ftpserver.__ver__) # Instantiate FTP server class and listen to address:port server = pyftpdlib.ftpserver.FTPServer((host, port), ftp_handler) server_data['port'] = server.socket.getsockname()[1] print 'FTP server started on port %d...' % server_data['port'] else: raise testserver_base.OptionError('unknown server type' + self.options.server_type) return server def run_server(self): if self.__ocsp_server: self.__ocsp_server.serve_forever_on_thread() testserver_base.TestServerRunner.run_server(self) if self.__ocsp_server: self.__ocsp_server.stop_serving() def add_options(self): testserver_base.TestServerRunner.add_options(self) self.option_parser.add_option('-f', '--ftp', action='store_const', const=SERVER_FTP, default=SERVER_HTTP, dest='server_type', help='start up an FTP server.') self.option_parser.add_option('--tcp-echo', action='store_const', const=SERVER_TCP_ECHO, default=SERVER_HTTP, dest='server_type', help='start up a tcp echo server.') self.option_parser.add_option('--udp-echo', action='store_const', const=SERVER_UDP_ECHO, default=SERVER_HTTP, dest='server_type', help='start up a udp echo server.') self.option_parser.add_option('--basic-auth-proxy', action='store_const', const=SERVER_BASIC_AUTH_PROXY, default=SERVER_HTTP, dest='server_type', help='start up a proxy server which requires ' 'basic authentication.') self.option_parser.add_option('--websocket', action='store_const', const=SERVER_WEBSOCKET, default=SERVER_HTTP, dest='server_type', help='start up a WebSocket server.') self.option_parser.add_option('--https', action='store_true', dest='https', help='Specify that https ' 'should be used.') self.option_parser.add_option('--cert-and-key-file', dest='cert_and_key_file', help='specify the ' 'path to the file containing the certificate ' 'and private key for the server in PEM ' 'format') self.option_parser.add_option('--ocsp', dest='ocsp', default='ok', help='The type of OCSP response generated ' 'for the automatically generated ' 'certificate. One of [ok,revoked,invalid]') self.option_parser.add_option('--cert-serial', dest='cert_serial', default=0, type=int, help='If non-zero then the generated ' 'certificate will have this serial number') self.option_parser.add_option('--tls-intolerant', dest='tls_intolerant', default='0', type='int', help='If nonzero, certain TLS connections ' 'will be aborted in order to test version ' 'fallback. 1 means all TLS versions will be ' 'aborted. 2 means TLS 1.1 or higher will be ' 'aborted. 3 means TLS 1.2 or higher will be ' 'aborted.') self.option_parser.add_option('--tls-intolerance-type', dest='tls_intolerance_type', default="alert", help='Controls how the server reacts to a ' 'TLS version it is intolerant to. Valid ' 'values are "alert", "close", and "reset".') self.option_parser.add_option('--signed-cert-timestamps-tls-ext', dest='signed_cert_timestamps_tls_ext', default='', help='Base64 encoded SCT list. If set, ' 'server will respond with a ' 'signed_certificate_timestamp TLS extension ' 'whenever the client supports it.') self.option_parser.add_option('--fallback-scsv', dest='fallback_scsv', default=False, const=True, action='store_const', help='If given, TLS_FALLBACK_SCSV support ' 'will be enabled. This causes the server to ' 'reject fallback connections from compatible ' 'clients (e.g. Chrome).') self.option_parser.add_option('--staple-ocsp-response', dest='staple_ocsp_response', default=False, action='store_true', help='If set, server will staple the OCSP ' 'response whenever OCSP is on and the client ' 'supports OCSP stapling.') self.option_parser.add_option('--https-record-resume', dest='record_resume', const=True, default=False, action='store_const', help='Record resumption cache events rather ' 'than resuming as normal. Allows the use of ' 'the /ssl-session-cache request') self.option_parser.add_option('--ssl-client-auth', action='store_true', help='Require SSL client auth on every ' 'connection.') self.option_parser.add_option('--ssl-client-ca', action='append', default=[], help='Specify that the client ' 'certificate request should include the CA ' 'named in the subject of the DER-encoded ' 'certificate contained in the specified ' 'file. This option may appear multiple ' 'times, indicating multiple CA names should ' 'be sent in the request.') self.option_parser.add_option('--ssl-client-cert-type', action='append', default=[], help='Specify that the client ' 'certificate request should include the ' 'specified certificate_type value. This ' 'option may appear multiple times, ' 'indicating multiple values should be send ' 'in the request. Valid values are ' '"rsa_sign", "dss_sign", and "ecdsa_sign". ' 'If omitted, "rsa_sign" will be used.') self.option_parser.add_option('--ssl-bulk-cipher', action='append', help='Specify the bulk encryption ' 'algorithm(s) that will be accepted by the ' 'SSL server. Valid values are "aes128gcm", ' '"aes256", "aes128", "3des", "rc4". If ' 'omitted, all algorithms will be used. This ' 'option may appear multiple times, ' 'indicating multiple algorithms should be ' 'enabled.'); self.option_parser.add_option('--ssl-key-exchange', action='append', help='Specify the key exchange algorithm(s)' 'that will be accepted by the SSL server. ' 'Valid values are "rsa", "dhe_rsa", ' '"ecdhe_rsa". If omitted, all algorithms ' 'will be used. This option may appear ' 'multiple times, indicating multiple ' 'algorithms should be enabled.'); # TODO(davidben): Add ALPN support to tlslite. self.option_parser.add_option('--npn-protocols', action='append', help='Specify the list of protocols sent in' 'an NPN response. The server will not' 'support NPN if the list is empty.') self.option_parser.add_option('--file-root-url', default='/files/', help='Specify a root URL for files served.') # TODO(ricea): Generalize this to support basic auth for HTTP too. self.option_parser.add_option('--ws-basic-auth', action='store_true', dest='ws_basic_auth', help='Enable basic-auth for WebSocket') self.option_parser.add_option('--ocsp-server-unavailable', dest='ocsp_server_unavailable', default=False, action='store_true', help='If set, the OCSP server will return ' 'a tryLater status rather than the actual ' 'OCSP response.') self.option_parser.add_option('--alert-after-handshake', dest='alert_after_handshake', default=False, action='store_true', help='If set, the server will send a fatal ' 'alert immediately after the handshake.') self.option_parser.add_option('--no-anonymous-ftp-user', dest='no_anonymous_ftp_user', default=False, action='store_true', help='If set, the FTP server will not create ' 'an anonymous user.') self.option_parser.add_option('--disable-channel-id', action='store_true') self.option_parser.add_option('--disable-extended-master-secret', action='store_true') self.option_parser.add_option('--token-binding-params', action='append', default=[], type='int') if __name__ == '__main__': sys.exit(ServerRunner().main())
{ "content_hash": "a83f00a520f56ef8f0d66245d03c967c", "timestamp": "", "source": "github", "line_count": 2313, "max_line_length": 80, "avg_line_length": 37.13964548205794, "alnum_prop": 0.6169677779847271, "repo_name": "Workday/OpenFrame", "id": "10ade37b9ef9395e99b9b39321015ea43677657e", "size": "86089", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "net/tools/testserver/testserver.py", "mode": "33261", "license": "bsd-3-clause", "language": [], "symlink_target": "" }
package com.sczyh30.todolist; /** * Constants class */ public final class Constants { /** API Route*/ public static final String API_GET = "/todos/:todoId"; public static final String API_LIST_ALL = "/todos"; public static final String API_CREATE= "/todos"; public static final String API_UPDATE = "/todos/:todoId"; public static final String API_DELETE = "/todos/:todoId"; public static final String API_DELETE_ALL = "/todos"; /** Persistence key */ public static final String REDIS_TODO_KEY = "VERT_TODO"; }
{ "content_hash": "deb684498571522fa7d391e2595ab7bc", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 61, "avg_line_length": 29.05263157894737, "alnum_prop": 0.6702898550724637, "repo_name": "sczyh30/todo-backend-vert.x", "id": "a4823bbbbca0bc1fce97669f3bbdb44a22dd9ca4", "size": "552", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/main/java/com/sczyh30/todolist/Constants.java", "mode": "33188", "license": "mit", "language": [ { "name": "Java", "bytes": "15739" } ], "symlink_target": "" }
class Thread { public: /// sets thread name for current or specified thread; unicode version static void SetName(LPCWSTR threadName, DWORD threadId = DWORD(-1)) { Thread::SetName(CStringA(threadName), threadId); } /// sets thread name for current or specified thread; ansi version /// \note from http://msdn.microsoft.com/en-us/library/xcb2z8hs.aspx static void SetName(LPCSTR threadName, DWORD threadId = DWORD(-1)); /// returns current thread ID static DWORD CurrentId(); };
{ "content_hash": "3ee4403a9c715c03b4c8ffc030cf0d3f", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 72, "avg_line_length": 32, "alnum_prop": 0.705078125, "repo_name": "vividos/UlibCpp", "id": "47a18033472e28ac324aabc5198162015916f37e", "size": "705", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "src/include/ulib/thread/Thread.hpp", "mode": "33188", "license": "bsd-2-clause", "language": [ { "name": "Batchfile", "bytes": "6845" }, { "name": "C", "bytes": "1203" }, { "name": "C++", "bytes": "413196" } ], "symlink_target": "" }
<html lang="da"> <!-- ** ** Copyright 2006, The Android Open Source Project ** ** 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. */ --> <p> 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ</p> <p> </p> <p> ABCDEFGHIJKLMNOPQRSTUVWXYZ</p> <p> – </p> <p>$1$2$3</p> <p>%1$s understøtter ikke arbejdsprofil</p> <p>%1$s, %2$s, %3$s</p> <p>%1$s, %2$s</p> <p>%1$s. Widget %2$d af %3$d.</p> <p>&lt;Uden titel&gt;</p> <p>(Intet telefonnummer)</p> <p>, </p> <p>, sikker</p> <p>999+</p> <p>?123</p> <p>ABC</p> <p>ÅBN ALLIGEVEL</p> <p>AFINSTALLER</p> <p>AFVIS</p> <p>AIM</p> <p>ALT</p> <p>Åbn appen igen</p> <p>Åbn links med</p> <p>Åbn med %1$s</p> <p>Åbn med</p> <p>Åbn sms-appen for at se beskeden</p> <p>Åbn</p> <p>Åbner dine apps.</p> <p>Accepter</p> <p>Adgangskode</p> <p>Administrationsappen kan ikke bruges. Enheden vil nu blive ryddet. \n\nKontakt din organisations administrator, hvis du har spørgsmål.</p> <p>Administrationsappen til arbejdsprofilen mangler eller er beskadiget. Derfor er din arbejdsprofil og dine relaterede data blevet slettet. Kontakt din administrator for at få hjælp.</p> <p>Administratoren har gjort personlig brug af enheden utilgængelig</p> <p>Administrere skærmforstørrelsen</p> <p>Administrerer, hvordan og hvornår skærmen låses.</p> <p>Advarsel om dataforbrug</p> <p>Af administratoren af din arbejdsprofil</p> <p>Af en ukendt tredjepart</p> <p>Afbryd forbindelsen</p> <p>Afbryderknap</p> <p>Afdeling</p> <p>Afslut handling</p> <p>Afslut pause for app</p> <p>Afslut sessionen</p> <p>Afslut</p> <p>Afslutter systemopdatering…</p> <p>Afspil</p> <p>Afspilning via Bluetooth</p> <p>Afvis</p> <p>Afvisning af uønskede, irriterende opkald</p> <p>Ægtefælle</p> <p>Aktivér dette igen i Systemindstillinger &gt; Apps &gt; Downloadet.</p> <p>Aktivér din arbejdsprofil</p> <p>Aktivér ikke</p> <p>Aktivér mobilselskab</p> <p>Aktivér</p> <p>Aktivere Udforsk ved berøring</p> <p>Aktuel pinkode:</p> <p>Alarmlyde</p> <p>Ældre</p> <p>Aldrig</p> <p>Alle områder</p> <p>Alle sprog</p> <p>Alt+</p> <p>Alt</p> <p>Altid</p> <p>Amt</p> <p>Andet faxnummer</p> <p>Andet</p> <p>Ændret til en SS-anmodning</p> <p>Ændret til en USSD-anmodning</p> <p>Ændring af adgangskode</p> <p>Ændring af tilstand</p> <p>Android starter...</p> <p>Android-app</p> <p>Android-system</p> <p>Android</p> <p>Angiv PUK- og pinkode</p> <p>Angiv PUK-kode</p> <p>Angiv PUK2-koden for at låse op for SIM-kortet.</p> <p>Angiv adgangskode</p> <p>Angiv adgangskoden for at låse op</p> <p>Angiv administratorpinkoden</p> <p>Angiv dato</p> <p>Angiv den korrekte PUK-kode. Gentagne forsøg vil permanent deaktivere SIM-kortet.</p> <p>Angiv den ønskede pinkode</p> <p>Angiv en PUK-kode på 8 eller flere cifre.</p> <p>Angiv en pinkode på mellem 4 og 8 tal.</p> <p>Angiv enhedens globale proxy</p> <p>Angiv et gyldigt klokkeslæt</p> <p>Angiv klokkeslæt</p> <p>Angiv kryptering af lager</p> <p>Angiv pinkode for at låse op</p> <p>Angiv pinkode til SIM-kort</p> <p>Angiv pinkode</p> <p>Angiv regler for adgangskoder</p> <p>Angiv sprog</p> <p>Angiv tidspunkt</p> <p>Angiv udløbsdato for adgangskoden til skærmlås</p> <p>Angiv</p> <p>Anmoder om oplåsning af HRDP-relateret RUIM…</p> <p>Anmoder om oplåsning af ICCID…</p> <p>Anmoder om oplåsning af IMPI…</p> <p>Anmoder om oplåsning af RUIM for Network1…</p> <p>Anmoder om oplåsning af RUIM for Network2…</p> <p>Anmoder om oplåsning af RUIM…</p> <p>Anmoder om oplåsning af SIM-netværket…</p> <p>Anmoder om oplåsning af SIM…</p> <p>Anmoder om oplåsning af SPN…</p> <p>Anmoder om oplåsning af delmængden for SIM-netværket…</p> <p>Anmoder om oplåsning af tjenesteudbyderens EHPLMN…</p> <p>Anmoder om oplåsning af tjenesteudbyderens RUIM…</p> <p>Anmoder om oplåsning af tjenesteudbyderens SIM…</p> <p>Anmoder om oplåsning af tjenesteudbyderens netværksdelmængde…</p> <p>Anmoder om oplåsning af virksomhedens RUIM…</p> <p>Anmoder om oplåsning af virksomhedens SIM…</p> <p>Anmoder om oplåsning med PUK-koden…</p> <p>Anmodning om adgang</p> <p>Anmodningen om oplåsning af HRDP-relateret RUIM mislykkedes.</p> <p>Anmodningen om oplåsning af ICCID mislykkedes.</p> <p>Anmodningen om oplåsning af IMPI mislykkedes.</p> <p>Anmodningen om oplåsning af RUIM for Network1 mislykkedes.</p> <p>Anmodningen om oplåsning af RUIM for Network2 mislykkedes.</p> <p>Anmodningen om oplåsning af RUIM mislykkedes.</p> <p>Anmodningen om oplåsning af SIM mislykkedes.</p> <p>Anmodningen om oplåsning af SIM-netværket mislykkedes.</p> <p>Anmodningen om oplåsning af SPN mislykkedes.</p> <p>Anmodningen om oplåsning af delmængde for SIM-netværket mislykkedes.</p> <p>Anmodningen om oplåsning af tjenesteudbyderens EHPLMN mislykkedes.</p> <p>Anmodningen om oplåsning af tjenesteudbyderens RUIM mislykkedes.</p> <p>Anmodningen om oplåsning af tjenesteudbyderens SIM mislykkedes.</p> <p>Anmodningen om oplåsning af tjenesteudbyderens netværksdelmængde mislykkedes.</p> <p>Anmodningen om oplåsning af virksomhedens RUIM mislykkedes.</p> <p>Anmodningen om oplåsning af virksomhedens SIM mislykkedes.</p> <p>Annuller fortryd</p> <p>Annuller</p> <p>Annulleret</p> <p>Ansigt ikke bekræftet. Hardware ikke tilgængelig.</p> <p>Ansigt</p> <p>Ansigtet er godkendt. Tryk på Bekræft.</p> <p>Ansigtet er godkendt</p> <p>Ansigtet kan ikke genkendes. Prøv igen.</p> <p>Ansigtet kan ikke længere genkendes. Prøv igen.</p> <p>Ansigtshandlingen blev annulleret.</p> <p>Ansigtslås blev annulleret af brugeren.</p> <p>Ansigtslås understøttes ikke på denne enhed.</p> <p>Ansigtslås</p> <p>Appen er ikke tilgængelig</p> <p>Appen er omdirigeret</p> <p>Appen kører</p> <p>Appinfo</p> <p>Apps kan få adgang til din placering</p> <p>Apps, der bruger batteri</p> <p>Appversionen er nedgraderet, eller også er den ikke kompatibel med denne genvej</p> <p>Arbejde</p> <p>Arbejdsfax</p> <p>Arbejdsmobil</p> <p>Arbejdsprofil</p> <p>Arbejdsprofilen blev slettet</p> <p>Arbejdsprofilen er låst</p> <p>Arbejdsprofilen er sat på pause</p> <p>Arkiv</p> <p>Årsdag</p> <p>Assistance</p> <p>Assistent</p> <p>Asynkroniser</p> <p>AutoFyld</p> <p>Autofyld</p> <p>Aviser og blade</p> <p>Baggrund</p> <p>Baggrundsdata er begrænsede</p> <p>Barn</p> <p>Batterisparefunktion blev slået fra</p> <p>Batterisparefunktion er aktiveret for at forlænge batteritiden</p> <p>Batterisparefunktion</p> <p>Batterisparefunktionen gør følgende for at spare på batteriet:\n\n•Aktiverer Mørkt tema\n•Deaktiverer eller begrænser aktivitet i baggrunden, visse visuelle effekter og andre funktioner som f.eks. \"Hey Google\"</p> <p>Bed om adgangskode inden frigørelse</p> <p>Bed om oplåsningsmønster ved deaktivering</p> <p>Bed om pinkode inden frigørelse</p> <p>Begivenhed</p> <p>Behandler opdateringspakken…</p> <p>Behold den på skærmen, mens det fysiske tastatur er aktivt</p> <p>Bekræft den nye pinkode</p> <p>Bekræft den ønskede pinkode</p> <p>Bekræft navigation</p> <p>Bekræft, at det er dig</p> <p>Bekræft</p> <p>Bemærk!</p> <p>Beskadiget</p> <p>Bevar roen, og søg ly i nærheden.</p> <p>Bil</p> <p>Bilkørselsappen er aktiv</p> <p>Billede</p> <p>Billeder</p> <p>Biltilstand</p> <p>Biometrisk hardware er ikke tilgængelig</p> <p>Bliv på denne side</p> <p>Bloker brug af alle kameraer på enheden.</p> <p>Bluetooth forbliver aktiveret i flytilstand</p> <p>Bluetooth-lyd</p> <p>Bror</p> <p>Brug %1$s som startapp</p> <p>Brug denne mulighed for at gribe mindst muligt ind, når enheden ikke reagerer eller er for langsom, eller når du har brug for alle rapportsektioner. Du har ikke mulighed for at angive flere oplysninger eller tage yderligere screenshots.</p> <p>Brug dette workflow under de fleste omstændigheder. Det giver dig mulighed for at se status på rapporten, angive flere oplysninger om problemet og tage screenshots. Nogle mindre brugte sektioner, der tager lang tid at rapportere, udelades muligvis.</p> <p>Brug en anden app</p> <p>Brug genvej</p> <p>Brug som standard til denne handling.</p> <p>Brug</p> <p>Brugernavn (mail)</p> <p>Brugervælger</p> <p>Cast skærm til enhed</p> <p>Cast</p> <p>Celle er tilføjet</p> <p>Chef</p> <p>Cirkulær minutvælger</p> <p>Cirkulær timevælger</p> <p>Ctrl+</p> <p>DEL</p> <p>Data</p> <p>Datagrænsen er overskredet</p> <p>Datasparefunktionen forhindrer nogle apps i at sende eller modtage data i baggrunden for at reducere dataforbruget. En app, der er i brug, kan få adgang til data, men gør det måske ikke så ofte. Dette kan f.eks. betyde, at billeder ikke vises, før du trykker på dem.</p> <p>De elementer, der trykkes på, læses højt, og skærmen kan udforskes ved hjælp af bevægelser.</p> <p>De indtastede pinkoder er ikke ens</p> <p>Deaktiver genvej</p> <p>Deaktiver kameraer</p> <p>Deaktiver</p> <p>Del med %1$s</p> <p>Del med</p> <p>Del</p> <p>Deler fejlrapport…</p> <p>Delmængden for SIM-netværket blev låst op.</p> <p>Demo til udstilling i butik</p> <p>Demonter mediet, inden du fjerner det, så du ikke mister dit indhold</p> <p>Den anden enhed har skiftet til FULD TTY-tilstand</p> <p>Den anden enhed har skiftet til TTY-tilstanden HCO</p> <p>Den anden enhed har skiftet til TTY-tilstanden VCO</p> <p>Den anden enhed har slået TTY-tilstanden FRA</p> <p>Den gamle pinkode, som du har indtastet, er ikke korrekt.</p> <p>Den indtastede PUK-kode er forkert.</p> <p>Den kan læse alt indhold på skærmen og vise indhold oven på andre apps.</p> <p>Den kan spore dine interaktioner med en app eller en hardwaresensor og interagere med apps på dine vegne.</p> <p>Den ønskede fil blev ikke fundet.</p> <p>Den tilsluttede enhed er ikke kompatibel med denne telefon. Tryk for at få flere oplysninger.</p> <p>Den tilsluttede enhed oplades via USB</p> <p>Den tilsluttede enhed oplades. Tryk for at få flere valgmuligheder.</p> <p>Denne app er lavet til en ældre version af Android og fungerer muligvis ikke korrekt. Prøv at søge efter opdateringer, eller kontakt udvikleren.</p> <p>Denne app har ikke fået tilladelse til at optage, men optager muligvis lyd via denne USB-enhed.</p> <p>Denne app kan bruge data i baggrunden. Dette kan øge dataforbruget.</p> <p>Denne app kan finde din nøjagtige placering via placeringstjenester, når appen er i brug. Placeringstjenester skal være aktiveret på din enhed, før appen kan finde din placering. Dette kan øge batteriforbruget.</p> <p>Denne app kan finde din omtrentlige placering via placeringstjenester, når appen er i brug. Placeringstjenester skal være aktiveret på din enhed, før appen kan finde din placering.</p> <p>Denne app kan genkende din fysiske aktivitet.</p> <p>Denne app kan køre i baggrunden. Dette kan dræne batteriet hurtigere.</p> <p>Denne app kan læse alle kalenderbegivenheder, der er gemt på din Android TV-enhed, og dele eller gemme dine kalenderdata.</p> <p>Denne app kan læse alle kalenderbegivenheder, der er gemt på din tablet, og dele eller gemme dine kalenderdata.</p> <p>Denne app kan læse alle kalenderbegivenheder, der er gemt på din telefon, og dele eller gemme dine kalenderdata.</p> <p>Denne app kan læse alle sms-beskeder, der er gemt på din Android TV-enhed.</p> <p>Denne app kan læse alle sms-beskeder, der er gemt på din tablet.</p> <p>Denne app kan læse alle sms-beskeder, der er gemt på din telefon.</p> <p>Denne app kan læse din opkaldshistorik.</p> <p>Denne app kan modtage tilbagekald, når en kameraenhed åbnes (via appen) eller lukkes.</p> <p>Denne app kan til enhver tid få adgang til din placering, selv når den ikke er i brug.</p> <p>Denne app kan til enhver tid optage lyd via mikrofonen.</p> <p>Denne app kan tilføje, fjerne eller ændre kalenderbegivenheder på din Android TV-enhed. Denne app kan sende meddelelser, der lader til at stamme fra kalenderejere, eller ændre begivenheder uden at give ejeren besked.</p> <p>Denne app kan tilføje, fjerne eller ændre kalenderbegivenheder på din tablet. Denne app kan sende meddelelser, der kan se ud, som om de kommer fra kalenderejere, eller ændre begivenheder uden at give ejeren besked.</p> <p>Denne app kan tilføje, fjerne eller ændre kalenderbegivenheder på din telefon. Denne app kan sende meddelelser, der kan se ud, som om de kommer fra kalenderejere, eller ændre begivenheder uden at give ejeren besked.</p> <p>Denne app kan vises oven på andre apps eller andre dele af skærmen. Dette kan forstyrre den normale brug af appen og ændre visningen af andre apps.</p> <p>Denne app kan vises oven på andre apps</p> <p>Denne enhed har ingen fingeraftrykslæser.</p> <p>Denne privilegerede app eller systemapp kan til enhver tid tage billeder og optage video med et systemkamera. Appen skal også have tilladelsen android.permission.CAMERA</p> <p>Denne tablet opdaterer…</p> <p>Denne tablet starter…</p> <p>Denne video kan ikke streames på denne enhed.</p> <p>Der afspilles ikke lyd ved opkald og notifikationer</p> <p>Der behandles for mange anmodninger. Prøv igen senere.</p> <p>Der blev ikke fundet nogen applikation, der kan håndtere denne handling</p> <p>Der blev ikke fundet nogen applikation, som kan vise denne kontakt.</p> <p>Der blev ikke fundet nogen matchende aktiviteter.</p> <p>Der blev ikke fundet nogen pakke, som leverer handlingen FACTORY_TEST.</p> <p>Der blev ikke registreret ansigtsdata. Prøv igen.</p> <p>Der blev låst op med PUK-koden.</p> <p>Der blev registreret et analogt lydtilbehør</p> <p>Der blev registreret et delvist fingeraftryk. Prøv igen.</p> <p>Der er anmodet om tilladelse</p> <p>Der er et internt problem med enheden, og den vil muligvis være ustabil, indtil du gendanner fabriksdataene.</p> <p>Der er et internt problem med enheden. Kontakt producenten for at få yderligere oplysninger.</p> <p>Der er for lyst. Prøv en mere dæmpet belysning.</p> <p>Der er for meget bevægelse. Hold telefonen stille.</p> <p>Der er ikke adgang til den private DNS-server</p> <p>Der er ikke angivet pinkode, mønster eller adgangskode</p> <p>Der er ikke mere lagerplads på din Android TV-enhed. Slet nogle filer for at frigøre plads.</p> <p>Der er ikke noget SIM-kort i tabletcomputeren.</p> <p>Der er ikke noget SIM-kort i telefonen.</p> <p>Der er ikke nok ledig lagerplads til systemet. Sørg for, at du har 250 MB ledig plads, og genstart.</p> <p>Der er ikke registreret nogen fingeraftryk.</p> <p>Der er indsamlet en heap dump. Tryk for at dele.</p> <p>Der er ingen anbefalede brugere at dele med</p> <p>Der er ingen apps, der kan foretage denne handling.</p> <p>Der er ingen forbindelse til mobilnetværket</p> <p>Der er ingen matches</p> <p>Der er ingen seneste apps.</p> <p>Der er intet SIM-kort i din Android TV-enhed.</p> <p>Der er oprettet forbindelse til trådløs fejlretning</p> <p>Der er registreret en skadelig app</p> <p>Der er snart ikke mere lagerplads</p> <p>Der er taget et screenshot af fejlrapporten</p> <p>Der indsamles oplysninger om din enheds aktuelle status, der efterfølgende sendes i en mail. Der går lidt tid, fra fejlrapporten påbegyndes, til den er klar til at blive sendt. Tak for tålmodigheden.</p> <p>Der kan ikke gemmes nye ansigtsdata. Slet et gammelt først.</p> <p>Der kræves ingen tilladelser</p> <p>Der kunne ikke fås adgang til filen.</p> <p>Der kunne ikke godkendes.</p> <p>Der kunne ikke kommunikeres med serveren. Prøv igen senere.</p> <p>Der kunne ikke kopieres til udklipsholderen</p> <p>Der kunne ikke låses op med PUK-koden.</p> <p>Der kunne ikke oprettes en sikker forbindelse.</p> <p>Der kunne ikke oprettes forbindelse til konstant VPN</p> <p>Der kunne ikke oprettes forbindelse til serveren.</p> <p>Der kunne ikke tages et screenshot af fejlrapporten</p> <p>Der opstod en netværksfejl.</p> <p>Der opstod timeout for forbindelsen til serveren.</p> <p>Det er ikke muligt at ændre indstillingerne for viderestilling af opkald fra din telefon, mens du bruger roaming.</p> <p>Det er ikke muligt at foretage nødopkald via Wi‑Fi</p> <p>Det er ikke muligt at foretage nødopkald</p> <p>Det er ikke muligt at synkronisere</p> <p>Det maksimale antal forsøg på at bruge Ansigtslås er overskredet</p> <p>Det minder for meget om et andet. Skift stilling.</p> <p>Det mobile netværk er utilgængeligt, indtil du genstarter med et gyldigt SIM-kort.</p> <p>Dette "<b>"kan medføre gebyrer"</b>" på din mobilkonto.</p> <p>Dette certifikat er gyldigt.</p> <p>Dette er en administreret enhed</p> <p>Dette er vigtigt på grund af de personer, det handler om.</p> <p>Dette giver indehaveren mulighed for at knytte sig til det øverste grænsefladeniveau for et mobilselskabs beskedtjeneste. Dette bør ikke være nødvendigt i normale apps.</p> <p>Dette indhold kan ikke åbnes af arbejdsapps</p> <p>Dette indhold kan ikke åbnes af personlige apps</p> <p>Dette indhold understøttes ikke af arbejdsapps</p> <p>Dette indhold understøttes ikke af personlige apps</p> <p>Dette omfatter personlige data såsom kreditkortnumre og adgangskoder.</p> <p>Dialogboks om strøm</p> <p>Din Android TV-enhed slukkes.</p> <p>Din administrator har anmodet om en fejlrapport for bedre at kunne finde og rette fejlen på enheden. Apps og data deles muligvis.</p> <p>Din administrator har ikke givet tilladelse til at foretage denne ændring</p> <p>Din arbejdsprofil er ikke længere tilgængelig på denne enhed</p> <p>Din enheds producent fik adgang til din placering i løbet af en nødsituation for nylig</p> <p>Din it-administrator har ikke givet dig tilladelse til at åbne dette indhold med apps fra din arbejdsprofil</p> <p>Din it-administrator har ikke givet dig tilladelse til at åbne dette indhold med apps fra din personlige profil</p> <p>Din it-administrator har ikke givet dig tilladelse til at dele dette indhold med apps fra din arbejdsprofil</p> <p>Din it-administrator har ikke givet dig tilladelse til at dele dette indhold med apps fra din personlige profil</p> <p>Din organisation administrerer denne enhed og kan overvåge netværkstrafik. Tryk for at se info.</p> <p>Din placering i nødstilfælde er tilgået</p> <p>Din tablet slukkes nu.</p> <p>Din tablets lager er fuldt. Slet nogle filer for at frigøre plads.</p> <p>Din telefon slukkes nu.</p> <p>Dine apps har haft et højere forbrug af mobildata end normalt</p> <p>Dine arbejdsapps, notifikationer, data og andre funktioner på din arbejdsprofil aktiveres</p> <p>Dine personlige apps er blokeret, indtil du aktiverer din arbejdsprofil</p> <p>Distrikt</p> <p>Dit SIM-kort er blevet permanent deaktiveret.\nKontakt din tjenesteudbyder for at få et nyt SIM-kort.</p> <p>Dit SIM-kort er låst med PUK-koden. Angiv PUK-koden for at låse den op.</p> <p>Dit forbrug af mobildata er sat på pause i resten af din cyklus</p> <p>Dit mobilselskab fik adgang til din placering i løbet af en nødsituation for nylig</p> <p>Dit ur lukkes ned.</p> <p>Dockstationens højttalere</p> <p>Dokument</p> <p>Download app</p> <p>Download mobilselskabsappen for at aktivere dit nye SIM-kort</p> <p>Du angiver, hvor vigtige disse notifikationer er.</p> <p>Du bevægede fingeren for hurtigt. Prøv igen.</p> <p>Du bevægede fingeren for langsomt. Prøv igen.</p> <p>Du bruger denne app i din arbejdsprofil</p> <p>Du bruger denne app uden for din arbejdsprofil</p> <p>Du har brugt for mange forsøg. Ansigtslås er deaktiveret.</p> <p>Du har brugt for mange forsøg. Fingeraftrykslæseren er deaktiveret.</p> <p>Du har ikke konfigureret ansigtslås.</p> <p>Du har ikke tilladelse til at åbne denne side.</p> <p>Du har nye beskeder</p> <p>Du har prøvet for mange gange. Prøv igen senere.</p> <p>Du kan altid ændre dette i Indstillinger &gt; Apps</p> <p>Du kan forbedre ydeevnen ved kun at åbne ét af disse spil ad gangen.</p> <p>Du kan ikke ændre indstillingen for opkalds-id\'et.</p> <p>Du kan kun foretage handlinger med dine numre til begrænset opkald.</p> <p>Du kan skifte mellem funktioner ved at holde knappen Hjælpefunktioner nede.</p> <p>Du kan skifte mellem funktioner ved at stryge opad med to fingre og holde dem nede.</p> <p>Du kan skifte mellem funktioner ved at stryge opad med tre fingre og holde dem nede.</p> <p>Du skal ikke dreje hovedet så meget.</p> <p>Du skal muligvis formatere enheden igen. Tryk for at skubbe den ud.</p> <p>Du skal muligvis formatere enheden igen</p> <p>Effektiviteten er påvirket. Deaktiver via bootloaderen.</p> <p>Ejer</p> <p>Emirat</p> <p>Enheden har tilstrækkeligt batteri. Funktionerne er ikke længere begrænsede.</p> <p>Enheden løber muligvis tør for batteri, inden du normalt oplader den</p> <p>Enheden opdaterer…</p> <p>Enheden oplades via USB</p> <p>Enheden slettes</p> <p>Enheden starter…</p> <p>Erstat...</p> <p>FAX</p> <p>FRA</p> <p>Få flere oplysninger</p> <p>Fabrikstest mislykkedes</p> <p>Fællesnavn:</p> <p>Familie</p> <p>Far</p> <p>Fastgør</p> <p>Fejl ved skrivning af indhold</p> <p>Fejl</p> <p>Fejlrapport</p> <p>Fil</p> <p>Filer og medier</p> <p>Film og video</p> <p>Filoverførsel via USB er slået til</p> <p>Find forrige</p> <p>Find næste</p> <p>Find på siden</p> <p>Find</p> <p>Fingeraftryk:</p> <p>Fingeraftrykket blev godkendt</p> <p>Fingeraftrykket kan ikke gemmes. Fjern et eksisterende fingeraftryk.</p> <p>Fingeraftrykket kunne ikke behandles. Prøv igen.</p> <p>Fingeraftryksbevægelser</p> <p>Fingeraftrykshandlingen blev annulleret af brugeren.</p> <p>Fingeraftrykshandlingen blev annulleret.</p> <p>Fingeraftrykslæseren er beskidt. Tør den af, og prøv igen.</p> <p>Firma (hovednr.)</p> <p>Fjern ikke</p> <p>Fjern</p> <p>Fjernet på usikker vis</p> <p>Fjernet</p> <p>Flere valgmuligheder</p> <p>Flyt telefonen længere væk.</p> <p>Flyt telefonen tættere på.</p> <p>Flyt telefonen til højre.</p> <p>Flyt telefonen til venstre.</p> <p>Flytilstand er TIL</p> <p>Flytilstand er slået FRA</p> <p>Flytilstand</p> <p>Flytter data</p> <p>Fn+</p> <p>Fødselsdato</p> <p>Føj til ordbog</p> <p>Følgende app eller apps anmoder om at få adgang til din konto nu og fremover.</p> <p>Før for 1 måned siden</p> <p>For mange forsøg på at tegne mønstret korrekt</p> <p>For mange mislykkede adgangskodeforsøg</p> <p>For mørkt. Prøv med mere belysning.</p> <p>Forælder</p> <p>Forbereder opdatering…</p> <p>Forbindelsen til konstant VPN blev afbrudt</p> <p>Forbindelsesproblemer eller ugyldig funktionskode.</p> <p>Forbindelsesproblemer eller ugyldigt MMI-nummer.</p> <p>Foreslået</p> <p>Foretrukne oplysninger vedrørende NFC-betalingstjeneste</p> <p>Forhindrer brug af visse skærmlåsfunktioner.</p> <p>Forkert adgangskode.</p> <p>Forkert adgangskode</p> <p>Forkert mønster</p> <p>Forkert pinkode.</p> <p>Forkert pinkode</p> <p>Forkert</p> <p>Forlad denne side</p> <p>Forlad omgående kyst- og flodområder, og søg mod et mere sikkert sted, f.eks. et højere terræn.</p> <p>Formaterer…</p> <p>Forøg minuttal</p> <p>Forøg timetal</p> <p>Forrige måned</p> <p>Forrige nummer</p> <p>Forrige</p> <p>Forstørrelse</p> <p>Forstyr ikke</p> <p>Fortryd sletningerne</p> <p>Fortryd</p> <p>Fortsæt</p> <p>Fra</p> <p>Frigør</p> <p>Fritag appen fra begrænsninger ift. optagelse af lyd.</p> <p>Fuld kontrol er velegnet til apps, der hjælper dig med hjælpefunktioner, men ikke de fleste apps.</p> <p>Fuld rapport</p> <p>Funktionskoden er komplet.</p> <p>Fysisk aktivitet</p> <p>Fysisk tastatur</p> <p>GB</p> <p>Gå</p> <p>Gem i AutoFyld</p> <p>Gem</p> <p>Gendan fabriksindstillingerne for at deaktivere tilstanden Testsele.</p> <p>Gendannelse af fabriksdata</p> <p>Gennemfør handling ved hjælp af %1$s</p> <p>Gennemfører start.</p> <p>Genstart din enhed for at få adgang til mobilnetværket.</p> <p>Genstart i sikker tilstand</p> <p>Genstart</p> <p>Genstarter…</p> <p>Genvej til hjælpefunktioner på skærmen</p> <p>Genvej til hjælpefunktioner</p> <p>Genvejen er deaktiveret</p> <p>Genvejen kunne ikke gendannes på grund af uoverensstemmelse i appsignatur</p> <p>Genvejen kunne ikke gendannes, da appen ikke understøtter backup og gendannelse</p> <p>Genvejen kunne ikke gendannes</p> <p>Giv adgang</p> <p>Giv en app eller tjeneste adgang til systemkameraer for at tage billeder og optage video</p> <p>Giver appen adgang til data fra sensorer, der overvåger din fysiske tilstand, f.eks. din puls.</p> <p>Giver appen tilladelse til at besvare et indgående opkald.</p> <p>Giver appen tilladelse til at kende skærmlåsens kompleksitet (høj, medium, lav eller ingen), hvilket kan afsløre oplysninger om skærmlåsens længde og type. Appen kan også foreslå brugerne at opdatere deres skærmlås til et bestemt niveau, men brugerne kan frit ignorere det og gå videre. Bemærk! Skærmlåsen gemmes ikke som almindelig tekst, så appen kender ikke den nøjagtige adgangskode.</p> <p>Giver appen tilladelse til at læse og redigere konfigurationen af Forstyr ikke.</p> <p>Glemt mønster</p> <p>Glid hurtigt henover for at låse op.</p> <p>Glid op for at øge og ned for at mindske.</p> <p>Glidende håndtag. Tryk og hold nede.</p> <p>Godkendelse via proxyserveren mislykkedes.</p> <p>Godkendelsen blev annulleret</p> <p>Gør det muligt for en app at bede om tilladelse til at ignorere batterioptimeringer for den pågældende app.</p> <p>Gør ikke noget lige nu.</p> <p>Grænsen for Wi-Fi-data er nået</p> <p>Grænsen for mobildata er nået</p> <p>Grænsen for sletning er overskredet</p> <p>Gruppesamtale</p> <p>Gyldighed:</p> <p>HDMI-skærm</p> <p>HDMI</p> <p>HRDP-relateret RUIM blev låst op.</p> <p>Handlingen FACTORY_TEST understøttes kun af pakker installeret i /system/app.</p> <p>Hangouts</p> <p>Har du glemt dit brugernavn eller din adgangskode?\nBesøg "<b>"google.com/accounts/recovery"</b>".</p> <p>Har du glemt dit brugernavn eller din adgangskode?\nGå til "<b>"google.com/accounts/recovery"</b>".</p> <p>Har du glemt mønstret?</p> <p>Hardwaren til fingeraftryk er ikke tilgængelig.</p> <p>Hente indholdet i vinduet</p> <p>Henvist af</p> <p>Hjælpefunktioner</p> <p>Hjem</p> <p>Hjemmefax</p> <p>Højere</p> <p>Højt forbrug af mobildata</p> <p>Hovednr.</p> <p>Hovedtelefoner</p> <p>Husk mit valg</p> <p>Husk</p> <p>Hverdagsaften</p> <p>Hvis noget skjuler dit ansigt, skal du fjerne det.</p> <p>I brug</p> <p>ICCID blev låst op.</p> <p>ICQ</p> <p>IMEI-nummer</p> <p>IMPI blev låst op.</p> <p>ISDN</p> <p>Id for opkaldsmodtager er skjult</p> <p>Id for opkaldsmodtager</p> <p>Ignorer, indtil enheden genstarter</p> <p>Ikke genkendt</p> <p>Ikke i bygningen</p> <p>Ikke i kvarteret</p> <p>Ikke isat</p> <p>Ikke nu</p> <p>Ikke tilgængelig</p> <p>Ikon for fingeraftryk</p> <p>Indbygget skærm</p> <p>Indgående opkalds-id</p> <p>Indhold kan ikke udfyldes automatisk</p> <p>Indholdet kan ikke åbnes med arbejdsapps</p> <p>Indholdet kan ikke åbnes med personlige apps</p> <p>Indholdet kan ikke deles med arbejdsapps</p> <p>Indholdet kan ikke deles med personlige apps</p> <p>Indholdet kunne ikke flyttes</p> <p>Indlæser</p> <p>Indlæser…</p> <p>Indsæt enheden igen</p> <p>Indsæt et SIM-kort.</p> <p>Indsæt som almindelig tekst</p> <p>Indsæt tegn</p> <p>Indsæt</p> <p>Indsend forespørgslen</p> <p>Indstil den globale proxy for enheden, der skal bruges, mens politikken er aktiveret. Det er kun enhedens ejer, der kan indstille den globale proxy.</p> <p>Indstil e.m.</p> <p>Indstil f.m.</p> <p>Indstillinger for telefon</p> <p>Indstillinger</p> <p>Indtil du deaktiverer</p> <p>Indtil du slår \"Forstyr ikke\" fra</p> <p>Ingen dækning</p> <p>Ingen fil er valgt</p> <p>Ingen forslag fra autofyld</p> <p>Ingen mobildatatjeneste</p> <p>Ingen taletjeneste eller nødopkald</p> <p>Ingen taletjeneste</p> <p>Ingen</p> <p>Inputmetode</p> <p>Installeret af din administrator</p> <p>Interaktiv rapport</p> <p>Intern delt lagerplads</p> <p>Intet SIM-kort</p> <p>Ja</p> <p>Jabber</p> <p>JavaScript</p> <p>Kalender</p> <p>Kamera</p> <p>Kan registrere bevægelser, der foretages på enhedens fingeraftrykslæser.</p> <p>Kan tage et screenshot af skærmen.</p> <p>Kan trykke, stryge, knibe sammen og udføre andre bevægelser.</p> <p>Kig mere direkte på din enhed.</p> <p>Klar</p> <p>Klip</p> <p>Konfigurer Autofyld</p> <p>Konfigurer fysisk tastatur</p> <p>Konfigurer</p> <p>Konstant VPN er forbundet</p> <p>Kontakt din it-administrator for at få flere oplysninger</p> <p>Kontakter</p> <p>Kontoen kontrolleres…</p> <p>Kontostatus</p> <p>Kontrollerer...</p> <p>Kontrollerer…</p> <p>Kopier webadresse</p> <p>Kopiér</p> <p>Kopieret</p> <p>Korriger farve</p> <p>Kort og navigation</p> <p>Kræver, at gemte appdata krypteres.</p> <p>Kropssensorer</p> <p>Kun Wi-Fi</p> <p>Kun én gang</p> <p>Kun nødopkald</p> <p>Kvikmenu</p> <p>Lageret optimeres.</p> <p>Lagerplads på enheden</p> <p>Landeregistrering</p> <p>Læs kalenderbegivenheder og -info</p> <p>Lås op for at se alle funktioner og data</p> <p>Lås op med adgangskode.</p> <p>Lås op med ansigt.</p> <p>Lås op med mønster.</p> <p>Lås op med pinkode.</p> <p>Lås op ved at logge ind med din Google-konto.</p> <p>Lås op ved at stryge.</p> <p>Lås op ved hjælp af PUK-koden til SIM-kortet.</p> <p>Lås op ved hjælp af pinkoden til SIM-kortet.</p> <p>Lås op</p> <p>Låse skærmen</p> <p>Låser SIM-kortet op ...</p> <p>Låseskærm</p> <p>Lavere</p> <p>Levering af nummervisning</p> <p>Liste over apps</p> <p>Løft telefonen højere op.</p> <p>Log ind på Wi-Fi-netværk</p> <p>Log ind på netværk</p> <p>Log ind</p> <p>Luk app</p> <p>Luk overløb</p> <p>Luk</p> <p>Lukker ned...</p> <p>Lukning</p> <p>Lyd slået fra</p> <p>Lyd slået til</p> <p>Lyd</p> <p>Lyden er TIL</p> <p>Lyden er slået FRA</p> <p>Lydløs ringetone er angivet</p> <p>Lydløs</p> <p>Lydstyrke for Bluetooth under opkald</p> <p>Lydstyrke for alarm</p> <p>Lydstyrke for bluetooth</p> <p>Lydstyrke for medier</p> <p>Lydstyrke for notifikationer</p> <p>Lydstyrke for opkald</p> <p>Lydstyrke for ringetone</p> <p>Lydstyrke</p> <p>MB</p> <p>MEID</p> <p>MIDI via USB er slået til</p> <p>MMI-nummer fuldført.</p> <p>MSISDN1</p> <p>Maksimér</p> <p>Mappe</p> <p>Markér alt</p> <p>Markér tekst</p> <p>Med denne app kan du tage billeder og optage video med kameraet når som helst.</p> <p>Mediestyring</p> <p>Menu+</p> <p>Mere</p> <p>Meta+</p> <p>Middag</p> <p>Midlertidigt deaktiveret af dit mobilselskab</p> <p>Midnat</p> <p>Mig</p> <p>Mikrofon</p> <p>Mislykkedes. Aktivér SIM-/RUIM-lås.</p> <p>Mobil</p> <p>Mobilnetværket har ingen internetadgang</p> <p>Mønster er begyndt</p> <p>Mønster er fuldført</p> <p>Mønster er ryddet</p> <p>Mønsterområde.</p> <p>Mor</p> <p>Musik og lyd</p> <p>Når genvejen er aktiveret, kan du starte en hjælpefunktion ved at trykke på begge lydstyrkeknapper i tre sekunder.</p> <p>Næste måned</p> <p>Næste nummer</p> <p>Næste</p> <p>Naviger hjem</p> <p>Naviger op</p> <p>Nedetid</p> <p>Nej tak</p> <p>Nej</p> <p>NetMeeting</p> <p>Netdeling via USB er slået til</p> <p>Netværket er låst</p> <p>Netværket har ingen internetadgang</p> <p>Netværksstatus</p> <p>Netværksunderretninger</p> <p>Nødnummer</p> <p>Nødsituation</p> <p>Nødtilbagekaldstilstand</p> <p>Nogle funktioner er begrænsede</p> <p>Nogle funktioner virker muligvis ikke som de skal. Indsæt en ny lagerenhed.</p> <p>Nogle systemfunktioner virker måske ikke</p> <p>Notifikation med oplysninger om rutinetilstand</p> <p>Notifikationer</p> <p>Notifikationslyde</p> <p>Notifikationslytter</p> <p>Nulstil</p> <p>Nulstiller enheden…</p> <p>Ny notifikation</p> <p>Ny pinkode</p> <p>Nyhed! Forstyr ikke skjuler notifikationer</p> <p>Nyt SIM-kort er indsat</p> <p>Ø</p> <p>OK, det er forstået</p> <p>OK</p> <p>Observere tekst, du skriver</p> <p>Ombytning af farver</p> <p>Område</p> <p>Områdeindstilling</p> <p>Omrokering af widgets er afsluttet.</p> <p>Omrokering af widgets er påbegyndt.</p> <p>Ønsker du, at browseren skal huske denne adgangskode?</p> <p>Opdater</p> <p>Opdateret af din administrator</p> <p>Opdatering af Android-systemet</p> <p>Opdateringer</p> <p>Opkaldslister</p> <p>Opkaldsnummeret er begrænset</p> <p>Opkaldsnummeret er til stede</p> <p>Opkaldsspærring</p> <p>Oplåsning af konto</p> <p>Oplåsningsområdet er skjult.</p> <p>Oplåsningsområdet er udvidet.</p> <p>Opret en pinkode til ændring af begrænsninger</p> <p>Opret forbindelse til enheden</p> <p>Opretter fejlrapport…</p> <p>Opretter forbindelse til konstant VPN…</p> <p>Opretter forbindelse...</p> <p>Ordningen for webstedsgodkendelse understøttes ikke.</p> <p>Organisation:</p> <p>Organisatorisk enhed:</p> <p>Overførslen af indhold er udført</p> <p>Overvåg antallet af forkert indtastede adgangskoder, når du låser skærmen op, og lås din tablet, eller slet alle data i den, hvis der er indtastet for mange forkerte adgangskoder.</p> <p>Overvåg antallet af forkerte adgangskoder ved oplåsning af skærmen, og lås telefonen eller slet alle data på telefonen, hvis der er indtastet for mange forkerte adgangskoder.</p> <p>Overvåg forsøg på oplåsning af skærm</p> <p>PAD</p> <p>PTP via USB er slået til</p> <p>PUK-kode</p> <p>PUK-koden skal være på 8 tal.</p> <p>Pakke</p> <p>Partner</p> <p>Pause</p> <p>Pb</p> <p>Personlig</p> <p>Personsøger (job)</p> <p>Personsøger</p> <p>Pinkode til oplåsning af HRDP-relateret RUIM</p> <p>Pinkode til oplåsning af ICCID</p> <p>Pinkode til oplåsning af IMPI</p> <p>Pinkode til oplåsning af RUIM for Network1</p> <p>Pinkode til oplåsning af RUIM for Network2</p> <p>Pinkode til oplåsning af RUIM</p> <p>Pinkode til oplåsning af SIM-netværket</p> <p>Pinkode til oplåsning af SIM</p> <p>Pinkode til oplåsning af SPN</p> <p>Pinkode til oplåsning af delmængde for SIM-netværket</p> <p>Pinkode til oplåsning af tjenesteudbyderens EHPLMN</p> <p>Pinkode til oplåsning af tjenesteudbyderens RUIM</p> <p>Pinkode til oplåsning af tjenesteudbyderens SIM</p> <p>Pinkode til oplåsning af tjenesteudbyderens netværksdelmængde</p> <p>Pinkode til oplåsning af virksomhedens RUIM</p> <p>Pinkode til oplåsning af virksomhedens SIM</p> <p>Pinkoden er for kort. Den skal være på mindst 4 tal.</p> <p>Pinkoderne stemmer ikke overens. Prøv igen.</p> <p>Pinkoderne stemmer ikke overens</p> <p>Placering</p> <p>Placeringsanmodning</p> <p>Placeringstjeneste</p> <p>Pop op-vindue</p> <p>Postnummer</p> <p>Præfektur</p> <p>Præsentation</p> <p>Produktivitet</p> <p>Protokollen understøttes ikke.</p> <p>Prøv ansigtslås igen.</p> <p>Prøv at flytte indholdet igen</p> <p>Prøv at skifte dit foretrukne netværk. Tryk for skifte.</p> <p>Prøv igen senere</p> <p>Prøv igen.</p> <p>Prøv igen</p> <p>Provins</p> <p>QQ</p> <p>RUIM blev låst op.</p> <p>RUIM for Network1 blev låst op.</p> <p>RUIM for Network2 blev låst op.</p> <p>Radio</p> <p>Rapportér</p> <p>Rediger genveje</p> <p>Rediger med %1$s</p> <p>Rediger med</p> <p>Rediger, hvor ofte skærmlåsens adgangskode, pinkode eller adgangsmønster skal skiftes.</p> <p>Rediger</p> <p>Registrer antallet af forkerte adgangskoder, der angives ved oplåsning af skærmen, og lås din Android TV-enhed, eller ryd alle brugerens data, hvis adgangskoden angives forkert for mange gange.</p> <p>Registrer antallet af forkerte adgangskoder, der angives ved oplåsning af skærmen, og lås din Android TV-enhed, eller ryd alle dataene på din Android TV-enhed, hvis adgangskoden angives forkert for mange gange.</p> <p>Registrer antallet af forkerte adgangskoder, der angives ved oplåsning af skærmen, og lås din tablet, eller slet alle brugerens data, hvis adgangskoden tastes forkert for mange gange.</p> <p>Registrer antallet af forkerte adgangskoder, der angives ved oplåsning af skærmen, og lås telefonen, eller slet alle brugerens data, hvis adgangskoden tastes forkert for mange gange.</p> <p>Registrer dit ansigt igen for at forbedre genkendelsen af det</p> <p>Registrer dit ansigt igen.</p> <p>Registrer dit ansigt igen</p> <p>Registrering af fingeraftryk fik timeout. Prøv igen.</p> <p>Registreringen er afsluttet.</p> <p>Regneark</p> <p>Rengør toppen af din skærm, inkl. den sorte bjælke</p> <p>Rigtigt!</p> <p>Ring via Wi-Fi</p> <p>Ring via mobilnetværk</p> <p>Ringeren er aktiveret</p> <p>Ringeren er deaktiveret</p> <p>Ringervibrering</p> <p>Ringetoner</p> <p>Roaming – Alliance Partner</p> <p>Roaming – Delvis servicefunktionalitet</p> <p>Roaming – Foretrukket system</p> <p>Roaming – Fuld servicefunktionalitet</p> <p>Roaming – Premium Partner</p> <p>Roaming – Tilgængeligt system</p> <p>Roamingbanner fra</p> <p>Roamingbanner til</p> <p>Roamingindikator blinker</p> <p>Roamingindikator fra</p> <p>Roamingindikator til</p> <p>Ryd dataene på din Android TV-enhed uden at gendanne fabriksdataene.</p> <p>Ryd denne brugers data på denne Android TV-enhed uden varsel.</p> <p>Ryd forespørgslen</p> <p>Ryd standard i Systemindstillinger &gt; Apps &gt; Downloadet.</p> <p>SD-kort</p> <p>SHA-1-fingeraftryk:</p> <p>SHA-256-fingeraftryk:</p> <p>SIM blev låst op.</p> <p>SIM-kort blev fjernet</p> <p>SIM-kort blev tilføjet</p> <p>SIM-kort er ikke provisioneret til tale</p> <p>SIM-kort er ikke tilladt for tale</p> <p>SIM-kort med høj prioritet</p> <p>SIM-kortet er låst med PUK-koden.</p> <p>SIM-kortet er låst.</p> <p>SIM-kortet er nu deaktiveret. Angiv PUK-koden for at fortsætte. Kontakt mobilselskabet for at få flere oplysninger.</p> <p>SIM-kortet låses op…</p> <p>SIM-kortet mangler eller kan ikke læses. Indsæt et SIM-kort.</p> <p>SIM-netværket blev låst op.</p> <p>SIM-status</p> <p>SPN blev låst op.</p> <p>SS-anmodningen blev ændret til en USSD-anmodning</p> <p>SS-anmodningen blev ændret til et almindeligt opkald</p> <p>SS-anmodningen blev ændret til et videoopkald</p> <p>Samlever</p> <p>Samtale</p> <p>Sænk minuttal</p> <p>Sænk telefonen.</p> <p>Sænk timetal</p> <p>Screenshot</p> <p>Se alle</p> <p>Se brugervejledningen, eller kontakt kundeservice.</p> <p>Se og styre skærm</p> <p>Se og udfør handlinger</p> <p>Send feedback</p> <p>Send og se sms-beskeder</p> <p>Send via %1$s</p> <p>Send via</p> <p>Send</p> <p>Sender sms-beskeder</p> <p>Sender...</p> <p>Senere år</p> <p>Senere dag</p> <p>Senere måned</p> <p>Seneste apps</p> <p>Seneste måned</p> <p>Seneste</p> <p>Sensoren er midlertidigt deaktiveret.</p> <p>Seriekonsollen er aktiveret</p> <p>Serienummer:</p> <p>Shift+</p> <p>Shift</p> <p>Siden indeholder for mange serveromdirigeringer.</p> <p>Siden kunne ikke åbnes, fordi webadressen er ugyldig.</p> <p>Siden svarer ikke.\n\nVil du lukke den?</p> <p>Sikker tilstand</p> <p>Sikkerhed</p> <p>Sikkerhedscertifikat</p> <p>Skaler</p> <p>Skærmen er låst.</p> <p>Skærmlås</p> <p>Skift baggrund</p> <p>Skift netværks- eller VPN-indstillinger</p> <p>Skift til arbejdsprofil</p> <p>Skift til personlig profil</p> <p>Skift til teksttilstand for at angive klokkeslæt.</p> <p>Skift til urtilstand for at angive klokkeslæt.</p> <p>Skift udgang</p> <p>Skifte skærmlås</p> <p>Skifter skærmlås.</p> <p>Skjul</p> <p>Skrivebeskyttet</p> <p>Skub ud</p> <p>Skubber ud…</p> <p>Skubbet ud</p> <p>Skype</p> <p>Slå til</p> <p>Slå trådløs fra</p> <p>Slå trådløs til</p> <p>Slå udvidelse til eller fra</p> <p>Slå visse skærmlåsfunktioner fra</p> <p>Slet brugerdata</p> <p>Slet denne brugers data på denne tablet uden varsel.</p> <p>Slet denne brugers data på denne telefon uden varsel.</p> <p>Slet din tablets data uden varsel ved at gendanne fabriksindstillingerne.</p> <p>Slet elementerne</p> <p>Slet</p> <p>Sletningen er fuldført.</p> <p>Slette alle data</p> <p>Sletter delt lagerplads…</p> <p>Sletter telefonens data uden varsel ved at gendanne fabriksindstillingerne.</p> <p>Slettet af din administrator</p> <p>Sluk</p> <p>Sms-beskeder</p> <p>Sms</p> <p>Sociale medier og kommunikation</p> <p>Søg efter opdatering</p> <p>Søg</p> <p>Søgeforespørgsel</p> <p>Søger efter enheder…</p> <p>Søger efter tjeneste</p> <p>Søger...</p> <p>Sogn</p> <p>Søg…</p> <p>Sørg for, at dit ansigt er direkte foran telefonen.</p> <p>Søster</p> <p>Sover</p> <p>Spil</p> <p>Spol frem</p> <p>Spol tilbage</p> <p>Spring over</p> <p>Standarder for opkalds-id til begrænset. Næste opkald: Begrænset</p> <p>Standarder for opkalds-id til begrænset. Næste opkald: Ikke begrænset</p> <p>Standarder for opkalds-id til ikke begrænset. Næste opkald: Begrænset</p> <p>Standarder for opkalds-id til ikke begrænset. Næste opkald: Ikke begrænset</p> <p>Standardringetone</p> <p>Starter demoen…</p> <p>Stat</p> <p>Status for mobildata</p> <p>Status</p> <p>Stemme</p> <p>Stop</p> <p>Stryg ned fra toppen for at afslutte.</p> <p>Strygeområde.</p> <p>Svar</p> <p>Sym+</p> <p>Synkroniser</p> <p>System</p> <p>Systemændringer</p> <p>TIL</p> <p>TTY TDD</p> <p>Tablet</p> <p>Tabletten har tilstrækkeligt batteri. Funktionerne er ikke længere begrænsede.</p> <p>Tag billede med %1$s</p> <p>Tag billede med</p> <p>Tag billede</p> <p>Tag screenshot</p> <p>Taleassistent</p> <p>Talebeskeder</p> <p>Talesøgning</p> <p>Tb</p> <p>Tegn dit mønster</p> <p>Tegn oplåsningsmønster</p> <p>Teksten er kopieret til udklipsholderen.</p> <p>Teksthandlinger</p> <p>Tekstmarkering</p> <p>Telefon er ikke tilladt for tale</p> <p>Telefon</p> <p>Telefonen har tilstrækkeligt batteri. Funktionerne er ikke længere begrænsede.</p> <p>Telefonen opdaterer…</p> <p>Telefonen registrerer ikke længere væske og snavs.</p> <p>Telefonen starter…</p> <p>Telefonen vibrerer ved opkald og notifikationer</p> <p>Telefonens lager er fuldt. Slet nogle filer for at frigøre plads.</p> <p>Telefonmøde</p> <p>Telefonsvarer</p> <p>Telefonvalgmuligheder</p> <p>Telex</p> <p>Test af nødbeskeder</p> <p>Tidligere år</p> <p>Tidligere dag</p> <p>Tidligere måned</p> <p>Til overførsel af billeder og medier</p> <p>Tilbage til opkald</p> <p>Tilbage</p> <p>Tilbagekald</p> <p>Tilføj en konto</p> <p>Tilføj et sprog</p> <p>Tilføj konto</p> <p>Tilføj widget.</p> <p>Tilgængelig</p> <p>Tilgængeligt netværk</p> <p>Tillad aldrig</p> <p>Tillad altid</p> <p>Tillad, at appen anvender tjenester i forgrunden.</p> <p>Tillad, at en app eller tjeneste modtager tilbagekald om kameraenheder, der åbnes eller lukkes.</p> <p>Tillad</p> <p>Tillader appen at dirigere sine opkald gennem systemet for at forbedre opkaldsoplevelsen.</p> <p>Tillader brugeren at forpligte sig til en notifikationslyttertjenestes grænseflade på øverste niveau. Bør aldrig være nødvendigt til almindelige apps.</p> <p>Tillader, at appen administrerer telefonforbindelser.</p> <p>Tillader, at appen ændrer din Android TV-enheds opkaldsliste, bl.a. data om indgående og udgående opkald. Skadelige apps kan bruge dette til at rydde eller ændre din opkaldsliste.</p> <p>Tillader, at appen ændrer din tablets opkaldsliste, f.eks. data om indgående og udgående opkald. Ondsindede apps kan bruge dette til at slette eller ændre din opkaldsliste.</p> <p>Tillader, at appen ændrer kalibreringsparametrene for berøringsskærmen. Dette bør aldrig være nødvendigt for almindelige apps.</p> <p>Tillader, at appen ændrer telefonens opkaldsliste, f.eks. data om indgående og udgående opkald. Ondsindede apps kan bruge dette til at slette eller ændre din opkaldsliste.</p> <p>Tillader, at appen bindes til Cell Broadcast-modulet, så Cell Broadcast-meddelelser kan videresendes, når de modtages. I nogle områder sendes der Cell Broadcast-underretninger for at advare dig om nødsituationer. Ondsindede apps kan forstyrre effektiviteten eller driften af din enhed, når den modtager en Cell Broadcast-meddelelse om en nødsituation.</p> <p>Tillader, at appen bruger den infrarøde sender på din Android TV-enhed.</p> <p>Tillader, at appen bruger hardware til ansigtslås til godkendelse</p> <p>Tillader, at appen bruger tablettens infrarøde sender.</p> <p>Tillader, at appen bruger telefonens infrarøde sender.</p> <p>Tillader, at appen bruger vibration.</p> <p>Tillader, at appen er statusbjælken.</p> <p>Tillader, at appen får adgang til telefonnumrene på denne enhed.</p> <p>Tillader, at appen får foretrukne oplysninger vedrørende NFC-betalingstjeneste, f.eks. registrerede hjælpemidler og rutedestinationer.</p> <p>Tillader, at appen foretager og modtager SIP-opkald.</p> <p>Tillader, at appen fortsætter et opkald, der blev startet i en anden app.</p> <p>Tillader, at appen giver tips til systembaggrundens størrelse.</p> <p>Tillader, at appen gør dele af sig selv vedholdende i hukommelsen. Dette kan begrænse den tilgængelige hukommelse for andre apps, hvilket gør din Android TV-enhed langsommere.</p> <p>Tillader, at appen gør dele af sig selv vedholdende i hukommelsen. Dette kan begrænse den tilgængelige hukommelse for andre apps, hvilket gør tabletten langsommere.</p> <p>Tillader, at appen gør dele af sig selv vedholdende i hukommelsen. Dette kan begrænse den tilgængelige hukommelse for andre apps, hvilket gør telefonen langsommere.</p> <p>Tillader, at appen holder bilens skærm tændt.</p> <p>Tillader, at appen kan åbne sig selv, når systemet er færdig med at starte op. Dette kan gøre opstarten af telefonen langsommere og generelt gøre systemet langsommere, når appen altid kører.</p> <p>Tillader, at appen kan administrere netværkspolitikker og definere appspecifikke regler.</p> <p>Tillader, at appen kan administrere vibratoren.</p> <p>Tillader, at appen kan afslutte baggrundsprocesser for andre apps. Dette kan forårsage, at andre apps holder op med at virke.</p> <p>Tillader, at appen kan aktivere biltilstand.</p> <p>Tillader, at appen kan ændre browserens historik eller de bogmærker, der er gemt på din Android TV-enhed. Dette kan give appen tilladelse til at rydde eller ændre browserdata. Bemærk! Denne tilladelse håndhæves muligvis ikke af tredjepartsbrowsere eller andre apps med websøgningsfunktioner.</p> <p>Tillader, at appen kan ændre browserens historik eller de bogmærker, der er gemt på din tablet. Dette kan give appen tilladelse til at slette eller ændre browserdata. Bemærk! Denne tilladelse håndhæves muligvis ikke af tredjepartsbrowsere eller andre apps med websøgningsfunktioner.</p> <p>Tillader, at appen kan ændre browserens historik eller de bogmærker, der er gemt på din telefon. Dette kan give appen tilladelse til at slette eller ændre browserdata. Bemærk! Denne tilladelse håndhæves muligvis ikke af tredjepartsbrowsere eller andre apps med websøgningsfunktioner.</p> <p>Tillader, at appen kan ændre browserens tilladelser angående geoplacering. Ondsindede apps kan benytte dette til at sende oplysninger om sted til vilkårlige websites.</p> <p>Tillader, at appen kan ændre data om de kontakter, der er gemt på din Android TV-enhed. Denne tilladelse giver apps mulighed for at slette kontaktdata.</p> <p>Tillader, at appen kan ændre data om de kontakter, der er gemt på din tablet. Denne tilladelse giver apps mulighed for at slette kontaktdata.</p> <p>Tillader, at appen kan ændre data om de kontakter, der er gemt på din telefon. Denne tilladelse giver apps mulighed for at slette kontaktdata.</p> <p>Tillader, at appen kan ændre den måde, som netværksforbrug udregnes på i forhold til apps. Anvendes ikke af normale apps.</p> <p>Tillader, at appen kan ændre din billedsamling.</p> <p>Tillader, at appen kan ændre din musiksamling.</p> <p>Tillader, at appen kan ændre din videosamling.</p> <p>Tillader, at appen kan ændre globale lydindstillinger, som f.eks. lydstyrke og hvilken højttaler der bruges til output.</p> <p>Tillader, at appen kan ændre netværksforbindelsens tilstand.</p> <p>Tillader, at appen kan ændre systemets indstillingsdata. Ondsindede apps kan ødelægge din systemkonfiguration.</p> <p>Tillader, at appen kan ændre tidszonen på din Android TV-enhed.</p> <p>Tillader, at appen kan ændre tidszonen på din tablet.</p> <p>Tillader, at appen kan ændre tidszonen på din telefon.</p> <p>Tillader, at appen kan ændre tilstand for en netværksforbindelse via netdeling.</p> <p>Tillader, at appen kan bruge biometrisk hardware til godkendelse</p> <p>Tillader, at appen kan bruge chat-tjenesten til at foretage opkald, uden du gør noget.</p> <p>Tillader, at appen kan bruge hardware til fingeraftryk til godkendelse</p> <p>Tillader, at appen kan bruge metoder til at tilføje og slette ansigtsskabeloner.</p> <p>Tillader, at appen kan deaktivere statusbjælken eller tilføje og fjerne systemikoner.</p> <p>Tillader, at appen kan deaktivere tastaturlåsen og anden form for tilknyttet adgangskodesikkerhed. Telefonen deaktiverer f.eks. tastaturlåsen ved indgående telefonopkald og aktiverer tastaturlåsen igen, når opkaldet er afsluttet.</p> <p>Tillader, at appen kan få adgang til telefonfunktionerne på enheden. Med denne tilladelse kan appen fastslå telefonnummeret og enheds-id\'erne, hvorvidt et opkald er aktivt samt det eksterne nummer, der oprettes forbindelse til via et opkald.</p> <p>Tillader, at appen kan få adgang til yderligere kommandoer for placeringsudbydere. Dette kan gøre det muligt for appen at forstyrre GPS-funktionen eller andre placeringskilder.</p> <p>Tillader, at appen kan fastslå, hvorvidt WiMAX er aktiveret, og oplysninger om eventuelle WiMAX-netværk, der er forbundet.</p> <p>Tillader, at appen kan flytte opgaver til forgrunden og baggrunden. Appen kan gøre dette uden din bekræftelse.</p> <p>Tillader, at appen kan forhindre din Android TV-enhed i at gå i dvale.</p> <p>Tillader, at appen kan forhindre tabletten i at gå i dvale.</p> <p>Tillader, at appen kan forhindre, at telefonen går i dvale.</p> <p>Tillader, at appen kan hente listen over konti, der er kendt af din Android TV-enhed. Dette kan omfatte alle konti, der er oprettet af de apps, du har installeret.</p> <p>Tillader, at appen kan hente listen over konti, der er kendt af tabletten. Dette kan omfatte alle konti, der er oprettet af de apps, som du har installeret.</p> <p>Tillader, at appen kan hente listen over konti, der er kendt af telefonen. Dette kan omfatte alle konti, der er oprettet af de apps, som du har installeret.</p> <p>Tillader, at appen kan hente oplysninger om de feeds, der synkroniseres.</p> <p>Tillader, at appen kan hente oplysninger om nuværende og seneste opgaver. Med denne tilladelse kan appen finde oplysninger om, hvilke apps der bruges på enheden.</p> <p>Tillader, at appen kan hente, undersøge og rydde notifikationer, f.eks. dem, der er sendt af andre apps.</p> <p>Tillader, at appen kan indstille en alarm i en installeret alarmapp. Nogle alarmapps har muligvis ikke denne funktion.</p> <p>Tillader, at appen kan interagere med telefonitjenester for at foretage/modtage opkald.</p> <p>Tillader, at appen kan kommunikere med NFC-tags (Near Field Communication), -kort og -læsere.</p> <p>Tillader, at appen kan konfigurere Bluetooth på din Android TV-enhed samt finde og tilknytte eksterne enheder.</p> <p>Tillader, at appen kan konfigurere den lokale Bluetooth-tablet samt finde og parre med fjerne enheder.</p> <p>Tillader, at appen kan konfigurere den lokale Bluetooth-telefon samt finde og parre med eksterne enheder.</p> <p>Tillader, at appen kan konfigurere systembaggrunden.</p> <p>Tillader, at appen kan køre metoder til at tilføje og slette fingeraftryksskabeloner</p> <p>Tillader, at appen kan læse data om de kontakter, der er gemt på din Android TV-enhed. Apps får også adgang til de konti på din Android TV-enhed, som har oprettet kontakter. Dette kan omfatte konti, som er oprettet af apps, du har installeret. Med denne tilladelse kan apps gemme dine kontaktdata, og skadelige apps kan dele kontaktdata uden din viden.</p> <p>Tillader, at appen kan læse data om de kontakter, der er gemt på din tablet. Apps får også adgang til de konti på din tablet, som har oprettet kontakter. Dette kan omfatte konti, som er oprettet af apps, du har installeret. Med denne tilladelse kan apps gemme dine kontaktdata, og skadelige apps kan dele kontaktdata uden din viden.</p> <p>Tillader, at appen kan læse historikken om alle webadresser, som browseren har besøgt, og alle browserens bogmærker. Bemærk! Denne tilladelse håndhæves muligvis ikke af tredjepartsbrowsere eller andre apps med websøgningsfunktioner.</p> <p>Tillader, at appen kan læse historisk netværksbrug for specifikke netværk og apps.</p> <p>Tillader, at appen kan læse indholdet af din delte lagerplads.</p> <p>Tillader, at appen kan læse konfigurationen af ​​Bluetooth på tabletten samt kan oprette og acceptere forbindelser med parrede enheder.</p> <p>Tillader, at appen kan læse konfigurationen af ​​Bluetooth på telefonen samt kan oprette og acceptere forbindelser med parrede enheder.</p> <p>Tillader, at appen kan læse oplysninger om Wi-Fi-netværk, f.eks. hvorvidt Wi-Fi er aktiveret og navnet på forbundne Wi-Fi-enheder.</p> <p>Tillader, at appen kan læse oplysninger om netværksforbindelser, f.eks. eksisterende og forbundne netværk.</p> <p>Tillader, at appen kan læse placeringer fra din mediesamling.</p> <p>Tillader, at appen kan læse synkroniseringsindstillingerne for en konto. Denne tilladelse kan f.eks. fastslå, om appen Personer er synkroniseret med en konto.</p> <p>Tillader, at appen kan modtage og behandle WAP-beskeder. Denne tilladelse omfatter muligheden for at overvåge eller slette de beskeder, der sendes til dig, uden at vise dem til dig.</p> <p>Tillader, at appen kan modtage og behandle mms-beskeder. Det betyder, at appen kan overvåge eller slette de beskeder, der sendes til din enhed, uden at vise dem til dig.</p> <p>Tillader, at appen kan modtage og behandle sms-beskeder. Det betyder, at appen kan overvåge eller slette de beskeder, der sendes til din enhed, uden at vise dem til dig.</p> <p>Tillader, at appen kan modtage pakker, der sendes til alle enheder på et Wi-Fi-netværk ved hjælp af multicastadresser og ikke kun din Android TV-enhed. Den bruger mere strøm end tilstanden, der ikke anvender multicast.</p> <p>Tillader, at appen kan modtage pakker, der sendes til alle enheder på et Wi-Fi-netværk ved hjælp af multicastadresser, ikke kun din tablet. Den bruger mere strøm end tilstanden, der ikke anvender multicast.</p> <p>Tillader, at appen kan modtage pakker, der sendes til alle enheder på et Wi-Fi-netværk ved hjælp af multicastadresser, ikke kun din telefon. Den bruger mere strøm end tilstanden, der ikke anvender multicast.</p> <p>Tillader, at appen kan oprette forbindelse fra tabletten og afbryde forbindelsen til tabletten på WiMAX-netværk.</p> <p>Tillader, at appen kan oprette forbindelse fra telefonen og afbryde forbindelsen til telefonen på WiMAX-netværk.</p> <p>Tillader, at appen kan oprette netværkssockets og bruge tilpassede netværksprotokoller. Browseren og andre apps indeholder midler til at sende data til internettet, så med denne tilladelse er der ingen forpligtelse til at sende data til internettet.</p> <p>Tillader, at appen kan oprette og afbryde forbindelsen fra Wi-Fi-adgangspunkter og foretage ændringer i enhedskonfigurationen for Wi-Fi-netværk.</p> <p>Tillader, at appen kan oprette og afbryde forbindelsen mellem din Android TV-enhed og WiMAX-netværk.</p> <p>Tillader, at appen kan ringe til telefonnumre uden din indgriben. Dette kan resultere i uventede opkrævninger eller opkald. Bemærk, at appen med denne tilladelse ikke kan ringe til nødopkaldsnumre. Skadelige apps kan koste dig penge ved at foretage opkald uden din bekræftelse.</p> <p>Tillader, at appen kan se det nummer, der ringes op til under et udgående opkald, og giver mulighed for at omdirigere opkaldet til et andet nummer eller afbryde opkaldet helt.</p> <p>Tillader, at appen kan se konfigurationen af Bluetooth på din Android TV-enhed samt oprette og acceptere forbindelser med parrede enheder.</p> <p>Tillader, at appen kan se og styre igangværende opkald på enheden. Dette omfatter oplysninger såsom telefonnumre og status for opkaldene.</p> <p>Tillader, at appen kan sende klæbende udsendelser, der forbliver tilbage, når udsendelsen er slut. Overdreven brug kan gøre din tablet langsom eller ustabil ved at tvinge den til at bruge for meget hukommelse.</p> <p>Tillader, at appen kan sende klæbende udsendelser, der forbliver tilbage, når udsendelsen er slut. Overdreven brug kan gøre din telefon langsom eller ustabil ved at tvinge den til at bruge for meget hukommelse.</p> <p>Tillader, at appen kan sende klæbende udsendelser, der forbliver, når udsendelsen er slut. Overdreven brug kan gøre din Android TV-enhed langsom eller ustabil, da det tvinger den til at bruge for meget hukommelse.</p> <p>Tillader, at appen kan sende sms-beskeder. Dette kan resultere i uventede opkrævninger. Skadelige apps kan koste dig penge ved at sende beskeder uden din bekræftelse.</p> <p>Tillader, at appen kan skrive indholdet af din delte lagerplads.</p> <p>Tillader, at appen kan starte af sig selv, så snart systemet er færdig med at starte. Dette kan gøre tablettens opstartstid længere og give appen tilladelse til at gøre tabletten langsommere ved altid at lade appen køre.</p> <p>Tillader, at appen kan starte af sig selv, så snart systemet er startet. Dette kan gøre Android TV-enhedens opstartstid længere og give appen tilladelse til at gøre enheden langsommere ved altid at lade appen køre.</p> <p>Tillader, at appen kan tilføje beskeder på din telefonsvarer.</p> <p>Tillader, at appen kan udvide og skjule statusbjælken.</p> <p>Tillader, at appen læser Cell Broadcast-underretninger, der modtages af din enhed. I nogle områder sendes der Cell Broadcast-underretninger for at advare om nødsituationer. Ondsindede apps kan forstyrre ydelsen eller driften af ​din ​enhed, når der modtages en Cell Broadcast-meddelelse om en nødsituation.</p> <p>Tillader, at appen læser data om de kontakter, der er gemt på din telefon. Apps får også adgang til de konti på din telefon, som har oprettet kontakter. Dette kan omfatte konti, som er oprettet af apps, du har installeret. Med denne tilladelse kan apps gemme dine kontaktdata, og skadelige apps kan dele kontaktdata uden din viden.</p> <p>Tillader, at appen leverer brugeroplevelsen under opkald.</p> <p>Tillader, at appen registrerer nye telefon-SIM-forbindelser.</p> <p>Tillader, at appen registrerer nye telefonforbindelser.</p> <p>Tillader, at appen sender kommandoer til SIM-kortet. Dette er meget farligt.</p> <p>Tillader, at appen styrer, hvornår og hvordan brugeren ser skærmen for indgående opkald.</p> <p>Tillader, at applikationen fjerner genveje på startskærmen uden brugerindgriben.</p> <p>Tillader, at applikationen modtager oplysninger om aktuelle Android Beam-overførsler</p> <p>Tillader, at apps konfigurerer profilejerne og enhedens ejer.</p> <p>Tillader, at brugeren aktiverer konfigurationsappen, der er forsynet af mobilselskabet. Dette bør aldrig være nødvendigt for almindelige apps.</p> <p>Tillader, at brugeren kan bruge en tilladelse for en app. Dette bør aldrig være nødvendigt for almindelige apps.</p> <p>Tillader, at brugeren knytter sig til tjenester fra mobilselskabet. Dette bør aldrig være nødvendigt for almindelige apps.</p> <p>Tillader, at brugeren opretter en binding til det øverste niveau af grænsefladen i en tjeneste til formidling af betingelser. Dette bør aldrig være nødvendigt for almindelige apps.</p> <p>Tillader, at en app anmoder om installation af pakker.</p> <p>Tillader, at en app anmoder om sletning af pakker.</p> <p>Tillader, at en app fjerner DRM-certifikater. Dette bør aldrig være nødvendigt for almindelige apps.</p> <p>Tillader, at en app kan ændre synkroniseringsindstillingerne for en konto. Denne tilladelse kan f.eks. anvendes til at aktivere synkronisering af appen Personer med en konto.</p> <p>Tillader, at en app kan hente sin kode, data og cachestørrelser</p> <p>Tillader, at en app kan læse synkroniseringsstatistikkerne for en konto, f.eks. historikken for synkroniserede begivenheder og hvor meget data der synkroniseres.</p> <p>Tillader, at en applikation føjer genveje til startskærmen uden brugerindgriben.</p> <p>Tillader, at en applikation læser installationssessioner. Dermed kan applikationen se oplysninger om aktive pakkeinstallationer.</p> <p>Tillader, at en applikation observerer netværksforhold. Bør aldrig være nødvendigt for almindelige apps.</p> <p>Tillader, at en applikation provisionerer og anvender DRM-certifikater. Dette bør aldrig være nødvendigt for almindelige apps.</p> <p>Tillader, at en applikation viderefører medieoutput til andre eksterne enheder.</p> <p>Tillader, at indehaveren fastlåser det øverste niveau af brugergrænsefladen for en drømmetjeneste. Dette bør aldrig være nødvendigt for almindelige apps.</p> <p>Tilpasset appnotifikation</p> <p>Tilpasset</p> <p>Tilstanden Forstyr ikke blev ændret</p> <p>Tilstanden Testsele er aktiveret</p> <p>Tip! Dobbeltklik for at zoome ind eller ud.</p> <p>Tjek længden samt tilladte tegn i adgangskoder og pinkoder til skærmlåsen.</p> <p>Tjek skærmens zoomniveau og position.</p> <p>Tjekker aktuelt indhold</p> <p>Tjeneste til formidling af betingelser</p> <p>Tjeneste til rangering af notifikationer</p> <p>Tjenesten Sensor Notification</p> <p>Tjenesten Twilight</p> <p>Tjenesten blev aktiveret for:</p> <p>Tjenesten blev aktiveret.</p> <p>Tjenesten er deaktiveret.</p> <p>Tjenesten provisioneres ikke.</p> <p>Tjenesteudbyderens EHPLMN blev låst op.</p> <p>Tjenesteudbyderens RUIM blev låst op.</p> <p>Tjenesteudbyderens SIM blev låst op.</p> <p>Tjenesteudbyderens netværksdelmængde blev låst op.</p> <p>Tom</p> <p>Trådløs skærm</p> <p>Trevejsopkald</p> <p>Tryk for at administrere netværket.</p> <p>Tryk for at aktivere</p> <p>Tryk for at deaktivere USB-fejlretning</p> <p>Tryk for at deaktivere trådløs fejlretning</p> <p>Tryk for at få flere oplysninger eller for at stoppe appen.</p> <p>Tryk for at få flere oplysninger og foretage ændringer.</p> <p>Tryk for at fjerne begrænsning.</p> <p>Tryk for at konfigurere</p> <p>Tryk for at låse profilen op</p> <p>Tryk for at løse problemet</p> <p>Tryk for at lukke bilkørselsappen.</p> <p>Tryk for at oprette forbindelse alligevel</p> <p>Tryk for at se filer</p> <p>Tryk for at se flere muligheder.</p> <p>Tryk for at se info om batteri- og dataforbrug</p> <p>Tryk for at se valgmuligheder</p> <p>Tryk for at se, hvad der er blokeret.</p> <p>Tryk for at vælge sprog og layout</p> <p>Tryk for at vende tilbage til spillet</p> <p>Tryk på Menu for at låse op eller foretage et nødopkald.</p> <p>Tryk på Menu for at låse op.</p> <p>Tryk på Menu og dernæst på 0 for at låse op.</p> <p>Tryk på en funktion for at bruge den:</p> <p>Tryk to gange for zoomkontrol</p> <p>Tv</p> <p>USB-drev</p> <p>USB-fejlretning er tilsluttet</p> <p>USB-fejlretning</p> <p>USB-forbindelse</p> <p>USB-lager</p> <p>USB-port til eksterne Android-enheder</p> <p>USB-port til eksterne enheder</p> <p>USB-porten deaktiveres automatisk. Tryk for at få flere oplysninger.</p> <p>USB-porten kan bruges</p> <p>USB-tilbehør er tilsluttet</p> <p>USB</p> <p>USSD-anmodningen blev ændret til en SS-anmodning</p> <p>USSD-anmodningen blev ændret til et almindeligt opkald</p> <p>USSD-anmodningen blev ændret til et videoopkald</p> <p>Ubrugeligt SIM-kort.</p> <p>Uden kategori</p> <p>Udfør</p> <p>Udføre bevægelser</p> <p>Udforsk</p> <p>Udgående opkalds-id</p> <p>Udløber den:</p> <p>Udskrivningstjenesten er ikke aktiveret</p> <p>Udstedt af:</p> <p>Udstedt den:</p> <p>Udstedt til:</p> <p>Udvid oplåsningsområdet.</p> <p>Udvid</p> <p>Udviklermeddelelser</p> <p>Ugyldigt brugernavn eller ugyldig adgangskode.</p> <p>Ukendt</p> <p>Underretninger fra din it-administrator</p> <p>Underretninger</p> <p>Underrettet</p> <p>Undersøge indholdet i et vindue, du interagerer med.</p> <p>Understøttes ikke</p> <p>Urets lager er fuldt. Slet nogle filer for at frigøre plads.</p> <p>VPN er aktiveret.</p> <p>VPN-status</p> <p>VR-lyttefunktion</p> <p>Valg af genvej til hjælpefunktioner på skærmen</p> <p>Vælg aktivitet</p> <p>Vælg år</p> <p>Vælg en app til USB-enheden</p> <p>Vælg en app</p> <p>Vælg en handling for teksten</p> <p>Vælg en handling</p> <p>Vælg en konto</p> <p>Vælg en startapp</p> <p>Vælg et spil</p> <p>Vælg fil</p> <p>Vælg for at deaktivere USB-fejlretning.</p> <p>Vælg for at deaktivere trådløs fejlretning.</p> <p>Vælg inputmetode</p> <p>Vælg måned og dag</p> <p>Vælg minutter</p> <p>Vælg timer</p> <p>Vælg, hvilke funktioner du vil bruge med genvejen via lydstyrkeknapperne</p> <p>Vælg, hvilke funktioner du vil bruge med knappen Hjælpefunktioner</p> <p>Vælg, hvilken funktion du vil bruge, når du laver bevægelsen for hjælpefunktioner (stryger opad fra bunden af skærmen med to fingre):</p> <p>Vælg, hvilken funktion du vil bruge, når du laver bevægelsen for hjælpefunktioner (stryger opad fra bunden af skærmen med tre fingre):</p> <p>Vælg, hvilken funktion du vil bruge, når du trykker på knappen Hjælpefunktioner:</p> <p>Valgmuligheder for Android TV</p> <p>Valgmuligheder for AutoFyld</p> <p>Valgmuligheder for tabletcomputeren</p> <p>Værktøjstip</p> <p>Væske eller snavs i USB-porten</p> <p>Ven</p> <p>Vent</p> <p>Ventende opkald</p> <p>Video</p> <p>Videoen kan ikke afspilles.</p> <p>Videoproblem</p> <p>Videresend Cell Broadcast-meddelelser</p> <p>Viderestilling af opkald</p> <p>Vigtige udviklermeddelelser</p> <p>Vil du aktivere Datasparefunktion?</p> <p>Vil du aktivere Udforsk ved berøring?</p> <p>Vil du aktivere din arbejdsprofil?</p> <p>Vil du aktivere hjælpefunktionerne?</p> <p>Vil du besvare opkaldet?</p> <p>Vil du bruge genvejen til Hjælpefunktioner?</p> <p>Vil du dele en heap dump?</p> <p>Vil du dele fejlrapporten?</p> <p>Vil du genstarte i sikker tilstand? Dette vil deaktivere alle tredjepartsapplikationer, som du har installeret. De vil blive genoprettet, når du genstarter igen.</p> <p>Vil du skrue højere op end det anbefalede lydstyrkeniveau?\n\nDu kan skade hørelsen ved at lytte til meget høj musik over længere tid.</p> <p>Vil du slukke?</p> <p>Vil du starte browseren?</p> <p>Vil du tillade denne anmodning?</p> <p>Virksomhedens RUIM blev låst op.</p> <p>Virksomhedens SIM blev låst op.</p> <p>Virtuelt tastatur</p> <p>Vis altid</p> <p>Vis oven på andre apps</p> <p>Vis virtuelt tastatur</p> <p>Visning i fuld skærm</p> <p>Visningen Arbejde</p> <p>Visningen Personligt</p> <p>VoWifi</p> <p>WLAN-opkald</p> <p>Webadressen blev ikke fundet.</p> <p>Websøgning</p> <p>Weekend</p> <p>Wi-Fi-datagrænsen er overskredet</p> <p>Wi-Fi-opkald kunne ikke konfigureres</p> <p>Wi-Fi-opkald</p> <p>Wi-Fi</p> <p>Widget kunne ikke tilføjes.</p> <p>Windows Live</p> <p>Yahoo</p> <p>adgang til notifikationer</p> <p>adgang til placering i baggrunden</p> <p>adgangskode</p> <p>administrer hardware til fingeraftryk</p> <p>administrer netværkspolitik</p> <p>administrer profil- og enhedsejere</p> <p>administrere Near Field Communication</p> <p>administrere hardware til ansigtslås</p> <p>administrere telefonforbindelser</p> <p>administrere vibration</p> <p>adresse</p> <p>afholde tabletcomputeren fra at gå i dvale</p> <p>afholde telefonen fra at gå i dvale</p> <p>afinstaller genveje</p> <p>aktivere biltilstand</p> <p>aktivere konfigurationsappen, der leveres af mobilselskabet</p> <p>ændre din billedsamling</p> <p>ændre din musiksamling</p> <p>ændre din videosamling</p> <p>ændre dine kontakter</p> <p>ændre eller slette indholdet af din delte lagerplads</p> <p>ændre størrelsen på din baggrund</p> <p>ændre systemindstillinger</p> <p>ændring af pinkode</p> <p>angiv</p> <p>angive baggrund</p> <p>angive tidszone</p> <p>anmod om installation af pakker</p> <p>anmod om sletning af pakker</p> <p>anmode om skærmlåsens kompleksitet</p> <p>år</p> <p>b</p> <p>bede om at ignorere batterioptimeringer</p> <p>besvar telefonopkald</p> <p>betalingskort</p> <p>brug biometrisk hardware</p> <p>brug data i baggrunden</p> <p>bruge hardware til ansigtslås</p> <p>bruge hardware til fingeraftryk</p> <p>brugernavn</p> <p>dag</p> <p>dage</p> <p>deaktivere din skærmlås</p> <p>deaktivere eller redigere statuslinje</p> <p>dette kan koste dig penge</p> <p>dirigere opkald gennem systemet</p> <p>en ukendt netværkstype</p> <p>få adgang til Bluetooth-indstillinger</p> <p>få adgang til DRM-certifikater</p> <p>få adgang til billeder, medier og filer på din enhed</p> <p>få adgang til chat-opkaldstjeneste</p> <p>få adgang til din fysiske aktivitet</p> <p>få adgang til enhedens placering</p> <p>få adgang til kropssensorer (f.eks. pulsmålere)</p> <p>få adgang til sensordata om dine livstegn</p> <p>få adgang til yderligere kommandoer for placeringsudbyder</p> <p>få fuld netværksadgang</p> <p>få kun adgang til nøjagtig placering i forgrunden</p> <p>få kun adgang til omtrentlig placering i forgrunden</p> <p>fastlås til en drømmetjeneste</p> <p>finde konti på enheden</p> <p>fjerne DRM-certifikater</p> <p>for 1 måned siden</p> <p>foretage og administrere telefonopkald</p> <p>foretage/modtage SIP-opkald</p> <p>forpligte sig til en notifikationslyttertjeneste</p> <p>fortsætte et opkald fra en anden app</p> <p>fritaget fra begrænsninger ift. optagelse af lyd</p> <p>genkend fysisk aktivitet</p> <p>have adgang til Forstyr ikke</p> <p>have adgang til din kalender</p> <p>have adgang til dine kontakter</p> <p>hente kørende apps</p> <p>hold bilens skærm tændt</p> <p>indstille en alarm</p> <p>installere genveje</p> <p>interager med skærmen under opkald</p> <p>interagere med telefonitjenester</p> <p>kB</p> <p>knytte til et mobilselskabs beskedtjeneste</p> <p>knytte til tjenester fra mobilselskabet</p> <p>kør i baggrunden</p> <p>kør tjeneste i forgrunden</p> <p>køre ved opstart</p> <p>kort</p> <p>kreditkort</p> <p>læs installationssessioner</p> <p>læse Cell Broadcast-meddelelser</p> <p>læse dine kontakter</p> <p>læse dine tekstbeskeder (sms eller mms)</p> <p>læse dine webbogmærker og -historik</p> <p>læse feeds, jeg abonnerer på</p> <p>læse historisk netværksbrug</p> <p>læse indholdet af din delte lagerplads</p> <p>læse indstillinger for synkronisering</p> <p>læse og redigere opkaldslisten</p> <p>læse opkaldsliste</p> <p>læse placeringer fra din mediesamling</p> <p>læse synkroniseringsstatistikker</p> <p>læse telefonens status og identitet</p> <p>læse telefonnumre</p> <p>leverer brugeroplevelsen under opkald</p> <p>linje</p> <p>link</p> <p>lukke andre apps</p> <p>mailadresse</p> <p>måle appens lagerplads</p> <p>middag</p> <p>midnat</p> <p>min.</p> <p>minut</p> <p>mms</p> <p>modtag status for Android Beam-overførsler</p> <p>modtage tekstbeskeder (WAP)</p> <p>modtage tekstbeskeder (mms)</p> <p>modtage tekstbeskeder (sms)</p> <p>nu</p> <p>observer netværksforhold</p> <p>omdirigere udgående opkald</p> <p>omorganisere kørende apps</p> <p>oprette binding til en tjeneste til formidling af betingelser</p> <p>oprette og afbryde Wi-Fi-forbindelse</p> <p>optage lyd</p> <p>ord</p> <p>parre med Bluetooth-enheder</p> <p>plads</p> <p>registrere nye telefon-SIM-forbindelser</p> <p>registrere nye telefonforbindelser</p> <p>ringe direkte op til telefonnumre</p> <p>se Wi-Fi-forbindelser</p> <p>se netværksforbindelser</p> <p>se og styre opkald via systemet.</p> <p>sek.</p> <p>send infrarød</p> <p>send kommandoer til SIM</p> <p>sende klæbende udsendelse</p> <p>sende og se sms-beskeder</p> <p>sendte et billede</p> <p>skift afregning af netværksbrug</p> <p>skift kalibrering for inputenheden</p> <p>skifte WiMAX-tilstand</p> <p>skifte dine lydindstillinger</p> <p>skifte forbindelse til netdeling</p> <p>skifte netværksforbindelse</p> <p>skifte tilladelser til geoplacering i Browser</p> <p>skriv opkaldsliste</p> <p>skrive webbogmærker og -historik</p> <p>slå synkronisering til og fra</p> <p>slået fra</p> <p>slået til</p> <p>slet</p> <p>sms</p> <p>sørge for, at appen altid kører</p> <p>start brugen at tilladelsesvisning</p> <p>tage billeder og optage video</p> <p>tegn</p> <p>tilføje eller ændre kalenderbegivenheder og sende mail til gæster uden ejerens viden</p> <p>tilføje telefonsvarer</p> <p>tillade Wi-Fi-multicastmodtagelse</p> <p>tilslut og afbryd fra WiMAX</p> <p>time</p> <p>timer</p> <p>udvid/skjul statuslinje</p> <p>uge</p> <p>uger</p> <p>ukendt</p> <p>undgå, at din Android TV-enhed ikke går i dvale</p> <p>vær statusbjælken</p> <p>viderefør medieoutput</p> <p>vises over andre apps på din skærm</p> </html>
{ "content_hash": "4c6cfc05fe6a8c09cf69b01c4f19a104", "timestamp": "", "source": "github", "line_count": 1500, "max_line_length": 398, "avg_line_length": 51.396, "alnum_prop": 0.6921939450540898, "repo_name": "googlei18n/noto-source", "id": "343e672e6cb8cb3fd24bf59afdd6619edbc14c9d", "size": "78435", "binary": false, "copies": "3", "ref": "refs/heads/main", "path": "test/Danish/fontdiff-androidtxt-da.html", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "HTML", "bytes": "18998112" }, { "name": "Python", "bytes": "6576" }, { "name": "Shell", "bytes": "33224" } ], "symlink_target": "" }
<?php namespace Elastica\Aggregation; /** * Class ScriptedMetric. * * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-metrics-scripted-metric-aggregation.html */ class ScriptedMetric extends AbstractAggregation { /** * @param string $name the name if this aggregation * @param string|null $initScript Executed prior to any collection of documents * @param string|null $mapScript Executed once per document collected * @param string|null $combineScript Executed once on each shard after document collection is complete * @param string|null $reduceScript Executed once on the coordinating node after all shards have returned their results */ public function __construct($name, $initScript = null, $mapScript = null, $combineScript = null, $reduceScript = null) { parent::__construct($name); if ($initScript) { $this->setInitScript($initScript); } if ($mapScript) { $this->setMapScript($mapScript); } if ($combineScript) { $this->setCombineScript($combineScript); } if ($reduceScript) { $this->setReduceScript($reduceScript); } } /** * Executed once on each shard after document collection is complete. * * Allows the aggregation to consolidate the state returned from each shard. * If a combine_script is not provided the combine phase will return the aggregation variable. * * @param string $script * * @return $this */ public function setCombineScript($script) { return $this->setParam('combine_script', $script); } /** * Executed prior to any collection of documents. * * Allows the aggregation to set up any initial state. * * @param string $script * * @return $this */ public function setInitScript($script) { return $this->setParam('init_script', $script); } /** * Executed once per document collected. * * This is the only required script. If no combine_script is specified, the resulting state needs to be stored in * an object named _agg. * * @param string $script * * @return $this */ public function setMapScript($script) { return $this->setParam('map_script', $script); } /** * Executed once on the coordinating node after all shards have returned their results. * * The script is provided with access to a variable _aggs which is an array of the result of the combine_script on * each shard. If a reduce_script is not provided the reduce phase will return the _aggs variable. * * @param string $script * * @return $this */ public function setReduceScript($script) { return $this->setParam('reduce_script', $script); } }
{ "content_hash": "f837c1f679a346f8d3880e6dc24083b1", "timestamp": "", "source": "github", "line_count": 93, "max_line_length": 133, "avg_line_length": 31.623655913978496, "alnum_prop": 0.630057803468208, "repo_name": "stof/Elastica", "id": "ec2aa86575f1abe944181d8651889cd2ee2a5113", "size": "2941", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "lib/Elastica/Aggregation/ScriptedMetric.php", "mode": "33188", "license": "mit", "language": [ { "name": "Makefile", "bytes": "5002" }, { "name": "PHP", "bytes": "1256176" }, { "name": "Shell", "bytes": "1288" } ], "symlink_target": "" }
<?php class Controller_Job extends Controller_Common { public function before() { parent::before(); $this->theme = \Theme::instance(); } public function action_index() { $page = Input::get('page')?Input::get('page'):1; $query = Input::get('query')?Input::get('query'):""; /*if (strlen($query)) { $data['jobs'] = DB::select('*')->from('jobs') ->where('job_title','LIKE','%'.$query.'%') ->order_by('created_at','desc') ->limit(30)->offset(($page-1)*30) ->execute()->as_array(); } else { $data['jobs'] = DB::select('*')->from('jobs') ->order_by('created_at','desc') ->limit(30)->offset(($page-1)*30) ->execute()->as_array(); }*/ $data['jobs'] = Model_Job::get_jobs($page,$query); $total_rec = $data['jobs']['total']; $data['total_page'] = ceil($total_rec/30); $data['page'] = $page; $config = array( 'pagination_url' => "", 'total_items' => $total_rec, 'per_page' => 30, 'uri_segment' => 2, 'current_page' => $page ); $pagination = Pagination::forge('pagenav',$config); $data['pagination'] = $pagination->render(); $cats = Model_Category::get_categories(); $this->theme->set_template('index'); $this->theme->get_template()->set_global('current_menu', "Jobs", false); $this->theme->get_template()->set_global('current_menu_desc', "จัดการตำแหน่งงานทั้งหมดในระบบ", false); $this->theme->get_template()->set('breadcrumb', array( array('title' => "Home", 'icon' => "fa-home", 'link' => Uri::create('home'), 'active' => false), array('title' => "Jobs", 'icon' => "fa-briefcase", 'link' => "", 'active' => true) )); $this->theme->get_template()->set_global('query',$query,false); $this->theme->get_template()->set_global('cats',$cats,false); $this->theme->set_partial('sidebar','common/sidebar'); $this->theme->set_partial('content', 'job/index')->set($data); } public function action_view($id = null) { is_null($id) and Response::redirect('job'); if (!$data['job'] = Model_Job::find($id)) { Session::set_flash('error', 'Could not find job #' . $id); Response::redirect('job'); } $this->template->title = "Job"; $this->template->content = View::forge('job/view', $data); } public function action_create() { if (Input::method() == 'POST') { $val = Model_Job::validate('create'); /*$val->add_field('employer_name', 'Employer Name', 'required|max_length[255]'); $val->add_field('employer_tel', 'Employer Tel', 'required'); $val->add_field('employer_email', 'Employer E-Mail', 'required|valid_email');*/ if(Input::post('job_type') == "fulltime"){ $val->add_field('job_title_fulltime', 'Job Title', 'required|max_length[255]'); $val->add_field('job_salary', 'Salary', 'required|is_numeric'); } else if(Input::post('job_type') == "project"){ $val->add_field('job_title_project', 'Job Title', 'required|max_length[255]'); $val->add_field('job_budget_type', 'Price offer', 'required'); $val->add_field('job_budget', 'Budget', 'required|is_numeric'); if(Input::post('job_budget_type') == "perunit") $val->add_field('job_budget_unit', 'Unit', 'required|max_length[255]'); } else if(Input::post('job_type') == "contest"){ $val->add_field('job_title_contest', 'Job Title', 'required|max_length[255]'); $val->add_field('job_prize', 'Prize', 'required|max_length[255]'); } // $employer_id = 0; if ($val->run()) { $error = false; // $employer_photo = ""; $job_attachment = ""; /* upload employer logo */ /*$file = Input::file('employer_photo_file'); $allowList = array(".jpeg", ".jpg", ".png"); $path = realpath(DOCROOT."/../../uploads/profile_photo/employer/").DS; if($file['size'] > 0){ $ext = strtolower(substr($file['name'],strrpos($file['name'],"."))); if(!in_array($ext,$allowList)){ Session::set_flash('error', 'ชนิดของไฟล์ภาพไม่ถูกต้อง'); $error = true; } $filename = md5(time()).$ext; if(@copy($file['tmp_name'],$path.$filename)){ $employer_photo = $filename; } else { Session::set_flash('error', 'ไม่สามารถอัพโหลดไฟล์ภาพได้ โปรดลองใหม่อีกครั้ง'); $error = true; } }*/ /* */ /* upload job attachment */ $file = Input::file('job_attachment_file'); $allowList = array(".pdf", ".doc"); $path = realpath(DOCROOT."/../../uploads/job_attachment/").DS; if($file['size'] > 0){ $ext = strtolower(substr($file['name'],strrpos($file['name'],"."))); if(!in_array($ext,$allowList)){ Session::set_flash('error', 'ชนิดของไฟล์แนบไม่ถูกต้อง'); $error = true; } $filename = md5(time()); if(@copy($file['tmp_name'],$path.$filename."-o".$ext)){ $employer_photo = $filename.$ext; /* retina */ parent::create_cropped_thumbnail($path.$filename."-o".$ext, 466, 360,"@2x"); /* */ /* normal */ parent::create_cropped_thumbnail($path.$filename."-o".$ext, 466, 360); /* */ } else { Session::set_flash('error', 'ไม่สามารถอัพโหลดไฟล์ภาพได้ โปรดลองใหม่อีกครั้ง'); $error = true; } } /* */ if(!$error){ /*$old_employer = DB::select('*')->from('employers') ->where('employer_name','=',Input::post('employer_name')) ->execute()->as_array(); if(count($old_employer)){ $employer_id = $old_employer[0]['id']; } else { $employer = Model_Employer::forge(array( 'user_id' => 0, 'province_id' => Input::post('province_id'), 'employer_name' => Input::post('employer_name'), 'employer_desc' => Input::post('employer_desc'), 'employer_addr' => Input::post('employer_addr'), 'employer_tel' => Input::post('employer_tel'), 'employer_fax' => Input::post('employer_fax'), 'employer_email' => Input::post('employer_email'), 'employer_website' => Input::post('employer_website'), 'employer_photo' => $employer_photo, 'created_at' => time() )); if($employer->save()){ $employer_id = $employer->id; } }*/ $config = array( 'employer_id' => Input::post('employer_id'), 'job_desc' => Input::post('job_desc'), 'job_type' => Input::post('job_type'), 'cat_id' => Input::post('cat_id'), 'subcat_id' => Input::post('subcat_id'), 'job_qualifications' => Input::post('job_qualifications'), 'job_skills' => Input::post('job_skills'), 'job_tags' => Input::post('job_tags'), 'job_attachment' => $job_attachment, 'job_is_featured' => Input::post('job_is_featured'), 'job_is_urgent' => Input::post('job_is_urgent'), 'job_is_active' => Input::post('job_is_active'), 'job_is_paid' => 1, 'created_at' => time(), 'expired_at' => time() + (30*24*60*60) ); if(Input::post('job_type') == "fulltime"){ $config['job_title'] = Input::post('job_title_fulltime'); $config['job_areas'] = Input::post('job_areas'); $config['job_position'] = Input::post('job_position'); $config['job_welfare'] = Input::post('job_welfare'); $config['job_salary'] = Input::post('job_salary'); } else if(Input::post('job_type') == "project"){ $config['job_title'] = Input::post('job_title_project'); $config['job_budget'] = Input::post('job_budget'); $config['job_budget_type'] = Input::post('job_budget_type'); $config['job_budget_unit'] = Input::post('job_budget_unit'); } else if(Input::post('job_type') == "contest"){ $config['job_title'] = Input::post('job_title_contest'); $config['job_prize'] = Input::post('job_prize'); } $job = Model_Job::forge($config); if ($job and $job->save()){ /* generate tags */ $title = $job->job_title; $title_tags = parent::split_tags($title); if($job->employer_id){ $employer = Model_Employer::find($job->employer_id); $company_tags = parent::split_tags($employer->employer_name); } else { $company_tags = array(); } $tags = array_merge($title_tags,$company_tags); foreach($tags as $t){ $t = strtolower(trim($t)); if(!strlen($t) || $t == " ") continue; $tag = Model_JobTag::get_tag($job->id,$t); if(!$tag){ $tag = Model_JobTag::forge(array( 'job_id' => $job->id, 'tag_name' => $t, 'created_at' => time() )); $tag->save(); } } /* */ /* generate ref. no. */ if(!strlen($job->ref_no)){ $job->job_tags = implode(",",Model_JobTag::get_tags_by_job($job->id)); $job->ref_no = "J".str_pad($job->id,7,"0",STR_PAD_LEFT); $job->save(); } $qualifications = explode(",",Input::post('job_qualifications')); foreach($qualifications as $q){ if(!strlen(trim($q))) continue; $qual = Model_JobQualification::get_qualification($job->id,trim($q)); if(!$qual){ $qual = Model_JobQualification::forge(array( 'job_id' => $job->id, 'qualification_title' => trim($q), 'created_at' => time() )); $qual->save(); } } $skills = explode(",",Input::post('job_skills')); foreach($skills as $s){ if(!strlen(trim($s))) continue; $skill = Model_JobSkill::get_skill($job->id,trim($s)); if(!$skill){ $skill = Model_JobSkill::forge(array( 'job_id' => $job->id, 'skill_title' => trim($s), 'created_at' => time() )); $skill->save(); } } Session::set_flash('success', 'Added job #' . $job->id . '.'); Response::redirect('job'); } else { Session::set_flash('error', 'Could not save job.'); } } } else { $msg = '<ul>'; foreach ($val->error() as $field => $error){ $msg .= '<li>'.$error->get_message().'</li>'; } $msg .= '</ul>'; Session::set_flash('error', $msg); } } $this->theme->set_template('edit'); $this->theme->get_template()->set_global('current_menu', "Jobs", false); $this->theme->get_template()->set_global('current_menu_desc', "จัดการตำแหน่งงานทั้งหมดในระบบ", false); $this->theme->get_template()->set('breadcrumb', array( array('title' => "Home", 'icon' => "fa-home", 'link' => Uri::create('home'), 'active' => false), array('title' => "Jobs", 'icon' => "fa-briefcase", 'link' => Uri::create('job/index'), 'active' => false), array('title' => "Create", 'icon' => "", 'link' => "", 'active' => true) )); $this->theme->get_template()->set_global('cats', Model_Category::get_categories(), false); $this->theme->get_template()->set_global('subcats', json_encode(Model_Subcategory::get_all_subcats()), false); $this->theme->get_template()->set_global('current_subcats', array(), false); $this->theme->get_template()->set_global('provinces', Model_Province::get_provinces("th"), false); $this->theme->get_template()->set_global('employers', Model_Employer::get_employers_for_dropdown(), false); $this->theme->get_template()->set_global('page_specific_js', "form_job.js", false); $this->theme->set_partial('sidebar','common/sidebar'); $this->theme->set_partial('left', 'job/create'); } public function action_edit($id = null) { try { is_null($id) and Response::redirect('job'); $this->theme->set_template('edit'); $this->theme->get_template()->set_global('current_menu', "Jobs", false); $this->theme->get_template()->set_global('current_menu_desc', "จัดการตำแหน่งงานทั้งหมดในระบบ", false); $this->theme->get_template()->set('breadcrumb', array( array('title' => "Home", 'icon' => "fa-home", 'link' => Uri::create('home'), 'active' => false), array('title' => "Jobs", 'icon' => "fa-briefcase", 'link' => Uri::create('job/index'), 'active' => false), array('title' => "Edit", 'icon' => "", 'link' => "", 'active' => true) )); if (!$job = Model_Job::find($id)) { Session::set_flash('error', 'Could not find job #' . $id); Response::redirect('job'); } // $employer = Model_Employer::find($job->employer_id); if(Input::method() == 'POST') { $val = Model_Job::validate('edit'); /*$val->add_field('employer_name', 'Employer Name', 'required|max_length[255]'); $val->add_field('employer_tel', 'Employer Tel', 'required'); $val->add_field('employer_email', 'Employer E-Mail', 'required|valid_email');*/ if(Input::post('job_type') == "fulltime"){ $val->add_field('job_title_fulltime', 'Job Title', 'required|max_length[255]'); $val->add_field('job_salary', 'Salary', 'required|is_numeric'); } else if(Input::post('job_type') == "project"){ $val->add_field('job_title_project', 'Job Title', 'required|max_length[255]'); $val->add_field('job_budget_type', 'Price offer', 'required'); $val->add_field('job_budget', 'Budget', 'required|is_numeric'); if(Input::post('job_budget_type') == "perunit") $val->add_field('job_budget_unit', 'Unit', 'required|max_length[255]'); } else if(Input::post('job_type') == "contest"){ $val->add_field('job_title_contest', 'Job Title', 'required|max_length[255]'); $val->add_field('job_prize', 'Prize', 'required|max_length[255]'); } if ($val->run()) { $error = false; // $employer_photo = ""; $job_attachment = ""; /* upload employer logo */ /* $file = Input::file('employer_photo_file'); $allowList = array(".jpeg", ".jpg", ".png"); $path = realpath(DOCROOT."/../../uploads/profile_photo/employer/").DS; if($file['size'] > 0){ $ext = strtolower(substr($file['name'],strrpos($file['name'],"."))); if(!in_array($ext,$allowList)){ Session::set_flash('error', 'ชนิดของไฟล์ภาพไม่ถูกต้อง'); $error = true; } $filename = md5(time()); if(@copy($file['tmp_name'],$path.$filename."-o".$ext)){ $employer_photo = $filename.$ext; parent::create_cropped_thumbnail($path.$filename."-o".$ext, 466, 360,"@2x"); parent::create_cropped_thumbnail($path.$filename."-o".$ext, 466, 360); } else { Session::set_flash('error', 'ไม่สามารถอัพโหลดไฟล์ภาพได้ โปรดลองใหม่อีกครั้ง'); $error = true; } } */ /* */ /*if(strlen($employer_photo) && strlen($employer->employer_photo)){ $old_ext = strtolower(substr($employer->employer_photo,strrpos($employer->employer_photo,"."))); $old_filename = substr($employer->employer_photo,0,strrpos($employer->employer_photo,".")); @unlink($path.$old_filename.$old_ext); @unlink($path.$old_filename."@2x".$old_ext); @unlink($path.$old_filename."-o".$old_ext); }*/ /* upload job attachment */ $file = Input::file('job_attachment_file'); $allowList = array(".pdf", ".doc"); $path = realpath(DOCROOT."/../../uploads/job_attachment/").DS; if($file['size'] > 0){ $ext = strtolower(substr($file['name'],strrpos($file['name'],"."))); if(!in_array($ext,$allowList)){ Session::set_flash('error', 'ชนิดของไฟล์แนบไม่ถูกต้อง'); $error = true; } $filename = md5(time()).$ext; if(@copy($file['tmp_name'],$path.$filename)){ $job_attachment = $filename; } else { Session::set_flash('error', 'ไม่สามารถอัพโหลดไฟล์ได้ โปรดลองใหม่อีกครั้ง'); $error = true; } } /* */ if(!$error){ /*$employer->province_id = Input::post('province_id'); $employer->employer_name = Input::post('employer_name'); $employer->employer_desc = Input::post('employer_desc'); $employer->employer_addr = Input::post('employer_addr'); $employer->employer_tel = Input::post('employer_tel'); $employer->employer_fax = Input::post('employer_fax'); $employer->employer_email = Input::post('employer_email'); $employer->employer_website = Input::post('employer_website'); if(strlen($employer_photo)) $employer->employer_photo = $employer_photo; $employer->save();*/ $job->employer_id = Input::post('employer_id'); $job->job_desc = Input::post('job_desc'); $job->job_type = Input::post('job_type'); $job->cat_id = Input::post('cat_id'); $job->subcat_id = Input::post('subcat_id'); $job->job_qualifications = Input::post('job_qualifications'); $job->job_skills = Input::post('job_skills'); $job->job_tags = Input::post('job_tags'); if(strlen($job_attachment)) $job->job_attachment = $job_attachment; $job->job_is_featured = Input::post('job_is_featured'); $job->job_is_urgent = Input::post('job_is_urgent'); $job->job_is_active = Input::post('job_is_active'); if(Input::post('job_type') == "fulltime"){ $job->job_title = Input::post('job_title_fulltime'); $job->job_areas = Input::post('job_areas'); $job->job_position = Input::post('job_position'); $job->job_welfare = Input::post('job_welfare'); $job->job_salary = Input::post('job_salary'); } else if(Input::post('job_type') == "project"){ $job->job_title = Input::post('job_title_project'); $job->job_budget = Input::post('job_budget'); $job->job_budget_type = Input::post('job_budget_type'); $job->job_budget_unit = Input::post('job_budget_unit'); } else if(Input::post('job_type') == "contest"){ $job->job_title = Input::post('job_title_contest'); $job->job_prize = Input::post('job_prize'); } if ($job->save()) { /* generate tags */ $title = $job->job_title; $title_tags = parent::split_tags($title); if($job->employer_id){ $employer = Model_Employer::find($job->employer_id); $company_tags = parent::split_tags($employer->employer_name); } else { $company_tags = array(); } $tags = array_merge($title_tags,$company_tags); foreach($tags as $t){ $t = strtolower(trim($t)); if(!strlen($t) || $t == " ") continue; $tag = Model_JobTag::get_tag($job->id,$t); if(!$tag){ $tag = Model_JobTag::forge(array( 'job_id' => $job->id, 'tag_name' => $t, 'created_at' => time() )); $tag->save(); } } /* */ /* generate ref. no. */ if(!strlen($job->ref_no)){ $job->job_tags = implode(",",Model_JobTag::get_tags_by_job($job->id)); $job->ref_no = "J".str_pad($job->id,7,"0",STR_PAD_LEFT); $job->save(); } $qualifications = explode(",",Input::post('job_qualifications')); foreach($qualifications as $q){ if(!strlen(trim($q))) continue; $qual = Model_JobQualification::get_qualification($job->id,trim($q)); if(!$qual){ $qual = Model_JobQualification::forge(array( 'job_id' => $job->id, 'qualification_title' => trim($q), 'created_at' => time() )); $qual->save(); } } $skills = explode(",",Input::post('job_skills')); foreach($skills as $s){ if(!strlen(trim($s))) continue; $skill = Model_JobSkill::get_skill($job->id,trim($s)); if(!$skill){ $skill = Model_JobSkill::forge(array( 'job_id' => $job->id, 'skill_title' => trim($s), 'created_at' => time() )); $skill->save(); } } Session::set_flash('success', 'Updated job #' . $id); Response::redirect('job'); } else { Session::set_flash('error', 'Could not update job #' . $id); } } } else { $msg = '<ul>'; foreach ($val->error() as $field => $error){ $msg .= '<li>'.$error->get_message().'</li>'; } $msg .= '</ul>'; Session::set_flash('error', $msg); } } $this->theme->get_template()->set_global('job', $job, false); // $this->theme->get_template()->set_global('employer', $employer, false); $this->theme->get_template()->set_global('cats', Model_Category::get_categories(), false); $this->theme->get_template()->set_global('subcats', json_encode(Model_Subcategory::get_all_subcats()), false); $current_subcats = Model_Subcategory::get_subcats_by_category($job->cat_id); $this->theme->get_template()->set_global('current_subcats', $current_subcats, false); $this->theme->get_template()->set_global('provinces', Model_Province::get_provinces("th"), false); $this->theme->get_template()->set_global('employers', Model_Employer::get_employers_for_dropdown(), false); $this->theme->get_template()->set_global('page_specific_js', "form_job.js", false); $this->theme->set_partial('sidebar','common/sidebar'); $this->theme->set_partial('left', 'job/edit'); } catch(Exception $e){ die($e->getMessage()); } } public function action_delete($id = null) { is_null($id) and Response::redirect('job'); if ($job = Model_Job::find($id)) { $job->delete(); Session::set_flash('success', 'Deleted job #' . $id); } else { Session::set_flash('error', 'Could not delete job #' . $id); } Response::redirect('job'); } public function after($response) { if (empty($response) or !$response instanceof Response) { $response = \Response::forge(\Theme::instance()->render()); } return parent::after($response); } }
{ "content_hash": "8878de1bbbaece375ad0cb8c539e8bcd", "timestamp": "", "source": "github", "line_count": 701, "max_line_length": 118, "avg_line_length": 40.32524964336662, "alnum_prop": 0.4204400735814348, "repo_name": "ksakuntanak/buffohero_cms", "id": "657d9b628fe54c8eead091348ee2d652c9e68e9a", "size": "28988", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "fuel/app/classes/controller/job.php", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "1491649" }, { "name": "JavaScript", "bytes": "1907950" }, { "name": "PHP", "bytes": "2737420" } ], "symlink_target": "" }
package io.aeron; import io.aeron.exceptions.AeronException; import org.agrona.concurrent.AtomicBuffer; import org.agrona.concurrent.status.AtomicCounter; import org.agrona.concurrent.status.CountersReader; import java.util.concurrent.atomic.AtomicIntegerFieldUpdater; import static java.util.concurrent.atomic.AtomicIntegerFieldUpdater.newUpdater; /** * Counter stored in a file managed by the media driver which can be observed with AeronStat. */ public final class Counter extends AtomicCounter { private static final AtomicIntegerFieldUpdater<Counter> IS_CLOSED_UPDATER = newUpdater(Counter.class, "isClosed"); private final long registrationId; private final ClientConductor clientConductor; private volatile int isClosed; Counter( final long registrationId, final ClientConductor clientConductor, final AtomicBuffer buffer, final int counterId) { super(buffer, counterId); this.registrationId = registrationId; this.clientConductor = clientConductor; } /** * Construct a read-write view of an existing counter. * * @param countersReader for getting access to the buffers. * @param registrationId assigned by the driver for the counter or {@link Aeron#NULL_VALUE} if not known. * @param counterId for the counter to be viewed. * @throws AeronException if the id has for the counter has not been allocated. */ public Counter(final CountersReader countersReader, final long registrationId, final int counterId) { super(countersReader.valuesBuffer(), counterId); if (countersReader.getCounterState(counterId) != CountersReader.RECORD_ALLOCATED) { throw new AeronException("Counter id is not allocated: " + counterId); } this.registrationId = registrationId; this.clientConductor = null; } /** * Return the registration id used to register this counter with the media driver. * * @return registration id */ public long registrationId() { return registrationId; } /** * Close the counter, releasing the resource managed by the media driver if this was the creator of the Counter. * <p> * This method is idempotent and thread safe. */ public void close() { if (IS_CLOSED_UPDATER.compareAndSet(this, 0, 1)) { super.close(); if (null != clientConductor) { clientConductor.releaseCounter(this); } } } /** * Has this object been closed and should no longer be used? * * @return true if it has been closed otherwise false. */ public boolean isClosed() { return 1 == isClosed; } void internalClose() { super.close(); isClosed = 1; } }
{ "content_hash": "2d239a2440aa53921ac6bf166526e44a", "timestamp": "", "source": "github", "line_count": 99, "max_line_length": 118, "avg_line_length": 29.141414141414142, "alnum_prop": 0.6606585788561525, "repo_name": "mikeb01/Aeron", "id": "17451de2ca8772226d3273a4c87127c48f8e6e50", "size": "3489", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "aeron-client/src/main/java/io/aeron/Counter.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "41480" }, { "name": "C", "bytes": "2135180" }, { "name": "C++", "bytes": "2826597" }, { "name": "CMake", "bytes": "81425" }, { "name": "Dockerfile", "bytes": "2186" }, { "name": "Java", "bytes": "7084749" }, { "name": "Shell", "bytes": "65347" } ], "symlink_target": "" }
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>topology: Not compatible 👼</title> <link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" /> <link href="../../../../../bootstrap.min.css" rel="stylesheet"> <link href="../../../../../bootstrap-custom.css" rel="stylesheet"> <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet"> <script src="../../../../../moment.min.js"></script> <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --> <!-- WARNING: Respond.js doesn't work if you view the page via file:// --> <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> <![endif]--> </head> <body> <div class="container"> <div class="navbar navbar-default" role="navigation"> <div class="container-fluid"> <div class="navbar-header"> <a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a> </div> <div id="navbar" class="collapse navbar-collapse"> <ul class="nav navbar-nav"> <li><a href="../..">clean / released</a></li> <li class="active"><a href="">8.8.1 / topology - 8.7.0</a></li> </ul> </div> </div> </div> <div class="article"> <div class="row"> <div class="col-md-12"> <a href="../..">« Up</a> <h1> topology <small> 8.7.0 <span class="label label-info">Not compatible 👼</span> </small> </h1> <p>📅 <em><script>document.write(moment("2022-10-06 05:16:16 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2022-10-06 05:16:16 UTC)</em><p> <h2>Context</h2> <pre># Packages matching: installed # Name # Installed # Synopsis base-bigarray base base-threads base base-unix base camlp5 7.14 Preprocessor-pretty-printer of OCaml conf-findutils 1 Virtual package relying on findutils conf-perl 2 Virtual package relying on perl coq 8.8.1 Formal proof management system num 1.4 The legacy Num library for arbitrary-precision integer and rational arithmetic ocaml 4.08.1 The OCaml compiler (virtual package) ocaml-base-compiler 4.08.1 Official release 4.08.1 ocaml-config 1 OCaml Switch Configuration ocamlfind 1.9.5 A library manager for OCaml # opam file: opam-version: &quot;2.0&quot; maintainer: &quot;Hugo.Herbelin@inria.fr&quot; homepage: &quot;https://github.com/coq-contribs/topology&quot; license: &quot;LGPL&quot; build: [make &quot;-j%{jobs}%&quot;] install: [make &quot;install&quot;] remove: [&quot;rm&quot; &quot;-R&quot; &quot;%{lib}%/coq/user-contrib/Topology&quot;] depends: [ &quot;ocaml&quot; &quot;coq&quot; {&gt;= &quot;8.7&quot; &amp; &lt; &quot;8.8~&quot;} &quot;coq-zorns-lemma&quot; {&gt;= &quot;8.7&quot; &amp; &lt; &quot;8.8~&quot;} ] tags: [ &quot;keyword: topology&quot; &quot;keyword: filters&quot; &quot;keyword: nets&quot; &quot;keyword: metric spaces&quot; &quot;keyword: real analysis&quot; &quot;keyword: Urysohn&#39;s lemma&quot; &quot;keyword: Tietze extension theorem&quot; &quot;category: Mathematics/Real Calculus and Topology&quot; ] authors: [ &quot;Daniel Schepler &lt;dschepler@gmail.com&gt;&quot; ] bug-reports: &quot;https://github.com/coq-contribs/topology/issues&quot; dev-repo: &quot;git+https://github.com/coq-contribs/topology.git&quot; synopsis: &quot;General Topology&quot; description: &quot;This library develops some of the basic concepts and results of general topology.&quot; flags: light-uninstall url { src: &quot;https://github.com/coq-contribs/topology/archive/v8.7.0.tar.gz&quot; checksum: &quot;md5=c06cd890b788297b5e66dc9be0aeaa4d&quot; } </pre> <h2>Lint</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Dry install 🏜️</h2> <p>Dry install with the current Coq version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam install -y --show-action coq-topology.8.7.0 coq.8.8.1</code></dd> <dt>Return code</dt> <dd>5120</dd> <dt>Output</dt> <dd><pre>[NOTE] Package coq is already installed (current version is 8.8.1). The following dependencies couldn&#39;t be met: - coq-topology -&gt; coq &lt; 8.8~ -&gt; ocaml &lt; 4.06.0 base of this switch (use `--unlock-base&#39; to force) Your request can&#39;t be satisfied: - No available version of coq satisfies the constraints No solution found, exiting </pre></dd> </dl> <p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-topology.8.7.0</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Install dependencies</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>0 s</dd> </dl> <h2>Install 🚀</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>0 s</dd> </dl> <h2>Installation size</h2> <p>No files were installed.</p> <h2>Uninstall 🧹</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Missing removes</dt> <dd> none </dd> <dt>Wrong removes</dt> <dd> none </dd> </dl> </div> </div> </div> <hr/> <div class="footer"> <p class="text-center"> Sources are on <a href="https://github.com/coq-bench">GitHub</a> © Guillaume Claret 🐣 </p> </div> </div> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <script src="../../../../../bootstrap.min.js"></script> </body> </html>
{ "content_hash": "619a3ccf3638d53a827e6038ae2c71e5", "timestamp": "", "source": "github", "line_count": 166, "max_line_length": 312, "avg_line_length": 42.84939759036145, "alnum_prop": 0.5456206945030226, "repo_name": "coq-bench/coq-bench.github.io", "id": "e21edc30976a29352e726bc2b410a7c7e41a6f3f", "size": "7138", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "clean/Linux-x86_64-4.08.1-2.0.5/released/8.8.1/topology/8.7.0.html", "mode": "33188", "license": "mit", "language": [], "symlink_target": "" }
ruby正则 ==== 参考: http://www.runoob.com/ruby/ruby-regular-expressions.html
{ "content_hash": "76f3538bd22159fc0a637fc7c7ae8baa", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 60, "avg_line_length": 18.5, "alnum_prop": 0.7297297297297297, "repo_name": "azhao1981/my-notes", "id": "35aab5fbde7a529f27babae6267606051dd24137", "size": "82", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "doc/ruby_reg.md", "mode": "33188", "license": "mit", "language": [ { "name": "Ruby", "bytes": "517" }, { "name": "Shell", "bytes": "12629" } ], "symlink_target": "" }
SYNONYM #### According to The Catalogue of Life, 3rd January 2011 #### Published in null #### Original name null ### Remarks null
{ "content_hash": "d2481a0e75416a86cfc857337a4f5ee3", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 39, "avg_line_length": 10.23076923076923, "alnum_prop": 0.6917293233082706, "repo_name": "mdoering/backbone", "id": "8d883d480402050da251df2be3561c7197d8f4b5", "size": "195", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Plantae/Magnoliophyta/Liliopsida/Poales/Poaceae/Urochloa/Urochloa panicoides/ Syn. Panicum trichopus breviglume/README.md", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
require 'test_helper' class UserTest < ActiveSupport::TestCase def setup User.delete_all() @user = create(:user) end def teardown @user.destroy end test 'should be valid' do assert @user.valid?, @user.errors.full_messages end test 'name should be present' do @user.name = ' ' assert_not @user.valid? end test 'email should be present' do @user.email = ' ' assert_not @user.valid? end test 'name should not be too long' do @user.name = 'a' * 31 assert_not @user.valid? end test 'email should not be too long' do @user.email = 'a' * 244 + '@example.com' assert_not @user.valid? end test 'email addresses should be unique' do duplicate_user = @user.dup duplicate_user.save assert_not duplicate_user.valid? end test 'email addresses should be saved as lower-case' do mixed_case_email = 'Foo@ExAMPle.CoM' @user.email = mixed_case_email @user.save assert_equal mixed_case_email.downcase, @user.reload.email end test 'email validation should accept valid addresses' do valid_addresses = %w[user@example.com USER@foo.COM A_US-ER@foo.bar.org first.last@foo.jp alice+bob@baz.cn] valid_addresses.each do |valid_address| @user.email = valid_address assert @user.valid?, "#{valid_address.inspect} should be valid" end end test 'email validation should reject invalid addresses' do invalid_addresses = %w[user@example,com user_at_foo.org user.name@example. foo@bar_baz.com foo@bar+baz.com] invalid_addresses.each do |invalid_address| @user.email = invalid_address assert_not @user.valid?, "#{invalid_address.inspect} should be invalid" end end test 'password should be present (nonblank)' do @user.password = @user.password_confirmation = ' ' * 6 assert_not @user.valid? end test 'password should have a minimum length' do @user.password = @user.password_confirmation = 'a' * 5 assert_not @user.valid? end test 'authenticated? returns false for a user with nil digest' do assert_not @user.authenticated?('') end end
{ "content_hash": "27c0c477560b570e885fb87635ca448e", "timestamp": "", "source": "github", "line_count": 81, "max_line_length": 77, "avg_line_length": 27.395061728395063, "alnum_prop": 0.64398377647589, "repo_name": "ftorrado/DinnerU", "id": "33f529bf0689b6df7d5f1f191572796e9f9eee64", "size": "2219", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "test/models/user_test.rb", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "2734" }, { "name": "CoffeeScript", "bytes": "1370" }, { "name": "HTML", "bytes": "24145" }, { "name": "JavaScript", "bytes": "4419" }, { "name": "Ruby", "bytes": "64878" } ], "symlink_target": "" }
var webpack = require('webpack'); module.exports = function (config) { config.set({ browsers: [ process.env.CONTINUOUS_INTEGRATION ? 'Firefox' : 'Chrome' ], singleRun: true, frameworks: [ 'mocha' ], files: [ 'tests.webpack.js' ], preprocessors: { 'tests.webpack.js': [ 'webpack', 'sourcemap' ] }, reporters: [ 'mocha' ], webpack: { devtool: 'inline-source-map', module: { loaders: [ { test: /\.(jpe?g|png|gif|svg)$/, loader: 'url', query: {limit: 10240} }, { test: /\.js$/, exclude: /node_modules/, loaders: ['react-hot', 'babel?stage=0&optional=runtime&plugins=typecheck']}, { test: /\.json$/, loader: 'json-loader' }, { test: /\.css$/, loader: 'style!css?modules&importLoaders=2&sourceMap&localIdentName=[local]___[hash:base64:5]!autoprefixer?browsers=last 2 version' }, { test: /sinon/, loader: 'imports?define=>false'} ] }, resolve: { modulesDirectories: [ 'src', 'node_modules' ], extensions: ['', '.json', '.js'] }, plugins: [ // hot reload new webpack.HotModuleReplacementPlugin(), new webpack.IgnorePlugin(/\.json$/), new webpack.NoErrorsPlugin(), new webpack.DefinePlugin({ __CLIENT__: true, __SERVER__: false, __DEVELOPMENT__: true, __DEVTOOLS__: false // <-------- DISABLE redux-devtools HERE }) ] }, webpackServer: { noInfo: true } }); };
{ "content_hash": "f232579d0f2b663eb230f017a26d902c", "timestamp": "", "source": "github", "line_count": 59, "max_line_length": 162, "avg_line_length": 26.64406779661017, "alnum_prop": 0.5248091603053435, "repo_name": "stevoland/bill-test", "id": "af3f6e685cbf8152aa047b43b5cbc3470df53103", "size": "1572", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "karma.conf.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "190" }, { "name": "JavaScript", "bytes": "36177" } ], "symlink_target": "" }
.explanation { background: lightsteelblue; padding: 1em; }
{ "content_hash": "2e307745f996b9c3c3644fe4e9f218e5", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 29, "avg_line_length": 15.75, "alnum_prop": 0.7142857142857143, "repo_name": "swirlycheetah/es6-hot-module-replacement", "id": "e7f27c56d70969ea8ea6d15cc18100d5c69ef633", "size": "63", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/example/example.css", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "154" }, { "name": "HTML", "bytes": "339" }, { "name": "JavaScript", "bytes": "2352" } ], "symlink_target": "" }
 #include <aws/elasticfilesystem/model/CreateMountTargetRequest.h> #include <aws/core/utils/json/JsonSerializer.h> #include <utility> using namespace Aws::EFS::Model; using namespace Aws::Utils::Json; using namespace Aws::Utils; CreateMountTargetRequest::CreateMountTargetRequest() : m_fileSystemIdHasBeenSet(false), m_subnetIdHasBeenSet(false), m_ipAddressHasBeenSet(false), m_securityGroupsHasBeenSet(false) { } Aws::String CreateMountTargetRequest::SerializePayload() const { JsonValue payload; if(m_fileSystemIdHasBeenSet) { payload.WithString("FileSystemId", m_fileSystemId); } if(m_subnetIdHasBeenSet) { payload.WithString("SubnetId", m_subnetId); } if(m_ipAddressHasBeenSet) { payload.WithString("IpAddress", m_ipAddress); } if(m_securityGroupsHasBeenSet) { Array<JsonValue> securityGroupsJsonList(m_securityGroups.size()); for(unsigned securityGroupsIndex = 0; securityGroupsIndex < securityGroupsJsonList.GetLength(); ++securityGroupsIndex) { securityGroupsJsonList[securityGroupsIndex].AsString(m_securityGroups[securityGroupsIndex]); } payload.WithArray("SecurityGroups", std::move(securityGroupsJsonList)); } return payload.View().WriteReadable(); }
{ "content_hash": "081bcb3555d5337a6f13b59165a8261b", "timestamp": "", "source": "github", "line_count": 58, "max_line_length": 121, "avg_line_length": 21.637931034482758, "alnum_prop": 0.749800796812749, "repo_name": "JoyIfBam5/aws-sdk-cpp", "id": "6fab2abd4994107717a5f7dac8b4ae96639553d9", "size": "1828", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "aws-cpp-sdk-elasticfilesystem/source/model/CreateMountTargetRequest.cpp", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C", "bytes": "11868" }, { "name": "C++", "bytes": "167818064" }, { "name": "CMake", "bytes": "591577" }, { "name": "HTML", "bytes": "4471" }, { "name": "Java", "bytes": "271801" }, { "name": "Python", "bytes": "85650" }, { "name": "Shell", "bytes": "5277" } ], "symlink_target": "" }
/** * * Send data to another system through a WebRTC channel * * This file manages the settings view for settings that are * specific to this output, and that are stored in the output's * metadata * * * @author Edouard Lafargue, ed@lafargue.name */ define(function (require) { "use strict"; var _ = require('underscore'), Backbone = require('backbone'); var template = require('tpl/outputs/WebRTCSettingsView'); require('webrtc_adapter'); // Load WebRTC adapter shim. return Backbone.View.extend({ initialize: function () { this.gotDevices = false; this.outputs = []; this.inputs = []; // Metadata is a simple object looking like this: // { 'address': 'name', 'address2': 'name2', etc... } this.metadata = this.model.get('metadata'); if (Object.keys(this.metadata).length == 0) { this.metadata = { ipaddress: '127.0.0.1:9000', instance: 'peerjs', audio_input: 'Default', audio_output: 'Default' }; this.model.set('metadata', this.metadata); } // Query the runtime for our media devices: navigator.mediaDevices.enumerateDevices() .then(this.gotMediaDevices.bind(this)) .catch(errorCallback); function errorCallback(error) { console.log('navigator.getUserMedia error: ', error); } }, render: function () { this.$el.html(template({ metadata: this.metadata, inputs: this.inputs, outputs: this.outputs })); return this; }, events: { "change": "change" }, gotMediaDevices: function (deviceInfos) { // Check: // github WebRTC examples https://github.com/webrtc/samples/blob/master/src/content/devices/input-output/js/main.js /////// for (var i = 0; i !== deviceInfos.length; ++i) { var deviceInfo = deviceInfos[i]; if (deviceInfo.kind === 'audioinput') { this.inputs.push({ label: deviceInfo.label || 'microphone ' + (audioInputSelect.length + 1), value: deviceInfo.deviceId }); } else if (deviceInfo.kind === 'audiooutput') { this.outputs.push({ label: deviceInfo.label || 'speaker ' + (audioOutputSelect.length + 1), value: deviceInfo.deviceId }); } else { console.log('Some other kind of source/device: ', deviceInfo); } } this.gotdevices = true; this.render(); }, change: function (event) { console.log("WebRTC output bespoke settings change"); // Apply the change to the metadata var target = event.target; this.metadata[target.name] = target.value; this.model.set('metadata', this.metadata); // This view is embedded into another view, so change events // are going to bubble up to the upper view and change attributes // with the same name, so we stop event propagation here: if (target.name != "numfields") event.stopPropagation(); }, }); });
{ "content_hash": "94ae89abf7d1a7a185c6c84401b343e1", "timestamp": "", "source": "github", "line_count": 112, "max_line_length": 127, "avg_line_length": 32.035714285714285, "alnum_prop": 0.5072463768115942, "repo_name": "wizkers/wizkers", "id": "0afc38418542a186a34a03bbf447b14db2f38808", "size": "4785", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "wizkers/www/js/app/outputs/webrtc/settings.js", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "2568" }, { "name": "C++", "bytes": "158330" }, { "name": "CSS", "bytes": "59878" }, { "name": "HTML", "bytes": "529065" }, { "name": "JavaScript", "bytes": "6218790" }, { "name": "Makefile", "bytes": "570" }, { "name": "Shell", "bytes": "734" } ], "symlink_target": "" }
<?php namespace Bitpay; /** */ class Bill implements BillInterface { /** * @var array */ protected $items; /** * @var CurrencyInterface */ protected $currency; /** * @var string */ protected $name; /** * @var array */ protected $address; /** * @var string */ protected $city; /** * @var string */ protected $state; /** * @var string */ protected $zip; /** * @var string */ protected $country; /** * @var string */ protected $email; /** * @var string */ protected $phone; /** * @var string */ protected $status; /** * @var string */ protected $showRate; /** * @var string */ protected $archived; /** */ public function __construct() { $this->address = array(); $this->archived = false; $this->currency = new Currency(); $this->items = array(); } /** * @inheritdoc */ public function getItems() { return $this->items; } /** * @param ItemInterface $item * * @return BillInterface */ public function addItem(ItemInterface $item) { $this->items[] = $item; return $this; } /** * @inheritdoc */ public function getCurrency() { return $this->currency; } /** * @param CurrencyInterface $currency * * @return BillInterface */ public function setCurrency(CurrencyInterface $currency) { $this->currency = $currency; return $this; } /** * @inheritdoc */ public function getName() { return $this->name; } /** * @param string $name * * @return BillInterface */ public function setName($name) { $this->name = $name; return $this; } /** * @inheritdoc */ public function getAddress() { return $this->address; } /** * @param array $address * * @return BillInterface */ public function setAddress($address) { $this->address = $address; return $this; } /** * @inheritdoc */ public function getCity() { return $this->city; } /** * @param string $city * * @return BillInterface */ public function setCity($city) { $this->city = $city; return $this; } /** * @inheritdoc */ public function getState() { return $this->state; } /** * @param string $state * * @return BillInterface */ public function setState($state) { $this->state = $state; return $this; } /** * @inheritdoc */ public function getZip() { return $this->zip; } /** * @param string $zip * * @return BillInterface */ public function setZip($zip) { $this->zip = $zip; return $this; } /** * @inheritdoc */ public function getCountry() { return $this->country; } /** * @param string $country * * @return BillInterface */ public function setCountry($country) { $this->country = $country; return $this; } /** * @inheritdoc */ public function getEmail() { return $this->email; } /** * @param string $email * * @return BillInterface */ public function setEmail($email) { $this->email = $email; return $this; } /** * @inheritdoc */ public function getPhone() { return $this->phone; } /** * @param string $phone * * @return BillInterface */ public function setPhone($phone) { $this->phone = $phone; return $this; } /** * @inheritdoc */ public function getStatus() { return $this->status; } /** * @param string $status * * @return BillInterface */ public function setStatus($status) { $this->status = $status; return $this; } /** * @inheritdoc */ public function getShowRate() { return $this->showRate; } /** * @param string $showRate * * @return BillInterface */ public function setShowRate($showRate) { $this->showRate = $showRate; return $this; } /** * @inheritdoc */ public function getArchived() { return $this->archived; } /** * @param boolean $archived * * @return BillInterface */ public function setArchived($archived) { $this->archived = $archived; return $this; } }
{ "content_hash": "fb8fff042930454a571e1fd2eb4051ea", "timestamp": "", "source": "github", "line_count": 344, "max_line_length": 60, "avg_line_length": 14.444767441860465, "alnum_prop": 0.46367478365868386, "repo_name": "JoshuaEstes/fuzzy-octo-avenger", "id": "d11a29c7cbfb6ea27652854f3213184e0ab8ac42", "size": "4969", "binary": false, "copies": "1", "ref": "refs/heads/feature/PrecisionMath", "path": "src/Bitpay/Bill.php", "mode": "33188", "license": "mit", "language": [ { "name": "PHP", "bytes": "540459" } ], "symlink_target": "" }
<!doctype html> <html> <title>npm-tag</title> <meta http-equiv="content-type" value="text/html;utf-8"> <link rel="stylesheet" type="text/css" href="../../static/style.css"> <link rel="canonical" href="https://www.npmjs.org/doc/api/npm-tag.html"> <script async=true src="../../static/toc.js"></script> <body> <div id="wrapper"> <h1><a href="../api/npm-tag.html">npm-tag</a></h1> <p>Tag a published version</p> <h2 id="synopsis">SYNOPSIS</h2> <pre><code>npm.commands.tag(package@version, tag, callback) </code></pre><h2 id="description">DESCRIPTION</h2> <p>Tags the specified version of the package with the specified tag, or the <code>--tag</code> config if not specified.</p> <p>The &#39;package@version&#39; is an array of strings, but only the first two elements are currently used.</p> <p>The first element must be in the form package@version, where package is the package name and version is the version number (much like installing a specific version).</p> <p>The second element is the name of the tag to tag this version with. If this parameter is missing or falsey (empty), the default from the config will be used. For more information about how to set this config, check <code>man 3 npm-config</code> for programmatic usage or <code>man npm-config</code> for cli usage.</p> </div> <table border=0 cellspacing=0 cellpadding=0 id=npmlogo> <tr><td style="width:180px;height:10px;background:rgb(237,127,127)" colspan=18>&nbsp;</td></tr> <tr><td rowspan=4 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td><td style="width:40px;height:10px;background:#fff" colspan=4>&nbsp;</td><td style="width:10px;height:10px;background:rgb(237,127,127)" rowspan=4>&nbsp;</td><td style="width:40px;height:10px;background:#fff" colspan=4>&nbsp;</td><td rowspan=4 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td><td colspan=6 style="width:60px;height:10px;background:#fff">&nbsp;</td><td style="width:10px;height:10px;background:rgb(237,127,127)" rowspan=4>&nbsp;</td></tr> <tr><td colspan=2 style="width:20px;height:30px;background:#fff" rowspan=3>&nbsp;</td><td style="width:10px;height:10px;background:rgb(237,127,127)" rowspan=3>&nbsp;</td><td style="width:10px;height:10px;background:#fff" rowspan=3>&nbsp;</td><td style="width:20px;height:10px;background:#fff" rowspan=4 colspan=2>&nbsp;</td><td style="width:10px;height:20px;background:rgb(237,127,127)" rowspan=2>&nbsp;</td><td style="width:10px;height:10px;background:#fff" rowspan=3>&nbsp;</td><td style="width:20px;height:10px;background:#fff" rowspan=3 colspan=2>&nbsp;</td><td style="width:10px;height:10px;background:rgb(237,127,127)" rowspan=3>&nbsp;</td><td style="width:10px;height:10px;background:#fff" rowspan=3>&nbsp;</td><td style="width:10px;height:10px;background:rgb(237,127,127)" rowspan=3>&nbsp;</td></tr> <tr><td style="width:10px;height:10px;background:#fff" rowspan=2>&nbsp;</td></tr> <tr><td style="width:10px;height:10px;background:#fff">&nbsp;</td></tr> <tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr> <tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr> </table> <p id="footer">npm-tag &mdash; npm@2.5.0</p>
{ "content_hash": "a3495f6a0ea5680b2e5d190717410569", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 807, "avg_line_length": 86.45, "alnum_prop": 0.7203585887796414, "repo_name": "ericntd/sccprototype", "id": "17ff41e2a671f4bbb54edc02dc8ee7d2335e8e99", "size": "3458", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "node_modules/npm/html/doc/api/npm-tag.html", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "223213" }, { "name": "HTML", "bytes": "85990" }, { "name": "JavaScript", "bytes": "93367" } ], "symlink_target": "" }
.class Landroid/support/v4/media/MediaBrowserCompat$Subscription; .super Ljava/lang/Object; .source "MediaBrowserCompat.java" # annotations .annotation system Ldalvik/annotation/EnclosingClass; value = Landroid/support/v4/media/MediaBrowserCompat; .end annotation .annotation system Ldalvik/annotation/InnerClass; accessFlags = 0xa name = "Subscription" .end annotation # instance fields .field private final mCallbacks:Ljava/util/List; .annotation system Ldalvik/annotation/Signature; value = { "Ljava/util/List", "<", "Landroid/support/v4/media/MediaBrowserCompat$SubscriptionCallback;", ">;" } .end annotation .end field .field private final mOptionsList:Ljava/util/List; .annotation system Ldalvik/annotation/Signature; value = { "Ljava/util/List", "<", "Landroid/os/Bundle;", ">;" } .end annotation .end field # direct methods .method public constructor <init>()V .registers 2 .prologue .line 1791 invoke-direct {p0}, Ljava/lang/Object;-><init>()V .line 1792 new-instance v0, Ljava/util/ArrayList; invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V iput-object v0, p0, Landroid/support/v4/media/MediaBrowserCompat$Subscription;->mCallbacks:Ljava/util/List; .line 1793 new-instance v0, Ljava/util/ArrayList; invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V iput-object v0, p0, Landroid/support/v4/media/MediaBrowserCompat$Subscription;->mOptionsList:Ljava/util/List; .line 1794 return-void .end method # virtual methods .method public getCallback(Landroid/os/Bundle;)Landroid/support/v4/media/MediaBrowserCompat$SubscriptionCallback; .registers 4 .param p1, "options" # Landroid/os/Bundle; .prologue .line 1809 const/4 v0, 0x0 .local v0, "i":I :goto_1 iget-object v1, p0, Landroid/support/v4/media/MediaBrowserCompat$Subscription;->mOptionsList:Ljava/util/List; invoke-interface {v1}, Ljava/util/List;->size()I move-result v1 if-ge v0, v1, :cond_23 .line 1810 iget-object v1, p0, Landroid/support/v4/media/MediaBrowserCompat$Subscription;->mOptionsList:Ljava/util/List; invoke-interface {v1, v0}, Ljava/util/List;->get(I)Ljava/lang/Object; move-result-object v1 check-cast v1, Landroid/os/Bundle; invoke-static {v1, p1}, Landroid/support/v4/media/MediaBrowserCompatUtils;->areSameOptions(Landroid/os/Bundle;Landroid/os/Bundle;)Z move-result v1 if-eqz v1, :cond_20 .line 1811 iget-object v1, p0, Landroid/support/v4/media/MediaBrowserCompat$Subscription;->mCallbacks:Ljava/util/List; invoke-interface {v1, v0}, Ljava/util/List;->get(I)Ljava/lang/Object; move-result-object v1 check-cast v1, Landroid/support/v4/media/MediaBrowserCompat$SubscriptionCallback; .line 1814 :goto_1f return-object v1 .line 1809 :cond_20 add-int/lit8 v0, v0, 0x1 goto :goto_1 .line 1814 :cond_23 const/4 v1, 0x0 goto :goto_1f .end method .method public getCallbacks()Ljava/util/List; .registers 2 .annotation system Ldalvik/annotation/Signature; value = { "()", "Ljava/util/List", "<", "Landroid/support/v4/media/MediaBrowserCompat$SubscriptionCallback;", ">;" } .end annotation .prologue .line 1805 iget-object v0, p0, Landroid/support/v4/media/MediaBrowserCompat$Subscription;->mCallbacks:Ljava/util/List; return-object v0 .end method .method public getOptionsList()Ljava/util/List; .registers 2 .annotation system Ldalvik/annotation/Signature; value = { "()", "Ljava/util/List", "<", "Landroid/os/Bundle;", ">;" } .end annotation .prologue .line 1801 iget-object v0, p0, Landroid/support/v4/media/MediaBrowserCompat$Subscription;->mOptionsList:Ljava/util/List; return-object v0 .end method .method public isEmpty()Z .registers 2 .prologue .line 1797 iget-object v0, p0, Landroid/support/v4/media/MediaBrowserCompat$Subscription;->mCallbacks:Ljava/util/List; invoke-interface {v0}, Ljava/util/List;->isEmpty()Z move-result v0 return v0 .end method .method public putCallback(Landroid/os/Bundle;Landroid/support/v4/media/MediaBrowserCompat$SubscriptionCallback;)V .registers 5 .param p1, "options" # Landroid/os/Bundle; .param p2, "callback" # Landroid/support/v4/media/MediaBrowserCompat$SubscriptionCallback; .prologue .line 1818 const/4 v0, 0x0 .local v0, "i":I :goto_1 iget-object v1, p0, Landroid/support/v4/media/MediaBrowserCompat$Subscription;->mOptionsList:Ljava/util/List; invoke-interface {v1}, Ljava/util/List;->size()I move-result v1 if-ge v0, v1, :cond_20 .line 1819 iget-object v1, p0, Landroid/support/v4/media/MediaBrowserCompat$Subscription;->mOptionsList:Ljava/util/List; invoke-interface {v1, v0}, Ljava/util/List;->get(I)Ljava/lang/Object; move-result-object v1 check-cast v1, Landroid/os/Bundle; invoke-static {v1, p1}, Landroid/support/v4/media/MediaBrowserCompatUtils;->areSameOptions(Landroid/os/Bundle;Landroid/os/Bundle;)Z move-result v1 if-eqz v1, :cond_1d .line 1820 iget-object v1, p0, Landroid/support/v4/media/MediaBrowserCompat$Subscription;->mCallbacks:Ljava/util/List; invoke-interface {v1, v0, p2}, Ljava/util/List;->set(ILjava/lang/Object;)Ljava/lang/Object; .line 1826 :goto_1c return-void .line 1818 :cond_1d add-int/lit8 v0, v0, 0x1 goto :goto_1 .line 1824 :cond_20 iget-object v1, p0, Landroid/support/v4/media/MediaBrowserCompat$Subscription;->mCallbacks:Ljava/util/List; invoke-interface {v1, p2}, Ljava/util/List;->add(Ljava/lang/Object;)Z .line 1825 iget-object v1, p0, Landroid/support/v4/media/MediaBrowserCompat$Subscription;->mOptionsList:Ljava/util/List; invoke-interface {v1, p1}, Ljava/util/List;->add(Ljava/lang/Object;)Z goto :goto_1c .end method
{ "content_hash": "7708151df81e4ea02ca36fc328380832", "timestamp": "", "source": "github", "line_count": 241, "max_line_length": 135, "avg_line_length": 25.767634854771785, "alnum_prop": 0.6747181964573269, "repo_name": "AresS31/SCI", "id": "9926513b326cab44fef51e7831e162d0ef72220d", "size": "6210", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "payloads/smali/support/v4/media/MediaBrowserCompat$Subscription.smali", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "PHP", "bytes": "4276" }, { "name": "Python", "bytes": "48120" }, { "name": "Smali", "bytes": "15529276" } ], "symlink_target": "" }
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>de.tu_berlin.cit</groupId> <artifactId>intercloud</artifactId> <version>0.0.1</version> </parent> <groupId>de.tu_berlin.cit.intercloud</groupId> <artifactId>xmpp-cep</artifactId> <packaging>jar</packaging> <name>XMPP Complex Event Processing Module</name> <build> <resources> <resource> <directory>src/main/xsd</directory> </resource> </resources> <plugins> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>xmlbeans-maven-plugin</artifactId> <version>2.3.3</version> <executions> <execution> <phase>generate-sources</phase> <goals> <goal>xmlbeans</goal> </goals> </execution> </executions> <inherited>true</inherited> <configuration> <xmlConfigs> <xmlConfig implementation="java.io.File">src/main/xsd/xmlbeans.xsdconfig </xmlConfig> </xmlConfigs> <schemaDirectory>src/main/xsd</schemaDirectory> <verbose>true</verbose> </configuration> </plugin> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>build-helper-maven-plugin</artifactId> <version>1.9.1</version> <executions> <execution> <id>add-source</id> <phase>generate-sources</phase> <goals> <goal>add-source</goal> </goals> <configuration> <sources> <source>${basedir}/target/generated-sources/xmlbeans</source> </sources> </configuration> </execution> </executions> </plugin> </plugins> <pluginManagement> <plugins> <plugin> <groupId>org.eclipse.m2e</groupId> <artifactId>lifecycle-mapping</artifactId> <version>1.0.0</version> <configuration> <lifecycleMappingMetadata> <pluginExecutions> <pluginExecution> <pluginExecutionFilter> <groupId> org.codehaus.mojo </groupId> <artifactId> xmlbeans-maven-plugin </artifactId> <versionRange> [2.3.3,) </versionRange> <goals> <goal>xmlbeans</goal> </goals> </pluginExecutionFilter> <action> <execute /> </action> </pluginExecution> <pluginExecution> <pluginExecutionFilter> <groupId> org.codehaus.mojo </groupId> <artifactId> build-helper-maven-plugin </artifactId> <versionRange> [1.9.1,) </versionRange> <goals> <goal>add-source</goal> </goals> </pluginExecutionFilter> <action> <execute /> </action> </pluginExecution> </pluginExecutions> </lifecycleMappingMetadata> </configuration> </plugin> </plugins> </pluginManagement> </build> <dependencies> <!-- intercloud dependencies --> <dependency> <groupId>de.tu_berlin.cit.intercloud</groupId> <artifactId>xmpp-rest</artifactId> <version>0.0.1</version> </dependency> <dependency> <groupId>de.tu_berlin.cit.intercloud</groupId> <artifactId>xmpp-occi</artifactId> <version>0.0.1</version> </dependency> <!-- xmlbeans --> <dependency> <groupId>org.apache.xmlbeans</groupId> <artifactId>xmlbeans</artifactId> <version>2.4.0</version> <scope>compile</scope> </dependency> <dependency> <groupId>dom4j</groupId> <artifactId>dom4j</artifactId> <version>1.6.1</version> </dependency> <!-- cep --> <dependency> <groupId>com.espertech</groupId> <artifactId>esper</artifactId> <version>5.3.0</version> <exclusions> <exclusion> <groupId>log4j</groupId> <artifactId>log4j</artifactId> </exclusion> </exclusions> </dependency> </dependencies> </project>
{ "content_hash": "34b8d5c32cebcb88a535ae642b56df89", "timestamp": "", "source": "github", "line_count": 159, "max_line_length": 104, "avg_line_length": 25.867924528301888, "alnum_prop": 0.5959153902261123, "repo_name": "citlab/Intercloud", "id": "8abffe5f5f212e92aec7985de4c1dbf162063684", "size": "4113", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "xmpp-cep/pom.xml", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "6758" }, { "name": "HTML", "bytes": "30200" }, { "name": "Java", "bytes": "1239045" }, { "name": "Shell", "bytes": "461" }, { "name": "XSLT", "bytes": "46742" } ], "symlink_target": "" }
<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.errorpoint.cameraexistingapp" android:versionCode="1" android:versionName="1.0" > <uses-sdk android:minSdkVersion="8" android:targetSdkVersion="17" /> <application android:allowBackup="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/AppTheme" > <activity android:name="com.errorpoint.cameraexistingapp.MainActivity" android:label="@string/app_name" > <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> </application> </manifest>
{ "content_hash": "7f848090df1fdff0c72a42e698766b26", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 76, "avg_line_length": 32.592592592592595, "alnum_prop": 0.6181818181818182, "repo_name": "pengzhao001/android-apps", "id": "729b91cfd77f658e47d69f71a3ff2995bc27031c", "size": "880", "binary": false, "copies": "4", "ref": "refs/heads/master", "path": "CameraExistingApp/AndroidManifest.xml", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "165" }, { "name": "HTML", "bytes": "5542" }, { "name": "Java", "bytes": "2987344" } ], "symlink_target": "" }
<Type Name="SchemaImporterExtensionElementCollection" FullName="System.Xml.Serialization.Configuration.SchemaImporterExtensionElementCollection"> <TypeSignature Language="C#" Value="public sealed class SchemaImporterExtensionElementCollection : System.Configuration.ConfigurationElementCollection" /> <AssemblyInfo> <AssemblyName>System.Xml</AssemblyName> <AssemblyVersion>2.0.0.0</AssemblyVersion> </AssemblyInfo> <Base> <BaseTypeName>System.Configuration.ConfigurationElementCollection</BaseTypeName> </Base> <Interfaces /> <Attributes> <Attribute> <AttributeName>System.Configuration.ConfigurationCollection(typeof(System.Xml.Serialization.Configuration.SchemaImporterExtensionElement), CollectionType=System.Configuration.ConfigurationElementCollectionType.AddRemoveClearMap)</AttributeName> </Attribute> </Attributes> <Docs> <summary>To be added.</summary> <remarks>To be added.</remarks> </Docs> <Members> <Member MemberName=".ctor"> <MemberSignature Language="C#" Value="public SchemaImporterExtensionElementCollection ();" /> <MemberType>Constructor</MemberType> <AssemblyInfo> <AssemblyVersion>2.0.0.0</AssemblyVersion> </AssemblyInfo> <Parameters /> <Docs> <summary>To be added.</summary> <remarks>To be added.</remarks> </Docs> </Member> <Member MemberName="Add"> <MemberSignature Language="C#" Value="public void Add (System.Xml.Serialization.Configuration.SchemaImporterExtensionElement element);" /> <MemberType>Method</MemberType> <AssemblyInfo> <AssemblyVersion>2.0.0.0</AssemblyVersion> </AssemblyInfo> <ReturnValue> <ReturnType>System.Void</ReturnType> </ReturnValue> <Parameters> <Parameter Name="element" Type="System.Xml.Serialization.Configuration.SchemaImporterExtensionElement" /> </Parameters> <Docs> <param name="element">To be added.</param> <summary>To be added.</summary> <remarks>To be added.</remarks> </Docs> </Member> <Member MemberName="Clear"> <MemberSignature Language="C#" Value="public void Clear ();" /> <MemberType>Method</MemberType> <AssemblyInfo> <AssemblyVersion>2.0.0.0</AssemblyVersion> </AssemblyInfo> <ReturnValue> <ReturnType>System.Void</ReturnType> </ReturnValue> <Parameters /> <Docs> <summary>To be added.</summary> <remarks>To be added.</remarks> </Docs> </Member> <Member MemberName="CreateNewElement"> <MemberSignature Language="C#" Value="protected override System.Configuration.ConfigurationElement CreateNewElement ();" /> <MemberType>Method</MemberType> <AssemblyInfo> <AssemblyVersion>2.0.0.0</AssemblyVersion> </AssemblyInfo> <ReturnValue> <ReturnType>System.Configuration.ConfigurationElement</ReturnType> </ReturnValue> <Parameters /> <Docs> <summary>To be added.</summary> <returns>To be added.</returns> <remarks>To be added.</remarks> </Docs> </Member> <Member MemberName="GetElementKey"> <MemberSignature Language="C#" Value="protected override object GetElementKey (System.Configuration.ConfigurationElement element);" /> <MemberType>Method</MemberType> <AssemblyInfo> <AssemblyVersion>2.0.0.0</AssemblyVersion> </AssemblyInfo> <ReturnValue> <ReturnType>System.Object</ReturnType> </ReturnValue> <Parameters> <Parameter Name="element" Type="System.Configuration.ConfigurationElement" /> </Parameters> <Docs> <param name="element">To be added.</param> <summary>To be added.</summary> <returns>To be added.</returns> <remarks>To be added.</remarks> </Docs> </Member> <Member MemberName="IndexOf"> <MemberSignature Language="C#" Value="public int IndexOf (System.Xml.Serialization.Configuration.SchemaImporterExtensionElement element);" /> <MemberType>Method</MemberType> <AssemblyInfo> <AssemblyVersion>2.0.0.0</AssemblyVersion> </AssemblyInfo> <ReturnValue> <ReturnType>System.Int32</ReturnType> </ReturnValue> <Parameters> <Parameter Name="element" Type="System.Xml.Serialization.Configuration.SchemaImporterExtensionElement" /> </Parameters> <Docs> <param name="element">To be added.</param> <summary>To be added.</summary> <returns>To be added.</returns> <remarks>To be added.</remarks> </Docs> </Member> <Member MemberName="Item"> <MemberSignature Language="C#" Value="public System.Xml.Serialization.Configuration.SchemaImporterExtensionElement this[int index] { set; get; }" /> <MemberType>Property</MemberType> <AssemblyInfo> <AssemblyVersion>2.0.0.0</AssemblyVersion> </AssemblyInfo> <ReturnValue> <ReturnType>System.Xml.Serialization.Configuration.SchemaImporterExtensionElement</ReturnType> </ReturnValue> <Parameters> <Parameter Name="index" Type="System.Int32" /> </Parameters> <Docs> <param name="index">To be added.</param> <summary>To be added.</summary> <value>To be added.</value> <remarks>To be added.</remarks> </Docs> </Member> <Member MemberName="Item"> <MemberSignature Language="C#" Value="public System.Xml.Serialization.Configuration.SchemaImporterExtensionElement this[string name] { set; get; }" /> <MemberType>Property</MemberType> <AssemblyInfo> <AssemblyVersion>2.0.0.0</AssemblyVersion> </AssemblyInfo> <ReturnValue> <ReturnType>System.Xml.Serialization.Configuration.SchemaImporterExtensionElement</ReturnType> </ReturnValue> <Parameters> <Parameter Name="name" Type="System.String" /> </Parameters> <Docs> <param name="name">To be added.</param> <summary>To be added.</summary> <value>To be added.</value> <remarks>To be added.</remarks> </Docs> </Member> <Member MemberName="Remove"> <MemberSignature Language="C#" Value="public void Remove (string name);" /> <MemberType>Method</MemberType> <AssemblyInfo> <AssemblyVersion>2.0.0.0</AssemblyVersion> </AssemblyInfo> <ReturnValue> <ReturnType>System.Void</ReturnType> </ReturnValue> <Parameters> <Parameter Name="name" Type="System.String" /> </Parameters> <Docs> <param name="name">To be added.</param> <summary>To be added.</summary> <remarks>To be added.</remarks> </Docs> </Member> <Member MemberName="Remove"> <MemberSignature Language="C#" Value="public void Remove (System.Xml.Serialization.Configuration.SchemaImporterExtensionElement element);" /> <MemberType>Method</MemberType> <AssemblyInfo> <AssemblyVersion>2.0.0.0</AssemblyVersion> </AssemblyInfo> <ReturnValue> <ReturnType>System.Void</ReturnType> </ReturnValue> <Parameters> <Parameter Name="element" Type="System.Xml.Serialization.Configuration.SchemaImporterExtensionElement" /> </Parameters> <Docs> <param name="element">To be added.</param> <summary>To be added.</summary> <remarks>To be added.</remarks> </Docs> </Member> <Member MemberName="RemoveAt"> <MemberSignature Language="C#" Value="public void RemoveAt (int i);" /> <MemberType>Method</MemberType> <AssemblyInfo> <AssemblyVersion>2.0.0.0</AssemblyVersion> </AssemblyInfo> <ReturnValue> <ReturnType>System.Void</ReturnType> </ReturnValue> <Parameters> <Parameter Name="i" Type="System.Int32" /> </Parameters> <Docs> <param name="i">To be added.</param> <summary>To be added.</summary> <remarks>To be added.</remarks> </Docs> </Member> </Members> </Type>
{ "content_hash": "576b1977eab15aff094e54fbee092799", "timestamp": "", "source": "github", "line_count": 213, "max_line_length": 250, "avg_line_length": 38.136150234741784, "alnum_prop": 0.6512372276252616, "repo_name": "matthid/Yaaf.Xmpp.Runtime", "id": "98bcae2384e635f4e003b2a613d6ee0d83cd58fb", "size": "8123", "binary": false, "copies": "2", "ref": "refs/heads/develop", "path": "src/source/System.XML/Documentation/en/System.Xml.Serialization.Configuration/SchemaImporterExtensionElementCollection.xml", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "22507" }, { "name": "C", "bytes": "17506" }, { "name": "C#", "bytes": "5548921" }, { "name": "F#", "bytes": "549201" }, { "name": "HTML", "bytes": "173" }, { "name": "Makefile", "bytes": "11845" }, { "name": "Shell", "bytes": "3623" }, { "name": "XSLT", "bytes": "5252" } ], "symlink_target": "" }
<?php namespace luya\cms\frontend\events; /** * An event will be triggered before the rendering of cms controller content happends. * * @author Basil Suter <basil@nadar.io> */ class BeforeRenderEvent extends \yii\base\Event { public $isValid = true; public $menu = null; }
{ "content_hash": "74f3c082f0c8f266ae7c4039cbb352bb", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 86, "avg_line_length": 19.466666666666665, "alnum_prop": 0.6952054794520548, "repo_name": "vuongminh/luya", "id": "ae9737d6bfeed5f7fced9f7eb1bec4a6aed4ccae", "size": "292", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "modules/cms/src/frontend/events/BeforeRenderEvent.php", "mode": "33188", "license": "mit", "language": [ { "name": "ApacheConf", "bytes": "1509" }, { "name": "CSS", "bytes": "229397" }, { "name": "HTML", "bytes": "45192" }, { "name": "JavaScript", "bytes": "205670" }, { "name": "PHP", "bytes": "2509552" }, { "name": "Shell", "bytes": "3746" } ], "symlink_target": "" }
MarkdownViewer ============== ## Requirement - Rubygems of [rdiscount](https://github.com/rtomayko/rdiscount) ## Modify rdiscount for MacRuby When you installed rdiscount with "`sudo macgem install rdiscount`", need slight changing. $ sudo vi /Library/Frameworks/MacRuby.framework/Versions/Current/usr/lib/ruby/Gems/1.9.2/gems/rdiscount-1.6.8/lib/rdiscount.rb Please change the following line to the end of the rdiscount.rb require 'rdiscount.bundle' # original "require 'rdiscount.so'"
{ "content_hash": "f7f5976e2e1e6266425b29e8934839f1", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 131, "avg_line_length": 31.25, "alnum_prop": 0.748, "repo_name": "Watson1978/MacRuby-Samples", "id": "24f8761105f95405c8b37c5161512a82e06d140a", "size": "500", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "MarkdownViewer/README.md", "mode": "33188", "license": "mit", "language": [ { "name": "Objective-C", "bytes": "19745" }, { "name": "Ruby", "bytes": "39104" } ], "symlink_target": "" }
http://domain.tld https://domain.tld ftp://domain.tld user@domain.tld www.domain.tld ``` fenced code ``` ~~~ more fenced code ~~~ I am text. <div>I am laxed spaced HTML</div> I am more text. This is _emphased_, but not inside var names like some_foo_bar. #this is no header Text can ~~not~~ be striked through. E = mc^2 | Left-Aligned | Center Aligned | Right Aligned | | :------------ |:---------------:| -----:| | col 3 is | some wordy text | $1600 | | col 2 is | centered | $12 |
{ "content_hash": "f61825d62080b77e9ba0e7588969c4c1", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 63, "avg_line_length": 15.176470588235293, "alnum_prop": 0.5755813953488372, "repo_name": "simbo/metalsmith-robotskirt", "id": "5135d0fdc3dedfbffa00422eb8f3fbf12e1ca802", "size": "517", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "test/fixtures/extensions/src/index.md", "mode": "33188", "license": "mit", "language": [ { "name": "JavaScript", "bytes": "7477" } ], "symlink_target": "" }
struct Transform2DComponent final : public Component { vec2 position; f32 orientation; vec2 scale; Transform2DComponent(Entity* parent); Transform2DComponent(Entity* parent, vec2 position); Transform2DComponent(Entity* parent, vec2 position, f32 orientation); Transform2DComponent(Entity* parent, vec2 position, f32 orientation, f32 scale); Transform2DComponent(Entity* parent, vec2 position, f32 orientation, vec2 scale); void update() override; }; #endif // TRANSFORM2D_COMPONENT_HPP
{ "content_hash": "3ffc220860a4b537b6443e7a5fc2e8a7", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 85, "avg_line_length": 29.27777777777778, "alnum_prop": 0.7476280834914611, "repo_name": "ckgomes/projects_archive", "id": "78c13d435cfbbcdb0c15c9cec6020c23ce799467", "size": "663", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "spinok/source/Components/Transform2DComponent.hpp", "mode": "33188", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "1767" }, { "name": "C", "bytes": "46550" }, { "name": "C#", "bytes": "64574" }, { "name": "C++", "bytes": "120821" }, { "name": "GLSL", "bytes": "2628" } ], "symlink_target": "" }
/* globals $ requester */ // Function to make current page nav tab active $(document).ready(function() { // $('[data-toggle="popover"]').popover('show'); $('#myModal').modal(); var path = window.location.pathname; $('#explore-nav').removeClass('active'); $('#new-nav').removeClass('active') $('#about-nav').removeClass('active'); $('#profile-nav').removeClass('active'); if (path === '/projects') { $('#explore-nav').toggleClass('active'); } else if (path.includes('/projects/new')) { $('#new-nav').toggleClass('active') } else if (path.includes('about')) { $('#about-nav').toggleClass('active'); } else if (path.includes('auth/profile')) { $('#profile-nav').toggleClass('active'); } }); // Function to get search results function loadSerachResults(options) { requester.get('/api/projects/search', options) .then(function(response) { $('#main').html(response); }); } $('#search-submit').on('click', function(event) { var value = $("input[name='searchValue']").val().trim(); var options = { data: { searchValue: value } }; loadSerachResults(options); }) // Function to prevent code injection function preventScripts(textInput) { return $('<div>').text(textInput).html(); //return textInput.replace(/</g, "&lt;").replace(/>/g, "&gt;"); } // Funciton to subscribe to newsletter function subscribe(options) { requester.post('/api/subscribe', options, true) .then(function(response) { $('#subscribe-email') .attr('data-content', response.message) .popover('show'); setTimeout(function() { $('#subscribe-email').popover('hide'); $("#subscribe-form").trigger('reset'); }, 2000); }) .catch(function(err) { console.log('--- Error with subscribing ---'); console.log(err); }); } $('#subscribe-form').on('submit', function(event) { event.preventDefault(); var $email = preventScripts($("input[name='email']").val().trim()); var options = { data: { email: $email } }; subscribe(options); }) // Function to send feedback function sendEmail(options) { requester.post('/api/feedback', options, true) .then(function(response) { $("#contact-modal").trigger('reset'); $('#contact-modal').modal('hide'); $('#flash-response').html(response); $('#myModal').modal('show'); }) .catch(function(err) { console.log('--- Error with sending contact form ---'); console.log(err); }); } $('#contact-modal').on('submit', function(event) { event.preventDefault(); var $sender = preventScripts($('#sender-name').val().trim()); var $subject = preventScripts($('#subject-text').val().trim()); var $message = preventScripts($('#message-text').val().trim()); var options = { data: { sender: $sender, subject: $subject, message: $message, } }; sendEmail(options); })
{ "content_hash": "8ebe6f9ec9eb5844ad0b340b91fef336", "timestamp": "", "source": "github", "line_count": 105, "max_line_length": 71, "avg_line_length": 29.933333333333334, "alnum_prop": 0.5558383709831372, "repo_name": "TeamVencedores/CrowdFundingWebsite", "id": "88b4ee5ecc5d49e67eccd2a48a9902233c33662f", "size": "3143", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "static/js/nav.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "170315" }, { "name": "HTML", "bytes": "30389" }, { "name": "JavaScript", "bytes": "147444" } ], "symlink_target": "" }
import Image from './AddImage'; import ImageOptions from './OptionsMenu'; export default { component: Image, icon: 'media', moduleName: 'devdecks-image', tooltip: 'Image', optionsMenuComponent: ImageOptions, state: { height: 200, lockAspectRatio: false, value: '', }, };
{ "content_hash": "e808e0b9254c5bbaa1ea205eea44cb8c", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 41, "avg_line_length": 19.866666666666667, "alnum_prop": 0.6644295302013423, "repo_name": "DevDecks/devdecks", "id": "f1567bda5058659f7078faea1bd3f0f50219fed0", "size": "298", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "app/plugins/node_modules/devdecks-image/index.ts", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "3461" }, { "name": "HTML", "bytes": "934" }, { "name": "JavaScript", "bytes": "21159" }, { "name": "TypeScript", "bytes": "44878" } ], "symlink_target": "" }
var sinon = require('sinon'); module.exports = function () { this.name = 'foo_logger'; this.initialize = sinon.spy(); this.log = sinon.spy(); };
{ "content_hash": "1a5f9a580ef034efa1dec9d0d1208e65", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 35, "avg_line_length": 21.375, "alnum_prop": 0.5555555555555556, "repo_name": "skytap/minorjs", "id": "2ff9b341b2e3496628e37c7e9384eccea2de160f", "size": "767", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "test/data/lib/loggers/foo_logger.js", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Gherkin", "bytes": "1132" }, { "name": "JavaScript", "bytes": "164503" } ], "symlink_target": "" }
require "optparse" require "pty" require "json" require 'termios' LFLAG_MASK = ~(Termios::ISIG | Termios::ICANON | Termios::IEXTEN | Termios::ECHO | Termios::ECHOE | Termios::ECHOK | Termios::ECHONL) IFLAG_MASK = ~(Termios::IGNBRK | Termios::BRKINT | Termios::PARMRK | Termios::ISTRIP | Termios::INLCR | Termios::IGNCR | Termios::ICRNL | Termios::IXON) class RecordSession UTF = Encoding.find "utf-8" def initialize(argv = ARGV) parse_options(argv) end def parse_options(argv) @outfile_name = "terminal.record" options = OptionParser.new do |opts| opts.banner = "usage: record_teminal [ -o output_file ]" opts.on("-o", "--output-to [name]", "Where to record session (default: terminal.record)") do |name| @outfile_name = name end opts.on("-h", "--help", "Display usage information") do display_help_and_exit end end options.parse!(argv) end def record @last_time = timestamp master, slave = PTY.open setup_tty(slave) do output_pid = fork do Signal.trap("CHLD") do master.close end fork do master.close Process.setsid slave.ioctl(536900705, 0) handle_shell(slave) end STDIN.close slave.close handle_output(master) end input_pid = fork do slave.close handle_input(master) end Process.wait(output_pid) Process.kill("KILL", input_pid) Process.wait(input_pid) end puts "Session recorded to #@outfile_name" end def setup_tty(slave) save_state = Termios.tcgetattr(STDIN) Termios.tcsetattr(slave, Termios::TCSAFLUSH, save_state) new_state = save_state.clone new_state.iflag &= 0#IFLAG_MASK new_state.lflag &= LFLAG_MASK new_state.oflag = Termios::OPOST new_state.cflag &= ~(Termios::CSIZE || Termios::PARENB) new_state.cflag |= Termios::CS8 new_state.cc[Termios::VINTR] = new_state.cc[Termios::VQUIT] = new_state.cc[Termios::VERASE] = new_state.cc[Termios::VKILL] = Termios::POSIX_VDISABLE new_state.cc[Termios::VEOF] = 1 new_state.cc[Termios::VEOL] = 0 Termios::tcsetattr(STDIN, Termios::TCSAFLUSH, new_state) begin yield save_state ensure Termios.tcsetattr(STDIN, Termios::TCSAFLUSH, save_state) end end def handle_shell(slave) STDIN.reopen(slave) STDOUT.reopen(slave) STDERR.reopen(slave) slave.close shell = ENV["SHELL"] || "/bin/sh" opts = ["-i" ] if shell =~ /zsh/ opts << "+o" << "prompt_sp" end ENV["RECORDING"] = "YES" exec(shell, *opts) end def handle_input(master) loop do data = STDIN.sysread(1000) master.syswrite(data) end rescue SystemCallError raise rescue EOFError # exit end class Result def initialize(terminal_size) @stream = [] @result = { size: terminal_size, stream: @stream } end def add_output(delay, chars) if delay <= 0 && @stream.size > 0 @stream.last[:val] << chars else @stream << { t: "op", d: delay, val: chars } end end def write(outfile_name) File.open(outfile_name, "w:utf-8") do |op| op.puts("the_recording_data(#{JSON.generate(@result)})") end end end def handle_output(master) STDOUT.sync = true result = Result.new(terminal_size) begin loop do data = master.sysread(1000) data.force_encoding(UTF) STDOUT.write(data) time = timestamp result.add_output(time - @last_time, data) @last_time = time end rescue EOFError, Errno::EBADF result.write(@outfile_name) rescue Exception => e STDERR.puts e.inspect end end def log_data(data) @outfile.syswrite(JSON.generate([timestamp - @start_time, data])) @outfile.syswrite("\n") end def timestamp (Time.now.to_r * 1000).to_i end def terminal_size lines, columns = IO.console.winsize { lines: lines, columns: columns } rescue {lines: 25, columns: 80} end def display_help_and_exit STDERR.puts %{ record_session [ -o output_file ] Record a terminal session to output_file (default terminal.record). %} exit(1) end end
{ "content_hash": "cd867d53cabe1636806498a07dc85b00", "timestamp": "", "source": "github", "line_count": 203, "max_line_length": 77, "avg_line_length": 22.54679802955665, "alnum_prop": 0.5728643216080402, "repo_name": "pragdave/record_session", "id": "d4145fdee6f0c52594df8b64d3225f4bfc4ef4ea", "size": "4577", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "lib/record_session.rb", "mode": "33188", "license": "mit", "language": [ { "name": "Ruby", "bytes": "5686" } ], "symlink_target": "" }
@extends('connexion::templates.backend') @section('css') @parent @stop @section('content') <div class="container-fluid spark-screen"> @include('connexion::shared.errors') <div class="row"> <div class="col-md-12"> <div class="panel panel-default"> <div class="panel-heading"> <div class="row"> <div class="col-md-6"><h4>Slideshows</h4></div> <div class="col-md-6"><a href="{{route('admin.slideshows.create')}}" class="btn btn-primary pull-right"><i class="fa fa-pencil"></i> Add a new slideshow</a></div> </div> </div> <div class="panel-body"> <table id="indexTable" class="table table-striped table-hover table-condensed table-responsive" width="100%" cellspacing="0"> <thead> <tr> <th>Slideshow</th><th>Slides</th> </tr> </thead> <tfoot> <tr> <th>Slideshow</th><th>Slides</th> </tr> </tfoot> <tbody> @forelse ($slideshows as $slideshow) <tr> <td><a href="{{route('admin.slideshows.show',$slideshow->id)}}">{{$slideshow->slideshow}}</a></td> <td><a href="{{route('admin.slideshows.show',$slideshow->id)}}">{{count($slideshow->slides)}}</a></td> </tr> @empty <tr><td>No slideshows have been added yet</td></tr> @endforelse </tbody> </table> </div> </div> </div> </div> </div> @endsection @section('js') @parent <script language="javascript"> $(document).ready(function() { $('#indexTable').DataTable(); } ); </script> @endsection
{ "content_hash": "4b69f2f606a347c097be6c71f0971e86", "timestamp": "", "source": "github", "line_count": 56, "max_line_length": 190, "avg_line_length": 41.42857142857143, "alnum_prop": 0.38362068965517243, "repo_name": "bishopm/base", "id": "1a3272657b8c86aa7888183c5dce771218e0708a", "size": "2320", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "src/Resources/views/slideshows/index.blade.php", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "206922" }, { "name": "HTML", "bytes": "264805" }, { "name": "JavaScript", "bytes": "838943" }, { "name": "PHP", "bytes": "380718" } ], "symlink_target": "" }
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!--NewPage--> <HTML> <HEAD> <!-- Generated by javadoc (build 1.6.0_26) on Tue Feb 14 08:16:37 UTC 2012 --> <TITLE> Uses of Class org.apache.hadoop.security.authentication.client.PseudoAuthenticator (Hadoop 1.0.1 API) </TITLE> <META NAME="date" CONTENT="2012-02-14"> <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../../../stylesheet.css" TITLE="Style"> <SCRIPT type="text/javascript"> function windowTitle() { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="Uses of Class org.apache.hadoop.security.authentication.client.PseudoAuthenticator (Hadoop 1.0.1 API)"; } } </SCRIPT> <NOSCRIPT> </NOSCRIPT> </HEAD> <BODY BGCOLOR="white" onload="windowTitle();"> <HR> <!-- ========= START OF TOP NAVBAR ======= --> <A NAME="navbar_top"><!-- --></A> <A HREF="#skip-navbar_top" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_top_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&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/hadoop/security/authentication/client/PseudoAuthenticator.html" title="class in org.apache.hadoop.security.authentication.client"><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/hadoop/security/authentication/client//class-usePseudoAuthenticator.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="PseudoAuthenticator.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 Class<br>org.apache.hadoop.security.authentication.client.PseudoAuthenticator</B></H2> </CENTER> No usage of org.apache.hadoop.security.authentication.client.PseudoAuthenticator <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/hadoop/security/authentication/client/PseudoAuthenticator.html" title="class in org.apache.hadoop.security.authentication.client"><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/hadoop/security/authentication/client//class-usePseudoAuthenticator.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="PseudoAuthenticator.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 &copy; 2009 The Apache Software Foundation </BODY> </HTML>
{ "content_hash": "25567bdd4c530ca6ab98eefc1bcbe55e", "timestamp": "", "source": "github", "line_count": 144, "max_line_length": 279, "avg_line_length": 44.416666666666664, "alnum_prop": 0.6214821763602252, "repo_name": "hoppinghippo/HadoopMapReduce", "id": "d1d05a470e829340809eab5f11de99cc4d30501c", "size": "6396", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "docs/api/org/apache/hadoop/security/authentication/client/class-use/PseudoAuthenticator.html", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "AspectJ", "bytes": "64797" }, { "name": "C", "bytes": "332613" }, { "name": "C++", "bytes": "460930" }, { "name": "CSS", "bytes": "34759" }, { "name": "HTML", "bytes": "932320" }, { "name": "Java", "bytes": "16215137" }, { "name": "JavaScript", "bytes": "59122" }, { "name": "Makefile", "bytes": "7960" }, { "name": "Objective-C", "bytes": "118273" }, { "name": "PHP", "bytes": "152555" }, { "name": "Perl", "bytes": "149888" }, { "name": "Python", "bytes": "1066410" }, { "name": "Ruby", "bytes": "28485" }, { "name": "Shell", "bytes": "1667689" }, { "name": "Smalltalk", "bytes": "56562" }, { "name": "TeX", "bytes": "26547" }, { "name": "Thrift", "bytes": "3965" }, { "name": "XSLT", "bytes": "27004" } ], "symlink_target": "" }
title: The Pulsar C++ client tags: [client, cpp] --- <!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you 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. --> ## Supported platforms The Pulsar C++ client has been successfully tested on **MacOS** and **Linux**. ## Linux There are recipes that build RPM and Debian packages containing a statically linked `libpulsar.so` / `libpulsar.a` with all the required dependencies. To build the C++ library packages, first build the Java packages: ```shell mvn install -DskipTests ``` #### RPM ```shell pulsar-client-cpp/pkg/rpm/docker-build-rpm.sh ``` This will build the RPM inside a Docker container and it will leave the RPMs in `pulsar-client-cpp/pkg/rpm/RPMS/x86_64/`. | Package name | Content | |-----|-----| | pulsar-client | Shared library `libpulsar.so` | | pulsar-client-devel | Static library `libpulsar.a` and C++ and C headers | | pulsar-client-debuginfo | Debug symbols for `libpulsar.so` | #### Deb To build Debian packages: ```shell pulsar-client-cpp/pkg/deb/docker-build-deb.sh ``` Debian packages will be created at `pulsar-client-cpp/pkg/deb/BUILD/DEB/` | Package name | Content | |-----|-----| | pulsar-client | Shared library `libpulsar.so` | | pulsar-client-dev | Static library `libpulsar.a` and C++ and C headers | ## MacOS Use the [Homebrew](https://brew.sh/) supplied recipe to build the Pulsar client lib on MacOS. ```shell brew install https://raw.githubusercontent.com/apache/incubator-pulsar/master/pulsar-client-cpp/homebrew/libpulsar.rb ``` If using Python 3 on MacOS, add the flag `--with-python3` to the above command. This will install the package with the library and headers. ## Connection URLs {% include explanations/client-url.md %} ## Consumer ```c++ Client client("pulsar://localhost:6650"); Consumer consumer; Result result = client.subscribe("my-topic", "my-subscribtion-name", consumer); if (result != ResultOk) { LOG_ERROR("Failed to subscribe: " << result); return -1; } Message msg; while (true) { consumer.receive(msg); LOG_INFO("Received: " << msg << " with payload '" << msg.getDataAsString() << "'"); consumer.acknowledge(msg); } client.close(); ``` ## Producer ```c++ Client client("pulsar://localhost:6650"); Producer producer; Result result = client.createProducer("my-topic", producer); if (result != ResultOk) { LOG_ERROR("Error creating producer: " << result); return -1; } // Publish 10 messages to the topic for (int i = 0; i < 10; i++){ Message msg = MessageBuilder().setContent("my-message").build(); Result res = producer.send(msg); LOG_INFO("Message sent: " << res); } client.close(); ``` ## Authentication ```cpp ClientConfiguration config = ClientConfiguration(); config.setTlsTrustCertsFilePath("/path/to/cacert.pem"); config.setTlsAllowInsecureConnection(false); config.setAuth(pulsar::AuthTls::create( "/path/to/client-cert.pem", "/path/to/client-key.pem");); Client client("pulsar+ssl://my-broker.com:6651", config); ```
{ "content_hash": "dc8189d94edb12f430cffe3e3b7258df", "timestamp": "", "source": "github", "line_count": 146, "max_line_length": 117, "avg_line_length": 25.684931506849313, "alnum_prop": 0.7, "repo_name": "jai1/pulsar", "id": "a1d9fb596b12bcd2280eeb573e610fb7d8a7022f", "size": "3754", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "site/docs/latest/clients/Cpp.md", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C", "bytes": "141682" }, { "name": "C++", "bytes": "1223657" }, { "name": "CMake", "bytes": "21062" }, { "name": "CSS", "bytes": "31825" }, { "name": "Dockerfile", "bytes": "24506" }, { "name": "Go", "bytes": "90492" }, { "name": "Groovy", "bytes": "20767" }, { "name": "HCL", "bytes": "13762" }, { "name": "HTML", "bytes": "133834" }, { "name": "Java", "bytes": "11867504" }, { "name": "JavaScript", "bytes": "73867" }, { "name": "Makefile", "bytes": "2305" }, { "name": "Python", "bytes": "376356" }, { "name": "Ruby", "bytes": "20575" }, { "name": "Shell", "bytes": "148915" }, { "name": "Smarty", "bytes": "1042" } ], "symlink_target": "" }
<configurations> <configuration name="Run hello" class="CargoCommandConfiguration" show_console_on_std_err="false" show_console_on_std_out="false"> <option name="additionalArguments" value="--package test-package --example hello" /> <option name="backtraceMode" value="2" /> <option name="channel" value="0" /> <option name="command" value="run" /> <option name="environmentVariables"> <map /> </option> <module name="light_idea_test_case"> <option name="moduleName" value="light_idea_test_case" /> </module> </configuration> </configurations>
{ "content_hash": "09d033bfd583a3712cd1d649073f9876", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 132, "avg_line_length": 42.285714285714285, "alnum_prop": 0.6739864864864865, "repo_name": "himikof/intellij-rust", "id": "4ae5d75067759f7c835e1669894bee64f4883be8", "size": "592", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/test/resources/org/rust/cargo/runconfig/producers/fixtures/executableProducerWorksForExamples.xml", "mode": "33188", "license": "mit", "language": [ { "name": "HTML", "bytes": "8593" }, { "name": "Java", "bytes": "1121" }, { "name": "Kotlin", "bytes": "1732761" }, { "name": "Lex", "bytes": "19046" }, { "name": "RenderScript", "bytes": "15" }, { "name": "Rust", "bytes": "76504" }, { "name": "Shell", "bytes": "760" } ], "symlink_target": "" }
var story_details = {}; story_details.MEDIA_PREFIX = "/site_media/media/"; story_details.default_story = {variables: [], story: [], choices: [], requirements: []}; story_details.all_images = {}; story_details.show_parsed_variables = true; story_details.show_choices_as_tree = true; story_details.choice_tree_shrink = false; story_details.new_tree_node_text = "-New Node-"; story_details.$tree_node_holder = null; story_details.$tree = null; //TODO: Generate random variables from generators //TODO: View Graphically with map background //TODO: Change to flatter JSON //TODO: Remove Story nodes - replace Chance with Story nodes //------------------------------------- story_details.suggested = {}; story_details.suggested.values = "epic fantastic superb great good fair average mediocre poor terrible none".split(" "); story_details.suggested.requirement_concept = "world city character".split(" "); story_details.suggested.requirement_name = { world: "magic technology war culture".split(" "), city: "near defense offense culture religion ocean wealth science industry".split(" "), character: "strength constitution dexterity intelligence wisdom charisma luck health wealth".split(" ") //TODO: Import Schema from some game obj }; story_details.suggested.effect_function = "increase decrease characterGainsMoney characterGainsServant characterGainsTreasure characterWounded battle familyCursed familyBlessed".split(" "); //TODO: Auto add: worldDecreaseMagic worldIncreaseMagic worldIncreaseTechnology worldDecreaseTechnology worldIncrease story_details.suggested.variable_kind = "item character location animal pet friend spell skill knowledge business child".split(" "); story_details.suggested.stories_type = "quest location story fight".split(" "); //------------------------------------- story_details.schema = { requirements: [ {field: "concept", options: story_details.suggested.requirement_concept, required: true, type: "options", default: "world"}, {field: "name", required: true, type: "options-suggested", options_relate_to: "concept", heading: true, default: "magic", options: story_details.suggested.requirement_name}, {field: "has", type: "string"}, {field: "exceeds", default: "mediocre", type: "options-suggested", options: story_details.suggested.values}, {field: "below", type: "options-suggested", options: story_details.suggested.values}, {field: "is", type: "string"} ], effects: [ {field: "function", required: true, type: "options-suggested", heading: true, default: "characterGainsMoney", options: story_details.suggested.effect_function}, {field: "value", type: "options-suggested", options: story_details.suggested.values, help_text:"What to pass to function, either named variable or concept.named or value"}, {field: "variable", type: "options", options_holder: 'variables', options_sub: 'nickname', help_text:"What to pass to function, wither named variable or concept.named or value"}, {field: "concept", type: "options", options: story_details.suggested.requirement_concept, default:"", help_text:"What to pass to function, either named variable or concept.named or value"}, {field: "named", type: "options-suggested", options_relate_to: "concept", default: "", options: story_details.suggested.requirement_name, help_text:"What to pass to function, either named variable or concept.named or value"} ], variables: [ {field: "name", required: true, type: "string", default: "gem"}, {field: "nickname", required: true, heading: true, type: "string", default: "Azure sparkling Gemstone"}, {field: "tags", type: "string"}, {field: "title", type: "string"}, {field: "value", type: "options-suggested", options: story_details.suggested.values}, {field: "kind", type: "options", required: true, options: story_details.suggested.variable_kind, default: "item"}, {field: "subkind", type: "string"}, {field: "strength", type: "options-suggested", options: story_details.suggested.values}, //TODO: Rethink this for use in fighting games... {field: "defense", type: "options-suggested", options: story_details.suggested.values}, {field: "armor", type: "string"}, {field: "weapons", type: "string"} ], story: [ {field: "text", heading: true, required: true, type: "textblock", default: "'Twas a dark and story night..."} ], stories: [ {field: "name", required: true, type: "string", default: "Something important happened...", heading: true}, {field: "anthology", required: true, type: "string", default: "Everywhere"}, {field: "tags", type: "string"}, {field: "type", type: "options", options: story_details.suggested.stories_type}, {field: "active", required: true, type: "options", options: ["True", "False"]}, {field: "max_times_usable", type: "integer"}, {field: "year_max", type: "integer"}, {field: "year_min", type: "integer"}, {field: "force_usage", type: "integer"}, {field: "description", type: "textblock", default: "Summary of story"} ], chances: [ {field: "id_link", type: "string", default: "", help_text:"Optional link to another chance or choice that this can link to"}, {field: "id", type: "string", default: "Optional id that can be linked to"}, {field: "title", heading: true, required: true, type: "textblock", default: "This is what happens..."} ], choices: [ {field: "id_link", type: "string", default: "", help_text:"Optional link to another chance or choice that this can link to"}, {field: "id", type: "string", default: "Optional id that can be linked to"}, {field: "title", heading: true, required: true, type: "string", default: "You can choose to..."} ], images: [ {field: "url", heading: true, required: true, type: "string", default: "image_name"} ] }; story_details.defaultObjectOfType = function (type) { var data = {}; var schema = story_details.schema[type] || story_details.schema[type + "s"] || {}; _.each(schema, function (schemata) { if (schemata.required) { data[schemata.field] = schemata.default; } }); return data; }; //======================================= story_details.init = function (story) { // story_details.schema.requirements[1].options = _.flatten(_.toArray(story_details.suggested.requirement_name)); story = story || story_details.default_story; //Link all images into the class object story_details.all_images = story.images; story_details.drawStory(story); $(document).on('showalert', '.alert', function () { window.setTimeout($.proxy(function () { $(this).fadeTo(500, 0).slideUp(500, function () { $(this).remove(); }); }, this), 5000); }); $('#battle_nodes') .css({cursor:'pointer'}) .on('mousedown', function (e) { var nodes = [ { id: true, text: 'Battle-node-holder', type: 'effect'} ]; return $.vakata.dnd.start(e, { 'jstree': true, 'obj': $(this), 'nodes': nodes}, '<div id="jstree-dnd" class="jstree-default"><i class="jstree-icon jstree-er"></i>Battle Event</div>'); }); }; story_details.drawStory = function (story) { story = story || story_details.default_story; //Draw story complex details $("#story, #choices, #variables, #downloads").empty(); // $("#requirements").append(story_details.buildRequirementsHolder(story.requirements)); story_details.showVariables(story.variables); story_details.showStory(story.story); story_details.buildDownloadButtons(); var $choices = $("#choices"); if (story_details.show_choices_as_tree) { var $tree = $("<div>").attr('id', 'story_tree').appendTo($choices); var $tree_node_holder = story_details.$tree_node_holder = $("<div>").appendTo($choices); story_details.treeFromData(story, $tree, $tree_node_holder); $('#variables').hide(); } else { $choices.append(story_details.buildChoices(story.choices)); $('#variables').show(); } }; story_details.showStory = function (data) { var $story = $("#story"); data = data || []; _.each(data, function (story) { var text = story_details.nodeTexts.story(story); if (text) { $("<div>") .addClass("story_text") .html(text) .appendTo($story); } $story.append(story_details.buildImagesHolder(story.images)); }); }; //This is the older div-based layout. Possibly delete if tree works well story_details.buildChoices = function (choices) { var $holder = $("<div>"); _.each(choices || [], function (choice) { var $opt = $("<div>") .addClass('choice_holder') .appendTo($holder); var title = "Player choice: <b>" + story_details.nodeTexts.choice(choice) + "</b>"; $("<span>") .addClass('choice_title') .html(title) .appendTo($opt); $opt.append(story_details.buildRequirementsHolder(choice.requirements)); $opt.append(story_details.buildEffectsHolder(choice.effects)); var chances = choice.chances || []; var num_chances = chances.length; _.each(chances, function (chance) { var percent = parseInt(100 / num_chances); var $sub_opt = $("<div>") .html(percent + "% : " + story_details.text(chance.title)) .addClass("chance spacer") .appendTo($opt); $sub_opt.append(story_details.buildRequirementsHolder(chance.requirements)); $sub_opt.append(story_details.buildEffectsHolder(chance.effects)); if (chance.choices) { $sub_opt.append(story_details.buildChoices(chance.choices)); } }); }); return $holder; }; story_details.showVariables = function (data) { var $vars = $("#variables"); data = data || []; _.each(data, function (variable) { var header = story_details.nodeTexts.variable(variable); var $var = $("<div>") .html(header) .appendTo($vars); if (variable.details) { $var .css("cursor", "hand") .attr("title", variable.details); } }); }; // --- HTML Holder Builders story_details.buildEffectsHolder = function (effects) { var $effects_holder = $("<span>"); _.each(effects, function (effect) { var text = "<b>" + story_details.nodeTexts.effect(effect) + "</b> "; $("<span>")//TODO: Pass it text and not have nested spans .html(text) .addClass('effect') .appendTo($effects_holder); }); return $effects_holder; }; story_details.nodeTexts = {}; story_details.nodeTexts.requirement = function (node) { var text = (node.concept || "default") + "." + node.name; if (node.has) { text += " has a value in it of " + node.has; } else if (node.exceeds) { text += " >= " + node.exceeds; } else if (node.below) { text += " <= " + node.below; } else if (node.is) { text += " = " + node.is; } else if (node.isnt) { text += " is not = " + node.isnt; } else { text += " is set and isn't 0"; } return text; }; story_details.nodeTexts.image = function (image) { var allImages = story_details.all_images; var url = null; if (_.isString(image) && _.str.startsWith(image, "http")) { url = image; } else if (image && image.url && _.str.startsWith(image.url, "http")) { url = image.url; } else if (image && image.url) { _.each(allImages, function (imageLookup) { if (imageLookup.url.indexOf(image.url) > 0) { url = story_details.MEDIA_PREFIX + imageLookup.url; } }); if (!url) url = image.url; } return url; }; story_details.nodeTexts.story = function (stories) { var text = ""; if (!_.isArray(stories)) stories = [stories]; _.each(stories, function (story) { if (story && story.text) { text += story.text; } }); return story_details.text(text); }; story_details.nodeTexts.chance = function (node, percent) { var text = ""; if (percent) { text = percent + "%: "; } text += (node.title || "Default"); return text; }; story_details.nodeTexts.effect = function (effect) { var text = effect.function || "effect"; if (effect.value) { text += "(" + effect.value + ")"; } if (effect.variable) { text += "(" + story_details.text(effect.variable) + ")"; } return text; }; story_details.nodeTexts.variable = function (variable) { var text = "[" + variable.nickname + "]: " + variable.name + ", Type: " + variable.type; if (variable.subtype) { text += " (" + variable.subtype + ")"; } if (variable.tags) { text += " (" + variable.tags + ")"; //TODO: Click on each to filter } return text; }; story_details.nodeTexts.choice = function (choice) { return story_details.text(choice.title); }; //--------------------- story_details.buildRequirementsHolder = function (data) { var $holder = $("<span>"); data = data || []; _.each(data, function (requirement) { var text = "<b>" + story_details.nodeTexts.requirement(requirement) + "</b> "; $("<span>") .addClass('requirement') .attr('title', "Requires") .html(text) .appendTo($holder); }); return $holder; }; story_details.buildImagesHolder = function (data) { var $holder = $("<span>"); _.each(data, function (image) { var url = story_details.nodeTexts.image(image); if (url) { $("<img>") .attr('src', url) .appendTo($holder); } }); return $holder; }; story_details.buildDownloadButtons = function () { var $downloads = $('#downloads'); $("<a>") .addClass('btn download') .text("Download Story as JSON") .on('click', function () { var obj = story_details.default_story; var data = "data:text/json;charset=utf-8," + encodeURIComponent(JSON.stringify(obj)); window.open(data, 'story_' + obj.id); }) .appendTo($downloads); $("<a>") .addClass('btn') .text("Toggle Parsed Variables") .on('click', function () { story_details.show_parsed_variables = !story_details.show_parsed_variables; story_details.drawStory(); }) .appendTo($downloads); $("<a>") .addClass('btn') .text("Show choices Differently") .on('click', function () { story_details.show_choices_as_tree = !story_details.show_choices_as_tree; story_details.drawStory(); }) .appendTo($downloads); $("<a>") .addClass('btn btn-warning') .text("Toggle Tree Editability") .on('click', function () { story_details.choice_tree_shrink = !story_details.choice_tree_shrink; story_details.drawStory(); }) .appendTo($downloads); $("<a>") .addClass('btn btn-success') .attr('id', 'btn_submit') .text("Submit Changes") .on('click', function () { $.ajax({ url: '', type: 'POST', contentType: 'application/json; charset=utf-8', data: JSON.stringify(story_details.default_story), dataType: 'text', success: function (result) { result = JSON.parse(result); if (result && result.status == "OK") { $('<div class="alert alert-success">Update Saved</div>').appendTo('#downloads').trigger('showalert'); } else { $('<div class="alert alert-error">Error - Update Not Saved</div>').appendTo('#downloads').trigger('showalert'); } console.log(result); } }); }) .appendTo($downloads); $("<a>") .addClass('btn btn-info') .attr('id', 'btn_submit') .text("Add new story") .on('click', function () { $.ajax({ url: story_details.edit_new_url, type: 'POST', contentType: 'application/json; charset=utf-8', data: JSON.stringify(story_details.default_story), dataType: 'text', success: function (result) { result = JSON.parse(result); if (result && result.status == "OK") { var text = "New Story #" + result.id + " Created <a href='" + result.id + "'>Go there</a>"; $('<div class="alert alert-success">' + text + '</div>').appendTo('#downloads').trigger('showalert'); } else { $('<div class="alert alert-error">Error - Story not created</div>').appendTo('#downloads').trigger('showalert'); } console.log(result); } }); }) .appendTo($downloads); }; story_details.text = function (text) { return (story_details.show_parsed_variables ? story_details.replaceParsedVariables(text) : text); }; story_details.replaceParsedVariables = function (text, variables) { variables = variables || story_details.default_story.variables; //Look for variables in text. If found, loop through each and replace them in text var var_finder = new RegExp("\[[\\w:]+\]", "ig"); var matches = var_finder.exec(text); if (matches && matches.length) { _.each(matches, function (match) { _.each(variables, function (v) { if (v.nickname && match.indexOf(v.nickname) > 0 && text.indexOf("[" + v.nickname) > -1) { //This is the variable described var var_finder = new RegExp("\\[" + v.nickname + "\\]", "ig"); text = text.replace(var_finder, "<b>" + v.nickname + "</b>"); _.each('name tags value subtype type details'.split(" "), function (field) { if (v[field]) { var var_finder = new RegExp("\\[" + v.nickname + ":" + field + "\\]", "ig"); text = text.replace(var_finder, "<b>" + v[field] + "</b>"); } }); } }); }) } return text; }; //------------------------------------ story_details.buildANode = function (parent, text, type, tree, data, dont_edit) { var new_node = tree.create_node(parent, {text: text}, "first"); var outputNode = story_details.titleNodeFromType(data, type); if (outputNode.icon) { tree.set_icon(new_node, outputNode.icon); } var new_node_pointer = tree.get_node(new_node); if (outputNode.a_attr && outputNode.a_attr.class) { new_node_pointer.a_attr = new_node_pointer.a_attr || {}; new_node_pointer.a_attr.class = new_node_pointer.a_attr.class || ""; new_node_pointer.a_attr.class += " " + outputNode.a_attr.class; new_node_pointer.a_attr.class = _.str.trim(new_node_pointer.a_attr.class); } if (data) { new_node_pointer.data = data; if (!dont_edit) { tree.edit(new_node, text); } } story_details.showNodeDetail(new_node_pointer); tree.deselect_all(); tree.select_node(new_node); return new_node; }; story_details.treeFromData = function (story, $treeHolder, $tree_node_holder) { var nodeIsNotFolder = function (node) { return !(node.text && !node.data); }; var preventSubFolders = function (node, parent_type) { var type = treeNodeStoryType(node); //Only allow choices aad chances to be added below the root level return !nodeIsNotFolder(node) || (node.parent == "#") || (type == "requirement") || (type == "variable"); }; var treeNodeStoryType = function (node) { var type = (node.data) ? node.data.type : node.text || null; type = type ? type.toLowerCase() : null; if (type == "requirements") { type = "requirement" } else if (type == "choices") { type = "choice"; } else if (type == "chances") { type = "chance"; } else if (type == "effects") { type = "effect"; } else if (type == "variables") { type = "variable"; } return type; }; var baseDataFromType = function (type) { var data = story_details.defaultObjectOfType(type); if (data && !_.isEmpty(data)) { data.type = type; } else { data = null; } return data; }; var customMenu = { "items": function (node) { var tree = $treeHolder.jstree(true); return { "AddRequirements": { "separator_before": false, "separator_after": false, "label": "Add Requirements", "_disabled": function () { return preventSubFolders(node, 'requirement'); }, "action": function () { story_details.buildANode(node, 'Requirements', 'tree_header', tree) } }, "AddChoices": { "separator_before": false, "separator_after": false, "label": "Add Choices", "_disabled": function () { return preventSubFolders(node, 'choice'); }, "action": function () { story_details.buildANode(node, 'Choices', 'tree_header', tree) } }, "AddChances": { "separator_before": false, "separator_after": false, "label": "Add Chances", "_disabled": function () { return preventSubFolders(node, 'chance'); }, "action": function () { story_details.buildANode(node, 'Chances', 'tree_header', tree) } }, "AddEffects": { "separator_before": false, "separator_after": false, "label": "Add Effects", "_disabled": function () { return preventSubFolders(node, 'effect'); }, "action": function () { story_details.buildANode(node, 'Effects', 'tree_header', tree) } }, "AddVariables": { "separator_before": false, "separator_after": false, "label": "Add Variables", "_disabled": function () { return node.id != "j1_2"; }, "action": function () { story_details.buildANode(node, 'Variables', 'tree_header', tree) } }, "AddItem": { "separator_before": false, "separator_after": false, "label": "Add Item", "_disabled": function () { return nodeIsNotFolder(node) || (node.text == story_details.new_tree_node_text); }, "action": function () { var type = treeNodeStoryType(node); story_details.buildANode(node, story_details.new_tree_node_text, type, tree, baseDataFromType(type)) } }, "Rename": { "separator_before": true, "separator_after": false, "label": "Rename", "_disabled": function () { return !nodeIsNotFolder(node); }, "action": function () { tree.edit(node); } }, "Remove": { "separator_before": true, "separator_after": false, "label": "Delete", "action": function () { tree.delete_node(node); } } }; } }; var pluginsToUse = ["wholerow", "dnd"]; if (!story_details.choice_tree_shrink) { pluginsToUse.push("contextmenu"); } var data = story_details.convertStoryToTree(story, "stories"); story_details.$tree = $treeHolder.jstree({ plugins: pluginsToUse, ui: { select_limit: 1 }, contextmenu: customMenu, core: { data: data, check_callback: true } }); $tree_node_holder .addClass("tree_detail"); $treeHolder.on("select_node.jstree", function (evt, holder) { var node = holder.node || {}; story_details.showNodeDetail(node, $tree_node_holder); } ); $treeHolder.on("rename_node.jstree", function (evt, holder) { var node = holder.node || {}; var data = node.data || {}; var newText = node.text || "unknown"; var type = data.type || "unknown"; var field = ""; if (type == "requirement") { field = "name" } else if (type == "choice") { field = "title"; } else if (type == "chance") { field = "title"; } else if (type == "effect") { field = "function"; } else if (type == "variable") { field = "nickname"; } node.data[field] = newText; story_details.showNodeDetail(node, $tree_node_holder); story_details.transformTreeToStory(); // story_details.$tree.jstree('refresh'); } ); $treeHolder.on("copy_node.jstree", function (evt, holder) { var node = holder.node || {}; var title = node.text; if (title == "Battle-node-holder") { var tree = story_details.$tree.jstree(true); tree.set_text(node, "battle"); tree.set_icon(node, "/static/icons/star_empty.png"); node.data = {function: "battle", type:"effect"}; var choices = story_details.buildANode(node,"Choices","tree_header",tree); story_details.buildANode(choices,"accept surrender","choices",tree,{type:'choices',title:'accept surrender'},true); story_details.buildANode(choices,"surrender","choices",tree,{type:'choices',title:'surrender'},true); story_details.buildANode(choices,"lose","choices",tree,{type:'choices',title:'lose'},true); story_details.buildANode(choices,"win","choices",tree,{type:'choices',title:'win'},true); } } ); }; story_details.showNodeDetail = function (node, $tree_node_holder) { $tree_node_holder = $tree_node_holder || story_details.$tree_node_holder; var data = node.data || {}; var variables_already_set = []; $tree_node_holder.empty(); if (data && !_.isEmpty(data)) { for (key in data) { var val = data[key]; if (!_.isArray(val) && !_.isObject(val)) { if (key != "type") variables_already_set.push(key); } } var schema = story_details.schema[data.type] || story_details.schema[data.type + "s"] || []; _.each(schema, function (schema_item) { story_details.buildEditControl(schema_item, node).appendTo($tree_node_holder); }); } else { //It's an array holder var text = node.text; if (text) { $("<span>") .html("<b>Folder of " + text + "</b>") .appendTo($tree_node_holder); } } }; story_details.titleNodeFromType = function (storyItem, type, stories) { type = type || storyItem.type || "unknown"; storyItem = storyItem || {}; // var output = {state: {}, text:""}; var output = {state: {opened: true}, text: ""}; if (type == "stories") { output.text = storyItem.name || storyItem.description || "Story"; } else if (type == "story") { output.text = story_details.nodeTexts.story(storyItem.story); output.icon = "/static/icons/story.png"; } else if (type == "images" || type == "image") { output.text = story_details.nodeTexts.image(storyItem); output.icon = "/static/icons/image.png"; } else if (type == "chances" || type == "chance") { var chances = stories ? stories.length : 1; var pct = ""; if (chances > 1) { pct = parseInt(100 / chances) + "%: "; } output.text = pct + story_details.nodeTexts.chance(storyItem); output.state = {opened: false}; output.a_attr = {class: 'chance bold'}; output.icon = "/static/icons/chance.png"; } else if (type == "effects" || type == "effect") { output.text = story_details.nodeTexts.effect(storyItem); output.a_attr = {class: 'effect'}; output.icon = "/static/icons/star_empty.png"; } else if (type == "requirements" || type == "requirement") { output.text = story_details.nodeTexts.requirement(storyItem); output.a_attr = {class: 'requirement'}; output.icon = "/static/icons/question.png"; } else if (type == "variables" || type == "variable") { output.text = story_details.nodeTexts.variable(storyItem); output.icon = "/static/icons/gem.png"; } else if (type == "choices" || type == "choice") { output.text = story_details.nodeTexts.choice(storyItem); output.a_attr = {class: 'choice bold'}; output.icon = "/static/icons/choice.png"; } if (!output.text && storyItem.text) { output.text = story_details.text(storyItem.text); } if (story_details.choice_tree_shrink) { output.text = "<b>" + _.str.titleize(type) + "</b>: " + output.text; } return output; }; story_details.convertStoryToTree = function (stories, type) { if (_.isObject(stories) && !_.isArray(stories)) { stories = [stories]; //Make sure it's an array } var nodeList = []; _.each(stories, function (storyItem) { nodeList.push(story_details.convertNodeToStoryNode(storyItem, type, stories)); }, stories); var result; if (story_details.choice_tree_shrink) { result = nodeList; } else { result = {text: _.str.titleize(type), children: nodeList, state: {opened: true}, a_attr: {class: 'tree_header'}} } return result; }; story_details.convertNodeToStoryNode = function (storyItem, type, stories) { if (_.isArray(storyItem)) { console.error("convertNodeToStoryNode - An Array was passed in through an array in a story item"); console.error(storyItem); return storyItem; } var output = story_details.titleNodeFromType(storyItem, type, stories); var children = []; //For each item, add children if there is a sub-tree _.each("requirements,choices,chances,effects,variables,story,images".split(","), function (key) { var val = storyItem[key]; if (val) { var node = story_details.convertStoryToTree(val, key); if (node) children.push(node); } }); output.text = _.str.truncate(output.text || "Unrecognized item", 80); if (story_details.choice_tree_shrink) { children = _.flatten(children); } output.children = (children && children.length) ? children : null; storyItem.type = type; output.data = storyItem; return output; }; story_details.transformTreeToStory = function ($tree) { $tree = $tree || story_details.$tree; var data = $tree.jstree().get_json(); var json = story_details.exportTreeNode(data); var story = json[0].stories[0]; story_details.default_story = story; }; story_details.exportTreeNode = function (data) { var output = []; _.each(data, function (item) { var obj = item.data; var output_obj = {}; if (_.isObject(obj) && _.isEmpty(obj) && item.children) { var title = item.text.toLowerCase(); output_obj[title] = story_details.exportTreeNode(item.children); } else if (_.isObject(obj) && item.children) { for (key in obj) { var val = obj[key]; if (val && !_.isArray(val) && !_.isObject(val)) { output_obj[key] = obj[key]; } } } _.each(item.children, function (nodeGroup) { var title = nodeGroup.text.toLowerCase(); output_obj[title] = story_details.exportTreeNode(nodeGroup.children); }); if (output_obj) { output.push(output_obj); } }); return output; }; story_details.buildEditControl = function (schema_item, node) { var $div = $("<div>"); var $control, $control2; var field = schema_item.field || "Field"; var $label = $("<label>") .text(_.str.titleize(field) + ": ") .appendTo($div); if (schema_item.required) $label.css({textWeight: "bold"}); var name = "edit_control_" + field; if (schema_item.type == "options-suggested" || schema_item.type == "options") { $control = $("<select>") .attr({ id: name, name: name }) .addClass("edit_input") .appendTo($div); var opts = schema_item.options || []; if (schema_item.options_relate_to) { //Use the options depending on what another var is set to var related = $("#edit_control_" + schema_item.options_relate_to).val(); var new_opts = []; if (related) { for (key in opts) { if (key.toLowerCase() == related.toLowerCase()) { new_opts = opts[key]; } } opts = new_opts; } } else if (schema_item.options_holder && schema_item.options_sub) { opts = story_details.default_story[schema_item.options_holder]; var new_opts = []; _.each(opts, function (opt) { if (opt && opt[schema_item.options_sub]) { new_opts.push(opt[schema_item.options_sub]); } }); opts = new_opts; } if (!schema_item.required) { opts = [" "].concat(opts); } var existing = node.data[field]; var foundExisting = false; _.each(opts, function (option) { var $opt = $("<option>") .val(option) .text(option) .appendTo($control); if (existing && option == existing) { $opt.attr('selected', true); foundExisting = true; } }); if (!foundExisting && existing && _.isString(existing) && existing.trim()) { $("<option>") .val(existing) .text(existing) .attr('selected', true) .appendTo($control); } if (schema_item.type == "options-suggested") { $("<span>or</span>") .appendTo($div); $control2 = $("<input>") .attr({ type: "text", placeholder: schema_item.default, id: name + "_text", name: name + "_text" }) .addClass("edit_input") .appendTo($div); if (node.data[field]) { $control2.val(node.data[field]); } } } else if (schema_item.type == "textblock") { $control = $("<textarea>") .attr({ placeholder: schema_item.default, required: schema_item.required, id: name, name: name }) .addClass("textarea") .appendTo($div); if (node.data[field]) { $control.val(node.data[field]); } } else { $control = $("<input>") .attr({ type: "text", placeholder: schema_item.default, required: schema_item.required, id: name, name: name }) .addClass("edit_input") .appendTo($div); if (node.data[field]) { $control.val(node.data[field]); } } var controls = [$control]; if ($control2) controls.push($control2); _.each(controls, function (control) { control.on('change', function (ev) { node.data[field] = $(this).val(); var tree = story_details.$tree.jstree(true); var outputNode = story_details.titleNodeFromType(node.data); tree.set_text(node, outputNode.text); if (outputNode.icon) { tree.set_icon(node, outputNode.icon); } var new_node_pointer = tree.get_node(node); if (outputNode.a_attr && outputNode.a_attr.class) { new_node_pointer.a_attr = new_node_pointer.a_attr || {}; new_node_pointer.a_attr.class = new_node_pointer.a_attr.class || ""; new_node_pointer.a_attr.class += " " + outputNode.a_attr.class; new_node_pointer.a_attr.class = _.str.trim(new_node_pointer.a_attr.class); } tree.deselect_all(); tree.select_node(node); story_details.transformTreeToStory(); }); if (schema_item.help_text){ control.attr('title',schema_item.help_text); } if (schema_item.style) { control.css(schema_item.style); } }); // {field: "name", required: true, type: "options-suggested", options_relate_to: "concept", heading: true, default: "magic", options: story_details.suggested.requirement_name}, return $div; };
{ "content_hash": "e957d71a8dabf7e23bc455ae0ad2502c", "timestamp": "", "source": "github", "line_count": 1033, "max_line_length": 308, "avg_line_length": 37.85091965150048, "alnum_prop": 0.5294373401534527, "repo_name": "jaycrossler/procyon", "id": "869dc1ee5a75cf7fe79eaf17da9a50c6aa421f58", "size": "39100", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "procyon/static/js/story_detail.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "105514" }, { "name": "JavaScript", "bytes": "872745" }, { "name": "Python", "bytes": "440877" } ], "symlink_target": "" }
/* v3_cpols.c */ /* * Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL project * 1999. */ /* ==================================================================== * Copyright (c) 1999-2004 The OpenSSL Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * 3. All advertising materials mentioning features or use of this * software must display the following acknowledgment: * "This product includes software developed by the OpenSSL Project * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" * * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to * endorse or promote products derived from this software without * prior written permission. For written permission, please contact * licensing@OpenSSL.org. * * 5. Products derived from this software may not be called "OpenSSL" * nor may "OpenSSL" appear in their names without prior written * permission of the OpenSSL Project. * * 6. Redistributions of any form whatsoever must retain the following * acknowledgment: * "This product includes software developed by the OpenSSL Project * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" * * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. * ==================================================================== * * This product includes cryptographic software written by Eric Young * (eay@cryptsoft.com). This product includes software written by Tim * Hudson (tjh@cryptsoft.com). * */ #include <stdio.h> #include <string.h> #include <openssl/asn1.h> #include <openssl/asn1t.h> #include <openssl/conf.h> #include <openssl/err.h> #include <openssl/mem.h> #include <openssl/obj.h> #include <openssl/stack.h> #include <openssl/x509v3.h> #include "internal.h" /* Certificate policies extension support: this one is a bit complex... */ static int i2r_certpol(X509V3_EXT_METHOD *method, STACK_OF(POLICYINFO) *pol, BIO *out, int indent); static STACK_OF(POLICYINFO) *r2i_certpol(X509V3_EXT_METHOD *method, X509V3_CTX *ctx, char *value); static void print_qualifiers(BIO *out, STACK_OF(POLICYQUALINFO) *quals, int indent); static void print_notice(BIO *out, USERNOTICE *notice, int indent); static POLICYINFO *policy_section(X509V3_CTX *ctx, STACK_OF(CONF_VALUE) *polstrs, int ia5org); static POLICYQUALINFO *notice_section(X509V3_CTX *ctx, STACK_OF(CONF_VALUE) *unot, int ia5org); static int nref_nos(STACK_OF(ASN1_INTEGER) *nnums, STACK_OF(CONF_VALUE) *nos); const X509V3_EXT_METHOD v3_cpols = { NID_certificate_policies, 0, ASN1_ITEM_ref(CERTIFICATEPOLICIES), 0, 0, 0, 0, 0, 0, 0, 0, (X509V3_EXT_I2R)i2r_certpol, (X509V3_EXT_R2I)r2i_certpol, NULL }; ASN1_ITEM_TEMPLATE(CERTIFICATEPOLICIES) = ASN1_EX_TEMPLATE_TYPE(ASN1_TFLG_SEQUENCE_OF, 0, CERTIFICATEPOLICIES, POLICYINFO) ASN1_ITEM_TEMPLATE_END(CERTIFICATEPOLICIES) IMPLEMENT_ASN1_FUNCTIONS(CERTIFICATEPOLICIES) ASN1_SEQUENCE(POLICYINFO) = { ASN1_SIMPLE(POLICYINFO, policyid, ASN1_OBJECT), ASN1_SEQUENCE_OF_OPT(POLICYINFO, qualifiers, POLICYQUALINFO) } ASN1_SEQUENCE_END(POLICYINFO) IMPLEMENT_ASN1_FUNCTIONS(POLICYINFO) ASN1_ADB_TEMPLATE(policydefault) = ASN1_SIMPLE(POLICYQUALINFO, d.other, ASN1_ANY); ASN1_ADB(POLICYQUALINFO) = { ADB_ENTRY(NID_id_qt_cps, ASN1_SIMPLE(POLICYQUALINFO, d.cpsuri, ASN1_IA5STRING)), ADB_ENTRY(NID_id_qt_unotice, ASN1_SIMPLE(POLICYQUALINFO, d.usernotice, USERNOTICE)) } ASN1_ADB_END(POLICYQUALINFO, 0, pqualid, 0, &policydefault_tt, NULL); ASN1_SEQUENCE(POLICYQUALINFO) = { ASN1_SIMPLE(POLICYQUALINFO, pqualid, ASN1_OBJECT), ASN1_ADB_OBJECT(POLICYQUALINFO) } ASN1_SEQUENCE_END(POLICYQUALINFO) IMPLEMENT_ASN1_FUNCTIONS(POLICYQUALINFO) ASN1_SEQUENCE(USERNOTICE) = { ASN1_OPT(USERNOTICE, noticeref, NOTICEREF), ASN1_OPT(USERNOTICE, exptext, DISPLAYTEXT) } ASN1_SEQUENCE_END(USERNOTICE) IMPLEMENT_ASN1_FUNCTIONS(USERNOTICE) ASN1_SEQUENCE(NOTICEREF) = { ASN1_SIMPLE(NOTICEREF, organization, DISPLAYTEXT), ASN1_SEQUENCE_OF(NOTICEREF, noticenos, ASN1_INTEGER) } ASN1_SEQUENCE_END(NOTICEREF) IMPLEMENT_ASN1_FUNCTIONS(NOTICEREF) static STACK_OF(POLICYINFO) *r2i_certpol(X509V3_EXT_METHOD *method, X509V3_CTX *ctx, char *value) { STACK_OF(POLICYINFO) *pols = NULL; char *pstr; POLICYINFO *pol; ASN1_OBJECT *pobj; STACK_OF(CONF_VALUE) *vals; CONF_VALUE *cnf; size_t i; int ia5org; pols = sk_POLICYINFO_new_null(); if (pols == NULL) { OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE); return NULL; } vals = X509V3_parse_list(value); if (vals == NULL) { OPENSSL_PUT_ERROR(X509V3, ERR_R_X509V3_LIB); goto err; } ia5org = 0; for (i = 0; i < sk_CONF_VALUE_num(vals); i++) { cnf = sk_CONF_VALUE_value(vals, i); if (cnf->value || !cnf->name) { OPENSSL_PUT_ERROR(X509V3, X509V3_R_INVALID_POLICY_IDENTIFIER); X509V3_conf_err(cnf); goto err; } pstr = cnf->name; if (!strcmp(pstr, "ia5org")) { ia5org = 1; continue; } else if (*pstr == '@') { STACK_OF(CONF_VALUE) *polsect; polsect = X509V3_get_section(ctx, pstr + 1); if (!polsect) { OPENSSL_PUT_ERROR(X509V3, X509V3_R_INVALID_SECTION); X509V3_conf_err(cnf); goto err; } pol = policy_section(ctx, polsect, ia5org); X509V3_section_free(ctx, polsect); if (!pol) goto err; } else { if (!(pobj = OBJ_txt2obj(cnf->name, 0))) { OPENSSL_PUT_ERROR(X509V3, X509V3_R_INVALID_OBJECT_IDENTIFIER); X509V3_conf_err(cnf); goto err; } pol = POLICYINFO_new(); if (pol == NULL) { OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE); ASN1_OBJECT_free(pobj); goto err; } pol->policyid = pobj; } if (!sk_POLICYINFO_push(pols, pol)) { POLICYINFO_free(pol); OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE); goto err; } } sk_CONF_VALUE_pop_free(vals, X509V3_conf_free); return pols; err: sk_CONF_VALUE_pop_free(vals, X509V3_conf_free); sk_POLICYINFO_pop_free(pols, POLICYINFO_free); return NULL; } static POLICYINFO *policy_section(X509V3_CTX *ctx, STACK_OF(CONF_VALUE) *polstrs, int ia5org) { size_t i; CONF_VALUE *cnf; POLICYINFO *pol; POLICYQUALINFO *qual; if (!(pol = POLICYINFO_new())) goto merr; for (i = 0; i < sk_CONF_VALUE_num(polstrs); i++) { cnf = sk_CONF_VALUE_value(polstrs, i); if (!strcmp(cnf->name, "policyIdentifier")) { ASN1_OBJECT *pobj; if (!(pobj = OBJ_txt2obj(cnf->value, 0))) { OPENSSL_PUT_ERROR(X509V3, X509V3_R_INVALID_OBJECT_IDENTIFIER); X509V3_conf_err(cnf); goto err; } pol->policyid = pobj; } else if (!x509v3_name_cmp(cnf->name, "CPS")) { if (!pol->qualifiers) pol->qualifiers = sk_POLICYQUALINFO_new_null(); if (!(qual = POLICYQUALINFO_new())) goto merr; if (!sk_POLICYQUALINFO_push(pol->qualifiers, qual)) goto merr; qual->pqualid = OBJ_nid2obj(NID_id_qt_cps); if (qual->pqualid == NULL) { OPENSSL_PUT_ERROR(X509V3, ERR_R_INTERNAL_ERROR); goto err; } qual->d.cpsuri = ASN1_IA5STRING_new(); if (qual->d.cpsuri == NULL) { goto err; } if (!ASN1_STRING_set(qual->d.cpsuri, cnf->value, strlen(cnf->value))) goto merr; } else if (!x509v3_name_cmp(cnf->name, "userNotice")) { STACK_OF(CONF_VALUE) *unot; if (*cnf->value != '@') { OPENSSL_PUT_ERROR(X509V3, X509V3_R_EXPECTED_A_SECTION_NAME); X509V3_conf_err(cnf); goto err; } unot = X509V3_get_section(ctx, cnf->value + 1); if (!unot) { OPENSSL_PUT_ERROR(X509V3, X509V3_R_INVALID_SECTION); X509V3_conf_err(cnf); goto err; } qual = notice_section(ctx, unot, ia5org); X509V3_section_free(ctx, unot); if (!qual) goto err; if (!pol->qualifiers) pol->qualifiers = sk_POLICYQUALINFO_new_null(); if (!sk_POLICYQUALINFO_push(pol->qualifiers, qual)) goto merr; } else { OPENSSL_PUT_ERROR(X509V3, X509V3_R_INVALID_OPTION); X509V3_conf_err(cnf); goto err; } } if (!pol->policyid) { OPENSSL_PUT_ERROR(X509V3, X509V3_R_NO_POLICY_IDENTIFIER); goto err; } return pol; merr: OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE); err: POLICYINFO_free(pol); return NULL; } static POLICYQUALINFO *notice_section(X509V3_CTX *ctx, STACK_OF(CONF_VALUE) *unot, int ia5org) { size_t i; int ret; CONF_VALUE *cnf; USERNOTICE *not; POLICYQUALINFO *qual; if (!(qual = POLICYQUALINFO_new())) goto merr; qual->pqualid = OBJ_nid2obj(NID_id_qt_unotice); if (qual->pqualid == NULL) { OPENSSL_PUT_ERROR(X509V3, ERR_R_INTERNAL_ERROR); goto err; } if (!(not = USERNOTICE_new())) goto merr; qual->d.usernotice = not; for (i = 0; i < sk_CONF_VALUE_num(unot); i++) { cnf = sk_CONF_VALUE_value(unot, i); if (!strcmp(cnf->name, "explicitText")) { not->exptext = ASN1_VISIBLESTRING_new(); if (not->exptext == NULL) goto merr; if (!ASN1_STRING_set(not->exptext, cnf->value, strlen(cnf->value))) goto merr; } else if (!strcmp(cnf->name, "organization")) { NOTICEREF *nref; if (!not->noticeref) { if (!(nref = NOTICEREF_new())) goto merr; not->noticeref = nref; } else nref = not->noticeref; if (ia5org) nref->organization->type = V_ASN1_IA5STRING; else nref->organization->type = V_ASN1_VISIBLESTRING; if (!ASN1_STRING_set(nref->organization, cnf->value, strlen(cnf->value))) goto merr; } else if (!strcmp(cnf->name, "noticeNumbers")) { NOTICEREF *nref; STACK_OF(CONF_VALUE) *nos; if (!not->noticeref) { if (!(nref = NOTICEREF_new())) goto merr; not->noticeref = nref; } else nref = not->noticeref; nos = X509V3_parse_list(cnf->value); if (!nos || !sk_CONF_VALUE_num(nos)) { OPENSSL_PUT_ERROR(X509V3, X509V3_R_INVALID_NUMBERS); X509V3_conf_err(cnf); goto err; } ret = nref_nos(nref->noticenos, nos); sk_CONF_VALUE_pop_free(nos, X509V3_conf_free); if (!ret) goto err; } else { OPENSSL_PUT_ERROR(X509V3, X509V3_R_INVALID_OPTION); X509V3_conf_err(cnf); goto err; } } if (not->noticeref && (!not->noticeref->noticenos || !not->noticeref->organization)) { OPENSSL_PUT_ERROR(X509V3, X509V3_R_NEED_ORGANIZATION_AND_NUMBERS); goto err; } return qual; merr: OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE); err: POLICYQUALINFO_free(qual); return NULL; } static int nref_nos(STACK_OF(ASN1_INTEGER) *nnums, STACK_OF(CONF_VALUE) *nos) { CONF_VALUE *cnf; ASN1_INTEGER *aint; size_t i; for (i = 0; i < sk_CONF_VALUE_num(nos); i++) { cnf = sk_CONF_VALUE_value(nos, i); if (!(aint = s2i_ASN1_INTEGER(NULL, cnf->name))) { OPENSSL_PUT_ERROR(X509V3, X509V3_R_INVALID_NUMBER); goto err; } if (!sk_ASN1_INTEGER_push(nnums, aint)) goto merr; } return 1; merr: ASN1_INTEGER_free(aint); OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE); err: return 0; } static int i2r_certpol(X509V3_EXT_METHOD *method, STACK_OF(POLICYINFO) *pol, BIO *out, int indent) { size_t i; POLICYINFO *pinfo; /* First print out the policy OIDs */ for (i = 0; i < sk_POLICYINFO_num(pol); i++) { pinfo = sk_POLICYINFO_value(pol, i); BIO_printf(out, "%*sPolicy: ", indent, ""); i2a_ASN1_OBJECT(out, pinfo->policyid); BIO_puts(out, "\n"); if (pinfo->qualifiers) print_qualifiers(out, pinfo->qualifiers, indent + 2); } return 1; } static void print_qualifiers(BIO *out, STACK_OF(POLICYQUALINFO) *quals, int indent) { POLICYQUALINFO *qualinfo; size_t i; for (i = 0; i < sk_POLICYQUALINFO_num(quals); i++) { qualinfo = sk_POLICYQUALINFO_value(quals, i); switch (OBJ_obj2nid(qualinfo->pqualid)) { case NID_id_qt_cps: BIO_printf(out, "%*sCPS: %.*s\n", indent, "", qualinfo->d.cpsuri->length, qualinfo->d.cpsuri->data); break; case NID_id_qt_unotice: BIO_printf(out, "%*sUser Notice:\n", indent, ""); print_notice(out, qualinfo->d.usernotice, indent + 2); break; default: BIO_printf(out, "%*sUnknown Qualifier: ", indent + 2, ""); i2a_ASN1_OBJECT(out, qualinfo->pqualid); BIO_puts(out, "\n"); break; } } } static void print_notice(BIO *out, USERNOTICE *notice, int indent) { size_t i; if (notice->noticeref) { NOTICEREF *ref; ref = notice->noticeref; BIO_printf(out, "%*sOrganization: %.*s\n", indent, "", ref->organization->length, ref->organization->data); BIO_printf(out, "%*sNumber%s: ", indent, "", sk_ASN1_INTEGER_num(ref->noticenos) > 1 ? "s" : ""); for (i = 0; i < sk_ASN1_INTEGER_num(ref->noticenos); i++) { ASN1_INTEGER *num; char *tmp; num = sk_ASN1_INTEGER_value(ref->noticenos, i); if (i) BIO_puts(out, ", "); if (num == NULL) BIO_puts(out, "(null)"); else { tmp = i2s_ASN1_INTEGER(NULL, num); if (tmp == NULL) return; BIO_puts(out, tmp); OPENSSL_free(tmp); } } BIO_puts(out, "\n"); } if (notice->exptext) BIO_printf(out, "%*sExplicit Text: %.*s\n", indent, "", notice->exptext->length, notice->exptext->data); } void X509_POLICY_NODE_print(BIO *out, X509_POLICY_NODE *node, int indent) { const X509_POLICY_DATA *dat = node->data; BIO_printf(out, "%*sPolicy: ", indent, ""); i2a_ASN1_OBJECT(out, dat->valid_policy); BIO_puts(out, "\n"); BIO_printf(out, "%*s%s\n", indent + 2, "", node_data_critical(dat) ? "Critical" : "Non Critical"); if (dat->qualifier_set) print_qualifiers(out, dat->qualifier_set, indent + 2); else BIO_printf(out, "%*sNo Qualifiers\n", indent + 2, ""); }
{ "content_hash": "431841b1c68345a36c166283edd98baf", "timestamp": "", "source": "github", "line_count": 500, "max_line_length": 91, "avg_line_length": 34.31, "alnum_prop": 0.5626930923928883, "repo_name": "grpc/grpc-ios", "id": "6e3eb141987c3840f2fddc181e56f305d824184b", "size": "17155", "binary": false, "copies": "2", "ref": "refs/heads/main", "path": "native/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_cpols.c", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Awk", "bytes": "5444" }, { "name": "Batchfile", "bytes": "38831" }, { "name": "C", "bytes": "1342403" }, { "name": "C#", "bytes": "111357" }, { "name": "C++", "bytes": "11936431" }, { "name": "CMake", "bytes": "34261" }, { "name": "CSS", "bytes": "1579" }, { "name": "Cython", "bytes": "258768" }, { "name": "Dockerfile", "bytes": "185143" }, { "name": "Go", "bytes": "34794" }, { "name": "HTML", "bytes": "14" }, { "name": "Java", "bytes": "22550" }, { "name": "JavaScript", "bytes": "89695" }, { "name": "Objective-C", "bytes": "770017" }, { "name": "Objective-C++", "bytes": "83300" }, { "name": "PHP", "bytes": "517157" }, { "name": "PowerShell", "bytes": "5008" }, { "name": "Python", "bytes": "4064457" }, { "name": "Ruby", "bytes": "715896" }, { "name": "Shell", "bytes": "781923" }, { "name": "Starlark", "bytes": "849400" }, { "name": "Swift", "bytes": "13168" }, { "name": "XSLT", "bytes": "9846" } ], "symlink_target": "" }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Xml.Serialization; using OopFactory.X12.Hipaa.Common; namespace OopFactory.X12.Hipaa.ClaimStatus { public class ClaimStatusServiceLineResponse { public DateTime BeginDate { get; set; } } }
{ "content_hash": "7a82eaf9ec5f881fa12154969c9d37f9", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 47, "avg_line_length": 22.142857142857142, "alnum_prop": 0.7548387096774194, "repo_name": "ygrinev/ygrinev", "id": "0513b25fb9312921d34a1c4f0c0a07f8dbb32971", "size": "312", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Study/EDI/x12parser/x12parser/trunk/src/OopFactory.X12.Hipaa/ClaimStatus/ClaimStatusServiceLineResponse.cs", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "ASP", "bytes": "52500" }, { "name": "Batchfile", "bytes": "55480" }, { "name": "C#", "bytes": "4763975" }, { "name": "CSS", "bytes": "873906" }, { "name": "HTML", "bytes": "2429022" }, { "name": "Java", "bytes": "9095" }, { "name": "JavaScript", "bytes": "8614632" }, { "name": "PHP", "bytes": "4319" }, { "name": "Pascal", "bytes": "402824" }, { "name": "PowerShell", "bytes": "1379876" }, { "name": "Puppet", "bytes": "2916" }, { "name": "Shell", "bytes": "306" }, { "name": "TypeScript", "bytes": "549603" }, { "name": "Visual Basic", "bytes": "9214" }, { "name": "XSLT", "bytes": "110282" } ], "symlink_target": "" }
Without arguments the help contents are shown. # repo create This command creates repository. ``` repo create repositoryname ``` #repo ls This command lists the available repositories on the gitserver. ``` repo ls ``` #repo rm This command removes a repository on the gitserver. ``` repo rm repositoryname ```
{ "content_hash": "fbe490079b8c5dfb29e5e4e61743079d", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 63, "avg_line_length": 14.363636363636363, "alnum_prop": 0.7468354430379747, "repo_name": "JurrianFahner/gitserver", "id": "f17b6289b655cfe7347269f99e305569ed6f0cf5", "size": "323", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "docs/useful-commands/Command repo.md", "mode": "33188", "license": "mit", "language": [ { "name": "Shell", "bytes": "3034" } ], "symlink_target": "" }
var TicTacToe; ;(function(global, document, $,ko){ "use strict"; //Fix strange bug using jquery2 and bootstrap3 HTMLDivElement.prototype.remove = function(){}; TicTacToe = global.TicTacToe = global.TicTacToe || {}; /* * To determine a win condition, each square is "tagged" from left * to right, top to bottom, with successive powers of 2. Each cell * thus represents an individual bit in a 9-bit string, and a * player's squares at any given time can be represented as a * unique 9-bit value. A winner can thus be easily determined by * checking whether the player's current 9 bits have covered any * of the eight "three-in-a-row" combinations. * * 273 84 * \ / * 1 | 2 | 4 = 7 * -----+-----+----- * 8 | 16 | 32 = 56 * -----+-----+----- * 64 | 128 | 256 = 448 * ================= * 73 146 292 * * Explanation from: http://jsfiddle.net/rtoal/5wKfF/ */ TicTacToe.wins = [7, 56, 448, 73, 146, 292, 273, 84]; //Knockout binding object TicTacToe.bindings = { board : ko.observableArray([]), loading: ko.observable(false), winner: ko.observable(false), draw: ko.observable(false) }; //Helpers TicTacToe.moves = 0; TicTacToe.scores = { human: 0, cpu:0 }; /* * Init method */ TicTacToe.init = function () { //Initialize board tiles click $("#main-content").on("click", ".board-tile", function() { var $obj = $(this); if(TicTacToe.bindings.loading() === false && TicTacToe.bindings.winner() === false && $obj.hasClass('clickeable')){ TicTacToe.humanMove($(this).attr('rel').split('|')); } }); //Clear button click handler $('.clear').on('click',function(){ TicTacToe.clear(); }); //Initialize Knockout data binding ko.applyBindings(TicTacToe.bindings); //Clear information before start this.clear(); }; /* * Process human move */ TicTacToe.humanMove = function(position){ this.setTileValue(position,'human'); if(this.moves < 9 && this.bindings.winner() === false){ this.bindings.loading(true); this.cpuMove(position); } }; /* * Process CPU move */ TicTacToe.cpuMove = function(position){ var that = this; TicTacToe.apiCall({ action:'move', position: position }, function(data) { that.bindings.loading(false); that.setTileValue(data.position,'cpu'); }); }; /* * Generic API call method */ TicTacToe.apiCall = function(params,callback){ $.post("api/index.php", params, function(data, textStatus, jqXHR) { callback(data); },"json") .fail(function(jqXHR, textStatus, errorThrown) { console.error(textStatus); }); }; /* * Change tile value: circle or cross */ TicTacToe.setTileValue = function (position,player) { var tile = this.bindings.board()[position[0]]()[position[1]]; tile.selected((player=='human')?'icon-radio-unchecked fg-green':'icon-cancel-2 fg-blue'); TicTacToe.moves++; this.checkResults(player,tile.indicator); }; /* * Called after every movement, verify is there is a winner */ TicTacToe.checkResults = function(player,i){ this.scores[player] += i; if(this.isWinner(this.scores[player])){ this.bindings.winner(player); }else if(this.moves === 9){ this.bindings.draw(true); } }; /* * Returns whether the given score is a winning score. */ TicTacToe.isWinner = function(score) { var i; for (i = 0; i < this.wins.length; i += 1) { if ((this.wins[i] & score) === this.wins[i]) { return true; } } return false; }; /* * Restart game, clear information */ TicTacToe.clear = function(){ var indicator = 1, row, cell, i,j; //Clear board binding this.bindings.board([]); this.bindings.winner(false); this.bindings.draw(false); //Clear helpers this.moves = 0; this.scores = { human: 0, cpu:0 }; //Generate blank board binding for (i = 0; i < 3; i += 1) { row = ko.observableArray([]); for (j = 0; j < 3; j += 1) { cell = { selected: ko.observable(undefined), indicator: indicator }; row.push(cell); indicator += indicator; } this.bindings.board.push(row); } //Clear server side session TicTacToe.apiCall({ action:'clear' }, function(data) { TicTacToe.bindings.loading(false); }); }; })(window, document,jQuery,ko);
{ "content_hash": "48b5a64fb5ffbb947a8c9c2aac7c6975", "timestamp": "", "source": "github", "line_count": 192, "max_line_length": 97, "avg_line_length": 27.838541666666668, "alnum_prop": 0.49934518241347053, "repo_name": "palamago/tic-tac-toe", "id": "a840de8b88e53b317a4530dc5caed7a7adf4d578", "size": "5345", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "js/main.js", "mode": "33261", "license": "mit", "language": [ { "name": "CSS", "bytes": "46" }, { "name": "JavaScript", "bytes": "419" }, { "name": "PHP", "bytes": "13" } ], "symlink_target": "" }
package fr.javatronic.blog.massive.annotation1; import fr.javatronic.blog.processor.Annotation_001; @Annotation_001 public class Class_349 { }
{ "content_hash": "85abc9e9a6454a0076a1657dcfb31bca", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 51, "avg_line_length": 20.714285714285715, "alnum_prop": 0.8068965517241379, "repo_name": "lesaint/experimenting-annotation-processing", "id": "2ff7a3fdaa1d993c4bd30da8735a66fd370c0f79", "size": "145", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "experimenting-rounds/massive-count-of-annotated-classes/src/main/java/fr/javatronic/blog/massive/annotation1/Class_349.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "1909421" }, { "name": "Shell", "bytes": "1605" } ], "symlink_target": "" }
layout: post title: 'Texas' date: 2004-07-12 19:14 comments: true categories : [] --- So United Van Lines finally got all my furniture and other stuff from California to me here in texas. Only took like 3 weeks. now I get to spend the next month unpacking and organizing. Joy Joy.
{ "content_hash": "209a849e680cc1b88ffbbcb022216b33", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 185, "avg_line_length": 26, "alnum_prop": 0.7412587412587412, "repo_name": "fusion94/fusion94.github.io", "id": "f7995448a94bb2ec7653d4a5c3a2500929b02a63", "size": "290", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "_posts/2004-07-12-texas.md", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "13953" }, { "name": "HTML", "bytes": "21389" }, { "name": "JavaScript", "bytes": "660" }, { "name": "Ruby", "bytes": "6183" } ], "symlink_target": "" }
;(function($) { var ver = '2.78'; if ($.support == undefined) { $.support = { opacity: !($.browser.msie) }; } function debug(s) { if ($.fn.cycle.debug) log(s); } function log() { if (window.console && window.console.log) window.console.log('[cycle] ' + Array.prototype.join.call(arguments,' ')); }; $.fn.cycle = function(options, arg2) { var o = { s: this.selector, c: this.context }; if (this.length === 0 && options != 'stop') { if (!$.isReady && o.s) { log('DOM not ready, queuing slideshow'); $(function() { $(o.s,o.c).cycle(options,arg2); }); return this; } // is your DOM ready? http://docs.jquery.com/Tutorials:Introducing_$(document).ready() log('terminating; zero elements found by selector' + ($.isReady ? '' : ' (DOM not ready)')); return this; } return this.each(function() { var opts = handleArguments(this, options, arg2); if (opts === false) return; opts.updateActivePagerLink = opts.updateActivePagerLink || $.fn.cycle.updateActivePagerLink; // stop existing slideshow for this container (if there is one) if (this.cycleTimeout) clearTimeout(this.cycleTimeout); this.cycleTimeout = this.cyclePause = 0; var $cont = $(this); var $slides = opts.slideExpr ? $(opts.slideExpr, this) : $cont.children(); var els = $slides.get(); if (els.length < 2) { log('terminating; too few slides: ' + els.length); return; } var opts2 = buildOptions($cont, $slides, els, opts, o); if (opts2 === false) return; var startTime = opts2.continuous ? 10 : getTimeout(opts2.currSlide, opts2.nextSlide, opts2, !opts2.rev); if (startTime) { startTime += (opts2.delay || 0); if (startTime < 10) startTime = 10; debug('first timeout: ' + startTime); this.cycleTimeout = setTimeout(function(){go(els,opts2,0,!opts2.rev)}, startTime); } }); }; function handleArguments(cont, options, arg2) { if (cont.cycleStop == undefined) cont.cycleStop = 0; if (options === undefined || options === null) options = {}; if (options.constructor == String) { switch(options) { case 'stop': cont.cycleStop++; // callbacks look for change if (cont.cycleTimeout) clearTimeout(cont.cycleTimeout); cont.cycleTimeout = 0; $(cont).removeData('cycle.opts'); return false; case 'toggle': cont.cyclePause = (cont.cyclePause === 1) ? 0 : 1; return false; case 'pause': cont.cyclePause = 1; return false; case 'resume': cont.cyclePause = 0; if (arg2 === true) { options = $(cont).data('cycle.opts'); if (!options) { log('options not found, can not resume'); return false; } if (cont.cycleTimeout) { clearTimeout(cont.cycleTimeout); cont.cycleTimeout = 0; } go(options.elements, options, 1, 1); } return false; case 'prev': case 'next': var opts = $(cont).data('cycle.opts'); if (!opts) { log('options not found, "prev/next" ignored'); return false; } $.fn.cycle[options](opts); return false; default: options = { fx: options }; }; return options; } else if (options.constructor == Number) { var num = options; options = $(cont).data('cycle.opts'); if (!options) { log('options not found, can not advance slide'); return false; } if (num < 0 || num >= options.elements.length) { log('invalid slide index: ' + num); return false; } options.nextSlide = num; if (cont.cycleTimeout) { clearTimeout(cont.cycleTimeout); cont.cycleTimeout = 0; } if (typeof arg2 == 'string') options.oneTimeFx = arg2; go(options.elements, options, 1, num >= options.currSlide); return false; } return options; }; function removeFilter(el, opts) { if (!$.support.opacity && opts.cleartype && el.style.filter) { try { el.style.removeAttribute('filter'); } catch(smother) {} } }; function buildOptions($cont, $slides, els, options, o) { var opts = $.extend({}, $.fn.cycle.defaults, options || {}, $.metadata ? $cont.metadata() : $.meta ? $cont.data() : {}); if (opts.autostop) opts.countdown = opts.autostopCount || els.length; var cont = $cont[0]; $cont.data('cycle.opts', opts); opts.$cont = $cont; opts.stopCount = cont.cycleStop; opts.elements = els; opts.before = opts.before ? [opts.before] : []; opts.after = opts.after ? [opts.after] : []; opts.after.unshift(function(){ opts.busy=0; }); if (!$.support.opacity && opts.cleartype) opts.after.push(function() { removeFilter(this, opts); }); if (opts.continuous) opts.after.push(function() { go(els,opts,0,!opts.rev); }); saveOriginalOpts(opts); if (!$.support.opacity && opts.cleartype && !opts.cleartypeNoBg) clearTypeFix($slides); // container requires non-static position so that slides can be position within if ($cont.css('position') == 'static') $cont.css('position', 'relative'); if (opts.width) $cont.width(opts.width); if (opts.height && opts.height != 'auto') $cont.height(opts.height); if (opts.startingSlide) opts.startingSlide = parseInt(opts.startingSlide); if (opts.random) { opts.randomMap = []; for (var i = 0; i < els.length; i++) opts.randomMap.push(i); opts.randomMap.sort(function(a,b) {return Math.random() - 0.5;}); opts.randomIndex = 1; opts.startingSlide = opts.randomMap[1]; } else if (opts.startingSlide >= els.length) opts.startingSlide = 0; // catch bogus input opts.currSlide = opts.startingSlide || 0; var first = opts.startingSlide; $slides.css({position: 'absolute', top:0, left:0}).hide().each(function(i) { var z = first ? i >= first ? els.length - (i-first) : first-i : els.length-i; $(this).css('z-index', z) }); $(els[first]).css('opacity',1).delay(100).show(1200); removeFilter(els[first], opts); if (opts.fit && opts.width) $slides.width(opts.width); if (opts.fit && opts.height && opts.height != 'auto') $slides.height(opts.height); var reshape = opts.containerResize && !$cont.innerHeight(); if (reshape) { var maxw = 0, maxh = 0; for(var j=0; j < els.length; j++) { var $e = $(els[j]), e = $e[0], w = $e.outerWidth(), h = $e.outerHeight(); if (!w) w = e.offsetWidth || e.width || $e.attr('width') if (!h) h = e.offsetHeight || e.height || $e.attr('height'); maxw = w > maxw ? w : maxw; maxh = h > maxh ? h : maxh; } if (maxw > 0 && maxh > 0) $cont.css({width:maxw+'px',height:maxh+'px'}); } if (opts.pause) $cont.hover(function(){this.cyclePause++;},function(){this.cyclePause--;}); if (supportMultiTransitions(opts) === false) return false; var requeue = false; options.requeueAttempts = options.requeueAttempts || 0; $slides.each(function() { var $el = $(this); this.cycleH = (opts.fit && opts.height) ? opts.height : ($el.height() || this.offsetHeight || this.height || $el.attr('height') || 0); this.cycleW = (opts.fit && opts.width) ? opts.width : ($el.width() || this.offsetWidth || this.width || $el.attr('width') || 0); if ( $el.is('img') ) { var loadingIE = ($.browser.msie && this.cycleW == 28 && this.cycleH == 30 && !this.complete); var loadingFF = ($.browser.mozilla && this.cycleW == 34 && this.cycleH == 19 && !this.complete); var loadingOp = ($.browser.opera && ((this.cycleW == 42 && this.cycleH == 19) || (this.cycleW == 37 && this.cycleH == 17)) && !this.complete); var loadingOther = (this.cycleH == 0 && this.cycleW == 0 && !this.complete); if (loadingIE || loadingFF || loadingOp || loadingOther) { if (o.s && opts.requeueOnImageNotLoaded && ++options.requeueAttempts < 100) { // track retry count so we don't loop forever log(options.requeueAttempts,' - img slide not loaded, requeuing slideshow: ', this.src, this.cycleW, this.cycleH); setTimeout(function() {$(o.s,o.c).cycle(options)}, opts.requeueTimeout); requeue = true; return false; } else { log('could not determine size of image: '+this.src, this.cycleW, this.cycleH); } } } return true; }); if (requeue) return false; opts.cssBefore = opts.cssBefore || {}; opts.animIn = opts.animIn || {}; opts.animOut = opts.animOut || {}; $slides.not(':eq('+first+')').css(opts.cssBefore); if (opts.cssFirst) $($slides[first]).css(opts.cssFirst); if (opts.timeout) { opts.timeout = parseInt(opts.timeout); if (opts.speed.constructor == String) opts.speed = $.fx.speeds[opts.speed] || parseInt(opts.speed); if (!opts.sync) opts.speed = opts.speed / 2; while((opts.timeout - opts.speed) < 250) // sanitize timeout opts.timeout += opts.speed; } if (opts.easing) opts.easeIn = opts.easeOut = opts.easing; if (!opts.speedIn) opts.speedIn = opts.speed; if (!opts.speedOut) opts.speedOut = opts.speed; opts.slideCount = els.length; opts.currSlide = opts.lastSlide = first; if (opts.random) { if (++opts.randomIndex == els.length) opts.randomIndex = 0; opts.nextSlide = opts.randomMap[opts.randomIndex]; } else opts.nextSlide = opts.startingSlide >= (els.length-1) ? 0 : opts.startingSlide+1; if (!opts.multiFx) { var init = $.fn.cycle.transitions[opts.fx]; if ($.isFunction(init)) init($cont, $slides, opts); else if (opts.fx != 'custom' && !opts.multiFx) { log('unknown transition: ' + opts.fx,'; slideshow terminating'); return false; } } var e0 = $slides[first]; if (opts.before.length) opts.before[0].apply(e0, [e0, e0, opts, true]); if (opts.after.length > 1) opts.after[1].apply(e0, [e0, e0, opts, true]); if (opts.next){ $(opts.next).bind(opts.prevNextEvent,function(){return advance(opts,opts.rev?-1:1)}); } if (opts.prev) $(opts.prev).bind(opts.prevNextEvent,function(){return advance(opts,opts.rev?1:-1)}); if (opts.pager) buildPager(els,opts); var swipePageDown = 0; var swipePageUp = 0; var swipePageYDown = 0; var swipePageYUp = 0; var swipeScaleArray = []; document.getElementById('pfsl').addEventListener('gesturestart', function(event){ }, true ); document.getElementById('pfsl').addEventListener('gesturechange', function(event){ }, true ); document.getElementById('pfsl').addEventListener('gestureend', function(event){ if (event.scale > 1){ swipeScaleArray.push(null); } else if (event.scale < 1){ swipeScaleArray.pop(); } }, true ); document.getElementById('pfsl').addEventListener('touchstart', function(event){ if (typeof event.targetTouches[0] !== 'undefined'){ swipePageDown = event.targetTouches[0].clientX; swipePageYDown = event.targetTouches[0].clientY; } },true ); document.getElementById('pfsl').addEventListener('touchmove', function(event){ if (typeof event.targetTouches[0] !== 'undefined'){ swipePageUp = event.targetTouches[0].clientX; swipePageYUp = event.targetTouches[0].clientY; } },true ); document.getElementById('pfsl').addEventListener('touchend', function(event){ if (window.orientation == 90 || window.orientation == -90){ var temp = swipePageDown; swipePageDown = swipePageUp; swipePageUp = temp; temp = swipePageYDown; swipePageYDown = swipePageYUp; swipePageYUp = temp; } if (Math.abs(swipePageYDown - swipePageYUp) >= 75 || Math.abs(swipePageDown - swipePageUp) < 100 || swipeScaleArray.length != 0 ){ }else{ event.preventDefault(); if (Math.abs(swipePageDown - swipePageUp) > 100 && Math.abs(swipePageYDown - swipePageYUp) < 75){ if ((swipePageDown - swipePageUp) > 0){ if (window.orientation == 90 || window.orientation == -90){ advance(opts,opts.rev?1:-1); } else{ advance(opts,opts.rev?-1:1); } }else if ((swipePageDown - swipePageUp) < 0){ if (window.orientation == 90 || window.orientation == -90){ advance(opts,opts.rev?-1:1); } else{ advance(opts,opts.rev?1:-1); } } } } swipePageDown = 0; swipePageUp = 0; },true ); exposeAddSlide(opts, els); return opts; }; function saveOriginalOpts(opts) { opts.original = { before: [], after: [] }; opts.original.cssBefore = $.extend({}, opts.cssBefore); opts.original.cssAfter = $.extend({}, opts.cssAfter); opts.original.animIn = $.extend({}, opts.animIn); opts.original.animOut = $.extend({}, opts.animOut); $.each(opts.before, function() { opts.original.before.push(this); }); $.each(opts.after, function() { opts.original.after.push(this); }); }; function supportMultiTransitions(opts) { var i, tx, txs = $.fn.cycle.transitions; if (opts.fx.indexOf(',') > 0) { opts.multiFx = true; opts.fxs = opts.fx.replace(/\s*/g,'').split(','); for (i=0; i < opts.fxs.length; i++) { var fx = opts.fxs[i]; tx = txs[fx]; if (!tx || !txs.hasOwnProperty(fx) || !$.isFunction(tx)) { log('discarding unknown transition: ',fx); opts.fxs.splice(i,1); i--; } } if (!opts.fxs.length) { log('No valid transitions named; slideshow terminating.'); return false; } } else if (opts.fx == 'all') { opts.multiFx = true; opts.fxs = []; for (p in txs) { tx = txs[p]; if (txs.hasOwnProperty(p) && $.isFunction(tx)) opts.fxs.push(p); } } if (opts.multiFx && opts.randomizeEffects) { // munge the fxs array to make effect selection random var r1 = Math.floor(Math.random() * 20) + 30; for (i = 0; i < r1; i++) { var r2 = Math.floor(Math.random() * opts.fxs.length); opts.fxs.push(opts.fxs.splice(r2,1)[0]); } debug('randomized fx sequence: ',opts.fxs); } return true; }; function exposeAddSlide(opts, els) { opts.addSlide = function(newSlide, prepend) { var $s = $(newSlide), s = $s[0]; if (!opts.autostopCount) opts.countdown++; els[prepend?'unshift':'push'](s); if (opts.els) opts.els[prepend?'unshift':'push'](s); // shuffle needs this opts.slideCount = els.length; $s.css('position','absolute'); $s[prepend?'prependTo':'appendTo'](opts.$cont); if (prepend) { opts.currSlide++; opts.nextSlide++; } if (!$.support.opacity && opts.cleartype && !opts.cleartypeNoBg) clearTypeFix($s); if (opts.fit && opts.width) $s.width(opts.width); if (opts.fit && opts.height && opts.height != 'auto') $slides.height(opts.height); s.cycleH = (opts.fit && opts.height) ? opts.height : $s.height(); s.cycleW = (opts.fit && opts.width) ? opts.width : $s.width(); $s.css(opts.cssBefore); if (opts.pager) $.fn.cycle.createPagerAnchor(els.length-1, s, $(opts.pager), els, opts); if ($.isFunction(opts.onAddSlide)) opts.onAddSlide($s); else $s.hide(); }; } $.fn.cycle.resetState = function(opts, fx) { fx = fx || opts.fx; opts.before = []; opts.after = []; opts.cssBefore = $.extend({}, opts.original.cssBefore); opts.cssAfter = $.extend({}, opts.original.cssAfter); opts.animIn = $.extend({}, opts.original.animIn); opts.animOut = $.extend({}, opts.original.animOut); opts.fxFn = null; $.each(opts.original.before, function() { opts.before.push(this); }); $.each(opts.original.after, function() { opts.after.push(this); }); var init = $.fn.cycle.transitions[fx]; if ($.isFunction(init)) init(opts.$cont, $(opts.elements), opts); }; function go(els, opts, manual, fwd) { // opts.busy is true if we're in the middle of an animation if (manual && opts.busy && opts.manualTrump) { // let manual transitions requests trump active ones $(els).stop(true,true); opts.busy = false; } if (opts.busy) return; var p = opts.$cont[0], curr = els[opts.currSlide], next = els[opts.nextSlide]; // stop cycling if we have an outstanding stop request if (p.cycleStop != opts.stopCount || p.cycleTimeout === 0 && !manual) return; if (!manual && !p.cyclePause && ((opts.autostop && (--opts.countdown <= 0)) || (opts.nowrap && !opts.random && opts.nextSlide < opts.currSlide))) { if (opts.end) opts.end(opts); return; } if ((manual || !p.cyclePause) && (opts.nextSlide != opts.currSlide)) { var fx = opts.fx; // keep trying to get the slide size if we don't have it yet curr.cycleH = curr.cycleH || $(curr).height(); curr.cycleW = curr.cycleW || $(curr).width(); next.cycleH = next.cycleH || $(next).height(); next.cycleW = next.cycleW || $(next).width(); // support multiple transition types if (opts.multiFx) { if (opts.lastFx == undefined || ++opts.lastFx >= opts.fxs.length) opts.lastFx = 0; fx = opts.fxs[opts.lastFx]; opts.currFx = fx; } if (opts.oneTimeFx) { fx = opts.oneTimeFx; opts.oneTimeFx = null; } $.fn.cycle.resetState(opts, fx); if (opts.before.length) $.each(opts.before, function(i,o) { if (p.cycleStop != opts.stopCount) return; o.apply(next, [curr, next, opts, fwd]); }); var after = function() { $.each(opts.after, function(i,o) { if (p.cycleStop != opts.stopCount) return; o.apply(next, [curr, next, opts, fwd]); }); }; opts.busy = 1; if (opts.fxFn) opts.fxFn(curr, next, opts, after, fwd); else if ($.isFunction($.fn.cycle[opts.fx])) $.fn.cycle[opts.fx](curr, next, opts, after); else $.fn.cycle.custom(curr, next, opts, after, manual && opts.fastOnEvent); opts.lastSlide = opts.currSlide; if (opts.random) { opts.currSlide = opts.nextSlide; if (++opts.randomIndex == els.length) opts.randomIndex = 0; opts.nextSlide = opts.randomMap[opts.randomIndex]; } else { // sequence var roll = (opts.nextSlide + 1) == els.length; opts.nextSlide = roll ? 0 : opts.nextSlide+1; opts.currSlide = roll ? els.length-1 : opts.nextSlide-1; } if (opts.pager) opts.updateActivePagerLink(opts.pager, opts.currSlide, opts.activePagerClass); } // stage the next transition var ms = 0; if (opts.timeout && !opts.continuous) ms = getTimeout(curr, next, opts, fwd); else if (opts.continuous && p.cyclePause) // continuous shows work off an after callback, not this timer logic ms = 10; if (ms > 0) p.cycleTimeout = setTimeout(function(){ go(els, opts, 0, !opts.rev) }, ms); }; $.fn.cycle.updateActivePagerLink = function(pager, currSlide, clsName) { $(pager).each(function() { $(this).find('a').removeClass(clsName).filter('a:eq('+currSlide+')').addClass(clsName); }); }; function getTimeout(curr, next, opts, fwd) { if (opts.timeoutFn) { var t = opts.timeoutFn(curr,next,opts,fwd); while ((t - opts.speed) < 250) t += opts.speed; debug('calculated timeout: ' + t + '; speed: ' + opts.speed); if (t !== false) return t; } return opts.timeout; }; $.fn.cycle.next = function(opts) { advance(opts, opts.rev?-1:1); }; $.fn.cycle.prev = function(opts) { advance(opts, opts.rev?1:-1);}; function advance(opts, val) { var els = opts.elements; var p = opts.$cont[0], timeout = p.cycleTimeout; if (timeout) { clearTimeout(timeout); p.cycleTimeout = 0; } if (opts.random && val < 0) { // move back to the previously display slide opts.randomIndex--; if (--opts.randomIndex == -2) opts.randomIndex = els.length-2; else if (opts.randomIndex == -1) opts.randomIndex = els.length-1; opts.nextSlide = opts.randomMap[opts.randomIndex]; } else if (opts.random) { opts.nextSlide = opts.randomMap[opts.randomIndex]; } else { opts.nextSlide = opts.currSlide + val; if (opts.nextSlide < 0) { if (opts.nowrap) return false; opts.nextSlide = els.length - 1; } else if (opts.nextSlide >= els.length) { if (opts.nowrap) return false; opts.nextSlide = 0; } } if ($.isFunction(opts.prevNextClick)) opts.prevNextClick(val > 0, opts.nextSlide, els[opts.nextSlide]); go(els, opts, 1, val>=0); return false; }; function buildPager(els, opts) { var $p = $(opts.pager); $.each(els, function(i,o) { $.fn.cycle.createPagerAnchor(i,o,$p,els,opts); }); opts.updateActivePagerLink(opts.pager, opts.startingSlide, opts.activePagerClass); }; $.fn.cycle.createPagerAnchor = function(i, el, $p, els, opts) { var a; if ($.isFunction(opts.pagerAnchorBuilder)) a = opts.pagerAnchorBuilder(i,el); else a = '<a href="#">'+(el.title)+'</a>'; if (!a) return; var $a = $(a); // don't reparent if anchor is in the dom if ($a.parents('body').length === 0) { var arr = []; if ($p.length > 1) { $p.each(function() { var $clone = $a.clone(true); $(this).append($clone); arr.push($clone[0]); }); $a = $(arr); } else { $a.appendTo($p); } } $a.bind(opts.pagerEvent, function(e) { e.preventDefault(); opts.nextSlide = i; var p = opts.$cont[0], timeout = p.cycleTimeout; if (timeout) { clearTimeout(timeout); p.cycleTimeout = 0; } if ($.isFunction(opts.pagerClick)) opts.pagerClick(opts.nextSlide, els[opts.nextSlide]); go(els,opts,1,opts.currSlide < i); // trigger the trans return false; }); if (opts.pagerEvent != 'click') $a.click(function(){return false;}); // supress click if (opts.pauseOnPagerHover) $a.hover(function() { opts.$cont[0].cyclePause++; }, function() { opts.$cont[0].cyclePause--; } ); }; $.fn.cycle.hopsFromLast = function(opts, fwd) { var hops, l = opts.lastSlide, c = opts.currSlide; if (fwd) hops = c > l ? c - l : opts.slideCount - l; else hops = c < l ? l - c : l + opts.slideCount - c; return hops; }; function clearTypeFix($slides) { function hex(s) { s = parseInt(s).toString(16); return s.length < 2 ? '0'+s : s; }; function getBg(e) { for ( ; e && e.nodeName.toLowerCase() != 'html'; e = e.parentNode) { var v = $.css(e,'background-color'); if (v.indexOf('rgb') >= 0 ) { var rgb = v.match(/\d+/g); return '#'+ hex(rgb[0]) + hex(rgb[1]) + hex(rgb[2]); } if (v && v != 'transparent') return v; } return '#ffffff'; }; $slides.each(function() { $(this).css('background-color', getBg(this)); }); }; // reset common props before the next transition $.fn.cycle.commonReset = function(curr,next,opts,w,h,rev) { $(opts.elements).not(curr).hide(); opts.cssBefore.opacity = 1; opts.cssBefore.display = 'block'; if (w !== false && next.cycleW > 0) opts.cssBefore.width = next.cycleW; if (h !== false && next.cycleH > 0) opts.cssBefore.height = next.cycleH; opts.cssAfter = opts.cssAfter || {}; opts.cssAfter.display = 'none'; $(curr).css('zIndex',opts.slideCount + (rev === true ? 1 : 0)); $(next).css('zIndex',opts.slideCount + (rev === true ? 0 : 1)); }; // the actual fn for effecting a transition $.fn.cycle.custom = function(curr, next, opts, cb, speedOverride) { var $l = $(curr), $n = $(next); var speedIn = opts.speedIn, speedOut = opts.speedOut, easeIn = opts.easeIn, easeOut = opts.easeOut; $n.css(opts.cssBefore); if (speedOverride) { if (typeof speedOverride == 'number') speedIn = speedOut = speedOverride; else speedIn = speedOut = 1; easeIn = easeOut = null; } var fn = function() {$n.animate(opts.animIn, speedIn, easeIn, cb)}; $l.animate(opts.animOut, speedOut, easeOut, function() { if (opts.cssAfter) $l.css(opts.cssAfter); if (!opts.sync) fn(); }); if (opts.sync) fn(); }; // transition definitions - only fade is defined here, transition pack defines the rest $.fn.cycle.transitions = { fade: function($cont, $slides, opts) { $slides.not(':eq('+opts.currSlide+')').css('opacity',0); opts.before.push(function(curr,next,opts) { $.fn.cycle.commonReset(curr,next,opts); opts.cssBefore.opacity = 0; }); opts.animIn = { opacity: 1 }; opts.animOut = { opacity: 0 }; opts.cssBefore = { top: 0, left: 0 }; } }; $.fn.cycle.ver = function() { return ver; }; // override these globally if you like (they are all optional) $.fn.cycle.defaults = { fx: 'pfsl', // name of transition effect (or comma separated names, ex: fade,scrollUp,shuffle) timeout: 0, // milliseconds between slide transitions (0 to disable auto advance) timeoutFn: null, // callback for determining per-slide timeout value: function(currSlideElement, nextSlideElement, options, forwardFlag) continuous: 0, // true to start next transition immediately after current one completes speed: 200, // speed of the transition (any valid fx speed value) speedIn: null, // speed of the 'in' transition speedOut: null, // speed of the 'out' transition next: '#next_arrow', // selector for element to use as click trigger for next slide prev: '#prev_arrow', // selector for element to use as click trigger for previous slide prevNextClick: null, // callback fn for prev/next clicks: function(isNext, zeroBasedSlideIndex, slideElement) prevNextEvent:'click',// event which drives the manual transition to the previous or next slide pager: '#line', // selector for element to use as pager container pagerClick: null, // callback fn for pager clicks: function(zeroBasedSlideIndex, slideElement) pagerEvent: 'click', // name of event which drives the pager navigation pagerAnchorBuilder: null, // callback fn for building anchor links: function(index, DOMelement) before: null, // transition callback (scope set to element to be shown): function(currSlideElement, nextSlideElement, options, forwardFlag) after: null, // transition callback (scope set to element that was shown): function(currSlideElement, nextSlideElement, options, forwardFlag) end: null, // callback invoked when the slideshow terminates (use with autostop or nowrap options): function(options) easing: null, // easing method for both in and out transitions easeIn: null, // easing for "in" transition easeOut: null, // easing for "out" transition shuffle: null, // coords for shuffle animation, ex: { top:15, left: 200 } animIn: null, // properties that define how the slide animates in animOut: null, // properties that define how the slide animates out cssBefore: null, // properties that define the initial state of the slide before transitioning in cssAfter: null, // properties that defined the state of the slide after transitioning out fxFn: null, // function used to control the transition: function(currSlideElement, nextSlideElement, options, afterCalback, forwardFlag) height: 'auto', // container height startingSlide: 0, // zero-based index of the first slide to be displayed sync: 0, // true if in/out transitions should occur simultaneously random: 0, // true for random, false for sequence (not applicable to shuffle fx) fit: 0, // force slides to fit container containerResize: 1, // resize container to fit largest slide pause: 0, // true to enable "pause on hover" pauseOnPagerHover: 0, // true to pause when hovering over pager link autostop: 0, // true to end slideshow after X transitions (where X == slide count) autostopCount: 0, // number of transitions (optionally used with autostop to define X) delay: 0, // additional delay (in ms) for first transition (hint: can be negative) slideExpr: null, // expression for selecting slides (if something other than all children is required) cleartype: !$.support.opacity, // true if clearType corrections should be applied (for IE) cleartypeNoBg: false, // set to true to disable extra cleartype fixing (leave false to force background color setting on slides) nowrap: 0, // true to prevent slideshow from wrapping fastOnEvent: 0, // force fast transitions when triggered manually (via pager or prev/next); value == time in ms randomizeEffects: 1, // valid when multiple effects are used; true to make the effect sequence random rev: 0, // causes animations to transition in reverse manualTrump: true, // causes manual transition to stop an active transition instead of being ignored requeueOnImageNotLoaded: true, // requeue the slideshow if any image slides are not yet loaded requeueTimeout: 250, // ms delay for requeue activePagerClass: 'activeSlide', // class name used for the active pager link updateActivePagerLink: null // callback fn invoked to update the active pager link (adds/removes activePagerClass style) }; })(jQuery); /*! * jQuery Cycle Plugin Transition Definitions * This script is a plugin for the jQuery Cycle Plugin * Examples and documentation at: http://malsup.com/jquery/cycle/ * Copyright (c) 2007-2008 M. Alsup * Version: 2.72 * Dual licensed under the MIT and GPL licenses: * http://www.opensource.org/licenses/mit-license.php * http://www.gnu.org/licenses/gpl.html */ (function($) { $.fn.cycle.transitions.none = function($cont, $slides, opts) { opts.fxFn = function(curr,next,opts,after){ $(next).show(); $(curr).hide(); after(); }; } $.fn.cycle.transitions.pfsl = function($cont, $slides, opts, fwd) { opts.before.push(function(curr, next, opts, fwd) { $.fn.cycle.commonReset(curr,next,opts); opts.cssBefore.left = fwd ? 960 : -960; opts.cssBefore.opacity = 0; opts.animOut.left = fwd ? 960 : -960; opts.animIn.opacity = 1; opts.animOut.opacity = 0; }); opts.cssBefore = fwd ? { top: 0, left: 960, display: 'block' } : { top: 0, left: -960, display: 'block' }; opts.animIn = fwd ? { left: 0 } : { left: 0 }; opts.animOut = fwd ? { left: 960 } : { left: -960 }; }; })(jQuery);
{ "content_hash": "a18d942a978b3546b21c726d08547868", "timestamp": "", "source": "github", "line_count": 898, "max_line_length": 148, "avg_line_length": 32.2728285077951, "alnum_prop": 0.6454573686208206, "repo_name": "dbstylesnet/dbstylesnet", "id": "577183942a0dfec02843f70d97f8b774bf988296", "size": "29353", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "jquery.cycle.all.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "34187" }, { "name": "HTML", "bytes": "33141" }, { "name": "Hack", "bytes": "5384" }, { "name": "JavaScript", "bytes": "85881" }, { "name": "PHP", "bytes": "49532" } ], "symlink_target": "" }
<?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_window_focused="false" android:state_enabled="true" android:drawable="@drawable/signup_normal" /> <item android:state_window_focused="false" android:state_enabled="false" android:drawable="@drawable/signup_normal" /> <item android:state_pressed="true" android:drawable="@drawable/signup_pressed" /> <item android:state_focused="true" android:state_enabled="true" android:drawable="@drawable/signup_pressed" /> <item android:state_enabled="true" android:drawable="@drawable/signup_normal" /> </selector>
{ "content_hash": "b26ec003479d409497b52955e73b4804", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 77, "avg_line_length": 55.69230769230769, "alnum_prop": 0.6657458563535912, "repo_name": "kii-dev-jenkins/KiiBoard", "id": "6e2fd711642722f5c78d4e08d10697e843f5cd06", "size": "724", "binary": false, "copies": "6", "ref": "refs/heads/master", "path": "res/drawable-hdpi/signup_button_background.xml", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "58758" } ], "symlink_target": "" }
SYNONYM #### According to Integrated Taxonomic Information System #### Published in null #### Original name null ### Remarks null
{ "content_hash": "f7e6a94795e1faf14aee43e5e92db454", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 39, "avg_line_length": 10.23076923076923, "alnum_prop": 0.7218045112781954, "repo_name": "mdoering/backbone", "id": "cbc441843c77f73e9a52c35c4911711373855d00", "size": "208", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Plantae/Magnoliophyta/Liliopsida/Poales/Juncaceae/Juncus/Juncus canadensis/ Syn. Juncus canadensis canadensis/README.md", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
<?php /** * Modules Class * * @package Ionize CMS * @subpackage User * @author Ionize Dev Team * */ namespace Ionize { if ( ! defined('BASEPATH')) exit('No direct script access allowed'); class Modules { private static $ci; /** * Contains the Modules instance. * * @var Modules */ private static $instance; /** * All modules definition * * @var null|array */ private static $modules = NULL; /** * Installed modules definition * * @var null|array */ private static $installed_modules = NULL; private static $resources = NULL; // -------------------------------------------------------------------- public function __construct() { self::$instance =& $this; log_message('debug', 'Class Module initialized'); static::get_modules(); } // -------------------------------------------------------------------- public static function get_module_config($module_folder) { $modules = static::get_modules(); if (isset($modules[ucfirst($module_folder)])) { return $modules[ucfirst($module_folder)]; } return array(); } // -------------------------------------------------------------------- public static function get_module_config_from_uri($module_uri) { $module_folder = NULL; // Modules from config file $modules = $aliases = $disable_controller = array(); include APPPATH . 'config/modules.php'; if(in_array($module_uri, array_keys($modules)) && ( ! in_array($module_uri, $disable_controller))) $module_folder = $modules[$module_uri]; $all_modules = static::get_modules(); if (isset($all_modules[ucfirst($module_folder)])) { return $all_modules[ucfirst($module_folder)]; } return array(); } // -------------------------------------------------------------------- public static function get_resources() { if ( is_null(static::$resources)) { $resources = array(); $modules = static::get_installed_modules(); foreach($modules as $module_key => $module) { $module_key = strtolower($module_key); $base_module_resource = 'module/' . $module_key; // Basic Module resource (root) $resources[] = array( 'id_resource' => $base_module_resource, 'id_parent' => '', 'resource' => $base_module_resource, 'actions' => '', 'title' => $module['name'], 'description' => '', ); if (isset($module['resources'])) { foreach($module['resources'] as $resource => $data) { // Root module actions if ( empty($resource)) { $resources[0]['id_resource'] = $base_module_resource; $resources[0]['actions'] = ! empty($data['actions']) ? $data['actions'] : ''; $resources[0]['title'] = ! empty($data['title']) ? $data['title'] : ''; $resources[0]['description'] = ! empty($data['description']) ? $data['description'] : ''; } else { $resources[] = array( 'id_resource' => $base_module_resource .'/' . $resource, 'id_parent' => ! empty($data['parent']) ? $base_module_resource .'/'.$data['parent'] : $base_module_resource, 'resource' => $base_module_resource .'/' . $resource, 'actions' => ! empty($data['actions']) ? $data['actions'] : '', 'title' => ! empty($data['title']) ? $data['title'] : '', 'description' => ! empty($data['description']) ? $data['description'] : $resource, ); } } } } static::$resources = $resources; } return static::$resources; } // -------------------------------------------------------------------- /** * Get all modules * * @return array|null * */ public static function get_modules() { if (is_null(static::$modules)) { static::$modules = array(); static::$installed_modules = array(); // Installed modules, stored in application/config/modules.php $modules = array(); include(APPPATH.'config/modules.php'); // All modules folders $folders = glob(MODPATH.'*'); if ( ! empty($folders)) { foreach($folders as $folder) { if (is_dir($folder)) { $file = $folder .'/config/config.php'; if (is_file($file)) { $config = include($file); if ( isset($config) && is_array($config)) { $folder_name = array_pop(explode('/', $folder)); $config['path'] = $folder; $config['folder'] = $folder_name; $config['key'] = strtolower($folder_name); $config['installed'] = FALSE; if ( ! isset($config['uri'])) $config['uri'] = $config['key']; if (in_array($folder_name, $modules)) { $config['installed'] = TRUE; static::$installed_modules[$folder_name] = $config; } static::$modules[$folder_name] = $config; } unset($config); } } } } } return static::$modules; } // -------------------------------------------------------------------- /** * Returns installed modules * * @return array|null * */ public static function get_installed_modules() { static::get_modules(); return static::$installed_modules; } // -------------------------------------------------------------------- /** * Get the instance of the Lib * */ public static function get_instance() { if( ! isset(self::$instance)) { new Modules(); self::$ci->load->_ci_loaded_files[] = APPPATH.'core/Modules.php'; } return self::$instance; } } } // -------------------------------------------------------------------- namespace { /** * Returns the authentication object, short for Modules::get_instance(). * * @return Ionize\Modules */ function Modules() { return Ionize\Modules::get_instance(); } }
{ "content_hash": "186431ef56d6ddb984ce0877f9ab4df3", "timestamp": "", "source": "github", "line_count": 274, "max_line_length": 118, "avg_line_length": 22.525547445255473, "alnum_prop": 0.4758587167854828, "repo_name": "chguoxi/ionize", "id": "644453f74715c06ac0744b53250472cb6313bc66", "size": "6172", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "application/core/Modules.php", "mode": "33188", "license": "mit", "language": [ { "name": "ApacheConf", "bytes": "1883" }, { "name": "CSS", "bytes": "219253" }, { "name": "HTML", "bytes": "86341" }, { "name": "JavaScript", "bytes": "2005100" }, { "name": "PHP", "bytes": "5028191" } ], "symlink_target": "" }
using System; namespace SmokeScreen { [EffectDefinition("DEBUG_EFFECT")] class DebugEffect : EffectBehaviour { public override void OnEvent() { Print(effectName.PadRight(16) + "OnEvent single -------------------------------------------------------"); } private float lastPower = -1; public override void OnEvent(float power) { if (Math.Abs(lastPower - power) > 0.01f) { lastPower = power; Print(effectName.PadRight(16) + " " + instanceName + "OnEvent pow = " + power.ToString("F2")); } } public override void OnInitialize() { Print("OnInitialize"); } public override void OnLoad(ConfigNode node) { Print("OnLoad"); } public override void OnSave(ConfigNode node) { Print("OnSave"); } private static void Print(String s) { print("[SmokeScreen DebugEffect] " + s); } } }
{ "content_hash": "d294f781d91009be8af5a487041a439e", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 118, "avg_line_length": 24.386363636363637, "alnum_prop": 0.4790307548928239, "repo_name": "sarbian/SmokeScreen", "id": "7c2de4ea00e4f0ab0f71a1b030a417dd11bb69fa", "size": "1075", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "DebugEffect.cs", "mode": "33188", "license": "bsd-2-clause", "language": [ { "name": "C#", "bytes": "159215" } ], "symlink_target": "" }
cask "pine" do version "0.1.0" sha256 "046f2603f7e4dcdc7535c6a5652dbfbab5cbe93fa36ca161f8a8029b53770b76" url "https://github.com/lukakerr/pine/releases/download/#{version}/Pine-#{version}.zip" appcast "https://github.com/lukakerr/pine/releases.atom" name "Pine" homepage "https://github.com/lukakerr/pine" depends_on macos: ">= :sierra" app "Pine.app" zap trash: [ "~/Library/Application Support/Pine", "~/Library/Application Support/com.apple.sharedfilelist/com.apple.LSSharedFileList.ApplicationRecentDocuments/io.github.lukakerr.pine.sfl2", "~/Library/Caches/io.github.lukakerr.Pine", "~/Library/Preferences/io.github.lukakerr.Pine.plist", "~/Library/Saved Application State/io.github.lukakerr.Pine.savedState", "~/Library/WebKit/io.github.lukakerr.Pine", ] end
{ "content_hash": "e332714c78d41634fea73d30768423f9", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 144, "avg_line_length": 36.95454545454545, "alnum_prop": 0.7392373923739237, "repo_name": "jgarber623/homebrew-cask", "id": "93cdcb07e17ab7a383299d6da476ade9ba8a096d", "size": "813", "binary": false, "copies": "5", "ref": "refs/heads/master", "path": "Casks/pine.rb", "mode": "33188", "license": "bsd-2-clause", "language": [ { "name": "Dockerfile", "bytes": "249" }, { "name": "Python", "bytes": "3630" }, { "name": "Ruby", "bytes": "2281486" }, { "name": "Shell", "bytes": "32035" } ], "symlink_target": "" }
ACCEPTED #### According to International Plant Names Index #### Published in null #### Original name null ### Remarks null
{ "content_hash": "6e3721d3054f1de13fef8270252bde2d", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 31, "avg_line_length": 9.692307692307692, "alnum_prop": 0.7063492063492064, "repo_name": "mdoering/backbone", "id": "b98a82563b702819549e7b7313dba8577c089f28", "size": "177", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Plantae/Magnoliophyta/Magnoliopsida/Malpighiales/Euphorbiaceae/Clutia/Clutia dumosa/README.md", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
/* * LM35.cpp * * Created: 13-4-2014 16:31:40 * Author: CE-Designs * Version: 1.01 * * Modified: 13-7-2014 * Reason: To ensure more accurate reading the sensor is * now being read 4 times and the average of the * measurements is returned * Also changed the way that the analog reference * is being set */ #include "LM35.h" // default constructor LM35::LM35(int tempPin, uint8_t unitOfMeasurement) { this->TempPin = tempPin; this->UnitOfMeasurement = unitOfMeasurement; this->Resolution = DEFAULT_RESOLUTION; } //LM35 // default constructor LM35::LM35(int tempPin, uint8_t unitOfMeasurement, uint8_t resolution) { this->UnitOfMeasurement = unitOfMeasurement; this->Resolution = resolution; this->TempPin = tempPin; } void LM35::begin() { applyResolution(); } float LM35::read() { switch (this->UnitOfMeasurement + this->Resolution) { case 5: return readCelcius(measureFoutTimes()); case 6: return readFahrenheit(measureFoutTimes()); case 9: return readCelciusHighRes(measureFoutTimes()); case 10: return readFahrenheitHighRes(measureFoutTimes()); default: return 0; break; } } float LM35::measureFoutTimes() { float avg = 0; for (uint8_t i = 0; i < 4; i++) { avg += analogRead(this->TempPin);; } return avg / 4; } float LM35::readCelcius(int reading) { return (5.0 * reading * 100.0) / 1024.0; } float LM35::readCelciusHighRes(int reading) { return reading / 9.31; } float LM35::readFahrenheit(int reading) { return (((5.0 * reading * 100.0) / 1024.0) * 9.0 / 5.0) + 32.0; } float LM35::readFahrenheitHighRes(int reading) { return ((reading / 9.31) * 9.0 / 5.0) + 32.0; } void LM35::useHighResolution() { analogReference(INTERNAL); } void LM35::useDefaultResolution() { analogReference(DEFAULT); } void LM35::applyResolution() { switch (this->Resolution) { case DEFAULT_RESOLUTION: analogReference(DEFAULT); break; case HIGH_RESOLUTION: analogReference(INTERNAL); break; default: analogReference(DEFAULT); break; } }
{ "content_hash": "70e72c652391743292814c21b2b0f3a2", "timestamp": "", "source": "github", "line_count": 112, "max_line_length": 70, "avg_line_length": 17.883928571428573, "alnum_prop": 0.6959560659011482, "repo_name": "ce-designs/LM35_lib", "id": "cb05e9efe675c9a6a3160b3dea67563760ab4d3b", "size": "2003", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "LM35.cpp", "mode": "33188", "license": "mit", "language": [ { "name": "C++", "bytes": "3165" } ], "symlink_target": "" }
from datetime import datetime, timedelta import uuid from database import Base from sqlalchemy import Column, Integer, String, DateTime, ForeignKey, Text, Boolean class SessionExpiredException(Exception): pass class User(Base): __tablename__ = "users" id = Column(Integer, primary_key=True) email = Column(String(60)) is_admin = Column(Boolean) created = Column(DateTime) def __init__(self, email): self.email = email self.is_admin = False self.created = datetime.utcnow() class Session(Base): __tablename__ = "sessions" id = Column(Integer, primary_key=True) user_id = Column(Integer, ForeignKey("users.id")) key = Column(String(16)) created = Column(DateTime) expires = Column(DateTime) def __init__(self, user): self.user_id = user self.key = unicode(uuid.uuid4()) self.created = datetime.utcnow() self.expires = self.created + timedelta(hours=1) def prolong(self): if self.is_valid: self.expires = datetime.utcnow() + timedelta(hours=1) else: raise SessionExpiredException("user_id {} session #{} has expired".format(self.user_id, self.id)) @property def is_valid(self): return datetime.utcnow() < self.expires class Tasks(Base): __tablename__ = "tasks" id = Column(Integer, primary_key=True) issuer_id = Column(Integer, ForeignKey("users.id")) type = Column(String(20)) status = Column(String(12)) log = Column(Text) created = Column(DateTime) updated = Column(DateTime) def __init__(self, task_type, user): self.type = task_type if user: self.issuer_id = user.id self.status = "scheduled" self.created = datetime.utcnow() self.updated = datetime.utcnow() self.log = None def start(self): self.status = "started" self.updated = datetime.utcnow() def finish(self, log): self.status = "finished" self.updated = datetime.utcnow() self.log = log def error(self, log): self.status = "failed" self.updated = datetime.utcnow() self.log = log
{ "content_hash": "3b44807be0e472937c5739d82996169f", "timestamp": "", "source": "github", "line_count": 80, "max_line_length": 109, "avg_line_length": 27.5, "alnum_prop": 0.6140909090909091, "repo_name": "RevelSystems/revel-bootstrap", "id": "bc6fc2390078babe493a12e712de5e3cd67ef333", "size": "2200", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "blueprints/dummy/models/__init__.py", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "136769" }, { "name": "JavaScript", "bytes": "58458" }, { "name": "Python", "bytes": "9862" } ], "symlink_target": "" }
Configuration ============= Available settings: ACCOUNT_ADAPTER (="allauth.account.adapter.DefaultAccountAdapter") Specifies the adapter class to use, allowing you to alter certain default behaviour. ACCOUNT_AUTHENTICATED_LOGIN_REDIRECTS (=True) The default behaviour is to redirect authenticated users to ``LOGIN_REDIRECT_URL`` when they try accessing login/signup pages. By changing this setting to ``False``, logged in users will not be redirected when they access login/signup pages. ACCOUNT_AUTHENTICATION_METHOD (="username" | "email" | "username_email") Specifies the login method to use -- whether the user logs in by entering their username, e-mail address, or either one of both. Setting this to "email" requires ACCOUNT_EMAIL_REQUIRED=True ACCOUNT_CONFIRM_EMAIL_ON_GET (=False) Determines whether or not an e-mail address is automatically confirmed by a GET request. `GET is not designed to modify the server state <http://programmers.stackexchange.com/questions/188860/>`_, though it is commonly used for email confirmation. To avoid requiring user interaction, consider using POST via Javascript in your email confirmation template as an alternative to setting this to True. ACCOUNT_EMAIL_CONFIRMATION_ANONYMOUS_REDIRECT_URL (=settings.LOGIN_URL) The URL to redirect to after a successful e-mail confirmation, in case no user is logged in. ACCOUNT_EMAIL_CONFIRMATION_AUTHENTICATED_REDIRECT_URL (=None) The URL to redirect to after a successful e-mail confirmation, in case of an authenticated user. Set to ``None`` to use ``settings.LOGIN_REDIRECT_URL``. ACCOUNT_EMAIL_CONFIRMATION_EXPIRE_DAYS (=3) Determines the expiration date of email confirmation mails (# of days). ACCOUNT_EMAIL_CONFIRMATION_HMAC (=True) In order to verify an email address a key is mailed identifying the email address to be verified. In previous versions, a record was stored in the database for each ongoing email confirmation, keeping track of these keys. Current versions use HMAC based keys that do not require server side state. ACCOUNT_EMAIL_REQUIRED (=False) The user is required to hand over an e-mail address when signing up. ACCOUNT_EMAIL_VERIFICATION (="optional") Determines the e-mail verification method during signup -- choose one of ``"mandatory"``, ``"optional"``, or ``"none"``. When set to "mandatory" the user is blocked from logging in until the email address is verified. Choose "optional" or "none" to allow logins with an unverified e-mail address. In case of "optional", the e-mail verification mail is still sent, whereas in case of "none" no e-mail verification mails are sent. ACCOUNT_EMAIL_SUBJECT_PREFIX (="[Site] ") Subject-line prefix to use for email messages sent. By default, the name of the current ``Site`` (``django.contrib.sites``) is used. ACCOUNT_DEFAULT_HTTP_PROTOCOL (="http") The default protocol used for when generating URLs, e.g. for the password forgotten procedure. Note that this is a default only -- see the section on HTTPS for more information. ACCOUNT_FORMS (={}) Used to override forms, for example: ``{'login': 'myapp.forms.LoginForm'}`` ACCOUNT_LOGIN_ATTEMPTS_LIMIT (=5) Number of failed login attempts. When this number is exceeded, the user is prohibited from logging in for the specified ``ACCOUNT_LOGIN_ATTEMPTS_TIMEOUT`` seconds. Set to ``None`` to disable this functionality. Important: while this protects the allauth login view, it does not protect Django's admin login from being brute forced. ACCOUNT_LOGIN_ATTEMPTS_TIMEOUT (=300) Time period, in seconds, from last unsuccessful login attempt, during which the user is prohibited from trying to log in. ACCOUNT_LOGIN_ON_EMAIL_CONFIRMATION (=False) The default behaviour is not log users in and to redirect them to ``ACCOUNT_EMAIL_CONFIRMATION_ANONYMOUS_REDIRECT_URL``. By changing this setting to ``True``, users will automatically be logged in once they confirm their email address. Note however that this only works when confirming the email address **immediately after signing up**, assuming users didn't close their browser or used some sort of private browsing mode. ACCOUNT_LOGOUT_ON_GET (=False) Determines whether or not the user is automatically logged out by a GET request. `GET is not designed to modify the server state <http://programmers.stackexchange.com/questions/188860/>`_, and in this case it can be dangerous. See `LogoutView in the documentation <http://django-allauth.readthedocs.io/en/latest/views.html#logout>`_ for details. ACCOUNT_LOGOUT_ON_PASSWORD_CHANGE (=False) Determines whether or not the user is automatically logged out after changing or setting their password. See documentation for `Django's session invalidation on password change <https://docs.djangoproject.com/en/1.8/topics/auth/default/#session-invalidation-on-password-change>`_. ACCOUNT_LOGIN_ON_PASSWORD_RESET (=False) By changing this setting to ``True``, users will automatically be logged in once they have reset their password. By default they are redirected to the password reset done page. ACCOUNT_LOGOUT_REDIRECT_URL (="/") The URL (or URL name) to return to after the user logs out. This is the counterpart to Django's ``LOGIN_REDIRECT_URL``. ACCOUNT_PASSWORD_INPUT_RENDER_VALUE (=False) ``render_value`` parameter as passed to ``PasswordInput`` fields. ACCOUNT_PRESERVE_USERNAME_CASING (=True) This setting determines whether the username is stored in lowercase (``False``) or whether its casing is to be preserved (``True``). Note that when casing is preserved, potentially expensive ``__iexact`` lookups are performed when filter on username. For now, the default is set to ``True`` to maintain backwards compatibility. ACCOUNT_SESSION_REMEMBER (=None) Controls the life time of the session. Set to ``None`` to ask the user ("Remember me?"), ``False`` to not remember, and ``True`` to always remember. ACCOUNT_SIGNUP_EMAIL_ENTER_TWICE (=False) When signing up, let the user type in their email address twice to avoid typo's. ACCOUNT_SIGNUP_FORM_CLASS (=None) A string pointing to a custom form class (e.g. 'myapp.forms.SignupForm') that is used during signup to ask the user for additional input (e.g. newsletter signup, birth date). This class should implement a ``def signup(self, request, user)`` method, where user represents the newly signed up user. ACCOUNT_SIGNUP_PASSWORD_ENTER_TWICE (=True) When signing up, let the user type in their password twice to avoid typos. ACCOUNT_TEMPLATE_EXTENSION (="html") A string defining the template extension to use, defaults to ``html``. ACCOUNT_USERNAME_BLACKLIST (=[]) A list of usernames that can't be used by user. ACCOUNT_UNIQUE_EMAIL (=True) Enforce uniqueness of e-mail addresses. The ``emailaddress.email`` model field is set to ``UNIQUE``. Forms prevent a user from registering with or adding an additional email address if that email address is in use by another account. ACCOUNT_USER_DISPLAY (=a callable returning ``user.username``) A callable (or string of the form ``'some.module.callable_name'``) that takes a user as its only argument and returns the display name of the user. The default implementation returns ``user.username``. ACCOUNT_USER_MODEL_EMAIL_FIELD (="email") The name of the field containing the ``email``, if any. See custom user models. ACCOUNT_USER_MODEL_USERNAME_FIELD (="username") The name of the field containing the ``username``, if any. See custom user models. ACCOUNT_USERNAME_MIN_LENGTH (=1) An integer specifying the minimum allowed length of a username. ACCOUNT_USERNAME_REQUIRED (=True) The user is required to enter a username when signing up. Note that the user will be asked to do so even if ``ACCOUNT_AUTHENTICATION_METHOD`` is set to ``email``. Set to ``False`` when you do not wish to prompt the user to enter a username. ACCOUNT_USERNAME_VALIDATORS (=None) A path (``'some.module.validators.custom_username_validators'``) to a list of custom username validators. If left unset, the validators setup within the user model username field are used. SOCIALACCOUNT_ADAPTER (="allauth.socialaccount.adapter.DefaultSocialAccountAdapter") Specifies the adapter class to use, allowing you to alter certain default behaviour. SOCIALACCOUNT_AUTO_SIGNUP (=True) Attempt to bypass the signup form by using fields (e.g. username, email) retrieved from the social account provider. If a conflict arises due to a duplicate e-mail address the signup form will still kick in. SOCIALACCOUNT_EMAIL_VERIFICATION (=ACCOUNT_EMAIL_VERIFICATION) As ``ACCOUNT_EMAIL_VERIFICATION``, but for social accounts. SOCIALACCOUNT_EMAIL_REQUIRED (=ACCOUNT_EMAIL_REQUIRED) The user is required to hand over an e-mail address when signing up using a social account. SOCIALACCOUNT_FORMS (={}) Used to override forms, for example: ``{'signup': 'myapp.forms.SignupForm'}`` SOCIALACCOUNT_PROVIDERS (= dict) Dictionary containing provider specific settings. SOCIALACCOUNT_QUERY_EMAIL (=ACCOUNT_EMAIL_REQUIRED) Request e-mail address from 3rd party account provider? E.g. using OpenID AX, or the Facebook "email" permission. SOCIALACCOUNT_STORE_TOKENS (=True) Indicates whether or not the access tokens are stored in the database.
{ "content_hash": "5ede02d678377cbeb1baf2779eaa94ae", "timestamp": "", "source": "github", "line_count": 214, "max_line_length": 155, "avg_line_length": 43.850467289719624, "alnum_prop": 0.7577791986359761, "repo_name": "okwow123/djangol2", "id": "189c57c8d9427d756c2e09ddb1a51545933d21fa", "size": "9384", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "docs/configuration.rst", "mode": "33188", "license": "mit", "language": [ { "name": "HTML", "bytes": "44659" }, { "name": "JavaScript", "bytes": "3260" }, { "name": "Makefile", "bytes": "694" }, { "name": "Python", "bytes": "636751" } ], "symlink_target": "" }
package org.mapfish.print.output; import net.sf.jasperreports.engine.JRException; import net.sf.jasperreports.engine.export.JRPdfExporter; import net.sf.jasperreports.export.SimpleExporterInput; import net.sf.jasperreports.export.SimpleOutputStreamExporterOutput; import net.sf.jasperreports.export.SimplePdfExporterConfiguration; import net.sf.jasperreports.export.type.PdfVersionEnum; import org.mapfish.print.config.PDFConfig; import java.io.OutputStream; /** * An PDF output format that uses Jasper reports to generate the result. */ public final class JasperReportPDFOutputFormat extends AbstractJasperReportOutputFormat implements OutputFormat { @Override public String getContentType() { return "application/pdf"; } @Override public String getFileSuffix() { return "pdf"; } @Override protected void doExport(final OutputStream outputStream, final Print print) throws JRException { JRPdfExporter exporter = new JRPdfExporter(print.context); exporter.setExporterInput(new SimpleExporterInput(print.print)); exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(outputStream)); SimplePdfExporterConfiguration configuration = new SimplePdfExporterConfiguration(); configuration.setPdfVersion(PdfVersionEnum.VERSION_1_7); final PDFConfig pdfConfig = print.values.getObject(Values.PDF_CONFIG, PDFConfig.class); configuration.setCompressed(pdfConfig.isCompressed()); configuration.setMetadataAuthor(pdfConfig.getAuthor()); configuration.setMetadataCreator(pdfConfig.getCreator()); configuration.setMetadataSubject(pdfConfig.getSubject()); configuration.setMetadataTitle(pdfConfig.getTitle()); configuration.setMetadataKeywords(pdfConfig.getKeywordsAsString()); exporter.setConfiguration(configuration); exporter.exportReport(); } }
{ "content_hash": "fb5f24cf352bacc26bbcf26ccaf3d992", "timestamp": "", "source": "github", "line_count": 52, "max_line_length": 113, "avg_line_length": 36.94230769230769, "alnum_prop": 0.7683498178032275, "repo_name": "Galigeo/mapfish-print", "id": "4f098ea1ef9d418a77c3c15819904d4f8f83d76c", "size": "1921", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "core/src/main/java/org/mapfish/print/output/JasperReportPDFOutputFormat.java", "mode": "33188", "license": "bsd-2-clause", "language": [ { "name": "Batchfile", "bytes": "2616" }, { "name": "HTML", "bytes": "8775" }, { "name": "Java", "bytes": "2237862" }, { "name": "Scheme", "bytes": "40153" }, { "name": "Shell", "bytes": "6144" }, { "name": "XSLT", "bytes": "1876" } ], "symlink_target": "" }
package org.spongepowered.api.event.item.inventory; import com.google.common.collect.Lists; import org.spongepowered.api.data.Transaction; import org.spongepowered.api.event.Cancellable; import org.spongepowered.api.event.Event; import org.spongepowered.api.item.inventory.Inventory; import org.spongepowered.api.item.inventory.ItemStack; import org.spongepowered.api.item.inventory.ItemStackSnapshot; import org.spongepowered.api.util.annotation.eventgen.NoFactoryMethod; import java.util.List; import java.util.function.Predicate; /** * Fired when {@link ItemStack}s are generated into a {@link Inventory}. */ @NoFactoryMethod // abstract event public interface AffectItemStackEvent extends Event, Cancellable { /** * Gets a list of the {@link Transaction}s for this event. If a * transaction is requested to be marked as "invalid", * {@link Transaction#setValid(boolean)} can be used. * * @return The unmodifiable list of transactions */ List<? extends Transaction<ItemStackSnapshot>> transactions(); /** * Applies the provided {@link Predicate} to the {@link List} of * {@link Transaction}s from {@link #transactions()} such that * any time that {@link Predicate#test(Object)} returns <code>false</code> * on a {@link Transaction}, the {@link Transaction} is * marked as "invalid" and will not apply post event. * * <p>{@link Transaction#finalReplacement()} is used to construct * the {@link ItemStack} to pass to the predicate</p> * * @param predicate The predicate to use for filtering * @return The transactions for which the predicate returned * <code>false</code> */ default List<? extends Transaction<ItemStackSnapshot>> filter(Predicate<ItemStack> predicate) { final List<Transaction<ItemStackSnapshot>> invalidatedTransactions = Lists.newArrayList(); this.transactions().stream().filter(transaction -> !predicate.test(transaction.finalReplacement().createStack())).forEach(transaction -> { transaction.setValid(false); invalidatedTransactions.add(transaction); }); return invalidatedTransactions; } }
{ "content_hash": "ee195eeb0aecd0f4ef8071a215ad100d", "timestamp": "", "source": "github", "line_count": 54, "max_line_length": 146, "avg_line_length": 40.7037037037037, "alnum_prop": 0.7156505914467698, "repo_name": "SpongePowered/SpongeAPI", "id": "6a9e7e63552cff649af16a2e2b7248d53e79ebf0", "size": "3448", "binary": false, "copies": "1", "ref": "refs/heads/api-8", "path": "src/main/java/org/spongepowered/api/event/item/inventory/AffectItemStackEvent.java", "mode": "33188", "license": "mit", "language": [ { "name": "Java", "bytes": "5652450" }, { "name": "Kotlin", "bytes": "19235" }, { "name": "Shell", "bytes": "81" } ], "symlink_target": "" }
namespace gcm { namespace { const char kRegistrationRequestContentType[] = "application/x-www-form-urlencoded"; // Request constants. const char kAppIdKey[] = "app"; const char kDeviceIdKey[] = "device"; const char kLoginHeader[] = "AidLogin"; // Response constants. const char kErrorPrefix[] = "Error="; const char kTokenPrefix[] = "token="; const char kDeviceRegistrationError[] = "PHONE_REGISTRATION_ERROR"; const char kAuthenticationFailed[] = "AUTHENTICATION_FAILED"; const char kInvalidSender[] = "INVALID_SENDER"; const char kInvalidParameters[] = "INVALID_PARAMETERS"; // Gets correct status from the error message. RegistrationRequest::Status GetStatusFromError(const std::string& error) { // TODO(fgorski): Improve error parsing in case there is nore then just an // Error=ERROR_STRING in response. if (error.find(kDeviceRegistrationError) != std::string::npos) return RegistrationRequest::DEVICE_REGISTRATION_ERROR; if (error.find(kAuthenticationFailed) != std::string::npos) return RegistrationRequest::AUTHENTICATION_FAILED; if (error.find(kInvalidSender) != std::string::npos) return RegistrationRequest::INVALID_SENDER; if (error.find(kInvalidParameters) != std::string::npos) return RegistrationRequest::INVALID_PARAMETERS; return RegistrationRequest::UNKNOWN_ERROR; } // Indicates whether a retry attempt should be made based on the status of the // last request. bool ShouldRetryWithStatus(RegistrationRequest::Status status) { return status == RegistrationRequest::UNKNOWN_ERROR || status == RegistrationRequest::AUTHENTICATION_FAILED || status == RegistrationRequest::DEVICE_REGISTRATION_ERROR || status == RegistrationRequest::HTTP_NOT_OK || status == RegistrationRequest::URL_FETCHING_FAILED || status == RegistrationRequest::RESPONSE_PARSING_FAILED; } } // namespace RegistrationRequest::RequestInfo::RequestInfo( uint64 android_id, uint64 security_token, const std::string& app_id) : android_id(android_id), security_token(security_token), app_id(app_id) { DCHECK(android_id != 0UL); DCHECK(security_token != 0UL); } RegistrationRequest::RequestInfo::~RequestInfo() {} RegistrationRequest::CustomRequestHandler::CustomRequestHandler() {} RegistrationRequest::CustomRequestHandler::~CustomRequestHandler() {} RegistrationRequest::RegistrationRequest( const GURL& registration_url, const RequestInfo& request_info, scoped_ptr<CustomRequestHandler> custom_request_handler, const net::BackoffEntry::Policy& backoff_policy, const RegistrationCallback& callback, int max_retry_count, scoped_refptr<net::URLRequestContextGetter> request_context_getter, GCMStatsRecorder* recorder, const std::string& source_to_record) : callback_(callback), request_info_(request_info), custom_request_handler_(custom_request_handler.Pass()), registration_url_(registration_url), backoff_entry_(&backoff_policy), request_context_getter_(request_context_getter), retries_left_(max_retry_count), recorder_(recorder), source_to_record_(source_to_record), weak_ptr_factory_(this) { DCHECK_GE(max_retry_count, 0); } RegistrationRequest::~RegistrationRequest() {} void RegistrationRequest::Start() { DCHECK(!callback_.is_null()); DCHECK(!url_fetcher_.get()); url_fetcher_ = net::URLFetcher::Create(registration_url_, net::URLFetcher::POST, this); url_fetcher_->SetRequestContext(request_context_getter_.get()); url_fetcher_->SetLoadFlags(net::LOAD_DO_NOT_SEND_COOKIES | net::LOAD_DO_NOT_SAVE_COOKIES); std::string extra_headers; BuildRequestHeaders(&extra_headers); url_fetcher_->SetExtraRequestHeaders(extra_headers); std::string body; BuildRequestBody(&body); DVLOG(1) << "Performing registration for: " << request_info_.app_id; DVLOG(1) << "Registration request: " << body; url_fetcher_->SetUploadData(kRegistrationRequestContentType, body); recorder_->RecordRegistrationSent(request_info_.app_id, source_to_record_); request_start_time_ = base::TimeTicks::Now(); url_fetcher_->Start(); } void RegistrationRequest::BuildRequestHeaders(std::string* extra_headers) { net::HttpRequestHeaders headers; headers.SetHeader( net::HttpRequestHeaders::kAuthorization, std::string(kLoginHeader) + " " + base::Uint64ToString(request_info_.android_id) + ":" + base::Uint64ToString(request_info_.security_token)); *extra_headers = headers.ToString(); } void RegistrationRequest::BuildRequestBody(std::string* body) { BuildFormEncoding(kAppIdKey, request_info_.app_id, body); BuildFormEncoding(kDeviceIdKey, base::Uint64ToString(request_info_.android_id), body); DCHECK(custom_request_handler_.get()); custom_request_handler_->BuildRequestBody(body); } void RegistrationRequest::RetryWithBackoff(bool update_backoff) { if (update_backoff) { DCHECK_GT(retries_left_, 0); --retries_left_; url_fetcher_.reset(); backoff_entry_.InformOfRequest(false); } if (backoff_entry_.ShouldRejectRequest()) { DVLOG(1) << "Delaying GCM registration of app: " << request_info_.app_id << ", for " << backoff_entry_.GetTimeUntilRelease().InMilliseconds() << " milliseconds."; recorder_->RecordRegistrationRetryDelayed( request_info_.app_id, source_to_record_, backoff_entry_.GetTimeUntilRelease().InMilliseconds(), retries_left_ + 1); base::MessageLoop::current()->PostDelayedTask( FROM_HERE, base::Bind(&RegistrationRequest::RetryWithBackoff, weak_ptr_factory_.GetWeakPtr(), false), backoff_entry_.GetTimeUntilRelease()); return; } Start(); } RegistrationRequest::Status RegistrationRequest::ParseResponse( const net::URLFetcher* source, std::string* token) { if (!source->GetStatus().is_success()) { LOG(ERROR) << "URL fetching failed."; return URL_FETCHING_FAILED; } std::string response; if (!source->GetResponseAsString(&response)) { LOG(ERROR) << "Failed to parse registration response as a string."; return RESPONSE_PARSING_FAILED; } if (source->GetResponseCode() == net::HTTP_OK) { size_t token_pos = response.find(kTokenPrefix); if (token_pos != std::string::npos) { *token = response.substr(token_pos + arraysize(kTokenPrefix) - 1); return SUCCESS; } } // If we are able to parse a meaningful known error, let's do so. Some errors // will have HTTP_BAD_REQUEST, some will have HTTP_OK response code. size_t error_pos = response.find(kErrorPrefix); if (error_pos != std::string::npos) { std::string error = response.substr( error_pos + arraysize(kErrorPrefix) - 1); return GetStatusFromError(error); } // If we cannot tell what the error is, but at least we know response code was // not OK. if (source->GetResponseCode() != net::HTTP_OK) { DLOG(ERROR) << "URL fetching HTTP response code is not OK. It is " << source->GetResponseCode(); return HTTP_NOT_OK; } return UNKNOWN_ERROR; } void RegistrationRequest::OnURLFetchComplete(const net::URLFetcher* source) { std::string token; Status status = ParseResponse(source, &token); recorder_->RecordRegistrationResponse( request_info_.app_id, source_to_record_, status); DCHECK(custom_request_handler_.get()); custom_request_handler_->ReportUMAs( status, backoff_entry_.failure_count(), base::TimeTicks::Now() - request_start_time_); if (ShouldRetryWithStatus(status)) { if (retries_left_ > 0) { RetryWithBackoff(true); return; } status = REACHED_MAX_RETRIES; recorder_->RecordRegistrationResponse( request_info_.app_id, source_to_record_, status); // Only REACHED_MAX_RETRIES is reported because the function will skip // reporting count and time when status is not SUCCESS. DCHECK(custom_request_handler_.get()); custom_request_handler_->ReportUMAs(status, 0, base::TimeDelta()); } callback_.Run(status, token); } } // namespace gcm
{ "content_hash": "b3eef36d0803cf069c8fc91f521f355c", "timestamp": "", "source": "github", "line_count": 242, "max_line_length": 80, "avg_line_length": 34.16115702479339, "alnum_prop": 0.6886415870327809, "repo_name": "chuan9/chromium-crosswalk", "id": "a593e2bf833243d1ef3297faef094469ae9dee0e", "size": "9056", "binary": false, "copies": "5", "ref": "refs/heads/master", "path": "google_apis/gcm/engine/registration_request.cc", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "AppleScript", "bytes": "6973" }, { "name": "Arduino", "bytes": "464" }, { "name": "Assembly", "bytes": "37073" }, { "name": "Batchfile", "bytes": "8451" }, { "name": "C", "bytes": "9417055" }, { "name": "C++", "bytes": "240920124" }, { "name": "CSS", "bytes": "938860" }, { "name": "DM", "bytes": "60" }, { "name": "Groff", "bytes": "2494" }, { "name": "HTML", "bytes": "27258381" }, { "name": "Java", "bytes": "14580273" }, { "name": "JavaScript", "bytes": "20507007" }, { "name": "Makefile", "bytes": "70992" }, { "name": "Objective-C", "bytes": "1742904" }, { "name": "Objective-C++", "bytes": "9967587" }, { "name": "PHP", "bytes": "97817" }, { "name": "PLpgSQL", "bytes": "178732" }, { "name": "Perl", "bytes": "63937" }, { "name": "Protocol Buffer", "bytes": "480579" }, { "name": "Python", "bytes": "8519074" }, { "name": "Shell", "bytes": "482077" }, { "name": "Standard ML", "bytes": "5034" }, { "name": "XSLT", "bytes": "418" }, { "name": "nesC", "bytes": "18347" } ], "symlink_target": "" }
from django.conf.urls import url from django.contrib import admin from main.views import Main, Item_Edit, Collection_New, Helper_Lists, \ Collection_View, Collection_Edit, Item_Delete, Collection_Delete urlpatterns = [ url(r'^admin/', admin.site.urls), url(r'^$', Main.as_view(), name="home"), # Collection selection url(r'^new/$', Collection_New.as_view(), name="collection_new"), url(r'^(?P<collection>\d+)/edit/$', Collection_Edit.as_view(), name="collection_edit"), url(r'^(?P<collection>\d+)/delete/$', Collection_Delete.as_view(), name="collection_delete"), url(r'^(?P<collection>\d+)/$', Collection_View.as_view(), name="collection_view"), # Collection selected url(r'^(?P<collection>\d+)/(?P<item>\d+)$', Collection_View.as_view(), name="item_view"), # Single item selected url(r'^(?P<collection>\d+)/new_item$', Item_Edit.as_view(), name="item_new"), url(r'^(?P<collection>\d+)/edit_item/(?P<item>\d+)$', Item_Edit.as_view(), name="item_edit"), url(r'^(?P<collection>\d+)/(?P<item>\d+)/delete$', Item_Delete.as_view(), name="item_delete"), url(r'^support_lists/$', Helper_Lists.as_view(), name="list_view"), url(r'^support_lists/edit/(?P<supp_list_id>\d+)$', Helper_Lists.as_view(), name="list_edit"), ]
{ "content_hash": "eb2b6068c3b6eb57bb7f619b9df4266a", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 117, "avg_line_length": 63.5, "alnum_prop": 0.6417322834645669, "repo_name": "EricFelixLuther/Szkiz", "id": "e898d22da017110eed79b016ffc133048bdaffc4", "size": "1270", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Szkiz/urls.py", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "1239" }, { "name": "HTML", "bytes": "6809" }, { "name": "JavaScript", "bytes": "6474" }, { "name": "Python", "bytes": "79995" } ], "symlink_target": "" }
The **Cyclops Dashboard** is one of the support services as part of CYCLOPS - A Rating, Charging & Billing solution for cloud being developed by <a href="http://blog.zhaw.ch/icclab/">InIT Cloud Computing Lab</a> at <a href="http://www.zhaw.ch">ZHAW</a> It is the place for users to check their usage data, connect to cloud providers and manage bills. Admins can use it to configure the different microservices and maintain user accounts. The dashboard interacts with the different micro service of <a href="http://icclab.github.io/cyclops">CYCLOPS</a>. The data for resource consumption visualization is gathered by the interaction with <a href="https://github.com/icclab/cyclops-udr">Usage Data Records Micro Service</a>. The coonfiguration of rate policy and generated charge for a user is accessed by the dashboard through that APIs of <a href="https://github.com/icclab/cyclops-rc">Rate & Charge Micro Service</a>. ![](https://github.com/icclab/cyclops-support/blob/master/dashboard/doc/images/dashboard_menu.png) ### Architecture #### * CYCLOPS Rating Charging & Billing Framework <img align="middle" src="http://blog.zhaw.ch/icclab/files/2013/05/overall_architecture.png" alt="CYCLOPS Architecture" height="500" width="600"></img> ### Installation 1. Check out this repository 1. Switch to the installation directory: `cd path/to/repository/dashboard/installation` 1. Make sure the hosts-file contains a route to localhost, otherwise OpenAM setup will fail 1. execute `cat /etc/hosts | grep $HOSTNAME` 1. it should output a line similar to `127.0.0.1 localhost myhostname` 1. If it doesn't, run this as root: `echo "127.0.0.1 myhostname" >> /etc/hosts` 1. Make the installation script executable: `sudo chmod +x install.sh` 1. Run the installation script as root: `sudo ./install.sh` 1. Follow the script instructions 1. Wait for the setup to complete 1. Follow the [configuration guide](https://github.com/icclab/cyclops-support/wiki/OpenAM-Configuration) to finish setting up OpenAM For more in-depth documentation, see: * [Installing OpenAM](https://github.com/icclab/cyclops-support/wiki/Dashboard-Installation) * [Configuring OpenAM](https://github.com/icclab/cyclops-support/wiki/OpenAM-Configuration) * [Communication Flow](https://github.com/icclab/cyclops-support/wiki/Communication-Flow) * [Javadoc](https://icclab.github.io/cyclops/javadoc/dashboard/) * [Development Environment](https://github.com/icclab/cyclops-support/wiki/Setting-Up-Development-Environment) * [Directory Structure](https://github.com/icclab/cyclops-support/wiki/Directory-Structure) ### Features Currently, the following features are implemented: * [User] Authentication / Authorisation via OpenAM * [User] Linking an account to OpenStack * [User] Dynamically created charts for usage data * [User] Dynamically created charts for rate data * [User] Dynamically created charts for charge data * [User] Alert Messages * [User] Charts for external meters * [User] View billing information and bill PDFs * [Admin] Listing users and admins * [Admin] Displaying list of all available meters * [Admin] Configuring UDR Microservice to use different set of meters * [Admin] User Management * [Admin] Configure Rate Microservice * [Admin] Create bills for users * [Admin] Add external meters ### Components & Libraries * <a href="https://angularjs.org">AngularJS</a> * <a href="https://github.com/angular-ui/ui-router">AngularJS ui-router</a> * <a href="https://github.com/Salakar/angular-toasty">angular-toasty</a> * <a href="https://github.com/chieffancypants/angular-loading-bar">angular-loading-bar</a> * <a href="https://angular-ui.github.io/bootstrap/">angular-ui bootstrap</a> * <a href="https://github.com/datejs/Datejs">DateJS</a> * <a href="http://d3js.org/">D3</a> * <a href="http://nvd3.org/">NVD3</a> * <a href="https://krispo.github.io/angular-nvd3/">angular-NVD3</a> * <a href="https://jasmine.github.io">Jasmine</a> * <a href="http://getbootstrap.com">Bootstrap</a> * <a href="http://startbootstrap.com/template-overviews/sb-admin-2">SB Admin 2 (Bootstrap Theme)</a> * <a href="https://tomcat.apache.org">Tomcat7</a> * <a href="https://restlet.com">RESTLET</a> ### Communication * Issues/Ideas/Suggestions : <a href="https://github.com/icclab/cyclops-support/issues">GitHub Issue</a> * Website : http://blog.zhaw.ch/icclab/ * Tweet us @<a href="https://twitter.com/ICC_Lab">ICC_Lab</a> ### Developed @ <img src="http://blog.zhaw.ch/icclab/files/2014/04/icclab_logo.png" alt="ICC Lab" height="180" width="620"></img> ### License 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.
{ "content_hash": "bccc002e82497082a73200a1ccb05286", "timestamp": "", "source": "github", "line_count": 88, "max_line_length": 483, "avg_line_length": 59.05681818181818, "alnum_prop": 0.7340773523186453, "repo_name": "icclab/cyclops-support", "id": "8a9dbc691763e148cdffa09d5f3f1c63f601bd26", "size": "5216", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "README.md", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "23029" }, { "name": "HTML", "bytes": "34429" }, { "name": "Java", "bytes": "103882" }, { "name": "JavaScript", "bytes": "323288" }, { "name": "Shell", "bytes": "6585" } ], "symlink_target": "" }
importScripts('https://www.gstatic.com/firebasejs/4.8.1/firebase-app.js') importScripts('https://www.gstatic.com/firebasejs/4.8.1/firebase-messaging.js') var config = { apiKey: "AIzaSyBz962CNxMspJzS2HsS8Br2AMGBQnBzdvs", authDomain: "netrango-delivery.firebaseapp.com", databaseURL: "https://netrango-delivery.firebaseio.com", projectId: "netrango-delivery", storageBucket: "netrango-delivery.appspot.com", messagingSenderId: "36823940597" } firebase.initializeApp(config) const messaging = firebase.messaging() messaging.setBackgroundMessageHandler(function(payload){})
{ "content_hash": "083646af3579dee6b91c1e1a32e88511", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 79, "avg_line_length": 39.733333333333334, "alnum_prop": 0.7718120805369127, "repo_name": "stanleygomes/stanleygomes.github.io", "id": "41566ff68a8caa187bc42aa87d841bb9a4425c37", "size": "596", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "projects/netrango-laravel-netrango/resources/assets/js/firebase-messaging-sw.js", "mode": "33188", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "188" }, { "name": "CSS", "bytes": "335166" }, { "name": "HTML", "bytes": "1189738" }, { "name": "Hack", "bytes": "134777" }, { "name": "Java", "bytes": "15174" }, { "name": "JavaScript", "bytes": "377670" }, { "name": "PHP", "bytes": "2257920" }, { "name": "TypeScript", "bytes": "45698" } ], "symlink_target": "" }
import * as _ from 'lodash'; import {BaseStore} from './baseStore'; import {getRouter} from './router'; interface Environment { dataLocation: string; windowTitle: string; /** Name of the experiment (if available). */ experimentName?: string; /** A description of the experiment (if available). */ experimentDescription?: string; /** Creation timestamp for the experiment (if available). */ creationTime?: number; } export class EnvironmentStore extends BaseStore { private environment: Environment; load() { const url = getRouter().environment(); return this.requestManager.request(url).then((result) => { const environment: Environment = { dataLocation: result.data_location, windowTitle: result.window_title, }; if (result.experiment_name !== undefined) { environment.experimentName = result.experiment_name; } if (result.experiment_description !== undefined) { environment.experimentDescription = result.experiment_description; } if (result.creation_time !== undefined) { environment.creationTime = result.creation_time; } if (_.isEqual(this.environment, environment)) return; this.environment = environment; this.emitChange(); }); } public getDataLocation(): string { return this.environment ? this.environment.dataLocation! : ''; } public getWindowTitle(): string { return this.environment ? this.environment.windowTitle! : ''; } public getExperimentName(): string { return this.environment ? this.environment.experimentName! : ''; } public getExperimentDescription(): string { return this.environment ? this.environment.experimentDescription! : ''; } public getCreationTime(): number | null { return this.environment ? this.environment.creationTime! : null; } } export const environmentStore = new EnvironmentStore();
{ "content_hash": "7934eab47458784155a55450316b0122", "timestamp": "", "source": "github", "line_count": 57, "max_line_length": 75, "avg_line_length": 33.473684210526315, "alnum_prop": 0.6860587002096437, "repo_name": "tensorflow/tensorboard", "id": "7c42dd7724f31bee3e82d8a730b2e9b711bdad11", "size": "2576", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "tensorboard/components/tf_backend/environmentStore.ts", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "16222" }, { "name": "Dockerfile", "bytes": "1226" }, { "name": "HTML", "bytes": "154824" }, { "name": "Java", "bytes": "20643" }, { "name": "JavaScript", "bytes": "11869" }, { "name": "Jupyter Notebook", "bytes": "7697" }, { "name": "Python", "bytes": "2922179" }, { "name": "Rust", "bytes": "311041" }, { "name": "SCSS", "bytes": "136834" }, { "name": "Shell", "bytes": "36731" }, { "name": "Starlark", "bytes": "541743" }, { "name": "TypeScript", "bytes": "5930550" } ], "symlink_target": "" }
package resttk import ( "crypto/hmac" "crypto/rand" "crypto/sha256" "encoding/base64" "fmt" "time" ) var ( Secret string ) func secret() string { if len(Secret) <= 1 { id := make([]byte, 32) if _, err := rand.Read(id); err != nil { Secret = "" } Secret = fmt.Sprintf("%x", id) } return Secret } func GenerateAuthToken(message string) string { mac := hmac.New(sha256.New, []byte(secret())) mac.Write([]byte(message + time.Now().String())) return base64.StdEncoding.EncodeToString(mac.Sum(nil)) }
{ "content_hash": "f8634dcfe717212e159367216741558e", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 55, "avg_line_length": 16.870967741935484, "alnum_prop": 0.6347992351816444, "repo_name": "dsledge/resttk", "id": "cb15d5cd8ea4a37f78c5912a724034606455521e", "size": "523", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "authentication.go", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Go", "bytes": "17498" } ], "symlink_target": "" }
<?xml version="1.0" encoding="utf-8"?> <resources> <declare-styleable name="FreeCropImageView"> <attr name="cropMaskColor" format="color"/> <attr name="cropBorderColor" format="color"/> <attr name="cropBorderWidth" format="dimension"/> <attr name="cropFocusWidth" format="dimension"/> <attr name="cropFocusHeight" format="dimension"/> <attr name="cropStyle" format="enum"> <enum name="rectangle" value="0"/> <enum name="circle" value="1"/> </attr> </declare-styleable> </resources>
{ "content_hash": "c7a6a7ef2cd006c574e7abf92e130df0", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 57, "avg_line_length": 40.642857142857146, "alnum_prop": 0.6115992970123023, "repo_name": "giantss/cordova-plugin-ImagePicker", "id": "4da3b28985f850ac3918e25e887f8ce7f96462af", "size": "569", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/android/res/values/attrs.xml", "mode": "33188", "license": "mit", "language": [ { "name": "HTML", "bytes": "3469" }, { "name": "Java", "bytes": "183855" }, { "name": "JavaScript", "bytes": "3542" }, { "name": "Objective-C", "bytes": "354125" } ], "symlink_target": "" }
using System; using System.Threading.Tasks; using Windows.Security.Authentication.Web; using Windows.UI.Popups; using Windows.UI.Xaml; using Windows.UI.Xaml.Controls; using Facebook; namespace FacebookNormal { public sealed partial class MainPage : Page { private const string AppId = "406204362913207"; private const string ExtendedPermissions = "publish_actions, user_managed_groups, user_groups"; public MainPage() { this.InitializeComponent(); } private async void ButtonBase_OnClick(object sender, RoutedEventArgs e) { var result = await AuthenticateFacebookAsync(); var md = new MessageDialog("your token is: " + result); await md.ShowAsync(); } private async Task<string> AuthenticateFacebookAsync() { try { var fb = new FacebookClient(); var redirectUri = WebAuthenticationBroker.GetCurrentApplicationCallbackUri().ToString(); var loginUri = fb.GetLoginUrl(new { client_id = AppId, redirect_uri = redirectUri, scope = ExtendedPermissions, display = "popup", response_type = "token" }); var callbackUri = new Uri(redirectUri, UriKind.Absolute); var authenticationResult = await WebAuthenticationBroker.AuthenticateAsync(WebAuthenticationOptions.None, loginUri, callbackUri); return ParseAuthenticationResult(fb, authenticationResult); } catch (Exception ex) { return ex.Message; } } public string ParseAuthenticationResult(FacebookClient fb, WebAuthenticationResult result) { switch (result.ResponseStatus) { case WebAuthenticationStatus.ErrorHttp: return "Error"; case WebAuthenticationStatus.Success: var oAuthResult = fb.ParseOAuthCallbackUrl(new Uri(result.ResponseData)); return oAuthResult.AccessToken; case WebAuthenticationStatus.UserCancel: return "Operation aborted"; } return null; } } }
{ "content_hash": "82d5311f48da9ddd43fa9b372c73fd31", "timestamp": "", "source": "github", "line_count": 78, "max_line_length": 99, "avg_line_length": 29.53846153846154, "alnum_prop": 0.5954861111111112, "repo_name": "LocalJoost/CustomFacebookoAuthLogin", "id": "285610a7cf9b42a439803bf64feb69ff02e57ba6", "size": "2306", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "FacebookNormal/MainPage.xaml.cs", "mode": "33188", "license": "mit", "language": [ { "name": "C#", "bytes": "16514" } ], "symlink_target": "" }
namespace crashpad { //! \brief A universally unique identifier (%UUID). //! //! An alternate term for %UUID is “globally unique identifier” (GUID), used //! primarily by Microsoft. //! //! A %UUID is a unique 128-bit number specified by RFC 4122. //! //! This is a POD structure. struct UUID { bool operator==(const UUID& that) const; bool operator!=(const UUID& that) const { return !operator==(that); } //! \brief Initializes the %UUID to zero. void InitializeToZero(); //! \brief Initializes the %UUID from a sequence of bytes. //! //! \a bytes is taken as a %UUID laid out in big-endian format in memory. On //! little-endian machines, appropriate byte-swapping will be performed to //! initialize an object’s data members. //! //! \param[in] bytes A buffer of exactly 16 bytes that will be assigned to the //! %UUID. void InitializeFromBytes(const uint8_t* bytes); //! \brief Initializes the %UUID from a RFC 4122 §3 formatted string. //! //! \param[in] string A string of the form //! `"00112233-4455-6677-8899-aabbccddeeff"`. //! //! \return `true` if the string was formatted correctly and the object has //! been initialized with the data. `false` if the string could not be //! parsed, with the object state untouched. bool InitializeFromString(const base::StringPiece& string); //! \brief Initializes the %UUID using a standard system facility to generate //! the value. //! //! \return `true` if the %UUID was initialized correctly, `false` otherwise //! with a message logged. bool InitializeWithNew(); #if defined(OS_WIN) || DOXYGEN //! \brief Initializes the %UUID from a system `UUID` or `GUID` structure. //! //! \param[in] system_uuid A system `UUID` or `GUID` structure. void InitializeFromSystemUUID(const ::UUID* system_uuid); #endif // OS_WIN //! \brief Formats the %UUID per RFC 4122 §3. //! //! \return A string of the form `"00112233-4455-6677-8899-aabbccddeeff"`. std::string ToString() const; #if defined(OS_WIN) || DOXYGEN //! \brief The same as ToString, but returned as a string16. base::string16 ToString16() const; #endif // OS_WIN // These fields are laid out according to RFC 4122 §4.1.2. uint32_t data_1; uint16_t data_2; uint16_t data_3; uint8_t data_4[2]; uint8_t data_5[6]; }; } // namespace crashpad #endif // CRASHPAD_UTIL_MISC_UUID_H_
{ "content_hash": "245fe893d994a7744260278a189d4815", "timestamp": "", "source": "github", "line_count": 72, "max_line_length": 80, "avg_line_length": 33.388888888888886, "alnum_prop": 0.6709650582362728, "repo_name": "atom/crashpad", "id": "4e5884e25abac8d726dde2c2d8c260d9fe115115", "size": "3296", "binary": false, "copies": "4", "ref": "refs/heads/master", "path": "util/misc/uuid.h", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Assembly", "bytes": "22931" }, { "name": "C", "bytes": "24780" }, { "name": "C++", "bytes": "3030843" }, { "name": "Objective-C", "bytes": "2279" }, { "name": "Objective-C++", "bytes": "55461" }, { "name": "Python", "bytes": "79575" } ], "symlink_target": "" }
title: Data Driven Testing slug: data-driven-testing.html --- Moved [here](datatesting/data_driven_testing.md)
{ "content_hash": "1e54679eced52c7cd3a94fe0421149c0", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 48, "avg_line_length": 22.4, "alnum_prop": 0.7678571428571429, "repo_name": "sksamuel/ktest", "id": "074634375dfb4a784b414d1895c35aece979e590", "size": "116", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "documentation/docs/framework/data_driven_testing.md", "mode": "33188", "license": "mit", "language": [ { "name": "Kotlin", "bytes": "10232" } ], "symlink_target": "" }
/* TEMPLATE GENERATED TESTCASE FILE Filename: CWE134_Uncontrolled_Format_String__char_file_w32_vsnprintf_43.cpp Label Definition File: CWE134_Uncontrolled_Format_String.vasinks.label.xml Template File: sources-vasinks-43.tmpl.cpp */ /* * @description * CWE: 134 Uncontrolled Format String * BadSource: file Read input from a file * GoodSource: Copy a fixed string into data * Sinks: w32_vsnprintf * GoodSink: vsnprintf with a format string * BadSink : vsnprintf without a format string * Flow Variant: 43 Data flow: data flows using a C++ reference from one function to another in the same source file * * */ #include <stdarg.h> #include "std_testcase.h" #ifndef _WIN32 #include <wchar.h> #endif #ifdef _WIN32 #define FILENAME "C:\\temp\\file.txt" #else #define FILENAME "/tmp/file.txt" #endif namespace CWE134_Uncontrolled_Format_String__char_file_w32_vsnprintf_43 { #ifndef OMITBAD static void badVaSink(char * data, ...) { { char dest[100] = ""; va_list args; va_start(args, data); /* POTENTIAL FLAW: Do not specify the format allowing a possible format string vulnerability */ vsnprintf(dest, 100-1, data, args); va_end(args); printLine(dest); } } static void badSource(char * &data) { { /* Read input from a file */ size_t dataLen = strlen(data); FILE * pFile; /* if there is room in data, attempt to read the input from a file */ if (100-dataLen > 1) { pFile = fopen(FILENAME, "r"); if (pFile != NULL) { /* POTENTIAL FLAW: Read data from a file */ if (fgets(data+dataLen, (int)(100-dataLen), pFile) == NULL) { printLine("fgets() failed"); /* Restore NUL terminator if fgets fails */ data[dataLen] = '\0'; } fclose(pFile); } } } } void bad() { char * data; char dataBuffer[100] = ""; data = dataBuffer; badSource(data); badVaSink(data, data); } #endif /* OMITBAD */ #ifndef OMITGOOD /* goodG2B() uses the GoodSource with the BadSink */ static void goodG2BVaSink(char * data, ...) { { char dest[100] = ""; va_list args; va_start(args, data); /* POTENTIAL FLAW: Do not specify the format allowing a possible format string vulnerability */ vsnprintf(dest, 100-1, data, args); va_end(args); printLine(dest); } } static void goodG2BSource(char * &data) { /* FIX: Use a fixed string that does not contain a format specifier */ strcpy(data, "fixedstringtest"); } static void goodG2B() { char * data; char dataBuffer[100] = ""; data = dataBuffer; goodG2BSource(data); goodG2BVaSink(data, data); } /* goodB2G() uses the BadSource with the GoodSink */ static void goodB2GVaSink(char * data, ...) { { char dest[100] = ""; va_list args; va_start(args, data); /* FIX: Specify the format disallowing a format string vulnerability */ vsnprintf(dest, 100-1, "%s", args); va_end(args); printLine(dest); } } static void goodB2GSource(char * &data) { { /* Read input from a file */ size_t dataLen = strlen(data); FILE * pFile; /* if there is room in data, attempt to read the input from a file */ if (100-dataLen > 1) { pFile = fopen(FILENAME, "r"); if (pFile != NULL) { /* POTENTIAL FLAW: Read data from a file */ if (fgets(data+dataLen, (int)(100-dataLen), pFile) == NULL) { printLine("fgets() failed"); /* Restore NUL terminator if fgets fails */ data[dataLen] = '\0'; } fclose(pFile); } } } } static void goodB2G() { char * data; char dataBuffer[100] = ""; data = dataBuffer; goodB2GSource(data); goodB2GVaSink(data, data); } void good() { goodG2B(); goodB2G(); } #endif /* OMITGOOD */ } /* close namespace */ /* Below is the main(). It is only used when building this testcase on its own for testing or for building a binary to use in testing binary analysis tools. It is not used when compiling all the testcases as one application, which is how source code analysis tools are tested. */ #ifdef INCLUDEMAIN using namespace CWE134_Uncontrolled_Format_String__char_file_w32_vsnprintf_43; /* so that we can use good and bad easily */ int main(int argc, char * argv[]) { /* seed randomness */ srand( (unsigned)time(NULL) ); #ifndef OMITGOOD printLine("Calling good()..."); good(); printLine("Finished good()"); #endif /* OMITGOOD */ #ifndef OMITBAD printLine("Calling bad()..."); bad(); printLine("Finished bad()"); #endif /* OMITBAD */ return 0; } #endif
{ "content_hash": "ff1087cd0ebc510285461605b27e6093", "timestamp": "", "source": "github", "line_count": 200, "max_line_length": 123, "avg_line_length": 26.005, "alnum_prop": 0.5598923283983849, "repo_name": "JianpingZeng/xcc", "id": "28256978d4bca53ffbbe9ce015a34f44882354ca", "size": "5201", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "xcc/test/juliet/testcases/CWE134_Uncontrolled_Format_String/s03/CWE134_Uncontrolled_Format_String__char_file_w32_vsnprintf_43.cpp", "mode": "33188", "license": "bsd-3-clause", "language": [], "symlink_target": "" }
namespace blink { class ScreenOrientation; class Screen; class ScreenScreenOrientation final : public GarbageCollected<ScreenScreenOrientation>, public Supplement<Screen> { public: static const char kSupplementName[]; static ScreenScreenOrientation& From(Screen&); static ScreenOrientation* orientation(Screen&); ScreenScreenOrientation(); void Trace(Visitor*) const override; private: Member<ScreenOrientation> orientation_; }; } // namespace blink #endif // THIRD_PARTY_BLINK_RENDERER_MODULES_SCREEN_ORIENTATION_SCREEN_SCREEN_ORIENTATION_H_
{ "content_hash": "21b1ebd9e04468b3cd63a0142b1f154c", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 93, "avg_line_length": 22.23076923076923, "alnum_prop": 0.7698961937716263, "repo_name": "ric2b/Vivaldi-browser", "id": "aff83cae507a94dce63ff595da052b457da4195d", "size": "1111", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "chromium/third_party/blink/renderer/modules/screen_orientation/screen_screen_orientation.h", "mode": "33188", "license": "bsd-3-clause", "language": [], "symlink_target": "" }
<!DOCTYPE html> <html lang="zh-CN"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <!-- 上述3个meta标签*必须*放在最前面,任何其他内容都*必须*跟随其后! --> <meta name="description" content=""> <meta name="author" content=""> <link rel="icon" href="../../favicon.ico"> <title>医卫里课堂登录</title> <!-- Bootstrap core CSS --> <link href="css/bootstrap.min.css" rel="stylesheet"> <!-- Custom styles for this template --> <link href="css/login.css" rel="stylesheet"> <!-- Just for debugging purposes. Don't actually copy these 2 lines! --> <!--[if lt IE 9]><script src="../../assets/js/ie8-responsive-file-warning.js"></script><![endif]--> <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries --> <!--[if lt IE 9]> <script src="//cdn.bootcss.com/html5shiv/3.7.2/html5shiv.min.js"></script> <script src="//cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script> <![endif]--> <script type="text/javascript" src="js/jquery.min.js"></script> </head> <body> <div class="container"> <div class="form-signin"> <h3 class="form-signin-heading" style="text-align: center;">登录</h3> <input type="email" id="inputEmail" class="form-control" placeholder="用户名/手机号码" required autofocus> <input type="password" id="inputPassword" class="form-control" placeholder="密码" required> <div class="checkbox"> <label> <input type="checkbox" value="remember-me">记住密码 </label> </div> <button class="btn btn-lg btn-info btn-block" type="submit" id="login">登录</button> </div> </div> <!-- /container --> <script> $('#login').click(function() { location.href = "index.html" }) </script> </body> </html>
{ "content_hash": "77673b606da8b0798a80659dea2c87c3", "timestamp": "", "source": "github", "line_count": 59, "max_line_length": 103, "avg_line_length": 30.610169491525422, "alnum_prop": 0.6317829457364341, "repo_name": "IMedLib/coludeedu", "id": "a5029c400b1fed55be678237cd9d8bbed79f2b4c", "size": "1908", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "login.html", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "43351" }, { "name": "HTML", "bytes": "236167" }, { "name": "JavaScript", "bytes": "22244" } ], "symlink_target": "" }
===== Agora ===== Agora is a forum for ideas. It is a simple, blog-like application, with support for multiple authors. It is developed for a class curriculum, and is not intended for real deployment, although it could serve some purpose. There are two classes--Author and Idea. A forum can have zero or more authors. Each author can have zero or more ideas. Agora uses SQLAlchemy for a persistence layer. You need a valid SQLAlchemy session to initialize agora. ----- Usage ----- Set up SQLAlchemy session ------------------------- :: >>> from agora.models import Base >>> from sqlalchemy import create_engine >>> from sqlalchemy.orm import scoped_session, sessionmaker >>> engine = create_engine('sqlite:///:memory:') >>> Base.metadata.create_all(engine) >>> DBSession = scoped_session(sessionmaker()) >>> DBSession.configure(bind=engine) Forum Basics ------------ :: >>> from agora import Forum >>> forum = Forum(DBSession) A new forum has no authors or ideas. :: >>> forum.get_authors() [] >>> forum.get_ideas() [] To add an idea, you first need an author. To add a new author, pass a username, fullname, and email to the `add_author` method. :: >>> forum.add_author(username='schmoe', fullname='Joe Schmoe', email='schmoe@example.com') 1 >>> forum.add_author(username='misinformation', fullname='Miss Information', email='misinformation@example.com') 2 Notice that the method returns the author's id. We now have authors. :: >>> forum.get_authors() [Joe Schmoe, March 02, 2016, Miss Information, March 02, 2016] You can access authors by id. :: >>> forum.get_author(1) Joe Schmoe, March 02, 2016 To add a new idea, pass a title, idea, and author_id to the `add_idea` method. :: >>> forum.add_idea(title='First Idea!', idea='This is my idea.', author_id=1) 1 >>> forum.add_idea(title='My First Idea!', idea='This is my idea.', author_id=2) 2 >>> forum.add_idea(title='Another Idea!', idea='This is my idea.', author_id=1) 3 >>> forum.add_idea(title='Another Idea!', idea='This is my idea.', author_id=2) 4 We now have ideas. :: >>> forum.get_ideas() [First Idea!, Joe Schmoe, March 02, 2016, My First Idea!, Miss Information, March 02, 2016, Another Idea!, Joe Schmoe, March 02, 2016, Another Idea!, Miss Information, March 02, 2016] You can access ideas by id. :: >>> forum.get_idea(1) First Idea!, Joe Schmoe, March 02, 2016 You can also access ideas with filters. :: >>> forum.get_ideas(filters={'author': forum.get_author(1)}) [First Idea!, Joe Schmoe, March 02, 2016, Another Idea!, Joe Schmoe, March 02, 2016] >>> forum.get_ideas(filters={'title': 'First Idea!'}) [First Idea!, Joe Schmoe, March 02, 2016] >>> forum.get_ideas(filters={'title': 'Another Idea!'}) [Another Idea!, Joe Schmoe, March 02, 2016, Another Idea!, Miss Information, March 02, 2016] >>> forum.get_ideas(filters={'author': forum.get_author(2), 'title': 'Another Idea!'}) [Another Idea!, Miss Information, March 02, 2016] You can delete ideas by id. :: >>> forum.delete_idea(1) 1 >>> forum.get_ideas() [My First Idea!, Miss Information, March 02, 2016, Another Idea!, Joe Schmoe, March 02, 2016, Another Idea!, Miss Information, March 02, 2016] ------------------- Initialize Database ------------------- There is a script provided to initialize the database. It is installed into the bin directory of your virtualenv. You must pass it a valid SQLAlchemy database URI. :: $ initialize_agora_db <database_uri> $ initialize_agora_db sqlite:///agora.sqlite You can also use the script to seed the database with a sample author and two ideas, if you append the word `seed` to the command. :: $ initialize_agora_db sqlite:///agora.sqlite seed
{ "content_hash": "0b3896a842b9a927a15b937e46100684", "timestamp": "", "source": "github", "line_count": 151, "max_line_length": 187, "avg_line_length": 25.629139072847682, "alnum_prop": 0.6555555555555556, "repo_name": "cullerton/cullerton.agora", "id": "bdf8bfefaf342b47d9a42ae34db04357fd855352", "size": "3870", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "README.rst", "mode": "33188", "license": "mit", "language": [ { "name": "Jupyter Notebook", "bytes": "8434" }, { "name": "Python", "bytes": "24118" } ], "symlink_target": "" }
from airflow import DAG from airflow.operators.bash_operator import BashOperator from datetime import datetime, timedelta default_args = { 'owner': 'airflow', 'depends_on_past': False, 'start_date': datetime.now(), 'email': ['chris@fregly.com'], 'email_on_failure': False, 'email_on_retry': False, 'retries': 0, 'retry_delay': timedelta(minutes=5), # 'queue': 'bash_queue', # 'pool': 'backfill', # 'priority_weight': 10, # 'end_date': datetime(2016, 4, 24), } dag = DAG('undeploy_prediction_tensorflow', default_args=default_args) # TODO: dockerFileTag and dockerFilePath should be passed in from webhook switch_to_aws = BashOperator( task_id='switch_to_aws', bash_command='sudo kubectl config use-context awsdemo', dag=dag) undeploy_container_aws = BashOperator( task_id='undeploy_container_to_aws', bash_command='sudo kubectl delete prediction-tensorflow', dag=dag) switch_to_gcp = BashOperator( task_id='switch_to_gcp', bash_command='sudo kubectl config use-context gcpdemo', dag=dag) undeploy_container_gcp = BashOperator( task_id='undeploy_container_gcp', bash_command='sudo kubectl delete prediction-tensorflow', dag=dag) # Setup Airflow DAG undeploy_container_aws.set_upstream(switch_to_aws) switch_to_gcp.set_upstream(undeploy_container_aws) undeploy_container_gcp.set_upstream(switch_to_gcp)
{ "content_hash": "a92994efcde154e40efdbf513c1fabcc", "timestamp": "", "source": "github", "line_count": 46, "max_line_length": 74, "avg_line_length": 30.565217391304348, "alnum_prop": 0.701280227596017, "repo_name": "shareactorIO/pipeline", "id": "3eaf9f2573ceb4faed94888ce0120ed15026708e", "size": "1406", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "source.ml/scheduler.ml/airflow/dags/undeploy_prediction_tensorflow.py", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "ApacheConf", "bytes": "36325" }, { "name": "Batchfile", "bytes": "63654" }, { "name": "C", "bytes": "1759" }, { "name": "C++", "bytes": "50538" }, { "name": "CSS", "bytes": "548116" }, { "name": "Cuda", "bytes": "12823" }, { "name": "Go", "bytes": "9555" }, { "name": "Groovy", "bytes": "24769" }, { "name": "HTML", "bytes": "146027580" }, { "name": "Java", "bytes": "109991" }, { "name": "JavaScript", "bytes": "644060" }, { "name": "Jupyter Notebook", "bytes": "17753504" }, { "name": "Makefile", "bytes": "357" }, { "name": "PLSQL", "bytes": "2470" }, { "name": "PLpgSQL", "bytes": "3657" }, { "name": "Protocol Buffer", "bytes": "692822" }, { "name": "Python", "bytes": "844350" }, { "name": "Scala", "bytes": "228848" }, { "name": "Shell", "bytes": "176444" }, { "name": "XSLT", "bytes": "80778" } ], "symlink_target": "" }
/*global $*/ // yolo const initAutocompleter = $input => { const followOnSelect = $input.data('follow-on-select'); $input.attr('autocomplete', 'off'); $input.typeahead({ autoSelect: false, changeInputOnMove: false, delay: 100, items: 20, selectOnBlur: false, source: (query, process) => $.ajax({ dataType: 'json', url: $input.data('url') + '?query=' + query, }).done(response => process(response)), matcher: () => true, highlighter: function (item) { const regex = new RegExp('(' + this.query + ')', 'gi'); return item.replace(regex, "<strong>$1</strong>"); }, getText: item => item.name, select: function () { const $activeMenuItem = this.$menu.find('.active'); if (!$activeMenuItem.length) { $input.val(this.value).parents('form').submit(); return true; } const item = $activeMenuItem.data('value'); $input.val(item.name); // $input.typeahead('close'); nie działa, stąd poniższy hak $input.trigger('blur').focus(); if (followOnSelect) { window.location = item.url; } }, }); } $(() => { const $inputs = $('[data-role="autocompleter"]'); $inputs.each((i, input) => initAutocompleter($(input))); });
{ "content_hash": "44c31db75063c02c56151f293eeecde5", "timestamp": "", "source": "github", "line_count": 54, "max_line_length": 71, "avg_line_length": 26.74074074074074, "alnum_prop": 0.502770083102493, "repo_name": "iammordaty/assistant-web", "id": "36c6572f700cb2e05191431926821681353484cf", "size": "1447", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "public/js/autocompleter.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "3886" }, { "name": "Dockerfile", "bytes": "2622" }, { "name": "JavaScript", "bytes": "12465" }, { "name": "PHP", "bytes": "303507" }, { "name": "Shell", "bytes": "505" }, { "name": "Twig", "bytes": "53950" } ], "symlink_target": "" }
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (1.8.0_151) on Wed Jan 16 11:48:25 MST 2019 --> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Uses of Interface org.wildfly.swarm.config.infinispan.cache_container.BinaryMemorySupplier (BOM: * : All 2.3.0.Final API)</title> <meta name="date" content="2019-01-16"> <link rel="stylesheet" type="text/css" href="../../../../../../../stylesheet.css" title="Style"> <script type="text/javascript" src="../../../../../../../script.js"></script> </head> <body> <script type="text/javascript"><!-- try { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="Uses of Interface org.wildfly.swarm.config.infinispan.cache_container.BinaryMemorySupplier (BOM: * : All 2.3.0.Final API)"; } } catch(err) { } //--> </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar.top"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.top.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../../../overview-summary.html">Overview</a></li> <li><a href="../package-summary.html">Package</a></li> <li><a href="../../../../../../../org/wildfly/swarm/config/infinispan/cache_container/BinaryMemorySupplier.html" title="interface in org.wildfly.swarm.config.infinispan.cache_container">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../../../../../../../overview-tree.html">Tree</a></li> <li><a href="../../../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../../../index-all.html">Index</a></li> <li><a href="../../../../../../../help-doc.html">Help</a></li> </ul> <div class="aboutLanguage">Thorntail API, 2.3.0.Final</div> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../../../../index.html?org/wildfly/swarm/config/infinispan/cache_container/class-use/BinaryMemorySupplier.html" target="_top">Frames</a></li> <li><a href="BinaryMemorySupplier.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip.navbar.top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <div class="header"> <h2 title="Uses of Interface org.wildfly.swarm.config.infinispan.cache_container.BinaryMemorySupplier" class="title">Uses of Interface<br>org.wildfly.swarm.config.infinispan.cache_container.BinaryMemorySupplier</h2> </div> <div class="classUseContainer"> <ul class="blockList"> <li class="blockList"> <table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing packages, and an explanation"> <caption><span>Packages that use <a href="../../../../../../../org/wildfly/swarm/config/infinispan/cache_container/BinaryMemorySupplier.html" title="interface in org.wildfly.swarm.config.infinispan.cache_container">BinaryMemorySupplier</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Package</th> <th class="colLast" scope="col">Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><a href="#org.wildfly.swarm.config.infinispan.cache_container">org.wildfly.swarm.config.infinispan.cache_container</a></td> <td class="colLast">&nbsp;</td> </tr> </tbody> </table> </li> <li class="blockList"> <ul class="blockList"> <li class="blockList"><a name="org.wildfly.swarm.config.infinispan.cache_container"> <!-- --> </a> <h3>Uses of <a href="../../../../../../../org/wildfly/swarm/config/infinispan/cache_container/BinaryMemorySupplier.html" title="interface in org.wildfly.swarm.config.infinispan.cache_container">BinaryMemorySupplier</a> in <a href="../../../../../../../org/wildfly/swarm/config/infinispan/cache_container/package-summary.html">org.wildfly.swarm.config.infinispan.cache_container</a></h3> <table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation"> <caption><span>Methods in <a href="../../../../../../../org/wildfly/swarm/config/infinispan/cache_container/package-summary.html">org.wildfly.swarm.config.infinispan.cache_container</a> with parameters of type <a href="../../../../../../../org/wildfly/swarm/config/infinispan/cache_container/BinaryMemorySupplier.html" title="interface in org.wildfly.swarm.config.infinispan.cache_container">BinaryMemorySupplier</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><code><a href="../../../../../../../org/wildfly/swarm/config/infinispan/cache_container/DistributedCache.html" title="type parameter in DistributedCache">T</a></code></td> <td class="colLast"><span class="typeNameLabel">DistributedCache.</span><code><span class="memberNameLink"><a href="../../../../../../../org/wildfly/swarm/config/infinispan/cache_container/DistributedCache.html#binaryMemory-org.wildfly.swarm.config.infinispan.cache_container.BinaryMemorySupplier-">binaryMemory</a></span>(<a href="../../../../../../../org/wildfly/swarm/config/infinispan/cache_container/BinaryMemorySupplier.html" title="interface in org.wildfly.swarm.config.infinispan.cache_container">BinaryMemorySupplier</a>&nbsp;supplier)</code> <div class="block">On-heap binary-based memory configuration.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code><a href="../../../../../../../org/wildfly/swarm/config/infinispan/cache_container/InvalidationCache.html" title="type parameter in InvalidationCache">T</a></code></td> <td class="colLast"><span class="typeNameLabel">InvalidationCache.</span><code><span class="memberNameLink"><a href="../../../../../../../org/wildfly/swarm/config/infinispan/cache_container/InvalidationCache.html#binaryMemory-org.wildfly.swarm.config.infinispan.cache_container.BinaryMemorySupplier-">binaryMemory</a></span>(<a href="../../../../../../../org/wildfly/swarm/config/infinispan/cache_container/BinaryMemorySupplier.html" title="interface in org.wildfly.swarm.config.infinispan.cache_container">BinaryMemorySupplier</a>&nbsp;supplier)</code> <div class="block">On-heap binary-based memory configuration.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><code><a href="../../../../../../../org/wildfly/swarm/config/infinispan/cache_container/ReplicatedCache.html" title="type parameter in ReplicatedCache">T</a></code></td> <td class="colLast"><span class="typeNameLabel">ReplicatedCache.</span><code><span class="memberNameLink"><a href="../../../../../../../org/wildfly/swarm/config/infinispan/cache_container/ReplicatedCache.html#binaryMemory-org.wildfly.swarm.config.infinispan.cache_container.BinaryMemorySupplier-">binaryMemory</a></span>(<a href="../../../../../../../org/wildfly/swarm/config/infinispan/cache_container/BinaryMemorySupplier.html" title="interface in org.wildfly.swarm.config.infinispan.cache_container">BinaryMemorySupplier</a>&nbsp;supplier)</code> <div class="block">On-heap binary-based memory configuration.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code><a href="../../../../../../../org/wildfly/swarm/config/infinispan/cache_container/LocalCache.html" title="type parameter in LocalCache">T</a></code></td> <td class="colLast"><span class="typeNameLabel">LocalCache.</span><code><span class="memberNameLink"><a href="../../../../../../../org/wildfly/swarm/config/infinispan/cache_container/LocalCache.html#binaryMemory-org.wildfly.swarm.config.infinispan.cache_container.BinaryMemorySupplier-">binaryMemory</a></span>(<a href="../../../../../../../org/wildfly/swarm/config/infinispan/cache_container/BinaryMemorySupplier.html" title="interface in org.wildfly.swarm.config.infinispan.cache_container">BinaryMemorySupplier</a>&nbsp;supplier)</code> <div class="block">On-heap binary-based memory configuration.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><code><a href="../../../../../../../org/wildfly/swarm/config/infinispan/cache_container/ScatteredCache.html" title="type parameter in ScatteredCache">T</a></code></td> <td class="colLast"><span class="typeNameLabel">ScatteredCache.</span><code><span class="memberNameLink"><a href="../../../../../../../org/wildfly/swarm/config/infinispan/cache_container/ScatteredCache.html#binaryMemory-org.wildfly.swarm.config.infinispan.cache_container.BinaryMemorySupplier-">binaryMemory</a></span>(<a href="../../../../../../../org/wildfly/swarm/config/infinispan/cache_container/BinaryMemorySupplier.html" title="interface in org.wildfly.swarm.config.infinispan.cache_container">BinaryMemorySupplier</a>&nbsp;supplier)</code> <div class="block">On-heap binary-based memory configuration.</div> </td> </tr> </tbody> </table> </li> </ul> </li> </ul> </div> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar.bottom"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.bottom.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../../../overview-summary.html">Overview</a></li> <li><a href="../package-summary.html">Package</a></li> <li><a href="../../../../../../../org/wildfly/swarm/config/infinispan/cache_container/BinaryMemorySupplier.html" title="interface in org.wildfly.swarm.config.infinispan.cache_container">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../../../../../../../overview-tree.html">Tree</a></li> <li><a href="../../../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../../../index-all.html">Index</a></li> <li><a href="../../../../../../../help-doc.html">Help</a></li> </ul> <div class="aboutLanguage">Thorntail API, 2.3.0.Final</div> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../../../../index.html?org/wildfly/swarm/config/infinispan/cache_container/class-use/BinaryMemorySupplier.html" target="_top">Frames</a></li> <li><a href="BinaryMemorySupplier.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip.navbar.bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> <p class="legalCopy"><small>Copyright &#169; 2019 <a href="http://www.jboss.org">JBoss by Red Hat</a>. All rights reserved.</small></p> </body> </html>
{ "content_hash": "defec3942567c8c08c4441ddfbe2ec91", "timestamp": "", "source": "github", "line_count": 194, "max_line_length": 553, "avg_line_length": 59.44845360824742, "alnum_prop": 0.6790080638168733, "repo_name": "wildfly-swarm/wildfly-swarm-javadocs", "id": "3f20c218de4c455fbebd8d0a6ffa0f1a3056c71b", "size": "11533", "binary": false, "copies": "1", "ref": "refs/heads/gh-pages", "path": "2.3.0.Final/apidocs/org/wildfly/swarm/config/infinispan/cache_container/class-use/BinaryMemorySupplier.html", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
package avans.ivh11a1.facturatie.domain; import avans.ivh11a1.facturatie.Builders.InsuranceCompanyBuilder; import avans.ivh11a1.facturatie.domain.administration.InsuranceCompany; import org.junit.Rule; import org.junit.Test; import org.junit.rules.ExpectedException; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest; import org.springframework.boot.test.autoconfigure.orm.jpa.TestEntityManager; import org.springframework.test.context.junit4.SpringRunner; import javax.validation.ConstraintViolationException; import static org.assertj.core.api.Assertions.assertThat; /** * Created by kevin on 22-3-2017. */ @RunWith(SpringRunner.class) @DataJpaTest public class InsuranceCompanyTest { @Rule public ExpectedException thrown = ExpectedException.none(); @Autowired private TestEntityManager entityManager; @Test public void saveCompanyWithoutKvkShouldThrowException() throws Exception { InsuranceCompany company = InsuranceCompanyBuilder.builder().kvkNumber(0).build(); this.thrown.expect(ConstraintViolationException.class); this.thrown.expectMessage("This value is not a valid KVK number"); this.entityManager.persistAndFlush(company); } @Test public void saveCompanyWithoutBtwShouldThrowException() throws Exception { InsuranceCompany company = InsuranceCompanyBuilder.builder().btw("").build(); this.thrown.expect(ConstraintViolationException.class); this.thrown.expectMessage("This value is not a valid BTW number"); this.entityManager.persistAndFlush(company); } @Test public void saveShouldPersistData(){ InsuranceCompany company = InsuranceCompanyBuilder.builder().build(); this.entityManager.persistAndFlush(company.getVat()); InsuranceCompany insuranceCompany = this.entityManager.persistFlushFind(company); assertThat(insuranceCompany.getCompanyName()).isEqualTo(company.getCompanyName()); assertThat(insuranceCompany.getVat().getPercentage()).isEqualTo(company.getVat().getPercentage()); } }
{ "content_hash": "38643e9d2e2224b044ba22ca3099d14a", "timestamp": "", "source": "github", "line_count": 55, "max_line_length": 106, "avg_line_length": 39.78181818181818, "alnum_prop": 0.7728519195612431, "repo_name": "kevin1232sn1/Facturatie.IVH11", "id": "ce4b2adc639143bac20c0184966b382341dfa98e", "size": "2188", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/test/java/avans/ivh11a1/facturatie/domain/InsuranceCompanyTest.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "5006" }, { "name": "HTML", "bytes": "142071" }, { "name": "Java", "bytes": "170229" }, { "name": "Shell", "bytes": "7059" } ], "symlink_target": "" }
<bill session="110" type="sr" number="23" updated="2009-01-09T20:01:31-05:00"> <status><vote date="1170306000" datetime="2007-02-01" where="s" result="pass" how="by Unanimous Consent" roll=""/></status> <introduced date="1168491600" datetime="2007-01-11"/> <titles> <title type="official" as="introduced">A resolution designating the week of February 5 through February 9, 2007, as &quot;National School Counseling Week&quot;.</title> </titles> <sponsor id="300076"/> <cosponsors> <cosponsor id="300090" joined="2007-02-01"/> </cosponsors> <actions> <action date="1168491600" datetime="2007-01-11"><text>Referred to the Committee on the Judiciary.</text><reference label="text of measure as introduced" ref="CR S464"/></action> <action date="1170306000" datetime="2007-02-01"><text>Senate Committee on the Judiciary discharged by Unanimous Consent.</text><reference label="consideration" ref="CR S1542"/></action> <vote date="1170306000" how="by Unanimous Consent" datetime="2007-02-01" where="s" type="vote" result="pass" ><text>Resolution agreed to in Senate without amendment and with a preamble by Unanimous Consent.</text><reference label="text" ref="CR S1542"/></vote> </actions> <committees> </committees> <relatedbills> </relatedbills> <subjects> </subjects> <amendments> </amendments> <summary> 2/1/2007--Passed Senate without amendment. (This measure has not been amended since it was introduced. The summary of that version is repeated here.) Designates the week of February 5-February 9, 2007, as National School Counseling Week.<br/> </summary> </bill>
{ "content_hash": "509a85e59e42890ed6eb1b58cd0eee49", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 262, "avg_line_length": 50.03125, "alnum_prop": 0.7295440349781387, "repo_name": "hashrocket/localpolitics.in", "id": "5e6f3a22c58c0c65377f07783217365ee2e903cf", "size": "1601", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "public/govtrack/110_bills/sr23.xml", "mode": "33188", "license": "mit", "language": [ { "name": "JavaScript", "bytes": "155887" }, { "name": "Ruby", "bytes": "147059" } ], "symlink_target": "" }
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>SFML - Simple and Fast Multimedia Library</title> <meta http-equiv="Content-Type" content="text/html;"/> <meta charset="utf-8"/> <!--<link rel='stylesheet' type='text/css' href="http://fonts.googleapis.com/css?family=Ubuntu:400,700,400italic"/>--> <link rel="stylesheet" type="text/css" href="doxygen.css" title="default" media="screen,print" /> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="dynsections.js"></script> </head> <body> <div id="banner-container"> <div id="banner"> <span id="sfml">SFML 2.3.2</span> </div> </div> <div id="content"> <!-- Generated by Doxygen 1.8.8 --> <div id="navrow1" class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main&#160;Page</span></a></li> <li><a href="pages.html"><span>Related&#160;Pages</span></a></li> <li><a href="modules.html"><span>Modules</span></a></li> <li class="current"><a href="annotated.html"><span>Classes</span></a></li> <li><a href="files.html"><span>Files</span></a></li> </ul> </div> <div id="navrow2" class="tabs2"> <ul class="tablist"> <li><a href="annotated.html"><span>Class&#160;List</span></a></li> <li><a href="classes.html"><span>Class&#160;Index</span></a></li> <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li> <li><a href="functions.html"><span>Class&#160;Members</span></a></li> </ul> </div> <div id="nav-path" class="navpath"> <ul> <li class="navelem"><b>sf</b></li><li class="navelem"><a class="el" href="classsf_1_1Mutex.html">Mutex</a></li> </ul> </div> </div><!-- top --> <div class="header"> <div class="summary"> <a href="#pub-methods">Public Member Functions</a> &#124; <a href="classsf_1_1Mutex-members.html">List of all members</a> </div> <div class="headertitle"> <div class="title">sf::Mutex Class Reference<div class="ingroups"><a class="el" href="group__system.html">System module</a></div></div> </div> </div><!--header--> <div class="contents"> <p>Blocks concurrent access to shared resources from multiple threads. <a href="classsf_1_1Mutex.html#details">More...</a></p> <p><code>#include &lt;<a class="el" href="Mutex_8hpp_source.html">Mutex.hpp</a>&gt;</code></p> <div class="dynheader"> Inheritance diagram for sf::Mutex:</div> <div class="dyncontent"> <div class="center"> <img src="classsf_1_1Mutex.png" usemap="#sf::Mutex_map" alt=""/> <map id="sf::Mutex_map" name="sf::Mutex_map"> <area href="classsf_1_1NonCopyable.html" title="Utility class that makes any derived class non-copyable. " alt="sf::NonCopyable" shape="rect" coords="0,0,105,24"/> </map> </div></div> <table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a> Public Member Functions</h2></td></tr> <tr class="memitem:a9bd52a48320fd7b6db8a78037aad276e"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Mutex.html#a9bd52a48320fd7b6db8a78037aad276e">Mutex</a> ()</td></tr> <tr class="memdesc:a9bd52a48320fd7b6db8a78037aad276e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Default constructor. <a href="#a9bd52a48320fd7b6db8a78037aad276e">More...</a><br /></td></tr> <tr class="separator:a9bd52a48320fd7b6db8a78037aad276e"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a9f76a67b7b6d3918131a692179b4e3f2"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Mutex.html#a9f76a67b7b6d3918131a692179b4e3f2">~Mutex</a> ()</td></tr> <tr class="memdesc:a9f76a67b7b6d3918131a692179b4e3f2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Destructor. <a href="#a9f76a67b7b6d3918131a692179b4e3f2">More...</a><br /></td></tr> <tr class="separator:a9f76a67b7b6d3918131a692179b4e3f2"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a1a16956a6bbea764480c1b80f2e45763"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Mutex.html#a1a16956a6bbea764480c1b80f2e45763">lock</a> ()</td></tr> <tr class="memdesc:a1a16956a6bbea764480c1b80f2e45763"><td class="mdescLeft">&#160;</td><td class="mdescRight"><a class="el" href="classsf_1_1Lock.html" title="Automatic wrapper for locking and unlocking mutexes. ">Lock</a> the mutex. <a href="#a1a16956a6bbea764480c1b80f2e45763">More...</a><br /></td></tr> <tr class="separator:a1a16956a6bbea764480c1b80f2e45763"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ade71268ffc5e80756652058b01c23c33"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Mutex.html#ade71268ffc5e80756652058b01c23c33">unlock</a> ()</td></tr> <tr class="memdesc:ade71268ffc5e80756652058b01c23c33"><td class="mdescLeft">&#160;</td><td class="mdescRight">Unlock the mutex. <a href="#ade71268ffc5e80756652058b01c23c33">More...</a><br /></td></tr> <tr class="separator:ade71268ffc5e80756652058b01c23c33"><td class="memSeparator" colspan="2">&#160;</td></tr> </table> <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2> <div class="textblock"><p>Blocks concurrent access to shared resources from multiple threads. </p> <p><a class="el" href="classsf_1_1Mutex.html" title="Blocks concurrent access to shared resources from multiple threads. ">Mutex</a> stands for "MUTual EXclusion".</p> <p>A mutex is a synchronization object, used when multiple threads are involved.</p> <p>When you want to protect a part of the code from being accessed simultaneously by multiple threads, you typically use a mutex. When a thread is locked by a mutex, any other thread trying to lock it will be blocked until the mutex is released by the thread that locked it. This way, you can allow only one thread at a time to access a critical region of your code.</p> <p>Usage example: </p><div class="fragment"><div class="line">Database database; <span class="comment">// this is a critical resource that needs some protection</span></div> <div class="line"><a class="code" href="classsf_1_1Mutex.html">sf::Mutex</a> mutex;</div> <div class="line"></div> <div class="line"><span class="keywordtype">void</span> thread1()</div> <div class="line">{</div> <div class="line"> mutex.<a class="code" href="classsf_1_1Mutex.html#a1a16956a6bbea764480c1b80f2e45763">lock</a>(); <span class="comment">// this call will block the thread if the mutex is already locked by thread2</span></div> <div class="line"> database.write(...);</div> <div class="line"> mutex.<a class="code" href="classsf_1_1Mutex.html#ade71268ffc5e80756652058b01c23c33">unlock</a>(); <span class="comment">// if thread2 was waiting, it will now be unblocked</span></div> <div class="line">}</div> <div class="line"></div> <div class="line"><span class="keywordtype">void</span> thread2()</div> <div class="line">{</div> <div class="line"> mutex.<a class="code" href="classsf_1_1Mutex.html#a1a16956a6bbea764480c1b80f2e45763">lock</a>(); <span class="comment">// this call will block the thread if the mutex is already locked by thread1</span></div> <div class="line"> database.write(...);</div> <div class="line"> mutex.<a class="code" href="classsf_1_1Mutex.html#ade71268ffc5e80756652058b01c23c33">unlock</a>(); <span class="comment">// if thread1 was waiting, it will now be unblocked</span></div> <div class="line">}</div> </div><!-- fragment --><p>Be very careful with mutexes. A bad usage can lead to bad problems, like deadlocks (two threads are waiting for each other and the application is globally stuck).</p> <p>To make the usage of mutexes more robust, particularly in environments where exceptions can be thrown, you should use the helper class <a class="el" href="classsf_1_1Lock.html" title="Automatic wrapper for locking and unlocking mutexes. ">sf::Lock</a> to lock/unlock mutexes.</p> <p>SFML mutexes are recursive, which means that you can lock a mutex multiple times in the same thread without creating a deadlock. In this case, the first call to <a class="el" href="classsf_1_1Mutex.html#a1a16956a6bbea764480c1b80f2e45763" title="Lock the mutex. ">lock()</a> behaves as usual, and the following ones have no effect. However, you must call <a class="el" href="classsf_1_1Mutex.html#ade71268ffc5e80756652058b01c23c33" title="Unlock the mutex. ">unlock()</a> exactly as many times as you called <a class="el" href="classsf_1_1Mutex.html#a1a16956a6bbea764480c1b80f2e45763" title="Lock the mutex. ">lock()</a>. If you don't, the mutex won't be released.</p> <dl class="section see"><dt>See also</dt><dd><a class="el" href="classsf_1_1Lock.html" title="Automatic wrapper for locking and unlocking mutexes. ">sf::Lock</a> </dd></dl> <p>Definition at line <a class="el" href="Mutex_8hpp_source.html#l00047">47</a> of file <a class="el" href="Mutex_8hpp_source.html">Mutex.hpp</a>.</p> </div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2> <a class="anchor" id="a9bd52a48320fd7b6db8a78037aad276e"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">sf::Mutex::Mutex </td> <td>(</td> <td class="paramname"></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Default constructor. </p> </div> </div> <a class="anchor" id="a9f76a67b7b6d3918131a692179b4e3f2"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">sf::Mutex::~Mutex </td> <td>(</td> <td class="paramname"></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Destructor. </p> </div> </div> <h2 class="groupheader">Member Function Documentation</h2> <a class="anchor" id="a1a16956a6bbea764480c1b80f2e45763"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void sf::Mutex::lock </td> <td>(</td> <td class="paramname"></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p><a class="el" href="classsf_1_1Lock.html" title="Automatic wrapper for locking and unlocking mutexes. ">Lock</a> the mutex. </p> <p>If the mutex is already locked in another thread, this call will block the execution until the mutex is released.</p> <dl class="section see"><dt>See also</dt><dd><a class="el" href="classsf_1_1Mutex.html#ade71268ffc5e80756652058b01c23c33" title="Unlock the mutex. ">unlock</a> </dd></dl> </div> </div> <a class="anchor" id="ade71268ffc5e80756652058b01c23c33"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void sf::Mutex::unlock </td> <td>(</td> <td class="paramname"></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Unlock the mutex. </p> <dl class="section see"><dt>See also</dt><dd><a class="el" href="classsf_1_1Mutex.html#a1a16956a6bbea764480c1b80f2e45763" title="Lock the mutex. ">lock</a> </dd></dl> </div> </div> <hr/>The documentation for this class was generated from the following file:<ul> <li><a class="el" href="Mutex_8hpp_source.html">Mutex.hpp</a></li> </ul> </div><!-- contents --> </div> <div id="footer-container"> <div id="footer"> SFML is licensed under the terms and conditions of the <a href="http://www.sfml-dev.org/license.php">zlib/png license</a>.<br> Copyright &copy; Laurent Gomila &nbsp;::&nbsp; Documentation generated by <a href="http://www.doxygen.org/" title="doxygen website">doxygen</a> &nbsp;::&nbsp; </div> </div> </body> </html>
{ "content_hash": "d8fe67b715938187eeb519fc8eb1c6bd", "timestamp": "", "source": "github", "line_count": 193, "max_line_length": 670, "avg_line_length": 63.43523316062176, "alnum_prop": 0.6719758229192191, "repo_name": "nihildeb/hme", "id": "7b7c89c2fe5aa83286ec068382d4a04693aeed2a", "size": "12243", "binary": false, "copies": "6", "ref": "refs/heads/master", "path": "dep/SFML-2.3.2/doc/html/classsf_1_1Mutex.html", "mode": "33188", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "107" }, { "name": "C", "bytes": "96153" }, { "name": "C++", "bytes": "2665993" }, { "name": "CMake", "bytes": "30870" }, { "name": "CSS", "bytes": "27886" }, { "name": "GLSL", "bytes": "3928" }, { "name": "Groff", "bytes": "6100" }, { "name": "HTML", "bytes": "6644995" }, { "name": "JavaScript", "bytes": "3422" }, { "name": "Makefile", "bytes": "4378" }, { "name": "Objective-C", "bytes": "15609" }, { "name": "Objective-C++", "bytes": "3806" }, { "name": "Python", "bytes": "14374" }, { "name": "QMake", "bytes": "5023" }, { "name": "Shell", "bytes": "62171" } ], "symlink_target": "" }
require 'test_helper' class EventOccurrenceControllerTest < ActionController::TestCase # test "the truth" do # assert true # end end
{ "content_hash": "8e74aeb7f6efc93e5c2ad5f5d488c05a", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 64, "avg_line_length": 20.285714285714285, "alnum_prop": 0.7394366197183099, "repo_name": "dsgrafiniert/campusasyl_projectsdb", "id": "62ba0d025e706aa9504f0bb36f11dd4b5bf4ad8e", "size": "142", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "test/controllers/event_occurrence_controller_test.rb", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "3212" }, { "name": "CoffeeScript", "bytes": "1519" }, { "name": "HTML", "bytes": "50056" }, { "name": "JavaScript", "bytes": "757" }, { "name": "Ruby", "bytes": "141906" }, { "name": "Shell", "bytes": "190" } ], "symlink_target": "" }
<?php namespace DC3\InstawallBundle\Tests\Controller; use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; class EventControllerTest extends WebTestCase { /* public function testCompleteScenario() { // Create a new client to browse the application $client = static::createClient(); // Create a new entry in the database $crawler = $client->request('GET', '/event/'); $this->assertEquals(200, $client->getResponse()->getStatusCode(), "Unexpected HTTP status code for GET /event/"); $crawler = $client->click($crawler->selectLink('Create a new entry')->link()); // Fill in the form and submit it $form = $crawler->selectButton('Create')->form(array( 'dc3_instawallbundle_eventtype[field_name]' => 'Test', // ... other fields to fill )); $client->submit($form); $crawler = $client->followRedirect(); // Check data in the show view $this->assertGreaterThan(0, $crawler->filter('td:contains("Test")')->count(), 'Missing element td:contains("Test")'); // Edit the entity $crawler = $client->click($crawler->selectLink('Edit')->link()); $form = $crawler->selectButton('Edit')->form(array( 'dc3_instawallbundle_eventtype[field_name]' => 'Foo', // ... other fields to fill )); $client->submit($form); $crawler = $client->followRedirect(); // Check the element contains an attribute with value equals "Foo" $this->assertGreaterThan(0, $crawler->filter('[value="Foo"]')->count(), 'Missing element [value="Foo"]'); // Delete the entity $client->submit($crawler->selectButton('Delete')->form()); $crawler = $client->followRedirect(); // Check the entity has been delete on the list $this->assertNotRegExp('/Foo/', $client->getResponse()->getContent()); } */ }
{ "content_hash": "ead0d1374af696d2c01f30db2e8984cd", "timestamp": "", "source": "github", "line_count": 55, "max_line_length": 125, "avg_line_length": 35.25454545454546, "alnum_prop": 0.6034038164002062, "repo_name": "pierrelauret/instawall", "id": "c97e16428d3b7f54a5ac58541626b39f05248f12", "size": "1939", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/DC3/InstawallBundle/Tests/Controller/EventControllerTest.php", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "259946" }, { "name": "JavaScript", "bytes": "189480" }, { "name": "PHP", "bytes": "119300" } ], "symlink_target": "" }
title: Ježiš – Prostredník lepšej zmluvy date: 06/01/2022 --- > <p></p> > <sup>8</sup>Keď ich karhá, hovorí: Hľa, prichádzajú dni, hovorí Pán, a uzavriem s domom Izraela a s domom Júdu novú zmluvu. <sup>9</sup>Nie takú zmluvu, ako som uzavrel s ich otcami v ten deň, keď som ich vzal za ruku, aby som ich vyviedol z egyptskej krajiny. Oni totiž nezotrvali pri mojej zmluve a ja som ich opustil, hovorí Pán. <sup>10</sup>Lebo toto je zmluva, ktorú uzavriem s domom Izraela po tých dňoch, hovorí Pán. Svoje zákony vložím do ich mysle a napíšem ich na ich srdcia. Budem ich Bohom a oni budú mojím ľudom. <sup>11</sup>A nikto už nebude poúčať svojho blížneho ani brat svojho brata slovami: „Poznaj Pána!“, lebo ma budú poznať všetci, od najmenšieho po najväčšieho, <sup>12</sup>pretože sa zľutujem nad ich neprávosťami a na ich hriechy si viac nespomeniem. **Osobné štúdium** List Hebrejom sa v kapitolách 8 až 10 zameriava na dielo Ježiša ako Sprostredkovateľa novej zmluvy. Problémom starej zmluvy bolo vlastne iba to, že bola predzvesťou všetkého dobrého, čo malo prísť. Jej ustanovenia mali predznamenávať, zobrazovať a opisovať dielo, ktoré Ježiš vykoná v budúcnosti. Kňazi poukazovali na Ježiša, ale oni sami boli smrteľní a hriešni. Nemohli prinášať dokonalosť, ktorú priniesol Ježiš. Okrem toho slúžili vo svätyni, ktorá bola len „obrazom a tieňom“ (Heb 8,5) nebeskej svätyne. Ježiš koná svoju službu v ozajstnej svätyni a umožňuje nám prístup k Bohu. Obete zvierat predstavovali Ježišovu smrť ako obeť za nás. Ich krv však nemohla očistiť svedomie človeka. Ježišova krv očisťuje aj naše svedomie. Vďaka Ježišovi, vierou v neho a prijatím jeho sprostredkovateľskej služby za nás, môžeme k Bohu pristupovať so smelou dôverou (Heb 10,19–22). `Uvažuj o úvodnom texte (Heb 8,8–12). Čo nám Boh zasľúbil v novej zmluve? Aký to má praktický vplyv na tvoj život?` Tým, že Otec ustanovil Ježiša za nášho Veľkňaza, uviedol do života novú zmluvu, ktorá uskutoční to, čo stará zmluva mohla iba naznačovať. Nová zmluva prináša to, čo môže uskutočniť len dokonalý, večný a božsko-ľudský kňaz. Tento Veľkňaz nielenže vysvetľuje a učí Boží zákon, ale ho aj vkladá do našich sŕdc. Tento Veľkňaz ponúka obeť, ktorá prináša odpustenie. Tento Veľkňaz nás očisťuje a premieňa. Z našich kamenných sŕdc robí srdcia „z mäsa“ (Ez 36,26). Robí z nás nové stvorenie (2Kor 5,17). Tento kňaz nás požehnáva tým najobdivuhodnejším spôsobom – privádza nás do prítomnosti samotného Otca. Boh ustanovil starú zmluvu, aby poukazovala na budúce dielo Ježiša Krista. Vo svojom zámere a cieli bola nádherná. Mnohí však prišli o požehnania, ktoré im Ježiš ponúkol svojou službou, pretože neboli ochotní opustiť symboly a tiene starej zmluvy a prijať pravdu, na ktorú tieto symboly ukazovali. „Kristus bol základom i životom chrámu. Chrámové služby boli predobrazom obete Božieho Syna. Kňazská služba mala predstavovať prostrednícku povahu Kristovho diela. Celý systém obetnej bohoslužby bol symbolom Spasiteľovej smrti na vykúpenie sveta. Všetky obete stratia svoj zmysel pri onej veľkej udalosti, ktorú tieto obete po celé veky názorne sprítomňovali.“ (DA 165; TV105) **Aplikácia** `V čom je Ježiš lepší Veľkňaz, ako boli veľkňazi starej zmluvy?` --- #### Dodatečné otázky k diskuzi `Co je tou „starou smlouvou“? Kdo, kdy a s kým ji uzavřel?` `Proč chce Ježíš s křesťany uzavřít novou smlouvu?` `Proč je třeba, aby byly jeho zákony vepsány do naší mysli i srdce?` `Jak to dopadá, když má někdo zákon zapsaný jen ve své mysli?` `Jak to dopadá, když má někdo zákon zapsaný jen ve svém srdci?` `Jak se mění tvůj život v závislosti na tom, jak roste tvé poznání Boha?` `Proč potřebujeme Ježíše k uzavření této lepší smlouvy?` `Cílem naší proměny je být dokonalým „obrazem“ Boha? Věříš, že to může být i tvůj případ? Proč?` `Co je pro takovou proměnu potřeba? V čem spočívá?`
{ "content_hash": "b888a2893a0aa7af2216b0154618b743", "timestamp": "", "source": "github", "line_count": 46, "max_line_length": 781, "avg_line_length": 83.93478260869566, "alnum_prop": 0.7821807821807821, "repo_name": "imasaru/sabbath-school-lessons", "id": "74badebab1350c4dfc1f09d6d9e3a2a71b3f6c9a", "size": "4244", "binary": false, "copies": "2", "ref": "refs/heads/stage", "path": "src/sk/2022-01/02/06.md", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "160533" }, { "name": "HTML", "bytes": "20725" }, { "name": "JavaScript", "bytes": "54661" } ], "symlink_target": "" }