text
stringlengths
2
100k
meta
dict
Manifest-Version: 1.0 Main-Class: main.java.ReadWrite
{ "pile_set_name": "Github" }
{ "name": "example-example75", "files": [ "index-production.html", "app.css", "app.js" ] }
{ "pile_set_name": "Github" }
/* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * Test that the function: * int msync(void *, size_t, int) * is declared. * * @pt:MF * @pt:SIO */ #include <sys/mman.h> typedef int (*msync_test) (void *, size_t, int); int dummyfcn(void) { msync_test dummyvar; dummyvar = msync; return 0; }
{ "pile_set_name": "Github" }
package redis // Copyright (c) Microsoft and contributors. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // // See the License for the specific language governing permissions and // limitations under the License. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "context" "encoding/json" "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" "github.com/Azure/go-autorest/autorest/date" "github.com/Azure/go-autorest/autorest/to" "github.com/Azure/go-autorest/tracing" "net/http" ) // The package's fully qualified name. const fqdn = "github.com/Azure/azure-sdk-for-go/services/redis/mgmt/2018-03-01/redis" // DayOfWeek enumerates the values for day of week. type DayOfWeek string const ( // Everyday ... Everyday DayOfWeek = "Everyday" // Friday ... Friday DayOfWeek = "Friday" // Monday ... Monday DayOfWeek = "Monday" // Saturday ... Saturday DayOfWeek = "Saturday" // Sunday ... Sunday DayOfWeek = "Sunday" // Thursday ... Thursday DayOfWeek = "Thursday" // Tuesday ... Tuesday DayOfWeek = "Tuesday" // Wednesday ... Wednesday DayOfWeek = "Wednesday" // Weekend ... Weekend DayOfWeek = "Weekend" ) // PossibleDayOfWeekValues returns an array of possible values for the DayOfWeek const type. func PossibleDayOfWeekValues() []DayOfWeek { return []DayOfWeek{Everyday, Friday, Monday, Saturday, Sunday, Thursday, Tuesday, Wednesday, Weekend} } // KeyType enumerates the values for key type. type KeyType string const ( // Primary ... Primary KeyType = "Primary" // Secondary ... Secondary KeyType = "Secondary" ) // PossibleKeyTypeValues returns an array of possible values for the KeyType const type. func PossibleKeyTypeValues() []KeyType { return []KeyType{Primary, Secondary} } // ProvisioningState enumerates the values for provisioning state. type ProvisioningState string const ( // Creating ... Creating ProvisioningState = "Creating" // Deleting ... Deleting ProvisioningState = "Deleting" // Disabled ... Disabled ProvisioningState = "Disabled" // Failed ... Failed ProvisioningState = "Failed" // Linking ... Linking ProvisioningState = "Linking" // Provisioning ... Provisioning ProvisioningState = "Provisioning" // RecoveringScaleFailure ... RecoveringScaleFailure ProvisioningState = "RecoveringScaleFailure" // Scaling ... Scaling ProvisioningState = "Scaling" // Succeeded ... Succeeded ProvisioningState = "Succeeded" // Unlinking ... Unlinking ProvisioningState = "Unlinking" // Unprovisioning ... Unprovisioning ProvisioningState = "Unprovisioning" // Updating ... Updating ProvisioningState = "Updating" ) // PossibleProvisioningStateValues returns an array of possible values for the ProvisioningState const type. func PossibleProvisioningStateValues() []ProvisioningState { return []ProvisioningState{Creating, Deleting, Disabled, Failed, Linking, Provisioning, RecoveringScaleFailure, Scaling, Succeeded, Unlinking, Unprovisioning, Updating} } // RebootType enumerates the values for reboot type. type RebootType string const ( // AllNodes ... AllNodes RebootType = "AllNodes" // PrimaryNode ... PrimaryNode RebootType = "PrimaryNode" // SecondaryNode ... SecondaryNode RebootType = "SecondaryNode" ) // PossibleRebootTypeValues returns an array of possible values for the RebootType const type. func PossibleRebootTypeValues() []RebootType { return []RebootType{AllNodes, PrimaryNode, SecondaryNode} } // ReplicationRole enumerates the values for replication role. type ReplicationRole string const ( // ReplicationRolePrimary ... ReplicationRolePrimary ReplicationRole = "Primary" // ReplicationRoleSecondary ... ReplicationRoleSecondary ReplicationRole = "Secondary" ) // PossibleReplicationRoleValues returns an array of possible values for the ReplicationRole const type. func PossibleReplicationRoleValues() []ReplicationRole { return []ReplicationRole{ReplicationRolePrimary, ReplicationRoleSecondary} } // SkuFamily enumerates the values for sku family. type SkuFamily string const ( // C ... C SkuFamily = "C" // P ... P SkuFamily = "P" ) // PossibleSkuFamilyValues returns an array of possible values for the SkuFamily const type. func PossibleSkuFamilyValues() []SkuFamily { return []SkuFamily{C, P} } // SkuName enumerates the values for sku name. type SkuName string const ( // Basic ... Basic SkuName = "Basic" // Premium ... Premium SkuName = "Premium" // Standard ... Standard SkuName = "Standard" ) // PossibleSkuNameValues returns an array of possible values for the SkuName const type. func PossibleSkuNameValues() []SkuName { return []SkuName{Basic, Premium, Standard} } // TLSVersion enumerates the values for tls version. type TLSVersion string const ( // OneFullStopOne ... OneFullStopOne TLSVersion = "1.1" // OneFullStopTwo ... OneFullStopTwo TLSVersion = "1.2" // OneFullStopZero ... OneFullStopZero TLSVersion = "1.0" ) // PossibleTLSVersionValues returns an array of possible values for the TLSVersion const type. func PossibleTLSVersionValues() []TLSVersion { return []TLSVersion{OneFullStopOne, OneFullStopTwo, OneFullStopZero} } // AccessKeys redis cache access keys. type AccessKeys struct { autorest.Response `json:"-"` // PrimaryKey - READ-ONLY; The current primary key that clients can use to authenticate with Redis cache. PrimaryKey *string `json:"primaryKey,omitempty"` // SecondaryKey - READ-ONLY; The current secondary key that clients can use to authenticate with Redis cache. SecondaryKey *string `json:"secondaryKey,omitempty"` } // CheckNameAvailabilityParameters parameters body to pass for resource name availability check. type CheckNameAvailabilityParameters struct { // Name - Resource name. Name *string `json:"name,omitempty"` // Type - Resource type. The only legal value of this property for checking redis cache name availability is 'Microsoft.Cache/redis'. Type *string `json:"type,omitempty"` } // CommonProperties create/Update/Get common properties of the redis cache. type CommonProperties struct { // RedisConfiguration - All Redis Settings. Few possible keys: rdb-backup-enabled,rdb-storage-connection-string,rdb-backup-frequency,maxmemory-delta,maxmemory-policy,notify-keyspace-events,maxmemory-samples,slowlog-log-slower-than,slowlog-max-len,list-max-ziplist-entries,list-max-ziplist-value,hash-max-ziplist-entries,hash-max-ziplist-value,set-max-intset-entries,zset-max-ziplist-entries,zset-max-ziplist-value etc. RedisConfiguration map[string]*string `json:"redisConfiguration"` // EnableNonSslPort - Specifies whether the non-ssl Redis server port (6379) is enabled. EnableNonSslPort *bool `json:"enableNonSslPort,omitempty"` // TenantSettings - A dictionary of tenant settings TenantSettings map[string]*string `json:"tenantSettings"` // ShardCount - The number of shards to be created on a Premium Cluster Cache. ShardCount *int32 `json:"shardCount,omitempty"` // MinimumTLSVersion - Optional: requires clients to use a specified TLS version (or higher) to connect (e,g, '1.0', '1.1', '1.2'). Possible values include: 'OneFullStopZero', 'OneFullStopOne', 'OneFullStopTwo' MinimumTLSVersion TLSVersion `json:"minimumTlsVersion,omitempty"` } // MarshalJSON is the custom marshaler for CommonProperties. func (cp CommonProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) if cp.RedisConfiguration != nil { objectMap["redisConfiguration"] = cp.RedisConfiguration } if cp.EnableNonSslPort != nil { objectMap["enableNonSslPort"] = cp.EnableNonSslPort } if cp.TenantSettings != nil { objectMap["tenantSettings"] = cp.TenantSettings } if cp.ShardCount != nil { objectMap["shardCount"] = cp.ShardCount } if cp.MinimumTLSVersion != "" { objectMap["minimumTlsVersion"] = cp.MinimumTLSVersion } return json.Marshal(objectMap) } // CreateFuture an abstraction for monitoring and retrieving the results of a long-running operation. type CreateFuture struct { azure.Future } // Result returns the result of the asynchronous operation. // If the operation has not completed it will return an error. func (future *CreateFuture) Result(client Client) (rt ResourceType, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { err = autorest.NewErrorWithError(err, "redis.CreateFuture", "Result", future.Response(), "Polling failure") return } if !done { err = azure.NewAsyncOpIncompleteError("redis.CreateFuture") return } sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if rt.Response.Response, err = future.GetResult(sender); err == nil && rt.Response.Response.StatusCode != http.StatusNoContent { rt, err = client.CreateResponder(rt.Response.Response) if err != nil { err = autorest.NewErrorWithError(err, "redis.CreateFuture", "Result", rt.Response.Response, "Failure responding to request") } } return } // CreateParameters parameters supplied to the Create Redis operation. type CreateParameters struct { // CreateProperties - Redis cache properties. *CreateProperties `json:"properties,omitempty"` // Zones - A list of availability zones denoting where the resource needs to come from. Zones *[]string `json:"zones,omitempty"` // Location - The geo-location where the resource lives Location *string `json:"location,omitempty"` // Tags - Resource tags. Tags map[string]*string `json:"tags"` } // MarshalJSON is the custom marshaler for CreateParameters. func (cp CreateParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) if cp.CreateProperties != nil { objectMap["properties"] = cp.CreateProperties } if cp.Zones != nil { objectMap["zones"] = cp.Zones } if cp.Location != nil { objectMap["location"] = cp.Location } if cp.Tags != nil { objectMap["tags"] = cp.Tags } return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for CreateParameters struct. func (cp *CreateParameters) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { return err } for k, v := range m { switch k { case "properties": if v != nil { var createProperties CreateProperties err = json.Unmarshal(*v, &createProperties) if err != nil { return err } cp.CreateProperties = &createProperties } case "zones": if v != nil { var zones []string err = json.Unmarshal(*v, &zones) if err != nil { return err } cp.Zones = &zones } case "location": if v != nil { var location string err = json.Unmarshal(*v, &location) if err != nil { return err } cp.Location = &location } case "tags": if v != nil { var tags map[string]*string err = json.Unmarshal(*v, &tags) if err != nil { return err } cp.Tags = tags } } } return nil } // CreateProperties properties supplied to Create Redis operation. type CreateProperties struct { // Sku - The SKU of the Redis cache to deploy. Sku *Sku `json:"sku,omitempty"` // SubnetID - The full resource ID of a subnet in a virtual network to deploy the Redis cache in. Example format: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/Microsoft.{Network|ClassicNetwork}/VirtualNetworks/vnet1/subnets/subnet1 SubnetID *string `json:"subnetId,omitempty"` // StaticIP - Static IP address. Required when deploying a Redis cache inside an existing Azure Virtual Network. StaticIP *string `json:"staticIP,omitempty"` // RedisConfiguration - All Redis Settings. Few possible keys: rdb-backup-enabled,rdb-storage-connection-string,rdb-backup-frequency,maxmemory-delta,maxmemory-policy,notify-keyspace-events,maxmemory-samples,slowlog-log-slower-than,slowlog-max-len,list-max-ziplist-entries,list-max-ziplist-value,hash-max-ziplist-entries,hash-max-ziplist-value,set-max-intset-entries,zset-max-ziplist-entries,zset-max-ziplist-value etc. RedisConfiguration map[string]*string `json:"redisConfiguration"` // EnableNonSslPort - Specifies whether the non-ssl Redis server port (6379) is enabled. EnableNonSslPort *bool `json:"enableNonSslPort,omitempty"` // TenantSettings - A dictionary of tenant settings TenantSettings map[string]*string `json:"tenantSettings"` // ShardCount - The number of shards to be created on a Premium Cluster Cache. ShardCount *int32 `json:"shardCount,omitempty"` // MinimumTLSVersion - Optional: requires clients to use a specified TLS version (or higher) to connect (e,g, '1.0', '1.1', '1.2'). Possible values include: 'OneFullStopZero', 'OneFullStopOne', 'OneFullStopTwo' MinimumTLSVersion TLSVersion `json:"minimumTlsVersion,omitempty"` } // MarshalJSON is the custom marshaler for CreateProperties. func (cp CreateProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) if cp.Sku != nil { objectMap["sku"] = cp.Sku } if cp.SubnetID != nil { objectMap["subnetId"] = cp.SubnetID } if cp.StaticIP != nil { objectMap["staticIP"] = cp.StaticIP } if cp.RedisConfiguration != nil { objectMap["redisConfiguration"] = cp.RedisConfiguration } if cp.EnableNonSslPort != nil { objectMap["enableNonSslPort"] = cp.EnableNonSslPort } if cp.TenantSettings != nil { objectMap["tenantSettings"] = cp.TenantSettings } if cp.ShardCount != nil { objectMap["shardCount"] = cp.ShardCount } if cp.MinimumTLSVersion != "" { objectMap["minimumTlsVersion"] = cp.MinimumTLSVersion } return json.Marshal(objectMap) } // DeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. type DeleteFuture struct { azure.Future } // Result returns the result of the asynchronous operation. // If the operation has not completed it will return an error. func (future *DeleteFuture) Result(client Client) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { err = autorest.NewErrorWithError(err, "redis.DeleteFuture", "Result", future.Response(), "Polling failure") return } if !done { err = azure.NewAsyncOpIncompleteError("redis.DeleteFuture") return } ar.Response = future.Response() return } // ExportDataFuture an abstraction for monitoring and retrieving the results of a long-running operation. type ExportDataFuture struct { azure.Future } // Result returns the result of the asynchronous operation. // If the operation has not completed it will return an error. func (future *ExportDataFuture) Result(client Client) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { err = autorest.NewErrorWithError(err, "redis.ExportDataFuture", "Result", future.Response(), "Polling failure") return } if !done { err = azure.NewAsyncOpIncompleteError("redis.ExportDataFuture") return } ar.Response = future.Response() return } // ExportRDBParameters parameters for Redis export operation. type ExportRDBParameters struct { // Format - File format. Format *string `json:"format,omitempty"` // Prefix - Prefix to use for exported files. Prefix *string `json:"prefix,omitempty"` // Container - Container name to export to. Container *string `json:"container,omitempty"` } // FirewallRule a firewall rule on a redis cache has a name, and describes a contiguous range of IP // addresses permitted to connect type FirewallRule struct { autorest.Response `json:"-"` // FirewallRuleProperties - redis cache firewall rule properties *FirewallRuleProperties `json:"properties,omitempty"` // ID - READ-ONLY; Resource ID. ID *string `json:"id,omitempty"` // Name - READ-ONLY; Resource name. Name *string `json:"name,omitempty"` // Type - READ-ONLY; Resource type. Type *string `json:"type,omitempty"` } // MarshalJSON is the custom marshaler for FirewallRule. func (fr FirewallRule) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) if fr.FirewallRuleProperties != nil { objectMap["properties"] = fr.FirewallRuleProperties } return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for FirewallRule struct. func (fr *FirewallRule) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { return err } for k, v := range m { switch k { case "properties": if v != nil { var firewallRuleProperties FirewallRuleProperties err = json.Unmarshal(*v, &firewallRuleProperties) if err != nil { return err } fr.FirewallRuleProperties = &firewallRuleProperties } case "id": if v != nil { var ID string err = json.Unmarshal(*v, &ID) if err != nil { return err } fr.ID = &ID } case "name": if v != nil { var name string err = json.Unmarshal(*v, &name) if err != nil { return err } fr.Name = &name } case "type": if v != nil { var typeVar string err = json.Unmarshal(*v, &typeVar) if err != nil { return err } fr.Type = &typeVar } } } return nil } // FirewallRuleCreateParameters parameters required for creating a firewall rule on redis cache. type FirewallRuleCreateParameters struct { // FirewallRuleProperties - Properties required to create a firewall rule . *FirewallRuleProperties `json:"properties,omitempty"` } // MarshalJSON is the custom marshaler for FirewallRuleCreateParameters. func (frcp FirewallRuleCreateParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) if frcp.FirewallRuleProperties != nil { objectMap["properties"] = frcp.FirewallRuleProperties } return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for FirewallRuleCreateParameters struct. func (frcp *FirewallRuleCreateParameters) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { return err } for k, v := range m { switch k { case "properties": if v != nil { var firewallRuleProperties FirewallRuleProperties err = json.Unmarshal(*v, &firewallRuleProperties) if err != nil { return err } frcp.FirewallRuleProperties = &firewallRuleProperties } } } return nil } // FirewallRuleListResult the response of list firewall rules Redis operation. type FirewallRuleListResult struct { autorest.Response `json:"-"` // Value - Results of the list firewall rules operation. Value *[]FirewallRule `json:"value,omitempty"` // NextLink - READ-ONLY; Link for next page of results. NextLink *string `json:"nextLink,omitempty"` } // FirewallRuleListResultIterator provides access to a complete listing of FirewallRule values. type FirewallRuleListResultIterator struct { i int page FirewallRuleListResultPage } // NextWithContext advances to the next value. If there was an error making // the request the iterator does not advance and the error is returned. func (iter *FirewallRuleListResultIterator) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/FirewallRuleListResultIterator.NextWithContext") defer func() { sc := -1 if iter.Response().Response.Response != nil { sc = iter.Response().Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() } iter.i++ if iter.i < len(iter.page.Values()) { return nil } err = iter.page.NextWithContext(ctx) if err != nil { iter.i-- return err } iter.i = 0 return nil } // Next advances to the next value. If there was an error making // the request the iterator does not advance and the error is returned. // Deprecated: Use NextWithContext() instead. func (iter *FirewallRuleListResultIterator) Next() error { return iter.NextWithContext(context.Background()) } // NotDone returns true if the enumeration should be started or is not yet complete. func (iter FirewallRuleListResultIterator) NotDone() bool { return iter.page.NotDone() && iter.i < len(iter.page.Values()) } // Response returns the raw server response from the last page request. func (iter FirewallRuleListResultIterator) Response() FirewallRuleListResult { return iter.page.Response() } // Value returns the current value or a zero-initialized value if the // iterator has advanced beyond the end of the collection. func (iter FirewallRuleListResultIterator) Value() FirewallRule { if !iter.page.NotDone() { return FirewallRule{} } return iter.page.Values()[iter.i] } // Creates a new instance of the FirewallRuleListResultIterator type. func NewFirewallRuleListResultIterator(page FirewallRuleListResultPage) FirewallRuleListResultIterator { return FirewallRuleListResultIterator{page: page} } // IsEmpty returns true if the ListResult contains no values. func (frlr FirewallRuleListResult) IsEmpty() bool { return frlr.Value == nil || len(*frlr.Value) == 0 } // firewallRuleListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (frlr FirewallRuleListResult) firewallRuleListResultPreparer(ctx context.Context) (*http.Request, error) { if frlr.NextLink == nil || len(to.String(frlr.NextLink)) < 1 { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), autorest.AsJSON(), autorest.AsGet(), autorest.WithBaseURL(to.String(frlr.NextLink))) } // FirewallRuleListResultPage contains a page of FirewallRule values. type FirewallRuleListResultPage struct { fn func(context.Context, FirewallRuleListResult) (FirewallRuleListResult, error) frlr FirewallRuleListResult } // NextWithContext advances to the next page of values. If there was an error making // the request the page does not advance and the error is returned. func (page *FirewallRuleListResultPage) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/FirewallRuleListResultPage.NextWithContext") defer func() { sc := -1 if page.Response().Response.Response != nil { sc = page.Response().Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() } next, err := page.fn(ctx, page.frlr) if err != nil { return err } page.frlr = next return nil } // Next advances to the next page of values. If there was an error making // the request the page does not advance and the error is returned. // Deprecated: Use NextWithContext() instead. func (page *FirewallRuleListResultPage) Next() error { return page.NextWithContext(context.Background()) } // NotDone returns true if the page enumeration should be started or is not yet complete. func (page FirewallRuleListResultPage) NotDone() bool { return !page.frlr.IsEmpty() } // Response returns the raw server response from the last page request. func (page FirewallRuleListResultPage) Response() FirewallRuleListResult { return page.frlr } // Values returns the slice of values for the current page or nil if there are no values. func (page FirewallRuleListResultPage) Values() []FirewallRule { if page.frlr.IsEmpty() { return nil } return *page.frlr.Value } // Creates a new instance of the FirewallRuleListResultPage type. func NewFirewallRuleListResultPage(getNextPage func(context.Context, FirewallRuleListResult) (FirewallRuleListResult, error)) FirewallRuleListResultPage { return FirewallRuleListResultPage{fn: getNextPage} } // FirewallRuleProperties specifies a range of IP addresses permitted to connect to the cache type FirewallRuleProperties struct { // StartIP - lowest IP address included in the range StartIP *string `json:"startIP,omitempty"` // EndIP - highest IP address included in the range EndIP *string `json:"endIP,omitempty"` } // ForceRebootResponse response to force reboot for Redis cache. type ForceRebootResponse struct { autorest.Response `json:"-"` // Message - READ-ONLY; Status message Message *string `json:"message,omitempty"` } // ImportDataFuture an abstraction for monitoring and retrieving the results of a long-running operation. type ImportDataFuture struct { azure.Future } // Result returns the result of the asynchronous operation. // If the operation has not completed it will return an error. func (future *ImportDataFuture) Result(client Client) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { err = autorest.NewErrorWithError(err, "redis.ImportDataFuture", "Result", future.Response(), "Polling failure") return } if !done { err = azure.NewAsyncOpIncompleteError("redis.ImportDataFuture") return } ar.Response = future.Response() return } // ImportRDBParameters parameters for Redis import operation. type ImportRDBParameters struct { // Format - File format. Format *string `json:"format,omitempty"` // Files - files to import. Files *[]string `json:"files,omitempty"` } // LinkedServer linked server Id type LinkedServer struct { // ID - READ-ONLY; Linked server Id. ID *string `json:"id,omitempty"` } // LinkedServerCreateFuture an abstraction for monitoring and retrieving the results of a long-running // operation. type LinkedServerCreateFuture struct { azure.Future } // Result returns the result of the asynchronous operation. // If the operation has not completed it will return an error. func (future *LinkedServerCreateFuture) Result(client LinkedServerClient) (lswp LinkedServerWithProperties, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { err = autorest.NewErrorWithError(err, "redis.LinkedServerCreateFuture", "Result", future.Response(), "Polling failure") return } if !done { err = azure.NewAsyncOpIncompleteError("redis.LinkedServerCreateFuture") return } sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if lswp.Response.Response, err = future.GetResult(sender); err == nil && lswp.Response.Response.StatusCode != http.StatusNoContent { lswp, err = client.CreateResponder(lswp.Response.Response) if err != nil { err = autorest.NewErrorWithError(err, "redis.LinkedServerCreateFuture", "Result", lswp.Response.Response, "Failure responding to request") } } return } // LinkedServerCreateParameters parameter required for creating a linked server to redis cache. type LinkedServerCreateParameters struct { // LinkedServerCreateProperties - Properties required to create a linked server. *LinkedServerCreateProperties `json:"properties,omitempty"` } // MarshalJSON is the custom marshaler for LinkedServerCreateParameters. func (lscp LinkedServerCreateParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) if lscp.LinkedServerCreateProperties != nil { objectMap["properties"] = lscp.LinkedServerCreateProperties } return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for LinkedServerCreateParameters struct. func (lscp *LinkedServerCreateParameters) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { return err } for k, v := range m { switch k { case "properties": if v != nil { var linkedServerCreateProperties LinkedServerCreateProperties err = json.Unmarshal(*v, &linkedServerCreateProperties) if err != nil { return err } lscp.LinkedServerCreateProperties = &linkedServerCreateProperties } } } return nil } // LinkedServerCreateProperties create properties for a linked server type LinkedServerCreateProperties struct { // LinkedRedisCacheID - Fully qualified resourceId of the linked redis cache. LinkedRedisCacheID *string `json:"linkedRedisCacheId,omitempty"` // LinkedRedisCacheLocation - Location of the linked redis cache. LinkedRedisCacheLocation *string `json:"linkedRedisCacheLocation,omitempty"` // ServerRole - Role of the linked server. Possible values include: 'ReplicationRolePrimary', 'ReplicationRoleSecondary' ServerRole ReplicationRole `json:"serverRole,omitempty"` } // LinkedServerProperties properties of a linked server to be returned in get/put response type LinkedServerProperties struct { // ProvisioningState - READ-ONLY; Terminal state of the link between primary and secondary redis cache. ProvisioningState *string `json:"provisioningState,omitempty"` // LinkedRedisCacheID - Fully qualified resourceId of the linked redis cache. LinkedRedisCacheID *string `json:"linkedRedisCacheId,omitempty"` // LinkedRedisCacheLocation - Location of the linked redis cache. LinkedRedisCacheLocation *string `json:"linkedRedisCacheLocation,omitempty"` // ServerRole - Role of the linked server. Possible values include: 'ReplicationRolePrimary', 'ReplicationRoleSecondary' ServerRole ReplicationRole `json:"serverRole,omitempty"` } // LinkedServerWithProperties response to put/get linked server (with properties) for Redis cache. type LinkedServerWithProperties struct { autorest.Response `json:"-"` // LinkedServerProperties - Properties of the linked server. *LinkedServerProperties `json:"properties,omitempty"` // ID - READ-ONLY; Resource ID. ID *string `json:"id,omitempty"` // Name - READ-ONLY; Resource name. Name *string `json:"name,omitempty"` // Type - READ-ONLY; Resource type. Type *string `json:"type,omitempty"` } // MarshalJSON is the custom marshaler for LinkedServerWithProperties. func (lswp LinkedServerWithProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) if lswp.LinkedServerProperties != nil { objectMap["properties"] = lswp.LinkedServerProperties } return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for LinkedServerWithProperties struct. func (lswp *LinkedServerWithProperties) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { return err } for k, v := range m { switch k { case "properties": if v != nil { var linkedServerProperties LinkedServerProperties err = json.Unmarshal(*v, &linkedServerProperties) if err != nil { return err } lswp.LinkedServerProperties = &linkedServerProperties } case "id": if v != nil { var ID string err = json.Unmarshal(*v, &ID) if err != nil { return err } lswp.ID = &ID } case "name": if v != nil { var name string err = json.Unmarshal(*v, &name) if err != nil { return err } lswp.Name = &name } case "type": if v != nil { var typeVar string err = json.Unmarshal(*v, &typeVar) if err != nil { return err } lswp.Type = &typeVar } } } return nil } // LinkedServerWithPropertiesList list of linked servers (with properties) of a Redis cache. type LinkedServerWithPropertiesList struct { autorest.Response `json:"-"` // Value - List of linked servers (with properties) of a Redis cache. Value *[]LinkedServerWithProperties `json:"value,omitempty"` // NextLink - READ-ONLY; Link for next set. NextLink *string `json:"nextLink,omitempty"` } // LinkedServerWithPropertiesListIterator provides access to a complete listing of // LinkedServerWithProperties values. type LinkedServerWithPropertiesListIterator struct { i int page LinkedServerWithPropertiesListPage } // NextWithContext advances to the next value. If there was an error making // the request the iterator does not advance and the error is returned. func (iter *LinkedServerWithPropertiesListIterator) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/LinkedServerWithPropertiesListIterator.NextWithContext") defer func() { sc := -1 if iter.Response().Response.Response != nil { sc = iter.Response().Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() } iter.i++ if iter.i < len(iter.page.Values()) { return nil } err = iter.page.NextWithContext(ctx) if err != nil { iter.i-- return err } iter.i = 0 return nil } // Next advances to the next value. If there was an error making // the request the iterator does not advance and the error is returned. // Deprecated: Use NextWithContext() instead. func (iter *LinkedServerWithPropertiesListIterator) Next() error { return iter.NextWithContext(context.Background()) } // NotDone returns true if the enumeration should be started or is not yet complete. func (iter LinkedServerWithPropertiesListIterator) NotDone() bool { return iter.page.NotDone() && iter.i < len(iter.page.Values()) } // Response returns the raw server response from the last page request. func (iter LinkedServerWithPropertiesListIterator) Response() LinkedServerWithPropertiesList { return iter.page.Response() } // Value returns the current value or a zero-initialized value if the // iterator has advanced beyond the end of the collection. func (iter LinkedServerWithPropertiesListIterator) Value() LinkedServerWithProperties { if !iter.page.NotDone() { return LinkedServerWithProperties{} } return iter.page.Values()[iter.i] } // Creates a new instance of the LinkedServerWithPropertiesListIterator type. func NewLinkedServerWithPropertiesListIterator(page LinkedServerWithPropertiesListPage) LinkedServerWithPropertiesListIterator { return LinkedServerWithPropertiesListIterator{page: page} } // IsEmpty returns true if the ListResult contains no values. func (lswpl LinkedServerWithPropertiesList) IsEmpty() bool { return lswpl.Value == nil || len(*lswpl.Value) == 0 } // linkedServerWithPropertiesListPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (lswpl LinkedServerWithPropertiesList) linkedServerWithPropertiesListPreparer(ctx context.Context) (*http.Request, error) { if lswpl.NextLink == nil || len(to.String(lswpl.NextLink)) < 1 { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), autorest.AsJSON(), autorest.AsGet(), autorest.WithBaseURL(to.String(lswpl.NextLink))) } // LinkedServerWithPropertiesListPage contains a page of LinkedServerWithProperties values. type LinkedServerWithPropertiesListPage struct { fn func(context.Context, LinkedServerWithPropertiesList) (LinkedServerWithPropertiesList, error) lswpl LinkedServerWithPropertiesList } // NextWithContext advances to the next page of values. If there was an error making // the request the page does not advance and the error is returned. func (page *LinkedServerWithPropertiesListPage) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/LinkedServerWithPropertiesListPage.NextWithContext") defer func() { sc := -1 if page.Response().Response.Response != nil { sc = page.Response().Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() } next, err := page.fn(ctx, page.lswpl) if err != nil { return err } page.lswpl = next return nil } // Next advances to the next page of values. If there was an error making // the request the page does not advance and the error is returned. // Deprecated: Use NextWithContext() instead. func (page *LinkedServerWithPropertiesListPage) Next() error { return page.NextWithContext(context.Background()) } // NotDone returns true if the page enumeration should be started or is not yet complete. func (page LinkedServerWithPropertiesListPage) NotDone() bool { return !page.lswpl.IsEmpty() } // Response returns the raw server response from the last page request. func (page LinkedServerWithPropertiesListPage) Response() LinkedServerWithPropertiesList { return page.lswpl } // Values returns the slice of values for the current page or nil if there are no values. func (page LinkedServerWithPropertiesListPage) Values() []LinkedServerWithProperties { if page.lswpl.IsEmpty() { return nil } return *page.lswpl.Value } // Creates a new instance of the LinkedServerWithPropertiesListPage type. func NewLinkedServerWithPropertiesListPage(getNextPage func(context.Context, LinkedServerWithPropertiesList) (LinkedServerWithPropertiesList, error)) LinkedServerWithPropertiesListPage { return LinkedServerWithPropertiesListPage{fn: getNextPage} } // ListResult the response of list Redis operation. type ListResult struct { autorest.Response `json:"-"` // Value - List of Redis cache instances. Value *[]ResourceType `json:"value,omitempty"` // NextLink - READ-ONLY; Link for next page of results. NextLink *string `json:"nextLink,omitempty"` } // ListResultIterator provides access to a complete listing of ResourceType values. type ListResultIterator struct { i int page ListResultPage } // NextWithContext advances to the next value. If there was an error making // the request the iterator does not advance and the error is returned. func (iter *ListResultIterator) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/ListResultIterator.NextWithContext") defer func() { sc := -1 if iter.Response().Response.Response != nil { sc = iter.Response().Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() } iter.i++ if iter.i < len(iter.page.Values()) { return nil } err = iter.page.NextWithContext(ctx) if err != nil { iter.i-- return err } iter.i = 0 return nil } // Next advances to the next value. If there was an error making // the request the iterator does not advance and the error is returned. // Deprecated: Use NextWithContext() instead. func (iter *ListResultIterator) Next() error { return iter.NextWithContext(context.Background()) } // NotDone returns true if the enumeration should be started or is not yet complete. func (iter ListResultIterator) NotDone() bool { return iter.page.NotDone() && iter.i < len(iter.page.Values()) } // Response returns the raw server response from the last page request. func (iter ListResultIterator) Response() ListResult { return iter.page.Response() } // Value returns the current value or a zero-initialized value if the // iterator has advanced beyond the end of the collection. func (iter ListResultIterator) Value() ResourceType { if !iter.page.NotDone() { return ResourceType{} } return iter.page.Values()[iter.i] } // Creates a new instance of the ListResultIterator type. func NewListResultIterator(page ListResultPage) ListResultIterator { return ListResultIterator{page: page} } // IsEmpty returns true if the ListResult contains no values. func (lr ListResult) IsEmpty() bool { return lr.Value == nil || len(*lr.Value) == 0 } // listResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (lr ListResult) listResultPreparer(ctx context.Context) (*http.Request, error) { if lr.NextLink == nil || len(to.String(lr.NextLink)) < 1 { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), autorest.AsJSON(), autorest.AsGet(), autorest.WithBaseURL(to.String(lr.NextLink))) } // ListResultPage contains a page of ResourceType values. type ListResultPage struct { fn func(context.Context, ListResult) (ListResult, error) lr ListResult } // NextWithContext advances to the next page of values. If there was an error making // the request the page does not advance and the error is returned. func (page *ListResultPage) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/ListResultPage.NextWithContext") defer func() { sc := -1 if page.Response().Response.Response != nil { sc = page.Response().Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() } next, err := page.fn(ctx, page.lr) if err != nil { return err } page.lr = next return nil } // Next advances to the next page of values. If there was an error making // the request the page does not advance and the error is returned. // Deprecated: Use NextWithContext() instead. func (page *ListResultPage) Next() error { return page.NextWithContext(context.Background()) } // NotDone returns true if the page enumeration should be started or is not yet complete. func (page ListResultPage) NotDone() bool { return !page.lr.IsEmpty() } // Response returns the raw server response from the last page request. func (page ListResultPage) Response() ListResult { return page.lr } // Values returns the slice of values for the current page or nil if there are no values. func (page ListResultPage) Values() []ResourceType { if page.lr.IsEmpty() { return nil } return *page.lr.Value } // Creates a new instance of the ListResultPage type. func NewListResultPage(getNextPage func(context.Context, ListResult) (ListResult, error)) ListResultPage { return ListResultPage{fn: getNextPage} } // NotificationListResponse the response of listUpgradeNotifications. type NotificationListResponse struct { autorest.Response `json:"-"` // Value - List of all notifications. Value *[]UpgradeNotification `json:"value,omitempty"` // NextLink - READ-ONLY; Link for next set of notifications. NextLink *string `json:"nextLink,omitempty"` } // Operation REST API operation type Operation struct { // Name - Operation name: {provider}/{resource}/{operation} Name *string `json:"name,omitempty"` // Display - The object that describes the operation. Display *OperationDisplay `json:"display,omitempty"` } // OperationDisplay the object that describes the operation. type OperationDisplay struct { // Provider - Friendly name of the resource provider Provider *string `json:"provider,omitempty"` // Operation - Operation type: read, write, delete, listKeys/action, etc. Operation *string `json:"operation,omitempty"` // Resource - Resource type on which the operation is performed. Resource *string `json:"resource,omitempty"` // Description - Friendly name of the operation Description *string `json:"description,omitempty"` } // OperationListResult result of the request to list REST API operations. It contains a list of operations // and a URL nextLink to get the next set of results. type OperationListResult struct { autorest.Response `json:"-"` // Value - List of operations supported by the resource provider. Value *[]Operation `json:"value,omitempty"` // NextLink - READ-ONLY; URL to get the next set of operation list results if there are any. NextLink *string `json:"nextLink,omitempty"` } // OperationListResultIterator provides access to a complete listing of Operation values. type OperationListResultIterator struct { i int page OperationListResultPage } // NextWithContext advances to the next value. If there was an error making // the request the iterator does not advance and the error is returned. func (iter *OperationListResultIterator) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultIterator.NextWithContext") defer func() { sc := -1 if iter.Response().Response.Response != nil { sc = iter.Response().Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() } iter.i++ if iter.i < len(iter.page.Values()) { return nil } err = iter.page.NextWithContext(ctx) if err != nil { iter.i-- return err } iter.i = 0 return nil } // Next advances to the next value. If there was an error making // the request the iterator does not advance and the error is returned. // Deprecated: Use NextWithContext() instead. func (iter *OperationListResultIterator) Next() error { return iter.NextWithContext(context.Background()) } // NotDone returns true if the enumeration should be started or is not yet complete. func (iter OperationListResultIterator) NotDone() bool { return iter.page.NotDone() && iter.i < len(iter.page.Values()) } // Response returns the raw server response from the last page request. func (iter OperationListResultIterator) Response() OperationListResult { return iter.page.Response() } // Value returns the current value or a zero-initialized value if the // iterator has advanced beyond the end of the collection. func (iter OperationListResultIterator) Value() Operation { if !iter.page.NotDone() { return Operation{} } return iter.page.Values()[iter.i] } // Creates a new instance of the OperationListResultIterator type. func NewOperationListResultIterator(page OperationListResultPage) OperationListResultIterator { return OperationListResultIterator{page: page} } // IsEmpty returns true if the ListResult contains no values. func (olr OperationListResult) IsEmpty() bool { return olr.Value == nil || len(*olr.Value) == 0 } // operationListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (olr OperationListResult) operationListResultPreparer(ctx context.Context) (*http.Request, error) { if olr.NextLink == nil || len(to.String(olr.NextLink)) < 1 { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), autorest.AsJSON(), autorest.AsGet(), autorest.WithBaseURL(to.String(olr.NextLink))) } // OperationListResultPage contains a page of Operation values. type OperationListResultPage struct { fn func(context.Context, OperationListResult) (OperationListResult, error) olr OperationListResult } // NextWithContext advances to the next page of values. If there was an error making // the request the page does not advance and the error is returned. func (page *OperationListResultPage) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultPage.NextWithContext") defer func() { sc := -1 if page.Response().Response.Response != nil { sc = page.Response().Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() } next, err := page.fn(ctx, page.olr) if err != nil { return err } page.olr = next return nil } // Next advances to the next page of values. If there was an error making // the request the page does not advance and the error is returned. // Deprecated: Use NextWithContext() instead. func (page *OperationListResultPage) Next() error { return page.NextWithContext(context.Background()) } // NotDone returns true if the page enumeration should be started or is not yet complete. func (page OperationListResultPage) NotDone() bool { return !page.olr.IsEmpty() } // Response returns the raw server response from the last page request. func (page OperationListResultPage) Response() OperationListResult { return page.olr } // Values returns the slice of values for the current page or nil if there are no values. func (page OperationListResultPage) Values() []Operation { if page.olr.IsEmpty() { return nil } return *page.olr.Value } // Creates a new instance of the OperationListResultPage type. func NewOperationListResultPage(getNextPage func(context.Context, OperationListResult) (OperationListResult, error)) OperationListResultPage { return OperationListResultPage{fn: getNextPage} } // PatchSchedule response to put/get patch schedules for Redis cache. type PatchSchedule struct { autorest.Response `json:"-"` // ScheduleEntries - List of patch schedules for a Redis cache. *ScheduleEntries `json:"properties,omitempty"` // ID - READ-ONLY; Resource ID. ID *string `json:"id,omitempty"` // Name - READ-ONLY; Resource name. Name *string `json:"name,omitempty"` // Type - READ-ONLY; Resource type. Type *string `json:"type,omitempty"` } // MarshalJSON is the custom marshaler for PatchSchedule. func (ps PatchSchedule) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) if ps.ScheduleEntries != nil { objectMap["properties"] = ps.ScheduleEntries } return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for PatchSchedule struct. func (ps *PatchSchedule) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { return err } for k, v := range m { switch k { case "properties": if v != nil { var scheduleEntries ScheduleEntries err = json.Unmarshal(*v, &scheduleEntries) if err != nil { return err } ps.ScheduleEntries = &scheduleEntries } case "id": if v != nil { var ID string err = json.Unmarshal(*v, &ID) if err != nil { return err } ps.ID = &ID } case "name": if v != nil { var name string err = json.Unmarshal(*v, &name) if err != nil { return err } ps.Name = &name } case "type": if v != nil { var typeVar string err = json.Unmarshal(*v, &typeVar) if err != nil { return err } ps.Type = &typeVar } } } return nil } // PatchScheduleListResult the response of list patch schedules Redis operation. type PatchScheduleListResult struct { autorest.Response `json:"-"` // Value - Results of the list patch schedules operation. Value *[]PatchSchedule `json:"value,omitempty"` // NextLink - READ-ONLY; Link for next page of results. NextLink *string `json:"nextLink,omitempty"` } // PatchScheduleListResultIterator provides access to a complete listing of PatchSchedule values. type PatchScheduleListResultIterator struct { i int page PatchScheduleListResultPage } // NextWithContext advances to the next value. If there was an error making // the request the iterator does not advance and the error is returned. func (iter *PatchScheduleListResultIterator) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/PatchScheduleListResultIterator.NextWithContext") defer func() { sc := -1 if iter.Response().Response.Response != nil { sc = iter.Response().Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() } iter.i++ if iter.i < len(iter.page.Values()) { return nil } err = iter.page.NextWithContext(ctx) if err != nil { iter.i-- return err } iter.i = 0 return nil } // Next advances to the next value. If there was an error making // the request the iterator does not advance and the error is returned. // Deprecated: Use NextWithContext() instead. func (iter *PatchScheduleListResultIterator) Next() error { return iter.NextWithContext(context.Background()) } // NotDone returns true if the enumeration should be started or is not yet complete. func (iter PatchScheduleListResultIterator) NotDone() bool { return iter.page.NotDone() && iter.i < len(iter.page.Values()) } // Response returns the raw server response from the last page request. func (iter PatchScheduleListResultIterator) Response() PatchScheduleListResult { return iter.page.Response() } // Value returns the current value or a zero-initialized value if the // iterator has advanced beyond the end of the collection. func (iter PatchScheduleListResultIterator) Value() PatchSchedule { if !iter.page.NotDone() { return PatchSchedule{} } return iter.page.Values()[iter.i] } // Creates a new instance of the PatchScheduleListResultIterator type. func NewPatchScheduleListResultIterator(page PatchScheduleListResultPage) PatchScheduleListResultIterator { return PatchScheduleListResultIterator{page: page} } // IsEmpty returns true if the ListResult contains no values. func (pslr PatchScheduleListResult) IsEmpty() bool { return pslr.Value == nil || len(*pslr.Value) == 0 } // patchScheduleListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (pslr PatchScheduleListResult) patchScheduleListResultPreparer(ctx context.Context) (*http.Request, error) { if pslr.NextLink == nil || len(to.String(pslr.NextLink)) < 1 { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), autorest.AsJSON(), autorest.AsGet(), autorest.WithBaseURL(to.String(pslr.NextLink))) } // PatchScheduleListResultPage contains a page of PatchSchedule values. type PatchScheduleListResultPage struct { fn func(context.Context, PatchScheduleListResult) (PatchScheduleListResult, error) pslr PatchScheduleListResult } // NextWithContext advances to the next page of values. If there was an error making // the request the page does not advance and the error is returned. func (page *PatchScheduleListResultPage) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/PatchScheduleListResultPage.NextWithContext") defer func() { sc := -1 if page.Response().Response.Response != nil { sc = page.Response().Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() } next, err := page.fn(ctx, page.pslr) if err != nil { return err } page.pslr = next return nil } // Next advances to the next page of values. If there was an error making // the request the page does not advance and the error is returned. // Deprecated: Use NextWithContext() instead. func (page *PatchScheduleListResultPage) Next() error { return page.NextWithContext(context.Background()) } // NotDone returns true if the page enumeration should be started or is not yet complete. func (page PatchScheduleListResultPage) NotDone() bool { return !page.pslr.IsEmpty() } // Response returns the raw server response from the last page request. func (page PatchScheduleListResultPage) Response() PatchScheduleListResult { return page.pslr } // Values returns the slice of values for the current page or nil if there are no values. func (page PatchScheduleListResultPage) Values() []PatchSchedule { if page.pslr.IsEmpty() { return nil } return *page.pslr.Value } // Creates a new instance of the PatchScheduleListResultPage type. func NewPatchScheduleListResultPage(getNextPage func(context.Context, PatchScheduleListResult) (PatchScheduleListResult, error)) PatchScheduleListResultPage { return PatchScheduleListResultPage{fn: getNextPage} } // Properties properties of the redis cache. type Properties struct { // RedisVersion - READ-ONLY; Redis version. RedisVersion *string `json:"redisVersion,omitempty"` // ProvisioningState - READ-ONLY; Redis instance provisioning status. Possible values include: 'Creating', 'Deleting', 'Disabled', 'Failed', 'Linking', 'Provisioning', 'RecoveringScaleFailure', 'Scaling', 'Succeeded', 'Unlinking', 'Unprovisioning', 'Updating' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` // HostName - READ-ONLY; Redis host name. HostName *string `json:"hostName,omitempty"` // Port - READ-ONLY; Redis non-SSL port. Port *int32 `json:"port,omitempty"` // SslPort - READ-ONLY; Redis SSL port. SslPort *int32 `json:"sslPort,omitempty"` // AccessKeys - READ-ONLY; The keys of the Redis cache - not set if this object is not the response to Create or Update redis cache AccessKeys *AccessKeys `json:"accessKeys,omitempty"` // LinkedServers - READ-ONLY; List of the linked servers associated with the cache LinkedServers *[]LinkedServer `json:"linkedServers,omitempty"` // Sku - The SKU of the Redis cache to deploy. Sku *Sku `json:"sku,omitempty"` // SubnetID - The full resource ID of a subnet in a virtual network to deploy the Redis cache in. Example format: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/Microsoft.{Network|ClassicNetwork}/VirtualNetworks/vnet1/subnets/subnet1 SubnetID *string `json:"subnetId,omitempty"` // StaticIP - Static IP address. Required when deploying a Redis cache inside an existing Azure Virtual Network. StaticIP *string `json:"staticIP,omitempty"` // RedisConfiguration - All Redis Settings. Few possible keys: rdb-backup-enabled,rdb-storage-connection-string,rdb-backup-frequency,maxmemory-delta,maxmemory-policy,notify-keyspace-events,maxmemory-samples,slowlog-log-slower-than,slowlog-max-len,list-max-ziplist-entries,list-max-ziplist-value,hash-max-ziplist-entries,hash-max-ziplist-value,set-max-intset-entries,zset-max-ziplist-entries,zset-max-ziplist-value etc. RedisConfiguration map[string]*string `json:"redisConfiguration"` // EnableNonSslPort - Specifies whether the non-ssl Redis server port (6379) is enabled. EnableNonSslPort *bool `json:"enableNonSslPort,omitempty"` // TenantSettings - A dictionary of tenant settings TenantSettings map[string]*string `json:"tenantSettings"` // ShardCount - The number of shards to be created on a Premium Cluster Cache. ShardCount *int32 `json:"shardCount,omitempty"` // MinimumTLSVersion - Optional: requires clients to use a specified TLS version (or higher) to connect (e,g, '1.0', '1.1', '1.2'). Possible values include: 'OneFullStopZero', 'OneFullStopOne', 'OneFullStopTwo' MinimumTLSVersion TLSVersion `json:"minimumTlsVersion,omitempty"` } // MarshalJSON is the custom marshaler for Properties. func (p Properties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) if p.Sku != nil { objectMap["sku"] = p.Sku } if p.SubnetID != nil { objectMap["subnetId"] = p.SubnetID } if p.StaticIP != nil { objectMap["staticIP"] = p.StaticIP } if p.RedisConfiguration != nil { objectMap["redisConfiguration"] = p.RedisConfiguration } if p.EnableNonSslPort != nil { objectMap["enableNonSslPort"] = p.EnableNonSslPort } if p.TenantSettings != nil { objectMap["tenantSettings"] = p.TenantSettings } if p.ShardCount != nil { objectMap["shardCount"] = p.ShardCount } if p.MinimumTLSVersion != "" { objectMap["minimumTlsVersion"] = p.MinimumTLSVersion } return json.Marshal(objectMap) } // ProxyResource the resource model definition for a ARM proxy resource. It will have everything other than // required location and tags type ProxyResource struct { // ID - READ-ONLY; Resource ID. ID *string `json:"id,omitempty"` // Name - READ-ONLY; Resource name. Name *string `json:"name,omitempty"` // Type - READ-ONLY; Resource type. Type *string `json:"type,omitempty"` } // RebootParameters specifies which Redis node(s) to reboot. type RebootParameters struct { // RebootType - Which Redis node(s) to reboot. Depending on this value data loss is possible. Possible values include: 'PrimaryNode', 'SecondaryNode', 'AllNodes' RebootType RebootType `json:"rebootType,omitempty"` // ShardID - If clustering is enabled, the ID of the shard to be rebooted. ShardID *int32 `json:"shardId,omitempty"` } // RegenerateKeyParameters specifies which Redis access keys to reset. type RegenerateKeyParameters struct { // KeyType - The Redis access key to regenerate. Possible values include: 'Primary', 'Secondary' KeyType KeyType `json:"keyType,omitempty"` } // Resource the Resource definition. type Resource struct { // ID - READ-ONLY; Resource ID. ID *string `json:"id,omitempty"` // Name - READ-ONLY; Resource name. Name *string `json:"name,omitempty"` // Type - READ-ONLY; Resource type. Type *string `json:"type,omitempty"` } // ResourceType a single Redis item in List or Get Operation. type ResourceType struct { autorest.Response `json:"-"` // Properties - Redis cache properties. *Properties `json:"properties,omitempty"` // Zones - A list of availability zones denoting where the resource needs to come from. Zones *[]string `json:"zones,omitempty"` // Tags - Resource tags. Tags map[string]*string `json:"tags"` // Location - The geo-location where the resource lives Location *string `json:"location,omitempty"` // ID - READ-ONLY; Resource ID. ID *string `json:"id,omitempty"` // Name - READ-ONLY; Resource name. Name *string `json:"name,omitempty"` // Type - READ-ONLY; Resource type. Type *string `json:"type,omitempty"` } // MarshalJSON is the custom marshaler for ResourceType. func (rt ResourceType) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) if rt.Properties != nil { objectMap["properties"] = rt.Properties } if rt.Zones != nil { objectMap["zones"] = rt.Zones } if rt.Tags != nil { objectMap["tags"] = rt.Tags } if rt.Location != nil { objectMap["location"] = rt.Location } return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for ResourceType struct. func (rt *ResourceType) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { return err } for k, v := range m { switch k { case "properties": if v != nil { var properties Properties err = json.Unmarshal(*v, &properties) if err != nil { return err } rt.Properties = &properties } case "zones": if v != nil { var zones []string err = json.Unmarshal(*v, &zones) if err != nil { return err } rt.Zones = &zones } case "tags": if v != nil { var tags map[string]*string err = json.Unmarshal(*v, &tags) if err != nil { return err } rt.Tags = tags } case "location": if v != nil { var location string err = json.Unmarshal(*v, &location) if err != nil { return err } rt.Location = &location } case "id": if v != nil { var ID string err = json.Unmarshal(*v, &ID) if err != nil { return err } rt.ID = &ID } case "name": if v != nil { var name string err = json.Unmarshal(*v, &name) if err != nil { return err } rt.Name = &name } case "type": if v != nil { var typeVar string err = json.Unmarshal(*v, &typeVar) if err != nil { return err } rt.Type = &typeVar } } } return nil } // ScheduleEntries list of patch schedules for a Redis cache. type ScheduleEntries struct { // ScheduleEntries - List of patch schedules for a Redis cache. ScheduleEntries *[]ScheduleEntry `json:"scheduleEntries,omitempty"` } // ScheduleEntry patch schedule entry for a Premium Redis Cache. type ScheduleEntry struct { // DayOfWeek - Day of the week when a cache can be patched. Possible values include: 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday', 'Everyday', 'Weekend' DayOfWeek DayOfWeek `json:"dayOfWeek,omitempty"` // StartHourUtc - Start hour after which cache patching can start. StartHourUtc *int32 `json:"startHourUtc,omitempty"` // MaintenanceWindow - ISO8601 timespan specifying how much time cache patching can take. MaintenanceWindow *string `json:"maintenanceWindow,omitempty"` } // Sku SKU parameters supplied to the create Redis operation. type Sku struct { // Name - The type of Redis cache to deploy. Valid values: (Basic, Standard, Premium). Possible values include: 'Basic', 'Standard', 'Premium' Name SkuName `json:"name,omitempty"` // Family - The SKU family to use. Valid values: (C, P). (C = Basic/Standard, P = Premium). Possible values include: 'C', 'P' Family SkuFamily `json:"family,omitempty"` // Capacity - The size of the Redis cache to deploy. Valid values: for C (Basic/Standard) family (0, 1, 2, 3, 4, 5, 6), for P (Premium) family (1, 2, 3, 4). Capacity *int32 `json:"capacity,omitempty"` } // TrackedResource the resource model definition for a ARM tracked top level resource type TrackedResource struct { // Tags - Resource tags. Tags map[string]*string `json:"tags"` // Location - The geo-location where the resource lives Location *string `json:"location,omitempty"` // ID - READ-ONLY; Resource ID. ID *string `json:"id,omitempty"` // Name - READ-ONLY; Resource name. Name *string `json:"name,omitempty"` // Type - READ-ONLY; Resource type. Type *string `json:"type,omitempty"` } // MarshalJSON is the custom marshaler for TrackedResource. func (tr TrackedResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) if tr.Tags != nil { objectMap["tags"] = tr.Tags } if tr.Location != nil { objectMap["location"] = tr.Location } return json.Marshal(objectMap) } // UpdateParameters parameters supplied to the Update Redis operation. type UpdateParameters struct { // UpdateProperties - Redis cache properties. *UpdateProperties `json:"properties,omitempty"` // Tags - Resource tags. Tags map[string]*string `json:"tags"` } // MarshalJSON is the custom marshaler for UpdateParameters. func (up UpdateParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) if up.UpdateProperties != nil { objectMap["properties"] = up.UpdateProperties } if up.Tags != nil { objectMap["tags"] = up.Tags } return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for UpdateParameters struct. func (up *UpdateParameters) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { return err } for k, v := range m { switch k { case "properties": if v != nil { var updateProperties UpdateProperties err = json.Unmarshal(*v, &updateProperties) if err != nil { return err } up.UpdateProperties = &updateProperties } case "tags": if v != nil { var tags map[string]*string err = json.Unmarshal(*v, &tags) if err != nil { return err } up.Tags = tags } } } return nil } // UpdateProperties patchable properties of the redis cache. type UpdateProperties struct { // Sku - The SKU of the Redis cache to deploy. Sku *Sku `json:"sku,omitempty"` // RedisConfiguration - All Redis Settings. Few possible keys: rdb-backup-enabled,rdb-storage-connection-string,rdb-backup-frequency,maxmemory-delta,maxmemory-policy,notify-keyspace-events,maxmemory-samples,slowlog-log-slower-than,slowlog-max-len,list-max-ziplist-entries,list-max-ziplist-value,hash-max-ziplist-entries,hash-max-ziplist-value,set-max-intset-entries,zset-max-ziplist-entries,zset-max-ziplist-value etc. RedisConfiguration map[string]*string `json:"redisConfiguration"` // EnableNonSslPort - Specifies whether the non-ssl Redis server port (6379) is enabled. EnableNonSslPort *bool `json:"enableNonSslPort,omitempty"` // TenantSettings - A dictionary of tenant settings TenantSettings map[string]*string `json:"tenantSettings"` // ShardCount - The number of shards to be created on a Premium Cluster Cache. ShardCount *int32 `json:"shardCount,omitempty"` // MinimumTLSVersion - Optional: requires clients to use a specified TLS version (or higher) to connect (e,g, '1.0', '1.1', '1.2'). Possible values include: 'OneFullStopZero', 'OneFullStopOne', 'OneFullStopTwo' MinimumTLSVersion TLSVersion `json:"minimumTlsVersion,omitempty"` } // MarshalJSON is the custom marshaler for UpdateProperties. func (up UpdateProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) if up.Sku != nil { objectMap["sku"] = up.Sku } if up.RedisConfiguration != nil { objectMap["redisConfiguration"] = up.RedisConfiguration } if up.EnableNonSslPort != nil { objectMap["enableNonSslPort"] = up.EnableNonSslPort } if up.TenantSettings != nil { objectMap["tenantSettings"] = up.TenantSettings } if up.ShardCount != nil { objectMap["shardCount"] = up.ShardCount } if up.MinimumTLSVersion != "" { objectMap["minimumTlsVersion"] = up.MinimumTLSVersion } return json.Marshal(objectMap) } // UpgradeNotification properties of upgrade notification. type UpgradeNotification struct { // Name - READ-ONLY; Name of upgrade notification. Name *string `json:"name,omitempty"` // Timestamp - READ-ONLY; Timestamp when upgrade notification occurred. Timestamp *date.Time `json:"timestamp,omitempty"` // UpsellNotification - READ-ONLY; Details about this upgrade notification UpsellNotification map[string]*string `json:"upsellNotification"` } // MarshalJSON is the custom marshaler for UpgradeNotification. func (un UpgradeNotification) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) return json.Marshal(objectMap) }
{ "pile_set_name": "Github" }
// ---------------------------------------------------------------------------- // feed_args.hpp : functions for processing each argument // (feed, feed_manip, and distribute) // ---------------------------------------------------------------------------- // Copyright Samuel Krempp 2003. Use, modification, and distribution are // subject to the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // See http://www.boost.org/libs/format for library home page // ---------------------------------------------------------------------------- #ifndef BOOST_FORMAT_FEED_ARGS_HPP #define BOOST_FORMAT_FEED_ARGS_HPP #include <boost/config.hpp> #include <boost/assert.hpp> #include <boost/throw_exception.hpp> #include <boost/format/format_class.hpp> #include <boost/format/group.hpp> #include <boost/format/detail/msvc_disambiguater.hpp> namespace boost { namespace io { namespace detail { template<class Ch, class Tr, class Alloc> void mk_str( std::basic_string<Ch,Tr, Alloc> & res, const Ch * beg, typename std::basic_string<Ch,Tr,Alloc>::size_type size, std::streamsize w, const Ch fill_char, std::ios_base::fmtflags f, const Ch prefix_space, // 0 if no space-padding bool center) // applies centered/left/right padding to the string [beg, beg+size[ // Effects : the result is placed in res. { typedef typename std::basic_string<Ch,Tr,Alloc>::size_type size_type; res.resize(0); if(w<=0 || static_cast<size_type>(w) <=size) { // no need to pad. res.reserve(size + !!prefix_space); if(prefix_space) res.append(1, prefix_space); if (size) res.append(beg, size); } else { std::streamsize n=static_cast<std::streamsize>(w-size-!!prefix_space); std::streamsize n_after = 0, n_before = 0; res.reserve(static_cast<size_type>(w)); // allocate once for the 2 inserts if(center) n_after = n/2, n_before = n - n_after; else if(f & std::ios_base::left) n_after = n; else n_before = n; // now make the res string : if(n_before) res.append(static_cast<size_type>(n_before), fill_char); if(prefix_space) res.append(1, prefix_space); if (size) res.append(beg, size); if(n_after) res.append(static_cast<size_type>(n_after), fill_char); } } // -mk_str(..) #if BOOST_WORKAROUND(__DECCXX_VER, BOOST_TESTED_AT(60590042)) // __DECCXX needs to be tricked to disambiguate this simple overload.. // the trick is in "boost/format/msvc_disambiguater.hpp" template< class Ch, class Tr, class T> inline void put_head (BOOST_IO_STD basic_ostream<Ch, Tr> & os, const T& x ) { disambiguater<Ch, Tr, T>::put_head(os, x, 1L); } template< class Ch, class Tr, class T> inline void put_last (BOOST_IO_STD basic_ostream<Ch, Tr> & os, const T& x ) { disambiguater<Ch, Tr, T>::put_last(os, x, 1L); } #else template< class Ch, class Tr, class T> inline void put_head (BOOST_IO_STD basic_ostream<Ch, Tr> &, const T& ) { } template< class Ch, class Tr, class T> inline void put_head( BOOST_IO_STD basic_ostream<Ch, Tr> & os, const group1<T>& x ) { os << group_head(x.a1_); // send the first N-1 items, not the last } template< class Ch, class Tr, class T> inline void put_last( BOOST_IO_STD basic_ostream<Ch, Tr> & os, const T& x ) { os << x ; } template< class Ch, class Tr, class T> inline void put_last( BOOST_IO_STD basic_ostream<Ch, Tr> & os, const group1<T>& x ) { os << group_last(x.a1_); // this selects the last element } #ifndef BOOST_NO_OVERLOAD_FOR_NON_CONST template< class Ch, class Tr, class T> inline void put_head( BOOST_IO_STD basic_ostream<Ch, Tr> &, T& ) { } template< class Ch, class Tr, class T> inline void put_last( BOOST_IO_STD basic_ostream<Ch, Tr> & os, T& x) { os << x ; } #endif #endif // -__DECCXX workaround template< class Ch, class Tr, class T> void call_put_head(BOOST_IO_STD basic_ostream<Ch, Tr> & os, const void* x) { put_head(os, *(typename ::boost::remove_reference<T>::type*)x); } template< class Ch, class Tr, class T> void call_put_last(BOOST_IO_STD basic_ostream<Ch, Tr> & os, const void* x) { put_last(os, *(T*)x); } template< class Ch, class Tr> struct put_holder { template<class T> put_holder(T& t) : arg(&t), put_head(&call_put_head<Ch, Tr, T>), put_last(&call_put_last<Ch, Tr, T>) {} const void* arg; void (*put_head)(BOOST_IO_STD basic_ostream<Ch, Tr> & os, const void* x); void (*put_last)(BOOST_IO_STD basic_ostream<Ch, Tr> & os, const void* x); }; template< class Ch, class Tr> inline void put_head( BOOST_IO_STD basic_ostream<Ch, Tr> & os, const put_holder<Ch, Tr>& t) { t.put_head(os, t.arg); } template< class Ch, class Tr> inline void put_last( BOOST_IO_STD basic_ostream<Ch, Tr> & os, const put_holder<Ch, Tr>& t) { t.put_last(os, t.arg); } template< class Ch, class Tr, class Alloc, class T> void put( T x, const format_item<Ch, Tr, Alloc>& specs, typename basic_format<Ch, Tr, Alloc>::string_type& res, typename basic_format<Ch, Tr, Alloc>::internal_streambuf_t & buf, io::detail::locale_t *loc_p = NULL) { #ifdef BOOST_MSVC // If std::min<unsigned> or std::max<unsigned> are already instantiated // at this point then we get a blizzard of warning messages when we call // those templates with std::size_t as arguments. Weird and very annoyning... #pragma warning(push) #pragma warning(disable:4267) #endif // does the actual conversion of x, with given params, into a string // using the supplied stringbuf. typedef typename basic_format<Ch, Tr, Alloc>::string_type string_type; typedef typename basic_format<Ch, Tr, Alloc>::format_item_t format_item_t; typedef typename string_type::size_type size_type; basic_oaltstringstream<Ch, Tr, Alloc> oss( &buf); if(loc_p != NULL) oss.imbue(*loc_p); specs.fmtstate_.apply_on(oss, loc_p); // the stream format state can be modified by manipulators in the argument : put_head( oss, x ); // in case x is a group, apply the manip part of it, // in order to find width const std::ios_base::fmtflags fl=oss.flags(); const bool internal = (fl & std::ios_base::internal) != 0; const std::streamsize w = oss.width(); const bool two_stepped_padding= internal && (w!=0); res.resize(0); if(! two_stepped_padding) { if(w>0) // handle padding via mk_str, not natively in stream oss.width(0); put_last( oss, x); const Ch * res_beg = buf.pbase(); Ch prefix_space = 0; if(specs.pad_scheme_ & format_item_t::spacepad) if(buf.pcount()== 0 || (res_beg[0] !=oss.widen('+') && res_beg[0] !=oss.widen('-') )) prefix_space = oss.widen(' '); size_type res_size = (std::min)( static_cast<size_type>(specs.truncate_ - !!prefix_space), buf.pcount() ); mk_str(res, res_beg, res_size, w, oss.fill(), fl, prefix_space, (specs.pad_scheme_ & format_item_t::centered) !=0 ); } else { // 2-stepped padding // internal can be implied by zeropad, or user-set. // left, right, and centered alignment overrule internal, // but spacepad or truncate might be mixed with internal (using manipulator) put_last( oss, x); // may pad const Ch * res_beg = buf.pbase(); size_type res_size = buf.pcount(); bool prefix_space=false; if(specs.pad_scheme_ & format_item_t::spacepad) if(buf.pcount()== 0 || (res_beg[0] !=oss.widen('+') && res_beg[0] !=oss.widen('-') )) prefix_space = true; if(res_size == static_cast<size_type>(w) && w<=specs.truncate_ && !prefix_space) { // okay, only one thing was printed and padded, so res is fine res.assign(res_beg, res_size); } else { // length w exceeded // either it was multi-output with first output padding up all width.. // either it was one big arg and we are fine. // Note that res_size<w is possible (in case of bad user-defined formatting) res.assign(res_beg, res_size); res_beg=NULL; // invalidate pointers. // make a new stream, to start re-formatting from scratch : buf.clear_buffer(); basic_oaltstringstream<Ch, Tr, Alloc> oss2( &buf); specs.fmtstate_.apply_on(oss2, loc_p); put_head( oss2, x ); oss2.width(0); if(prefix_space) oss2 << ' '; put_last(oss2, x ); if(buf.pcount()==0 && specs.pad_scheme_ & format_item_t::spacepad) { prefix_space =true; oss2 << ' '; } // we now have the minimal-length output const Ch * tmp_beg = buf.pbase(); size_type tmp_size = (std::min)(static_cast<size_type>(specs.truncate_), buf.pcount() ); if(static_cast<size_type>(w) <= tmp_size) { // minimal length is already >= w, so no padding (cool!) res.assign(tmp_beg, tmp_size); } else { // hum.. we need to pad (multi_output, or spacepad present) //find where we should pad size_type sz = (std::min)(res_size + (prefix_space ? 1 : 0), tmp_size); size_type i = prefix_space; for(; i<sz && tmp_beg[i] == res[i - (prefix_space ? 1 : 0)]; ++i) {} if(i>=tmp_size) i=prefix_space; res.assign(tmp_beg, i); std::streamsize d = w - static_cast<std::streamsize>(tmp_size); BOOST_ASSERT(d>0); res.append(static_cast<size_type>( d ), oss2.fill()); res.append(tmp_beg+i, tmp_size-i); BOOST_ASSERT(i+(tmp_size-i)+(std::max)(d,(std::streamsize)0) == static_cast<size_type>(w)); BOOST_ASSERT(res.size() == static_cast<size_type>(w)); } } } buf.clear_buffer(); #ifdef BOOST_MSVC #pragma warning(pop) #endif } // end- put(..) template< class Ch, class Tr, class Alloc, class T> void distribute (basic_format<Ch,Tr, Alloc>& self, T x) { // call put(x, ..) on every occurrence of the current argument : if(self.cur_arg_ >= self.num_args_) { if( self.exceptions() & too_many_args_bit ) boost::throw_exception(too_many_args(self.cur_arg_, self.num_args_)); else return; } for(unsigned long i=0; i < self.items_.size(); ++i) { if(self.items_[i].argN_ == self.cur_arg_) { put<Ch, Tr, Alloc, T> (x, self.items_[i], self.items_[i].res_, self.buf_, boost::get_pointer(self.loc_) ); } } } template<class Ch, class Tr, class Alloc, class T> basic_format<Ch, Tr, Alloc>& feed_impl (basic_format<Ch,Tr, Alloc>& self, T x) { if(self.dumped_) self.clear(); distribute<Ch, Tr, Alloc, T> (self, x); ++self.cur_arg_; if(self.bound_.size() != 0) { while( self.cur_arg_ < self.num_args_ && self.bound_[self.cur_arg_] ) ++self.cur_arg_; } return self; } template<class Ch, class Tr, class Alloc, class T> inline basic_format<Ch, Tr, Alloc>& feed (basic_format<Ch,Tr, Alloc>& self, T x) { return feed_impl<Ch, Tr, Alloc, const put_holder<Ch, Tr>&>(self, put_holder<Ch, Tr>(x)); } } // namespace detail } // namespace io } // namespace boost #endif // BOOST_FORMAT_FEED_ARGS_HPP
{ "pile_set_name": "Github" }
// Copyright 2015 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package draw provides image composition functions. // // See "The Go image/draw package" for an introduction to this package: // http://golang.org/doc/articles/image_draw.html // // This package is a superset of and a drop-in replacement for the image/draw // package in the standard library. package draw // This file just contains the API exported by the image/draw package in the // standard library. Other files in this package provide additional features. import ( "image" "image/draw" ) // Draw calls DrawMask with a nil mask. func Draw(dst Image, r image.Rectangle, src image.Image, sp image.Point, op Op) { draw.Draw(dst, r, src, sp, draw.Op(op)) } // DrawMask aligns r.Min in dst with sp in src and mp in mask and then // replaces the rectangle r in dst with the result of a Porter-Duff // composition. A nil mask is treated as opaque. func DrawMask(dst Image, r image.Rectangle, src image.Image, sp image.Point, mask image.Image, mp image.Point, op Op) { draw.DrawMask(dst, r, src, sp, mask, mp, draw.Op(op)) } // Drawer contains the Draw method. type Drawer = draw.Drawer // FloydSteinberg is a Drawer that is the Src Op with Floyd-Steinberg error // diffusion. var FloydSteinberg Drawer = floydSteinberg{} type floydSteinberg struct{} func (floydSteinberg) Draw(dst Image, r image.Rectangle, src image.Image, sp image.Point) { draw.FloydSteinberg.Draw(dst, r, src, sp) } // Image is an image.Image with a Set method to change a single pixel. type Image = draw.Image // Op is a Porter-Duff compositing operator. type Op = draw.Op const ( // Over specifies ``(src in mask) over dst''. Over Op = draw.Over // Src specifies ``src in mask''. Src Op = draw.Src ) // Quantizer produces a palette for an image. type Quantizer = draw.Quantizer
{ "pile_set_name": "Github" }
package client // import "github.com/docker/docker/client" import ( "bytes" "context" "encoding/json" "io/ioutil" "github.com/docker/docker/api/types/swarm" ) // ConfigInspectWithRaw returns the config information with raw data func (cli *Client) ConfigInspectWithRaw(ctx context.Context, id string) (swarm.Config, []byte, error) { if id == "" { return swarm.Config{}, nil, objectNotFoundError{object: "config", id: id} } if err := cli.NewVersionError("1.30", "config inspect"); err != nil { return swarm.Config{}, nil, err } resp, err := cli.get(ctx, "/configs/"+id, nil, nil) if err != nil { return swarm.Config{}, nil, wrapResponseError(err, resp, "config", id) } defer ensureReaderClosed(resp) body, err := ioutil.ReadAll(resp.body) if err != nil { return swarm.Config{}, nil, err } var config swarm.Config rdr := bytes.NewReader(body) err = json.NewDecoder(rdr).Decode(&config) return config, body, err }
{ "pile_set_name": "Github" }
/**************************************************************************** * Copyright (c) 1998-2014,2015 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * * "Software"), to deal in the Software without restriction, including * * without limitation the rights to use, copy, modify, merge, publish, * * distribute, distribute with modifications, sublicense, and/or sell * * copies of the Software, and to permit persons to whom the Software is * * furnished to do so, subject to the following conditions: * * * * The above copyright notice and this permission notice shall be included * * in all copies or substantial portions of the Software. * * * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * * * * Except as contained in this notice, the name(s) of the above copyright * * holders shall not be used in advertising or otherwise to promote the * * sale, use or other dealings in this Software without prior written * * authorization. * ****************************************************************************/ /**************************************************************************** * Author: Zeyd M. Ben-Halim <[email protected]> 1992,1995 * * and: Eric S. Raymond <[email protected]> * * and: Thomas E. Dickey 1996-on * * and: Juergen Pfeifer * ****************************************************************************/ /* * $Id: curses.priv.h,v 1.547 2015/06/27 01:22:16 tom Exp $ * * curses.priv.h * * Header file for curses library objects which are private to * the library. * */ #ifndef CURSES_PRIV_H #define CURSES_PRIV_H 1 /* *INDENT-OFF* */ #include <ncurses_dll.h> #ifdef __cplusplus extern "C" { #endif #include <ncurses_cfg.h> #if USE_RCS_IDS #define MODULE_ID(id) static const char Ident[] = id; #else #define MODULE_ID(id) /*nothing*/ #endif #include <stddef.h> /* for offsetof */ #include <stdlib.h> #include <string.h> #include <sys/types.h> #include <sys/stat.h> #if HAVE_UNISTD_H #include <unistd.h> #endif #if HAVE_SYS_BSDTYPES_H #include <sys/bsdtypes.h> /* needed for ISC */ #endif #if HAVE_LIMITS_H # include <limits.h> #elif HAVE_SYS_PARAM_H # include <sys/param.h> #endif #include <assert.h> #include <stdio.h> #include <errno.h> #if defined __hpux # ifndef EILSEQ # define EILSEQ 47 # endif #endif #ifndef PATH_MAX # if defined(_POSIX_PATH_MAX) # define PATH_MAX _POSIX_PATH_MAX # elif defined(MAXPATHLEN) # define PATH_MAX MAXPATHLEN # else # define PATH_MAX 255 /* the Posix minimum path-size */ # endif #endif #if DECL_ERRNO extern int errno; #endif /* Some systems have a broken 'select()', but workable 'poll()'. Use that */ #if HAVE_WORKING_POLL #define USE_FUNC_POLL 1 #if HAVE_POLL_H #include <poll.h> #else #include <sys/poll.h> #endif #else #define USE_FUNC_POLL 0 #endif #if HAVE_INTTYPES_H # include <inttypes.h> #else # if HAVE_STDINT_H # include <stdint.h> # endif #endif /* include signal.h before curses.h to work-around defect in glibc 2.1.3 */ #include <signal.h> /* Alessandro Rubini's GPM (general-purpose mouse) */ #if HAVE_LIBGPM && HAVE_GPM_H #define USE_GPM_SUPPORT 1 #else #define USE_GPM_SUPPORT 0 #endif /* QNX mouse support */ #if defined(__QNX__) && !defined(__QNXNTO__) #define USE_QNX_MOUSE 1 #else #define USE_QNX_MOUSE 0 #endif /* EMX mouse support */ #ifdef __EMX__ #define USE_EMX_MOUSE 1 #else #define USE_EMX_MOUSE 0 #endif /* kLIBC keyboard/mouse support */ #if defined(__OS2__) && defined(__KLIBC__) #define USE_KLIBC_KBD 1 #define USE_KLIBC_MOUSE 1 #else #define USE_KLIBC_KBD 0 #define USE_KLIBC_MOUSE 0 #endif #define DEFAULT_MAXCLICK 166 #define EV_MAX 8 /* size of mouse circular event queue */ /* * If we don't have signals to support it, don't add a sigwinch handler. * In any case, resizing is an extended feature. Use it if we've got it. */ #if !NCURSES_EXT_FUNCS #undef HAVE_SIZECHANGE #define HAVE_SIZECHANGE 0 #endif #if HAVE_SIZECHANGE && USE_SIGWINCH && defined(SIGWINCH) #define USE_SIZECHANGE 1 #else #define USE_SIZECHANGE 0 #undef USE_SIGWINCH #define USE_SIGWINCH 0 #endif /* * When building in the MSYS2 environment, the automatic discovery of * the path separator in configure doesn't work properly. So, if building * for MinGW, we enforce the correct Windows PATH separator */ #ifdef __MINGW32__ # ifdef NCURSES_PATHSEP # undef NCURSES_PATHSEP # endif # define NCURSES_PATHSEP ';' #endif /* * If desired, one can configure this, disabling environment variables that * point to custom terminfo/termcap locations. */ #ifdef USE_ROOT_ENVIRON #define use_terminfo_vars() 1 #else #define use_terminfo_vars() _nc_env_access() extern NCURSES_EXPORT(int) _nc_env_access (void); #endif /* * Not all platforms have memmove; some have an equivalent bcopy. (Some may * have neither). */ #if USE_OK_BCOPY #define memmove(d,s,n) bcopy(s,d,n) #elif USE_MY_MEMMOVE #define memmove(d,s,n) _nc_memmove(d,s,n) extern NCURSES_EXPORT(void *) _nc_memmove (void *, const void *, size_t); #endif /* * If we have va_copy(), use it for assigning va_list's. */ #if defined(HAVE___VA_COPY) #define begin_va_copy(dst,src) __va_copy(dst, src) #define end_va_copy(dst) va_end(dst) #elif defined(va_copy) || defined(HAVE_VA_COPY) #define begin_va_copy(dst,src) va_copy(dst, src) #define end_va_copy(dst) va_end(dst) #else #define begin_va_copy(dst,src) (dst) = (src) #define end_va_copy(dst) /* nothing */ #endif /* * Either/both S_ISxxx and/or S_IFxxx are defined in sys/types.h; some systems * lack one or the other. */ #ifndef S_ISDIR #define S_ISDIR(mode) ((mode & S_IFMT) == S_IFDIR) #endif #ifndef S_ISREG #define S_ISREG(mode) ((mode & S_IFMT) == S_IFREG) #endif /* * Scroll hints are useless when hashmap is used */ #if !USE_SCROLL_HINTS #if !USE_HASHMAP #define USE_SCROLL_HINTS 1 #else #define USE_SCROLL_HINTS 0 #endif #endif #if USE_SCROLL_HINTS #define if_USE_SCROLL_HINTS(stmt) stmt #else #define if_USE_SCROLL_HINTS(stmt) /*nothing*/ #endif #include <nc_string.h> /* * Options for terminal drivers, etc... */ #ifdef USE_TERM_DRIVER #define USE_SP_RIPOFF 1 #define USE_SP_TERMTYPE 1 #define USE_SP_WINDOWLIST 1 #endif /* * Note: ht/cbt expansion flakes out randomly under Linux 1.1.47, but only * when we're throwing control codes at the screen at high volume. To see * this, re-enable USE_HARD_TABS and run worm for a while. Other systems * probably don't want to define this either due to uncertainties about tab * delays and expansion in raw mode. */ #define TRIES struct tries typedef TRIES { TRIES *child; /* ptr to child. NULL if none */ TRIES *sibling; /* ptr to sibling. NULL if none */ unsigned char ch; /* character at this node */ unsigned short value; /* code of string so far. 0 if none. */ #undef TRIES } TRIES; /* * Common/troublesome character definitions */ #define StringOf(ch) {ch, 0} #define L_BRACE '{' #define R_BRACE '}' #define S_QUOTE '\'' #define D_QUOTE '"' #define VT_ACSC "``aaffggiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~" /* * Structure for palette tables */ #define MAXCOLUMNS 135 #define MAXLINES 66 #define FIFO_SIZE MAXCOLUMNS+2 /* for nocbreak mode input */ #define ACS_LEN 128 #define WINDOWLIST struct _win_list #if USE_WIDEC_SUPPORT #define _nc_bkgd _bkgrnd #else #undef _XOPEN_SOURCE_EXTENDED #undef _XPG5 #define _nc_bkgd _bkgd #define wgetbkgrnd(win, wch) ((*wch = win->_bkgd) != 0 ? OK : ERR) #define wbkgrnd wbkgd #endif #undef NCURSES_OPAQUE #define NCURSES_INTERNALS 1 #define NCURSES_OPAQUE 0 #include <curses.h> /* we'll use -Ipath directive to get the right one! */ typedef struct { NCURSES_COLOR_T red, green, blue; /* what color_content() returns */ NCURSES_COLOR_T r, g, b; /* params to init_color() */ int init; /* true if we called init_color() */ } color_t; /* * If curses.h did not expose the SCREEN-functions, then we do not need the * parameter in the corresponding unextended functions. */ #define USE_SP_FUNC_SUPPORT NCURSES_SP_FUNCS #define USE_EXT_SP_FUNC_SUPPORT (NCURSES_SP_FUNCS && NCURSES_EXT_FUNCS) #if NCURSES_SP_FUNCS #define SP_PARM sp /* use parameter */ #define NCURSES_SP_ARG SP_PARM #define NCURSES_SP_DCL SCREEN *NCURSES_SP_ARG #define NCURSES_SP_DCL0 NCURSES_SP_DCL #define NCURSES_SP_ARGx NCURSES_SP_ARG, #define NCURSES_SP_DCLx SCREEN *NCURSES_SP_ARGx #else #define SP_PARM SP /* use global variable */ #define NCURSES_SP_ARG #define NCURSES_SP_DCL #define NCURSES_SP_DCL0 void #define NCURSES_SP_ARGx #define NCURSES_SP_DCLx #endif #include <nc_panel.h> #define IsPreScreen(sp) (((sp) != 0) && sp->_prescreen) #define HasTerminal(sp) (((sp) != 0) && (0 != ((sp)->_term))) #define IsValidScreen(sp) (HasTerminal(sp) && !IsPreScreen(sp)) #if USE_REENTRANT #define CurTerm _nc_prescreen._cur_term #else #define CurTerm cur_term #endif #if NCURSES_SP_FUNCS #define TerminalOf(sp) ((sp) ? ((sp)->_term ? (sp)->_term : CurTerm) : CurTerm) #else #define TerminalOf(sp) CurTerm #endif #include <term.h> #include <nc_termios.h> /* * Reduce dependency on cur_term global by using terminfo data from SCREEN's * pointer to this data. */ #ifdef USE_SP_TERMTYPE #undef CUR #endif #define SP_TERMTYPE TerminalOf(sp)->type. #include <term_entry.h> #include <nc_tparm.h> /* * Simplify ifdef's for the "*_ATTR" macros in case italics are not configured. */ #ifdef A_ITALIC #define USE_ITALIC 1 #else #define USE_ITALIC 0 #define A_ITALIC 0 #endif /* * Use these macros internally, to make tracing less verbose. But leave the * option for compiling the tracing into the library. */ #if 1 #define ColorPair(n) NCURSES_BITS(n, 0) #define PairNumber(a) (NCURSES_CAST(int,(((unsigned long)(a) & A_COLOR) >> NCURSES_ATTR_SHIFT))) #else #define ColorPair(pair) COLOR_PAIR(pair) #define PairNumber(attr) PAIR_NUMBER(attr) #endif #define unColor(n) unColor2(AttrOf(n)) #define unColor2(a) ((a) & ALL_BUT_COLOR) /* * Extended-colors stores the color pair in a separate struct-member than the * attributes. But for compatibility, we handle most cases where a program * written for non-extended colors stores the color in the attributes by * checking for a color pair in both places. */ #if NCURSES_EXT_COLORS #define if_EXT_COLORS(stmt) stmt #define SetPair(value,p) SetPair2((value).ext_color, AttrOf(value), p) #define SetPair2(c,a,p) c = (p), \ a = (unColor2(a) | (A_COLOR & (unsigned) ColorPair(oldColor(c)))) #define GetPair(value) GetPair2((value).ext_color, AttrOf(value)) #define GetPair2(c,a) ((c) ? (c) : PairNumber(a)) #define oldColor(p) (((p) > 255) ? 255 : (p)) #define GET_WINDOW_PAIR(w) GetPair2((w)->_color, (w)->_attrs) #define SET_WINDOW_PAIR(w,p) (w)->_color = (p) #define SameAttrOf(a,b) (AttrOf(a) == AttrOf(b) && GetPair(a) == GetPair(b)) #define VIDATTR(sp,attr,pair) NCURSES_SP_NAME(vid_puts)(NCURSES_SP_ARGx attr, (short) pair, 0, NCURSES_OUTC_FUNC) #else /* !NCURSES_EXT_COLORS */ #define if_EXT_COLORS(stmt) /* nothing */ #define SetPair(value,p) RemAttr(value, A_COLOR), \ SetAttr(value, AttrOf(value) | (A_COLOR & (attr_t) ColorPair(p))) #define GetPair(value) PairNumber(AttrOf(value)) #define GET_WINDOW_PAIR(w) PairNumber(WINDOW_ATTRS(w)) #define SET_WINDOW_PAIR(w,p) WINDOW_ATTRS(w) &= ALL_BUT_COLOR, \ WINDOW_ATTRS(w) |= (A_COLOR & (attr_t) ColorPair(p)) #define SameAttrOf(a,b) (AttrOf(a) == AttrOf(b)) #define VIDATTR(sp,attr,pair) NCURSES_SP_NAME(vidputs)(NCURSES_SP_ARGx attr, NCURSES_OUTC_FUNC) #endif /* NCURSES_EXT_COLORS */ #define NCURSES_OUTC_FUNC NCURSES_SP_NAME(_nc_outch) #define NCURSES_PUTP2(name,value) NCURSES_SP_NAME(_nc_putp)(NCURSES_SP_ARGx name, value) #define NCURSES_PUTP2_FLUSH(name,value) NCURSES_SP_NAME(_nc_putp_flush)(NCURSES_SP_ARGx name, value) #if NCURSES_NO_PADDING #define GetNoPadding(sp) ((sp) ? (sp)->_no_padding : _nc_prescreen._no_padding) #define SetNoPadding(sp) _nc_set_no_padding(sp) extern NCURSES_EXPORT(void) _nc_set_no_padding(SCREEN *); #else #define GetNoPadding(sp) FALSE #define SetNoPadding(sp) /*nothing*/ #endif #define WINDOW_ATTRS(w) ((w)->_attrs) #define SCREEN_ATTRS(s) (*((s)->_current_attr)) #define GET_SCREEN_PAIR(s) GetPair(SCREEN_ATTRS(s)) #define SET_SCREEN_PAIR(s,p) SetPair(SCREEN_ATTRS(s), p) #if USE_REENTRANT || NCURSES_SP_FUNCS NCURSES_EXPORT(int *) _nc_ptr_Lines (SCREEN *); NCURSES_EXPORT(int *) _nc_ptr_Cols (SCREEN *); NCURSES_EXPORT(int *) _nc_ptr_Tabsize (SCREEN *); NCURSES_EXPORT(int *) _nc_ptr_Escdelay (SCREEN *); #endif #if USE_REENTRANT #define ptrLines(sp) (sp ? &(sp->_LINES) : &(_nc_prescreen._LINES)) #define ptrCols(sp) (sp ? &(sp->_COLS) : &(_nc_prescreen._COLS)) #define ptrTabsize(sp) (sp ? &(sp->_TABSIZE) : &(_nc_prescreen._TABSIZE)) #define ptrEscdelay(sp) (sp ? &(sp->_ESCDELAY) : &(_nc_prescreen._ESCDELAY)) #define SET_LINES(value) *_nc_ptr_Lines(SP_PARM) = value #define SET_COLS(value) *_nc_ptr_Cols(SP_PARM) = value #define SET_TABSIZE(value) *_nc_ptr_Tabsize(SP_PARM) = value #define SET_ESCDELAY(value) *_nc_ptr_Escdelay(SP_PARM) = value #else #define ptrLines(sp) &LINES #define ptrCols(sp) &COLS #define ptrTabsize(sp) &TABSIZE #define ptrEscdelay(sp) &ESCDELAY #define SET_LINES(value) LINES = value #define SET_COLS(value) COLS = value #define SET_TABSIZE(value) TABSIZE = value #define SET_ESCDELAY(value) ESCDELAY = value #endif #define TR_MUTEX(data) _tracef("%s@%d: me:%08lX COUNT:%2u/%2d/%6d/%2d/%s%9u: " #data, \ __FILE__, __LINE__, \ (unsigned long) (pthread_self()), \ data.__data.__lock, \ data.__data.__count, \ data.__data.__owner, \ data.__data.__kind, \ (data.__data.__nusers > 5) ? " OOPS " : "", \ data.__data.__nusers) #define TR_GLOBAL_MUTEX(name) TR_MUTEX(_nc_globals.mutex_##name) #if USE_WEAK_SYMBOLS #if defined(__GNUC__) # if defined __USE_ISOC99 # define _cat_pragma(exp) _Pragma(#exp) # define _weak_pragma(exp) _cat_pragma(weak name) # else # define _weak_pragma(exp) # endif # define _declare(name) __extension__ extern __typeof__(name) name # define weak_symbol(name) _weak_pragma(name) _declare(name) __attribute__((weak)) #else # undef USE_WEAK_SYMBOLS # define USE_WEAK_SYMBOLS 0 #endif #endif #ifdef USE_PTHREADS #if USE_REENTRANT #include <pthread.h> extern NCURSES_EXPORT(void) _nc_init_pthreads(void); extern NCURSES_EXPORT(void) _nc_mutex_init(pthread_mutex_t *); extern NCURSES_EXPORT(int) _nc_mutex_lock(pthread_mutex_t *); extern NCURSES_EXPORT(int) _nc_mutex_trylock(pthread_mutex_t *); extern NCURSES_EXPORT(int) _nc_mutex_unlock(pthread_mutex_t *); #define _nc_lock_global(name) _nc_mutex_lock(&_nc_globals.mutex_##name) #define _nc_try_global(name) _nc_mutex_trylock(&_nc_globals.mutex_##name) #define _nc_unlock_global(name) _nc_mutex_unlock(&_nc_globals.mutex_##name) #else #error POSIX threads requires --enable-reentrant option #endif #ifdef USE_PTHREADS # if USE_WEAK_SYMBOLS weak_symbol(pthread_sigmask); weak_symbol(pthread_kill); weak_symbol(pthread_self); weak_symbol(pthread_equal); weak_symbol(pthread_mutex_init); weak_symbol(pthread_mutex_lock); weak_symbol(pthread_mutex_unlock); weak_symbol(pthread_mutex_trylock); weak_symbol(pthread_mutexattr_settype); weak_symbol(pthread_mutexattr_init); extern NCURSES_EXPORT(int) _nc_sigprocmask(int, const sigset_t *, sigset_t *); # undef sigprocmask # define sigprocmask _nc_sigprocmask # endif #endif #if HAVE_NANOSLEEP #undef HAVE_NANOSLEEP #define HAVE_NANOSLEEP 0 /* nanosleep suspends all threads */ #endif #else /* !USE_PTHREADS */ #if USE_PTHREADS_EINTR # if USE_WEAK_SYMBOLS #include <pthread.h> weak_symbol(pthread_sigmask); weak_symbol(pthread_kill); weak_symbol(pthread_self); weak_symbol(pthread_equal); extern NCURSES_EXPORT(int) _nc_sigprocmask(int, const sigset_t *, sigset_t *); # undef sigprocmask # define sigprocmask _nc_sigprocmask # endif #endif /* USE_PTHREADS_EINTR */ #define _nc_init_pthreads() /* nothing */ #define _nc_mutex_init(obj) /* nothing */ #define _nc_lock_global(name) /* nothing */ #define _nc_try_global(name) 0 #define _nc_unlock_global(name) /* nothing */ #endif /* USE_PTHREADS */ /* * When using sp-funcs, locks are targeted to SCREEN-level granularity. * So the locking is done in the non-sp-func (which calls the sp-func) rather * than in the sp-func itself. * * Use the _nc_nonsp_XXX functions in the function using "NCURSES_SP_NAME()". * Use the _nc_sp_XXX functions in the function using "#if NCURSES_SP_FUNCS". */ #if NCURSES_SP_FUNCS #define _nc_nonsp_lock_global(name) /* nothing */ #define _nc_nonsp_try_global(name) 0 #define _nc_nonsp_unlock_global(name) /* nothing */ #define _nc_sp_lock_global(name) _nc_lock_global(name) #define _nc_sp_try_global(name) _nc_try_global(name) #define _nc_sp_unlock_global(name) _nc_unlock_global(name) #else #define _nc_nonsp_lock_global(name) _nc_lock_global(name) #define _nc_nonsp_try_global(name) _nc_try_global(name) #define _nc_nonsp_unlock_global(name) _nc_unlock_global(name) #define _nc_sp_lock_global(name) /* nothing */ #define _nc_sp_try_global(name) 0 #define _nc_sp_unlock_global(name) /* nothing */ #endif #if HAVE_GETTIMEOFDAY # define PRECISE_GETTIME 1 # define TimeType struct timeval #else # define PRECISE_GETTIME 0 # define TimeType time_t #endif /* * Definitions for color pairs */ typedef unsigned colorpair_t; /* type big enough to store PAIR_OF() */ #define C_SHIFT 9 /* we need more bits than there are colors */ #define C_MASK ((1 << C_SHIFT) - 1) #define PAIR_OF(fg, bg) (colorpair_t) ((((fg) & C_MASK) << C_SHIFT) | ((bg) & C_MASK)) #define FORE_OF(c) (((c) >> C_SHIFT) & C_MASK) #define BACK_OF(c) ((c) & C_MASK) #define isDefaultColor(c) ((c) >= COLOR_DEFAULT || (c) < 0) #define COLOR_DEFAULT C_MASK #if defined(USE_BUILD_CC) || (defined(USE_TERMLIB) && !defined(NEED_NCURSES_CH_T)) #undef NCURSES_CH_T /* this is not a termlib feature */ #define NCURSES_CH_T void /* ...but we need a pointer in SCREEN */ #endif /* USE_TERMLIB */ #ifndef USE_TERMLIB struct ldat { NCURSES_CH_T *text; /* text of the line */ NCURSES_SIZE_T firstchar; /* first changed character in the line */ NCURSES_SIZE_T lastchar; /* last changed character in the line */ NCURSES_SIZE_T oldindex; /* index of the line at last update */ }; #endif /* USE_TERMLIB */ typedef enum { M_XTERM = -1 /* use xterm's mouse tracking? */ ,M_NONE = 0 /* no mouse device */ #if USE_GPM_SUPPORT ,M_GPM /* use GPM */ #endif #if USE_SYSMOUSE ,M_SYSMOUSE /* FreeBSD sysmouse on console */ #endif #ifdef USE_TERM_DRIVER ,M_TERM_DRIVER /* Win32 console, etc */ #endif } MouseType; typedef enum { MF_X10 = 0 /* conventional 3-byte format */ , MF_SGR1006 /* xterm private mode 1006, SGR-style */ #ifdef EXP_XTERM_1005 , MF_XTERM_1005 /* xterm UTF-8 private mode 1005 */ #endif } MouseFormat; /* * Structures for scrolling. */ typedef struct { unsigned long hashval; int oldcount, newcount; int oldindex, newindex; } HASHMAP; /* * Structures for soft labels. */ struct _SLK; #if !(defined(USE_TERMLIB) || defined(USE_BUILD_CC)) typedef struct { char *ent_text; /* text for the label */ char *form_text; /* formatted text (left/center/...) */ int ent_x; /* x coordinate of this field */ char dirty; /* this label has changed */ char visible; /* field is visible */ } slk_ent; typedef struct _SLK { bool dirty; /* all labels have changed */ bool hidden; /* soft labels are hidden */ WINDOW *win; slk_ent *ent; short maxlab; /* number of available labels */ short labcnt; /* number of allocated labels */ short maxlen; /* length of labels */ NCURSES_CH_T attr; /* soft label attribute */ } SLK; #endif /* USE_TERMLIB */ typedef struct { WINDOW *win; /* the window used in the hook */ int line; /* lines to take, < 0 => from bottom*/ int (*hook)(WINDOW *, int); /* callback for user */ } ripoff_t; #if USE_GPM_SUPPORT #undef buttons /* term.h defines this, and gpm uses it! */ #include <gpm.h> #if USE_WEAK_SYMBOLS weak_symbol(Gpm_Wgetch); #endif #ifdef HAVE_LIBDL /* link dynamically to GPM */ typedef int *TYPE_gpm_fd; typedef int (*TYPE_Gpm_Open) (Gpm_Connect *, int); typedef int (*TYPE_Gpm_Close) (void); typedef int (*TYPE_Gpm_GetEvent) (Gpm_Event *); #define my_gpm_fd SP_PARM->_mouse_gpm_fd #define my_Gpm_Open SP_PARM->_mouse_Gpm_Open #define my_Gpm_Close SP_PARM->_mouse_Gpm_Close #define my_Gpm_GetEvent SP_PARM->_mouse_Gpm_GetEvent #else /* link statically to GPM */ #define my_gpm_fd &gpm_fd #define my_Gpm_Open Gpm_Open #define my_Gpm_Close Gpm_Close #define my_Gpm_GetEvent Gpm_GetEvent #endif /* HAVE_LIBDL */ #endif /* USE_GPM_SUPPORT */ typedef struct { long sequence; bool last_used; char *fix_sgr0; /* this holds the filtered sgr0 string */ char *last_bufp; /* help with fix_sgr0 leak */ TERMINAL *last_term; } TGETENT_CACHE; #define TGETENT_MAX 4 /* * State of tparm(). */ #define STACKSIZE 20 typedef struct { union { int num; char *str; } data; bool num_type; } STACK_FRAME; #define NUM_VARS 26 typedef struct { #ifdef TRACE const char *tname; #endif const char *tparam_base; STACK_FRAME stack[STACKSIZE]; int stack_ptr; char *out_buff; size_t out_size; size_t out_used; char *fmt_buff; size_t fmt_size; int dynamic_var[NUM_VARS]; int static_vars[NUM_VARS]; } TPARM_STATE; typedef struct { char *text; size_t size; } TRACEBUF; /* * The filesystem database normally uses a single-letter for the lower level * of directories. Use a hexadecimal code for filesystems which do not * preserve mixed-case names. */ #if MIXEDCASE_FILENAMES #define LEAF_FMT "%c" #define LEAF_LEN 1 #else #define LEAF_FMT "%02x" #define LEAF_LEN 2 #endif /* * TRACEMSE_FMT is no longer than 80 columns, there are 5 numbers that * could at most have 10 digits, and the mask contains no more than 32 bits * with each bit representing less than 15 characters. Usually the whole * string is less than 80 columns, but this buffer size is an absolute * limit. */ #define TRACEMSE_MAX (80 + (5 * 10) + (32 * 15)) #define TRACEMSE_FMT "id %2d at (%2d, %2d, %2d) state %4lx = {" /* } */ #ifdef USE_TERM_DRIVER struct DriverTCB; /* Terminal Control Block forward declaration */ #define INIT_TERM_DRIVER() _nc_globals.term_driver = _nc_get_driver #else #define INIT_TERM_DRIVER() /* nothing */ #endif typedef struct { const char *name; char *value; } ITERATOR_VARS; /* * Global data which is not specific to a screen. */ typedef struct { SIG_ATOMIC_T have_sigtstp; SIG_ATOMIC_T have_sigwinch; SIG_ATOMIC_T cleanup_nested; bool init_signals; bool init_screen; char *comp_sourcename; char *comp_termtype; bool have_tic_directory; bool keep_tic_directory; const char *tic_directory; char *dbi_list; int dbi_size; char *first_name; char **keyname_table; int init_keyname; int slk_format; char *safeprint_buf; size_t safeprint_used; TGETENT_CACHE tgetent_cache[TGETENT_MAX]; int tgetent_index; long tgetent_sequence; char *dbd_blob; /* string-heap for dbd_list[] */ char **dbd_list; /* distinct places to look for data */ int dbd_size; /* length of dbd_list[] */ time_t dbd_time; /* cache last updated */ ITERATOR_VARS dbd_vars[dbdLAST]; #ifndef USE_SP_WINDOWLIST WINDOWLIST *_nc_windowlist; #define WindowList(sp) _nc_globals._nc_windowlist #endif #if USE_HOME_TERMINFO char *home_terminfo; #endif #if !USE_SAFE_SPRINTF int safeprint_cols; int safeprint_rows; #endif #ifdef USE_TERM_DRIVER int (*term_driver)(struct DriverTCB*, const char*, int*); #endif #ifdef TRACE bool init_trace; char trace_fname[PATH_MAX]; int trace_level; FILE *trace_fp; char *tracearg_buf; size_t tracearg_used; TRACEBUF *tracebuf_ptr; size_t tracebuf_used; char tracechr_buf[40]; char *tracedmp_buf; size_t tracedmp_used; unsigned char *tracetry_buf; size_t tracetry_used; char traceatr_color_buf[2][80]; int traceatr_color_sel; int traceatr_color_last; #if !defined(USE_PTHREADS) && USE_REENTRANT int nested_tracef; #endif #endif /* TRACE */ #ifdef USE_PTHREADS pthread_mutex_t mutex_curses; pthread_mutex_t mutex_tst_tracef; pthread_mutex_t mutex_tracef; int nested_tracef; int use_pthreads; #define _nc_use_pthreads _nc_globals.use_pthreads #endif #if USE_PTHREADS_EINTR pthread_t read_thread; /* The reading thread */ #endif } NCURSES_GLOBALS; extern NCURSES_EXPORT_VAR(NCURSES_GLOBALS) _nc_globals; #define N_RIPS 5 /* * Global data which can be swept up into a SCREEN when one is created. * It may be modified before the next SCREEN is created. */ typedef struct { bool use_env; bool filter_mode; attr_t previous_attr; #ifndef USE_SP_RIPOFF ripoff_t rippedoff[N_RIPS]; ripoff_t *rsp; #endif TPARM_STATE tparm_state; TTY *saved_tty; /* savetty/resetty information */ #if NCURSES_NO_PADDING bool _no_padding; /* flag to set if padding disabled */ #endif NCURSES_SP_OUTC _outch; /* output handler if not putc */ #if BROKEN_LINKER || USE_REENTRANT chtype *real_acs_map; int _LINES; int _COLS; int _TABSIZE; int _ESCDELAY; TERMINAL *_cur_term; #ifdef TRACE long _outchars; const char *_tputs_trace; #endif #endif bool use_tioctl; } NCURSES_PRESCREEN; /* * Use screen-specific ripoff data (for softkeys) rather than global. */ #ifdef USE_SP_RIPOFF #define safe_ripoff_sp (sp)->rsp #define safe_ripoff_stack (sp)->rippedoff #else #define safe_ripoff_sp _nc_prescreen.rsp #define safe_ripoff_stack _nc_prescreen.rippedoff #endif extern NCURSES_EXPORT_VAR(NCURSES_PRESCREEN) _nc_prescreen; /* * The SCREEN structure. */ struct screen { int _ifd; /* input file descriptor for screen */ int _ofd; /* output file descriptor for screen */ FILE *_ofp; /* output file ptr for screen */ char *out_buffer; /* output buffer */ size_t out_limit; /* output buffer size */ size_t out_inuse; /* output buffer current use */ bool _filtered; /* filter() was called */ bool _prescreen; /* is in prescreen phase */ bool _use_env; /* LINES & COLS from environment? */ int _checkfd; /* filedesc for typeahead check */ TERMINAL *_term; /* terminal type information */ TTY _saved_tty; /* savetty/resetty information */ NCURSES_SIZE_T _lines; /* screen lines */ NCURSES_SIZE_T _columns; /* screen columns */ NCURSES_SIZE_T _lines_avail; /* lines available for stdscr */ NCURSES_SIZE_T _topstolen; /* lines stolen from top */ WINDOW *_curscr; /* current screen */ WINDOW *_newscr; /* virtual screen to be updated to */ WINDOW *_stdscr; /* screen's full-window context */ #define CurScreen(sp) (sp)->_curscr #define NewScreen(sp) (sp)->_newscr #define StdScreen(sp) (sp)->_stdscr TRIES *_keytry; /* "Try" for use with keypad mode */ TRIES *_key_ok; /* Disabled keys via keyok(,FALSE) */ bool _tried; /* keypad mode was initialized */ bool _keypad_on; /* keypad mode is currently on */ bool _called_wgetch; /* check for recursion in wgetch() */ int _fifo[FIFO_SIZE]; /* input push-back buffer */ short _fifohead, /* head of fifo queue */ _fifotail, /* tail of fifo queue */ _fifopeek, /* where to peek for next char */ _fifohold; /* set if breakout marked */ int _endwin; /* are we out of window mode? */ NCURSES_CH_T *_current_attr; /* holds current attributes set */ int _coloron; /* is color enabled? */ int _color_defs; /* are colors modified */ int _cursor; /* visibility of the cursor */ int _cursrow; /* physical cursor row */ int _curscol; /* physical cursor column */ bool _notty; /* true if we cannot switch non-tty */ int _nl; /* True if NL -> CR/NL is on */ int _raw; /* True if in raw mode */ int _cbreak; /* 1 if in cbreak mode */ /* > 1 if in halfdelay mode */ int _echo; /* True if echo on */ int _use_meta; /* use the meta key? */ struct _SLK *_slk; /* ptr to soft key struct / NULL */ int slk_format; /* selected format for this screen */ /* cursor movement costs; units are 10ths of milliseconds */ #if NCURSES_NO_PADDING bool _no_padding; /* flag to set if padding disabled */ #endif int _char_padding; /* cost of character put */ int _cr_cost; /* cost of (carriage_return) */ int _cup_cost; /* cost of (cursor_address) */ int _home_cost; /* cost of (cursor_home) */ int _ll_cost; /* cost of (cursor_to_ll) */ #if USE_HARD_TABS int _ht_cost; /* cost of (tab) */ int _cbt_cost; /* cost of (backtab) */ #endif /* USE_HARD_TABS */ int _cub1_cost; /* cost of (cursor_left) */ int _cuf1_cost; /* cost of (cursor_right) */ int _cud1_cost; /* cost of (cursor_down) */ int _cuu1_cost; /* cost of (cursor_up) */ int _cub_cost; /* cost of (parm_cursor_left) */ int _cuf_cost; /* cost of (parm_cursor_right) */ int _cud_cost; /* cost of (parm_cursor_down) */ int _cuu_cost; /* cost of (parm_cursor_up) */ int _hpa_cost; /* cost of (column_address) */ int _vpa_cost; /* cost of (row_address) */ /* used in tty_update.c, must be chars */ int _ed_cost; /* cost of (clr_eos) */ int _el_cost; /* cost of (clr_eol) */ int _el1_cost; /* cost of (clr_bol) */ int _dch1_cost; /* cost of (delete_character) */ int _ich1_cost; /* cost of (insert_character) */ int _dch_cost; /* cost of (parm_dch) */ int _ich_cost; /* cost of (parm_ich) */ int _ech_cost; /* cost of (erase_chars) */ int _rep_cost; /* cost of (repeat_char) */ int _hpa_ch_cost; /* cost of (column_address) */ int _cup_ch_cost; /* cost of (cursor_address) */ int _cuf_ch_cost; /* cost of (parm_cursor_right) */ int _inline_cost; /* cost of inline-move */ int _smir_cost; /* cost of (enter_insert_mode) */ int _rmir_cost; /* cost of (exit_insert_mode) */ int _ip_cost; /* cost of (insert_padding) */ /* used in lib_mvcur.c */ char * _address_cursor; /* used in tty_update.c */ int _scrolling; /* 1 if terminal's smart enough to */ /* used in lib_color.c */ color_t *_color_table; /* screen's color palette */ int _color_count; /* count of colors in palette */ colorpair_t *_color_pairs; /* screen's color pair list */ int _pair_count; /* count of color pairs */ int _pair_limit; /* actual limit of color-pairs */ #if NCURSES_EXT_FUNCS bool _assumed_color; /* use assumed colors */ bool _default_color; /* use default colors */ bool _has_sgr_39_49; /* has ECMA default color support */ int _default_fg; /* assumed default foreground */ int _default_bg; /* assumed default background */ int _default_pairs; /* count pairs using default color */ #endif chtype _ok_attributes; /* valid attributes for terminal */ chtype _xmc_suppress; /* attributes to suppress if xmc */ chtype _xmc_triggers; /* attributes to process if xmc */ chtype * _acs_map; /* the real alternate-charset map */ bool * _screen_acs_map; /* used in lib_vidattr.c */ bool _use_rmso; /* true if we may use 'rmso' */ bool _use_rmul; /* true if we may use 'rmul' */ #if USE_ITALIC bool _use_ritm; /* true if we may use 'ritm' */ #endif #if USE_KLIBC_KBD bool _extended_key; /* true if an extended key */ #endif /* * These data correspond to the state of the idcok() and idlok() * functions. A caveat is in order here: the XSI and SVr4 * documentation specify that these functions apply to the window which * is given as an argument. However, ncurses implements this logic * only for the newscr/curscr update process, _not_ per-window. */ bool _nc_sp_idlok; bool _nc_sp_idcok; /* * These are the data that support the mouse interface. */ bool _mouse_initialized; MouseType _mouse_type; int _maxclick; bool (*_mouse_event) (SCREEN *); bool (*_mouse_inline)(SCREEN *); bool (*_mouse_parse) (SCREEN *, int); void (*_mouse_resume)(SCREEN *); void (*_mouse_wrap) (SCREEN *); int _mouse_fd; /* file-descriptor, if any */ bool _mouse_active; /* true if initialized */ mmask_t _mouse_mask; /* set via mousemask() */ mmask_t _mouse_mask2; /* OR's in press/release bits */ mmask_t _mouse_bstate; MouseFormat _mouse_format; /* type of xterm mouse protocol */ NCURSES_CONST char *_mouse_xtermcap; /* string to enable/disable mouse */ MEVENT _mouse_events[EV_MAX]; /* hold the last mouse event seen */ MEVENT *_mouse_eventp; /* next free slot in event queue */ #if USE_GPM_SUPPORT bool _mouse_gpm_loaded; bool _mouse_gpm_found; #ifdef HAVE_LIBDL void *_dlopen_gpm; TYPE_gpm_fd _mouse_gpm_fd; TYPE_Gpm_Open _mouse_Gpm_Open; TYPE_Gpm_Close _mouse_Gpm_Close; TYPE_Gpm_GetEvent _mouse_Gpm_GetEvent; #endif Gpm_Connect _mouse_gpm_connect; #endif /* USE_GPM_SUPPORT */ #if USE_EMX_MOUSE int _emxmouse_wfd; int _emxmouse_thread; int _emxmouse_activated; char _emxmouse_buttons[4]; #endif #if USE_SYSMOUSE MEVENT _sysmouse_fifo[FIFO_SIZE]; int _sysmouse_head; int _sysmouse_tail; int _sysmouse_char_width; /* character width */ int _sysmouse_char_height; /* character height */ int _sysmouse_old_buttons; int _sysmouse_new_buttons; #endif #ifdef USE_TERM_DRIVER MEVENT _drv_mouse_fifo[FIFO_SIZE]; int _drv_mouse_head; int _drv_mouse_tail; int _drv_mouse_old_buttons; int _drv_mouse_new_buttons; #endif /* * This supports automatic resizing */ #if USE_SIZECHANGE int (*_resize)(NCURSES_SP_DCLx int y, int x); int (*_ungetch)(SCREEN *, int); #endif /* * These are data that support the proper handling of the panel stack on an * per screen basis. */ struct panelhook _panelHook; bool _sig_winch; SCREEN *_next_screen; /* hashes for old and new lines */ unsigned long *oldhash, *newhash; HASHMAP *hashtab; int hashtab_len; int *_oldnum_list; int _oldnum_size; NCURSES_SP_OUTC _outch; /* output handler if not putc */ int _legacy_coding; /* see use_legacy_coding() */ #if USE_REENTRANT char _ttytype[NAMESIZE]; int _ESCDELAY; int _TABSIZE; int _LINES; int _COLS; #ifdef TRACE long _outchars; const char *_tputs_trace; #endif #endif #ifdef TRACE char tracechr_buf[40]; char tracemse_buf[TRACEMSE_MAX]; #endif #ifdef USE_SP_WINDOWLIST WINDOWLIST* _windowlist; #define WindowList(sp) (sp)->_windowlist #endif NCURSES_OUTC jump; ripoff_t rippedoff[N_RIPS]; ripoff_t *rsp; /* * ncurses/ncursesw are the same up to this point. */ #if USE_WIDEC_SUPPORT /* recent versions of 'screen' have partially-working support for * UTF-8, but do not permit ACS at the same time (see tty_update.c). */ bool _screen_acs_fix; bool _screen_unicode; #endif bool _use_tioctl; }; extern NCURSES_EXPORT_VAR(SCREEN *) _nc_screen_chain; extern NCURSES_EXPORT_VAR(SIG_ATOMIC_T) _nc_have_sigwinch; WINDOWLIST { WINDOWLIST *next; SCREEN *screen; /* screen containing the window */ WINDOW win; /* WINDOW_EXT() needs to account for offset */ #if NCURSES_WIDECHAR char addch_work[(MB_LEN_MAX * 9) + 1]; unsigned addch_used; /* number of bytes in addch_work[] */ int addch_x; /* x-position for addch_work[] */ int addch_y; /* y-position for addch_work[] */ #endif }; #define WINDOW_EXT(w,m) (((WINDOWLIST *)((void *)((char *)(w) - offsetof(WINDOWLIST, win))))->m) #define SP_PRE_INIT(sp) \ sp->_cursrow = -1; \ sp->_curscol = -1; \ sp->_nl = TRUE; \ sp->_raw = FALSE; \ sp->_cbreak = 0; \ sp->_echo = TRUE; \ sp->_fifohead = -1; \ sp->_endwin = TRUE; \ sp->_cursor = -1; \ WindowList(sp) = 0; \ sp->_outch = NCURSES_OUTC_FUNC; \ sp->jump = 0 \ /* usually in <limits.h> */ #ifndef UCHAR_MAX #define UCHAR_MAX 255 #endif /* The terminfo source is assumed to be 7-bit ASCII */ #define is7bits(c) ((unsigned)(c) < 128) /* Checks for isprint() should be done on 8-bit characters (non-wide) */ #define is8bits(c) ((unsigned)(c) <= UCHAR_MAX) #ifndef min #define min(a,b) ((a) > (b) ? (b) : (a)) #endif #ifndef max #define max(a,b) ((a) < (b) ? (b) : (a)) #endif /* usually in <unistd.h> */ #ifndef STDIN_FILENO #define STDIN_FILENO 0 #endif #ifndef STDOUT_FILENO #define STDOUT_FILENO 1 #endif #ifndef STDERR_FILENO #define STDERR_FILENO 2 #endif #ifndef EXIT_SUCCESS #define EXIT_SUCCESS 0 #endif #ifndef EXIT_FAILURE #define EXIT_FAILURE 1 #endif #ifndef R_OK #define R_OK 4 /* Test for read permission. */ #endif #ifndef W_OK #define W_OK 2 /* Test for write permission. */ #endif #ifndef X_OK #define X_OK 1 /* Test for execute permission. */ #endif #ifndef F_OK #define F_OK 0 /* Test for existence. */ #endif #if HAVE_FCNTL_H #include <fcntl.h> /* may define O_BINARY */ #endif #ifndef O_BINARY #define O_BINARY 0 #endif #ifdef TRACE #if USE_REENTRANT #define COUNT_OUTCHARS(n) _nc_count_outchars(n); #else #define COUNT_OUTCHARS(n) _nc_outchars += (n); #endif #else #define COUNT_OUTCHARS(n) /* nothing */ #endif #define RESET_OUTCHARS() COUNT_OUTCHARS(-_nc_outchars) #define UChar(c) ((unsigned char)(c)) #define UShort(c) ((unsigned short)(c)) #define ChCharOf(c) ((chtype)(c) & (chtype)A_CHARTEXT) #define ChAttrOf(c) ((chtype)(c) & (chtype)A_ATTRIBUTES) #ifndef MB_LEN_MAX #define MB_LEN_MAX 8 /* should be >= MB_CUR_MAX, but that may be a function */ #endif #if USE_WIDEC_SUPPORT /* { */ #define isEILSEQ(status) (((size_t)status == (size_t)-1) && (errno == EILSEQ)) #define init_mb(state) memset(&state, 0, sizeof(state)) #if NCURSES_EXT_COLORS #define NulColor , 0 #else #define NulColor /* nothing */ #endif #define NulChar 0,0,0,0 /* FIXME: see CCHARW_MAX */ #define CharOf(c) ((c).chars[0]) #define AttrOf(c) ((c).attr) #define AddAttr(c,a) AttrOf(c) |= ((a) & A_ATTRIBUTES) #define RemAttr(c,a) AttrOf(c) &= ~((a) & A_ATTRIBUTES) #define SetAttr(c,a) AttrOf(c) = ((a) & A_ATTRIBUTES) | WidecExt(c) #define NewChar2(c,a) { a, { c, NulChar } NulColor } #define NewChar(ch) NewChar2(ChCharOf(ch), ChAttrOf(ch)) #if CCHARW_MAX == 5 #define CharEq(a,b) (((a).attr == (b).attr) \ && (a).chars[0] == (b).chars[0] \ && (a).chars[1] == (b).chars[1] \ && (a).chars[2] == (b).chars[2] \ && (a).chars[3] == (b).chars[3] \ && (a).chars[4] == (b).chars[4] \ if_EXT_COLORS(&& (a).ext_color == (b).ext_color)) #else #define CharEq(a,b) (!memcmp(&(a), &(b), sizeof(a))) #endif #define SetChar(ch,c,a) do { \ NCURSES_CH_T *_cp = &ch; \ memset(_cp, 0, sizeof(ch)); \ _cp->chars[0] = (wchar_t) (c); \ _cp->attr = (a); \ if_EXT_COLORS(SetPair(ch, PairNumber(a))); \ } while (0) #define CHREF(wch) (&wch) #define CHDEREF(wch) (*wch) #define ARG_CH_T NCURSES_CH_T * #define CARG_CH_T const NCURSES_CH_T * #define PUTC_DATA char PUTC_buf[MB_LEN_MAX]; int PUTC_i, PUTC_n; \ mbstate_t PUT_st; wchar_t PUTC_ch #define PUTC_INIT init_mb (PUT_st) #define PUTC(ch) do { if(!isWidecExt(ch)) { \ if (Charable(ch)) { \ NCURSES_OUTC_FUNC (NCURSES_SP_ARGx CharOf(ch)); \ COUNT_OUTCHARS(1); \ } else { \ PUTC_INIT; \ for (PUTC_i = 0; PUTC_i < CCHARW_MAX; ++PUTC_i) { \ PUTC_ch = (ch).chars[PUTC_i]; \ if (PUTC_ch == L'\0') \ break; \ PUTC_n = (int) wcrtomb(PUTC_buf, \ (ch).chars[PUTC_i], &PUT_st); \ if (PUTC_n <= 0) { \ if (PUTC_ch && is8bits(PUTC_ch) && PUTC_i == 0) \ NCURSES_OUTC_FUNC (NCURSES_SP_ARGx CharOf(ch)); \ break; \ } else { \ int PUTC_j; \ for (PUTC_j = 0; PUTC_j < PUTC_n; ++PUTC_j) { \ NCURSES_OUTC_FUNC (NCURSES_SP_ARGx PUTC_buf[PUTC_j]); \ } \ } \ } \ COUNT_OUTCHARS(PUTC_i); \ } } } while (0) #define BLANK NewChar2(' ', WA_NORMAL) #define ZEROS NewChar2('\0', WA_NORMAL) #define ISBLANK(ch) ((ch).chars[0] == L' ' && (ch).chars[1] == L'\0') /* * Wide characters cannot be represented in the A_CHARTEXT mask of * attr_t's but an application might have set a narrow character there. * But even in that case, it would only be a printable character, or * zero. Otherwise we can use those bits to tell if a cell is the * first or extension part of a wide character. */ #define WidecExt(ch) (int) (AttrOf(ch) & A_CHARTEXT) #define isWidecBase(ch) (WidecExt(ch) == 1) #define isWidecExt(ch) (WidecExt(ch) > 1 && WidecExt(ch) < 32) #define SetWidecExt(dst, ext) AttrOf(dst) &= ~A_CHARTEXT, \ AttrOf(dst) |= (attr_t) (ext + 1) #define if_WIDEC(code) code #define Charable(ch) (((SP_PARM->_legacy_coding) \ || (AttrOf(ch) & A_ALTCHARSET) \ || (!isWidecExt(ch))) && \ (ch).chars[1] == L'\0' && \ _nc_is_charable(CharOf(ch))) #define L(ch) L ## ch #else /* }{ */ #define CharOf(c) ChCharOf(c) #define AttrOf(c) ChAttrOf(c) #define AddAttr(c,a) c |= (a) #define RemAttr(c,a) c &= ~((a) & A_ATTRIBUTES) #define SetAttr(c,a) c = ((c) & ~A_ATTRIBUTES) | (a) #define NewChar(ch) (ch) #define NewChar2(c,a) ((c) | (a)) #define CharEq(a,b) ((a) == (b)) #define SetChar(ch,c,a) ch = (c) | (a) #define CHREF(wch) wch #define CHDEREF(wch) wch #define ARG_CH_T NCURSES_CH_T #define CARG_CH_T NCURSES_CH_T #define PUTC_DATA /* nothing */ #define PUTC(ch) NCURSES_OUTC_FUNC (NCURSES_SP_ARGx (int) ch) #define BLANK (' '|A_NORMAL) #define ZEROS ('\0'|A_NORMAL) #define ISBLANK(ch) (CharOf(ch) == ' ') #define isWidecExt(ch) (0) #define if_WIDEC(code) /* nothing */ #define L(ch) ch #endif /* } */ #define AttrOfD(ch) AttrOf(CHDEREF(ch)) #define CharOfD(ch) CharOf(CHDEREF(ch)) #define SetChar2(wch,ch) SetChar(wch,ChCharOf(ch),ChAttrOf(ch)) #define BLANK_ATTR A_NORMAL #define BLANK_TEXT L(' ') #define CHANGED -1 #define LEGALYX(w, y, x) \ ((w) != 0 && \ ((x) >= 0 && (x) <= (w)->_maxx && \ (y) >= 0 && (y) <= (w)->_maxy)) #define CHANGED_CELL(line,col) \ if (line->firstchar == _NOCHANGE) \ line->firstchar = line->lastchar = (NCURSES_SIZE_T) (col); \ else if ((col) < line->firstchar) \ line->firstchar = (NCURSES_SIZE_T) (col); \ else if ((col) > line->lastchar) \ line->lastchar = (NCURSES_SIZE_T) (col) #define CHANGED_RANGE(line,start,end) \ if (line->firstchar == _NOCHANGE \ || line->firstchar > (start)) \ line->firstchar = (NCURSES_SIZE_T) (start); \ if (line->lastchar == _NOCHANGE \ || line->lastchar < (end)) \ line->lastchar = (NCURSES_SIZE_T) (end) #define CHANGED_TO_EOL(line,start,end) \ if (line->firstchar == _NOCHANGE \ || line->firstchar > (start)) \ line->firstchar = (NCURSES_SIZE_T) (start); \ line->lastchar = (NCURSES_SIZE_T) (end) #define SIZEOF(v) (sizeof(v)/sizeof(v[0])) #define FreeIfNeeded(p) if ((p) != 0) free(p) /* FreeAndNull() is not a comma-separated expression because some compilers * do not accept a mixture of void with values. */ #define FreeAndNull(p) free(p); p = 0 #include <nc_alloc.h> /* * Use these for tic/infocmp malloc failures. Generally the ncurses library * tries to limp along after a failure. */ #define TYPE_MALLOC(type, size, name) \ name = typeMalloc(type, size); \ if (name == 0) \ _nc_err_abort(MSG_NO_MEMORY) #define TYPE_REALLOC(type, size, name) \ name = typeRealloc(type, size, name); \ if (name == 0) \ _nc_err_abort(MSG_NO_MEMORY) /* * TTY bit definition for converting tabs to spaces. */ #ifdef TAB3 # define OFLAGS_TABS TAB3 /* POSIX specifies TAB3 */ #else # ifdef XTABS # define OFLAGS_TABS XTABS /* XTABS is usually the "same" */ # else # ifdef OXTABS # define OFLAGS_TABS OXTABS /* the traditional BSD equivalent */ # else # define OFLAGS_TABS 0 # endif # endif #endif /* * Standardize/simplify common loops */ #define each_screen(p) p = _nc_screen_chain; p != 0; p = (p)->_next_screen #define each_window(sp,p) p = WindowList(sp); p != 0; p = (p)->next #define each_ripoff(p) p = safe_ripoff_stack; (p - safe_ripoff_stack) < N_RIPS; ++p /* * Prefixes for call/return points of library function traces. We use these to * instrument the public functions so that the traces can be easily transformed * into regression scripts. */ #define T_CALLED(fmt) "called {" fmt #define T_CREATE(fmt) "create :" fmt #define T_RETURN(fmt) "return }" fmt #ifdef TRACE #if USE_REENTRANT #define TPUTS_TRACE(s) _nc_set_tputs_trace(s); #else #define TPUTS_TRACE(s) _nc_tputs_trace = s; #endif #define START_TRACE() \ if ((_nc_tracing & TRACE_MAXIMUM) == 0) { \ int t = _nc_getenv_num("NCURSES_TRACE"); \ if (t >= 0) \ trace((unsigned) t); \ } /* * Many of the _tracef() calls use static buffers; lock the trace state before * trying to fill them. */ #if USE_REENTRANT #define USE_TRACEF(mask) _nc_use_tracef(mask) extern NCURSES_EXPORT(int) _nc_use_tracef (unsigned); extern NCURSES_EXPORT(void) _nc_locked_tracef (const char *, ...) GCC_PRINTFLIKE(1,2); #else #define USE_TRACEF(mask) (_nc_tracing & (mask)) #define _nc_locked_tracef _tracef #endif #define TR(n, a) if (USE_TRACEF(n)) _nc_locked_tracef a #define T(a) TR(TRACE_CALLS, a) #define TRACE_RETURN(value,type) return _nc_retrace_##type((type)(value)) #define TRACE_RETURN1(value,dst) return _nc_retrace_##dst(value) #define TRACE_RETURN2(value,dst,src) return _nc_retrace_##dst##_##src(value) #define TRACE_RETURN_SP(value,type) return _nc_retrace_##type(SP_PARM, value) #define NonNull(s) ((s) != 0 ? s : "<null>") #define returnAttr(code) TRACE_RETURN(code,attr_t) #define returnBits(code) TRACE_RETURN(code,unsigned) #define returnBool(code) TRACE_RETURN(code,bool) #define returnCPtr(code) TRACE_RETURN1(code,cptr) #define returnCVoidPtr(code) TRACE_RETURN1(code,cvoid_ptr) #define returnChar(code) TRACE_RETURN(code,char) #define returnChtype(code) TRACE_RETURN(code,chtype) #define returnCode(code) TRACE_RETURN(code,int) #define returnIntAttr(code) TRACE_RETURN2(code,int,attr_t) #define returnMMask(code) TRACE_RETURN_SP(code,mmask_t) #define returnPtr(code) TRACE_RETURN1(code,ptr) #define returnSP(code) TRACE_RETURN1(code,sp) #define returnVoid T((T_RETURN(""))); return #define returnVoidPtr(code) TRACE_RETURN1(code,void_ptr) #define returnWin(code) TRACE_RETURN1(code,win) extern NCURSES_EXPORT(NCURSES_BOOL) _nc_retrace_bool (int); extern NCURSES_EXPORT(NCURSES_CONST void *) _nc_retrace_cvoid_ptr (NCURSES_CONST void *); extern NCURSES_EXPORT(SCREEN *) _nc_retrace_sp (SCREEN *); extern NCURSES_EXPORT(WINDOW *) _nc_retrace_win (WINDOW *); extern NCURSES_EXPORT(attr_t) _nc_retrace_attr_t (attr_t); extern NCURSES_EXPORT(char *) _nc_retrace_ptr (char *); extern NCURSES_EXPORT(char *) _nc_trace_ttymode(TTY *tty); extern NCURSES_EXPORT(char *) _nc_varargs (const char *, va_list); extern NCURSES_EXPORT(chtype) _nc_retrace_chtype (chtype); extern NCURSES_EXPORT(const char *) _nc_altcharset_name(attr_t, chtype); extern NCURSES_EXPORT(const char *) _nc_retrace_cptr (const char *); extern NCURSES_EXPORT(char) _nc_retrace_char (int); extern NCURSES_EXPORT(int) _nc_retrace_int (int); extern NCURSES_EXPORT(int) _nc_retrace_int_attr_t (attr_t); extern NCURSES_EXPORT(mmask_t) _nc_retrace_mmask_t (SCREEN *, mmask_t); extern NCURSES_EXPORT(unsigned) _nc_retrace_unsigned (unsigned); extern NCURSES_EXPORT(void *) _nc_retrace_void_ptr (void *); extern NCURSES_EXPORT(void) _nc_fifo_dump (SCREEN *); #if USE_REENTRANT NCURSES_WRAPPED_VAR(long, _nc_outchars); NCURSES_WRAPPED_VAR(const char *, _nc_tputs_trace); #define _nc_outchars NCURSES_PUBLIC_VAR(_nc_outchars()) #define _nc_tputs_trace NCURSES_PUBLIC_VAR(_nc_tputs_trace()) extern NCURSES_EXPORT(void) _nc_set_tputs_trace (const char *); extern NCURSES_EXPORT(void) _nc_count_outchars (long); #else extern NCURSES_EXPORT_VAR(const char *) _nc_tputs_trace; extern NCURSES_EXPORT_VAR(long) _nc_outchars; #endif extern NCURSES_EXPORT_VAR(unsigned) _nc_tracing; #if USE_WIDEC_SUPPORT extern NCURSES_EXPORT(const char *) _nc_viswbuf2 (int, const wchar_t *); extern NCURSES_EXPORT(const char *) _nc_viswbufn (const wchar_t *, int); #endif extern NCURSES_EXPORT(const char *) _nc_viscbuf2 (int, const NCURSES_CH_T *, int); extern NCURSES_EXPORT(const char *) _nc_viscbuf (const NCURSES_CH_T *, int); #else /* !TRACE */ #define START_TRACE() /* nothing */ #define T(a) #define TR(n, a) #define TPUTS_TRACE(s) #define returnAttr(code) return code #define returnBits(code) return code #define returnBool(code) return code #define returnCPtr(code) return code #define returnCVoidPtr(code) return code #define returnChar(code) return ((char) code) #define returnChtype(code) return code #define returnCode(code) return code #define returnIntAttr(code) return code #define returnMMask(code) return code #define returnPtr(code) return code #define returnSP(code) return code #define returnVoid return #define returnVoidPtr(code) return code #define returnWin(code) return code #endif /* TRACE/!TRACE */ /* * Workaround for defective implementation of gcc attribute warn_unused_result */ #if defined(__GNUC__) && defined(_FORTIFY_SOURCE) #define IGNORE_RC(func) errno = (int) func #else #define IGNORE_RC(func) (void) func #endif /* gcc workarounds */ /* * Return-codes for tgetent() and friends. */ #define TGETENT_YES 1 /* entry is found */ #define TGETENT_NO 0 /* entry is not found */ #define TGETENT_ERR -1 /* an error occurred */ extern NCURSES_EXPORT(const char *) _nc_visbuf2 (int, const char *); extern NCURSES_EXPORT(const char *) _nc_visbufn (const char *, int); #define EMPTY_MODULE(name) \ extern NCURSES_EXPORT(void) name (void); \ NCURSES_EXPORT(void) name (void) { } #define ALL_BUT_COLOR ((chtype)~(A_COLOR)) #define NONBLANK_ATTR (A_BOLD | A_DIM | A_BLINK | A_ITALIC) #define TPARM_ATTR (A_STANDOUT | A_UNDERLINE | A_REVERSE | A_BLINK | A_DIM | A_BOLD | A_ALTCHARSET | A_INVIS | A_PROTECT) #define XMC_CONFLICT (A_STANDOUT | A_UNDERLINE | A_REVERSE | A_BLINK | A_DIM | A_BOLD | A_INVIS | A_PROTECT | A_ITALIC) #define XMC_CHANGES(c) ((c) & SP_PARM->_xmc_suppress) #define toggle_attr_on(S,at) {\ if (PairNumber(at) > 0) {\ (S) = ((S) & ALL_BUT_COLOR) | (attr_t) (at);\ } else {\ (S) |= (attr_t) (at);\ }\ TR(TRACE_ATTRS, ("new attribute is %s", _traceattr((S))));} #define toggle_attr_off(S,at) {\ if (PairNumber(at) > 0) {\ (S) &= ~(at|A_COLOR);\ } else {\ (S) &= ~(at);\ }\ TR(TRACE_ATTRS, ("new attribute is %s", _traceattr((S))));} #define DelCharCost(sp,count) \ ((parm_dch != 0) \ ? sp->_dch_cost \ : ((delete_character != 0) \ ? (sp->_dch1_cost * count) \ : INFINITY)) #define InsCharCost(sp,count) \ ((parm_ich != 0) \ ? sp->_ich_cost \ : ((enter_insert_mode && exit_insert_mode) \ ? sp->_smir_cost + sp->_rmir_cost + (sp->_ip_cost * count) \ : ((insert_character != 0) \ ? ((sp->_ich1_cost + sp->_ip_cost) * count) \ : INFINITY))) #if USE_XMC_SUPPORT #define UpdateAttrs(sp,c) if (!SameAttrOf(SCREEN_ATTRS(sp), c)) { \ attr_t chg = AttrOf(SCREEN_ATTRS(sp)); \ VIDATTR(sp, AttrOf(c), GetPair(c)); \ if (magic_cookie_glitch > 0 \ && XMC_CHANGES((chg ^ AttrOf(SCREEN_ATTRS(sp))))) { \ T(("%s @%d before glitch %d,%d", \ __FILE__, __LINE__, \ sp->_cursrow, \ sp->_curscol)); \ NCURSES_SP_NAME(_nc_do_xmc_glitch)(NCURSES_SP_ARGx chg); \ } \ } #else #define UpdateAttrs(sp,c) if (!SameAttrOf(SCREEN_ATTRS(sp), c)) { \ VIDATTR(sp, AttrOf(c), GetPair(c)); \ } #endif /* * Macros to make additional parameter to implement wgetch_events() */ #ifdef NCURSES_WGETCH_EVENTS #define EVENTLIST_0th(param) param #define EVENTLIST_1st(param) param #define EVENTLIST_2nd(param) , param #define TWAIT_MASK (TW_ANY | TW_EVENT) #else #define EVENTLIST_0th(param) void #define EVENTLIST_1st(param) /* nothing */ #define EVENTLIST_2nd(param) /* nothing */ #define TWAIT_MASK TW_ANY #endif #if NCURSES_EXPANDED && NCURSES_EXT_FUNCS #undef toggle_attr_on #define toggle_attr_on(S,at) _nc_toggle_attr_on(&(S), at) extern NCURSES_EXPORT(void) _nc_toggle_attr_on (attr_t *, attr_t); #undef toggle_attr_off #define toggle_attr_off(S,at) _nc_toggle_attr_off(&(S), at) extern NCURSES_EXPORT(void) _nc_toggle_attr_off (attr_t *, attr_t); #undef DelCharCost #define DelCharCost(sp, count) NCURSES_SP_NAME(_nc_DelCharCost)(NCURSES_SP_ARGx count) #undef InsCharCost #define InsCharCost(sp, count) NCURSES_SP_NAME(_nc_InsCharCost)(NCURSES_SP_ARGx count) extern NCURSES_EXPORT(int) NCURSES_SP_NAME(_nc_DelCharCost) (NCURSES_SP_DCLx int _c); extern NCURSES_EXPORT(int) NCURSES_SP_NAME(_nc_InsCharCost) (NCURSES_SP_DCLx int _c); #undef UpdateAttrs #define UpdateAttrs(sp,c) NCURSES_SP_NAME(_nc_UpdateAttrs)(NCURSES_SP_ARGx CHREF(c)) #if USE_WIDEC_SUPPORT || defined(NEED_NCURSES_CH_T) extern NCURSES_EXPORT(void) NCURSES_SP_NAME(_nc_UpdateAttrs) (NCURSES_SP_DCLx CARG_CH_T _c); #else extern NCURSES_EXPORT(void) NCURSES_SP_NAME(_nc_UpdateAttrs) (NCURSES_SP_DCLx chtype c); #endif #if NCURSES_SP_FUNCS extern NCURSES_EXPORT(int) _nc_DelCharCost (int); extern NCURSES_EXPORT(int) _nc_InsCharCost (int); extern NCURSES_EXPORT(void) _nc_UpdateAttrs (CARG_CH_T); #endif /* NCURSES_SP_FUNCS */ #else extern NCURSES_EXPORT(void) _nc_expanded (void); #endif #if !NCURSES_EXT_FUNCS #define set_escdelay(value) ESCDELAY = value #endif #if !HAVE_GETCWD #define getcwd(buf,len) getwd(buf) #endif /* charable.c */ #if USE_WIDEC_SUPPORT extern NCURSES_EXPORT(bool) _nc_is_charable(wchar_t); extern NCURSES_EXPORT(int) _nc_to_char(wint_t); extern NCURSES_EXPORT(wint_t) _nc_to_widechar(int); #endif /* comp_captab.c */ typedef struct { short nte_name; /* offset of name to hash on */ int nte_type; /* BOOLEAN, NUMBER or STRING */ short nte_index; /* index of associated variable in its array */ short nte_link; /* index in table of next hash, or -1 */ } name_table_data; typedef struct { short from; short to; short source; } alias_table_data; /* doupdate.c */ #if USE_XMC_SUPPORT extern NCURSES_EXPORT(void) _nc_do_xmc_glitch (attr_t); #endif /* hardscroll.c */ #if defined(TRACE) || defined(SCROLLDEBUG) || defined(HASHDEBUG) extern NCURSES_EXPORT(void) _nc_linedump (void); #endif /* lib_acs.c */ extern NCURSES_EXPORT(void) _nc_init_acs (void); /* corresponds to traditional 'init_acs()' */ extern NCURSES_EXPORT(int) _nc_msec_cost (const char *const, int); /* used by 'tack' program */ /* lib_addch.c */ #if USE_WIDEC_SUPPORT NCURSES_EXPORT(int) _nc_build_wch(WINDOW *win, ARG_CH_T ch); #endif /* lib_addstr.c */ #if USE_WIDEC_SUPPORT && !(defined(USE_TERMLIB) || defined(USE_BUILD_CC)) extern NCURSES_EXPORT(int) _nc_wchstrlen(const cchar_t *); #endif /* lib_color.c */ extern NCURSES_EXPORT(bool) _nc_reset_colors(void); /* lib_getch.c */ extern NCURSES_EXPORT(int) _nc_wgetch(WINDOW *, int *, int EVENTLIST_2nd(_nc_eventlist *)); /* lib_insch.c */ extern NCURSES_EXPORT(int) _nc_insert_ch(SCREEN *, WINDOW *, chtype); /* lib_mvcur.c */ #define INFINITY 1000000 /* cost: too high to use */ extern NCURSES_EXPORT(int) _nc_mvcur(int yold, int xold, int ynew, int xnew); extern NCURSES_EXPORT(void) _nc_mvcur_init (void); extern NCURSES_EXPORT(void) _nc_mvcur_resume (void); extern NCURSES_EXPORT(void) _nc_mvcur_wrap (void); extern NCURSES_EXPORT(int) _nc_scrolln (int, int, int, int); extern NCURSES_EXPORT(void) _nc_screen_init (void); extern NCURSES_EXPORT(void) _nc_screen_resume (void); extern NCURSES_EXPORT(void) _nc_screen_wrap (void); /* lib_mouse.c */ extern NCURSES_EXPORT(bool) _nc_has_mouse (SCREEN *); /* lib_mvcur.c */ #define INFINITY 1000000 /* cost: too high to use */ #define BAUDBYTE 9 /* 9 = 7 bits + 1 parity + 1 stop */ /* lib_setup.c */ extern NCURSES_EXPORT(char *) _nc_get_locale(void); extern NCURSES_EXPORT(int) _nc_unicode_locale(void); extern NCURSES_EXPORT(int) _nc_locale_breaks_acs(TERMINAL *); extern NCURSES_EXPORT(int) _nc_setupterm(NCURSES_CONST char *, int, int *, int); extern NCURSES_EXPORT(void) _nc_tinfo_cmdch(TERMINAL *, int); /* lib_set_term.c */ extern NCURSES_EXPORT(int) _nc_ripoffline(int, int(*)(WINDOW*, int)); /* lib_setup.c */ #define SETUP_FAIL ERR #define ret_error(code, fmt, arg) if (errret) {\ *errret = code;\ returnCode(SETUP_FAIL);\ } else {\ fprintf(stderr, fmt, arg);\ exit(EXIT_FAILURE);\ } #define ret_error1(code, fmt, arg) ret_error(code, "'%s': " fmt, arg) #define ret_error0(code, msg) if (errret) {\ *errret = code;\ returnCode(SETUP_FAIL);\ } else {\ fprintf(stderr, msg);\ exit(EXIT_FAILURE);\ } /* lib_tstp.c */ #if USE_SIGWINCH extern NCURSES_EXPORT(int) _nc_handle_sigwinch(SCREEN *); #else #define _nc_handle_sigwinch(a) /* nothing */ #endif /* lib_wacs.c */ #if USE_WIDEC_SUPPORT extern NCURSES_EXPORT(void) _nc_init_wacs(void); #endif typedef struct { char *s_head; /* beginning of the string (may be null) */ char *s_tail; /* end of the string (may be null) */ size_t s_size; /* current remaining size available */ size_t s_init; /* total size available */ } string_desc; /* strings.c */ extern NCURSES_EXPORT(string_desc *) _nc_str_init (string_desc *, char *, size_t); extern NCURSES_EXPORT(string_desc *) _nc_str_null (string_desc *, size_t); extern NCURSES_EXPORT(string_desc *) _nc_str_copy (string_desc *, string_desc *); extern NCURSES_EXPORT(bool) _nc_safe_strcat (string_desc *, const char *); extern NCURSES_EXPORT(bool) _nc_safe_strcpy (string_desc *, const char *); #if !HAVE_STRSTR #define strstr _nc_strstr extern NCURSES_EXPORT(char *) _nc_strstr (const char *, const char *); #endif /* safe_sprintf.c */ extern NCURSES_EXPORT(char *) _nc_printf_string (const char *, va_list); /* tries.c */ extern NCURSES_EXPORT(int) _nc_add_to_try (TRIES **, const char *, unsigned); extern NCURSES_EXPORT(char *) _nc_expand_try (TRIES *, unsigned, int *, size_t); extern NCURSES_EXPORT(int) _nc_remove_key (TRIES **, unsigned); extern NCURSES_EXPORT(int) _nc_remove_string (TRIES **, const char *); /* elsewhere ... */ extern NCURSES_EXPORT(ENTRY *) _nc_delink_entry (ENTRY *, TERMTYPE *); extern NCURSES_EXPORT(SCREEN *) _nc_screen_of (WINDOW *); extern NCURSES_EXPORT(TERMINAL*) _nc_get_cur_term (void); extern NCURSES_EXPORT(WINDOW *) _nc_makenew (int, int, int, int, int); extern NCURSES_EXPORT(char *) _nc_trace_buf (int, size_t); extern NCURSES_EXPORT(char *) _nc_trace_bufcat (int, const char *); extern NCURSES_EXPORT(char *) _nc_tracechar (SCREEN *, int); extern NCURSES_EXPORT(char *) _nc_tracemouse (SCREEN *, MEVENT const *); extern NCURSES_EXPORT(char *) _nc_trace_mmask_t (SCREEN *, mmask_t); extern NCURSES_EXPORT(int) _nc_access (const char *, int); extern NCURSES_EXPORT(int) _nc_baudrate (int); extern NCURSES_EXPORT(int) _nc_freewin (WINDOW *); extern NCURSES_EXPORT(int) _nc_getenv_num (const char *); extern NCURSES_EXPORT(int) _nc_keypad (SCREEN *, int); extern NCURSES_EXPORT(int) _nc_ospeed (int); extern NCURSES_EXPORT(int) _nc_outch (int); extern NCURSES_EXPORT(int) _nc_putchar (int); extern NCURSES_EXPORT(int) _nc_putp(const char *, const char *); extern NCURSES_EXPORT(int) _nc_putp_flush(const char *, const char *); extern NCURSES_EXPORT(int) _nc_read_termcap_entry (const char *const, TERMTYPE *const); extern NCURSES_EXPORT(int) _nc_setup_tinfo(const char *, TERMTYPE *); extern NCURSES_EXPORT(int) _nc_setupscreen (int, int, FILE *, int, int); extern NCURSES_EXPORT(int) _nc_timed_wait (SCREEN *, int, int, int * EVENTLIST_2nd(_nc_eventlist *)); extern NCURSES_EXPORT(void) _nc_do_color (int, int, int, NCURSES_OUTC); extern NCURSES_EXPORT(void) _nc_flush (void); extern NCURSES_EXPORT(void) _nc_free_and_exit (int) GCC_NORETURN; extern NCURSES_EXPORT(void) _nc_free_entry (ENTRY *, TERMTYPE *); extern NCURSES_EXPORT(void) _nc_freeall (void); extern NCURSES_EXPORT(void) _nc_hash_map (void); extern NCURSES_EXPORT(void) _nc_init_keytry (SCREEN *); extern NCURSES_EXPORT(void) _nc_keep_tic_dir (const char *); extern NCURSES_EXPORT(void) _nc_make_oldhash (int i); extern NCURSES_EXPORT(void) _nc_scroll_oldhash (int n, int top, int bot); extern NCURSES_EXPORT(void) _nc_scroll_optimize (void); extern NCURSES_EXPORT(void) _nc_set_buffer (FILE *, int); extern NCURSES_EXPORT(void) _nc_setenv_num (const char *, int); extern NCURSES_EXPORT(void) _nc_signal_handler (int); extern NCURSES_EXPORT(void) _nc_synchook (WINDOW *); extern NCURSES_EXPORT(void) _nc_trace_tries (TRIES *); #if NO_LEAKS extern NCURSES_EXPORT(void) _nc_alloc_entry_leaks(void); extern NCURSES_EXPORT(void) _nc_captoinfo_leaks(void); extern NCURSES_EXPORT(void) _nc_codes_leaks(void); extern NCURSES_EXPORT(void) _nc_comp_captab_leaks(void); extern NCURSES_EXPORT(void) _nc_comp_error_leaks(void); extern NCURSES_EXPORT(void) _nc_comp_scan_leaks(void); extern NCURSES_EXPORT(void) _nc_db_iterator_leaks(void); extern NCURSES_EXPORT(void) _nc_keyname_leaks(void); extern NCURSES_EXPORT(void) _nc_names_leaks(void); extern NCURSES_EXPORT(void) _nc_tgetent_leaks(void); #endif #if !(defined(USE_TERMLIB) || defined(USE_BUILD_CC)) extern NCURSES_EXPORT(NCURSES_CH_T) _nc_render (WINDOW *, NCURSES_CH_T); extern NCURSES_EXPORT(int) _nc_waddch_nosync (WINDOW *, const NCURSES_CH_T); extern NCURSES_EXPORT(void) _nc_scroll_window (WINDOW *, int const, int const, int const, NCURSES_CH_T); #endif #if USE_WIDEC_SUPPORT extern NCURSES_EXPORT(int) _nc_insert_wch(WINDOW *, const cchar_t *); #endif #if USE_WIDEC_SUPPORT && !(defined(USE_TERMLIB) || defined(USE_BUILD_CC)) extern NCURSES_EXPORT(size_t) _nc_wcrtomb (char *, wchar_t, mbstate_t *); #endif #if USE_SIZECHANGE extern NCURSES_EXPORT(void) _nc_update_screensize (SCREEN *); #endif #if HAVE_RESIZETERM extern NCURSES_EXPORT(void) _nc_resize_margins (WINDOW *); #else #define _nc_resize_margins(wp) /* nothing */ #endif #ifdef NCURSES_WGETCH_EVENTS extern NCURSES_EXPORT(int) _nc_eventlist_timeout(_nc_eventlist *); #else #define wgetch_events(win, evl) wgetch(win) #define wgetnstr_events(win, str, maxlen, evl) wgetnstr(win, str, maxlen) #endif /* * Wide-character macros to hide some platform-differences. */ #if USE_WIDEC_SUPPORT #if defined(__MINGW32__) /* * MinGW has wide-character functions, but they do not work correctly. */ extern int __MINGW_NOTHROW _nc_wctomb(char *, wchar_t); #define wctomb(s,wc) _nc_wctomb(s,wc) #define wcrtomb(s,wc,n) _nc_wctomb(s,wc) extern int __MINGW_NOTHROW _nc_mbtowc(wchar_t *, const char *, size_t); #define mbtowc(pwc,s,n) _nc_mbtowc(pwc,s,n) extern int __MINGW_NOTHROW _nc_mblen(const char *, size_t); #define mblen(s,n) _nc_mblen(s, n) #endif /* __MINGW32__ */ #if HAVE_MBTOWC && HAVE_MBLEN #define reset_mbytes(state) IGNORE_RC(mblen(NULL, (size_t) 0)), IGNORE_RC(mbtowc(NULL, NULL, (size_t) 0)) #define count_mbytes(buffer,length,state) mblen(buffer,length) #define check_mbytes(wch,buffer,length,state) \ (int) mbtowc(&wch, buffer, length) #define state_unused #elif HAVE_MBRTOWC && HAVE_MBRLEN #define reset_mbytes(state) init_mb(state) #define count_mbytes(buffer,length,state) mbrlen(buffer,length,&state) #define check_mbytes(wch,buffer,length,state) \ (int) mbrtowc(&wch, buffer, length, &state) #else make an error #endif #endif /* USE_WIDEC_SUPPORT */ /* * Not everyone has vsscanf(), but we'd like to use it for scanw(). */ #if !HAVE_VSSCANF extern int vsscanf(const char *str, const char *format, va_list __arg); #endif /* scroll indices */ extern NCURSES_EXPORT_VAR(int *) _nc_oldnums; #define USE_SETBUF_0 0 #define NC_OUTPUT(sp) ((sp != 0) ? sp->_ofp : stdout) /* * On systems with a broken linker, define 'SP' as a function to force the * linker to pull in the data-only module with 'SP'. */ #define _nc_alloc_screen_sp() typeCalloc(SCREEN, 1) #if BROKEN_LINKER #define SP _nc_screen() extern NCURSES_EXPORT(SCREEN *) _nc_screen (void); extern NCURSES_EXPORT(int) _nc_alloc_screen (void); extern NCURSES_EXPORT(void) _nc_set_screen (SCREEN *); #define CURRENT_SCREEN _nc_screen() #else /* current screen is private data; avoid possible linking conflicts too */ extern NCURSES_EXPORT_VAR(SCREEN *) SP; #define CURRENT_SCREEN SP #define _nc_alloc_screen() ((SP = _nc_alloc_screen_sp()) != 0) #define _nc_set_screen(sp) SP = sp #endif #if NCURSES_SP_FUNCS #define CURRENT_SCREEN_PRE (IsPreScreen(CURRENT_SCREEN) ? CURRENT_SCREEN : new_prescr()) #else #define CURRENT_SCREEN_PRE CURRENT_SCREEN #endif /* * We don't want to use the lines or columns capabilities internally, because * if the application is running multiple screens under X, it's quite possible * they could all have type xterm but have different sizes! So... */ #define screen_lines(sp) (sp)->_lines #define screen_columns(sp) (sp)->_columns extern NCURSES_EXPORT(int) _nc_slk_initialize (WINDOW *, int); extern NCURSES_EXPORT(int) _nc_format_slks (NCURSES_SP_DCLx int _c); /* * Some constants related to SLK's */ #define MAX_SKEY_OLD 8 /* count of soft keys */ #define MAX_SKEY_LEN_OLD 8 /* max length of soft key text */ #define MAX_SKEY_PC 12 /* This is what most PC's have */ #define MAX_SKEY_LEN_PC 5 /* Macro to check whether or not we use a standard format */ #define SLK_STDFMT(fmt) (fmt < 3) /* Macro to determine height of label window */ #define SLK_LINES(fmt) (SLK_STDFMT(fmt) ? 1 : ((fmt) - 2)) #define MAX_SKEY(fmt) (SLK_STDFMT(fmt)? MAX_SKEY_OLD : MAX_SKEY_PC) #define MAX_SKEY_LEN(fmt) (SLK_STDFMT(fmt)? MAX_SKEY_LEN_OLD : MAX_SKEY_LEN_PC) /* * Common error messages */ #define MSG_NO_MEMORY "Out of memory" #define MSG_NO_INPUTS "Premature EOF" extern NCURSES_EXPORT(int) _nc_set_tty_mode(TTY *); extern NCURSES_EXPORT(int) _nc_get_tty_mode(TTY *); /* timed_wait flag definitions */ #define TW_NONE 0 #define TW_INPUT 1 #define TW_MOUSE 2 #define TW_ANY (TW_INPUT | TW_MOUSE) #define TW_EVENT 4 #define SetSafeOutcWrapper(outc) \ SCREEN* sp = CURRENT_SCREEN; \ struct screen outc_wrapper; \ if (sp==0) { \ sp = &outc_wrapper; \ memset(sp,0,sizeof(struct screen)); \ sp->_outch = _nc_outc_wrapper; \ }\ sp->jump = outc #ifdef USE_TERM_DRIVER typedef struct _termInfo { bool caninit; bool hascolor; bool initcolor; bool canchange; int tabsize; int maxcolors; int maxpairs; int nocolorvideo; int numbuttons; int numlabels; int labelwidth; int labelheight; const color_t* defaultPalette; } TerminalInfo; typedef struct term_driver { bool isTerminfo; const char* (*td_name)(struct DriverTCB*); bool (*td_CanHandle)(struct DriverTCB*, const char*, int*); void (*td_init)(struct DriverTCB*); void (*td_release)(struct DriverTCB*); int (*td_size)(struct DriverTCB*, int* Line, int *Cols); int (*td_sgmode)(struct DriverTCB*, int setFlag, TTY*); chtype (*td_conattr)(struct DriverTCB*); int (*td_hwcur)(struct DriverTCB*, int yold, int xold, int y, int x); int (*td_mode)(struct DriverTCB*, int progFlag, int defFlag); bool (*td_rescol)(struct DriverTCB*); bool (*td_rescolors)(struct DriverTCB*); void (*td_color)(struct DriverTCB*, int fore, int color, int(*)(SCREEN*, int)); int (*td_doBeepOrFlash)(struct DriverTCB*, int); void (*td_initpair)(struct DriverTCB*, int, int, int); void (*td_initcolor)(struct DriverTCB*, int, int, int, int); void (*td_docolor)(struct DriverTCB*, int, int, int, int(*)(SCREEN*, int)); void (*td_initmouse)(struct DriverTCB*); int (*td_testmouse)(struct DriverTCB*, int EVENTLIST_2nd(_nc_eventlist*)); void (*td_setfilter)(struct DriverTCB*); void (*td_hwlabel)(struct DriverTCB*, int, char*); void (*td_hwlabelOnOff)(struct DriverTCB*, int); int (*td_update)(struct DriverTCB*); int (*td_defaultcolors)(struct DriverTCB*, int, int); int (*td_print)(struct DriverTCB*, char*, int); int (*td_getsize)(struct DriverTCB*, int*, int*); int (*td_setsize)(struct DriverTCB*, int, int); void (*td_initacs)(struct DriverTCB*, chtype*, chtype*); void (*td_scinit)(SCREEN *); void (*td_scexit)(SCREEN *); int (*td_twait)(struct DriverTCB*, int, int, int* EVENTLIST_2nd(_nc_eventlist*)); int (*td_read)(struct DriverTCB*, int*); int (*td_nap)(struct DriverTCB*, int); int (*td_kpad)(struct DriverTCB*, int); int (*td_kyOk)(struct DriverTCB*, int, int); bool (*td_kyExist)(struct DriverTCB*, int); int (*td_cursorSet)(struct DriverTCB*, int); } TERM_DRIVER; typedef struct DriverTCB { TERMINAL term; /* needs to be the first Element !!! */ TERM_DRIVER* drv; /* The driver for that Terminal */ SCREEN* csp; /* The screen that owns that Terminal */ TerminalInfo info; /* Driver independent core capabilities of the Terminal */ void* prop; /* Driver dependent property storage to be used by the Driver */ long magic; } TERMINAL_CONTROL_BLOCK; #define NCDRV_MAGIC(id) (0x47110000 | (id&0xffff)) #define NCDRV_TINFO 0x01 #define NCDRV_WINCONSOLE 0x02 #define TCBOf(sp) ((TERMINAL_CONTROL_BLOCK*)(TerminalOf(sp))) #define InfoOf(sp) TCBOf(sp)->info #define CallDriver(sp,method) TCBOf(sp)->drv->method(TCBOf(sp)) #define CallDriver_1(sp,method,arg1) TCBOf(sp)->drv->method(TCBOf(sp),arg1) #define CallDriver_2(sp,method,arg1,arg2) TCBOf(sp)->drv->method(TCBOf(sp),arg1,arg2) #define CallDriver_3(sp,method,arg1,arg2,arg3) TCBOf(sp)->drv->method(TCBOf(sp),arg1,arg2,arg3) #define CallDriver_4(sp,method,arg1,arg2,arg3,arg4) TCBOf(sp)->drv->method(TCBOf(sp),arg1,arg2,arg3,arg4) extern NCURSES_EXPORT_VAR(const color_t*) _nc_cga_palette; extern NCURSES_EXPORT_VAR(const color_t*) _nc_hls_palette; extern NCURSES_EXPORT(int) _nc_get_driver(TERMINAL_CONTROL_BLOCK*, const char*, int*); extern NCURSES_EXPORT(void) _nc_get_screensize_ex(SCREEN *, TERMINAL *, int *, int *); #endif /* USE_TERM_DRIVER */ /* * Entrypoints which are actually provided in the terminal driver, which would * be an sp-name otherwise. */ #ifdef USE_TERM_DRIVER #define TINFO_HAS_KEY _nc_tinfo_has_key #define TINFO_DOUPDATE _nc_tinfo_doupdate #define TINFO_MVCUR _nc_tinfo_mvcur extern NCURSES_EXPORT(int) TINFO_HAS_KEY(SCREEN*, int); extern NCURSES_EXPORT(int) TINFO_DOUPDATE(SCREEN *); extern NCURSES_EXPORT(int) TINFO_MVCUR(SCREEN*, int, int, int, int); #else #define TINFO_HAS_KEY NCURSES_SP_NAME(has_key) #define TINFO_DOUPDATE NCURSES_SP_NAME(doupdate) #define TINFO_MVCUR NCURSES_SP_NAME(_nc_mvcur) #endif /* * Entrypoints using an extra parameter with the terminal driver. */ #ifdef USE_TERM_DRIVER extern NCURSES_EXPORT(void) _nc_get_screensize(SCREEN *, TERMINAL *, int *, int *); extern NCURSES_EXPORT(int) _nc_setupterm_ex(TERMINAL **, NCURSES_CONST char *, int , int *, int); #define TINFO_GET_SIZE(sp, tp, lp, cp) \ _nc_get_screensize(sp, tp, lp, cp) #define TINFO_SET_CURTERM(sp, tp) \ NCURSES_SP_NAME(set_curterm)(sp, tp) #define TINFO_SETUP_TERM(tpp, name, fd, err, reuse) \ _nc_setupterm_ex(tpp, name, fd, err, reuse) #else /* !USE_TERM_DRIVER */ extern NCURSES_EXPORT(void) _nc_get_screensize(SCREEN *, int *, int *); #define TINFO_GET_SIZE(sp, tp, lp, cp) \ _nc_get_screensize(sp, lp, cp) #define TINFO_SET_CURTERM(sp, tp) \ set_curterm(tp) #define TINFO_SETUP_TERM(tpp, name, fd, err, reuse) \ _nc_setupterm(name, fd, err, reuse) #endif /* !USE_TERM_DRIVER */ #ifdef USE_TERM_DRIVER #if defined(USE_WIN32CON_DRIVER) #include <nc_mingw.h> extern NCURSES_EXPORT_VAR(TERM_DRIVER) _nc_WIN_DRIVER; extern NCURSES_EXPORT(int) _nc_mingw_isatty(int fd); extern NCURSES_EXPORT(int) _nc_mingw_isconsole(int fd); extern NCURSES_EXPORT(int) _nc_mingw_console_read( SCREEN *sp, HANDLE fd, int *buf); extern NCURSES_EXPORT(int) _nc_mingw_testmouse( SCREEN * sp, HANDLE fd, int delay); #else #endif extern NCURSES_EXPORT_VAR(TERM_DRIVER) _nc_TINFO_DRIVER; #endif #if defined(USE_TERM_DRIVER) && defined(USE_WIN32CON_DRIVER) #define NC_ISATTY(fd) _nc_mingw_isatty(fd) #else #define NC_ISATTY(fd) isatty(fd) #endif #ifdef USE_TERM_DRIVER # define IsTermInfo(sp) ((TCBOf(sp) != 0) && ((TCBOf(sp)->drv->isTerminfo))) # define HasTInfoTerminal(sp) ((0 != TerminalOf(sp)) && IsTermInfo(sp)) # if defined(USE_WIN32CON_DRIVER) # define IsTermInfoOnConsole(sp) (IsTermInfo(sp)&&_nc_mingw_isconsole(TerminalOf(sp)->Filedes)) #else # define IsTermInfoOnConsole(sp) FALSE # endif #else # define IsTermInfo(sp) TRUE # define HasTInfoTerminal(sp) (0 != TerminalOf(sp)) # define IsTermInfoOnConsole(sp) FALSE #endif #define IsValidTIScreen(sp) (HasTInfoTerminal(sp)) /* * Exported entrypoints beyond the published API */ #if NCURSES_SP_FUNCS extern NCURSES_EXPORT(WINDOW *) _nc_curscr_of(SCREEN*); extern NCURSES_EXPORT(WINDOW *) _nc_newscr_of(SCREEN*); extern NCURSES_EXPORT(WINDOW *) _nc_stdscr_of(SCREEN*); extern NCURSES_EXPORT(int) _nc_outc_wrapper(SCREEN*,int); #if USE_REENTRANT extern NCURSES_EXPORT(int) NCURSES_SP_NAME(_nc_TABSIZE)(SCREEN*); extern NCURSES_EXPORT(char *) NCURSES_SP_NAME(longname)(SCREEN*); #endif #if NCURSES_EXT_FUNCS extern NCURSES_EXPORT(int) NCURSES_SP_NAME(_nc_set_tabsize)(SCREEN*, int); #endif /* * We put the safe versions of various calls here as they are not published * part of the API up to now */ extern NCURSES_EXPORT(TERMINAL*) NCURSES_SP_NAME(_nc_get_cur_term) (SCREEN *sp); extern NCURSES_EXPORT(WINDOW *) NCURSES_SP_NAME(_nc_makenew) (SCREEN*, int, int, int, int, int); extern NCURSES_EXPORT(bool) NCURSES_SP_NAME(_nc_reset_colors)(SCREEN*); extern NCURSES_EXPORT(char *) NCURSES_SP_NAME(_nc_printf_string)(SCREEN*, const char *, va_list); extern NCURSES_EXPORT(chtype) NCURSES_SP_NAME(_nc_acs_char)(SCREEN*,int); extern NCURSES_EXPORT(int) NCURSES_SP_NAME(_nc_curs_set)(SCREEN*,int); extern NCURSES_EXPORT(int) NCURSES_SP_NAME(_nc_get_tty_mode)(SCREEN*,TTY*); extern NCURSES_EXPORT(int) NCURSES_SP_NAME(_nc_mcprint)(SCREEN*,char*, int); extern NCURSES_EXPORT(int) NCURSES_SP_NAME(_nc_msec_cost)(SCREEN*, const char *, int); extern NCURSES_EXPORT(int) NCURSES_SP_NAME(_nc_mvcur)(SCREEN*, int, int, int, int); extern NCURSES_EXPORT(int) NCURSES_SP_NAME(_nc_outch)(SCREEN*, int); extern NCURSES_EXPORT(int) NCURSES_SP_NAME(_nc_putchar)(SCREEN*, int); extern NCURSES_EXPORT(int) NCURSES_SP_NAME(_nc_putp)(SCREEN*, const char *, const char*); extern NCURSES_EXPORT(int) NCURSES_SP_NAME(_nc_putp_flush)(SCREEN*, const char *, const char *); extern NCURSES_EXPORT(int) NCURSES_SP_NAME(_nc_resetty)(SCREEN*); extern NCURSES_EXPORT(int) NCURSES_SP_NAME(_nc_resize_term)(SCREEN*,int,int); extern NCURSES_EXPORT(int) NCURSES_SP_NAME(_nc_ripoffline)(SCREEN*, int, int (*)(WINDOW *,int)); extern NCURSES_EXPORT(int) NCURSES_SP_NAME(_nc_savetty)(SCREEN*); extern NCURSES_EXPORT(int) NCURSES_SP_NAME(_nc_scr_init)(SCREEN*,const char*); extern NCURSES_EXPORT(int) NCURSES_SP_NAME(_nc_scr_restore)(SCREEN*, const char*); extern NCURSES_EXPORT(int) NCURSES_SP_NAME(_nc_scrolln)(SCREEN*, int, int, int, int); extern NCURSES_EXPORT(int) NCURSES_SP_NAME(_nc_set_tty_mode)(SCREEN*, TTY*); extern NCURSES_EXPORT(int) NCURSES_SP_NAME(_nc_setupscreen)(SCREEN**, int, int, FILE *, int, int); extern NCURSES_EXPORT(int) NCURSES_SP_NAME(_nc_tgetent)(SCREEN*,char*,const char *); extern NCURSES_EXPORT(int) NCURSES_SP_NAME(_nc_tigetnum)(SCREEN*,NCURSES_CONST char*); extern NCURSES_EXPORT(int) NCURSES_SP_NAME(_nc_vid_attr)(SCREEN *, attr_t, NCURSES_COLOR_T, void *); extern NCURSES_EXPORT(int) NCURSES_SP_NAME(_nc_vidputs)(SCREEN*,chtype,int(*) (SCREEN*, int)); extern NCURSES_EXPORT(void) NCURSES_SP_NAME(_nc_do_color)(SCREEN*, int, int, int, NCURSES_SP_OUTC); extern NCURSES_EXPORT(void) NCURSES_SP_NAME(_nc_do_xmc_glitch)(SCREEN*, attr_t); extern NCURSES_EXPORT(void) NCURSES_SP_NAME(_nc_flush)(SCREEN*); extern NCURSES_EXPORT(void) NCURSES_SP_NAME(_nc_free_and_exit)(SCREEN*, int) GCC_NORETURN; extern NCURSES_EXPORT(void) NCURSES_SP_NAME(_nc_freeall)(SCREEN*); extern NCURSES_EXPORT(void) NCURSES_SP_NAME(_nc_hash_map)(SCREEN*); extern NCURSES_EXPORT(void) NCURSES_SP_NAME(_nc_init_acs)(SCREEN*); extern NCURSES_EXPORT(void) NCURSES_SP_NAME(_nc_make_oldhash)(SCREEN*, int i); extern NCURSES_EXPORT(void) NCURSES_SP_NAME(_nc_mvcur_init)(SCREEN*); extern NCURSES_EXPORT(void) NCURSES_SP_NAME(_nc_mvcur_resume)(SCREEN*); extern NCURSES_EXPORT(void) NCURSES_SP_NAME(_nc_mvcur_wrap)(SCREEN*); extern NCURSES_EXPORT(void) NCURSES_SP_NAME(_nc_screen_init)(SCREEN*); extern NCURSES_EXPORT(void) NCURSES_SP_NAME(_nc_screen_resume)(SCREEN*); extern NCURSES_EXPORT(void) NCURSES_SP_NAME(_nc_screen_wrap)(SCREEN*); extern NCURSES_EXPORT(void) NCURSES_SP_NAME(_nc_scroll_oldhash)(SCREEN*, int n, int top, int bot); extern NCURSES_EXPORT(void) NCURSES_SP_NAME(_nc_scroll_optimize)(SCREEN*); extern NCURSES_EXPORT(void) NCURSES_SP_NAME(_nc_set_buffer)(SCREEN*, FILE *, int); extern NCURSES_EXPORT(void) _nc_cookie_init(SCREEN *sp); #if defined(TRACE) || defined(SCROLLDEBUG) || defined(HASHDEBUG) extern NCURSES_EXPORT(void) NCURSES_SP_NAME(_nc_linedump)(SCREEN*); #endif #if USE_WIDEC_SUPPORT extern NCURSES_EXPORT(wchar_t *) NCURSES_SP_NAME(_nc_wunctrl)(SCREEN*, cchar_t *); #endif #endif /* NCURSES_SP_FUNCS */ #if NCURSES_SP_FUNCS #define safe_keyname NCURSES_SP_NAME(keyname) #define safe_unctrl NCURSES_SP_NAME(unctrl) #define safe_ungetch NCURSES_SP_NAME(ungetch) #else #define safe_keyname _nc_keyname #define safe_unctrl _nc_unctrl #define safe_ungetch _nc_ungetch extern NCURSES_EXPORT(NCURSES_CONST char *) _nc_keyname (SCREEN *, int); extern NCURSES_EXPORT(int) _nc_ungetch (SCREEN *, int); extern NCURSES_EXPORT(NCURSES_CONST char *) _nc_unctrl (SCREEN *, chtype); #endif #ifdef EXP_XTERM_1005 NCURSES_EXPORT(int) _nc_conv_to_utf8(unsigned char *, unsigned, unsigned); NCURSES_EXPORT(int) _nc_conv_to_utf32(unsigned *, const char *, unsigned); #endif #ifdef __cplusplus } #endif /* *INDENT-ON* */ #endif /* CURSES_PRIV_H */
{ "pile_set_name": "Github" }
// Copyright (c) MOSA Project. Licensed under the New BSD License. using Mosa.Kernel.x86; using Mosa.Kernel.x86.Smbios; using Mosa.Runtime.x86; using System; namespace Mosa.Demo.HelloWorld.x86 { /// <summary> /// Boot /// </summary> public static class Boot { public static ConsoleSession Console; /// <summary> /// Main /// </summary> public static void Main() { Kernel.x86.Kernel.Setup(); Console = ConsoleManager.Controller.Boot; Console.Clear(); Console.Goto(0, 0); IDT.SetInterruptHandler(ProcessInterrupt); Console.ScrollRow = 25; Console.Color = ScreenColor.Yellow; Console.BackgroundColor = ScreenColor.Black; Console.Write("MOSA OS Version 1.4 '"); Console.Color = ScreenColor.Red; Console.Write("Neptune"); Console.Color = ScreenColor.Yellow; Console.Write("' Copyright 2008-2019"); Console.Color = ScreenColor.White; Console.Write(new String((char)205, 60)); Console.Write((char)203); Console.Write(new String((char)205, 19)); Console.WriteLine(); Console.Goto(2, 0); Console.Color = ScreenColor.Green; Console.Write("MultibootAddress: "); Console.Color = ScreenColor.Gray; Console.Write((uint)Multiboot.MultibootStructure.ToInt32(), 16, 8); Console.WriteLine(); Console.Color = ScreenColor.Green; Console.Write("Multiboot-Flags: "); Console.Color = ScreenColor.Gray; Console.Write(Multiboot.Flags, 2, 32); Console.WriteLine(); Console.Color = ScreenColor.Green; Console.Write("Size of Memory: "); Console.Color = ScreenColor.Gray; Console.Write((uint)(Multiboot.MemoryLower.ToInt32() + Multiboot.MemoryUpper.ToInt32()) / 1024, 10, -1); Console.Write(" MB ("); Console.Write((uint)(Multiboot.MemoryLower.ToInt32() + Multiboot.MemoryUpper.ToInt32()), 10, -1); Console.Write(" KB)"); Console.WriteLine(); Console.WriteLine(); Console.WriteLine(); Console.Color = ScreenColor.Green; Console.Write("Smbios Info: "); if (SmbiosManager.IsAvailable) { Console.Color = ScreenColor.White; Console.Write("["); Console.Color = ScreenColor.Gray; Console.Write("Version "); Console.Write(SmbiosManager.MajorVersion, 10, -1); Console.Write("."); Console.Write(SmbiosManager.MinorVersion, 10, -1); Console.Color = ScreenColor.White; Console.Write("]"); Console.WriteLine(); Console.Color = ScreenColor.Yellow; Console.Write("[Bios]"); Console.Color = ScreenColor.White; Console.WriteLine(); var biosInformation = new BiosInformationStructure(); Console.Color = ScreenColor.White; Console.Write("Vendor: "); Console.Color = ScreenColor.Gray; Console.Write(biosInformation.BiosVendor); Console.WriteLine(); Console.Color = ScreenColor.White; Console.Write("Version: "); Console.Color = ScreenColor.Gray; Console.Write(biosInformation.BiosVersion); Console.WriteLine(); Console.Color = ScreenColor.White; Console.Write("Date: "); Console.Color = ScreenColor.Gray; Console.Write(biosInformation.BiosDate); Console.Color = ScreenColor.Yellow; Console.Row = 8; Console.Column = 35; Console.Write("[Cpu]"); Console.Color = ScreenColor.White; Console.WriteLine(); Console.Column = 35; var cpuStructure = new CpuStructure(); Console.Color = ScreenColor.White; Console.Write("Vendor: "); Console.Color = ScreenColor.Gray; Console.Write(cpuStructure.Vendor); Console.WriteLine(); Console.Column = 35; Console.Color = ScreenColor.White; Console.Write("Version: "); Console.Color = ScreenColor.Gray; Console.Write(cpuStructure.Version); Console.WriteLine(); Console.Column = 35; Console.Color = ScreenColor.White; Console.Write("Socket: "); Console.Color = ScreenColor.Gray; Console.Write(cpuStructure.Socket); Console.Write(" MHz"); Console.WriteLine(); Console.Column = 35; Console.Color = ScreenColor.White; Console.Write("Cur. Speed: "); Console.Color = ScreenColor.Gray; Console.Write(cpuStructure.MaxSpeed, 10, -1); Console.Write(" MHz"); Console.WriteLine(); Console.Column = 35; } else { Console.Color = ScreenColor.Red; Console.Write("No SMBIOS available on this system!"); } Console.WriteLine(); Console.WriteLine(); Console.Color = ScreenColor.Green; Console.Write("Memory-Map:"); Console.WriteLine(); for (uint index = 0; index < Multiboot.MemoryMapCount; index++) { Console.Color = ScreenColor.White; Console.Write(Multiboot.GetMemoryMapBase(index), 16, 8); Console.Write(" - "); Console.Write(Multiboot.GetMemoryMapBase(index) + Multiboot.GetMemoryMapLength(index) - 1, 16, 8); Console.Write(" ("); Console.Color = ScreenColor.Gray; Console.Write(Multiboot.GetMemoryMapLength(index), 16, 8); Console.Color = ScreenColor.White; Console.Write(") "); Console.Color = ScreenColor.Gray; Console.Write("Type: "); Console.Write(Multiboot.GetMemoryMapType(index), 16, 1); Console.WriteLine(); } Console.Color = ScreenColor.Yellow; Console.Goto(24, 29); Console.Write("www.mosa-project.org"); // Borders Console.Color = ScreenColor.White; for (uint index = 0; index < 60; index++) { Console.Goto(14, index); Console.Write((char)205); } for (uint index = 0; index < 60; index++) { Console.Goto(6, index); Console.Write((char)205); } for (uint index = 60; index < 80; index++) { Console.Goto(19, index); Console.Write((char)205); } for (uint index = 0; index < 80; index++) { Console.Goto(23, index); Console.Write((char)205); } for (uint index = 2; index < 20; index++) { Console.Goto(index, 60); if (index == 6) Console.Write((char)185); else if (index == 14) Console.Write((char)185); else if (index == 19) Console.Write((char)200); else Console.Write((char)186); } Console.Goto(12, 0); Logger.Log("<SELFTEST:PASSED>"); while (true) { DisplayCMOS(); DisplayTime(); Native.Hlt(); } } /// <summary> /// Displays the seconds. /// </summary> private static void DisplayCMOS() { Console.Row = 2; Console.Column = 65; Console.Color = ScreenColor.Green; Console.Write("CMOS:"); Console.WriteLine(); Console.Color = ScreenColor.White; byte i = 0; for (byte x = 0; x < 5; x++) { Console.Column = 65; for (byte y = 0; y < 4; y++) { Console.Write(CMOS.Get(i), 16, 2); Console.Write(' '); i++; } Console.WriteLine(); } } /// <summary> /// Displays the seconds. /// </summary> private static void DisplayTime() { Console.Goto(24, 50); Console.Color = ScreenColor.Green; Console.Write("Time: "); byte bcd = 10; if (CMOS.BCD) bcd = 16; Console.Color = ScreenColor.White; Console.Write(CMOS.Hour, bcd, 2); Console.Color = ScreenColor.Gray; Console.Write(':'); Console.Color = ScreenColor.White; Console.Write(CMOS.Minute, bcd, 2); Console.Color = ScreenColor.Gray; Console.Write(':'); Console.Color = ScreenColor.White; Console.Write(CMOS.Second, bcd, 2); Console.Write(' '); Console.Color = ScreenColor.Gray; Console.Write('('); Console.Color = ScreenColor.White; Console.Write(CMOS.Month, bcd, 2); Console.Color = ScreenColor.Gray; Console.Write('/'); Console.Color = ScreenColor.White; Console.Write(CMOS.Day, bcd, 2); Console.Color = ScreenColor.Gray; Console.Write('/'); Console.Color = ScreenColor.White; Console.Write('2'); Console.Write('0'); Console.Write(CMOS.Year, bcd, 2); Console.Color = ScreenColor.Gray; Console.Write(')'); } private static uint counter = 0; public static object _lock { get; private set; } public static void ProcessInterrupt(uint interrupt, uint errorCode) { counter++; uint c = Console.Column; uint r = Console.Row; var col = Console.Color; var back = Console.BackgroundColor; Console.Column = 31; Console.Row = 0; Console.Color = ScreenColor.Cyan; Console.BackgroundColor = ScreenColor.Black; Console.Write(counter, 10, 7); Console.Write(':'); Console.Write(interrupt, 16, 2); Console.Write(':'); Console.Write(errorCode, 16, 2); if (interrupt != 0x20) { Console.Write('-'); Console.Write(counter, 10, 7); Console.Write(':'); Console.Write(interrupt, 16, 2); if (interrupt == 0x21) { byte scancode = Keyboard.ReadScanCode(); Console.Write('-'); Console.Write(scancode, 16, 2); } } Console.Column = c; Console.Row = r; Console.Color = col; Console.BackgroundColor = back; } } }
{ "pile_set_name": "Github" }
// RUN: c-index-test -write-pch %t.h.pch %s // RUN: c-index-test -code-completion-at=%s:19:1 %s -include %t.h | FileCheck %s // <rdar://12316296> clang Code Completion returns nothing but preprocessor macros #ifndef HEADER #define HEADER @interface I @end // CHECK: FunctionDecl:{ResultType void}{TypedText foo} void foo(); #else @implementation I -(void)meth { } @end #endif
{ "pile_set_name": "Github" }
𫓿
{ "pile_set_name": "Github" }
define( [ "../core" ], function( jQuery ) { "use strict"; var // Map over jQuery in case of overwrite _jQuery = window.jQuery, // Map over the $ in case of overwrite _$ = window.$; jQuery.noConflict = function( deep ) { if ( window.$ === jQuery ) { window.$ = _$; } if ( deep && window.jQuery === jQuery ) { window.jQuery = _jQuery; } return jQuery; }; // Expose jQuery and $ identifiers, even in AMD // (#7102#comment:10, https://github.com/jquery/jquery/pull/557) // and CommonJS for browser emulators (#13566) if ( typeof noGlobal === "undefined" ) { window.jQuery = window.$ = jQuery; } } );
{ "pile_set_name": "Github" }
/* orinoco_plx.c * * Driver for Prism II devices which would usually be driven by orinoco_cs, * but are connected to the PCI bus by a PLX9052. * * Current maintainers are: * Pavel Roskin <proski AT gnu.org> * and David Gibson <hermes AT gibson.dropbear.id.au> * * (C) Copyright David Gibson, IBM Corp. 2001-2003. * Copyright (C) 2001 Daniel Barlow * * The contents of this file are subject to the Mozilla Public License * Version 1.1 (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.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See * the License for the specific language governing rights and * limitations under the License. * * Alternatively, the contents of this file may be used under the * terms of the GNU General Public License version 2 (the "GPL"), in * which case the provisions of the GPL are applicable instead of the * above. If you wish to allow the use of your version of this file * only under the terms of the GPL and not to allow others to use your * version of this file under the MPL, indicate your decision by * deleting the provisions above and replace them with the notice and * other provisions required by the GPL. If you do not delete the * provisions above, a recipient may use your version of this file * under either the MPL or the GPL. * * Here's the general details on how the PLX9052 adapter works: * * - Two PCI I/O address spaces, one 0x80 long which contains the * PLX9052 registers, and one that's 0x40 long mapped to the PCMCIA * slot I/O address space. * * - One PCI memory address space, mapped to the PCMCIA attribute space * (containing the CIS). * * Using the later, you can read through the CIS data to make sure the * card is compatible with the driver. Keep in mind that the PCMCIA * spec specifies the CIS as the lower 8 bits of each word read from * the CIS, so to read the bytes of the CIS, read every other byte * (0,2,4,...). Passing that test, you need to enable the I/O address * space on the PCMCIA card via the PCMCIA COR register. This is the * first byte following the CIS. In my case (which may not have any * relation to what's on the PRISM2 cards), COR was at offset 0x800 * within the PCI memory space. Write 0x41 to the COR register to * enable I/O mode and to select level triggered interrupts. To * confirm you actually succeeded, read the COR register back and make * sure it actually got set to 0x41, in case you have an unexpected * card inserted. * * Following that, you can treat the second PCI I/O address space (the * one that's not 0x80 in length) as the PCMCIA I/O space. * * Note that in the Eumitcom's source for their drivers, they register * the interrupt as edge triggered when registering it with the * Windows kernel. I don't recall how to register edge triggered on * Linux (if it can be done at all). But in some experimentation, I * don't see much operational difference between using either * interrupt mode. Don't mess with the interrupt mode in the COR * register though, as the PLX9052 wants level triggers with the way * the serial EEPROM configures it on the WL11000. * * There's some other little quirks related to timing that I bumped * into, but I don't recall right now. Also, there's two variants of * the WL11000 I've seen, revision A1 and T2. These seem to differ * slightly in the timings configured in the wait-state generator in * the PLX9052. There have also been some comments from Eumitcom that * cards shouldn't be hot swapped, apparently due to risk of cooking * the PLX9052. I'm unsure why they believe this, as I can't see * anything in the design that would really cause a problem, except * for crashing drivers not written to expect it. And having developed * drivers for the WL11000, I'd say it's quite tricky to write code * that will successfully deal with a hot unplug. Very odd things * happen on the I/O side of things. But anyway, be warned. Despite * that, I've hot-swapped a number of times during debugging and * driver development for various reasons (stuck WAIT# line after the * radio card's firmware locks up). */ #define DRIVER_NAME "orinoco_plx" #define PFX DRIVER_NAME ": " #include <linux/module.h> #include <linux/kernel.h> #include <linux/init.h> #include <linux/delay.h> #include <linux/pci.h> #include <pcmcia/cisreg.h> #include "orinoco.h" #include "orinoco_pci.h" #define COR_OFFSET (0x3e0) /* COR attribute offset of Prism2 PC card */ #define COR_VALUE (COR_LEVEL_REQ | COR_FUNC_ENA) /* Enable PC card with interrupt in level trigger */ #define COR_RESET (0x80) /* reset bit in the COR register */ #define PLX_RESET_TIME (500) /* milliseconds */ #define PLX_INTCSR 0x4c /* Interrupt Control & Status Register */ #define PLX_INTCSR_INTEN (1<<6) /* Interrupt Enable bit */ /* * Do a soft reset of the card using the Configuration Option Register */ static int orinoco_plx_cor_reset(struct orinoco_private *priv) { hermes_t *hw = &priv->hw; struct orinoco_pci_card *card = priv->card; unsigned long timeout; u16 reg; iowrite8(COR_VALUE | COR_RESET, card->attr_io + COR_OFFSET); mdelay(1); iowrite8(COR_VALUE, card->attr_io + COR_OFFSET); mdelay(1); /* Just in case, wait more until the card is no longer busy */ timeout = jiffies + (PLX_RESET_TIME * HZ / 1000); reg = hermes_read_regn(hw, CMD); while (time_before(jiffies, timeout) && (reg & HERMES_CMD_BUSY)) { mdelay(1); reg = hermes_read_regn(hw, CMD); } /* Still busy? */ if (reg & HERMES_CMD_BUSY) { printk(KERN_ERR PFX "Busy timeout\n"); return -ETIMEDOUT; } return 0; } static int orinoco_plx_hw_init(struct orinoco_pci_card *card) { int i; u32 csr_reg; static const u8 cis_magic[] = { 0x01, 0x03, 0x00, 0x00, 0xff, 0x17, 0x04, 0x67 }; printk(KERN_DEBUG PFX "CIS: "); for (i = 0; i < 16; i++) { printk("%02X:", ioread8(card->attr_io + (i << 1))); } printk("\n"); /* Verify whether a supported PC card is present */ /* FIXME: we probably need to be smarted about this */ for (i = 0; i < sizeof(cis_magic); i++) { if (cis_magic[i] != ioread8(card->attr_io + (i << 1))) { printk(KERN_ERR PFX "The CIS value of Prism2 PC " "card is unexpected\n"); return -ENODEV; } } /* bjoern: We need to tell the card to enable interrupts, in case the serial eprom didn't do this already. See the PLX9052 data book, p8-1 and 8-24 for reference. */ csr_reg = ioread32(card->bridge_io + PLX_INTCSR); if (!(csr_reg & PLX_INTCSR_INTEN)) { csr_reg |= PLX_INTCSR_INTEN; iowrite32(csr_reg, card->bridge_io + PLX_INTCSR); csr_reg = ioread32(card->bridge_io + PLX_INTCSR); if (!(csr_reg & PLX_INTCSR_INTEN)) { printk(KERN_ERR PFX "Cannot enable interrupts\n"); return -EIO; } } return 0; } static int orinoco_plx_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) { int err; struct orinoco_private *priv; struct orinoco_pci_card *card; struct net_device *dev; void __iomem *hermes_io, *attr_io, *bridge_io; err = pci_enable_device(pdev); if (err) { printk(KERN_ERR PFX "Cannot enable PCI device\n"); return err; } err = pci_request_regions(pdev, DRIVER_NAME); if (err) { printk(KERN_ERR PFX "Cannot obtain PCI resources\n"); goto fail_resources; } bridge_io = pci_iomap(pdev, 1, 0); if (!bridge_io) { printk(KERN_ERR PFX "Cannot map bridge registers\n"); err = -EIO; goto fail_map_bridge; } attr_io = pci_iomap(pdev, 2, 0); if (!attr_io) { printk(KERN_ERR PFX "Cannot map PCMCIA attributes\n"); err = -EIO; goto fail_map_attr; } hermes_io = pci_iomap(pdev, 3, 0); if (!hermes_io) { printk(KERN_ERR PFX "Cannot map chipset registers\n"); err = -EIO; goto fail_map_hermes; } /* Allocate network device */ dev = alloc_orinocodev(sizeof(*card), orinoco_plx_cor_reset); if (!dev) { printk(KERN_ERR PFX "Cannot allocate network device\n"); err = -ENOMEM; goto fail_alloc; } priv = netdev_priv(dev); card = priv->card; card->bridge_io = bridge_io; card->attr_io = attr_io; SET_MODULE_OWNER(dev); SET_NETDEV_DEV(dev, &pdev->dev); hermes_struct_init(&priv->hw, hermes_io, HERMES_16BIT_REGSPACING); err = request_irq(pdev->irq, orinoco_interrupt, IRQF_SHARED, dev->name, dev); if (err) { printk(KERN_ERR PFX "Cannot allocate IRQ %d\n", pdev->irq); err = -EBUSY; goto fail_irq; } err = orinoco_plx_hw_init(card); if (err) { printk(KERN_ERR PFX "Hardware initialization failed\n"); goto fail; } err = orinoco_plx_cor_reset(priv); if (err) { printk(KERN_ERR PFX "Initial reset failed\n"); goto fail; } err = register_netdev(dev); if (err) { printk(KERN_ERR PFX "Cannot register network device\n"); goto fail; } pci_set_drvdata(pdev, dev); printk(KERN_DEBUG "%s: " DRIVER_NAME " at %s\n", dev->name, pci_name(pdev)); return 0; fail: free_irq(pdev->irq, dev); fail_irq: pci_set_drvdata(pdev, NULL); free_orinocodev(dev); fail_alloc: pci_iounmap(pdev, hermes_io); fail_map_hermes: pci_iounmap(pdev, attr_io); fail_map_attr: pci_iounmap(pdev, bridge_io); fail_map_bridge: pci_release_regions(pdev); fail_resources: pci_disable_device(pdev); return err; } static void __devexit orinoco_plx_remove_one(struct pci_dev *pdev) { struct net_device *dev = pci_get_drvdata(pdev); struct orinoco_private *priv = netdev_priv(dev); struct orinoco_pci_card *card = priv->card; unregister_netdev(dev); free_irq(pdev->irq, dev); pci_set_drvdata(pdev, NULL); free_orinocodev(dev); pci_iounmap(pdev, priv->hw.iobase); pci_iounmap(pdev, card->attr_io); pci_iounmap(pdev, card->bridge_io); pci_release_regions(pdev); pci_disable_device(pdev); } static struct pci_device_id orinoco_plx_id_table[] = { {0x111a, 0x1023, PCI_ANY_ID, PCI_ANY_ID,}, /* Siemens SpeedStream SS1023 */ {0x1385, 0x4100, PCI_ANY_ID, PCI_ANY_ID,}, /* Netgear MA301 */ {0x15e8, 0x0130, PCI_ANY_ID, PCI_ANY_ID,}, /* Correga - does this work? */ {0x1638, 0x1100, PCI_ANY_ID, PCI_ANY_ID,}, /* SMC EZConnect SMC2602W, Eumitcom PCI WL11000, Addtron AWA-100 */ {0x16ab, 0x1100, PCI_ANY_ID, PCI_ANY_ID,}, /* Global Sun Tech GL24110P */ {0x16ab, 0x1101, PCI_ANY_ID, PCI_ANY_ID,}, /* Reported working, but unknown */ {0x16ab, 0x1102, PCI_ANY_ID, PCI_ANY_ID,}, /* Linksys WDT11 */ {0x16ec, 0x3685, PCI_ANY_ID, PCI_ANY_ID,}, /* USR 2415 */ {0xec80, 0xec00, PCI_ANY_ID, PCI_ANY_ID,}, /* Belkin F5D6000 tested by Brendan W. McAdams <rit AT jacked-in.org> */ {0x10b7, 0x7770, PCI_ANY_ID, PCI_ANY_ID,}, /* 3Com AirConnect PCI tested by Damien Persohn <damien AT persohn.net> */ {0,}, }; MODULE_DEVICE_TABLE(pci, orinoco_plx_id_table); static struct pci_driver orinoco_plx_driver = { .name = DRIVER_NAME, .id_table = orinoco_plx_id_table, .probe = orinoco_plx_init_one, .remove = __devexit_p(orinoco_plx_remove_one), .suspend = orinoco_pci_suspend, .resume = orinoco_pci_resume, }; static char version[] __initdata = DRIVER_NAME " " DRIVER_VERSION " (Pavel Roskin <[email protected]>," " David Gibson <[email protected]>," " Daniel Barlow <[email protected]>)"; MODULE_AUTHOR("Daniel Barlow <[email protected]>"); MODULE_DESCRIPTION("Driver for wireless LAN cards using the PLX9052 PCI bridge"); MODULE_LICENSE("Dual MPL/GPL"); static int __init orinoco_plx_init(void) { printk(KERN_DEBUG "%s\n", version); return pci_register_driver(&orinoco_plx_driver); } static void __exit orinoco_plx_exit(void) { pci_unregister_driver(&orinoco_plx_driver); } module_init(orinoco_plx_init); module_exit(orinoco_plx_exit); /* * Local variables: * c-indent-level: 8 * c-basic-offset: 8 * tab-width: 8 * End: */
{ "pile_set_name": "Github" }
| Classes.java:15:16:15:26 | MaybeStatic | MaybeStatic should be made static, since the enclosing instance is not used. | | Classes.java:20:16:20:27 | MaybeStatic1 | MaybeStatic1 could be made static, since the enclosing instance is used only in its constructor. | | Classes.java:27:16:27:27 | MaybeStatic2 | MaybeStatic2 could be made static, since the enclosing instance is used only in its constructor. | | Classes.java:40:16:40:27 | MaybeStatic3 | MaybeStatic3 should be made static, since the enclosing instance is not used. | | Classes.java:50:16:50:27 | MaybeStatic4 | MaybeStatic4 should be made static, since the enclosing instance is not used. | | Classes.java:60:16:60:27 | MaybeStatic5 | MaybeStatic5 should be made static, since the enclosing instance is not used. | | Classes.java:66:16:66:27 | MaybeStatic6 | MaybeStatic6 should be made static, since the enclosing instance is not used. | | Classes.java:72:16:72:27 | MaybeStatic7 | MaybeStatic7 should be made static, since the enclosing instance is not used. | | Classes.java:85:10:85:21 | MaybeStatic8 | MaybeStatic8 should be made static, since the enclosing instance is not used. | | Classes.java:94:15:94:26 | MaybeStatic9 | MaybeStatic9 should be made static, since the enclosing instance is not used. | | Classes.java:101:8:101:20 | MaybeStatic10 | MaybeStatic10 should be made static, since the enclosing instance is not used. | | Classes.java:111:20:111:33 | MaybeStaticToo | MaybeStaticToo should be made static, since the enclosing instance is not used. | | Classes.java:133:9:133:27 | NotStaticButCouldBe | NotStaticButCouldBe should be made static, since the enclosing instance is not used. | | Classes.java:190:16:190:29 | SadlyNotStatic | SadlyNotStatic should be made static, since the enclosing instance is not used. | | Classes.java:192:17:192:33 | SadlyNotStaticToo | SadlyNotStaticToo should be made static, since the enclosing instance is not used. | | Classes.java:206:16:206:28 | MaybeStatic11 | MaybeStatic11 should be made static, since the enclosing instance is not used. | | Classes.java:210:16:210:28 | MaybeStatic12 | MaybeStatic12 should be made static, since the enclosing instance is not used. | | Classes.java:214:16:214:28 | MaybeStatic13 | MaybeStatic13 should be made static, since the enclosing instance is not used. | | Classes.java:218:8:218:20 | CouldBeStatic | CouldBeStatic should be made static, since the enclosing instance is not used. | | Classes.java:225:9:225:22 | CouldBeStatic2 | CouldBeStatic2 should be made static, since the enclosing instance is not used. | | Classes.java:255:8:255:21 | CouldBeStatic3 | CouldBeStatic3 should be made static, since the enclosing instance is not used. | | Test.java:5:8:5:10 | Sub | Sub should be made static, since the enclosing instance is not used. |
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="UTF-8"?> <BUSMASTER_CONFIGURATION> <Global_Configuration> <BUSMASTER_Version>1.9.0</BUSMASTER_Version> <IsMsgFilterEnabled>FALSE</IsMsgFilterEnabled> <IsReplayFilterEnabled>FALSE</IsReplayFilterEnabled> <IsLogFilterEnabled>FALSE</IsLogFilterEnabled> <IsLoggingEnabled>FALSE</IsLoggingEnabled> <IsMsgIntepretationEnabled>FALSE</IsMsgIntepretationEnabled> <IsOverWriteEnabled>TRUE</IsOverWriteEnabled> <DisplayTimeMode>SYSTEM</DisplayTimeMode> <DisplayNumericMode>FALSE</DisplayNumericMode> <LogOnConnect_CAN>TRUE</LogOnConnect_CAN> <LogOnConnect_J1939>TRUE</LogOnConnect_J1939> <Window_Position> <Visibility>SHOWNORMAL</Visibility> <WindowPlacement>HIDE</WindowPlacement> <Top>678</Top> <Left>0</Left> <Bottom>904</Bottom> <Right>1309</Right> </Window_Position> </Global_Configuration> <Module_Configuration> <CAN_Database_Files> <FilePath>testNS_03.dbf</FilePath> </CAN_Database_Files> <J1939_Database_Files/> <CAN_DIL_Section> <DriverName>Vector XL</DriverName> <ControllerMode>Unknown</ControllerMode> <ControllerSettings> <Channel> <BaudRate>500</BaudRate> <CNF1>7</CNF1> <CNF2>B8</CNF2> <CNF3>5</CNF3> <BTR0>C0</BTR0> <BTR1>3A</BTR1> <Clock>16</Clock> <SamplePerc>75</SamplePerc> <Sampling>1</Sampling> <Warning_Limit>96</Warning_Limit> <Propagation_Delay>ALL</Propagation_Delay> <SJW>4</SJW> <AccCodeByte1_0>0</AccCodeByte1_0> <AccCodeByte1_1>0</AccCodeByte1_1> <AccCodeByte2_0>0</AccCodeByte2_0> <AccCodeByte2_1>0</AccCodeByte2_1> <AccCodeByte3_0>0</AccCodeByte3_0> <AccCodeByte3_1>0</AccCodeByte3_1> <AccCodeByte4_0>0</AccCodeByte4_0> <AccCodeByte4_1>0</AccCodeByte4_1> <AccMaskByte1_0>FF</AccMaskByte1_0> <AccMaskByte1_1>FF</AccMaskByte1_1> <AccMaskByte2_0>FF</AccMaskByte2_0> <AccMaskByte2_1>FF</AccMaskByte2_1> <AccMaskByte3_0>FF</AccMaskByte3_0> <AccMaskByte3_1>FF</AccMaskByte3_1> <AccMaskByte4_0>FF</AccMaskByte4_0> <AccMaskByte4_1>FF</AccMaskByte4_1> <HardwareDesc>Vector - Virtual Channel 1 SN - 0Channel Index - 0</HardwareDesc> <ItemUnderFocus>64</ItemUnderFocus> <BTR0BTR1>49210</BTR0BTR1> <AccFilterMode>0</AccFilterMode> <ControllerMode>1</ControllerMode> <SelfReception>1</SelfReception> <HWFilterType_0>0</HWFilterType_0> <HWFilterType_1>0</HWFilterType_1> <Debug>0</Debug> <PassiveMode>0</PassiveMode> <HWTimestamps>0</HWTimestamps> <Location></Location> </Channel> </ControllerSettings> </CAN_DIL_Section> <CAN_Signal_Watch> <Window_Position> <Visibility>SHOWNORMAL</Visibility> <WindowPlacement>HIDE</WindowPlacement> <Top>0</Top> <Left>0</Left> <Right>444</Right> <Bottom>218</Bottom> </Window_Position> <COLUMN_WIDTH> <MESSAGE_COLUMN>85</MESSAGE_COLUMN> <Raw_Val_Column>85</Raw_Val_Column> <Physical_Val_Column>171</Physical_Val_Column> <Signal_Column>85</Signal_Column> </COLUMN_WIDTH> </CAN_Signal_Watch> <J1939_Signal_Watch> <Window_Position> <Visibility>SHOWNORMAL</Visibility> <WindowPlacement>HIDE</WindowPlacement> <Top>31</Top> <Left>5</Left> <Right>449</Right> <Bottom>249</Bottom> </Window_Position> <COLUMN_WIDTH> <MESSAGE_COLUMN>85</MESSAGE_COLUMN> <Raw_Val_Column>85</Raw_Val_Column> <Physical_Val_Column>171</Physical_Val_Column> <Signal_Column>85</Signal_Column> </COLUMN_WIDTH> </J1939_Signal_Watch> <CAN_Signal_Graph> <GRAPH_PARAMETERS> <Buffer_Size>5000</Buffer_Size> <Refresh_Rate>1000</Refresh_Rate> <Frame_Color>21760</Frame_Color> <Frame_Style>1</Frame_Style> <Plot_Area_Color>0</Plot_Area_Color> <Grid_Color>12632256</Grid_Color> <Axis_Color>255</Axis_Color> <X_Grid_Lines>10</X_Grid_Lines> <Y_Grid_Lines>5</Y_Grid_Lines> <Active_Axis>2</Active_Axis> <Selected_Action>0</Selected_Action> <Show_Grid>TRUE</Show_Grid> <Display_Type>NORMAL</Display_Type> </GRAPH_PARAMETERS> <Window_Position> <Visibility>HIDE</Visibility> <Window_Position>HIDE</Window_Position> <Top>-1</Top> <Left>0</Left> <Bottom>746</Bottom> <Right>1270</Right> </Window_Position> <Splitter_Window_Col_0> <CxIdeal>-1</CxIdeal> <CxMin>0</CxMin> </Splitter_Window_Col_0> <Splitter_Window_Col_1> <CxIdeal>934</CxIdeal> <CxMin>0</CxMin> </Splitter_Window_Col_1> <Splitter_Window_Row_0> <CxIdeal>497</CxIdeal> <CxMin>0</CxMin> </Splitter_Window_Row_0> <Splitter_Window_Row_1> <CxIdeal>204</CxIdeal> <CxMin>0</CxMin> </Splitter_Window_Row_1> </CAN_Signal_Graph> <CAN_Log/> <J1939_Log/> <CAN_Simulated_Systems> <Sym_Path>TestNS_04_SIM.sim</Sym_Path> <Window_Position> <Visibility>SHOWNORMAL</Visibility> <WindowPlacement>RESTORETOMAXIMIZED</WindowPlacement> <Top>108</Top> <Left>152</Left> <Bottom>932</Bottom> <Right>1227</Right> </Window_Position> </CAN_Simulated_Systems> <J1939_Simulated_Systems> <Window_Position> <Visibility>HIDE</Visibility> <WindowPlacement>RESTORETOMAXIMIZED</WindowPlacement> <Top>0</Top> <Left>0</Left> <Bottom>0</Bottom> <Right>0</Right> </Window_Position> </J1939_Simulated_Systems> <CAN_Replay/> <CAN_Message_Window> <Append_Buffer_Size>5000</Append_Buffer_Size> <Overwrite_Buffer_Size>2000</Overwrite_Buffer_Size> <Display_Update_Time>100</Display_Update_Time> <COLUMN> <ID></ID> <Order>1</Order> <IsVisible>0</IsVisible> <Width>0</Width> </COLUMN> <COLUMN> <ID>Time</ID> <Order>2</Order> <IsVisible>1</IsVisible> <Width>127</Width> </COLUMN> <COLUMN> <ID>Tx/Rx</ID> <Order>3</Order> <IsVisible>1</IsVisible> <Width>85</Width> </COLUMN> <COLUMN> <ID>Channel</ID> <Order>4</Order> <IsVisible>1</IsVisible> <Width>92</Width> </COLUMN> <COLUMN> <ID>Msg Type</ID> <Order>5</Order> <IsVisible>1</IsVisible> <Width>71</Width> </COLUMN> <COLUMN> <ID>ID</ID> <Order>6</Order> <IsVisible>1</IsVisible> <Width>69</Width> </COLUMN> <COLUMN> <ID>Message</ID> <Order>7</Order> <IsVisible>1</IsVisible> <Width>95</Width> </COLUMN> <COLUMN> <ID>DLC</ID> <Order>8</Order> <IsVisible>1</IsVisible> <Width>38</Width> </COLUMN> <COLUMN> <ID>Data Byte(s)</ID> <Order>9</Order> <IsVisible>1</IsVisible> <Width>728</Width> </COLUMN> <IsHex>1</IsHex> <IsAppend>0</IsAppend> <IsInterpret>0</IsInterpret> <Time_Mode>SYSTEM</Time_Mode> <Window_Position> <Visibility>SHOWNORMAL</Visibility> <WindowPlacement>SETMINPOSITION</WindowPlacement> <Top>0</Top> <Left>0</Left> <Bottom>566</Bottom> <Right>1321</Right> </Window_Position> <Interpretation_Window_Position> <Visibility>SHOWNORMAL</Visibility> <WindowPlacement>RESTORETOMAXIMIZED</WindowPlacement> <Top>115</Top> <Left>49</Left> <Bottom>392</Bottom> <Right>398</Right> </Interpretation_Window_Position> </CAN_Message_Window> <J1939_Message_Window> <Message_Attribute> <Name>DM16</Name> <Message_ID>55040</Message_ID> <Color>8080ff</Color> </Message_Attribute> <COLUMN> <ID></ID> <Order>1</Order> <IsVisible>0</IsVisible> <Width>0</Width> </COLUMN> <COLUMN> <ID>Time</ID> <Order>2</Order> <IsVisible>1</IsVisible> <Width>91</Width> </COLUMN> <COLUMN> <ID>Channel</ID> <Order>3</Order> <IsVisible>1</IsVisible> <Width>76</Width> </COLUMN> <COLUMN> <ID>CAN ID</ID> <Order>4</Order> <IsVisible>1</IsVisible> <Width>76</Width> </COLUMN> <COLUMN> <ID>PGN</ID> <Order>5</Order> <IsVisible>1</IsVisible> <Width>68</Width> </COLUMN> <COLUMN> <ID>PGN Name</ID> <Order>6</Order> <IsVisible>1</IsVisible> <Width>90</Width> </COLUMN> <COLUMN> <ID>Type</ID> <Order>7</Order> <IsVisible>1</IsVisible> <Width>67</Width> </COLUMN> <COLUMN> <ID>Src</ID> <Order>8</Order> <IsVisible>1</IsVisible> <Width>44</Width> </COLUMN> <COLUMN> <ID>Dest</ID> <Order>9</Order> <IsVisible>1</IsVisible> <Width>65</Width> </COLUMN> <COLUMN> <ID>Priority</ID> <Order>10</Order> <IsVisible>1</IsVisible> <Width>54</Width> </COLUMN> <COLUMN> <ID>Tx/Rx</ID> <Order>11</Order> <IsVisible>1</IsVisible> <Width>61</Width> </COLUMN> <COLUMN> <ID>DLC</ID> <Order>12</Order> <IsVisible>1</IsVisible> <Width>38</Width> </COLUMN> <COLUMN> <ID>Data Byte(s)</ID> <Order>13</Order> <IsVisible>1</IsVisible> <Width>235</Width> </COLUMN> <IsHex>1</IsHex> <IsAppend>0</IsAppend> <IsInterpret>0</IsInterpret> <Time_Mode>SYSTEM</Time_Mode> <Window_Position> <Visibility>SHOWNORMAL</Visibility> <WindowPlacement>SETMINPOSITION</WindowPlacement> <Top>0</Top> <Left>0</Left> <Bottom>566</Bottom> <Right>1321</Right> </Window_Position> <Interpretation_Window_Position> <Visibility>SHOWNORMAL</Visibility> <WindowPlacement>RESTORETOMAXIMIZED</WindowPlacement> <Top>115</Top> <Left>49</Left> <Bottom>392</Bottom> <Right>398</Right> </Interpretation_Window_Position> </J1939_Message_Window> <CAN_Tx_Window> <Message_Block> <Block_Name>OnTime</Block_Name> <IsEnabled>1</IsEnabled> <Trigger>1</Trigger> <Index>0</Index> <Key_Value>A</Key_Value> <Time_Interval>100</Time_Interval> <IsCyclic>0</IsCyclic> <Transmit_All_Frames>0</Transmit_All_Frames> <MESSAGES> <Message_ID>256</Message_ID> <IsExtended>FALSE</IsExtended> <IsRtr>0</IsRtr> <DLC>8</DLC> <Index>0</Index> <Channel>1</Channel> <DataBytes> <Byte>0</Byte> <Byte>17</Byte> <Byte>0</Byte> <Byte>0</Byte> <Byte>0</Byte> <Byte>0</Byte> <Byte>0</Byte> <Byte>0</Byte> </DataBytes> <IsEnabled>1</IsEnabled> </MESSAGES> </Message_Block> <Window_Position> <Visibility>SHOWNORMAL</Visibility> <WindowPlacement>SETMINPOSITION</WindowPlacement> <Top>72</Top> <Left>166</Left> <Bottom>747</Bottom> <Right>1016</Right> </Window_Position> <IsAutoSaveEnabled>1</IsAutoSaveEnabled> <Time_Delay_Blocks_Enabled>FALSE</Time_Delay_Blocks_Enabled> <Time_Delay_Blocks>100</Time_Delay_Blocks> <Splitter_Window_Root_0> <CxIdeal>554</CxIdeal> <CxMin>0</CxMin> </Splitter_Window_Root_0> <Splitter_Window_Root_1> <CxIdeal>72</CxIdeal> <CxMin>50</CxMin> </Splitter_Window_Root_1> <Splitter_Window_Left_0> <CxIdeal>226</CxIdeal> <CxMin>0</CxMin> </Splitter_Window_Left_0> <Splitter_Window_Left_1> <CxIdeal>322</CxIdeal> <CxMin>0</CxMin> <CxIdeal>322</CxIdeal> <CxMin>0</CxMin> </Splitter_Window_Left_1> <Splitter_Window_Right_0> <CxIdeal>225</CxIdeal> <CxMin>0</CxMin> </Splitter_Window_Right_0> </CAN_Tx_Window> <CAN_Wave_Form_Genarator> <Default_Sampling_Period>125</Default_Sampling_Period> <SignalDefiner_AutoCorrect>1</SignalDefiner_AutoCorrect> </CAN_Wave_Form_Genarator> <CAN_Bus_Statistics> <COLUMN> <ID>Parameter</ID> <Order>1</Order> <Width>200</Width> <IsVisible>1</IsVisible> </COLUMN> <COLUMN> <ID>Channel 1</ID> <Order>2</Order> <Width>90</Width> <IsVisible>1</IsVisible> </COLUMN> <COLUMN> <ID>Channel 2</ID> <Order>3</Order> <Width>90</Width> <IsVisible>1</IsVisible> </COLUMN> <COLUMN> <ID>Channel 3</ID> <Order>4</Order> <Width>90</Width> <IsVisible>1</IsVisible> </COLUMN> <COLUMN> <ID>Channel 4</ID> <Order>5</Order> <Width>90</Width> <IsVisible>1</IsVisible> </COLUMN> <COLUMN> <ID>Channel 5</ID> <Order>6</Order> <Width>90</Width> <IsVisible>1</IsVisible> </COLUMN> <COLUMN> <ID>Channel 6</ID> <Order>7</Order> <Width>90</Width> <IsVisible>1</IsVisible> </COLUMN> <COLUMN> <ID>Channel 7</ID> <Order>8</Order> <Width>90</Width> <IsVisible>1</IsVisible> </COLUMN> <COLUMN> <ID>Channel 8</ID> <Order>9</Order> <Width>90</Width> <IsVisible>1</IsVisible> </COLUMN> <COLUMN> <ID>Channel 9</ID> <Order>10</Order> <Width>90</Width> <IsVisible>1</IsVisible> </COLUMN> <COLUMN> <ID>Channel 10</ID> <Order>11</Order> <Width>90</Width> <IsVisible>1</IsVisible> </COLUMN> <COLUMN> <ID>Channel 11</ID> <Order>12</Order> <Width>90</Width> <IsVisible>1</IsVisible> </COLUMN> <COLUMN> <ID>Channel 12</ID> <Order>13</Order> <Width>90</Width> <IsVisible>1</IsVisible> </COLUMN> <COLUMN> <ID>Channel 13</ID> <Order>14</Order> <Width>90</Width> <IsVisible>1</IsVisible> </COLUMN> <COLUMN> <ID>Channel 14</ID> <Order>15</Order> <Width>90</Width> <IsVisible>1</IsVisible> </COLUMN> <COLUMN> <ID>Channel 15</ID> <Order>16</Order> <Width>90</Width> <IsVisible>1</IsVisible> </COLUMN> <COLUMN> <ID>Channel 16</ID> <Order>17</Order> <Width>90</Width> <IsVisible>1</IsVisible> </COLUMN> <Window_Position> <Visibility>SHOWNORMAL</Visibility> <WindowPlacement>RESTORETOMAXIMIZED</WindowPlacement> <Top>456</Top> <Left>552</Left> <Bottom>986</Bottom> <Right>942</Right> </Window_Position> </CAN_Bus_Statistics> <CAN_TS_Editor> <XML_File_Path>TestSetupFile.xml</XML_File_Path> <Tree_Bkg_Color>feefed</Tree_Bkg_Color> <Tree_Text_Color>0</Tree_Text_Color> <List_Row1_Color>feefed</List_Row1_Color> <List_Row2_Color>ffffff</List_Row2_Color> <Window_Position> <Visibility>HIDE</Visibility> <WindowPlacement>SETMINPOSITION</WindowPlacement> <Top>20</Top> <Left>171</Left> <Bottom>695</Bottom> <Right>1021</Right> </Window_Position> <Splitter_Window> <CxIdeal>200</CxIdeal> <CxMin>0</CxMin> </Splitter_Window> </CAN_TS_Editor> <CAN_TS_Executor> <Test_Suite_Name>Unnamed Test Suite</Test_Suite_Name> <IsEnable>1</IsEnable> <TEST_SUITE> <File_Path>TestSetupFile.xml</File_Path> <IsEnable>1</IsEnable> <Testcases_Selected> <Index>0</Index> </Testcases_Selected> </TEST_SUITE> <Window_Position> <Visibility>HIDE</Visibility> <WindowPlacement>SETMINPOSITION</WindowPlacement> <Top>116</Top> <Left>353</Left> <Bottom>708</Bottom> <Right>1203</Right> </Window_Position> <Splitter_Window> <CxIdeal>200</CxIdeal> <CxMin>0</CxMin> </Splitter_Window> </CAN_TS_Executor> </Module_Configuration> </BUSMASTER_CONFIGURATION>
{ "pile_set_name": "Github" }
/* eslint-disable camelcase */ 'use strict'; var assign = require('../lib/assign').assign; var fiveCharacterLocales = { da_DK: require('./da_DK'), de_DE: require('./de_DE'), en_US: require('./en_US'), en_AU: require('./en_AU'), en_GB: require('./en_GB'), es_ES: require('./es_ES'), fr_CA: require('./fr_CA'), fr_FR: require('./fr_FR'), id_ID: require('./id_ID'), it_IT: require('./it_IT'), ja_JP: require('./ja_JP'), ko_KR: require('./ko_KR'), nl_NL: require('./nl_NL'), no_NO: require('./no_NO'), pl_PL: require('./pl_PL'), pt_BR: require('./pt_BR'), pt_PT: require('./pt_PT'), ru_RU: require('./ru_RU'), sv_SE: require('./sv_SE'), th_TH: require('./th_TH'), zh_CN: require('./zh_CN'), zh_HK: require('./zh_HK'), zh_TW: require('./zh_TW') }; var twoCharacterLocaleAliases = { da: fiveCharacterLocales.da_DK, de: fiveCharacterLocales.de_DE, en: fiveCharacterLocales.en_US, es: fiveCharacterLocales.es_ES, fr: fiveCharacterLocales.fr_FR, id: fiveCharacterLocales.id_ID, it: fiveCharacterLocales.it_IT, ja: fiveCharacterLocales.ja_JP, ko: fiveCharacterLocales.ko_KR, nl: fiveCharacterLocales.nl_NL, no: fiveCharacterLocales.no_NO, pl: fiveCharacterLocales.pl_PL, pt: fiveCharacterLocales.pt_PT, ru: fiveCharacterLocales.ru_RU, sv: fiveCharacterLocales.sv_SE, th: fiveCharacterLocales.th_TH, zh: fiveCharacterLocales.zh_CN }; module.exports = { twoCharacterLocaleAliases: twoCharacterLocaleAliases, fiveCharacterLocales: fiveCharacterLocales, translations: assign({}, twoCharacterLocaleAliases, fiveCharacterLocales) }; /* eslint-enable camelcase */
{ "pile_set_name": "Github" }
/* * fstransform - transform a file-system to another file-system type, * preserving its contents and without the need for a backup * * Copyright (C) 2011-2012 Massimiliano Ghilardi * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. * * rope_impl.hh * * Created on: Mar 3, 2018 * Author: max */ #ifndef FSTRANSFORM_ROPE_IMPL_HH #define FSTRANSFORM_ROPE_IMPL_HH #include "../types.hh" // for ft_string, ft_size FT_NAMESPACE_BEGIN /** * short immutable string, with a prefix shared with other rope:s */ class ft_rope_impl { private: enum { PREFIX_SCALE = sizeof(void *) }; ft_i32 prefix_delta; ft_u32 refcount, suffix_len; /** default constructor. private use only, call make() instead */ FT_INLINE ft_rope_impl() : prefix_delta(0), refcount(0), suffix_len(0) { } /** copy constructor. forbidden. call make() instead */ ft_rope_impl(const ft_rope_impl & other); /** assignment operator. forbidden */ const ft_rope_impl & operator=(const ft_rope_impl & other); /** * constructor. private use only. call make() instead. * makes a copy of 'suffix' */ FT_INLINE ft_rope_impl(ft_rope_impl * prefix_ptr, ft_size suffix_length); /** destructor. private use only. call unref() instead */ ~ft_rope_impl(); FT_INLINE char * suffix() { return reinterpret_cast<char *>(this) + sizeof(ft_rope_impl); } FT_INLINE const char * suffix() const { return reinterpret_cast<const char *>(this) + sizeof(ft_rope_impl); } FT_INLINE ft_rope_impl * prefix() const { if (!prefix_delta) return NULL; ft_size self = (ft_size)(this); return reinterpret_cast<ft_rope_impl *>(self + (ft_size)prefix_delta * PREFIX_SCALE); } FT_INLINE ft_size prefix_len() const { ft_rope_impl * ptr = prefix(); return ptr ? ptr->len() : 0; } public: /** create an empty rope */ static ft_rope_impl * make(); /** create a rope with given prefix and suffix. makes a private copy of 'suffix' */ static ft_rope_impl * make(ft_rope_impl * prefix, const char * suffix, ft_size suffix_length); /** increment reference count */ void ref(); /** decrement reference count */ void unref(); bool empty() const; ft_size len() const; /** convert to ft_string */ void to_string(ft_string & append_dst) const; /** compare against char[] */ bool equals(const char other[], ft_size other_len) const; /** return this hash */ ft_size hash() const; /** return other's hash */ static ft_size hash(const char other[], ft_size other_len); }; FT_NAMESPACE_END #endif /* FSTRANSFORM_ROPE_IMPL_HH */
{ "pile_set_name": "Github" }
package org.zstack.network.service.vip; import org.zstack.header.core.Completion; import org.zstack.header.message.Message; /** * Created by xing5 on 2016/11/20. */ public abstract class VipBaseBackend extends VipBase { public VipBaseBackend(VipVO self) { super(self); } protected abstract void releaseVipOnBackend(Completion completion); protected abstract void acquireVipOnBackend(Completion completion); protected abstract void handleBackendSpecificMessage(Message msg); }
{ "pile_set_name": "Github" }
/* Copyright Rene Rivera 2008-2014 Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) */ #ifndef BOOST_PREDEF_COMPILER_LLVM_H #define BOOST_PREDEF_COMPILER_LLVM_H /* Other compilers that emulate this one need to be detected first. */ #include <boost/predef/compiler/clang.h> #include <boost/predef/version_number.h> #include <boost/predef/make.h> /*` [heading `BOOST_COMP_LLVM`] [@http://en.wikipedia.org/wiki/LLVM LLVM] compiler. [table [[__predef_symbol__] [__predef_version__]] [[`__llvm__`] [__predef_detection__]] ] */ #define BOOST_COMP_LLVM BOOST_VERSION_NUMBER_NOT_AVAILABLE #if defined(__llvm__) # define BOOST_COMP_LLVM_DETECTION BOOST_VERSION_NUMBER_AVAILABLE #endif #ifdef BOOST_COMP_LLVM_DETECTION # if defined(BOOST_PREDEF_DETAIL_COMP_DETECTED) # define BOOST_COMP_LLVM_EMULATED BOOST_COMP_LLVM_DETECTION # else # undef BOOST_COMP_LLVM # define BOOST_COMP_LLVM BOOST_COMP_LLVM_DETECTION # endif # define BOOST_COMP_LLVM_AVAILABLE # include <boost/predef/detail/comp_detected.h> #endif #define BOOST_COMP_LLVM_NAME "LLVM" #include <boost/predef/detail/test.h> BOOST_PREDEF_DECLARE_TEST(BOOST_COMP_LLVM,BOOST_COMP_LLVM_NAME) #ifdef BOOST_COMP_LLVM_EMULATED #include <boost/predef/detail/test.h> BOOST_PREDEF_DECLARE_TEST(BOOST_COMP_LLVM_EMULATED,BOOST_COMP_LLVM_NAME) #endif #endif
{ "pile_set_name": "Github" }
// Copyright (c) 2011 The LevelDB Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. See the AUTHORS file for names of contributors. // AtomicPointer provides storage for a lock-free pointer. // Platform-dependent implementation of AtomicPointer: // - If the platform provides a cheap barrier, we use it with raw pointers // - If <atomic> is present (on newer versions of gcc, it is), we use // a <atomic>-based AtomicPointer. However we prefer the memory // barrier based version, because at least on a gcc 4.4 32-bit build // on linux, we have encountered a buggy <atomic> implementation. // Also, some <atomic> implementations are much slower than a memory-barrier // based implementation (~16ns for <atomic> based acquire-load vs. ~1ns for // a barrier based acquire-load). // This code is based on atomicops-internals-* in Google's perftools: // http://code.google.com/p/google-perftools/source/browse/#svn%2Ftrunk%2Fsrc%2Fbase #ifndef PORT_ATOMIC_POINTER_H_ #define PORT_ATOMIC_POINTER_H_ #include <stdint.h> #ifdef LEVELDB_ATOMIC_PRESENT #include <atomic> #endif #ifdef OS_WIN #include <windows.h> #endif #ifdef OS_MACOSX #include <libkern/OSAtomic.h> #endif #if defined(_M_X64) || defined(__x86_64__) #define ARCH_CPU_X86_FAMILY 1 #elif defined(_M_IX86) || defined(__i386__) || defined(__i386) #define ARCH_CPU_X86_FAMILY 1 #elif defined(__ARMEL__) #define ARCH_CPU_ARM_FAMILY 1 #elif defined(__ppc__) || defined(__powerpc__) || defined(__powerpc64__) #define ARCH_CPU_PPC_FAMILY 1 #endif namespace leveldb { namespace port { // Define MemoryBarrier() if available // Windows on x86 #if defined(OS_WIN) && defined(COMPILER_MSVC) && defined(ARCH_CPU_X86_FAMILY) // windows.h already provides a MemoryBarrier(void) macro // http://msdn.microsoft.com/en-us/library/ms684208(v=vs.85).aspx #define LEVELDB_HAVE_MEMORY_BARRIER // Mac OS #elif defined(OS_MACOSX) inline void MemoryBarrier() { OSMemoryBarrier(); } #define LEVELDB_HAVE_MEMORY_BARRIER // Gcc on x86 #elif defined(ARCH_CPU_X86_FAMILY) && defined(__GNUC__) inline void MemoryBarrier() { // See http://gcc.gnu.org/ml/gcc/2003-04/msg01180.html for a discussion on // this idiom. Also see http://en.wikipedia.org/wiki/Memory_ordering. __asm__ __volatile__("" : : : "memory"); } #define LEVELDB_HAVE_MEMORY_BARRIER // Sun Studio #elif defined(ARCH_CPU_X86_FAMILY) && defined(__SUNPRO_CC) inline void MemoryBarrier() { // See http://gcc.gnu.org/ml/gcc/2003-04/msg01180.html for a discussion on // this idiom. Also see http://en.wikipedia.org/wiki/Memory_ordering. asm volatile("" : : : "memory"); } #define LEVELDB_HAVE_MEMORY_BARRIER // ARM Linux #elif defined(ARCH_CPU_ARM_FAMILY) && defined(__linux__) typedef void (*LinuxKernelMemoryBarrierFunc)(void); // The Linux ARM kernel provides a highly optimized device-specific memory // barrier function at a fixed memory address that is mapped in every // user-level process. // // This beats using CPU-specific instructions which are, on single-core // devices, un-necessary and very costly (e.g. ARMv7-A "dmb" takes more // than 180ns on a Cortex-A8 like the one on a Nexus One). Benchmarking // shows that the extra function call cost is completely negligible on // multi-core devices. // inline void MemoryBarrier() { (*(LinuxKernelMemoryBarrierFunc)0xffff0fa0)(); } #define LEVELDB_HAVE_MEMORY_BARRIER // PPC #elif defined(ARCH_CPU_PPC_FAMILY) && defined(__GNUC__) inline void MemoryBarrier() { // TODO for some powerpc expert: is there a cheaper suitable variant? // Perhaps by having separate barriers for acquire and release ops. asm volatile("sync" : : : "memory"); } #define LEVELDB_HAVE_MEMORY_BARRIER #endif // AtomicPointer built using platform-specific MemoryBarrier() #if defined(LEVELDB_HAVE_MEMORY_BARRIER) class AtomicPointer { private: void* rep_; public: AtomicPointer() { } explicit AtomicPointer(void* p) : rep_(p) {} inline void* NoBarrier_Load() const { return rep_; } inline void NoBarrier_Store(void* v) { rep_ = v; } inline void* Acquire_Load() const { void* result = rep_; MemoryBarrier(); return result; } inline void Release_Store(void* v) { MemoryBarrier(); rep_ = v; } }; // AtomicPointer based on <cstdatomic> #elif defined(LEVELDB_ATOMIC_PRESENT) class AtomicPointer { private: std::atomic<void*> rep_; public: AtomicPointer() { } explicit AtomicPointer(void* v) : rep_(v) { } inline void* Acquire_Load() const { return rep_.load(std::memory_order_acquire); } inline void Release_Store(void* v) { rep_.store(v, std::memory_order_release); } inline void* NoBarrier_Load() const { return rep_.load(std::memory_order_relaxed); } inline void NoBarrier_Store(void* v) { rep_.store(v, std::memory_order_relaxed); } }; // Atomic pointer based on sparc memory barriers #elif defined(__sparcv9) && defined(__GNUC__) class AtomicPointer { private: void* rep_; public: AtomicPointer() { } explicit AtomicPointer(void* v) : rep_(v) { } inline void* Acquire_Load() const { void* val; __asm__ __volatile__ ( "ldx [%[rep_]], %[val] \n\t" "membar #LoadLoad|#LoadStore \n\t" : [val] "=r" (val) : [rep_] "r" (&rep_) : "memory"); return val; } inline void Release_Store(void* v) { __asm__ __volatile__ ( "membar #LoadStore|#StoreStore \n\t" "stx %[v], [%[rep_]] \n\t" : : [rep_] "r" (&rep_), [v] "r" (v) : "memory"); } inline void* NoBarrier_Load() const { return rep_; } inline void NoBarrier_Store(void* v) { rep_ = v; } }; // Atomic pointer based on ia64 acq/rel #elif defined(__ia64) && defined(__GNUC__) class AtomicPointer { private: void* rep_; public: AtomicPointer() { } explicit AtomicPointer(void* v) : rep_(v) { } inline void* Acquire_Load() const { void* val ; __asm__ __volatile__ ( "ld8.acq %[val] = [%[rep_]] \n\t" : [val] "=r" (val) : [rep_] "r" (&rep_) : "memory" ); return val; } inline void Release_Store(void* v) { __asm__ __volatile__ ( "st8.rel [%[rep_]] = %[v] \n\t" : : [rep_] "r" (&rep_), [v] "r" (v) : "memory" ); } inline void* NoBarrier_Load() const { return rep_; } inline void NoBarrier_Store(void* v) { rep_ = v; } }; // We have neither MemoryBarrier(), nor <atomic> #else #error Please implement AtomicPointer for this platform. #endif #undef LEVELDB_HAVE_MEMORY_BARRIER #undef ARCH_CPU_X86_FAMILY #undef ARCH_CPU_ARM_FAMILY #undef ARCH_CPU_PPC_FAMILY } // namespace port } // namespace leveldb #endif // PORT_ATOMIC_POINTER_H_
{ "pile_set_name": "Github" }
package org.telegram.api.functions.channels; import org.telegram.api.input.chat.TLAbsInputChannel; import org.telegram.api.message.TLExportedMessageLink; import org.telegram.tl.StreamingUtils; import org.telegram.tl.TLContext; import org.telegram.tl.TLMethod; import org.telegram.tl.TLObject; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; /** * The type TL request channel edit admin */ public class TLRequestChannelsExportMessageLink extends TLMethod<TLExportedMessageLink> { /** * The constant CLASS_ID. */ public static final int CLASS_ID = 0xc846d22d; private TLAbsInputChannel channel; private int id; /** * Instantiates a new TL request channel edit admin */ public TLRequestChannelsExportMessageLink() { super(); } public int getClassId() { return CLASS_ID; } public TLExportedMessageLink deserializeResponse(InputStream stream, TLContext context) throws IOException { final TLObject res = StreamingUtils.readTLObject(stream, context); if (res == null) { throw new IOException("Unable to parse response"); } if ((res instanceof TLExportedMessageLink)) { return (TLExportedMessageLink) res; } throw new IOException("Incorrect response type. Expected " + TLExportedMessageLink.class.getName() +", got: " + res.getClass().getName()); } public TLAbsInputChannel getChannel() { return channel; } public void setChannel(TLAbsInputChannel channel) { this.channel = channel; } public void serializeBody(OutputStream stream) throws IOException { StreamingUtils.writeTLObject(this.channel, stream); StreamingUtils.writeInt(this.id, stream); } public void deserializeBody(InputStream stream, TLContext context) throws IOException { this.channel = (TLAbsInputChannel) StreamingUtils.readTLObject(stream, context); this.id = StreamingUtils.readInt(stream); } public String toString() { return "channels.exportMessageLink#c846d22d"; } }
{ "pile_set_name": "Github" }
// entity 0 { "classname" "worldspawn" "author" "Robert Kooima" "version" "1.1" "shot" "shot-medium/drops.jpg" "back" "map-back/city.sol" "grad" "back/city.png" "song" "bgm/track3.ogg" "time" "9000" "goal" "20" "time_hs" "500 1500" "coin_hs" "194 120" "goal_hs" "1250 4500" "message" "Remember to keep an eye on the shadow to\help control a bouncing ball. And don't\forget to use the mouse buttons to keep the\ball in view.\" // brush 0 { ( 256 256 -16 ) ( 0 256 -16 ) ( 0 0 -16 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 ( 0 0 0 ) ( 0 256 0 ) ( 256 256 0 ) mtrl/turf-red 0 0 0 0.5 0.5 0 0 0 ( 16 64 0 ) ( 272 64 0 ) ( 272 64 -16 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 192 0 0 ) ( 192 256 0 ) ( 192 256 -16 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 256 192 0 ) ( 0 192 0 ) ( 0 192 -16 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 64 256 0 ) ( 64 0 0 ) ( 64 0 -16 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 } // brush 1 { ( 64 320 0 ) ( 64 64 0 ) ( 64 64 -16 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 256 256 0 ) ( 0 256 0 ) ( 0 256 -16 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 192 64 0 ) ( 192 320 0 ) ( 192 320 -16 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 16 192 0 ) ( 272 192 0 ) ( 272 192 -16 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 0 64 0 ) ( 0 320 0 ) ( 256 320 0 ) mtrl/turf-red 0 0 0 0.5 0.5 0 0 0 ( 256 320 -16 ) ( 0 320 -16 ) ( 0 64 -16 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 } // brush 2 { ( 256 128 -16 ) ( 0 128 -16 ) ( 0 -128 -16 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 ( 0 -128 0 ) ( 0 128 0 ) ( 256 128 0 ) mtrl/turf-red 0 0 0 0.5 0.5 0 0 0 ( 16 0 0 ) ( 272 0 0 ) ( 272 0 -16 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 192 -128 0 ) ( 192 128 0 ) ( 192 128 -16 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 256 64 0 ) ( 0 64 0 ) ( 0 64 -16 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 64 128 0 ) ( 64 -128 0 ) ( 64 -128 -16 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 } // brush 3 { ( 0 256 0 ) ( 0 0 0 ) ( 0 0 -16 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 128 192 0 ) ( -128 192 0 ) ( -128 192 -16 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 64 0 0 ) ( 64 256 0 ) ( 64 256 -16 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( -112 64 0 ) ( 144 64 0 ) ( 144 64 -16 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( -64 0 0 ) ( -64 256 0 ) ( 192 256 0 ) mtrl/turf-red 0 0 0 0.5 0.5 0 0 0 ( 192 256 -16 ) ( -64 256 -16 ) ( -64 0 -16 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 } // brush 4 { ( 192 320 -16 ) ( -64 320 -16 ) ( -64 64 -16 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 ( -64 64 0 ) ( -64 320 0 ) ( 192 320 0 ) mtrl/coin-red 0 0 0 0.5 0.5 0 0 0 ( -112 192 0 ) ( 144 192 0 ) ( 144 192 -16 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 64 64 0 ) ( 64 320 0 ) ( 64 320 -16 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 192 256 0 ) ( -64 256 0 ) ( -64 256 -16 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 0 320 0 ) ( 0 64 0 ) ( 0 64 -16 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 } // brush 5 { ( 0 128 0 ) ( 0 -128 0 ) ( 0 -128 -16 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 128 64 0 ) ( -128 64 0 ) ( -128 64 -16 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 64 -128 0 ) ( 64 128 0 ) ( 64 128 -16 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( -48 0 0 ) ( 208 0 0 ) ( 208 0 -16 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( -64 -128 0 ) ( -64 128 0 ) ( 192 128 0 ) mtrl/coin-red 0 0 0 0.5 0.5 0 0 0 ( 192 128 -16 ) ( -64 128 -16 ) ( -64 -128 -16 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 } // brush 6 { ( 384 256 -16 ) ( 128 256 -16 ) ( 128 0 -16 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 ( 128 0 0 ) ( 128 256 0 ) ( 384 256 0 ) mtrl/turf-red 0 0 0 0.5 0.5 0 0 0 ( 80 64 0 ) ( 336 64 0 ) ( 336 64 -16 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 256 0 0 ) ( 256 256 0 ) ( 256 256 -16 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 320 192 0 ) ( 64 192 0 ) ( 64 192 -16 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 192 256 0 ) ( 192 0 0 ) ( 192 0 -16 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 } // brush 7 { ( 192 320 0 ) ( 192 64 0 ) ( 192 64 -16 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 384 256 0 ) ( 128 256 0 ) ( 128 256 -16 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 256 64 0 ) ( 256 320 0 ) ( 256 320 -16 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 80 192 0 ) ( 336 192 0 ) ( 336 192 -16 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 128 64 0 ) ( 128 320 0 ) ( 384 320 0 ) mtrl/coin-red 0 0 0 0.5 0.5 0 0 0 ( 384 320 -16 ) ( 128 320 -16 ) ( 128 64 -16 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 } // brush 8 { ( 384 128 -16 ) ( 128 128 -16 ) ( 128 -128 -16 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 ( 128 -128 0 ) ( 128 128 0 ) ( 384 128 0 ) mtrl/coin-red 0 0 0 0.5 0.5 0 0 0 ( 144 0 0 ) ( 400 0 0 ) ( 400 0 -16 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 256 -128 0 ) ( 256 128 0 ) ( 256 128 -16 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 320 64 0 ) ( 64 64 0 ) ( 64 64 -16 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 192 128 0 ) ( 192 -128 0 ) ( 192 -128 -16 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 } // brush 9 { ( 256 256 0 ) ( 256 0 0 ) ( 256 0 -16 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 328 192 0 ) ( 72 192 0 ) ( 72 192 -16 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 264 0 0 ) ( 264 256 0 ) ( 264 256 -16 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 ( 88 64 0 ) ( 344 64 0 ) ( 344 64 -16 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 192 0 0 ) ( 192 256 0 ) ( 448 256 0 ) mtrl/edge-red 0 0 0 0.5 0.5 0 0 0 ( 448 256 -16 ) ( 192 256 -16 ) ( 192 0 -16 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 } // brush 10 { ( 448 320 -16 ) ( 192 320 -16 ) ( 192 64 -16 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 ( 192 64 0 ) ( 192 320 0 ) ( 448 320 0 ) mtrl/edge-red 0 0 0 0.5 0.5 0 0 0 ( 88 192 0 ) ( 344 192 0 ) ( 344 192 -16 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 264 264 0 ) ( 264 264 -16 ) ( 264 192 -16 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 ( 264 264 -16 ) ( 264 264 0 ) ( 256 256 0 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 256 320 0 ) ( 256 64 0 ) ( 256 64 -16 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 } // brush 11 { ( 256 128 0 ) ( 256 -128 0 ) ( 256 -128 -16 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 328 64 0 ) ( 72 64 0 ) ( 72 64 -16 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 264 -8 -16 ) ( 264 -8 0 ) ( 264 64 0 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 ( 264 -8 0 ) ( 264 -8 -16 ) ( 256 0 -16 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 192 -128 0 ) ( 192 128 0 ) ( 448 128 0 ) mtrl/edge-red 0 0 0 0.5 0.5 0 0 0 ( 448 128 -16 ) ( 192 128 -16 ) ( 192 -128 -16 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 } // brush 12 { ( 184 256 -16 ) ( -72 256 -16 ) ( -72 0 -16 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 ( -72 0 0 ) ( -72 256 0 ) ( 184 256 0 ) mtrl/edge-red 0 0 0 0.5 0.5 0 0 0 ( -176 64 0 ) ( 80 64 0 ) ( 80 64 -16 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 0 0 0 ) ( 0 256 0 ) ( 0 256 -16 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 64 192 0 ) ( -192 192 0 ) ( -192 192 -16 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( -8 256 0 ) ( -8 0 0 ) ( -8 0 -16 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 } // brush 13 { ( -8 264 -16 ) ( -8 264 0 ) ( -8 192 0 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 ( -8 264 0 ) ( -8 264 -16 ) ( 0 256 -16 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 0 64 0 ) ( 0 320 0 ) ( 0 320 -16 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( -176 192 0 ) ( 80 192 0 ) ( 80 192 -16 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( -72 64 0 ) ( -72 320 0 ) ( 184 320 0 ) mtrl/edge-red 0 0 0 0.5 0.5 0 0 0 ( 184 320 -16 ) ( -72 320 -16 ) ( -72 64 -16 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 } // brush 14 { ( 184 128 -16 ) ( -72 128 -16 ) ( -72 -128 -16 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 ( -72 -128 0 ) ( -72 128 0 ) ( 184 128 0 ) mtrl/edge-red 0 0 0 0.5 0.5 0 0 0 ( -8 -8 -16 ) ( -8 -8 0 ) ( 0 0 0 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 0 -128 0 ) ( 0 128 0 ) ( 0 128 -16 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 64 64 0 ) ( -192 64 0 ) ( -192 64 -16 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( -8 -8 0 ) ( -8 -8 -16 ) ( -8 64 -16 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 } // brush 15 { ( 256 384 -16 ) ( 0 384 -16 ) ( 0 128 -16 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 ( 0 128 0 ) ( 0 384 0 ) ( 256 384 0 ) mtrl/edge-red 0 0 0 0.5 0.5 0 0 0 ( 16 256 0 ) ( 272 256 0 ) ( 272 256 -16 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 192 72 0 ) ( 192 328 0 ) ( 192 328 -16 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 256 264 0 ) ( 0 264 0 ) ( 0 264 -16 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 ( 64 328 0 ) ( 64 72 0 ) ( 64 72 -16 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 } // brush 16 { ( -8 264 -16 ) ( -8 264 0 ) ( 0 256 0 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( -8 264 0 ) ( -8 264 -16 ) ( 64 264 -16 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 ( 64 72 0 ) ( 64 328 0 ) ( 64 328 -16 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( -112 256 0 ) ( 144 256 0 ) ( 144 256 -16 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( -64 128 0 ) ( -64 384 0 ) ( 192 384 0 ) mtrl/edge-red 0 0 0 0.5 0.5 0 0 0 ( 192 384 -16 ) ( -64 384 -16 ) ( -64 128 -16 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 } // brush 17 { ( 384 384 -16 ) ( 128 384 -16 ) ( 128 128 -16 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 ( 128 128 0 ) ( 128 384 0 ) ( 384 384 0 ) mtrl/edge-red 0 0 0 0.5 0.5 0 0 0 ( 80 256 0 ) ( 336 256 0 ) ( 336 256 -16 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 264 264 0 ) ( 264 264 -16 ) ( 256 256 -16 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 264 264 -16 ) ( 264 264 0 ) ( 192 264 0 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 ( 192 328 0 ) ( 192 72 0 ) ( 192 72 -16 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 } // brush 18 { ( 64 64 0 ) ( 64 -192 0 ) ( 64 -192 -16 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 256 0 0 ) ( 0 0 0 ) ( 0 0 -16 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 192 -192 0 ) ( 192 64 0 ) ( 192 64 -16 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 16 -8 0 ) ( 272 -8 0 ) ( 272 -8 -16 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 ( 0 -136 0 ) ( 0 120 0 ) ( 256 120 0 ) mtrl/edge-red 0 0 0 0.5 0.5 0 0 0 ( 256 120 -16 ) ( 0 120 -16 ) ( 0 -136 -16 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 } // brush 19 { ( 192 120 -16 ) ( -64 120 -16 ) ( -64 -136 -16 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 ( -64 -136 0 ) ( -64 120 0 ) ( 192 120 0 ) mtrl/edge-red 0 0 0 0.5 0.5 0 0 0 ( -8 -8 -16 ) ( -8 -8 0 ) ( 64 -8 0 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 ( 64 -192 0 ) ( 64 64 0 ) ( 64 64 -16 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 192 0 0 ) ( -64 0 0 ) ( -64 0 -16 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( -8 -8 0 ) ( -8 -8 -16 ) ( 0 0 -16 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 } // brush 20 { ( 192 64 0 ) ( 192 -192 0 ) ( 192 -192 -16 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 384 0 0 ) ( 128 0 0 ) ( 128 0 -16 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 264 -8 -16 ) ( 264 -8 0 ) ( 256 0 0 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 264 -8 0 ) ( 264 -8 -16 ) ( 192 -8 -16 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 ( 128 -136 0 ) ( 128 120 0 ) ( 384 120 0 ) mtrl/edge-red 0 0 0 0.5 0.5 0 0 0 ( 384 120 -16 ) ( 128 120 -16 ) ( 128 -136 -16 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 } // brush 21 { ( 320 256 -64 ) ( 320 0 -64 ) ( 320 0 -80 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 512 192 -64 ) ( 256 192 -64 ) ( 256 192 -80 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 448 0 -64 ) ( 448 256 -64 ) ( 448 256 -80 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 272 64 -64 ) ( 528 64 -64 ) ( 528 64 -80 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 256 0 -64 ) ( 256 256 -64 ) ( 512 256 -64 ) mtrl/turf-red 0 0 0 0.5 0.5 0 0 0 ( 512 256 -80 ) ( 256 256 -80 ) ( 256 0 -80 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 } // brush 22 { ( 512 320 -80 ) ( 256 320 -80 ) ( 256 64 -80 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 ( 256 64 -64 ) ( 256 320 -64 ) ( 512 320 -64 ) mtrl/turf-red 0 0 0 0.5 0.5 0 0 0 ( 272 192 -64 ) ( 528 192 -64 ) ( 528 192 -80 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 448 64 -64 ) ( 448 320 -64 ) ( 448 320 -80 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 512 256 -64 ) ( 256 256 -64 ) ( 256 256 -80 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 320 320 -64 ) ( 320 64 -64 ) ( 320 64 -80 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 } // brush 23 { ( 320 128 -64 ) ( 320 -128 -64 ) ( 320 -128 -80 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 512 64 -64 ) ( 256 64 -64 ) ( 256 64 -80 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 448 -128 -64 ) ( 448 128 -64 ) ( 448 128 -80 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 272 0 -64 ) ( 528 0 -64 ) ( 528 0 -80 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 256 -128 -64 ) ( 256 128 -64 ) ( 512 128 -64 ) mtrl/turf-red 0 0 0 0.5 0.5 0 0 0 ( 512 128 -80 ) ( 256 128 -80 ) ( 256 -128 -80 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 } // brush 24 { ( 448 256 -80 ) ( 192 256 -80 ) ( 192 0 -80 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 ( 192 0 -64 ) ( 192 256 -64 ) ( 448 256 -64 ) mtrl/turf-red 0 0 0 0.5 0.5 0 0 0 ( 144 64 -64 ) ( 400 64 -64 ) ( 400 64 -80 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 320 0 -64 ) ( 320 256 -64 ) ( 320 256 -80 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 384 192 -64 ) ( 128 192 -64 ) ( 128 192 -80 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 256 256 -64 ) ( 256 0 -64 ) ( 256 0 -80 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 } // brush 25 { ( 256 320 -64 ) ( 256 64 -64 ) ( 256 64 -80 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 448 256 -64 ) ( 192 256 -64 ) ( 192 256 -80 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 320 64 -64 ) ( 320 320 -64 ) ( 320 320 -80 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 144 192 -64 ) ( 400 192 -64 ) ( 400 192 -80 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 192 64 -64 ) ( 192 320 -64 ) ( 448 320 -64 ) mtrl/coin-red 0 0 0 0.5 0.5 0 0 0 ( 448 320 -80 ) ( 192 320 -80 ) ( 192 64 -80 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 } // brush 26 { ( 448 128 -80 ) ( 192 128 -80 ) ( 192 -128 -80 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 ( 192 -128 -64 ) ( 192 128 -64 ) ( 448 128 -64 ) mtrl/coin-red 0 0 0 0.5 0.5 0 0 0 ( 208 0 -64 ) ( 464 0 -64 ) ( 464 0 -80 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 320 -128 -64 ) ( 320 128 -64 ) ( 320 128 -80 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 384 64 -64 ) ( 128 64 -64 ) ( 128 64 -80 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 256 128 -64 ) ( 256 -128 -64 ) ( 256 -128 -80 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 } // brush 27 { ( 448 256 -64 ) ( 448 0 -64 ) ( 448 0 -80 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 576 192 -64 ) ( 320 192 -64 ) ( 320 192 -80 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 512 0 -64 ) ( 512 256 -64 ) ( 512 256 -80 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 336 64 -64 ) ( 592 64 -64 ) ( 592 64 -80 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 384 0 -64 ) ( 384 256 -64 ) ( 640 256 -64 ) mtrl/turf-red 0 0 0 0.5 0.5 0 0 0 ( 640 256 -80 ) ( 384 256 -80 ) ( 384 0 -80 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 } // brush 28 { ( 640 320 -80 ) ( 384 320 -80 ) ( 384 64 -80 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 ( 384 64 -64 ) ( 384 320 -64 ) ( 640 320 -64 ) mtrl/coin-red 0 0 0 0.5 0.5 0 0 0 ( 336 192 -64 ) ( 592 192 -64 ) ( 592 192 -80 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 512 64 -64 ) ( 512 320 -64 ) ( 512 320 -80 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 640 256 -64 ) ( 384 256 -64 ) ( 384 256 -80 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 448 320 -64 ) ( 448 64 -64 ) ( 448 64 -80 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 } // brush 29 { ( 448 128 -64 ) ( 448 -128 -64 ) ( 448 -128 -80 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 576 64 -64 ) ( 320 64 -64 ) ( 320 64 -80 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 512 -128 -64 ) ( 512 128 -64 ) ( 512 128 -80 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 400 0 -64 ) ( 656 0 -64 ) ( 656 0 -80 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 384 -128 -64 ) ( 384 128 -64 ) ( 640 128 -64 ) mtrl/coin-red 0 0 0 0.5 0.5 0 0 0 ( 640 128 -80 ) ( 384 128 -80 ) ( 384 -128 -80 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 } // brush 30 { ( 704 256 -80 ) ( 448 256 -80 ) ( 448 0 -80 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 ( 448 0 -64 ) ( 448 256 -64 ) ( 704 256 -64 ) mtrl/edge-red 0 0 0 0.5 0.5 0 0 0 ( 344 64 -64 ) ( 600 64 -64 ) ( 600 64 -80 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 520 0 -64 ) ( 520 256 -64 ) ( 520 256 -80 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 ( 584 192 -64 ) ( 328 192 -64 ) ( 328 192 -80 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 512 256 -64 ) ( 512 0 -64 ) ( 512 0 -80 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 } // brush 31 { ( 512 320 -64 ) ( 512 64 -64 ) ( 512 64 -80 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 520 264 -80 ) ( 520 264 -64 ) ( 512 256 -64 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 520 264 -64 ) ( 520 264 -80 ) ( 520 192 -80 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 ( 344 192 -64 ) ( 600 192 -64 ) ( 600 192 -80 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 448 64 -64 ) ( 448 320 -64 ) ( 704 320 -64 ) mtrl/edge-red 0 0 0 0.5 0.5 0 0 0 ( 704 320 -80 ) ( 448 320 -80 ) ( 448 64 -80 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 } // brush 32 { ( 704 128 -80 ) ( 448 128 -80 ) ( 448 -128 -80 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 ( 448 -128 -64 ) ( 448 128 -64 ) ( 704 128 -64 ) mtrl/edge-red 0 0 0 0.5 0.5 0 0 0 ( 520 -8 -64 ) ( 520 -8 -80 ) ( 512 0 -80 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 520 -8 -80 ) ( 520 -8 -64 ) ( 520 64 -64 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 ( 584 64 -64 ) ( 328 64 -64 ) ( 328 64 -80 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 512 128 -64 ) ( 512 -128 -64 ) ( 512 -128 -80 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 } // brush 33 { ( 248 256 -64 ) ( 248 0 -64 ) ( 248 0 -80 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 ( 320 192 -64 ) ( 64 192 -64 ) ( 64 192 -80 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 256 0 -64 ) ( 256 256 -64 ) ( 256 256 -80 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 80 64 -64 ) ( 336 64 -64 ) ( 336 64 -80 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 184 0 -64 ) ( 184 256 -64 ) ( 440 256 -64 ) mtrl/edge-red 0 0 0 0.5 0.5 0 0 0 ( 440 256 -80 ) ( 184 256 -80 ) ( 184 0 -80 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 } // brush 34 { ( 440 320 -80 ) ( 184 320 -80 ) ( 184 64 -80 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 ( 184 64 -64 ) ( 184 320 -64 ) ( 440 320 -64 ) mtrl/edge-red 0 0 0 0.5 0.5 0 0 0 ( 80 192 -64 ) ( 336 192 -64 ) ( 336 192 -80 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 256 64 -64 ) ( 256 320 -64 ) ( 256 320 -80 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 248 264 -64 ) ( 248 264 -80 ) ( 256 256 -80 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 248 264 -80 ) ( 248 264 -64 ) ( 248 192 -64 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 } // brush 35 { ( 248 -8 -64 ) ( 248 -8 -80 ) ( 248 64 -80 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 ( 320 64 -64 ) ( 64 64 -64 ) ( 64 64 -80 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 256 -128 -64 ) ( 256 128 -64 ) ( 256 128 -80 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 248 -8 -80 ) ( 248 -8 -64 ) ( 256 0 -64 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 184 -128 -64 ) ( 184 128 -64 ) ( 440 128 -64 ) mtrl/edge-red 0 0 0 0.5 0.5 0 0 0 ( 440 128 -80 ) ( 184 128 -80 ) ( 184 -128 -80 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 } // brush 36 { ( 320 328 -64 ) ( 320 72 -64 ) ( 320 72 -80 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 512 264 -64 ) ( 256 264 -64 ) ( 256 264 -80 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 ( 448 72 -64 ) ( 448 328 -64 ) ( 448 328 -80 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 272 256 -64 ) ( 528 256 -64 ) ( 528 256 -80 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 256 128 -64 ) ( 256 384 -64 ) ( 512 384 -64 ) mtrl/edge-red 0 0 0 0.5 0.5 0 0 0 ( 512 384 -80 ) ( 256 384 -80 ) ( 256 128 -80 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 } // brush 37 { ( 448 384 -80 ) ( 192 384 -80 ) ( 192 128 -80 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 ( 192 128 -64 ) ( 192 384 -64 ) ( 448 384 -64 ) mtrl/edge-red 0 0 0 0.5 0.5 0 0 0 ( 144 256 -64 ) ( 400 256 -64 ) ( 400 256 -80 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 320 72 -64 ) ( 320 328 -64 ) ( 320 328 -80 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 248 264 -64 ) ( 248 264 -80 ) ( 320 264 -80 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 ( 248 264 -80 ) ( 248 264 -64 ) ( 256 256 -64 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 } // brush 38 { ( 448 328 -64 ) ( 448 72 -64 ) ( 448 72 -80 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 520 264 -80 ) ( 520 264 -64 ) ( 448 264 -64 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 ( 520 264 -64 ) ( 520 264 -80 ) ( 512 256 -80 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 336 256 -64 ) ( 592 256 -64 ) ( 592 256 -80 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 384 128 -64 ) ( 384 384 -64 ) ( 640 384 -64 ) mtrl/edge-red 0 0 0 0.5 0.5 0 0 0 ( 640 384 -80 ) ( 384 384 -80 ) ( 384 128 -80 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 } // brush 39 { ( 512 120 -80 ) ( 256 120 -80 ) ( 256 -136 -80 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 ( 256 -136 -64 ) ( 256 120 -64 ) ( 512 120 -64 ) mtrl/edge-red 0 0 0 0.5 0.5 0 0 0 ( 272 -8 -64 ) ( 528 -8 -64 ) ( 528 -8 -80 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 ( 448 -192 -64 ) ( 448 64 -64 ) ( 448 64 -80 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 512 0 -64 ) ( 256 0 -64 ) ( 256 0 -80 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 320 64 -64 ) ( 320 -192 -64 ) ( 320 -192 -80 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 } // brush 40 { ( 248 -8 -64 ) ( 248 -8 -80 ) ( 256 0 -80 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 448 0 -64 ) ( 192 0 -64 ) ( 192 0 -80 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 320 -192 -64 ) ( 320 64 -64 ) ( 320 64 -80 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 248 -8 -80 ) ( 248 -8 -64 ) ( 320 -8 -64 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 ( 192 -136 -64 ) ( 192 120 -64 ) ( 448 120 -64 ) mtrl/edge-red 0 0 0 0.5 0.5 0 0 0 ( 448 120 -80 ) ( 192 120 -80 ) ( 192 -136 -80 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 } // brush 41 { ( 640 120 -80 ) ( 384 120 -80 ) ( 384 -136 -80 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 ( 384 -136 -64 ) ( 384 120 -64 ) ( 640 120 -64 ) mtrl/edge-red 0 0 0 0.5 0.5 0 0 0 ( 520 -8 -64 ) ( 520 -8 -80 ) ( 448 -8 -80 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 ( 520 -8 -80 ) ( 520 -8 -64 ) ( 512 0 -64 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 640 0 -64 ) ( 384 0 -64 ) ( 384 0 -80 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 448 64 -64 ) ( 448 -192 -64 ) ( 448 -192 -80 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 } // brush 42 { ( 512 0 -208 ) ( 256 0 -208 ) ( 256 -256 -208 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 ( 256 -256 -192 ) ( 256 0 -192 ) ( 512 0 -192 ) mtrl/turf-red 0 0 0 0.5 0.5 0 0 0 ( 272 -192 -192 ) ( 528 -192 -192 ) ( 528 -192 -208 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 448 -256 -192 ) ( 448 0 -192 ) ( 448 0 -208 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 512 -64 -192 ) ( 256 -64 -192 ) ( 256 -64 -208 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 320 0 -192 ) ( 320 -256 -192 ) ( 320 -256 -208 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 } // brush 43 { ( 320 64 -192 ) ( 320 -192 -192 ) ( 320 -192 -208 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 512 0 -192 ) ( 256 0 -192 ) ( 256 0 -208 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 448 -192 -192 ) ( 448 64 -192 ) ( 448 64 -208 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 272 -64 -192 ) ( 528 -64 -192 ) ( 528 -64 -208 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 256 -192 -192 ) ( 256 64 -192 ) ( 512 64 -192 ) mtrl/turf-red 0 0 0 0.5 0.5 0 0 0 ( 512 64 -208 ) ( 256 64 -208 ) ( 256 -192 -208 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 } // brush 44 { ( 512 -128 -208 ) ( 256 -128 -208 ) ( 256 -384 -208 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 ( 256 -384 -192 ) ( 256 -128 -192 ) ( 512 -128 -192 ) mtrl/turf-red 0 0 0 0.5 0.5 0 0 0 ( 272 -256 -192 ) ( 528 -256 -192 ) ( 528 -256 -208 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 448 -384 -192 ) ( 448 -128 -192 ) ( 448 -128 -208 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 512 -192 -192 ) ( 256 -192 -192 ) ( 256 -192 -208 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 320 -128 -192 ) ( 320 -384 -192 ) ( 320 -384 -208 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 } // brush 45 { ( 256 0 -192 ) ( 256 -256 -192 ) ( 256 -256 -208 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 384 -64 -192 ) ( 128 -64 -192 ) ( 128 -64 -208 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 320 -256 -192 ) ( 320 0 -192 ) ( 320 0 -208 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 144 -192 -192 ) ( 400 -192 -192 ) ( 400 -192 -208 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 192 -256 -192 ) ( 192 0 -192 ) ( 448 0 -192 ) mtrl/turf-red 0 0 0 0.5 0.5 0 0 0 ( 448 0 -208 ) ( 192 0 -208 ) ( 192 -256 -208 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 } // brush 46 { ( 448 64 -208 ) ( 192 64 -208 ) ( 192 -192 -208 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 ( 192 -192 -192 ) ( 192 64 -192 ) ( 448 64 -192 ) mtrl/coin-red 0 0 0 0.5 0.5 0 0 0 ( 144 -64 -192 ) ( 400 -64 -192 ) ( 400 -64 -208 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 320 -192 -192 ) ( 320 64 -192 ) ( 320 64 -208 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 448 0 -192 ) ( 192 0 -192 ) ( 192 0 -208 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 256 64 -192 ) ( 256 -192 -192 ) ( 256 -192 -208 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 } // brush 47 { ( 256 -128 -192 ) ( 256 -384 -192 ) ( 256 -384 -208 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 384 -192 -192 ) ( 128 -192 -192 ) ( 128 -192 -208 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 320 -384 -192 ) ( 320 -128 -192 ) ( 320 -128 -208 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 208 -256 -192 ) ( 464 -256 -192 ) ( 464 -256 -208 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 192 -384 -192 ) ( 192 -128 -192 ) ( 448 -128 -192 ) mtrl/coin-red 0 0 0 0.5 0.5 0 0 0 ( 448 -128 -208 ) ( 192 -128 -208 ) ( 192 -384 -208 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 } // brush 48 { ( 640 0 -208 ) ( 384 0 -208 ) ( 384 -256 -208 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 ( 384 -256 -192 ) ( 384 0 -192 ) ( 640 0 -192 ) mtrl/turf-red 0 0 0 0.5 0.5 0 0 0 ( 336 -192 -192 ) ( 592 -192 -192 ) ( 592 -192 -208 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 512 -256 -192 ) ( 512 0 -192 ) ( 512 0 -208 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 576 -64 -192 ) ( 320 -64 -192 ) ( 320 -64 -208 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 448 0 -192 ) ( 448 -256 -192 ) ( 448 -256 -208 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 } // brush 49 { ( 448 64 -192 ) ( 448 -192 -192 ) ( 448 -192 -208 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 640 0 -192 ) ( 384 0 -192 ) ( 384 0 -208 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 512 -192 -192 ) ( 512 64 -192 ) ( 512 64 -208 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 336 -64 -192 ) ( 592 -64 -192 ) ( 592 -64 -208 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 384 -192 -192 ) ( 384 64 -192 ) ( 640 64 -192 ) mtrl/coin-red 0 0 0 0.5 0.5 0 0 0 ( 640 64 -208 ) ( 384 64 -208 ) ( 384 -192 -208 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 } // brush 50 { ( 640 -128 -208 ) ( 384 -128 -208 ) ( 384 -384 -208 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 ( 384 -384 -192 ) ( 384 -128 -192 ) ( 640 -128 -192 ) mtrl/coin-red 0 0 0 0.5 0.5 0 0 0 ( 400 -256 -192 ) ( 656 -256 -192 ) ( 656 -256 -208 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 512 -384 -192 ) ( 512 -128 -192 ) ( 512 -128 -208 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 576 -192 -192 ) ( 320 -192 -192 ) ( 320 -192 -208 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 448 -128 -192 ) ( 448 -384 -192 ) ( 448 -384 -208 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 } // brush 51 { ( 512 0 -192 ) ( 512 -256 -192 ) ( 512 -256 -208 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 584 -64 -192 ) ( 328 -64 -192 ) ( 328 -64 -208 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 520 -256 -192 ) ( 520 0 -192 ) ( 520 0 -208 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 ( 344 -192 -192 ) ( 600 -192 -192 ) ( 600 -192 -208 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 448 -256 -192 ) ( 448 0 -192 ) ( 704 0 -192 ) mtrl/edge-red 0 0 0 0.5 0.5 0 0 0 ( 704 0 -208 ) ( 448 0 -208 ) ( 448 -256 -208 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 } // brush 52 { ( 704 64 -208 ) ( 448 64 -208 ) ( 448 -192 -208 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 ( 448 -192 -192 ) ( 448 64 -192 ) ( 704 64 -192 ) mtrl/edge-red 0 0 0 0.5 0.5 0 0 0 ( 344 -64 -192 ) ( 600 -64 -192 ) ( 600 -64 -208 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 520 8 -192 ) ( 520 8 -208 ) ( 520 -64 -208 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 ( 520 8 -208 ) ( 520 8 -192 ) ( 512 0 -192 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 512 64 -192 ) ( 512 -192 -192 ) ( 512 -192 -208 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 } // brush 53 { ( 512 -128 -192 ) ( 512 -384 -192 ) ( 512 -384 -208 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 584 -192 -192 ) ( 328 -192 -192 ) ( 328 -192 -208 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 520 -264 -208 ) ( 520 -264 -192 ) ( 520 -192 -192 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 ( 520 -264 -192 ) ( 520 -264 -208 ) ( 512 -256 -208 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 448 -384 -192 ) ( 448 -128 -192 ) ( 704 -128 -192 ) mtrl/edge-red 0 0 0 0.5 0.5 0 0 0 ( 704 -128 -208 ) ( 448 -128 -208 ) ( 448 -384 -208 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 } // brush 54 { ( 440 0 -208 ) ( 184 0 -208 ) ( 184 -256 -208 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 ( 184 -256 -192 ) ( 184 0 -192 ) ( 440 0 -192 ) mtrl/edge-red 0 0 0 0.5 0.5 0 0 0 ( 80 -192 -192 ) ( 336 -192 -192 ) ( 336 -192 -208 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 256 -256 -192 ) ( 256 0 -192 ) ( 256 0 -208 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 320 -64 -192 ) ( 64 -64 -192 ) ( 64 -64 -208 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 248 0 -192 ) ( 248 -256 -192 ) ( 248 -256 -208 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 } // brush 55 { ( 248 8 -208 ) ( 248 8 -192 ) ( 248 -64 -192 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 ( 248 8 -192 ) ( 248 8 -208 ) ( 256 0 -208 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 256 -192 -192 ) ( 256 64 -192 ) ( 256 64 -208 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 80 -64 -192 ) ( 336 -64 -192 ) ( 336 -64 -208 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 184 -192 -192 ) ( 184 64 -192 ) ( 440 64 -192 ) mtrl/edge-red 0 0 0 0.5 0.5 0 0 0 ( 440 64 -208 ) ( 184 64 -208 ) ( 184 -192 -208 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 } // brush 56 { ( 440 -128 -208 ) ( 184 -128 -208 ) ( 184 -384 -208 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 ( 184 -384 -192 ) ( 184 -128 -192 ) ( 440 -128 -192 ) mtrl/edge-red 0 0 0 0.5 0.5 0 0 0 ( 248 -264 -208 ) ( 248 -264 -192 ) ( 256 -256 -192 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 256 -384 -192 ) ( 256 -128 -192 ) ( 256 -128 -208 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 320 -192 -192 ) ( 64 -192 -192 ) ( 64 -192 -208 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 248 -264 -192 ) ( 248 -264 -208 ) ( 248 -192 -208 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 } // brush 57 { ( 512 128 -208 ) ( 256 128 -208 ) ( 256 -128 -208 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 ( 256 -128 -192 ) ( 256 128 -192 ) ( 512 128 -192 ) mtrl/edge-red 0 0 0 0.5 0.5 0 0 0 ( 272 0 -192 ) ( 528 0 -192 ) ( 528 0 -208 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 448 -184 -192 ) ( 448 72 -192 ) ( 448 72 -208 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 512 8 -192 ) ( 256 8 -192 ) ( 256 8 -208 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 ( 320 72 -192 ) ( 320 -184 -192 ) ( 320 -184 -208 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 } // brush 58 { ( 248 8 -208 ) ( 248 8 -192 ) ( 256 0 -192 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 248 8 -192 ) ( 248 8 -208 ) ( 320 8 -208 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 ( 320 -184 -192 ) ( 320 72 -192 ) ( 320 72 -208 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 144 0 -192 ) ( 400 0 -192 ) ( 400 0 -208 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 192 -128 -192 ) ( 192 128 -192 ) ( 448 128 -192 ) mtrl/edge-red 0 0 0 0.5 0.5 0 0 0 ( 448 128 -208 ) ( 192 128 -208 ) ( 192 -128 -208 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 } // brush 59 { ( 640 128 -208 ) ( 384 128 -208 ) ( 384 -128 -208 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 ( 384 -128 -192 ) ( 384 128 -192 ) ( 640 128 -192 ) mtrl/edge-red 0 0 0 0.5 0.5 0 0 0 ( 336 0 -192 ) ( 592 0 -192 ) ( 592 0 -208 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 520 8 -192 ) ( 520 8 -208 ) ( 512 0 -208 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 520 8 -208 ) ( 520 8 -192 ) ( 448 8 -192 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 ( 448 72 -192 ) ( 448 -184 -192 ) ( 448 -184 -208 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 } // brush 60 { ( 320 -192 -192 ) ( 320 -448 -192 ) ( 320 -448 -208 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 512 -256 -192 ) ( 256 -256 -192 ) ( 256 -256 -208 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 448 -448 -192 ) ( 448 -192 -192 ) ( 448 -192 -208 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 272 -264 -192 ) ( 528 -264 -192 ) ( 528 -264 -208 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 ( 256 -392 -192 ) ( 256 -136 -192 ) ( 512 -136 -192 ) mtrl/edge-red 0 0 0 0.5 0.5 0 0 0 ( 512 -136 -208 ) ( 256 -136 -208 ) ( 256 -392 -208 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 } // brush 61 { ( 448 -136 -208 ) ( 192 -136 -208 ) ( 192 -392 -208 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 ( 192 -392 -192 ) ( 192 -136 -192 ) ( 448 -136 -192 ) mtrl/edge-red 0 0 0 0.5 0.5 0 0 0 ( 248 -264 -208 ) ( 248 -264 -192 ) ( 320 -264 -192 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 ( 320 -448 -192 ) ( 320 -192 -192 ) ( 320 -192 -208 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 448 -256 -192 ) ( 192 -256 -192 ) ( 192 -256 -208 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 248 -264 -192 ) ( 248 -264 -208 ) ( 256 -256 -208 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 } // brush 62 { ( 448 -192 -192 ) ( 448 -448 -192 ) ( 448 -448 -208 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 640 -256 -192 ) ( 384 -256 -192 ) ( 384 -256 -208 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 520 -264 -208 ) ( 520 -264 -192 ) ( 512 -256 -192 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 520 -264 -192 ) ( 520 -264 -208 ) ( 448 -264 -208 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 ( 384 -392 -192 ) ( 384 -136 -192 ) ( 640 -136 -192 ) mtrl/edge-red 0 0 0 0.5 0.5 0 0 0 ( 640 -136 -208 ) ( 384 -136 -208 ) ( 384 -392 -208 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 } // brush 63 { ( 64 0 -384 ) ( 64 -256 -384 ) ( 64 -256 -400 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 256 -64 -384 ) ( 0 -64 -384 ) ( 0 -64 -400 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 192 -256 -384 ) ( 192 0 -384 ) ( 192 0 -400 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 16 -192 -384 ) ( 272 -192 -384 ) ( 272 -192 -400 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 0 -256 -384 ) ( 0 0 -384 ) ( 256 0 -384 ) mtrl/turf-red 0 0 0 0.5 0.5 0 0 0 ( 256 0 -400 ) ( 0 0 -400 ) ( 0 -256 -400 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 } // brush 64 { ( 256 64 -400 ) ( 0 64 -400 ) ( 0 -192 -400 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 ( 0 -192 -384 ) ( 0 64 -384 ) ( 256 64 -384 ) mtrl/turf-red 0 0 0 0.5 0.5 0 0 0 ( 16 -64 -384 ) ( 272 -64 -384 ) ( 272 -64 -400 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 192 -192 -384 ) ( 192 64 -384 ) ( 192 64 -400 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 256 0 -384 ) ( 0 0 -384 ) ( 0 0 -400 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 64 64 -384 ) ( 64 -192 -384 ) ( 64 -192 -400 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 } // brush 65 { ( 64 -128 -384 ) ( 64 -384 -384 ) ( 64 -384 -400 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 256 -192 -384 ) ( 0 -192 -384 ) ( 0 -192 -400 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 192 -384 -384 ) ( 192 -128 -384 ) ( 192 -128 -400 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 16 -256 -384 ) ( 272 -256 -384 ) ( 272 -256 -400 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 0 -384 -384 ) ( 0 -128 -384 ) ( 256 -128 -384 ) mtrl/turf-red 0 0 0 0.5 0.5 0 0 0 ( 256 -128 -400 ) ( 0 -128 -400 ) ( 0 -384 -400 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 } // brush 66 { ( 192 0 -400 ) ( -64 0 -400 ) ( -64 -256 -400 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 ( -64 -256 -384 ) ( -64 0 -384 ) ( 192 0 -384 ) mtrl/turf-red 0 0 0 0.5 0.5 0 0 0 ( -112 -192 -384 ) ( 144 -192 -384 ) ( 144 -192 -400 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 64 -256 -384 ) ( 64 0 -384 ) ( 64 0 -400 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 128 -64 -384 ) ( -128 -64 -384 ) ( -128 -64 -400 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 0 0 -384 ) ( 0 -256 -384 ) ( 0 -256 -400 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 } // brush 67 { ( 0 64 -384 ) ( 0 -192 -384 ) ( 0 -192 -400 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 192 0 -384 ) ( -64 0 -384 ) ( -64 0 -400 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 64 -192 -384 ) ( 64 64 -384 ) ( 64 64 -400 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( -112 -64 -384 ) ( 144 -64 -384 ) ( 144 -64 -400 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( -64 -192 -384 ) ( -64 64 -384 ) ( 192 64 -384 ) mtrl/coin-red 0 0 0 0.5 0.5 0 0 0 ( 192 64 -400 ) ( -64 64 -400 ) ( -64 -192 -400 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 } // brush 68 { ( 192 -128 -400 ) ( -64 -128 -400 ) ( -64 -384 -400 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 ( -64 -384 -384 ) ( -64 -128 -384 ) ( 192 -128 -384 ) mtrl/coin-red 0 0 0 0.5 0.5 0 0 0 ( -48 -256 -384 ) ( 208 -256 -384 ) ( 208 -256 -400 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 64 -384 -384 ) ( 64 -128 -384 ) ( 64 -128 -400 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 128 -192 -384 ) ( -128 -192 -384 ) ( -128 -192 -400 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 0 -128 -384 ) ( 0 -384 -384 ) ( 0 -384 -400 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 } // brush 69 { ( 192 0 -384 ) ( 192 -256 -384 ) ( 192 -256 -400 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 320 -64 -384 ) ( 64 -64 -384 ) ( 64 -64 -400 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 256 -256 -384 ) ( 256 0 -384 ) ( 256 0 -400 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 80 -192 -384 ) ( 336 -192 -384 ) ( 336 -192 -400 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 128 -256 -384 ) ( 128 0 -384 ) ( 384 0 -384 ) mtrl/turf-red 0 0 0 0.5 0.5 0 0 0 ( 384 0 -400 ) ( 128 0 -400 ) ( 128 -256 -400 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 } // brush 70 { ( 384 64 -400 ) ( 128 64 -400 ) ( 128 -192 -400 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 ( 128 -192 -384 ) ( 128 64 -384 ) ( 384 64 -384 ) mtrl/coin-red 0 0 0 0.5 0.5 0 0 0 ( 80 -64 -384 ) ( 336 -64 -384 ) ( 336 -64 -400 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 256 -192 -384 ) ( 256 64 -384 ) ( 256 64 -400 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 384 0 -384 ) ( 128 0 -384 ) ( 128 0 -400 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 192 64 -384 ) ( 192 -192 -384 ) ( 192 -192 -400 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 } // brush 71 { ( 192 -128 -384 ) ( 192 -384 -384 ) ( 192 -384 -400 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 320 -192 -384 ) ( 64 -192 -384 ) ( 64 -192 -400 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 256 -384 -384 ) ( 256 -128 -384 ) ( 256 -128 -400 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 144 -256 -384 ) ( 400 -256 -384 ) ( 400 -256 -400 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 128 -384 -384 ) ( 128 -128 -384 ) ( 384 -128 -384 ) mtrl/coin-red 0 0 0 0.5 0.5 0 0 0 ( 384 -128 -400 ) ( 128 -128 -400 ) ( 128 -384 -400 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 } // brush 72 { ( 448 0 -400 ) ( 192 0 -400 ) ( 192 -256 -400 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 ( 192 -256 -384 ) ( 192 0 -384 ) ( 448 0 -384 ) mtrl/edge-red 0 0 0 0.5 0.5 0 0 0 ( 88 -192 -384 ) ( 344 -192 -384 ) ( 344 -192 -400 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 264 -256 -384 ) ( 264 0 -384 ) ( 264 0 -400 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 ( 328 -64 -384 ) ( 72 -64 -384 ) ( 72 -64 -400 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 256 0 -384 ) ( 256 -256 -384 ) ( 256 -256 -400 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 } // brush 73 { ( 256 64 -384 ) ( 256 -192 -384 ) ( 256 -192 -400 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 264 8 -400 ) ( 264 8 -384 ) ( 256 0 -384 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 264 8 -384 ) ( 264 8 -400 ) ( 264 -64 -400 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 ( 88 -64 -384 ) ( 344 -64 -384 ) ( 344 -64 -400 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 192 -192 -384 ) ( 192 64 -384 ) ( 448 64 -384 ) mtrl/edge-red 0 0 0 0.5 0.5 0 0 0 ( 448 64 -400 ) ( 192 64 -400 ) ( 192 -192 -400 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 } // brush 74 { ( 448 -128 -400 ) ( 192 -128 -400 ) ( 192 -384 -400 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 ( 192 -384 -384 ) ( 192 -128 -384 ) ( 448 -128 -384 ) mtrl/edge-red 0 0 0 0.5 0.5 0 0 0 ( 264 -264 -384 ) ( 264 -264 -400 ) ( 256 -256 -400 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 264 -264 -400 ) ( 264 -264 -384 ) ( 264 -192 -384 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 ( 328 -192 -384 ) ( 72 -192 -384 ) ( 72 -192 -400 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 256 -128 -384 ) ( 256 -384 -384 ) ( 256 -384 -400 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 } // brush 75 { ( -8 0 -384 ) ( -8 -256 -384 ) ( -8 -256 -400 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 ( 64 -64 -384 ) ( -192 -64 -384 ) ( -192 -64 -400 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 0 -256 -384 ) ( 0 0 -384 ) ( 0 0 -400 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( -176 -192 -384 ) ( 80 -192 -384 ) ( 80 -192 -400 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( -72 -256 -384 ) ( -72 0 -384 ) ( 184 0 -384 ) mtrl/edge-red 0 0 0 0.5 0.5 0 0 0 ( 184 0 -400 ) ( -72 0 -400 ) ( -72 -256 -400 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 } // brush 76 { ( 184 64 -400 ) ( -72 64 -400 ) ( -72 -192 -400 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 ( -72 -192 -384 ) ( -72 64 -384 ) ( 184 64 -384 ) mtrl/edge-red 0 0 0 0.5 0.5 0 0 0 ( -176 -64 -384 ) ( 80 -64 -384 ) ( 80 -64 -400 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 0 -192 -384 ) ( 0 64 -384 ) ( 0 64 -400 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( -8 8 -384 ) ( -8 8 -400 ) ( 0 0 -400 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( -8 8 -400 ) ( -8 8 -384 ) ( -8 -64 -384 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 } // brush 77 { ( -8 -264 -384 ) ( -8 -264 -400 ) ( -8 -192 -400 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 ( 64 -192 -384 ) ( -192 -192 -384 ) ( -192 -192 -400 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 0 -384 -384 ) ( 0 -128 -384 ) ( 0 -128 -400 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( -8 -264 -400 ) ( -8 -264 -384 ) ( 0 -256 -384 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( -72 -384 -384 ) ( -72 -128 -384 ) ( 184 -128 -384 ) mtrl/edge-red 0 0 0 0.5 0.5 0 0 0 ( 184 -128 -400 ) ( -72 -128 -400 ) ( -72 -384 -400 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 } // brush 78 { ( 64 72 -384 ) ( 64 -184 -384 ) ( 64 -184 -400 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 256 8 -384 ) ( 0 8 -384 ) ( 0 8 -400 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 ( 192 -184 -384 ) ( 192 72 -384 ) ( 192 72 -400 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 16 0 -384 ) ( 272 0 -384 ) ( 272 0 -400 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 0 -128 -384 ) ( 0 128 -384 ) ( 256 128 -384 ) mtrl/edge-red 0 0 0 0.5 0.5 0 0 0 ( 256 128 -400 ) ( 0 128 -400 ) ( 0 -128 -400 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 } // brush 79 { ( 192 128 -400 ) ( -64 128 -400 ) ( -64 -128 -400 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 ( -64 -128 -384 ) ( -64 128 -384 ) ( 192 128 -384 ) mtrl/edge-red 0 0 0 0.5 0.5 0 0 0 ( -112 0 -384 ) ( 144 0 -384 ) ( 144 0 -400 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 64 -184 -384 ) ( 64 72 -384 ) ( 64 72 -400 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( -8 8 -384 ) ( -8 8 -400 ) ( 64 8 -400 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 ( -8 8 -400 ) ( -8 8 -384 ) ( 0 0 -384 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 } // brush 80 { ( 192 72 -384 ) ( 192 -184 -384 ) ( 192 -184 -400 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 264 8 -400 ) ( 264 8 -384 ) ( 192 8 -384 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 ( 264 8 -384 ) ( 264 8 -400 ) ( 256 0 -400 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 80 0 -384 ) ( 336 0 -384 ) ( 336 0 -400 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 128 -128 -384 ) ( 128 128 -384 ) ( 384 128 -384 ) mtrl/edge-red 0 0 0 0.5 0.5 0 0 0 ( 384 128 -400 ) ( 128 128 -400 ) ( 128 -128 -400 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 } // brush 81 { ( 256 -136 -400 ) ( 0 -136 -400 ) ( 0 -392 -400 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 ( 0 -392 -384 ) ( 0 -136 -384 ) ( 256 -136 -384 ) mtrl/edge-red 0 0 0 0.5 0.5 0 0 0 ( 16 -264 -384 ) ( 272 -264 -384 ) ( 272 -264 -400 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 ( 192 -448 -384 ) ( 192 -192 -384 ) ( 192 -192 -400 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 256 -256 -384 ) ( 0 -256 -384 ) ( 0 -256 -400 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 64 -192 -384 ) ( 64 -448 -384 ) ( 64 -448 -400 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 } // brush 82 { ( -8 -264 -384 ) ( -8 -264 -400 ) ( 0 -256 -400 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 192 -256 -384 ) ( -64 -256 -384 ) ( -64 -256 -400 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 64 -448 -384 ) ( 64 -192 -384 ) ( 64 -192 -400 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( -8 -264 -400 ) ( -8 -264 -384 ) ( 64 -264 -384 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 ( -64 -392 -384 ) ( -64 -136 -384 ) ( 192 -136 -384 ) mtrl/edge-red 0 0 0 0.5 0.5 0 0 0 ( 192 -136 -400 ) ( -64 -136 -400 ) ( -64 -392 -400 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 } // brush 83 { ( 384 -136 -400 ) ( 128 -136 -400 ) ( 128 -392 -400 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 ( 128 -392 -384 ) ( 128 -136 -384 ) ( 384 -136 -384 ) mtrl/edge-red 0 0 0 0.5 0.5 0 0 0 ( 264 -264 -384 ) ( 264 -264 -400 ) ( 192 -264 -400 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 ( 264 -264 -400 ) ( 264 -264 -384 ) ( 256 -256 -384 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 384 -256 -384 ) ( 128 -256 -384 ) ( 128 -256 -400 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 192 -192 -384 ) ( 192 -448 -384 ) ( 192 -448 -400 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 } // brush 84 { ( 256 256 -656 ) ( 0 256 -656 ) ( 0 0 -656 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 ( 0 0 -640 ) ( 0 256 -640 ) ( 256 256 -640 ) mtrl/turf-red 0 0 0 0.5 0.5 0 0 0 ( 16 64 -640 ) ( 272 64 -640 ) ( 272 64 -656 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 192 0 -640 ) ( 192 256 -640 ) ( 192 256 -656 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 256 192 -640 ) ( 0 192 -640 ) ( 0 192 -656 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 64 256 -640 ) ( 64 0 -640 ) ( 64 0 -656 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 } // brush 85 { ( 64 320 -640 ) ( 64 64 -640 ) ( 64 64 -656 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 256 256 -640 ) ( 0 256 -640 ) ( 0 256 -656 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 192 64 -640 ) ( 192 320 -640 ) ( 192 320 -656 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 16 192 -640 ) ( 272 192 -640 ) ( 272 192 -656 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 0 64 -640 ) ( 0 320 -640 ) ( 256 320 -640 ) mtrl/coin-red 0 0 0 0.5 0.5 0 0 0 ( 256 320 -656 ) ( 0 320 -656 ) ( 0 64 -656 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 } // brush 86 { ( 256 128 -656 ) ( 0 128 -656 ) ( 0 -128 -656 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 ( 0 -128 -640 ) ( 0 128 -640 ) ( 256 128 -640 ) mtrl/turf-red 0 0 0 0.5 0.5 0 0 0 ( 16 0 -640 ) ( 272 0 -640 ) ( 272 0 -656 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 192 -128 -640 ) ( 192 128 -640 ) ( 192 128 -656 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 256 64 -640 ) ( 0 64 -640 ) ( 0 64 -656 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 64 128 -640 ) ( 64 -128 -640 ) ( 64 -128 -656 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 } // brush 87 { ( 0 256 -640 ) ( 0 0 -640 ) ( 0 0 -656 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 128 192 -640 ) ( -128 192 -640 ) ( -128 192 -656 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 64 0 -640 ) ( 64 256 -640 ) ( 64 256 -656 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( -112 64 -640 ) ( 144 64 -640 ) ( 144 64 -656 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( -64 0 -640 ) ( -64 256 -640 ) ( 192 256 -640 ) mtrl/coin-red 0 0 0 0.5 0.5 0 0 0 ( 192 256 -656 ) ( -64 256 -656 ) ( -64 0 -656 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 } // brush 88 { ( 192 320 -656 ) ( -64 320 -656 ) ( -64 64 -656 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 ( -64 64 -640 ) ( -64 320 -640 ) ( 192 320 -640 ) mtrl/turf-red 0 0 0 0.5 0.5 0 0 0 ( -112 192 -640 ) ( 144 192 -640 ) ( 144 192 -656 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 64 64 -640 ) ( 64 320 -640 ) ( 64 320 -656 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 192 256 -640 ) ( -64 256 -640 ) ( -64 256 -656 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 0 320 -640 ) ( 0 64 -640 ) ( 0 64 -656 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 } // brush 89 { ( 0 128 -640 ) ( 0 -128 -640 ) ( 0 -128 -656 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 128 64 -640 ) ( -128 64 -640 ) ( -128 64 -656 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 64 -128 -640 ) ( 64 128 -640 ) ( 64 128 -656 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( -48 0 -640 ) ( 208 0 -640 ) ( 208 0 -656 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( -64 -128 -640 ) ( -64 128 -640 ) ( 192 128 -640 ) mtrl/turf-red 0 0 0 0.5 0.5 0 0 0 ( 192 128 -656 ) ( -64 128 -656 ) ( -64 -128 -656 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 } // brush 90 { ( 384 256 -656 ) ( 128 256 -656 ) ( 128 0 -656 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 ( 128 0 -640 ) ( 128 256 -640 ) ( 384 256 -640 ) mtrl/coin-red 0 0 0 0.5 0.5 0 0 0 ( 80 64 -640 ) ( 336 64 -640 ) ( 336 64 -656 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 256 0 -640 ) ( 256 256 -640 ) ( 256 256 -656 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 320 192 -640 ) ( 64 192 -640 ) ( 64 192 -656 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 192 256 -640 ) ( 192 0 -640 ) ( 192 0 -656 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 } // brush 91 { ( 192 320 -640 ) ( 192 64 -640 ) ( 192 64 -656 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 384 256 -640 ) ( 128 256 -640 ) ( 128 256 -656 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 256 64 -640 ) ( 256 320 -640 ) ( 256 320 -656 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 80 192 -640 ) ( 336 192 -640 ) ( 336 192 -656 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 128 64 -640 ) ( 128 320 -640 ) ( 384 320 -640 ) mtrl/turf-red 0 0 0 0.5 0.5 0 0 0 ( 384 320 -656 ) ( 128 320 -656 ) ( 128 64 -656 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 } // brush 92 { ( 384 128 -656 ) ( 128 128 -656 ) ( 128 -128 -656 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 ( 128 -128 -640 ) ( 128 128 -640 ) ( 384 128 -640 ) mtrl/turf-red 0 0 0 0.5 0.5 0 0 0 ( 144 0 -640 ) ( 400 0 -640 ) ( 400 0 -656 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 256 -128 -640 ) ( 256 128 -640 ) ( 256 128 -656 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 320 64 -640 ) ( 64 64 -640 ) ( 64 64 -656 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 192 128 -640 ) ( 192 -128 -640 ) ( 192 -128 -656 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 } // brush 93 { ( 256 256 -640 ) ( 256 0 -640 ) ( 256 0 -656 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 328 192 -640 ) ( 72 192 -640 ) ( 72 192 -656 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 264 0 -640 ) ( 264 256 -640 ) ( 264 256 -656 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 ( 88 64 -640 ) ( 344 64 -640 ) ( 344 64 -656 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 192 0 -640 ) ( 192 256 -640 ) ( 448 256 -640 ) mtrl/edge-red 0 0 0 0.5 0.5 0 0 0 ( 448 256 -656 ) ( 192 256 -656 ) ( 192 0 -656 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 } // brush 94 { ( 448 320 -656 ) ( 192 320 -656 ) ( 192 64 -656 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 ( 192 64 -640 ) ( 192 320 -640 ) ( 448 320 -640 ) mtrl/edge-red 0 0 0 0.5 0.5 0 0 0 ( 88 192 -640 ) ( 344 192 -640 ) ( 344 192 -656 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 264 264 -640 ) ( 264 264 -656 ) ( 264 192 -656 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 ( 264 264 -656 ) ( 264 264 -640 ) ( 256 256 -640 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 256 320 -640 ) ( 256 64 -640 ) ( 256 64 -656 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 } // brush 95 { ( 256 128 -640 ) ( 256 -128 -640 ) ( 256 -128 -656 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 328 64 -640 ) ( 72 64 -640 ) ( 72 64 -656 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 264 -8 -656 ) ( 264 -8 -640 ) ( 264 64 -640 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 ( 264 -8 -640 ) ( 264 -8 -656 ) ( 256 0 -656 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 192 -128 -640 ) ( 192 128 -640 ) ( 448 128 -640 ) mtrl/edge-red 0 0 0 0.5 0.5 0 0 0 ( 448 128 -656 ) ( 192 128 -656 ) ( 192 -128 -656 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 } // brush 96 { ( 184 256 -656 ) ( -72 256 -656 ) ( -72 0 -656 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 ( -72 0 -640 ) ( -72 256 -640 ) ( 184 256 -640 ) mtrl/edge-red 0 0 0 0.5 0.5 0 0 0 ( -176 64 -640 ) ( 80 64 -640 ) ( 80 64 -656 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 0 0 -640 ) ( 0 256 -640 ) ( 0 256 -656 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 64 192 -640 ) ( -192 192 -640 ) ( -192 192 -656 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( -8 256 -640 ) ( -8 0 -640 ) ( -8 0 -656 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 } // brush 97 { ( -8 264 -656 ) ( -8 264 -640 ) ( -8 192 -640 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 ( -8 264 -640 ) ( -8 264 -656 ) ( 0 256 -656 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 0 64 -640 ) ( 0 320 -640 ) ( 0 320 -656 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( -176 192 -640 ) ( 80 192 -640 ) ( 80 192 -656 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( -72 64 -640 ) ( -72 320 -640 ) ( 184 320 -640 ) mtrl/edge-red 0 0 0 0.5 0.5 0 0 0 ( 184 320 -656 ) ( -72 320 -656 ) ( -72 64 -656 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 } // brush 98 { ( 184 128 -656 ) ( -72 128 -656 ) ( -72 -128 -656 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 ( -72 -128 -640 ) ( -72 128 -640 ) ( 184 128 -640 ) mtrl/edge-red 0 0 0 0.5 0.5 0 0 0 ( -8 -8 -656 ) ( -8 -8 -640 ) ( 0 0 -640 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 0 -128 -640 ) ( 0 128 -640 ) ( 0 128 -656 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 64 64 -640 ) ( -192 64 -640 ) ( -192 64 -656 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( -8 -8 -640 ) ( -8 -8 -656 ) ( -8 64 -656 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 } // brush 99 { ( 256 384 -656 ) ( 0 384 -656 ) ( 0 128 -656 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 ( 0 128 -640 ) ( 0 384 -640 ) ( 256 384 -640 ) mtrl/edge-red 0 0 0 0.5 0.5 0 0 0 ( 16 256 -640 ) ( 272 256 -640 ) ( 272 256 -656 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 192 72 -640 ) ( 192 328 -640 ) ( 192 328 -656 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 256 264 -640 ) ( 0 264 -640 ) ( 0 264 -656 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 ( 64 328 -640 ) ( 64 72 -640 ) ( 64 72 -656 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 } // brush 100 { ( -8 264 -656 ) ( -8 264 -640 ) ( 0 256 -640 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( -8 264 -640 ) ( -8 264 -656 ) ( 64 264 -656 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 ( 64 72 -640 ) ( 64 328 -640 ) ( 64 328 -656 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( -112 256 -640 ) ( 144 256 -640 ) ( 144 256 -656 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( -64 128 -640 ) ( -64 384 -640 ) ( 192 384 -640 ) mtrl/edge-red 0 0 0 0.5 0.5 0 0 0 ( 192 384 -656 ) ( -64 384 -656 ) ( -64 128 -656 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 } // brush 101 { ( 384 384 -656 ) ( 128 384 -656 ) ( 128 128 -656 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 ( 128 128 -640 ) ( 128 384 -640 ) ( 384 384 -640 ) mtrl/edge-red 0 0 0 0.5 0.5 0 0 0 ( 80 256 -640 ) ( 336 256 -640 ) ( 336 256 -656 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 264 264 -640 ) ( 264 264 -656 ) ( 256 256 -656 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 264 264 -656 ) ( 264 264 -640 ) ( 192 264 -640 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 ( 192 328 -640 ) ( 192 72 -640 ) ( 192 72 -656 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 } // brush 102 { ( 64 64 -640 ) ( 64 -192 -640 ) ( 64 -192 -656 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 256 0 -640 ) ( 0 0 -640 ) ( 0 0 -656 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 192 -192 -640 ) ( 192 64 -640 ) ( 192 64 -656 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 16 -8 -640 ) ( 272 -8 -640 ) ( 272 -8 -656 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 ( 0 -136 -640 ) ( 0 120 -640 ) ( 256 120 -640 ) mtrl/edge-red 0 0 0 0.5 0.5 0 0 0 ( 256 120 -656 ) ( 0 120 -656 ) ( 0 -136 -656 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 } // brush 103 { ( 192 120 -656 ) ( -64 120 -656 ) ( -64 -136 -656 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 ( -64 -136 -640 ) ( -64 120 -640 ) ( 192 120 -640 ) mtrl/edge-red 0 0 0 0.5 0.5 0 0 0 ( -8 -8 -656 ) ( -8 -8 -640 ) ( 64 -8 -640 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 ( 64 -192 -640 ) ( 64 64 -640 ) ( 64 64 -656 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 192 0 -640 ) ( -64 0 -640 ) ( -64 0 -656 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( -8 -8 -640 ) ( -8 -8 -656 ) ( 0 0 -656 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 } // brush 104 { ( 192 64 -640 ) ( 192 -192 -640 ) ( 192 -192 -656 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 384 0 -640 ) ( 128 0 -640 ) ( 128 0 -656 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 264 -8 -656 ) ( 264 -8 -640 ) ( 256 0 -640 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 264 -8 -640 ) ( 264 -8 -656 ) ( 192 -8 -656 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 ( 128 -136 -640 ) ( 128 120 -640 ) ( 384 120 -640 ) mtrl/edge-red 0 0 0 0.5 0.5 0 0 0 ( 384 120 -656 ) ( 128 120 -656 ) ( 128 -136 -656 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 } // brush 105 { ( 64 256 0 ) ( 64 0 0 ) ( 64 0 -16 ) mtrl/invisible 0 0 0 0.5 0.5 134217728 0 0 ( 256 192 0 ) ( 0 192 0 ) ( 0 192 -16 ) mtrl/invisible 0 0 0 0.5 0.5 134217728 0 0 ( 192 0 0 ) ( 192 256 0 ) ( 192 256 -16 ) mtrl/invisible 0 0 0 0.5 0.5 134217728 0 0 ( 16 64 0 ) ( 272 64 0 ) ( 272 64 -16 ) mtrl/invisible 0 0 0 0.5 0.5 134217728 0 0 ( 0 0 0 ) ( 0 256 0 ) ( 256 256 0 ) mtrl/arrow-light 128 128 -90 0.5 0.5 134217728 0 0 ( 256 256 -16 ) ( 0 256 -16 ) ( 0 0 -16 ) mtrl/invisible 0 0 0 0.5 0.5 134217728 0 0 } // brush 106 { ( 512 256 -80 ) ( 256 256 -80 ) ( 256 0 -80 ) mtrl/invisible 0 0 0 0.5 0.5 134217728 0 0 ( 256 0 -64 ) ( 256 256 -64 ) ( 512 256 -64 ) mtrl/arrow-light 128 128 -180 0.5 0.5 134217728 0 0 ( 272 64 -64 ) ( 528 64 -64 ) ( 528 64 -80 ) mtrl/invisible 0 0 0 0.5 0.5 134217728 0 0 ( 448 0 -64 ) ( 448 256 -64 ) ( 448 256 -80 ) mtrl/invisible 0 0 0 0.5 0.5 134217728 0 0 ( 512 192 -64 ) ( 256 192 -64 ) ( 256 192 -80 ) mtrl/invisible 0 0 0 0.5 0.5 134217728 0 0 ( 320 256 -64 ) ( 320 0 -64 ) ( 320 0 -80 ) mtrl/invisible 0 0 0 0.5 0.5 134217728 0 0 } // brush 107 { ( 320 0 -192 ) ( 320 -256 -192 ) ( 320 -256 -208 ) mtrl/invisible 0 0 0 0.5 0.5 134217728 0 0 ( 512 -64 -192 ) ( 256 -64 -192 ) ( 256 -64 -208 ) mtrl/invisible 0 0 0 0.5 0.5 134217728 0 0 ( 448 -256 -192 ) ( 448 0 -192 ) ( 448 0 -208 ) mtrl/invisible 0 0 0 0.5 0.5 134217728 0 0 ( 272 -192 -192 ) ( 528 -192 -192 ) ( 528 -192 -208 ) mtrl/invisible 0 0 0 0.5 0.5 134217728 0 0 ( 256 -256 -192 ) ( 256 0 -192 ) ( 512 0 -192 ) mtrl/arrow-light 128 128 90 0.5 0.5 134217728 0 0 ( 512 0 -208 ) ( 256 0 -208 ) ( 256 -256 -208 ) mtrl/invisible 0 0 0 0.5 0.5 134217728 0 0 } // brush 108 { ( 256 0 -400 ) ( 0 0 -400 ) ( 0 -256 -400 ) mtrl/invisible 0 0 0 0.5 0.5 134217728 0 0 ( 0 -256 -384 ) ( 0 0 -384 ) ( 256 0 -384 ) mtrl/arrow-light 128 128 0 0.5 0.5 134217728 0 0 ( 16 -192 -384 ) ( 272 -192 -384 ) ( 272 -192 -400 ) mtrl/invisible 0 0 0 0.5 0.5 134217728 0 0 ( 192 -256 -384 ) ( 192 0 -384 ) ( 192 0 -400 ) mtrl/invisible 0 0 0 0.5 0.5 134217728 0 0 ( 256 -64 -384 ) ( 0 -64 -384 ) ( 0 -64 -400 ) mtrl/invisible 0 0 0 0.5 0.5 134217728 0 0 ( 64 0 -384 ) ( 64 -256 -384 ) ( 64 -256 -400 ) mtrl/invisible 0 0 0 0.5 0.5 134217728 0 0 } // brush 109 { ( 64 256 -640 ) ( 64 0 -640 ) ( 64 0 -656 ) mtrl/invisible 0 0 0 0.5 0.5 134217728 0 0 ( 256 192 -640 ) ( 0 192 -640 ) ( 0 192 -656 ) mtrl/invisible 0 0 0 0.5 0.5 134217728 0 0 ( 192 0 -640 ) ( 192 256 -640 ) ( 192 256 -656 ) mtrl/invisible 0 0 0 0.5 0.5 134217728 0 0 ( 16 64 -640 ) ( 272 64 -640 ) ( 272 64 -656 ) mtrl/invisible 0 0 0 0.5 0.5 134217728 0 0 ( 0 0 -640 ) ( 0 256 -640 ) ( 256 256 -640 ) mtrl/goal 128 128 0 0.5 0.5 134217728 0 0 ( 256 256 -656 ) ( 0 256 -656 ) ( 0 0 -656 ) mtrl/invisible 0 0 0 0.5 0.5 134217728 0 0 } // brush 110 { ( 0 192 -1296 ) ( 0 192 -1280 ) ( -256 192 -1280 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( -192 256 -1296 ) ( -192 256 -1280 ) ( -192 0 -1280 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( -256 64 -1296 ) ( -256 64 -1280 ) ( 0 64 -1280 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( -64 -16 -1296 ) ( -64 -16 -1280 ) ( -64 240 -1280 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( -256 0 -1280 ) ( -256 256 -1280 ) ( 0 256 -1280 ) mtrl/turf-red 0 0 0 0.5 0.5 0 0 0 ( 0 256 -1296 ) ( -256 256 -1296 ) ( -256 0 -1296 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 } // brush 111 { ( -64 256 -1296 ) ( -320 256 -1296 ) ( -320 0 -1296 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 ( -320 0 -1280 ) ( -320 256 -1280 ) ( -64 256 -1280 ) mtrl/coin-red 0 0 0 0.5 0.5 0 0 0 ( -192 -16 -1296 ) ( -192 -16 -1280 ) ( -192 240 -1280 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( -320 64 -1296 ) ( -320 64 -1280 ) ( -64 64 -1280 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( -256 256 -1296 ) ( -256 256 -1280 ) ( -256 0 -1280 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( -64 192 -1296 ) ( -64 192 -1280 ) ( -320 192 -1280 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 } // brush 112 { ( 128 192 -1296 ) ( 128 192 -1280 ) ( -128 192 -1280 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( -64 256 -1296 ) ( -64 256 -1280 ) ( -64 0 -1280 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( -128 64 -1296 ) ( -128 64 -1280 ) ( 128 64 -1280 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 0 -16 -1296 ) ( 0 -16 -1280 ) ( 0 240 -1280 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( -128 0 -1280 ) ( -128 256 -1280 ) ( 128 256 -1280 ) mtrl/turf-red 0 0 0 0.5 0.5 0 0 0 ( 128 256 -1296 ) ( -128 256 -1296 ) ( -128 0 -1296 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 } // brush 113 { ( 0 320 -1296 ) ( -256 320 -1296 ) ( -256 64 -1296 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 ( -256 64 -1280 ) ( -256 320 -1280 ) ( 0 320 -1280 ) mtrl/coin-red 0 0 0 0.5 0.5 0 0 0 ( -64 112 -1296 ) ( -64 112 -1280 ) ( -64 368 -1280 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( -256 192 -1296 ) ( -256 192 -1280 ) ( 0 192 -1280 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( -192 384 -1296 ) ( -192 384 -1280 ) ( -192 128 -1280 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 0 256 -1296 ) ( 0 256 -1280 ) ( -256 256 -1280 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 } // brush 114 { ( -64 256 -1296 ) ( -64 256 -1280 ) ( -320 256 -1280 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( -256 320 -1296 ) ( -256 320 -1280 ) ( -256 64 -1280 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( -320 192 -1296 ) ( -320 192 -1280 ) ( -64 192 -1280 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( -192 112 -1296 ) ( -192 112 -1280 ) ( -192 368 -1280 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( -320 64 -1280 ) ( -320 320 -1280 ) ( -64 320 -1280 ) mtrl/turf-red 0 0 0 0.5 0.5 0 0 0 ( -64 320 -1296 ) ( -320 320 -1296 ) ( -320 64 -1296 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 } // brush 115 { ( 128 320 -1296 ) ( -128 320 -1296 ) ( -128 64 -1296 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 ( -128 64 -1280 ) ( -128 320 -1280 ) ( 128 320 -1280 ) mtrl/turf-red 0 0 0 0.5 0.5 0 0 0 ( 0 48 -1296 ) ( 0 48 -1280 ) ( 0 304 -1280 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( -128 192 -1296 ) ( -128 192 -1280 ) ( 128 192 -1280 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( -64 384 -1296 ) ( -64 384 -1280 ) ( -64 128 -1280 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 128 256 -1296 ) ( 128 256 -1280 ) ( -128 256 -1280 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 } // brush 116 { ( 0 64 -1296 ) ( 0 64 -1280 ) ( -256 64 -1280 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( -192 192 -1296 ) ( -192 192 -1280 ) ( -192 -64 -1280 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( -256 0 -1296 ) ( -256 0 -1280 ) ( 0 0 -1280 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( -64 -80 -1296 ) ( -64 -80 -1280 ) ( -64 176 -1280 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( -256 -128 -1280 ) ( -256 128 -1280 ) ( 0 128 -1280 ) mtrl/coin-red 0 0 0 0.5 0.5 0 0 0 ( 0 128 -1296 ) ( -256 128 -1296 ) ( -256 -128 -1296 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 } // brush 117 { ( -64 128 -1296 ) ( -320 128 -1296 ) ( -320 -128 -1296 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 ( -320 -128 -1280 ) ( -320 128 -1280 ) ( -64 128 -1280 ) mtrl/turf-red 0 0 0 0.5 0.5 0 0 0 ( -192 -80 -1296 ) ( -192 -80 -1280 ) ( -192 176 -1280 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( -320 0 -1296 ) ( -320 0 -1280 ) ( -64 0 -1280 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( -256 128 -1296 ) ( -256 128 -1280 ) ( -256 -128 -1280 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( -64 64 -1296 ) ( -64 64 -1280 ) ( -320 64 -1280 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 } // brush 118 { ( 128 64 -1296 ) ( 128 64 -1280 ) ( -128 64 -1280 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( -64 192 -1296 ) ( -64 192 -1280 ) ( -64 -64 -1280 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( -128 0 -1296 ) ( -128 0 -1280 ) ( 128 0 -1280 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 0 -144 -1296 ) ( 0 -144 -1280 ) ( 0 112 -1280 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( -128 -128 -1280 ) ( -128 128 -1280 ) ( 128 128 -1280 ) mtrl/turf-red 0 0 0 0.5 0.5 0 0 0 ( 128 128 -1296 ) ( -128 128 -1296 ) ( -128 -128 -1296 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 } // brush 119 { ( 0 64 -1296 ) ( -256 64 -1296 ) ( -256 -192 -1296 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 ( -256 -192 -1280 ) ( -256 64 -1280 ) ( 0 64 -1280 ) mtrl/edge-red 0 0 0 0.5 0.5 0 0 0 ( -64 -88 -1296 ) ( -64 -88 -1280 ) ( -64 168 -1280 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( -256 -8 -1296 ) ( -256 -8 -1280 ) ( 0 -8 -1280 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 ( -192 184 -1296 ) ( -192 184 -1280 ) ( -192 -72 -1280 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 0 0 -1296 ) ( 0 0 -1280 ) ( -256 0 -1280 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 } // brush 120 { ( -64 0 -1296 ) ( -64 0 -1280 ) ( -320 0 -1280 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( -256 0 -1280 ) ( -264 -8 -1280 ) ( -264 -8 -1296 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( -192 -8 -1296 ) ( -264 -8 -1296 ) ( -264 -8 -1280 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 ( -192 -88 -1296 ) ( -192 -88 -1280 ) ( -192 168 -1280 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( -320 -192 -1280 ) ( -320 64 -1280 ) ( -64 64 -1280 ) mtrl/edge-red 0 0 0 0.5 0.5 0 0 0 ( -64 64 -1296 ) ( -320 64 -1296 ) ( -320 -192 -1296 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 } // brush 121 { ( 128 64 -1296 ) ( -128 64 -1296 ) ( -128 -192 -1296 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 ( -128 -192 -1280 ) ( -128 64 -1280 ) ( 128 64 -1280 ) mtrl/edge-red 0 0 0 0.5 0.5 0 0 0 ( 0 0 -1296 ) ( 8 -8 -1296 ) ( 8 -8 -1280 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( -64 -8 -1280 ) ( 8 -8 -1280 ) ( 8 -8 -1296 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 ( -64 184 -1296 ) ( -64 184 -1280 ) ( -64 -72 -1280 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 128 0 -1296 ) ( 128 0 -1280 ) ( -128 0 -1280 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 } // brush 122 { ( 0 264 -1296 ) ( 0 264 -1280 ) ( -256 264 -1280 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 ( -192 448 -1296 ) ( -192 448 -1280 ) ( -192 192 -1280 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( -256 256 -1296 ) ( -256 256 -1280 ) ( 0 256 -1280 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( -64 176 -1296 ) ( -64 176 -1280 ) ( -64 432 -1280 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( -256 72 -1280 ) ( -256 328 -1280 ) ( 0 328 -1280 ) mtrl/edge-red 0 0 0 0.5 0.5 0 0 0 ( 0 328 -1296 ) ( -256 328 -1296 ) ( -256 72 -1296 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 } // brush 123 { ( -64 328 -1296 ) ( -320 328 -1296 ) ( -320 72 -1296 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 ( -320 72 -1280 ) ( -320 328 -1280 ) ( -64 328 -1280 ) mtrl/edge-red 0 0 0 0.5 0.5 0 0 0 ( -192 176 -1296 ) ( -192 176 -1280 ) ( -192 432 -1280 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( -320 256 -1296 ) ( -320 256 -1280 ) ( -64 256 -1280 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( -256 256 -1296 ) ( -264 264 -1296 ) ( -264 264 -1280 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( -192 264 -1280 ) ( -264 264 -1280 ) ( -264 264 -1296 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 } // brush 124 { ( -64 264 -1296 ) ( 8 264 -1296 ) ( 8 264 -1280 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 ( -64 448 -1296 ) ( -64 448 -1280 ) ( -64 192 -1280 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( -128 256 -1296 ) ( -128 256 -1280 ) ( 128 256 -1280 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 0 256 -1280 ) ( 8 264 -1280 ) ( 8 264 -1296 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( -128 72 -1280 ) ( -128 328 -1280 ) ( 128 328 -1280 ) mtrl/edge-red 0 0 0 0.5 0.5 0 0 0 ( 128 328 -1296 ) ( -128 328 -1296 ) ( -128 72 -1296 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 } // brush 125 { ( -72 192 -1296 ) ( -72 192 -1280 ) ( -328 192 -1280 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( -264 256 -1296 ) ( -264 256 -1280 ) ( -264 0 -1280 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 ( -328 64 -1296 ) ( -328 64 -1280 ) ( -72 64 -1280 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( -256 -16 -1296 ) ( -256 -16 -1280 ) ( -256 240 -1280 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( -384 0 -1280 ) ( -384 256 -1280 ) ( -128 256 -1280 ) mtrl/edge-red 0 0 0 0.5 0.5 0 0 0 ( -128 256 -1296 ) ( -384 256 -1296 ) ( -384 0 -1296 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 } // brush 126 { ( -128 320 -1296 ) ( -384 320 -1296 ) ( -384 64 -1296 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 ( -384 64 -1280 ) ( -384 320 -1280 ) ( -128 320 -1280 ) mtrl/edge-red 0 0 0 0.5 0.5 0 0 0 ( -256 112 -1296 ) ( -256 112 -1280 ) ( -256 368 -1280 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( -328 192 -1296 ) ( -328 192 -1280 ) ( -72 192 -1280 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( -264 192 -1296 ) ( -264 264 -1296 ) ( -264 264 -1280 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 ( -256 256 -1280 ) ( -264 264 -1280 ) ( -264 264 -1296 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 } // brush 127 { ( -72 64 -1296 ) ( -72 64 -1280 ) ( -328 64 -1280 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( -264 64 -1280 ) ( -264 -8 -1280 ) ( -264 -8 -1296 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 ( -256 0 -1296 ) ( -264 -8 -1296 ) ( -264 -8 -1280 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( -256 -80 -1296 ) ( -256 -80 -1280 ) ( -256 176 -1280 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( -384 -128 -1280 ) ( -384 128 -1280 ) ( -128 128 -1280 ) mtrl/edge-red 0 0 0 0.5 0.5 0 0 0 ( -128 128 -1296 ) ( -384 128 -1296 ) ( -384 -128 -1296 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 } // brush 128 { ( 136 256 -1296 ) ( -120 256 -1296 ) ( -120 0 -1296 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 ( -120 0 -1280 ) ( -120 256 -1280 ) ( 136 256 -1280 ) mtrl/edge-red 0 0 0 0.5 0.5 0 0 0 ( 8 -16 -1296 ) ( 8 -16 -1280 ) ( 8 240 -1280 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 ( -64 64 -1296 ) ( -64 64 -1280 ) ( 192 64 -1280 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 0 256 -1296 ) ( 0 256 -1280 ) ( 0 0 -1280 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 192 192 -1296 ) ( 192 192 -1280 ) ( -64 192 -1280 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 } // brush 129 { ( 0 256 -1296 ) ( 8 264 -1296 ) ( 8 264 -1280 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 0 320 -1296 ) ( 0 320 -1280 ) ( 0 64 -1280 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( -64 192 -1296 ) ( -64 192 -1280 ) ( 192 192 -1280 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 8 192 -1280 ) ( 8 264 -1280 ) ( 8 264 -1296 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 ( -120 64 -1280 ) ( -120 320 -1280 ) ( 136 320 -1280 ) mtrl/edge-red 0 0 0 0.5 0.5 0 0 0 ( 136 320 -1296 ) ( -120 320 -1296 ) ( -120 64 -1296 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 } // brush 130 { ( 136 128 -1296 ) ( -120 128 -1296 ) ( -120 -128 -1296 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 ( -120 -128 -1280 ) ( -120 128 -1280 ) ( 136 128 -1280 ) mtrl/edge-red 0 0 0 0.5 0.5 0 0 0 ( 8 64 -1296 ) ( 8 -8 -1296 ) ( 8 -8 -1280 ) mtrl/turf-grey 0 0 0 0.5 0.5 0 0 0 ( 0 0 -1280 ) ( 8 -8 -1280 ) ( 8 -8 -1296 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 0 128 -1296 ) ( 0 128 -1280 ) ( 0 -128 -1280 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 ( 192 64 -1296 ) ( 192 64 -1280 ) ( -64 64 -1280 ) mtrl/invisible 0 0 0 0.5 0.5 0 0 0 } // brush 131 { ( 0 256 -1296 ) ( -256 256 -1296 ) ( -256 0 -1296 ) mtrl/invisible 0 0 0 0.5 0.5 134217728 0 0 ( -256 0 -1280 ) ( -256 256 -1280 ) ( 0 256 -1280 ) mtrl/goal 128 128 0 0.5 0.5 134217728 0 0 ( -64 -16 -1296 ) ( -64 -16 -1280 ) ( -64 240 -1280 ) mtrl/invisible 0 0 0 0.5 0.5 134217728 0 0 ( -256 64 -1296 ) ( -256 64 -1280 ) ( 0 64 -1280 ) mtrl/invisible 0 0 0 0.5 0.5 134217728 0 0 ( -192 256 -1296 ) ( -192 256 -1280 ) ( -192 0 -1280 ) mtrl/invisible 0 0 0 0.5 0.5 134217728 0 0 ( 0 192 -1296 ) ( 0 192 -1280 ) ( -256 192 -1280 ) mtrl/invisible 0 0 0 0.5 0.5 134217728 0 0 } } // entity 1 { "classname" "info_player_start" "origin" "128 128 24" } // entity 2 { "classname" "info_player_deathmatch" "origin" "128 128 -616" } // entity 3 { "classname" "light" "light" "1" "origin" "224 224 16" } // entity 4 { "classname" "light" "origin" "224 32 16" "light" "1" } // entity 5 { "classname" "light" "light" "1" "origin" "32 32 16" } // entity 6 { "classname" "light" "origin" "32 224 16" "light" "1" } // entity 7 { "classname" "light" "origin" "480 224 -48" "light" "1" } // entity 8 { "classname" "light" "light" "1" "origin" "480 32 -48" } // entity 9 { "classname" "light" "origin" "288 32 -48" "light" "1" } // entity 10 { "classname" "light" "light" "1" "origin" "288 224 -48" } // entity 11 { "classname" "light" "light" "1" "origin" "480 -32 -176" } // entity 12 { "classname" "light" "origin" "480 -224 -176" "light" "1" } // entity 13 { "classname" "light" "light" "1" "origin" "288 -224 -176" } // entity 14 { "classname" "light" "origin" "288 -32 -176" "light" "1" } // entity 15 { "classname" "light" "origin" "224 -32 -368" "light" "1" } // entity 16 { "classname" "light" "light" "1" "origin" "224 -224 -368" } // entity 17 { "classname" "light" "origin" "32 -224 -368" "light" "1" } // entity 18 { "classname" "light" "light" "1" "origin" "32 -32 -368" } // entity 19 { "classname" "light" "light" "1" "origin" "224 160 -624" } // entity 20 { "classname" "light" "light" "1" "origin" "32 96 -624" } // entity 21 { "classname" "light" "origin" "160 224 -624" "light" "5" } // entity 22 { "classname" "light" "light" "5" "origin" "96 224 -624" } // entity 23 { "classname" "light" "origin" "224 96 -624" "light" "1" } // entity 24 { "classname" "light" "origin" "32 160 -624" "light" "1" } // entity 25 { "classname" "light" "light" "10" "origin" "128 32 -480" } // entity 26 { "classname" "light" "origin" "128 32 -544" "light" "10" } // entity 27 { "classname" "light" "origin" "128 32 -416" "light" "10" } // entity 28 { "classname" "light" "origin" "224 -128 -272" "light" "10" } // entity 29 { "classname" "light" "light" "10" "origin" "224 -128 -336" } // entity 30 { "classname" "light" "light" "10" "origin" "224 -128 -208" } // entity 31 { "classname" "light" "light" "10" "origin" "128 32 -608" } // entity 32 { "classname" "light" "light" "10" "origin" "384 -32 -160" } // entity 33 { "classname" "light" "origin" "384 -32 -96" "light" "10" } // entity 34 { "classname" "light" "light" "10" "origin" "288 128 -32" } // entity 35 { "classname" "info_player_deathmatch" "origin" "-128 128 -1256" } // entity 36 { "classname" "light" "origin" "-160 32 -1264" "light" "1" } // entity 37 { "classname" "light" "origin" "-96 224 -1264" "light" "1" } // entity 38 { "classname" "light" "light" "5" "origin" "-224 96 -1264" } // entity 39 { "classname" "light" "origin" "-224 160 -1264" "light" "5" } // entity 40 { "classname" "light" "light" "1" "origin" "-96 32 -1264" } // entity 41 { "classname" "light" "light" "1" "origin" "-160 224 -1264" } // entity 42 { "classname" "light" "origin" "-32 128 -1120" "light" "10" } // entity 43 { "classname" "light" "light" "10" "origin" "-32 128 -1184" } // entity 44 { "classname" "light" "light" "10" "origin" "-32 128 -1056" } // entity 45 { "classname" "info_player_intermission" "target" "t1" "origin" "-544 -416 192" } // entity 46 { "classname" "target_position" "targetname" "t1" "origin" "80 -16 -256" } // entity 47 { "classname" "light" "origin" "-32 128 -1248" "light" "10" } // entity 48 { "classname" "light" "origin" "-32 128 -992" "light" "10" }
{ "pile_set_name": "Github" }
<% title "Products" %> <% for product in @products %> <div class="product"> <h3> <%= link_to h(product.name), product %> <%= number_to_currency(product.price) %> </h3> <div class="actions"> <%= link_to "Edit", edit_product_path(product) %> | <%= link_to "Destroy", product, :confirm => 'Are you sure?', :method => :delete %> </div> </div> <% end %> <p><%= link_to "New Product", new_product_path %></p>
{ "pile_set_name": "Github" }
// 代码地址: https://github.com/CoderMJLee/MJRefresh // 代码地址: http://code4app.com/ios/%E5%BF%AB%E9%80%9F%E9%9B%86%E6%88%90%E4%B8%8B%E6%8B%89%E4%B8%8A%E6%8B%89%E5%88%B7%E6%96%B0/52326ce26803fabc46000000 // MJRefreshComponent.m // MJRefreshExample // // Created by MJ Lee on 15/3/4. // Copyright (c) 2015年 小码哥. All rights reserved. // #import "MJRefreshComponent.h" #import "MJRefreshConst.h" @interface MJRefreshComponent() @property (strong, nonatomic) UIPanGestureRecognizer *pan; @end @implementation MJRefreshComponent #pragma mark - 初始化 - (instancetype)initWithFrame:(CGRect)frame { if (self = [super initWithFrame:frame]) { // 准备工作 [self prepare]; // 默认是普通状态 self.state = MJRefreshStateIdle; } return self; } - (void)prepare { // 基本属性 self.autoresizingMask = UIViewAutoresizingFlexibleWidth; self.backgroundColor = [UIColor clearColor]; } - (void)layoutSubviews { [self placeSubviews]; [super layoutSubviews]; } - (void)placeSubviews{} - (void)willMoveToSuperview:(UIView *)newSuperview { [super willMoveToSuperview:newSuperview]; // 如果不是UIScrollView,不做任何事情 if (newSuperview && ![newSuperview isKindOfClass:[UIScrollView class]]) return; // 旧的父控件移除监听 [self removeObservers]; if (newSuperview) { // 新的父控件 // 设置宽度 self.mj_w = newSuperview.mj_w; // 设置位置 self.mj_x = 0; // 记录UIScrollView _scrollView = (UIScrollView *)newSuperview; // 设置永远支持垂直弹簧效果 _scrollView.alwaysBounceVertical = YES; // 记录UIScrollView最开始的contentInset _scrollViewOriginalInset = _scrollView.contentInset; // 添加监听 [self addObservers]; } } - (void)drawRect:(CGRect)rect { [super drawRect:rect]; if (self.state == MJRefreshStateWillRefresh) { // 预防view还没显示出来就调用了beginRefreshing self.state = MJRefreshStateRefreshing; } } #pragma mark - KVO监听 - (void)addObservers { NSKeyValueObservingOptions options = NSKeyValueObservingOptionNew | NSKeyValueObservingOptionOld; [self.scrollView addObserver:self forKeyPath:MJRefreshKeyPathContentOffset options:options context:nil]; [self.scrollView addObserver:self forKeyPath:MJRefreshKeyPathContentSize options:options context:nil]; self.pan = self.scrollView.panGestureRecognizer; [self.pan addObserver:self forKeyPath:MJRefreshKeyPathPanState options:options context:nil]; } - (void)removeObservers { [self.superview removeObserver:self forKeyPath:MJRefreshKeyPathContentOffset]; [self.superview removeObserver:self forKeyPath:MJRefreshKeyPathContentSize];; [self.pan removeObserver:self forKeyPath:MJRefreshKeyPathPanState]; self.pan = nil; } - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context { // 遇到这些情况就直接返回 if (!self.userInteractionEnabled) return; // 这个就算看不见也需要处理 if ([keyPath isEqualToString:MJRefreshKeyPathContentSize]) { [self scrollViewContentSizeDidChange:change]; } // 看不见 if (self.hidden) return; if ([keyPath isEqualToString:MJRefreshKeyPathContentOffset]) { [self scrollViewContentOffsetDidChange:change]; } else if ([keyPath isEqualToString:MJRefreshKeyPathPanState]) { [self scrollViewPanStateDidChange:change]; } } - (void)scrollViewContentOffsetDidChange:(NSDictionary *)change{} - (void)scrollViewContentSizeDidChange:(NSDictionary *)change{} - (void)scrollViewPanStateDidChange:(NSDictionary *)change{} #pragma mark - 公共方法 #pragma mark 设置回调对象和回调方法 - (void)setRefreshingTarget:(id)target refreshingAction:(SEL)action { self.refreshingTarget = target; self.refreshingAction = action; } - (void)setState:(MJRefreshState)state { _state = state; // 加入主队列的目的是等setState:方法调用完毕、设置完文字后再去布局子控件 dispatch_async(dispatch_get_main_queue(), ^{ [self setNeedsLayout]; }); } #pragma mark 进入刷新状态 - (void)beginRefreshing { [UIView animateWithDuration:MJRefreshFastAnimationDuration animations:^{ self.alpha = 1.0; }]; self.pullingPercent = 1.0; // 只要正在刷新,就完全显示 if (self.window) { self.state = MJRefreshStateRefreshing; } else { // 预防正在刷新中时,调用本方法使得header inset回置失败 if (self.state != MJRefreshStateRefreshing) { self.state = MJRefreshStateWillRefresh; // 刷新(预防从另一个控制器回到这个控制器的情况,回来要重新刷新一下) [self setNeedsDisplay]; } } } - (void)beginRefreshingWithCompletionBlock:(void (^)())completionBlock { self.beginRefreshingCompletionBlock = completionBlock; [self beginRefreshing]; } #pragma mark 结束刷新状态 - (void)endRefreshing { self.state = MJRefreshStateIdle; } - (void)endRefreshingWithCompletionBlock:(void (^)())completionBlock { self.endRefreshingCompletionBlock = completionBlock; [self endRefreshing]; } #pragma mark 是否正在刷新 - (BOOL)isRefreshing { return self.state == MJRefreshStateRefreshing || self.state == MJRefreshStateWillRefresh; } #pragma mark 自动切换透明度 - (void)setAutoChangeAlpha:(BOOL)autoChangeAlpha { self.automaticallyChangeAlpha = autoChangeAlpha; } - (BOOL)isAutoChangeAlpha { return self.isAutomaticallyChangeAlpha; } - (void)setAutomaticallyChangeAlpha:(BOOL)automaticallyChangeAlpha { _automaticallyChangeAlpha = automaticallyChangeAlpha; if (self.isRefreshing) return; if (automaticallyChangeAlpha) { self.alpha = self.pullingPercent; } else { self.alpha = 1.0; } } #pragma mark 根据拖拽进度设置透明度 - (void)setPullingPercent:(CGFloat)pullingPercent { _pullingPercent = pullingPercent; if (self.isRefreshing) return; if (self.isAutomaticallyChangeAlpha) { self.alpha = pullingPercent; } } #pragma mark - 内部方法 - (void)executeRefreshingCallback { dispatch_async(dispatch_get_main_queue(), ^{ if (self.refreshingBlock) { self.refreshingBlock(); } if ([self.refreshingTarget respondsToSelector:self.refreshingAction]) { MJRefreshMsgSend(MJRefreshMsgTarget(self.refreshingTarget), self.refreshingAction, self); } if (self.beginRefreshingCompletionBlock) { self.beginRefreshingCompletionBlock(); } }); } @end @implementation UILabel(MJRefresh) + (instancetype)mj_label { UILabel *label = [[self alloc] init]; label.font = MJRefreshLabelFont; label.textColor = MJRefreshLabelTextColor; label.autoresizingMask = UIViewAutoresizingFlexibleWidth; label.textAlignment = NSTextAlignmentCenter; label.backgroundColor = [UIColor clearColor]; return label; } - (CGFloat)mj_textWith { CGFloat stringWidth = 0; CGSize size = CGSizeMake(MAXFLOAT, MAXFLOAT); if (self.text.length > 0) { #if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 70000 stringWidth =[self.text boundingRectWithSize:size options:NSStringDrawingUsesLineFragmentOrigin attributes:@{NSFontAttributeName:self.font} context:nil].size.width; #else stringWidth = [self.text sizeWithFont:self.font constrainedToSize:size lineBreakMode:NSLineBreakByCharWrapping].width; #endif } return stringWidth; } @end
{ "pile_set_name": "Github" }
#pragma once #include "arithmetics.hpp" namespace msdfgen { typedef unsigned char byte; inline byte pixelFloatToByte(float x) { return byte(clamp(256.f*x, 255.f)); } inline float pixelByteToFloat(byte x) { return 1.f/255.f*float(x); } }
{ "pile_set_name": "Github" }
/* * This file is part of SpongeAPI, licensed under the MIT License (MIT). * * Copyright (c) SpongePowered <https://www.spongepowered.org> * Copyright (c) contributors * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ package org.spongepowered.api.util.weighted; import com.google.common.base.MoreObjects; import org.spongepowered.api.data.DataContainer; import org.spongepowered.api.data.DataSerializable; import org.spongepowered.api.data.Queries; /** * An entry which contains an object with the added restriction that the object * be serializable. * * @param <T> The entry type */ public class WeightedSerializableObject<T extends DataSerializable> extends WeightedObject<T> implements DataSerializable { /** * Creates a new {@link WeightedSerializableObject} with the provided * {@link DataSerializable}. * * @param object The serializable object * @param weight The weight */ public WeightedSerializableObject(T object, int weight) { super(object, weight); } @Override public String toString() { return MoreObjects.toStringHelper(this) .add("object", get()) .add("weight", getWeight()) .toString(); } @SuppressWarnings("rawtypes") @Override public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof WeightedSerializableObject)) { return false; } WeightedSerializableObject object = (WeightedSerializableObject) o; return get().equals(object.get()) && getWeight() == object.getWeight(); } @Override public int getContentVersion() { return 1; } @Override public DataContainer toContainer() { return DataContainer.createNew() .set(Queries.CONTENT_VERSION, getContentVersion()) .set(Queries.WEIGHTED_SERIALIZABLE, get()) .set(Queries.WEIGHTED_SERIALIZABLE_WEIGHT, getWeight()); } }
{ "pile_set_name": "Github" }
% Codes for CVPR-15 work `Face Alignment by Coarse-to-Fine Shape Searching' % Any question please contact Shizhan Zhu: [email protected] % Released on July 25, 2015 function T = getTransToMean(pose) % T = getTransToMean(pose) % produce trans to project poese onto mean pose % size(pose) = [m,2n], each row must in the format of X1...Xn,Y1...Yn. % T is a array containing n structures. Each one is the trans for one % sample. n = size(pose,2); if mod(n,2),error('size(pose,2) is odd!');end n = n / 2; m = size(pose,1); meanPose = reshape(mean(pose,1),n,2); if (m<100) || (matlabpool('size')==0) T = arrayfun(@(i)cp2tform(reshape(pose(i,:),n,2),meanPose,'nonreflective similarity'),1:m); if m>=100 warning('Please launch matlabpool to speed up your program!'); end else T = cell(m,1); parfor i = 1:m T{i} = cp2tform(reshape(pose(i,:),n,2),meanPose,'nonreflective similarity'); end T = cell2mat(T); end end
{ "pile_set_name": "Github" }
shared_examples 'a request error' do context 'API' do let(:response_body) { "{\"error\": {\"text\": \"error message\", \"id\": \"INTERNAL_ERROR\"}}" } let(:bad_response) { double('response', status: 400, body: response_body) } it 'should raise an error' do client.stub_chain(:connection, :get).and_return(bad_response) expect { request }.to raise_error(Yelp::Error::InternalError) end end end
{ "pile_set_name": "Github" }
{ "Result": [ { "id": 360869911, "number": 87007, "state": "closed", "locked": false, "title": "Cleanup manual conversions", "body": "This PR cleans up a bunch of manual conversions that are not needed (due to existence of auto-generated ones).\r\n\r\nThis is preparation towards: https://github.com/kubernetes/kubernetes/issues/87006\r\n\r\n```release-note\r\nNONE\r\n```", "created_at": "2020-01-09T09:58:05Z", "updated_at": "2020-02-06T10:27:36Z", "closed_at": "2020-02-06T10:27:34Z", "merged_at": "2020-02-06T10:27:34Z", "labels": [ { "id": 414883982, "url": "https://api.github.com/repos/kubernetes/kubernetes/labels/approved", "name": "approved", "color": "0ffa16", "description": "Indicates a PR has been approved by an approver from all required OWNERS files.", "default": false, "node_id": "MDU6TGFiZWw0MTQ4ODM5ODI=" }, { "id": 477397086, "url": "https://api.github.com/repos/kubernetes/kubernetes/labels/cncf-cla:%20yes", "name": "cncf-cla: yes", "color": "bfe5bf", "description": "Indicates the PR's author has signed the CNCF CLA.", "default": false, "node_id": "MDU6TGFiZWw0NzczOTcwODY=" }, { "id": 122775691, "url": "https://api.github.com/repos/kubernetes/kubernetes/labels/kind/cleanup", "name": "kind/cleanup", "color": "c7def8", "description": "Categorizes issue or PR as related to cleaning up code, process, or technical debt.", "default": false, "node_id": "MDU6TGFiZWwxMjI3NzU2OTE=" }, { "id": 148225179, "url": "https://api.github.com/repos/kubernetes/kubernetes/labels/lgtm", "name": "lgtm", "color": "15dd18", "description": "Indicates that a PR is ready to be merged.", "default": false, "node_id": "MDU6TGFiZWwxNDgyMjUxNzk=" }, { "id": 496752236, "url": "https://api.github.com/repos/kubernetes/kubernetes/labels/priority/important-longterm", "name": "priority/important-longterm", "color": "eb6420", "description": "Important over the long term, but may not be staffed and/or may need multiple releases to complete.", "default": false, "node_id": "MDU6TGFiZWw0OTY3NTIyMzY=" }, { "id": 349530249, "url": "https://api.github.com/repos/kubernetes/kubernetes/labels/release-note-none", "name": "release-note-none", "color": "c2e0c6", "description": "Denotes a PR that doesn't merit a release note.", "default": false, "node_id": "MDU6TGFiZWwzNDk1MzAyNDk=" }, { "id": 404091735, "url": "https://api.github.com/repos/kubernetes/kubernetes/labels/sig/apps", "name": "sig/apps", "color": "d2b48c", "description": "Categorizes an issue or PR as relevant to sig-apps.", "default": false, "node_id": "MDU6TGFiZWw0MDQwOTE3MzU=" }, { "id": 116712108, "url": "https://api.github.com/repos/kubernetes/kubernetes/labels/sig/network", "name": "sig/network", "color": "d2b48c", "description": "Categorizes an issue or PR as relevant to sig-network.", "default": false, "node_id": "MDU6TGFiZWwxMTY3MTIxMDg=" }, { "id": 253451057, "url": "https://api.github.com/repos/kubernetes/kubernetes/labels/size/XL", "name": "size/XL", "color": "ee5500", "description": "Denotes a PR that changes 500-999 lines, ignoring generated files.", "default": false, "node_id": "MDU6TGFiZWwyNTM0NTEwNTc=" } ], "user": { "login": "wojtek-t", "id": 10743879, "node_id": "MDQ6VXNlcjEwNzQzODc5", "avatar_url": "https://avatars3.githubusercontent.com/u/10743879?v=4", "html_url": "https://github.com/wojtek-t", "gravatar_id": "", "type": "User", "site_admin": false, "url": "https://api.github.com/users/wojtek-t", "events_url": "https://api.github.com/users/wojtek-t/events{/privacy}", "following_url": "https://api.github.com/users/wojtek-t/following{/other_user}", "followers_url": "https://api.github.com/users/wojtek-t/followers", "gists_url": "https://api.github.com/users/wojtek-t/gists{/gist_id}", "organizations_url": "https://api.github.com/users/wojtek-t/orgs", "received_events_url": "https://api.github.com/users/wojtek-t/received_events", "repos_url": "https://api.github.com/users/wojtek-t/repos", "starred_url": "https://api.github.com/users/wojtek-t/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/wojtek-t/subscriptions" }, "draft": false, "merge_commit_sha": "a67238eed67315169b4ff97c73860002c39ea428", "url": "https://api.github.com/repos/kubernetes/kubernetes/pulls/87007", "html_url": "https://github.com/kubernetes/kubernetes/pull/87007", "issue_url": "https://api.github.com/repos/kubernetes/kubernetes/issues/87007", "statuses_url": "https://api.github.com/repos/kubernetes/kubernetes/statuses/1fc80c57eeaa61d915b0e8a3f3d7c88fc8f67fb0", "diff_url": "https://github.com/kubernetes/kubernetes/pull/87007.diff", "patch_url": "https://github.com/kubernetes/kubernetes/pull/87007.patch", "commits_url": "https://api.github.com/repos/kubernetes/kubernetes/pulls/87007/commits", "comments_url": "https://api.github.com/repos/kubernetes/kubernetes/issues/87007/comments", "review_comments_url": "https://api.github.com/repos/kubernetes/kubernetes/pulls/87007/comments", "review_comment_url": "https://api.github.com/repos/kubernetes/kubernetes/pulls/comments{/number}", "assignee": { "login": "liggitt", "id": 980082, "node_id": "MDQ6VXNlcjk4MDA4Mg==", "avatar_url": "https://avatars0.githubusercontent.com/u/980082?v=4", "html_url": "https://github.com/liggitt", "gravatar_id": "", "type": "User", "site_admin": false, "url": "https://api.github.com/users/liggitt", "events_url": "https://api.github.com/users/liggitt/events{/privacy}", "following_url": "https://api.github.com/users/liggitt/following{/other_user}", "followers_url": "https://api.github.com/users/liggitt/followers", "gists_url": "https://api.github.com/users/liggitt/gists{/gist_id}", "organizations_url": "https://api.github.com/users/liggitt/orgs", "received_events_url": "https://api.github.com/users/liggitt/received_events", "repos_url": "https://api.github.com/users/liggitt/repos", "starred_url": "https://api.github.com/users/liggitt/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/liggitt/subscriptions" }, "assignees": [ { "login": "liggitt", "id": 980082, "node_id": "MDQ6VXNlcjk4MDA4Mg==", "avatar_url": "https://avatars0.githubusercontent.com/u/980082?v=4", "html_url": "https://github.com/liggitt", "gravatar_id": "", "type": "User", "site_admin": false, "url": "https://api.github.com/users/liggitt", "events_url": "https://api.github.com/users/liggitt/events{/privacy}", "following_url": "https://api.github.com/users/liggitt/following{/other_user}", "followers_url": "https://api.github.com/users/liggitt/followers", "gists_url": "https://api.github.com/users/liggitt/gists{/gist_id}", "organizations_url": "https://api.github.com/users/liggitt/orgs", "received_events_url": "https://api.github.com/users/liggitt/received_events", "repos_url": "https://api.github.com/users/liggitt/repos", "starred_url": "https://api.github.com/users/liggitt/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/liggitt/subscriptions" } ], "milestone": { "url": "https://api.github.com/repos/kubernetes/kubernetes/milestones/44", "html_url": "https://github.com/kubernetes/kubernetes/milestone/44", "labels_url": "https://api.github.com/repos/kubernetes/kubernetes/milestones/44/labels", "id": 4018465, "number": 44, "state": "open", "title": "v1.18", "creator": { "login": "liggitt", "id": 980082, "node_id": "MDQ6VXNlcjk4MDA4Mg==", "avatar_url": "https://avatars0.githubusercontent.com/u/980082?v=4", "html_url": "https://github.com/liggitt", "gravatar_id": "", "type": "User", "site_admin": false, "url": "https://api.github.com/users/liggitt", "events_url": "https://api.github.com/users/liggitt/events{/privacy}", "following_url": "https://api.github.com/users/liggitt/following{/other_user}", "followers_url": "https://api.github.com/users/liggitt/followers", "gists_url": "https://api.github.com/users/liggitt/gists{/gist_id}", "organizations_url": "https://api.github.com/users/liggitt/orgs", "received_events_url": "https://api.github.com/users/liggitt/received_events", "repos_url": "https://api.github.com/users/liggitt/repos", "starred_url": "https://api.github.com/users/liggitt/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/liggitt/subscriptions" }, "open_issues": 121, "closed_issues": 951, "created_at": "2019-01-31T15:17:22Z", "updated_at": "2020-02-06T10:27:36Z", "node_id": "MDk6TWlsZXN0b25lNDAxODQ2NQ==" }, "author_association": "MEMBER", "node_id": "MDExOlB1bGxSZXF1ZXN0MzYwODY5OTEx", "requested_reviewers": [ { "login": "sttts", "id": 730123, "node_id": "MDQ6VXNlcjczMDEyMw==", "avatar_url": "https://avatars0.githubusercontent.com/u/730123?v=4", "html_url": "https://github.com/sttts", "gravatar_id": "", "type": "User", "site_admin": false, "url": "https://api.github.com/users/sttts", "events_url": "https://api.github.com/users/sttts/events{/privacy}", "following_url": "https://api.github.com/users/sttts/following{/other_user}", "followers_url": "https://api.github.com/users/sttts/followers", "gists_url": "https://api.github.com/users/sttts/gists{/gist_id}", "organizations_url": "https://api.github.com/users/sttts/orgs", "received_events_url": "https://api.github.com/users/sttts/received_events", "repos_url": "https://api.github.com/users/sttts/repos", "starred_url": "https://api.github.com/users/sttts/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/sttts/subscriptions" }, { "login": "nikhiljindal", "id": 10199099, "node_id": "MDQ6VXNlcjEwMTk5MDk5", "avatar_url": "https://avatars0.githubusercontent.com/u/10199099?v=4", "html_url": "https://github.com/nikhiljindal", "gravatar_id": "", "type": "User", "site_admin": false, "url": "https://api.github.com/users/nikhiljindal", "events_url": "https://api.github.com/users/nikhiljindal/events{/privacy}", "following_url": "https://api.github.com/users/nikhiljindal/following{/other_user}", "followers_url": "https://api.github.com/users/nikhiljindal/followers", "gists_url": "https://api.github.com/users/nikhiljindal/gists{/gist_id}", "organizations_url": "https://api.github.com/users/nikhiljindal/orgs", "received_events_url": "https://api.github.com/users/nikhiljindal/received_events", "repos_url": "https://api.github.com/users/nikhiljindal/repos", "starred_url": "https://api.github.com/users/nikhiljindal/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/nikhiljindal/subscriptions" } ], "_links": { "self": { "href": "https://api.github.com/repos/kubernetes/kubernetes/pulls/87007" }, "html": { "href": "https://github.com/kubernetes/kubernetes/pull/87007" }, "issue": { "href": "https://api.github.com/repos/kubernetes/kubernetes/issues/87007" }, "comments": { "href": "https://api.github.com/repos/kubernetes/kubernetes/issues/87007/comments" }, "review_comments": { "href": "https://api.github.com/repos/kubernetes/kubernetes/pulls/87007/comments" }, "review_comment": { "href": "https://api.github.com/repos/kubernetes/kubernetes/pulls/comments{/number}" }, "commits": { "href": "https://api.github.com/repos/kubernetes/kubernetes/pulls/87007/commits" }, "statuses": { "href": "https://api.github.com/repos/kubernetes/kubernetes/statuses/1fc80c57eeaa61d915b0e8a3f3d7c88fc8f67fb0" } }, "head": { "label": "wojtek-t:cleanup_manual_conversions", "ref": "cleanup_manual_conversions", "sha": "1fc80c57eeaa61d915b0e8a3f3d7c88fc8f67fb0", "repo": { "id": 30216785, "node_id": "MDEwOlJlcG9zaXRvcnkzMDIxNjc4NQ==", "owner": { "login": "wojtek-t", "id": 10743879, "node_id": "MDQ6VXNlcjEwNzQzODc5", "avatar_url": "https://avatars3.githubusercontent.com/u/10743879?v=4", "html_url": "https://github.com/wojtek-t", "gravatar_id": "", "type": "User", "site_admin": false, "url": "https://api.github.com/users/wojtek-t", "events_url": "https://api.github.com/users/wojtek-t/events{/privacy}", "following_url": "https://api.github.com/users/wojtek-t/following{/other_user}", "followers_url": "https://api.github.com/users/wojtek-t/followers", "gists_url": "https://api.github.com/users/wojtek-t/gists{/gist_id}", "organizations_url": "https://api.github.com/users/wojtek-t/orgs", "received_events_url": "https://api.github.com/users/wojtek-t/received_events", "repos_url": "https://api.github.com/users/wojtek-t/repos", "starred_url": "https://api.github.com/users/wojtek-t/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/wojtek-t/subscriptions" }, "name": "kubernetes", "full_name": "wojtek-t/kubernetes", "description": "Container Cluster Manager", "homepage": "http://kubernetes.io", "default_branch": "master", "created_at": "2015-02-03T00:37:55Z", "pushed_at": "2020-02-06T11:04:17Z", "updated_at": "2015-04-30T12:14:58Z", "html_url": "https://github.com/wojtek-t/kubernetes", "clone_url": "https://github.com/wojtek-t/kubernetes.git", "git_url": "git://github.com/wojtek-t/kubernetes.git", "ssh_url": "[email protected]:wojtek-t/kubernetes.git", "svn_url": "https://github.com/wojtek-t/kubernetes", "language": "Go", "fork": true, "forks_count": 0, "open_issues_count": 0, "stargazers_count": 0, "watchers_count": 0, "size": 641711, "archived": false, "disabled": false, "license": { "key": "apache-2.0", "name": "Apache License 2.0", "url": "https://api.github.com/licenses/apache-2.0", "spdx_id": "Apache-2.0" }, "private": false, "has_issues": false, "has_wiki": true, "has_pages": false, "has_projects": true, "has_downloads": true, "url": "https://api.github.com/repos/wojtek-t/kubernetes", "archive_url": "https://api.github.com/repos/wojtek-t/kubernetes/{archive_format}{/ref}", "assignees_url": "https://api.github.com/repos/wojtek-t/kubernetes/assignees{/user}", "blobs_url": "https://api.github.com/repos/wojtek-t/kubernetes/git/blobs{/sha}", "branches_url": "https://api.github.com/repos/wojtek-t/kubernetes/branches{/branch}", "collaborators_url": "https://api.github.com/repos/wojtek-t/kubernetes/collaborators{/collaborator}", "comments_url": "https://api.github.com/repos/wojtek-t/kubernetes/comments{/number}", "commits_url": "https://api.github.com/repos/wojtek-t/kubernetes/commits{/sha}", "compare_url": "https://api.github.com/repos/wojtek-t/kubernetes/compare/{base}...{head}", "contents_url": "https://api.github.com/repos/wojtek-t/kubernetes/contents/{+path}", "contributors_url": "https://api.github.com/repos/wojtek-t/kubernetes/contributors", "deployments_url": "https://api.github.com/repos/wojtek-t/kubernetes/deployments", "downloads_url": "https://api.github.com/repos/wojtek-t/kubernetes/downloads", "events_url": "https://api.github.com/repos/wojtek-t/kubernetes/events", "forks_url": "https://api.github.com/repos/wojtek-t/kubernetes/forks", "git_commits_url": "https://api.github.com/repos/wojtek-t/kubernetes/git/commits{/sha}", "git_refs_url": "https://api.github.com/repos/wojtek-t/kubernetes/git/refs{/sha}", "git_tags_url": "https://api.github.com/repos/wojtek-t/kubernetes/git/tags{/sha}", "hooks_url": "https://api.github.com/repos/wojtek-t/kubernetes/hooks", "issue_comment_url": "https://api.github.com/repos/wojtek-t/kubernetes/issues/comments{/number}", "issue_events_url": "https://api.github.com/repos/wojtek-t/kubernetes/issues/events{/number}", "issues_url": "https://api.github.com/repos/wojtek-t/kubernetes/issues{/number}", "keys_url": "https://api.github.com/repos/wojtek-t/kubernetes/keys{/key_id}", "labels_url": "https://api.github.com/repos/wojtek-t/kubernetes/labels{/name}", "languages_url": "https://api.github.com/repos/wojtek-t/kubernetes/languages", "merges_url": "https://api.github.com/repos/wojtek-t/kubernetes/merges", "milestones_url": "https://api.github.com/repos/wojtek-t/kubernetes/milestones{/number}", "notifications_url": "https://api.github.com/repos/wojtek-t/kubernetes/notifications{?since,all,participating}", "pulls_url": "https://api.github.com/repos/wojtek-t/kubernetes/pulls{/number}", "releases_url": "https://api.github.com/repos/wojtek-t/kubernetes/releases{/id}", "stargazers_url": "https://api.github.com/repos/wojtek-t/kubernetes/stargazers", "statuses_url": "https://api.github.com/repos/wojtek-t/kubernetes/statuses/{sha}", "subscribers_url": "https://api.github.com/repos/wojtek-t/kubernetes/subscribers", "subscription_url": "https://api.github.com/repos/wojtek-t/kubernetes/subscription", "tags_url": "https://api.github.com/repos/wojtek-t/kubernetes/tags", "trees_url": "https://api.github.com/repos/wojtek-t/kubernetes/git/trees{/sha}", "teams_url": "https://api.github.com/repos/wojtek-t/kubernetes/teams" }, "user": { "login": "wojtek-t", "id": 10743879, "node_id": "MDQ6VXNlcjEwNzQzODc5", "avatar_url": "https://avatars3.githubusercontent.com/u/10743879?v=4", "html_url": "https://github.com/wojtek-t", "gravatar_id": "", "type": "User", "site_admin": false, "url": "https://api.github.com/users/wojtek-t", "events_url": "https://api.github.com/users/wojtek-t/events{/privacy}", "following_url": "https://api.github.com/users/wojtek-t/following{/other_user}", "followers_url": "https://api.github.com/users/wojtek-t/followers", "gists_url": "https://api.github.com/users/wojtek-t/gists{/gist_id}", "organizations_url": "https://api.github.com/users/wojtek-t/orgs", "received_events_url": "https://api.github.com/users/wojtek-t/received_events", "repos_url": "https://api.github.com/users/wojtek-t/repos", "starred_url": "https://api.github.com/users/wojtek-t/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/wojtek-t/subscriptions" } }, "base": { "label": "kubernetes:master", "ref": "master", "sha": "a71586fac6007382db1c1dbe1ea192d4b21a0dde", "repo": { "id": 20580498, "node_id": "MDEwOlJlcG9zaXRvcnkyMDU4MDQ5OA==", "owner": { "login": "kubernetes", "id": 13629408, "node_id": "MDEyOk9yZ2FuaXphdGlvbjEzNjI5NDA4", "avatar_url": "https://avatars2.githubusercontent.com/u/13629408?v=4", "html_url": "https://github.com/kubernetes", "gravatar_id": "", "type": "Organization", "site_admin": false, "url": "https://api.github.com/users/kubernetes", "events_url": "https://api.github.com/users/kubernetes/events{/privacy}", "following_url": "https://api.github.com/users/kubernetes/following{/other_user}", "followers_url": "https://api.github.com/users/kubernetes/followers", "gists_url": "https://api.github.com/users/kubernetes/gists{/gist_id}", "organizations_url": "https://api.github.com/users/kubernetes/orgs", "received_events_url": "https://api.github.com/users/kubernetes/received_events", "repos_url": "https://api.github.com/users/kubernetes/repos", "starred_url": "https://api.github.com/users/kubernetes/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kubernetes/subscriptions" }, "name": "kubernetes", "full_name": "kubernetes/kubernetes", "description": "Production-Grade Container Scheduling and Management", "homepage": "https://kubernetes.io", "default_branch": "master", "created_at": "2014-06-06T22:56:04Z", "pushed_at": "2020-02-06T11:28:44Z", "updated_at": "2020-02-06T11:30:47Z", "html_url": "https://github.com/kubernetes/kubernetes", "clone_url": "https://github.com/kubernetes/kubernetes.git", "git_url": "git://github.com/kubernetes/kubernetes.git", "ssh_url": "[email protected]:kubernetes/kubernetes.git", "svn_url": "https://github.com/kubernetes/kubernetes", "language": "Go", "fork": false, "forks_count": 22321, "open_issues_count": 3138, "stargazers_count": 62957, "watchers_count": 62957, "size": 894104, "archived": false, "disabled": false, "license": { "key": "apache-2.0", "name": "Apache License 2.0", "url": "https://api.github.com/licenses/apache-2.0", "spdx_id": "Apache-2.0" }, "private": false, "has_issues": true, "has_wiki": false, "has_pages": false, "has_projects": true, "has_downloads": true, "url": "https://api.github.com/repos/kubernetes/kubernetes", "archive_url": "https://api.github.com/repos/kubernetes/kubernetes/{archive_format}{/ref}", "assignees_url": "https://api.github.com/repos/kubernetes/kubernetes/assignees{/user}", "blobs_url": "https://api.github.com/repos/kubernetes/kubernetes/git/blobs{/sha}", "branches_url": "https://api.github.com/repos/kubernetes/kubernetes/branches{/branch}", "collaborators_url": "https://api.github.com/repos/kubernetes/kubernetes/collaborators{/collaborator}", "comments_url": "https://api.github.com/repos/kubernetes/kubernetes/comments{/number}", "commits_url": "https://api.github.com/repos/kubernetes/kubernetes/commits{/sha}", "compare_url": "https://api.github.com/repos/kubernetes/kubernetes/compare/{base}...{head}", "contents_url": "https://api.github.com/repos/kubernetes/kubernetes/contents/{+path}", "contributors_url": "https://api.github.com/repos/kubernetes/kubernetes/contributors", "deployments_url": "https://api.github.com/repos/kubernetes/kubernetes/deployments", "downloads_url": "https://api.github.com/repos/kubernetes/kubernetes/downloads", "events_url": "https://api.github.com/repos/kubernetes/kubernetes/events", "forks_url": "https://api.github.com/repos/kubernetes/kubernetes/forks", "git_commits_url": "https://api.github.com/repos/kubernetes/kubernetes/git/commits{/sha}", "git_refs_url": "https://api.github.com/repos/kubernetes/kubernetes/git/refs{/sha}", "git_tags_url": "https://api.github.com/repos/kubernetes/kubernetes/git/tags{/sha}", "hooks_url": "https://api.github.com/repos/kubernetes/kubernetes/hooks", "issue_comment_url": "https://api.github.com/repos/kubernetes/kubernetes/issues/comments{/number}", "issue_events_url": "https://api.github.com/repos/kubernetes/kubernetes/issues/events{/number}", "issues_url": "https://api.github.com/repos/kubernetes/kubernetes/issues{/number}", "keys_url": "https://api.github.com/repos/kubernetes/kubernetes/keys{/key_id}", "labels_url": "https://api.github.com/repos/kubernetes/kubernetes/labels{/name}", "languages_url": "https://api.github.com/repos/kubernetes/kubernetes/languages", "merges_url": "https://api.github.com/repos/kubernetes/kubernetes/merges", "milestones_url": "https://api.github.com/repos/kubernetes/kubernetes/milestones{/number}", "notifications_url": "https://api.github.com/repos/kubernetes/kubernetes/notifications{?since,all,participating}", "pulls_url": "https://api.github.com/repos/kubernetes/kubernetes/pulls{/number}", "releases_url": "https://api.github.com/repos/kubernetes/kubernetes/releases{/id}", "stargazers_url": "https://api.github.com/repos/kubernetes/kubernetes/stargazers", "statuses_url": "https://api.github.com/repos/kubernetes/kubernetes/statuses/{sha}", "subscribers_url": "https://api.github.com/repos/kubernetes/kubernetes/subscribers", "subscription_url": "https://api.github.com/repos/kubernetes/kubernetes/subscription", "tags_url": "https://api.github.com/repos/kubernetes/kubernetes/tags", "trees_url": "https://api.github.com/repos/kubernetes/kubernetes/git/trees{/sha}", "teams_url": "https://api.github.com/repos/kubernetes/kubernetes/teams" }, "user": { "login": "kubernetes", "id": 13629408, "node_id": "MDEyOk9yZ2FuaXphdGlvbjEzNjI5NDA4", "avatar_url": "https://avatars2.githubusercontent.com/u/13629408?v=4", "html_url": "https://github.com/kubernetes", "gravatar_id": "", "type": "Organization", "site_admin": false, "url": "https://api.github.com/users/kubernetes", "events_url": "https://api.github.com/users/kubernetes/events{/privacy}", "following_url": "https://api.github.com/users/kubernetes/following{/other_user}", "followers_url": "https://api.github.com/users/kubernetes/followers", "gists_url": "https://api.github.com/users/kubernetes/gists{/gist_id}", "organizations_url": "https://api.github.com/users/kubernetes/orgs", "received_events_url": "https://api.github.com/users/kubernetes/received_events", "repos_url": "https://api.github.com/users/kubernetes/repos", "starred_url": "https://api.github.com/users/kubernetes/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kubernetes/subscriptions" } } } ], "LastPage": 0 }
{ "pile_set_name": "Github" }
class ParticleSystem { ArrayList<Particle> particles; PShape particleShape; ParticleSystem(int n) { particles = new ArrayList<Particle>(); particleShape = createShape(PShape.GROUP); for (int i = 0; i < n; i++) { Particle p = new Particle(); particles.add(p); particleShape.addChild(p.getShape()); } } void update() { for (Particle p : particles) { p.update(); } } void setEmitter(float x, float y) { for (Particle p : particles) { if (p.isDead()) { p.rebirth(x, y); } } } void display() { shape(particleShape); } }
{ "pile_set_name": "Github" }
chAf_arrow.chem: .br .EQ delim $$ .EN .cstart # Example file for `chem': # This originates from Computing Science Technical Report No. 122 # CHEM - A Program for Typesetting Chemical Diagrams: User Manual # by Jon L. Bentley, Lynn W. Jelinski, Brian W. Kernighan # <http://cm.bell-labs.com/cm/cs/cstr/122.ps.gz>. # Copyright (C) 2006, 2009 Free Software Foundation, Inc. # Last update: 5 Jan 2009 # This file is part of `chem', which is part of `groff'. # `groff' is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # `groff' is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. ######################################################################## bond length .1 ; BP bond up length .5 bond right bond down length .5 from BP bond right bond right from BP ; C double bond up ; O bond right from C benzene pointing right bond right ; C double bond up from C ; O bond right from C ; O bond right ; CH2 # this is the statement to make the arrow line <- from CH2.s down move down .1 ; "0.085" CH2CH2CH2 right of CH2 bond right ; O bond right length .1 ; BP bond up length .5 from BP bond left bond right length .1 from BP bond down length .5 from BP ; BP bond left "$n$" with .w at BP.se ######################################################################## ### Emacs settings # Local Variables: # mode: Nroff # End: .cend .EQ delim off .EN
{ "pile_set_name": "Github" }
[titleEn]: <>(Payment plugin) [metaDescriptionEn]: <>(Payments are an essential part of the checkout process. That's the reason why Shopware 6 offers an easy platform on which you can build payment plugins. Learn here, how that's done.) [hash]: <>(article:how_to_payment_plugin) Payments are an essential part of the checkout process. That's the reason why Shopware 6 offers an easy platform on which you can build payment plugins. ## Payment handler Shopware 6 has a few default payment handler which can be found under `Shopware\Core\Checkout\Payment\Cart\PaymentHandler`. ## Creating a custom payment handler You can create your own payment handler by implementing one of the following interfaces: | Interface | DI container tag | Usage | |-------------------------------------|-------------------------------|---------------------------------------------------------------------| | SynchronousPaymentHandlerInterface | shopware.payment.method.sync | Payment can be handled locally, e.g. pre-payment | | AsynchronousPaymentHandlerInterface | shopware.payment.method.async | A redirect to an external payment provider is required, e.g. PayPal | Depending on the interface, those two methods are required: * `pay`: This method will be called after an order has been placed. You receive a `Shopware\Core\Checkout\Payment\Cart\AsyncPaymentTransactionStruct|Shopware\Core\Checkout\Payment\Cart\SyncPaymentTransactionStruct` which contains the transactionId, order details, the amount for the transaction, a return URL, payment method information and language information. Please be aware, Shopware 6 supports multiple transactions and you have to use the amount provided and not the total order amount. If you're using the `AsynchronousPaymentHandlerInterface`, the `pay` method has to return a `RedirectResponse` to redirect the customer to an external payment provider. Note: The `AsyncPaymentTransactionStruct` contains a return URL. Pass this URL to the external payment provider to ensure that the customer will be redirected back to the shop to this URL. If an error occurs while e.g. calling the API of your external payment provider you should throw an `AsyncPaymentProcessException`. Shopware will handle this exception and set the transaction to the `cancelled` state. The same happens if you are using the `SynchronousPaymentHandlerInterface`: throw a `SyncPaymentProcessException` in an error case. * `finalize`: The `finalize` method is only required if you implemented the `AsynchronousPaymentHandlerInterface`, returned a `RedirectResponse` in your `pay` method and the customer has been redirected from the payment provider back to Shopware 6. You must check here if the payment was successful or not and update the order transaction state accordingly. Similar to the pay action you are able to throw exceptions if some error cases occur. Throw the `CustomerCanceledAsyncPaymentException` if the customer canceled the payment process on the payment provider site. If another general error occurs throw the `AsyncPaymentFinalizeException` e.g. if your call to the payment provider API fails. Again Shopware will handle these exceptions and will set the transaction to the `cancelled` state. Both methods get the `\Shopware\Core\System\SalesChannel\SalesChannelContext` injected. Please note, that this class contains properties, which are nullable. If you want to use these information, ensure in your code, that they are set and not `NULL` You also need to make sure to register your custom payment in the DI container. ```xml <?xml version="1.0" ?> <container xmlns="http://symfony.com/schema/dic/services" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd"> <services> <service id="Swag\PaymentPlugin\Service\ExamplePayment"> <argument type="service" id="Shopware\Core\Checkout\Order\Aggregate\OrderTransaction\OrderTransactionStateHandler"/> <tag name="shopware.payment.method.async" /> </service> </services> </container> ``` The mentioned example class `Swag\PaymentPlugin\Service\ExamplePayment` is created in the next step. ### Asynchronous example An implementation of your custom asynchronous payment handler could look like this: ```php <?php declare(strict_types=1); namespace Swag\PaymentPlugin\Service; use Shopware\Core\Checkout\Payment\Cart\AsyncPaymentTransactionStruct; use Shopware\Core\Checkout\Payment\Cart\PaymentHandler\AsynchronousPaymentHandlerInterface; use Shopware\Core\Checkout\Payment\Exception\AsyncPaymentProcessException; use Shopware\Core\Checkout\Payment\Exception\CustomerCanceledAsyncPaymentException; use Shopware\Core\Checkout\Order\Aggregate\OrderTransaction\OrderTransactionStateHandler; use Shopware\Core\Framework\Validation\DataBag\RequestDataBag; use Shopware\Core\System\SalesChannel\SalesChannelContext; use Symfony\Component\HttpFoundation\RedirectResponse; use Symfony\Component\HttpFoundation\Request; class ExamplePayment implements AsynchronousPaymentHandlerInterface { /** * @var OrderTransactionStateHandler */ private $transactionStateHandler; public function __construct(OrderTransactionStateHandler $transactionStateHandler) { $this->transactionStateHandler = $transactionStateHandler; } /** * @throws AsyncPaymentProcessException */ public function pay(AsyncPaymentTransactionStruct $transaction, RequestDataBag $dataBag, SalesChannelContext $salesChannelContext): RedirectResponse { // Method that sends the return URL to the external gateway and gets a redirect URL back try { $redirectUrl = $this->sendReturnUrlToExternalGateway($transaction->getReturnUrl()); } catch (\Exception $e) { throw new AsyncPaymentProcessException( $transaction->getOrderTransaction()->getId(), 'An error occurred during the communication with external payment gateway' . PHP_EOL . $e->getMessage() ); } // Redirect to external gateway return new RedirectResponse($redirectUrl); } /** * @throws CustomerCanceledAsyncPaymentException */ public function finalize(AsyncPaymentTransactionStruct $transaction, Request $request, SalesChannelContext $salesChannelContext): void { $transactionId = $transaction->getOrderTransaction()->getId(); // Cancelled payment? if ($request->query->getBoolean('cancel')) { throw new CustomerCanceledAsyncPaymentException( $transactionId, 'Customer canceled the payment on the PayPal page' ); } $paymentState = $request->query->getAlpha('status'); $context = $salesChannelContext->getContext(); if ($paymentState === 'completed') { // Payment completed, set transaction status to "paid" $this->transactionStateHandler->paid($transaction->getOrderTransaction()->getId(), $context); } else { // Payment not completed, set transaction status to "open" $this->transactionStateHandler->reopen($transaction->getOrderTransaction()->getId(), $context); } } private function sendReturnUrlToExternalGateway(string $getReturnUrl): string { $paymentProviderUrl = ''; // Do some API Call to your payment provider return $paymentProviderUrl; } } ``` ### Synchronous example In this example, changing the `stateId` of the order should already be done in the `pay` method, since there will be no `finalize` method. If you have to execute some logic which might fail, e.g. a call to an external API, you should throw a `SyncPaymentProcessException` Shopware will handle this exception and set the transaction to the `cancelled` state. ```php <?php declare(strict_types=1); namespace PaymentPlugin\Service; use Shopware\Core\Checkout\Payment\Cart\PaymentHandler\SynchronousPaymentHandlerInterface; use Shopware\Core\Checkout\Payment\Cart\SyncPaymentTransactionStruct; use Shopware\Core\Checkout\Order\Aggregate\OrderTransaction\OrderTransactionStateHandler; use Shopware\Core\Framework\Validation\DataBag\RequestDataBag; use Shopware\Core\System\SalesChannel\SalesChannelContext; class ExamplePayment implements SynchronousPaymentHandlerInterface { /** * @var OrderTransactionStateHandler */ private $transactionStateHandler; public function __construct(OrderTransactionStateHandler $transactionStateHandler) { $this->transactionStateHandler = $transactionStateHandler; } public function pay(SyncPaymentTransactionStruct $transaction, RequestDataBag $dataBag, SalesChannelContext $salesChannelContext): void { $context = $salesChannelContext->getContext(); $this->transactionStateHandler->paid($transaction->getOrderTransaction()->getId(), $context); } } ``` ## Setting up new payment method The handler itself is not used yet, since there is no payment method actually using the handler mentioned above. The payment method can be added to the system while installing your plugin. An example for your plugin could look like this: ```php <?php declare(strict_types=1); namespace Swag\PaymentPlugin; use Swag\PaymentPlugin\Service\ExamplePayment; use Shopware\Core\Framework\Context; use Shopware\Core\Framework\DataAbstractionLayer\EntityRepositoryInterface; use Shopware\Core\Framework\DataAbstractionLayer\Search\Criteria; use Shopware\Core\Framework\DataAbstractionLayer\Search\Filter\EqualsFilter; use Shopware\Core\Framework\Plugin; use Shopware\Core\Framework\Plugin\Context\ActivateContext; use Shopware\Core\Framework\Plugin\Context\DeactivateContext; use Shopware\Core\Framework\Plugin\Context\InstallContext; use Shopware\Core\Framework\Plugin\Context\UninstallContext; use Shopware\Core\Framework\Plugin\Util\PluginIdProvider; class PaymentPlugin extends Plugin { public function install(InstallContext $context): void { $this->addPaymentMethod($context->getContext()); } public function uninstall(UninstallContext $context): void { // Only set the payment method to inactive when uninstalling. Removing the payment method would // cause data consistency issues, since the payment method might have been used in several orders $this->setPaymentMethodIsActive(false, $context->getContext()); } public function activate(ActivateContext $context): void { $this->setPaymentMethodIsActive(true, $context->getContext()); parent::activate($context); } public function deactivate(DeactivateContext $context): void { $this->setPaymentMethodIsActive(false, $context->getContext()); parent::deactivate($context); } private function addPaymentMethod(Context $context): void { $paymentMethodExists = $this->getPaymentMethodId(); // Payment method exists already, no need to continue here if ($paymentMethodExists) { return; } /** @var PluginIdProvider $pluginIdProvider */ $pluginIdProvider = $this->container->get(PluginIdProvider::class); $pluginId = $pluginIdProvider->getPluginIdByBaseClass(get_class($this), $context); $examplePaymentData = [ // payment handler will be selected by the identifier 'handlerIdentifier' => ExamplePayment::class, 'name' => 'Example payment', 'description' => 'Example payment description', 'pluginId' => $pluginId, ]; /** @var EntityRepositoryInterface $paymentRepository */ $paymentRepository = $this->container->get('payment_method.repository'); $paymentRepository->create([$examplePaymentData], $context); } private function setPaymentMethodIsActive(bool $active, Context $context): void { /** @var EntityRepositoryInterface $paymentRepository */ $paymentRepository = $this->container->get('payment_method.repository'); $paymentMethodId = $this->getPaymentMethodId(); // Payment does not even exist, so nothing to (de-)activate here if (!$paymentMethodId) { return; } $paymentMethod = [ 'id' => $paymentMethodId, 'active' => $active, ]; $paymentRepository->update([$paymentMethod], $context); } private function getPaymentMethodId(): ?string { /** @var EntityRepositoryInterface $paymentRepository */ $paymentRepository = $this->container->get('payment_method.repository'); // Fetch ID for update $paymentCriteria = (new Criteria())->addFilter(new EqualsFilter('handlerIdentifier', ExamplePayment::class)); $paymentIds = $paymentRepository->searchIds($paymentCriteria, Context::createDefaultContext()); if ($paymentIds->getTotal() === 0) { return null; } return $paymentIds->getIds()[0]; } } ``` ## Identify your payment You can identify your payment by the entity property `formattedHandlerIdentifier`. It shortens the original handler identifier (php class reference): `Custom/Payment/SEPAPayment` to `handler_custom_sepapayment` The syntax for the shortening can be looked up in `Shopware\Core\Checkout\Payment\DataAbstractionLayer\PaymentHandlerIdentifierSubscriber`. ## Source There's a GitHub repository available, containing this example source. Check it out [here](https://github.com/shopware/swag-docs-payment-plugin).
{ "pile_set_name": "Github" }
{"text": ["are", "you", "buying", "$", "upl", "$", "duk", "$", "hst", "$", "aapl", "overvalued", "URL"], "created_at": "Thu Feb 20 00:36:40 +0000 2014", "user_id_str": "2323906809"}
{ "pile_set_name": "Github" }
/// auto-generated file generated from errors.dat #include "Basics/Common.h" #include "Basics/error.h" #include "Basics/voc-errors.h" /// helper macro to define an error string #define REG_ERROR(id, label) TRI_set_errno_string(TRI_ ## id, label); void TRI_InitializeErrorMessages() { REG_ERROR(ERROR_NO_ERROR, "no error"); REG_ERROR(ERROR_FAILED, "failed"); REG_ERROR(ERROR_SYS_ERROR, "system error"); REG_ERROR(ERROR_OUT_OF_MEMORY, "out of memory"); REG_ERROR(ERROR_INTERNAL, "internal error"); REG_ERROR(ERROR_ILLEGAL_NUMBER, "illegal number"); REG_ERROR(ERROR_NUMERIC_OVERFLOW, "numeric overflow"); REG_ERROR(ERROR_ILLEGAL_OPTION, "illegal option"); REG_ERROR(ERROR_DEAD_PID, "dead process identifier"); REG_ERROR(ERROR_NOT_IMPLEMENTED, "not implemented"); REG_ERROR(ERROR_BAD_PARAMETER, "bad parameter"); REG_ERROR(ERROR_FORBIDDEN, "forbidden"); REG_ERROR(ERROR_OUT_OF_MEMORY_MMAP, "out of memory in mmap"); REG_ERROR(ERROR_CORRUPTED_CSV, "csv is corrupt"); REG_ERROR(ERROR_FILE_NOT_FOUND, "file not found"); REG_ERROR(ERROR_CANNOT_WRITE_FILE, "cannot write file"); REG_ERROR(ERROR_CANNOT_OVERWRITE_FILE, "cannot overwrite file"); REG_ERROR(ERROR_TYPE_ERROR, "type error"); REG_ERROR(ERROR_LOCK_TIMEOUT, "lock timeout"); REG_ERROR(ERROR_CANNOT_CREATE_DIRECTORY, "cannot create directory"); REG_ERROR(ERROR_CANNOT_CREATE_TEMP_FILE, "cannot create temporary file"); REG_ERROR(ERROR_REQUEST_CANCELED, "canceled request"); REG_ERROR(ERROR_DEBUG, "intentional debug error"); REG_ERROR(ERROR_IP_ADDRESS_INVALID, "IP address is invalid"); REG_ERROR(ERROR_FILE_EXISTS, "file exists"); REG_ERROR(ERROR_LOCKED, "locked"); REG_ERROR(ERROR_DEADLOCK, "deadlock detected"); REG_ERROR(ERROR_SHUTTING_DOWN, "shutdown in progress"); REG_ERROR(ERROR_ONLY_ENTERPRISE, "only enterprise version"); REG_ERROR(ERROR_RESOURCE_LIMIT, "resource limit exceeded"); REG_ERROR(ERROR_ARANGO_ICU_ERROR, "icu error: %s"); REG_ERROR(ERROR_CANNOT_READ_FILE, "cannot read file"); REG_ERROR(ERROR_INCOMPATIBLE_VERSION, "incompatible server version"); REG_ERROR(ERROR_DISABLED, "disabled"); REG_ERROR(ERROR_HTTP_BAD_PARAMETER, "bad parameter"); REG_ERROR(ERROR_HTTP_UNAUTHORIZED, "unauthorized"); REG_ERROR(ERROR_HTTP_FORBIDDEN, "forbidden"); REG_ERROR(ERROR_HTTP_NOT_FOUND, "not found"); REG_ERROR(ERROR_HTTP_METHOD_NOT_ALLOWED, "method not supported"); REG_ERROR(ERROR_HTTP_NOT_ACCEPTABLE, "request not acceptable"); REG_ERROR(ERROR_HTTP_PRECONDITION_FAILED, "precondition failed"); REG_ERROR(ERROR_HTTP_SERVER_ERROR, "internal server error"); REG_ERROR(ERROR_HTTP_SERVICE_UNAVAILABLE, "service unavailable"); REG_ERROR(ERROR_HTTP_GATEWAY_TIMEOUT, "gateway timeout"); REG_ERROR(ERROR_HTTP_CORRUPTED_JSON, "invalid JSON object"); REG_ERROR(ERROR_HTTP_SUPERFLUOUS_SUFFICES, "superfluous URL suffices"); REG_ERROR(ERROR_ARANGO_ILLEGAL_STATE, "illegal state"); REG_ERROR(ERROR_ARANGO_DATAFILE_SEALED, "datafile sealed"); REG_ERROR(ERROR_ARANGO_READ_ONLY, "read only"); REG_ERROR(ERROR_ARANGO_DUPLICATE_IDENTIFIER, "duplicate identifier"); REG_ERROR(ERROR_ARANGO_DATAFILE_UNREADABLE, "datafile unreadable"); REG_ERROR(ERROR_ARANGO_DATAFILE_EMPTY, "datafile empty"); REG_ERROR(ERROR_ARANGO_RECOVERY, "logfile recovery error"); REG_ERROR(ERROR_ARANGO_DATAFILE_STATISTICS_NOT_FOUND, "datafile statistics not found"); REG_ERROR(ERROR_ARANGO_CORRUPTED_DATAFILE, "corrupted datafile"); REG_ERROR(ERROR_ARANGO_ILLEGAL_PARAMETER_FILE, "illegal or unreadable parameter file"); REG_ERROR(ERROR_ARANGO_CORRUPTED_COLLECTION, "corrupted collection"); REG_ERROR(ERROR_ARANGO_MMAP_FAILED, "mmap failed"); REG_ERROR(ERROR_ARANGO_FILESYSTEM_FULL, "filesystem full"); REG_ERROR(ERROR_ARANGO_NO_JOURNAL, "no journal"); REG_ERROR(ERROR_ARANGO_DATAFILE_ALREADY_EXISTS, "cannot create/rename datafile because it already exists"); REG_ERROR(ERROR_ARANGO_DATADIR_LOCKED, "database directory is locked"); REG_ERROR(ERROR_ARANGO_COLLECTION_DIRECTORY_ALREADY_EXISTS, "cannot create/rename collection because directory already exists"); REG_ERROR(ERROR_ARANGO_MSYNC_FAILED, "msync failed"); REG_ERROR(ERROR_ARANGO_DATADIR_UNLOCKABLE, "cannot lock database directory"); REG_ERROR(ERROR_ARANGO_SYNC_TIMEOUT, "sync timeout"); REG_ERROR(ERROR_ARANGO_CONFLICT, "conflict"); REG_ERROR(ERROR_ARANGO_DATADIR_INVALID, "invalid database directory"); REG_ERROR(ERROR_ARANGO_DOCUMENT_NOT_FOUND, "document not found"); REG_ERROR(ERROR_ARANGO_DATA_SOURCE_NOT_FOUND, "collection or view not found"); REG_ERROR(ERROR_ARANGO_COLLECTION_PARAMETER_MISSING, "parameter 'collection' not found"); REG_ERROR(ERROR_ARANGO_DOCUMENT_HANDLE_BAD, "illegal document identifier"); REG_ERROR(ERROR_ARANGO_MAXIMAL_SIZE_TOO_SMALL, "maximal size of journal too small"); REG_ERROR(ERROR_ARANGO_DUPLICATE_NAME, "duplicate name"); REG_ERROR(ERROR_ARANGO_ILLEGAL_NAME, "illegal name"); REG_ERROR(ERROR_ARANGO_NO_INDEX, "no suitable index known"); REG_ERROR(ERROR_ARANGO_UNIQUE_CONSTRAINT_VIOLATED, "unique constraint violated"); REG_ERROR(ERROR_ARANGO_INDEX_NOT_FOUND, "index not found"); REG_ERROR(ERROR_ARANGO_CROSS_COLLECTION_REQUEST, "cross collection request not allowed"); REG_ERROR(ERROR_ARANGO_INDEX_HANDLE_BAD, "illegal index identifier"); REG_ERROR(ERROR_ARANGO_DOCUMENT_TOO_LARGE, "document too large"); REG_ERROR(ERROR_ARANGO_COLLECTION_NOT_UNLOADED, "collection must be unloaded"); REG_ERROR(ERROR_ARANGO_COLLECTION_TYPE_INVALID, "collection type invalid"); REG_ERROR(ERROR_ARANGO_ATTRIBUTE_PARSER_FAILED, "parsing attribute name definition failed"); REG_ERROR(ERROR_ARANGO_DOCUMENT_KEY_BAD, "illegal document key"); REG_ERROR(ERROR_ARANGO_DOCUMENT_KEY_UNEXPECTED, "unexpected document key"); REG_ERROR(ERROR_ARANGO_DATADIR_NOT_WRITABLE, "server database directory not writable"); REG_ERROR(ERROR_ARANGO_OUT_OF_KEYS, "out of keys"); REG_ERROR(ERROR_ARANGO_DOCUMENT_KEY_MISSING, "missing document key"); REG_ERROR(ERROR_ARANGO_DOCUMENT_TYPE_INVALID, "invalid document type"); REG_ERROR(ERROR_ARANGO_DATABASE_NOT_FOUND, "database not found"); REG_ERROR(ERROR_ARANGO_DATABASE_NAME_INVALID, "database name invalid"); REG_ERROR(ERROR_ARANGO_USE_SYSTEM_DATABASE, "operation only allowed in system database"); REG_ERROR(ERROR_ARANGO_INVALID_KEY_GENERATOR, "invalid key generator"); REG_ERROR(ERROR_ARANGO_INVALID_EDGE_ATTRIBUTE, "edge attribute missing or invalid"); REG_ERROR(ERROR_ARANGO_INDEX_CREATION_FAILED, "index creation failed"); REG_ERROR(ERROR_ARANGO_WRITE_THROTTLE_TIMEOUT, "write-throttling timeout"); REG_ERROR(ERROR_ARANGO_COLLECTION_TYPE_MISMATCH, "collection type mismatch"); REG_ERROR(ERROR_ARANGO_COLLECTION_NOT_LOADED, "collection not loaded"); REG_ERROR(ERROR_ARANGO_DOCUMENT_REV_BAD, "illegal document revision"); REG_ERROR(ERROR_ARANGO_INCOMPLETE_READ, "incomplete read"); REG_ERROR(ERROR_ARANGO_DATAFILE_FULL, "datafile full"); REG_ERROR(ERROR_ARANGO_EMPTY_DATADIR, "server database directory is empty"); REG_ERROR(ERROR_ARANGO_TRY_AGAIN, "operation should be tried again"); REG_ERROR(ERROR_ARANGO_BUSY, "engine is busy"); REG_ERROR(ERROR_ARANGO_MERGE_IN_PROGRESS, "merge in progress"); REG_ERROR(ERROR_ARANGO_IO_ERROR, "storage engine I/O error"); REG_ERROR(ERROR_REPLICATION_NO_RESPONSE, "no response"); REG_ERROR(ERROR_REPLICATION_INVALID_RESPONSE, "invalid response"); REG_ERROR(ERROR_REPLICATION_LEADER_ERROR, "leader error"); REG_ERROR(ERROR_REPLICATION_LEADER_INCOMPATIBLE, "leader incompatible"); REG_ERROR(ERROR_REPLICATION_LEADER_CHANGE, "leader change"); REG_ERROR(ERROR_REPLICATION_LOOP, "loop detected"); REG_ERROR(ERROR_REPLICATION_UNEXPECTED_MARKER, "unexpected marker"); REG_ERROR(ERROR_REPLICATION_INVALID_APPLIER_STATE, "invalid applier state"); REG_ERROR(ERROR_REPLICATION_UNEXPECTED_TRANSACTION, "invalid transaction"); REG_ERROR(ERROR_REPLICATION_INVALID_APPLIER_CONFIGURATION, "invalid replication applier configuration"); REG_ERROR(ERROR_REPLICATION_RUNNING, "cannot perform operation while applier is running"); REG_ERROR(ERROR_REPLICATION_APPLIER_STOPPED, "replication stopped"); REG_ERROR(ERROR_REPLICATION_NO_START_TICK, "no start tick"); REG_ERROR(ERROR_REPLICATION_START_TICK_NOT_PRESENT, "start tick not present"); REG_ERROR(ERROR_REPLICATION_WRONG_CHECKSUM, "wrong checksum"); REG_ERROR(ERROR_REPLICATION_SHARD_NONEMPTY, "shard not empty"); REG_ERROR(ERROR_CLUSTER_FOLLOWER_TRANSACTION_COMMIT_PERFORMED, "follower transaction intermediate commit already performed"); REG_ERROR(ERROR_CLUSTER_CREATE_COLLECTION_PRECONDITION_FAILED, "creating collection failed due to precondition"); REG_ERROR(ERROR_CLUSTER_SERVER_UNKNOWN, "got a request from an unkown server"); REG_ERROR(ERROR_CLUSTER_TOO_MANY_SHARDS, "too many shards"); REG_ERROR(ERROR_CLUSTER_COLLECTION_ID_EXISTS, "collection ID already exists"); REG_ERROR(ERROR_CLUSTER_COULD_NOT_CREATE_COLLECTION_IN_PLAN, "could not create collection in plan"); REG_ERROR(ERROR_CLUSTER_COULD_NOT_CREATE_COLLECTION, "could not create collection"); REG_ERROR(ERROR_CLUSTER_TIMEOUT, "timeout in cluster operation"); REG_ERROR(ERROR_CLUSTER_COULD_NOT_REMOVE_COLLECTION_IN_PLAN, "could not remove collection from plan"); REG_ERROR(ERROR_CLUSTER_COULD_NOT_REMOVE_COLLECTION_IN_CURRENT, "could not remove collection from current"); REG_ERROR(ERROR_CLUSTER_COULD_NOT_CREATE_DATABASE_IN_PLAN, "could not create database in plan"); REG_ERROR(ERROR_CLUSTER_COULD_NOT_CREATE_DATABASE, "could not create database"); REG_ERROR(ERROR_CLUSTER_COULD_NOT_REMOVE_DATABASE_IN_PLAN, "could not remove database from plan"); REG_ERROR(ERROR_CLUSTER_COULD_NOT_REMOVE_DATABASE_IN_CURRENT, "could not remove database from current"); REG_ERROR(ERROR_CLUSTER_SHARD_GONE, "no responsible shard found"); REG_ERROR(ERROR_CLUSTER_CONNECTION_LOST, "cluster internal HTTP connection broken"); REG_ERROR(ERROR_CLUSTER_MUST_NOT_SPECIFY_KEY, "must not specify _key for this collection"); REG_ERROR(ERROR_CLUSTER_GOT_CONTRADICTING_ANSWERS, "got contradicting answers from different shards"); REG_ERROR(ERROR_CLUSTER_NOT_ALL_SHARDING_ATTRIBUTES_GIVEN, "not all sharding attributes given"); REG_ERROR(ERROR_CLUSTER_MUST_NOT_CHANGE_SHARDING_ATTRIBUTES, "must not change the value of a shard key attribute"); REG_ERROR(ERROR_CLUSTER_UNSUPPORTED, "unsupported operation or parameter"); REG_ERROR(ERROR_CLUSTER_ONLY_ON_COORDINATOR, "this operation is only valid on a coordinator in a cluster"); REG_ERROR(ERROR_CLUSTER_READING_PLAN_AGENCY, "error reading Plan in agency"); REG_ERROR(ERROR_CLUSTER_COULD_NOT_TRUNCATE_COLLECTION, "could not truncate collection"); REG_ERROR(ERROR_CLUSTER_AQL_COMMUNICATION, "error in cluster internal communication for AQL"); REG_ERROR(ERROR_CLUSTER_ONLY_ON_DBSERVER, "this operation is only valid on a DBserver in a cluster"); REG_ERROR(ERROR_CLUSTER_BACKEND_UNAVAILABLE, "A cluster backend which was required for the operation could not be reached"); REG_ERROR(ERROR_CLUSTER_AQL_COLLECTION_OUT_OF_SYNC, "collection is out of sync"); REG_ERROR(ERROR_CLUSTER_COULD_NOT_CREATE_INDEX_IN_PLAN, "could not create index in plan"); REG_ERROR(ERROR_CLUSTER_COULD_NOT_DROP_INDEX_IN_PLAN, "could not drop index in plan"); REG_ERROR(ERROR_CLUSTER_CHAIN_OF_DISTRIBUTESHARDSLIKE, "chain of distributeShardsLike references"); REG_ERROR(ERROR_CLUSTER_MUST_NOT_DROP_COLL_OTHER_DISTRIBUTESHARDSLIKE, "must not drop collection while another has a distributeShardsLike attribute pointing to it"); REG_ERROR(ERROR_CLUSTER_UNKNOWN_DISTRIBUTESHARDSLIKE, "must not have a distributeShardsLike attribute pointing to an unknown collection"); REG_ERROR(ERROR_CLUSTER_INSUFFICIENT_DBSERVERS, "the number of current dbservers is lower than the requested replicationFactor"); REG_ERROR(ERROR_CLUSTER_COULD_NOT_DROP_FOLLOWER, "a follower could not be dropped in agency"); REG_ERROR(ERROR_CLUSTER_SHARD_LEADER_REFUSES_REPLICATION, "a shard leader refuses to perform a replication operation"); REG_ERROR(ERROR_CLUSTER_SHARD_FOLLOWER_REFUSES_OPERATION, "a shard follower refuses to perform an operation that is not a replication"); REG_ERROR(ERROR_CLUSTER_SHARD_LEADER_RESIGNED, "a (former) shard leader refuses to perform an operation, because it has resigned in the meantime"); REG_ERROR(ERROR_CLUSTER_AGENCY_COMMUNICATION_FAILED, "some agency operation failed"); REG_ERROR(ERROR_CLUSTER_LEADERSHIP_CHALLENGE_ONGOING, "leadership challenge is ongoing"); REG_ERROR(ERROR_CLUSTER_NOT_LEADER, "not a leader"); REG_ERROR(ERROR_CLUSTER_COULD_NOT_CREATE_VIEW_IN_PLAN, "could not create view in plan"); REG_ERROR(ERROR_CLUSTER_VIEW_ID_EXISTS, "view ID already exists"); REG_ERROR(ERROR_CLUSTER_COULD_NOT_DROP_COLLECTION, "could not drop collection in plan"); REG_ERROR(ERROR_QUERY_KILLED, "query killed"); REG_ERROR(ERROR_QUERY_PARSE, "%s"); REG_ERROR(ERROR_QUERY_EMPTY, "query is empty"); REG_ERROR(ERROR_QUERY_SCRIPT, "runtime error '%s'"); REG_ERROR(ERROR_QUERY_NUMBER_OUT_OF_RANGE, "number out of range"); REG_ERROR(ERROR_QUERY_INVALID_GEO_VALUE, "invalid geo coordinate value"); REG_ERROR(ERROR_QUERY_VARIABLE_NAME_INVALID, "variable name '%s' has an invalid format"); REG_ERROR(ERROR_QUERY_VARIABLE_REDECLARED, "variable '%s' is assigned multiple times"); REG_ERROR(ERROR_QUERY_VARIABLE_NAME_UNKNOWN, "unknown variable '%s'"); REG_ERROR(ERROR_QUERY_COLLECTION_LOCK_FAILED, "unable to read-lock collection %s"); REG_ERROR(ERROR_QUERY_TOO_MANY_COLLECTIONS, "too many collections/shards"); REG_ERROR(ERROR_QUERY_DOCUMENT_ATTRIBUTE_REDECLARED, "document attribute '%s' is assigned multiple times"); REG_ERROR(ERROR_QUERY_FUNCTION_NAME_UNKNOWN, "usage of unknown function '%s()'"); REG_ERROR(ERROR_QUERY_FUNCTION_ARGUMENT_NUMBER_MISMATCH, "invalid number of arguments for function '%s()', expected number of arguments: minimum: %d, maximum: %d"); REG_ERROR(ERROR_QUERY_FUNCTION_ARGUMENT_TYPE_MISMATCH, "invalid argument type in call to function '%s()'"); REG_ERROR(ERROR_QUERY_INVALID_REGEX, "invalid regex value"); REG_ERROR(ERROR_QUERY_BIND_PARAMETERS_INVALID, "invalid structure of bind parameters"); REG_ERROR(ERROR_QUERY_BIND_PARAMETER_MISSING, "no value specified for declared bind parameter '%s'"); REG_ERROR(ERROR_QUERY_BIND_PARAMETER_UNDECLARED, "bind parameter '%s' was not declared in the query"); REG_ERROR(ERROR_QUERY_BIND_PARAMETER_TYPE, "bind parameter '%s' has an invalid value or type"); REG_ERROR(ERROR_QUERY_INVALID_LOGICAL_VALUE, "invalid logical value"); REG_ERROR(ERROR_QUERY_INVALID_ARITHMETIC_VALUE, "invalid arithmetic value"); REG_ERROR(ERROR_QUERY_DIVISION_BY_ZERO, "division by zero"); REG_ERROR(ERROR_QUERY_ARRAY_EXPECTED, "array expected"); REG_ERROR(ERROR_QUERY_FAIL_CALLED, "FAIL(%s) called"); REG_ERROR(ERROR_QUERY_GEO_INDEX_MISSING, "no suitable geo index found for geo restriction on '%s'"); REG_ERROR(ERROR_QUERY_FULLTEXT_INDEX_MISSING, "no suitable fulltext index found for fulltext query on '%s'"); REG_ERROR(ERROR_QUERY_INVALID_DATE_VALUE, "invalid date value"); REG_ERROR(ERROR_QUERY_MULTI_MODIFY, "multi-modify query"); REG_ERROR(ERROR_QUERY_INVALID_AGGREGATE_EXPRESSION, "invalid aggregate expression"); REG_ERROR(ERROR_QUERY_COMPILE_TIME_OPTIONS, "query options must be readable at query compile time"); REG_ERROR(ERROR_QUERY_EXCEPTION_OPTIONS, "query options expected"); REG_ERROR(ERROR_QUERY_FORCED_INDEX_HINT_UNUSABLE, "could not use forced index hint"); REG_ERROR(ERROR_QUERY_DISALLOWED_DYNAMIC_CALL, "disallowed dynamic call to '%s'"); REG_ERROR(ERROR_QUERY_ACCESS_AFTER_MODIFICATION, "access after data-modification by %s"); REG_ERROR(ERROR_QUERY_FUNCTION_INVALID_NAME, "invalid user function name"); REG_ERROR(ERROR_QUERY_FUNCTION_INVALID_CODE, "invalid user function code"); REG_ERROR(ERROR_QUERY_FUNCTION_NOT_FOUND, "user function '%s()' not found"); REG_ERROR(ERROR_QUERY_FUNCTION_RUNTIME_ERROR, "user function runtime error: %s"); REG_ERROR(ERROR_QUERY_BAD_JSON_PLAN, "bad execution plan JSON"); REG_ERROR(ERROR_QUERY_NOT_FOUND, "query ID not found"); REG_ERROR(ERROR_QUERY_USER_ASSERT, "%s"); REG_ERROR(ERROR_QUERY_USER_WARN, "%s"); REG_ERROR(ERROR_CURSOR_NOT_FOUND, "cursor not found"); REG_ERROR(ERROR_CURSOR_BUSY, "cursor is busy"); REG_ERROR(ERROR_VALIDATION_FAILED, "schema validation failed"); REG_ERROR(ERROR_VALIDATION_BAD_PARAMETER, "invalid schema validation parameter"); REG_ERROR(ERROR_TRANSACTION_INTERNAL, "internal transaction error"); REG_ERROR(ERROR_TRANSACTION_NESTED, "nested transactions detected"); REG_ERROR(ERROR_TRANSACTION_UNREGISTERED_COLLECTION, "unregistered collection used in transaction"); REG_ERROR(ERROR_TRANSACTION_DISALLOWED_OPERATION, "disallowed operation inside transaction"); REG_ERROR(ERROR_TRANSACTION_ABORTED, "transaction aborted"); REG_ERROR(ERROR_TRANSACTION_NOT_FOUND, "transaction not found"); REG_ERROR(ERROR_USER_INVALID_NAME, "invalid user name"); REG_ERROR(ERROR_USER_DUPLICATE, "duplicate user"); REG_ERROR(ERROR_USER_NOT_FOUND, "user not found"); REG_ERROR(ERROR_USER_EXTERNAL, "user is external"); REG_ERROR(ERROR_SERVICE_DOWNLOAD_FAILED, "service download failed"); REG_ERROR(ERROR_SERVICE_UPLOAD_FAILED, "service upload failed"); REG_ERROR(ERROR_LDAP_CANNOT_INIT, "cannot init a LDAP connection"); REG_ERROR(ERROR_LDAP_CANNOT_SET_OPTION, "cannot set a LDAP option"); REG_ERROR(ERROR_LDAP_CANNOT_BIND, "cannot bind to a LDAP server"); REG_ERROR(ERROR_LDAP_CANNOT_UNBIND, "cannot unbind from a LDAP server"); REG_ERROR(ERROR_LDAP_CANNOT_SEARCH, "cannot issue a LDAP search"); REG_ERROR(ERROR_LDAP_CANNOT_START_TLS, "cannot start a TLS LDAP session"); REG_ERROR(ERROR_LDAP_FOUND_NO_OBJECTS, "LDAP didn't found any objects"); REG_ERROR(ERROR_LDAP_NOT_ONE_USER_FOUND, "LDAP found zero ore more than one user"); REG_ERROR(ERROR_LDAP_USER_NOT_IDENTIFIED, "LDAP found a user, but its not the desired one"); REG_ERROR(ERROR_LDAP_INVALID_MODE, "invalid ldap mode"); REG_ERROR(ERROR_TASK_INVALID_ID, "invalid task id"); REG_ERROR(ERROR_TASK_DUPLICATE_ID, "duplicate task id"); REG_ERROR(ERROR_TASK_NOT_FOUND, "task not found"); REG_ERROR(ERROR_GRAPH_INVALID_GRAPH, "invalid graph"); REG_ERROR(ERROR_GRAPH_COULD_NOT_CREATE_GRAPH, "could not create graph"); REG_ERROR(ERROR_GRAPH_INVALID_VERTEX, "invalid vertex"); REG_ERROR(ERROR_GRAPH_COULD_NOT_CREATE_VERTEX, "could not create vertex"); REG_ERROR(ERROR_GRAPH_COULD_NOT_CHANGE_VERTEX, "could not change vertex"); REG_ERROR(ERROR_GRAPH_INVALID_EDGE, "invalid edge"); REG_ERROR(ERROR_GRAPH_COULD_NOT_CREATE_EDGE, "could not create edge"); REG_ERROR(ERROR_GRAPH_COULD_NOT_CHANGE_EDGE, "could not change edge"); REG_ERROR(ERROR_GRAPH_TOO_MANY_ITERATIONS, "too many iterations - try increasing the value of 'maxIterations'"); REG_ERROR(ERROR_GRAPH_INVALID_FILTER_RESULT, "invalid filter result"); REG_ERROR(ERROR_GRAPH_COLLECTION_MULTI_USE, "multi use of edge collection in edge def"); REG_ERROR(ERROR_GRAPH_COLLECTION_USE_IN_MULTI_GRAPHS, "edge collection already used in edge def"); REG_ERROR(ERROR_GRAPH_CREATE_MISSING_NAME, "missing graph name"); REG_ERROR(ERROR_GRAPH_CREATE_MALFORMED_EDGE_DEFINITION, "malformed edge definition"); REG_ERROR(ERROR_GRAPH_NOT_FOUND, "graph '%s' not found"); REG_ERROR(ERROR_GRAPH_DUPLICATE, "graph already exists"); REG_ERROR(ERROR_GRAPH_VERTEX_COL_DOES_NOT_EXIST, "vertex collection does not exist or is not part of the graph"); REG_ERROR(ERROR_GRAPH_WRONG_COLLECTION_TYPE_VERTEX, "collection not a vertex collection"); REG_ERROR(ERROR_GRAPH_NOT_IN_ORPHAN_COLLECTION, "collection is not in list of orphan collections"); REG_ERROR(ERROR_GRAPH_COLLECTION_USED_IN_EDGE_DEF, "collection already used in edge def"); REG_ERROR(ERROR_GRAPH_EDGE_COLLECTION_NOT_USED, "edge collection not used in graph"); REG_ERROR(ERROR_GRAPH_NO_GRAPH_COLLECTION, "collection _graphs does not exist"); REG_ERROR(ERROR_GRAPH_INVALID_EXAMPLE_ARRAY_OBJECT_STRING, "Invalid example type. Has to be String, Array or Object"); REG_ERROR(ERROR_GRAPH_INVALID_EXAMPLE_ARRAY_OBJECT, "Invalid example type. Has to be Array or Object"); REG_ERROR(ERROR_GRAPH_INVALID_NUMBER_OF_ARGUMENTS, "Invalid number of arguments. Expected: "); REG_ERROR(ERROR_GRAPH_INVALID_PARAMETER, "Invalid parameter type."); REG_ERROR(ERROR_GRAPH_INVALID_ID, "Invalid id"); REG_ERROR(ERROR_GRAPH_COLLECTION_USED_IN_ORPHANS, "collection used in orphans"); REG_ERROR(ERROR_GRAPH_EDGE_COL_DOES_NOT_EXIST, "edge collection does not exist or is not part of the graph"); REG_ERROR(ERROR_GRAPH_EMPTY, "empty graph"); REG_ERROR(ERROR_GRAPH_INTERNAL_DATA_CORRUPT, "internal graph data corrupt"); REG_ERROR(ERROR_GRAPH_INTERNAL_EDGE_COLLECTION_ALREADY_SET, "edge collection already set"); REG_ERROR(ERROR_GRAPH_CREATE_MALFORMED_ORPHAN_LIST, "malformed orphan list"); REG_ERROR(ERROR_GRAPH_EDGE_DEFINITION_IS_DOCUMENT, "edge definition collection is a document collection"); REG_ERROR(ERROR_GRAPH_COLLECTION_IS_INITIAL, "initial collection is not allowed to be removed manually"); REG_ERROR(ERROR_GRAPH_NO_INITIAL_COLLECTION, "no valid initial collection found"); REG_ERROR(ERROR_SESSION_UNKNOWN, "unknown session"); REG_ERROR(ERROR_SESSION_EXPIRED, "session expired"); REG_ERROR(ERROR_SIMPLE_CLIENT_UNKNOWN_ERROR, "unknown client error"); REG_ERROR(ERROR_SIMPLE_CLIENT_COULD_NOT_CONNECT, "could not connect to server"); REG_ERROR(ERROR_SIMPLE_CLIENT_COULD_NOT_WRITE, "could not write to server"); REG_ERROR(ERROR_SIMPLE_CLIENT_COULD_NOT_READ, "could not read from server"); REG_ERROR(ERROR_WAS_ERLAUBE, "was erlaube?!"); REG_ERROR(ERROR_INTERNAL_AQL, "General internal AQL error"); REG_ERROR(ERROR_WROTE_TOO_FEW_OUTPUT_REGISTERS, "An AQL block wrote too few output registers"); REG_ERROR(ERROR_WROTE_TOO_MANY_OUTPUT_REGISTERS, "An AQL block wrote too many output registers"); REG_ERROR(ERROR_WROTE_OUTPUT_REGISTER_TWICE, "An AQL block wrote an output register twice"); REG_ERROR(ERROR_WROTE_IN_WRONG_REGISTER, "An AQL block wrote in a register that is not its output"); REG_ERROR(ERROR_INPUT_REGISTERS_NOT_COPIED, "An AQL block did not copy its input registers"); REG_ERROR(ERROR_MALFORMED_MANIFEST_FILE, "failed to parse manifest file"); REG_ERROR(ERROR_INVALID_SERVICE_MANIFEST, "manifest file is invalid"); REG_ERROR(ERROR_SERVICE_FILES_MISSING, "service files missing"); REG_ERROR(ERROR_SERVICE_FILES_OUTDATED, "service files outdated"); REG_ERROR(ERROR_INVALID_FOXX_OPTIONS, "service options are invalid"); REG_ERROR(ERROR_INVALID_MOUNTPOINT, "invalid mountpath"); REG_ERROR(ERROR_SERVICE_NOT_FOUND, "service not found"); REG_ERROR(ERROR_SERVICE_NEEDS_CONFIGURATION, "service needs configuration"); REG_ERROR(ERROR_SERVICE_MOUNTPOINT_CONFLICT, "service already exists"); REG_ERROR(ERROR_SERVICE_MANIFEST_NOT_FOUND, "missing manifest file"); REG_ERROR(ERROR_SERVICE_OPTIONS_MALFORMED, "failed to parse service options"); REG_ERROR(ERROR_SERVICE_SOURCE_NOT_FOUND, "source path not found"); REG_ERROR(ERROR_SERVICE_SOURCE_ERROR, "error resolving source"); REG_ERROR(ERROR_SERVICE_UNKNOWN_SCRIPT, "unknown script"); REG_ERROR(ERROR_SERVICE_API_DISABLED, "service api disabled"); REG_ERROR(ERROR_MODULE_NOT_FOUND, "cannot locate module"); REG_ERROR(ERROR_MODULE_SYNTAX_ERROR, "syntax error in module"); REG_ERROR(ERROR_MODULE_FAILURE, "failed to invoke module"); REG_ERROR(ERROR_NO_SMART_COLLECTION, "collection is not smart"); REG_ERROR(ERROR_NO_SMART_GRAPH_ATTRIBUTE, "smart graph attribute not given"); REG_ERROR(ERROR_CANNOT_DROP_SMART_COLLECTION, "cannot drop this smart collection"); REG_ERROR(ERROR_KEY_MUST_BE_PREFIXED_WITH_SMART_GRAPH_ATTRIBUTE, "in smart vertex collections _key must be prefixed with the value of the smart graph attribute"); REG_ERROR(ERROR_ILLEGAL_SMART_GRAPH_ATTRIBUTE, "attribute cannot be used as smart graph attribute"); REG_ERROR(ERROR_SMART_GRAPH_ATTRIBUTE_MISMATCH, "smart graph attribute mismatch"); REG_ERROR(ERROR_INVALID_SMART_JOIN_ATTRIBUTE, "invalid smart join attribute declaration"); REG_ERROR(ERROR_KEY_MUST_BE_PREFIXED_WITH_SMART_JOIN_ATTRIBUTE, "shard key value must be prefixed with the value of the smart join attribute"); REG_ERROR(ERROR_NO_SMART_JOIN_ATTRIBUTE, "smart join attribute not given or invalid"); REG_ERROR(ERROR_CLUSTER_MUST_NOT_CHANGE_SMART_JOIN_ATTRIBUTE, "must not change the value of the smartJoinAttribute"); REG_ERROR(ERROR_INVALID_DISJOINT_SMART_EDGE, "non disjoint edge found"); REG_ERROR(ERROR_CLUSTER_REPAIRS_FAILED, "error during cluster repairs"); REG_ERROR(ERROR_CLUSTER_REPAIRS_NOT_ENOUGH_HEALTHY, "not enough (healthy) db servers"); REG_ERROR(ERROR_CLUSTER_REPAIRS_REPLICATION_FACTOR_VIOLATED, "replication factor violated during cluster repairs"); REG_ERROR(ERROR_CLUSTER_REPAIRS_NO_DBSERVERS, "no dbservers during cluster repairs"); REG_ERROR(ERROR_CLUSTER_REPAIRS_MISMATCHING_LEADERS, "mismatching leaders during cluster repairs"); REG_ERROR(ERROR_CLUSTER_REPAIRS_MISMATCHING_FOLLOWERS, "mismatching followers during cluster repairs"); REG_ERROR(ERROR_CLUSTER_REPAIRS_INCONSISTENT_ATTRIBUTES, "inconsistent attributes during cluster repairs"); REG_ERROR(ERROR_CLUSTER_REPAIRS_MISMATCHING_SHARDS, "mismatching shards during cluster repairs"); REG_ERROR(ERROR_CLUSTER_REPAIRS_JOB_FAILED, "move shard job failed during cluster repairs"); REG_ERROR(ERROR_CLUSTER_REPAIRS_JOB_DISAPPEARED, "move shard job disappeared during cluster repairs"); REG_ERROR(ERROR_CLUSTER_REPAIRS_OPERATION_FAILED, "agency transaction failed during cluster repairs"); REG_ERROR(ERROR_AGENCY_INFORM_MUST_BE_OBJECT, "Inform message must be an object."); REG_ERROR(ERROR_AGENCY_INFORM_MUST_CONTAIN_TERM, "Inform message must contain uint parameter 'term'"); REG_ERROR(ERROR_AGENCY_INFORM_MUST_CONTAIN_ID, "Inform message must contain string parameter 'id'"); REG_ERROR(ERROR_AGENCY_INFORM_MUST_CONTAIN_ACTIVE, "Inform message must contain array 'active'"); REG_ERROR(ERROR_AGENCY_INFORM_MUST_CONTAIN_POOL, "Inform message must contain object 'pool'"); REG_ERROR(ERROR_AGENCY_INFORM_MUST_CONTAIN_MIN_PING, "Inform message must contain object 'min ping'"); REG_ERROR(ERROR_AGENCY_INFORM_MUST_CONTAIN_MAX_PING, "Inform message must contain object 'max ping'"); REG_ERROR(ERROR_AGENCY_INFORM_MUST_CONTAIN_TIMEOUT_MULT, "Inform message must contain object 'timeoutMult'"); REG_ERROR(ERROR_AGENCY_CANNOT_REBUILD_DBS, "Cannot rebuild readDB and spearHead"); REG_ERROR(ERROR_SUPERVISION_GENERAL_FAILURE, "general supervision failure"); REG_ERROR(ERROR_QUEUE_FULL, "named queue is full"); REG_ERROR(ERROR_ACTION_OPERATION_UNABORTABLE, "this maintenance action cannot be stopped"); REG_ERROR(ERROR_ACTION_UNFINISHED, "maintenance action still processing"); REG_ERROR(ERROR_NO_SUCH_ACTION, "no such maintenance action"); REG_ERROR(ERROR_HOT_BACKUP_INTERNAL, "internal hot backup error"); REG_ERROR(ERROR_HOT_RESTORE_INTERNAL, "internal hot restore error"); REG_ERROR(ERROR_BACKUP_TOPOLOGY, "backup does not match this topology"); REG_ERROR(ERROR_NO_SPACE_LEFT_ON_DEVICE, "no space left on device"); REG_ERROR(ERROR_FAILED_TO_UPLOAD_BACKUP, "failed to upload hot backup set to remote target"); REG_ERROR(ERROR_FAILED_TO_DOWNLOAD_BACKUP, "failed to download hot backup set from remote source"); REG_ERROR(ERROR_NO_SUCH_HOT_BACKUP, "no such hot backup set can be found"); REG_ERROR(ERROR_REMOTE_REPOSITORY_CONFIG_BAD, "remote hotback repository configuration error"); REG_ERROR(ERROR_LOCAL_LOCK_FAILED, "some db servers cannot be reached for transaction locks"); REG_ERROR(ERROR_LOCAL_LOCK_RETRY, "some db servers cannot be reached for transaction locks"); REG_ERROR(ERROR_HOT_BACKUP_CONFLICT, "hot backup conflict"); REG_ERROR(ERROR_HOT_BACKUP_DBSERVERS_AWOL, "hot backup not all db servers reachable"); REG_ERROR(ERROR_CLUSTER_COULD_NOT_MODIFY_ANALYZERS_IN_PLAN, "analyzers in plan could not be modified"); }
{ "pile_set_name": "Github" }
/* * Copyright 2015-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with * the License. A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file 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. */ package com.amazonaws.services.kinesisanalytics.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.protocol.StructuredPojo; import com.amazonaws.protocol.ProtocolMarshaller; /** * <p> * Describes the record format and relevant mapping information that should be applied to schematize the records on the * stream. * </p> * * @see <a href="http://docs.aws.amazon.com/goto/WebAPI/kinesisanalytics-2015-08-14/RecordFormat" target="_top">AWS API * Documentation</a> */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class RecordFormat implements Serializable, Cloneable, StructuredPojo { /** * <p> * The type of record format. * </p> */ private String recordFormatType; /** * <p> * When configuring application input at the time of creating or updating an application, provides additional * mapping information specific to the record format (such as JSON, CSV, or record fields delimited by some * delimiter) on the streaming source. * </p> */ private MappingParameters mappingParameters; /** * <p> * The type of record format. * </p> * * @param recordFormatType * The type of record format. * @see RecordFormatType */ public void setRecordFormatType(String recordFormatType) { this.recordFormatType = recordFormatType; } /** * <p> * The type of record format. * </p> * * @return The type of record format. * @see RecordFormatType */ public String getRecordFormatType() { return this.recordFormatType; } /** * <p> * The type of record format. * </p> * * @param recordFormatType * The type of record format. * @return Returns a reference to this object so that method calls can be chained together. * @see RecordFormatType */ public RecordFormat withRecordFormatType(String recordFormatType) { setRecordFormatType(recordFormatType); return this; } /** * <p> * The type of record format. * </p> * * @param recordFormatType * The type of record format. * @see RecordFormatType */ public void setRecordFormatType(RecordFormatType recordFormatType) { withRecordFormatType(recordFormatType); } /** * <p> * The type of record format. * </p> * * @param recordFormatType * The type of record format. * @return Returns a reference to this object so that method calls can be chained together. * @see RecordFormatType */ public RecordFormat withRecordFormatType(RecordFormatType recordFormatType) { this.recordFormatType = recordFormatType.toString(); return this; } /** * <p> * When configuring application input at the time of creating or updating an application, provides additional * mapping information specific to the record format (such as JSON, CSV, or record fields delimited by some * delimiter) on the streaming source. * </p> * * @param mappingParameters * When configuring application input at the time of creating or updating an application, provides additional * mapping information specific to the record format (such as JSON, CSV, or record fields delimited by some * delimiter) on the streaming source. */ public void setMappingParameters(MappingParameters mappingParameters) { this.mappingParameters = mappingParameters; } /** * <p> * When configuring application input at the time of creating or updating an application, provides additional * mapping information specific to the record format (such as JSON, CSV, or record fields delimited by some * delimiter) on the streaming source. * </p> * * @return When configuring application input at the time of creating or updating an application, provides * additional mapping information specific to the record format (such as JSON, CSV, or record fields * delimited by some delimiter) on the streaming source. */ public MappingParameters getMappingParameters() { return this.mappingParameters; } /** * <p> * When configuring application input at the time of creating or updating an application, provides additional * mapping information specific to the record format (such as JSON, CSV, or record fields delimited by some * delimiter) on the streaming source. * </p> * * @param mappingParameters * When configuring application input at the time of creating or updating an application, provides additional * mapping information specific to the record format (such as JSON, CSV, or record fields delimited by some * delimiter) on the streaming source. * @return Returns a reference to this object so that method calls can be chained together. */ public RecordFormat withMappingParameters(MappingParameters mappingParameters) { setMappingParameters(mappingParameters); return this; } /** * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be * redacted from this string using a placeholder value. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getRecordFormatType() != null) sb.append("RecordFormatType: ").append(getRecordFormatType()).append(","); if (getMappingParameters() != null) sb.append("MappingParameters: ").append(getMappingParameters()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof RecordFormat == false) return false; RecordFormat other = (RecordFormat) obj; if (other.getRecordFormatType() == null ^ this.getRecordFormatType() == null) return false; if (other.getRecordFormatType() != null && other.getRecordFormatType().equals(this.getRecordFormatType()) == false) return false; if (other.getMappingParameters() == null ^ this.getMappingParameters() == null) return false; if (other.getMappingParameters() != null && other.getMappingParameters().equals(this.getMappingParameters()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getRecordFormatType() == null) ? 0 : getRecordFormatType().hashCode()); hashCode = prime * hashCode + ((getMappingParameters() == null) ? 0 : getMappingParameters().hashCode()); return hashCode; } @Override public RecordFormat clone() { try { return (RecordFormat) super.clone(); } catch (CloneNotSupportedException e) { throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e); } } @com.amazonaws.annotation.SdkInternalApi @Override public void marshall(ProtocolMarshaller protocolMarshaller) { com.amazonaws.services.kinesisanalytics.model.transform.RecordFormatMarshaller.getInstance().marshall(this, protocolMarshaller); } }
{ "pile_set_name": "Github" }
--- title: "rewind" ms.date: "4/2/2020" api_name: ["rewind", "_o_rewind"] api_location: ["msvcrt.dll", "msvcr80.dll", "msvcr90.dll", "msvcr100.dll", "msvcr100_clr0400.dll", "msvcr110.dll", "msvcr110_clr0400.dll", "msvcr120.dll", "msvcr120_clr0400.dll", "ucrtbase.dll", "api-ms-win-crt-stdio-l1-1-0.dll", "api-ms-win-crt-private-l1-1-0.dll"] api_type: ["DLLExport"] topic_type: ["apiref"] f1_keywords: ["rewind"] helpviewer_keywords: ["rewind function", "repositioning file pointers", "file pointers [C++], repositioning", "file pointers [C++]"] ms.assetid: 1a460ce1-28d8-4b5e-83a6-633dca29c28a --- # rewind Repositions the file pointer to the beginning of a file. ## Syntax ```C void rewind( FILE *stream ); ``` ### Parameters *stream*<br/> Pointer to **FILE** structure. ## Remarks The **rewind** function repositions the file pointer associated with *stream* to the beginning of the file. A call to **rewind** is similar to **(void) fseek(** _stream_**, 0L, SEEK_SET );** However, unlike [fseek](fseek-fseeki64.md), **rewind** clears the error indicators for the stream as well as the end-of-file indicator. Also, unlike [fseek](fseek-fseeki64.md), **rewind** does not return a value to indicate whether the pointer was successfully moved. To clear the keyboard buffer, use **rewind** with the stream **stdin**, which is associated with the keyboard by default. If stream is a **NULL** pointer, the invalid parameter handler is invoked, as described in [Parameter Validation](../../c-runtime-library/parameter-validation.md). If execution is allowed to continue, this function returns and **errno** is set to **EINVAL**. For information on these and other error codes, see [_doserrno, errno, _sys_errlist, and _sys_nerr](../../c-runtime-library/errno-doserrno-sys-errlist-and-sys-nerr.md). By default, this function's global state is scoped to the application. To change this, see [Global state in the CRT](../global-state.md). ## Requirements |Routine|Required header| |-------------|---------------------| |**rewind**|\<stdio.h>| For additional compatibility information, see [Compatibility](../../c-runtime-library/compatibility.md). ## Libraries All versions of the [C run-time libraries](../../c-runtime-library/crt-library-features.md). ## Example ```C // crt_rewind.c /* This program first opens a file named * crt_rewind.out for input and output and writes two * integers to the file. Next, it uses rewind to * reposition the file pointer to the beginning of * the file and reads the data back in. */ #include <stdio.h> int main( void ) { FILE *stream; int data1, data2; data1 = 1; data2 = -37; fopen_s( &stream, "crt_rewind.out", "w+" ); if( stream != NULL ) { fprintf( stream, "%d %d", data1, data2 ); printf( "The values written are: %d and %d\n", data1, data2 ); rewind( stream ); fscanf_s( stream, "%d %d", &data1, &data2 ); printf( "The values read are: %d and %d\n", data1, data2 ); fclose( stream ); } } ``` ### Output ```Output The values written are: 1 and -37 The values read are: 1 and -37 ``` ## See also [Stream I/O](../../c-runtime-library/stream-i-o.md)<br/>
{ "pile_set_name": "Github" }
module Admin class TeamsController < Fae::BaseController private def use_pagination true end end end
{ "pile_set_name": "Github" }
/* * Copyright 2019 Google LLC * * 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 * * https://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. */ using System.Collections; using System.Collections.Generic; using UnityEngine; namespace BehaviorUX { public class SoundField : PropertyField { [SerializeField] TMPro.TextMeshProUGUI label; [SerializeField] TMPro.TMP_Dropdown dropdown; SoundEffectSystem sfxSystem; private List<string> sfxIdValues = new List<string>(); public delegate void OnValueChanged(string value); public event OnValueChanged onValueChanged; protected override void Initialize() { label.text = editor.labelForDisplay; Util.FindIfNotSet(this, ref sfxSystem); dropdown.onValueChanged.AddListener(OnDropdownValueChanged); sfxSystem.onSoundEffectChanged += (p) => RefreshValues(); sfxSystem.onSoundEffectRemoved += (p) => RefreshValues(); RefreshValues(); } private void OnDropdownValueChanged(int i) { string newId = sfxIdValues[i]; editor.SetData(newId); onValueChanged?.Invoke(newId); } private void RefreshValues() { dropdown.onValueChanged.RemoveListener(OnDropdownValueChanged); dropdown.ClearOptions(); sfxIdValues.Clear(); List<TMPro.TMP_Dropdown.OptionData> data = new List<TMPro.TMP_Dropdown.OptionData>(); data.Add(new TMPro.TMP_Dropdown.OptionData("(none)")); sfxIdValues.Add(null); foreach (SoundEffectListing listing in sfxSystem.ListAll()) { data.Add(new TMPro.TMP_Dropdown.OptionData(listing.name)); sfxIdValues.Add(listing.id); } dropdown.options = data; string pfxId = (string)editor.data; int index = sfxIdValues.IndexOf(pfxId); if (index < 0) { dropdown.value = 0; } dropdown.onValueChanged.AddListener(OnDropdownValueChanged); } private void Update() { string sfxId = (string)editor.data; if (!string.IsNullOrEmpty(sfxId) && sfxSystem.GetSoundEffect(sfxId) == null) { sfxId = null; } dropdown.onValueChanged.RemoveListener(OnDropdownValueChanged); dropdown.value = sfxIdValues.IndexOf(sfxId); dropdown.onValueChanged.AddListener(OnDropdownValueChanged); } } }
{ "pile_set_name": "Github" }
# frozen_string_literal: true RSpec.describe TTY::Table::Renderer, '#select' do let(:klass) { ::Class.new } let(:instance) { described_class } subject { instance.select(renderer) } context 'with basic' do let(:renderer) { :basic } it { is_expected.to be(TTY::Table::Renderer::Basic) } end context 'with unicode' do let(:renderer) { :unicode } it { is_expected.to be(TTY::Table::Renderer::Unicode) } end end
{ "pile_set_name": "Github" }
#### phantomjs properties #### # the host and port phantomjs listens to host = 127.0.0.1 port = 7777 # location of the phantomjs executable, could be for example /usr/local/bin/phantomjs exec = /usr/local/bin/phantomjs # specify here an alternative location (the whole path!) for the script that starts an Phantomjs server. F.eks /home/bert/scripts/my-highcharts-convert.js # Leave empty if you're using the script bundled with the export-server. script = #### connect properties used to connect with phantomjs running as HTTP-server #### # all values in milliseconds # specifies the timeout when reading from phantomjs when a connection is established readTimeout = 6000 # timeout to be used when opening a communications link to the phantomjs server connectTimeout = 500 # the whole request to the phantomjs server is scheduled, max timeout can last to this value. This is because in java you can't rely on the above two timeouts. maxTimeout = 6500 #### Pool properties #### # number of phantomjs servers you can run in the pool. poolSize = 10 # The pool is implemented as a BlockingQueue. When asking for a phantom server connection and nothing is available, it waits for the number of milliseconds defined by maxWait maxWait = 1000 # Keep files in the temp folder for a certain retentionTime, defined in miliseconds retentionTime = 60000
{ "pile_set_name": "Github" }
ffi_sources = """ src/prep_cif.c src/closures.c """.split() ffi_platforms = { 'MIPS_IRIX': ['src/mips/ffi.c', 'src/mips/o32.S', 'src/mips/n32.S'], 'MIPS_LINUX': ['src/mips/ffi.c', 'src/mips/o32.S'], 'X86': ['src/x86/ffi.c', 'src/x86/sysv.S'], 'X86_FREEBSD': ['src/x86/ffi.c', 'src/x86/freebsd.S'], 'X86_WIN32': ['src/x86/ffi.c', 'src/x86/win32.S'], 'SPARC': ['src/sparc/ffi.c', 'src/sparc/v8.S', 'src/sparc/v9.S'], 'ALPHA': ['src/alpha/ffi.c', 'src/alpha/osf.S'], 'IA64': ['src/ia64/ffi.c', 'src/ia64/unix.S'], 'M32R': ['src/m32r/sysv.S', 'src/m32r/ffi.c'], 'M68K': ['src/m68k/ffi.c', 'src/m68k/sysv.S'], 'POWERPC': ['src/powerpc/ffi.c', 'src/powerpc/sysv.S', 'src/powerpc/ppc_closure.S', 'src/powerpc/linux64.S', 'src/powerpc/linux64_closure.S'], 'POWERPC_AIX': ['src/powerpc/ffi_darwin.c', 'src/powerpc/aix.S', 'src/powerpc/aix_closure.S'], 'POWERPC_FREEBSD': ['src/powerpc/ffi.c', 'src/powerpc/sysv.S', 'src/powerpc/ppc_closure.S'], 'ARM': ['src/arm/sysv.S', 'src/arm/ffi.c'], 'LIBFFI_CRIS': ['src/cris/sysv.S', 'src/cris/ffi.c'], 'FRV': ['src/frv/eabi.S', 'src/frv/ffi.c'], 'S390': ['src/s390/sysv.S', 'src/s390/ffi.c'], 'X86_64': ['src/x86/ffi64.c', 'src/x86/unix64.S', 'src/x86/ffi.c', 'src/x86/sysv.S'], 'SH': ['src/sh/sysv.S', 'src/sh/ffi.c'], 'SH64': ['src/sh64/sysv.S', 'src/sh64/ffi.c'], 'PA': ['src/pa/linux.S', 'src/pa/ffi.c'], 'PA_LINUX': ['src/pa/linux.S', 'src/pa/ffi.c'], 'PA_HPUX': ['src/pa/hpux32.S', 'src/pa/ffi.c'], } ffi_sources += ffi_platforms['@TARGET@'] ffi_cflags = '@CFLAGS@'
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="iso-8859-1"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <!-- qtpropertymanager.cpp --> <head> <title>QtSizeFPropertyManager Class Reference</title> <link href="classic.css" rel="stylesheet" type="text/css" /> </head> <body> <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tr> <td align="left" valign="top" width="32"><img src="images/qt-logo.png" align="left" width="57" height="67" border="0" /></td> <td width="1">&nbsp;&nbsp;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a></td> </tr></table><h1 class="title">QtSizeFPropertyManager Class Reference</h1> <p>The QtSizeFPropertyManager provides and manages <a href="http://qt.nokia.com/doc/4.6/qsizef.html">QSizeF</a> properties. <a href="#details">More...</a></p> <pre> #include &lt;QtSizeFPropertyManager&gt;</pre><p>Inherits <a href="qtabstractpropertymanager.html">QtAbstractPropertyManager</a>.</p> <ul> <li><a href="qtsizefpropertymanager-members.html">List of all members, including inherited members</a></li> </ul> <hr /> <a name="public-functions"></a> <h2>Public Functions</h2> <table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%"> <tr><td class="memItemLeft" align="right" valign="top"></td><td class="memItemRight" valign="bottom"><b><a href="qtsizefpropertymanager.html#QtSizeFPropertyManager">QtSizeFPropertyManager</a></b> ( QObject * <i>parent</i> = 0 )</td></tr> <tr><td class="memItemLeft" align="right" valign="top"></td><td class="memItemRight" valign="bottom"><b><a href="qtsizefpropertymanager.html#dtor.QtSizeFPropertyManager">~QtSizeFPropertyManager</a></b> ()</td></tr> <tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><b><a href="qtsizefpropertymanager.html#decimals">decimals</a></b> ( const QtProperty * <i>property</i> ) const</td></tr> <tr><td class="memItemLeft" align="right" valign="top">QSizeF </td><td class="memItemRight" valign="bottom"><b><a href="qtsizefpropertymanager.html#maximum">maximum</a></b> ( const QtProperty * <i>property</i> ) const</td></tr> <tr><td class="memItemLeft" align="right" valign="top">QSizeF </td><td class="memItemRight" valign="bottom"><b><a href="qtsizefpropertymanager.html#minimum">minimum</a></b> ( const QtProperty * <i>property</i> ) const</td></tr> <tr><td class="memItemLeft" align="right" valign="top">QtDoublePropertyManager * </td><td class="memItemRight" valign="bottom"><b><a href="qtsizefpropertymanager.html#subDoublePropertyManager">subDoublePropertyManager</a></b> () const</td></tr> <tr><td class="memItemLeft" align="right" valign="top">QSizeF </td><td class="memItemRight" valign="bottom"><b><a href="qtsizefpropertymanager.html#value">value</a></b> ( const QtProperty * <i>property</i> ) const</td></tr> </table> <ul> <li><div bar="2" class="fn"></div>3 public functions inherited from <a href="qtabstractpropertymanager.html#public-functions">QtAbstractPropertyManager</a></li> <li><div bar="2" class="fn"></div>29 public functions inherited from <a href="http://qt.nokia.com/doc/4.6/qobject.html#public-functions">QObject</a></li> </ul> <hr /> <a name="public-slots"></a> <h2>Public Slots</h2> <table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%"> <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qtsizefpropertymanager.html#setDecimals">setDecimals</a></b> ( QtProperty * <i>property</i>, int <i>prec</i> )</td></tr> <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qtsizefpropertymanager.html#setMaximum">setMaximum</a></b> ( QtProperty * <i>property</i>, const QSizeF &amp; <i>maxVal</i> )</td></tr> <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qtsizefpropertymanager.html#setMinimum">setMinimum</a></b> ( QtProperty * <i>property</i>, const QSizeF &amp; <i>minVal</i> )</td></tr> <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qtsizefpropertymanager.html#setRange">setRange</a></b> ( QtProperty * <i>property</i>, const QSizeF &amp; <i>minimum</i>, const QSizeF &amp; <i>maximum</i> )</td></tr> <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qtsizefpropertymanager.html#setValue">setValue</a></b> ( QtProperty * <i>property</i>, const QSizeF &amp; <i>value</i> )</td></tr> </table> <ul> <li><div bar="2" class="fn"></div>1 public slot inherited from <a href="http://qt.nokia.com/doc/4.6/qobject.html#public-slots">QObject</a></li> </ul> <hr /> <a name="signals"></a> <h2>Signals</h2> <table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%"> <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qtsizefpropertymanager.html#decimalsChanged">decimalsChanged</a></b> ( QtProperty * <i>property</i>, int <i>prec</i> )</td></tr> <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qtsizefpropertymanager.html#rangeChanged">rangeChanged</a></b> ( QtProperty * <i>property</i>, const QSizeF &amp; <i>minimum</i>, const QSizeF &amp; <i>maximum</i> )</td></tr> <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qtsizefpropertymanager.html#valueChanged">valueChanged</a></b> ( QtProperty * <i>property</i>, const QSizeF &amp; <i>value</i> )</td></tr> </table> <ul> <li><div bar="2" class="fn"></div>4 signals inherited from <a href="qtabstractpropertymanager.html#signals">QtAbstractPropertyManager</a></li> <li><div bar="2" class="fn"></div>1 signal inherited from <a href="http://qt.nokia.com/doc/4.6/qobject.html#signals">QObject</a></li> </ul> <hr /> <a name="reimplemented-protected-functions"></a> <h2>Reimplemented Protected Functions</h2> <table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%"> <tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b><a href="qtsizefpropertymanager.html#initializeProperty">initializeProperty</a></b> ( QtProperty * <i>property</i> )</td></tr> <tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b><a href="qtsizefpropertymanager.html#uninitializeProperty">uninitializeProperty</a></b> ( QtProperty * <i>property</i> )</td></tr> <tr><td class="memItemLeft" align="right" valign="top">virtual QString </td><td class="memItemRight" valign="bottom"><b><a href="qtsizefpropertymanager.html#valueText">valueText</a></b> ( const QtProperty * <i>property</i> ) const</td></tr> </table> <ul> <li><div bar="2" class="fn"></div>6 protected functions inherited from <a href="qtabstractpropertymanager.html#protected-functions">QtAbstractPropertyManager</a></li> <li><div bar="2" class="fn"></div>7 protected functions inherited from <a href="http://qt.nokia.com/doc/4.6/qobject.html#protected-functions">QObject</a></li> </ul> <h3>Additional Inherited Members</h3> <ul> <li><div class="fn"></div>1 property inherited from <a href="http://qt.nokia.com/doc/4.6/qobject.html#properties">QObject</a></li> <li><div class="fn"></div>1 public type inherited from <a href="http://qt.nokia.com/doc/4.6/qobject.html#public-variables">QObject</a></li> <li><div class="fn"></div>4 static public members inherited from <a href="http://qt.nokia.com/doc/4.6/qobject.html#static-public-members">QObject</a></li> <li><div class="fn"></div>6 protected functions inherited from <a href="qtabstractpropertymanager.html#protected-functions">QtAbstractPropertyManager</a></li> <li><div class="fn"></div>7 protected functions inherited from <a href="http://qt.nokia.com/doc/4.6/qobject.html#protected-functions">QObject</a></li> <li><div class="fn"></div>2 protected variables inherited from <a href="http://qt.nokia.com/doc/4.6/qobject.html#protected-variables">QObject</a></li> </ul> <a name="details"></a> <hr /> <h2>Detailed Description</h2> <p>The QtSizeFPropertyManager provides and manages <a href="http://qt.nokia.com/doc/4.6/qsizef.html">QSizeF</a> properties.</p> <p>A size property has nested <i>width</i> and <i>height</i> subproperties. The top-level property's value can be retrieved using the <a href="qtsizefpropertymanager.html#value">value</a>() function, and set using the <a href="qtsizefpropertymanager.html#setValue">setValue</a>() slot.</p> <p>The subproperties are created by a <a href="qtdoublepropertymanager.html">QtDoublePropertyManager</a> object. This manager can be retrieved using the <a href="qtsizefpropertymanager.html#subDoublePropertyManager">subDoublePropertyManager</a>() function. In order to provide editing widgets for the subproperties in a property browser widget, this manager must be associated with an editor factory.</p> <p>A size property also has a range of valid values defined by a minimum size and a maximum size. These sizes can be retrieved using the <a href="qtsizefpropertymanager.html#minimum">minimum</a>() and the <a href="qtsizefpropertymanager.html#maximum">maximum</a>() functions, and set using the <a href="qtsizefpropertymanager.html#setMinimum">setMinimum</a>() and <a href="qtsizefpropertymanager.html#setMaximum">setMaximum</a>() slots. Alternatively, the range can be defined in one go using the <a href="qtsizefpropertymanager.html#setRange">setRange</a>() slot.</p> <p>In addition, QtSizeFPropertyManager provides the <a href="qtsizefpropertymanager.html#valueChanged">valueChanged</a>() signal which is emitted whenever a property created by this manager changes, and the <a href="qtsizefpropertymanager.html#rangeChanged">rangeChanged</a>() signal which is emitted whenever such a property changes its range of valid sizes.</p> <p>See also <a href="qtabstractpropertymanager.html">QtAbstractPropertyManager</a>, <a href="qtdoublepropertymanager.html">QtDoublePropertyManager</a>, and <a href="qtsizepropertymanager.html">QtSizePropertyManager</a>.</p> <hr /> <h2>Member Function Documentation</h2> <h3 class="fn"><a name="QtSizeFPropertyManager"></a>QtSizeFPropertyManager::QtSizeFPropertyManager ( <a href="http://qt.nokia.com/doc/4.6/qobject.html">QObject</a> * <i>parent</i> = 0 )</h3> <p>Creates a manager with the given <i>parent</i>.</p> <h3 class="fn"><a name="dtor.QtSizeFPropertyManager"></a>QtSizeFPropertyManager::~QtSizeFPropertyManager ()</h3> <p>Destroys this manager, and all the properties it has created.</p> <h3 class="fn"><a name="decimals"></a>int QtSizeFPropertyManager::decimals ( const <a href="qtproperty.html">QtProperty</a> * <i>property</i> ) const</h3> <p>Returns the given <i>property</i>'s precision, in decimals.</p> <p>See also <a href="qtsizefpropertymanager.html#setDecimals">setDecimals</a>().</p> <h3 class="fn"><a name="decimalsChanged"></a>void QtSizeFPropertyManager::decimalsChanged ( <a href="qtproperty.html">QtProperty</a> * <i>property</i>, int <i>prec</i> )&nbsp;&nbsp;<tt> [signal]</tt></h3> <p>This signal is emitted whenever a property created by this manager changes its precision of value, passing a pointer to the <i>property</i> and the new <i>prec</i> value</p> <p>See also <a href="qtsizefpropertymanager.html#setDecimals">setDecimals</a>().</p> <h3 class="fn"><a name="initializeProperty"></a>void QtSizeFPropertyManager::initializeProperty ( <a href="qtproperty.html">QtProperty</a> * <i>property</i> )&nbsp;&nbsp;<tt> [virtual protected]</tt></h3> <p>Reimplemented from <a href="qtabstractpropertymanager.html#initializeProperty">QtAbstractPropertyManager::initializeProperty</a>().</p> <h3 class="fn"><a name="maximum"></a><a href="http://qt.nokia.com/doc/4.6/qsizef.html">QSizeF</a> QtSizeFPropertyManager::maximum ( const <a href="qtproperty.html">QtProperty</a> * <i>property</i> ) const</h3> <p>Returns the given <i>property</i>'s maximum size value.</p> <p>See also <a href="qtsizefpropertymanager.html#setMaximum">setMaximum</a>(), <a href="qtsizefpropertymanager.html#minimum">minimum</a>(), and <a href="qtsizefpropertymanager.html#setRange">setRange</a>().</p> <h3 class="fn"><a name="minimum"></a><a href="http://qt.nokia.com/doc/4.6/qsizef.html">QSizeF</a> QtSizeFPropertyManager::minimum ( const <a href="qtproperty.html">QtProperty</a> * <i>property</i> ) const</h3> <p>Returns the given <i>property</i>'s minimum size value.</p> <p>See also <a href="qtsizefpropertymanager.html#setMinimum">setMinimum</a>(), <a href="qtsizefpropertymanager.html#maximum">maximum</a>(), and <a href="qtsizefpropertymanager.html#setRange">setRange</a>().</p> <h3 class="fn"><a name="rangeChanged"></a>void QtSizeFPropertyManager::rangeChanged ( <a href="qtproperty.html">QtProperty</a> * <i>property</i>, const <a href="http://qt.nokia.com/doc/4.6/qsizef.html">QSizeF</a> &amp; <i>minimum</i>, const <a href="http://qt.nokia.com/doc/4.6/qsizef.html">QSizeF</a> &amp; <i>maximum</i> )&nbsp;&nbsp;<tt> [signal]</tt></h3> <p>This signal is emitted whenever a property created by this manager changes its range of valid sizes, passing a pointer to the <i>property</i> and the new <i>minimum</i> and <i>maximum</i> sizes.</p> <p>See also <a href="qtsizefpropertymanager.html#setRange">setRange</a>().</p> <h3 class="fn"><a name="setDecimals"></a>void QtSizeFPropertyManager::setDecimals ( <a href="qtproperty.html">QtProperty</a> * <i>property</i>, int <i>prec</i> )&nbsp;&nbsp;<tt> [slot]</tt></h3> <p>Sets the precision of the given <i>property</i> to <i>prec</i>.</p> <p>The valid decimal range is 0-13. The default is 2.</p> <p>See also <a href="qtsizefpropertymanager.html#decimals">decimals</a>().</p> <h3 class="fn"><a name="setMaximum"></a>void QtSizeFPropertyManager::setMaximum ( <a href="qtproperty.html">QtProperty</a> * <i>property</i>, const <a href="http://qt.nokia.com/doc/4.6/qsizef.html">QSizeF</a> &amp; <i>maxVal</i> )&nbsp;&nbsp;<tt> [slot]</tt></h3> <p>Sets the maximum size value for the given <i>property</i> to <i>maxVal</i>.</p> <p>When setting the maximum size value, the minimum and current values are adjusted if necessary (ensuring that the size range remains valid and that the current value is within the range).</p> <p>See also <a href="qtsizefpropertymanager.html#maximum">maximum</a>(), <a href="qtsizefpropertymanager.html#setRange">setRange</a>(), and <a href="qtsizefpropertymanager.html#rangeChanged">rangeChanged</a>().</p> <h3 class="fn"><a name="setMinimum"></a>void QtSizeFPropertyManager::setMinimum ( <a href="qtproperty.html">QtProperty</a> * <i>property</i>, const <a href="http://qt.nokia.com/doc/4.6/qsizef.html">QSizeF</a> &amp; <i>minVal</i> )&nbsp;&nbsp;<tt> [slot]</tt></h3> <p>Sets the minimum size value for the given <i>property</i> to <i>minVal</i>.</p> <p>When setting the minimum size value, the maximum and current values are adjusted if necessary (ensuring that the size range remains valid and that the current value is within the range).</p> <p>See also <a href="qtsizefpropertymanager.html#minimum">minimum</a>(), <a href="qtsizefpropertymanager.html#setRange">setRange</a>(), and <a href="qtsizefpropertymanager.html#rangeChanged">rangeChanged</a>().</p> <h3 class="fn"><a name="setRange"></a>void QtSizeFPropertyManager::setRange ( <a href="qtproperty.html">QtProperty</a> * <i>property</i>, const <a href="http://qt.nokia.com/doc/4.6/qsizef.html">QSizeF</a> &amp; <i>minimum</i>, const <a href="http://qt.nokia.com/doc/4.6/qsizef.html">QSizeF</a> &amp; <i>maximum</i> )&nbsp;&nbsp;<tt> [slot]</tt></h3> <p>Sets the range of valid values.</p> <p>This is a convenience function defining the range of valid values in one go; setting the <i>minimum</i> and <i>maximum</i> values for the given <i>property</i> with a single function call.</p> <p>When setting a new range, the current value is adjusted if necessary (ensuring that the value remains within the range).</p> <p>See also <a href="qtsizefpropertymanager.html#setMinimum">setMinimum</a>(), <a href="qtsizefpropertymanager.html#setMaximum">setMaximum</a>(), and <a href="qtsizefpropertymanager.html#rangeChanged">rangeChanged</a>().</p> <h3 class="fn"><a name="setValue"></a>void QtSizeFPropertyManager::setValue ( <a href="qtproperty.html">QtProperty</a> * <i>property</i>, const <a href="http://qt.nokia.com/doc/4.6/qsizef.html">QSizeF</a> &amp; <i>value</i> )&nbsp;&nbsp;<tt> [slot]</tt></h3> <p>Sets the value of the given <i>property</i> to <i>value</i>.</p> <p>If the specified <i>value</i> is not valid according to the given <i>property</i>'s size range, the <i>value</i> is adjusted to the nearest valid value within the size range.</p> <p>See also <a href="qtsizefpropertymanager.html#value">value</a>(), <a href="qtsizefpropertymanager.html#setRange">setRange</a>(), and <a href="qtsizefpropertymanager.html#valueChanged">valueChanged</a>().</p> <h3 class="fn"><a name="subDoublePropertyManager"></a><a href="qtdoublepropertymanager.html">QtDoublePropertyManager</a> * QtSizeFPropertyManager::subDoublePropertyManager () const</h3> <p>Returns the manager that creates the nested <i>width</i> and <i>height</i> subproperties.</p> <p>In order to provide editing widgets for the <i>width</i> and <i>height</i> properties in a property browser widget, this manager must be associated with an editor factory.</p> <p>See also <a href="qtabstractpropertybrowser.html#setFactoryForManager">QtAbstractPropertyBrowser::setFactoryForManager</a>().</p> <h3 class="fn"><a name="uninitializeProperty"></a>void QtSizeFPropertyManager::uninitializeProperty ( <a href="qtproperty.html">QtProperty</a> * <i>property</i> )&nbsp;&nbsp;<tt> [virtual protected]</tt></h3> <p>Reimplemented from <a href="qtabstractpropertymanager.html#uninitializeProperty">QtAbstractPropertyManager::uninitializeProperty</a>().</p> <h3 class="fn"><a name="value"></a><a href="http://qt.nokia.com/doc/4.6/qsizef.html">QSizeF</a> QtSizeFPropertyManager::value ( const <a href="qtproperty.html">QtProperty</a> * <i>property</i> ) const</h3> <p>Returns the given <i>property</i>'s value.</p> <p>If the given <i>property</i> is not managed by this manager, this function returns an invalid size</p> <p>See also <a href="qtsizefpropertymanager.html#setValue">setValue</a>().</p> <h3 class="fn"><a name="valueChanged"></a>void QtSizeFPropertyManager::valueChanged ( <a href="qtproperty.html">QtProperty</a> * <i>property</i>, const <a href="http://qt.nokia.com/doc/4.6/qsizef.html">QSizeF</a> &amp; <i>value</i> )&nbsp;&nbsp;<tt> [signal]</tt></h3> <p>This signal is emitted whenever a property created by this manager changes its value, passing a pointer to the <i>property</i> and the new <i>value</i> as parameters.</p> <p>See also <a href="qtsizefpropertymanager.html#setValue">setValue</a>().</p> <h3 class="fn"><a name="valueText"></a><a href="http://qt.nokia.com/doc/4.6/qstring.html">QString</a> QtSizeFPropertyManager::valueText ( const <a href="qtproperty.html">QtProperty</a> * <i>property</i> ) const&nbsp;&nbsp;<tt> [virtual protected]</tt></h3> <p>Reimplemented from <a href="qtabstractpropertymanager.html#valueText">QtAbstractPropertyManager::valueText</a>().</p> <p /><address><hr /><div align="center"> <table width="100%" cellspacing="0" border="0"><tr class="address"> <td width="30%" align="left">Copyright &copy; 2010 Nokia Corporation and/or its subsidiary(-ies)</td> <td width="40%" align="center"><a href="http://qt.nokia.com/doc/trademarks.html">Trademarks</a></td> <td width="30%" align="right"><div align="right">Qt Solutions</div></td> </tr></table></div></address></body> </html>
{ "pile_set_name": "Github" }
/* LUFA Library Copyright (C) Dean Camera, 2013. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that the copyright notice and this permission notice and warranty disclaimer appear in supporting documentation, and that the name of the author not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. The author disclaims all warranties with regard to this software, including all implied warranties of merchantability and fitness. In no event shall the author be liable for any special, indirect or consequential damages or any damages whatsoever resulting from loss of use, data or profits, whether in an action of contract, negligence or other tortious action, arising out of or in connection with the use or performance of this software. */ #include "../../Common/Common.h" #if (ARCH == ARCH_UC3) #define __INCLUDE_FROM_INTMANAGEMENT_C #include "InterruptManagement.h" /** Interrupt vector table, containing the ISR to call for each interrupt group */ InterruptHandlerPtr_t InterruptHandlers[AVR32_INTC_NUM_INT_GRPS]; /** ISR for unhandled interrupt groups */ ISR(Unhandled_Interrupt) { for (;;); } InterruptHandlerPtr_t INTC_GetInterruptHandler(const uint_reg_t InterruptLevel) { return InterruptHandlers[AVR32_INTC.icr[AVR32_INTC_INT3 - InterruptLevel]]; } void INTC_Init(void) { for (uint8_t InterruptGroup = 0; InterruptGroup < AVR32_INTC_NUM_INT_GRPS; InterruptGroup++) { InterruptHandlers[InterruptGroup] = Unhandled_Interrupt; AVR32_INTC.ipr[InterruptGroup] = Autovector_Table[AVR32_INTC_INT0]; } __builtin_mtsr(AVR32_EVBA, (uintptr_t)&EVBA_Table); } #endif
{ "pile_set_name": "Github" }
package validation import ( "testing" "github.com/stretchr/testify/assert" "k8s.io/apimachinery/pkg/util/validation/field" "github.com/openshift/installer/pkg/types/aws" ) func TestValidatePlatform(t *testing.T) { cases := []struct { name string platform *aws.Platform expected string }{ { name: "minimal", platform: &aws.Platform{ Region: "us-east-1", }, }, { name: "invalid region", platform: &aws.Platform{ Region: "", }, expected: `^test-path\.region: Required value: region must be specified$`, }, { name: "invalid url for service endpoint", platform: &aws.Platform{ Region: "us-east-1", ServiceEndpoints: []aws.ServiceEndpoint{{ Name: "ec2", URL: "/path/some", }}, }, expected: `^test-path\.serviceEndpoints\[0\]\.url: Invalid value: "(.*)": host cannot be empty, empty host provided$`, }, { name: "invalid url for service endpoint", platform: &aws.Platform{ Region: "us-east-1", ServiceEndpoints: []aws.ServiceEndpoint{{ Name: "ec2", URL: "https://test-ec2.random.local/path/some", }}, }, expected: `^test-path\.serviceEndpoints\[0\]\.url: Invalid value: "(.*)": no path or request parameters must be provided, "/path/some" was provided$`, }, { name: "invalid url for service endpoint", platform: &aws.Platform{ Region: "us-east-1", ServiceEndpoints: []aws.ServiceEndpoint{{ Name: "ec2", URL: "https://test-ec2.random.local?foo=some", }}, }, expected: `^test-path\.serviceEndpoints\[0\]\.url: Invalid value: "(.*)": no path or request parameters must be provided, "/\?foo=some" was provided$`, }, { name: "valid url for service endpoint", platform: &aws.Platform{ Region: "us-east-1", ServiceEndpoints: []aws.ServiceEndpoint{{ Name: "ec2", URL: "test-ec2.random.local", }}, }, }, { name: "valid url for service endpoint", platform: &aws.Platform{ Region: "us-east-1", ServiceEndpoints: []aws.ServiceEndpoint{{ Name: "ec2", URL: "https://test-ec2.random.local", }}, }, }, { name: "duplicate service endpoints", platform: &aws.Platform{ Region: "us-east-1", ServiceEndpoints: []aws.ServiceEndpoint{{ Name: "ec2", URL: "test-ec2.random.local", }, { Name: "s3", URL: "test-ec2.random.local", }, { Name: "ec2", URL: "test-ec2.random.local", }}, }, expected: `^test-path\.serviceEndpoints\[2\]\.name: Invalid value: "ec2": duplicate service endpoint not allowed for ec2, service endpoint already defined at test-path\.serviceEndpoints\[0\]$`, }, { name: "valid machine pool", platform: &aws.Platform{ Region: "us-east-1", DefaultMachinePlatform: &aws.MachinePool{}, }, }, { name: "invalid machine pool", platform: &aws.Platform{ Region: "us-east-1", DefaultMachinePlatform: &aws.MachinePool{ EC2RootVolume: aws.EC2RootVolume{ IOPS: -10, }, }, }, expected: `^test-path\.defaultMachinePlatform\.iops: Invalid value: -10: Storage IOPS must be positive$`, }, { name: "invalid userTags, Name key", platform: &aws.Platform{ Region: "us-east-1", UserTags: map[string]string{ "Name": "test-cluster", }, }, expected: `^\Qtest-path.userTags[Name]: Invalid value: "test-cluster": Name key is not allowed for user defined tags\E$`, }, { name: "invalid userTags, key with kubernetes.io/cluster/", platform: &aws.Platform{ Region: "us-east-1", UserTags: map[string]string{ "kubernetes.io/cluster/test-cluster": "shared", }, }, expected: `^\Qtest-path.userTags[kubernetes.io/cluster/test-cluster]: Invalid value: "shared": Keys with prefix 'kubernetes.io/cluster/' are not allowed for user defined tags\E$`, }, { name: "valid userTags", platform: &aws.Platform{ Region: "us-east-1", UserTags: map[string]string{ "app": "production", }, }, }, } for _, tc := range cases { t.Run(tc.name, func(t *testing.T) { err := ValidatePlatform(tc.platform, field.NewPath("test-path")).ToAggregate() if tc.expected == "" { assert.NoError(t, err) } else { assert.Regexp(t, tc.expected, err) } }) } }
{ "pile_set_name": "Github" }
// Copyright Aleksey Gurtovoy 2000-2004 // // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // // *Preprocessed* version of the main "advance_forward.hpp" header // -- DO NOT modify by hand! namespace boost { namespace mpl { namespace aux { template< long N > struct advance_forward; template<> struct advance_forward<0> { template< typename Iterator > struct apply { typedef Iterator iter0; typedef iter0 type; }; }; template<> struct advance_forward<1> { template< typename Iterator > struct apply { typedef Iterator iter0; typedef typename next<iter0>::type iter1; typedef iter1 type; }; }; template<> struct advance_forward<2> { template< typename Iterator > struct apply { typedef Iterator iter0; typedef typename next<iter0>::type iter1; typedef typename next<iter1>::type iter2; typedef iter2 type; }; }; template<> struct advance_forward<3> { template< typename Iterator > struct apply { typedef Iterator iter0; typedef typename next<iter0>::type iter1; typedef typename next<iter1>::type iter2; typedef typename next<iter2>::type iter3; typedef iter3 type; }; }; template<> struct advance_forward<4> { template< typename Iterator > struct apply { typedef Iterator iter0; typedef typename next<iter0>::type iter1; typedef typename next<iter1>::type iter2; typedef typename next<iter2>::type iter3; typedef typename next<iter3>::type iter4; typedef iter4 type; }; }; template< long N > struct advance_forward { template< typename Iterator > struct apply { typedef typename apply_wrap1< advance_forward<4> , Iterator >::type chunk_result_; typedef typename apply_wrap1< advance_forward<( (N - 4) < 0 ? 0 : N - 4 )> , chunk_result_ >::type type; }; }; }}}
{ "pile_set_name": "Github" }
/* * Copyright (c) 2018 (https://github.com/phase1geo/Minder) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public * License along with this program; if not, write to the * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301 USA * * Authored by: Trevor Williams <[email protected]> */ public class ThemeDefault : Theme { /* Create the theme colors */ public ThemeDefault() { name = "default"; label = _( "Default" ); custom = false; /* Generate the non-link colors */ set_color( "background", color_from_string( "#ffffff" ) ); set_color( "foreground", color_from_string( "Black" ) ); set_color( "root_background", color_from_string( "#d4d4d4" ) ); set_color( "root_foreground", color_from_string( "Black" ) ); set_color( "nodesel_background", color_from_string( "#64baff" ) ); set_color( "nodesel_foreground", color_from_string( "Black" ) ); set_color( "textsel_background", color_from_string( "#0d52bf" ) ); set_color( "textsel_foreground", color_from_string( "White" ) ); set_color( "text_cursor", color_from_string( "Black" ) ); set_color( "attachable", color_from_string( "#9bdb4d" ) ); set_color( "connection_background", color_from_string( "#777777" ) ); set_color( "connection_foreground", color_from_string( "#ffffff" ) ); set_color( "url_background", color_from_string( "Grey") ); set_color( "url_foreground", color_from_string( "Blue" ) ); set_color( "tag", color_from_string( "#c00000" ) ); set_color( "syntax", color_from_string( "Grey" ) ); set_color( "match_background", color_from_string( "Gold" ) ); set_color( "match_foreground", color_from_string( "Black" ) ); set_color( "markdown_listitem", color_from_string( "Red" ) ); set_color( "link_color0", color_from_string( "#c6262e" ) ); set_color( "link_color1", color_from_string( "#f37329" ) ); set_color( "link_color2", color_from_string( "#f9c440" ) ); set_color( "link_color3", color_from_string( "#68b723" ) ); set_color( "link_color4", color_from_string( "#3689e6" ) ); set_color( "link_color5", color_from_string( "#7a36b1" ) ); set_color( "link_color6", color_from_string( "#715344" ) ); set_color( "link_color7", color_from_string( "#333333" ) ); prefer_dark = false; } }
{ "pile_set_name": "Github" }
fileFormatVersion: 2 guid: 0d8ad70d0e1e04248b1f5c5d5fb358f4 folderAsset: yes timeCreated: 1508414568 licenseType: Free DefaultImporter: externalObjects: {} userData: assetBundleName: assetBundleVariant:
{ "pile_set_name": "Github" }
<?php // Get the PHP helper library from https://twilio.com/docs/libraries/php require_once '/path/to/vendor/autoload.php'; // Loads the library use Twilio\Rest\Client; // Get your Account SID and Auth Token from https://twilio.com/console $accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'; $authToken = 'your_auth_token'; $client = new Client($accountSid, $authToken); $deploymentSid = 'DLXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'; $deployment = $client->preview->deployedDevices->deployments($deploymentSid)->update( array( 'friendlyName' => 'My New Device Deployment' ) ); echo $deployment->friendlyName;
{ "pile_set_name": "Github" }
<?php /** * PluginLeaveRequest * * This class has been auto-generated by the Doctrine ORM Framework * * @package ##PACKAGE## * @subpackage ##SUBPACKAGE## * @author ##NAME## <##EMAIL##> * @version SVN: $Id: Builder.php 7490 2010-03-29 19:53:27Z jwage $ */ abstract class PluginLeaveRequest extends BaseLeaveRequest { private $leave = null; private $leaveCount = null; private $numberOfDays = null; private $leaveDuration = null; private $statusCounter = array(); private $workShiftHoursPerDay = null; // const LEAVE_REQUEST_STATUS_APPROVED = 'Scheduled'; // const LEAVE_REQUEST_STATUS_CANCELLED = 'Cancelled'; // const LEAVE_REQUEST_STATUS_REJECTED = 'Rejected'; const LEAVE_REQUEST_STATUS_DIFFER = -2; public function getNumberOfDays() { $this->_fetchLeave(); return number_format($this->numberOfDays, 2); } private function getStatusCounter() { return $this->statusCounter; } public function getLeaveDuration() { if ($this->leaveCount == 1) { $startTime = $this->leave[0]->getStartTime(); $endTime = $this->leave[0]->getEndTime(); if ((!empty($startTime) && !empty($endTime)) && ("{$startTime} {$endTime}" != '00:00:00 00:00:00')) { return "{$startTime} to {$endTime}"; } else { $totalDuration = $this->leave[0]->getLengthHours(); if (!empty($totalDuration)) { return number_format($totalDuration, 2) . ' hours'; } else { return number_format($this->_getWorkShiftHoursPerDay(), 2) . ' hours'; } } } else { return number_format($this->leaveDuration, 2) . ' hours'; } } public function getLeaveBreakdown() { $this->_fetchLeave(); $statusStrings = array(); foreach ($this->statusCounter as $status => $count) { if (!is_null($status)) { $statusStrings[] = __(ucwords(strtolower(Leave::getTextForLeaveStatus($status)))) . "(" . number_format($count, 2) . ")"; } } return implode(', ', $statusStrings); } public function getLeaveBalance() { $balance = ''; $leaveEntitlementService = new LeaveEntitlementService(); $employeeId = $this->getEmpNumber(); $leaveTypeId = $this->getLeaveTypeId(); $leaveBalance = $leaveEntitlementService->getLeaveBalance( $employeeId ,$leaveTypeId); if( $leaveBalance instanceof LeaveBalance){ $balance = $leaveBalance->getBalance(); } return $balance; } private function _fetchLeave() { if (is_null($this->leave)) { $this->leave = $this->getLeave(); $this->_parseLeave(); } } public function getLeaveStatusId() { $this->_fetchLeave(); if ($this->isStatusDiffer()) { return self::LEAVE_REQUEST_STATUS_DIFFER; } else { reset($this->statusCounter); $firstKey = key($this->statusCounter); return $firstKey; } } public function getLeaveDateRange() { $this->_fetchLeave(); $leaveCount = count($this->leave); if ($leaveCount == 1) { return $this->leave[0]->getFormattedLeaveDateToView(); } else { $firstDate = $this->leave[0]->getDate(); $lastDate = $this->leave[$leaveCount - 1]->getDate(); if (strtotime($firstDate) > strtotime($lastDate)) { $startDate = $lastDate; $endDate = $firstDate; } else { $startDate = $firstDate; $endDate = $lastDate; } return sprintf('%s %s %s', set_datepicker_date_format($startDate), __('to'), set_datepicker_date_format($endDate)); } } public function getLeaveStartAndEndDate() { $this->_fetchLeave(); $leaveCount = count($this->leave); if ($leaveCount == 1) { $startDate = $endDate = $this->leave[0]->getDate(); } else { $firstDate = $this->leave[0]->getDate(); $lastDate = $this->leave[$leaveCount - 1]->getDate(); if (strtotime($firstDate) > strtotime($lastDate)) { $startDate = $lastDate; $endDate = $firstDate; } else { $startDate = $firstDate; $endDate = $lastDate; } } return array($startDate, $endDate); } public function getLeaveDates() { $this->_fetchLeave(); $dates = array(); if (count($this->leave) > 0) { foreach ($this->leave as $leave) { $dates[] = $leave->getDate(); } } return $dates; } private function _parseLeave() { $this->numberOfDays = 0.0; $this->leaveDuration = 0.0; // Counting leave $this->leaveCount = $this->leave->count(); $this->statusCounter = array(); foreach ($this->leave as $leave) { // Calculating number of days and duration $dayLength = (float) $leave->getLengthDays(); //this got changed to fix sf-3019087,3044234 $hourLength = $dayLength * $this->_getWorkShiftHoursPerDay(); $hourLength = (float) $leave->getLengthHours(); if ($dayLength >= 1) { $hourLength = $dayLength * (float) $leave->getLengthHours(); } if ($hourLength == 0.0) { $hourLength = (float) $leave->getLengthHours(); } $this->leaveDuration += $hourLength; //if($hourLength > 0) { $this->numberOfDays += $dayLength; //} if (!$leave->isNonWorkingDay()) { // Populating leave breakdown $status = $leave->getStatus(); $statusDayLength = ($dayLength != 0) ? $dayLength : 1; if ($hourLength > 0) { if (array_key_exists($status, $this->statusCounter)) { $this->statusCounter[$status]+= $statusDayLength; } else { $this->statusCounter[$status] = $statusDayLength; } } } } //is there any use of this block ? /* if ($this->numberOfDays == 1.0) { $this->numberOfDays = $this->leave[0]->getLengthDays(); } */ } private function _getWorkShiftHoursPerDay() { if (!isset($this->workShiftHoursPerDay)) { $employeeWorkshift = $this->getEmployee()->getEmployeeWorkShift(); if ($employeeWorkshift->count() > 0) { $this->workShiftHoursPerDay = $employeeWorkshift[0]->getWorkShift()->getHoursPerDay(); } else { $this->workShiftHoursPerDay = WorkShift::DEFAULT_WORK_SHIFT_LENGTH; } } return $this->workShiftHoursPerDay; } private function _AreAllTaken() { $flag = true; foreach ($this->leave as $leave) { if ($leave->getStatus() != Leave::LEAVE_STATUS_LEAVE_TAKEN && $leave->getLengthHours() != '0.00') { $flag = false; break; } } return $flag; } public function isStatusDiffer() { $this->_fetchLeave(); if (count($this->getStatusCounter()) > 1) { return true; } else { return false; } } public function getLeaveItems() { $leaveRequestDao = new LeaveRequestDao(); return $leaveRequestDao->fetchLeave($this->getId()); } public function getLeaveTypeName() { return $this->getLeaveType()->getName(); } public function getLatestCommentAsText() { $latestComment = ''; $leaveComments = $this->getLeaveRequestComment(); if (count($leaveComments) > 0) { $lastComment = $leaveComments->getLast(); $latestComment = $lastComment->getComments(); } return $latestComment; } public function getCommentsAsText() { $leaveComments = $this->getLeaveRequestComment(); $allComments = ''; // show last comment only if (count($leaveComments) > 0) { foreach ($leaveComments as $comment) { $created = new DateTime($comment->getCreated()); $createdAt = set_datepicker_date_format($created->format('Y-m-d')) . ' ' . $created->format('H:i'); $formatComment = "(" . $createdAt . ' - ' . $comment->getCreatedByName() . ") \n" . $comment->getComments(); $allComments = $formatComment . "\n\n" . $allComments; } } return $allComments; } }
{ "pile_set_name": "Github" }
// // Prefix header // // The contents of this file are implicitly included at the beginning of every source file. // #import <Availability.h> #ifndef __IPHONE_5_0 #warning "This project uses features only available in iOS SDK 5.0 and later." #endif #ifdef __OBJC__ #import <UIKit/UIKit.h> #import <Foundation/Foundation.h> #endif
{ "pile_set_name": "Github" }
// Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.23.0 // protoc v3.11.2 // source: github.com/google/cloudprober/surfacers/postgres/proto/config.proto package proto import ( proto "github.com/golang/protobuf/proto" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" ) const ( // Verify that this generated code is sufficiently up-to-date. _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) // Verify that runtime/protoimpl is sufficiently up-to-date. _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) // This is a compile-time assertion that a sufficiently up-to-date version // of the legacy proto package is being used. const _ = proto.ProtoPackageIsVersion4 type SurfacerConf struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields ConnectionString *string `protobuf:"bytes,1,req,name=connection_string,json=connectionString" json:"connection_string,omitempty"` MetricsTableName *string `protobuf:"bytes,2,req,name=metrics_table_name,json=metricsTableName" json:"metrics_table_name,omitempty"` } func (x *SurfacerConf) Reset() { *x = SurfacerConf{} if protoimpl.UnsafeEnabled { mi := &file_github_com_google_cloudprober_surfacers_postgres_proto_config_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *SurfacerConf) String() string { return protoimpl.X.MessageStringOf(x) } func (*SurfacerConf) ProtoMessage() {} func (x *SurfacerConf) ProtoReflect() protoreflect.Message { mi := &file_github_com_google_cloudprober_surfacers_postgres_proto_config_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use SurfacerConf.ProtoReflect.Descriptor instead. func (*SurfacerConf) Descriptor() ([]byte, []int) { return file_github_com_google_cloudprober_surfacers_postgres_proto_config_proto_rawDescGZIP(), []int{0} } func (x *SurfacerConf) GetConnectionString() string { if x != nil && x.ConnectionString != nil { return *x.ConnectionString } return "" } func (x *SurfacerConf) GetMetricsTableName() string { if x != nil && x.MetricsTableName != nil { return *x.MetricsTableName } return "" } var File_github_com_google_cloudprober_surfacers_postgres_proto_config_proto protoreflect.FileDescriptor var file_github_com_google_cloudprober_surfacers_postgres_proto_config_proto_rawDesc = []byte{ 0x0a, 0x43, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x70, 0x72, 0x6f, 0x62, 0x65, 0x72, 0x2f, 0x73, 0x75, 0x72, 0x66, 0x61, 0x63, 0x65, 0x72, 0x73, 0x2f, 0x70, 0x6f, 0x73, 0x74, 0x67, 0x72, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1d, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x70, 0x72, 0x6f, 0x62, 0x65, 0x72, 0x2e, 0x73, 0x75, 0x72, 0x66, 0x61, 0x63, 0x65, 0x72, 0x2e, 0x70, 0x6f, 0x73, 0x74, 0x67, 0x72, 0x65, 0x73, 0x22, 0x69, 0x0a, 0x0c, 0x53, 0x75, 0x72, 0x66, 0x61, 0x63, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x66, 0x12, 0x2b, 0x0a, 0x11, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x18, 0x01, 0x20, 0x02, 0x28, 0x09, 0x52, 0x10, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x12, 0x2c, 0x0a, 0x12, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x5f, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x02, 0x28, 0x09, 0x52, 0x10, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x42, 0x38, 0x5a, 0x36, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x70, 0x72, 0x6f, 0x62, 0x65, 0x72, 0x2f, 0x73, 0x75, 0x72, 0x66, 0x61, 0x63, 0x65, 0x72, 0x73, 0x2f, 0x70, 0x6f, 0x73, 0x74, 0x67, 0x72, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, } var ( file_github_com_google_cloudprober_surfacers_postgres_proto_config_proto_rawDescOnce sync.Once file_github_com_google_cloudprober_surfacers_postgres_proto_config_proto_rawDescData = file_github_com_google_cloudprober_surfacers_postgres_proto_config_proto_rawDesc ) func file_github_com_google_cloudprober_surfacers_postgres_proto_config_proto_rawDescGZIP() []byte { file_github_com_google_cloudprober_surfacers_postgres_proto_config_proto_rawDescOnce.Do(func() { file_github_com_google_cloudprober_surfacers_postgres_proto_config_proto_rawDescData = protoimpl.X.CompressGZIP(file_github_com_google_cloudprober_surfacers_postgres_proto_config_proto_rawDescData) }) return file_github_com_google_cloudprober_surfacers_postgres_proto_config_proto_rawDescData } var file_github_com_google_cloudprober_surfacers_postgres_proto_config_proto_msgTypes = make([]protoimpl.MessageInfo, 1) var file_github_com_google_cloudprober_surfacers_postgres_proto_config_proto_goTypes = []interface{}{ (*SurfacerConf)(nil), // 0: cloudprober.surfacer.postgres.SurfacerConf } var file_github_com_google_cloudprober_surfacers_postgres_proto_config_proto_depIdxs = []int32{ 0, // [0:0] is the sub-list for method output_type 0, // [0:0] is the sub-list for method input_type 0, // [0:0] is the sub-list for extension type_name 0, // [0:0] is the sub-list for extension extendee 0, // [0:0] is the sub-list for field type_name } func init() { file_github_com_google_cloudprober_surfacers_postgres_proto_config_proto_init() } func file_github_com_google_cloudprober_surfacers_postgres_proto_config_proto_init() { if File_github_com_google_cloudprober_surfacers_postgres_proto_config_proto != nil { return } if !protoimpl.UnsafeEnabled { file_github_com_google_cloudprober_surfacers_postgres_proto_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*SurfacerConf); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_github_com_google_cloudprober_surfacers_postgres_proto_config_proto_rawDesc, NumEnums: 0, NumMessages: 1, NumExtensions: 0, NumServices: 0, }, GoTypes: file_github_com_google_cloudprober_surfacers_postgres_proto_config_proto_goTypes, DependencyIndexes: file_github_com_google_cloudprober_surfacers_postgres_proto_config_proto_depIdxs, MessageInfos: file_github_com_google_cloudprober_surfacers_postgres_proto_config_proto_msgTypes, }.Build() File_github_com_google_cloudprober_surfacers_postgres_proto_config_proto = out.File file_github_com_google_cloudprober_surfacers_postgres_proto_config_proto_rawDesc = nil file_github_com_google_cloudprober_surfacers_postgres_proto_config_proto_goTypes = nil file_github_com_google_cloudprober_surfacers_postgres_proto_config_proto_depIdxs = nil }
{ "pile_set_name": "Github" }
/* * Phosphorus Five, copyright 2014 - 2017, Thomas Hansen, [email protected] * * This file is part of Phosphorus Five. * * Phosphorus Five is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License version 3, as published by * the Free Software Foundation. * * * Phosphorus Five is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Phosphorus Five. If not, see <http://www.gnu.org/licenses/>. * * If you cannot for some reasons use the GPL license, Phosphorus * Five is also commercially available under Quid Pro Quo terms. Check * out our website at http://gaiasoul.com for more details. */ using System; using System.Linq; using System.Collections.Generic; using p5.core; namespace p5.exp.iterators { /// <summary> /// Returns all parent <see cref="Node" />s of previous iterator result /// </summary> [Serializable] public class IteratorParent : Iterator { public override IEnumerable<Node> Evaluate (ApplicationContext context) { return Left.Evaluate (context).Select (ix => ix.Parent).Distinct (); } } }
{ "pile_set_name": "Github" }
/****************************************************************************** * Product: ADempiere ERP & CRM Smart Business Solution * * Copyright (C) 2006-2017 ADempiere Foundation, All Rights Reserved. * * This program is free software, you can redistribute it and/or modify it * * under the terms version 2 of the GNU General Public License as published * * or (at your option) any later version. * * by the Free Software Foundation. This program is distributed in the hope * * that it will be useful, but WITHOUT ANY WARRANTY, without even the implied * * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * * See the GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * * with this program, if not, write to the Free Software Foundation, Inc., * * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * * For the text or an alternative of this public license, you may reach us * * or via [email protected] or http://www.adempiere.net/license.html * *****************************************************************************/ package org.eevolution.model; import java.math.BigDecimal; import java.sql.Timestamp; import org.compiere.model.*; import org.compiere.util.KeyNamePair; /** Generated Interface for C_ProjectProcessor * @author Adempiere (generated) * @version Release 3.9.2 */ public interface I_C_ProjectProcessor { /** TableName=C_ProjectProcessor */ public static final String Table_Name = "C_ProjectProcessor"; /** AD_Table_ID=54315 */ public static final int Table_ID = MTable.getTable_ID(Table_Name); KeyNamePair Model = new KeyNamePair(Table_ID, Table_Name); /** AccessLevel = 2 - Client */ BigDecimal accessLevel = BigDecimal.valueOf(2); /** Load Meta Data */ /** Column name AD_Client_ID */ public static final String COLUMNNAME_AD_Client_ID = "AD_Client_ID"; /** Get Client. * Client/Tenant for this installation. */ public int getAD_Client_ID(); /** Column name AD_Org_ID */ public static final String COLUMNNAME_AD_Org_ID = "AD_Org_ID"; /** Set Organization. * Organizational entity within client */ public void setAD_Org_ID (int AD_Org_ID); /** Get Organization. * Organizational entity within client */ public int getAD_Org_ID(); /** Column name C_ProjectProcessor_ID */ public static final String COLUMNNAME_C_ProjectProcessor_ID = "C_ProjectProcessor_ID"; /** Set Project Processor. * Processor for Project */ public void setC_ProjectProcessor_ID (int C_ProjectProcessor_ID); /** Get Project Processor. * Processor for Project */ public int getC_ProjectProcessor_ID(); /** Column name C_ProjectTaskCategory_ID */ public static final String COLUMNNAME_C_ProjectTaskCategory_ID = "C_ProjectTaskCategory_ID"; /** Set Project Task Category. * Set Category for project task */ public void setC_ProjectTaskCategory_ID (int C_ProjectTaskCategory_ID); /** Get Project Task Category. * Set Category for project task */ public int getC_ProjectTaskCategory_ID(); public org.eevolution.model.I_C_ProjectTaskCategory getC_ProjectTaskCategory() throws RuntimeException; /** Column name C_ProjectType_ID */ public static final String COLUMNNAME_C_ProjectType_ID = "C_ProjectType_ID"; /** Set Project Type. * Type of the project */ public void setC_ProjectType_ID (int C_ProjectType_ID); /** Get Project Type. * Type of the project */ public int getC_ProjectType_ID(); public org.compiere.model.I_C_ProjectType getC_ProjectType() throws RuntimeException; /** Column name Created */ public static final String COLUMNNAME_Created = "Created"; /** Get Created. * Date this record was created */ public Timestamp getCreated(); /** Column name CreatedBy */ public static final String COLUMNNAME_CreatedBy = "CreatedBy"; /** Get Created By. * User who created this records */ public int getCreatedBy(); /** Column name DateLastRun */ public static final String COLUMNNAME_DateLastRun = "DateLastRun"; /** Set Date last run. * Date the process was last run. */ public void setDateLastRun (Timestamp DateLastRun); /** Get Date last run. * Date the process was last run. */ public Timestamp getDateLastRun(); /** Column name DateNextRun */ public static final String COLUMNNAME_DateNextRun = "DateNextRun"; /** Set Date next run. * Date the process will run next */ public void setDateNextRun (Timestamp DateNextRun); /** Get Date next run. * Date the process will run next */ public Timestamp getDateNextRun(); /** Column name DaysBeforeStart */ public static final String COLUMNNAME_DaysBeforeStart = "DaysBeforeStart"; /** Set Days before due start date. * Days before start date to start */ public void setDaysBeforeStart (int DaysBeforeStart); /** Get Days before due start date. * Days before start date to start */ public int getDaysBeforeStart(); /** Column name Description */ public static final String COLUMNNAME_Description = "Description"; /** Set Description. * Optional short description of the record */ public void setDescription (String Description); /** Get Description. * Optional short description of the record */ public String getDescription(); /** Column name Frequency */ public static final String COLUMNNAME_Frequency = "Frequency"; /** Set Frequency. * Frequency of events */ public void setFrequency (int Frequency); /** Get Frequency. * Frequency of events */ public int getFrequency(); /** Column name FrequencyType */ public static final String COLUMNNAME_FrequencyType = "FrequencyType"; /** Set Frequency Type. * Frequency of event */ public void setFrequencyType (String FrequencyType); /** Get Frequency Type. * Frequency of event */ public String getFrequencyType(); /** Column name InactivityAlertDays */ public static final String COLUMNNAME_InactivityAlertDays = "InactivityAlertDays"; /** Set Inactivity Alert Days. * Send Alert when there is no activity after days (0= no alert) */ public void setInactivityAlertDays (int InactivityAlertDays); /** Get Inactivity Alert Days. * Send Alert when there is no activity after days (0= no alert) */ public int getInactivityAlertDays(); /** Column name IsActive */ public static final String COLUMNNAME_IsActive = "IsActive"; /** Set Active. * The record is active in the system */ public void setIsActive (boolean IsActive); /** Get Active. * The record is active in the system */ public boolean isActive(); /** Column name KeepLogDays */ public static final String COLUMNNAME_KeepLogDays = "KeepLogDays"; /** Set Days to keep Log. * Number of days to keep the log entries */ public void setKeepLogDays (int KeepLogDays); /** Get Days to keep Log. * Number of days to keep the log entries */ public int getKeepLogDays(); /** Column name Name */ public static final String COLUMNNAME_Name = "Name"; /** Set Name. * Alphanumeric identifier of the entity */ public void setName (String Name); /** Get Name. * Alphanumeric identifier of the entity */ public String getName(); /** Column name OverdueAlertDays */ public static final String COLUMNNAME_OverdueAlertDays = "OverdueAlertDays"; /** Set Alert after Days Due. * Send email alert after number of days due (0=no alerts) */ public void setOverdueAlertDays (int OverdueAlertDays); /** Get Alert after Days Due. * Send email alert after number of days due (0=no alerts) */ public int getOverdueAlertDays(); /** Column name OverdueAssignDays */ public static final String COLUMNNAME_OverdueAssignDays = "OverdueAssignDays"; /** Set Escalate after Days Due. * Escalation to superior after number of due days (0 = no) */ public void setOverdueAssignDays (int OverdueAssignDays); /** Get Escalate after Days Due. * Escalation to superior after number of due days (0 = no) */ public int getOverdueAssignDays(); /** Column name Processing */ public static final String COLUMNNAME_Processing = "Processing"; /** Set Process Now */ public void setProcessing (boolean Processing); /** Get Process Now */ public boolean isProcessing(); /** Column name R_MailText_ID */ public static final String COLUMNNAME_R_MailText_ID = "R_MailText_ID"; /** Set Mail Template. * Text templates for mailings */ public void setR_MailText_ID (int R_MailText_ID); /** Get Mail Template. * Text templates for mailings */ public int getR_MailText_ID(); public org.compiere.model.I_R_MailText getR_MailText() throws RuntimeException; /** Column name RemindDays */ public static final String COLUMNNAME_RemindDays = "RemindDays"; /** Set Reminder Days. * Days between sending Reminder Emails for a due or inactive Document */ public void setRemindDays (int RemindDays); /** Get Reminder Days. * Days between sending Reminder Emails for a due or inactive Document */ public int getRemindDays(); /** Column name Supervisor_ID */ public static final String COLUMNNAME_Supervisor_ID = "Supervisor_ID"; /** Set Supervisor. * Supervisor for this user/organization - used for escalation and approval */ public void setSupervisor_ID (int Supervisor_ID); /** Get Supervisor. * Supervisor for this user/organization - used for escalation and approval */ public int getSupervisor_ID(); public org.compiere.model.I_AD_User getSupervisor() throws RuntimeException; /** Column name UUID */ public static final String COLUMNNAME_UUID = "UUID"; /** Set Immutable Universally Unique Identifier. * Immutable Universally Unique Identifier */ public void setUUID (String UUID); /** Get Immutable Universally Unique Identifier. * Immutable Universally Unique Identifier */ public String getUUID(); /** Column name Updated */ public static final String COLUMNNAME_Updated = "Updated"; /** Get Updated. * Date this record was updated */ public Timestamp getUpdated(); /** Column name UpdatedBy */ public static final String COLUMNNAME_UpdatedBy = "UpdatedBy"; /** Get Updated By. * User who updated this records */ public int getUpdatedBy(); }
{ "pile_set_name": "Github" }
{%- block version %} <div class="sidebarblock"> <div class="tile"> <h4>Latest version:</h4> {{ release }} (<a href="https://github.com/pysathq/pysat">GitHub</a>) </div> </br> </div> {%- endblock %}
{ "pile_set_name": "Github" }
######################################################################## ## ## Copyright (C) 2008-2020 The Octave Project Developers ## ## See the file COPYRIGHT.md in the top-level directory of this ## distribution or <https://octave.org/copyright/>. ## ## This file is part of Octave. ## ## Octave is free software: you can redistribute it and/or modify it ## under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## (at your option) any later version. ## ## Octave is distributed in the hope that it will be useful, but ## WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with Octave; see the file COPYING. If not, see ## <https://www.gnu.org/licenses/>. ## ######################################################################## ## -*- texinfo -*- ## @deftypefn {} {@var{info} =} imfinfo (@var{filename}) ## @deftypefnx {} {@var{info} =} imfinfo (@var{url}) ## @deftypefnx {} {@var{info} =} imfinfo (@dots{}, @var{ext}) ## Read image information from a file. ## ## @code{imfinfo} returns a structure containing information about the image ## stored in the file @var{filename}. If there is no file @var{filename}, ## and @var{ext} was specified, it will look for a file named @var{filename} ## and extension @var{ext}, i.e., a file named @var{filename}.@var{ext}. ## ## The output structure @var{info} contains the following fields: ## ## @table @samp ## @item Filename ## The full name of the image file. ## ## @item FileModDate ## Date of last modification to the file. ## ## @item FileSize ## Number of bytes of the image on disk ## ## @item Format ## Image format (e.g., @qcode{"jpeg"}). ## ## @item Height ## Image height in pixels. ## ## @item Width ## Image Width in pixels. ## ## @item BitDepth ## Number of bits per channel per pixel. ## ## @item ColorType ## Image type. Value is @qcode{"grayscale"}, @qcode{"indexed"}, ## @qcode{"truecolor"}, @qcode{"CMYK"}, or @qcode{"undefined"}. ## ## @item XResolution ## X resolution of the image. ## ## @item YResolution ## Y resolution of the image. ## ## @item ResolutionUnit ## Units of image resolution. Value is @qcode{"Inch"}, ## @qcode{"Centimeter"}, or @qcode{"undefined"}. ## ## @item DelayTime ## Time in @nospell{1/100ths} of a second (0 to 65535) which must expire before ## displaying the next image in an animated sequence. ## ## @item LoopCount ## Number of iterations to loop an animation. ## ## @item ByteOrder ## Endian option for formats that support it. Value is ## @qcode{"little-endian"}, @qcode{"big-endian"}, or @qcode{"undefined"}. ## ## @item Gamma ## Gamma level of the image. The same color image displayed on two different ## workstations may look different due to differences in the display monitor. ## ## @item Quality ## JPEG/MIFF/PNG compression level. Value is an integer in the range [0 100]. ## ## @item DisposalMethod ## Only valid for GIF images, control how successive frames are rendered (how ## the preceding frame is disposed of) when creating a GIF animation. Values ## can be @qcode{"doNotSpecify"}, @qcode{"leaveInPlace"}, @qcode{"restoreBG"}, ## or @qcode{"restorePrevious"}. For non-GIF files, value is an empty string. ## ## @item Chromaticities ## Value is a 1x8 Matrix with the x,y chromaticity values for white, red, ## green, and blue points, in that order. ## ## @item Comment ## Image comment. ## ## @item Compression ## Compression type. Value can be @qcode{"none"}, @qcode{"bzip"}, ## @qcode{"fax3"}, @qcode{"fax4"}, @qcode{"jpeg"}, @qcode{"lzw"}, ## @qcode{"rle"}, @qcode{"deflate"}, @qcode{"lzma"}, @qcode{"jpeg2000"}, ## @qcode{"jbig2"}, @qcode{"jbig2"}, or @qcode{"undefined"}. ## ## @item Colormap ## Colormap for each image. ## ## @item Orientation ## The orientation of the image with respect to the rows and columns. Value ## is an integer between 1 and 8 as defined in the TIFF 6 specifications, and ## for @sc{matlab} compatibility. ## ## @item Software ## Name and version of the software or firmware of the camera or image input ## device used to generate the image. ## ## @item Make ## The manufacturer of the recording equipment. This is the manufacture of the ## @nospell{DSC}, scanner, video digitizer or other equipment that generated ## the image. ## ## @item Model ## The model name or model number of the recording equipment as mentioned on ## the field @qcode{"Make"}. ## ## @item DateTime ## The date and time of image creation as defined by the Exif standard, i.e., ## it is the date and time the file was changed. ## ## @item ImageDescription ## The title of the image as defined by the Exif standard. ## ## @item Artist ## Name of the camera owner, photographer or image creator. ## ## @item Copyright ## Copyright notice of the person or organization claiming rights to the image. ## ## @item DigitalCamera ## A struct with information retrieved from the Exif tag. ## ## @item GPSInfo ## A struct with geotagging information retrieved from the Exif tag. ## @end table ## ## @seealso{imread, imwrite, imshow, imformats} ## @end deftypefn function info = imfinfo (filename, varargin) if (nargin < 1 || nargin > 2) print_usage (); elseif (! ischar (filename)) error ("imfinfo: FILENAME must be a string"); elseif (nargin > 1 && ! ischar (varargin{1})) error ("imfinfo: EXT must be a string"); endif info = imageIO ("imfinfo", @__imfinfo__, "info", filename, varargin{:}); endfunction ## This test is the same as the similar one in imread. imfinfo must check ## if file exists before calling __imfinfo_. This BIST test confirms this. %!testif HAVE_MAGICK %! warning ("off", "Octave:GraphicsMagick-Quantum-Depth", "local"); %! fmt = fmt_ori = imformats ("jpg"); %! fmt.info = @true; %! error_thrown = false; %! imformats ("update", "jpg", fmt); %! unwind_protect %! try %! imread ("I_sure_hope_this_file_does_not_exist.jpg"); %! catch %! error_thrown = true; %! end_try_catch %! unwind_protect_cleanup %! imformats ("update", "jpg", fmt_ori); %! end_unwind_protect %! assert (error_thrown, true); ## Test input validation %!error imfinfo () %!error imfinfo (1,2,3) %!error <FILENAME must be a string> imfinfo (1) %!error <EXT must be a string> imfinfo ("foo", 1)
{ "pile_set_name": "Github" }
CONFIG_ARM=y CONFIG_ARCH_OMAP2PLUS=y CONFIG_SPL_GPIO_SUPPORT=y CONFIG_SPL_LIBCOMMON_SUPPORT=y CONFIG_SPL_LIBGENERIC_SUPPORT=y CONFIG_SYS_MALLOC_F_LEN=0x2000 CONFIG_AM33XX=y CONFIG_TARGET_AM335X_IGEP003X=y CONFIG_SPL_MMC_SUPPORT=y CONFIG_SPL_SERIAL_SUPPORT=y CONFIG_SPL=y CONFIG_SPL_FAT_SUPPORT=y CONFIG_SPL_LIBDISK_SUPPORT=y CONFIG_DISTRO_DEFAULTS=y CONFIG_OF_BOARD_SETUP=y CONFIG_SYS_EXTRA_OPTIONS="MACH_TYPE=MACH_TYPE_IGEP0033" # CONFIG_USE_BOOTCOMMAND is not set CONFIG_SYS_CONSOLE_INFO_QUIET=y CONFIG_VERSION_VARIABLE=y CONFIG_SPL_EXT_SUPPORT=y CONFIG_SPL_I2C_SUPPORT=y CONFIG_SPL_MTD_SUPPORT=y CONFIG_SPL_OS_BOOT=y CONFIG_SPL_POWER_SUPPORT=y CONFIG_SPL_WATCHDOG_SUPPORT=y CONFIG_SPL_YMODEM_SUPPORT=y CONFIG_CMD_SPL=y CONFIG_CMD_ASKENV=y # CONFIG_CMD_FLASH is not set CONFIG_CMD_GPIO=y CONFIG_CMD_I2C=y CONFIG_CMD_MMC=y CONFIG_CMD_NAND=y CONFIG_CMD_SPI=y # CONFIG_CMD_SETEXPR is not set CONFIG_CMD_EXT4_WRITE=y CONFIG_CMD_MTDPARTS=y CONFIG_MTDIDS_DEFAULT="nand0=omap2-nand.0" CONFIG_MTDPARTS_DEFAULT="mtdparts=omap2-nand.0:512k(SPL),-(UBI)" CONFIG_CMD_UBI=y # CONFIG_CMD_UBIFS is not set CONFIG_ENV_IS_IN_UBI=y CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y CONFIG_MMC_OMAP_HS=y CONFIG_NAND=y CONFIG_MTD_UBI_FASTMAP=y CONFIG_MII=y CONFIG_DRIVER_TI_CPSW=y CONFIG_SPI=y CONFIG_OMAP3_SPI=y CONFIG_FAT_WRITE=y CONFIG_OF_LIBFDT=y CONFIG_FDT_FIXUP_PARTITIONS=y # CONFIG_GENERATE_SMBIOS_TABLE is not set
{ "pile_set_name": "Github" }
# Copyright 1999-2020 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=6 VALA_USE_DEPEND="vapigen" inherit flag-o-matic gnome2 vala DESCRIPTION="Utilities for creating and parsing messages using MIME" HOMEPAGE="http://spruce.sourceforge.net/gmime/ https://developer.gnome.org/gmime/stable/" SLOT="3.0" LICENSE="LGPL-2.1+" KEYWORDS="~alpha amd64 arm ~arm64 hppa ~ia64 ppc ppc64 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos ~x64-solaris ~x86-solaris" IUSE="crypt doc idn static-libs test +vala" RESTRICT="!test? ( test )" RDEPEND=" >=dev-libs/glib-2.32.0:2 sys-libs/zlib crypt? ( >=app-crypt/gpgme-1.8.0:1= ) idn? ( net-dns/libidn2:= ) vala? ( $(vala_depend) >=dev-libs/gobject-introspection-1.30.0:= ) " DEPEND="${RDEPEND} >=dev-util/gtk-doc-am-1.8 virtual/libiconv virtual/pkgconfig doc? ( app-text/docbook-sgml-utils ) test? ( app-crypt/gnupg ) " # gnupg is needed for tests if --enable-cryptography is enabled, which we do unconditionally src_prepare() { gnome2_src_prepare use vala && vala_src_prepare } src_configure() { if [[ ${CHOST} == *-solaris* ]]; then # bug #???, why not use --with-libiconv append-libs iconv fi gnome2_src_configure \ $(use_enable crypt crypto) \ $(use_enable static-libs static) \ $(use_enable vala) \ $(use_with idn libidn) \ $(usex doc "" DB2HTML=) } src_compile() { gnome2_src_compile if use doc; then emake -C docs/tutorial html fi } src_install() { gnome2_src_install if use doc ; then docinto tutorial dodoc -r docs/tutorial/html/ fi }
{ "pile_set_name": "Github" }
{-# LANGUAGE Arrows, CPP #-} module Examples.Cabal where import Options.Applicative import Options.Applicative.Arrows import Data.Monoid #if __GLASGOW_HASKELL__ <= 702 (<>) :: Monoid a => a -> a -> a (<>) = mappend #endif data Args = Args CommonOpts Command deriving Show data CommonOpts = CommonOpts { optVerbosity :: Int } deriving Show data Command = Install ConfigureOpts InstallOpts | Update | Configure ConfigureOpts | Build BuildOpts deriving Show data InstallOpts = InstallOpts { instReinstall :: Bool , instForce :: Bool } deriving Show data ConfigureOpts = ConfigureOpts { configTests :: Bool , configFlags :: [String] } deriving Show data BuildOpts = BuildOpts { buildDir :: FilePath } deriving Show version :: Parser (a -> a) version = infoOption "0.0.0" ( long "version" <> help "Print version information" ) parser :: Parser Args parser = runA $ proc () -> do opts <- asA commonOpts -< () cmds <- (asA . hsubparser) ( command "install" (info installParser (progDesc "Installs a list of packages")) <> command "update" (info updateParser (progDesc "Updates list of known packages")) <> command "configure" (info configureParser (progDesc "Prepare to build the package")) <> command "build" (info buildParser (progDesc "Make this package ready for installation")) ) -< () A version >>> A helper -< Args opts cmds commonOpts :: Parser CommonOpts commonOpts = CommonOpts <$> option auto ( short 'v' <> long "verbose" <> metavar "LEVEL" <> help "Set verbosity to LEVEL" <> value 0 ) installParser :: Parser Command installParser = runA $ proc () -> do config <- asA configureOpts -< () inst <- asA installOpts -< () returnA -< Install config inst installOpts :: Parser InstallOpts installOpts = runA $ proc () -> do reinst <- asA (switch (long "reinstall")) -< () force <- asA (switch (long "force-reinstall")) -< () returnA -< InstallOpts { instReinstall = reinst , instForce = force } updateParser :: Parser Command updateParser = pure Update configureParser :: Parser Command configureParser = runA $ proc () -> do config <- asA configureOpts -< () returnA -< Configure config configureOpts :: Parser ConfigureOpts configureOpts = runA $ proc () -> do tests <- (asA . switch) ( long "enable-tests" <> help "Enable compilation of test suites" ) -< () flags <- (asA . many . strOption) ( short 'f' <> long "flags" <> metavar "FLAGS" <> help "Enable the given flag" ) -< () returnA -< ConfigureOpts tests flags buildParser :: Parser Command buildParser = runA $ proc () -> do opts <- asA buildOpts -< () returnA -< Build opts buildOpts :: Parser BuildOpts buildOpts = runA $ proc () -> do bdir <- (asA . strOption) ( long "builddir" <> metavar "DIR" <> value "dist" ) -< () returnA -< BuildOpts bdir pinfo :: ParserInfo Args pinfo = info parser ( progDesc "An example modelled on cabal" ) main :: IO () main = do r <- customExecParser (prefs helpShowGlobals) pinfo print r
{ "pile_set_name": "Github" }
AutoForm.addInputType("week", { template: "afInputWeek", valueConverters: { "stringArray": AutoForm.valueConverters.stringToStringArray } });
{ "pile_set_name": "Github" }
/* * Copyright (C) 2006 TopCoder Inc., All Rights Reserved. */ package com.topcoder.util.actionmanager; import javax.swing.undo.UndoableEdit; /** * <p> * This class implements the UndoableEdit interface and used for testing only. * </p> * * @author biotrail * @version 1.0 */ public class MockUndoableEdit implements UndoableEdit { /** * <p> * This method implements the undo() method defined in the UndoableEdit interface. * </p> * * <p> * Empty method. * </p> */ public void undo() { // empty } /** * <p> * This method implements the canUndo() method defined in the UndoableEdit interface. * </p> * * <p> * This method always returns false. * </p> * * @return false */ public boolean canUndo() { return false; } /** * <p> * This method implements the redo() method defined in the UndoableEdit interface. * </p> * * <p> * Empty method. * </p> */ public void redo() { } /** * <p> * This method implements the canRedo() method defined in the UndoableEdit interface. * </p> * * <p> * This method always returns false. * </p> * * @return false */ public boolean canRedo() { return false; } /** * <p> * This method implements the die() method defined in the UndoableEdit interface. * </p> * * <p> * Empty method. * </p> */ public void die() { // empty } /** * <p> * This method implements the addEdit() method defined in the UndoableEdit interface. * </p> * * <p> * This method always returns false. * </p> * * @param anEdit anEdit * @return false */ public boolean addEdit(UndoableEdit anEdit) { return false; } /** * <p> * This method implements the replaceEdit() method defined in the UndoableEdit interface. * </p> * * <p> * This method always returns false. * </p> * * @param anEdit anEdit * @return false */ public boolean replaceEdit(UndoableEdit anEdit) { return false; } /** * <p> * This method implements the isSignificant() method defined in the UndoableEdit interface. * </p> * * <p> * This method always returns false. * </p> * * @return false */ public boolean isSignificant() { return false; } /** * <p> * This method implements the getPresentationName() method defined in the UndoableEdit interface. * </p> * * @return the presentation name */ public String getPresentationName() { return "MockUndoableEdit"; } /** * <p> * This method implements the getUndoPresentationName() method defined in the UndoableEdit interface. * </p> * * @return the undo presentation name */ public String getUndoPresentationName() { return "Undo:MockUndoableEdit"; } /** * <p> * This method implements the getRedoPresentationName() method defined in the UndoableEdit interface. * </p> * * @return the redo presentation name */ public String getRedoPresentationName() { return "Redo:MockUndoableEdit"; } }
{ "pile_set_name": "Github" }
/** * @license * Copyright Mauricio Gemelli Vigolo and contributors. * * Use of this source code is governed by a MIT-style license that can be * found in the LICENSE file at https://github.com/mauriciovigolo/keycloak-angular/LICENSE */ import session from 'express-session'; import Keycloak from 'keycloak-connect'; const keycloakConfig = { bearerOnly: true, clientId: 'keycloak-heroes-api', serverUrl: 'http://localhost:8080/auth', realm: 'keycloak-angular' }; let keycloak; export const initKeycloak = app => { const memoryStore = new session.MemoryStore(); keycloak = new Keycloak({ store: memoryStore }, keycloakConfig); app.use(keycloak.middleware()); }; export const authenticated = () => { return keycloak.protect(); }; export const roleAllowed = (roleAllowed = '') => { return keycloak.protect(roleAllowed); };
{ "pile_set_name": "Github" }
/** * @author alteredq / http://alteredqualia.com/ * */ import { Color, ShaderChunk, UniformsLib, UniformsUtils, Vector3, Vector4 } from "../../../build/three.module.js"; /* ------------------------------------------------------------------------------------------ // Basic skin shader // - per-pixel Blinn-Phong diffuse term mixed with half-Lambert wrap-around term (per color component) // - physically based specular term (Kelemen/Szirmay-Kalos specular reflectance) // // - diffuse map // - bump map // - specular map // - point, directional and hemisphere lights (use with "lights: true" material option) // - fog (use with "fog: true" material option) // // ------------------------------------------------------------------------------------------ */ var SkinShaderBasic = { uniforms: UniformsUtils.merge( [ UniformsLib[ "fog" ], UniformsLib[ "lights" ], { "enableBump": { value: 0 }, "enableSpecular": { value: 0 }, "tDiffuse": { value: null }, "tBeckmann": { value: null }, "diffuse": { value: new Color( 0xeeeeee ) }, "specular": { value: new Color( 0x111111 ) }, "opacity": { value: 1 }, "uRoughness": { value: 0.15 }, "uSpecularBrightness": { value: 0.75 }, "bumpMap": { value: null }, "bumpScale": { value: 1 }, "specularMap": { value: null }, "offsetRepeat": { value: new Vector4( 0, 0, 1, 1 ) }, "uWrapRGB": { value: new Vector3( 0.75, 0.375, 0.1875 ) } } ] ), vertexShader: [ "uniform vec4 offsetRepeat;", "varying vec3 vNormal;", "varying vec2 vUv;", "varying vec3 vViewPosition;", ShaderChunk[ "common" ], ShaderChunk[ "lights_pars_begin" ], ShaderChunk[ "fog_pars_vertex" ], "void main() {", " vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );", " vec4 worldPosition = modelMatrix * vec4( position, 1.0 );", " vViewPosition = -mvPosition.xyz;", " vNormal = normalize( normalMatrix * normal );", " vUv = uv * offsetRepeat.zw + offsetRepeat.xy;", " gl_Position = projectionMatrix * mvPosition;", ShaderChunk[ "fog_vertex" ], "}" ].join( "\n" ), fragmentShader: [ "#define USE_BUMPMAP", "uniform bool enableBump;", "uniform bool enableSpecular;", "uniform vec3 diffuse;", "uniform vec3 specular;", "uniform float opacity;", "uniform float uRoughness;", "uniform float uSpecularBrightness;", "uniform vec3 uWrapRGB;", "uniform sampler2D tDiffuse;", "uniform sampler2D tBeckmann;", "uniform sampler2D specularMap;", "varying vec3 vNormal;", "varying vec2 vUv;", "varying vec3 vViewPosition;", ShaderChunk[ "common" ], ShaderChunk[ "bsdfs" ], ShaderChunk[ "packing" ], ShaderChunk[ "lights_pars_begin" ], ShaderChunk[ "fog_pars_fragment" ], ShaderChunk[ "bumpmap_pars_fragment" ], // Fresnel term "float fresnelReflectance( vec3 H, vec3 V, float F0 ) {", " float base = 1.0 - dot( V, H );", " float exponential = pow( base, 5.0 );", " return exponential + F0 * ( 1.0 - exponential );", "}", // Kelemen/Szirmay-Kalos specular BRDF "float KS_Skin_Specular( vec3 N,", // Bumped surface normal " vec3 L,", // Points to light " vec3 V,", // Points to eye " float m,", // Roughness " float rho_s", // Specular brightness " ) {", " float result = 0.0;", " float ndotl = dot( N, L );", " if( ndotl > 0.0 ) {", " vec3 h = L + V;", // Unnormalized half-way vector " vec3 H = normalize( h );", " float ndoth = dot( N, H );", " float PH = pow( 2.0 * texture2D( tBeckmann, vec2( ndoth, m ) ).x, 10.0 );", " float F = fresnelReflectance( H, V, 0.028 );", " float frSpec = max( PH * F / dot( h, h ), 0.0 );", " result = ndotl * rho_s * frSpec;", // BRDF * dot(N,L) * rho_s " }", " return result;", "}", "void main() {", " vec3 outgoingLight = vec3( 0.0 );", // outgoing light does not have an alpha, the surface does " vec4 diffuseColor = vec4( diffuse, opacity );", " vec4 colDiffuse = texture2D( tDiffuse, vUv );", " colDiffuse.rgb *= colDiffuse.rgb;", " diffuseColor = diffuseColor * colDiffuse;", " vec3 normal = normalize( vNormal );", " vec3 viewerDirection = normalize( vViewPosition );", " float specularStrength;", " if ( enableSpecular ) {", " vec4 texelSpecular = texture2D( specularMap, vUv );", " specularStrength = texelSpecular.r;", " } else {", " specularStrength = 1.0;", " }", " #ifdef USE_BUMPMAP", " if ( enableBump ) normal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd() );", " #endif", // point lights " vec3 totalSpecularLight = vec3( 0.0 );", " vec3 totalDiffuseLight = vec3( 0.0 );", " #if NUM_POINT_LIGHTS > 0", " for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {", " vec3 lVector = pointLights[ i ].position + vViewPosition.xyz;", " float attenuation = calcLightAttenuation( length( lVector ), pointLights[ i ].distance, pointLights[ i ].decay );", " lVector = normalize( lVector );", " float pointDiffuseWeightFull = max( dot( normal, lVector ), 0.0 );", " float pointDiffuseWeightHalf = max( 0.5 * dot( normal, lVector ) + 0.5, 0.0 );", " vec3 pointDiffuseWeight = mix( vec3 ( pointDiffuseWeightFull ), vec3( pointDiffuseWeightHalf ), uWrapRGB );", " float pointSpecularWeight = KS_Skin_Specular( normal, lVector, viewerDirection, uRoughness, uSpecularBrightness );", " totalDiffuseLight += pointLight[ i ].color * ( pointDiffuseWeight * attenuation );", " totalSpecularLight += pointLight[ i ].color * specular * ( pointSpecularWeight * specularStrength * attenuation );", " }", " #endif", // directional lights " #if NUM_DIR_LIGHTS > 0", " for( int i = 0; i < NUM_DIR_LIGHTS; i++ ) {", " vec3 dirVector = directionalLights[ i ].direction;", " float dirDiffuseWeightFull = max( dot( normal, dirVector ), 0.0 );", " float dirDiffuseWeightHalf = max( 0.5 * dot( normal, dirVector ) + 0.5, 0.0 );", " vec3 dirDiffuseWeight = mix( vec3 ( dirDiffuseWeightFull ), vec3( dirDiffuseWeightHalf ), uWrapRGB );", " float dirSpecularWeight = KS_Skin_Specular( normal, dirVector, viewerDirection, uRoughness, uSpecularBrightness );", " totalDiffuseLight += directionalLights[ i ].color * dirDiffuseWeight;", " totalSpecularLight += directionalLights[ i ].color * ( dirSpecularWeight * specularStrength );", " }", " #endif", // hemisphere lights " #if NUM_HEMI_LIGHTS > 0", " for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {", " vec3 lVector = hemisphereLightDirection[ i ];", " float dotProduct = dot( normal, lVector );", " float hemiDiffuseWeight = 0.5 * dotProduct + 0.5;", " totalDiffuseLight += mix( hemisphereLightGroundColor[ i ], hemisphereLightSkyColor[ i ], hemiDiffuseWeight );", // specular (sky light) " float hemiSpecularWeight = 0.0;", " hemiSpecularWeight += KS_Skin_Specular( normal, lVector, viewerDirection, uRoughness, uSpecularBrightness );", // specular (ground light) " vec3 lVectorGround = -lVector;", " hemiSpecularWeight += KS_Skin_Specular( normal, lVectorGround, viewerDirection, uRoughness, uSpecularBrightness );", " vec3 hemiSpecularColor = mix( hemisphereLightGroundColor[ i ], hemisphereLightSkyColor[ i ], hemiDiffuseWeight );", " totalSpecularLight += hemiSpecularColor * specular * ( hemiSpecularWeight * specularStrength );", " }", " #endif", " outgoingLight += diffuseColor.xyz * ( totalDiffuseLight + ambientLightColor * diffuse ) + totalSpecularLight;", " gl_FragColor = linearToOutputTexel( vec4( outgoingLight, diffuseColor.a ) );", // TODO, this should be pre-multiplied to allow for bright highlights on very transparent objects ShaderChunk[ "fog_fragment" ], "}" ].join( "\n" ) }; /* ------------------------------------------------------------------------------------------ // Skin shader // - Blinn-Phong diffuse term (using normal + diffuse maps) // - subsurface scattering approximation by four blur layers // - physically based specular term (Kelemen/Szirmay-Kalos specular reflectance) // // - point and directional lights (use with "lights: true" material option) // // - based on Nvidia Advanced Skin Rendering GDC 2007 presentation // and GPU Gems 3 Chapter 14. Advanced Techniques for Realistic Real-Time Skin Rendering // // http://developer.download.nvidia.com/presentations/2007/gdc/Advanced_Skin.pdf // http://http.developer.nvidia.com/GPUGems3/gpugems3_ch14.html // ------------------------------------------------------------------------------------------ */ var SkinShaderAdvanced = { uniforms: UniformsUtils.merge( [ UniformsLib[ "fog" ], UniformsLib[ "lights" ], { "passID": { value: 0 }, "tDiffuse": { value: null }, "tNormal": { value: null }, "tBlur1": { value: null }, "tBlur2": { value: null }, "tBlur3": { value: null }, "tBlur4": { value: null }, "tBeckmann": { value: null }, "uNormalScale": { value: 1.0 }, "diffuse": { value: new Color( 0xeeeeee ) }, "specular": { value: new Color( 0x111111 ) }, "opacity": { value: 1 }, "uRoughness": { value: 0.15 }, "uSpecularBrightness": { value: 0.75 } } ] ), vertexShader: [ "#ifdef VERTEX_TEXTURES", " uniform sampler2D tDisplacement;", " uniform float uDisplacementScale;", " uniform float uDisplacementBias;", "#endif", "varying vec3 vNormal;", "varying vec2 vUv;", "varying vec3 vViewPosition;", ShaderChunk[ "common" ], ShaderChunk[ "fog_pars_vertex" ], "void main() {", " vec4 worldPosition = modelMatrix * vec4( position, 1.0 );", " vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );", " vViewPosition = -mvPosition.xyz;", " vNormal = normalize( normalMatrix * normal );", " vUv = uv;", // displacement mapping " #ifdef VERTEX_TEXTURES", " vec3 dv = texture2D( tDisplacement, uv ).xyz;", " float df = uDisplacementScale * dv.x + uDisplacementBias;", " vec4 displacedPosition = vec4( vNormal.xyz * df, 0.0 ) + mvPosition;", " gl_Position = projectionMatrix * displacedPosition;", " #else", " gl_Position = projectionMatrix * mvPosition;", " #endif", ShaderChunk[ "fog_vertex" ], "}", ].join( "\n" ), vertexShaderUV: [ "varying vec3 vNormal;", "varying vec2 vUv;", "varying vec3 vViewPosition;", ShaderChunk[ "common" ], "void main() {", " vec4 worldPosition = modelMatrix * vec4( position, 1.0 );", " vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );", " vViewPosition = -mvPosition.xyz;", " vNormal = normalize( normalMatrix * normal );", " vUv = uv;", " gl_Position = vec4( uv.x * 2.0 - 1.0, uv.y * 2.0 - 1.0, 0.0, 1.0 );", "}" ].join( "\n" ), fragmentShader: [ "uniform vec3 diffuse;", "uniform vec3 specular;", "uniform float opacity;", "uniform float uRoughness;", "uniform float uSpecularBrightness;", "uniform int passID;", "uniform sampler2D tDiffuse;", "uniform sampler2D tNormal;", "uniform sampler2D tBlur1;", "uniform sampler2D tBlur2;", "uniform sampler2D tBlur3;", "uniform sampler2D tBlur4;", "uniform sampler2D tBeckmann;", "uniform float uNormalScale;", "varying vec3 vNormal;", "varying vec2 vUv;", "varying vec3 vViewPosition;", ShaderChunk[ "common" ], ShaderChunk[ "lights_pars_begin" ], ShaderChunk[ "fog_pars_fragment" ], "float fresnelReflectance( vec3 H, vec3 V, float F0 ) {", " float base = 1.0 - dot( V, H );", " float exponential = pow( base, 5.0 );", " return exponential + F0 * ( 1.0 - exponential );", "}", // Kelemen/Szirmay-Kalos specular BRDF "float KS_Skin_Specular( vec3 N,", // Bumped surface normal " vec3 L,", // Points to light " vec3 V,", // Points to eye " float m,", // Roughness " float rho_s", // Specular brightness " ) {", " float result = 0.0;", " float ndotl = dot( N, L );", " if( ndotl > 0.0 ) {", " vec3 h = L + V;", // Unnormalized half-way vector " vec3 H = normalize( h );", " float ndoth = dot( N, H );", " float PH = pow( 2.0 * texture2D( tBeckmann, vec2( ndoth, m ) ).x, 10.0 );", " float F = fresnelReflectance( H, V, 0.028 );", " float frSpec = max( PH * F / dot( h, h ), 0.0 );", " result = ndotl * rho_s * frSpec;", // BRDF * dot(N,L) * rho_s " }", " return result;", "}", "void main() {", " vec3 outgoingLight = vec3( 0.0 );", // outgoing light does not have an alpha, the surface does " vec4 diffuseColor = vec4( diffuse, opacity );", " vec4 mSpecular = vec4( specular, opacity );", " vec4 colDiffuse = texture2D( tDiffuse, vUv );", " colDiffuse *= colDiffuse;", " diffuseColor *= colDiffuse;", // normal mapping " vec4 posAndU = vec4( -vViewPosition, vUv.x );", " vec4 posAndU_dx = dFdx( posAndU ), posAndU_dy = dFdy( posAndU );", " vec3 tangent = posAndU_dx.w * posAndU_dx.xyz + posAndU_dy.w * posAndU_dy.xyz;", " vec3 normal = normalize( vNormal );", " vec3 binormal = normalize( cross( tangent, normal ) );", " tangent = cross( normal, binormal );", // no normalization required " mat3 tsb = mat3( tangent, binormal, normal );", " vec3 normalTex = texture2D( tNormal, vUv ).xyz * 2.0 - 1.0;", " normalTex.xy *= uNormalScale;", " normalTex = normalize( normalTex );", " vec3 finalNormal = tsb * normalTex;", " normal = normalize( finalNormal );", " vec3 viewerDirection = normalize( vViewPosition );", // point lights " vec3 totalDiffuseLight = vec3( 0.0 );", " vec3 totalSpecularLight = vec3( 0.0 );", " #if NUM_POINT_LIGHTS > 0", " for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {", " vec3 pointVector = normalize( pointLights[ i ].direction );", " float attenuation = calcLightAttenuation( length( lVector ), pointLights[ i ].distance, pointLights[ i ].decay );", " float pointDiffuseWeight = max( dot( normal, pointVector ), 0.0 );", " totalDiffuseLight += pointLightColor[ i ] * ( pointDiffuseWeight * attenuation );", " if ( passID == 1 ) {", " float pointSpecularWeight = KS_Skin_Specular( normal, pointVector, viewerDirection, uRoughness, uSpecularBrightness );", " totalSpecularLight += pointLightColor[ i ] * mSpecular.xyz * ( pointSpecularWeight * attenuation );", " }", " }", " #endif", // directional lights " #if NUM_DIR_LIGHTS > 0", " for( int i = 0; i < NUM_DIR_LIGHTS; i++ ) {", " vec3 dirVector = directionalLights[ i ].direction;", " float dirDiffuseWeight = max( dot( normal, dirVector ), 0.0 );", " totalDiffuseLight += directionalLights[ i ].color * dirDiffuseWeight;", " if ( passID == 1 ) {", " float dirSpecularWeight = KS_Skin_Specular( normal, dirVector, viewerDirection, uRoughness, uSpecularBrightness );", " totalSpecularLight += directionalLights[ i ].color * mSpecular.xyz * dirSpecularWeight;", " }", " }", " #endif", " outgoingLight += diffuseColor.rgb * ( totalDiffuseLight + totalSpecularLight );", " if ( passID == 0 ) {", " outgoingLight = sqrt( outgoingLight );", " } else if ( passID == 1 ) {", //"#define VERSION1", " #ifdef VERSION1", " vec3 nonblurColor = sqrt(outgoingLight );", " #else", " vec3 nonblurColor = outgoingLight;", " #endif", " vec3 blur1Color = texture2D( tBlur1, vUv ).xyz;", " vec3 blur2Color = texture2D( tBlur2, vUv ).xyz;", " vec3 blur3Color = texture2D( tBlur3, vUv ).xyz;", " vec3 blur4Color = texture2D( tBlur4, vUv ).xyz;", //"gl_FragColor = vec4( blur1Color, gl_FragColor.w );", //"gl_FragColor = vec4( vec3( 0.22, 0.5, 0.7 ) * nonblurColor + vec3( 0.2, 0.5, 0.3 ) * blur1Color + vec3( 0.58, 0.0, 0.0 ) * blur2Color, gl_FragColor.w );", //"gl_FragColor = vec4( vec3( 0.25, 0.6, 0.8 ) * nonblurColor + vec3( 0.15, 0.25, 0.2 ) * blur1Color + vec3( 0.15, 0.15, 0.0 ) * blur2Color + vec3( 0.45, 0.0, 0.0 ) * blur3Color, gl_FragColor.w );", " outgoingLight = vec3( vec3( 0.22, 0.437, 0.635 ) * nonblurColor + ", " vec3( 0.101, 0.355, 0.365 ) * blur1Color + ", " vec3( 0.119, 0.208, 0.0 ) * blur2Color + ", " vec3( 0.114, 0.0, 0.0 ) * blur3Color + ", " vec3( 0.444, 0.0, 0.0 ) * blur4Color );", " outgoingLight *= sqrt( colDiffuse.xyz );", " outgoingLight += ambientLightColor * diffuse * colDiffuse.xyz + totalSpecularLight;", " #ifndef VERSION1", " outgoingLight = sqrt( outgoingLight );", " #endif", " }", " gl_FragColor = vec4( outgoingLight, diffuseColor.a );", // TODO, this should be pre-multiplied to allow for bright highlights on very transparent objects ShaderChunk[ "fog_fragment" ], "}" ].join( "\n" ) }; /* ------------------------------------------------------------------------------------------ // Beckmann distribution function // - to be used in specular term of skin shader // - render a screen-aligned quad to precompute a 512 x 512 texture // // - from http://developer.nvidia.com/node/171 ------------------------------------------------------------------------------------------ */ var SkinShaderBeckmann = { uniforms: {}, vertexShader: [ "varying vec2 vUv;", "void main() {", " vUv = uv;", " gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}" ].join( "\n" ), fragmentShader: [ "varying vec2 vUv;", "float PHBeckmann( float ndoth, float m ) {", " float alpha = acos( ndoth );", " float ta = tan( alpha );", " float val = 1.0 / ( m * m * pow( ndoth, 4.0 ) ) * exp( -( ta * ta ) / ( m * m ) );", " return val;", "}", "float KSTextureCompute( vec2 tex ) {", // Scale the value to fit within [0,1] invert upon lookup. " return 0.5 * pow( PHBeckmann( tex.x, tex.y ), 0.1 );", "}", "void main() {", " float x = KSTextureCompute( vUv );", " gl_FragColor = vec4( x, x, x, 1.0 );", "}" ].join( "\n" ) }; export { SkinShaderBasic, SkinShaderAdvanced, SkinShaderBeckmann };
{ "pile_set_name": "Github" }
; RUN: llvm-link %s -S -o - | FileCheck %s ; Check that the constant is not linked and the metadata is correctly referencing a nullptr ; CHECK: !0 = !{!"foo", null, i64 16} target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-apple-macosx10.12.0" @foo = external unnamed_addr constant { [4 x i8*], [32 x i8] }, align 32 !llvm.bitsets = !{!0} !0 = !{!"foo", [4 x i8*]* getelementptr inbounds ({ [4 x i8*], [32 x i8] }, { [4 x i8*], [32 x i8] }* @foo, i32 0, i32 0), i64 16}
{ "pile_set_name": "Github" }
好奇心原文链接:[商业剪报:支付宝推海外交通卡,三星的老大们还没走_商业_好奇心日报-李会娜 黄俊杰](https://www.qdaily.com/articles/4031.html) WebArchive归档链接:[商业剪报:支付宝推海外交通卡,三星的老大们还没走_商业_好奇心日报-李会娜 黄俊杰](http://web.archive.org/web/20190623153501/https://www.qdaily.com/articles/4031.html) ![image](http://ww3.sinaimg.cn/large/007d5XDpgy1g3vdto5fk9j30u03qhhdt)
{ "pile_set_name": "Github" }
// dnlib: See LICENSE.txt for more info using System.Collections.Generic; using System.IO; using System.Text; using dnlib.IO; using dnlib.PE; using dnlib.DotNet.MD; namespace dnlib.DotNet.Writer { /// <summary> /// <see cref="MetaDataHeader"/> options /// </summary> public sealed class MetaDataHeaderOptions { /// <summary> /// Default version string /// </summary> public const string DEFAULT_VERSION_STRING = MDHeaderRuntimeVersion.MS_CLR_20; /// <summary> /// Default header signature /// </summary> public const uint DEFAULT_SIGNATURE = 0x424A5342; /// <summary> /// MD header signature. Default value is <see cref="DEFAULT_SIGNATURE"/> /// </summary> public uint? Signature; /// <summary> /// Major version. Default is 1. MS' CLR supports v0.x (x >= 19) and v1.1, nothing else. /// </summary> public ushort? MajorVersion; /// <summary> /// Minor version. Default is 1. /// </summary> public ushort? MinorVersion; /// <summary> /// Reserved and should be 0. /// </summary> public uint? Reserved1; /// <summary> /// Version string. Default is <see cref="DEFAULT_VERSION_STRING"/>. It's stored as a /// zero-terminated UTF-8 string. Length should be &lt;= 255 bytes. /// </summary> public string VersionString; /// <summary> /// Storage flags should be 0 /// </summary> public StorageFlags? StorageFlags; /// <summary> /// Reserved and should be 0 /// </summary> public byte? Reserved2; } /// <summary> /// Meta data header. IMAGE_COR20_HEADER.MetaData points to this header. /// </summary> public sealed class MetaDataHeader : IChunk { IList<IHeap> heaps; readonly MetaDataHeaderOptions options; uint length; FileOffset offset; RVA rva; /// <inheritdoc/> public FileOffset FileOffset { get { return offset; } } /// <inheritdoc/> public RVA RVA { get { return rva; } } /// <summary> /// Gets/sets the heaps /// </summary> public IList<IHeap> Heaps { get { return heaps; } set { heaps = value; } } /// <summary> /// Default constructor /// </summary> public MetaDataHeader() : this(null) { } /// <summary> /// Constructor /// </summary> /// <param name="options">Options</param> public MetaDataHeader(MetaDataHeaderOptions options) { this.options = options ?? new MetaDataHeaderOptions(); } /// <inheritdoc/> public void SetOffset(FileOffset offset, RVA rva) { this.offset = offset; this.rva = rva; length = 16; length += (uint)GetVersionString().Length; length = Utils.AlignUp(length, 4); length += 4; foreach (var heap in heaps) { length += 8; length += (uint)GetAsciizName(heap.Name).Length; length = Utils.AlignUp(length, 4); } } /// <inheritdoc/> public uint GetFileLength() { return length; } /// <inheritdoc/> public uint GetVirtualSize() { return GetFileLength(); } /// <inheritdoc/> public void WriteTo(BinaryWriter writer) { writer.Write(options.Signature ?? MetaDataHeaderOptions.DEFAULT_SIGNATURE); writer.Write(options.MajorVersion ?? 1); writer.Write(options.MinorVersion ?? 1); writer.Write(options.Reserved1 ?? 0); var s = GetVersionString(); writer.Write(Utils.AlignUp(s.Length, 4)); writer.Write(s); writer.WriteZeros(Utils.AlignUp(s.Length, 4) - s.Length); writer.Write((byte)(options.StorageFlags ?? 0)); writer.Write(options.Reserved2 ?? 0); writer.Write((ushort)heaps.Count); foreach (var heap in heaps) { writer.Write((uint)(heap.FileOffset - offset)); writer.Write(heap.GetFileLength()); writer.Write(s = GetAsciizName(heap.Name)); if (s.Length > 32) throw new ModuleWriterException(string.Format("Heap name '{0}' is > 32 bytes", heap.Name)); writer.WriteZeros(Utils.AlignUp(s.Length, 4) - s.Length); } } byte[] GetVersionString() { return Encoding.UTF8.GetBytes((options.VersionString ?? MetaDataHeaderOptions.DEFAULT_VERSION_STRING) + "\0"); } byte[] GetAsciizName(string s) { return Encoding.ASCII.GetBytes(s + "\0"); } } }
{ "pile_set_name": "Github" }
# $Id$ # Authority: matthias %define gkplugindir %{_libdir}/gkrellm2/plugins %define weatherver 2.0.6 %define xmmsver 2.1.20 %define setiver 0.7.0b %define dnetver 0.12.1 %define volumever 2.1.13 %define mailwatchver 2.4.2 %define snmpver 0.21 %define radiover 2.0.4 %define wirelessver 2.0.3 %define aclockver 0.3.2 %define kamver 2.0.0 %define reminderver 2.0.0 %define moonver 0.6 %define multipingver 2.0.2 %define whover 0.5 %define x86ver 0.0.2 %define ssver 2.6 %define shootver 0.4.2 %define flynnver 0.8 %define ledsver 0.8.1 %define bgchgver 0.1.2 %define trayver 1.02 %define cpufreqver 0.5.2 %define alltraxver 0.2 %define hdplopver 0.9.6 Summary: Some neat plugins for GKrellM Name: gkrellm-plugins Version: 2.2.4 Release: 1%{?dist} License: GPL Group: Applications/System URL: http://web.wt.net/~billw/gkrellm/Plugins.html Source0: http://kmlinux.fjfi.cvut.cz/~makovick/gkrellm/gkrellweather-%{weatherver}.tgz Source1: http://gkrellm.luon.net/files/gkrellmms-%{xmmsver}.tar.gz Source2: http://xavier.serpaggi.free.fr/seti/seti-%{setiver}.tar.bz2 Source3: http://download.sf.net/gkrelldnet/gkrelldnet-%{dnetver}.tar.gz Source4: http://gkrellm.luon.net/files/gkrellm-volume-%{volumever}.tar.gz Source5: http://gkrellm.luon.net/files/gkrellm-mailwatch-%{mailwatchver}.tar.gz Source6: http://triq.net/gkrellm/gkrellm_snmp-%{snmpver}.tar.gz Source7: http://gkrellm.luon.net/files/gkrellm-radio-%{radiover}.tar.gz Source8: http://gkrellm.luon.net/files/gkrellmwireless-%{wirelessver}.tar.gz Source9: http://www.geocities.com/m_muthukumar/gkrellaclock-%{aclockver}.tar.gz Source10: http://download.sf.net/gkrellkam/gkrellkam_%{kamver}.tar.gz Source11: http://web.wt.net/~billw/gkrellm/Plugins/gkrellm-reminder-%{reminderver}.tar.gz Source12: http://download.sf.net/gkrellmoon/gkrellmoon-%{moonver}.tar.gz #Source13: Source14: http://kmlinux.fjfi.cvut.cz/~makovick/gkrellm/gkrellm-multiping-%{multipingver}.tgz #Source15: http://sperion.vuse.vanderbilt.edu/kirk/gkrellmwho2.tgz Source16: http://anchois.free.fr/gkx86info2-%{x86ver}.tar.gz Source17: http://web.wt.net/~billw/gkrellmss/gkrellmss-%{ssver}.tar.gz Source18: http://download.sf.net/gkrellshoot/gkrellshoot-%{shootver}.tar.gz Source19: http://horus.comlab.uni-rostock.de/flynn/gkrellflynn-%{flynnver}.tar.gz Source20: http://heim.ifi.uio.no/~oyvinha/gkleds/gkleds-%{ledsver}.tar.gz Source21: http://www.bender-suhl.de/stefan/comp/sources/gkrellmbgchg2-%{bgchgver}.tar.gz Source22: http://sweb.cz/tripie/gkrellm/trayicons/dist/gkrellm-trayicons-%{trayver}.tar.gz Source23: http://iacs.epfl.ch/~winkelma/gkrellm2-cpufreq/gkrellm2-cpufreq-%{cpufreqver}.tar.gz Source24: http://invalid.url/alltraxclock2_%{alltraxver}-1.tar.gz Source25: http://hules.free.fr/wmhdplop/wmhdplop-%{hdplopver}.tar.gz Patch0: http://xavier.serpaggi.free.fr/seti/seti-0.7.0b-gkrellm2.diff BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root BuildRequires: gkrellm-devel >= 2.1.0, gtk2-devel, perl %description This is a "previously small but now bigger and bigger" ;-) collection of plugins for GKrellM, the GNU Krell Monitor. %package media Summary: Multimedia plugins for GKrellM Group: Applications/System Requires: gkrellm >= 2.1.0, xmms, esound, fftw # gkrellmms BuildRequires: gtk+-devel, xmms-devel BuildRequires: esound-devel, fftw-devel # gkrellmss BuildRequires: gettext %description media This package contains the following multimedia plugins for GKrellM, the GNU Krell Monitor : xmms, volume, radio and esd meter. %package misc Summary: Amusement and miscellaneous plugins for GKrellM Group: Applications/System Requires: gkrellm >= 2.1.0 Requires: perl(LWP::UserAgent) # wmhdplop BuildRequires: imlib2-devel %description misc This package contains the following amusements plugins for GKrellM, the GNU Krell Monitor : Seti@HOME, distributed.net, weather, moon clock, analog clock, gkrellkam, Flynn and background change. %package utils Summary: System and network utility plugins for GKrellM Group: Applications/System Requires: gkrellm >= 2.1.0, ImageMagick %description utils This package contains the following utility plugins for GKrellM, the GNU Krell Monitor : ACPI monitor, mail watch, wireless network monitor, multi ping utility, x86 cpu speed, screenshot/lock and reminder. For the cpufreq plugin, you might want to use visudo and add the following : <your user> ALL = (root) NOPASSWD: /usr/sbin/cpufreqset [0-9]* <your user> ALL = (root) NOPASSWD: /usr/sbin/cpufreqsetgovernor [a-z] %package snmp Summary: SNMP monitoring plugin for GKrellM. Group: Applications/System Requires: gkrellm >= 2.1.0, net-snmp BuildRequires: net-snmp-devel %description snmp This is a snmp monitoring plugin for GKrellM, the GNU Krell Monitor. %prep %setup -T -a0 -a1 -a2 -a3 -a4 -a5 -a6 -a7 -a8 -a9 -a10 -a11 -a12 -a14 -a16 -a17 -a18 -a19 -a20 -a21 -a22 -a23 -a24 -a25 -c %{name}-%{version} # -a13 -a15 %patch0 -p0 # Fix for multiping %{__perl} -pi.orig -e \ 's|/usr/local/lib/gkrellm2/plugins|%{_libdir}/gkrellm2/plugins|g' \ gkrellm-multiping-%{multipingver}/multiping.c %build %{__mkdir} plugins/ bin/ sbin/ man5/ # Nearly no configure macro here, hence manual exports... export CFLAGS="%{optflags}" export CXXFLAGS="%{optflags}" ( cd gkrellweather-%{weatherver} ; make PREFIX=%{_prefix} ; mv *.so ../plugins// ; cp GrabWeather ../bin/ ) # gkrellmms contains locales, skipping them for now. ( cd gkrellmms ; make ; mv *.so ../plugins/ ) ( cd seti-%{setiver} ; make ; mv *.so ../plugins/ ) ( cd gkrelldnet-%{dnetver} ; make ; mv *.so ../plugins/ ; cp dnetw ../bin/ ) # volume plugin contains locales, skipping them for now. ( cd gkrellm-volume ; make ; mv *.so ../plugins/ ) ( cd gkrellm-mailwatch ; make ; mv *.so ../plugins/ ) # cd gkrellm_snmp-%{snmpver} ; make ; mv *.so ../plugins/ ) # radio has locales as well... ( cd gkrellm-radio ; make ; mv *.so ../plugins/ ) ( cd gkrellmwireless ; make ; mv *.so ../plugins/ ) ( cd gkrellAclock-%{aclockver} ; make ; mv *.so ../plugins/ ) ( cd gkrellkam-%{kamver} ; make ; mv *.so ../plugins/ ; mv *.5 ../man5/ ) ( cd gkrellm-reminder-%{reminderver} ; make ; mv *.so ../plugins/ ) ( cd gkrellmoon-%{moonver} ; make ; mv *.so ../plugins/ ) ( cd gkrellm-multiping-%{multipingver} ; make ; mv *.so ../plugins/ ; cp pinger ../plugins/ ) #( cd gkrellmwho2 ; make ; mv *.so ../plugins/ ) ( cd gkrellmss-%{ssver} ; make ; mv src/*.so ../plugins/ ) ( cd gkrellShoot-%{shootver} ; make ; mv *.so ../plugins/ ) ( cd gkrellflynn-%{flynnver} ; make gkrellm2 ; mv *.so ../plugins/ ) ( cd gkleds-%{ledsver} ; make ; mv *.so ../plugins/ ) ( cd gkrellmbgchg2-%{bgchgver} ; make ; mv *.so ../plugins/ ) ( cd gkrellm-trayicons-%{trayver} ; make ; mv *.so ../plugins/ ) ( cd gkrellm2-cpufreq-%{cpufreqver} ; make ; mv *.so ../plugins/ ; cp cpufreqset cpufreqsetgovernor ../sbin/ ) ( cd alltraxclock2_%{alltraxver} ; make ; mv *.so ../plugins/ ) ( cd wmhdplop-%{hdplopver} ; ./configure && make ; mv gkhdplop.so ../plugins/ ) %ifarch %ix86 ( cd gkx86info%{x86ver} ; ./build ; mv *.so ../plugins/ ) %endif %install %{__rm} -rf %{buildroot} %{__mkdir_p} %{buildroot}%{gkplugindir} %{__mkdir_p} %{buildroot}%{_bindir} %{__mkdir_p} %{buildroot}%{_sbindir} %{__install} -m 0755 plugins/* %{buildroot}%{gkplugindir}/ %{__install} -m 0755 bin/* %{buildroot}%{_bindir}/ %{__install} -m 0755 sbin/* %{buildroot}%{_sbindir}/ # Man pages %{__mkdir_p} %{buildroot}%{_mandir}/man5 %{__install} -m 644 `find . -type f -name "*.5"` %{buildroot}%{_mandir}/man5/ %clean %{__rm} -rf %{buildroot} %files media %defattr(-, root, root, 0755) %{gkplugindir}/gkrellmms.so %{gkplugindir}/volume.so %{gkplugindir}/radio.so %{gkplugindir}/gkrellmss.so %files misc %defattr(-, root, root, 0755) %{gkplugindir}/seti.so # Code needs cleanup to compile on non x86 %ifarch %{ix86} %{gkplugindir}/gkrelldnet.so %{_bindir}/dnetw %endif %{gkplugindir}/gkrellmoon.so %{gkplugindir}/gkrellaclock.so %{gkplugindir}/gkrellweather.so %{_bindir}/GrabWeather %{gkplugindir}/gkrellkam2.so %{_mandir}/man5/gkrellkam* %{gkplugindir}/gkrellflynn.so %{gkplugindir}/gkrellmbgchg.so %{gkplugindir}/trayicons.so %{gkplugindir}/alltraxclock.so %{gkplugindir}/gkhdplop.so %files utils %defattr(-, root, root, 0755) %{_sbindir}/cpufreqset %{_sbindir}/cpufreqsetgovernor %{gkplugindir}/mailwatch.so %{gkplugindir}/wireless.so %{gkplugindir}/reminder.so %{gkplugindir}/multiping.so %{gkplugindir}/pinger %{gkplugindir}/gkrellshoot.so # Code needs cleanup to compile on non x86 %ifarch %{ix86} %{gkplugindir}/gkleds.so %endif %{gkplugindir}/cpufreq.so %ifarch %ix86 %{gkplugindir}/gkx86info.so %endif #%files snmp #%defattr(-, root, root, 0755) #%{gkplugindir}/gkrellm_snmp.so %changelog * Tue Mar 1 2005 Matthias Saou <http://freshrpms.net/> 2.2.4-1 - Fix build dep to imlib2-devel for hdplop. - Disable non building dnetc and leds for non-x86. Later fixing required. * Thu Nov 4 2004 Matthias Saou <http://freshrpms.net/> 2.2.4-1 - Updated shoot, cpufreq and volume plugins. - Updated file name for gk86info2. - Known gkrellm2 alltraxclock web page seems gone :-( - Added hdplop. - Fixed gkrellweather and multiping paths, thanks to Kevin Otte for reporting. * Wed May 26 2004 Matthias Saou <http://freshrpms.net/> 2.2.0-1 - Updated plugins and added tray icon and cpufreq plugins. * Wed Feb 4 2004 Matthias Saou <http://freshrpms.net/> 2.1.12-4 - Updated all plugins from luon.net (xmms, volume, wireless, radio). - Removed obsolete gkacpi plugin, gkrellm handles temp and battery on its own. * Sun Nov 23 2003 Matthias Saou <http://freshrpms.net/> 2.1.12-3 - Updated gkacpi to 0.5 + patch from Ronny Buchmann. * Fri Nov 7 2003 Matthias Saou <http://freshrpms.net/> 2.1.12-2 - Rebuild for Fedora Core 1. - Updated volume plugin. * Thu Jun 19 2003 Matthias Saou <http://freshrpms.net/> - Updates xmms (2.1.12), mailwatch (2.4.2) and volume (2.1.8). * Mon Jun 16 2003 Matthias Saou <http://freshrpms.net/> - Updates xmms (2.1.11), mailwatch (2.4.1), weather (2.0.6), gkacpi2 (0.4). - Added bgchg2 (0.0.5). - Readded snmp (0.19-pre4), but still disabled (problems with net-snmp). - Removed all obsolete plugins. * Mon Mar 31 2003 Matthias Saou <http://freshrpms.net/> - Rebuilt for Red Hat Linux 9. - Update mailwatch (2.3.1), gkrellmms (2.1.9). * Tue Mar 11 2003 Matthias Saou <http://freshrpms.net/> - Exclude gkx86info on non-x86 platforms. * Wed Jan 29 2003 Matthias Saou <http://freshrpms.net/> - Added gkleds 0.8.1. * Sun Jan 26 2003 Ville Skyttä <ville.skytta at iki.fi> - 2:2.1.6-fr1 - Updated multiping (2.0.2), gkrellmms (2.1.7), volume (2.1.7), mailwatch (2.2.2), radio (2.0.3) and gkrelldnet (0.12.1). - Rebuilt with GKrellm 2.1.6. * Sun Jan 5 2003 Ville Skyttä <ville.skytta at iki.fi> - 2:2.1.4-fr1 - Updated gkrellmoon (0.6), gkrellweather (2.0.5), gkrellm-radio (2.0.2), gkrellmms (2.1.6), mailwatch (2.1), wireless (2.0.2) and gkrelldnet (0.12). - Re-added gkrellm-reminder (2.0.0). - Rebuilt with GKrellM 2.1.4. * Thu Nov 28 2002 Matthias Saou <http://freshrpms.net/> - Updated gkrellmms to 2.1.5. * Wed Nov 20 2002 Ville Skyttä <ville.skytta at iki.fi> - 2:2.1.0-fr5 - Updated gkrellweather, gkrellmms, gkrellmwireless and volume plugins. * Tue Oct 29 2002 Matthias Saou <http://freshrpms.net/> - Added gkrellm2 versions of gkrellmkam, gkx86 and gkrellmoon. * Mon Oct 21 2002 Matthias Saou <http://freshrpms.net/> - Re-added gkrellmss, I missed that one! - Replaced gkrellmPing by multiping (deactivated, bad binary search path!). - Added Flynn ;-) * Sat Oct 19 2002 Ville Skyttä <ville.skytta at iki.fi> 2:2.1.0-fr2 - Re-added GkrellWeather. * Fri Oct 11 2002 Ville Skyttä <ville.skytta at iki.fi> 2:2.1.0-fr1 - Re-added GkACPI. - Rebuild with GKrellM 2.1.0. * Wed Oct 9 2002 Ville Skyttä <ville.skytta at iki.fi> 2:2.0.4-fr2 - Re-added SETI@Home, built with patch from the author homepage. * Sun Oct 6 2002 Ville Skyttä <ville.skytta at iki.fi> 2:2.0.4-fr1 - Rebuild with Red Hat 8.0 and GKrellM 2.0.4. - Update aclock, gkrelldnet, gkrellmms, volume, mailwatch, wireless, radio and gkrellshoot. - Remove acpi, gkrinn, gamma, ping, mouse, snmp, gkrellmss, earth_anim, logwatch, seti, who, gnome, consolewatch, moon clock, newsticker, gkrellkam, reminder, x86info, taskman and weather for now (they don't build with 2.0 or have missing requirements). * Wed Jul 31 2002 Ville Skyttä <ville.skytta at iki.fi> 2:1.2.13-fr1 - Updated gkacpi, gkrelldnet, gkrellshoot, gkrellm-radio, gkrellmms and consolewatch. - Added gamma. - Removed gkrellmms patch, no longer needed. - Fixed incorrect note about gkrellmss in changelog of 1.2.11-fr1. - Use $RPM_OPT_FLAGS when compiling. - BuildRequires gtk+-devel and db1-devel. - Rebuilt with GKrellM 1.2.13. * Fri May 3 2002 Matthias Saou <http://freshrpms.net/> - Rebuilt against Red Hat Linux 7.3. * Tue Apr 2 2002 Ville Skyttä <ville.skytta at iki.fi> 1.2.11-fr1 - Added Gk-Taskman and GKrellShoot. - Added a patch for gkrellmms to make it compile with 1.2.11. - Updated aclock, gkrellkam, gkrellm-newsticker, radio, reminder and seti. - Didn't update gkrellmss because 0.4 would require fftw, which we don't have. - Rebuilt with GKrellM 1.2.11. * Tue Jan 8 2002 Ville Skyttä <ville.skytta at iki.fi> - Updated seven plugins : seti, gkrelldnet, mailwatch, gkrellm-radio, gkrellkam, gkrellm-newsticker and reminder. - GKrellKam now actually belongs to a package (misc) :) - Added missing requirements for gnome, newsticker and snmp. - Rebuilt with GKrellM 1.2.8 * Fri Oct 12 2001 Matthias Saou <http://freshrpms.net/> - Updated at last! So many plugins were added that I've decided to now package into categories and not as individual RPMs any more. - New packages include : earth_anim, gkrellAclock, gkrellkam, newsticker, reminder, gkrellmoon, gkrinn, glogwatch, gkacpi, gkrellmouse, gkrellmPing, gkrellmwho, x86info, gkrellmss, gkrellm-gnome, consolewatch. - FIXME : Need to add the Gnome applet :-) * Fri Apr 20 2001 Matthias Saou <http://freshrpms.net/> - Updated five plugins : weather, dnet, mailwatch, snmp and radio. - Rebuilt for Red Hat 7.1. * Thu Feb 15 2001 Matthias Saou <http://freshrpms.net/> - Updated three plugins : dnetc, seti and snmp. - Added two plugins : radio and wireless. * Tue Jan 30 2001 Matthias Saou <http://freshrpms.net/> - Split all the plugins in individual packages. * Mon Jan 29 2001 Matthias Saou <http://freshrpms.net/> - Initial RPM release.
{ "pile_set_name": "Github" }
/******************************************************************** * 2014 - * open source under Apache License Version 2.0 ********************************************************************/ /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "client/FileSystem.h" #include "client/FileSystemInter.h" #include "client/FileSystemKey.h" #include "client/InputStream.h" #include "client/OutputStream.h" #include "client/OutputStream.h" #include "client/Permission.h" #include "DateTime.h" #include "Exception.h" #include "ExceptionInternal.h" #include "gtest/gtest.h" #include "Logger.h" #include "Memory.h" #include "server/NamenodeInfo.h" #include "TestUtil.h" #include "XmlConfig.h" #include <ctime> #ifndef TEST_HDFS_PREFIX #define TEST_HDFS_PREFIX "./" #endif #define BASE_DIR TEST_HDFS_PREFIX"/testSecureHA/" using namespace Hdfs; using namespace Hdfs::Internal; class TestKerberosConnect : public ::testing::Test { public: TestKerberosConnect() : conf("function-secure.xml") { std::stringstream ss; ss.imbue(std::locale::classic()); ss << "/tmp/krb5cc_"; ss << getuid(); const char * userCCpath = GetEnv("LIBHDFS3_TEST_USER_CCPATH", ss.str().c_str()); conf.set("hadoop.security.kerberos.ticket.cache.path", userCCpath); } ~TestKerberosConnect() { } protected: Config conf; }; TEST_F(TestKerberosConnect, connect) { FileSystem fs(conf); ASSERT_NO_THROW(DebugException(fs.connect())); } TEST_F(TestKerberosConnect, GetDelegationToken_Failure) { FileSystem fs(conf); ASSERT_NO_THROW(DebugException(fs.connect())); EXPECT_THROW(fs.getDelegationToken(NULL), InvalidParameter); EXPECT_THROW(fs.getDelegationToken(""), InvalidParameter); fs.disconnect(); } TEST_F(TestKerberosConnect, DelegationToken_Failure) { std::string token; FileSystem fs(conf); ASSERT_NO_THROW(DebugException(fs.connect())); EXPECT_THROW(DebugException(fs.renewDelegationToken(token)), HdfsInvalidBlockToken); ASSERT_NO_THROW(token = fs.getDelegationToken("Unknown")); EXPECT_THROW(fs.renewDelegationToken(token), AccessControlException); ASSERT_NO_THROW(token = fs.getDelegationToken()); ASSERT_NO_THROW(fs.cancelDelegationToken(token)); EXPECT_THROW(DebugException(fs.renewDelegationToken(token)), HdfsInvalidBlockToken); EXPECT_THROW(DebugException(fs.cancelDelegationToken(token)), HdfsInvalidBlockToken); fs.disconnect(); } TEST_F(TestKerberosConnect, DelegationToken) { FileSystem fs(conf); ASSERT_NO_THROW(DebugException(fs.connect())); ASSERT_NO_THROW({ std::string token = fs.getDelegationToken(); fs.renewDelegationToken(token); fs.cancelDelegationToken(token); }); fs.disconnect(); } TEST(TestDeletationToken, ToFromString) { Token t1, t2; std::string str; ASSERT_NO_THROW(str = t1.toString()); ASSERT_NO_THROW(t2.fromString(str)); EXPECT_TRUE(t1 == t2); t1.setIdentifier("test"); ASSERT_NO_THROW(str = t1.toString()); ASSERT_NO_THROW(t2.fromString(str)); EXPECT_TRUE(t1 == t2); t1.setPassword("test"); ASSERT_NO_THROW(str = t1.toString()); ASSERT_NO_THROW(t2.fromString(str)); EXPECT_TRUE(t1 == t2); t1.setKind("test"); ASSERT_NO_THROW(str = t1.toString()); ASSERT_NO_THROW(t2.fromString(str)); EXPECT_TRUE(t1 == t2); t1.setService("test"); ASSERT_NO_THROW(str = t1.toString()); ASSERT_NO_THROW(t2.fromString(str)); EXPECT_TRUE(t1 == t2); } class TestToken: public ::testing::Test { public: TestToken() { Config conf("function-secure.xml"); std::stringstream ss; ss.imbue(std::locale::classic()); ss << "/tmp/krb5cc_"; ss << getuid(); const char * userCCpath = GetEnv("LIBHDFS3_TEST_USER_CCPATH", ss.str().c_str()); conf.set("hadoop.security.kerberos.ticket.cache.path", userCCpath); fs = shared_ptr<FileSystem> (new FileSystem(conf)); fs->connect(); try { fs->deletePath(BASE_DIR, true); } catch (...) { } fs->mkdirs(BASE_DIR, 0755); relengBin = GetEnv("RELENG_BIN", "./"); } ~TestToken() { try { fs->disconnect(); } catch (...) { } } protected: shared_ptr<FileSystem> fs; std::string relengBin; }; class TestNamenodeHA: public TestToken { public: void switchToStandbyNamenode() { std::string cmd = relengBin + "/ha_failover.sh"; int rc = std::system(cmd.c_str()); if (rc) { LOG(WARNING, "failed to invoke ha_failover.sh, return code is %d", rc); } } void CheckFileContent(const std::string & path, int64_t len, size_t offset, bool switchNamenode = false) { InputStream in; EXPECT_NO_THROW(in.open(*fs, path.c_str(), true)); std::vector<char> buff(20 * 1024); int rc, todo = len, batch; while (todo > 0) { if (switchNamenode && todo < len / 2) { switchToStandbyNamenode(); switchNamenode = false; } batch = todo < static_cast<int>(buff.size()) ? todo : buff.size(); batch = in.read(&buff[0], batch); EXPECT_TRUE(batch > 0); todo = todo - batch; rc = Hdfs::CheckBuffer(&buff[0], batch, offset); offset += batch; EXPECT_TRUE(rc); } EXPECT_NO_THROW(in.close()); } }; static void TestInputOutputStream(FileSystem & fs) { OutputStream out; ASSERT_NO_THROW(DebugException(out.open(fs, BASE_DIR "file", Create, 0644, true, 0, 1024))); std::vector<char> buffer(1024 * 3 + 1); FillBuffer(&buffer[0], buffer.size(), 0); ASSERT_NO_THROW(DebugException(out.append(&buffer[0], buffer.size()))); ASSERT_NO_THROW(out.sync()); InputStream in; ASSERT_NO_THROW(DebugException(in.open(fs, BASE_DIR "file"))); memset(&buffer[0], 0, buffer.size()); ASSERT_NO_THROW(DebugException(in.readFully(&buffer[0], buffer.size()))); EXPECT_TRUE(CheckBuffer(&buffer[0], buffer.size(), 0)); ASSERT_NO_THROW(in.close()); ASSERT_NO_THROW(out.close()); } TEST_F(TestToken, BlockToken) { TestInputOutputStream(*fs); } static void VerifyToken(const std::string & token, const std::string & host, const std::string & port) { std::stringstream ss; ss.imbue(std::locale::classic()); ss << "curl -o /tmp/VerifyToken.out --silent --no-buffer -i \"http://" << host << ":" << port << "/webhdfs/v1/?op=GETHOMEDIRECTORY&delegation=" << token << "\"" << std::endl; std::cerr << "cmd: " << ss.str(); ASSERT_EQ(0, std::system(ss.str().c_str())); ASSERT_EQ(0, access("/tmp/VerifyToken.out", R_OK)); ASSERT_EQ(0, std::system("grep -E '200 OK|StandbyException' /tmp/VerifyToken.out")); } static void ExtractHostPort(const std::string & uri, std::string & host, std::string & port) { std::stringstream ss; ss.imbue(std::locale::classic()); if (NULL == strstr(uri.c_str(), "://")) { ss << "hdfs://" << uri; } else { ss << uri; } FileSystemKey key(ss.str(), NULL); host = key.getHost(); port = key.getPort(); } TEST_F(TestToken, DelegatationToken) { std::string token; Hdfs::Internal::Token t; std::string host, port; Config conf("function-secure.xml"); std::string namenode = conf.getString("dfs.default.uri"); std::vector<NamenodeInfo> namenodes; int count = 1000; for (int i = 0; i < count; ++i) { ExtractHostPort(namenode, host, port); ASSERT_NO_THROW(token = fs->getDelegationToken()); ASSERT_NO_THROW(DebugException(t.fromString(token))); try { namenodes = NamenodeInfo::GetHANamenodeInfo(host, conf); for (size_t i = 0; i < namenodes.size(); ++i) { ExtractHostPort(namenodes[i].getHttpAddr(), host, port); VerifyToken(token, host, port); } } catch (HdfsConfigNotFound & e) { VerifyToken(token, host, "50070"); } ASSERT_NO_THROW(fs->cancelDelegationToken(token)); } } TEST_F(TestToken, DelegatationTokenAccess) { std::string token; ASSERT_NO_THROW(token = fs->getDelegationToken()); Config conf("function-secure.xml"); FileSystem tempfs(conf); ASSERT_NO_THROW(tempfs.connect(conf.getString("dfs.default.uri"), NULL, token.c_str())); TestInputOutputStream(tempfs); ASSERT_NO_THROW(fs->cancelDelegationToken(token)); } TEST_F(TestNamenodeHA, Throughput) { const char * filename = BASE_DIR"TestNamenodeHA"; std::vector<char> buffer(64 * 1024); int64_t fileLength = 5 * 1024 * 1024 * 1024ll; int64_t todo = fileLength, batch; size_t offset = 0; OutputStream ous; bool switchNamenode = true; EXPECT_NO_THROW(DebugException(ous.open(*fs, filename, Create | Overwrite /*| SyncBlock*/))); while (todo > 0) { if (switchNamenode && todo < fileLength / 2) { switchToStandbyNamenode(); switchNamenode = false; } batch = todo < static_cast<int>(buffer.size()) ? todo : buffer.size(); Hdfs::FillBuffer(&buffer[0], batch, offset); ASSERT_NO_THROW(DebugException(ous.append(&buffer[0], batch))); todo -= batch; offset += batch; } ASSERT_NO_THROW(DebugException(ous.close())); CheckFileContent(filename, fileLength, 0, true); } static void CreateFile(FileSystem & fs, const std::string & path) { OutputStream ous; ASSERT_NO_THROW(DebugException(ous.open(fs, path.c_str()))); ASSERT_NO_THROW(ous.sync()); ASSERT_NO_THROW(ous.close()); } static void AppendFile(FileSystem & fs, const std::string & path, int64_t len) { OutputStream ous; ous.open(fs, path.c_str(), Append | SyncBlock, 0755, true); size_t offset = 0; int64_t todo = len, batch; std::vector<char> buffer(32 * 1024); while (todo > 0) { batch = static_cast<int64_t>(buffer.size()) < todo ? buffer.size() : todo; Hdfs::FillBuffer(&buffer[0], batch, offset); ASSERT_NO_THROW(DebugException(ous.append(&buffer[0], batch))); todo -= batch; offset += batch; } ASSERT_NO_THROW(ous.sync()); ASSERT_NO_THROW(ous.close()); } TEST_F(TestNamenodeHA, SmallFiles) { int count = 100; int64_t filesize = 32 * 1024 * 1024ll; const char * filename = BASE_DIR"smallfile"; std::vector<std::string> paths; bool switchNamenode = true; for (int i = 0; i < count; ++i) { std::stringstream ss; ss.imbue(std::locale::classic()); ss << filename << i; paths.push_back(ss.str()); } /* * test create */ for (int i = 0; i < count; ++i) { if (switchNamenode && i > count / 2) { switchToStandbyNamenode(); switchNamenode = false; } CreateFile(*fs, paths[i]); } /* * test append */ switchNamenode = true; for (int i = 0; i < count; ++i) { if (switchNamenode && i > count / 2) { switchToStandbyNamenode(); switchNamenode = false; } AppendFile(*fs, paths[i], filesize); } /* * test read */ switchNamenode = true; for (int i = 0; i < count; ++i) { if (switchNamenode && i > count / 2) { switchToStandbyNamenode(); switchNamenode = false; } CheckFileContent(paths[i], filesize, 0); } }
{ "pile_set_name": "Github" }
package nl.utwente.viskell.haskell.type; import nl.utwente.viskell.haskell.expr.Expression; import java.util.List; import java.util.logging.Level; import java.util.logging.Logger; /** * Implementation of a typechecker for a simplified variant of Haskell. */ public final class TypeChecker { /** * Logger for this class. */ private static final Logger logger = Logger.getLogger(TypeChecker.class.getName()); static { TypeChecker.logger.setLevel(Level.WARNING); // Changing this to Level.INFO will show debug messages. } /** * Private constructor - methods in this class are static. */ private TypeChecker() { } public static void unify(final Expression context, final Type a, final Type b) throws HaskellTypeError { TypeChecker.unify(context.toString(), a, b); } public static void unify(final String context, final Type a, final Type b) throws HaskellTypeError { TypeChecker.logger.info(String.format("Unifying types %s and %s for context %s", a, b, context)); if (a.equals(b)) { // for identical types unifying is trivial } else if (a instanceof TypeVar) { TypeVar va = (TypeVar) a; // First, prevent ourselves from going into an infinite loop if (b.containsOccurenceOf(va)) { TypeChecker.logger.info(String.format("Recursion in types %s and %s for context %s", a, b, context)); throw new HaskellTypeError(String.format("%s ∈ %s in context of %s", a, b, context)); } if (va.hasConcreteInstance()) { // if a type variable has been instantiated already then we can just unify b with a concrete type of a TypeChecker.unify(context, va.getInstantiatedType(), b); } else if (b instanceof TypeVar) { TypeVar vb = (TypeVar) b; if (vb.hasConcreteInstance()) { // with type variable b instantiated continue with unifying type variable a with the concrete type of b TypeChecker.unify(context, va, vb.getInstantiatedType()); } else { // two plain type variable are unified by sharing the internal reference of (future) type instance vb.unifyWith(va); } } else if (b instanceof ConcreteType) { ConcreteType tb = (ConcreteType) b; // check that the type satisfy the constraints TypeChecker.satisfyConstraints(tb, va.getConstraints(), context); // then make the type variable instantiated by this concrete type va.setConcreteInstance(tb); } } else if (b instanceof TypeVar && a instanceof ConcreteType) { // Example: we have to unify Int and α. // Same as above, but mirrored. TypeChecker.unify(context, b, a); } else if (a instanceof TypeCon && b instanceof TypeCon) { final TypeCon ca = (TypeCon) a; final TypeCon cb = (TypeCon) b; // unification of type constructor is just name equality if (! ca.getName().equals(cb.getName())) { TypeChecker.logger.info(String.format("Mismatching TypeCon %s and %s for context %s", a, b, context)); throw new HaskellTypeError(String.format("%s ⊥ %s in context of %s", a, b, context)); } } else if (a instanceof FunType && b instanceof FunType) { // Unifying function types is pairwise unification of its argument and result. FunType fa = (FunType) a; FunType fb = (FunType) b; TypeChecker.unify(context, fa.getArgument(), fb.getArgument()); TypeChecker.unify(context, fa.getResult(), fb.getResult()); } else if (a instanceof TypeApp && b instanceof TypeApp) { // Unifying type applications is pairwise unification of its typeFun and typeArg. TypeApp ta = (TypeApp) a; TypeApp tb = (TypeApp) b; TypeChecker.unify(context, ta.getTypeFun(), tb.getTypeFun()); TypeChecker.unify(context, ta.getTypeArg(), tb.getTypeArg()); } else { // Running out of things that can be unified, so bail out with a type error. TypeChecker.logger.info(String.format("Given up to unify types %s and %s for context %s", a, b, context)); throw new HaskellTypeError(String.format("%s ⊥ %s in context of %s", a, b, context)); } } /** * Check and enforce that a type matches a set of type class constraints. * * @param type A concrete type which is affected by the constraints * @param constraints The set of constraint that need to be satisfied. * @param context the expression string to use as context in errors. * @throws HaskellTypeError if the constraints can no be satisfied by this type. */ protected static void satisfyConstraints(Type type, ConstraintSet constraints, String context) throws HaskellTypeError { if (! constraints.hasConstraints()) { // empty constraints are always satisfied. return; } if (type instanceof TypeVar) { TypeVar tv = (TypeVar) type; if (tv.hasConcreteInstance()) { // just constrain the concrete instantiation TypeChecker.satisfyConstraints(tv.getInstantiatedType(), constraints, context); return; } else { // add extra constraint for this type variable tv.introduceConstrainst(constraints); return; } } else if (type instanceof TypeCon) { TypeCon tc = (TypeCon)type; // directly check if all constraints are satisfied if (constraints.allConstraintsMatch(tc)) { return; } } else if (type instanceof TypeApp) { TypeApp ta = (TypeApp)type; List<Type> chain = ta.asFlattenedAppChain(); Type ctype = chain.remove(0); // use the instantiated type instead, if available. if (ctype instanceof TypeVar && ((TypeVar)ctype).hasConcreteInstance()) { ctype = ((TypeVar)ctype).getInstantiatedType(); } // check if the head of a type application chain is a known type constructor if (ctype instanceof TypeCon) { TypeCon tc = (TypeCon)ctype; if (constraints.allConstraintsMatch(tc)) { // also for all type arguments add implied constraint as needed int arity = chain.size(); List<ConstraintSet> argConstraints = constraints.getImpliedArgConstraints(tc, arity); for (int i = 0; i < arity; i++) { TypeChecker.satisfyConstraints(chain.get(i), argConstraints.get(i), context); } // all satisfied, done return; } } else if (ctype instanceof TypeVar) { // in case of a type variable application we add the constraints ta.extendConstraints(constraints); ((TypeVar)ctype).addConstrainedTypeApp(ta); // done for now, the constraint satisfaction check is deferred to later return; } } // for now, constraining other types will fail. TypeChecker.logger.info(String.format("Unable to unify types %s with constraints %s for context %s", type, constraints, context)); throw new HaskellTypeError(String.format("%s ∉ constraints of %s in context of %s", type, constraints, context)); } }
{ "pile_set_name": "Github" }
package slack import ( "fmt" "net/url" ) // StartRTM calls the "rtm.start" endpoint and returns the provided URL and the full Info // block. // // To have a fully managed Websocket connection, use `NewRTM`, and call `ManageConnection()` // on it. func (api *Client) StartRTM() (info *Info, websocketURL string, err error) { response := &infoResponseFull{} err = post("rtm.start", url.Values{"token": {api.config.token}}, response, api.debug) if err != nil { return nil, "", fmt.Errorf("post: %s", err) } if !response.Ok { return nil, "", response.Error } // websocket.Dial does not accept url without the port (yet) // Fixed by: https://github.com/golang/net/commit/5058c78c3627b31e484a81463acd51c7cecc06f3 // but slack returns the address with no port, so we have to fix it api.Debugln("Using URL:", response.Info.URL) websocketURL, err = websocketizeURLPort(response.Info.URL) if err != nil { return nil, "", fmt.Errorf("parsing response URL: %s", err) } return &response.Info, websocketURL, nil } // NewRTM returns a RTM, which provides a fully managed connection to // Slack's websocket-based Real-Time Messaging protocol./ func (api *Client) NewRTM() *RTM { return newRTM(api) }
{ "pile_set_name": "Github" }
--- title: ZeroConf Support description: Swirl supports peer and stream detection via mDNS or ZeroConf protocol menu: main weight: 1000 draft: false --- This page is unintentionally left blank. We're working on more documentation all the time.
{ "pile_set_name": "Github" }
<?php /* * This file is part of the Symfony package. * * (c) Fabien Potencier <[email protected]> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\VarDumper\Caster; use Symfony\Component\VarDumper\Cloner\Stub; /** * Casts DateTimeInterface related classes to array representation. * * @author Dany Maillard <[email protected]> */ class DateCaster { private const PERIOD_LIMIT = 3; public static function castDateTime(\DateTimeInterface $d, array $a, Stub $stub, $isNested, $filter) { $prefix = Caster::PREFIX_VIRTUAL; $location = $d->getTimezone()->getLocation(); $fromNow = (new \DateTime())->diff($d); $title = $d->format('l, F j, Y') ."\n".self::formatInterval($fromNow).' from now' .($location ? ($d->format('I') ? "\nDST On" : "\nDST Off") : '') ; $a = []; $a[$prefix.'date'] = new ConstStub(self::formatDateTime($d, $location ? ' e (P)' : ' P'), $title); $stub->class .= $d->format(' @U'); return $a; } public static function castInterval(\DateInterval $interval, array $a, Stub $stub, $isNested, $filter) { $now = new \DateTimeImmutable(); $numberOfSeconds = $now->add($interval)->getTimestamp() - $now->getTimestamp(); $title = number_format($numberOfSeconds, 0, '.', ' ').'s'; $i = [Caster::PREFIX_VIRTUAL.'interval' => new ConstStub(self::formatInterval($interval), $title)]; return $filter & Caster::EXCLUDE_VERBOSE ? $i : $i + $a; } private static function formatInterval(\DateInterval $i) { $format = '%R '; if (0 === $i->y && 0 === $i->m && ($i->h >= 24 || $i->i >= 60 || $i->s >= 60)) { $i = date_diff($d = new \DateTime(), date_add(clone $d, $i)); // recalculate carry over points $format .= 0 < $i->days ? '%ad ' : ''; } else { $format .= ($i->y ? '%yy ' : '').($i->m ? '%mm ' : '').($i->d ? '%dd ' : ''); } $format .= $i->h || $i->i || $i->s || $i->f ? '%H:%I:'.self::formatSeconds($i->s, substr($i->f, 2)) : ''; $format = '%R ' === $format ? '0s' : $format; return $i->format(rtrim($format)); } public static function castTimeZone(\DateTimeZone $timeZone, array $a, Stub $stub, $isNested, $filter) { $location = $timeZone->getLocation(); $formatted = (new \DateTime('now', $timeZone))->format($location ? 'e (P)' : 'P'); $title = $location && \extension_loaded('intl') ? \Locale::getDisplayRegion('-'.$location['country_code']) : ''; $z = [Caster::PREFIX_VIRTUAL.'timezone' => new ConstStub($formatted, $title)]; return $filter & Caster::EXCLUDE_VERBOSE ? $z : $z + $a; } public static function castPeriod(\DatePeriod $p, array $a, Stub $stub, $isNested, $filter) { $dates = []; if (\PHP_VERSION_ID >= 70107) { // see https://bugs.php.net/bug.php?id=74639 foreach (clone $p as $i => $d) { if (self::PERIOD_LIMIT === $i) { $now = new \DateTimeImmutable(); $dates[] = sprintf('%s more', ($end = $p->getEndDate()) ? ceil(($end->format('U.u') - $d->format('U.u')) / ((int) $now->add($p->getDateInterval())->format('U.u') - (int) $now->format('U.u'))) : $p->recurrences - $i ); break; } $dates[] = sprintf('%s) %s', $i + 1, self::formatDateTime($d)); } } $period = sprintf( 'every %s, from %s (%s) %s', self::formatInterval($p->getDateInterval()), self::formatDateTime($p->getStartDate()), $p->include_start_date ? 'included' : 'excluded', ($end = $p->getEndDate()) ? 'to '.self::formatDateTime($end) : 'recurring '.$p->recurrences.' time/s' ); $p = [Caster::PREFIX_VIRTUAL.'period' => new ConstStub($period, implode("\n", $dates))]; return $filter & Caster::EXCLUDE_VERBOSE ? $p : $p + $a; } private static function formatDateTime(\DateTimeInterface $d, $extra = '') { return $d->format('Y-m-d H:i:'.self::formatSeconds($d->format('s'), $d->format('u')).$extra); } private static function formatSeconds($s, $us) { return sprintf('%02d.%s', $s, 0 === ($len = \strlen($t = rtrim($us, '0'))) ? '0' : ($len <= 3 ? str_pad($t, 3, '0') : $us)); } }
{ "pile_set_name": "Github" }
(* A quick note about preorders; skip this if you know about them. * * A preorder is a relation (a ≤ b) satisfying two rules: * 1. Reflexivity: a ≤ a. * 2. Transitivity: if a ≤ b and b ≤ c then a ≤ c. * * A good example of a preorder is "lists under containment": * let (X ≤ Y) if every element of the list X is also in Y. * * Preorders are like partial orders, but without requiring antisymmetry. * Let a ≡ b iff a ≤ b ∧ b ≤ a. Antisymmetry says: a ≡ b ⊃ a = b. * Under "list containment" [0,1] ≡ [1,0], even though [0,1] ≠ [1,0] * * If you're a category theorist, a preorder is a "thin" category, where between * any two objects there is at most one morphism. I believe much of the "tone * theory" in this file, ostensibly about maps between preorders, can be * extended to functors between categories. *) (* ========== TONES ========== *) (* Tones have two definitions: * * 1. Ways a function may respect the ordering on its argument. * 2. Transformations on the ordering of a preorder. * * Let's focus on the first definition for now. *) type tone = Id (* monotone: x ≤ y implies f(x) ≤ f(y) *) | Op (* antitone: x ≥ y implies f(x) ≤ f(y) *) | Iso (* invariant: (x ≤ y ∧ x ≥ y) implies f(x) ≤ f(y) *) | Path (* bivariant: (x ≤ y ∨ x ≥ y) implies f(x) ≤ f(y) *) (* Consider an arbitrary preorder A. Let A^op be A, ordered oppositely. * Now, observe that * * (f : A -> B) is antitone * * if and only if * * (f : A^op -> B) is monotone * * So "antitone" is a special case of "monotone"! * * This observation generalizes; every tone is really monotonicity with a * transformation applied to the domain's ordering. Tones transform orderings. *) (* We formalize this as follows, letting A^s be "A transformed by the tone s": * * (f : A -> B) respects its arguments with tone s * * if and only if * * (f : A^s -> B) is a monotone map from A^s to B * * Of course, we still need to define A^s: * * 1. id leaves the order unchanged. * * 2. op inverts it: (a ≤ b): A^op iff (b ≤ a): A. * * 3. iso gives the induced equivalence, the smallest preorder such that * (a ≤ b ∧ b ≤ a): A implies a ≤ b : A^iso. * * 4. path gives the equivalence closure, the smallest preorder such that * (a ≤ b ∨ b ≤ a): A implies a ≤ b : A^path. *) (* Note that (a ≤ b): A^iso iff (a ≤ b ∧ b ≤ a): A. * * A^path, the dual of A^iso, is not so easy to define directly. In particular, * (a ≤ b ∨ b ≤ a): A implies, but isn't always implied by, (a ≤ b): A^path. * A good counterexample is the "fencepost ordering", Fencepost: * * 1 3 5 7 ... * / \ / \ / \ / \ / * 0 2 4 6 8 ... * * That is, (x ≤ x+1 iff x even) and (x ≥ x+1 iff x odd). * In Fencepost^path, everything is equivalent: * * 0 ≡ 1 ≡ 2 ≡ 3 ≡ 4 ... * * But in Fencepost, (a ≤ b ∨ b ≤ a) is equivalent to |a-b| ≤ 1, which isn't * even transitive! *) (* ---------- TONE COMPOSITION ---------- *) (* Tone composition, (s ** t), corresponds to two things: * * 1. Composing functions with the given tones. * Given f : A^s -> B and g : B^t -> C, their composition * (f then g), in general, has tone (s ** t). * * 2. Composing the preorder transformations, postfix: * A^(s ** t) = (A^s)^t. *) let ( ** ) (a: tone) (b: tone): tone = match a,b with | x, Id | Id, x -> x | Op, Op -> Id | Iso, _ | Path, _ -> a (* hi priority, must come first *) | _, Iso | _, Path -> b (* lo priority, comes later *) (* Tone composition is associative, with Id as identity. Further laws: * * Op ** Op = Id * Path ** s = Path * Iso ** s = Iso * * Tone composition is NOT commutative. For example, * Path = Path ** Iso ≠ Iso ** Path = Iso. *) (* ---------- THE TONE LATTICE ---------- *) (* Tones themselves have a natural ordering: let (s ≤ t) iff * (∀A. A^s is a subpreorder of A^t). This looks like: * * Path greatest * / \ * Id Op * \ / * Iso least * *) let subtone (a: tone) (b: tone): bool = match a,b with | Iso, _ | _, Path | Id, Id | Op, Op -> true | _, Iso | Path, _ | Op, Id | Id, Op -> false (* "meet" means "greatest lower bound"; we'll need this for subtyping. *) let meet2 (a: tone) (b: tone): tone = match a, b with | Iso, _ | _, Iso | Id, Op | Op, Id -> Iso | x, Path | Path, x -> x | Id, Id | Op, Op -> a let meet: tone list -> tone = List.fold_left meet2 Path (* ========== TYPES ========== *) (* Here is a simple fragment of Modal Datafun's type system. * * You can think of it as a type system for a simply typed lambda calculus, * but one where types are interpreted as /preorders/, not sets; and where * all functions are monotone. *) type tag = string type tp = [ `Base (* some arbitrary type *) | `Fn of tp * tp (* functions *) | `Tuple of tp list (* tuples *) | `Sum of (tag * tp) list (* sums *) | `Set of tp (* finite sets *) | `Box of tp (* internalizes Iso / the discrete ordering *) | `Op of tp ] (* internalizes Op / the opposite ordering *) (* Internalizing Id is trivial; it's the identity function on types. * Internalizing Path is... nontrivial. * If you know what Path's intro/elim/subtyping rules should be, email me. *) (* ---------- SUBTYPING ---------- *) (* Write (A <: B) for "A is a subpreorder of B", by which I mean: * 1. A is a subset of B * 2. (x <= y at A) implies (x <= y at B). * * Since our types represent preorders, we'd like our subtyping relation to * match this. However, for type inference purposes, it's convenient if we solve * a more general problem, namely: * * Given types A, B, what is the greatest tone s such that A^s <: B? * Or does no such tone exist? * * And that's what I /hope/ this code does. I have sketched cases of a proof * that, if (s = subtype A B), then (A^s <: B). I also have, for many of my * subtyping rules, counterexamples that show that their conclusions can't be * safely strengthened. However, that's as far as I've gotten, proof-wise. *) exception Incompatible of tp * tp let rec subtype (a: tp) (b: tp): tone = let fail () = raise (Incompatible (a,b)) in match a,b with (* I believe the order of these two Box rules doesn't matter. * But I haven't proven this. *) | x, `Box y -> subtype x y ** Iso | `Box x, y -> Path ** subtype x y | `Op x, y | x, `Op y -> Op ** subtype x y (* NB. Op ** s = s ** Op *) (* If we assumed Base was discrete, we could return Path here. *) | `Base, `Base -> Id (* (Set a <: Set b) iff (a is a subset of b); that's why we can safely ignore * the result of (subtype a b) here. *) | `Set a, `Set b -> ignore (subtype a b); Id | `Tuple xs, `Tuple ys -> meet (try List.map2 subtype xs ys with Invalid_argument _ -> fail()) | `Sum tps1, `Sum tps2 -> let f (tag, tp1) = try subtype tp1 (List.assoc tag tps2) with Not_found -> fail() in meet (List.map f tps1) | `Fn(a1,b1), `Fn(a2,b2) -> let t = subtype b1 b2 in begin match t, subtype a2 a1 with | Iso, Path | Id, (Id|Path) | Op, (Op|Path) | Path, (Id|Op|Path) -> t (* TODO: failure messages should mention the tones as the issue. *) | Iso, _ | Id, _ | Op, _ | Path, _ -> fail() end (* Incongruous cases. *) | (`Base|`Tuple _|`Sum _|`Fn _|`Set _), (`Base|`Tuple _|`Sum _|`Fn _|`Set _) -> fail() (* ========== TERMS, TYPE CHECKING, and TONE INFERENCE ========== *) module Cx = Map.Make(String) type var = string type 'a cx = 'a Cx.t (* Our typechecker is written for clarity rather than for good error messages; * it can throw many exceptions when it fails, not just TypeError. *) exception TypeError of string let error msg = raise (TypeError msg) (* Checking forms. *) type ('check, 'synth) checkF = [ `Fn of var * 'check | `Tuple of 'check list | `Tag of tag * 'check | `Set of 'check list | `Box of 'check | `Op of 'check (* Large eliminations. * TODO: case-elimination for sums. *) (* `For (x, M, N) means: union for (x in M) of N *) | `Case of 'synth * (tag * var * 'check) list | `For of var * 'synth * 'check ] (* Synthesis forms. *) type ('check, 'synth) synthF = [ `Check of tp * 'check | `Var of var (* Small eliminations. *) | `App of 'synth * 'check | `Proj of 'synth * int | `Unbox of 'synth | `Unop of 'synth ] type tm = [ (tm, synthTm) synthF | (tm, synthTm) checkF ] and synthTm = (tm, synthTm) synthF let (&): tone cx -> tone cx -> tone cx = Cx.union (fun _ s t -> Some (s ** t)) let cxMeet: tone cx list -> tone cx = List.fold_left (&) Cx.empty let at (tone: tone): tone cx -> tone cx = Cx.map (fun s -> s ** tone) let rec check (cx: tp cx) (tp: tp) (tm: tm): tone cx = match tp, tm with | want, (#synthF as tm) -> let (got, tones) = synth cx tm in at (subtype got want) tones | `Fn(a,b), `Fn(x,body) -> let tones = check (Cx.add x a cx) b body in begin match Cx.find_opt x tones with | Some s when not (subtone s Id) -> error "non-monotone function" | _ -> Cx.remove x tones end | `Tuple tps, `Tuple tms -> List.map2 (check cx) tps tms |> cxMeet | `Sum tagtps, `Tag (n, tm) -> check cx (List.assoc n tagtps) tm (* TODO: need `tp` to be an equality type! *) | `Set tp, `Set tms -> List.map (check cx tp) tms |> cxMeet |> at Iso | `Box tp, `Box tm -> check cx tp tm |> at Iso | `Op tp, `Op tm -> check cx tp tm |> at Op | `Set _, `For (x, setTm, bodyTm) -> let (elemtp, tones1) = match synth cx setTm with | `Set tp, tones -> tp, tones | _ -> error "looping over non-set" in tones1 & Cx.remove x (check (Cx.add x elemtp cx) tp bodyTm) | _tp, `Case (_subj, _arms) -> Util.todo() (* Auto-introductions. *) | `Box tp, tm -> check cx tp tm |> at Iso | `Op tp, tm -> check cx tp tm |> at Iso (* Incongruous cases. *) | _, (`Fn _|`Tuple _|`Tag _|`Set _|`Box _|`Op _|`For _) -> error "cannot give that type to that term" and synth (cx: tp cx) (tm: synthTm): tp * tone cx = match tm with | `Check (tp, tm) -> (tp, check cx tp tm) | `Var x -> (Cx.find x cx, Cx.singleton x Id) | `App (func, arg) -> begin match synth cx func with | `Fn(a,b), tones1 -> (b, tones1 & check cx a arg) | _ -> error "expected a function" end | `Proj (tm, i) -> begin match synth cx tm with | `Tuple tps, tones -> List.nth tps i, tones | _ -> error "projecting from a non-tuple" end | `Unbox tm -> begin match synth cx tm with | `Box tp, tones -> tp, at Path tones | _ -> error "unboxing a non-box" end | `Unop tm -> begin match synth cx tm with | `Op tp, tones -> tp, at Op tones | _ -> error "unopping a non-op" end (* TODO: Type checker tests! *) (* ========== EVALUATION ========== *) module rec Values: Set.S with type elt = Value.t = Set.Make(Value) and Value: sig type t = Base of int | Set of Values.t | Tuple of t list | Tag of tag * t | Fn of (t -> t) val compare: t -> t -> int end = struct type t = Base of int | Set of Values.t | Tuple of t list | Tag of tag * t | Fn of (t -> t) let rec compare x y = match x,y with | Base x, Base y -> Pervasives.compare x y | Set x, Set y -> Values.compare x y | Tuple [], Tuple [] -> 0 | Tuple (x::xs), Tuple (y::ys) -> let c = compare x y in if c <> 0 then c else compare (Tuple xs) (Tuple ys) | Tag(n,x), Tag(m,y) -> let c = Pervasives.compare n m in if c <> 0 then c else compare x y | (Base _|Set _|Tuple _|Tag _|Fn _), _ -> failwith "runtime type error" end open Value type value = Value.t type env = value Cx.t let deFn = function Fn f -> f | _ -> failwith "runtime type error" let deSet = function Set s -> s | _ -> failwith "runtime type error" let deTuple = function Tuple xs -> xs | _ -> failwith "runtime type error" let rec eval (env: env): tm -> value = function | `Var v -> Cx.find v env (* introductions *) | `Fn(v,body) -> Fn (fun arg -> eval (Cx.add v arg env) body) | `Tuple xs -> Tuple (List.map (eval env) xs) | `Tag(n,x) -> Tag (n, eval env x) | `Set xs -> Set (Values.of_list (List.map (eval env) xs)) (* eliminations *) | `Proj(x,i) -> List.nth (deTuple (evalS env x)) i | `App(func, arg) -> deFn (evalS env func) (eval env arg) | `For(v, set, body) -> let elems = deSet (evalS env set) in let union elem = Values.union (deSet (eval (Cx.add v elem env) body)) in Set (Values.fold union elems Values.empty) | `Case(_subj, _arms) -> Util.todo() (* type erasure *) | `Check (_, x) -> eval env x (* modal erasure *) | `Box x | `Op x -> eval env x | `Unbox x | `Unop x -> eval env (x :> tm) and evalS (env: env) (tm: synthTm): value = eval env (tm :> tm) (* TODO: evaluator tests *)
{ "pile_set_name": "Github" }
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package hivemall.knn.distance; import hivemall.model.FeatureValue; import hivemall.utils.hadoop.HiveUtils; import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; import org.apache.hadoop.hive.ql.exec.Description; import org.apache.hadoop.hive.ql.exec.UDFArgumentException; import org.apache.hadoop.hive.ql.metadata.HiveException; import org.apache.hadoop.hive.ql.udf.UDFType; import org.apache.hadoop.hive.ql.udf.generic.GenericUDF; import org.apache.hadoop.hive.serde2.objectinspector.ListObjectInspector; import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector; import org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorFactory; import org.apache.hadoop.io.FloatWritable; //@formatter:off @Description(name = "euclid_distance", value = "_FUNC_(ftvec1, ftvec2) - Returns the square root of the sum of the squared differences" + ": sqrt(sum((x - y)^2))", extended = "WITH docs as (\n" + " select 1 as docid, array('apple:1.0', 'orange:2.0', 'banana:1.0', 'kuwi:0') as features\n" + " union all\n" + " select 2 as docid, array('apple:1.0', 'orange:0', 'banana:2.0', 'kuwi:1.0') as features\n" + " union all\n" + " select 3 as docid, array('apple:2.0', 'orange:0', 'banana:2.0', 'kuwi:1.0') as features\n" + ") \n" + "select\n" + " l.docid as doc1,\n" + " r.docid as doc2,\n" + " euclid_distance(l.features, r.features) as distance,\n" + " distance2similarity(euclid_distance(l.features, r.features)) as similarity\n" + "from \n" + " docs l\n" + " CROSS JOIN docs r\n" + "where\n" + " l.docid != r.docid\n" + "order by \n" + " doc1 asc,\n" + " distance asc;\n" + "\n" + "doc1 doc2 distance similarity\n" + "1 2 2.4494898 0.28989795\n" + "1 3 2.6457512 0.2742919\n" + "2 3 1.0 0.5\n" + "2 1 2.4494898 0.28989795\n" + "3 2 1.0 0.5\n" + "3 1 2.6457512 0.2742919") @UDFType(deterministic = true, stateful = false) //@formatter:on public final class EuclidDistanceUDF extends GenericUDF { private ListObjectInspector arg0ListOI, arg1ListOI; @Override public ObjectInspector initialize(ObjectInspector[] argOIs) throws UDFArgumentException { if (argOIs.length != 2) { throw new UDFArgumentException("euclid_distance takes 2 arguments"); } this.arg0ListOI = HiveUtils.asListOI(argOIs[0]); this.arg1ListOI = HiveUtils.asListOI(argOIs[1]); return PrimitiveObjectInspectorFactory.writableFloatObjectInspector; } @Override public FloatWritable evaluate(DeferredObject[] arguments) throws HiveException { List<String> ftvec1 = HiveUtils.asStringList(arguments[0], arg0ListOI); List<String> ftvec2 = HiveUtils.asStringList(arguments[1], arg1ListOI); float d = (float) euclidDistance(ftvec1, ftvec2); return new FloatWritable(d); } public static double euclidDistance(final List<String> ftvec1, final List<String> ftvec2) { final FeatureValue probe = new FeatureValue(); final Map<String, Float> map = new HashMap<String, Float>(ftvec1.size() * 2 + 1); for (String ft : ftvec1) { if (ft == null) { continue; } FeatureValue.parseFeatureAsString(ft, probe); float v1 = probe.getValueAsFloat(); String f1 = probe.getFeature(); map.put(f1, v1); } double d = 0.d; for (String ft : ftvec2) { if (ft == null) { continue; } FeatureValue.parseFeatureAsString(ft, probe); String f2 = probe.getFeature(); float v2f = probe.getValueAsFloat(); Float v1 = map.remove(f2); if (v1 == null) { d += (v2f * v2f); } else { float v1f = v1.floatValue(); float diff = v1f - v2f; d += (diff * diff); } } for (Map.Entry<String, Float> e : map.entrySet()) { float v1f = e.getValue(); d += (v1f * v1f); } return Math.sqrt(d); } @Override public String getDisplayString(String[] children) { return "euclid_distance(" + Arrays.toString(children) + ")"; } }
{ "pile_set_name": "Github" }
/* * Copyright (C) 2005-2018 Team Kodi * This file is part of Kodi - https://kodi.tv * * SPDX-License-Identifier: GPL-2.0-or-later * See LICENSES/README.md for more information. */ #include "MultiPathFile.h" #include "MultiPathDirectory.h" #include "utils/URIUtils.h" #include "URL.h" using namespace XFILE; CMultiPathFile::CMultiPathFile(void) : COverrideFile(false) { } CMultiPathFile::~CMultiPathFile(void) = default; bool CMultiPathFile::Open(const CURL& url) { // grab the filename off the url std::string path, fileName; URIUtils::Split(url.Get(), path, fileName); std::vector<std::string> vecPaths; if (!CMultiPathDirectory::GetPaths(path, vecPaths)) return false; for (unsigned int i = 0; i < vecPaths.size(); i++) { std::string filePath = vecPaths[i]; filePath = URIUtils::AddFileToFolder(filePath, fileName); if (m_file.Open(filePath)) return true; } return false; } bool CMultiPathFile::Exists(const CURL& url) { // grab the filename off the url std::string path, fileName; URIUtils::Split(url.Get(), path, fileName); std::vector<std::string> vecPaths; if (!CMultiPathDirectory::GetPaths(path, vecPaths)) return false; for (unsigned int i = 0; i < vecPaths.size(); i++) { std::string filePath = vecPaths[i]; filePath = URIUtils::AddFileToFolder(filePath, fileName); if (CFile::Exists(filePath)) return true; } return false; } int CMultiPathFile::Stat(const CURL& url, struct __stat64* buffer) { // grab the filename off the url std::string path, fileName; URIUtils::Split(url.Get(), path, fileName); std::vector<std::string> vecPaths; if (!CMultiPathDirectory::GetPaths(path, vecPaths)) return false; for (unsigned int i = 0; i < vecPaths.size(); i++) { std::string filePath = vecPaths[i]; filePath = URIUtils::AddFileToFolder(filePath, fileName); int ret = CFile::Stat(filePath, buffer); if (ret == 0) return ret; } return -1; } std::string CMultiPathFile::TranslatePath(const CURL& url) { return url.Get(); }
{ "pile_set_name": "Github" }
/* * Copyright (c) 2007 KISA(Korea Information Security Agency). All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Neither the name of author nor the names of its contributors may * be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * */ #ifndef OPENSSL_NO_SEED #include <stdio.h> #include <stdlib.h> #include <string.h> #ifdef WIN32 #include <memory.h> #endif #include <openssl/seed.h> #include "seed_locl.h" static seed_word SS[4][256] = { { 0x2989a1a8, 0x05858184, 0x16c6d2d4, 0x13c3d3d0, 0x14445054, 0x1d0d111c, 0x2c8ca0ac, 0x25052124, 0x1d4d515c, 0x03434340, 0x18081018, 0x1e0e121c, 0x11415150, 0x3cccf0fc, 0x0acac2c8, 0x23436360, 0x28082028, 0x04444044, 0x20002020, 0x1d8d919c, 0x20c0e0e0, 0x22c2e2e0, 0x08c8c0c8, 0x17071314, 0x2585a1a4, 0x0f8f838c, 0x03030300, 0x3b4b7378, 0x3b8bb3b8, 0x13031310, 0x12c2d2d0, 0x2ecee2ec, 0x30407070, 0x0c8c808c, 0x3f0f333c, 0x2888a0a8, 0x32023230, 0x1dcdd1dc, 0x36c6f2f4, 0x34447074, 0x2ccce0ec, 0x15859194, 0x0b0b0308, 0x17475354, 0x1c4c505c, 0x1b4b5358, 0x3d8db1bc, 0x01010100, 0x24042024, 0x1c0c101c, 0x33437370, 0x18889098, 0x10001010, 0x0cccc0cc, 0x32c2f2f0, 0x19c9d1d8, 0x2c0c202c, 0x27c7e3e4, 0x32427270, 0x03838380, 0x1b8b9398, 0x11c1d1d0, 0x06868284, 0x09c9c1c8, 0x20406060, 0x10405050, 0x2383a3a0, 0x2bcbe3e8, 0x0d0d010c, 0x3686b2b4, 0x1e8e929c, 0x0f4f434c, 0x3787b3b4, 0x1a4a5258, 0x06c6c2c4, 0x38487078, 0x2686a2a4, 0x12021210, 0x2f8fa3ac, 0x15c5d1d4, 0x21416160, 0x03c3c3c0, 0x3484b0b4, 0x01414140, 0x12425250, 0x3d4d717c, 0x0d8d818c, 0x08080008, 0x1f0f131c, 0x19899198, 0x00000000, 0x19091118, 0x04040004, 0x13435350, 0x37c7f3f4, 0x21c1e1e0, 0x3dcdf1fc, 0x36467274, 0x2f0f232c, 0x27072324, 0x3080b0b0, 0x0b8b8388, 0x0e0e020c, 0x2b8ba3a8, 0x2282a2a0, 0x2e4e626c, 0x13839390, 0x0d4d414c, 0x29496168, 0x3c4c707c, 0x09090108, 0x0a0a0208, 0x3f8fb3bc, 0x2fcfe3ec, 0x33c3f3f0, 0x05c5c1c4, 0x07878384, 0x14041014, 0x3ecef2fc, 0x24446064, 0x1eced2dc, 0x2e0e222c, 0x0b4b4348, 0x1a0a1218, 0x06060204, 0x21012120, 0x2b4b6368, 0x26466264, 0x02020200, 0x35c5f1f4, 0x12829290, 0x0a8a8288, 0x0c0c000c, 0x3383b3b0, 0x3e4e727c, 0x10c0d0d0, 0x3a4a7278, 0x07474344, 0x16869294, 0x25c5e1e4, 0x26062224, 0x00808080, 0x2d8da1ac, 0x1fcfd3dc, 0x2181a1a0, 0x30003030, 0x37073334, 0x2e8ea2ac, 0x36063234, 0x15051114, 0x22022220, 0x38083038, 0x34c4f0f4, 0x2787a3a4, 0x05454144, 0x0c4c404c, 0x01818180, 0x29c9e1e8, 0x04848084, 0x17879394, 0x35053134, 0x0bcbc3c8, 0x0ecec2cc, 0x3c0c303c, 0x31417170, 0x11011110, 0x07c7c3c4, 0x09898188, 0x35457174, 0x3bcbf3f8, 0x1acad2d8, 0x38c8f0f8, 0x14849094, 0x19495158, 0x02828280, 0x04c4c0c4, 0x3fcff3fc, 0x09494148, 0x39093138, 0x27476364, 0x00c0c0c0, 0x0fcfc3cc, 0x17c7d3d4, 0x3888b0b8, 0x0f0f030c, 0x0e8e828c, 0x02424240, 0x23032320, 0x11819190, 0x2c4c606c, 0x1bcbd3d8, 0x2484a0a4, 0x34043034, 0x31c1f1f0, 0x08484048, 0x02c2c2c0, 0x2f4f636c, 0x3d0d313c, 0x2d0d212c, 0x00404040, 0x3e8eb2bc, 0x3e0e323c, 0x3c8cb0bc, 0x01c1c1c0, 0x2a8aa2a8, 0x3a8ab2b8, 0x0e4e424c, 0x15455154, 0x3b0b3338, 0x1cccd0dc, 0x28486068, 0x3f4f737c, 0x1c8c909c, 0x18c8d0d8, 0x0a4a4248, 0x16465254, 0x37477374, 0x2080a0a0, 0x2dcde1ec, 0x06464244, 0x3585b1b4, 0x2b0b2328, 0x25456164, 0x3acaf2f8, 0x23c3e3e0, 0x3989b1b8, 0x3181b1b0, 0x1f8f939c, 0x1e4e525c, 0x39c9f1f8, 0x26c6e2e4, 0x3282b2b0, 0x31013130, 0x2acae2e8, 0x2d4d616c, 0x1f4f535c, 0x24c4e0e4, 0x30c0f0f0, 0x0dcdc1cc, 0x08888088, 0x16061214, 0x3a0a3238, 0x18485058, 0x14c4d0d4, 0x22426260, 0x29092128, 0x07070304, 0x33033330, 0x28c8e0e8, 0x1b0b1318, 0x05050104, 0x39497178, 0x10809090, 0x2a4a6268, 0x2a0a2228, 0x1a8a9298 }, { 0x38380830, 0xe828c8e0, 0x2c2d0d21, 0xa42686a2, 0xcc0fcfc3, 0xdc1eced2, 0xb03383b3, 0xb83888b0, 0xac2f8fa3, 0x60204060, 0x54154551, 0xc407c7c3, 0x44044440, 0x6c2f4f63, 0x682b4b63, 0x581b4b53, 0xc003c3c3, 0x60224262, 0x30330333, 0xb43585b1, 0x28290921, 0xa02080a0, 0xe022c2e2, 0xa42787a3, 0xd013c3d3, 0x90118191, 0x10110111, 0x04060602, 0x1c1c0c10, 0xbc3c8cb0, 0x34360632, 0x480b4b43, 0xec2fcfe3, 0x88088880, 0x6c2c4c60, 0xa82888a0, 0x14170713, 0xc404c4c0, 0x14160612, 0xf434c4f0, 0xc002c2c2, 0x44054541, 0xe021c1e1, 0xd416c6d2, 0x3c3f0f33, 0x3c3d0d31, 0x8c0e8e82, 0x98188890, 0x28280820, 0x4c0e4e42, 0xf436c6f2, 0x3c3e0e32, 0xa42585a1, 0xf839c9f1, 0x0c0d0d01, 0xdc1fcfd3, 0xd818c8d0, 0x282b0b23, 0x64264662, 0x783a4a72, 0x24270723, 0x2c2f0f23, 0xf031c1f1, 0x70324272, 0x40024242, 0xd414c4d0, 0x40014141, 0xc000c0c0, 0x70334373, 0x64274763, 0xac2c8ca0, 0x880b8b83, 0xf437c7f3, 0xac2d8da1, 0x80008080, 0x1c1f0f13, 0xc80acac2, 0x2c2c0c20, 0xa82a8aa2, 0x34340430, 0xd012c2d2, 0x080b0b03, 0xec2ecee2, 0xe829c9e1, 0x5c1d4d51, 0x94148490, 0x18180810, 0xf838c8f0, 0x54174753, 0xac2e8ea2, 0x08080800, 0xc405c5c1, 0x10130313, 0xcc0dcdc1, 0x84068682, 0xb83989b1, 0xfc3fcff3, 0x7c3d4d71, 0xc001c1c1, 0x30310131, 0xf435c5f1, 0x880a8a82, 0x682a4a62, 0xb03181b1, 0xd011c1d1, 0x20200020, 0xd417c7d3, 0x00020202, 0x20220222, 0x04040400, 0x68284860, 0x70314171, 0x04070703, 0xd81bcbd3, 0x9c1d8d91, 0x98198991, 0x60214161, 0xbc3e8eb2, 0xe426c6e2, 0x58194951, 0xdc1dcdd1, 0x50114151, 0x90108090, 0xdc1cccd0, 0x981a8a92, 0xa02383a3, 0xa82b8ba3, 0xd010c0d0, 0x80018181, 0x0c0f0f03, 0x44074743, 0x181a0a12, 0xe023c3e3, 0xec2ccce0, 0x8c0d8d81, 0xbc3f8fb3, 0x94168692, 0x783b4b73, 0x5c1c4c50, 0xa02282a2, 0xa02181a1, 0x60234363, 0x20230323, 0x4c0d4d41, 0xc808c8c0, 0x9c1e8e92, 0x9c1c8c90, 0x383a0a32, 0x0c0c0c00, 0x2c2e0e22, 0xb83a8ab2, 0x6c2e4e62, 0x9c1f8f93, 0x581a4a52, 0xf032c2f2, 0x90128292, 0xf033c3f3, 0x48094941, 0x78384870, 0xcc0cccc0, 0x14150511, 0xf83bcbf3, 0x70304070, 0x74354571, 0x7c3f4f73, 0x34350531, 0x10100010, 0x00030303, 0x64244460, 0x6c2d4d61, 0xc406c6c2, 0x74344470, 0xd415c5d1, 0xb43484b0, 0xe82acae2, 0x08090901, 0x74364672, 0x18190911, 0xfc3ecef2, 0x40004040, 0x10120212, 0xe020c0e0, 0xbc3d8db1, 0x04050501, 0xf83acaf2, 0x00010101, 0xf030c0f0, 0x282a0a22, 0x5c1e4e52, 0xa82989a1, 0x54164652, 0x40034343, 0x84058581, 0x14140410, 0x88098981, 0x981b8b93, 0xb03080b0, 0xe425c5e1, 0x48084840, 0x78394971, 0x94178793, 0xfc3cccf0, 0x1c1e0e12, 0x80028282, 0x20210121, 0x8c0c8c80, 0x181b0b13, 0x5c1f4f53, 0x74374773, 0x54144450, 0xb03282b2, 0x1c1d0d11, 0x24250521, 0x4c0f4f43, 0x00000000, 0x44064642, 0xec2dcde1, 0x58184850, 0x50124252, 0xe82bcbe3, 0x7c3e4e72, 0xd81acad2, 0xc809c9c1, 0xfc3dcdf1, 0x30300030, 0x94158591, 0x64254561, 0x3c3c0c30, 0xb43686b2, 0xe424c4e0, 0xb83b8bb3, 0x7c3c4c70, 0x0c0e0e02, 0x50104050, 0x38390931, 0x24260622, 0x30320232, 0x84048480, 0x68294961, 0x90138393, 0x34370733, 0xe427c7e3, 0x24240420, 0xa42484a0, 0xc80bcbc3, 0x50134353, 0x080a0a02, 0x84078783, 0xd819c9d1, 0x4c0c4c40, 0x80038383, 0x8c0f8f83, 0xcc0ecec2, 0x383b0b33, 0x480a4a42, 0xb43787b3 }, { 0xa1a82989, 0x81840585, 0xd2d416c6, 0xd3d013c3, 0x50541444, 0x111c1d0d, 0xa0ac2c8c, 0x21242505, 0x515c1d4d, 0x43400343, 0x10181808, 0x121c1e0e, 0x51501141, 0xf0fc3ccc, 0xc2c80aca, 0x63602343, 0x20282808, 0x40440444, 0x20202000, 0x919c1d8d, 0xe0e020c0, 0xe2e022c2, 0xc0c808c8, 0x13141707, 0xa1a42585, 0x838c0f8f, 0x03000303, 0x73783b4b, 0xb3b83b8b, 0x13101303, 0xd2d012c2, 0xe2ec2ece, 0x70703040, 0x808c0c8c, 0x333c3f0f, 0xa0a82888, 0x32303202, 0xd1dc1dcd, 0xf2f436c6, 0x70743444, 0xe0ec2ccc, 0x91941585, 0x03080b0b, 0x53541747, 0x505c1c4c, 0x53581b4b, 0xb1bc3d8d, 0x01000101, 0x20242404, 0x101c1c0c, 0x73703343, 0x90981888, 0x10101000, 0xc0cc0ccc, 0xf2f032c2, 0xd1d819c9, 0x202c2c0c, 0xe3e427c7, 0x72703242, 0x83800383, 0x93981b8b, 0xd1d011c1, 0x82840686, 0xc1c809c9, 0x60602040, 0x50501040, 0xa3a02383, 0xe3e82bcb, 0x010c0d0d, 0xb2b43686, 0x929c1e8e, 0x434c0f4f, 0xb3b43787, 0x52581a4a, 0xc2c406c6, 0x70783848, 0xa2a42686, 0x12101202, 0xa3ac2f8f, 0xd1d415c5, 0x61602141, 0xc3c003c3, 0xb0b43484, 0x41400141, 0x52501242, 0x717c3d4d, 0x818c0d8d, 0x00080808, 0x131c1f0f, 0x91981989, 0x00000000, 0x11181909, 0x00040404, 0x53501343, 0xf3f437c7, 0xe1e021c1, 0xf1fc3dcd, 0x72743646, 0x232c2f0f, 0x23242707, 0xb0b03080, 0x83880b8b, 0x020c0e0e, 0xa3a82b8b, 0xa2a02282, 0x626c2e4e, 0x93901383, 0x414c0d4d, 0x61682949, 0x707c3c4c, 0x01080909, 0x02080a0a, 0xb3bc3f8f, 0xe3ec2fcf, 0xf3f033c3, 0xc1c405c5, 0x83840787, 0x10141404, 0xf2fc3ece, 0x60642444, 0xd2dc1ece, 0x222c2e0e, 0x43480b4b, 0x12181a0a, 0x02040606, 0x21202101, 0x63682b4b, 0x62642646, 0x02000202, 0xf1f435c5, 0x92901282, 0x82880a8a, 0x000c0c0c, 0xb3b03383, 0x727c3e4e, 0xd0d010c0, 0x72783a4a, 0x43440747, 0x92941686, 0xe1e425c5, 0x22242606, 0x80800080, 0xa1ac2d8d, 0xd3dc1fcf, 0xa1a02181, 0x30303000, 0x33343707, 0xa2ac2e8e, 0x32343606, 0x11141505, 0x22202202, 0x30383808, 0xf0f434c4, 0xa3a42787, 0x41440545, 0x404c0c4c, 0x81800181, 0xe1e829c9, 0x80840484, 0x93941787, 0x31343505, 0xc3c80bcb, 0xc2cc0ece, 0x303c3c0c, 0x71703141, 0x11101101, 0xc3c407c7, 0x81880989, 0x71743545, 0xf3f83bcb, 0xd2d81aca, 0xf0f838c8, 0x90941484, 0x51581949, 0x82800282, 0xc0c404c4, 0xf3fc3fcf, 0x41480949, 0x31383909, 0x63642747, 0xc0c000c0, 0xc3cc0fcf, 0xd3d417c7, 0xb0b83888, 0x030c0f0f, 0x828c0e8e, 0x42400242, 0x23202303, 0x91901181, 0x606c2c4c, 0xd3d81bcb, 0xa0a42484, 0x30343404, 0xf1f031c1, 0x40480848, 0xc2c002c2, 0x636c2f4f, 0x313c3d0d, 0x212c2d0d, 0x40400040, 0xb2bc3e8e, 0x323c3e0e, 0xb0bc3c8c, 0xc1c001c1, 0xa2a82a8a, 0xb2b83a8a, 0x424c0e4e, 0x51541545, 0x33383b0b, 0xd0dc1ccc, 0x60682848, 0x737c3f4f, 0x909c1c8c, 0xd0d818c8, 0x42480a4a, 0x52541646, 0x73743747, 0xa0a02080, 0xe1ec2dcd, 0x42440646, 0xb1b43585, 0x23282b0b, 0x61642545, 0xf2f83aca, 0xe3e023c3, 0xb1b83989, 0xb1b03181, 0x939c1f8f, 0x525c1e4e, 0xf1f839c9, 0xe2e426c6, 0xb2b03282, 0x31303101, 0xe2e82aca, 0x616c2d4d, 0x535c1f4f, 0xe0e424c4, 0xf0f030c0, 0xc1cc0dcd, 0x80880888, 0x12141606, 0x32383a0a, 0x50581848, 0xd0d414c4, 0x62602242, 0x21282909, 0x03040707, 0x33303303, 0xe0e828c8, 0x13181b0b, 0x01040505, 0x71783949, 0x90901080, 0x62682a4a, 0x22282a0a, 0x92981a8a }, { 0x08303838, 0xc8e0e828, 0x0d212c2d, 0x86a2a426, 0xcfc3cc0f, 0xced2dc1e, 0x83b3b033, 0x88b0b838, 0x8fa3ac2f, 0x40606020, 0x45515415, 0xc7c3c407, 0x44404404, 0x4f636c2f, 0x4b63682b, 0x4b53581b, 0xc3c3c003, 0x42626022, 0x03333033, 0x85b1b435, 0x09212829, 0x80a0a020, 0xc2e2e022, 0x87a3a427, 0xc3d3d013, 0x81919011, 0x01111011, 0x06020406, 0x0c101c1c, 0x8cb0bc3c, 0x06323436, 0x4b43480b, 0xcfe3ec2f, 0x88808808, 0x4c606c2c, 0x88a0a828, 0x07131417, 0xc4c0c404, 0x06121416, 0xc4f0f434, 0xc2c2c002, 0x45414405, 0xc1e1e021, 0xc6d2d416, 0x0f333c3f, 0x0d313c3d, 0x8e828c0e, 0x88909818, 0x08202828, 0x4e424c0e, 0xc6f2f436, 0x0e323c3e, 0x85a1a425, 0xc9f1f839, 0x0d010c0d, 0xcfd3dc1f, 0xc8d0d818, 0x0b23282b, 0x46626426, 0x4a72783a, 0x07232427, 0x0f232c2f, 0xc1f1f031, 0x42727032, 0x42424002, 0xc4d0d414, 0x41414001, 0xc0c0c000, 0x43737033, 0x47636427, 0x8ca0ac2c, 0x8b83880b, 0xc7f3f437, 0x8da1ac2d, 0x80808000, 0x0f131c1f, 0xcac2c80a, 0x0c202c2c, 0x8aa2a82a, 0x04303434, 0xc2d2d012, 0x0b03080b, 0xcee2ec2e, 0xc9e1e829, 0x4d515c1d, 0x84909414, 0x08101818, 0xc8f0f838, 0x47535417, 0x8ea2ac2e, 0x08000808, 0xc5c1c405, 0x03131013, 0xcdc1cc0d, 0x86828406, 0x89b1b839, 0xcff3fc3f, 0x4d717c3d, 0xc1c1c001, 0x01313031, 0xc5f1f435, 0x8a82880a, 0x4a62682a, 0x81b1b031, 0xc1d1d011, 0x00202020, 0xc7d3d417, 0x02020002, 0x02222022, 0x04000404, 0x48606828, 0x41717031, 0x07030407, 0xcbd3d81b, 0x8d919c1d, 0x89919819, 0x41616021, 0x8eb2bc3e, 0xc6e2e426, 0x49515819, 0xcdd1dc1d, 0x41515011, 0x80909010, 0xccd0dc1c, 0x8a92981a, 0x83a3a023, 0x8ba3a82b, 0xc0d0d010, 0x81818001, 0x0f030c0f, 0x47434407, 0x0a12181a, 0xc3e3e023, 0xcce0ec2c, 0x8d818c0d, 0x8fb3bc3f, 0x86929416, 0x4b73783b, 0x4c505c1c, 0x82a2a022, 0x81a1a021, 0x43636023, 0x03232023, 0x4d414c0d, 0xc8c0c808, 0x8e929c1e, 0x8c909c1c, 0x0a32383a, 0x0c000c0c, 0x0e222c2e, 0x8ab2b83a, 0x4e626c2e, 0x8f939c1f, 0x4a52581a, 0xc2f2f032, 0x82929012, 0xc3f3f033, 0x49414809, 0x48707838, 0xccc0cc0c, 0x05111415, 0xcbf3f83b, 0x40707030, 0x45717435, 0x4f737c3f, 0x05313435, 0x00101010, 0x03030003, 0x44606424, 0x4d616c2d, 0xc6c2c406, 0x44707434, 0xc5d1d415, 0x84b0b434, 0xcae2e82a, 0x09010809, 0x46727436, 0x09111819, 0xcef2fc3e, 0x40404000, 0x02121012, 0xc0e0e020, 0x8db1bc3d, 0x05010405, 0xcaf2f83a, 0x01010001, 0xc0f0f030, 0x0a22282a, 0x4e525c1e, 0x89a1a829, 0x46525416, 0x43434003, 0x85818405, 0x04101414, 0x89818809, 0x8b93981b, 0x80b0b030, 0xc5e1e425, 0x48404808, 0x49717839, 0x87939417, 0xccf0fc3c, 0x0e121c1e, 0x82828002, 0x01212021, 0x8c808c0c, 0x0b13181b, 0x4f535c1f, 0x47737437, 0x44505414, 0x82b2b032, 0x0d111c1d, 0x05212425, 0x4f434c0f, 0x00000000, 0x46424406, 0xcde1ec2d, 0x48505818, 0x42525012, 0xcbe3e82b, 0x4e727c3e, 0xcad2d81a, 0xc9c1c809, 0xcdf1fc3d, 0x00303030, 0x85919415, 0x45616425, 0x0c303c3c, 0x86b2b436, 0xc4e0e424, 0x8bb3b83b, 0x4c707c3c, 0x0e020c0e, 0x40505010, 0x09313839, 0x06222426, 0x02323032, 0x84808404, 0x49616829, 0x83939013, 0x07333437, 0xc7e3e427, 0x04202424, 0x84a0a424, 0xcbc3c80b, 0x43535013, 0x0a02080a, 0x87838407, 0xc9d1d819, 0x4c404c0c, 0x83838003, 0x8f838c0f, 0xcec2cc0e, 0x0b33383b, 0x4a42480a, 0x87b3b437 } }; /* key schedule constants - golden ratio */ #define KC0 0x9e3779b9 #define KC1 0x3c6ef373 #define KC2 0x78dde6e6 #define KC3 0xf1bbcdcc #define KC4 0xe3779b99 #define KC5 0xc6ef3733 #define KC6 0x8dde6e67 #define KC7 0x1bbcdccf #define KC8 0x3779b99e #define KC9 0x6ef3733c #define KC10 0xdde6e678 #define KC11 0xbbcdccf1 #define KC12 0x779b99e3 #define KC13 0xef3733c6 #define KC14 0xde6e678d #define KC15 0xbcdccf1b void SEED_set_key(const unsigned char rawkey[SEED_KEY_LENGTH], SEED_KEY_SCHEDULE *ks) { seed_word x1, x2, x3, x4; seed_word t0, t1; char2word(rawkey , x1); char2word(rawkey+4 , x2); char2word(rawkey+8 , x3); char2word(rawkey+12, x4); t0 = (x1 + x3 - KC0) & 0xffffffff; t1 = (x2 - x4 + KC0) & 0xffffffff; KEYUPDATE_TEMP(t0, t1, &ks->data[0]); KEYSCHEDULE_UPDATE1(t0, t1, x1, x2, x3, x4, KC1); KEYUPDATE_TEMP(t0, t1, &ks->data[2]); KEYSCHEDULE_UPDATE0(t0, t1, x1, x2, x3, x4, KC2); KEYUPDATE_TEMP(t0, t1, &ks->data[4]); KEYSCHEDULE_UPDATE1(t0, t1, x1, x2, x3, x4, KC3); KEYUPDATE_TEMP(t0, t1, &ks->data[6]); KEYSCHEDULE_UPDATE0(t0, t1, x1, x2, x3, x4, KC4); KEYUPDATE_TEMP(t0, t1, &ks->data[8]); KEYSCHEDULE_UPDATE1(t0, t1, x1, x2, x3, x4, KC5); KEYUPDATE_TEMP(t0, t1, &ks->data[10]); KEYSCHEDULE_UPDATE0(t0, t1, x1, x2, x3, x4, KC6); KEYUPDATE_TEMP(t0, t1, &ks->data[12]); KEYSCHEDULE_UPDATE1(t0, t1, x1, x2, x3, x4, KC7); KEYUPDATE_TEMP(t0, t1, &ks->data[14]); KEYSCHEDULE_UPDATE0(t0, t1, x1, x2, x3, x4, KC8); KEYUPDATE_TEMP(t0, t1, &ks->data[16]); KEYSCHEDULE_UPDATE1(t0, t1, x1, x2, x3, x4, KC9); KEYUPDATE_TEMP(t0, t1, &ks->data[18]); KEYSCHEDULE_UPDATE0(t0, t1, x1, x2, x3, x4, KC10); KEYUPDATE_TEMP(t0, t1, &ks->data[20]); KEYSCHEDULE_UPDATE1(t0, t1, x1, x2, x3, x4, KC11); KEYUPDATE_TEMP(t0, t1, &ks->data[22]); KEYSCHEDULE_UPDATE0(t0, t1, x1, x2, x3, x4, KC12); KEYUPDATE_TEMP(t0, t1, &ks->data[24]); KEYSCHEDULE_UPDATE1(t0, t1, x1, x2, x3, x4, KC13); KEYUPDATE_TEMP(t0, t1, &ks->data[26]); KEYSCHEDULE_UPDATE0(t0, t1, x1, x2, x3, x4, KC14); KEYUPDATE_TEMP(t0, t1, &ks->data[28]); KEYSCHEDULE_UPDATE1(t0, t1, x1, x2, x3, x4, KC15); KEYUPDATE_TEMP(t0, t1, &ks->data[30]); } void SEED_encrypt(const unsigned char s[SEED_BLOCK_SIZE], unsigned char d[SEED_BLOCK_SIZE], const SEED_KEY_SCHEDULE *ks) { seed_word x1, x2, x3, x4; seed_word t0, t1; char2word(s, x1); char2word(s+4, x2); char2word(s+8, x3); char2word(s+12, x4); E_SEED(t0, t1, x1, x2, x3, x4, 0); E_SEED(t0, t1, x3, x4, x1, x2, 2); E_SEED(t0, t1, x1, x2, x3, x4, 4); E_SEED(t0, t1, x3, x4, x1, x2, 6); E_SEED(t0, t1, x1, x2, x3, x4, 8); E_SEED(t0, t1, x3, x4, x1, x2, 10); E_SEED(t0, t1, x1, x2, x3, x4, 12); E_SEED(t0, t1, x3, x4, x1, x2, 14); E_SEED(t0, t1, x1, x2, x3, x4, 16); E_SEED(t0, t1, x3, x4, x1, x2, 18); E_SEED(t0, t1, x1, x2, x3, x4, 20); E_SEED(t0, t1, x3, x4, x1, x2, 22); E_SEED(t0, t1, x1, x2, x3, x4, 24); E_SEED(t0, t1, x3, x4, x1, x2, 26); E_SEED(t0, t1, x1, x2, x3, x4, 28); E_SEED(t0, t1, x3, x4, x1, x2, 30); word2char(x3, d); word2char(x4, d+4); word2char(x1, d+8); word2char(x2, d+12); } void SEED_decrypt(const unsigned char s[SEED_BLOCK_SIZE], unsigned char d[SEED_BLOCK_SIZE], const SEED_KEY_SCHEDULE *ks) { seed_word x1, x2, x3, x4; seed_word t0, t1; char2word(s, x1); char2word(s+4, x2); char2word(s+8, x3); char2word(s+12, x4); E_SEED(t0, t1, x1, x2, x3, x4, 30); E_SEED(t0, t1, x3, x4, x1, x2, 28); E_SEED(t0, t1, x1, x2, x3, x4, 26); E_SEED(t0, t1, x3, x4, x1, x2, 24); E_SEED(t0, t1, x1, x2, x3, x4, 22); E_SEED(t0, t1, x3, x4, x1, x2, 20); E_SEED(t0, t1, x1, x2, x3, x4, 18); E_SEED(t0, t1, x3, x4, x1, x2, 16); E_SEED(t0, t1, x1, x2, x3, x4, 14); E_SEED(t0, t1, x3, x4, x1, x2, 12); E_SEED(t0, t1, x1, x2, x3, x4, 10); E_SEED(t0, t1, x3, x4, x1, x2, 8); E_SEED(t0, t1, x1, x2, x3, x4, 6); E_SEED(t0, t1, x3, x4, x1, x2, 4); E_SEED(t0, t1, x1, x2, x3, x4, 2); E_SEED(t0, t1, x3, x4, x1, x2, 0); word2char(x3, d); word2char(x4, d+4); word2char(x1, d+8); word2char(x2, d+12); } #endif /* OPENSSL_NO_SEED */
{ "pile_set_name": "Github" }
#warning the cake is a lie
{ "pile_set_name": "Github" }
#!/bin/bash FN="ye6100subdcdf_2.18.0.tar.gz" URLS=( "https://bioconductor.org/packages/3.11/data/annotation/src/contrib/ye6100subdcdf_2.18.0.tar.gz" "https://bioarchive.galaxyproject.org/ye6100subdcdf_2.18.0.tar.gz" "https://depot.galaxyproject.org/software/bioconductor-ye6100subdcdf/bioconductor-ye6100subdcdf_2.18.0_src_all.tar.gz" "https://depot.galaxyproject.org/software/bioconductor-ye6100subdcdf/bioconductor-ye6100subdcdf_2.18.0_src_all.tar.gz" ) MD5="521b501ddbcdc680c3d27b5b201029b1" # Use a staging area in the conda dir rather than temp dirs, both to avoid # permission issues as well as to have things downloaded in a predictable # manner. STAGING=$PREFIX/share/$PKG_NAME-$PKG_VERSION-$PKG_BUILDNUM mkdir -p $STAGING TARBALL=$STAGING/$FN SUCCESS=0 for URL in ${URLS[@]}; do curl $URL > $TARBALL [[ $? == 0 ]] || continue # Platform-specific md5sum checks. if [[ $(uname -s) == "Linux" ]]; then if md5sum -c <<<"$MD5 $TARBALL"; then SUCCESS=1 break fi else if [[ $(uname -s) == "Darwin" ]]; then if [[ $(md5 $TARBALL | cut -f4 -d " ") == "$MD5" ]]; then SUCCESS=1 break fi fi fi done if [[ $SUCCESS != 1 ]]; then echo "ERROR: post-link.sh was unable to download any of the following URLs with the md5sum $MD5:" printf '%s\n' "${URLS[@]}" exit 1 fi # Install and clean up R CMD INSTALL --library=$PREFIX/lib/R/library $TARBALL rm $TARBALL rmdir $STAGING
{ "pile_set_name": "Github" }
gcr.io/google_containers/kube-scheduler-amd64:v1.6.9
{ "pile_set_name": "Github" }
/* * Copyright (c) 1988 University of Utah. * Copyright (c) 1982, 1986, 1990, 1993 * The Regents of the University of California. All rights reserved. * * This code is derived from software contributed to Berkeley by * the Systems Programming Group of the University of Utah Computer * Science Department. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by the University of * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * from: Utah $Hdr: vmparam.h 1.16 91/01/18$ * * @(#)vmparam.h 8.2 (Berkeley) 4/19/94 */ /* * Machine dependent constants for HP300 */ /* * USRTEXT is the start of the user text/data space, while USRSTACK * is the top (end) of the user stack. LOWPAGES and HIGHPAGES are * the number of pages from the beginning of the P0 region to the * beginning of the text and from the beginning of the P1 region to the * beginning of the stack respectively. * * NOTE: the ONLY reason that HIGHPAGES is 0x100 instead of UPAGES (3) * is for HPUX compatibility. Why?? Because HPUX's debuggers * have the user's stack hard-wired at FFF00000 for post-mortems, * and we must be compatible... */ #define USRTEXT 0 #define USRSTACK (-HIGHPAGES*NBPG) /* Start of user stack */ #define BTOPUSRSTACK (0x100000-HIGHPAGES) /* btop(USRSTACK) */ #define P1PAGES 0x100000 #define LOWPAGES 0 #define HIGHPAGES (0x100000/NBPG) /* * Virtual memory related constants, all in bytes */ #ifndef MAXTSIZ #define MAXTSIZ (8*1024*1024) /* max text size */ #endif #ifndef DFLDSIZ #define DFLDSIZ (16*1024*1024) /* initial data size limit */ #endif #ifndef MAXDSIZ #define MAXDSIZ (64*1024*1024) /* max data size */ #endif #ifndef DFLSSIZ #define DFLSSIZ (512*1024) /* initial stack size limit */ #endif #ifndef MAXSSIZ #define MAXSSIZ MAXDSIZ /* max stack size */ #endif /* * Default sizes of swap allocation chunks (see dmap.h). * The actual values may be changed in vminit() based on MAXDSIZ. * With MAXDSIZ of 16Mb and NDMAP of 38, dmmax will be 1024. * DMMIN should be at least ctod(1) so that vtod() works. * vminit() insures this. */ #define DMMIN 32 /* smallest swap allocation */ #define DMMAX 4096 /* largest potential swap allocation */ /* * Sizes of the system and user portions of the system page table. */ /* SYSPTSIZE IS SILLY; IT SHOULD BE COMPUTED AT BOOT TIME */ #define SYSPTSIZE (2 * NPTEPG) /* 8mb */ #define USRPTSIZE (1 * NPTEPG) /* 4mb */ /* * PTEs for mapping user space into the kernel for phyio operations. * One page is enough to handle 4Mb of simultaneous raw IO operations. */ #ifndef USRIOSIZE #define USRIOSIZE (1 * NPTEPG) /* 4mb */ #endif /* * PTEs for system V style shared memory. * This is basically slop for kmempt which we actually allocate (malloc) from. */ #ifndef SHMMAXPGS #define SHMMAXPGS 1024 /* 4mb */ #endif /* * External IO space map size. * By default we make it large enough to map up to 3 DIO-II devices and * the complete DIO space. For a 320-only configuration (which has no * DIO-II) you could define a considerably smaller region. */ #ifndef EIOMAPSIZE #define EIOMAPSIZE 3584 /* 14mb */ #endif /* * Boundary at which to place first MAPMEM segment if not explicitly * specified. Should be a power of two. This allows some slop for * the data segment to grow underneath the first mapped segment. */ #define MMSEG 0x200000 /* * The size of the clock loop. */ #define LOOPPAGES (maxfree - firstfree) /* * The time for a process to be blocked before being very swappable. * This is a number of seconds which the system takes as being a non-trivial * amount of real time. You probably shouldn't change this; * it is used in subtle ways (fractions and multiples of it are, that is, like * half of a ``long time'', almost a long time, etc.) * It is related to human patience and other factors which don't really * change over time. */ #define MAXSLP 20 /* * A swapped in process is given a small amount of core without being bothered * by the page replacement algorithm. Basically this says that if you are * swapped in you deserve some resources. We protect the last SAFERSS * pages against paging and will just swap you out rather than paging you. * Note that each process has at least UPAGES+CLSIZE pages which are not * paged anyways (this is currently 8+2=10 pages or 5k bytes), so this * number just means a swapped in process is given around 25k bytes. * Just for fun: current memory prices are 4600$ a megabyte on VAX (4/22/81), * so we loan each swapped in process memory worth 100$, or just admit * that we don't consider it worthwhile and swap it out to disk which costs * $30/mb or about $0.75. */ #define SAFERSS 4 /* nominal ``small'' resident set size protected against replacement */ /* * DISKRPM is used to estimate the number of paging i/o operations * which one can expect from a single disk controller. */ #define DISKRPM 60 /* * Klustering constants. Klustering is the gathering * of pages together for pagein/pageout, while clustering * is the treatment of hardware page size as though it were * larger than it really is. * * KLMAX gives maximum cluster size in CLSIZE page (cluster-page) * units. Note that ctod(KLMAX*CLSIZE) must be <= DMMIN in dmap.h. * ctob(KLMAX) should also be less than MAXPHYS (in vm_swp.c) * unless you like "big push" panics. */ #define KLMAX (4/CLSIZE) #define KLSEQL (2/CLSIZE) /* in klust if vadvise(VA_SEQL) */ #define KLIN (4/CLSIZE) /* default data/stack in klust */ #define KLTXT (4/CLSIZE) /* default text in klust */ #define KLOUT (4/CLSIZE) /* * KLSDIST is the advance or retard of the fifo reclaim for sequential * processes data space. */ #define KLSDIST 3 /* klusters advance/retard for seq. fifo */ /* * Paging thresholds (see vm_sched.c). * Strategy of 1/19/85: * lotsfree is 512k bytes, but at most 1/4 of memory * desfree is 200k bytes, but at most 1/8 of memory */ #define LOTSFREE (512 * 1024) #define LOTSFREEFRACT 4 #define DESFREE (200 * 1024) #define DESFREEFRACT 8 /* * There are two clock hands, initially separated by HANDSPREAD bytes * (but at most all of user memory). The amount of time to reclaim * a page once the pageout process examines it increases with this * distance and decreases as the scan rate rises. */ #define HANDSPREAD (2 * 1024 * 1024) /* * The number of times per second to recompute the desired paging rate * and poke the pagedaemon. */ #define RATETOSCHEDPAGING 4 /* * Believed threshold (in megabytes) for which interleaved * swapping area is desirable. */ #define LOTSOFMEM 2 /* * Mach derived constants */ /* user/kernel map constants */ #define VM_MIN_ADDRESS ((vm_offset_t)0) #define VM_MAXUSER_ADDRESS ((vm_offset_t)0xFFF00000) #define VM_MAX_ADDRESS ((vm_offset_t)0xFFF00000) #define VM_MIN_KERNEL_ADDRESS ((vm_offset_t)0) #define VM_MAX_KERNEL_ADDRESS ((vm_offset_t)0xFFFFF000) /* virtual sizes (bytes) for various kernel submaps */ #define VM_MBUF_SIZE (NMBCLUSTERS*MCLBYTES) #define VM_KMEM_SIZE (NKMEMCLUSTERS*CLBYTES) #define VM_PHYS_SIZE (USRIOSIZE*CLBYTES) /* # of kernel PT pages (initial only, can grow dynamically) */ #define VM_KERNEL_PT_PAGES ((vm_size_t)2) /* XXX: SYSPTSIZE */ /* pcb base */ #define pcbb(p) ((u_int)(p)->p_addr)
{ "pile_set_name": "Github" }
Below are the ID numbers representing which history list is to be managed. 0 Instrument History Individual externally sourced instruments 1 Patch History Full instrument patch sets 2 Scale History Complete microtonal settings 3 State History Entire system state 4 Vector History Per channel Vector controls 5 MidiLearn History Learned MIDI CC lists These values have now been superceeded by named constants in globals.h
{ "pile_set_name": "Github" }
// // Utils.swift // EZPlayerExample // // Created by yangjun zhu on 2016/12/30. // Copyright © 2016年 yangjun zhu. All rights reserved. // import Foundation extension URL { struct Test { //local static let localMP4_0 = Bundle.main.url(forResource: "hubblecast", withExtension: "m4v")! static let localMP4_1 = Bundle.main.url(forResource: "Charlie The Unicorn", withExtension: "m4v")! static let localMP4_2 = Bundle.main.url(forResource: "blackhole", withExtension: "mp4")! //remote vod static let apple_0 = URL(string: "http://devimages.apple.com/iphone/samples/bipbop/bipbopall.m3u8")! static let apple_1 = URL(string: "https://devimages.apple.com.edgekey.net/streaming/examples/bipbop_16x9/bipbop_16x9_variant.m3u8")! static let remoteMP4_0 = URL(string: "http://baobab.wdjcdn.com/1456459181808howtoloseweight_x264.mp4")! static let remoteM3U8_0 = URL(string: "http://www.streambox.fr/playlists/x36xhzz/url_6/193039199_mp4_h264_aac_hq_7.m3u8")! //live static let live_0 = URL(string: "https://devimages.apple.com.edgekey.net/streaming/examples/bipbop_16x9/bipbop_16x9_variant.m3u8")! } }
{ "pile_set_name": "Github" }
/* ============================================================================== This file is part of the JUCE library. Copyright (c) 2013 - Raw Material Software Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) b) the Affero GPL v3 Details of these licenses can be found at: www.gnu.org/licenses JUCE is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. ------------------------------------------------------------------------------ To release a closed-source product which uses JUCE, commercial licenses are available: visit www.juce.com for more information. ============================================================================== */ #ifndef __MAINHOSTWINDOW_JUCEHEADER__ #define __MAINHOSTWINDOW_JUCEHEADER__ #include "FilterGraph.h" #include "GraphEditorPanel.h" #include "../CabbageUtils.h" #include "CabbagePluginListComponent.h" #include "Preferences.h" //============================================================================== namespace CommandIDs { static const int open = 0x30000; static const int save = 0x30001; static const int saveAs = 0x30002; static const int showPluginListEditor = 0x30100; static const int showAudioSettings = 0x30200; static const int showAboutBox = 0x30303; static const int preferences = 0x30400; static const int setCabbageFileDirectory= 0x30500; static const int viewSidepanel = 0x30600; static const int midiLearn = 0x30700; static const int midiMappings = 0x30701; static const int viewBottomPanel = 0x30800; } ApplicationCommandManager& getCommandManager(); ApplicationProperties& getAppProperties(); //============================================================================== /** */ class MainHostWindow : public DocumentWindow, public MenuBarModel, public ApplicationCommandTarget, public ChangeListener, public FileDragAndDropTarget, public DragAndDropContainer { public: //============================================================================== MainHostWindow(); ~MainHostWindow(); //============================================================================== void closeButtonPressed(); void changeListenerCallback (ChangeBroadcaster*); bool isInterestedInFileDrag (const StringArray& files); void fileDragEnter (const StringArray& files, int, int); void fileDragMove (const StringArray& files, int, int); void fileDragExit (const StringArray& files); void filesDropped (const StringArray& files, int, int); StringArray getMenuBarNames(); PopupMenu getMenuForIndex (int topLevelMenuIndex, const String& menuName); void menuItemSelected (int menuItemID, int topLevelMenuIndex); ApplicationCommandTarget* getNextCommandTarget(); void getAllCommands (Array <CommandID>& commands); void getCommandInfo (CommandID commandID, ApplicationCommandInfo& result); bool perform (const InvocationInfo& info); bool tryToQuitApplication(); void launchPreferencesDialogue(); void createPlugin (const PluginDescription* desc, int x, int y); void showMidiMappings(); void addPluginsToMenu (PopupMenu& m) const; //add native Cabbage filters to list...nice. void addCabbagePluginsToMenu (PopupMenu& m, Array<File> &cabbageFiles) const; const PluginDescription* getChosenType (const int menuID) const; GraphDocumentComponent* getGraphDocument() const; private: //============================================================================== AudioDeviceManager deviceManager; CabbageAudioDeviceSelectorComponent* audioSettingsComp; CabbagePluginListComponent* pluginList; const File deadMansPedalFile; TooltipWindow tooltipWindow; AudioPluginFormatManager formatManager; OwnedArray <PluginDescription> internalTypes; KnownPluginList knownPluginList; KnownPluginList::SortMethod pluginSortMethod; class PluginListWindow; ScopedPointer <PluginListWindow> pluginListWindow; void showAudioSettings(); JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (MainHostWindow) }; #endif // __MAINHOSTWINDOW_JUCEHEADER__
{ "pile_set_name": "Github" }
#include "src/protocol/ClientAcknowledgement.h" #include "src/protocol/ProtocolSpecs.h" namespace openmittsu { namespace protocol { ClientAcknowledgement::ClientAcknowledgement(ContactId const& sender, MessageId const& messageId) : sender(sender), messageId(messageId) { // Intentionally left empty. } ClientAcknowledgement::~ClientAcknowledgement() { // Intentionally left empty. } QByteArray ClientAcknowledgement::toPacket() const { // Header: 0x82 (Client Acknowledgment) QByteArray result(4, 0x00); result[0] = PROTO_PACKET_SIGNATURE_CLIENT_ACK; // Message Sender result.append(sender.getContactIdAsByteArray()); // Message Id result.append(messageId.getMessageIdAsByteArray()); return result; } } }
{ "pile_set_name": "Github" }
@mixin triangle($size, $color, $direction) { $width: nth($size, 1); $height: nth($size, length($size)); $foreground-color: nth($color, 1); $background-color: if(length($color) == 2, nth($color, 2), transparent); height: 0; width: 0; @if ($direction == up) or ($direction == down) or ($direction == right) or ($direction == left) { $width: $width / 2; $height: if(length($size) > 1, $height, $height/2); @if $direction == up { border-bottom: $height solid $foreground-color; border-left: $width solid $background-color; border-right: $width solid $background-color; } @else if $direction == right { border-bottom: $width solid $background-color; border-left: $height solid $foreground-color; border-top: $width solid $background-color; } @else if $direction == down { border-left: $width solid $background-color; border-right: $width solid $background-color; border-top: $height solid $foreground-color; } @else if $direction == left { border-bottom: $width solid $background-color; border-right: $height solid $foreground-color; border-top: $width solid $background-color; } } @else if ($direction == up-right) or ($direction == up-left) { border-top: $height solid $foreground-color; @if $direction == up-right { border-left: $width solid $background-color; } @else if $direction == up-left { border-right: $width solid $background-color; } } @else if ($direction == down-right) or ($direction == down-left) { border-bottom: $height solid $foreground-color; @if $direction == down-right { border-left: $width solid $background-color; } @else if $direction == down-left { border-right: $width solid $background-color; } } @else if ($direction == inset-up) { border-color: $background-color $background-color $foreground-color; border-style: solid; border-width: $height $width; } @else if ($direction == inset-down) { border-color: $foreground-color $background-color $background-color; border-style: solid; border-width: $height $width; } @else if ($direction == inset-right) { border-color: $background-color $background-color $background-color $foreground-color; border-style: solid; border-width: $width $height; } @else if ($direction == inset-left) { border-color: $background-color $foreground-color $background-color $background-color; border-style: solid; border-width: $width $height; } }
{ "pile_set_name": "Github" }
define( [ "../var/document" ], function( document ) { "use strict"; function DOMEval( code, doc ) { doc = doc || document; var script = doc.createElement( "script" ); script.text = code; doc.head.appendChild( script ).parentNode.removeChild( script ); } return DOMEval; } );
{ "pile_set_name": "Github" }
<?php /** * This file is part of Gitonomy. * * (c) Alexandre Salomé <[email protected]> * (c) Julien DIDIER <[email protected]> * * This source file is subject to the GPL license that is bundled * with this source code in the file LICENSE. */ namespace Gitonomy\Bundle\CoreBundle\Tests\Command; use Gitonomy\Bundle\CoreBundle\Test\CommandTestCase; class UserRoleCreateCommandTest extends CommandTestCase { protected $client; public function setUp() { $this->client = self::createClient(); $this->client->startIsolation(); } public function tearDown() { $this->client->stopIsolation(); } public function testProjectRole() { list($statusCode ,$output) = $this->runCommand($this->client, 'gitonomy:user-role-create bob Developer barbaz'); $this->assertEquals("Added successfully Bob as Developer to Barbaz\n", $output); $em = $this->client->getKernel()->getContainer()->get('doctrine')->getManager(); $user = $em->getRepository('GitonomyCoreBundle:User')->findOneByUsername('bob'); $role = $em->getRepository('GitonomyCoreBundle:Role')->findOneByName('Developer'); $project = $em->getRepository('GitonomyCoreBundle:Project')->findOneBySlug('barbaz'); $userRole = $em->getRepository('GitonomyCoreBundle:UserRoleProject')->findOneBy(array( 'user' => $user, 'role' => $role, )); $this->assertInstanceOf('Gitonomy\Bundle\CoreBundle\Entity\UserRoleProject', $userRole); } public function testGlobalRole() { list($statusCode ,$output) = $this->runCommand($this->client, 'gitonomy:user-role-create bob Administrator'); $this->assertEquals("Added successfully Bob as Administrator\n", $output); $em = $this->client->getKernel()->getContainer()->get('doctrine')->getManager(); $user = $em->getRepository('GitonomyCoreBundle:User')->findOneByUsername('bob'); $role = $em->getRepository('GitonomyCoreBundle:Role')->findOneByName('Administrator'); $this->assertTrue($user->getGlobalRoles()->contains($role)); } public function testProjectRoleIncorrect() { list($statusCode ,$output) = $this->runCommand($this->client, 'gitonomy:user-role-create bob Administrator barbaz'); $this->assertContains("Cannot add a global role to a project", $output); } public function testGlobalRoleIncorrect() { list($statusCode ,$output) = $this->runCommand($this->client, 'gitonomy:user-role-create bob Developer'); $this->assertContains("Cannot add a project role without project slug", $output); } }
{ "pile_set_name": "Github" }
'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); var _helpers = require('../helpers'); exports.default = function (state, actions) { if (state.debug) console.log('IntentAny'.bold.green); return (0, _helpers.factoryActions)(state, actions); };
{ "pile_set_name": "Github" }
fileFormatVersion: 2 guid: f9e5704ccbf06764294443278c614f1d timeCreated: 1469126254 licenseType: Free DefaultImporter: userData: assetBundleName: assetBundleVariant:
{ "pile_set_name": "Github" }
# mapstructure mapstructure is a Go library for decoding generic map values to structures and vice versa, while providing helpful error handling. This library is most useful when decoding values from some data stream (JSON, Gob, etc.) where you don't _quite_ know the structure of the underlying data until you read a part of it. You can therefore read a `map[string]interface{}` and use this library to decode it into the proper underlying native Go structure. ## Installation Standard `go get`: ``` $ go get github.com/mitchellh/mapstructure ``` ## Usage & Example For usage and examples see the [Godoc](http://godoc.org/github.com/mitchellh/mapstructure). The `Decode` function has examples associated with it there. ## But Why?! Go offers fantastic standard libraries for decoding formats such as JSON. The standard method is to have a struct pre-created, and populate that struct from the bytes of the encoded format. This is great, but the problem is if you have configuration or an encoding that changes slightly depending on specific fields. For example, consider this JSON: ```json { "type": "person", "name": "Mitchell" } ``` Perhaps we can't populate a specific structure without first reading the "type" field from the JSON. We could always do two passes over the decoding of the JSON (reading the "type" first, and the rest later). However, it is much simpler to just decode this into a `map[string]interface{}` structure, read the "type" key, then use something like this library to decode it into the proper structure.
{ "pile_set_name": "Github" }
# frozen_string_literal: true require 'spec_helper' require './spec/controllers/squash_many_duplicates_examples' module Calagator describe VenuesController, type: :controller do routes { Calagator::Engine.routes } render_views context 'concerning duplicates' do let!(:venue_master) { FactoryBot.create(:venue) } let!(:venue_duplicate) { FactoryBot.create(:venue, duplicate_of: venue_master) } it 'redirects duplicate venues to their master' do get 'show', id: venue_duplicate.id expect(response).to redirect_to(venue_url(venue_master.id)) end it "doesn't redirect non-duplicates" do get 'show', id: venue_master.id expect(response).not_to be_redirect expect(assigns(:venue).id).to eq venue_master.id end end context 'with admin auth for duplicates' do before do credentials = ActionController::HttpAuthentication::Basic.encode_credentials Calagator.admin_username, Calagator.admin_password request.env['HTTP_AUTHORIZATION'] = credentials end it 'displays an error message if given invalid arguments' do get 'duplicates', type: 'omgwtfbbq' expect(response).to be_success expect(response.body).to have_selector('.failure', text: 'omgwtfbbq') end context do include_examples '#squash_many_duplicates', :venue end end describe 'when creating venues' do it 'redirects to the newly created venue' do post :create, venue: FactoryBot.attributes_for(:venue) expect(response).to redirect_to(assigns(:venue)) end it 'stops evil robots' do post :create, trap_field: "I AM AN EVIL ROBOT, I EAT OLD PEOPLE'S MEDICINE FOR FOOD!" expect(response).to render_template :new end end describe 'when updating venues' do before do @venue = FactoryBot.create(:venue) end it 'redirects to the updated venue' do put :update, id: @venue.id, venue: FactoryBot.attributes_for(:venue) expect(response).to redirect_to(@venue) end it 'redirects to any associated event' do @event = FactoryBot.create(:event, venue: @venue) put :update, id: @venue.id, from_event: @event.id, venue: FactoryBot.attributes_for(:venue) expect(response).to redirect_to(@event) end it 'stops evil robots' do put :update, id: @venue.id, trap_field: "I AM AN EVIL ROBOT, I EAT OLD PEOPLE'S MEDICINE FOR FOOD!" expect(response).to render_template :edit end end describe 'when rendering the new venue page' do it 'passes the template a new venue' do get :new expect(assigns[:venue]).to be_a Venue expect(assigns[:venue]).to be_new_record end end describe 'when rendering the edit venue page' do it 'passes the template the specified venue' do @venue = FactoryBot.create(:venue) get :edit, id: @venue.id expect(assigns[:venue]).to eq(@venue) end end describe 'when rendering the map page' do before do @open_venue = FactoryBot.create(:venue) @closed_venue = FactoryBot.create(:venue, closed: true) @duplicate_venue = FactoryBot.create(:venue, duplicate_of: @open_venue) end it 'only shows open non-duplicate venues' do get :map expect(assigns[:venues]).to eq([@open_venue]) end end describe 'when rendering the venues index' do before do @venues = [FactoryBot.create(:venue), FactoryBot.create(:venue)] end it 'assigns the search object to @search' do get :index expect(assigns[:search]).to be_a Venue::Search end it 'assigns search results to @venues' do get :index expect(assigns[:venues]).to eq(@venues) end describe 'in JSON format' do it 'produces JSON' do get :index, format: 'json' struct = ActiveSupport::JSON.decode(response.body) expect(struct).to be_a_kind_of Array end end end describe 'when showing venues' do it "redirects to all venues if venue doesn't exist" do get :show, id: 'garbage' expect(response).to redirect_to('/venues') end describe 'in JSON format' do describe 'with events' do before do @venue = FactoryBot.build(:venue, id: 123) allow(Venue).to receive(:find).and_return(@venue) end it 'produces JSON' do get :show, id: @venue.to_param, format: 'json' struct = ActiveSupport::JSON.decode(response.body) expect(struct).to be_a_kind_of Hash %w[id title description address].each do |field| expect(struct[field]).to eq @venue.send(field) end end end end describe 'in HTML format' do describe 'venue with future and past events' do before do @venue = FactoryBot.create(:venue) @future_event = FactoryBot.create(:event, venue: @venue) @past_event = FactoryBot.create(:event, venue: @venue, start_time: Time.now.in_time_zone - 1.week + 1.hour, end_time: Time.now.in_time_zone - 1.week + 2.hours) get :show, id: @venue.to_param, format: 'html' expect(response).to be_success end it 'has a venue' do expect(response.body).to have_selector('.location .fn', text: @venue.title) end it 'has a future event' do expect(response.body).to have_selector('#events #future_events .summary', text: @future_event.title) end it 'has a past event' do expect(response.body).to have_selector('#events #past_events .summary', text: @past_event.title) end end end describe 'as an iCalendar' do before do @venue = FactoryBot.create(:venue) @future_event = FactoryBot.create(:event, venue: @venue, start_time: today + 1.hour) @past_event = FactoryBot.create(:event, venue: @venue, start_time: today - 1.hour) get :show, id: @venue.to_param, format: 'ics' end it 'has a calendar' do expect(response.body).to match /BEGIN:VCALENDAR/ end it 'has events' do expect(response.body).to match /BEGIN:VEVENT/ end it 'renders all future events' do expect(response.body).to match /SUMMARY:#{@future_event.title}/ end it 'renders all past events' do expect(response.body).to match /SUMMARY:#{@past_event.title}/ end end end describe 'DELETE' do describe 'when deleting a venue without events' do before do @venue = FactoryBot.create(:venue) end shared_examples_for 'destroying a Venue record without events' do it 'destroys the Venue record' do expect { Venue.find(@venue.id) }.to raise_error ActiveRecord::RecordNotFound end end describe 'and rendering HTML' do before do delete :destroy, id: @venue.id end it_behaves_like 'destroying a Venue record without events' it 'displays a success message' do expect(flash[:success]).to be_present end it 'redirects to the venues listing' do expect(response).to redirect_to(venues_path) end end describe 'and rendering XML' do render_views before do delete :destroy, id: @venue.id, format: 'xml' end it_behaves_like 'destroying a Venue record without events' it 'returns a success status' do expect(response).to be_success end end end describe 'when deleting a venue with events' do before do @event = FactoryBot.create(:event, :with_venue) @venue = @event.venue end shared_examples_for 'destroying a Venue record with events' do it 'does not destroy the Venue record' do expect(Venue.find(@venue.id)).to be_present end end describe 'and rendering HTML' do before do delete :destroy, id: @venue.id end it_behaves_like 'destroying a Venue record with events' it 'displays a failure message' do expect(flash[:failure]).to be_present end it 'redirects to the venue page' do expect(response).to redirect_to(venue_path(@venue)) end end describe 'and rendering XML' do before do delete :destroy, id: @venue.id, format: 'xml' end it_behaves_like 'destroying a Venue record with events' it 'returns unprocessable entity status' do expect(response.code.to_i).to eq 422 end it 'describings the problem' do expect(response.body).to match /cannot/i end end end end end end
{ "pile_set_name": "Github" }
// Numerical integration #ifndef QUADRATURE_INTEGRATION_H #define QUADRATURE_INTEGRATION_H #include <stddef.h> // Availability #if __has_include( <Availability.h> ) #include <Availability.h> #else #define __API_AVAILABLE(...) #endif // Nullability #if __has_feature(assume_nonnull) _Pragma("clang assume_nonnull begin") #else #define _Null_unspecified #define _Nullable #endif /*! @abstract Y=F(X) one-dimensional real function, array form, double precision @discussion Should set values <tt>y[i] = F(x[i])</tt> for i=0..n-1. @param arg User argument passed back to the function when evaluated @param n Dimension of arrays X and Y @param x Array of points to evaluate the function @param y Array receiving the values */ typedef void (*quadrature_function_array)(void * _Null_unspecified __arg, size_t __n, const double *__x, double *__y); /*! @enum quadrature_integrator @abstract Integrators @constant QUADRATURE_INTEGRATE_QNG Simple non-adaptive automatic integrator using Gauss-Kronrod-Patterson quadrature coefficients. Evaluates 21, or 43, or 87 points in the interval until the requested accuracy is reached. No workspace is necessary for this integrator. @constant QUADRATURE_INTEGRATE_QAG Simple globally adaptive integrator. Allows selection of the number of Gauss-Kronrod points used in each subinterval, and the max number of subintervals. @constant QUADRATURE_INTEGRATE_QAGS Global adaptive quadrature based on 21-point or 15-point (if at least one bound is infinite) Gauss–Kronrod quadrature within each subinterval, with acceleration by Peter Wynn's epsilon algorithm. If at least one of the interval bounds is infinite, this is equivalent to the QUADPACK QAGI routine. Otherwise, this is equivalent to the QUADPACK QAGS routine. */ typedef enum { QUADRATURE_INTEGRATE_QNG, QUADRATURE_INTEGRATE_QAG, QUADRATURE_INTEGRATE_QAGS } quadrature_integrator; /*! @abstract Bytes per interval to allocate in workspace for the QAG integrator. */ #define QUADRATURE_INTEGRATE_QAG_WORKSPACE_PER_INTERVAL 32 /*! @abstract Bytes per interval to allocate in workspace for the QAGS integrator. */ #define QUADRATURE_INTEGRATE_QAGS_WORKSPACE_PER_INTERVAL 152 /*! @abstract Function to integrate @discussion Describes a real function Y=F(X). Since most of the integration time is spent evaluating F, we allow the caller to provide a array callback, computing several values of F in a single call. @field fun Y=F(X) callback. @field fun_arg User pointer passed as first argument to all invocations of <tt>fun</tt>. */ typedef struct { quadrature_function_array fun; void * _Null_unspecified fun_arg; } quadrature_integrate_function; /*! @abstract Integration options @field integrator Integration algorithm to apply. @field abs_tolerance Requested absolute tolerance on the result. @field rel_tolerance Requested relative tolerance on the result. @field qag_points_per_interval Number of Gauss-Kronrod points per interval used by the QAG integrator. Can be 0, 15, 21, 31, 41, 51, 61. 0 maps to the default 21. Used by the QAG integrator only. Other integrators ignore this value. @field max_intervals Limit the number of intervals in the subdivision used by adaptive integrators. If a workspace is provided, this value is ignored, and the number of intervals is limited by <tt>workspace_size</tt>. <br>The QNG integrator doesn't require a workspace. <br>The QAG integrator requires at least <tt>max_intervals * QUADRATURE_INTEGRATE_QAG_WORKSPACE_PER_INTERVAL</tt> bytes in <tt>workspace</tt>. <br>The QAGS integrator requires at least <tt>max_intervals * QUADRATURE_INTEGRATE_QAGS_WORKSPACE_PER_INTERVAL</tt> bytes in <tt>workspace</tt>. */ typedef struct { quadrature_integrator integrator; double abs_tolerance; double rel_tolerance; size_t qag_points_per_interval; size_t max_intervals; } quadrature_integrate_options; /*! @abstract Integrate a function F over ]A,B[. @discussion This function provides a set of algorithms (integrators) to compute an approximation S' of the integral S = &int; F(x) dx over the interval ]A,B[. The QNG (simple non-adaptive Gauss-Kronrod integration) and QAG (simple adaptive Gauss-Kronrod integration) integrators are C ports of the QUADPACK library corresponding routines. The QAGS integrator provides the functionality offered by the QAGS and QAGI QUADPACK routines. On success, S' is assumed to verify abs(S-S') &le; max(abs_tolerance, rel_tolerance * abs(S)). The integration algorithms will identify <b>most</b> cases of divergence, slow convergence, and bad behaviour, and report an error. The bounds a,b do not need to verify a &le; b. If the integrator is QAGS, one or both of the interval bounds can be infinite (-INFINITY or +INFINITY). Unless F is known to be smooth enough to guarantee success, it is strongly advised to always check the returned status and absolute error. The QUADPACK library documentation provides a decision tree to select the integrator. Adapted to match the contents of this library, this decision tree becomes: <b>Integration over a finite region</b> <ul> <li>If performance is not a concern and you don’t know much about the specifics of the problem, use QAGS. <li>Otherwise, if the integrand is smooth, use QNG or QAG if the requested tolerance couldn't be reached with QNG. <li>Otherwise, if there are discontinuities or singularities of the integrand or of its derivative, and you know where they are, split the integration range at these points and analyze each subinterval. <li>Otherwise, if the integrand has end point singularities, use QAGS. <li>Otherwise, if the integrand has an oscillatory behavior of nonspecific type, and no singularities, use QAG with 61 points per interval. <li>Otherwise, use QAGS. </ul> <b>Integration over an infinite region</b> <ul> <li>If the integrand decays rapidly to zero, truncate the interval and use the finite interval decision tree. <li>Otherwise, if you are not constrained by computer time, and do not wish to analyze the problem further, use QAGS. <li>Otherwise, if the integrand has a non-smooth behavior in the range, and you know where it occurs, split off these regions and use the appropriate finite range routines to integrate over them. Then begin this tree again to handle the remainder of the region. <li>Otherwise, truncation of the interval, or application of a suitable transformation for reducing the problem to a finite range may be possible. </ul> QUADPACK Reference: Robert Piessens, Elise deDoncker-Kapenga, Christian Ueberhuber, David Kahaner, QUADPACK: A Subroutine Package for Automatic Integration, Springer, 1983, ISBN: 3540125531, LC: QA299.3.Q36. @param f Function to integrate. Can't be NULL. @param a First bound of the integration interval. May be +/- INFINITY for QAGS. @param b Second bound of the integration interval. May be +/- INFINITY for QAGS. @param options Integration options. Can't be NULL. @param status If not NULL, <tt>*status</tt> receives QUADRATURE_SUCCESS if the integration was successful, and a negative QUADRATURE_..._ERROR code on failure. @param abs_error If not NULL, <tt>*abs_error</tt> receives an estimate of the absolute error on the result. @param workspace_size Number of bytes allocated in <tt>workspace</tt>, or 0. @param workspace If not NULL, points to a work buffer of <tt>workspace_size</tt> bytes. In that case, no additional memory will be allocated. If NULL, the function will internally allocate a workspace buffer if one is needed. @return Returns an approximation to the integral. */ extern double quadrature_integrate(const quadrature_integrate_function * __f, double __a, double __b, const quadrature_integrate_options * options, quadrature_status * _Nullable status, double * _Nullable abs_error, size_t workspace_size, void * __restrict _Nullable workspace) __API_AVAILABLE(macos(10.12), ios(10.0), tvos(10.0), watchos(3.0)); // Availability #if !__has_include(<Availability.h>) #undef __API_AVAILABLE #endif // Nullability #if __has_feature(assume_nonnull) _Pragma("clang assume_nonnull end") #else #undef _Nullable #undef _Null_unspecified #endif #endif // QUADRATURE_INTEGRATION_H
{ "pile_set_name": "Github" }
/* SPDX-License-Identifier: GPL-2.0-only */ #include <memlayout.h> #include <arch/header.ld> /* * Note: The BootROM uses the address range [0x4000_0000:0x4000_E000) itself, * so the bootblock loading address must be placed after that. After the * handoff that area may be reclaimed for other uses, e.g. CBFS cache. */ SECTIONS { SRAM_START(0x40000000) TTB(0x40000000, 16K + 32) PRERAM_CBMEM_CONSOLE(0x40004020, 6K - 32) FMAP_CACHE(0x40005800, 2K) PRERAM_CBFS_CACHE(0x40006000, 14K) VBOOT2_WORK(0x40009800, 12K) TPM_TCPA_LOG(0x4000D800, 2K) STACK(0x4000E000, 8K) BOOTBLOCK(0x40010000, 30K) VERSTAGE(0x40017800, 72K) ROMSTAGE(0x40029800, 89K) TIMESTAMP(0x4003FC00, 1K) SRAM_END(0x40040000) DRAM_START(0x80000000) POSTRAM_CBFS_CACHE(0x80100000, 1M) RAMSTAGE(0x80200000, 128K) DMA_COHERENT(0x90000000, 2M) }
{ "pile_set_name": "Github" }
body { margin: 0; padding: 0; }
{ "pile_set_name": "Github" }
FROM alpine:3.11 release: ARG RELEASE_TAG RUN test -n "$RELEASE_TAG" BUILD ../+test-all BUILD --build-arg RELEASE_TAG="$RELEASE_TAG" +release-dockerhub BUILD --build-arg RELEASE_TAG="$RELEASE_TAG" +release-github release-dockerhub: ARG RELEASE_TAG RUN test -n "$RELEASE_TAG" BUILD --build-arg TAG="$RELEASE_TAG" ../+earth-docker BUILD --build-arg TAG="$RELEASE_TAG" ../buildkitd+buildkitd BUILD --build-arg TAG=latest ../+earth-docker BUILD --build-arg TAG=latest ../buildkitd+buildkitd release-github: FROM node:13.10.1-alpine3.11 RUN npm install -g github-release-cli WORKDIR /earthly ARG RELEASE_TAG ARG EARTHLY_GIT_HASH RUN test -n "$RELEASE_TAG" && test -n "$EARTHLY_GIT_HASH" COPY --build-arg VERSION=$RELEASE_TAG \ ../+earth-all/* ./release/ RUN ls ./release RUN test -f ./release/earth-linux-amd64 && \ test -f ./release/earth-darwin-amd64 ARG BODY="No details provided" RUN --secret GITHUB_TOKEN=+secrets/GITHUB_TOKEN test -n "$GITHUB_TOKEN" RUN --push \ --secret GITHUB_TOKEN=+secrets/GITHUB_TOKEN \ github-release upload \ --owner earthly \ --repo earthly \ --commitish "$EARTHLY_GIT_HASH" \ --tag "$RELEASE_TAG" \ --name "$RELEASE_TAG" \ --body "$BODY" \ ./release/* release-homebrew: RUN apk add --update --no-cache \ bash \ bash-completion \ binutils \ ca-certificates \ coreutils \ curl \ findutils \ g++ \ git \ grep \ less \ make \ openssl \ util-linux RUN apk add --update --no-cache --repository=http://dl-cdn.alpinelinux.org/alpine/edge/testing hub # Deps and preconditions. ARG RELEASE_TAG ARG GIT_USERNAME ARG GIT_NAME ARG GIT_EMAIL ARG REPO_OWNER=Homebrew ARG HOMEBREW_CORE_URL="https://github.com/$REPO_OWNER/homebrew-core" RUN test -n "$RELEASE_TAG" && \ test -n "$GIT_USERNAME" && \ test -n "$GIT_NAME" && \ test -n "$GIT_EMAIL" && \ test -n "$REPO_OWNER" && \ test -n "$HOMEBREW_CORE_URL" ARG NEW_URL=https://github.com/earthly/earthly/archive/"$RELEASE_TAG".tar.gz RUN test -n "$NEW_URL" GIT CLONE "$HOMEBREW_CORE_URL" /earthly/homebrew-core WORKDIR /earthly/homebrew-core # Git setup. # Force use of https. RUN git remote set-url origin "$HOMEBREW_CORE_URL" && \ git remote -v RUN --secret GIT_PASSWORD=+secrets/GITHUB_TOKEN \ git fetch --unshallow origin master RUN git branch -f master && \ git checkout master && \ git branch -u origin/master RUN git config --global user.name "$GIT_NAME" && \ git config --global user.email "$GIT_EMAIL" COPY ./envcredhelper.sh /usr/bin/envcredhelper.sh RUN git config --global credential.helper "/bin/sh /usr/bin/envcredhelper.sh" # Make the change in a new branch. RUN git checkout -b "release-$RELEASE_TAG" RUN mkdir -p /params RUN curl -L "$NEW_URL" | sha256sum | cut -f 1 -d ' ' > /params/downloadsha256 COPY --build-arg VERSION=$RELEASE_TAG \ ../+earth-darwin/tags ../+earth-darwin/ldflags /params/ # Split /params/ldflags over two lines (to satisfy ruby linter). RUN split --numeric-suffixes=1 --suffix-length=1 --bytes=80 /params/ldflags /params/ldflags && \ touch /params/ldflags2 && \ if [ -f "/params/ldflags3" ]; then \ echo "More than two lines for ldflags not supported" && \ exit 1 ;\ fi # replace version with #{version} variable to conform to homebrew PR requests RUN escapedversion=`echo "${RELEASE_TAG}" | sed 's/\./\\\./g'`; \ sed -i -e "s/${escapedversion}/v#{version}/g" /params/ldflags* RUN sed -i \ -e 's^url ".*"^url "'"$NEW_URL"'"^' \ -e 's^sha256 ".*"$^sha256 "'$(cat /params/downloadsha256)'"^' \ -e 's^tags = ".*"^tags = "'"$(cat /params/tags)"'"^' \ -e 's^ldflags = ".*"^ldflags = "'"$(cat /params/ldflags1)"'"^' \ -e '/ldflags = ".*"/{n;s^".*"^"'"$(cat /params/ldflags2)"'"^}' \ ./Formula/earthly.rb RUN echo "Diff:" && git diff RUN version=${RELEASE_TAG#v} ;\ echo version=$version ;\ git commit -a -m "earthly $version" # Fork, push branch to fork and create upstream PR. RUN --secret GITHUB_TOKEN=+secrets/GITHUB_TOKEN test -n "$GITHUB_TOKEN" RUN --push \ --secret GITHUB_TOKEN=+secrets/GITHUB_TOKEN \ -- \ hub fork # Force use of https st we can use GITHUB_TOKEN via envcredhelper.sh. RUN --push \ -- \ git remote set-url "$GIT_USERNAME" "https://github.com/$GIT_USERNAME/homebrew-core.git" && \ git remote -v RUN --push \ --secret GIT_PASSWORD=+secrets/GITHUB_TOKEN \ -- \ git push "$GIT_USERNAME" "release-$RELEASE_TAG" RUN --push \ --secret GIT_PASSWORD=+secrets/GITHUB_TOKEN \ --secret GITHUB_TOKEN=+secrets/GITHUB_TOKEN \ -- \ version=${RELEASE_TAG#v} ;\ echo version=$version ;\ hub pull-request --no-edit \ -h "$GIT_USERNAME":"release-$RELEASE_TAG" \ -b "$REPO_OWNER:master" \ -m "earthly $version" \ -m '-------------' \ -m '#### Debug data' \ -m 'PR generated by the [Earthly build](https://github.com/earthly/earthly/blob/master/release/Earthfile) (target +release-homebrew)' \ -m '* `RELEASE_TAG='"$RELEASE_TAG"'`' \ -m '* `GIT_USERNAME='"$GIT_USERNAME"'`' \ -m '* `NEW_URL='"$NEW_URL"'`' \ -m '* `NEW_SHA256='"$(cat /params/downloadsha256)"'`' \ -m '* `TAGS='"$(cat /params/tags)"'`' \ -m '* `LDFLAGS='"$(cat /params/ldflags)"'`' \ -m '* `LDFLAGS1='"$(cat /params/ldflags1)"'`' \ -m '* `LDFLAGS2='"$(cat /params/ldflags2)"'`' release-vscode-syntax-highlighting: ARG VSCODE_RELEASE_TAG BUILD --build-arg VSCODE_RELEASE_TAG="$VSCODE_RELEASE_TAG" ../contrib/earthfile-syntax-highlighting+release
{ "pile_set_name": "Github" }
{ "name": "react-morph-docz", "version": "0.4.0", "description": "", "main": "index.js", "scripts": { "postinstall": "./postinstall.sh", "watch-lib": "onchange '../lib/**/*.js' -- npm run postinstall", "dev": "docz dev && npm run watch-lib", "deploy": "gh-pages -d .docz/dist", "build": "docz build" }, "keywords": [], "dependencies": { "@types/react-router-dom": "^4.3.2", "@types/styled-components": "^4.1.14", "docz-plugin-css": "^0.11.0", "react": "^16.8.6", "react-dom": "^16.8.6", "react-router-dom": "^5.0.0", "styled-components": "^4.2.0" }, "devDependencies": { "@types/react": "^16.8.13", "@types/react-dom": "^16.8.3", "docz": "^1.0.0", "docz-theme-default": "^1.0.0", "onchange": "^5.2.0" }, "homepage": "https://brunnolou.github.io/react-morph", "repository": { "type": "git", "url": "git+https://github.com/brunnolou/react-morph.git" }, "contributors": [ "Bruno Lourenço" ], "license": "MIT", "bugs": { "url": "https://github.com/brunnolou/react-morph/issues" } }
{ "pile_set_name": "Github" }
/** * Checks if a `cache` value for `key` exists. * * @private * @param {Object} cache The cache to query. * @param {string} key The key of the entry to check. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. */ function cacheHas(cache, key) { return cache.has(key); } module.exports = cacheHas;
{ "pile_set_name": "Github" }
/// { /// description: 'scalar(0) should be "0"', /// data: { /// foo: 0 /// }, /// result: '0' /// } match / { scalar(.foo) }
{ "pile_set_name": "Github" }
/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #pragma once #include <aws/kinesisanalytics/KinesisAnalytics_EXPORTS.h> #include <aws/kinesisanalytics/model/ApplicationDetail.h> #include <utility> namespace Aws { template<typename RESULT_TYPE> class AmazonWebServiceResult; namespace Utils { namespace Json { class JsonValue; } // namespace Json } // namespace Utils namespace KinesisAnalytics { namespace Model { /** * <p/><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/kinesisanalytics-2015-08-14/DescribeApplicationResponse">AWS * API Reference</a></p> */ class AWS_KINESISANALYTICS_API DescribeApplicationResult { public: DescribeApplicationResult(); DescribeApplicationResult(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result); DescribeApplicationResult& operator=(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result); /** * <p>Provides a description of the application, such as the application Amazon * Resource Name (ARN), status, latest version, and input and output configuration * details.</p> */ inline const ApplicationDetail& GetApplicationDetail() const{ return m_applicationDetail; } /** * <p>Provides a description of the application, such as the application Amazon * Resource Name (ARN), status, latest version, and input and output configuration * details.</p> */ inline void SetApplicationDetail(const ApplicationDetail& value) { m_applicationDetail = value; } /** * <p>Provides a description of the application, such as the application Amazon * Resource Name (ARN), status, latest version, and input and output configuration * details.</p> */ inline void SetApplicationDetail(ApplicationDetail&& value) { m_applicationDetail = std::move(value); } /** * <p>Provides a description of the application, such as the application Amazon * Resource Name (ARN), status, latest version, and input and output configuration * details.</p> */ inline DescribeApplicationResult& WithApplicationDetail(const ApplicationDetail& value) { SetApplicationDetail(value); return *this;} /** * <p>Provides a description of the application, such as the application Amazon * Resource Name (ARN), status, latest version, and input and output configuration * details.</p> */ inline DescribeApplicationResult& WithApplicationDetail(ApplicationDetail&& value) { SetApplicationDetail(std::move(value)); return *this;} private: ApplicationDetail m_applicationDetail; }; } // namespace Model } // namespace KinesisAnalytics } // namespace Aws
{ "pile_set_name": "Github" }
package mtp import ( "io" ) // Android MTP extensions // Same as GetPartialObject, but with 64 bit offset const OC_ANDROID_GET_PARTIAL_OBJECT64 = 0x95C1 // Same as GetPartialObject64, but copying host to device const OC_ANDROID_SEND_PARTIAL_OBJECT = 0x95C2 // Truncates file to 64 bit length const OC_ANDROID_TRUNCATE_OBJECT = 0x95C3 // Must be called before using SendPartialObject and TruncateObject const OC_ANDROID_BEGIN_EDIT_OBJECT = 0x95C4 // Called to commit changes made by SendPartialObject and TruncateObject const OC_ANDROID_END_EDIT_OBJECT = 0x95C5 func init() { OC_names[0x95C1] = "ANDROID_GET_PARTIAL_OBJECT64" OC_names[0x95C2] = "ANDROID_SEND_PARTIAL_OBJECT" OC_names[0x95C3] = "ANDROID_TRUNCATE_OBJECT" OC_names[0x95C4] = "ANDROID_BEGIN_EDIT_OBJECT" OC_names[0x95C5] = "ANDROID_END_EDIT_OBJECT" } // AndroidGetPartialObject64 reads a section of a file. func (d *Device) AndroidGetPartialObject64(handle uint32, w io.Writer, offset int64, size uint32) error { var req, rep Container req.Code = OC_ANDROID_GET_PARTIAL_OBJECT64 req.Param = []uint32{handle, uint32(offset & 0xFFFFFFFF), uint32(offset >> 32), size} return d.RunTransaction(&req, &rep, w, nil, 0) } // AndroidBeginEditObject opens a file for writing. func (d *Device) AndroidBeginEditObject(handle uint32) error { var req, rep Container req.Code = OC_ANDROID_BEGIN_EDIT_OBJECT req.Param = []uint32{handle} return d.RunTransaction(&req, &rep, nil, nil, 0) } // AndroidTruncate truncates at a file at a given length. func (d *Device) AndroidTruncate(handle uint32, offset int64) error { var req, rep Container req.Code = OC_ANDROID_TRUNCATE_OBJECT req.Param = []uint32{handle, uint32(offset & 0xFFFFFFFF), uint32(offset >> 32)} return d.RunTransaction(&req, &rep, nil, nil, 0) } // AndroidSendPartialObject writes a section of a file. func (d *Device) AndroidSendPartialObject(handle uint32, offset int64, size uint32, r io.Reader) error { var req, rep Container req.Code = OC_ANDROID_SEND_PARTIAL_OBJECT req.Param = []uint32{handle, uint32(offset & 0xFFFFFFFF), uint32(offset >> 32), size} // MtpServer.cpp is buggy: it uses write() without offset // rather than pwrite to send the data for data coming with // the header packet d.SeparateHeader = true err := d.RunTransaction(&req, &rep, nil, r, int64(size)) d.SeparateHeader = false return err } // AndroidEndEditObject closes a file opened for write. func (d *Device) AndroidEndEditObject(handle uint32) error { var req, rep Container req.Code = OC_ANDROID_END_EDIT_OBJECT req.Param = []uint32{handle} return d.RunTransaction(&req, &rep, nil, nil, 0) }
{ "pile_set_name": "Github" }
/* * #%L * ACS AEM Commons Bundle * %% * Copyright (C) 2017 Adobe * %% * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * #L% */ package com.adobe.acs.commons.util.impl.exception; public class CacheMBeanException extends Exception{ public CacheMBeanException() { } public CacheMBeanException(String message) { super(message); } public CacheMBeanException(String message, Throwable cause) { super(message, cause); } }
{ "pile_set_name": "Github" }