text:
package org.wso2.carbon.appmgt.rest.api.publisher;

import io.swagger.annotations.ApiParam;
import org.apache.cxf.jaxrs.ext.multipart.Attachment;
import org.apache.cxf.jaxrs.ext.multipart.Multipart;
import org.wso2.carbon.appmgt.rest.api.publisher.dto.AppDTO;
import org.wso2.carbon.appmgt.rest.api.publisher.dto.AppListDTO;
import org.wso2.carbon.appmgt.rest.api.publisher.dto.AppSummaryDTO;
import org.wso2.carbon.appmgt.rest.api.publisher.dto.BinaryDTO;
import org.wso2.carbon.appmgt.rest.api.publisher.dto.LifeCycleDTO;
import org.wso2.carbon.appmgt.rest.api.publisher.dto.LifeCycleHistoryListDTO;
import org.wso2.carbon.appmgt.rest.api.publisher.dto.PListDTO;
import org.wso2.carbon.appmgt.rest.api.publisher.dto.ResponseMessageDTO;
import org.wso2.carbon.appmgt.rest.api.publisher.dto.StaticContentDTO;
import org.wso2.carbon.appmgt.rest.api.publisher.dto.TierListDTO;
import org.wso2.carbon.appmgt.rest.api.publisher.dto.UserIdListDTO;
import org.wso2.carbon.appmgt.rest.api.publisher.factories.AppsApiServiceFactory;

import javax.ws.rs.Consumes;
import javax.ws.rs.DELETE;
import javax.ws.rs.GET;
import javax.ws.rs.HeaderParam;
import javax.ws.rs.POST;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.Response;
import java.io.File;
import java.io.InputStream;

@Path("/apps")
@Consumes({ "application/json" })
@Produces({ "application/json" })
@io.swagger.annotations.Api(value = "/apps", description = "the apps API")
public class AppsApi  {

   private final AppsApiService delegate = AppsApiServiceFactory.getAppsApi();

    @POST
    @Path("/mobile/binaries")
    @Consumes({ "multipart/form-data" })
    @Produces({ "application/json" })
    @io.swagger.annotations.ApiOperation(value = "Uploading binary files", notes = "Uploading .apk/.IPA binary files.", response = BinaryDTO.class)
    @io.swagger.annotations.ApiResponses(value = {
        @io.swagger.annotations.ApiResponse(code = 200, message = "OK.\nBinary file uploaded successfully."),

        @io.swagger.annotations.ApiResponse(code = 400, message = "Bad Request.\nInvalid request or validation error"),

        @io.swagger.annotations.ApiResponse(code = 404, message = "Not Found.\nRequested App does not exist."),

        @io.swagger.annotations.ApiResponse(code = 412, message = "Precondition Failed.\nThe request has not been performed because one of the preconditions is not met.") })

    public Response appsMobileBinariesPost(@ApiParam(value = "Document to upload") @Multipart(value = "file", required = false) InputStream fileInputStream,
    @ApiParam(value = "Document to upload : details") @Multipart(value = "file" , required = false) Attachment fileDetail,
    @ApiParam(value = "Validator for conditional requests; based on ETag."  )@HeaderParam("If-Match") String ifMatch,
    @ApiParam(value = "Validator for conditional requests; based on Last Modified header."  )@HeaderParam("If-Unmodified-Since") String ifUnmodifiedSince)
    {
    return delegate.appsMobileBinariesPost(fileInputStream,fileDetail,ifMatch,ifUnmodifiedSince);
    }
    @GET
    @Path("/mobile/binaries/{fileName}")
    @Consumes({ "application/json" })
    @Produces({ "application/json" })
    @io.swagger.annotations.ApiOperation(value = "Retrieving mobile application binaries", notes = "Retrieving .apk, .ipa binaries for mobile apps.", response = File.class)
    @io.swagger.annotations.ApiResponses(value = {
        @io.swagger.annotations.ApiResponse(code = 200, message = "OK.\nMobile app binary content retrieved successfully."),

        @io.swagger.annotations.ApiResponse(code = 400, message = "Bad Request.\nInvalid request or validation error"),

        @io.swagger.annotations.ApiResponse(code = 404, message = "Not Found.\nRequested entity does not exist."),

        @io.swagger.annotations.ApiResponse(code = 412, message = "Precondition Failed.\nThe request has not been performed because one of the preconditions is not met.") })

    public Response appsMobileBinariesFileNameGet(@ApiParam(value = "File name.",required=true ) @PathParam("fileName") String fileName,
    @ApiParam(value = "Validator for conditional requests; based on ETag."  )@HeaderParam("If-Match") String ifMatch,
    @ApiParam(value = "Validator for conditional requests; based on Last Modified header."  )@HeaderParam("If-Unmodified-Since") String ifUnmodifiedSince)
    {
    return delegate.appsMobileBinariesFileNameGet(fileName,ifMatch,ifUnmodifiedSince);
    }
    @GET
    @Path("/mobile/getplist/tenant/{tenantId}/file/{fileName}")
    @Consumes({ "application/json" })
    @Produces({ "application/json" })
    @io.swagger.annotations.ApiOperation(value = "Get plist", notes = "Plist file of the specified iOS (Apple) mobile app.", response = PListDTO.class)
    @io.swagger.annotations.ApiResponses(value = {
        @io.swagger.annotations.ApiResponse(code = 200, message = "OK."),

        @io.swagger.annotations.ApiResponse(code = 400, message = "Bad Request.\nInvalid request or validation error."),

        @io.swagger.annotations.ApiResponse(code = 403, message = "Forbidden.\nThe request must be conditional but no condition has been specified."),

        @io.swagger.annotations.ApiResponse(code = 404, message = "Not Found.\nThe resource to be updated does not exist.") })

    public Response appsMobileGetplistTenantTenantIdFileFileNameGet(@ApiParam(value = "Tenant Id.",required=true ) @PathParam("tenantId") String tenantId,
    @ApiParam(value = "File name.",required=true ) @PathParam("fileName") String fileName,
    @ApiParam(value = "Media types acceptable for the response. Default is JSON."  , defaultValue="JSON")@HeaderParam("Accept") String accept,
    @ApiParam(value = "Validator for conditional requests; based on the ETag of the formerly retrieved\nvariant of the resourec."  )@HeaderParam("If-None-Match") String ifNoneMatch)
    {
    return delegate.appsMobileGetplistTenantTenantIdFileFileNameGet(tenantId,fileName,accept,ifNoneMatch);
    }
    @POST
    @Path("/static-contents")
    @Consumes({ "multipart/form-data" })
    @Produces({ "application/json" })
    @io.swagger.annotations.ApiOperation(value = "Uploading images, pdf, documents files", notes = "Uploading images for banners, screenshots etc.", response = StaticContentDTO.class)
    @io.swagger.annotations.ApiResponses(value = {
        @io.swagger.annotations.ApiResponse(code = 200, message = "OK.\nStatic content uploaded successfully."),

        @io.swagger.annotations.ApiResponse(code = 400, message = "Bad Request.\nInvalid request or validation error"),

        @io.swagger.annotations.ApiResponse(code = 404, message = "Not Found.\nRequested entity does not exist."),

        @io.swagger.annotations.ApiResponse(code = 412, message = "Precondition Failed.\nThe request has not been performed because one of the preconditions is not met.") })

    public Response appsStaticContentsPost(@ApiParam(value = "Application type",required=true) @QueryParam("appType") String appType,
    @ApiParam(value = "Document to upload") @Multipart(value = "file", required = false) InputStream fileInputStream,
    @ApiParam(value = "Document to upload : details") @Multipart(value = "file" , required = false) Attachment fileDetail,
    @ApiParam(value = "Validator for conditional requests; based on ETag."  )@HeaderParam("If-Match") String ifMatch,
    @ApiParam(value = "Validator for conditional requests; based on Last Modified header."  )@HeaderParam("If-Unmodified-Since") String ifUnmodifiedSince)
    {
    return delegate.appsStaticContentsPost(appType,fileInputStream,fileDetail,ifMatch,ifUnmodifiedSince);
    }
    @GET
    @Path("/static-contents/{fileName}")
    @Consumes({ "application/json" })
    @Produces({ "application/json" })
    @io.swagger.annotations.ApiOperation(value = "Retrieving images, pdf, documents files", notes = "Retrieving images for banners, screenshots etc.", response = File.class)
    @io.swagger.annotations.ApiResponses(value = {
        @io.swagger.annotations.ApiResponse(code = 200, message = "OK.\nStatic content Retrieved successfully."),

        @io.swagger.annotations.ApiResponse(code = 400, message = "Bad Request.\nInvalid request or validation error"),

        @io.swagger.annotations.ApiResponse(code = 404, message = "Not Found.\nRequested entity does not exist."),

        @io.swagger.annotations.ApiResponse(code = 412, message = "Precondition Failed.\nThe request has not been performed because one of the preconditions is not met.") })

    public Response appsStaticContentsFileNameGet(@ApiParam(value = "Application type",required=true) @QueryParam("appType") String appType,
    @ApiParam(value = "File name.",required=true ) @PathParam("fileName") String fileName,
    @ApiParam(value = "Validator for conditional requests; based on ETag."  )@HeaderParam("If-Match") String ifMatch,
    @ApiParam(value = "Validator for conditional requests; based on Last Modified header."  )@HeaderParam("If-Unmodified-Since") String ifUnmodifiedSince)
    {
    return delegate.appsStaticContentsFileNameGet(appType,fileName,ifMatch,ifUnmodifiedSince);
    }
    @GET
    @Path("/{appType}")
    @Consumes({ "application/json" })
    @Produces({ "application/json" })
    @io.swagger.annotations.ApiOperation(value = "Get all Apps", notes = "Get a list of available Apps qualifying under a given search condition.", response = AppListDTO.class)
    @io.swagger.annotations.ApiResponses(value = {
        @io.swagger.annotations.ApiResponse(code = 200, message = "OK.\nList of qualifying Apps is returned."),

        @io.swagger.annotations.ApiResponse(code = 400, message = "Bad Request.\nInvalid request or validation error."),

        @io.swagger.annotations.ApiResponse(code = 403, message = "Forbidden.\nThe request must be conditional but no condition has been specified."),

        @io.swagger.annotations.ApiResponse(code = 404, message = "Not Found.\nThe resource to be updated does not exist.") })

    public Response appsAppTypeGet(@ApiParam(value = "App Type. Either webapp or mobileapp",required=true ) @PathParam("appType") String appType,
    @ApiParam(value = "**Search condition**.\n\n\n\n\nYou can search in attributes by using an **\"attribute:\"** modifier.\n\n\n\n\nEg. \"provider:wso2\" will match an App if the provider of the App contains \"wso2\".\n\n\n\n\nSupported attribute modifiers are [*provider, app_name, app_version, app_id**]\n\n\n\n\nIf no advanced attribute modifier has been specified, search will match the\ngiven query string against App Name.") @QueryParam("query") String query,
    @ApiParam(value = "Used to limit the fields in response.\n\n\n\n\nSupported filters are [ **basic,all**]", allowableValues="{values=[basic, all]}", defaultValue="basic") @QueryParam("field-filter") String fieldFilter,
    @ApiParam(value = "Maximum size of resource array to return.", defaultValue="25") @QueryParam("limit") Integer limit,
    @ApiParam(value = "Starting point within the complete list of items qualified.", defaultValue="0") @QueryParam("offset") Integer offset,
    @ApiParam(value = "Media types acceptable for the response. Default is JSON."  , defaultValue="JSON")@HeaderParam("Accept") String accept,
    @ApiParam(value = "Validator for conditional requests; based on the ETag of the formerly retrieved\nvariant of the resourec."  )@HeaderParam("If-None-Match") String ifNoneMatch)
    {
    return delegate.appsAppTypeGet(appType,query,fieldFilter,limit,offset,accept,ifNoneMatch);
    }
    @POST
    @Path("/{appType}")
    @Consumes({ "application/json" })
    @Produces({ "application/json" })
    @io.swagger.annotations.ApiOperation(value = "Create a new App", notes = "Create a new App", response = AppDTO.class)
    @io.swagger.annotations.ApiResponses(value = {
        @io.swagger.annotations.ApiResponse(code = 201, message = "Created.\nSuccessful response with the newly created object as entity in the body.\nLocation header contains URL of newly created entity."),

        @io.swagger.annotations.ApiResponse(code = 400, message = "Bad Request.\nInvalid request or validation error."),

        @io.swagger.annotations.ApiResponse(code = 415, message = "Unsupported Media Type.\nThe entity of the request was in a not supported format.") })

    public Response appsAppTypePost(@ApiParam(value = "App Type. Either webapp or mobileapp",required=true ) @PathParam("appType") String appType,
    @ApiParam(value = "App object that needs to be added" ,required=true ) AppDTO body,
    @ApiParam(value = "Media type of the entity in the body. Default is JSON." ,required=true , defaultValue="JSON")@HeaderParam("Content-Type") String contentType,
    @ApiParam(value = "Validator for conditional requests; based on Last Modified header of the\nformerly retrieved variant of the resource."  )@HeaderParam("If-Modified-Since") String ifModifiedSince)
    {
    return delegate.appsAppTypePost(appType,body,contentType,ifModifiedSince);
    }
    @POST
    @Path("/{appType}/change-lifecycle")
    @Consumes({ "application/json" })
    @Produces({ "application/json" })
    @io.swagger.annotations.ApiOperation(value = "Change App Status", notes = "Change the lifecycle of an App", response = ResponseMessageDTO.class)
    @io.swagger.annotations.ApiResponses(value = {
        @io.swagger.annotations.ApiResponse(code = 202, message = "OK.\nLifecycle changed successfully."),

        @io.swagger.annotations.ApiResponse(code = 400, message = "Bad Request.\nInvalid request or validation error"),

        @io.swagger.annotations.ApiResponse(code = 404, message = "Not Found.\nRequested App does not exist."),

        @io.swagger.annotations.ApiResponse(code = 412, message = "Precondition Failed.\nThe request has not been performed because one of the preconditions is not met.") })

    public Response appsAppTypeChangeLifecyclePost(@ApiParam(value = "App Type. Either webapp or mobileapp",required=true ) @PathParam("appType") String appType,
    @ApiParam(value = "The action to demote or promote the state of the App.\n\n\n\n\nSupported actions are [ **Publish,Approve,Reject,Unpublish,Deprecate,Retire,Recycle,Re-Publish,Submit#for#Review **]",required=true, allowableValues="{values=[Publish, Approve, Reject, Unpublish, Deprecate, Retire, Recycle, Re-Publish, Submit#for#Review]}") @QueryParam("action") String action,
    @ApiParam(value = "**appId ID** consisting of the **UUID** of the App.\nThe combination of the provider of the appId, name of the appId and the version is also accepted as a valid App ID.\nShould be formatted as **provider-name-version**.",required=true) @QueryParam("appId") String appId,
    @ApiParam(value = "Validator for conditional requests; based on ETag."  )@HeaderParam("If-Match") String ifMatch,
    @ApiParam(value = "Validator for conditional requests; based on Last Modified header."  )@HeaderParam("If-Unmodified-Since") String ifUnmodifiedSince)
    {
    return delegate.appsAppTypeChangeLifecyclePost(appType,action,appId,ifMatch,ifUnmodifiedSince);
    }
    @GET
    @Path("/{appType}/id/{appId}")
    @Consumes({ "application/json" })
    @Produces({ "application/json" })
    @io.swagger.annotations.ApiOperation(value = "Get app details", notes = "Get details of an app.", response = AppSummaryDTO.class)
    @io.swagger.annotations.ApiResponses(value = {
        @io.swagger.annotations.ApiResponse(code = 200, message = "OK.\nQualifying App is returned."),

        @io.swagger.annotations.ApiResponse(code = 400, message = "Bad Request.\nInvalid request or validation error."),

        @io.swagger.annotations.ApiResponse(code = 403, message = "Forbidden.\nThe request must be conditional but no condition has been specified."),

        @io.swagger.annotations.ApiResponse(code = 404, message = "Not Found.\nThe resource to be updated does not exist.") })

    public Response appsAppTypeIdAppIdGet(@ApiParam(value = "App Type. Either webapp or mobileapp",required=true ) @PathParam("appType") String appType,
    @ApiParam(value = "**APP ID** consisting of the **UUID** of the App.\nThe combination of the provider of the app, name of the appId and the version is also accepted as a valid App ID.\nShould be formatted as **provider-name-version**.",required=true ) @PathParam("appId") String appId,
    @ApiParam(value = "Media types acceptable for the response. Default is JSON."  , defaultValue="JSON")@HeaderParam("Accept") String accept,
    @ApiParam(value = "Validator for conditional requests; based on the ETag of the formerly retrieved\nvariant of the resourec."  )@HeaderParam("If-None-Match") String ifNoneMatch,
    @ApiParam(value = "Validator for conditional requests; based on Last Modified header of the\nformerly retrieved variant of the resource."  )@HeaderParam("If-Modified-Since") String ifModifiedSince)
    {
    return delegate.appsAppTypeIdAppIdGet(appType,appId,accept,ifNoneMatch,ifModifiedSince);
    }
    @PUT
    @Path("/{appType}/id/{appId}")
    @Consumes({ "application/json" })
    @Produces({ "application/json" })
    @io.swagger.annotations.ApiOperation(value = "Update an existing App", notes = "Update an existing App", response = AppDTO.class)
    @io.swagger.annotations.ApiResponses(value = {
        @io.swagger.annotations.ApiResponse(code = 200, message = "OK.\nSuccessful response with updated App object"),

        @io.swagger.annotations.ApiResponse(code = 400, message = "Bad Request.\nInvalid request or validation error"),

        @io.swagger.annotations.ApiResponse(code = 403, message = "Forbidden.\nThe request must be conditional but no condition has been specified."),

        @io.swagger.annotations.ApiResponse(code = 404, message = "Not Found.\nThe resource to be updated does not exist."),

        @io.swagger.annotations.ApiResponse(code = 412, message = "Precondition Failed.\nThe request has not been performed because one of the preconditions is not met.") })

    public Response appsAppTypeIdAppIdPut(@ApiParam(value = "App Type. Either webapp or mobileapp",required=true ) @PathParam("appType") String appType,
    @ApiParam(value = "**APP ID** consisting of the **UUID** of the App.\nThe combination of the provider of the app, name of the appId and the version is also accepted as a valid App ID.\nShould be formatted as **provider-name-version**.",required=true ) @PathParam("appId") String appId,
    @ApiParam(value = "App object that needs to be added" ,required=true ) AppDTO body,
    @ApiParam(value = "Media type of the entity in the body. Default is JSON." ,required=true , defaultValue="JSON")@HeaderParam("Content-Type") String contentType,
    @ApiParam(value = "Validator for conditional requests; based on ETag."  )@HeaderParam("If-Match") String ifMatch,
    @ApiParam(value = "Validator for conditional requests; based on Last Modified header."  )@HeaderParam("If-Unmodified-Since") String ifUnmodifiedSince)
    {
    return delegate.appsAppTypeIdAppIdPut(appType,appId,body,contentType,ifMatch,ifUnmodifiedSince);
    }
    @DELETE
    @Path("/{appType}/id/{appId}")
    @Consumes({ "application/json" })
    @Produces({ "application/json" })
    @io.swagger.annotations.ApiOperation(value = "Delete App", notes = "Delete an existing App", response = Void.class)
    @io.swagger.annotations.ApiResponses(value = {
        @io.swagger.annotations.ApiResponse(code = 200, message = "OK.\nResource successfully deleted."),

        @io.swagger.annotations.ApiResponse(code = 403, message = "Forbidden.\nThe request must be conditional but no condition has been specified."),

        @io.swagger.annotations.ApiResponse(code = 404, message = "Not Found.\nResource to be deleted does not exist."),

        @io.swagger.annotations.ApiResponse(code = 412, message = "Precondition Failed.\nThe request has not been performed because one of the preconditions is not met.") })

    public Response appsAppTypeIdAppIdDelete(@ApiParam(value = "App Type. Either webapp or mobileapp",required=true ) @PathParam("appType") String appType,
    @ApiParam(value = "**APP ID** consisting of the **UUID** of the App.\nThe combination of the provider of the app, name of the appId and the version is also accepted as a valid App ID.\nShould be formatted as **provider-name-version**.",required=true ) @PathParam("appId") String appId,
    @ApiParam(value = "Validator for conditional requests; based on ETag."  )@HeaderParam("If-Match") String ifMatch,
    @ApiParam(value = "Validator for conditional requests; based on Last Modified header."  )@HeaderParam("If-Unmodified-Since") String ifUnmodifiedSince)
    {
    return delegate.appsAppTypeIdAppIdDelete(appType,appId,ifMatch,ifUnmodifiedSince);
    }
    @POST
    @Path("/{appType}/id/{appId}/create-new-version")
    @Consumes({ "application/json" })
    @Produces({ "application/json" })
    @io.swagger.annotations.ApiOperation(value = "Create a new version of an App", notes = "Create a new version of an App", response = AppDTO.class)
    @io.swagger.annotations.ApiResponses(value = {
        @io.swagger.annotations.ApiResponse(code = 201, message = "Created.\nSuccessful response with the newly created object as entity in the body.\nLocation header contains URL of newly created entity."),

        @io.swagger.annotations.ApiResponse(code = 400, message = "Bad Request.\nInvalid request or validation error."),

        @io.swagger.annotations.ApiResponse(code = 415, message = "Unsupported Media Type.\nThe entity of the request was in a not supported format.") })

    public Response appsAppTypeIdAppIdCreateNewVersionPost(@ApiParam(value = "App Type. Either webapp or mobileapp",required=true ) @PathParam("appType") String appType,
    @ApiParam(value = "**APP ID** consisting of the **UUID** of the App.\nThe combination of the provider of the app, name of the appId and the version is also accepted as a valid App ID.\nShould be formatted as **provider-name-version**.",required=true ) @PathParam("appId") String appId,
    @ApiParam(value = "App object that needs to be added" ,required=true ) AppDTO body,
    @ApiParam(value = "Media type of the entity in the body. Default is JSON." ,required=true , defaultValue="JSON")@HeaderParam("Content-Type") String contentType,
    @ApiParam(value = "Validator for conditional requests; based on Last Modified header of the\nformerly retrieved variant of the resource."  )@HeaderParam("If-Modified-Since") String ifModifiedSince)
    {
    return delegate.appsAppTypeIdAppIdCreateNewVersionPost(appType,appId,body,contentType,ifModifiedSince);
    }
    @POST
    @Path("/{appType}/id/{appId}/discover")
    @Consumes({ "application/json" })
    @Produces({ "application/json" })
    @io.swagger.annotations.ApiOperation(value = "Discover Apps", notes = "Discover Apps.", response = Void.class)
    @io.swagger.annotations.ApiResponses(value = {
        @io.swagger.annotations.ApiResponse(code = 200, message = "OK."),

        @io.swagger.annotations.ApiResponse(code = 400, message = "Bad Request.\nInvalid request or validation error."),

        @io.swagger.annotations.ApiResponse(code = 415, message = "Unsupported Media Type.\nThe entity of the request was in a not supported format.") })

    public Response appsAppTypeIdAppIdDiscoverPost(@ApiParam(value = "App Type. Either webapp or mobileapp",required=true ) @PathParam("appType") String appType,
    @ApiParam(value = "**APP ID** consisting of the **UUID** of the App.\nThe combination of the provider of the app, name of the appId and the version is also accepted as a valid App ID.\nShould be formatted as **provider-name-version**.",required=true ) @PathParam("appId") String appId,
    @ApiParam(value = "Media type of the entity in the body. Default is JSON." ,required=true , defaultValue="JSON")@HeaderParam("Content-Type") String contentType,
    @ApiParam(value = "Validator for conditional requests; based on Last Modified header of the\nformerly retrieved variant of the resource."  )@HeaderParam("If-Modified-Since") String ifModifiedSince)
    {
    return delegate.appsAppTypeIdAppIdDiscoverPost(appType,appId,contentType,ifModifiedSince);
    }
    @GET
    @Path("/{appType}/id/{appId}/lifecycle")
    @Consumes({ "application/json" })
    @Produces({ "application/json" })
    @io.swagger.annotations.ApiOperation(value = "Get lifecycle details", notes = "Get lifecycle details of an App.", response = LifeCycleDTO.class)
    @io.swagger.annotations.ApiResponses(value = {
        @io.swagger.annotations.ApiResponse(code = 200, message = "OK.\nDetails of a lifecycle is returned."),

        @io.swagger.annotations.ApiResponse(code = 400, message = "Bad Request.\nInvalid request or validation error."),

        @io.swagger.annotations.ApiResponse(code = 403, message = "Forbidden.\nThe request must be conditional but no condition has been specified."),

        @io.swagger.annotations.ApiResponse(code = 404, message = "Not Found.\nThe resource to be updated does not exist.") })

    public Response appsAppTypeIdAppIdLifecycleGet(@ApiParam(value = "App Type. Either webapp or mobileapp",required=true ) @PathParam("appType") String appType,
    @ApiParam(value = "**APP ID** consisting of the **UUID** of the App.\nThe combination of the provider of the app, name of the appId and the version is also accepted as a valid App ID.\nShould be formatted as **provider-name-version**.",required=true ) @PathParam("appId") String appId,
    @ApiParam(value = "Media types acceptable for the response. Default is JSON."  , defaultValue="JSON")@HeaderParam("Accept") String accept,
    @ApiParam(value = "Validator for conditional requests; based on the ETag of the formerly retrieved\nvariant of the resourec."  )@HeaderParam("If-None-Match") String ifNoneMatch)
    {
    return delegate.appsAppTypeIdAppIdLifecycleGet(appType,appId,accept,ifNoneMatch);
    }
    @GET
    @Path("/{appType}/id/{appId}/lifecycle-history")
    @Consumes({ "application/json" })
    @Produces({ "application/json" })
    @io.swagger.annotations.ApiOperation(value = "Get lifecycle details", notes = "Get lifecycle details.", response = LifeCycleHistoryListDTO.class)
    @io.swagger.annotations.ApiResponses(value = {
        @io.swagger.annotations.ApiResponse(code = 200, message = "OK.\nList of qualifying Apps is returned."),

        @io.swagger.annotations.ApiResponse(code = 400, message = "Bad Request.\nInvalid request or validation error."),

        @io.swagger.annotations.ApiResponse(code = 403, message = "Forbidden.\nThe request must be conditional but no condition has been specified."),

        @io.swagger.annotations.ApiResponse(code = 404, message = "Not Found.\nThe resource to be updated does not exist.") })

    public Response appsAppTypeIdAppIdLifecycleHistoryGet(@ApiParam(value = "App Type. Either webapp or mobileapp",required=true ) @PathParam("appType") String appType,
    @ApiParam(value = "**APP ID** consisting of the **UUID** of the App.\nThe combination of the provider of the app, name of the appId and the version is also accepted as a valid App ID.\nShould be formatted as **provider-name-version**.",required=true ) @PathParam("appId") String appId,
    @ApiParam(value = "Media types acceptable for the response. Default is JSON."  , defaultValue="JSON")@HeaderParam("Accept") String accept,
    @ApiParam(value = "Validator for conditional requests; based on the ETag of the formerly retrieved\nvariant of the resourec."  )@HeaderParam("If-None-Match") String ifNoneMatch)
    {
    return delegate.appsAppTypeIdAppIdLifecycleHistoryGet(appType,appId,accept,ifNoneMatch);
    }
    @GET
    @Path("/{appType}/id/{appId}/subscriptions")
    @Consumes({ "application/json" })
    @Produces({ "application/json" })
    @io.swagger.annotations.ApiOperation(value = "Get subscribed user list for an App", notes = "Get subscribed user list for an App.", response = UserIdListDTO.class)
    @io.swagger.annotations.ApiResponses(value = {
        @io.swagger.annotations.ApiResponse(code = 200, message = "OK.\nQualifying User List is returned."),

        @io.swagger.annotations.ApiResponse(code = 400, message = "Bad Request.\nInvalid request or validation error."),

        @io.swagger.annotations.ApiResponse(code = 403, message = "Forbidden.\nThe request must be conditional but no condition has been specified."),

        @io.swagger.annotations.ApiResponse(code = 404, message = "Not Found.\nThe resource to be updated does not exist.") })

    public Response appsAppTypeIdAppIdSubscriptionsGet(@ApiParam(value = "App Type. Either webapp or mobileapp",required=true ) @PathParam("appType") String appType,
    @ApiParam(value = "**APP ID** consisting of the **UUID** of the App.\nThe combination of the provider of the app, name of the appId and the version is also accepted as a valid App ID.\nShould be formatted as **provider-name-version**.",required=true ) @PathParam("appId") String appId,
    @ApiParam(value = "Media types acceptable for the response. Default is JSON."  , defaultValue="JSON")@HeaderParam("Accept") String accept,
    @ApiParam(value = "Validator for conditional requests; based on the ETag of the formerly retrieved\nvariant of the resourec."  )@HeaderParam("If-None-Match") String ifNoneMatch,
    @ApiParam(value = "Validator for conditional requests; based on Last Modified header of the\nformerly retrieved variant of the resource."  )@HeaderParam("If-Modified-Since") String ifModifiedSince)
    {
    return delegate.appsAppTypeIdAppIdSubscriptionsGet(appType,appId,accept,ifNoneMatch,ifModifiedSince);
    }
    @GET
    @Path("/{appType}/throttlingtiers")
    @Consumes({ "application/json" })
    @Produces({ "application/json" })
    @io.swagger.annotations.ApiOperation(value = "Get all Tiers", notes = "Get a list of Tiers.", response = TierListDTO.class)
    @io.swagger.annotations.ApiResponses(value = {
        @io.swagger.annotations.ApiResponse(code = 200, message = "OK.\nList of Tiers is returned."),

        @io.swagger.annotations.ApiResponse(code = 400, message = "Bad Request.\nInvalid request or validation error."),

        @io.swagger.annotations.ApiResponse(code = 403, message = "Forbidden.\nThe request must be conditional but no condition has been specified."),

        @io.swagger.annotations.ApiResponse(code = 404, message = "Not Found.\nThe resource to be updated does not exist.") })

    public Response appsAppTypeThrottlingtiersGet(@ApiParam(value = "App Type. Either webapp or mobileapp",required=true ) @PathParam("appType") String appType,
    @ApiParam(value = "Media types acceptable for the response. Default is JSON."  , defaultValue="JSON")@HeaderParam("Accept") String accept,
    @ApiParam(value = "Validator for conditional requests; based on the ETag of the formerly retrieved\nvariant of the resourec."  )@HeaderParam("If-None-Match") String ifNoneMatch)
    {
    return delegate.appsAppTypeThrottlingtiersGet(appType, accept, ifNoneMatch);
    }
    @POST
    @Path("/{appType}/validate-context")
    @Consumes({ "application/json" })
    @Produces({ "application/json" })
    @io.swagger.annotations.ApiOperation(value = "Validate App Context", notes = "Validate App Context.", response = Void.class)
    @io.swagger.annotations.ApiResponses(value = {
        @io.swagger.annotations.ApiResponse(code = 200, message = "OK."),

        @io.swagger.annotations.ApiResponse(code = 400, message = "Bad Request.\nInvalid request or validation error."),

        @io.swagger.annotations.ApiResponse(code = 415, message = "Unsupported Media Type.\nThe entity of the request was in a not supported format.") })

    public Response appsAppTypeValidateContextPost(@ApiParam(value = "App Type. Either webapp or mobileapp",required=true ) @PathParam("appType") String appType,
    @ApiParam(value = "Application Context",required=true) @QueryParam("appContext") String appContext,
    @ApiParam(value = "Media type of the entity in the body. Default is JSON." ,required=true , defaultValue="JSON")@HeaderParam("Content-Type") String contentType,
    @ApiParam(value = "Validator for conditional requests; based on Last Modified header of the\nformerly retrieved variant of the resource."  )@HeaderParam("If-Modified-Since") String ifModifiedSince)
    {
    return delegate.appsAppTypeValidateContextPost(appType,appContext,contentType,ifModifiedSince);
    }
    @GET
    @Path("/{appType}/name/{appName}/version/{version}/uuid")
    @Consumes({ "application/json" })
    @Produces({ "application/json" })
    @io.swagger.annotations.ApiOperation(value = "Get app UUID", notes = "Get app UUId by name and version  ", response = AppDTO.class, tags={ "Apps", })
    @io.swagger.annotations.ApiResponses(value = {
            @io.swagger.annotations.ApiResponse(code = 200, message = "OK. List of uuids is returned. ", response = AppDTO.class),

            @io.swagger.annotations.ApiResponse(code = 400, message = "Bad Request. Invalid request or validation error. ", response = AppDTO.class),

            @io.swagger.annotations.ApiResponse(code = 403, message = "Forbidden. The request must be conditional but no condition has been specified. ", response = AppDTO.class),

            @io.swagger.annotations.ApiResponse(code = 404, message = "Not Found. The resource to be updated does not exist. ", response = AppDTO.class) })
    public Response appsAppTypeNameAppNameVersionVersionUuidGet(@ApiParam(value = "The App type (either Webapp/Mobile app). ",required=true) @PathParam("appType") String appType
            ,@ApiParam(value = "The App appName. ",required=true) @PathParam("appName") String appName
            ,@ApiParam(value = "The App version. ",required=true) @PathParam("version") String version
            ,@ApiParam(value = "Media types acceptable for the response. Default is JSON. " , defaultValue="JSON")@HeaderParam("Accept") String accept
            ,@ApiParam(value = "Validator for conditional requests; based on the ETag of the formerly retrieved variant of the resource. " )@HeaderParam("If-None-Match") String ifNoneMatch){
        return delegate.appsAppTypeNameAppNameVersionVersionUuidGet(appType,appName,version,accept,ifNoneMatch);
    }
}


text:
title: A Published Post
status: published
---

This is a published post.

redpajama_set_name: RedPajamaGithub


text:
CREATE TABLE [dbo].[man_mta_transaction](
	[mta_msg_id] [uniqueidentifier] NOT NULL,
	[ip_ipAddress_id] [int] NULL,
	[mta_transaction_timestamp] [datetime] NOT NULL,
	[mta_transactionStatus_id] [int] NOT NULL,
	[mta_transaction_serverResponse] [nvarchar](max) COLLATE Latin1_General_CI_AS NOT NULL,
	[mta_transaction_serverHostname] [nvarchar](max) COLLATE Latin1_General_CI_AS NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

GO

CREATE CLUSTERED INDEX [IX_man_mta_transaction] ON [dbo].[man_mta_transaction]
(
	[mta_msg_id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO

CREATE NONCLUSTERED INDEX [Status] ON [dbo].[man_mta_transaction]
(
	[mta_msg_id] ASC,
	[mta_transactionStatus_id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO

CREATE NONCLUSTERED INDEX [Timestamp] ON [dbo].[man_mta_transaction]
(
	[mta_transaction_timestamp] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO


text:
<?php

namespace Google\Service\Directory;

class Role extends \Google\Collection
{
  protected $collection_key = 'rolePrivileges';
  /**
   * @var string
   */
  public $etag;
  /**
   * @var bool
   */
  public $isSuperAdminRole;
  /**
   * @var bool
   */
  public $isSystemRole;
  /**
   * @var string
   */
  public $kind;
  /**
   * @var string
   */
  public $roleDescription;
  /**
   * @var string
   */
  public $roleId;
  /**
   * @var string
   */
  public $roleName;
  protected $rolePrivilegesType = RoleRolePrivileges::class;
  protected $rolePrivilegesDataType = 'array';

  /**
   * @param string
   */
  public function setEtag($etag)
  {
    $this->etag = $etag;
  }
  /**
   * @return string
   */
  public function getEtag()
  {
    return $this->etag;
  }
  /**
   * @param bool
   */
  public function setIsSuperAdminRole($isSuperAdminRole)
  {
    $this->isSuperAdminRole = $isSuperAdminRole;
  }
  /**
   * @return bool
   */
  public function getIsSuperAdminRole()
  {
    return $this->isSuperAdminRole;
  }
  /**
   * @param bool
   */
  public function setIsSystemRole($isSystemRole)
  {
    $this->isSystemRole = $isSystemRole;
  }
  /**
   * @return bool
   */
  public function getIsSystemRole()
  {
    return $this->isSystemRole;
  }
  /**
   * @param string
   */
  public function setKind($kind)
  {
    $this->kind = $kind;
  }
  /**
   * @return string
   */
  public function getKind()
  {
    return $this->kind;
  }
  /**
   * @param string
   */
  public function setRoleDescription($roleDescription)
  {
    $this->roleDescription = $roleDescription;
  }
  /**
   * @return string
   */
  public function getRoleDescription()
  {
    return $this->roleDescription;
  }
  /**
   * @param string
   */
  public function setRoleId($roleId)
  {
    $this->roleId = $roleId;
  }
  /**
   * @return string
   */
  public function getRoleId()
  {
    return $this->roleId;
  }
  /**
   * @param string
   */
  public function setRoleName($roleName)
  {
    $this->roleName = $roleName;
  }
  /**
   * @return string
   */
  public function getRoleName()
  {
    return $this->roleName;
  }
  /**
   * @param RoleRolePrivileges[]
   */
  public function setRolePrivileges($rolePrivileges)
  {
    $this->rolePrivileges = $rolePrivileges;
  }
  /**
   * @return RoleRolePrivileges[]
   */
  public function getRolePrivileges()
  {
    return $this->rolePrivileges;
  }
}

// Adding a class alias for backwards compatibility with the previous class name.
class_alias(Role::class, 'Google_Service_Directory_Role');


text:
package org.apache.sysds.runtime.instructions.spark.data;

import java.lang.ref.SoftReference;

import org.apache.spark.broadcast.Broadcast;
import org.apache.sysds.runtime.controlprogram.caching.CacheBlock;

public class BroadcastObject<T extends CacheBlock> extends LineageObject {
	//soft reference storage for graceful cleanup in case of memory pressure
	private SoftReference<PartitionedBroadcast<T>> _pbcRef; // partitioned broadcast object reference
	private SoftReference<Broadcast<T>> _npbcRef; // non partitioned broadcast object reference

	private long _pbcSize; // partitioned broadcast size
	private long _npbcSize; // non-partitioned broadcast size

	public BroadcastObject() {
		super();
	}

	public void setNonPartitionedBroadcast(Broadcast<T> bvar, long size) {
		_npbcRef = new SoftReference<>(bvar);
		_npbcSize = size;
		_pbcSize = -1;
	}

	public void setPartitionedBroadcast(PartitionedBroadcast<T> bvar, long size) {
		_pbcRef = new SoftReference<>(bvar);
		_pbcSize = size;
		_npbcSize = -1;
	}

	@SuppressWarnings("rawtypes")
	public PartitionedBroadcast getPartitionedBroadcast() {
		return _pbcRef.get();
	}

	public Broadcast<T> getNonPartitionedBroadcast() {
		return _npbcRef.get();
	}

	public long getSize() {
		return Math.max(_pbcSize, _npbcSize);
	}

	public boolean isPartitionedBroadcastValid() {
		return _pbcRef != null && checkPartitionedBroadcastValid();
	}

	public boolean isNonPartitionedBroadcastValid() {
		return _npbcRef != null && checkNonPartitionedBroadcastValid();
	}

	private boolean checkNonPartitionedBroadcastValid() {
		return _npbcRef.get() != null;
	}

	private boolean checkPartitionedBroadcastValid() {
		//check for evicted soft reference
		PartitionedBroadcast<T> pbm = _pbcRef.get();
		if (pbm == null)
			return false;

		//check for validity of individual broadcasts
		Broadcast<PartitionedBlock<T>>[] tmp = pbm.getBroadcasts();
		for (Broadcast<PartitionedBlock<T>> bc : tmp)
			if (!bc.isValid())
				return false;
		return true;
	}
}


text:
using System.Collections.Generic;
using System.Linq;
using Mono.Cecil;
using Mono.Cecil.Cil;

namespace Stratis.SmartContracts.CLR.Validation
{
    /// <summary>
    /// Validator for a <see cref="TypeDefinition"/> using a given <see cref="ValidationPolicy"/>
    /// </summary>
    public class TypePolicyValidator : ITypeDefinitionValidator
    {
        private readonly ValidationPolicy policy;

        public TypePolicyValidator(ValidationPolicy policy)
        {
            this.policy = policy;
        }

        public IEnumerable<ValidationResult> Validate(TypeDefinition type)
        {
            var results = new List<ValidationResult>();

            this.ValidateTypeDef(results, type);
            this.ValidateNestedTypes(results, type);
            this.ValidateFields(results, type);
            this.ValidateMethods(results, type);

            return results;
        }

        /// <summary>
        /// Validates the methods within a <see cref="TypeDefinition"/>
        /// </summary>
        private void ValidateMethods(List<ValidationResult> results, TypeDefinition type)
        {
            foreach (MethodDefinition method in type.Methods)
            {
                if (!method.HasBody)
                    return;

                if (method.Body.Instructions.Count == 0)
                    return;

                this.ValidateParameters(results, type, method);

                foreach (var validator in this.policy.MethodDefValidators)
                {
                    results.AddRange(validator.Validate(method));
                }

                this.ValidateInstructions(results, type, method);
            }
        }

        /// <summary>
        /// Validates the parameters within a <see cref="MethodDefinition"/>
        /// </summary>
        private void ValidateParameters(List<ValidationResult> results, TypeDefinition type, MethodDefinition method)
        {
            if (!this.policy.ParameterValidators.Any())
                return;

            foreach (var parameter in method.Parameters)
            {
                foreach (var validator in this.policy.ParameterValidators)
                {
                    results.AddRange(validator.Validate(parameter));
                }
            }
        }

        /// <summary>
        /// Validates instructions in a <see cref="MethodDefinition"/>
        /// </summary>
        private void ValidateInstructions(List<ValidationResult> results, TypeDefinition type, MethodDefinition method)
        {
            if (!this.policy.InstructionValidators.Any() && !this.policy.MemberRefValidators.Any())
                return;

            foreach (Instruction instruction in method.Body.Instructions)
            {
                foreach (var validator in this.policy.InstructionValidators)
                {
                    results.AddRange(validator.Validate(instruction, method));

                    this.ValidateMemberReferences(results, type, method, instruction);
                }
            }
        }

        /// <summary>
        /// Validate Types referred to by instructions that are member references
        /// </summary>
        private void ValidateMemberReferences(
            List<ValidationResult> results,
            TypeDefinition type,
            MethodDefinition method,
            Instruction instruction)
        {
            if (!this.policy.MemberRefValidators.Any())
                return;

            if (!(instruction.Operand is MemberReference reference))
                return;

            foreach (var validator in this.policy.MemberRefValidators)
            {
                results.AddRange(validator.Validate(reference));
            }
        }

        /// <summary>
        /// Recursively validates nested Types
        /// </summary>
        private void ValidateNestedTypes(List<ValidationResult> results, TypeDefinition type)
        {
            foreach (TypeDefinition nestedType in type.NestedTypes)
            {
                results.AddRange(Validate(nestedType));
            }
        }

        /// <summary>
        /// Validates a type definition's fields
        /// </summary>
        private void ValidateFields(List<ValidationResult> results, TypeDefinition type)
        {
            if (!this.policy.FieldDefValidators.Any())
                return;

            foreach (var field in type.Fields)
            {
                foreach (var validator in this.policy.FieldDefValidators)
                {
                    results.AddRange(validator.Validate(field));
                }
            }
        }

        /// <summary>
        /// Validate the type def using TypeDefinition validators
        /// </summary>
        private void ValidateTypeDef(List<ValidationResult> results, TypeDefinition type)
        {
            if (!this.policy.TypeDefValidators.Any())
                return;

            foreach (var (validator, shouldValidateTypeFilter) in this.policy.TypeDefValidators)
            {
                if (shouldValidateTypeFilter(type))
                {
                    results.AddRange(validator.Validate(type));
                }
            }
        }
    }
}


text:
package filodb.coordinator

import com.typesafe.config.Config
import com.typesafe.scalalogging.StrictLogging
import kamon.{MetricReporter, SpanReporter}
import kamon.metric._
import kamon.metric.MeasurementUnit.{information, time}
import kamon.metric.MeasurementUnit.Dimension.{Information, Time}
import kamon.trace.Span
import kamon.util.Clock

class KamonMetricsLogReporter extends MetricReporter with StrictLogging {
  override def start(): Unit = {
    logger.info("Started KamonMetricsLogReporter successfully")
  }

  override def stop(): Unit = {}

  override def reconfigure(config: Config): Unit = {}

  override def reportPeriodSnapshot(snapshot: PeriodSnapshot): Unit = {
    logMetricValues(snapshot.metrics.counters, "counter")
    logMetricValues(snapshot.metrics.gauges, "gauge")
    logMetricDistribution(snapshot.metrics.histograms, "histograms")
    logMetricDistribution(snapshot.metrics.rangeSamplers, "rangeSamplers")
  }

  private def logMetricValues(metrics: Seq[MetricValue], metricType: String): Unit = {
    for { c <- metrics } {
      val name = normalizeMetricName(c.name, c.unit)
      val value = scale(c.value, c.unit)
      logger.info(s"KAMON ${metricType} name=${name} ${formatTags(c.tags)} value=$value")
    }
  }

  private def logMetricDistribution(metrics: Seq[MetricDistribution], metricType: String): Unit = {
    for { m <- metrics } {
      val name = normalizeMetricName(m.name, m.unit)
      val h = m.distribution
      def percentile(percentile: Double) = scale(h.percentile(25.0D).value, m.unit)
      logger.info(s"KAMON ${metricType} name=$name ${formatTags(m.tags)} " +
        s"n=${h.count} min=${scale(h.min, m.unit)} " +
        s"p50=${percentile(50.0D)} p90=${percentile(90.0D)} " +
        s"p95=${percentile(95.0D)} p99=${percentile(99.0D)} " +
        s"p999=${percentile(99.9D)} max=${scale(h.max, m.unit)}")
    }
  }

  private def formatTags(tags: Map[String, String]) = tags.view.map { case (k, v) => s"$k=$v" }.mkString(" ")

  private def normalizeLabelName(label: String): String =
    label.map(charOrUnderscore)

  private def charOrUnderscore(char: Char): Char =
    if (char.isLetterOrDigit || char == '_') char else '_'

  private def normalizeMetricName(metricName: String, unit: MeasurementUnit): String = {
    val normalizedMetricName = metricName.map(charOrUnderscore)
    unit.dimension match  {
      case Time         => normalizedMetricName + "_seconds"
      case Information  => normalizedMetricName + "_bytes"
      case _            => normalizedMetricName
    }
  }

  private def scale(value: Long, unit: MeasurementUnit): Double = unit.dimension match {
    case Time if unit.magnitude != time.seconds.magnitude =>
      MeasurementUnit.scale(value, unit, time.seconds)
    case Information  if unit.magnitude != information.bytes.magnitude  =>
      MeasurementUnit.scale(value, unit, information.bytes)
    case _ => value
  }

}

class KamonSpanLogReporter extends SpanReporter with StrictLogging {

  override def reportSpans(spans: Seq[Span.FinishedSpan]): Unit = {
    spans.groupBy(_.operationName).foreach { case (name, spans) =>
      val durations = spans.map { s => Math.floorDiv(Clock.nanosBetween(s.from, s.to), 1000) }
      logger.info(s"KAMON-TRACE name $name min=${durations.min} max=${durations.max} " +
        s"avg=${durations.sum.toFloat / durations.size}")
    }
  }

  override def start(): Unit = {
    logger.info("Started KamonSpanLogReporter successfully")
  }

  override def stop(): Unit = {}

  override def reconfigure(config: Config): Unit = {}
}


text:
import { IScope } from './Scope';
import enforce from '../util/enforce';
import * as helpers from '../util/helpers';
import * as _ from 'underscore';

export class ModuleRepository {
    static lookup: {[name: string]: Module} = {};

    static addModule(name: string): ModuleBuilder {
        const module = new Module();

        ModuleRepository.lookup[name] = module;

        return new ModuleBuilder(module);
    }
}

export type Injector = ($scope: IScope) => any;
export type InjectorLookup = {[name: string]: Injector};
export type FunctionLookup = {[name: string]: Function};

export class Module {
    private injectors: InjectorLookup = {};
    private functions: FunctionLookup = {};

    getInjectors(): InjectorLookup {
        return this.injectors;
    }

    addInjector(name: string, injector: Injector) {
        enforce(name, 'name').isNotNull().isString();
        enforce(injector, 'injector').isNotNull().isFunction();

        this.injectors[name] = injector;
    }

    getFunctions(): FunctionLookup {
        return this.functions;
    }

    addFunction(name: string, func: Function) {
        enforce(name, 'name').isNotNull().isString();
        enforce(func, 'func').isNotNull().isFunction();

        this.functions[name] = func;
    }
}

export class ModuleBuilder {
    constructor(private module: Module) {
    }

    function(name: string, func: Function | any[]): ModuleBuilder {
        const f = new ModuleFunction(name, func);
        this.module.addFunction(name, f.declaration);

        return this;
    }

    injector(name: string, func: ($scope: IScope) => void): ModuleBuilder {
        this.module.addInjector(name, func);

        return this;
    }

    export(): Object {
        return this.module;
    }

    //Deprecated, added for backward compatibility
    asExport(): Object {
        return this.export();
    }
}

const AliasListKey = '__alias';
const DeferredListKey = '__deferEval';
const DeferredPrefix = '$deferred.';
class ModuleFunction {

    declaration: Function;

    constructor(
        public name: string,
        declaration: Function | any[]) {
        enforce(name, 'name')
            .isNotNull()
            .isString();
        enforce(declaration, 'declaration').isNotNull();

        const actualParams = helpers.getParameters(declaration);
        let funcArray: any[];
        if (_.isFunction(declaration)) {
            funcArray = actualParams;
        }
        else if (_.isArray(declaration)) {
            //Function declaration is ['parameter1', 'parameter2', ..., Function]
            enforce(declaration).isNotEmpty();
            funcArray = <any[]>declaration;
            declaration = funcArray.pop();
            enforce(declaration).isFunction('Final parameter in array must be a function');

            if (actualParams.length != funcArray.length) {
                throw new Error(`Parameter count mismatch between parameter and function declarations. Expected ${actualParams.length}, got ${funcArray.length}`);
            }
        }
        else {
            throw new Error(`Expected '${declaration}' to be a function or an array`);
        }

        this.declaration = <Function>declaration;

        this.declaration[DeferredListKey] = [];
        this.declaration[AliasListKey] = {};

        for (let i = 0; i < funcArray.length; i++) {
            let alias = <string>funcArray[i];
            const actual = actualParams[i];

            if (alias.startsWith(DeferredPrefix)) {
                alias = alias.substring(DeferredPrefix.length);
                this.declaration[DeferredListKey].push(alias);
            }

            this.declaration[AliasListKey][actual] = alias;
        }
    }

}


text:
namespace RRLab.PhysiologyWorkbench.Devices
{
    partial class FilterWheelDeviceCompactControl
    {
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Component Designer generated code

        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
            this.label1 = new System.Windows.Forms.Label();
            this.label2 = new System.Windows.Forms.Label();
            this.label3 = new System.Windows.Forms.Label();
            this.FiltersComboBox = new System.Windows.Forms.ComboBox();
            this.ShutterAComboBox = new System.Windows.Forms.ComboBox();
            this.ShutterBComboBox = new System.Windows.Forms.ComboBox();
            this.SelectFilterButton = new System.Windows.Forms.Button();
            this.SetShutterAButton = new System.Windows.Forms.Button();
            this.SetShutterBButton = new System.Windows.Forms.Button();
            this.tableLayoutPanel1.SuspendLayout();
            this.SuspendLayout();
            //
            // tableLayoutPanel1
            //
            this.tableLayoutPanel1.AutoSize = true;
            this.tableLayoutPanel1.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
            this.tableLayoutPanel1.ColumnCount = 3;
            this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
            this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
            this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
            this.tableLayoutPanel1.Controls.Add(this.SetShutterBButton, 2, 2);
            this.tableLayoutPanel1.Controls.Add(this.SetShutterAButton, 2, 1);
            this.tableLayoutPanel1.Controls.Add(this.ShutterBComboBox, 1, 2);
            this.tableLayoutPanel1.Controls.Add(this.ShutterAComboBox, 1, 1);
            this.tableLayoutPanel1.Controls.Add(this.label3, 0, 2);
            this.tableLayoutPanel1.Controls.Add(this.label2, 0, 1);
            this.tableLayoutPanel1.Controls.Add(this.label1, 0, 0);
            this.tableLayoutPanel1.Controls.Add(this.FiltersComboBox, 1, 0);
            this.tableLayoutPanel1.Controls.Add(this.SelectFilterButton, 2, 0);
            this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
            this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0);
            this.tableLayoutPanel1.Name = "tableLayoutPanel1";
            this.tableLayoutPanel1.RowCount = 3;
            this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
            this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
            this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
            this.tableLayoutPanel1.Size = new System.Drawing.Size(231, 87);
            this.tableLayoutPanel1.TabIndex = 0;
            //
            // label1
            //
            this.label1.AutoSize = true;
            this.label1.Dock = System.Windows.Forms.DockStyle.Fill;
            this.label1.Location = new System.Drawing.Point(3, 0);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(54, 29);
            this.label1.TabIndex = 0;
            this.label1.Text = "Filter:";
            this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
            //
            // label2
            //
            this.label2.AutoSize = true;
            this.label2.Dock = System.Windows.Forms.DockStyle.Fill;
            this.label2.Location = new System.Drawing.Point(3, 29);
            this.label2.Name = "label2";
            this.label2.Size = new System.Drawing.Size(54, 29);
            this.label2.TabIndex = 1;
            this.label2.Text = "Shutter A:";
            this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
            //
            // label3
            //
            this.label3.AutoSize = true;
            this.label3.Dock = System.Windows.Forms.DockStyle.Fill;
            this.label3.Location = new System.Drawing.Point(3, 58);
            this.label3.Name = "label3";
            this.label3.Size = new System.Drawing.Size(54, 29);
            this.label3.TabIndex = 2;
            this.label3.Text = "Shutter B:";
            this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
            //
            // FiltersComboBox
            //
            this.FiltersComboBox.Dock = System.Windows.Forms.DockStyle.Fill;
            this.FiltersComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
            this.FiltersComboBox.FormattingEnabled = true;
            this.FiltersComboBox.Location = new System.Drawing.Point(63, 3);
            this.FiltersComboBox.Name = "FiltersComboBox";
            this.FiltersComboBox.Size = new System.Drawing.Size(112, 21);
            this.FiltersComboBox.TabIndex = 3;
            //
            // ShutterAComboBox
            //
            this.ShutterAComboBox.Dock = System.Windows.Forms.DockStyle.Fill;
            this.ShutterAComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
            this.ShutterAComboBox.FormattingEnabled = true;
            this.ShutterAComboBox.Items.AddRange(new object[] {
            "Closed",
            "Conditional Open",
            "Open"});
            this.ShutterAComboBox.Location = new System.Drawing.Point(63, 32);
            this.ShutterAComboBox.Name = "ShutterAComboBox";
            this.ShutterAComboBox.Size = new System.Drawing.Size(112, 21);
            this.ShutterAComboBox.TabIndex = 4;
            //
            // ShutterBComboBox
            //
            this.ShutterBComboBox.Dock = System.Windows.Forms.DockStyle.Fill;
            this.ShutterBComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
            this.ShutterBComboBox.FormattingEnabled = true;
            this.ShutterBComboBox.Items.AddRange(new object[] {
            "Closed",
            "Conditional Open",
            "Open"});
            this.ShutterBComboBox.Location = new System.Drawing.Point(63, 61);
            this.ShutterBComboBox.Name = "ShutterBComboBox";
            this.ShutterBComboBox.Size = new System.Drawing.Size(112, 21);
            this.ShutterBComboBox.TabIndex = 5;
            //
            // SelectFilterButton
            //
            this.SelectFilterButton.AutoSize = true;
            this.SelectFilterButton.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
            this.SelectFilterButton.Dock = System.Windows.Forms.DockStyle.Fill;
            this.SelectFilterButton.Location = new System.Drawing.Point(181, 3);
            this.SelectFilterButton.Name = "SelectFilterButton";
            this.SelectFilterButton.Size = new System.Drawing.Size(47, 23);
            this.SelectFilterButton.TabIndex = 6;
            this.SelectFilterButton.Text = "Select";
            this.SelectFilterButton.UseVisualStyleBackColor = true;
            this.SelectFilterButton.Click += new System.EventHandler(this.SelectFilterButton_Click);
            //
            // SetShutterAButton
            //
            this.SetShutterAButton.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
            this.SetShutterAButton.Dock = System.Windows.Forms.DockStyle.Fill;
            this.SetShutterAButton.Location = new System.Drawing.Point(181, 32);
            this.SetShutterAButton.Name = "SetShutterAButton";
            this.SetShutterAButton.Size = new System.Drawing.Size(47, 23);
            this.SetShutterAButton.TabIndex = 7;
            this.SetShutterAButton.Text = "Set";
            this.SetShutterAButton.UseVisualStyleBackColor = true;
            this.SetShutterAButton.Click += new System.EventHandler(this.SetShutterAButton_Click);
            //
            // SetShutterBButton
            //
            this.SetShutterBButton.AutoSize = true;
            this.SetShutterBButton.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
            this.SetShutterBButton.Dock = System.Windows.Forms.DockStyle.Fill;
            this.SetShutterBButton.Location = new System.Drawing.Point(181, 61);
            this.SetShutterBButton.Name = "SetShutterBButton";
            this.SetShutterBButton.Size = new System.Drawing.Size(47, 23);
            this.SetShutterBButton.TabIndex = 8;
            this.SetShutterBButton.Text = "Set";
            this.SetShutterBButton.UseVisualStyleBackColor = true;
            this.SetShutterBButton.Click += new System.EventHandler(this.SetShutterBButton_Click);
            //
            // FilterWheelDeviceManualControl
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.Controls.Add(this.tableLayoutPanel1);
            this.Name = "FilterWheelDeviceManualControl";
            this.Size = new System.Drawing.Size(231, 87);
            this.tableLayoutPanel1.ResumeLayout(false);
            this.tableLayoutPanel1.PerformLayout();
            this.ResumeLayout(false);
            this.PerformLayout();

        }

        #endregion

        private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
        private System.Windows.Forms.ComboBox ShutterBComboBox;
        private System.Windows.Forms.ComboBox ShutterAComboBox;
        private System.Windows.Forms.Label label3;
        private System.Windows.Forms.Label label2;
        private System.Windows.Forms.Label label1;
        private System.Windows.Forms.ComboBox FiltersComboBox;
        private System.Windows.Forms.Button SetShutterBButton;
        private System.Windows.Forms.Button SetShutterAButton;
        private System.Windows.Forms.Button SelectFilterButton;
    }
}


text:
START_ATF_NAMESPACE
    #pragma pack(push, 8)
    struct _INTERNET_CACHE_ENTRY_INFOA
    {
        unsigned int dwStructSize;
        char *lpszSourceUrlName;
        char *lpszLocalFileName;
        unsigned int CacheEntryType;
        unsigned int dwUseCount;
        unsigned int dwHitRate;
        unsigned int dwSizeLow;
        unsigned int dwSizeHigh;
        _FILETIME LastModifiedTime;
        _FILETIME ExpireTime;
        _FILETIME LastAccessTime;
        _FILETIME LastSyncTime;
        char *lpHeaderInfo;
        unsigned int dwHeaderInfoSize;
        char *lpszFileExtension;
        $381360F90D54CFC6495AFF241C0D4B8E ___u15;
    };
    #pragma pack(pop)
END_ATF_NAMESPACE


text:
// Template Source: BaseEntityCollectionPage.java.tt
// ------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation.  All Rights Reserved.  Licensed under the MIT License.  See License in the project root for license information.
// ------------------------------------------------------------------------------

package com.microsoft.graph.security.requests;
import com.microsoft.graph.security.models.EdiscoveryNoncustodialDataSource;
import com.microsoft.graph.security.requests.EdiscoveryNoncustodialDataSourceCollectionRequestBuilder;
import javax.annotation.Nullable;
import javax.annotation.Nonnull;
import com.microsoft.graph.security.requests.EdiscoveryNoncustodialDataSourceCollectionResponse;
import com.microsoft.graph.http.BaseCollectionPage;

// **NOTE** This file was generated by a tool and any changes will be overwritten.

/**
 * The class for the Ediscovery Noncustodial Data Source Collection Page.
 */
public class EdiscoveryNoncustodialDataSourceCollectionPage extends BaseCollectionPage<EdiscoveryNoncustodialDataSource, EdiscoveryNoncustodialDataSourceCollectionRequestBuilder> {

    /**
     * A collection page for EdiscoveryNoncustodialDataSource
     *
     * @param response the serialized EdiscoveryNoncustodialDataSourceCollectionResponse from the service
     * @param builder  the request builder for the next collection page
     */
    public EdiscoveryNoncustodialDataSourceCollectionPage(@Nonnull final EdiscoveryNoncustodialDataSourceCollectionResponse response, @Nonnull final EdiscoveryNoncustodialDataSourceCollectionRequestBuilder builder) {
        super(response, builder);
    }

    /**
     * Creates the collection page for EdiscoveryNoncustodialDataSource
     *
     * @param pageContents       the contents of this page
     * @param nextRequestBuilder the request builder for the next page
     */
    public EdiscoveryNoncustodialDataSourceCollectionPage(@Nonnull final java.util.List<EdiscoveryNoncustodialDataSource> pageContents, @Nullable final EdiscoveryNoncustodialDataSourceCollectionRequestBuilder nextRequestBuilder) {
        super(pageContents, nextRequestBuilder);
    }
}


text:
#region Licence

#endregion

using System;
using System.Collections.Generic;

namespace WmcSoft.Text
{
    public sealed class Tokenizer : ITokenizer<string, string>
    {
        private readonly Predicate<char> _isSeparator;
        private readonly bool _keepEmptyToken;

        public Tokenizer(StringSplitOptions options, params char[] separators)
        {
            _keepEmptyToken = options == StringSplitOptions.None;
            if (separators == null || separators.Length == 0) {
                _isSeparator = c => c == ' ';
            } else if (separators.Length == 1) {
                var separator = separators[0];
                _isSeparator = c => c == separator;
            } else {
                Array.Sort(separators);
                _isSeparator = c => c.BinaryAny(separators);
            }
        }

        public Tokenizer(params char[] separators)
            : this(StringSplitOptions.RemoveEmptyEntries, separators)
        {
        }

        public Tokenizer(StringSplitOptions options, Predicate<char> isSeparator)
        {
            _keepEmptyToken = options == StringSplitOptions.None;
            _isSeparator = isSeparator;
        }

        public Tokenizer(Predicate<char> isSeparator)
            : this(StringSplitOptions.RemoveEmptyEntries, isSeparator)
        {
        }

        public IEnumerable<string> Tokenize(string value)
        {
            var start = 0;
            var length = 0;
            if (_keepEmptyToken) {
                foreach (var c in value) {
                    if (_isSeparator(c)) {
                        yield return value.Substring(start, length);
                        start += length + 1;
                        length = 0;
                    } else {
                        length++;
                    }
                }
                yield return value.Substring(start, length);
            } else {
                foreach (var c in value) {
                    if (_isSeparator(c)) {
                        if (length > 0)
                            yield return value.Substring(start, length);
                        start += length + 1;
                        length = 0;
                    } else {
                        length++;
                    }
                }
                if (length > 0)
                    yield return value.Substring(start, length);
            }
        }
    }
}


text:
<!doctype html>

    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Template Foundation - Terms</title>
    <link rel="icon" type="image/png" href="images/favicon.png" />
    <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/foundation/6.1.2/foundation.min.css" />
    <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/foundicons/3.0.0/foundation-icons.min.css" />
    <link rel="stylesheet" href="styles/outline.css" />

Sign In

Sign Up

Terms

            By using this site, you agree that we own all your data and can do whatever we want with it.

Follow Us:

Terms

Privacy

©9999 Company


text:
package org.ambraproject.wombat.config.site;

import com.google.common.base.Preconditions;
import com.google.common.collect.HashBasedTable;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableTable;
import com.google.common.collect.Iterables;
import com.google.common.collect.Table;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.HashMap;
import java.util.Map;
import java.util.Optional;
import java.util.function.UnaryOperator;

/**
 * A global bean that looks up patterns that have been mapped to request handlers. Ordinarily those patterns are set up
 * as part of Spring configuration; we want to capture those patterns in order to use them later, for building links.
 *

 * This bean has two roles: intercepting the patterns before they get passed to Spring config (which, as far as we know,
 * doesn't have any built-in way to extract them later), and looking them up later. It would be nice if we could have
 * one bean to do the first job, which produces another, immutable bean to do the second job when it's done.
 * Unfortunately, we're not aware of a Spring hook that allows us to set up a separate bean only after all request
 * handlers have been mapped. For the next-best thing, we statefully freeze this object the first time it is read and
 * throw an {@code IllegalStateException} rather than allow any further writes, making it effectively immutable.
 *

 * This class is intended to be thread-safe. Writes are synchronized, and the object is immutable while being read.
 */
public class RequestMappingContextDictionary {
  private static final Logger log = LoggerFactory.getLogger(RequestMappingContextDictionary.class);

  // While false, this object is in a state to accept writes. Permanently set to true on first call to getPattern.
  private boolean isFrozen = false;

  private final Object writeLock = new Object();

  private final Table<String, Site, RequestMappingContext> siteTableBuilder;
  private final Map<String, RequestMappingContext> globalTableBuilder;

  // By convention, assign to each of these fields only once, when isFrozen is set to true.
  private ImmutableTable<String, Site, RequestMappingContext> siteTable = null;
  private ImmutableMap<String, RequestMappingContext> globalTable = null;

  public RequestMappingContextDictionary() {
    siteTableBuilder = HashBasedTable.create();
    globalTableBuilder = new HashMap<>();
  }

  private static String getHandlerName(RequestMappingContext mapping) {
    return Preconditions.checkNotNull(mapping.getAnnotation().name());
  }

  /**
   * Store a registered mapping and check whether there is a key collision.
   *
   * @param mapping           a mapping to be registered
   * @param insertionFunction a function that stores the mapping object in this object at a particular key and returns
   *                          the mapping that was previously at the same key, or {@code null} if none
   * @throws IllegalStateException if {@link #getPattern} has been called once or more on this object
   * @throws RuntimeException      if the key that {@code insertionFunction} uses has a collision
   */
  private void insertMapping(RequestMappingContext mapping,
                             UnaryOperator<RequestMappingContext> insertionFunction) {
    synchronized (writeLock) {
      if (isFrozen) {
        throw new IllegalStateException("Cannot register more methods after directory has been read");
      }

      RequestMappingContext previous = insertionFunction.apply(mapping);

      if (previous != null) {
        if (previous.equals(mapping)) {
          log.debug("Registered redundant mapping: {}", getHandlerName(mapping));
        } else {
          throw new RuntimeException("Key collision for mappings: " + getHandlerName(mapping));
        }
      }
    }
  }

  /**
   * Register the pattern that is associated with a handler on a particular site.
   *

   * All registrations must be completed before the first call to {@link #getPattern}.
   *
   * @param mapping the mapping to the handler
   * @param site    the site associated with the handler
   * @throws IllegalStateException if {@link #getPattern} has been called once or more on this object
   */
  public void registerSiteMapping(RequestMappingContext mapping, Site site) {
    Preconditions.checkNotNull(site);
    Preconditions.checkArgument(!mapping.isSiteless());
    String handlerName = getHandlerName(mapping);

    insertMapping(mapping, m -> siteTableBuilder.put(handlerName, site, m));
  }

  /**
   * Register the pattern that is associated with a siteless handler.
   *

   * All registrations must be completed before the first call to {@link #getPattern}.
   *
   * @param mapping the mapping to the handler
   * @throws IllegalStateException if {@link #getPattern} has been called once or more on this object
   */
  public void registerGlobalMapping(RequestMappingContext mapping) {
    Preconditions.checkArgument(mapping.isSiteless());
    String handlerName = getHandlerName(mapping);

    insertMapping(mapping, m -> globalTableBuilder.put(handlerName, m));
  }

  private void buildAndFreeze() {
    /*
     * We permit a harmless race condition on the `if (!isFrozen)` block: if the first two calls to this method happen
     * concurrently, we might copy the builders more than once. This is safe because they will contain identical data.
     */
    if (!isFrozen) {
      synchronized (writeLock) {
        siteTable = ImmutableTable.copyOf(siteTableBuilder);
        globalTable = ImmutableMap.copyOf(globalTableBuilder);
        isFrozen = true;
      }
    }
  }

  /**
   * Look up a registered pattern.
   *

   * This method should only be called when all registrations are complete. The first time this method is called for
   * this object, it has the side effect of freezing the object and invalidating any future calls to {@link
   * #registerSiteMapping} and {@link #registerGlobalMapping}.
   *
   * @param handlerName the name of the handler
   * @param site        the site associated with the request to map. Use null here in the case of a siteless mapping
   * @return the pattern, or {@code null} if no handler exists for the given name on the given site
   */
  public RequestMappingContext getPattern(String handlerName, Site site) {
    buildAndFreeze();
    Preconditions.checkNotNull(handlerName);
    if (site != null) {
      RequestMappingContext siteMapping = siteTable.get(handlerName, site);
      if (siteMapping != null) {
        return siteMapping;
      }
    }
    return globalTable.get(handlerName);
  }

  public static interface MappingEntry {
    String getHandlerName();

    Optional<Site> getSite();

    RequestMappingContext getMapping();
  }

  public Iterable<MappingEntry> getAll() {
    buildAndFreeze();

    Iterable<MappingEntry> siteEntries = Iterables.transform(siteTable.cellSet(),
        (Table.Cell<String, Site, RequestMappingContext> cell) ->
            new MappingEntry() {
              @Override
              public String getHandlerName() {
                return cell.getRowKey();
              }

              @Override
              public Optional<Site> getSite() {
                return Optional.of(cell.getColumnKey());
              }

              @Override
              public RequestMappingContext getMapping() {
                return cell.getValue();
              }
            });

    Iterable<MappingEntry> globalEntries = Iterables.transform(globalTable.entrySet(),
        (Map.Entry<String, RequestMappingContext> entry) ->
            new MappingEntry() {
              @Override
              public String getHandlerName() {
                return entry.getKey();
              }

              @Override
              public Optional<Site> getSite() {
                return Optional.empty();
              }

              @Override
              public RequestMappingContext getMapping() {
                return entry.getValue();
              }
            });

    return Iterables.concat(siteEntries, globalEntries);
  }

}


text:
/*
 *	package : test
 *	source  : CustomEvent.java
 *	date    : 1999.8.29
 */

package test;

import java.util.*;

public class CustomEvent extends EventObject {
	static final int WINDOW_CLOSING = 1;
	static final int WINDOW_CLOSED = 2;

	private int id = 0;

	CustomEvent(Object source, int i){
		super(source);
		id = i;
	}

	public int getID() {return id;}
}


text:
module.exports = function(string) {
  // Search available parsers until one likes what it sees
  var matchedParser = parsers.filter(function(parser){ return parser.testPattern.test(string); })[0];

  if(matchedParser){
    // All parsers convert the supplied value to L/100km, which is what
    // the Measure class expects as input.
    var vStr = matchedParser.valuePattern.exec(string);
    var vNum = conversions[matchedParser.label.replace('/','per') + "_Lper100km"](vStr);
    return new Measure(vNum);
  } else {
    throw "Could not determine the format of the string (mpg, L/100km, etc)";
  }
};

var Measure = function(v){
  this.v = v;
};

Measure.prototype = {
  // Return this measure's value in some given unit
  // Assumes that the unit is correctly spelled and capitalized
  to: function(unit){
    return conversions["Lper100km_" + unit.trim().replace('/','per')](this.v);
  }
};

var parsers = [
  {
    label: "mpg",
    testPattern: /\d*.?\d+\s*mpg/,
    valuePattern: /\d*.?\d+/
  },
  {
    label: "L/100km",
    testPattern: /\d*.?\d+\s*L\/100km/,
    valuePattern: /\d*.?\d+/
  },
  {
    label: "km/L",
    testPattern: /\d*.?\d+\s*km\/L/,
    valuePattern: /\d*.?\d+/
  }
];

var conversions = {

  Lper100km_Lper100km: function(v) {
    return v;
  },

  Lper100km_mpg: function(v) {
    return 235.2 / v;
  },

  Lper100km_kmperL: function(v) {
    return 100 / v;
  },

  mpg_Lper100km: function(v) {
    return 235.2 / v;
  },

  kmperL_Lper100km: function(v) {
    return 100 / v;
  },

  km_miles: function(v) {
    return v / 1.609344;
  },

  miles_km: function(v) {
    return v * 1.609344;
  }
};

var consumption = {

  mpg: function(milesTravelled, gallonsConsumed){
    return milesTravelled / gallonsConsumed;
  },

  Lper100km: function(kmTravelled, Lconsumed) {
    return (Lconsumed / kmTravelled) * 100;
  }

};

var range = {

  miles: function(mpg, gallonsRemaining){
    return gallonsRemaining * mpg;
  },

  km: function(Lper100km, litersRemaining){
    return conversions.Lper100km_kmperL(Lper100km) * litersRemaining;
  }

};


text:
ACCEPTED

#### According to
GRIN Taxonomy for Plants

#### Published in
Flora iranica 61:9. 1969

#### Original name
null

### Remarks
null


text:
<?php

namespace Arhitector\Transcoder\Stream;

use Arhitector\Transcoder\Codec;
use Arhitector\Transcoder\Format\FormatInterface;
use Arhitector\Transcoder\TimeInterval;
use Arhitector\Transcoder\TranscodeInterface;

/**
 * Interface StreamInterface.
 *
 * @package Arhitector\Transcoder\Stream
 */
interface StreamInterface extends \ArrayAccess, EnumerationInterface
{

	/**
	 * Returns a new format instance.
	 *
	 * @param TranscodeInterface $media
	 * @param array              $options
	 *
	 * <code>
	 * array (size=8)
	 *  'channels' => int 2
	 *  'frequency' => int 44100
	 *  'codec' => object(Arhitector\Transcoder\Codec)[13]
	 *      protected 'codec' => string 'mp3' (length=3)
	 *      protected 'name' => string 'MP3 (MPEG audio layer 3)' (length=24)
	 *  'index' => int 1
	 *  'profile' => string 'base' (length=4)
	 *  'bitrate' => int 320000
	 *  'start_time' => float 0.025057
	 *  'duration' => float 208.53551
	 * </code>
	 *
	 * @return static
	 * @throws \InvalidArgumentException
	 */
	public static function create(TranscodeInterface $media, array $options = []);

	/**
	 * Get the full path to the file.
	 *
	 * @return string
	 */
	public function getFilePath();

	/**
	 * Get Codec instance or NULL.
	 *
	 * @return Codec|null
	 */
	public function getCodec();

	/**
	 * Set a new Codec instance.
	 *
	 * @param Codec $codec
	 *
	 * @return StreamInterface
	 */
	public function setCodec(Codec $codec);

	/**
	 * Get stream index value.
	 *
	 * @return int
	 */
	public function getIndex();

	/**
	 * Set a new order.
	 *
	 * @param int $position
	 *
	 * @return StreamInterface
	 */
	public function setIndex($position);

	/**
	 * Get profile value.
	 *
	 * @return string
	 */
	public function getProfile();

	/**
	 * Get bit rate value.
	 *
	 * @return int
	 */
	public function getBitrate();

	/**
	 * Get stream start time.
	 *
	 * @return float
	 */
	public function getStartTime();

	/**
	 * Get duration value.
	 *
	 * @return TimeInterval
	 */
	public function getDuration();

	/**
	 * Stream save.
	 *
	 * @param FormatInterface $format
	 * @param string          $filePath
	 * @param bool            $overwrite
	 *
	 * @return bool
	 */
	public function save(FormatInterface $format, $filePath, $overwrite = true);

	/**
	 * Get array of values.
	 *
	 * @return array
	 */
	public function toArray();

	/**
	 * Returns a bit mask of type.
	 *
	 * @return int
	 */
	public function getType();

	/**
	 * Gets the metadata.
	 *
	 * @return array
	 */
	public function getMetadata();

}


text:
var test = require('tape');
var defaults = require('../defaults');

test('defaults', function(t) {
  t.plan(3);
  t.equal(defaults({}, { a: true }).a, true, 'Property a copied across');
  t.equal(defaults({ a: 1 }, { a: 2 }).a, 1, 'Property value not overriden');
  t.equal(defaults(undefined, { a: true }).a, true, 'Property pushed to new object');
});


text:
<?xml version="1.0" encoding="UTF-8"?>
<!--
  Copyright 2015 herd contributors

  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.
-->
<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/maven-v4_0_0.xsd">
   <modelVersion>4.0.0</modelVersion>

   <parent>
      <groupId>org.finra.herd</groupId>
      <artifactId>herd-tools</artifactId>
      <version>0.8.0-SNAPSHOT</version>
   </parent>

   <name>herd tools common</name>

   <!-- groupId and version are inherited from the parent and can be overridden where if needed. -->
   <artifactId>herd-tools-common</artifactId>

   <description>This is a project where common code across all tools can reside.</description>
   <url>http://finraos.github.io/herd/</url>

   <dependencies>
      <dependency>
         <groupId>${project.groupId}</groupId>
         <artifactId>herd-service</artifactId>
         <!--
         Exclude dependencies that aren't needed in the uploader and downloader applications.
         -->
         <exclusions>
            <exclusion>
               <artifactId>oozie-client</artifactId>
               <groupId>org.apache.oozie</groupId>
            </exclusion>
            <exclusion>
               <artifactId>activiti-spring</artifactId>
               <groupId>org.activiti</groupId>
            </exclusion>
            <exclusion>
               <artifactId>amazon-sqs-java-messaging-lib</artifactId>
               <groupId>com.amazonaws</groupId>
            </exclusion>
            <exclusion>
               <artifactId>hibernate-entitymanager</artifactId>
               <groupId>org.hibernate</groupId>
            </exclusion>
            <exclusion>
               <artifactId>hibernate-ehcache</artifactId>
               <groupId>org.hibernate</groupId>
            </exclusion>
            <exclusion>
               <artifactId>aspectjrt</artifactId>
               <groupId>org.aspectj</groupId>
            </exclusion>
            <exclusion>
               <artifactId>aws-java-sdk-emr</artifactId>
               <groupId>com.amazonaws</groupId>
            </exclusion>
            <exclusion>
               <artifactId>aws-java-sdk-sts</artifactId>
               <groupId>com.amazonaws</groupId>
            </exclusion>
            <exclusion>
               <artifactId>aws-java-sdk-ec2</artifactId>
               <groupId>com.amazonaws</groupId>
            </exclusion>
            <exclusion>
               <artifactId>aws-java-sdk-sqs</artifactId>
               <groupId>com.amazonaws</groupId>
            </exclusion>
            <exclusion>
               <artifactId>quartz</artifactId>
               <groupId>org.quartz-scheduler</groupId>
            </exclusion>
            <exclusion>
               <artifactId>velocity</artifactId>
               <groupId>org.apache.velocity</groupId>
            </exclusion>
            <exclusion>
               <artifactId>commons-configuration</artifactId>
               <groupId>commons-configuration</groupId>
            </exclusion>
            <exclusion>
               <artifactId>hibernate-jpamodelgen</artifactId>
               <groupId>org.hibernate</groupId>
            </exclusion>
            <exclusion>
               <artifactId>quartz-jobs</artifactId>
               <groupId>org.quartz-scheduler</groupId>
            </exclusion>
            <exclusion>
               <artifactId>spring-jms</artifactId>
               <groupId>org.springframework</groupId>
            </exclusion>
            <exclusion>
               <artifactId>spring-web</artifactId>
               <groupId>org.springframework</groupId>
            </exclusion>
            <exclusion>
               <artifactId>spring-security-config</artifactId>
               <groupId>org.springframework.security</groupId>
            </exclusion>
            <exclusion>
               <artifactId>spring-jdbc</artifactId>
               <groupId>org.springframework</groupId>
            </exclusion>
            <exclusion>
               <artifactId>spring-orm</artifactId>
               <groupId>org.springframework</groupId>
            </exclusion>
            <exclusion>
               <artifactId>spring-context-support</artifactId>
               <groupId>org.springframework</groupId>
            </exclusion>
         </exclusions>
      </dependency>
      <dependency>
         <groupId>${project.groupId}</groupId>
         <artifactId>herd-dao</artifactId>
         <type>test-jar</type>
         <scope>test</scope>
      </dependency>
      <dependency>
         <groupId>${project.groupId}</groupId>
         <artifactId>herd-core</artifactId>
         <type>test-jar</type>
         <scope>test</scope>
      </dependency>
      <dependency>
         <groupId>org.springframework</groupId>
         <artifactId>spring-test</artifactId>
         <scope>test</scope>
      </dependency>
      <!--
      This seems to be needed by the Xerces implementation. Without it, it produces a NullPointerException when de-serializing objects.
      -->
      <dependency>
         <groupId>org.codehaus.woodstox</groupId>
         <artifactId>woodstox-core-asl</artifactId>
      </dependency>
   </dependencies>
</project>


text:
<!DOCTYPE html>

  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1">

  <meta name="description" content="">
  <meta name="author" content="">

  <link href="css/bootstrap.css" rel="stylesheet" />

  <title>Using JQuery to manipulate the DOM</title>

          <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
            Toggle navigation

          </button>
          Home

Using JQuery to manipulate the DOM

We will explore how JQuery makes it easier to manipulate the DOM.

Notice that in this example there is no event wiring in the HTML, all javascript functionality is added through the script file. This is known as unobtrusive javascript

Changing styles on elements

Example 1: Show or hide a single element

            Click me to hide or show a paragraph of text

Some content here that gets shown or hidden

Example 2: Change styling of multiple elements

List item 1

List item 2

List item 3

List item 4

            Make all list items red
            Make all list items bold
            Add class to all items

Chaning the DOM

Example 3: Change content

I am a paragraph

            Change paragraph text

Example 4: Add data to a table

                Column 1
                Column 2

                Data 1
                Data 1

                Data 2
                Data 2

            Add another row

Example 5: Images

Click above to change the image

Hover over above to change the image

Ajax

Example 6: Get some data from the server

              Click the button to load in some data from the server.

            Refresh data

© Company 2014


text:
<?php

$validation_errors = validation_errors();

if ($validation_errors) :
?>

	×

Please fix the following errors:

	<?php echo $validation_errors; ?>

<?php
endif;

if (isset($city))
{
	$city = (array) $city;
}
$id = isset($city['cid']) ? $city['cid'] : '';

?>

city

	<?php echo form_open($this->uri->uri_string(), 'class="form-horizontal"'); ?>
		<fieldset>

			<div class="control-group <?php echo form_error('city') ? 'error' : ''; ?>">
				<?php echo form_label('City'. lang('bf_form_label_required'), 'city_city', array('class' => 'control-label') ); ?>

					<input id='city_city' type='text' name='city_city' maxlength="60" value="<?php echo set_value('city_city', isset($city['city']) ? $city['city'] : ''); ?>" />
					<?php echo form_error('city'); ?>

			<div class="control-group <?php echo form_error('name') ? 'error' : ''; ?>">
				<?php echo form_label('Name', 'city_name', array('class' => 'control-label') ); ?>

					<input id='city_name' type='text' name='city_name' maxlength="50" value="<?php echo set_value('city_name', isset($city['name']) ? $city['name'] : ''); ?>" />
					<?php echo form_error('name'); ?>

			<div class="control-group <?php echo form_error('country') ? 'error' : ''; ?>">
				<?php echo form_label('Country', 'city_country', array('class' => 'control-label') ); ?>

					<input id='city_country' type='text' name='city_country' maxlength="60" value="<?php echo set_value('city_country', isset($city['country']) ? $city['country'] : ''); ?>" />
					<?php echo form_error('country'); ?>

			<div class="control-group <?php echo form_error('fmuser') ? 'error' : ''; ?>">
				<?php echo form_label('Fmuser', 'city_fmuser', array('class' => 'control-label') ); ?>

					<input id='city_fmuser' type='text' name='city_fmuser' maxlength="50" value="<?php echo set_value('city_fmuser', isset($city['fmuser']) ? $city['fmuser'] : ''); ?>" />
					<?php echo form_error('fmuser'); ?>

			<div class="control-group <?php echo form_error('fmpass') ? 'error' : ''; ?>">
				<?php echo form_label('Fmpass', 'city_fmpass', array('class' => 'control-label') ); ?>

					<input id='city_fmpass' type='text' name='city_fmpass' maxlength="50" value="<?php echo set_value('city_fmpass', isset($city['fmpass']) ? $city['fmpass'] : ''); ?>" />
					<?php echo form_error('fmpass'); ?>

			<div class="control-group <?php echo form_error('apikey') ? 'error' : ''; ?>">
				<?php echo form_label('Apikey', 'city_apikey', array('class' => 'control-label') ); ?>

					<input id='city_apikey' type='text' name='city_apikey' maxlength="36" value="<?php echo set_value('city_apikey', isset($city['apikey']) ? $city['apikey'] : ''); ?>" />
					<?php echo form_error('apikey'); ?>

			<div class="control-group <?php echo form_error('apisecret') ? 'error' : ''; ?>">
				<?php echo form_label('Apisecret', 'city_apisecret', array('class' => 'control-label') ); ?>

					<input id='city_apisecret' type='text' name='city_apisecret' maxlength="36" value="<?php echo set_value('city_apisecret', isset($city['apisecret']) ? $city['apisecret'] : ''); ?>" />
					<?php echo form_error('apisecret'); ?>

				<input type="submit" name="save" class="btn btn-primary" value="<?php echo lang('city_action_edit'); ?>"  />
				<?php echo lang('bf_or'); ?>
				<?php echo anchor(SITE_AREA .'/content/city', lang('city_cancel'), 'class="btn btn-warning"'); ?>

			<?php if ($this->auth->has_permission('City.Content.Delete')) : ?>
				or
				<button type="submit" name="delete" class="btn btn-danger" id="delete-me" onclick="return confirm('<?php e(js_escape(lang('city_delete_confirm'))); ?>'); ">
					 <?php echo lang('city_delete_record'); ?>
				</button>
			<?php endif; ?>

		</fieldset>
    <?php echo form_close(); ?>


text:
<!doctype html>
<html>
<style>
  html {
    margin: 0;
    padding: 0;
  }
  body {
    margin: 0;
    padding: 0;
    min-width: 100px;
    min-height: 100px;
  }
</style>
<body>
  Add some text that will cause the page to allow input on the first frame.
</body>
<script src="user_gesture_test.js"></script>
</html>


text:
class SVD : public overres::ObjectWrap{
public:
	static void Init(Handle<Object> target, std::shared_ptr<overload_resolution> overload);

	std::shared_ptr<cv::SVD> _svd;

	static Nan::Persistent<FunctionTemplate> constructor;

	virtual v8::Local<v8::Function> get_constructor();

	static POLY_METHOD(New);
	static POLY_METHOD(New_array);
	static POLY_METHOD(compute_u_vt);
	static POLY_METHOD(compute);
	static POLY_METHOD(backSubst_w_u_vt_rhs);
	static POLY_METHOD(solveZ);
	static POLY_METHOD(run);
	static POLY_METHOD(backSubst);

	static NAN_GETTER(u_getter);
	static NAN_SETTER(u_setter);

	static NAN_GETTER(w_getter);
	static NAN_SETTER(w_setter);

	static NAN_GETTER(vt_getter);
	static NAN_SETTER(vt_setter);
};

#endif


text:
#include "SkLocalMatrixShader.h"

#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING
SkLocalMatrixShader::SkLocalMatrixShader(SkReadBuffer& buffer) : INHERITED(buffer) {
    if (buffer.isVersionLT(SkReadBuffer::kSimplifyLocalMatrix_Version)) {
        buffer.readMatrix(&(INHERITED::fLocalMatrix));
    }
    fProxyShader.reset(buffer.readShader());
    if (NULL == fProxyShader.get()) {
        sk_throw();
    }
}
#endif

SkFlattenable* SkLocalMatrixShader::CreateProc(SkReadBuffer& buffer) {
    SkMatrix lm;
    buffer.readMatrix(&lm);
    SkAutoTUnref<SkShader> shader(buffer.readShader());
    if (!shader.get()) {
        return NULL;
    }
    return SkShader::CreateLocalMatrixShader(shader, lm);
}

void SkLocalMatrixShader::flatten(SkWriteBuffer& buffer) const {
    buffer.writeMatrix(this->getLocalMatrix());
    buffer.writeFlattenable(fProxyShader.get());
}

SkShader::Context* SkLocalMatrixShader::onCreateContext(const ContextRec& rec,
                                                        void* storage) const {
    ContextRec newRec(rec);
    SkMatrix tmp;
    if (rec.fLocalMatrix) {
        tmp.setConcat(*rec.fLocalMatrix, this->getLocalMatrix());
        newRec.fLocalMatrix = &tmp;
    } else {
        newRec.fLocalMatrix = &this->getLocalMatrix();
    }
    return fProxyShader->createContext(newRec, storage);
}

#ifndef SK_IGNORE_TO_STRING
void SkLocalMatrixShader::toString(SkString* str) const {
    str->append("SkLocalMatrixShader: (");

    fProxyShader->toString(str);

    this->INHERITED::toString(str);

    str->append(")");
}
#endif

SkShader* SkShader::CreateLocalMatrixShader(SkShader* proxy, const SkMatrix& localMatrix) {
    if (localMatrix.isIdentity()) {
        return SkRef(proxy);
    }

    const SkMatrix* lm = &localMatrix;

    SkMatrix otherLocalMatrix;
    SkAutoTUnref<SkShader> otherProxy(proxy->refAsALocalMatrixShader(&otherLocalMatrix));
    if (otherProxy.get()) {
        otherLocalMatrix.preConcat(localMatrix);
        lm = &otherLocalMatrix;
        proxy = otherProxy.get();
    }

    return SkNEW_ARGS(SkLocalMatrixShader, (proxy, *lm));
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://ws.apache.org/ns/synapse">
    <proxy name="urlRewriteProxy" transports="https,http" statistics="disable" trace="disable"
           startOnLoad="true">
        <target>
            <inSequence>
                <property name="host.value" value="localhost" scope="default"/>
                <rewrite>
                    <rewriterule>
                        <condition>
                            <equal xmlns="" type="url" source="protocol" value="http"/>
                        </condition>
                        <action value="localhost" type="set" fragment="host"/>
                    </rewriterule>
                    <rewriterule>
                        <condition>
                            <equal xmlns="" type="url" source="protocol" value="https"/>
                        </condition>
                        <action xpath="get-property('host.value')" type="set" fragment="host"/>
                        <action value="http" type="set" fragment="protocol"/>
                    </rewriterule>
                </rewrite>
                <log level="full"/>
                <send/>
            </inSequence>
            <outSequence>
                <send/>
            </outSequence>
        </target>
        <description></description>
    </proxy>

</definitions>


text:
export interface OnRoutesInit {
  $onRoutesInit(): void | Promise<any>;
}


text:
const airbnb = require('eslint-config-airbnb');

module.exports = airbnb