text
stringlengths
2
100k
meta
dict
package request import ( "bytes" "fmt" "io" "net/http" "net/url" "reflect" "strings" "time" "github.com/IBM/ibm-cos-sdk-go/aws" "github.com/IBM/ibm-cos-sdk-go/aws/awserr" "github.com/IBM/ibm-cos-sdk-go/aws/client/metadata" "github.com/IBM/ibm-cos-sdk-go/internal/sdkio" ) const ( // ErrCodeSerialization is the serialization error code that is received // during protocol unmarshaling. ErrCodeSerialization = "SerializationError" // ErrCodeRead is an error that is returned during HTTP reads. ErrCodeRead = "ReadError" // ErrCodeResponseTimeout is the connection timeout error that is received // during body reads. ErrCodeResponseTimeout = "ResponseTimeout" // ErrCodeInvalidPresignExpire is returned when the expire time provided to // presign is invalid ErrCodeInvalidPresignExpire = "InvalidPresignExpireError" // CanceledErrorCode is the error code that will be returned by an // API request that was canceled. Requests given a aws.Context may // return this error when canceled. CanceledErrorCode = "RequestCanceled" ) // A Request is the service request to be made. type Request struct { Config aws.Config ClientInfo metadata.ClientInfo Handlers Handlers Retryer AttemptTime time.Time Time time.Time Operation *Operation HTTPRequest *http.Request HTTPResponse *http.Response Body io.ReadSeeker BodyStart int64 // offset from beginning of Body that the request body starts Params interface{} Error error Data interface{} RequestID string RetryCount int Retryable *bool RetryDelay time.Duration NotHoist bool SignedHeaderVals http.Header LastSignedAt time.Time DisableFollowRedirects bool // Additional API error codes that should be retried. IsErrorRetryable // will consider these codes in addition to its built in cases. RetryErrorCodes []string // Additional API error codes that should be retried with throttle backoff // delay. IsErrorThrottle will consider these codes in addition to its // built in cases. ThrottleErrorCodes []string // A value greater than 0 instructs the request to be signed as Presigned URL // You should not set this field directly. Instead use Request's // Presign or PresignRequest methods. ExpireTime time.Duration context aws.Context built bool // Need to persist an intermediate body between the input Body and HTTP // request body because the HTTP Client's transport can maintain a reference // to the HTTP request's body after the client has returned. This value is // safe to use concurrently and wrap the input Body for each HTTP request. safeBody *offsetReader } // An Operation is the service API operation to be made. type Operation struct { Name string HTTPMethod string HTTPPath string *Paginator BeforePresignFn func(r *Request) error } // New returns a new Request pointer for the service API operation and // parameters. // // A Retryer should be provided to direct how the request is retried. If // Retryer is nil, a default no retry value will be used. You can use // NoOpRetryer in the Client package to disable retry behavior directly. // // Params is any value of input parameters to be the request payload. // Data is pointer value to an object which the request's response // payload will be deserialized to. func New(cfg aws.Config, clientInfo metadata.ClientInfo, handlers Handlers, retryer Retryer, operation *Operation, params interface{}, data interface{}) *Request { if retryer == nil { retryer = noOpRetryer{} } method := operation.HTTPMethod if method == "" { method = "POST" } httpReq, _ := http.NewRequest(method, "", nil) var err error httpReq.URL, err = url.Parse(clientInfo.Endpoint + operation.HTTPPath) if err != nil { httpReq.URL = &url.URL{} err = awserr.New("InvalidEndpointURL", "invalid endpoint uri", err) } SanitizeHostForHeader(httpReq) r := &Request{ Config: cfg, ClientInfo: clientInfo, Handlers: handlers.Copy(), Retryer: retryer, Time: time.Now(), ExpireTime: 0, Operation: operation, HTTPRequest: httpReq, Body: nil, Params: params, Error: err, Data: data, } r.SetBufferBody([]byte{}) return r } // A Option is a functional option that can augment or modify a request when // using a WithContext API operation method. type Option func(*Request) // WithGetResponseHeader builds a request Option which will retrieve a single // header value from the HTTP Response. If there are multiple values for the // header key use WithGetResponseHeaders instead to access the http.Header // map directly. The passed in val pointer must be non-nil. // // This Option can be used multiple times with a single API operation. // // var id2, versionID string // svc.PutObjectWithContext(ctx, params, // request.WithGetResponseHeader("x-amz-id-2", &id2), // request.WithGetResponseHeader("x-amz-version-id", &versionID), // ) func WithGetResponseHeader(key string, val *string) Option { return func(r *Request) { r.Handlers.Complete.PushBack(func(req *Request) { *val = req.HTTPResponse.Header.Get(key) }) } } // WithGetResponseHeaders builds a request Option which will retrieve the // headers from the HTTP response and assign them to the passed in headers // variable. The passed in headers pointer must be non-nil. // // var headers http.Header // svc.PutObjectWithContext(ctx, params, request.WithGetResponseHeaders(&headers)) func WithGetResponseHeaders(headers *http.Header) Option { return func(r *Request) { r.Handlers.Complete.PushBack(func(req *Request) { *headers = req.HTTPResponse.Header }) } } // WithLogLevel is a request option that will set the request to use a specific // log level when the request is made. // // svc.PutObjectWithContext(ctx, params, request.WithLogLevel(aws.LogDebugWithHTTPBody) func WithLogLevel(l aws.LogLevelType) Option { return func(r *Request) { r.Config.LogLevel = aws.LogLevel(l) } } // ApplyOptions will apply each option to the request calling them in the order // the were provided. func (r *Request) ApplyOptions(opts ...Option) { for _, opt := range opts { opt(r) } } // Context will always returns a non-nil context. If Request does not have a // context aws.BackgroundContext will be returned. func (r *Request) Context() aws.Context { if r.context != nil { return r.context } return aws.BackgroundContext() } // SetContext adds a Context to the current request that can be used to cancel // a in-flight request. The Context value must not be nil, or this method will // panic. // // Unlike http.Request.WithContext, SetContext does not return a copy of the // Request. It is not safe to use use a single Request value for multiple // requests. A new Request should be created for each API operation request. // // Go 1.6 and below: // The http.Request's Cancel field will be set to the Done() value of // the context. This will overwrite the Cancel field's value. // // Go 1.7 and above: // The http.Request.WithContext will be used to set the context on the underlying // http.Request. This will create a shallow copy of the http.Request. The SDK // may create sub contexts in the future for nested requests such as retries. func (r *Request) SetContext(ctx aws.Context) { if ctx == nil { panic("context cannot be nil") } setRequestContext(r, ctx) } // WillRetry returns if the request's can be retried. func (r *Request) WillRetry() bool { if !aws.IsReaderSeekable(r.Body) && r.HTTPRequest.Body != NoBody { return false } return r.Error != nil && aws.BoolValue(r.Retryable) && r.RetryCount < r.MaxRetries() } func fmtAttemptCount(retryCount, maxRetries int) string { return fmt.Sprintf("attempt %v/%v", retryCount, maxRetries) } // ParamsFilled returns if the request's parameters have been populated // and the parameters are valid. False is returned if no parameters are // provided or invalid. func (r *Request) ParamsFilled() bool { return r.Params != nil && reflect.ValueOf(r.Params).Elem().IsValid() } // DataFilled returns true if the request's data for response deserialization // target has been set and is a valid. False is returned if data is not // set, or is invalid. func (r *Request) DataFilled() bool { return r.Data != nil && reflect.ValueOf(r.Data).Elem().IsValid() } // SetBufferBody will set the request's body bytes that will be sent to // the service API. func (r *Request) SetBufferBody(buf []byte) { r.SetReaderBody(bytes.NewReader(buf)) } // SetStringBody sets the body of the request to be backed by a string. func (r *Request) SetStringBody(s string) { r.SetReaderBody(strings.NewReader(s)) } // SetReaderBody will set the request's body reader. func (r *Request) SetReaderBody(reader io.ReadSeeker) { r.Body = reader if aws.IsReaderSeekable(reader) { var err error // Get the Bodies current offset so retries will start from the same // initial position. r.BodyStart, err = reader.Seek(0, sdkio.SeekCurrent) if err != nil { r.Error = awserr.New(ErrCodeSerialization, "failed to determine start of request body", err) return } } r.ResetBody() } // Presign returns the request's signed URL. Error will be returned // if the signing fails. The expire parameter is only used for presigned Amazon // S3 API requests. All other AWS services will use a fixed expiration // time of 15 minutes. // // It is invalid to create a presigned URL with a expire duration 0 or less. An // error is returned if expire duration is 0 or less. func (r *Request) Presign(expire time.Duration) (string, error) { r = r.copy() // Presign requires all headers be hoisted. There is no way to retrieve // the signed headers not hoisted without this. Making the presigned URL // useless. r.NotHoist = false u, _, err := getPresignedURL(r, expire) return u, err } // PresignRequest behaves just like presign, with the addition of returning a // set of headers that were signed. The expire parameter is only used for // presigned Amazon S3 API requests. All other AWS services will use a fixed // expiration time of 15 minutes. // // It is invalid to create a presigned URL with a expire duration 0 or less. An // error is returned if expire duration is 0 or less. // // Returns the URL string for the API operation with signature in the query string, // and the HTTP headers that were included in the signature. These headers must // be included in any HTTP request made with the presigned URL. // // To prevent hoisting any headers to the query string set NotHoist to true on // this Request value prior to calling PresignRequest. func (r *Request) PresignRequest(expire time.Duration) (string, http.Header, error) { r = r.copy() return getPresignedURL(r, expire) } // IsPresigned returns true if the request represents a presigned API url. func (r *Request) IsPresigned() bool { return r.ExpireTime != 0 } func getPresignedURL(r *Request, expire time.Duration) (string, http.Header, error) { if expire <= 0 { return "", nil, awserr.New( ErrCodeInvalidPresignExpire, "presigned URL requires an expire duration greater than 0", nil, ) } r.ExpireTime = expire if r.Operation.BeforePresignFn != nil { if err := r.Operation.BeforePresignFn(r); err != nil { return "", nil, err } } if err := r.Sign(); err != nil { return "", nil, err } return r.HTTPRequest.URL.String(), r.SignedHeaderVals, nil } const ( notRetrying = "not retrying" ) func debugLogReqError(r *Request, stage, retryStr string, err error) { if !r.Config.LogLevel.Matches(aws.LogDebugWithRequestErrors) { return } r.Config.Logger.Log(fmt.Sprintf("DEBUG: %s %s/%s failed, %s, error %v", stage, r.ClientInfo.ServiceName, r.Operation.Name, retryStr, err)) } // Build will build the request's object so it can be signed and sent // to the service. Build will also validate all the request's parameters. // Any additional build Handlers set on this request will be run // in the order they were set. // // The request will only be built once. Multiple calls to build will have // no effect. // // If any Validate or Build errors occur the build will stop and the error // which occurred will be returned. func (r *Request) Build() error { if !r.built { r.Handlers.Validate.Run(r) if r.Error != nil { debugLogReqError(r, "Validate Request", notRetrying, r.Error) return r.Error } r.Handlers.Build.Run(r) if r.Error != nil { debugLogReqError(r, "Build Request", notRetrying, r.Error) return r.Error } r.built = true } return r.Error } // Sign will sign the request, returning error if errors are encountered. // // Sign will build the request prior to signing. All Sign Handlers will // be executed in the order they were set. func (r *Request) Sign() error { r.Build() if r.Error != nil { debugLogReqError(r, "Build Request", notRetrying, r.Error) return r.Error } r.Handlers.Sign.Run(r) return r.Error } func (r *Request) getNextRequestBody() (body io.ReadCloser, err error) { if r.safeBody != nil { r.safeBody.Close() } r.safeBody, err = newOffsetReader(r.Body, r.BodyStart) if err != nil { return nil, awserr.New(ErrCodeSerialization, "failed to get next request body reader", err) } // Go 1.8 tightened and clarified the rules code needs to use when building // requests with the http package. Go 1.8 removed the automatic detection // of if the Request.Body was empty, or actually had bytes in it. The SDK // always sets the Request.Body even if it is empty and should not actually // be sent. This is incorrect. // // Go 1.8 did add a http.NoBody value that the SDK can use to tell the http // client that the request really should be sent without a body. The // Request.Body cannot be set to nil, which is preferable, because the // field is exported and could introduce nil pointer dereferences for users // of the SDK if they used that field. // // Related golang/go#18257 l, err := aws.SeekerLen(r.Body) if err != nil { return nil, awserr.New(ErrCodeSerialization, "failed to compute request body size", err) } if l == 0 { body = NoBody } else if l > 0 { body = r.safeBody } else { // Hack to prevent sending bodies for methods where the body // should be ignored by the server. Sending bodies on these // methods without an associated ContentLength will cause the // request to socket timeout because the server does not handle // Transfer-Encoding: chunked bodies for these methods. // // This would only happen if a aws.ReaderSeekerCloser was used with // a io.Reader that was not also an io.Seeker, or did not implement // Len() method. switch r.Operation.HTTPMethod { case "GET", "HEAD", "DELETE": body = NoBody default: body = r.safeBody } } return body, nil } // GetBody will return an io.ReadSeeker of the Request's underlying // input body with a concurrency safe wrapper. func (r *Request) GetBody() io.ReadSeeker { return r.safeBody } // Send will send the request, returning error if errors are encountered. // // Send will sign the request prior to sending. All Send Handlers will // be executed in the order they were set. // // Canceling a request is non-deterministic. If a request has been canceled, // then the transport will choose, randomly, one of the state channels during // reads or getting the connection. // // readLoop() and getConn(req *Request, cm connectMethod) // https://github.com/golang/go/blob/master/src/net/http/transport.go // // Send will not close the request.Request's body. func (r *Request) Send() error { defer func() { // Regardless of success or failure of the request trigger the Complete // request handlers. r.Handlers.Complete.Run(r) }() if err := r.Error; err != nil { return err } for { r.Error = nil r.AttemptTime = time.Now() if err := r.Sign(); err != nil { debugLogReqError(r, "Sign Request", notRetrying, err) return err } if err := r.sendRequest(); err == nil { return nil } r.Handlers.Retry.Run(r) r.Handlers.AfterRetry.Run(r) if r.Error != nil || !aws.BoolValue(r.Retryable) { return r.Error } if err := r.prepareRetry(); err != nil { r.Error = err return err } } } func (r *Request) prepareRetry() error { if r.Config.LogLevel.Matches(aws.LogDebugWithRequestRetries) { r.Config.Logger.Log(fmt.Sprintf("DEBUG: Retrying Request %s/%s, attempt %d", r.ClientInfo.ServiceName, r.Operation.Name, r.RetryCount)) } // The previous http.Request will have a reference to the r.Body // and the HTTP Client's Transport may still be reading from // the request's body even though the Client's Do returned. r.HTTPRequest = copyHTTPRequest(r.HTTPRequest, nil) r.ResetBody() if err := r.Error; err != nil { return awserr.New(ErrCodeSerialization, "failed to prepare body for retry", err) } // Closing response body to ensure that no response body is leaked // between retry attempts. if r.HTTPResponse != nil && r.HTTPResponse.Body != nil { r.HTTPResponse.Body.Close() } return nil } func (r *Request) sendRequest() (sendErr error) { defer r.Handlers.CompleteAttempt.Run(r) r.Retryable = nil r.Handlers.Send.Run(r) if r.Error != nil { debugLogReqError(r, "Send Request", fmtAttemptCount(r.RetryCount, r.MaxRetries()), r.Error) return r.Error } r.Handlers.UnmarshalMeta.Run(r) r.Handlers.ValidateResponse.Run(r) if r.Error != nil { r.Handlers.UnmarshalError.Run(r) debugLogReqError(r, "Validate Response", fmtAttemptCount(r.RetryCount, r.MaxRetries()), r.Error) return r.Error } r.Handlers.Unmarshal.Run(r) if r.Error != nil { debugLogReqError(r, "Unmarshal Response", fmtAttemptCount(r.RetryCount, r.MaxRetries()), r.Error) return r.Error } return nil } // copy will copy a request which will allow for local manipulation of the // request. func (r *Request) copy() *Request { req := &Request{} *req = *r req.Handlers = r.Handlers.Copy() op := *r.Operation req.Operation = &op return req } // AddToUserAgent adds the string to the end of the request's current user agent. func AddToUserAgent(r *Request, s string) { curUA := r.HTTPRequest.Header.Get("User-Agent") if len(curUA) > 0 { s = curUA + " " + s } r.HTTPRequest.Header.Set("User-Agent", s) } // SanitizeHostForHeader removes default port from host and updates request.Host func SanitizeHostForHeader(r *http.Request) { host := getHost(r) port := portOnly(host) if port != "" && isDefaultPort(r.URL.Scheme, port) { r.Host = stripPort(host) } } // Returns host from request func getHost(r *http.Request) string { if r.Host != "" { return r.Host } return r.URL.Host } // Hostname returns u.Host, without any port number. // // If Host is an IPv6 literal with a port number, Hostname returns the // IPv6 literal without the square brackets. IPv6 literals may include // a zone identifier. // // Copied from the Go 1.8 standard library (net/url) func stripPort(hostport string) string { colon := strings.IndexByte(hostport, ':') if colon == -1 { return hostport } if i := strings.IndexByte(hostport, ']'); i != -1 { return strings.TrimPrefix(hostport[:i], "[") } return hostport[:colon] } // Port returns the port part of u.Host, without the leading colon. // If u.Host doesn't contain a port, Port returns an empty string. // // Copied from the Go 1.8 standard library (net/url) func portOnly(hostport string) string { colon := strings.IndexByte(hostport, ':') if colon == -1 { return "" } if i := strings.Index(hostport, "]:"); i != -1 { return hostport[i+len("]:"):] } if strings.Contains(hostport, "]") { return "" } return hostport[colon+len(":"):] } // Returns true if the specified URI is using the standard port // (i.e. port 80 for HTTP URIs or 443 for HTTPS URIs) func isDefaultPort(scheme, port string) bool { if port == "" { return true } lowerCaseScheme := strings.ToLower(scheme) if (lowerCaseScheme == "http" && port == "80") || (lowerCaseScheme == "https" && port == "443") { return true } return false }
{ "pile_set_name": "Github" }
Bridge.merge(new System.Globalization.CultureInfo("es-PR", true), { englishName: "Spanish (Puerto Rico)", nativeName: "español (Puerto Rico)", numberFormat: Bridge.merge(new System.Globalization.NumberFormatInfo(), { nanSymbol: "NaN", negativeSign: "-", positiveSign: "+", negativeInfinitySymbol: "-∞", positiveInfinitySymbol: "∞", percentSymbol: "%", percentGroupSizes: [3], percentDecimalDigits: 2, percentDecimalSeparator: ".", percentGroupSeparator: ",", percentPositivePattern: 0, percentNegativePattern: 0, currencySymbol: "$", currencyGroupSizes: [3], currencyDecimalDigits: 2, currencyDecimalSeparator: ".", currencyGroupSeparator: ",", currencyNegativePattern: 1, currencyPositivePattern: 0, numberGroupSizes: [3], numberDecimalDigits: 2, numberDecimalSeparator: ".", numberGroupSeparator: ",", numberNegativePattern: 1 }), dateTimeFormat: Bridge.merge(new System.Globalization.DateTimeFormatInfo(), { abbreviatedDayNames: ["dom.","lun.","mar.","mié.","jue.","vie.","sáb."], abbreviatedMonthGenitiveNames: ["ene.","feb.","mar.","abr.","may.","jun.","jul.","ago.","sep.","oct.","nov.","dic.",""], abbreviatedMonthNames: ["ene.","feb.","mar.","abr.","may.","jun.","jul.","ago.","sep.","oct.","nov.","dic.",""], amDesignator: "a. m.", dateSeparator: "/", dayNames: ["domingo","lunes","martes","miércoles","jueves","viernes","sábado"], firstDayOfWeek: 0, fullDateTimePattern: "dddd, d 'de' MMMM 'de' yyyy h:mm:ss tt", longDatePattern: "dddd, d 'de' MMMM 'de' yyyy", longTimePattern: "h:mm:ss tt", monthDayPattern: "d 'de' MMMM", monthGenitiveNames: ["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre",""], monthNames: ["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre",""], pmDesignator: "p. m.", rfc1123: "ddd, dd MMM yyyy HH':'mm':'ss 'GMT'", shortDatePattern: "MM/dd/yyyy", shortestDayNames: ["DO","LU","MA","MI","JU","VI","SA"], shortTimePattern: "h:mm tt", sortableDateTimePattern: "yyyy'-'MM'-'dd'T'HH':'mm':'ss", sortableDateTimePattern1: "yyyy'-'MM'-'dd", timeSeparator: ":", universalSortableDateTimePattern: "yyyy'-'MM'-'dd HH':'mm':'ss'Z'", yearMonthPattern: "MMMM 'de' yyyy", roundtripFormat: "yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffzzz" }), TextInfo: Bridge.merge(new System.Globalization.TextInfo(), { ANSICodePage: 1252, CultureName: "es-PR", EBCDICCodePage: 20284, IsRightToLeft: false, LCID: 20490, listSeparator: ";", MacCodePage: 10000, OEMCodePage: 850, IsReadOnly: true }) });
{ "pile_set_name": "Github" }
[link](https://github.com/nicolargo/glances)
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>FILEHEADER</key> <string> // ___FILENAME___ // ProtonVPN - Created on ___DATE___. // // Copyright (c) 2019 Proton Technologies AG // // This file is part of ProtonVPN. // // ProtonVPN 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. // // ProtonVPN 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 ProtonVPN. If not, see &lt;https://www.gnu.org/licenses/&gt;. //</string> </dict> </plist>
{ "pile_set_name": "Github" }
;;; flycheck-buttercup.el --- Flycheck: Extensions to Buttercup -*- lexical-binding: t; -*- ;; Copyright (C) 2017 Flycheck contributors ;; Copyright (C) 2016 Sebastian Wiesner and Flycheck contributors ;; Author: Sebastian Wiesner <[email protected]> ;; Maintainer: Clément Pit-Claudel <[email protected]> ;; fmdkdd <[email protected]> ;; Keywords: lisp, tools ;; This file is not part of GNU Emacs. ;; 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/>. ;;; Commentary: ;; Extensions to Buttercup to write BDD tests for Flycheck. ;; ;; Buttercup is a BDD testing framework for Emacs, see URL ;; `https://github.com/jorgenschaefer/emacs-buttercup/'. Flycheck uses ;; Buttercup extensively for new tests. ;; ;; This library provides extensions to Buttercup to write Specs for Flycheck. ;; ;; * Custom matchers ;; ;; (expect 'foo :to-be-local) - Is `foo' a local variable in the current buffer? ;;; Code: (require 'buttercup) (require 'flycheck) (require 'seq) ;;; Buttercup helpers (defun flycheck-buttercup-format-error-list (errors) "Format ERRORS into a human-readable string." (mapconcat (lambda (e) (flycheck-error-format e 'with-file-name)) errors "\n")) ;;; Data matchers (buttercup-define-matcher :to-be-empty-string (s) (let ((s (funcall s))) (if (equal s "") (cons t (format "Expected %S not be an empty string" s)) (cons nil (format "Expected %S to be an empty string" s))))) (buttercup-define-matcher :to-match-with-group (re s index match) (let* ((re (funcall re)) (s (funcall s)) (index (funcall index)) (match (funcall match)) (matches? (string-match re s)) (result (and matches? (match-string index s)))) (if (and matches? (equal result match)) (cons t (format "Expected %S not to match %S with %S in group %s" re s match index)) (cons nil (format "Expected %S to match %S with %S in group %s, %s" re s match index (if matches? (format "but got %S" result) "but did not match")))))) ;;; Emacs feature matchers (buttercup-define-matcher :to-be-live (buffer) (let ((buffer (get-buffer (funcall buffer)))) (if (buffer-live-p buffer) (cons t (format "Expected %S not to be a live buffer, but it is" buffer)) (cons nil (format "Expected %S to be a live buffer, but it is not" buffer))))) (buttercup-define-matcher :to-be-visible (buffer) (let ((buffer (get-buffer (funcall buffer)))) (cond ((and buffer (get-buffer-window buffer)) (cons t (format "Expected %S not to be a visible buffer, but it is" buffer))) ((not (bufferp buffer)) (cons nil (format "Expected %S to be a visible buffer, but it is not a buffer" buffer))) (t (cons nil (format "Expected %S to be a visible buffer, but it is not visible" buffer)))))) (buttercup-define-matcher :to-be-local (symbol) (let ((symbol (funcall symbol))) (if (local-variable-p symbol) (cons t (format "Expected %S not to be a local variable, but it is" symbol)) (cons nil (format "Expected %S to be a local variable, but it is not" symbol))))) (buttercup-define-matcher :to-contain-match (buffer re) (let ((buffer (funcall buffer)) (re (funcall re))) (if (not (get-buffer buffer)) (cons nil (format "Expected %S to contain a match of %s, \ but is not a buffer" buffer re)) (with-current-buffer buffer (save-excursion (goto-char (point-min)) (if (re-search-forward re nil 'noerror) (cons t (format "Expected %S to contain a match \ for %s, but it did not" buffer re)) (cons nil (format "Expected %S not to contain a match for \ %s but it did not." buffer re)))))))) ;;; Flycheck matchers (buttercup-define-matcher :to-be-equal-flycheck-errors (a b) (let* ((a (funcall a)) (b (funcall b)) (a-formatted (flycheck-buttercup-format-error-list a)) (b-formatted (flycheck-buttercup-format-error-list b))) (if (equal a b) (cons t (format "Expected %s not to be equal to %s" a-formatted b-formatted)) (cons nil (format "Expected %s to be equal to %s" a-formatted b-formatted))))) (provide 'flycheck-buttercup) ;; Disable byte compilation for this library, to prevent package.el choking on a ;; missing `buttercup' library. See ;; https://github.com/flycheck/flycheck/issues/860 ;; Local Variables: ;; no-byte-compile: t ;; End: ;;; flycheck-buttercup.el ends here
{ "pile_set_name": "Github" }
/*============================================================================= Copyright (c) 2001-2011 Joel de Guzman 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) ==============================================================================*/ #if !defined(BOOST_SPIRIT_LAZY_MARCH_27_2007_1002AM) #define BOOST_SPIRIT_LAZY_MARCH_27_2007_1002AM #if defined(_MSC_VER) #pragma once #endif #include <boost/spirit/home/qi/domain.hpp> #include <boost/spirit/home/qi/skip_over.hpp> #include <boost/spirit/home/qi/meta_compiler.hpp> #include <boost/spirit/home/qi/detail/attributes.hpp> #include <boost/spirit/home/support/unused.hpp> #include <boost/spirit/home/support/info.hpp> #include <boost/spirit/home/support/lazy.hpp> #include <boost/spirit/include/phoenix_core.hpp> #include <boost/fusion/include/at.hpp> #include <boost/utility/result_of.hpp> #include <boost/type_traits/remove_reference.hpp> #include <boost/mpl/not.hpp> namespace boost { namespace spirit { /////////////////////////////////////////////////////////////////////////// // Enablers /////////////////////////////////////////////////////////////////////////// template <typename Eval> struct use_terminal<qi::domain, phoenix::actor<Eval> > // enables phoenix actors : mpl::true_ {}; // forward declaration template <typename Terminal, typename Actor, int Arity> struct lazy_terminal; }} namespace boost { namespace spirit { namespace qi { using spirit::lazy; typedef modify<qi::domain> qi_modify; namespace detail { template <typename Parser, typename Iterator, typename Context , typename Skipper, typename Attribute> bool lazy_parse_impl(Parser const& p , Iterator& first, Iterator const& last , Context& context, Skipper const& skipper , Attribute& attr, mpl::false_) { return p.parse(first, last, context, skipper, attr); } template <typename Parser, typename Iterator, typename Context , typename Skipper, typename Attribute> bool lazy_parse_impl(Parser const& p , Iterator& first, Iterator const& last , Context& context, Skipper const& skipper , Attribute& /*attr*/, mpl::true_) { // If DeducedAuto is false (semantic actions is present), the // component's attribute is unused. return p.parse(first, last, context, skipper, unused); } template <typename Parser, typename Iterator, typename Context , typename Skipper, typename Attribute> bool lazy_parse_impl_main(Parser const& p , Iterator& first, Iterator const& last , Context& context, Skipper const& skipper , Attribute& attr) { // If DeducedAuto is true (no semantic action), we pass the parser's // attribute on to the component. typedef typename traits::has_semantic_action<Parser>::type auto_rule; return lazy_parse_impl(p, first, last, context, skipper, attr, auto_rule()); } } template <typename Function, typename Modifiers> struct lazy_parser : parser<lazy_parser<Function, Modifiers> > { template <typename Context, typename Iterator> struct attribute { typedef typename boost::result_of<qi_modify(tag::lazy_eval, Modifiers)>::type modifier; typedef typename remove_reference< typename boost::result_of<Function(unused_type, Context)>::type >::type expr_type; // If you got an error_invalid_expression error message here, // then the expression (expr_type) is not a valid spirit qi // expression. BOOST_SPIRIT_ASSERT_MATCH(qi::domain, expr_type); typedef typename result_of::compile<qi::domain, expr_type, modifier>::type parser_type; typedef typename traits::attribute_of<parser_type, Context, Iterator>::type type; }; lazy_parser(Function const& function_, Modifiers const& modifiers_) : function(function_), modifiers(modifiers_) {} template <typename Iterator, typename Context , typename Skipper, typename Attribute> bool parse(Iterator& first, Iterator const& last , Context& context, Skipper const& skipper , Attribute& attr) const { return detail::lazy_parse_impl_main( compile<qi::domain>(function(unused, context) , qi_modify()(tag::lazy_eval(), modifiers)) , first, last, context, skipper, attr); } template <typename Context> info what(Context& context) const { return info("lazy" , compile<qi::domain>(function(unused, context) , qi_modify()(tag::lazy_eval(), modifiers)) .what(context) ); } Function function; Modifiers modifiers; }; template <typename Function, typename Subject, typename Modifiers> struct lazy_directive : unary_parser<lazy_directive<Function, Subject, Modifiers> > { typedef Subject subject_type; template <typename Context, typename Iterator> struct attribute { typedef typename boost::result_of<qi_modify(tag::lazy_eval, Modifiers)>::type modifier; typedef typename remove_reference< typename boost::result_of<Function(unused_type, Context)>::type >::type directive_expr_type; typedef typename proto::result_of::make_expr< proto::tag::subscript , directive_expr_type , Subject >::type expr_type; // If you got an error_invalid_expression error message here, // then the expression (expr_type) is not a valid spirit qi // expression. BOOST_SPIRIT_ASSERT_MATCH(qi::domain, expr_type); typedef typename result_of::compile<qi::domain, expr_type, modifier>::type parser_type; typedef typename traits::attribute_of<parser_type, Context, Iterator>::type type; }; lazy_directive( Function const& function_ , Subject const& subject_ , Modifiers const& modifiers_) : function(function_), subject(subject_), modifiers(modifiers_) {} template <typename Iterator, typename Context , typename Skipper, typename Attribute> bool parse(Iterator& first, Iterator const& last , Context& context, Skipper const& skipper , Attribute& attr) const { return detail::lazy_parse_impl_main(compile<qi::domain>( proto::make_expr<proto::tag::subscript>( function(unused, context) , subject) , qi_modify()(tag::lazy_eval(), modifiers)) , first, last, context, skipper, attr); } template <typename Context> info what(Context& context) const { return info("lazy-directive" , compile<qi::domain>( proto::make_expr<proto::tag::subscript>( function(unused, context) , subject ), qi_modify()(tag::lazy_eval(), modifiers)) .what(context) ); } Function function; Subject subject; Modifiers modifiers; }; /////////////////////////////////////////////////////////////////////////// // Parser generators: make_xxx function (objects) /////////////////////////////////////////////////////////////////////////// template <typename Eval, typename Modifiers> struct make_primitive<phoenix::actor<Eval>, Modifiers> { typedef lazy_parser<phoenix::actor<Eval>, Modifiers> result_type; result_type operator()(phoenix::actor<Eval> const& f , Modifiers const& modifiers) const { return result_type(f, modifiers); } }; template <typename Terminal, typename Actor, int Arity, typename Modifiers> struct make_primitive<lazy_terminal<Terminal, Actor, Arity>, Modifiers> { typedef lazy_parser<Actor, Modifiers> result_type; result_type operator()( lazy_terminal<Terminal, Actor, Arity> const& lt , Modifiers const& modifiers) const { return result_type(lt.actor, modifiers); } }; template <typename Terminal, typename Actor, int Arity, typename Subject, typename Modifiers> struct make_directive<lazy_terminal<Terminal, Actor, Arity>, Subject, Modifiers> { typedef lazy_directive<Actor, Subject, Modifiers> result_type; result_type operator()( lazy_terminal<Terminal, Actor, Arity> const& lt , Subject const& subject, Modifiers const& modifiers) const { return result_type(lt.actor, subject, modifiers); } }; }}} namespace boost { namespace spirit { namespace traits { /////////////////////////////////////////////////////////////////////////// template <typename Actor, typename Modifiers, typename Attribute , typename Context, typename Iterator> struct handles_container< qi::lazy_parser<Actor, Modifiers>, Attribute, Context, Iterator> : handles_container< typename qi::lazy_parser<Actor, Modifiers>::template attribute<Context, Iterator>::parser_type , Attribute, Context, Iterator> {}; template <typename Subject, typename Actor, typename Modifiers , typename Attribute, typename Context, typename Iterator> struct handles_container< qi::lazy_directive<Actor, Subject, Modifiers>, Attribute , Context, Iterator> : handles_container< typename qi::lazy_directive<Actor, Subject, Modifiers>::template attribute<Context, Iterator>::parser_type , Attribute, Context, Iterator> {}; }}} #endif
{ "pile_set_name": "Github" }
<annotation> <folder>CameraPhotos</folder> <filename>2017-12-15 14:14:23.371901.jpg</filename> <path>/Volumes/Untitled/CameraPhotos/2017-12-15 14:14:23.371901.jpg</path> <source> <database>Unknown</database> </source> <size> <width>352</width> <height>240</height> <depth>3</depth> </size> <segmented>0</segmented> <object> <name>car</name> <pose>Unspecified</pose> <truncated>0</truncated> <difficult>0</difficult> <bndbox> <xmin>171</xmin> <ymin>177</ymin> <xmax>217</xmax> <ymax>225</ymax> </bndbox> </object> <object> <name>truck</name> <pose>Unspecified</pose> <truncated>0</truncated> <difficult>0</difficult> <bndbox> <xmin>133</xmin> <ymin>156</ymin> <xmax>171</xmax> <ymax>202</ymax> </bndbox> </object> <object> <name>bus</name> <pose>Unspecified</pose> <truncated>1</truncated> <difficult>0</difficult> <bndbox> <xmin>1</xmin> <ymin>176</ymin> <xmax>90</xmax> <ymax>240</ymax> </bndbox> </object> <object> <name>car</name> <pose>Unspecified</pose> <truncated>0</truncated> <difficult>0</difficult> <bndbox> <xmin>94</xmin> <ymin>163</ymin> <xmax>120</xmax> <ymax>187</ymax> </bndbox> </object> <object> <name>car</name> <pose>Unspecified</pose> <truncated>0</truncated> <difficult>0</difficult> <bndbox> <xmin>110</xmin> <ymin>145</ymin> <xmax>130</xmax> <ymax>165</ymax> </bndbox> </object> <object> <name>car</name> <pose>Unspecified</pose> <truncated>0</truncated> <difficult>0</difficult> <bndbox> <xmin>152</xmin> <ymin>150</ymin> <xmax>174</xmax> <ymax>163</ymax> </bndbox> </object> <object> <name>car</name> <pose>Unspecified</pose> <truncated>0</truncated> <difficult>0</difficult> <bndbox> <xmin>203</xmin> <ymin>155</ymin> <xmax>230</xmax> <ymax>173</ymax> </bndbox> </object> </annotation>
{ "pile_set_name": "Github" }
/* Copyright (c) 2011, Philipp Krähenbühl All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * 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. * Neither the name of the Stanford 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 Philipp Krähenbühl ''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 Philipp Krähenbühl 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. */ #include <cstdio> #include <cmath> #include "../libDenseCRF/densecrf.h" #include "../libDenseCRF/util.h" // Store the colors we read, so that we can write them again. int nColors = 0; int colors[255]; unsigned int getColor( const unsigned char * c ){ return c[0] + 256*c[1] + 256*256*c[2]; } void putColor( unsigned char * c, unsigned int cc ){ c[0] = cc&0xff; c[1] = (cc>>8)&0xff; c[2] = (cc>>16)&0xff; } // Produce a color image from a bunch of labels unsigned char * colorize( const short * map, int W, int H ){ unsigned char * r = new unsigned char[ W*H*3 ]; for( int k=0; k<W*H; k++ ){ int c = colors[ map[k] ]; putColor( r+3*k, c ); } return r; } // Certainty that the groundtruth is correct const float GT_PROB = 0.5; // Simple classifier that is 50% certain that the annotation is correct float * classify( const unsigned char * im, int W, int H, int M ){ const float u_energy = -log( 1.0f / M ); const float n_energy = -log( (1.0f - GT_PROB) / (M-1) ); const float p_energy = -log( GT_PROB ); float * res = new float[W*H*M]; for( int k=0; k<W*H; k++ ){ // Map the color to a label int c = getColor( im + 3*k ); int i; for( i=0;i<nColors && c!=colors[i]; i++ ); if (c && i==nColors){ if (i<M) colors[nColors++] = c; else c=0; } // Set the energy float * r = res + k*M; if (c){ for( int j=0; j<M; j++ ) r[j] = n_energy; r[i] = p_energy; } else{ for( int j=0; j<M; j++ ) r[j] = u_energy; } } return res; } int main( int argc, char* argv[]){ if (argc<4){ printf("Usage: %s image annotations output\n", argv[0] ); return 1; } // Number of labels const int M = 21; // Load the color image and some crude annotations (which are used in a simple classifier) int W, H, GW, GH; unsigned char * im = readPPM( argv[1], W, H ); if (!im){ printf("Failed to load image!\n"); return 1; } unsigned char * anno = readPPM( argv[2], GW, GH ); if (!anno){ printf("Failed to load annotations!\n"); return 1; } if (W!=GW || H!=GH){ printf("Annotation size doesn't match image!\n"); return 1; } /////////// Put your own unary classifier here! /////////// float * unary = classify( anno, W, H, M ); /////////////////////////////////////////////////////////// // Setup the CRF model DenseCRF2D crf(W, H, M); // Specify the unary potential as an array of size W*H*(#classes) // packing order: x0y0l0 x0y0l1 x0y0l2 .. x1y0l0 x1y0l1 ... (row-order) crf.setUnaryEnergy( unary ); // add a color independent term (feature = pixel location 0..W-1, 0..H-1) // x_stddev = 3 // y_stddev = 3 // weight = 3 crf.addPairwiseGaussian( 3, 3, 3 ); // add a color dependent term (feature = xyrgb) // x_stddev = 60 // y_stddev = 60 // r_stddev = g_stddev = b_stddev = 20 // weight = 10 crf.addPairwiseBilateral( 60, 60, 20, 20, 20, im, 10 ); // Do map inference short * map = new short[W*H]; crf.map(10, map); // Store the result unsigned char *res = colorize( map, W, H ); writePPM( argv[3], W, H, res ); delete[] im; delete[] anno; delete[] res; delete[] map; delete[] unary; }
{ "pile_set_name": "Github" }
export const types = { SET_REGISTRATION_TOKEN: 'SET_REGISTRATION_TOKEN', } export const setRegistrationToken = token => ({ type: types.SET_REGISTRATION_TOKEN, token, })
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="UTF-8"?> <project version="4"> <component name="ProjectModuleManager"> <modules> <module fileurl="file://$PROJECT_DIR$/.idea/cfn-certificate-provider.iml" filepath="$PROJECT_DIR$/.idea/cfn-certificate-provider.iml" /> </modules> </component> </project>
{ "pile_set_name": "Github" }
// // GoogleMobileAds.h // Google Mobile Ads SDK // // Copyright 2014 Google Inc. All rights reserved. #import <Foundation/Foundation.h> #import <UIKit/UIKit.h> #if __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_6_0 #error The Google Mobile Ads SDK requires a deployment target of iOS 6.0 or later. #endif #if defined(__ARM_ARCH_7S__) && __ARM_ARCH_7S__ #error The Google Mobile Ads SDK doesn't support linking with armv7s. Remove armv7s from "ARCHS" (Architectures) in your Build Settings. #endif /// Project version string for GoogleMobileAds. FOUNDATION_EXPORT const unsigned char GoogleMobileAdsVersionString[]; // Header files. #import <GoogleMobileAds/GoogleMobileAdsDefines.h> #import <GoogleMobileAds/GADAdNetworkExtras.h> #import <GoogleMobileAds/GADAdSize.h> #import <GoogleMobileAds/GADAudioVideoManagerDelegate.h> #import <GoogleMobileAds/GADAudioVideoManager.h> #import <GoogleMobileAds/GADBannerView.h> #import <GoogleMobileAds/GADBannerViewDelegate.h> #import <GoogleMobileAds/GADCorrelator.h> #import <GoogleMobileAds/GADCorrelatorAdLoaderOptions.h> #import <GoogleMobileAds/GADDebugOptionsViewController.h> #import <GoogleMobileAds/GADExtras.h> #import <GoogleMobileAds/GADInAppPurchase.h> #import <GoogleMobileAds/GADInAppPurchaseDelegate.h> #import <GoogleMobileAds/GADInterstitial.h> #import <GoogleMobileAds/GADInterstitialDelegate.h> #import <GoogleMobileAds/GADMediaView.h> #import <GoogleMobileAds/GADMobileAds.h> #import <GoogleMobileAds/GADNativeExpressAdView.h> #import <GoogleMobileAds/GADNativeExpressAdViewDelegate.h> #import <GoogleMobileAds/GADRequest.h> #import <GoogleMobileAds/GADRequestError.h> #import <GoogleMobileAds/GADVideoController.h> #import <GoogleMobileAds/GADVideoControllerDelegate.h> #import <GoogleMobileAds/GADVideoOptions.h> #import <GoogleMobileAds/DFPBannerView.h> #import <GoogleMobileAds/DFPBannerViewOptions.h> #import <GoogleMobileAds/DFPCustomRenderedAd.h> #import <GoogleMobileAds/DFPCustomRenderedBannerViewDelegate.h> #import <GoogleMobileAds/DFPCustomRenderedInterstitialDelegate.h> #import <GoogleMobileAds/DFPInterstitial.h> #import <GoogleMobileAds/DFPRequest.h> #import <GoogleMobileAds/GADAdSizeDelegate.h> #import <GoogleMobileAds/GADAppEventDelegate.h> #import <GoogleMobileAds/GADAdLoader.h> #import <GoogleMobileAds/GADAdLoaderAdTypes.h> #import <GoogleMobileAds/GADAdLoaderDelegate.h> #import <GoogleMobileAds/GADAdChoicesView.h> #import <GoogleMobileAds/GADNativeAd.h> #import <GoogleMobileAds/GADNativeAdDelegate.h> #import <GoogleMobileAds/GADNativeAdImage.h> #import <GoogleMobileAds/GADNativeAdImage+Mediation.h> #import <GoogleMobileAds/GADNativeAppInstallAd.h> #import <GoogleMobileAds/GADNativeAppInstallAdAssetIDs.h> #import <GoogleMobileAds/GADNativeContentAd.h> #import <GoogleMobileAds/GADNativeContentAdAssetIDs.h> #import <GoogleMobileAds/GADNativeCustomTemplateAd.h> #import <GoogleMobileAds/GADMultipleAdsAdLoaderOptions.h> #import <GoogleMobileAds/GADNativeAdImageAdLoaderOptions.h> #import <GoogleMobileAds/GADNativeAdViewAdOptions.h> #import <GoogleMobileAds/GADCustomEventBanner.h> #import <GoogleMobileAds/GADCustomEventBannerDelegate.h> #import <GoogleMobileAds/GADCustomEventExtras.h> #import <GoogleMobileAds/GADCustomEventInterstitial.h> #import <GoogleMobileAds/GADCustomEventInterstitialDelegate.h> #import <GoogleMobileAds/GADCustomEventNativeAd.h> #import <GoogleMobileAds/GADCustomEventNativeAdDelegate.h> #import <GoogleMobileAds/GADCustomEventParameters.h> #import <GoogleMobileAds/GADCustomEventRequest.h> #import <GoogleMobileAds/GADDynamicHeightSearchRequest.h> #import <GoogleMobileAds/GADSearchBannerView.h> #import <GoogleMobileAds/GADSearchRequest.h> #import <GoogleMobileAds/GADAdReward.h> #import <GoogleMobileAds/GADRewardBasedVideoAd.h> #import <GoogleMobileAds/GADRewardBasedVideoAdDelegate.h> #import <GoogleMobileAds/Mediation/GADMAdNetworkAdapterProtocol.h> #import <GoogleMobileAds/Mediation/GADMAdNetworkConnectorProtocol.h> #import <GoogleMobileAds/Mediation/GADMediatedNativeAd.h> #import <GoogleMobileAds/Mediation/GADMediatedNativeAdDelegate.h> #import <GoogleMobileAds/Mediation/GADMediatedNativeAdNotificationSource.h> #import <GoogleMobileAds/Mediation/GADMediatedNativeAppInstallAd.h> #import <GoogleMobileAds/Mediation/GADMediatedNativeContentAd.h> #import <GoogleMobileAds/Mediation/GADMediationAdRequest.h> #import <GoogleMobileAds/Mediation/GADMEnums.h> #import <GoogleMobileAds/Mediation/GADMRewardBasedVideoAdNetworkAdapterProtocol.h> #import <GoogleMobileAds/Mediation/GADMRewardBasedVideoAdNetworkConnectorProtocol.h>
{ "pile_set_name": "Github" }
/** ****************************************************************************** * @file stm32f4xx_hal.c * @author MCD Application Team * @version V1.7.0 * @date 17-February-2017 * @brief HAL module driver. * This is the common part of the HAL initialization * @verbatim ============================================================================== ##### How to use this driver ##### ============================================================================== [..] The common HAL driver contains a set of generic and common APIs that can be used by the PPP peripheral drivers and the user to start using the HAL. [..] The HAL contains two APIs' categories: (+) Common HAL APIs (+) Services HAL APIs @endverbatim ****************************************************************************** * @attention * * <h2><center>&copy; COPYRIGHT(c) 2017 STMicroelectronics</center></h2> * * 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. Neither the name of STMicroelectronics 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 COPYRIGHT HOLDERS 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 COPYRIGHT HOLDER 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. * ****************************************************************************** */ /* Includes ------------------------------------------------------------------*/ #include "stm32f4xx_hal.h" /** @addtogroup STM32F4xx_HAL_Driver * @{ */ /** @defgroup HAL HAL * @brief HAL module driver. * @{ */ /* Private typedef -----------------------------------------------------------*/ /* Private define ------------------------------------------------------------*/ /** @addtogroup HAL_Private_Constants * @{ */ /** * @brief STM32F4xx HAL Driver version number V1.5.0 */ #define __STM32F4xx_HAL_VERSION_MAIN (0x01U) /*!< [31:24] main version */ #define __STM32F4xx_HAL_VERSION_SUB1 (0x05U) /*!< [23:16] sub1 version */ #define __STM32F4xx_HAL_VERSION_SUB2 (0x00U) /*!< [15:8] sub2 version */ #define __STM32F4xx_HAL_VERSION_RC (0x00U) /*!< [7:0] release candidate */ #define __STM32F4xx_HAL_VERSION ((__STM32F4xx_HAL_VERSION_MAIN << 24U)\ |(__STM32F4xx_HAL_VERSION_SUB1 << 16U)\ |(__STM32F4xx_HAL_VERSION_SUB2 << 8U )\ |(__STM32F4xx_HAL_VERSION_RC)) #define IDCODE_DEVID_MASK 0x00000FFFU /* ------------ RCC registers bit address in the alias region ----------- */ #define SYSCFG_OFFSET (SYSCFG_BASE - PERIPH_BASE) /* --- MEMRMP Register ---*/ /* Alias word address of UFB_MODE bit */ #define MEMRMP_OFFSET SYSCFG_OFFSET #define UFB_MODE_BIT_NUMBER POSITION_VAL(SYSCFG_MEMRMP_UFB_MODE) #define UFB_MODE_BB (uint32_t)(PERIPH_BB_BASE + (MEMRMP_OFFSET * 32U) + (UFB_MODE_BIT_NUMBER * 4U)) /* --- CMPCR Register ---*/ /* Alias word address of CMP_PD bit */ #define CMPCR_OFFSET (SYSCFG_OFFSET + 0x20U) #define CMP_PD_BIT_NUMBER POSITION_VAL(SYSCFG_CMPCR_CMP_PD) #define CMPCR_CMP_PD_BB (uint32_t)(PERIPH_BB_BASE + (CMPCR_OFFSET * 32U) + (CMP_PD_BIT_NUMBER * 4U)) /* --- MCHDLYCR Register ---*/ /* Alias word address of BSCKSEL bit */ #define MCHDLYCR_OFFSET (SYSCFG_OFFSET + 0x30U) #define BSCKSEL_BIT_NUMBER POSITION_VAL(SYSCFG_MCHDLYCR_BSCKSEL) #define MCHDLYCR_BSCKSEL_BB (uint32_t)(PERIPH_BB_BASE + (MCHDLYCR_OFFSET * 32U) + (BSCKSEL_BIT_NUMBER * 4U)) /** * @} */ /* Private macro -------------------------------------------------------------*/ /* Private variables ---------------------------------------------------------*/ /** @addtogroup HAL_Private_Variables * @{ */ __IO uint32_t uwTick; /** * @} */ /* Private function prototypes -----------------------------------------------*/ /* Private functions ---------------------------------------------------------*/ /** @defgroup HAL_Exported_Functions HAL Exported Functions * @{ */ /** @defgroup HAL_Exported_Functions_Group1 Initialization and de-initialization Functions * @brief Initialization and de-initialization functions * @verbatim =============================================================================== ##### Initialization and de-initialization functions ##### =============================================================================== [..] This section provides functions allowing to: (+) Initializes the Flash interface the NVIC allocation and initial clock configuration. It initializes the systick also when timeout is needed and the backup domain when enabled. (+) de-Initializes common part of the HAL (+) Configure The time base source to have 1ms time base with a dedicated Tick interrupt priority. (++) Systick timer is used by default as source of time base, but user can eventually implement his proper time base source (a general purpose timer for example or other time source), keeping in mind that Time base duration should be kept 1ms since PPP_TIMEOUT_VALUEs are defined and handled in milliseconds basis. (++) Time base configuration function (HAL_InitTick ()) is called automatically at the beginning of the program after reset by HAL_Init() or at any time when clock is configured, by HAL_RCC_ClockConfig(). (++) Source of time base is configured to generate interrupts at regular time intervals. Care must be taken if HAL_Delay() is called from a peripheral ISR process, the Tick interrupt line must have higher priority (numerically lower) than the peripheral interrupt. Otherwise the caller ISR process will be blocked. (++) functions affecting time base configurations are declared as __weak to make override possible in case of other implementations in user file. @endverbatim * @{ */ /** * @brief This function is used to initialize the HAL Library; it must be the first * instruction to be executed in the main program (before to call any other * HAL function), it performs the following: * Configure the Flash prefetch, instruction and Data caches. * Configures the SysTick to generate an interrupt each 1 millisecond, * which is clocked by the HSI (at this stage, the clock is not yet * configured and thus the system is running from the internal HSI at 16 MHz). * Set NVIC Group Priority to 4. * Calls the HAL_MspInit() callback function defined in user file * "stm32f4xx_hal_msp.c" to do the global low level hardware initialization * * @note SysTick is used as time base for the HAL_Delay() function, the application * need to ensure that the SysTick time base is always set to 1 millisecond * to have correct HAL operation. * @retval HAL status */ HAL_StatusTypeDef HAL_Init(void) { /* Configure Flash prefetch, Instruction cache, Data cache */ #if (INSTRUCTION_CACHE_ENABLE != 0U) __HAL_FLASH_INSTRUCTION_CACHE_ENABLE(); #endif /* INSTRUCTION_CACHE_ENABLE */ #if (DATA_CACHE_ENABLE != 0U) __HAL_FLASH_DATA_CACHE_ENABLE(); #endif /* DATA_CACHE_ENABLE */ #if (PREFETCH_ENABLE != 0U) __HAL_FLASH_PREFETCH_BUFFER_ENABLE(); #endif /* PREFETCH_ENABLE */ /* Set Interrupt Group Priority */ HAL_NVIC_SetPriorityGrouping(NVIC_PRIORITYGROUP_4); /* Use systick as time base source and configure 1ms tick (default clock after Reset is HSI) */ HAL_InitTick(TICK_INT_PRIORITY); /* Init the low level hardware */ HAL_MspInit(); /* Return function status */ return HAL_OK; } /** * @brief This function de-Initializes common part of the HAL and stops the systick. * This function is optional. * @retval HAL status */ HAL_StatusTypeDef HAL_DeInit(void) { /* Reset of all peripherals */ __HAL_RCC_APB1_FORCE_RESET(); __HAL_RCC_APB1_RELEASE_RESET(); __HAL_RCC_APB2_FORCE_RESET(); __HAL_RCC_APB2_RELEASE_RESET(); __HAL_RCC_AHB1_FORCE_RESET(); __HAL_RCC_AHB1_RELEASE_RESET(); __HAL_RCC_AHB2_FORCE_RESET(); __HAL_RCC_AHB2_RELEASE_RESET(); __HAL_RCC_AHB3_FORCE_RESET(); __HAL_RCC_AHB3_RELEASE_RESET(); /* De-Init the low level hardware */ HAL_MspDeInit(); /* Return function status */ return HAL_OK; } /** * @brief Initializes the MSP. * @retval None */ __weak void HAL_MspInit(void) { /* NOTE : This function Should not be modified, when the callback is needed, the HAL_MspInit could be implemented in the user file */ } /** * @brief DeInitializes the MSP. * @retval None */ __weak void HAL_MspDeInit(void) { /* NOTE : This function Should not be modified, when the callback is needed, the HAL_MspDeInit could be implemented in the user file */ } /** * @brief This function configures the source of the time base. * The time source is configured to have 1ms time base with a dedicated * Tick interrupt priority. * @note This function is called automatically at the beginning of program after * reset by HAL_Init() or at any time when clock is reconfigured by HAL_RCC_ClockConfig(). * @note In the default implementation, SysTick timer is the source of time base. * It is used to generate interrupts at regular time intervals. * Care must be taken if HAL_Delay() is called from a peripheral ISR process, * The the SysTick interrupt must have higher priority (numerically lower) * than the peripheral interrupt. Otherwise the caller ISR process will be blocked. * The function is declared as __weak to be overwritten in case of other * implementation in user file. * @param TickPriority: Tick interrupt priority. * @retval HAL status */ __weak HAL_StatusTypeDef HAL_InitTick(uint32_t TickPriority) { /*Configure the SysTick to have interrupt in 1ms time basis*/ HAL_SYSTICK_Config(SystemCoreClock/1000U); /*Configure the SysTick IRQ priority */ HAL_NVIC_SetPriority(SysTick_IRQn, TickPriority ,0U); /* Return function status */ return HAL_OK; } /** * @} */ /** @defgroup HAL_Exported_Functions_Group2 HAL Control functions * @brief HAL Control functions * @verbatim =============================================================================== ##### HAL Control functions ##### =============================================================================== [..] This section provides functions allowing to: (+) Provide a tick value in millisecond (+) Provide a blocking delay in millisecond (+) Suspend the time base source interrupt (+) Resume the time base source interrupt (+) Get the HAL API driver version (+) Get the device identifier (+) Get the device revision identifier (+) Enable/Disable Debug module during SLEEP mode (+) Enable/Disable Debug module during STOP mode (+) Enable/Disable Debug module during STANDBY mode @endverbatim * @{ */ /** * @brief This function is called to increment a global variable "uwTick" * used as application time base. * @note In the default implementation, this variable is incremented each 1ms * in Systick ISR. * @note This function is declared as __weak to be overwritten in case of other * implementations in user file. * @retval None */ __weak void HAL_IncTick(void) { uwTick++; } /** * @brief Provides a tick value in millisecond. * @note This function is declared as __weak to be overwritten in case of other * implementations in user file. * @retval tick value */ __weak uint32_t HAL_GetTick(void) { return uwTick; } /** * @brief This function provides minimum delay (in milliseconds) based * on variable incremented. * @note In the default implementation , SysTick timer is the source of time base. * It is used to generate interrupts at regular time intervals where uwTick * is incremented. * @note This function is declared as __weak to be overwritten in case of other * implementations in user file. * @param Delay: specifies the delay time length, in milliseconds. * @retval None */ __weak void HAL_Delay(__IO uint32_t Delay) { uint32_t tickstart = HAL_GetTick(); uint32_t wait = Delay; /* Add a period to guarantee minimum wait */ if (wait < HAL_MAX_DELAY) { wait++; } while((HAL_GetTick() - tickstart) < wait) { } } /** * @brief Suspend Tick increment. * @note In the default implementation , SysTick timer is the source of time base. It is * used to generate interrupts at regular time intervals. Once HAL_SuspendTick() * is called, the SysTick interrupt will be disabled and so Tick increment * is suspended. * @note This function is declared as __weak to be overwritten in case of other * implementations in user file. * @retval None */ __weak void HAL_SuspendTick(void) { /* Disable SysTick Interrupt */ SysTick->CTRL &= ~SysTick_CTRL_TICKINT_Msk; } /** * @brief Resume Tick increment. * @note In the default implementation , SysTick timer is the source of time base. It is * used to generate interrupts at regular time intervals. Once HAL_ResumeTick() * is called, the SysTick interrupt will be enabled and so Tick increment * is resumed. * @note This function is declared as __weak to be overwritten in case of other * implementations in user file. * @retval None */ __weak void HAL_ResumeTick(void) { /* Enable SysTick Interrupt */ SysTick->CTRL |= SysTick_CTRL_TICKINT_Msk; } /** * @brief Returns the HAL revision * @retval version : 0xXYZR (8bits for each decimal, R for RC) */ uint32_t HAL_GetHalVersion(void) { return __STM32F4xx_HAL_VERSION; } /** * @brief Returns the device revision identifier. * @retval Device revision identifier */ uint32_t HAL_GetREVID(void) { return((DBGMCU->IDCODE) >> 16U); } /** * @brief Returns the device identifier. * @retval Device identifier */ uint32_t HAL_GetDEVID(void) { return((DBGMCU->IDCODE) & IDCODE_DEVID_MASK); } /** * @brief Enable the Debug Module during SLEEP mode * @retval None */ void HAL_DBGMCU_EnableDBGSleepMode(void) { SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_SLEEP); } /** * @brief Disable the Debug Module during SLEEP mode * @retval None */ void HAL_DBGMCU_DisableDBGSleepMode(void) { CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_SLEEP); } /** * @brief Enable the Debug Module during STOP mode * @retval None */ void HAL_DBGMCU_EnableDBGStopMode(void) { SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_STOP); } /** * @brief Disable the Debug Module during STOP mode * @retval None */ void HAL_DBGMCU_DisableDBGStopMode(void) { CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_STOP); } /** * @brief Enable the Debug Module during STANDBY mode * @retval None */ void HAL_DBGMCU_EnableDBGStandbyMode(void) { SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_STANDBY); } /** * @brief Disable the Debug Module during STANDBY mode * @retval None */ void HAL_DBGMCU_DisableDBGStandbyMode(void) { CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_STANDBY); } /** * @brief Enables the I/O Compensation Cell. * @note The I/O compensation cell can be used only when the device supply * voltage ranges from 2.4 to 3.6 V. * @retval None */ void HAL_EnableCompensationCell(void) { *(__IO uint32_t *)CMPCR_CMP_PD_BB = (uint32_t)ENABLE; } /** * @brief Power-down the I/O Compensation Cell. * @note The I/O compensation cell can be used only when the device supply * voltage ranges from 2.4 to 3.6 V. * @retval None */ void HAL_DisableCompensationCell(void) { *(__IO uint32_t *)CMPCR_CMP_PD_BB = (uint32_t)DISABLE; } /** * @brief Return the unique device identifier (UID based on 96 bits) * @param UID: pointer to 3 words array. * @retval Device identifier */ void HAL_GetUID(uint32_t *UID) { UID[0] = (uint32_t)(READ_REG(*((uint32_t *)UID_BASE))); UID[1] = (uint32_t)(READ_REG(*((uint32_t *)(UID_BASE + 4U)))); UID[2] = (uint32_t)(READ_REG(*((uint32_t *)(UID_BASE + 8U)))); } #if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx)|| defined(STM32F439xx) ||\ defined(STM32F469xx) || defined(STM32F479xx) /** * @brief Enables the Internal FLASH Bank Swapping. * * @note This function can be used only for STM32F42xxx/43xxx devices. * * @note Flash Bank2 mapped at 0x08000000 (and aliased @0x00000000) * and Flash Bank1 mapped at 0x08100000 (and aliased at 0x00100000) * * @retval None */ void HAL_EnableMemorySwappingBank(void) { *(__IO uint32_t *)UFB_MODE_BB = (uint32_t)ENABLE; } /** * @brief Disables the Internal FLASH Bank Swapping. * * @note This function can be used only for STM32F42xxx/43xxx devices. * * @note The default state : Flash Bank1 mapped at 0x08000000 (and aliased @0x00000000) * and Flash Bank2 mapped at 0x08100000 (and aliased at 0x00100000) * * @retval None */ void HAL_DisableMemorySwappingBank(void) { *(__IO uint32_t *)UFB_MODE_BB = (uint32_t)DISABLE; } #endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx || STM32F469xx || STM32F479xx */ /** * @} */ /** * @} */ /** * @} */ /** * @} */ /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
{ "pile_set_name": "Github" }
PACKAGE_NAME="rtl88x2bu" PACKAGE_VERSION="5.6.1" MAKE[0]="make KVER=$kernelver src=$source_tree/rtl88x2bu-$PACKAGE_VERSION" CLEAN="make clean" BUILT_MODULE_NAME[0]="88x2bu" DEST_MODULE_LOCATION[0]="/kernel/drivers/net" AUTOINSTALL="yes"
{ "pile_set_name": "Github" }
"use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); Object.defineProperty(exports, "__esModule", { value: true }); exports.default = parseSeq; var _constants = require("../constants"); var _errors = require("../errors"); var _Pair = _interopRequireDefault(require("./Pair")); var _parseUtils = require("./parseUtils"); var _Seq = _interopRequireDefault(require("./Seq")); function parseSeq(doc, cst) { if (cst.type !== _constants.Type.SEQ && cst.type !== _constants.Type.FLOW_SEQ) { var msg = "A ".concat(cst.type, " node cannot be resolved as a sequence"); doc.errors.push(new _errors.YAMLSyntaxError(cst, msg)); return null; } var _ref = cst.type === _constants.Type.FLOW_SEQ ? resolveFlowSeqItems(doc, cst) : resolveBlockSeqItems(doc, cst), comments = _ref.comments, items = _ref.items; var seq = new _Seq.default(); seq.items = items; (0, _parseUtils.resolveComments)(seq, comments); cst.resolved = seq; return seq; } function resolveBlockSeqItems(doc, cst) { var comments = []; var items = []; for (var i = 0; i < cst.items.length; ++i) { var item = cst.items[i]; switch (item.type) { case _constants.Type.BLANK_LINE: comments.push({ before: items.length }); break; case _constants.Type.COMMENT: comments.push({ comment: item.comment, before: items.length }); break; case _constants.Type.SEQ_ITEM: if (item.error) doc.errors.push(item.error); items.push(doc.resolveNode(item.node)); if (item.hasProps) { var msg = 'Sequence items cannot have tags or anchors before the - indicator'; doc.errors.push(new _errors.YAMLSemanticError(item, msg)); } break; default: if (item.error) doc.errors.push(item.error); doc.errors.push(new _errors.YAMLSyntaxError(item, "Unexpected ".concat(item.type, " node in sequence"))); } } return { comments: comments, items: items }; } function resolveFlowSeqItems(doc, cst) { var comments = []; var items = []; var explicitKey = false; var key = undefined; var keyStart = null; var next = '['; for (var i = 0; i < cst.items.length; ++i) { var item = cst.items[i]; if (typeof item.char === 'string') { var char = item.char; if (char !== ':' && (explicitKey || key !== undefined)) { if (explicitKey && key === undefined) key = next ? items.pop() : null; items.push(new _Pair.default(key)); explicitKey = false; key = undefined; keyStart = null; } if (char === next) { next = null; } else if (!next && char === '?') { explicitKey = true; } else if (next !== '[' && char === ':' && key === undefined) { if (next === ',') { key = items.pop(); if (key instanceof _Pair.default) { var msg = 'Chaining flow sequence pairs is invalid (e.g. [ a : b : c ])'; doc.errors.push(new _errors.YAMLSemanticError(char, msg)); } if (!explicitKey) (0, _parseUtils.checkKeyLength)(doc.errors, cst, i, key, keyStart); } else { key = null; } keyStart = null; explicitKey = false; // TODO: add error for non-explicit multiline plain key next = null; } else if (next === '[' || char !== ']' || i < cst.items.length - 1) { var _msg = "Flow sequence contains an unexpected ".concat(char); doc.errors.push(new _errors.YAMLSyntaxError(cst, _msg)); } } else if (item.type === _constants.Type.BLANK_LINE) { comments.push({ before: items.length }); } else if (item.type === _constants.Type.COMMENT) { comments.push({ comment: item.comment, before: items.length }); } else { if (next) { var _msg2 = "Expected a ".concat(next, " here in flow sequence"); doc.errors.push(new _errors.YAMLSemanticError(item, _msg2)); } var value = doc.resolveNode(item); if (key === undefined) { items.push(value); } else { items.push(new _Pair.default(key, value)); key = undefined; } keyStart = item.range.start; next = ','; } } if (cst.items[cst.items.length - 1].char !== ']') doc.errors.push(new _errors.YAMLSemanticError(cst, 'Expected flow sequence to end with ]')); if (key !== undefined) items.push(new _Pair.default(key)); return { comments: comments, items: items }; }
{ "pile_set_name": "Github" }
var isSymbol = require('./isSymbol'); /** Used as references for various `Number` constants. */ var INFINITY = 1 / 0; /** * Converts `value` to a string key if it's not a string or symbol. * * @private * @param {*} value The value to inspect. * @returns {string|symbol} Returns the key. */ function toKey(value) { if (typeof value == 'string' || isSymbol(value)) { return value; } var result = (value + ''); return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; } module.exports = toKey;
{ "pile_set_name": "Github" }
{ "rowCount" : 1920800, "columns" : { "cd_demo_sk" : { "distinctValuesCount" : 1920800, "nullsCount" : 0, "min" : 1, "max" : 1920800, "dataSize" : null }, "cd_gender" : { "distinctValuesCount" : 2, "nullsCount" : 0, "min" : "F", "max" : "M", "dataSize" : 2 }, "cd_marital_status" : { "distinctValuesCount" : 5, "nullsCount" : 0, "min" : "D", "max" : "W", "dataSize" : 5 }, "cd_education_status" : { "distinctValuesCount" : 7, "nullsCount" : 0, "min" : "2 yr Degree", "max" : "Unknown", "dataSize" : 67 }, "cd_purchase_estimate" : { "distinctValuesCount" : 20, "nullsCount" : 0, "min" : 500, "max" : 10000, "dataSize" : null }, "cd_credit_rating" : { "distinctValuesCount" : 4, "nullsCount" : 0, "min" : "Good", "max" : "Unknown", "dataSize" : 28 }, "cd_dep_count" : { "distinctValuesCount" : 7, "nullsCount" : 0, "min" : 0, "max" : 6, "dataSize" : null }, "cd_dep_employed_count" : { "distinctValuesCount" : 7, "nullsCount" : 0, "min" : 0, "max" : 6, "dataSize" : null }, "cd_dep_college_count" : { "distinctValuesCount" : 7, "nullsCount" : 0, "min" : 0, "max" : 6, "dataSize" : null } } }
{ "pile_set_name": "Github" }
json.reporting do json.extract! @abuse, :id, :signaled_id, :signaled_type end
{ "pile_set_name": "Github" }
/* * Copyright (C) 2013-2015 RoboVM AB * * 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. */ package org.robovm.apple.foundation; /*<imports>*/ import java.io.*; import java.nio.*; import java.util.*; import org.robovm.objc.*; import org.robovm.objc.annotation.*; import org.robovm.objc.block.*; import org.robovm.rt.*; import org.robovm.rt.annotation.*; import org.robovm.rt.bro.*; import org.robovm.rt.bro.annotation.*; import org.robovm.rt.bro.ptr.*; import org.robovm.apple.corefoundation.*; import org.robovm.apple.uikit.*; import org.robovm.apple.coretext.*; import org.robovm.apple.coreanimation.*; import org.robovm.apple.coredata.*; import org.robovm.apple.coregraphics.*; import org.robovm.apple.coremedia.*; import org.robovm.apple.security.*; import org.robovm.apple.dispatch.*; /*</imports>*/ /*<javadoc>*/ /** * @since Available in iOS 10.0 and later. */ /*</javadoc>*/ /*<annotations>*/@Library("Foundation") @NativeClass/*</annotations>*/ /*<visibility>*/public/*</visibility>*/ class /*<name>*/NSISO8601DateFormatter/*</name>*/ extends /*<extends>*/NSFormatter/*</extends>*/ /*<implements>*/implements NSSecureCoding/*</implements>*/ { /*<ptr>*/public static class NSISO8601DateFormatterPtr extends Ptr<NSISO8601DateFormatter, NSISO8601DateFormatterPtr> {}/*</ptr>*/ /*<bind>*/static { ObjCRuntime.bind(NSISO8601DateFormatter.class); }/*</bind>*/ /*<constants>*//*</constants>*/ /*<constructors>*/ public NSISO8601DateFormatter() {} protected NSISO8601DateFormatter(Handle h, long handle) { super(h, handle); } protected NSISO8601DateFormatter(SkipInit skipInit) { super(skipInit); } /*</constructors>*/ /*<properties>*/ @Property(selector = "timeZone") public native NSTimeZone getTimeZone(); @Property(selector = "setTimeZone:") public native void setTimeZone(NSTimeZone v); @Property(selector = "formatOptions") public native NSISO8601DateFormatOptions getFormatOptions(); @Property(selector = "setFormatOptions:") public native void setFormatOptions(NSISO8601DateFormatOptions v); @Property(selector = "supportsSecureCoding") public static native boolean supportsSecureCoding(); /*</properties>*/ /*<members>*//*</members>*/ /*<methods>*/ @Method(selector = "stringFromDate:") public native String format(NSDate date); @Method(selector = "dateFromString:") public native NSDate parse(String string); @Method(selector = "stringFromDate:timeZone:formatOptions:") public static native String format(NSDate date, NSTimeZone timeZone, NSISO8601DateFormatOptions formatOptions); /*</methods>*/ }
{ "pile_set_name": "Github" }
/* Copyright (c) 2016 Anton Valentinov Kirilov 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. */ #include <errno.h> #include <fcntl.h> #include <h2o.h> #include <stdlib.h> #include <string.h> #include <postgresql/libpq-fe.h> #include "database.h" #include "error.h" #include "list.h" #include "thread.h" #define IS_RESETTING 1 #define IS_WRITING 2 typedef struct { list_t l; PGconn *conn; thread_context_t *ctx; db_query_param_t *param; list_t *prepared_statement; h2o_socket_t *sock; uint_fast32_t flags; h2o_timeout_entry_t h2o_timeout_entry; } db_conn_t; typedef struct { list_t l; const char *name; const char *query; } prepared_statement_t; static int do_database_write(db_conn_t *db_conn); static int do_execute_query(db_conn_t *db_conn, bool direct_notification); static void error_notification(thread_context_t *ctx, bool timeout, const char *error_string); static void on_database_connect_error(db_conn_t *db_conn, bool timeout, const char *error_string); static void on_database_connect_timeout(h2o_timeout_entry_t *entry); static void on_database_error(db_conn_t *db_conn, const char *error_string); static void on_database_read_ready(h2o_socket_t *db_sock, const char *err); static void on_database_timeout(h2o_timeout_entry_t *entry); static void on_database_write_ready(h2o_socket_t *db_sock, const char *err); static void poll_database_connection(h2o_socket_t *db_sock, const char *err); static void process_query(db_conn_t *db_conn); static void start_database_connect(thread_context_t *ctx, db_conn_t *db_conn); static int do_database_write(db_conn_t *db_conn) { assert(db_conn->param); int ret = db_conn->param->on_write_ready(db_conn->param, db_conn->conn); if (!ret) db_conn->flags &= ~IS_WRITING; else if (ret < 0) { ERROR(PQerrorMessage(db_conn->conn)); on_database_error(db_conn, DB_ERROR); } else { h2o_socket_notify_write(db_conn->sock, on_database_write_ready); ret = 0; } return ret; } static int do_execute_query(db_conn_t *db_conn, bool direct_notification) { const int ec = db_conn->param->flags & IS_PREPARED ? PQsendQueryPrepared(db_conn->conn, db_conn->param->command, db_conn->param->nParams, db_conn->param->paramValues, db_conn->param->paramLengths, db_conn->param->paramFormats, db_conn->param->resultFormat) : PQsendQuery(db_conn->conn, db_conn->param->command); int ret = 1; if (ec) { if (db_conn->param->flags & IS_SINGLE_ROW) PQsetSingleRowMode(db_conn->conn); db_conn->h2o_timeout_entry.cb = on_database_timeout; h2o_timeout_link(db_conn->ctx->event_loop.h2o_ctx.loop, &db_conn->ctx->db_state.h2o_timeout, &db_conn->h2o_timeout_entry); h2o_socket_read_start(db_conn->sock, on_database_read_ready); const int send_status = PQflush(db_conn->conn); if (send_status < 0) { if (direct_notification) db_conn->param = NULL; LIBRARY_ERROR("PQflush", PQerrorMessage(db_conn->conn)); on_database_error(db_conn, DB_ERROR); } else { ret = 0; if (send_status) h2o_socket_notify_write(db_conn->sock, on_database_write_ready); } } else { if (direct_notification) db_conn->param = NULL; ERROR(PQerrorMessage(db_conn->conn)); on_database_error(db_conn, DB_ERROR); } return ret; } static void error_notification(thread_context_t *ctx, bool timeout, const char *error_string) { if (!--ctx->db_state.db_conn_num) { // We don't want to keep requests waiting for an unbounded amount of time. list_t *iter = ctx->db_state.queries.head; ctx->db_state.queries.head = NULL; ctx->db_state.queries.tail = &ctx->db_state.queries.head; ctx->db_state.query_num = 0; if (iter) do { db_query_param_t * const param = H2O_STRUCT_FROM_MEMBER(db_query_param_t, l, iter); // The callback may free the db_query_param_t structure. iter = iter->next; if (timeout) param->on_timeout(param); else param->on_error(param, error_string); } while (iter); } } static void on_database_connect_error(db_conn_t *db_conn, bool timeout, const char *error_string) { thread_context_t * const ctx = db_conn->ctx; error_notification(ctx, timeout, error_string); h2o_timeout_unlink(&db_conn->h2o_timeout_entry); h2o_socket_read_stop(db_conn->sock); h2o_socket_close(db_conn->sock); PQfinish(db_conn->conn); free(db_conn); } static void on_database_connect_timeout(h2o_timeout_entry_t *entry) { db_conn_t * const db_conn = H2O_STRUCT_FROM_MEMBER(db_conn_t, h2o_timeout_entry, entry); ERROR(DB_TIMEOUT_ERROR); on_database_connect_error(db_conn, true, DB_TIMEOUT_ERROR); } static void on_database_error(db_conn_t *db_conn, const char *error_string) { if (db_conn->prepared_statement) on_database_connect_error(db_conn, false, error_string); else { if (db_conn->param) { db_conn->param->on_error(db_conn->param, error_string); db_conn->param = NULL; } if (PQstatus(db_conn->conn) == CONNECTION_OK) { h2o_timeout_unlink(&db_conn->h2o_timeout_entry); h2o_socket_read_stop(db_conn->sock); process_query(db_conn); } else start_database_connect(db_conn->ctx, db_conn); } } static void on_database_read_ready(h2o_socket_t *db_sock, const char *err) { db_conn_t * const db_conn = db_sock->data; if (err) ERROR(err); else { if (PQconsumeInput(db_conn->conn)) { const int send_status = PQflush(db_conn->conn); if (send_status > 0) h2o_socket_notify_write(db_conn->sock, on_database_write_ready); if (send_status >= 0) { while (!PQisBusy(db_conn->conn)) { PGresult * const result = PQgetResult(db_conn->conn); if (db_conn->param) switch (db_conn->param->on_result(db_conn->param, result)) { case WANT_WRITE: db_conn->flags |= IS_WRITING; if (do_database_write(db_conn)) return; break; case DONE: db_conn->param = NULL; h2o_timeout_unlink(&db_conn->h2o_timeout_entry); break; default: break; } else if (result) { if (PQresultStatus(result) != PGRES_COMMAND_OK) LIBRARY_ERROR("PQresultStatus", PQresultErrorMessage(result)); PQclear(result); } if (!result) { assert(!db_conn->param); h2o_timeout_unlink(&db_conn->h2o_timeout_entry); h2o_socket_read_stop(db_conn->sock); process_query(db_conn); break; } } return; } } ERROR(PQerrorMessage(db_conn->conn)); } on_database_error(db_conn, DB_ERROR); } static void on_database_timeout(h2o_timeout_entry_t *entry) { db_conn_t * const db_conn = H2O_STRUCT_FROM_MEMBER(db_conn_t, h2o_timeout_entry, entry); ERROR(DB_TIMEOUT_ERROR); if (db_conn->param) { db_conn->param->on_timeout(db_conn->param); db_conn->param = NULL; } start_database_connect(db_conn->ctx, db_conn); } static void on_database_write_ready(h2o_socket_t *db_sock, const char *err) { db_conn_t * const db_conn = db_sock->data; if (err) { ERROR(err); on_database_error(db_conn, DB_ERROR); } else { const int send_status = PQflush(db_conn->conn); if (!send_status) { if (db_conn->flags & IS_WRITING && db_conn->param) do_database_write(db_conn); } else if (send_status < 0) { LIBRARY_ERROR("PQflush", PQerrorMessage(db_conn->conn)); on_database_error(db_conn, DB_ERROR); } else h2o_socket_notify_write(db_conn->sock, on_database_write_ready); } } static void poll_database_connection(h2o_socket_t *db_sock, const char *err) { db_conn_t * const db_conn = db_sock->data; if (err) ERROR(err); else { const PostgresPollingStatusType status = db_conn->flags & IS_RESETTING ? PQresetPoll(db_conn->conn) : PQconnectPoll(db_conn->conn); switch (status) { case PGRES_POLLING_WRITING: if (!h2o_socket_is_writing(db_conn->sock)) h2o_socket_notify_write(db_conn->sock, poll_database_connection); h2o_socket_read_stop(db_conn->sock); return; case PGRES_POLLING_OK: if (PQsetnonblocking(db_conn->conn, 1)) { LIBRARY_ERROR("PQsetnonblocking", PQerrorMessage(db_conn->conn)); break; } h2o_timeout_unlink(&db_conn->h2o_timeout_entry); h2o_socket_read_stop(db_conn->sock); process_query(db_conn); return; case PGRES_POLLING_READING: h2o_socket_read_start(db_conn->sock, poll_database_connection); return; default: ERROR(PQerrorMessage(db_conn->conn)); } } on_database_connect_error(db_conn, false, DB_ERROR); } static void process_query(db_conn_t *db_conn) { if (db_conn->prepared_statement) { const prepared_statement_t * const p = H2O_STRUCT_FROM_MEMBER(prepared_statement_t, l, db_conn->prepared_statement); if (PQsendPrepare(db_conn->conn, p->name, p->query, 0, NULL)) { db_conn->prepared_statement = p->l.next; db_conn->h2o_timeout_entry.cb = on_database_connect_timeout; h2o_timeout_link(db_conn->ctx->event_loop.h2o_ctx.loop, &db_conn->ctx->db_state.h2o_timeout, &db_conn->h2o_timeout_entry); h2o_socket_read_start(db_conn->sock, on_database_read_ready); on_database_write_ready(db_conn->sock, NULL); } else { LIBRARY_ERROR("PQsendPrepare", PQerrorMessage(db_conn->conn)); on_database_connect_error(db_conn, false, DB_ERROR); } } else if (db_conn->ctx->db_state.query_num) { db_conn->ctx->db_state.query_num--; if (db_conn->ctx->db_state.queries.tail == &db_conn->ctx->db_state.queries.head->next) { assert(!db_conn->ctx->db_state.query_num); db_conn->ctx->db_state.queries.tail = &db_conn->ctx->db_state.queries.head; } db_conn->param = H2O_STRUCT_FROM_MEMBER(db_query_param_t, l, db_conn->ctx->db_state.queries.head); db_conn->ctx->db_state.queries.head = db_conn->ctx->db_state.queries.head->next; do_execute_query(db_conn, false); } else { db_conn->l.next = db_conn->ctx->db_state.db_conn; db_conn->ctx->db_state.db_conn = &db_conn->l; db_conn->ctx->db_state.free_db_conn_num++; } } static void start_database_connect(thread_context_t *ctx, db_conn_t *db_conn) { if (db_conn) { db_conn->flags = IS_RESETTING; h2o_timeout_unlink(&db_conn->h2o_timeout_entry); h2o_socket_read_stop(db_conn->sock); h2o_socket_close(db_conn->sock); if (!PQresetStart(db_conn->conn)) { LIBRARY_ERROR("PQresetStart", PQerrorMessage(db_conn->conn)); goto error_dup; } } else { ctx->db_state.db_conn_num++; db_conn = h2o_mem_alloc(sizeof(*db_conn)); memset(db_conn, 0, sizeof(*db_conn)); const char * const conninfo = ctx->config->db_host ? ctx->config->db_host : ""; db_conn->conn = PQconnectStart(conninfo); if (!db_conn->conn) { errno = ENOMEM; STANDARD_ERROR("PQconnectStart"); goto error_connect; } if (PQstatus(db_conn->conn) == CONNECTION_BAD) { LIBRARY_ERROR("PQstatus", PQerrorMessage(db_conn->conn)); goto error_dup; } } const int sd = dup(PQsocket(db_conn->conn)); if (sd < 0) { STANDARD_ERROR("dup"); goto error_dup; } const int flags = fcntl(sd, F_GETFD); if (flags < 0 || fcntl(sd, F_SETFD, flags | FD_CLOEXEC)) { STANDARD_ERROR("fcntl"); goto error_fcntl; } db_conn->sock = h2o_evloop_socket_create(ctx->event_loop.h2o_ctx.loop, sd, H2O_SOCKET_FLAG_DONT_READ); if (db_conn->sock) { db_conn->sock->data = db_conn; db_conn->ctx = ctx; db_conn->h2o_timeout_entry.cb = on_database_connect_timeout; db_conn->prepared_statement = ctx->global_data->prepared_statements; h2o_timeout_link(ctx->event_loop.h2o_ctx.loop, &ctx->db_state.h2o_timeout, &db_conn->h2o_timeout_entry); h2o_socket_notify_write(db_conn->sock, poll_database_connection); return; } errno = ENOMEM; STANDARD_ERROR("h2o_evloop_socket_create"); error_fcntl: close(sd); error_dup: PQfinish(db_conn->conn); error_connect: free(db_conn); error_notification(ctx, false, DB_ERROR); } void add_prepared_statement(const char *name, const char *query, list_t **prepared_statements) { prepared_statement_t * const p = h2o_mem_alloc(sizeof(*p)); memset(p, 0, sizeof(*p)); p->l.next = *prepared_statements; p->name = name; p->query = query; *prepared_statements = &p->l; } int execute_query(thread_context_t *ctx, db_query_param_t *param) { int ret = 1; if (ctx->db_state.free_db_conn_num) { db_conn_t * const db_conn = H2O_STRUCT_FROM_MEMBER(db_conn_t, l, ctx->db_state.db_conn); ctx->db_state.db_conn = db_conn->l.next; ctx->db_state.free_db_conn_num--; db_conn->param = param; ret = do_execute_query(db_conn, true); } else if (ctx->db_state.query_num < ctx->config->max_query_num) { if (ctx->db_state.db_conn_num < ctx->config->max_db_conn_num) start_database_connect(ctx, NULL); if (ctx->db_state.db_conn_num) { param->l.next = NULL; *ctx->db_state.queries.tail = &param->l; ctx->db_state.queries.tail = &param->l.next; ctx->db_state.query_num++; ret = 0; } } return ret; } void free_database_state(h2o_loop_t *loop, db_state_t *db_state) { assert(!db_state->query_num && db_state->free_db_conn_num == db_state->db_conn_num); list_t *iter = db_state->db_conn; if (iter) do { db_conn_t * const db_conn = H2O_STRUCT_FROM_MEMBER(db_conn_t, l, iter); iter = iter->next; assert(!db_conn->param && !h2o_timeout_is_linked(&db_conn->h2o_timeout_entry)); h2o_socket_close(db_conn->sock); PQfinish(db_conn->conn); free(db_conn); } while (iter); h2o_timeout_dispose(loop, &db_state->h2o_timeout); } void initialize_database_state(h2o_loop_t *loop, db_state_t *db_state) { memset(db_state, 0, sizeof(*db_state)); db_state->queries.tail = &db_state->queries.head; h2o_timeout_init(loop, &db_state->h2o_timeout, H2O_DEFAULT_HTTP1_REQ_TIMEOUT); } void remove_prepared_statements(list_t *prepared_statements) { if (prepared_statements) do { prepared_statement_t * const p = H2O_STRUCT_FROM_MEMBER(prepared_statement_t, l, prepared_statements); prepared_statements = prepared_statements->next; free(p); } while (prepared_statements); }
{ "pile_set_name": "Github" }
{ "images" : [ { "size" : "29x29", "idiom" : "iphone", "filename" : "[email protected]", "scale" : "2x" }, { "size" : "40x40", "idiom" : "iphone", "filename" : "[email protected]", "scale" : "2x" }, { "size" : "60x60", "idiom" : "iphone", "filename" : "iPhone.png", "scale" : "2x" }, { "size" : "29x29", "idiom" : "ipad", "filename" : "Settings.png", "scale" : "1x" }, { "size" : "29x29", "idiom" : "ipad", "filename" : "[email protected]", "scale" : "2x" }, { "size" : "40x40", "idiom" : "ipad", "filename" : "Spotlight.png", "scale" : "1x" }, { "size" : "40x40", "idiom" : "ipad", "filename" : "[email protected]", "scale" : "2x" }, { "size" : "76x76", "idiom" : "ipad", "filename" : "iPad.png", "scale" : "1x" }, { "size" : "76x76", "idiom" : "ipad", "filename" : "[email protected]", "scale" : "2x" }, { "size" : "512x512", "idiom" : "mac", "filename" : "iTunesArtwork.png", "scale" : "1x" }, { "size" : "512x512", "idiom" : "mac", "filename" : "[email protected]", "scale" : "2x" } ], "info" : { "version" : 1, "author" : "xcode" }, "properties" : { "pre-rendered" : true } }
{ "pile_set_name": "Github" }
Additional IP Rights Grant (Patents) "This implementation" means the copyrightable works distributed by Google as part of the Go project. Google hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, transfer and otherwise run, modify and propagate the contents of this implementation of Go, where such license applies only to those patent claims, both currently owned or controlled by Google and acquired in the future, licensable by Google that are necessarily infringed by this implementation of Go. This grant does not include claims that would be infringed only as a consequence of further modification of this implementation. If you or your agent or exclusive licensee institute or order or agree to the institution of patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that this implementation of Go or any code incorporated within this implementation of Go constitutes direct or contributory patent infringement, or inducement of patent infringement, then any patent rights granted to you under this License for this implementation of Go shall terminate as of the date such litigation is filed.
{ "pile_set_name": "Github" }
### Description This demo attaches a vector (in this case a float vector of length 1) to each point in a polydata.
{ "pile_set_name": "Github" }
/*! * Copyright (c) 2015, Salesforce.com, Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * 3. Neither the name of Salesforce.com 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 COPYRIGHT HOLDERS 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 COPYRIGHT HOLDER 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. */ "use strict"; var pubsuffix = require('./pubsuffix'); // Gives the permutation of all possible domainMatch()es of a given domain. The // array is in shortest-to-longest order. Handy for indexing. function permuteDomain (domain) { var pubSuf = pubsuffix.getPublicSuffix(domain); if (!pubSuf) { return null; } if (pubSuf == domain) { return [domain]; } var prefix = domain.slice(0, -(pubSuf.length + 1)); // ".example.com" var parts = prefix.split('.').reverse(); var cur = pubSuf; var permutations = [cur]; while (parts.length) { cur = parts.shift() + '.' + cur; permutations.push(cur); } return permutations; } exports.permuteDomain = permuteDomain;
{ "pile_set_name": "Github" }
*************************** The operating-system Module *************************** .. current-library:: system .. current-module:: operating-system The operating-system module is part of the System library. It provides an interface to some features of the host machine's operating system. .. contents:: Manipulating environment information ------------------------------------ The operating-system module contains a number of interfaces for examining and specifying information about the operating system environment of the host machine. As well as providing constants that you can use in your code, you can examine and set the value of any environment variable in the system. The following constants contain machine-specific information: - :const:`$architecture-little-endian?` - :const:`$machine-name` - :const:`$os-name` - :const:`$os-variant` - :const:`$os-version` - :const:`$platform-name` These constants contain information about the hardware and software resident on the host machine. The constants let you programmatically check the current system conditions before executing a piece of code. The following function also returns information about the machine: - :func:`machine-concurrent-thread-count` The following two functions let you manipulate the values of any environment variables in the system. - :func:`environment-variable` - :func:`environment-variable-setter` The following functions access information about the user logged on to the current machine, where available. - :func:`login-name` - :func:`login-group` - :func:`owner-name` - :func:`owner-organization` Running Applications -------------------- - :func:`run-application` Manipulating application information ------------------------------------ The operating-system module contains a number of functions for manipulating information specific to a given application, rather than the environment as a whole. You can run or quit any application, and interrogate the running application for application-specific information. - :func:`exit-application` - :func:`register-application-exit-function` - :func:`application-arguments` - :func:`application-name` - :func:`application-filename` - :func:`tokenize-command-string` - :func:`current-process-id` - :func:`parent-process-id` Working with shared libraries ----------------------------- - :func:`load-library` The operating-system module --------------------------- This section contains a reference entry for each item exported from the System library's operating-system module. .. function:: application-arguments Returns the arguments passed to the running application. :signature: application-arguments => *arguments* :value arguments: An instance of :drm:`<simple-object-vector>`. :description: Returns the arguments passed to the running application as a vector of instances of :drm:`<byte-string>`. :seealso: - :func:`application-filename` - :func:`application-name` - :func:`tokenize-command-string` .. function:: application-filename Returns the full filename of the running application. :signature: application-filename => *false-or-filename* :value false-or-filename: An instance of ``false-or(<byte-string>)``. :description: Returns the full filename (that is, the absolute pathname) of the running application, or ``#f`` if the filename cannot be determined. :example: The following is an example of an absolute pathname naming an application:: "C:\\Program Files\\foo\\bar.exe" :seealso: - :func:`application-arguments` - :func:`application-name` - :func:`tokenize-command-string` .. function:: application-name Returns the name of the running application. :signature: application-name => *name* :value name: An instance of :drm:`<byte-string>`. :description: Returns the name of the running application. This is normally the command name as typed on the command line and may be a non-absolute pathname. :example: The following is an example of a non-absolute pathname used to refer to the application name:: "foo\\bar.exe" :seealso: - :func:`application-arguments` - :func:`application-filename` - :func:`tokenize-command-string` .. constant:: $architecture-little-endian? Constant specifying whether the processor architecture is little-endian. :type: <boolean> :description: This constant is a boolean value that is true if the processor architecture is little-endian and false if it is big-endian. (A processor is little-endian if the rightmost bit in a word is the least-significant bit.) For processors implementing the Intel x86 architecture this value is ``#t``. :seealso: - :const:`$machine-name` - :const:`$os-name` - :const:`$os-variant` - :const:`$os-version` - :const:`$platform-name` .. function:: current-process-id Returns the integer value for the current process ID. :signature: current-process-id => *pid* :value pid: An instance of :drm:`<integer>`. :description: Returns the integer value of the current process ID. :seealso: - :func:`current-thread-id` - :func:`parent-process-id` .. function:: environment-variable Returns the value of a specified environment variable. :signature: environment-variable *name* => *value* :parameter name: An instance of :drm:`<byte-string>`. :value value: An instance of :drm:`<byte-string>`, or ``#f``. :description: Returns the value of the environment variable specified by *name*, or ``#f`` if there is no such environment variable. :seealso: - :func:`environment-variable-setter` .. function:: environment-variable-setter Sets the value of an environment variable. :signature: environment-variable-setter *new-value* *name* => *new-value* :parameter new-value: An instance of :drm:`<byte-string>`, or ``#f``. :parameter name: An instance of :drm:`<byte-string>`. :value new-value: An instance of :drm:`<byte-string>`, or ``#f``. :description: Changes the value of the environment variable specified by *name* to *new-value*. If *new-value* is ``#f``, the environment variable is undefined. If the environment variable does not already exist, *environment-variable-setter* creates it. .. note:: Windows 95 places restrictions on the number of environment variables allowed, based on the total length of the names and values of the existing environment variables. The function *environment-variable-setter* only creates a new environment variable if it is possible within these restrictions. See the relevant Windows 95 documentation for more details. :seealso: - :func:`environment-variable` .. function:: exit-application Terminates execution of the running application. :signature: exit-application *status* => () :parameter status: An instance of :drm:`<integer>`. :description: Terminates execution of the running application, returning the value of *status* to whatever launched the application, for example an MS-DOS window or Windows 95/NT shell. .. note:: This function is also available from the ``dylan-extensions`` module in the ``dylan`` library and the ``common-extensions`` module of the ``common-dylan`` library. :seealso: - :func:`register-application-exit-function` .. function:: load-library Loads a shared library into the current process. :signature: load-library *name* => *module* :parameter name: An instance of :drm:`<string>`. :value module: An instance of :class:`<machine-word>`. :description: Loads the library specified by *name* into the current process. The library must be a shared library. If the library is a library written in Dylan, then when it loaded, constructor functions will run which set up the various methods and other Dylan objects within the shared library. Top level code within the library will be executed. Load-time failures, for example due to missing files or unsatisfied symbol dependencies, will cause an :drm:`<error>` condition to be signaled. .. note:: Dynamic loading of Dylan code is currently only supported on non-Windows platforms using the LLVM back-end, and on Windows using the HARP back-end. .. function:: login-name Returns as an instance of :drm:`<string>` the name of the user logged on to the current machine, or ``#f`` if unavailable. :signature: login-name () => *name-or-false* :value name-or-false: An instance of ``false-or(<string>)``. :description: Returns as an instance of :drm:`<string>` the name of the user logged on to the current machine, or ``#f`` if unavailable. :seealso: - :func:`login-group` .. function:: login-group :signature: login-group () => *group-or-false* :value group-or-false: An instance of ``false-or(<string>)``. :description: Returns as an instance of :drm:`<string>` the group (for example NT domain, or Windows Workgroup) of which the user logged on to the current machine is a member, or ``#f`` if the group is unavailable. :seealso: - :func:`login-name` .. constant:: $machine-name Constant specifying the type of hardware installed in the host machine. :type: <symbol> :value: #"x86", #"x86-64", #"ppc" :description: This constant is a symbol that represents the type of hardware installed in the host machine. :seealso: - :const:`$architecture-little-endian?` - :const:`$os-name` - :const:`$os-variant` - :const:`$os-version` - :const:`$platform-name` .. constant:: $os-name Constant specifying the operating system running on the host machine. :type: <symbol> :value: #"win32", #"linux", #"darwin", #"freebsd" :description: This constant is a symbol that represents the operating system running on the host machine. :seealso: - :const:`$architecture-little-endian?` - :const:`$machine-name` - :const:`$os-variant` - :const:`$os-version` - :const:`$platform-name` .. constant:: $os-variant Constant specifying which variant of an operating system the current machine is running, where relevant. :type: <symbol> :description: This constant is a symbol value distinguishing between variants of the operating system identified by ``$os-name``, where relevant; otherwise it has the same value as ``$os-name``. On Windows, the possible values are ``#"win3.1"``, ``#"win95"``, ``#"win98"``, and ``#"winnt"``. :seealso: - :const:`$architecture-little-endian?` - :const:`$machine-name` - :const:`$os-name` - :const:`$os-version` - :const:`$platform-name` .. constant:: $os-version Constant specifying which version of an operating system the current machine is running. :type: <string> :description: The constant *$os-version* is a string value that identifies the version of the operating system. For Windows NT, a typical value would be *"4.0.1381 Service Pack 3"*. For Windows 95, a typical value would be *"4.0.1212 B"*. :seealso: - :const:`$architecture-little-endian?` - :const:`$machine-name` - :const:`$os-name` - :const:`$os-variant` - :const:`$platform-name` .. function:: owner-name Returns the name of the user who owns the current machine, if available. :signature: owner-name () => *name-or-false* :value name-or-false: An instance of ``false-or(<string>)``. :description: Returns as an instance of :drm:`<string>` the name of the user who owns the current machine (that is, the name entered when the machine was registered), or ``#f`` if the name is unavailable. .. function:: owner-organization Returns the organization to which the user who owns the current machine belongs, if available. :signature: owner-organization () => *organization-or-false* :value organization-or-false: An instance of ``false-or(<string>)``. :description: Returns as an instance of :drm:`<string>` the organization to which the user who owns the current machine belongs, or ``#f`` if the name is unavailable. .. function:: parent-process-id Returns the integer value for the parent process ID. :signature: parent-process-id => *pid* :value pid: An instance of :drm:`<integer>`. :description: Returns the integer value of the parent process ID. .. note:: This is not yet implemented on Windows. :seealso: - :func:`current-process-id` - :func:`current-thread-id` .. constant:: $platform-name Constant specifying the operating system running on and the type of hardware installed in the host machine. :type: <symbol> :value: ``#"x86-win32"``, ``#"x86-linux"``, etc. :description: This constant is a symbol that represents the both the operating system running on, and the type of hardware installed in, the host machine. It is a combination of the :const:`$os-name` and :const:`$machine-name` constants. :example: ``#"x86-win32"``, ``#"x86_64-linux"`` :seealso: - :const:`$machine-name` - :const:`$os-name` .. function:: machine-concurrent-thread-count Return the number of concurrent execution threads available. :signature: machine-concurrent-thread-count => *count* :value count: An instance of :drm:`<integer>`. :description: Returns the number of execution threads currently available. This normally corresponds to the number of logical processor cores currently online, and may vary over the lifetime of the program. .. function:: register-application-exit-function Register a function to be executed when the application is about to exit. :signature: register-application-exit-function *function* => () :parameter function: An instance of :drm:`<function>`. :description: Register a function to be executed when the application is about to exit. The Dylan runtime will make sure that these functions are executed. The *function* should not expect any arguments, nor expect that any return values be used. .. note:: Currently, the registered functions will be invoked in the reverse order in which they were added. This is **not** currently a contractual guarantee and may be subject to change. .. note:: This function is also available from the ``dylan-extensions`` module in the ``dylan`` library and the ``common-extensions`` module of the ``common-dylan`` library. :example: :seealso: - :func:`exit-application` .. function:: run-application Launches an application using the specified name and arguments. :signature: run-application *command* #key *minimize?* *activate?* *under-shell?* *inherit-console?* => *status* :parameter command: An instance of :drm:`<string>`. :parameter #key minimize?: An instance of :drm:`<boolean>`. :parameter #key activate?: An instance of :drm:`<boolean>`. :parameter #key under-shell?: An instance of :drm:`<boolean>`. :parameter #key inherit-console?: An instance of :drm:`<boolean>`. :value status: An instance of :drm:`<integer>`. :description: Launches an application using the name and arguments specified in command. Using this function is equivalent to typing the command in a MS-DOS window. The return value is the exit status returned by the application. If the *minimize?* keyword is ``#t``, the command's shell will appear minimized. It is ``#f`` by default. If the *activate?* keyword is ``#t``, the shell window becomes the active window. It is ``#t`` by default. If the *under-shell?* keyword is ``#t``, an MS-DOS shell is created to run the application; otherwise, the application is run directly. It is ``#f`` by default. If the *inherit-console?* keyword is ``#t``, the new application uses the same console window as the current application; otherwise, the new application is created with a separate console window. It is ``#t`` by default. :seealso: - :func:`exit-application` .. function:: tokenize-command-string Parses a command line into a command name and arguments. :signature: tokenize-command-string *line* => *command* #rest *arguments* :parameter line: An instance of :drm:`<byte-string>`. :value command: An instance of :drm:`<byte-string>`. :value #rest arguments: Instances of :drm:`<byte-string>`. :description: Parses the command specified in *line* into a command name and arguments. The rules used to tokenize the string are given in Microsoft's C/C++ reference in the section `"Parsing C Command-Line Arguments" <http://msdn.microsoft.com/en-us/library/a1y7w461.aspx>`_. :seealso: - :func:`application-arguments` - :func:`application-name`
{ "pile_set_name": "Github" }
package com.vk.api.sdk.queries.stories; import com.vk.api.sdk.client.AbstractQueryBuilder; import com.vk.api.sdk.client.VkApiClient; import com.vk.api.sdk.client.actors.GroupActor; import com.vk.api.sdk.client.actors.UserActor; import com.vk.api.sdk.objects.base.UserGroupFields; import com.vk.api.sdk.objects.stories.responses.GetRepliesResponse; import java.util.Arrays; import java.util.List; /** * Query for Stories.getReplies method */ public class StoriesGetRepliesQuery extends AbstractQueryBuilder<StoriesGetRepliesQuery, GetRepliesResponse> { /** * Creates a AbstractQueryBuilder instance that can be used to build api request with various parameters * * @param client VK API client * @param actor actor with access token * @param ownerId value of "owner id" parameter. * @param storyId value of "story id" parameter. Minimum is 0. */ public StoriesGetRepliesQuery(VkApiClient client, UserActor actor, int ownerId, int storyId) { super(client, "stories.getReplies", GetRepliesResponse.class); accessToken(actor.getAccessToken()); ownerId(ownerId); storyId(storyId); } /** * Creates a AbstractQueryBuilder instance that can be used to build api request with various parameters * * @param client VK API client * @param actor actor with access token * @param ownerId value of "owner id" parameter. * @param storyId value of "story id" parameter. Minimum is 0. */ public StoriesGetRepliesQuery(VkApiClient client, GroupActor actor, int ownerId, int storyId) { super(client, "stories.getReplies", GetRepliesResponse.class); accessToken(actor.getAccessToken()); ownerId(ownerId); storyId(storyId); } /** * Story owner ID. * * @param value value of "owner id" parameter. * @return a reference to this {@code AbstractQueryBuilder} object to fulfill the "Builder" pattern. */ protected StoriesGetRepliesQuery ownerId(int value) { return unsafeParam("owner_id", value); } /** * Story ID. * * @param value value of "story id" parameter. Minimum is 0. * @return a reference to this {@code AbstractQueryBuilder} object to fulfill the "Builder" pattern. */ protected StoriesGetRepliesQuery storyId(int value) { return unsafeParam("story_id", value); } /** * Access key for the private object. * * @param value value of "access key" parameter. * @return a reference to this {@code AbstractQueryBuilder} object to fulfill the "Builder" pattern. */ public StoriesGetRepliesQuery accessKey(String value) { return unsafeParam("access_key", value); } /** * '1' — to return additional fields for users and communities. Default value is 0. * * @param value value of "extended" parameter. By default false. * @return a reference to this {@code AbstractQueryBuilder} object to fulfill the "Builder" pattern. */ public StoriesGetRepliesQuery extended(Boolean value) { return unsafeParam("extended", value); } /** * fields * Additional fields to return * * @param value value of "fields" parameter. * @return a reference to this {@code AbstractQueryBuilder} object to fulfill the "Builder" pattern. */ public StoriesGetRepliesQuery fields(UserGroupFields... value) { return unsafeParam("fields", value); } /** * Additional fields to return * * @param value value of "fields" parameter. * @return a reference to this {@code AbstractQueryBuilder} object to fulfill the "Builder" pattern. */ public StoriesGetRepliesQuery fields(List<UserGroupFields> value) { return unsafeParam("fields", value); } @Override protected StoriesGetRepliesQuery getThis() { return this; } @Override protected List<String> essentialKeys() { return Arrays.asList("story_id", "owner_id", "access_token"); } }
{ "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 org.apache.carbondata.core.metadata.datatype; public class BinaryType extends DataType { static final DataType BINARY = new BinaryType(DataTypes.BINARY_TYPE_ID, 26, "BINARY", -1); private BinaryType(int id, int precedenceOrder, String name, int sizeInBytes) { super(id, precedenceOrder, name, sizeInBytes); } // this function is needed to ensure singleton pattern while supporting java serialization private Object readResolve() { return DataTypes.BINARY; } }
{ "pile_set_name": "Github" }
{ "name": "Circular", "description": "The free tweet scheduling app.", "version": "1.0.2", "app": { "urls": [ "*://circular.io/" ], "launch": { "web_url": "http://circular.io/" } }, "icons": { "128": "icon_128.png" }, "permissions": [ ], "manifest_version": 2 }
{ "pile_set_name": "Github" }
{ "model": "ssd_mobilenet", "batchnorm": true, "input_info": { "sample_size": [2, 3, 300, 300] }, "pretrained": true, "num_classes": 21, "dataset": "voc", "preprocessing": { "mean": [0.406, 0.456, 0.485], "std": [0.255, 0.224, 0.229], "normalize_coef": 255, "rgb": true }, "max_iter": 75000, "iter_size": 1, "save_freq": 50, "optimizer": { "type": "Adam", "base_lr": 1e-4, "weight_decay": 5e-4, "schedule_type": "plateau", "scheduler_params": { "threshold": 0.1, "cooldown": 3 } }, "ssd_params": { "variance": [0.1, 0.1, 0.2, 0.2], "max_sizes": [60, 111, 162, 213, 264, 315], "min_sizes": [30, 60, 111, 162, 213, 264], "steps": [16, 32, 64, 100, 150, 300], "aspect_ratios": [[2], [2, 3], [2, 3], [2, 3], [2], [2]], "clip": false, "flip": true, "top_k": 200, } }
{ "pile_set_name": "Github" }
#!/usr/bin/env bash set -e echo echo "GET CATEGORY MESSAGES" echo "=====================" echo "- Write 2 messages each to 3 entity streams in the same category" echo "- Retrieve a batch of messages from the category" echo source test/_controls.sh category=$(category) echo "Category:" echo $category echo for i in {1..3}; do stream_name=$(stream-name $category) echo $stream_name write-message $stream_name 2 done echo cmd="SELECT * FROM get_category_messages('$category');" echo "Command:" echo "$cmd" echo psql message_store -U message_store -P pager=off -x -c "$cmd" echo "= = =" echo
{ "pile_set_name": "Github" }
/* * 12/12/99 Added appendSamples() method for efficiency. MDM. * 15/02/99 ,Java Conversion by E.B ,[email protected], JavaLayer *----------------------------------------------------------------------------- * obuffer.h * * Declarations for output buffer, includes operating system * implementation of the virtual Obuffer. Optional routines * enabling seeks and stops added by Jeff Tsay. * * * @(#) obuffer.h 1.8, last edit: 6/15/94 16:51:56 * @(#) Copyright (C) 1993, 1994 Tobias Bading ([email protected]) * @(#) Berlin University of Technology * * Idea and first implementation for u-law output with fast downsampling by * Jim Boucher ([email protected]) * * LinuxObuffer class written by * Louis P. Kruger ([email protected]) * * 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., 675 Mass Ave, Cambridge, MA 02139, USA. *---------------------------------------------------------------------------- */ namespace javazoom.jl.decoder { using System; /// <summary> Base Class for audio output. /// </summary> internal abstract class Obuffer { public const int OBUFFERSIZE = 2 * 1152; // max. 2 * 1152 samples per frame public const int MAXCHANNELS = 2; // max. number of channels /// <summary> Takes a 16 Bit PCM sample. /// </summary> public abstract void append(int channel, short value_Renamed); /// <summary> Accepts 32 new PCM samples. /// </summary> public virtual void appendSamples(int channel, float[] f) { short s; for (int i = 0; i < 32; i++) { append(channel, (short)clip((f[i]))); } } /// <summary> Clip Sample to 16 Bits /// </summary> private short clip(float sample) { //UPGRADE_WARNING: Narrowing conversions may produce unexpected results in C#. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1042"' return ((sample > 32767.0f)?(short)32767:((sample < - 32768.0f)?(short)- 32768:(short) sample)); } /// <summary> Write the samples to the file or directly to the audio hardware. /// </summary> public abstract void write_buffer(int val); public abstract void close(); /// <summary> Clears all data in the buffer (for seeking). /// </summary> public abstract void clear_buffer(); /// <summary> Notify the buffer that the user has stopped the stream. /// </summary> public abstract void set_stop_flag(); } }
{ "pile_set_name": "Github" }
'use strict' const http = require('http') const { expect } = require('chai') const nock = require('..') const sinon = require('sinon') const assertRejects = require('assert-rejects') const got = require('./got_client') const servers = require('./servers') require('./setup') describe('Nock lifecycle functions', () => { describe('`activate()`', () => { it('double activation throws exception', () => { nock.restore() expect(nock.isActive()).to.be.false() nock.activate() expect(nock.isActive()).to.be.true() expect(() => nock.activate()).to.throw(Error, 'Nock already active') expect(nock.isActive()).to.be.true() }) it('(re-)activate after restore', async () => { const onResponse = sinon.spy() const { origin } = await servers.startHttpServer((request, response) => { onResponse() if (request.url === '/') { response.writeHead(200) response.write('server served a response') } response.end() }) const scope = nock(origin).get('/').reply(304, 'served from our mock') nock.restore() expect(nock.isActive()).to.be.false() expect(await got(origin)).to.include({ statusCode: 200 }) expect(scope.isDone()).to.be.false() nock.activate() expect(nock.isActive()).to.be.true() expect(await got(origin)).to.include({ statusCode: 304 }) expect(scope.isDone()).to.be.true() expect(onResponse).to.have.been.calledOnce() }) }) describe('`cleanAll()`', () => { it('removes a half-consumed mock', async () => { nock('http://example.test').get('/').twice().reply() await got('http://example.test/') nock.cleanAll() await assertRejects(got('http://example.test/'), err => { expect(err).to.include({ name: 'RequestError', code: 'ENOTFOUND' }) return true }) }) it('removes pending mocks from all scopes', () => { const scope1 = nock('http://example.test') .get('/somepath') .reply(200, 'hey') expect(scope1.pendingMocks()).to.deep.equal([ 'GET http://example.test:80/somepath', ]) const scope2 = nock('http://example.test') .get('/somepath') .reply(200, 'hey') expect(scope2.pendingMocks()).to.deep.equal([ 'GET http://example.test:80/somepath', ]) nock.cleanAll() expect(scope1.pendingMocks()).to.be.empty() expect(scope2.pendingMocks()).to.be.empty() }) it('removes persistent mocks', async () => { nock('http://example.test').persist().get('/').reply() nock.cleanAll() await assertRejects(got('http://example.test/'), err => { expect(err).to.include({ name: 'RequestError', code: 'ENOTFOUND', }) return true }) }) it('should be safe to call in the middle of a request', done => { // This covers a race-condition where cleanAll() is called while a request // is in mid-flight. The request itself should continue to process normally. // Notably, `cleanAll` is being called before the Interceptor is marked as // consumed and removed from the global map. Having this test wait until the // response event means we verify it didn't throw an error when attempting // to remove an Interceptor that doesn't exist in the global map `allInterceptors`. nock('http://example.test').get('/').reply() const req = http.request('http://example.test', () => { done() }) req.once('socket', () => { nock.cleanAll() }) req.end() }) }) describe('`isDone()`', () => { it('returns false while a mock is pending, and true after it is consumed', async () => { const scope = nock('http://example.test').get('/').reply() expect(nock.isDone()).to.be.false() await got('http://example.test/') expect(nock.isDone()).to.be.true() scope.done() }) }) describe('`pendingMocks()`', () => { it('returns the expected array while a mock is pending, and an empty array after it is consumed', async () => { nock('http://example.test').get('/').reply() expect(nock.pendingMocks()).to.deep.equal(['GET http://example.test:80/']) await got('http://example.test/') expect(nock.pendingMocks()).to.be.empty() }) }) describe('`activeMocks()`', () => { it('returns the expected array for incomplete mocks', () => { nock('http://example.test').get('/').reply(200) expect(nock.activeMocks()).to.deep.equal(['GET http://example.test:80/']) }) it("activeMocks doesn't return completed mocks", async () => { nock('http://example.test').get('/').reply() await got('http://example.test/') expect(nock.activeMocks()).to.be.empty() }) }) describe('resetting nock catastrophically while a request is in progress', () => { it('is handled gracefully', async () => { // While invoking cleanAll() from a nock request handler isn't very // realistic, it's possible that user code under test could crash, causing // before or after hooks to fire, which invoke `nock.cleanAll()`. A little // extreme, though if this does happen, we may as well be graceful about it. function somethingBad() { nock.cleanAll() } const responseBody = 'hi' const scope = nock('http://example.test') .get('/somepath') .reply(200, (uri, requestBody) => { somethingBad() return responseBody }) const { body } = await got('http://example.test/somepath') expect(body).to.equal(responseBody) scope.done() }) }) describe('`abortPendingRequests()`', () => { it('prevents the request from completing', done => { const onRequest = sinon.spy() nock('http://example.test').get('/').delayConnection(100).reply(200, 'OK') http.get('http://example.test', onRequest) setTimeout(() => { expect(onRequest).not.to.have.been.called() done() }, 200) process.nextTick(nock.abortPendingRequests) }) }) })
{ "pile_set_name": "Github" }
class B { x: Object; } class D extends B { public x: string; } class D2 extends B { public x: number; } var b: B; var d: D; var d2: D2; d.x = ''; b = d; b.x = 1; // assigned number to string
{ "pile_set_name": "Github" }
from __future__ import absolute_import from datetime import datetime, timedelta import six from sentry.models import GroupStatus, UserReport from sentry.testutils import APITestCase class OrganizationUserReportListTest(APITestCase): endpoint = "sentry-api-0-organization-user-feedback" method = "get" def setUp(self): self.user = self.create_user("[email protected]") self.login_as(user=self.user) self.org = self.create_organization() self.team = self.create_team(organization=self.org) self.create_member(teams=[self.team], user=self.user, organization=self.org) self.project_1 = self.create_project(organization=self.org, teams=[self.team], name="wat") self.project_2 = self.create_project(organization=self.org, teams=[self.team], name="who") self.group_1 = self.create_group(project=self.project_1) self.group_2 = self.create_group(project=self.project_1, status=GroupStatus.RESOLVED) self.env_1 = self.create_environment(name="prod", project=self.project_1) self.env_2 = self.create_environment(name="dev", project=self.project_1) self.report_1 = UserReport.objects.create( project=self.project_1, event_id="a" * 32, name="Foo", email="[email protected]", comments="Hello world", group=self.group_1, environment=self.env_1, ) # should not be included due to missing link UserReport.objects.create( project=self.project_1, event_id="b" * 32, name="Bar", email="[email protected]", comments="Hello world", ) self.report_resolved_1 = UserReport.objects.create( project=self.project_1, event_id="c" * 32, name="Baz", email="[email protected]", comments="Hello world", group=self.group_2, ) self.report_2 = UserReport.objects.create( project=self.project_2, event_id="d" * 32, name="Wat", email="[email protected]", comments="Hello world", group=self.group_1, environment=self.env_2, date_added=datetime.now() - timedelta(days=7), ) def run_test(self, expected, **params): response = self.get_response(self.project_1.organization.slug, **params) assert response.status_code == 200, response.content result_ids = set(report["id"] for report in response.data) assert result_ids == set(six.text_type(report.id) for report in expected) def test_no_filters(self): self.run_test([self.report_1, self.report_2]) def test_project_filter(self): self.run_test([self.report_1], project=[self.project_1.id]) self.run_test([self.report_2], project=[self.project_2.id]) def test_environment_filter(self): self.run_test([self.report_1], environment=[self.env_1.name]) self.run_test([self.report_2], environment=[self.env_2.name]) def test_date_filter(self): self.run_test( [self.report_1], start=(datetime.now() - timedelta(days=1)).isoformat() + "Z", end=datetime.now().isoformat() + "Z", ) self.run_test( [self.report_1, self.report_2], start=(datetime.now() - timedelta(days=8)).isoformat() + "Z", end=datetime.now().isoformat() + "Z", ) self.run_test([self.report_1, self.report_2], statsPeriod="14d") def test_all_reports(self): self.run_test([self.report_1, self.report_2, self.report_resolved_1], status="") def test_new_project(self): org2 = self.create_organization() self.team = self.create_team(organization=org2) self.create_member(teams=[self.team], user=self.user, organization=org2) response = self.get_response(org2.slug) assert response.status_code == 200, response.content assert response.data == [] def test_invalid_date_params(self): response = self.get_response( self.project_1.organization.slug, **{"start": "null", "end": "null"} ) assert response.status_code == 400
{ "pile_set_name": "Github" }
// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. import {Concat} from '../../../ops/concat'; import {Tensor} from '../../../tensor'; import * as Util from '../../../util'; import {CpuInferenceHandler} from '../inference-handler'; export class CpuConcat extends Concat { run(inferenceHandler: CpuInferenceHandler, inputs: Tensor[]): Tensor[] { const output = concat(inputs, this.axis); return [output]; } } export function concat(x: Tensor[], axis: number) { const input0 = x[0]; const inputShape = input0.dims; if (axis >= inputShape.length || axis < (-1 * inputShape.length)) { throw new Error(`axis specified for concat doesn't match input dimensionality`); } if (axis < 0) { axis = inputShape.length + axis; } // ensure all of the non-concatenated axes match each other // along the way, calculate the shape of the output tensor let concatAxisSize = inputShape[axis]; const outputShape = new Array<number>(inputShape.length); for (let i = 1; i < x.length; i++) { const dataN = x[i]; const dataNShape = dataN.dims; for (let axisIndex = 0; axisIndex < inputShape.length; axisIndex++) { // add to the placeholder for computing output shape if (axisIndex === axis) { concatAxisSize += dataNShape[axisIndex]; } // ensure all non-cancatenated axes match each other else if (inputShape[axisIndex] !== dataNShape[axisIndex]) { throw new Error(`non concat dimensions must match`); } // fill the 'outputShape' array outputShape[axisIndex] = dataNShape[axisIndex]; } } // complete the 'outputShape' array outputShape[axis] = concatAxisSize; // main logic const output = new Tensor(outputShape, input0.type); const Y = output.numberData; // the axisPitch is the number of elements to add to move // to the next split axis in the output let axisPitch = 1; for (let i = outputShape.length - 1; i >= axis; i--) { axisPitch *= outputShape[i]; } let outputBase = 0; for (let inputIndex = 0; inputIndex < x.length; inputIndex++) { const dataN = x[inputIndex]; // the inputAxisPitch is the number of elements to add // to move to the next split axis in the input let inputAxisPitch = 1; for (let i = dataN.dims.length - 1; i >= axis; i--) { inputAxisPitch *= dataN.dims[i]; } const inputData = dataN.numberData; const inputSize = Util.ShapeUtil.size(dataN.dims); // copy the data across. // for every 'inputAxisPitch' values copied, we move over by // the 'axisPitch' let outputOffset = outputBase; for (let i = 0, j = 0; i < inputSize; i++) { Y[outputOffset + i] = inputData[i]; if (++j === inputAxisPitch) { // subtract inputAxisPitch because output is being indexed by 'i' outputOffset += (axisPitch - inputAxisPitch); j = 0; } } outputBase += inputAxisPitch; } return output; }
{ "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 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. * * Copyright (c) 2012-2014, Purdue University * Copyright (c) 2013, 2018, Oracle and/or its affiliates * * All rights reserved. */ package com.oracle.truffle.r.test.builtins; import org.junit.Test; import com.oracle.truffle.r.test.TestBase; // Checkstyle: stop line length check public class TestBuiltin_substr extends TestBase { @Test public void testsubstr1() { assertEval("argv <- list('weight', 1L, 2L); .Internal(substr(argv[[1]], argv[[2]], argv[[3]]))"); } @Test public void testsubstr2() { assertEval("argv <- list(c(' ', ' '), 1L, c(4L, -16L)); .Internal(substr(argv[[1]], argv[[2]], argv[[3]]))"); } @Test public void testsubstr3() { assertEval("argv <- list(structure(c('as.formula', 'coef', 'makepredictcall', 'na.fail', 'predict'), .Names = c('as.formula', 'coef', 'makepredictcall', 'na.fail', 'predict')), 1L, 6L); .Internal(substr(argv[[1]], argv[[2]], argv[[3]]))"); } @Test public void testsubstr4() { assertEval("argv <- list(character(0), 7L, 1000000L); .Internal(substr(argv[[1]], argv[[2]], argv[[3]]))"); } @Test public void testsubstr5() { assertEval("argv <- list(structure('to be supported).', Rd_tag = 'TEXT'), 17L, 17L); .Internal(substr(argv[[1]], argv[[2]], argv[[3]]))"); } @Test public void testsubstr6() { assertEval("argv <- list(character(0), 1L, 5L); .Internal(substr(argv[[1]], argv[[2]], argv[[3]]))"); } @Test public void testsubstr7() { assertEval("argv <- list('', 1L, 2L); .Internal(substr(argv[[1]], argv[[2]], argv[[3]]))"); } @Test public void testsubstr8() { assertEval("argv <- list(structure(c('model.frame', 'predict', 'residuals'), .Names = c('model.frame', 'predict', 'residuals')), 1L, 6L); .Internal(substr(argv[[1]], argv[[2]], argv[[3]]))"); } @Test public void testsubstr9() { assertEval("argv <- list('> ### R code from vignette source \\'parallel.Rnw\\'\\n> \\n> ###################################################\\n> ### code chunk number 1: parallel.Rnw:474-475 (eval = FALSE)\\n> ###################################################\\n> ## library(parallel)\\n> \\n> \\n> ###################################################\\n> ### code chunk number 2: parallel.Rnw:500-507 (eval = FALSE)\\n> ###################################################\\n> ## library(boot)\\n> ## cd4.rg <- function(data, mle) MASS::mvrnorm(nrow(data), mle$m, mle$v)\\n> ## cd4.mle <- list(m = colMeans(cd4), v = var(cd4))\\n> ## cd4.boot <- boot(cd4, corr, R = 999, sim = \\\'parametric\\\',\\n> ## ran.gen = cd4.rg, mle = cd4.mle)\\n> ## boot.ci(cd4.boot, type = c(\\\'norm\\\', \\\'basic\\\', \\\'perc\\\'),\\n> ## conf = 0.9, h = atanh, hinv = tanh)\\n> \\n> \\n> ###################################################\\n> ### code chunk number 3: parallel.Rnw:512-522 (eval = FALSE)\\n> ###################################################\\n> ## cd4.rg <- function(data, mle) MASS::mvrnorm(nrow(data), mle$m, mle$v)\\n> ## cd4.mle <- list(m = colMeans(cd4), v = var(cd4))\\n> ## run1 <- function(...) boot(cd4, corr, R = 500, sim = \\\'parametric\\\',\\n> ## ran.gen = cd4.rg, mle = cd4.mle)\\n> ## mc <- 2 # set as appropriate for your hardware\\n> ## ## To make this reproducible:\\n> ## set.seed(123, \\\'L\\'Ecuyer\\\')\\n> ## cd4.boot <- do.call(c, mclapply(seq_len(mc), run1) )\\n> ## boot.ci(cd4.boot, type = c(\\\'norm\\\', \\\'basic\\\', \\\'perc\\\'),\\n> ## conf = 0.9, h = atanh, hinv = tanh)\\n> \\n> \\n> ###################################################\\n> ### code chunk number 4: parallel.Rnw:527-528 (eval = FALSE)\\n> ###################################################\\n> ## do.call(c, lapply(seq_len(mc), run1))\\n> \\n> \\n> ###################################################\\n> ### code chunk number 5: parallel.Rnw:532-547 (eval = FALSE)\\n> ###################################################\\n> ## run1 <- function(...) {\\n> ## library(boot)\\n> ## cd4.rg <- function(data, mle) MASS::mvrnorm(nrow(data), mle$m, mle$v)\\n> ## cd4.mle <- list(m = colMeans(cd4), v = var(cd4))\\n> ## boot(cd4, corr, R = 500, sim = \\\'parametric\\\',\\n> ## ran.gen = cd4.rg, mle = cd4.mle)\\n> ## }\\n> ## cl <- makeCluster(mc)\\n> ## ## make this reproducible\\n> ## clusterSetRNGStream(cl, 123)\\n> ## library(boot) # needed for c() method on master\\n> ## cd4.boot <- do.call(c, parLapply(cl, seq_len(mc), run1) )\\n> ## boot.ci(cd4.boot, type = c(\\\'norm\\\', \\\'basic\\\', \\\'perc\\\'),\\n> ## conf = 0.9, h = atanh, hinv = tanh)\\n> ## stopCluster(cl)\\n> \\n> \\n> ###################################################\\n> ### code chunk number 6: parallel.Rnw:557-570 (eval = FALSE)\\n> ###################################################\\n> ## cl <- makeCluster(mc)\\n> ## cd4.rg <- function(data, mle) MASS::mvrnorm(nrow(data), mle$m, mle$v)\\n> ## cd4.mle <- list(m = colMeans(cd4), v = var(cd4))\\n> ## clusterExport(cl, c(\\\'cd4.rg\\\', \\\'cd4.mle\\\'))\\n> ## junk <- clusterEvalQ(cl, library(boot)) # discard result\\n> ## clusterSetRNGStream(cl, 123)\\n> ## res <- clusterEvalQ(cl, boot(cd4, corr, R = 500,\\n> ## sim = \\\'parametric\\\', ran.gen = cd4.rg, mle = cd4.mle))\\n> ## library(boot) # needed for c() method on master\\n> ## cd4.boot <- do.call(c, res)\\n> ## boot.ci(cd4.boot, type = c(\\\'norm\\\', \\\'basic\\\', \\\'perc\\\'),\\n> ## conf = 0.9, h = atanh, hinv = tanh)\\n> ## stopCluster(cl)\\n> \\n> \\n> ###################################################\\n> ### code chunk number 7: parallel.Rnw:575-589 (eval = FALSE)\\n> ###################################################\\n> ## R <- 999; M <- 999 ## we would like at least 999 each\\n> ## cd4.nest <- boot(cd4, nested.corr, R=R, stype=\\\'w\\\', t0=corr(cd4), M=M)\\n> ## ## nested.corr is a function in package boot\\n> ## op <- par(pty = \\\'s\\\', xaxs = \\\'i\\\', yaxs = \\\'i\\\')\\n> ## qqplot((1:R)/(R+1), cd4.nest$t[, 2], pch = \\\'.\\\', asp = 1,\\n> ## xlab = \\\'nominal\\\', ylab = \\\'estimated\\\')\\n> ## abline(a = 0, b = 1, col = \\\'grey\\\')\\n> ## abline(h = 0.05, col = \\\'grey\\\')\\n> ## abline(h = 0.95, col = \\\'grey\\\')\\n> ## par(op)\\n> ## \\n> ## nominal <- (1:R)/(R+1)\\n> ## actual <- cd4.nest$t[, 2]\\n> ## 100*nominal[c(sum(actual <= 0.05), sum(actual < 0.95))]\\n> \\n> \\n> ###################################################\\n> ### code chunk number 8: parallel.Rnw:594-602 (eval = FALSE)\\n> ###################################################\\n> ## mc <- 9\\n> ## R <- 999; M <- 999; RR <- floor(R/mc)\\n> ## run2 <- function(...)\\n> ## cd4.nest <- boot(cd4, nested.corr, R=RR, stype=\\\'w\\\', t0=corr(cd4), M=M)\\n> ## cd4.nest <- do.call(c, mclapply(seq_len(mc), run2, mc.cores = mc) )\\n> ## nominal <- (1:R)/(R+1)\\n> ## actual <- cd4.nest$t[, 2]\\n> ## 100*nominal[c(sum(actual <= 0.05), sum(actual < 0.95))]\\n> \\n> \\n> ###################################################\\n> ### code chunk number 9: parallel.Rnw:616-627 (eval = FALSE)\\n> ###################################################\\n> ## library(spatial)\\n> ## towns <- ppinit(\\\'towns.dat\\\')\\n> ## tget <- function(x, r=3.5) sum(dist(cbind(x$x, x$y)) < r)\\n> ## t0 <- tget(towns)\\n> ## R <- 1000\\n> ## c <- seq(0, 1, 0.1)\\n> ## ## res[1] = 0\\n> ## res <- c(0, sapply(c[-1], function(c)\\n> ## mean(replicate(R, tget(Strauss(69, c=c, r=3.5))))))\\n> ## plot(c, res, type=\\\'l\\\', ylab=\\\'E t\\\')\\n> ## abline(h=t0, col=\\\'grey\\\')\\n> \\n> \\n> ###################################################\\n> ### code chunk number 10: parallel.Rnw:631-640 (eval = FALSE)\\n> ###################################################\\n> ## run3 <- function(c) {\\n> ## library(spatial)\\n> ## towns <- ppinit(\\\'towns.dat\\\') # has side effects\\n> ## mean(replicate(R, tget(Strauss(69, c=c, r=3.5))))\\n> ## }\\n> ## cl <- makeCluster(10, methods = FALSE)\\n> ## clusterExport(cl, c(\\\'R\\\', \\\'towns\\\', \\\'tget\\\'))\\n> ## res <- c(0, parSapply(cl, c[-1], run3)) # 10 tasks\\n> ## stopCluster(cl)\\n> \\n> \\n> ###################################################\\n> ### code chunk number 11: parallel.Rnw:644-648 (eval = FALSE)\\n> ###################################################\\n> ## cl <- makeForkCluster(10) # fork after the variables have been set up\\n> ## run4 <- function(c) mean(replicate(R, tget(Strauss(69, c=c, r=3.5))))\\n> ## res <- c(0, parSapply(cl, c[-1], run4))\\n> ## stopCluster(cl)\\n> \\n> \\n> ###################################################\\n> ### code chunk number 12: parallel.Rnw:651-653 (eval = FALSE)\\n> ###################################################\\n> ## run4 <- function(c) mean(replicate(R, tget(Strauss(69, c=c, r=3.5))))\\n> ## res <- c(0, unlist(mclapply(c[-1], run4, mc.cores = 10)))\\n> \\n> \\n> ###################################################\\n> ### code chunk number 13: parallel.Rnw:684-718 (eval = FALSE)\\n> ###################################################\\n> ## pkgs <- \\\'<names of packages to be installed>\\\'\\n> ## M <- 20 # number of parallel installs\\n> ## M <- min(M, length(pkgs))\\n> ## library(parallel)\\n> ## unlink(\\\'install_log\\\')\\n> ## cl <- makeCluster(M, outfile = \\\'install_log\\\')\\n> ## clusterExport(cl, c(\\\'tars\\\', \\\'fakes\\\', \\\'gcc\\\')) # variables needed by do_one\\n> ## \\n> ## ## set up available via a call to available.packages() for\\n> ## ## repositories containing all the packages involved and all their\\n> ## ## dependencies.\\n> ## DL <- utils:::.make_dependency_list(pkgs, available, recursive = TRUE)\\n> ## DL <- lapply(DL, function(x) x[x %in% pkgs])\\n> ## lens <- sapply(DL, length)\\n> ## ready <- names(DL[lens == 0L])\\n> ## done <- character() # packages already installed\\n> ## n <- length(ready)\\n> ## submit <- function(node, pkg)\\n> ## parallel:::sendCall(cl[[node]], do_one, list(pkg), tag = pkg)\\n> ## for (i in 1:min(n, M)) submit(i, ready[i])\\n> ## DL <- DL[!names(DL) %in% ready[1:min(n, M)]]\\n> ## av <- if(n < M) (n+1L):M else integer() # available workers\\n> ## while(length(done) < length(pkgs)) {\\n> ## d <- parallel:::recvOneResult(cl)\\n> ## av <- c(av, d$node)\\n> ## done <- c(done, d$tag)\\n> ## OK <- unlist(lapply(DL, function(x) all(x %in% done) ))\\n> ## if (!any(OK)) next\\n> ## p <- names(DL)[OK]\\n> ## m <- min(length(p), length(av)) # >= 1\\n> ## for (i in 1:m) submit(av[i], p[i])\\n> ## av <- av[-(1:m)]\\n> ## DL <- DL[!names(DL) %in% p[1:m]]\\n> ## }\\n> \\n> \\n> ###################################################\\n> ### code chunk number 14: parallel.Rnw:731-748 (eval = FALSE)\\n> ###################################################\\n> ## fn <- function(r) statistic(data, i[r, ], ...)\\n> ## RR <- sum(R)\\n> ## res <- if (ncpus > 1L && (have_mc || have_snow)) {\\n> ## if (have_mc) {\\n> ## parallel::mclapply(seq_len(RR), fn, mc.cores = ncpus)\\n> ## } else if (have_snow) {\\n> ## list(...) # evaluate any promises\\n> ## if (is.null(cl)) {\\n> ## cl <- parallel::makePSOCKcluster(rep(\\\'localhost\\\', ncpus))\\n> ## if(RNGkind()[1L] == \\\'L\\'Ecuyer-CMRG\\\')\\n> ## parallel::clusterSetRNGStream(cl)\\n> ## res <- parallel::parLapply(cl, seq_len(RR), fn)\\n> ## parallel::stopCluster(cl)\\n> ## res\\n> ## } else parallel::parLapply(cl, seq_len(RR), fn)\\n> ## }\\n> ## } else lapply(seq_len(RR), fn)\\n> \\n> \\n> ###################################################\\n> ### code chunk number 15: parallel.Rnw:751-752 (eval = FALSE)\\n> ###################################################\\n> ## list(...) # evaluate any promises\\n> \\n> ', 1L, 150L); .Internal(substr(argv[[1]], argv[[2]], argv[[3]]))"); } @Test public void testSubstring() { assertEval("{ substr(\"123456\", 2L, 4L) }"); assertEval("{ substr(\"123456\", 2, 4) }"); assertEval("{ substr(\"123456\", 4, 2) }"); assertEval("{ substr(\"123456\", 7, 8) }"); assertEval("{ substr(\"123456\", 4, 8) }"); assertEval("{ substr(\"123456\", -1, 3) }"); assertEval("{ substr(\"123456\", -5, -1) }"); assertEval("{ substr(\"123456\", -20, -100) }"); assertEval("{ substr(\"123456\", 2.8, 4) }"); assertEval("{ substr(c(\"hello\", \"bye\"), 1, 2) }"); assertEval("{ substr(c(\"hello\", \"bye\"), c(1,2,3), 4) }"); assertEval("{ substr(c(\"hello\", \"bye\"), 1, c(1,2,3)) }"); assertEval("{ substr(c(\"hello\", \"bye\"), c(1,2), c(2,3)) }"); assertEval("{ substr(1234L,2,3) }"); assertEval("{ substr(1234,2,3) }"); assertEval("{ substr(\"abcdef\",c(1,2),c(3L,5L)) }"); assertEval("{ substr(c(\"abcdef\", \"aa\"), integer(), 2) }"); assertEval("{ substr(c(\"abcdef\", \"aa\"), 2, integer()) }"); assertEval("{ substr(character(), integer(), integer()) }"); assertEval("{ substr(c(\"abcdef\", \"aa\"), NA, 4) }"); assertEval("{ substr(c(\"abcdef\", \"aa\"), 3, NA) }"); assertEval("{ substr(c(\"abcdef\", \"aa\"), c(NA,8), 4) }"); assertEval("{ substr(c(\"abcdef\", \"aa\"), c(1,NA), 4) }"); assertEval("{ substr(NA,1,2) }"); assertEval("{ substr(\"fastr\", NA, 2) }"); assertEval("{ substr(\"fastr\", 1, NA) }"); assertEval("{ x<-\"abcdef\"; substr(x,1,4)<-\"0000\"; x }"); assertEval("{ x<-\"abcdef\"; substr(x,1,3)<-\"0000\"; x }"); assertEval("{ x<-\"abcdef\"; substr(x,1,3)<-\"0\"; x }"); assertEval("{ x<-\"abcdef\"; substr(x,NA,3)<-\"0\"; x }"); assertEval("{ x<-\"abcdef\"; substr(x,1,NA)<-\"0\"; x }"); assertEval("{ x<-character(); substr(x,1,3)<-\"0\"; x }"); assertEval("{ x<-c(\"abcdef\", \"ghijklm\"); substr(x, c(1,NA), 4)<-\"0\"; x }"); assertEval(Output.ImprovedErrorContext, "{ x<-\"abcdef\"; substr(x,3,1)<-0; x }"); assertEval(Output.ImprovedErrorContext, "{ x<-\"abcdef\"; substr(x,1,3)<-character(); x }"); assertEval(Output.ImprovedErrorContext, "{ x<-\"abcdef\"; substr(x,1,3)<-NULL; x }"); assertEval(Output.ImprovedErrorContext, "{ x<-\"abcdef\"; substr(x,integer(),3)<-NULL; x }"); assertEval("{ x<-character(); substr(x,1,3)<-0; x }"); assertEval("{ x<-character(); substr(x,1,3)<-NULL; x }"); assertEval("{ x<-character(); substr(x,integer(),3)<-NULL; x }"); assertEval("{ x<-c(\"abcdef\"); substr(x[1], 2, 3)<-\"0\"; x }"); } }
{ "pile_set_name": "Github" }
{{# def.definitions }} {{# def.errors }} {{# def.setupKeyword }} {{# def.$data }} {{ var $op = $keyword == 'maxProperties' ? '>' : '<'; }} if ({{# def.$dataNotType:'number' }} Object.keys({{=$data}}).length {{=$op}} {{=$schemaValue}}) { {{ var $errorKeyword = $keyword; }} {{# def.error:'_limitProperties' }} } {{? $breakOnError }} else { {{?}}
{ "pile_set_name": "Github" }
# encoding: UTF-8 require File.join(File.dirname(__FILE__), 'lib', 'social_stream', 'oauth2_server', 'version') Gem::Specification.new do |s| s.name = "social_stream-oauth2_server" s.version = SocialStream::Oauth2Server::VERSION.dup s.authors = ["Antonio Tapiador", "GING - DIT - UPM"] s.summary = "OAuth2 server support for Social Stream, the framework for building social network websites" s.description = "Social Stream is a Ruby on Rails engine providing your application with social networking features and activity streams.\n\nThis gem supplies with OAuth2 server support" s.email = "[email protected]" s.homepage = "http://github.com/ging/social_stream-oauth2_server" s.files = `git ls-files`.split("\n") s.license = 'MIT' # Gem dependencies s.add_runtime_dependency('social_stream-base', '~> 2.2.2') s.add_runtime_dependency('rack-oauth2', '~> 1.0.0') s.add_development_dependency('rspec-rails', '~> 2.8.0') end
{ "pile_set_name": "Github" }
// Go support for Protocol Buffers - Google's data interchange format // // Copyright 2010 The Go Authors. All rights reserved. // https://github.com/golang/protobuf // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * 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. // * Neither the name of Google Inc. 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 COPYRIGHT HOLDERS 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 COPYRIGHT // OWNER 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. /* Package proto converts data structures to and from the wire format of protocol buffers. It works in concert with the Go source code generated for .proto files by the protocol compiler. A summary of the properties of the protocol buffer interface for a protocol buffer variable v: - Names are turned from camel_case to CamelCase for export. - There are no methods on v to set fields; just treat them as structure fields. - There are getters that return a field's value if set, and return the field's default value if unset. The getters work even if the receiver is a nil message. - The zero value for a struct is its correct initialization state. All desired fields must be set before marshaling. - A Reset() method will restore a protobuf struct to its zero state. - Non-repeated fields are pointers to the values; nil means unset. That is, optional or required field int32 f becomes F *int32. - Repeated fields are slices. - Helper functions are available to aid the setting of fields. msg.Foo = proto.String("hello") // set field - Constants are defined to hold the default values of all fields that have them. They have the form Default_StructName_FieldName. Because the getter methods handle defaulted values, direct use of these constants should be rare. - Enums are given type names and maps from names to values. Enum values are prefixed by the enclosing message's name, or by the enum's type name if it is a top-level enum. Enum types have a String method, and a Enum method to assist in message construction. - Nested messages, groups and enums have type names prefixed with the name of the surrounding message type. - Extensions are given descriptor names that start with E_, followed by an underscore-delimited list of the nested messages that contain it (if any) followed by the CamelCased name of the extension field itself. HasExtension, ClearExtension, GetExtension and SetExtension are functions for manipulating extensions. - Oneof field sets are given a single field in their message, with distinguished wrapper types for each possible field value. - Marshal and Unmarshal are functions to encode and decode the wire format. When the .proto file specifies `syntax="proto3"`, there are some differences: - Non-repeated fields of non-message type are values instead of pointers. - Enum types do not get an Enum method. The simplest way to describe this is to see an example. Given file test.proto, containing package example; enum FOO { X = 17; } message Test { required string label = 1; optional int32 type = 2 [default=77]; repeated int64 reps = 3; optional group OptionalGroup = 4 { required string RequiredField = 5; } oneof union { int32 number = 6; string name = 7; } } The resulting file, test.pb.go, is: package example import proto "github.com/golang/protobuf/proto" import math "math" type FOO int32 const ( FOO_X FOO = 17 ) var FOO_name = map[int32]string{ 17: "X", } var FOO_value = map[string]int32{ "X": 17, } func (x FOO) Enum() *FOO { p := new(FOO) *p = x return p } func (x FOO) String() string { return proto.EnumName(FOO_name, int32(x)) } func (x *FOO) UnmarshalJSON(data []byte) error { value, err := proto.UnmarshalJSONEnum(FOO_value, data) if err != nil { return err } *x = FOO(value) return nil } type Test struct { Label *string `protobuf:"bytes,1,req,name=label" json:"label,omitempty"` Type *int32 `protobuf:"varint,2,opt,name=type,def=77" json:"type,omitempty"` Reps []int64 `protobuf:"varint,3,rep,name=reps" json:"reps,omitempty"` Optionalgroup *Test_OptionalGroup `protobuf:"group,4,opt,name=OptionalGroup" json:"optionalgroup,omitempty"` // Types that are valid to be assigned to Union: // *Test_Number // *Test_Name Union isTest_Union `protobuf_oneof:"union"` XXX_unrecognized []byte `json:"-"` } func (m *Test) Reset() { *m = Test{} } func (m *Test) String() string { return proto.CompactTextString(m) } func (*Test) ProtoMessage() {} type isTest_Union interface { isTest_Union() } type Test_Number struct { Number int32 `protobuf:"varint,6,opt,name=number"` } type Test_Name struct { Name string `protobuf:"bytes,7,opt,name=name"` } func (*Test_Number) isTest_Union() {} func (*Test_Name) isTest_Union() {} func (m *Test) GetUnion() isTest_Union { if m != nil { return m.Union } return nil } const Default_Test_Type int32 = 77 func (m *Test) GetLabel() string { if m != nil && m.Label != nil { return *m.Label } return "" } func (m *Test) GetType() int32 { if m != nil && m.Type != nil { return *m.Type } return Default_Test_Type } func (m *Test) GetOptionalgroup() *Test_OptionalGroup { if m != nil { return m.Optionalgroup } return nil } type Test_OptionalGroup struct { RequiredField *string `protobuf:"bytes,5,req" json:"RequiredField,omitempty"` } func (m *Test_OptionalGroup) Reset() { *m = Test_OptionalGroup{} } func (m *Test_OptionalGroup) String() string { return proto.CompactTextString(m) } func (m *Test_OptionalGroup) GetRequiredField() string { if m != nil && m.RequiredField != nil { return *m.RequiredField } return "" } func (m *Test) GetNumber() int32 { if x, ok := m.GetUnion().(*Test_Number); ok { return x.Number } return 0 } func (m *Test) GetName() string { if x, ok := m.GetUnion().(*Test_Name); ok { return x.Name } return "" } func init() { proto.RegisterEnum("example.FOO", FOO_name, FOO_value) } To create and play with a Test object: package main import ( "log" "github.com/golang/protobuf/proto" pb "./example.pb" ) func main() { test := &pb.Test{ Label: proto.String("hello"), Type: proto.Int32(17), Reps: []int64{1, 2, 3}, Optionalgroup: &pb.Test_OptionalGroup{ RequiredField: proto.String("good bye"), }, Union: &pb.Test_Name{"fred"}, } data, err := proto.Marshal(test) if err != nil { log.Fatal("marshaling error: ", err) } newTest := &pb.Test{} err = proto.Unmarshal(data, newTest) if err != nil { log.Fatal("unmarshaling error: ", err) } // Now test and newTest contain the same data. if test.GetLabel() != newTest.GetLabel() { log.Fatalf("data mismatch %q != %q", test.GetLabel(), newTest.GetLabel()) } // Use a type switch to determine which oneof was set. switch u := test.Union.(type) { case *pb.Test_Number: // u.Number contains the number. case *pb.Test_Name: // u.Name contains the string. } // etc. } */ package proto import ( "encoding/json" "fmt" "log" "reflect" "sort" "strconv" "sync" ) // RequiredNotSetError is an error type returned by either Marshal or Unmarshal. // Marshal reports this when a required field is not initialized. // Unmarshal reports this when a required field is missing from the wire data. type RequiredNotSetError struct{ field string } func (e *RequiredNotSetError) Error() string { if e.field == "" { return fmt.Sprintf("proto: required field not set") } return fmt.Sprintf("proto: required field %q not set", e.field) } func (e *RequiredNotSetError) RequiredNotSet() bool { return true } type invalidUTF8Error struct{ field string } func (e *invalidUTF8Error) Error() string { if e.field == "" { return "proto: invalid UTF-8 detected" } return fmt.Sprintf("proto: field %q contains invalid UTF-8", e.field) } func (e *invalidUTF8Error) InvalidUTF8() bool { return true } // errInvalidUTF8 is a sentinel error to identify fields with invalid UTF-8. // This error should not be exposed to the external API as such errors should // be recreated with the field information. var errInvalidUTF8 = &invalidUTF8Error{} // isNonFatal reports whether the error is either a RequiredNotSet error // or a InvalidUTF8 error. func isNonFatal(err error) bool { if re, ok := err.(interface{ RequiredNotSet() bool }); ok && re.RequiredNotSet() { return true } if re, ok := err.(interface{ InvalidUTF8() bool }); ok && re.InvalidUTF8() { return true } return false } type nonFatal struct{ E error } // Merge merges err into nf and reports whether it was successful. // Otherwise it returns false for any fatal non-nil errors. func (nf *nonFatal) Merge(err error) (ok bool) { if err == nil { return true // not an error } if !isNonFatal(err) { return false // fatal error } if nf.E == nil { nf.E = err // store first instance of non-fatal error } return true } // Message is implemented by generated protocol buffer messages. type Message interface { Reset() String() string ProtoMessage() } // A Buffer is a buffer manager for marshaling and unmarshaling // protocol buffers. It may be reused between invocations to // reduce memory usage. It is not necessary to use a Buffer; // the global functions Marshal and Unmarshal create a // temporary Buffer and are fine for most applications. type Buffer struct { buf []byte // encode/decode byte stream index int // read point deterministic bool } // NewBuffer allocates a new Buffer and initializes its internal data to // the contents of the argument slice. func NewBuffer(e []byte) *Buffer { return &Buffer{buf: e} } // Reset resets the Buffer, ready for marshaling a new protocol buffer. func (p *Buffer) Reset() { p.buf = p.buf[0:0] // for reading/writing p.index = 0 // for reading } // SetBuf replaces the internal buffer with the slice, // ready for unmarshaling the contents of the slice. func (p *Buffer) SetBuf(s []byte) { p.buf = s p.index = 0 } // Bytes returns the contents of the Buffer. func (p *Buffer) Bytes() []byte { return p.buf } // SetDeterministic sets whether to use deterministic serialization. // // Deterministic serialization guarantees that for a given binary, equal // messages will always be serialized to the same bytes. This implies: // // - Repeated serialization of a message will return the same bytes. // - Different processes of the same binary (which may be executing on // different machines) will serialize equal messages to the same bytes. // // Note that the deterministic serialization is NOT canonical across // languages. It is not guaranteed to remain stable over time. It is unstable // across different builds with schema changes due to unknown fields. // Users who need canonical serialization (e.g., persistent storage in a // canonical form, fingerprinting, etc.) should define their own // canonicalization specification and implement their own serializer rather // than relying on this API. // // If deterministic serialization is requested, map entries will be sorted // by keys in lexographical order. This is an implementation detail and // subject to change. func (p *Buffer) SetDeterministic(deterministic bool) { p.deterministic = deterministic } /* * Helper routines for simplifying the creation of optional fields of basic type. */ // Bool is a helper routine that allocates a new bool value // to store v and returns a pointer to it. func Bool(v bool) *bool { return &v } // Int32 is a helper routine that allocates a new int32 value // to store v and returns a pointer to it. func Int32(v int32) *int32 { return &v } // Int is a helper routine that allocates a new int32 value // to store v and returns a pointer to it, but unlike Int32 // its argument value is an int. func Int(v int) *int32 { p := new(int32) *p = int32(v) return p } // Int64 is a helper routine that allocates a new int64 value // to store v and returns a pointer to it. func Int64(v int64) *int64 { return &v } // Float32 is a helper routine that allocates a new float32 value // to store v and returns a pointer to it. func Float32(v float32) *float32 { return &v } // Float64 is a helper routine that allocates a new float64 value // to store v and returns a pointer to it. func Float64(v float64) *float64 { return &v } // Uint32 is a helper routine that allocates a new uint32 value // to store v and returns a pointer to it. func Uint32(v uint32) *uint32 { return &v } // Uint64 is a helper routine that allocates a new uint64 value // to store v and returns a pointer to it. func Uint64(v uint64) *uint64 { return &v } // String is a helper routine that allocates a new string value // to store v and returns a pointer to it. func String(v string) *string { return &v } // EnumName is a helper function to simplify printing protocol buffer enums // by name. Given an enum map and a value, it returns a useful string. func EnumName(m map[int32]string, v int32) string { s, ok := m[v] if ok { return s } return strconv.Itoa(int(v)) } // UnmarshalJSONEnum is a helper function to simplify recovering enum int values // from their JSON-encoded representation. Given a map from the enum's symbolic // names to its int values, and a byte buffer containing the JSON-encoded // value, it returns an int32 that can be cast to the enum type by the caller. // // The function can deal with both JSON representations, numeric and symbolic. func UnmarshalJSONEnum(m map[string]int32, data []byte, enumName string) (int32, error) { if data[0] == '"' { // New style: enums are strings. var repr string if err := json.Unmarshal(data, &repr); err != nil { return -1, err } val, ok := m[repr] if !ok { return 0, fmt.Errorf("unrecognized enum %s value %q", enumName, repr) } return val, nil } // Old style: enums are ints. var val int32 if err := json.Unmarshal(data, &val); err != nil { return 0, fmt.Errorf("cannot unmarshal %#q into enum %s", data, enumName) } return val, nil } // DebugPrint dumps the encoded data in b in a debugging format with a header // including the string s. Used in testing but made available for general debugging. func (p *Buffer) DebugPrint(s string, b []byte) { var u uint64 obuf := p.buf index := p.index p.buf = b p.index = 0 depth := 0 fmt.Printf("\n--- %s ---\n", s) out: for { for i := 0; i < depth; i++ { fmt.Print(" ") } index := p.index if index == len(p.buf) { break } op, err := p.DecodeVarint() if err != nil { fmt.Printf("%3d: fetching op err %v\n", index, err) break out } tag := op >> 3 wire := op & 7 switch wire { default: fmt.Printf("%3d: t=%3d unknown wire=%d\n", index, tag, wire) break out case WireBytes: var r []byte r, err = p.DecodeRawBytes(false) if err != nil { break out } fmt.Printf("%3d: t=%3d bytes [%d]", index, tag, len(r)) if len(r) <= 6 { for i := 0; i < len(r); i++ { fmt.Printf(" %.2x", r[i]) } } else { for i := 0; i < 3; i++ { fmt.Printf(" %.2x", r[i]) } fmt.Printf(" ..") for i := len(r) - 3; i < len(r); i++ { fmt.Printf(" %.2x", r[i]) } } fmt.Printf("\n") case WireFixed32: u, err = p.DecodeFixed32() if err != nil { fmt.Printf("%3d: t=%3d fix32 err %v\n", index, tag, err) break out } fmt.Printf("%3d: t=%3d fix32 %d\n", index, tag, u) case WireFixed64: u, err = p.DecodeFixed64() if err != nil { fmt.Printf("%3d: t=%3d fix64 err %v\n", index, tag, err) break out } fmt.Printf("%3d: t=%3d fix64 %d\n", index, tag, u) case WireVarint: u, err = p.DecodeVarint() if err != nil { fmt.Printf("%3d: t=%3d varint err %v\n", index, tag, err) break out } fmt.Printf("%3d: t=%3d varint %d\n", index, tag, u) case WireStartGroup: fmt.Printf("%3d: t=%3d start\n", index, tag) depth++ case WireEndGroup: depth-- fmt.Printf("%3d: t=%3d end\n", index, tag) } } if depth != 0 { fmt.Printf("%3d: start-end not balanced %d\n", p.index, depth) } fmt.Printf("\n") p.buf = obuf p.index = index } // SetDefaults sets unset protocol buffer fields to their default values. // It only modifies fields that are both unset and have defined defaults. // It recursively sets default values in any non-nil sub-messages. func SetDefaults(pb Message) { setDefaults(reflect.ValueOf(pb), true, false) } // v is a pointer to a struct. func setDefaults(v reflect.Value, recur, zeros bool) { v = v.Elem() defaultMu.RLock() dm, ok := defaults[v.Type()] defaultMu.RUnlock() if !ok { dm = buildDefaultMessage(v.Type()) defaultMu.Lock() defaults[v.Type()] = dm defaultMu.Unlock() } for _, sf := range dm.scalars { f := v.Field(sf.index) if !f.IsNil() { // field already set continue } dv := sf.value if dv == nil && !zeros { // no explicit default, and don't want to set zeros continue } fptr := f.Addr().Interface() // **T // TODO: Consider batching the allocations we do here. switch sf.kind { case reflect.Bool: b := new(bool) if dv != nil { *b = dv.(bool) } *(fptr.(**bool)) = b case reflect.Float32: f := new(float32) if dv != nil { *f = dv.(float32) } *(fptr.(**float32)) = f case reflect.Float64: f := new(float64) if dv != nil { *f = dv.(float64) } *(fptr.(**float64)) = f case reflect.Int32: // might be an enum if ft := f.Type(); ft != int32PtrType { // enum f.Set(reflect.New(ft.Elem())) if dv != nil { f.Elem().SetInt(int64(dv.(int32))) } } else { // int32 field i := new(int32) if dv != nil { *i = dv.(int32) } *(fptr.(**int32)) = i } case reflect.Int64: i := new(int64) if dv != nil { *i = dv.(int64) } *(fptr.(**int64)) = i case reflect.String: s := new(string) if dv != nil { *s = dv.(string) } *(fptr.(**string)) = s case reflect.Uint8: // exceptional case: []byte var b []byte if dv != nil { db := dv.([]byte) b = make([]byte, len(db)) copy(b, db) } else { b = []byte{} } *(fptr.(*[]byte)) = b case reflect.Uint32: u := new(uint32) if dv != nil { *u = dv.(uint32) } *(fptr.(**uint32)) = u case reflect.Uint64: u := new(uint64) if dv != nil { *u = dv.(uint64) } *(fptr.(**uint64)) = u default: log.Printf("proto: can't set default for field %v (sf.kind=%v)", f, sf.kind) } } for _, ni := range dm.nested { f := v.Field(ni) // f is *T or []*T or map[T]*T switch f.Kind() { case reflect.Ptr: if f.IsNil() { continue } setDefaults(f, recur, zeros) case reflect.Slice: for i := 0; i < f.Len(); i++ { e := f.Index(i) if e.IsNil() { continue } setDefaults(e, recur, zeros) } case reflect.Map: for _, k := range f.MapKeys() { e := f.MapIndex(k) if e.IsNil() { continue } setDefaults(e, recur, zeros) } } } } var ( // defaults maps a protocol buffer struct type to a slice of the fields, // with its scalar fields set to their proto-declared non-zero default values. defaultMu sync.RWMutex defaults = make(map[reflect.Type]defaultMessage) int32PtrType = reflect.TypeOf((*int32)(nil)) ) // defaultMessage represents information about the default values of a message. type defaultMessage struct { scalars []scalarField nested []int // struct field index of nested messages } type scalarField struct { index int // struct field index kind reflect.Kind // element type (the T in *T or []T) value interface{} // the proto-declared default value, or nil } // t is a struct type. func buildDefaultMessage(t reflect.Type) (dm defaultMessage) { sprop := GetProperties(t) for _, prop := range sprop.Prop { fi, ok := sprop.decoderTags.get(prop.Tag) if !ok { // XXX_unrecognized continue } ft := t.Field(fi).Type sf, nested, err := fieldDefault(ft, prop) switch { case err != nil: log.Print(err) case nested: dm.nested = append(dm.nested, fi) case sf != nil: sf.index = fi dm.scalars = append(dm.scalars, *sf) } } return dm } // fieldDefault returns the scalarField for field type ft. // sf will be nil if the field can not have a default. // nestedMessage will be true if this is a nested message. // Note that sf.index is not set on return. func fieldDefault(ft reflect.Type, prop *Properties) (sf *scalarField, nestedMessage bool, err error) { var canHaveDefault bool switch ft.Kind() { case reflect.Ptr: if ft.Elem().Kind() == reflect.Struct { nestedMessage = true } else { canHaveDefault = true // proto2 scalar field } case reflect.Slice: switch ft.Elem().Kind() { case reflect.Ptr: nestedMessage = true // repeated message case reflect.Uint8: canHaveDefault = true // bytes field } case reflect.Map: if ft.Elem().Kind() == reflect.Ptr { nestedMessage = true // map with message values } } if !canHaveDefault { if nestedMessage { return nil, true, nil } return nil, false, nil } // We now know that ft is a pointer or slice. sf = &scalarField{kind: ft.Elem().Kind()} // scalar fields without defaults if !prop.HasDefault { return sf, false, nil } // a scalar field: either *T or []byte switch ft.Elem().Kind() { case reflect.Bool: x, err := strconv.ParseBool(prop.Default) if err != nil { return nil, false, fmt.Errorf("proto: bad default bool %q: %v", prop.Default, err) } sf.value = x case reflect.Float32: x, err := strconv.ParseFloat(prop.Default, 32) if err != nil { return nil, false, fmt.Errorf("proto: bad default float32 %q: %v", prop.Default, err) } sf.value = float32(x) case reflect.Float64: x, err := strconv.ParseFloat(prop.Default, 64) if err != nil { return nil, false, fmt.Errorf("proto: bad default float64 %q: %v", prop.Default, err) } sf.value = x case reflect.Int32: x, err := strconv.ParseInt(prop.Default, 10, 32) if err != nil { return nil, false, fmt.Errorf("proto: bad default int32 %q: %v", prop.Default, err) } sf.value = int32(x) case reflect.Int64: x, err := strconv.ParseInt(prop.Default, 10, 64) if err != nil { return nil, false, fmt.Errorf("proto: bad default int64 %q: %v", prop.Default, err) } sf.value = x case reflect.String: sf.value = prop.Default case reflect.Uint8: // []byte (not *uint8) sf.value = []byte(prop.Default) case reflect.Uint32: x, err := strconv.ParseUint(prop.Default, 10, 32) if err != nil { return nil, false, fmt.Errorf("proto: bad default uint32 %q: %v", prop.Default, err) } sf.value = uint32(x) case reflect.Uint64: x, err := strconv.ParseUint(prop.Default, 10, 64) if err != nil { return nil, false, fmt.Errorf("proto: bad default uint64 %q: %v", prop.Default, err) } sf.value = x default: return nil, false, fmt.Errorf("proto: unhandled def kind %v", ft.Elem().Kind()) } return sf, false, nil } // mapKeys returns a sort.Interface to be used for sorting the map keys. // Map fields may have key types of non-float scalars, strings and enums. func mapKeys(vs []reflect.Value) sort.Interface { s := mapKeySorter{vs: vs} // Type specialization per https://developers.google.com/protocol-buffers/docs/proto#maps. if len(vs) == 0 { return s } switch vs[0].Kind() { case reflect.Int32, reflect.Int64: s.less = func(a, b reflect.Value) bool { return a.Int() < b.Int() } case reflect.Uint32, reflect.Uint64: s.less = func(a, b reflect.Value) bool { return a.Uint() < b.Uint() } case reflect.Bool: s.less = func(a, b reflect.Value) bool { return !a.Bool() && b.Bool() } // false < true case reflect.String: s.less = func(a, b reflect.Value) bool { return a.String() < b.String() } default: panic(fmt.Sprintf("unsupported map key type: %v", vs[0].Kind())) } return s } type mapKeySorter struct { vs []reflect.Value less func(a, b reflect.Value) bool } func (s mapKeySorter) Len() int { return len(s.vs) } func (s mapKeySorter) Swap(i, j int) { s.vs[i], s.vs[j] = s.vs[j], s.vs[i] } func (s mapKeySorter) Less(i, j int) bool { return s.less(s.vs[i], s.vs[j]) } // isProto3Zero reports whether v is a zero proto3 value. func isProto3Zero(v reflect.Value) bool { switch v.Kind() { case reflect.Bool: return !v.Bool() case reflect.Int32, reflect.Int64: return v.Int() == 0 case reflect.Uint32, reflect.Uint64: return v.Uint() == 0 case reflect.Float32, reflect.Float64: return v.Float() == 0 case reflect.String: return v.String() == "" } return false } const ( // ProtoPackageIsVersion3 is referenced from generated protocol buffer files // to assert that that code is compatible with this version of the proto package. ProtoPackageIsVersion3 = true // ProtoPackageIsVersion2 is referenced from generated protocol buffer files // to assert that that code is compatible with this version of the proto package. ProtoPackageIsVersion2 = true // ProtoPackageIsVersion1 is referenced from generated protocol buffer files // to assert that that code is compatible with this version of the proto package. ProtoPackageIsVersion1 = true ) // InternalMessageInfo is a type used internally by generated .pb.go files. // This type is not intended to be used by non-generated code. // This type is not subject to any compatibility guarantee. type InternalMessageInfo struct { marshal *marshalInfo unmarshal *unmarshalInfo merge *mergeInfo discard *discardInfo }
{ "pile_set_name": "Github" }
/* Copyright (c) 2012, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and * only version 2 as published 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. */ #ifndef MSM_JPEG_COMMON_H #define MSM_JPEG_COMMON_H #ifdef MSM_JPEG_DEBUG #define JPEG_DBG(fmt, args...) pr_info(fmt, ##args) #else #define JPEG_DBG(fmt, args...) do { } while (0) #endif #define JPEG_PR_ERR pr_err #define JPEG_DBG_HIGH pr_err enum JPEG_MODE { JPEG_MODE_DISABLE, JPEG_MODE_OFFLINE, JPEG_MODE_REALTIME, JPEG_MODE_REALTIME_ROTATION }; enum JPEG_ROTATION { JPEG_ROTATION_0, JPEG_ROTATION_90, JPEG_ROTATION_180, JPEG_ROTATION_270 }; #endif /* MSM_JPEG_COMMON_H */
{ "pile_set_name": "Github" }
#Fri Jun 23 08:50:38 CEST 2017 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
{ "pile_set_name": "Github" }
rule malware_multi_vesche_basicrat { meta: description = "cross-platform Python 2.x Remote Access Trojan (RAT)" reference = "https://github.com/vesche/basicRAT" author = "@mimeframe" strings: $a1 = "HKCU Run registry key applied" wide ascii $a2 = "HKCU Run registry key failed" wide ascii $a3 = "Error, platform unsupported." wide ascii $a4 = "Persistence successful," wide ascii $a5 = "Persistence unsuccessful," wide ascii condition: all of ($a*) }
{ "pile_set_name": "Github" }
""" Copyright (C) 2018-2020 Intel Corporation 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. """ from mo.front.extractor import FrontExtractorOp from mo.front.mxnet.extractors.utils import get_mxnet_layer_attrs from mo.ops.squeeze import Squeeze class SqueezeExtractor(FrontExtractorOp): op = 'squeeze' enabled = True @classmethod def extract(cls, node): attrs = get_mxnet_layer_attrs(node.symbol_dict) Squeeze.update_node_stat(node, {'squeeze_dims': attrs.int("axis", None), 'keep_at_least_1d': True}) return cls.enabled
{ "pile_set_name": "Github" }
### `normalize()` The *normalize* reset makes browsers render all elements more consistently and in line with modern standards. For more information, refers to the [original normalize repository](https://github.com/necolas/normalize.css), by [Nicolas Gallagher](https://github.com/necolas). > **Note:** Kouto Swiss include normalize version `5.0.0` #### Example ##### Usage ```stylus normalize() ``` ##### Result ```css html { font-family: sans-serif; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; } body { margin: 0; } article, aside, details, figcaption, figure, footer, header, hgroup, main, nav, section, summary { display: block; } audio, canvas, progress, video { display: inline-block; vertical-align: baseline; } audio:not([controls]) { display: none; height: 0; } [hidden], template { display: none; } a { background: transparent; } a:active, a:hover { outline: 0; } abbr[title] { border-bottom: 1px dotted; } b, strong { font-weight: bold; } dfn { font-style: italic; } h1 { font-size: 2em; margin: 0.67em 0; } mark { background: #ff0; color: #000; } small { font-size: 80%; } sub, sup { font-size: 75%; line-height: 0; position: relative; vertical-align: baseline; } sup { top: -0.5em; } sub { bottom: -0.25em; } img { border: 0; } svg:not(:root) { overflow: hidden; } figure { margin: 1em 40px; } hr { -webkit-box-sizing: content-box; -moz-box-sizing: content-box; box-sizing: content-box; height: 0; } pre { overflow: auto; } code, kbd, pre, samp { font-family: monospace, monospace; font-size: 1em; } button, input, optgroup, select, textarea { color: inherit; font: inherit; margin: 0; } button { overflow: visible; } button, select { text-transform: none; } button, html input[type="button"], input[type="reset"], input[type="submit"] { -webkit-appearance: button; cursor: pointer; } button[disabled], html input[disabled] { cursor: default; } button::-moz-focus-inner, input::-moz-focus-inner { border: 0; padding: 0; } input { line-height: normal; } input[type="checkbox"], input[type="radio"] { -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; padding: 0; } input[type="number"]::-webkit-inner-spin-button, input[type="number"]::-webkit-outer-spin-button { height: auto; } input[type="search"] { -webkit-appearance: textfield; -webkit-box-sizing: content-box; -moz-box-sizing: content-box; box-sizing: content-box; } input[type="search"]::-webkit-search-cancel-button, input[type="search"]::-webkit-search-decoration { -webkit-appearance: none; } fieldset { border: 1px solid #c0c0c0; margin: 0 2px; padding: 0.35em 0.625em 0.75em; } legend { border: 0; padding: 0; } textarea { overflow: auto; } optgroup { font-weight: bold; } table { border-collapse: collapse; border-spacing: 0; } td, th { padding: 0; } ```
{ "pile_set_name": "Github" }
{ "collections": {}, "config": { "id": "36a3b0b5-bad0-4a04-b79b-441c7cef77db", "label": "BetterBibTeX JSON", "options": { "Export collections": false, "exportFileData": false, "exportNotes": true }, "preferences": { "bibtexURL": "note", "citekeyFormat": "[auth][year]", "jabrefFormat": 0 }, "release": "0.7.6" }, "items": [ { "accessDate": "2015-01-31 16:24:56", "attachments": [], "creators": [ { "creatorType": "author", "fieldMode": "", "firstName": "John", "lastName": "MacFarlane" } ], "extra": "bibtex: MacFarlaneJohna\nbiblatexdata[referencetype=archived]", "itemID": 389, "itemType": "webpage", "title": "Pandoc User\u2019s Guide", "url": "http://johnmacfarlane.net/pandoc/README.html#citations" } ] }
{ "pile_set_name": "Github" }
// SPDX-License-Identifier: GPL-2.0-only /****************************************************************************** ******************************************************************************* ** ** Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved. ** Copyright (C) 2004-2011 Red Hat, Inc. All rights reserved. ** ** ******************************************************************************* ******************************************************************************/ #include <linux/module.h> #include "dlm_internal.h" #include "lockspace.h" #include "member.h" #include "recoverd.h" #include "dir.h" #include "lowcomms.h" #include "config.h" #include "memory.h" #include "lock.h" #include "recover.h" #include "requestqueue.h" #include "user.h" #include "ast.h" static int ls_count; static struct mutex ls_lock; static struct list_head lslist; static spinlock_t lslist_lock; static struct task_struct * scand_task; static ssize_t dlm_control_store(struct dlm_ls *ls, const char *buf, size_t len) { ssize_t ret = len; int n; int rc = kstrtoint(buf, 0, &n); if (rc) return rc; ls = dlm_find_lockspace_local(ls->ls_local_handle); if (!ls) return -EINVAL; switch (n) { case 0: dlm_ls_stop(ls); break; case 1: dlm_ls_start(ls); break; default: ret = -EINVAL; } dlm_put_lockspace(ls); return ret; } static ssize_t dlm_event_store(struct dlm_ls *ls, const char *buf, size_t len) { int rc = kstrtoint(buf, 0, &ls->ls_uevent_result); if (rc) return rc; set_bit(LSFL_UEVENT_WAIT, &ls->ls_flags); wake_up(&ls->ls_uevent_wait); return len; } static ssize_t dlm_id_show(struct dlm_ls *ls, char *buf) { return snprintf(buf, PAGE_SIZE, "%u\n", ls->ls_global_id); } static ssize_t dlm_id_store(struct dlm_ls *ls, const char *buf, size_t len) { int rc = kstrtouint(buf, 0, &ls->ls_global_id); if (rc) return rc; return len; } static ssize_t dlm_nodir_show(struct dlm_ls *ls, char *buf) { return snprintf(buf, PAGE_SIZE, "%u\n", dlm_no_directory(ls)); } static ssize_t dlm_nodir_store(struct dlm_ls *ls, const char *buf, size_t len) { int val; int rc = kstrtoint(buf, 0, &val); if (rc) return rc; if (val == 1) set_bit(LSFL_NODIR, &ls->ls_flags); return len; } static ssize_t dlm_recover_status_show(struct dlm_ls *ls, char *buf) { uint32_t status = dlm_recover_status(ls); return snprintf(buf, PAGE_SIZE, "%x\n", status); } static ssize_t dlm_recover_nodeid_show(struct dlm_ls *ls, char *buf) { return snprintf(buf, PAGE_SIZE, "%d\n", ls->ls_recover_nodeid); } struct dlm_attr { struct attribute attr; ssize_t (*show)(struct dlm_ls *, char *); ssize_t (*store)(struct dlm_ls *, const char *, size_t); }; static struct dlm_attr dlm_attr_control = { .attr = {.name = "control", .mode = S_IWUSR}, .store = dlm_control_store }; static struct dlm_attr dlm_attr_event = { .attr = {.name = "event_done", .mode = S_IWUSR}, .store = dlm_event_store }; static struct dlm_attr dlm_attr_id = { .attr = {.name = "id", .mode = S_IRUGO | S_IWUSR}, .show = dlm_id_show, .store = dlm_id_store }; static struct dlm_attr dlm_attr_nodir = { .attr = {.name = "nodir", .mode = S_IRUGO | S_IWUSR}, .show = dlm_nodir_show, .store = dlm_nodir_store }; static struct dlm_attr dlm_attr_recover_status = { .attr = {.name = "recover_status", .mode = S_IRUGO}, .show = dlm_recover_status_show }; static struct dlm_attr dlm_attr_recover_nodeid = { .attr = {.name = "recover_nodeid", .mode = S_IRUGO}, .show = dlm_recover_nodeid_show }; static struct attribute *dlm_attrs[] = { &dlm_attr_control.attr, &dlm_attr_event.attr, &dlm_attr_id.attr, &dlm_attr_nodir.attr, &dlm_attr_recover_status.attr, &dlm_attr_recover_nodeid.attr, NULL, }; ATTRIBUTE_GROUPS(dlm); static ssize_t dlm_attr_show(struct kobject *kobj, struct attribute *attr, char *buf) { struct dlm_ls *ls = container_of(kobj, struct dlm_ls, ls_kobj); struct dlm_attr *a = container_of(attr, struct dlm_attr, attr); return a->show ? a->show(ls, buf) : 0; } static ssize_t dlm_attr_store(struct kobject *kobj, struct attribute *attr, const char *buf, size_t len) { struct dlm_ls *ls = container_of(kobj, struct dlm_ls, ls_kobj); struct dlm_attr *a = container_of(attr, struct dlm_attr, attr); return a->store ? a->store(ls, buf, len) : len; } static void lockspace_kobj_release(struct kobject *k) { struct dlm_ls *ls = container_of(k, struct dlm_ls, ls_kobj); kfree(ls); } static const struct sysfs_ops dlm_attr_ops = { .show = dlm_attr_show, .store = dlm_attr_store, }; static struct kobj_type dlm_ktype = { .default_groups = dlm_groups, .sysfs_ops = &dlm_attr_ops, .release = lockspace_kobj_release, }; static struct kset *dlm_kset; static int do_uevent(struct dlm_ls *ls, int in) { if (in) kobject_uevent(&ls->ls_kobj, KOBJ_ONLINE); else kobject_uevent(&ls->ls_kobj, KOBJ_OFFLINE); log_rinfo(ls, "%s the lockspace group...", in ? "joining" : "leaving"); /* dlm_controld will see the uevent, do the necessary group management and then write to sysfs to wake us */ wait_event(ls->ls_uevent_wait, test_and_clear_bit(LSFL_UEVENT_WAIT, &ls->ls_flags)); log_rinfo(ls, "group event done %d", ls->ls_uevent_result); return ls->ls_uevent_result; } static int dlm_uevent(struct kset *kset, struct kobject *kobj, struct kobj_uevent_env *env) { struct dlm_ls *ls = container_of(kobj, struct dlm_ls, ls_kobj); add_uevent_var(env, "LOCKSPACE=%s", ls->ls_name); return 0; } static const struct kset_uevent_ops dlm_uevent_ops = { .uevent = dlm_uevent, }; int __init dlm_lockspace_init(void) { ls_count = 0; mutex_init(&ls_lock); INIT_LIST_HEAD(&lslist); spin_lock_init(&lslist_lock); dlm_kset = kset_create_and_add("dlm", &dlm_uevent_ops, kernel_kobj); if (!dlm_kset) { printk(KERN_WARNING "%s: can not create kset\n", __func__); return -ENOMEM; } return 0; } void dlm_lockspace_exit(void) { kset_unregister(dlm_kset); } static struct dlm_ls *find_ls_to_scan(void) { struct dlm_ls *ls; spin_lock(&lslist_lock); list_for_each_entry(ls, &lslist, ls_list) { if (time_after_eq(jiffies, ls->ls_scan_time + dlm_config.ci_scan_secs * HZ)) { spin_unlock(&lslist_lock); return ls; } } spin_unlock(&lslist_lock); return NULL; } static int dlm_scand(void *data) { struct dlm_ls *ls; while (!kthread_should_stop()) { ls = find_ls_to_scan(); if (ls) { if (dlm_lock_recovery_try(ls)) { ls->ls_scan_time = jiffies; dlm_scan_rsbs(ls); dlm_scan_timeout(ls); dlm_scan_waiters(ls); dlm_unlock_recovery(ls); } else { ls->ls_scan_time += HZ; } continue; } schedule_timeout_interruptible(dlm_config.ci_scan_secs * HZ); } return 0; } static int dlm_scand_start(void) { struct task_struct *p; int error = 0; p = kthread_run(dlm_scand, NULL, "dlm_scand"); if (IS_ERR(p)) error = PTR_ERR(p); else scand_task = p; return error; } static void dlm_scand_stop(void) { kthread_stop(scand_task); } struct dlm_ls *dlm_find_lockspace_global(uint32_t id) { struct dlm_ls *ls; spin_lock(&lslist_lock); list_for_each_entry(ls, &lslist, ls_list) { if (ls->ls_global_id == id) { ls->ls_count++; goto out; } } ls = NULL; out: spin_unlock(&lslist_lock); return ls; } struct dlm_ls *dlm_find_lockspace_local(dlm_lockspace_t *lockspace) { struct dlm_ls *ls; spin_lock(&lslist_lock); list_for_each_entry(ls, &lslist, ls_list) { if (ls->ls_local_handle == lockspace) { ls->ls_count++; goto out; } } ls = NULL; out: spin_unlock(&lslist_lock); return ls; } struct dlm_ls *dlm_find_lockspace_device(int minor) { struct dlm_ls *ls; spin_lock(&lslist_lock); list_for_each_entry(ls, &lslist, ls_list) { if (ls->ls_device.minor == minor) { ls->ls_count++; goto out; } } ls = NULL; out: spin_unlock(&lslist_lock); return ls; } void dlm_put_lockspace(struct dlm_ls *ls) { spin_lock(&lslist_lock); ls->ls_count--; spin_unlock(&lslist_lock); } static void remove_lockspace(struct dlm_ls *ls) { for (;;) { spin_lock(&lslist_lock); if (ls->ls_count == 0) { WARN_ON(ls->ls_create_count != 0); list_del(&ls->ls_list); spin_unlock(&lslist_lock); return; } spin_unlock(&lslist_lock); ssleep(1); } } static int threads_start(void) { int error; error = dlm_scand_start(); if (error) { log_print("cannot start dlm_scand thread %d", error); goto fail; } /* Thread for sending/receiving messages for all lockspace's */ error = dlm_lowcomms_start(); if (error) { log_print("cannot start dlm lowcomms %d", error); goto scand_fail; } return 0; scand_fail: dlm_scand_stop(); fail: return error; } static void threads_stop(void) { dlm_scand_stop(); dlm_lowcomms_stop(); } static int new_lockspace(const char *name, const char *cluster, uint32_t flags, int lvblen, const struct dlm_lockspace_ops *ops, void *ops_arg, int *ops_result, dlm_lockspace_t **lockspace) { struct dlm_ls *ls; int i, size, error; int do_unreg = 0; int namelen = strlen(name); if (namelen > DLM_LOCKSPACE_LEN || namelen == 0) return -EINVAL; if (!lvblen || (lvblen % 8)) return -EINVAL; if (!try_module_get(THIS_MODULE)) return -EINVAL; if (!dlm_user_daemon_available()) { log_print("dlm user daemon not available"); error = -EUNATCH; goto out; } if (ops && ops_result) { if (!dlm_config.ci_recover_callbacks) *ops_result = -EOPNOTSUPP; else *ops_result = 0; } if (!cluster) log_print("dlm cluster name '%s' is being used without an application provided cluster name", dlm_config.ci_cluster_name); if (dlm_config.ci_recover_callbacks && cluster && strncmp(cluster, dlm_config.ci_cluster_name, DLM_LOCKSPACE_LEN)) { log_print("dlm cluster name '%s' does not match " "the application cluster name '%s'", dlm_config.ci_cluster_name, cluster); error = -EBADR; goto out; } error = 0; spin_lock(&lslist_lock); list_for_each_entry(ls, &lslist, ls_list) { WARN_ON(ls->ls_create_count <= 0); if (ls->ls_namelen != namelen) continue; if (memcmp(ls->ls_name, name, namelen)) continue; if (flags & DLM_LSFL_NEWEXCL) { error = -EEXIST; break; } ls->ls_create_count++; *lockspace = ls; error = 1; break; } spin_unlock(&lslist_lock); if (error) goto out; error = -ENOMEM; ls = kzalloc(sizeof(struct dlm_ls) + namelen, GFP_NOFS); if (!ls) goto out; memcpy(ls->ls_name, name, namelen); ls->ls_namelen = namelen; ls->ls_lvblen = lvblen; ls->ls_count = 0; ls->ls_flags = 0; ls->ls_scan_time = jiffies; if (ops && dlm_config.ci_recover_callbacks) { ls->ls_ops = ops; ls->ls_ops_arg = ops_arg; } if (flags & DLM_LSFL_TIMEWARN) set_bit(LSFL_TIMEWARN, &ls->ls_flags); /* ls_exflags are forced to match among nodes, and we don't need to require all nodes to have some flags set */ ls->ls_exflags = (flags & ~(DLM_LSFL_TIMEWARN | DLM_LSFL_FS | DLM_LSFL_NEWEXCL)); size = dlm_config.ci_rsbtbl_size; ls->ls_rsbtbl_size = size; ls->ls_rsbtbl = vmalloc(array_size(size, sizeof(struct dlm_rsbtable))); if (!ls->ls_rsbtbl) goto out_lsfree; for (i = 0; i < size; i++) { ls->ls_rsbtbl[i].keep.rb_node = NULL; ls->ls_rsbtbl[i].toss.rb_node = NULL; spin_lock_init(&ls->ls_rsbtbl[i].lock); } spin_lock_init(&ls->ls_remove_spin); for (i = 0; i < DLM_REMOVE_NAMES_MAX; i++) { ls->ls_remove_names[i] = kzalloc(DLM_RESNAME_MAXLEN+1, GFP_KERNEL); if (!ls->ls_remove_names[i]) goto out_rsbtbl; } idr_init(&ls->ls_lkbidr); spin_lock_init(&ls->ls_lkbidr_spin); INIT_LIST_HEAD(&ls->ls_waiters); mutex_init(&ls->ls_waiters_mutex); INIT_LIST_HEAD(&ls->ls_orphans); mutex_init(&ls->ls_orphans_mutex); INIT_LIST_HEAD(&ls->ls_timeout); mutex_init(&ls->ls_timeout_mutex); INIT_LIST_HEAD(&ls->ls_new_rsb); spin_lock_init(&ls->ls_new_rsb_spin); INIT_LIST_HEAD(&ls->ls_nodes); INIT_LIST_HEAD(&ls->ls_nodes_gone); ls->ls_num_nodes = 0; ls->ls_low_nodeid = 0; ls->ls_total_weight = 0; ls->ls_node_array = NULL; memset(&ls->ls_stub_rsb, 0, sizeof(struct dlm_rsb)); ls->ls_stub_rsb.res_ls = ls; ls->ls_debug_rsb_dentry = NULL; ls->ls_debug_waiters_dentry = NULL; init_waitqueue_head(&ls->ls_uevent_wait); ls->ls_uevent_result = 0; init_completion(&ls->ls_members_done); ls->ls_members_result = -1; mutex_init(&ls->ls_cb_mutex); INIT_LIST_HEAD(&ls->ls_cb_delay); ls->ls_recoverd_task = NULL; mutex_init(&ls->ls_recoverd_active); spin_lock_init(&ls->ls_recover_lock); spin_lock_init(&ls->ls_rcom_spin); get_random_bytes(&ls->ls_rcom_seq, sizeof(uint64_t)); ls->ls_recover_status = 0; ls->ls_recover_seq = 0; ls->ls_recover_args = NULL; init_rwsem(&ls->ls_in_recovery); init_rwsem(&ls->ls_recv_active); INIT_LIST_HEAD(&ls->ls_requestqueue); mutex_init(&ls->ls_requestqueue_mutex); mutex_init(&ls->ls_clear_proc_locks); ls->ls_recover_buf = kmalloc(dlm_config.ci_buffer_size, GFP_NOFS); if (!ls->ls_recover_buf) goto out_lkbidr; ls->ls_slot = 0; ls->ls_num_slots = 0; ls->ls_slots_size = 0; ls->ls_slots = NULL; INIT_LIST_HEAD(&ls->ls_recover_list); spin_lock_init(&ls->ls_recover_list_lock); idr_init(&ls->ls_recover_idr); spin_lock_init(&ls->ls_recover_idr_lock); ls->ls_recover_list_count = 0; ls->ls_local_handle = ls; init_waitqueue_head(&ls->ls_wait_general); INIT_LIST_HEAD(&ls->ls_root_list); init_rwsem(&ls->ls_root_sem); spin_lock(&lslist_lock); ls->ls_create_count = 1; list_add(&ls->ls_list, &lslist); spin_unlock(&lslist_lock); if (flags & DLM_LSFL_FS) { error = dlm_callback_start(ls); if (error) { log_error(ls, "can't start dlm_callback %d", error); goto out_delist; } } init_waitqueue_head(&ls->ls_recover_lock_wait); /* * Once started, dlm_recoverd first looks for ls in lslist, then * initializes ls_in_recovery as locked in "down" mode. We need * to wait for the wakeup from dlm_recoverd because in_recovery * has to start out in down mode. */ error = dlm_recoverd_start(ls); if (error) { log_error(ls, "can't start dlm_recoverd %d", error); goto out_callback; } wait_event(ls->ls_recover_lock_wait, test_bit(LSFL_RECOVER_LOCK, &ls->ls_flags)); /* let kobject handle freeing of ls if there's an error */ do_unreg = 1; ls->ls_kobj.kset = dlm_kset; error = kobject_init_and_add(&ls->ls_kobj, &dlm_ktype, NULL, "%s", ls->ls_name); if (error) goto out_recoverd; kobject_uevent(&ls->ls_kobj, KOBJ_ADD); /* This uevent triggers dlm_controld in userspace to add us to the group of nodes that are members of this lockspace (managed by the cluster infrastructure.) Once it's done that, it tells us who the current lockspace members are (via configfs) and then tells the lockspace to start running (via sysfs) in dlm_ls_start(). */ error = do_uevent(ls, 1); if (error) goto out_recoverd; wait_for_completion(&ls->ls_members_done); error = ls->ls_members_result; if (error) goto out_members; dlm_create_debug_file(ls); log_rinfo(ls, "join complete"); *lockspace = ls; return 0; out_members: do_uevent(ls, 0); dlm_clear_members(ls); kfree(ls->ls_node_array); out_recoverd: dlm_recoverd_stop(ls); out_callback: dlm_callback_stop(ls); out_delist: spin_lock(&lslist_lock); list_del(&ls->ls_list); spin_unlock(&lslist_lock); idr_destroy(&ls->ls_recover_idr); kfree(ls->ls_recover_buf); out_lkbidr: idr_destroy(&ls->ls_lkbidr); out_rsbtbl: for (i = 0; i < DLM_REMOVE_NAMES_MAX; i++) kfree(ls->ls_remove_names[i]); vfree(ls->ls_rsbtbl); out_lsfree: if (do_unreg) kobject_put(&ls->ls_kobj); else kfree(ls); out: module_put(THIS_MODULE); return error; } int dlm_new_lockspace(const char *name, const char *cluster, uint32_t flags, int lvblen, const struct dlm_lockspace_ops *ops, void *ops_arg, int *ops_result, dlm_lockspace_t **lockspace) { int error = 0; mutex_lock(&ls_lock); if (!ls_count) error = threads_start(); if (error) goto out; error = new_lockspace(name, cluster, flags, lvblen, ops, ops_arg, ops_result, lockspace); if (!error) ls_count++; if (error > 0) error = 0; if (!ls_count) threads_stop(); out: mutex_unlock(&ls_lock); return error; } static int lkb_idr_is_local(int id, void *p, void *data) { struct dlm_lkb *lkb = p; return lkb->lkb_nodeid == 0 && lkb->lkb_grmode != DLM_LOCK_IV; } static int lkb_idr_is_any(int id, void *p, void *data) { return 1; } static int lkb_idr_free(int id, void *p, void *data) { struct dlm_lkb *lkb = p; if (lkb->lkb_lvbptr && lkb->lkb_flags & DLM_IFL_MSTCPY) dlm_free_lvb(lkb->lkb_lvbptr); dlm_free_lkb(lkb); return 0; } /* NOTE: We check the lkbidr here rather than the resource table. This is because there may be LKBs queued as ASTs that have been unlinked from their RSBs and are pending deletion once the AST has been delivered */ static int lockspace_busy(struct dlm_ls *ls, int force) { int rv; spin_lock(&ls->ls_lkbidr_spin); if (force == 0) { rv = idr_for_each(&ls->ls_lkbidr, lkb_idr_is_any, ls); } else if (force == 1) { rv = idr_for_each(&ls->ls_lkbidr, lkb_idr_is_local, ls); } else { rv = 0; } spin_unlock(&ls->ls_lkbidr_spin); return rv; } static int release_lockspace(struct dlm_ls *ls, int force) { struct dlm_rsb *rsb; struct rb_node *n; int i, busy, rv; busy = lockspace_busy(ls, force); spin_lock(&lslist_lock); if (ls->ls_create_count == 1) { if (busy) { rv = -EBUSY; } else { /* remove_lockspace takes ls off lslist */ ls->ls_create_count = 0; rv = 0; } } else if (ls->ls_create_count > 1) { rv = --ls->ls_create_count; } else { rv = -EINVAL; } spin_unlock(&lslist_lock); if (rv) { log_debug(ls, "release_lockspace no remove %d", rv); return rv; } dlm_device_deregister(ls); if (force < 3 && dlm_user_daemon_available()) do_uevent(ls, 0); dlm_recoverd_stop(ls); dlm_callback_stop(ls); remove_lockspace(ls); dlm_delete_debug_file(ls); idr_destroy(&ls->ls_recover_idr); kfree(ls->ls_recover_buf); /* * Free all lkb's in idr */ idr_for_each(&ls->ls_lkbidr, lkb_idr_free, ls); idr_destroy(&ls->ls_lkbidr); /* * Free all rsb's on rsbtbl[] lists */ for (i = 0; i < ls->ls_rsbtbl_size; i++) { while ((n = rb_first(&ls->ls_rsbtbl[i].keep))) { rsb = rb_entry(n, struct dlm_rsb, res_hashnode); rb_erase(n, &ls->ls_rsbtbl[i].keep); dlm_free_rsb(rsb); } while ((n = rb_first(&ls->ls_rsbtbl[i].toss))) { rsb = rb_entry(n, struct dlm_rsb, res_hashnode); rb_erase(n, &ls->ls_rsbtbl[i].toss); dlm_free_rsb(rsb); } } vfree(ls->ls_rsbtbl); for (i = 0; i < DLM_REMOVE_NAMES_MAX; i++) kfree(ls->ls_remove_names[i]); while (!list_empty(&ls->ls_new_rsb)) { rsb = list_first_entry(&ls->ls_new_rsb, struct dlm_rsb, res_hashchain); list_del(&rsb->res_hashchain); dlm_free_rsb(rsb); } /* * Free structures on any other lists */ dlm_purge_requestqueue(ls); kfree(ls->ls_recover_args); dlm_clear_members(ls); dlm_clear_members_gone(ls); kfree(ls->ls_node_array); log_rinfo(ls, "release_lockspace final free"); kobject_put(&ls->ls_kobj); /* The ls structure will be freed when the kobject is done with */ module_put(THIS_MODULE); return 0; } /* * Called when a system has released all its locks and is not going to use the * lockspace any longer. We free everything we're managing for this lockspace. * Remaining nodes will go through the recovery process as if we'd died. The * lockspace must continue to function as usual, participating in recoveries, * until this returns. * * Force has 4 possible values: * 0 - don't destroy locksapce if it has any LKBs * 1 - destroy lockspace if it has remote LKBs but not if it has local LKBs * 2 - destroy lockspace regardless of LKBs * 3 - destroy lockspace as part of a forced shutdown */ int dlm_release_lockspace(void *lockspace, int force) { struct dlm_ls *ls; int error; ls = dlm_find_lockspace_local(lockspace); if (!ls) return -EINVAL; dlm_put_lockspace(ls); mutex_lock(&ls_lock); error = release_lockspace(ls, force); if (!error) ls_count--; if (!ls_count) threads_stop(); mutex_unlock(&ls_lock); return error; } void dlm_stop_lockspaces(void) { struct dlm_ls *ls; int count; restart: count = 0; spin_lock(&lslist_lock); list_for_each_entry(ls, &lslist, ls_list) { if (!test_bit(LSFL_RUNNING, &ls->ls_flags)) { count++; continue; } spin_unlock(&lslist_lock); log_error(ls, "no userland control daemon, stopping lockspace"); dlm_ls_stop(ls); goto restart; } spin_unlock(&lslist_lock); if (count) log_print("dlm user daemon left %d lockspaces", count); }
{ "pile_set_name": "Github" }
package concurrent import ( "context" "fmt" "runtime" "runtime/debug" "sync" "time" "reflect" ) // HandlePanic logs goroutine panic by default var HandlePanic = func(recovered interface{}, funcName string) { ErrorLogger.Println(fmt.Sprintf("%s panic: %v", funcName, recovered)) ErrorLogger.Println(string(debug.Stack())) } // UnboundedExecutor is a executor without limits on counts of alive goroutines // it tracks the goroutine started by it, and can cancel them when shutdown type UnboundedExecutor struct { ctx context.Context cancel context.CancelFunc activeGoroutinesMutex *sync.Mutex activeGoroutines map[string]int HandlePanic func(recovered interface{}, funcName string) } // GlobalUnboundedExecutor has the life cycle of the program itself // any goroutine want to be shutdown before main exit can be started from this executor // GlobalUnboundedExecutor expects the main function to call stop // it does not magically knows the main function exits var GlobalUnboundedExecutor = NewUnboundedExecutor() // NewUnboundedExecutor creates a new UnboundedExecutor, // UnboundedExecutor can not be created by &UnboundedExecutor{} // HandlePanic can be set with a callback to override global HandlePanic func NewUnboundedExecutor() *UnboundedExecutor { ctx, cancel := context.WithCancel(context.TODO()) return &UnboundedExecutor{ ctx: ctx, cancel: cancel, activeGoroutinesMutex: &sync.Mutex{}, activeGoroutines: map[string]int{}, } } // Go starts a new goroutine and tracks its lifecycle. // Panic will be recovered and logged automatically, except for StopSignal func (executor *UnboundedExecutor) Go(handler func(ctx context.Context)) { pc := reflect.ValueOf(handler).Pointer() f := runtime.FuncForPC(pc) funcName := f.Name() file, line := f.FileLine(pc) executor.activeGoroutinesMutex.Lock() defer executor.activeGoroutinesMutex.Unlock() startFrom := fmt.Sprintf("%s:%d", file, line) executor.activeGoroutines[startFrom] += 1 go func() { defer func() { recovered := recover() // if you want to quit a goroutine without trigger HandlePanic // use runtime.Goexit() to quit if recovered != nil { if executor.HandlePanic == nil { HandlePanic(recovered, funcName) } else { executor.HandlePanic(recovered, funcName) } } executor.activeGoroutinesMutex.Lock() executor.activeGoroutines[startFrom] -= 1 executor.activeGoroutinesMutex.Unlock() }() handler(executor.ctx) }() } // Stop cancel all goroutines started by this executor without wait func (executor *UnboundedExecutor) Stop() { executor.cancel() } // StopAndWaitForever cancel all goroutines started by this executor and // wait until all goroutines exited func (executor *UnboundedExecutor) StopAndWaitForever() { executor.StopAndWait(context.Background()) } // StopAndWait cancel all goroutines started by this executor and wait. // Wait can be cancelled by the context passed in. func (executor *UnboundedExecutor) StopAndWait(ctx context.Context) { executor.cancel() for { oneHundredMilliseconds := time.NewTimer(time.Millisecond * 100) select { case <-oneHundredMilliseconds.C: if executor.checkNoActiveGoroutines() { return } case <-ctx.Done(): return } } } func (executor *UnboundedExecutor) checkNoActiveGoroutines() bool { executor.activeGoroutinesMutex.Lock() defer executor.activeGoroutinesMutex.Unlock() for startFrom, count := range executor.activeGoroutines { if count > 0 { InfoLogger.Println("UnboundedExecutor is still waiting goroutines to quit", "startFrom", startFrom, "count", count) return false } } return true }
{ "pile_set_name": "Github" }
/* Copyright (c) 1992-2008 The University of Tennessee. All rights reserved. * See file COPYING in this directory for details. */ #ifdef __cplusplus extern "C" { #endif #include "f2c.h" #include "hypre_lapack.h" /* Subroutine */ integer dpotrf_(const char *uplo, integer *n, doublereal *a, integer * lda, integer *info) { /* -- LAPACK routine (version 3.0) -- Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., Courant Institute, Argonne National Lab, and Rice University March 31, 1993 Purpose ======= DPOTRF computes the Cholesky factorization of a real symmetric positive definite matrix A. The factorization has the form A = U**T * U, if UPLO = 'U', or A = L * L**T, if UPLO = 'L', where U is an upper triangular matrix and L is lower triangular. This is the block version of the algorithm, calling Level 3 BLAS. Arguments ========= UPLO (input) CHARACTER*1 = 'U': Upper triangle of A is stored; = 'L': Lower triangle of A is stored. N (input) INTEGER The order of the matrix A. N >= 0. A (input/output) DOUBLE PRECISION array, dimension (LDA,N) On entry, the symmetric matrix A. If UPLO = 'U', the leading N-by-N upper triangular part of A contains the upper triangular part of the matrix A, and the strictly lower triangular part of A is not referenced. If UPLO = 'L', the leading N-by-N lower triangular part of A contains the lower triangular part of the matrix A, and the strictly upper triangular part of A is not referenced. On exit, if INFO = 0, the factor U or L from the Cholesky factorization A = U**T*U or A = L*L**T. LDA (input) INTEGER The leading dimension of the array A. LDA >= max(1,N). INFO (output) INTEGER = 0: successful exit < 0: if INFO = -i, the i-th argument had an illegal value > 0: if INFO = i, the leading minor of order i is not positive definite, and the factorization could not be completed. ===================================================================== Test the input parameters. Parameter adjustments */ /* Table of constant values */ static integer c__1 = 1; static integer c_n1 = -1; static doublereal c_b13 = -1.; static doublereal c_b14 = 1.; /* System generated locals */ integer a_dim1, a_offset, i__1, i__2, i__3, i__4; /* Local variables */ static integer j; extern /* Subroutine */ integer dgemm_(const char *,const char *, integer *, integer *, integer *, doublereal *, doublereal *, integer *, doublereal *, integer *, doublereal *, doublereal *, integer *); extern logical lsame_(const char *,const char *); extern /* Subroutine */ integer dtrsm_(const char *,const char *,const char *,const char *, integer *, integer *, doublereal *, doublereal *, integer *, doublereal *, integer *); static logical upper; extern /* Subroutine */ integer dsyrk_(const char *,const char *, integer *, integer *, doublereal *, doublereal *, integer *, doublereal *, doublereal *, integer *), dpotf2_(const char *, integer *, doublereal *, integer *, integer *); static integer jb, nb; extern /* Subroutine */ integer xerbla_(const char *, integer *); extern integer ilaenv_(integer *,const char *,const char *, integer *, integer *, integer *, integer *, ftnlen, ftnlen); #define a_ref(a_1,a_2) a[(a_2)*a_dim1 + a_1] a_dim1 = *lda; a_offset = 1 + a_dim1 * 1; a -= a_offset; /* Function Body */ *info = 0; upper = lsame_(uplo, "U"); if (! upper && ! lsame_(uplo, "L")) { *info = -1; } else if (*n < 0) { *info = -2; } else if (*lda < max(1,*n)) { *info = -4; } if (*info != 0) { i__1 = -(*info); xerbla_("DPOTRF", &i__1); return 0; } /* Quick return if possible */ if (*n == 0) { return 0; } /* Determine the block size for this environment. */ nb = ilaenv_(&c__1, "DPOTRF", uplo, n, &c_n1, &c_n1, &c_n1, (ftnlen)6, ( ftnlen)1); if (nb <= 1 || nb >= *n) { /* Use unblocked code. */ dpotf2_(uplo, n, &a[a_offset], lda, info); } else { /* Use blocked code. */ if (upper) { /* Compute the Cholesky factorization A = U'*U. */ i__1 = *n; i__2 = nb; for (j = 1; i__2 < 0 ? j >= i__1 : j <= i__1; j += i__2) { /* Update and factorize the current diagonal block and test for non-positive-definiteness. Computing MIN */ i__3 = nb, i__4 = *n - j + 1; jb = min(i__3,i__4); i__3 = j - 1; dsyrk_("Upper", "Transpose", &jb, &i__3, &c_b13, &a_ref(1, j), lda, &c_b14, &a_ref(j, j), lda) ; dpotf2_("Upper", &jb, &a_ref(j, j), lda, info); if (*info != 0) { goto L30; } if (j + jb <= *n) { /* Compute the current block row. */ i__3 = *n - j - jb + 1; i__4 = j - 1; dgemm_("Transpose", "No transpose", &jb, &i__3, &i__4, & c_b13, &a_ref(1, j), lda, &a_ref(1, j + jb), lda, &c_b14, &a_ref(j, j + jb), lda); i__3 = *n - j - jb + 1; dtrsm_("Left", "Upper", "Transpose", "Non-unit", &jb, & i__3, &c_b14, &a_ref(j, j), lda, &a_ref(j, j + jb) , lda) ; } /* L10: */ } } else { /* Compute the Cholesky factorization A = L*L'. */ i__2 = *n; i__1 = nb; for (j = 1; i__1 < 0 ? j >= i__2 : j <= i__2; j += i__1) { /* Update and factorize the current diagonal block and test for non-positive-definiteness. Computing MIN */ i__3 = nb, i__4 = *n - j + 1; jb = min(i__3,i__4); i__3 = j - 1; dsyrk_("Lower", "No transpose", &jb, &i__3, &c_b13, &a_ref(j, 1), lda, &c_b14, &a_ref(j, j), lda); dpotf2_("Lower", &jb, &a_ref(j, j), lda, info); if (*info != 0) { goto L30; } if (j + jb <= *n) { /* Compute the current block column. */ i__3 = *n - j - jb + 1; i__4 = j - 1; dgemm_("No transpose", "Transpose", &i__3, &jb, &i__4, & c_b13, &a_ref(j + jb, 1), lda, &a_ref(j, 1), lda, &c_b14, &a_ref(j + jb, j), lda); i__3 = *n - j - jb + 1; dtrsm_("Right", "Lower", "Transpose", "Non-unit", &i__3, & jb, &c_b14, &a_ref(j, j), lda, &a_ref(j + jb, j), lda); } /* L20: */ } } } goto L40; L30: *info = *info + j - 1; L40: return 0; /* End of DPOTRF */ } /* dpotrf_ */ #undef a_ref #ifdef __cplusplus } #endif
{ "pile_set_name": "Github" }
//------------------------------------------------------------------------------------------------------- // Copyright (C) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE.txt file in the project root for full license information. //------------------------------------------------------------------------------------------------------- function test(param) { var l = param; param = function() { return l; } return arguments; } WScript.Echo(test("test1")[0]()); WScript.Echo(test("test2")[0]());
{ "pile_set_name": "Github" }
+++ Talk_date = "" Talk_start_time = "" Talk_end_time = "" Title = "Desafios de segurança em arquitetura de microsserviços" Type = "talk" Speakers = ["thaiane-braga","ruan-vitor"] youtube = "" slideshare = "" slides = "" +++ Aplicações utilizando arquitetura em microsserviços são cada vez mais comuns hoje em dia, entretanto, há necessidade de monitorar e garantir a segurança de cada microsserviço. Conheça os desafios dessa arquitetura, bem como suas possíveis soluções para mitigar essas possíveis vulnerabilidades.
{ "pile_set_name": "Github" }
<script src="/main.js?raw=true"></script> # Active with simple ADB mode It is recommended to set up the [device owner mode](https://iceboxdoc.catchingnow.com/Device%20Owner%20(Non%20Root)%20Setup). You can set up the simple ADB mode if you don't want to delete the accounts or have other difficulties. - Pros: no need to delete the account and other steps. - Cons: You will have to reactivate it every time after restarting your device. Otherwise the frozen apps will not be available. ### Step 1. Please keep the USB debugging always on and set the USB connection to "charge only". For MIUI enable the "USB debugging (security setting)". 2. Run the cmd: ``` adb shell sh /sdcard/Android/data/com.catchingnow.icebox/files/start.sh ```
{ "pile_set_name": "Github" }
fileFormatVersion: 2 guid: 5b737012b8e5485b8764ed00e6932da1 MonoImporter: externalObjects: {} serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant:
{ "pile_set_name": "Github" }
.middle-container { position: relative; overflow: hidden; margin: 50px 0; } .middle-bg { position: relative; right: 0; top: 0; } .middle-down { position: absolute; left: 0; bottom: 0; _margin-bottom: 100px; } .middle-top{margin: 30px 0 50px;} .middle-bottom{border:1px solid #e6e6e6;padding-top:55px;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;background:#fff;} .middle-bottom a{width:627px;height:88px;border:0;margin-left: auto;margin-right: auto;display: block;} .middle-bottom p{margin-top:35px;padding-bottom:55px;text-align: center;}
{ "pile_set_name": "Github" }
import { IntegerWidget, TextAreaWidget, StringWidget } from './'; import { DefaultWidgetRegistry } from './defaultwidgetregistry'; describe('DefaultWidgetRegistry', () => { let STRING_TYPE = 'string'; let INT_TYPE = 'integer'; let TEXTAREA_TYPE = 'textarea'; let A_NOT_REGISTERED_TYPE = 'FOOBARSTRING'; let THE_DEFAULT_FIELD_TYPE = class { }; let THE_TYPE = 'date'; let THE_FIELD_TYPE = class { }; let registry: DefaultWidgetRegistry; beforeEach(() => { registry = new DefaultWidgetRegistry(); }); it('should be initialized with primitives widgets', () => { let stringWidget = registry.getWidgetType(STRING_TYPE); let integerWidget = registry.getWidgetType(INT_TYPE); let textareaWidget = registry.getWidgetType(TEXTAREA_TYPE); expect(stringWidget).toBe(StringWidget); expect(integerWidget).toBe(IntegerWidget); expect(textareaWidget).toBe(TextAreaWidget); }); it('should return a default widget if there is no matching string in widgets', () => { let widget = registry.getWidgetType(A_NOT_REGISTERED_TYPE); expect(widget).not.toBe(null); }); it('should return the widget type set when there is no matching type registered', () => { registry.setDefaultWidget(THE_DEFAULT_FIELD_TYPE); let widget = registry.getWidgetType(A_NOT_REGISTERED_TYPE); expect(widget).toBe(THE_DEFAULT_FIELD_TYPE); }); it('should register a widget type', () => { registry.register(THE_TYPE, THE_FIELD_TYPE); let widget = registry.getWidgetType(THE_TYPE); expect(widget).toBe(THE_FIELD_TYPE); }); });
{ "pile_set_name": "Github" }
%% %% %CopyrightBegin% %% %% Copyright Ericsson AB 2009-2016. 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. %% %% %CopyrightEnd% %% -module(user_skip_6_SUITE). -compile(export_all). -include_lib("common_test/include/ct.hrl"). %%-------------------------------------------------------------------- %% Function: suite() -> Info %% Info = [tuple()] %%-------------------------------------------------------------------- suite() -> [{timetrap,{seconds,30}}]. %%-------------------------------------------------------------------- %% Function: init_per_group(GroupName, Config0) -> %% Config1 | {skip,Reason} | {skip_and_save,Reason,Config1} %% GroupName = atom() %% Config0 = Config1 = [tuple()] %% Reason = term() %%-------------------------------------------------------------------- init_per_group(ptop1, Config) -> {skip,"Top group skipped"}; init_per_group(psub2, Config) -> {skip,"Sub group skipped"}; init_per_group(_GroupName, Config) -> Config. %%-------------------------------------------------------------------- %% Function: end_per_group(GroupName, Config0) -> %% void() | {save_config,Config1} %% GroupName = atom() %% Config0 = Config1 = [tuple()] %%-------------------------------------------------------------------- end_per_group(_GroupName, _Config) -> ok. %%-------------------------------------------------------------------- %% Function: init_per_testcase(TestCase, Config0) -> %% Config1 | {skip,Reason} | {skip_and_save,Reason,Config1} %% TestCase = atom() %% Config0 = Config1 = [tuple()] %% Reason = term() %%-------------------------------------------------------------------- init_per_testcase(_TestCase, Config) -> Config. %%-------------------------------------------------------------------- %% Function: end_per_testcase(TestCase, Config0) -> %% void() | {save_config,Config1} %% TestCase = atom() %% Config0 = Config1 = [tuple()] %%-------------------------------------------------------------------- end_per_testcase(_TestCase, _Config) -> ok. %%-------------------------------------------------------------------- %% Function: groups() -> [Group] %% Group = {GroupName,Properties,GroupsAndTestCases} %% GroupName = atom() %% Properties = [parallel | sequence | Shuffle | {RepeatType,N}] %% GroupsAndTestCases = [Group | {group,GroupName} | TestCase] %% TestCase = atom() %% Shuffle = shuffle | {shuffle,{integer(),integer(),integer()}} %% RepeatType = repeat | repeat_until_all_ok | repeat_until_all_fail | %% repeat_until_any_ok | repeat_until_any_fail %% N = integer() | forever %%-------------------------------------------------------------------- groups() -> [{ptop1,[parallel],[tc1,{psub1,[parallel],[tc3,tc4]},tc2]}, {ptop2,[parallel],[tc1,{psub2,[parallel],[tc3,tc4]},tc2]}]. %%-------------------------------------------------------------------- %% Function: all() -> GroupsAndTestCases | {skip,Reason} %% GroupsAndTestCases = [{group,GroupName} | TestCase] %% GroupName = atom() %% TestCase = atom() %% Reason = term() %%-------------------------------------------------------------------- all() -> [{group,ptop1},{group,ptop2}]. %%-------------------------------------------------------------------- %% Function: TestCase(Config0) -> %% ok | exit() | {skip,Reason} | {comment,Comment} | %% {save_config,Config1} | {skip_and_save,Reason,Config1} %% Config0 = Config1 = [tuple()] %% Reason = term() %% Comment = term() %%-------------------------------------------------------------------- tc1(_) -> ok. tc2(_) -> ok. tc3(_) -> ok. tc4(_) -> ok.
{ "pile_set_name": "Github" }
/* ============================================================================== This file is part of the JUCE library. Copyright (c) 2017 - ROLI Ltd. JUCE is an open source library subject to commercial or open-source licensing. By using JUCE, you agree to the terms of both the JUCE 5 End-User License Agreement and JUCE 5 Privacy Policy (both updated and effective as of the 27th April 2017). End User License Agreement: www.juce.com/juce-5-licence Privacy Policy: www.juce.com/juce-5-privacy-policy Or: You may also use this code under the terms of the GPL v3 (see www.gnu.org/licenses). JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE DISCLAIMED. ============================================================================== */ #pragma once //============================================================================== /** A PropertyComponent that shows its value as a slider. @see PropertyComponent, Slider */ class JUCE_API SliderPropertyComponent : public PropertyComponent, private SliderListener // (can't use Slider::Listener due to idiotic VC2005 bug) { protected: //============================================================================== /** Creates the property component. The ranges, interval and skew factor are passed to the Slider component. If you need to customise the slider in other ways, your constructor can access the slider member variable and change it directly. */ SliderPropertyComponent (const String& propertyName, double rangeMin, double rangeMax, double interval, double skewFactor = 1.0, bool symmetricSkew = false); public: //============================================================================== /** Creates the property component. The ranges, interval and skew factor are passed to the Slider component. If you need to customise the slider in other ways, your constructor can access the slider member variable and change it directly. Note that if you call this constructor then you must use the Value to interact with the value, and you can't override the class with your own setValue or getValue methods. If you want to use those methods, call the other constructor instead. */ SliderPropertyComponent (const Value& valueToControl, const String& propertyName, double rangeMin, double rangeMax, double interval, double skewFactor = 1.0, bool symmetricSkew = false); /** Destructor. */ ~SliderPropertyComponent(); //============================================================================== /** Called when the user moves the slider to change its value. Your subclass must use this method to update whatever item this property represents. */ virtual void setValue (double newValue); /** Returns the value that the slider should show. */ virtual double getValue() const; //============================================================================== /** @internal */ void refresh(); /** @internal */ void sliderValueChanged (Slider*); protected: /** The slider component being used in this component. Your subclass has access to this in case it needs to customise it in some way. */ Slider slider; private: //============================================================================== JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (SliderPropertyComponent) };
{ "pile_set_name": "Github" }
function New-PSHTMLChartPieDataSet { <# .SYNOPSIS Create a dataset object for a Pie chart .DESCRIPTION Create a dataset object for a Line chart .EXAMPLE .INPUTS Inputs (if any) .OUTPUTS DataSetLine .NOTES .LINK https://github.com/Stephanevg/PSHTML #> [CmdletBinding()] param ( [Array]$Data, [String]$label, [array]$backgroundColor, [String]$borderColor, [int]$borderWidth = 1, [array]$hoverBackgroundColor, [string]$HoverBorderColor, [int]$HoverBorderWidth ) $Datachart = [datasetPie]::New() if($Data){ $null = $Datachart.AddData($Data) } If($Label){ $Datachart.label = $label } if($backgroundColor){ $Datachart.AddBackGroundColor($backgroundColor) #$Datachart.backgroundColor = $backgroundColor } If($borderColor){ $Datachart.borderColor = $borderColor } if ($borderWidth){ $Datachart.borderWidth = $borderWidth } If($hoverBackgroundColor){ $Datachart.AddHoverBackGroundColor($hoverBackgroundColor) #$Datachart.hoverBackgroundColor = $hoverBackgroundColor }else{ $Datachart.AddHoverBackGroundColor($backgroundColor) } if($HoverBorderColor){ $Datachart.HoverBorderColor = $HoverBorderColor } if ($HoverborderWidth){ $Datachart.HoverBorderWidth = $HoverborderWidth } return $Datachart }
{ "pile_set_name": "Github" }
// Code generated by protoc-gen-gogo. DO NOT EDIT. // source: castvalue.proto /* Package castvalue is a generated protocol buffer package. It is generated from these files: castvalue.proto It has these top-level messages: Castaway Wilson */ package castvalue import proto "github.com/gogo/protobuf/proto" import fmt "fmt" import math "math" import _ "github.com/gogo/protobuf/gogoproto" import descriptor "github.com/gogo/protobuf/protoc-gen-gogo/descriptor" import gzip "compress/gzip" import bytes "bytes" import ioutil "io/ioutil" import strings "strings" import reflect "reflect" import sortkeys "github.com/gogo/protobuf/sortkeys" // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal var _ = fmt.Errorf var _ = math.Inf // This is a compile-time assertion to ensure that this generated file // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package type Castaway struct { CastMapValueMessage map[int32]MyWilson `protobuf:"bytes,1,rep,name=CastMapValueMessage,castvalue=MyWilson,castvaluetype=castvalue.Wilson" json:"CastMapValueMessage" protobuf_key:"varint,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` CastMapValueMessageNullable map[int32]*MyWilson `protobuf:"bytes,2,rep,name=CastMapValueMessageNullable,castvalue=MyWilson,castvaluetype=castvalue.Wilson" json:"CastMapValueMessageNullable,omitempty" protobuf_key:"varint,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` XXX_unrecognized []byte `json:"-"` } func (m *Castaway) Reset() { *m = Castaway{} } func (*Castaway) ProtoMessage() {} func (*Castaway) Descriptor() ([]byte, []int) { return fileDescriptorCastvalue, []int{0} } type Wilson struct { Int64 *int64 `protobuf:"varint,1,opt,name=Int64" json:"Int64,omitempty"` XXX_unrecognized []byte `json:"-"` } func (m *Wilson) Reset() { *m = Wilson{} } func (*Wilson) ProtoMessage() {} func (*Wilson) Descriptor() ([]byte, []int) { return fileDescriptorCastvalue, []int{1} } func init() { proto.RegisterType((*Castaway)(nil), "castvalue.Castaway") proto.RegisterType((*Wilson)(nil), "castvalue.Wilson") } func (this *Castaway) Description() (desc *descriptor.FileDescriptorSet) { return CastvalueDescription() } func (this *Wilson) Description() (desc *descriptor.FileDescriptorSet) { return CastvalueDescription() } func CastvalueDescription() (desc *descriptor.FileDescriptorSet) { d := &descriptor.FileDescriptorSet{} var gzipped = []byte{ // 3894 bytes of a gzipped FileDescriptorSet 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x5a, 0x5d, 0x70, 0x1b, 0xd7, 0x75, 0xe6, 0xe2, 0x87, 0x04, 0x0e, 0x40, 0x70, 0x79, 0x49, 0x4b, 0x10, 0x1d, 0x43, 0x14, 0x6d, 0x47, 0xb4, 0x9d, 0x50, 0x19, 0x59, 0x92, 0x25, 0xa8, 0x89, 0x0b, 0x82, 0x10, 0x03, 0x95, 0x7f, 0x59, 0x90, 0xb1, 0xe5, 0x4c, 0x67, 0x67, 0xb9, 0xb8, 0x00, 0x57, 0x5a, 0xec, 0x6e, 0x76, 0x17, 0x92, 0xa9, 0xe9, 0x83, 0x3a, 0x4e, 0xdb, 0x49, 0x3b, 0xfd, 0xef, 0x4c, 0x12, 0xd7, 0x71, 0x7f, 0x66, 0x5a, 0xa7, 0xe9, 0x5f, 0xd2, 0xb4, 0x69, 0xda, 0xa7, 0xf4, 0x21, 0xad, 0x9f, 0x3a, 0xc9, 0x5b, 0x1f, 0x3a, 0xad, 0xc5, 0x78, 0xa6, 0x6e, 0xeb, 0x36, 0x6e, 0xeb, 0x07, 0xcf, 0x68, 0x3a, 0xd3, 0xb9, 0x7f, 0x8b, 0x5d, 0x00, 0xe4, 0x82, 0xe9, 0xd8, 0x79, 0x22, 0xf6, 0xdc, 0xf3, 0x7d, 0x7b, 0xee, 0xb9, 0xe7, 0x9e, 0x73, 0xee, 0x5d, 0xc2, 0x0f, 0xae, 0xc0, 0x7c, 0xdb, 0xb6, 0xdb, 0x26, 0x3e, 0xe7, 0xb8, 0xb6, 0x6f, 0xef, 0x76, 0x5b, 0xe7, 0x9a, 0xd8, 0xd3, 0x5d, 0xc3, 0xf1, 0x6d, 0x77, 0x89, 0xca, 0xd0, 0x14, 0xd3, 0x58, 0x12, 0x1a, 0x0b, 0xeb, 0x30, 0x7d, 0xcd, 0x30, 0xf1, 0x4a, 0xa0, 0xd8, 0xc0, 0x3e, 0xba, 0x0c, 0xa9, 0x96, 0x61, 0xe2, 0xa2, 0x34, 0x9f, 0x5c, 0xcc, 0x9d, 0x7f, 0x6c, 0xa9, 0x0f, 0xb4, 0x14, 0x45, 0x6c, 0x11, 0xb1, 0x42, 0x11, 0x0b, 0x6f, 0xa6, 0x60, 0x66, 0xc8, 0x28, 0x42, 0x90, 0xb2, 0xb4, 0x0e, 0x61, 0x94, 0x16, 0xb3, 0x0a, 0xfd, 0x8d, 0x8a, 0x30, 0xe1, 0x68, 0xfa, 0x2d, 0xad, 0x8d, 0x8b, 0x09, 0x2a, 0x16, 0x8f, 0xa8, 0x04, 0xd0, 0xc4, 0x0e, 0xb6, 0x9a, 0xd8, 0xd2, 0xf7, 0x8b, 0xc9, 0xf9, 0xe4, 0x62, 0x56, 0x09, 0x49, 0xd0, 0x53, 0x30, 0xed, 0x74, 0x77, 0x4d, 0x43, 0x57, 0x43, 0x6a, 0x30, 0x9f, 0x5c, 0x4c, 0x2b, 0x32, 0x1b, 0x58, 0xe9, 0x29, 0x9f, 0x85, 0xa9, 0x3b, 0x58, 0xbb, 0x15, 0x56, 0xcd, 0x51, 0xd5, 0x02, 0x11, 0x87, 0x14, 0xab, 0x90, 0xef, 0x60, 0xcf, 0xd3, 0xda, 0x58, 0xf5, 0xf7, 0x1d, 0x5c, 0x4c, 0xd1, 0xd9, 0xcf, 0x0f, 0xcc, 0xbe, 0x7f, 0xe6, 0x39, 0x8e, 0xda, 0xde, 0x77, 0x30, 0xaa, 0x40, 0x16, 0x5b, 0xdd, 0x0e, 0x63, 0x48, 0x1f, 0xe2, 0xbf, 0x9a, 0xd5, 0xed, 0xf4, 0xb3, 0x64, 0x08, 0x8c, 0x53, 0x4c, 0x78, 0xd8, 0xbd, 0x6d, 0xe8, 0xb8, 0x38, 0x4e, 0x09, 0xce, 0x0e, 0x10, 0x34, 0xd8, 0x78, 0x3f, 0x87, 0xc0, 0xa1, 0x2a, 0x64, 0xf1, 0x8b, 0x3e, 0xb6, 0x3c, 0xc3, 0xb6, 0x8a, 0x13, 0x94, 0xe4, 0xf1, 0x21, 0xab, 0x88, 0xcd, 0x66, 0x3f, 0x45, 0x0f, 0x87, 0x2e, 0xc1, 0x84, 0xed, 0xf8, 0x86, 0x6d, 0x79, 0xc5, 0xcc, 0xbc, 0xb4, 0x98, 0x3b, 0xff, 0xa1, 0xa1, 0x81, 0xb0, 0xc9, 0x74, 0x14, 0xa1, 0x8c, 0xea, 0x20, 0x7b, 0x76, 0xd7, 0xd5, 0xb1, 0xaa, 0xdb, 0x4d, 0xac, 0x1a, 0x56, 0xcb, 0x2e, 0x66, 0x29, 0xc1, 0xe9, 0xc1, 0x89, 0x50, 0xc5, 0xaa, 0xdd, 0xc4, 0x75, 0xab, 0x65, 0x2b, 0x05, 0x2f, 0xf2, 0x8c, 0x4e, 0xc0, 0xb8, 0xb7, 0x6f, 0xf9, 0xda, 0x8b, 0xc5, 0x3c, 0x8d, 0x10, 0xfe, 0xb4, 0xf0, 0x57, 0xe3, 0x30, 0x35, 0x4a, 0x88, 0x5d, 0x85, 0x74, 0x8b, 0xcc, 0xb2, 0x98, 0x38, 0x8e, 0x0f, 0x18, 0x26, 0xea, 0xc4, 0xf1, 0x1f, 0xd2, 0x89, 0x15, 0xc8, 0x59, 0xd8, 0xf3, 0x71, 0x93, 0x45, 0x44, 0x72, 0xc4, 0x98, 0x02, 0x06, 0x1a, 0x0c, 0xa9, 0xd4, 0x0f, 0x15, 0x52, 0xcf, 0xc3, 0x54, 0x60, 0x92, 0xea, 0x6a, 0x56, 0x5b, 0xc4, 0xe6, 0xb9, 0x38, 0x4b, 0x96, 0x6a, 0x02, 0xa7, 0x10, 0x98, 0x52, 0xc0, 0x91, 0x67, 0xb4, 0x02, 0x60, 0x5b, 0xd8, 0x6e, 0xa9, 0x4d, 0xac, 0x9b, 0xc5, 0xcc, 0x21, 0x5e, 0xda, 0x24, 0x2a, 0x03, 0x5e, 0xb2, 0x99, 0x54, 0x37, 0xd1, 0x95, 0x5e, 0xa8, 0x4d, 0x1c, 0x12, 0x29, 0xeb, 0x6c, 0x93, 0x0d, 0x44, 0xdb, 0x0e, 0x14, 0x5c, 0x4c, 0xe2, 0x1e, 0x37, 0xf9, 0xcc, 0xb2, 0xd4, 0x88, 0xa5, 0xd8, 0x99, 0x29, 0x1c, 0xc6, 0x26, 0x36, 0xe9, 0x86, 0x1f, 0xd1, 0xa3, 0x10, 0x08, 0x54, 0x1a, 0x56, 0x40, 0xb3, 0x50, 0x5e, 0x08, 0x37, 0xb4, 0x0e, 0x9e, 0xbb, 0x0b, 0x85, 0xa8, 0x7b, 0xd0, 0x2c, 0xa4, 0x3d, 0x5f, 0x73, 0x7d, 0x1a, 0x85, 0x69, 0x85, 0x3d, 0x20, 0x19, 0x92, 0xd8, 0x6a, 0xd2, 0x2c, 0x97, 0x56, 0xc8, 0x4f, 0xf4, 0xe3, 0xbd, 0x09, 0x27, 0xe9, 0x84, 0x3f, 0x3c, 0xb8, 0xa2, 0x11, 0xe6, 0xfe, 0x79, 0xcf, 0x3d, 0x03, 0x93, 0x91, 0x09, 0x8c, 0xfa, 0xea, 0x85, 0x9f, 0x82, 0x87, 0x86, 0x52, 0xa3, 0xe7, 0x61, 0xb6, 0x6b, 0x19, 0x96, 0x8f, 0x5d, 0xc7, 0xc5, 0x24, 0x62, 0xd9, 0xab, 0x8a, 0xff, 0x32, 0x71, 0x48, 0xcc, 0xed, 0x84, 0xb5, 0x19, 0x8b, 0x32, 0xd3, 0x1d, 0x14, 0x3e, 0x99, 0xcd, 0xbc, 0x35, 0x21, 0xdf, 0xbb, 0x77, 0xef, 0x5e, 0x62, 0xe1, 0x8b, 0xe3, 0x30, 0x3b, 0x6c, 0xcf, 0x0c, 0xdd, 0xbe, 0x27, 0x60, 0xdc, 0xea, 0x76, 0x76, 0xb1, 0x4b, 0x9d, 0x94, 0x56, 0xf8, 0x13, 0xaa, 0x40, 0xda, 0xd4, 0x76, 0xb1, 0x59, 0x4c, 0xcd, 0x4b, 0x8b, 0x85, 0xf3, 0x4f, 0x8d, 0xb4, 0x2b, 0x97, 0xd6, 0x08, 0x44, 0x61, 0x48, 0xf4, 0x09, 0x48, 0xf1, 0x14, 0x4d, 0x18, 0x9e, 0x1c, 0x8d, 0x81, 0xec, 0x25, 0x85, 0xe2, 0xd0, 0xc3, 0x90, 0x25, 0x7f, 0x59, 0x6c, 0x8c, 0x53, 0x9b, 0x33, 0x44, 0x40, 0xe2, 0x02, 0xcd, 0x41, 0x86, 0x6e, 0x93, 0x26, 0x16, 0xa5, 0x2d, 0x78, 0x26, 0x81, 0xd5, 0xc4, 0x2d, 0xad, 0x6b, 0xfa, 0xea, 0x6d, 0xcd, 0xec, 0x62, 0x1a, 0xf0, 0x59, 0x25, 0xcf, 0x85, 0x9f, 0x26, 0x32, 0x74, 0x1a, 0x72, 0x6c, 0x57, 0x19, 0x56, 0x13, 0xbf, 0x48, 0xb3, 0x67, 0x5a, 0x61, 0x1b, 0xad, 0x4e, 0x24, 0xe4, 0xf5, 0x37, 0x3d, 0xdb, 0x12, 0xa1, 0x49, 0x5f, 0x41, 0x04, 0xf4, 0xf5, 0xcf, 0xf4, 0x27, 0xee, 0x47, 0x86, 0x4f, 0xaf, 0x3f, 0xa6, 0x16, 0xbe, 0x99, 0x80, 0x14, 0xcd, 0x17, 0x53, 0x90, 0xdb, 0xbe, 0xb1, 0x55, 0x53, 0x57, 0x36, 0x77, 0x96, 0xd7, 0x6a, 0xb2, 0x84, 0x0a, 0x00, 0x54, 0x70, 0x6d, 0x6d, 0xb3, 0xb2, 0x2d, 0x27, 0x82, 0xe7, 0xfa, 0xc6, 0xf6, 0xa5, 0x0b, 0x72, 0x32, 0x00, 0xec, 0x30, 0x41, 0x2a, 0xac, 0xf0, 0xf4, 0x79, 0x39, 0x8d, 0x64, 0xc8, 0x33, 0x82, 0xfa, 0xf3, 0xb5, 0x95, 0x4b, 0x17, 0xe4, 0xf1, 0xa8, 0xe4, 0xe9, 0xf3, 0xf2, 0x04, 0x9a, 0x84, 0x2c, 0x95, 0x2c, 0x6f, 0x6e, 0xae, 0xc9, 0x99, 0x80, 0xb3, 0xb1, 0xad, 0xd4, 0x37, 0x56, 0xe5, 0x6c, 0xc0, 0xb9, 0xaa, 0x6c, 0xee, 0x6c, 0xc9, 0x10, 0x30, 0xac, 0xd7, 0x1a, 0x8d, 0xca, 0x6a, 0x4d, 0xce, 0x05, 0x1a, 0xcb, 0x37, 0xb6, 0x6b, 0x0d, 0x39, 0x1f, 0x31, 0xeb, 0xe9, 0xf3, 0xf2, 0x64, 0xf0, 0x8a, 0xda, 0xc6, 0xce, 0xba, 0x5c, 0x40, 0xd3, 0x30, 0xc9, 0x5e, 0x21, 0x8c, 0x98, 0xea, 0x13, 0x5d, 0xba, 0x20, 0xcb, 0x3d, 0x43, 0x18, 0xcb, 0x74, 0x44, 0x70, 0xe9, 0x82, 0x8c, 0x16, 0xaa, 0x90, 0xa6, 0xd1, 0x85, 0x10, 0x14, 0xd6, 0x2a, 0xcb, 0xb5, 0x35, 0x75, 0x73, 0x6b, 0xbb, 0xbe, 0xb9, 0x51, 0x59, 0x93, 0xa5, 0x9e, 0x4c, 0xa9, 0x7d, 0x6a, 0xa7, 0xae, 0xd4, 0x56, 0xe4, 0x44, 0x58, 0xb6, 0x55, 0xab, 0x6c, 0xd7, 0x56, 0xe4, 0xe4, 0x82, 0x0e, 0xb3, 0xc3, 0xf2, 0xe4, 0xd0, 0x9d, 0x11, 0x5a, 0xe2, 0xc4, 0x21, 0x4b, 0x4c, 0xb9, 0x06, 0x96, 0xf8, 0xfb, 0x09, 0x98, 0x19, 0x52, 0x2b, 0x86, 0xbe, 0xe4, 0x59, 0x48, 0xb3, 0x10, 0x65, 0xd5, 0xf3, 0x89, 0xa1, 0x45, 0x87, 0x06, 0xec, 0x40, 0x05, 0xa5, 0xb8, 0x70, 0x07, 0x91, 0x3c, 0xa4, 0x83, 0x20, 0x14, 0x03, 0x39, 0xfd, 0x27, 0x07, 0x72, 0x3a, 0x2b, 0x7b, 0x97, 0x46, 0x29, 0x7b, 0x54, 0x76, 0xbc, 0xdc, 0x9e, 0x1e, 0x92, 0xdb, 0xaf, 0xc2, 0xf4, 0x00, 0xd1, 0xc8, 0x39, 0xf6, 0x25, 0x09, 0x8a, 0x87, 0x39, 0x27, 0x26, 0xd3, 0x25, 0x22, 0x99, 0xee, 0x6a, 0xbf, 0x07, 0xcf, 0x1c, 0xbe, 0x08, 0x03, 0x6b, 0xfd, 0x9a, 0x04, 0x27, 0x86, 0x77, 0x8a, 0x43, 0x6d, 0xf8, 0x04, 0x8c, 0x77, 0xb0, 0xbf, 0x67, 0x8b, 0x6e, 0xe9, 0xc3, 0x43, 0x6a, 0x30, 0x19, 0xee, 0x5f, 0x6c, 0x8e, 0x0a, 0x17, 0xf1, 0xe4, 0x61, 0xed, 0x1e, 0xb3, 0x66, 0xc0, 0xd2, 0xcf, 0x27, 0xe0, 0xa1, 0xa1, 0xe4, 0x43, 0x0d, 0x7d, 0x04, 0xc0, 0xb0, 0x9c, 0xae, 0xcf, 0x3a, 0x22, 0x96, 0x60, 0xb3, 0x54, 0x42, 0x93, 0x17, 0x49, 0x9e, 0x5d, 0x3f, 0x18, 0x4f, 0xd2, 0x71, 0x60, 0x22, 0xaa, 0x70, 0xb9, 0x67, 0x68, 0x8a, 0x1a, 0x5a, 0x3a, 0x64, 0xa6, 0x03, 0x81, 0xf9, 0x31, 0x90, 0x75, 0xd3, 0xc0, 0x96, 0xaf, 0x7a, 0xbe, 0x8b, 0xb5, 0x8e, 0x61, 0xb5, 0x69, 0x05, 0xc9, 0x94, 0xd3, 0x2d, 0xcd, 0xf4, 0xb0, 0x32, 0xc5, 0x86, 0x1b, 0x62, 0x94, 0x20, 0x68, 0x00, 0xb9, 0x21, 0xc4, 0x78, 0x04, 0xc1, 0x86, 0x03, 0xc4, 0xc2, 0x37, 0x32, 0x90, 0x0b, 0xf5, 0xd5, 0xe8, 0x0c, 0xe4, 0x6f, 0x6a, 0xb7, 0x35, 0x55, 0x9c, 0x95, 0x98, 0x27, 0x72, 0x44, 0xb6, 0xc5, 0xcf, 0x4b, 0x1f, 0x83, 0x59, 0xaa, 0x62, 0x77, 0x7d, 0xec, 0xaa, 0xba, 0xa9, 0x79, 0x1e, 0x75, 0x5a, 0x86, 0xaa, 0x22, 0x32, 0xb6, 0x49, 0x86, 0xaa, 0x62, 0x04, 0x5d, 0x84, 0x19, 0x8a, 0xe8, 0x74, 0x4d, 0xdf, 0x70, 0x4c, 0xac, 0x92, 0xd3, 0x9b, 0x47, 0x2b, 0x49, 0x60, 0xd9, 0x34, 0xd1, 0x58, 0xe7, 0x0a, 0xc4, 0x22, 0x0f, 0xad, 0xc0, 0x23, 0x14, 0xd6, 0xc6, 0x16, 0x76, 0x35, 0x1f, 0xab, 0xf8, 0xb3, 0x5d, 0xcd, 0xf4, 0x54, 0xcd, 0x6a, 0xaa, 0x7b, 0x9a, 0xb7, 0x57, 0x9c, 0x25, 0x04, 0xcb, 0x89, 0xa2, 0xa4, 0x9c, 0x22, 0x8a, 0xab, 0x5c, 0xaf, 0x46, 0xd5, 0x2a, 0x56, 0xf3, 0x93, 0x9a, 0xb7, 0x87, 0xca, 0x70, 0x82, 0xb2, 0x78, 0xbe, 0x6b, 0x58, 0x6d, 0x55, 0xdf, 0xc3, 0xfa, 0x2d, 0xb5, 0xeb, 0xb7, 0x2e, 0x17, 0x1f, 0x0e, 0xbf, 0x9f, 0x5a, 0xd8, 0xa0, 0x3a, 0x55, 0xa2, 0xb2, 0xe3, 0xb7, 0x2e, 0xa3, 0x06, 0xe4, 0xc9, 0x62, 0x74, 0x8c, 0xbb, 0x58, 0x6d, 0xd9, 0x2e, 0x2d, 0x8d, 0x85, 0x21, 0xa9, 0x29, 0xe4, 0xc1, 0xa5, 0x4d, 0x0e, 0x58, 0xb7, 0x9b, 0xb8, 0x9c, 0x6e, 0x6c, 0xd5, 0x6a, 0x2b, 0x4a, 0x4e, 0xb0, 0x5c, 0xb3, 0x5d, 0x12, 0x50, 0x6d, 0x3b, 0x70, 0x70, 0x8e, 0x05, 0x54, 0xdb, 0x16, 0xee, 0xbd, 0x08, 0x33, 0xba, 0xce, 0xe6, 0x6c, 0xe8, 0x2a, 0x3f, 0x63, 0x79, 0x45, 0x39, 0xe2, 0x2c, 0x5d, 0x5f, 0x65, 0x0a, 0x3c, 0xc6, 0x3d, 0x74, 0x05, 0x1e, 0xea, 0x39, 0x2b, 0x0c, 0x9c, 0x1e, 0x98, 0x65, 0x3f, 0xf4, 0x22, 0xcc, 0x38, 0xfb, 0x83, 0x40, 0x14, 0x79, 0xa3, 0xb3, 0xdf, 0x0f, 0x7b, 0x06, 0x66, 0x9d, 0x3d, 0x67, 0x10, 0xf7, 0x64, 0x18, 0x87, 0x9c, 0x3d, 0xa7, 0x1f, 0xf8, 0x38, 0x3d, 0x70, 0xbb, 0x58, 0xd7, 0x7c, 0xdc, 0x2c, 0x9e, 0x0c, 0xab, 0x87, 0x06, 0xd0, 0x39, 0x90, 0x75, 0x5d, 0xc5, 0x96, 0xb6, 0x6b, 0x62, 0x55, 0x73, 0xb1, 0xa5, 0x79, 0xc5, 0xd3, 0x61, 0xe5, 0x82, 0xae, 0xd7, 0xe8, 0x68, 0x85, 0x0e, 0xa2, 0x27, 0x61, 0xda, 0xde, 0xbd, 0xa9, 0xb3, 0x90, 0x54, 0x1d, 0x17, 0xb7, 0x8c, 0x17, 0x8b, 0x8f, 0x51, 0xff, 0x4e, 0x91, 0x01, 0x1a, 0x90, 0x5b, 0x54, 0x8c, 0x9e, 0x00, 0x59, 0xf7, 0xf6, 0x34, 0xd7, 0xa1, 0x39, 0xd9, 0x73, 0x34, 0x1d, 0x17, 0x1f, 0x67, 0xaa, 0x4c, 0xbe, 0x21, 0xc4, 0x64, 0x4b, 0x78, 0x77, 0x8c, 0x96, 0x2f, 0x18, 0xcf, 0xb2, 0x2d, 0x41, 0x65, 0x9c, 0x6d, 0x11, 0x64, 0xe2, 0x8a, 0xc8, 0x8b, 0x17, 0xa9, 0x5a, 0xc1, 0xd9, 0x73, 0xc2, 0xef, 0x7d, 0x14, 0x26, 0x89, 0x66, 0xef, 0xa5, 0x4f, 0xb0, 0x86, 0xcc, 0xd9, 0x0b, 0xbd, 0xf1, 0x7d, 0xeb, 0x8d, 0x17, 0xca, 0x90, 0x0f, 0xc7, 0x27, 0xca, 0x02, 0x8b, 0x50, 0x59, 0x22, 0xcd, 0x4a, 0x75, 0x73, 0x85, 0xb4, 0x19, 0x2f, 0xd4, 0xe4, 0x04, 0x69, 0x77, 0xd6, 0xea, 0xdb, 0x35, 0x55, 0xd9, 0xd9, 0xd8, 0xae, 0xaf, 0xd7, 0xe4, 0x64, 0xb8, 0xaf, 0xfe, 0x4e, 0x02, 0x0a, 0xd1, 0x23, 0x12, 0xfa, 0x31, 0x38, 0x29, 0xee, 0x33, 0x3c, 0xec, 0xab, 0x77, 0x0c, 0x97, 0x6e, 0x99, 0x8e, 0xc6, 0xca, 0x57, 0xb0, 0x68, 0xb3, 0x5c, 0xab, 0x81, 0xfd, 0xe7, 0x0c, 0x97, 0x6c, 0x88, 0x8e, 0xe6, 0xa3, 0x35, 0x38, 0x6d, 0xd9, 0xaa, 0xe7, 0x6b, 0x56, 0x53, 0x73, 0x9b, 0x6a, 0xef, 0x26, 0x49, 0xd5, 0x74, 0x1d, 0x7b, 0x9e, 0xcd, 0x4a, 0x55, 0xc0, 0xf2, 0x21, 0xcb, 0x6e, 0x70, 0xe5, 0x5e, 0x0e, 0xaf, 0x70, 0xd5, 0xbe, 0x00, 0x4b, 0x1e, 0x16, 0x60, 0x0f, 0x43, 0xb6, 0xa3, 0x39, 0x2a, 0xb6, 0x7c, 0x77, 0x9f, 0x36, 0xc6, 0x19, 0x25, 0xd3, 0xd1, 0x9c, 0x1a, 0x79, 0xfe, 0x60, 0xce, 0x27, 0xff, 0x98, 0x84, 0x7c, 0xb8, 0x39, 0x26, 0x67, 0x0d, 0x9d, 0xd6, 0x11, 0x89, 0x66, 0x9a, 0x47, 0x8f, 0x6c, 0xa5, 0x97, 0xaa, 0xa4, 0xc0, 0x94, 0xc7, 0x59, 0xcb, 0xaa, 0x30, 0x24, 0x29, 0xee, 0x24, 0xb7, 0x60, 0xd6, 0x22, 0x64, 0x14, 0xfe, 0x84, 0x56, 0x61, 0xfc, 0xa6, 0x47, 0xb9, 0xc7, 0x29, 0xf7, 0x63, 0x47, 0x73, 0x5f, 0x6f, 0x50, 0xf2, 0xec, 0xf5, 0x86, 0xba, 0xb1, 0xa9, 0xac, 0x57, 0xd6, 0x14, 0x0e, 0x47, 0xa7, 0x20, 0x65, 0x6a, 0x77, 0xf7, 0xa3, 0xa5, 0x88, 0x8a, 0x46, 0x75, 0xfc, 0x29, 0x48, 0xdd, 0xc1, 0xda, 0xad, 0x68, 0x01, 0xa0, 0xa2, 0xf7, 0x31, 0xf4, 0xcf, 0x41, 0x9a, 0xfa, 0x0b, 0x01, 0x70, 0x8f, 0xc9, 0x63, 0x28, 0x03, 0xa9, 0xea, 0xa6, 0x42, 0xc2, 0x5f, 0x86, 0x3c, 0x93, 0xaa, 0x5b, 0xf5, 0x5a, 0xb5, 0x26, 0x27, 0x16, 0x2e, 0xc2, 0x38, 0x73, 0x02, 0xd9, 0x1a, 0x81, 0x1b, 0xe4, 0x31, 0xfe, 0xc8, 0x39, 0x24, 0x31, 0xba, 0xb3, 0xbe, 0x5c, 0x53, 0xe4, 0x44, 0x78, 0x79, 0x3d, 0xc8, 0x87, 0xfb, 0xe2, 0x0f, 0x26, 0xa6, 0xfe, 0x5a, 0x82, 0x5c, 0xa8, 0xcf, 0x25, 0x0d, 0x8a, 0x66, 0x9a, 0xf6, 0x1d, 0x55, 0x33, 0x0d, 0xcd, 0xe3, 0x41, 0x01, 0x54, 0x54, 0x21, 0x92, 0x51, 0x17, 0xed, 0x03, 0x31, 0xfe, 0x55, 0x09, 0xe4, 0xfe, 0x16, 0xb3, 0xcf, 0x40, 0xe9, 0x47, 0x6a, 0xe0, 0x2b, 0x12, 0x14, 0xa2, 0x7d, 0x65, 0x9f, 0x79, 0x67, 0x7e, 0xa4, 0xe6, 0xbd, 0x91, 0x80, 0xc9, 0x48, 0x37, 0x39, 0xaa, 0x75, 0x9f, 0x85, 0x69, 0xa3, 0x89, 0x3b, 0x8e, 0xed, 0x63, 0x4b, 0xdf, 0x57, 0x4d, 0x7c, 0x1b, 0x9b, 0xc5, 0x05, 0x9a, 0x28, 0xce, 0x1d, 0xdd, 0xaf, 0x2e, 0xd5, 0x7b, 0xb8, 0x35, 0x02, 0x2b, 0xcf, 0xd4, 0x57, 0x6a, 0xeb, 0x5b, 0x9b, 0xdb, 0xb5, 0x8d, 0xea, 0x0d, 0x75, 0x67, 0xe3, 0x27, 0x36, 0x36, 0x9f, 0xdb, 0x50, 0x64, 0xa3, 0x4f, 0xed, 0x7d, 0xdc, 0xea, 0x5b, 0x20, 0xf7, 0x1b, 0x85, 0x4e, 0xc2, 0x30, 0xb3, 0xe4, 0x31, 0x34, 0x03, 0x53, 0x1b, 0x9b, 0x6a, 0xa3, 0xbe, 0x52, 0x53, 0x6b, 0xd7, 0xae, 0xd5, 0xaa, 0xdb, 0x0d, 0x76, 0x03, 0x11, 0x68, 0x6f, 0x47, 0x37, 0xf5, 0xcb, 0x49, 0x98, 0x19, 0x62, 0x09, 0xaa, 0xf0, 0xb3, 0x03, 0x3b, 0xce, 0x7c, 0x74, 0x14, 0xeb, 0x97, 0x48, 0xc9, 0xdf, 0xd2, 0x5c, 0x9f, 0x1f, 0x35, 0x9e, 0x00, 0xe2, 0x25, 0xcb, 0x37, 0x5a, 0x06, 0x76, 0xf9, 0x85, 0x0d, 0x3b, 0x50, 0x4c, 0xf5, 0xe4, 0xec, 0xce, 0xe6, 0x23, 0x80, 0x1c, 0xdb, 0x33, 0x7c, 0xe3, 0x36, 0x56, 0x0d, 0x4b, 0xdc, 0xee, 0x90, 0x03, 0x46, 0x4a, 0x91, 0xc5, 0x48, 0xdd, 0xf2, 0x03, 0x6d, 0x0b, 0xb7, 0xb5, 0x3e, 0x6d, 0x92, 0xc0, 0x93, 0x8a, 0x2c, 0x46, 0x02, 0xed, 0x33, 0x90, 0x6f, 0xda, 0x5d, 0xd2, 0x75, 0x31, 0x3d, 0x52, 0x2f, 0x24, 0x25, 0xc7, 0x64, 0x81, 0x0a, 0xef, 0xa7, 0x7b, 0xd7, 0x4a, 0x79, 0x25, 0xc7, 0x64, 0x4c, 0xe5, 0x2c, 0x4c, 0x69, 0xed, 0xb6, 0x4b, 0xc8, 0x05, 0x11, 0x3b, 0x21, 0x14, 0x02, 0x31, 0x55, 0x9c, 0xbb, 0x0e, 0x19, 0xe1, 0x07, 0x52, 0x92, 0x89, 0x27, 0x54, 0x87, 0x1d, 0x7b, 0x13, 0x8b, 0x59, 0x25, 0x63, 0x89, 0xc1, 0x33, 0x90, 0x37, 0x3c, 0xb5, 0x77, 0x4b, 0x9e, 0x98, 0x4f, 0x2c, 0x66, 0x94, 0x9c, 0xe1, 0x05, 0x37, 0x8c, 0x0b, 0xaf, 0x25, 0xa0, 0x10, 0xbd, 0xe5, 0x47, 0x2b, 0x90, 0x31, 0x6d, 0x5d, 0xa3, 0xa1, 0xc5, 0x3e, 0x31, 0x2d, 0xc6, 0x7c, 0x18, 0x58, 0x5a, 0xe3, 0xfa, 0x4a, 0x80, 0x9c, 0xfb, 0x7b, 0x09, 0x32, 0x42, 0x8c, 0x4e, 0x40, 0xca, 0xd1, 0xfc, 0x3d, 0x4a, 0x97, 0x5e, 0x4e, 0xc8, 0x92, 0x42, 0x9f, 0x89, 0xdc, 0x73, 0x34, 0x8b, 0x86, 0x00, 0x97, 0x93, 0x67, 0xb2, 0xae, 0x26, 0xd6, 0x9a, 0xf4, 0xf8, 0x61, 0x77, 0x3a, 0xd8, 0xf2, 0x3d, 0xb1, 0xae, 0x5c, 0x5e, 0xe5, 0x62, 0xf4, 0x14, 0x4c, 0xfb, 0xae, 0x66, 0x98, 0x11, 0xdd, 0x14, 0xd5, 0x95, 0xc5, 0x40, 0xa0, 0x5c, 0x86, 0x53, 0x82, 0xb7, 0x89, 0x7d, 0x4d, 0xdf, 0xc3, 0xcd, 0x1e, 0x68, 0x9c, 0x5e, 0x33, 0x9c, 0xe4, 0x0a, 0x2b, 0x7c, 0x5c, 0x60, 0x17, 0xbe, 0x27, 0xc1, 0xb4, 0x38, 0x30, 0x35, 0x03, 0x67, 0xad, 0x03, 0x68, 0x96, 0x65, 0xfb, 0x61, 0x77, 0x0d, 0x86, 0xf2, 0x00, 0x6e, 0xa9, 0x12, 0x80, 0x94, 0x10, 0xc1, 0x5c, 0x07, 0xa0, 0x37, 0x72, 0xa8, 0xdb, 0x4e, 0x43, 0x8e, 0x7f, 0xc2, 0xa1, 0xdf, 0x01, 0xd9, 0x11, 0x1b, 0x98, 0x88, 0x9c, 0xac, 0xd0, 0x2c, 0xa4, 0x77, 0x71, 0xdb, 0xb0, 0xf8, 0xc5, 0x2c, 0x7b, 0x10, 0x17, 0x21, 0xa9, 0xe0, 0x22, 0x64, 0xf9, 0x33, 0x30, 0xa3, 0xdb, 0x9d, 0x7e, 0x73, 0x97, 0xe5, 0xbe, 0x63, 0xbe, 0xf7, 0x49, 0xe9, 0x05, 0xe8, 0xb5, 0x98, 0xef, 0x49, 0xd2, 0xef, 0x26, 0x92, 0xab, 0x5b, 0xcb, 0x5f, 0x4d, 0xcc, 0xad, 0x32, 0xe8, 0x96, 0x98, 0xa9, 0x82, 0x5b, 0x26, 0xd6, 0x89, 0xf5, 0xf0, 0x85, 0xb3, 0xf0, 0xd1, 0xb6, 0xe1, 0xef, 0x75, 0x77, 0x97, 0x74, 0xbb, 0x73, 0xae, 0x6d, 0xb7, 0xed, 0xde, 0xa7, 0x4f, 0xf2, 0x44, 0x1f, 0xe8, 0x2f, 0xfe, 0xf9, 0x33, 0x1b, 0x48, 0xe7, 0x62, 0xbf, 0x95, 0x96, 0x37, 0x60, 0x86, 0x2b, 0xab, 0xf4, 0xfb, 0x0b, 0x3b, 0x45, 0xa0, 0x23, 0xef, 0xb0, 0x8a, 0x5f, 0x7f, 0x93, 0x96, 0x6b, 0x65, 0x9a, 0x43, 0xc9, 0x18, 0x3b, 0x68, 0x94, 0x15, 0x78, 0x28, 0xc2, 0xc7, 0xb6, 0x26, 0x76, 0x63, 0x18, 0xbf, 0xc3, 0x19, 0x67, 0x42, 0x8c, 0x0d, 0x0e, 0x2d, 0x57, 0x61, 0xf2, 0x38, 0x5c, 0x7f, 0xcb, 0xb9, 0xf2, 0x38, 0x4c, 0xb2, 0x0a, 0x53, 0x94, 0x44, 0xef, 0x7a, 0xbe, 0xdd, 0xa1, 0x79, 0xef, 0x68, 0x9a, 0xbf, 0x7b, 0x93, 0xed, 0x95, 0x02, 0x81, 0x55, 0x03, 0x54, 0xb9, 0x0c, 0xf4, 0x93, 0x53, 0x13, 0xeb, 0x66, 0x0c, 0xc3, 0xeb, 0xdc, 0x90, 0x40, 0xbf, 0xfc, 0x69, 0x98, 0x25, 0xbf, 0x69, 0x5a, 0x0a, 0x5b, 0x12, 0x7f, 0xe1, 0x55, 0xfc, 0xde, 0x4b, 0x6c, 0x3b, 0xce, 0x04, 0x04, 0x21, 0x9b, 0x42, 0xab, 0xd8, 0xc6, 0xbe, 0x8f, 0x5d, 0x4f, 0xd5, 0xcc, 0x61, 0xe6, 0x85, 0x6e, 0x0c, 0x8a, 0x5f, 0x7a, 0x3b, 0xba, 0x8a, 0xab, 0x0c, 0x59, 0x31, 0xcd, 0xf2, 0x0e, 0x9c, 0x1c, 0x12, 0x15, 0x23, 0x70, 0xbe, 0xcc, 0x39, 0x67, 0x07, 0x22, 0x83, 0xd0, 0x6e, 0x81, 0x90, 0x07, 0x6b, 0x39, 0x02, 0xe7, 0x6f, 0x72, 0x4e, 0xc4, 0xb1, 0x62, 0x49, 0x09, 0xe3, 0x75, 0x98, 0xbe, 0x8d, 0xdd, 0x5d, 0xdb, 0xe3, 0xb7, 0x34, 0x23, 0xd0, 0xbd, 0xc2, 0xe9, 0xa6, 0x38, 0x90, 0x5e, 0xdb, 0x10, 0xae, 0x2b, 0x90, 0x69, 0x69, 0x3a, 0x1e, 0x81, 0xe2, 0xcb, 0x9c, 0x62, 0x82, 0xe8, 0x13, 0x68, 0x05, 0xf2, 0x6d, 0x9b, 0x57, 0xa6, 0x78, 0xf8, 0xab, 0x1c, 0x9e, 0x13, 0x18, 0x4e, 0xe1, 0xd8, 0x4e, 0xd7, 0x24, 0x65, 0x2b, 0x9e, 0xe2, 0xb7, 0x04, 0x85, 0xc0, 0x70, 0x8a, 0x63, 0xb8, 0xf5, 0xb7, 0x05, 0x85, 0x17, 0xf2, 0xe7, 0xb3, 0x90, 0xb3, 0x2d, 0x73, 0xdf, 0xb6, 0x46, 0x31, 0xe2, 0x77, 0x38, 0x03, 0x70, 0x08, 0x21, 0xb8, 0x0a, 0xd9, 0x51, 0x17, 0xe2, 0xf7, 0xde, 0x16, 0xdb, 0x43, 0xac, 0xc0, 0x2a, 0x4c, 0x89, 0x04, 0x65, 0xd8, 0xd6, 0x08, 0x14, 0xbf, 0xcf, 0x29, 0x0a, 0x21, 0x18, 0x9f, 0x86, 0x8f, 0x3d, 0xbf, 0x8d, 0x47, 0x21, 0x79, 0x4d, 0x4c, 0x83, 0x43, 0xb8, 0x2b, 0x77, 0xb1, 0xa5, 0xef, 0x8d, 0xc6, 0xf0, 0x15, 0xe1, 0x4a, 0x81, 0x21, 0x14, 0x55, 0x98, 0xec, 0x68, 0xae, 0xb7, 0xa7, 0x99, 0x23, 0x2d, 0xc7, 0x1f, 0x70, 0x8e, 0x7c, 0x00, 0xe2, 0x1e, 0xe9, 0x5a, 0xc7, 0xa1, 0xf9, 0xaa, 0xf0, 0x48, 0x08, 0xc6, 0xb7, 0x9e, 0xe7, 0xd3, 0x2b, 0xad, 0xe3, 0xb0, 0xfd, 0xa1, 0xd8, 0x7a, 0x0c, 0xbb, 0x1e, 0x66, 0xbc, 0x0a, 0x59, 0xcf, 0xb8, 0x3b, 0x12, 0xcd, 0x1f, 0x89, 0x95, 0xa6, 0x00, 0x02, 0xbe, 0x01, 0xa7, 0x86, 0x96, 0x89, 0x11, 0xc8, 0xfe, 0x98, 0x93, 0x9d, 0x18, 0x52, 0x2a, 0x78, 0x4a, 0x38, 0x2e, 0xe5, 0x9f, 0x88, 0x94, 0x80, 0xfb, 0xb8, 0xb6, 0xc8, 0x59, 0xc1, 0xd3, 0x5a, 0xc7, 0xf3, 0xda, 0x9f, 0x0a, 0xaf, 0x31, 0x6c, 0xc4, 0x6b, 0xdb, 0x70, 0x82, 0x33, 0x1e, 0x6f, 0x5d, 0xbf, 0x26, 0x12, 0x2b, 0x43, 0xef, 0x44, 0x57, 0xf7, 0x33, 0x30, 0x17, 0xb8, 0x53, 0x34, 0xa5, 0x9e, 0xda, 0xd1, 0x9c, 0x11, 0x98, 0xbf, 0xce, 0x99, 0x45, 0xc6, 0x0f, 0xba, 0x5a, 0x6f, 0x5d, 0x73, 0x08, 0xf9, 0xf3, 0x50, 0x14, 0xe4, 0x5d, 0xcb, 0xc5, 0xba, 0xdd, 0xb6, 0x8c, 0xbb, 0xb8, 0x39, 0x02, 0xf5, 0x9f, 0xf5, 0x2d, 0xd5, 0x4e, 0x08, 0x4e, 0x98, 0xeb, 0x20, 0x07, 0xbd, 0x8a, 0x6a, 0x74, 0x1c, 0xdb, 0xf5, 0x63, 0x18, 0xbf, 0x21, 0x56, 0x2a, 0xc0, 0xd5, 0x29, 0xac, 0x5c, 0x83, 0x02, 0x7d, 0x1c, 0x35, 0x24, 0xff, 0x9c, 0x13, 0x4d, 0xf6, 0x50, 0x3c, 0x71, 0xe8, 0x76, 0xc7, 0xd1, 0xdc, 0x51, 0xf2, 0xdf, 0x5f, 0x88, 0xc4, 0xc1, 0x21, 0x3c, 0x71, 0xf8, 0xfb, 0x0e, 0x26, 0xd5, 0x7e, 0x04, 0x86, 0x6f, 0x8a, 0xc4, 0x21, 0x30, 0x9c, 0x42, 0x34, 0x0c, 0x23, 0x50, 0xfc, 0xa5, 0xa0, 0x10, 0x18, 0x42, 0xf1, 0xa9, 0x5e, 0xa1, 0x75, 0x71, 0xdb, 0xf0, 0x7c, 0x97, 0xb5, 0xc2, 0x47, 0x53, 0x7d, 0xeb, 0xed, 0x68, 0x13, 0xa6, 0x84, 0xa0, 0xe5, 0xeb, 0x30, 0xd5, 0xd7, 0x62, 0xa0, 0xb8, 0xff, 0x5f, 0x29, 0xfe, 0xf4, 0xbb, 0x3c, 0x19, 0x45, 0x3b, 0x8c, 0xf2, 0x1a, 0x59, 0xf7, 0x68, 0x1f, 0x10, 0x4f, 0xf6, 0xd2, 0xbb, 0xc1, 0xd2, 0x47, 0xda, 0x80, 0xf2, 0x35, 0x98, 0x8c, 0xf4, 0x00, 0xf1, 0x54, 0x9f, 0xe3, 0x54, 0xf9, 0x70, 0x0b, 0x50, 0xbe, 0x08, 0x29, 0x52, 0xcf, 0xe3, 0xe1, 0x3f, 0xc3, 0xe1, 0x54, 0xbd, 0xfc, 0x71, 0xc8, 0x88, 0x3a, 0x1e, 0x0f, 0xfd, 0x59, 0x0e, 0x0d, 0x20, 0x04, 0x2e, 0x6a, 0x78, 0x3c, 0xfc, 0xe7, 0x04, 0x5c, 0x40, 0x08, 0x7c, 0x74, 0x17, 0x7e, 0xfb, 0x17, 0x52, 0x3c, 0x0f, 0x0b, 0xdf, 0x5d, 0x85, 0x09, 0x5e, 0xbc, 0xe3, 0xd1, 0x9f, 0xe7, 0x2f, 0x17, 0x88, 0xf2, 0x33, 0x90, 0x1e, 0xd1, 0xe1, 0xbf, 0xc8, 0xa1, 0x4c, 0xbf, 0x5c, 0x85, 0x5c, 0xa8, 0x60, 0xc7, 0xc3, 0x7f, 0x89, 0xc3, 0xc3, 0x28, 0x62, 0x3a, 0x2f, 0xd8, 0xf1, 0x04, 0xbf, 0x2c, 0x4c, 0xe7, 0x08, 0xe2, 0x36, 0x51, 0xab, 0xe3, 0xd1, 0xbf, 0x22, 0xbc, 0x2e, 0x20, 0xe5, 0x67, 0x21, 0x1b, 0xe4, 0xdf, 0x78, 0xfc, 0xaf, 0x72, 0x7c, 0x0f, 0x43, 0x3c, 0x10, 0xca, 0xff, 0xf1, 0x14, 0xbf, 0x26, 0x3c, 0x10, 0x42, 0x91, 0x6d, 0xd4, 0x5f, 0xd3, 0xe3, 0x99, 0x7e, 0x5d, 0x6c, 0xa3, 0xbe, 0x92, 0x4e, 0x56, 0x93, 0xa6, 0xc1, 0x78, 0x8a, 0xdf, 0x10, 0xab, 0x49, 0xf5, 0x89, 0x19, 0xfd, 0x45, 0x32, 0x9e, 0xe3, 0x0b, 0xc2, 0x8c, 0xbe, 0x1a, 0x59, 0xde, 0x02, 0x34, 0x58, 0x20, 0xe3, 0xf9, 0xbe, 0xc8, 0xf9, 0xa6, 0x07, 0xea, 0x63, 0xf9, 0x39, 0x38, 0x31, 0xbc, 0x38, 0xc6, 0xb3, 0x7e, 0xe9, 0xdd, 0xbe, 0xe3, 0x4c, 0xb8, 0x36, 0x96, 0xb7, 0x7b, 0x59, 0x36, 0x5c, 0x18, 0xe3, 0x69, 0x5f, 0x7e, 0x37, 0x9a, 0x68, 0xc3, 0x75, 0xb1, 0x5c, 0x01, 0xe8, 0xd5, 0xa4, 0x78, 0xae, 0x57, 0x38, 0x57, 0x08, 0x44, 0xb6, 0x06, 0x2f, 0x49, 0xf1, 0xf8, 0x2f, 0x8b, 0xad, 0xc1, 0x11, 0x64, 0x6b, 0x88, 0x6a, 0x14, 0x8f, 0x7e, 0x55, 0x6c, 0x0d, 0x01, 0x29, 0x5f, 0x85, 0x8c, 0xd5, 0x35, 0x4d, 0x12, 0x5b, 0xe8, 0xe8, 0x7f, 0xc9, 0x2a, 0xfe, 0xeb, 0x03, 0x0e, 0x16, 0x80, 0xf2, 0x45, 0x48, 0xe3, 0xce, 0x2e, 0x6e, 0xc6, 0x21, 0xff, 0xed, 0x81, 0xc8, 0x27, 0x44, 0xbb, 0xfc, 0x2c, 0x00, 0x3b, 0x4c, 0xd3, 0x0f, 0x45, 0x31, 0xd8, 0x7f, 0x7f, 0xc0, 0xff, 0x59, 0xa2, 0x07, 0xe9, 0x11, 0xb0, 0x7f, 0xbd, 0x38, 0x9a, 0xe0, 0xed, 0x28, 0x01, 0x3d, 0x80, 0x5f, 0x81, 0x89, 0x9b, 0x9e, 0x6d, 0xf9, 0x5a, 0x3b, 0x0e, 0xfd, 0x1f, 0x1c, 0x2d, 0xf4, 0x89, 0xc3, 0x3a, 0xb6, 0x8b, 0x7d, 0xad, 0xed, 0xc5, 0x61, 0xff, 0x93, 0x63, 0x03, 0x00, 0x01, 0xeb, 0x9a, 0xe7, 0x8f, 0x32, 0xef, 0x1f, 0x08, 0xb0, 0x00, 0x10, 0xa3, 0xc9, 0xef, 0x5b, 0x78, 0x3f, 0x0e, 0xfb, 0x8e, 0x30, 0x9a, 0xeb, 0x97, 0x3f, 0x0e, 0x59, 0xf2, 0x93, 0xfd, 0x07, 0x54, 0x0c, 0xf8, 0xbf, 0x38, 0xb8, 0x87, 0x20, 0x6f, 0xf6, 0xfc, 0xa6, 0x6f, 0xc4, 0x3b, 0xfb, 0xbf, 0xf9, 0x4a, 0x0b, 0xfd, 0x72, 0x05, 0x72, 0x9e, 0xdf, 0x6c, 0x76, 0x79, 0x47, 0x13, 0x03, 0xff, 0x9f, 0x07, 0xc1, 0x21, 0x37, 0xc0, 0x2c, 0xd7, 0x86, 0xdf, 0xd7, 0xc1, 0xaa, 0xbd, 0x6a, 0xb3, 0x9b, 0xba, 0x17, 0x16, 0xe2, 0xaf, 0xdc, 0xe0, 0x7f, 0x53, 0x30, 0x15, 0x4c, 0x49, 0xdc, 0xbd, 0x05, 0x82, 0xb9, 0xe3, 0xdd, 0xda, 0x2d, 0xfc, 0x4d, 0x12, 0x32, 0x55, 0xcd, 0xf3, 0xb5, 0x3b, 0xda, 0x3e, 0x72, 0x60, 0x86, 0xfc, 0x5e, 0xd7, 0x1c, 0x7a, 0x07, 0xc4, 0x37, 0x1d, 0xbf, 0x18, 0xfd, 0xc8, 0x52, 0xef, 0xad, 0x02, 0xb1, 0x34, 0x44, 0x9d, 0x7e, 0x50, 0x5e, 0x96, 0x5f, 0xff, 0xa7, 0xd3, 0x63, 0x3f, 0xff, 0xcf, 0xa7, 0x33, 0xeb, 0xfb, 0xcf, 0x19, 0xa6, 0x67, 0x5b, 0xca, 0x30, 0x6a, 0xf4, 0x39, 0x09, 0x1e, 0x1e, 0x22, 0xdf, 0xe0, 0x3b, 0x93, 0x7f, 0x5e, 0xb8, 0x30, 0xe2, 0xab, 0x05, 0x8c, 0x99, 0x90, 0x8f, 0xbc, 0xfe, 0xa8, 0xd7, 0xcc, 0xdd, 0x80, 0xe2, 0x61, 0x33, 0x41, 0x32, 0x24, 0x6f, 0xe1, 0x7d, 0xfe, 0x5f, 0x69, 0xe4, 0x27, 0x3a, 0xdb, 0xfb, 0xdf, 0x3d, 0x69, 0x31, 0x77, 0x7e, 0x3a, 0x64, 0x1d, 0x7f, 0x19, 0x1b, 0x2f, 0x27, 0x2e, 0x4b, 0x73, 0x1a, 0xcc, 0xc7, 0x59, 0xfa, 0xff, 0x7c, 0xc5, 0x42, 0x09, 0xc6, 0x99, 0x10, 0xcd, 0x42, 0xba, 0x6e, 0xf9, 0x97, 0x2e, 0x50, 0xaa, 0xa4, 0xc2, 0x1e, 0x96, 0xd7, 0x5e, 0xbf, 0x5f, 0x1a, 0xfb, 0xee, 0xfd, 0xd2, 0xd8, 0x3f, 0xdc, 0x2f, 0x8d, 0xbd, 0x71, 0xbf, 0x24, 0xbd, 0x75, 0xbf, 0x24, 0xbd, 0x73, 0xbf, 0x24, 0xbd, 0x77, 0xbf, 0x24, 0xdd, 0x3b, 0x28, 0x49, 0x5f, 0x39, 0x28, 0x49, 0x5f, 0x3b, 0x28, 0x49, 0xdf, 0x3a, 0x28, 0x49, 0xdf, 0x3e, 0x28, 0x49, 0xaf, 0x1f, 0x94, 0xc6, 0xbe, 0x7b, 0x50, 0x1a, 0x7b, 0xe3, 0xa0, 0x24, 0xbd, 0x75, 0x50, 0x1a, 0x7b, 0xe7, 0xa0, 0x24, 0xbd, 0x77, 0x50, 0x1a, 0xbb, 0xf7, 0xfd, 0xd2, 0xd8, 0xff, 0x05, 0x00, 0x00, 0xff, 0xff, 0x17, 0x52, 0x12, 0x1d, 0x0c, 0x33, 0x00, 0x00, } r := bytes.NewReader(gzipped) gzipr, err := gzip.NewReader(r) if err != nil { panic(err) } ungzipped, err := ioutil.ReadAll(gzipr) if err != nil { panic(err) } if err := proto.Unmarshal(ungzipped, d); err != nil { panic(err) } return d } func (this *Castaway) VerboseEqual(that interface{}) error { if that == nil { if this == nil { return nil } return fmt.Errorf("that == nil && this != nil") } that1, ok := that.(*Castaway) if !ok { that2, ok := that.(Castaway) if ok { that1 = &that2 } else { return fmt.Errorf("that is not of type *Castaway") } } if that1 == nil { if this == nil { return nil } return fmt.Errorf("that is type *Castaway but is nil && this != nil") } else if this == nil { return fmt.Errorf("that is type *Castaway but is not nil && this == nil") } if len(this.CastMapValueMessage) != len(that1.CastMapValueMessage) { return fmt.Errorf("CastMapValueMessage this(%v) Not Equal that(%v)", len(this.CastMapValueMessage), len(that1.CastMapValueMessage)) } for i := range this.CastMapValueMessage { a := (Wilson)(this.CastMapValueMessage[i]) b := (Wilson)(that1.CastMapValueMessage[i]) if !(&a).Equal(&b) { return fmt.Errorf("CastMapValueMessage this[%v](%v) Not Equal that[%v](%v)", i, this.CastMapValueMessage[i], i, that1.CastMapValueMessage[i]) } } if len(this.CastMapValueMessageNullable) != len(that1.CastMapValueMessageNullable) { return fmt.Errorf("CastMapValueMessageNullable this(%v) Not Equal that(%v)", len(this.CastMapValueMessageNullable), len(that1.CastMapValueMessageNullable)) } for i := range this.CastMapValueMessageNullable { a := (*Wilson)(this.CastMapValueMessageNullable[i]) b := (*Wilson)(that1.CastMapValueMessageNullable[i]) if !a.Equal(b) { return fmt.Errorf("CastMapValueMessageNullable this[%v](%v) Not Equal that[%v](%v)", i, this.CastMapValueMessageNullable[i], i, that1.CastMapValueMessageNullable[i]) } } if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) } return nil } func (this *Castaway) Equal(that interface{}) bool { if that == nil { return this == nil } that1, ok := that.(*Castaway) if !ok { that2, ok := that.(Castaway) if ok { that1 = &that2 } else { return false } } if that1 == nil { return this == nil } else if this == nil { return false } if len(this.CastMapValueMessage) != len(that1.CastMapValueMessage) { return false } for i := range this.CastMapValueMessage { a := (Wilson)(this.CastMapValueMessage[i]) b := (Wilson)(that1.CastMapValueMessage[i]) if !(&a).Equal(&b) { return false } } if len(this.CastMapValueMessageNullable) != len(that1.CastMapValueMessageNullable) { return false } for i := range this.CastMapValueMessageNullable { a := (*Wilson)(this.CastMapValueMessageNullable[i]) b := (*Wilson)(that1.CastMapValueMessageNullable[i]) if !a.Equal(b) { return false } } if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { return false } return true } func (this *Wilson) VerboseEqual(that interface{}) error { if that == nil { if this == nil { return nil } return fmt.Errorf("that == nil && this != nil") } that1, ok := that.(*Wilson) if !ok { that2, ok := that.(Wilson) if ok { that1 = &that2 } else { return fmt.Errorf("that is not of type *Wilson") } } if that1 == nil { if this == nil { return nil } return fmt.Errorf("that is type *Wilson but is nil && this != nil") } else if this == nil { return fmt.Errorf("that is type *Wilson but is not nil && this == nil") } if this.Int64 != nil && that1.Int64 != nil { if *this.Int64 != *that1.Int64 { return fmt.Errorf("Int64 this(%v) Not Equal that(%v)", *this.Int64, *that1.Int64) } } else if this.Int64 != nil { return fmt.Errorf("this.Int64 == nil && that.Int64 != nil") } else if that1.Int64 != nil { return fmt.Errorf("Int64 this(%v) Not Equal that(%v)", this.Int64, that1.Int64) } if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) } return nil } func (this *Wilson) Equal(that interface{}) bool { if that == nil { return this == nil } that1, ok := that.(*Wilson) if !ok { that2, ok := that.(Wilson) if ok { that1 = &that2 } else { return false } } if that1 == nil { return this == nil } else if this == nil { return false } if this.Int64 != nil && that1.Int64 != nil { if *this.Int64 != *that1.Int64 { return false } } else if this.Int64 != nil { return false } else if that1.Int64 != nil { return false } if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { return false } return true } type CastawayFace interface { Proto() proto.Message GetCastMapValueMessage() map[int32]MyWilson GetCastMapValueMessageNullable() map[int32]*MyWilson } func (this *Castaway) Proto() proto.Message { return this } func (this *Castaway) TestProto() proto.Message { return NewCastawayFromFace(this) } func (this *Castaway) GetCastMapValueMessage() map[int32]MyWilson { return this.CastMapValueMessage } func (this *Castaway) GetCastMapValueMessageNullable() map[int32]*MyWilson { return this.CastMapValueMessageNullable } func NewCastawayFromFace(that CastawayFace) *Castaway { this := &Castaway{} this.CastMapValueMessage = that.GetCastMapValueMessage() this.CastMapValueMessageNullable = that.GetCastMapValueMessageNullable() return this } type WilsonFace interface { Proto() proto.Message GetInt64() *int64 } func (this *Wilson) Proto() proto.Message { return this } func (this *Wilson) TestProto() proto.Message { return NewWilsonFromFace(this) } func (this *Wilson) GetInt64() *int64 { return this.Int64 } func NewWilsonFromFace(that WilsonFace) *Wilson { this := &Wilson{} this.Int64 = that.GetInt64() return this } func (this *Castaway) GoString() string { if this == nil { return "nil" } s := make([]string, 0, 6) s = append(s, "&castvalue.Castaway{") keysForCastMapValueMessage := make([]int32, 0, len(this.CastMapValueMessage)) for k := range this.CastMapValueMessage { keysForCastMapValueMessage = append(keysForCastMapValueMessage, k) } sortkeys.Int32s(keysForCastMapValueMessage) mapStringForCastMapValueMessage := "map[int32]MyWilson{" for _, k := range keysForCastMapValueMessage { mapStringForCastMapValueMessage += fmt.Sprintf("%#v: %#v,", k, this.CastMapValueMessage[k]) } mapStringForCastMapValueMessage += "}" if this.CastMapValueMessage != nil { s = append(s, "CastMapValueMessage: "+mapStringForCastMapValueMessage+",\n") } keysForCastMapValueMessageNullable := make([]int32, 0, len(this.CastMapValueMessageNullable)) for k := range this.CastMapValueMessageNullable { keysForCastMapValueMessageNullable = append(keysForCastMapValueMessageNullable, k) } sortkeys.Int32s(keysForCastMapValueMessageNullable) mapStringForCastMapValueMessageNullable := "map[int32]*MyWilson{" for _, k := range keysForCastMapValueMessageNullable { mapStringForCastMapValueMessageNullable += fmt.Sprintf("%#v: %#v,", k, this.CastMapValueMessageNullable[k]) } mapStringForCastMapValueMessageNullable += "}" if this.CastMapValueMessageNullable != nil { s = append(s, "CastMapValueMessageNullable: "+mapStringForCastMapValueMessageNullable+",\n") } if this.XXX_unrecognized != nil { s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") } s = append(s, "}") return strings.Join(s, "") } func (this *Wilson) GoString() string { if this == nil { return "nil" } s := make([]string, 0, 5) s = append(s, "&castvalue.Wilson{") if this.Int64 != nil { s = append(s, "Int64: "+valueToGoStringCastvalue(this.Int64, "int64")+",\n") } if this.XXX_unrecognized != nil { s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") } s = append(s, "}") return strings.Join(s, "") } func valueToGoStringCastvalue(v interface{}, typ string) string { rv := reflect.ValueOf(v) if rv.IsNil() { return "nil" } pv := reflect.Indirect(rv).Interface() return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv) } func NewPopulatedCastaway(r randyCastvalue, easy bool) *Castaway { this := &Castaway{} if r.Intn(10) != 0 { v1 := r.Intn(10) this.CastMapValueMessage = make(map[int32]MyWilson) for i := 0; i < v1; i++ { this.CastMapValueMessage[int32(r.Int31())] = (MyWilson)(*NewPopulatedWilson(r, easy)) } } if r.Intn(10) != 0 { v2 := r.Intn(10) this.CastMapValueMessageNullable = make(map[int32]*MyWilson) for i := 0; i < v2; i++ { this.CastMapValueMessageNullable[int32(r.Int31())] = (*MyWilson)(NewPopulatedWilson(r, easy)) } } if !easy && r.Intn(10) != 0 { this.XXX_unrecognized = randUnrecognizedCastvalue(r, 3) } return this } func NewPopulatedWilson(r randyCastvalue, easy bool) *Wilson { this := &Wilson{} if r.Intn(10) != 0 { v3 := int64(r.Int63()) if r.Intn(2) == 0 { v3 *= -1 } this.Int64 = &v3 } if !easy && r.Intn(10) != 0 { this.XXX_unrecognized = randUnrecognizedCastvalue(r, 2) } return this } type randyCastvalue interface { Float32() float32 Float64() float64 Int63() int64 Int31() int32 Uint32() uint32 Intn(n int) int } func randUTF8RuneCastvalue(r randyCastvalue) rune { ru := r.Intn(62) if ru < 10 { return rune(ru + 48) } else if ru < 36 { return rune(ru + 55) } return rune(ru + 61) } func randStringCastvalue(r randyCastvalue) string { v4 := r.Intn(100) tmps := make([]rune, v4) for i := 0; i < v4; i++ { tmps[i] = randUTF8RuneCastvalue(r) } return string(tmps) } func randUnrecognizedCastvalue(r randyCastvalue, maxFieldNumber int) (dAtA []byte) { l := r.Intn(5) for i := 0; i < l; i++ { wire := r.Intn(4) if wire == 3 { wire = 5 } fieldNumber := maxFieldNumber + r.Intn(100) dAtA = randFieldCastvalue(dAtA, r, fieldNumber, wire) } return dAtA } func randFieldCastvalue(dAtA []byte, r randyCastvalue, fieldNumber int, wire int) []byte { key := uint32(fieldNumber)<<3 | uint32(wire) switch wire { case 0: dAtA = encodeVarintPopulateCastvalue(dAtA, uint64(key)) v5 := r.Int63() if r.Intn(2) == 0 { v5 *= -1 } dAtA = encodeVarintPopulateCastvalue(dAtA, uint64(v5)) case 1: dAtA = encodeVarintPopulateCastvalue(dAtA, uint64(key)) dAtA = append(dAtA, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256))) case 2: dAtA = encodeVarintPopulateCastvalue(dAtA, uint64(key)) ll := r.Intn(100) dAtA = encodeVarintPopulateCastvalue(dAtA, uint64(ll)) for j := 0; j < ll; j++ { dAtA = append(dAtA, byte(r.Intn(256))) } default: dAtA = encodeVarintPopulateCastvalue(dAtA, uint64(key)) dAtA = append(dAtA, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256))) } return dAtA } func encodeVarintPopulateCastvalue(dAtA []byte, v uint64) []byte { for v >= 1<<7 { dAtA = append(dAtA, uint8(uint64(v)&0x7f|0x80)) v >>= 7 } dAtA = append(dAtA, uint8(v)) return dAtA } func (m *Castaway) Size() (n int) { var l int _ = l if len(m.CastMapValueMessage) > 0 { for k, v := range m.CastMapValueMessage { _ = k _ = v l = ((*Wilson)(&v)).Size() mapEntrySize := 1 + sovCastvalue(uint64(k)) + 1 + l + sovCastvalue(uint64(l)) n += mapEntrySize + 1 + sovCastvalue(uint64(mapEntrySize)) } } if len(m.CastMapValueMessageNullable) > 0 { for k, v := range m.CastMapValueMessageNullable { _ = k _ = v l = 0 if v != nil { l = ((*Wilson)(v)).Size() l += 1 + sovCastvalue(uint64(l)) } mapEntrySize := 1 + sovCastvalue(uint64(k)) + l n += mapEntrySize + 1 + sovCastvalue(uint64(mapEntrySize)) } } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) } return n } func (m *Wilson) Size() (n int) { var l int _ = l if m.Int64 != nil { n += 1 + sovCastvalue(uint64(*m.Int64)) } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) } return n } func sovCastvalue(x uint64) (n int) { for { n++ x >>= 7 if x == 0 { break } } return n } func sozCastvalue(x uint64) (n int) { return sovCastvalue(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } func (this *Castaway) String() string { if this == nil { return "nil" } keysForCastMapValueMessage := make([]int32, 0, len(this.CastMapValueMessage)) for k := range this.CastMapValueMessage { keysForCastMapValueMessage = append(keysForCastMapValueMessage, k) } sortkeys.Int32s(keysForCastMapValueMessage) mapStringForCastMapValueMessage := "map[int32]MyWilson{" for _, k := range keysForCastMapValueMessage { mapStringForCastMapValueMessage += fmt.Sprintf("%v: %v,", k, this.CastMapValueMessage[k]) } mapStringForCastMapValueMessage += "}" keysForCastMapValueMessageNullable := make([]int32, 0, len(this.CastMapValueMessageNullable)) for k := range this.CastMapValueMessageNullable { keysForCastMapValueMessageNullable = append(keysForCastMapValueMessageNullable, k) } sortkeys.Int32s(keysForCastMapValueMessageNullable) mapStringForCastMapValueMessageNullable := "map[int32]*MyWilson{" for _, k := range keysForCastMapValueMessageNullable { mapStringForCastMapValueMessageNullable += fmt.Sprintf("%v: %v,", k, this.CastMapValueMessageNullable[k]) } mapStringForCastMapValueMessageNullable += "}" s := strings.Join([]string{`&Castaway{`, `CastMapValueMessage:` + mapStringForCastMapValueMessage + `,`, `CastMapValueMessageNullable:` + mapStringForCastMapValueMessageNullable + `,`, `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, `}`, }, "") return s } func (this *Wilson) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&Wilson{`, `Int64:` + valueToStringCastvalue(this.Int64) + `,`, `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, `}`, }, "") return s } func valueToStringCastvalue(v interface{}) string { rv := reflect.ValueOf(v) if rv.IsNil() { return "nil" } pv := reflect.Indirect(rv).Interface() return fmt.Sprintf("*%v", pv) } func init() { proto.RegisterFile("castvalue.proto", fileDescriptorCastvalue) } var fileDescriptorCastvalue = []byte{ // 342 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x4f, 0x4e, 0x2c, 0x2e, 0x29, 0x4b, 0xcc, 0x29, 0x4d, 0xd5, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x84, 0x0b, 0x48, 0xe9, 0xa6, 0x67, 0x96, 0x64, 0x94, 0x26, 0xe9, 0x25, 0xe7, 0xe7, 0xea, 0xa7, 0xe7, 0xa7, 0xe7, 0xeb, 0x83, 0x55, 0x24, 0x95, 0xa6, 0x81, 0x79, 0x60, 0x0e, 0x98, 0x05, 0xd1, 0xa9, 0x74, 0x90, 0x99, 0x8b, 0xc3, 0x39, 0xb1, 0xb8, 0x24, 0xb1, 0x3c, 0xb1, 0x52, 0xa8, 0x80, 0x4b, 0x18, 0xc4, 0xf6, 0x4d, 0x2c, 0x08, 0x03, 0x99, 0xe5, 0x9b, 0x5a, 0x5c, 0x9c, 0x98, 0x9e, 0x2a, 0xc1, 0xa8, 0xc0, 0xac, 0xc1, 0x6d, 0xa4, 0xa3, 0x87, 0xb0, 0x15, 0xa6, 0x43, 0x0f, 0x8b, 0x72, 0xd7, 0xbc, 0x92, 0xa2, 0x4a, 0x27, 0x81, 0x13, 0xf7, 0xe4, 0x19, 0xba, 0xee, 0xcb, 0x73, 0xf8, 0x56, 0x86, 0x67, 0xe6, 0x14, 0xe7, 0xe7, 0x05, 0x61, 0x33, 0x5a, 0xa8, 0x85, 0x91, 0x4b, 0x1a, 0x8b, 0xb8, 0x5f, 0x69, 0x4e, 0x4e, 0x62, 0x52, 0x4e, 0xaa, 0x04, 0x13, 0xd8, 0x6a, 0x13, 0x22, 0xad, 0x86, 0x69, 0x83, 0x38, 0x81, 0x07, 0xc5, 0x7a, 0x7c, 0xd6, 0x48, 0x45, 0x72, 0x49, 0xe0, 0xf2, 0x89, 0x90, 0x00, 0x17, 0x73, 0x76, 0x6a, 0xa5, 0x04, 0xa3, 0x02, 0xa3, 0x06, 0x6b, 0x10, 0x88, 0x29, 0xa4, 0xce, 0xc5, 0x0a, 0x76, 0x8b, 0x04, 0x93, 0x02, 0xa3, 0x06, 0xb7, 0x91, 0x20, 0x92, 0xeb, 0xa0, 0x96, 0x41, 0xe4, 0xad, 0x98, 0x2c, 0x18, 0xa5, 0x12, 0xb9, 0x14, 0x08, 0xb9, 0x94, 0x42, 0x2b, 0x94, 0xe4, 0xb8, 0xd8, 0x20, 0x82, 0x42, 0x22, 0x5c, 0xac, 0x9e, 0x79, 0x25, 0x66, 0x26, 0x60, 0xa3, 0x98, 0x83, 0x20, 0x1c, 0x27, 0x9f, 0x13, 0x0f, 0xe5, 0x18, 0x2e, 0x3c, 0x94, 0x63, 0xb8, 0xf1, 0x50, 0x8e, 0xe1, 0xc1, 0x43, 0x39, 0xc6, 0x17, 0x0f, 0xe5, 0x18, 0x3f, 0x3c, 0x94, 0x63, 0xfc, 0xf1, 0x50, 0x8e, 0xb1, 0xe1, 0x91, 0x1c, 0xe3, 0x8a, 0x47, 0x72, 0x8c, 0x1b, 0x1e, 0xc9, 0x31, 0xee, 0x78, 0x24, 0xc7, 0x78, 0xe0, 0x91, 0x1c, 0xe3, 0x89, 0x47, 0x72, 0x0c, 0x17, 0x1e, 0xc9, 0x31, 0x3c, 0x78, 0x24, 0xc7, 0xf8, 0xe2, 0x91, 0x1c, 0xc3, 0x87, 0x47, 0x72, 0x8c, 0x3f, 0x1e, 0xc9, 0x31, 0x34, 0x3c, 0x96, 0x63, 0x00, 0x04, 0x00, 0x00, 0xff, 0xff, 0x7b, 0x8b, 0x19, 0x68, 0x7d, 0x02, 0x00, 0x00, }
{ "pile_set_name": "Github" }
PIE 2 TYPE 200 TEXTURE 0 page-12-player-buildings.png 256 256 LEVELS 1 LEVEL 1 POINTS 8 -64 0 -64 64 0 -64 64 0 64 -64 0 64 -34 3 -51 34 3 -51 34 3 51 -34 3 51 POLYGONS 4 200 3 3 2 1 188 101 210 101 210 125 200 3 3 1 0 188 101 210 125 188 125 200 3 7 6 5 237 234 247 234 247 249 200 3 7 5 4 237 234 247 249 237 249
{ "pile_set_name": "Github" }
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010-2012 OpenStack 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 # # 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. """ Utilities for memcache encryption and integrity check. """ import base64 import functools import hashlib import json import os # make sure pycrypt is available try: from Crypto.Cipher import AES except ImportError: AES = None # prefix marker indicating data is HMACed (signed by a secret key) MAC_MARKER = '{MAC:SHA1}' # prefix marker indicating data is encrypted ENCRYPT_MARKER = '{ENCRYPT:AES256}' class InvalidMacError(Exception): """ raise when unable to verify MACed data This usually indicates that data had been expectedly modified in memcache. """ pass class DecryptError(Exception): """ raise when unable to decrypt encrypted data """ pass class CryptoUnavailableError(Exception): """ raise when Python Crypto module is not available """ pass def assert_crypto_availability(f): """ Ensure Crypto module is available. """ @functools.wraps(f) def wrapper(*args, **kwds): if AES is None: raise CryptoUnavailableError() return f(*args, **kwds) return wrapper def generate_aes_key(token, secret): """ Generates and returns a 256 bit AES key, based on sha256 hash. """ return hashlib.sha256(token + secret).digest() def compute_mac(token, serialized_data): """ Computes and returns the base64 encoded MAC. """ return hash_data(serialized_data + token) def hash_data(data): """ Return the base64 encoded SHA1 hash of the data. """ return base64.b64encode(hashlib.sha1(data).digest()) def sign_data(token, data): """ MAC the data using SHA1. """ mac_data = {} mac_data['serialized_data'] = json.dumps(data) mac = compute_mac(token, mac_data['serialized_data']) mac_data['mac'] = mac md = MAC_MARKER + base64.b64encode(json.dumps(mac_data)) return md def verify_signed_data(token, data): """ Verify data integrity by ensuring MAC is valid. """ if data.startswith(MAC_MARKER): try: data = data[len(MAC_MARKER):] mac_data = json.loads(base64.b64decode(data)) mac = compute_mac(token, mac_data['serialized_data']) if mac != mac_data['mac']: raise InvalidMacError('invalid MAC; expect=%s, actual=%s' % (mac_data['mac'], mac)) return json.loads(mac_data['serialized_data']) except: raise InvalidMacError('invalid MAC; data appeared to be corrupted') else: # doesn't appear to be MACed data return data @assert_crypto_availability def encrypt_data(token, secret, data): """ Encryptes the data with the given secret key. """ iv = os.urandom(16) aes_key = generate_aes_key(token, secret) cipher = AES.new(aes_key, AES.MODE_CFB, iv) data = json.dumps(data) encoded_data = base64.b64encode(iv + cipher.encrypt(data)) encoded_data = ENCRYPT_MARKER + encoded_data return encoded_data @assert_crypto_availability def decrypt_data(token, secret, data): """ Decrypt the data with the given secret key. """ if data.startswith(ENCRYPT_MARKER): try: # encrypted data encoded_data = data[len(ENCRYPT_MARKER):] aes_key = generate_aes_key(token, secret) decoded_data = base64.b64decode(encoded_data) iv = decoded_data[:16] encrypted_data = decoded_data[16:] cipher = AES.new(aes_key, AES.MODE_CFB, iv) decrypted_data = cipher.decrypt(encrypted_data) return json.loads(decrypted_data) except: raise DecryptError('data appeared to be corrupted') else: # doesn't appear to be encrypted data return data
{ "pile_set_name": "Github" }
import '../iterablehelpers'; import { tap } from 'ix/iterable/operators'; import { defer, sequenceEqual, toArray, whileDo } from 'ix/iterable'; test('Iterable#while some', () => { let x = 5; const res = toArray( whileDo( defer(() => tap({ next: () => x-- })([x])), () => x > 0 ) ); expect(sequenceEqual(res, [5, 4, 3, 2, 1])).toBeTruthy(); }); test('Iterable#while none', () => { let x = 0; const res = toArray( whileDo( defer(() => tap({ next: () => x-- })([x])), () => x > 0 ) ); expect(sequenceEqual(res, [])).toBeTruthy(); });
{ "pile_set_name": "Github" }
// Copyright 2013 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. // +build darwin package ipv6 import ( "unsafe" "golang.org/x/net/internal/iana" "golang.org/x/net/internal/socket" ) func marshal2292HopLimit(b []byte, cm *ControlMessage) []byte { m := socket.ControlMessage(b) m.MarshalHeader(iana.ProtocolIPv6, sysIPV6_2292HOPLIMIT, 4) if cm != nil { socket.NativeEndian.PutUint32(m.Data(4), uint32(cm.HopLimit)) } return m.Next(4) } func marshal2292PacketInfo(b []byte, cm *ControlMessage) []byte { m := socket.ControlMessage(b) m.MarshalHeader(iana.ProtocolIPv6, sysIPV6_2292PKTINFO, sizeofInet6Pktinfo) if cm != nil { pi := (*inet6Pktinfo)(unsafe.Pointer(&m.Data(sizeofInet6Pktinfo)[0])) if ip := cm.Src.To16(); ip != nil && ip.To4() == nil { copy(pi.Addr[:], ip) } if cm.IfIndex > 0 { pi.setIfindex(cm.IfIndex) } } return m.Next(sizeofInet6Pktinfo) } func marshal2292NextHop(b []byte, cm *ControlMessage) []byte { m := socket.ControlMessage(b) m.MarshalHeader(iana.ProtocolIPv6, sysIPV6_2292NEXTHOP, sizeofSockaddrInet6) if cm != nil { sa := (*sockaddrInet6)(unsafe.Pointer(&m.Data(sizeofSockaddrInet6)[0])) sa.setSockaddr(cm.NextHop, cm.IfIndex) } return m.Next(sizeofSockaddrInet6) }
{ "pile_set_name": "Github" }
/* Icon Font: <%= font_name %> */ <%= font_face %> .fl { } <% scale = %w|12 14 16 18 21 24 36 48 60 72| %> <% scale.each do |n| %> .fl-<%= n %> { font-size: <%= n %>px; } <% end %> [data-icon]:before { content: attr(data-icon); } [data-icon]:before, <%= glyph_selectors %> { <%= glyph_properties %> } <%= glyphs %>
{ "pile_set_name": "Github" }
using System.Collections.Generic; using Essensoft.AspNetCore.Payment.Alipay.Response; namespace Essensoft.AspNetCore.Payment.Alipay.Request { /// <summary> /// alipay.ebpp.invoice.auth.unsign /// </summary> public class AlipayEbppInvoiceAuthUnsignRequest : IAlipayRequest<AlipayEbppInvoiceAuthUnsignResponse> { /// <summary> /// 发票授权关系解约 /// </summary> public string BizContent { get; set; } #region IAlipayRequest Members private bool needEncrypt = false; private string apiVersion = "1.0"; private string terminalType; private string terminalInfo; private string prodCode; private string notifyUrl; private string returnUrl; private AlipayObject bizModel; public void SetNeedEncrypt(bool needEncrypt) { this.needEncrypt = needEncrypt; } public bool GetNeedEncrypt() { return needEncrypt; } public void SetNotifyUrl(string notifyUrl) { this.notifyUrl = notifyUrl; } public string GetNotifyUrl() { return notifyUrl; } public void SetReturnUrl(string returnUrl) { this.returnUrl = returnUrl; } public string GetReturnUrl() { return returnUrl; } public void SetTerminalType(string terminalType) { this.terminalType = terminalType; } public string GetTerminalType() { return terminalType; } public void SetTerminalInfo(string terminalInfo) { this.terminalInfo = terminalInfo; } public string GetTerminalInfo() { return terminalInfo; } public void SetProdCode(string prodCode) { this.prodCode = prodCode; } public string GetProdCode() { return prodCode; } public string GetApiName() { return "alipay.ebpp.invoice.auth.unsign"; } public void SetApiVersion(string apiVersion) { this.apiVersion = apiVersion; } public string GetApiVersion() { return apiVersion; } public IDictionary<string, string> GetParameters() { var parameters = new AlipayDictionary { { "biz_content", BizContent } }; return parameters; } public AlipayObject GetBizModel() { return bizModel; } public void SetBizModel(AlipayObject bizModel) { this.bizModel = bizModel; } #endregion } }
{ "pile_set_name": "Github" }
<!-- HTML header for doxygen 1.8.4--> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <meta name="generator" content="Doxygen 1.8.13"/> <title>Fermat: cugar::vector_type&lt; int, 3 &gt; Struct Template Reference</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="dynsections.js"></script> <link href="search/search.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="search/searchdata.js"></script> <script type="text/javascript" src="search/search.js"></script> <link href="doxygen.css" rel="stylesheet" type="text/css" /> <link href="extra_stylesheet.css" rel="stylesheet" type="text/css"/> <script type="text/javascript"> (function(i, s, o, g, r, a, m) { i['GoogleAnalyticsObject'] = r; i[r] = i[r] || function() { (i[r].q = i[r].q || []).push(arguments) }, i[r].l = 1 * new Date(); a = s.createElement(o), m = s.getElementsByTagName(o)[0]; a.async = 1; a.src = g; m.parentNode.insertBefore(a, m) })(window, document, 'script', '//www.google-analytics.com/analytics.js', 'ga'); ga('create', 'UA-47310325-1', 'nvlabs.github.io'); ga('send', 'pageview'); </script> </head> <body> <div id="top"><!-- do not remove this div, it is closed by doxygen! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td style="padding-left: 0.5em;"> <div id="projectname">Fermat </div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <!-- Generated by Doxygen 1.8.13 --> <script type="text/javascript"> var searchBox = new SearchBox("searchBox", "search",false,'Search'); </script> <script type="text/javascript" src="menudata.js"></script> <script type="text/javascript" src="menu.js"></script> <script type="text/javascript"> $(function() { initMenu('',true,false,'search.php','Search'); $(document).ready(function() { init_search(); }); }); </script> <div id="main-nav"></div> <!-- window showing the filter options --> <div id="MSearchSelectWindow" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> </div> <!-- iframe showing the search results (closed by default) --> <div id="MSearchResultsWindow"> <iframe src="javascript:void(0)" frameborder="0" name="MSearchResults" id="MSearchResults"> </iframe> </div> <div id="nav-path" class="navpath"> <ul> <li class="navelem"><a class="el" href="namespacecugar.html">cugar</a></li><li class="navelem"><a class="el" href="structcugar_1_1vector__type_3_01int_00_013_01_4.html">vector_type&lt; int, 3 &gt;</a></li> </ul> </div> </div><!-- top --> <div class="header"> <div class="summary"> <a href="#pub-types">Public Types</a> &#124; <a href="#pub-static-methods">Static Public Methods</a> &#124; <a href="structcugar_1_1vector__type_3_01int_00_013_01_4-members.html">List of all members</a> </div> <div class="headertitle"> <div class="title">cugar::vector_type&lt; int, 3 &gt; Struct Template Reference<div class="ingroups"><a class="el" href="group___basic.html">Basic</a> &raquo; <a class="el" href="group___vector_types_module.html">Vector Types</a></div></div> </div> </div><!--header--> <div class="contents"> <table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-types"></a> Public Types</h2></td></tr> <tr class="memitem:a501a3d5571716029df892b2e03eae802"><td class="memItemLeft" align="right" valign="top"><a id="a501a3d5571716029df892b2e03eae802"></a> typedef int3&#160;</td><td class="memItemRight" valign="bottom"><b>type</b></td></tr> <tr class="separator:a501a3d5571716029df892b2e03eae802"><td class="memSeparator" colspan="2">&#160;</td></tr> </table><table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-methods"></a> Static Public Methods</h2></td></tr> <tr class="memitem:aaae01ee72c18d1b999ba761008e89322"><td class="memItemLeft" align="right" valign="top"><a id="aaae01ee72c18d1b999ba761008e89322"></a> CUGAR_FORCEINLINE static CUGAR_HOST_DEVICE type&#160;</td><td class="memItemRight" valign="bottom"><b>make</b> (const int i1, const int i2, const int i3)</td></tr> <tr class="separator:aaae01ee72c18d1b999ba761008e89322"><td class="memSeparator" colspan="2">&#160;</td></tr> </table> <hr/>The documentation for this struct was generated from the following file:<ul> <li>C:/p4research/research/jpantaleoni/Fermat-Public/contrib/cugar/basic/<a class="el" href="numbers_8h_source.html">numbers.h</a></li> </ul> </div><!-- contents --> <!-- start footer part --> <hr class="footer"/><address class="footer"><small> Generated by &#160;<a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/> </a> 1.8.13 </small></address> </body> </html>
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>com.defcon.sortDescriptor</key> <array> <dict> <key>ascending</key> <array> <string>uni00A0</string> <string>A</string> <string>Agrave</string> <string>Aacute</string> <string>Acircumflex</string> <string>Atilde</string> <string>Adieresis</string> <string>Aring</string> <string>Amacron</string> <string>Abreve</string> <string>Aogonek</string> <string>Aringacute</string> <string>Adotbelow</string> <string>B</string> <string>C</string> <string>Ccedilla</string> <string>Cacute</string> <string>Ccircumflex</string> <string>Cdotaccent</string> <string>Ccaron</string> <string>D</string> <string>Dcaron</string> <string>E</string> <string>Egrave</string> <string>Eacute</string> <string>Ecircumflex</string> <string>Edieresis</string> <string>Emacron</string> <string>Ebreve</string> <string>Edotaccent</string> <string>Eogonek</string> <string>Ecaron</string> <string>Edotbelow</string> <string>Etilde</string> <string>F</string> <string>G</string> <string>Gcircumflex</string> <string>Gbreve</string> <string>Gdotaccent</string> <string>Gcommaaccent</string> <string>Gcaron</string> <string>H</string> <string>Hcircumflex</string> <string>I</string> <string>Igrave</string> <string>Iacute</string> <string>Icircumflex</string> <string>Idieresis</string> <string>Itilde</string> <string>Imacron</string> <string>Ibreve</string> <string>Iogonek</string> <string>Idotaccent</string> <string>Idotbelow</string> <string>J</string> <string>Jcircumflex</string> <string>K</string> <string>Kcommaaccent</string> <string>L</string> <string>Lacute</string> <string>Lcommaaccent</string> <string>Lcaron</string> <string>M</string> <string>N</string> <string>Ntilde</string> <string>Nacute</string> <string>Ncommaaccent</string> <string>Ncaron</string> <string>O</string> <string>Ograve</string> <string>Oacute</string> <string>Ocircumflex</string> <string>Otilde</string> <string>Odieresis</string> <string>Omacron</string> <string>Obreve</string> <string>Ohungarumlaut</string> <string>Oogonek</string> <string>Odotbelow</string> <string>P</string> <string>Q</string> <string>R</string> <string>Racute</string> <string>Rcommaaccent</string> <string>Rcaron</string> <string>S</string> <string>Sacute</string> <string>Scircumflex</string> <string>Scedilla</string> <string>Scaron</string> <string>Scommaaccent</string> <string>T</string> <string>uni0162</string> <string>Tcaron</string> <string>uni021A</string> <string>U</string> <string>Ugrave</string> <string>Uacute</string> <string>Ucircumflex</string> <string>Udieresis</string> <string>Utilde</string> <string>Umacron</string> <string>Ubreve</string> <string>Uring</string> <string>Uhungarumlaut</string> <string>Uogonek</string> <string>Udotbelow</string> <string>V</string> <string>W</string> <string>Wcircumflex</string> <string>Wgrave</string> <string>Wacute</string> <string>Wdieresis</string> <string>X</string> <string>Y</string> <string>Yacute</string> <string>Ycircumflex</string> <string>Ydieresis</string> <string>Ymacron</string> <string>Ygrave</string> <string>Ytilde</string> <string>Z</string> <string>Zacute</string> <string>Zdotaccent</string> <string>Zcaron</string> <string>AE</string> <string>AEacute</string> <string>Eth</string> <string>Oslash</string> <string>Oslashacute</string> <string>Thorn</string> <string>Dcroat</string> <string>Hbar</string> <string>IJ</string> <string>Ldot</string> <string>Lslash</string> <string>Eng</string> <string>OE</string> <string>Tbar</string> <string>Schwa</string> <string>Nhookleft</string> <string>uni1E9E</string> <string>uni2126</string> <string>a</string> <string>agrave</string> <string>aacute</string> <string>acircumflex</string> <string>atilde</string> <string>adieresis</string> <string>aring</string> <string>amacron</string> <string>abreve</string> <string>aogonek</string> <string>aringacute</string> <string>adotbelow</string> <string>b</string> <string>c</string> <string>ccedilla</string> <string>cacute</string> <string>ccircumflex</string> <string>cdotaccent</string> <string>ccaron</string> <string>d</string> <string>dcaron</string> <string>e</string> <string>egrave</string> <string>eacute</string> <string>ecircumflex</string> <string>edieresis</string> <string>emacron</string> <string>ebreve</string> <string>edotaccent</string> <string>eogonek</string> <string>ecaron</string> <string>edotbelow</string> <string>etilde</string> <string>f</string> <string>g</string> <string>gcircumflex</string> <string>gbreve</string> <string>gdotaccent</string> <string>gcommaaccent</string> <string>gcaron</string> <string>h</string> <string>hcircumflex</string> <string>i</string> <string>igrave</string> <string>iacute</string> <string>icircumflex</string> <string>idieresis</string> <string>itilde</string> <string>imacron</string> <string>ibreve</string> <string>iogonek</string> <string>idotbelow</string> <string>j</string> <string>jcircumflex</string> <string>k</string> <string>kcommaaccent</string> <string>l</string> <string>lacute</string> <string>lcommaaccent</string> <string>lcaron</string> <string>m</string> <string>n</string> <string>ntilde</string> <string>nacute</string> <string>ncommaaccent</string> <string>ncaron</string> <string>o</string> <string>ograve</string> <string>oacute</string> <string>ocircumflex</string> <string>otilde</string> <string>odieresis</string> <string>omacron</string> <string>obreve</string> <string>ohungarumlaut</string> <string>oogonek</string> <string>odotbelow</string> <string>p</string> <string>q</string> <string>r</string> <string>racute</string> <string>rcommaaccent</string> <string>rcaron</string> <string>s</string> <string>sacute</string> <string>scircumflex</string> <string>scedilla</string> <string>scaron</string> <string>scommaaccent</string> <string>t</string> <string>uni0163</string> <string>tcaron</string> <string>uni021B</string> <string>u</string> <string>ugrave</string> <string>uacute</string> <string>ucircumflex</string> <string>udieresis</string> <string>utilde</string> <string>umacron</string> <string>ubreve</string> <string>uring</string> <string>uhungarumlaut</string> <string>uogonek</string> <string>udotbelow</string> <string>v</string> <string>w</string> <string>wcircumflex</string> <string>wgrave</string> <string>wacute</string> <string>wdieresis</string> <string>x</string> <string>y</string> <string>yacute</string> <string>ydieresis</string> <string>ycircumflex</string> <string>ymacron</string> <string>ygrave</string> <string>ytilde</string> <string>z</string> <string>zacute</string> <string>zdotaccent</string> <string>zcaron</string> <string>germandbls</string> <string>ae</string> <string>aeacute</string> <string>eth</string> <string>oslash</string> <string>oslashacute</string> <string>thorn</string> <string>dcroat</string> <string>hbar</string> <string>dotlessi</string> <string>ij</string> <string>kgreenlandic</string> <string>ldot</string> <string>lslash</string> <string>napostrophe</string> <string>eng</string> <string>oe</string> <string>tbar</string> <string>dotlessj</string> <string>schwa</string> <string>nhookleft</string> <string>pi</string> <string>ordfeminine</string> <string>ordmasculine</string> <string>gravecomb</string> <string>acutecomb</string> <string>circumflexcomb</string> <string>tildecomb</string> <string>macroncomb</string> <string>brevecomb</string> <string>dotaccentcomb</string> <string>dieresiscomb</string> <string>ringcomb</string> <string>hungarumlautcomb</string> <string>caroncomb</string> <string>commaturnedabovecomb</string> <string>commaaboverightcomb</string> <string>dotbelowcomb</string> <string>commaaccentcomb</string> <string>cedillacomb</string> <string>ogonekcomb</string> <string>zero</string> <string>one</string> <string>two</string> <string>three</string> <string>four</string> <string>five</string> <string>six</string> <string>seven</string> <string>eight</string> <string>nine</string> <string>onesuperior</string> <string>twosuperior</string> <string>threesuperior</string> <string>onequarter</string> <string>onehalf</string> <string>threequarters</string> <string>underscore</string> <string>hyphen</string> <string>endash</string> <string>emdash</string> <string>parenleft</string> <string>parenright</string> <string>bracketleft</string> <string>bracketright</string> <string>braceleft</string> <string>braceright</string> <string>numbersign</string> <string>percent</string> <string>perthousand</string> <string>quotesingle</string> <string>quotedbl</string> <string>quoteleft</string> <string>quoteright</string> <string>quotedblleft</string> <string>quotedblright</string> <string>quotesinglbase</string> <string>quotedblbase</string> <string>guilsinglleft</string> <string>guilsinglright</string> <string>guillemotleft</string> <string>guillemotright</string> <string>asterisk</string> <string>dagger</string> <string>daggerdbl</string> <string>period</string> <string>comma</string> <string>colon</string> <string>semicolon</string> <string>ellipsis</string> <string>exclam</string> <string>exclamdown</string> <string>question</string> <string>questiondown</string> <string>slash</string> <string>backslash</string> <string>fraction</string> <string>bar</string> <string>brokenbar</string> <string>at</string> <string>ampersand</string> <string>section</string> <string>paragraph</string> <string>uni2113</string> <string>periodcentered</string> <string>bullet</string> <string>overline</string> <string>plus</string> <string>minus</string> <string>plusminus</string> <string>divide</string> <string>multiply</string> <string>equal</string> <string>less</string> <string>greater</string> <string>lessequal</string> <string>greaterequal</string> <string>approxequal</string> <string>notequal</string> <string>logicalnot</string> <string>uni2190</string> <string>uni2191</string> <string>uni2192</string> <string>uni2193</string> <string>partialdiff</string> <string>uni2206</string> <string>product</string> <string>summation</string> <string>uni00B5</string> <string>uni2215</string> <string>radical</string> <string>infinity</string> <string>integral</string> <string>uni2261</string> <string>dollar</string> <string>cent</string> <string>sterling</string> <string>currency</string> <string>yen</string> <string>Euro</string> <string>florin</string> <string>asciicircum</string> <string>asciitilde</string> <string>acute</string> <string>grave</string> <string>hungarumlaut</string> <string>circumflex</string> <string>caron</string> <string>breve</string> <string>tilde</string> <string>macron</string> <string>dieresis</string> <string>dotaccent</string> <string>ring</string> <string>cedilla</string> <string>ogonek</string> <string>copyright</string> <string>registered</string> <string>trademark</string> <string>degree</string> <string>estimated</string> <string>lozenge</string> <string>uni00AD</string> <string>ijacute</string> <string>IJacute</string> <string>bitcoin</string> <string>dotlessij</string> <string>flatg</string> <string>ringacute</string> <string>gravecomb.case</string> <string>acutecomb.case</string> <string>circumflexcomb.case</string> <string>tildecomb.case</string> <string>macroncomb.case</string> <string>brevecomb.case</string> <string>dotaccentcomb.case</string> <string>dieresiscomb.case</string> <string>ringcomb.case</string> <string>hungarumlautcomb.case</string> <string>caroncomb.case</string> <string>commaturnedabovecomb.case</string> <string>commaaboverightcomb.case</string> <string>dotbelowcomb.case</string> <string>commaaccentcomb.case</string> <string>cedillacomb.case</string> <string>ogonekcomb.case</string> <string>ringacute.case</string> <string>dollar.lower</string> <string>a.roman</string> <string>f.roman</string> <string>g.roman</string> <string>i.roman</string> <string>l.roman</string> <string>r.roman</string> <string>y.roman</string> <string>a.italic</string> <string>f.italic</string> <string>g.italic</string> <string>i.italic</string> <string>l.italic</string> <string>r.italic</string> <string>y.italic</string> <string>a.ss01</string> <string>g.ss01</string> <string>Z.noserif</string> </array> <key>type</key> <string>glyphList</string> </dict> </array> <key>com.typemytype.glyphBuilder.lastSavedFileName</key> <string>recursive-diacritics-for-latin-refined</string> <key>com.typemytype.robofont.compileSettings.MacRomanFirst</key> <integer>1</integer> <key>com.typemytype.robofont.compileSettings.autohint</key> <true/> <key>com.typemytype.robofont.compileSettings.checkOutlines</key> <integer>1</integer> <key>com.typemytype.robofont.compileSettings.createDummyDSIG</key> <true/> <key>com.typemytype.robofont.compileSettings.decompose</key> <integer>1</integer> <key>com.typemytype.robofont.compileSettings.generateFormat</key> <integer>0</integer> <key>com.typemytype.robofont.compileSettings.layerName</key> <string>foreground</string> <key>com.typemytype.robofont.compileSettings.path</key> <string>/Users/stephennixon/Dropbox/KABK_netherlands/type_media/000-casual-mono/generated-fonts/Recursive Mono v0.0.10-Micro Bold.otf</string> <key>com.typemytype.robofont.compileSettings.releaseMode</key> <false/> <key>com.typemytype.robofont.italicSlantOffset</key> <integer>0</integer> <key>com.typemytype.robofont.segmentType</key> <string>curve</string> <key>com.typemytype.robofont.shouldAddPointsInSplineConversion</key> <integer>1</integer> <key>public.glyphOrder</key> <array> <string>uni00A0</string> <string>A</string> <string>Agrave</string> <string>Aacute</string> <string>Acircumflex</string> <string>Atilde</string> <string>Adieresis</string> <string>Aring</string> <string>Amacron</string> <string>Abreve</string> <string>Aogonek</string> <string>Aringacute</string> <string>Adotbelow</string> <string>B</string> <string>C</string> <string>Ccedilla</string> <string>Cacute</string> <string>Ccircumflex</string> <string>Cdotaccent</string> <string>Ccaron</string> <string>D</string> <string>Dcaron</string> <string>E</string> <string>Egrave</string> <string>Eacute</string> <string>Ecircumflex</string> <string>Edieresis</string> <string>Emacron</string> <string>Ebreve</string> <string>Edotaccent</string> <string>Eogonek</string> <string>Ecaron</string> <string>Edotbelow</string> <string>Etilde</string> <string>F</string> <string>G</string> <string>Gcircumflex</string> <string>Gbreve</string> <string>Gdotaccent</string> <string>Gcommaaccent</string> <string>Gcaron</string> <string>H</string> <string>Hcircumflex</string> <string>I</string> <string>Igrave</string> <string>Iacute</string> <string>Icircumflex</string> <string>Idieresis</string> <string>Itilde</string> <string>Imacron</string> <string>Ibreve</string> <string>Iogonek</string> <string>Idotaccent</string> <string>Idotbelow</string> <string>J</string> <string>Jcircumflex</string> <string>K</string> <string>Kcommaaccent</string> <string>L</string> <string>Lacute</string> <string>Lcommaaccent</string> <string>Lcaron</string> <string>M</string> <string>N</string> <string>Ntilde</string> <string>Nacute</string> <string>Ncommaaccent</string> <string>Ncaron</string> <string>O</string> <string>Ograve</string> <string>Oacute</string> <string>Ocircumflex</string> <string>Otilde</string> <string>Odieresis</string> <string>Omacron</string> <string>Obreve</string> <string>Ohungarumlaut</string> <string>Oogonek</string> <string>Odotbelow</string> <string>P</string> <string>Q</string> <string>R</string> <string>Racute</string> <string>Rcommaaccent</string> <string>Rcaron</string> <string>S</string> <string>Sacute</string> <string>Scircumflex</string> <string>Scedilla</string> <string>Scaron</string> <string>Scommaaccent</string> <string>T</string> <string>uni0162</string> <string>Tcaron</string> <string>uni021A</string> <string>U</string> <string>Ugrave</string> <string>Uacute</string> <string>Ucircumflex</string> <string>Udieresis</string> <string>Utilde</string> <string>Umacron</string> <string>Ubreve</string> <string>Uring</string> <string>Uhungarumlaut</string> <string>Uogonek</string> <string>Udotbelow</string> <string>V</string> <string>W</string> <string>Wcircumflex</string> <string>Wgrave</string> <string>Wacute</string> <string>Wdieresis</string> <string>X</string> <string>Y</string> <string>Yacute</string> <string>Ycircumflex</string> <string>Ydieresis</string> <string>Ymacron</string> <string>Ygrave</string> <string>Ytilde</string> <string>Z</string> <string>Zacute</string> <string>Zdotaccent</string> <string>Zcaron</string> <string>AE</string> <string>AEacute</string> <string>Eth</string> <string>Oslash</string> <string>Oslashacute</string> <string>Thorn</string> <string>Dcroat</string> <string>Hbar</string> <string>IJ</string> <string>Ldot</string> <string>Lslash</string> <string>Eng</string> <string>OE</string> <string>Tbar</string> <string>Schwa</string> <string>Nhookleft</string> <string>uni1E9E</string> <string>uni2126</string> <string>a</string> <string>agrave</string> <string>aacute</string> <string>acircumflex</string> <string>atilde</string> <string>adieresis</string> <string>aring</string> <string>amacron</string> <string>abreve</string> <string>aogonek</string> <string>aringacute</string> <string>adotbelow</string> <string>b</string> <string>c</string> <string>ccedilla</string> <string>cacute</string> <string>ccircumflex</string> <string>cdotaccent</string> <string>ccaron</string> <string>d</string> <string>dcaron</string> <string>e</string> <string>egrave</string> <string>eacute</string> <string>ecircumflex</string> <string>edieresis</string> <string>emacron</string> <string>ebreve</string> <string>edotaccent</string> <string>eogonek</string> <string>ecaron</string> <string>edotbelow</string> <string>etilde</string> <string>f</string> <string>g</string> <string>gcircumflex</string> <string>gbreve</string> <string>gdotaccent</string> <string>gcommaaccent</string> <string>gcaron</string> <string>h</string> <string>hcircumflex</string> <string>i</string> <string>igrave</string> <string>iacute</string> <string>icircumflex</string> <string>idieresis</string> <string>itilde</string> <string>imacron</string> <string>ibreve</string> <string>iogonek</string> <string>idotbelow</string> <string>j</string> <string>jcircumflex</string> <string>k</string> <string>kcommaaccent</string> <string>l</string> <string>lacute</string> <string>lcommaaccent</string> <string>lcaron</string> <string>m</string> <string>n</string> <string>ntilde</string> <string>nacute</string> <string>ncommaaccent</string> <string>ncaron</string> <string>o</string> <string>ograve</string> <string>oacute</string> <string>ocircumflex</string> <string>otilde</string> <string>odieresis</string> <string>omacron</string> <string>obreve</string> <string>ohungarumlaut</string> <string>oogonek</string> <string>odotbelow</string> <string>p</string> <string>q</string> <string>r</string> <string>racute</string> <string>rcommaaccent</string> <string>rcaron</string> <string>s</string> <string>sacute</string> <string>scircumflex</string> <string>scedilla</string> <string>scaron</string> <string>scommaaccent</string> <string>t</string> <string>uni0163</string> <string>tcaron</string> <string>uni021B</string> <string>u</string> <string>ugrave</string> <string>uacute</string> <string>ucircumflex</string> <string>udieresis</string> <string>utilde</string> <string>umacron</string> <string>ubreve</string> <string>uring</string> <string>uhungarumlaut</string> <string>uogonek</string> <string>udotbelow</string> <string>v</string> <string>w</string> <string>wcircumflex</string> <string>wgrave</string> <string>wacute</string> <string>wdieresis</string> <string>x</string> <string>y</string> <string>yacute</string> <string>ydieresis</string> <string>ycircumflex</string> <string>ymacron</string> <string>ygrave</string> <string>ytilde</string> <string>z</string> <string>zacute</string> <string>zdotaccent</string> <string>zcaron</string> <string>germandbls</string> <string>ae</string> <string>aeacute</string> <string>eth</string> <string>oslash</string> <string>oslashacute</string> <string>thorn</string> <string>dcroat</string> <string>hbar</string> <string>dotlessi</string> <string>ij</string> <string>kgreenlandic</string> <string>ldot</string> <string>lslash</string> <string>napostrophe</string> <string>eng</string> <string>oe</string> <string>tbar</string> <string>dotlessj</string> <string>schwa</string> <string>nhookleft</string> <string>pi</string> <string>ordfeminine</string> <string>ordmasculine</string> <string>gravecomb</string> <string>acutecomb</string> <string>circumflexcomb</string> <string>tildecomb</string> <string>macroncomb</string> <string>brevecomb</string> <string>dotaccentcomb</string> <string>dieresiscomb</string> <string>ringcomb</string> <string>hungarumlautcomb</string> <string>caroncomb</string> <string>commaturnedabovecomb</string> <string>commaaboverightcomb</string> <string>dotbelowcomb</string> <string>commaaccentcomb</string> <string>cedillacomb</string> <string>ogonekcomb</string> <string>zero</string> <string>one</string> <string>two</string> <string>three</string> <string>four</string> <string>five</string> <string>six</string> <string>seven</string> <string>eight</string> <string>nine</string> <string>onesuperior</string> <string>twosuperior</string> <string>threesuperior</string> <string>onequarter</string> <string>onehalf</string> <string>threequarters</string> <string>underscore</string> <string>hyphen</string> <string>endash</string> <string>emdash</string> <string>parenleft</string> <string>parenright</string> <string>bracketleft</string> <string>bracketright</string> <string>braceleft</string> <string>braceright</string> <string>numbersign</string> <string>percent</string> <string>perthousand</string> <string>quotesingle</string> <string>quotedbl</string> <string>quoteleft</string> <string>quoteright</string> <string>quotedblleft</string> <string>quotedblright</string> <string>quotesinglbase</string> <string>quotedblbase</string> <string>guilsinglleft</string> <string>guilsinglright</string> <string>guillemotleft</string> <string>guillemotright</string> <string>asterisk</string> <string>dagger</string> <string>daggerdbl</string> <string>period</string> <string>comma</string> <string>colon</string> <string>semicolon</string> <string>ellipsis</string> <string>exclam</string> <string>exclamdown</string> <string>question</string> <string>questiondown</string> <string>slash</string> <string>backslash</string> <string>fraction</string> <string>bar</string> <string>brokenbar</string> <string>at</string> <string>ampersand</string> <string>section</string> <string>paragraph</string> <string>uni2113</string> <string>periodcentered</string> <string>bullet</string> <string>overline</string> <string>plus</string> <string>minus</string> <string>plusminus</string> <string>divide</string> <string>multiply</string> <string>equal</string> <string>less</string> <string>greater</string> <string>lessequal</string> <string>greaterequal</string> <string>approxequal</string> <string>notequal</string> <string>logicalnot</string> <string>uni2190</string> <string>uni2191</string> <string>uni2192</string> <string>uni2193</string> <string>partialdiff</string> <string>uni2206</string> <string>product</string> <string>summation</string> <string>uni00B5</string> <string>uni2215</string> <string>radical</string> <string>infinity</string> <string>integral</string> <string>uni2261</string> <string>dollar</string> <string>cent</string> <string>sterling</string> <string>currency</string> <string>yen</string> <string>Euro</string> <string>florin</string> <string>asciicircum</string> <string>asciitilde</string> <string>acute</string> <string>grave</string> <string>hungarumlaut</string> <string>circumflex</string> <string>caron</string> <string>breve</string> <string>tilde</string> <string>macron</string> <string>dieresis</string> <string>dotaccent</string> <string>ring</string> <string>cedilla</string> <string>ogonek</string> <string>copyright</string> <string>registered</string> <string>trademark</string> <string>degree</string> <string>estimated</string> <string>lozenge</string> <string>uni00AD</string> <string>ijacute</string> <string>IJacute</string> <string>bitcoin</string> <string>dotlessij</string> <string>flatg</string> <string>ringacute</string> <string>gravecomb.case</string> <string>acutecomb.case</string> <string>circumflexcomb.case</string> <string>tildecomb.case</string> <string>macroncomb.case</string> <string>brevecomb.case</string> <string>dotaccentcomb.case</string> <string>dieresiscomb.case</string> <string>ringcomb.case</string> <string>hungarumlautcomb.case</string> <string>caroncomb.case</string> <string>commaturnedabovecomb.case</string> <string>commaaboverightcomb.case</string> <string>dotbelowcomb.case</string> <string>commaaccentcomb.case</string> <string>cedillacomb.case</string> <string>ogonekcomb.case</string> <string>ringacute.case</string> <string>dollar.lower</string> <string>a.roman</string> <string>f.roman</string> <string>g.roman</string> <string>i.roman</string> <string>l.roman</string> <string>r.roman</string> <string>y.roman</string> <string>a.italic</string> <string>f.italic</string> <string>g.italic</string> <string>i.italic</string> <string>l.italic</string> <string>r.italic</string> <string>y.italic</string> <string>a.ss01</string> <string>g.ss01</string> <string>Z.noserif</string> <string>space</string> </array> </dict> </plist>
{ "pile_set_name": "Github" }
CREATE TABLE list (id VARCHAR(2) NOT NULL, value VARCHAR(64) NOT NULL, PRIMARY KEY(id)); INSERT INTO "list" ("id", "value") VALUES ('ff', 'Fulah'); INSERT INTO "list" ("id", "value") VALUES ('ff_CM', 'Fulah (Cameroon)'); INSERT INTO "list" ("id", "value") VALUES ('ff_GN', 'Fulah (Guinea)'); INSERT INTO "list" ("id", "value") VALUES ('ff_MR', 'Fulah (Mauritania)'); INSERT INTO "list" ("id", "value") VALUES ('ff_SN', 'Fulah (Senegal)'); INSERT INTO "list" ("id", "value") VALUES ('no', 'Norwegian'); INSERT INTO "list" ("id", "value") VALUES ('no_NO', 'Norwegian (Norway)'); INSERT INTO "list" ("id", "value") VALUES ('os', 'Ossetic'); INSERT INTO "list" ("id", "value") VALUES ('os_GE', 'Ossetic (Georgia)'); INSERT INTO "list" ("id", "value") VALUES ('os_RU', 'Ossetic (Russia)'); INSERT INTO "list" ("id", "value") VALUES ('gd', 'Scottish Gaelic'); INSERT INTO "list" ("id", "value") VALUES ('gd_GB', 'Scottish Gaelic (United Kingdom)'); INSERT INTO "list" ("id", "value") VALUES ('sh', 'Serbo-Croatian'); INSERT INTO "list" ("id", "value") VALUES ('sh_BA', 'Serbo-Croatian (Bosnia & Herzegovina)'); INSERT INTO "list" ("id", "value") VALUES ('tl', 'Tagalog'); INSERT INTO "list" ("id", "value") VALUES ('tl_PH', 'Tagalog (Philippines)'); INSERT INTO "list" ("id", "value") VALUES ('yi', 'Yiddish'); INSERT INTO "list" ("id", "value") VALUES ('en', 'अंग्रेजी'); INSERT INTO "list" ("id", "value") VALUES ('en_AS', 'अंग्रेजी (अमेरिकी समोआ)'); INSERT INTO "list" ("id", "value") VALUES ('en_AU', 'अंग्रेजी (अष्ट्रेलिया)'); INSERT INTO "list" ("id", "value") VALUES ('en_IM', 'अंग्रेजी (आइज्ले अफ् म्यान)'); INSERT INTO "list" ("id", "value") VALUES ('en_AI', 'अंग्रेजी (आङ्गुइला)'); INSERT INTO "list" ("id", "value") VALUES ('en_IE', 'अंग्रेजी (आयरल्याण्ड)'); INSERT INTO "list" ("id", "value") VALUES ('en_MP', 'अंग्रेजी (उत्तरी मारिआना टापु)'); INSERT INTO "list" ("id", "value") VALUES ('en_AG', 'अंग्रेजी (एन्टिगुआ र बारबुडा)'); INSERT INTO "list" ("id", "value") VALUES ('en_ER', 'अंग्रेजी (एरित्रिया)'); INSERT INTO "list" ("id", "value") VALUES ('en_KI', 'अंग्रेजी (किरिबाटी)'); INSERT INTO "list" ("id", "value") VALUES ('en_CK', 'अंग्रेजी (कुक टापुहरु)'); INSERT INTO "list" ("id", "value") VALUES ('en_KE', 'अंग्रेजी (केन्या)'); INSERT INTO "list" ("id", "value") VALUES ('en_KY', 'अंग्रेजी (केयमान टापु)'); INSERT INTO "list" ("id", "value") VALUES ('en_CC', 'अंग्रेजी (कोकोस (किलिंग) टापुहरु)'); INSERT INTO "list" ("id", "value") VALUES ('en_CA', 'अंग्रेजी (क्यानाडा)'); INSERT INTO "list" ("id", "value") VALUES ('en_CM', 'अंग्रेजी (क्यामरून)'); INSERT INTO "list" ("id", "value") VALUES ('en_CX', 'अंग्रेजी (क्रिष्टमस टापु)'); INSERT INTO "list" ("id", "value") VALUES ('en_GM', 'अंग्रेजी (गाम्विया)'); INSERT INTO "list" ("id", "value") VALUES ('en_GG', 'अंग्रेजी (गुएर्नसे)'); INSERT INTO "list" ("id", "value") VALUES ('en_GY', 'अंग्रेजी (गुयाना)'); INSERT INTO "list" ("id", "value") VALUES ('en_GU', 'अंग्रेजी (गुवाम)'); INSERT INTO "list" ("id", "value") VALUES ('en_GD', 'अंग्रेजी (ग्रेनाडा)'); INSERT INTO "list" ("id", "value") VALUES ('en_GH', 'अंग्रेजी (घाना)'); INSERT INTO "list" ("id", "value") VALUES ('en_JM', 'अंग्रेजी (जमाइका)'); INSERT INTO "list" ("id", "value") VALUES ('en_JE', 'अंग्रेजी (जर्सी)'); INSERT INTO "list" ("id", "value") VALUES ('en_ZM', 'अंग्रेजी (जाम्बिया)'); INSERT INTO "list" ("id", "value") VALUES ('en_GI', 'अंग्रेजी (जिब्राल्टार)'); INSERT INTO "list" ("id", "value") VALUES ('en_ZW', 'अंग्रेजी (जिम्बाबे)'); INSERT INTO "list" ("id", "value") VALUES ('en_TO', 'अंग्रेजी (टोंगा)'); INSERT INTO "list" ("id", "value") VALUES ('en_DG', 'अंग्रेजी (डियगो गार्सिया)'); INSERT INTO "list" ("id", "value") VALUES ('en_DM', 'अंग्रेजी (डोमिनिका)'); INSERT INTO "list" ("id", "value") VALUES ('en_TZ', 'अंग्रेजी (तान्जानिया)'); INSERT INTO "list" ("id", "value") VALUES ('en_TV', 'अंग्रेजी (तुभालु)'); INSERT INTO "list" ("id", "value") VALUES ('en_TC', 'अंग्रेजी (तुर्क र काइकोस टापु)'); INSERT INTO "list" ("id", "value") VALUES ('en_TK', 'अंग्रेजी (तोकेलाउ)'); INSERT INTO "list" ("id", "value") VALUES ('en_TT', 'अंग्रेजी (त्रिनिडाड एण्ड टोबागो)'); INSERT INTO "list" ("id", "value") VALUES ('en_ZA', 'अंग्रेजी (दक्षिण अफ्रिका)'); INSERT INTO "list" ("id", "value") VALUES ('en_SS', 'अंग्रेजी (दक्षिणी सुडान)'); INSERT INTO "list" ("id", "value") VALUES ('en_NG', 'अंग्रेजी (नाइजेरिया)'); INSERT INTO "list" ("id", "value") VALUES ('en_NR', 'अंग्रेजी (नाउरू)'); INSERT INTO "list" ("id", "value") VALUES ('en_NA', 'अंग्रेजी (नामिबिया)'); INSERT INTO "list" ("id", "value") VALUES ('en_NU', 'अंग्रेजी (नियुइ)'); INSERT INTO "list" ("id", "value") VALUES ('en_NF', 'अंग्रेजी (नोरफोल्क टापु)'); INSERT INTO "list" ("id", "value") VALUES ('en_NZ', 'अंग्रेजी (न्युजिल्याण्ड)'); INSERT INTO "list" ("id", "value") VALUES ('en_PG', 'अंग्रेजी (पपुआ न्यू गाइनिया)'); INSERT INTO "list" ("id", "value") VALUES ('en_PW', 'अंग्रेजी (पलाउ)'); INSERT INTO "list" ("id", "value") VALUES ('en_PK', 'अंग्रेजी (पाकिस्तान)'); INSERT INTO "list" ("id", "value") VALUES ('en_PN', 'अंग्रेजी (पिटकाइर्न टापुहरु)'); INSERT INTO "list" ("id", "value") VALUES ('en_PR', 'अंग्रेजी (पुएर्टो रिको)'); INSERT INTO "list" ("id", "value") VALUES ('en_FK', 'अंग्रेजी (फकल्याण्ड टापुहरु)'); INSERT INTO "list" ("id", "value") VALUES ('en_FJ', 'अंग्रेजी (फिजी)'); INSERT INTO "list" ("id", "value") VALUES ('en_PH', 'अंग्रेजी (फिलिपिन्स)'); INSERT INTO "list" ("id", "value") VALUES ('en_BM', 'अंग्रेजी (बर्मुडा)'); INSERT INTO "list" ("id", "value") VALUES ('en_BS', 'अंग्रेजी (बहामास)'); INSERT INTO "list" ("id", "value") VALUES ('en_BB', 'अंग्रेजी (बार्बाडोस)'); INSERT INTO "list" ("id", "value") VALUES ('en_GB', 'अंग्रेजी (बेलायत)'); INSERT INTO "list" ("id", "value") VALUES ('en_VG', 'अंग्रेजी (बेलायती भर्जिन टापुहरु)'); INSERT INTO "list" ("id", "value") VALUES ('en_IO', 'अंग्रेजी (बेलायती हिन्द महासागर क्षेत्र)'); INSERT INTO "list" ("id", "value") VALUES ('en_BZ', 'अंग्रेजी (बेलिज)'); INSERT INTO "list" ("id", "value") VALUES ('en_BE', 'अंग्रेजी (बेल्जियम)'); INSERT INTO "list" ("id", "value") VALUES ('en_BW', 'अंग्रेजी (बोट्स्वाना)'); INSERT INTO "list" ("id", "value") VALUES ('en_VU', 'अंग्रेजी (भानुआतु)'); INSERT INTO "list" ("id", "value") VALUES ('en_IN', 'अंग्रेजी (भारत)'); INSERT INTO "list" ("id", "value") VALUES ('en_MO', 'अंग्रेजी (मकावो चिनिँया स्वशासित क्षेत्र)'); INSERT INTO "list" ("id", "value") VALUES ('en_MG', 'अंग्रेजी (मडागास्कर)'); INSERT INTO "list" ("id", "value") VALUES ('en_MY', 'अंग्रेजी (मलेसिया)'); INSERT INTO "list" ("id", "value") VALUES ('en_FM', 'अंग्रेजी (माइक्रोनेसिया)'); INSERT INTO "list" ("id", "value") VALUES ('en_MU', 'अंग्रेजी (माउरिटस)'); INSERT INTO "list" ("id", "value") VALUES ('en_MH', 'अंग्रेजी (मार्शल टापुहरु)'); INSERT INTO "list" ("id", "value") VALUES ('en_MW', 'अंग्रेजी (मालावी)'); INSERT INTO "list" ("id", "value") VALUES ('en_MT', 'अंग्रेजी (माल्टा)'); INSERT INTO "list" ("id", "value") VALUES ('en_MS', 'अंग्रेजी (मोन्टसेर्राट)'); INSERT INTO "list" ("id", "value") VALUES ('en_UG', 'अंग्रेजी (युगाण्डा)'); INSERT INTO "list" ("id", "value") VALUES ('en_RW', 'अंग्रेजी (रवाण्डा)'); INSERT INTO "list" ("id", "value") VALUES ('en_LR', 'अंग्रेजी (लाइबेरिया)'); INSERT INTO "list" ("id", "value") VALUES ('en_LS', 'अंग्रेजी (लेसोथो)'); INSERT INTO "list" ("id", "value") VALUES ('en_UM', 'अंग्रेजी (संयुक्त राज्य बाह्य टापुहरु)'); INSERT INTO "list" ("id", "value") VALUES ('en_VI', 'अंग्रेजी (संयुक्त राज्य भर्जिन टापुहरु)'); INSERT INTO "list" ("id", "value") VALUES ('en_US', 'अंग्रेजी (संयुक्त राज्य)'); INSERT INTO "list" ("id", "value") VALUES ('en_WS', 'अंग्रेजी (सामोआ)'); INSERT INTO "list" ("id", "value") VALUES ('en_SL', 'अंग्रेजी (सिएर्रा लिओन)'); INSERT INTO "list" ("id", "value") VALUES ('en_SG', 'अंग्रेजी (सिङ्गापुर)'); INSERT INTO "list" ("id", "value") VALUES ('en_SX', 'अंग्रेजी (सिन्ट मार्टेन)'); INSERT INTO "list" ("id", "value") VALUES ('en_SD', 'अंग्रेजी (सुडान)'); INSERT INTO "list" ("id", "value") VALUES ('en_SC', 'अंग्रेजी (सेचेलेस)'); INSERT INTO "list" ("id", "value") VALUES ('en_KN', 'अंग्रेजी (सेन्ट किट्स र नेभिस)'); INSERT INTO "list" ("id", "value") VALUES ('en_VC', 'अंग्रेजी (सेन्ट भिन्सेन्ट र ग्रेनाडिन्स)'); INSERT INTO "list" ("id", "value") VALUES ('en_LC', 'अंग्रेजी (सेन्ट लुसिया)'); INSERT INTO "list" ("id", "value") VALUES ('en_SH', 'अंग्रेजी (सेन्ट हेलेना)'); INSERT INTO "list" ("id", "value") VALUES ('en_SB', 'अंग्रेजी (सोलोमोन टापुहरु)'); INSERT INTO "list" ("id", "value") VALUES ('en_SZ', 'अंग्रेजी (स्वाजिल्याण्ड)'); INSERT INTO "list" ("id", "value") VALUES ('en_HK', 'अंग्रेजी (हङकङ चिनिया समाजवादी स्वायत्त क्षेत्र)'); INSERT INTO "list" ("id", "value") VALUES ('az', 'अजरबैजानी'); INSERT INTO "list" ("id", "value") VALUES ('az_AZ', 'अजरबैजानी (अजरबैजान)'); INSERT INTO "list" ("id", "value") VALUES ('az_Latn_AZ', 'अजरबैजानी (ल्याटिन, अजरबैजान)'); INSERT INTO "list" ("id", "value") VALUES ('az_Latn', 'अजरबैजानी (ल्याटिन)'); INSERT INTO "list" ("id", "value") VALUES ('az_Cyrl_AZ', 'अजरबैजानी (सिरिलिक, अजरबैजान)'); INSERT INTO "list" ("id", "value") VALUES ('az_Cyrl', 'अजरबैजानी (सिरिलिक)'); INSERT INTO "list" ("id", "value") VALUES ('af', 'अफ्रिकान्स'); INSERT INTO "list" ("id", "value") VALUES ('af_ZA', 'अफ्रिकान्स (दक्षिण अफ्रिका)'); INSERT INTO "list" ("id", "value") VALUES ('af_NA', 'अफ्रिकान्स (नामिबिया)'); INSERT INTO "list" ("id", "value") VALUES ('am', 'अम्हारिक'); INSERT INTO "list" ("id", "value") VALUES ('am_ET', 'अम्हारिक (इथियोपिया)'); INSERT INTO "list" ("id", "value") VALUES ('ar', 'अरबी'); INSERT INTO "list" ("id", "value") VALUES ('ar_DZ', 'अरबी (अल्जेरिया)'); INSERT INTO "list" ("id", "value") VALUES ('ar_IL', 'अरबी (इजरायल)'); INSERT INTO "list" ("id", "value") VALUES ('ar_EG', 'अरबी (इजिप्ट)'); INSERT INTO "list" ("id", "value") VALUES ('ar_IQ', 'अरबी (इराक)'); INSERT INTO "list" ("id", "value") VALUES ('ar_ER', 'अरबी (एरित्रिया)'); INSERT INTO "list" ("id", "value") VALUES ('ar_OM', 'अरबी (ओमन)'); INSERT INTO "list" ("id", "value") VALUES ('ar_QA', 'अरबी (कतार)'); INSERT INTO "list" ("id", "value") VALUES ('ar_KW', 'अरबी (कुवेत)'); INSERT INTO "list" ("id", "value") VALUES ('ar_KM', 'अरबी (कोमोरोस)'); INSERT INTO "list" ("id", "value") VALUES ('ar_TD', 'अरबी (चाड)'); INSERT INTO "list" ("id", "value") VALUES ('ar_JO', 'अरबी (जोर्डन)'); INSERT INTO "list" ("id", "value") VALUES ('ar_TN', 'अरबी (ट्युनिसिया)'); INSERT INTO "list" ("id", "value") VALUES ('ar_DJ', 'अरबी (डिजिबुटी)'); INSERT INTO "list" ("id", "value") VALUES ('ar_SS', 'अरबी (दक्षिणी सुडान)'); INSERT INTO "list" ("id", "value") VALUES ('ar_EH', 'अरबी (पश्चिमी साहारा)'); INSERT INTO "list" ("id", "value") VALUES ('ar_PS', 'अरबी (प्यालेस्टनी भू-भागहरु)'); INSERT INTO "list" ("id", "value") VALUES ('ar_BH', 'अरबी (बहराइन)'); INSERT INTO "list" ("id", "value") VALUES ('ar_MR', 'अरबी (माउरिटानिया)'); INSERT INTO "list" ("id", "value") VALUES ('ar_MA', 'अरबी (मोरोक्को)'); INSERT INTO "list" ("id", "value") VALUES ('ar_YE', 'अरबी (येमेन)'); INSERT INTO "list" ("id", "value") VALUES ('ar_LY', 'अरबी (लिबिया)'); INSERT INTO "list" ("id", "value") VALUES ('ar_LB', 'अरबी (लेबनन)'); INSERT INTO "list" ("id", "value") VALUES ('ar_AE', 'अरबी (संयुक्त अरब इमिराट्स)'); INSERT INTO "list" ("id", "value") VALUES ('ar_SA', 'अरबी (साउदी अरब)'); INSERT INTO "list" ("id", "value") VALUES ('ar_SY', 'अरबी (सिरिया)'); INSERT INTO "list" ("id", "value") VALUES ('ar_SD', 'अरबी (सुडान)'); INSERT INTO "list" ("id", "value") VALUES ('ar_SO', 'अरबी (सोमालिया)'); INSERT INTO "list" ("id", "value") VALUES ('sq', 'अल्बेनियन'); INSERT INTO "list" ("id", "value") VALUES ('sq_AL', 'अल्बेनियन (अल्बानिया)'); INSERT INTO "list" ("id", "value") VALUES ('sq_XK', 'अल्बेनियन (कोसोवो)'); INSERT INTO "list" ("id", "value") VALUES ('sq_MK', 'अल्बेनियन (म्याकेडोनिया)'); INSERT INTO "list" ("id", "value") VALUES ('ga', 'आइरिश'); INSERT INTO "list" ("id", "value") VALUES ('ga_IE', 'आइरिश (आयरल्याण्ड)'); INSERT INTO "list" ("id", "value") VALUES ('is', 'आइसल्यान्डिक'); INSERT INTO "list" ("id", "value") VALUES ('is_IS', 'आइसल्यान्डिक (आइस्ल्याण्ड)'); INSERT INTO "list" ("id", "value") VALUES ('ak', 'आकान'); INSERT INTO "list" ("id", "value") VALUES ('ak_GH', 'आकान (घाना)'); INSERT INTO "list" ("id", "value") VALUES ('hy', 'आर्मेनियाली'); INSERT INTO "list" ("id", "value") VALUES ('hy_AM', 'आर्मेनियाली (आर्मेनिया)'); INSERT INTO "list" ("id", "value") VALUES ('as', 'आसामी'); INSERT INTO "list" ("id", "value") VALUES ('as_IN', 'आसामी (भारत)'); INSERT INTO "list" ("id", "value") VALUES ('ig', 'इग्बो'); INSERT INTO "list" ("id", "value") VALUES ('ig_NG', 'इग्बो (नाइजेरिया)'); INSERT INTO "list" ("id", "value") VALUES ('it', 'इटालियन'); INSERT INTO "list" ("id", "value") VALUES ('it_IT', 'इटालियन (इटाली)'); INSERT INTO "list" ("id", "value") VALUES ('it_SM', 'इटालियन (सान् मारिनो)'); INSERT INTO "list" ("id", "value") VALUES ('it_CH', 'इटालियन (स्विजरल्याण्ड)'); INSERT INTO "list" ("id", "value") VALUES ('id', 'इन्डोनेसियाली'); INSERT INTO "list" ("id", "value") VALUES ('id_ID', 'इन्डोनेसियाली (इन्डोनेशिया)'); INSERT INTO "list" ("id", "value") VALUES ('ee', 'इवि'); INSERT INTO "list" ("id", "value") VALUES ('ee_GH', 'इवि (घाना)'); INSERT INTO "list" ("id", "value") VALUES ('ee_TG', 'इवि (टोगो)'); INSERT INTO "list" ("id", "value") VALUES ('et', 'इस्टोनियाली'); INSERT INTO "list" ("id", "value") VALUES ('et_EE', 'इस्टोनियाली (इस्टोनिया)'); INSERT INTO "list" ("id", "value") VALUES ('ug', 'उइघुर'); INSERT INTO "list" ("id", "value") VALUES ('ug_Arab_CN', 'उइघुर (अरबी, चीन)'); INSERT INTO "list" ("id", "value") VALUES ('ug_Arab', 'उइघुर (अरबी)'); INSERT INTO "list" ("id", "value") VALUES ('ug_CN', 'उइघुर (चीन)'); INSERT INTO "list" ("id", "value") VALUES ('uz', 'उज्बेकी'); INSERT INTO "list" ("id", "value") VALUES ('uz_AF', 'उज्बेकी (अफगानिस्तान)'); INSERT INTO "list" ("id", "value") VALUES ('uz_Arab_AF', 'उज्बेकी (अरबी, अफगानिस्तान)'); INSERT INTO "list" ("id", "value") VALUES ('uz_Arab', 'उज्बेकी (अरबी)'); INSERT INTO "list" ("id", "value") VALUES ('uz_UZ', 'उज्बेकी (उज्बेकिस्तान)'); INSERT INTO "list" ("id", "value") VALUES ('uz_Latn_UZ', 'उज्बेकी (ल्याटिन, उज्बेकिस्तान)'); INSERT INTO "list" ("id", "value") VALUES ('uz_Latn', 'उज्बेकी (ल्याटिन)'); INSERT INTO "list" ("id", "value") VALUES ('uz_Cyrl_UZ', 'उज्बेकी (सिरिलिक, उज्बेकिस्तान)'); INSERT INTO "list" ("id", "value") VALUES ('uz_Cyrl', 'उज्बेकी (सिरिलिक)'); INSERT INTO "list" ("id", "value") VALUES ('nd', 'उत्तर नेडेबेले'); INSERT INTO "list" ("id", "value") VALUES ('nd_ZW', 'उत्तर नेडेबेले (जिम्बाबे)'); INSERT INTO "list" ("id", "value") VALUES ('se', 'उत्तरी सामी'); INSERT INTO "list" ("id", "value") VALUES ('se_NO', 'उत्तरी सामी (नर्वे)'); INSERT INTO "list" ("id", "value") VALUES ('se_FI', 'उत्तरी सामी (फिन्ल्याण्ड)'); INSERT INTO "list" ("id", "value") VALUES ('se_SE', 'उत्तरी सामी (स्विडेन)'); INSERT INTO "list" ("id", "value") VALUES ('ur', 'उर्दु'); INSERT INTO "list" ("id", "value") VALUES ('ur_PK', 'उर्दु (पाकिस्तान)'); INSERT INTO "list" ("id", "value") VALUES ('ur_IN', 'उर्दु (भारत)'); INSERT INTO "list" ("id", "value") VALUES ('eo', 'एस्पेरान्तो'); INSERT INTO "list" ("id", "value") VALUES ('or', 'ओरिया'); INSERT INTO "list" ("id", "value") VALUES ('or_IN', 'ओरिया (भारत)'); INSERT INTO "list" ("id", "value") VALUES ('om', 'ओरोमो'); INSERT INTO "list" ("id", "value") VALUES ('om_ET', 'ओरोमो (इथियोपिया)'); INSERT INTO "list" ("id", "value") VALUES ('om_KE', 'ओरोमो (केन्या)'); INSERT INTO "list" ("id", "value") VALUES ('kn', 'कन्नाडा'); INSERT INTO "list" ("id", "value") VALUES ('kn_IN', 'कन्नाडा (भारत)'); INSERT INTO "list" ("id", "value") VALUES ('kk', 'काजाख'); INSERT INTO "list" ("id", "value") VALUES ('kk_KZ', 'काजाख (काजाकस्तान)'); INSERT INTO "list" ("id", "value") VALUES ('kk_Cyrl_KZ', 'काजाख (सिरिलिक, काजाकस्तान)'); INSERT INTO "list" ("id", "value") VALUES ('kk_Cyrl', 'काजाख (सिरिलिक)'); INSERT INTO "list" ("id", "value") VALUES ('kl', 'कालालिसुट'); INSERT INTO "list" ("id", "value") VALUES ('kl_GL', 'कालालिसुट (ग्रिनल्याण्ड)'); INSERT INTO "list" ("id", "value") VALUES ('ks', 'काश्मीरी'); INSERT INTO "list" ("id", "value") VALUES ('ks_Arab_IN', 'काश्मीरी (अरबी, भारत)'); INSERT INTO "list" ("id", "value") VALUES ('ks_Arab', 'काश्मीरी (अरबी)'); INSERT INTO "list" ("id", "value") VALUES ('ks_IN', 'काश्मीरी (भारत)'); INSERT INTO "list" ("id", "value") VALUES ('ki', 'किकुयु'); INSERT INTO "list" ("id", "value") VALUES ('ki_KE', 'किकुयु (केन्या)'); INSERT INTO "list" ("id", "value") VALUES ('rw', 'किन्यारवान्डा'); INSERT INTO "list" ("id", "value") VALUES ('rw_RW', 'किन्यारवान्डा (रवाण्डा)'); INSERT INTO "list" ("id", "value") VALUES ('ky', 'किर्गिज'); INSERT INTO "list" ("id", "value") VALUES ('ky_KG', 'किर्गिज (किर्गिस्थान)'); INSERT INTO "list" ("id", "value") VALUES ('ky_Cyrl_KG', 'किर्गिज (सिरिलिक, किर्गिस्थान)'); INSERT INTO "list" ("id", "value") VALUES ('ky_Cyrl', 'किर्गिज (सिरिलिक)'); INSERT INTO "list" ("id", "value") VALUES ('ko', 'कोरियाली'); INSERT INTO "list" ("id", "value") VALUES ('ko_KP', 'कोरियाली (उत्तर कोरिया)'); INSERT INTO "list" ("id", "value") VALUES ('ko_KR', 'कोरियाली (दक्षिण कोरिया)'); INSERT INTO "list" ("id", "value") VALUES ('kw', 'कोर्निश'); INSERT INTO "list" ("id", "value") VALUES ('kw_GB', 'कोर्निश (बेलायत)'); INSERT INTO "list" ("id", "value") VALUES ('ca', 'क्याटालन'); INSERT INTO "list" ("id", "value") VALUES ('ca_AD', 'क्याटालन (अन्डोर्रा)'); INSERT INTO "list" ("id", "value") VALUES ('ca_IT', 'क्याटालन (इटाली)'); INSERT INTO "list" ("id", "value") VALUES ('ca_FR', 'क्याटालन (फ्रान्स)'); INSERT INTO "list" ("id", "value") VALUES ('ca_ES', 'क्याटालन (स्पेन)'); INSERT INTO "list" ("id", "value") VALUES ('hr', 'क्रोएशियाली'); INSERT INTO "list" ("id", "value") VALUES ('hr_HR', 'क्रोएशियाली (क्रोएशिया)'); INSERT INTO "list" ("id", "value") VALUES ('hr_BA', 'क्रोएशियाली (बोस्निया एण्ड हर्जगोभिनिया)'); INSERT INTO "list" ("id", "value") VALUES ('qu', 'क्वेचुवा'); INSERT INTO "list" ("id", "value") VALUES ('qu_EC', 'क्वेचुवा (इक्वडेर)'); INSERT INTO "list" ("id", "value") VALUES ('qu_PE', 'क्वेचुवा (पेरू)'); INSERT INTO "list" ("id", "value") VALUES ('qu_BO', 'क्वेचुवा (बोलिभिया)'); INSERT INTO "list" ("id", "value") VALUES ('km', 'खमेर'); INSERT INTO "list" ("id", "value") VALUES ('km_KH', 'खमेर (कम्बोडिया)'); INSERT INTO "list" ("id", "value") VALUES ('gl', 'गलिसियाली'); INSERT INTO "list" ("id", "value") VALUES ('gl_ES', 'गलिसियाली (स्पेन)'); INSERT INTO "list" ("id", "value") VALUES ('lg', 'गान्डा'); INSERT INTO "list" ("id", "value") VALUES ('lg_UG', 'गान्डा (युगाण्डा)'); INSERT INTO "list" ("id", "value") VALUES ('gu', 'गुजराती'); INSERT INTO "list" ("id", "value") VALUES ('gu_IN', 'गुजराती (भारत)'); INSERT INTO "list" ("id", "value") VALUES ('el', 'ग्रीक'); INSERT INTO "list" ("id", "value") VALUES ('el_GR', 'ग्रीक (ग्रिस)'); INSERT INTO "list" ("id", "value") VALUES ('el_CY', 'ग्रीक (साइप्रस)'); INSERT INTO "list" ("id", "value") VALUES ('zh', 'चिनियाँ'); INSERT INTO "list" ("id", "value") VALUES ('zh_CN', 'चिनियाँ (चीन)'); INSERT INTO "list" ("id", "value") VALUES ('zh_TW', 'चिनियाँ (ताइवान)'); INSERT INTO "list" ("id", "value") VALUES ('zh_Hant_TW', 'चिनियाँ (परम्परागत चिनी, ताइवान)'); INSERT INTO "list" ("id", "value") VALUES ('zh_Hant_MO', 'चिनियाँ (परम्परागत चिनी, मकावो चिनिँया स्वशासित क्षेत्र)'); INSERT INTO "list" ("id", "value") VALUES ('zh_Hant_HK', 'चिनियाँ (परम्परागत चिनी, हङकङ चिनिया समाजवादी स्वायत्त क्षेत्र)'); INSERT INTO "list" ("id", "value") VALUES ('zh_Hant', 'चिनियाँ (परम्परागत चिनी)'); INSERT INTO "list" ("id", "value") VALUES ('zh_MO', 'चिनियाँ (मकावो चिनिँया स्वशासित क्षेत्र)'); INSERT INTO "list" ("id", "value") VALUES ('zh_Hans_CN', 'चिनियाँ (सरलिकृत चिनी, चीन)'); INSERT INTO "list" ("id", "value") VALUES ('zh_Hans_MO', 'चिनियाँ (सरलिकृत चिनी, मकावो चिनिँया स्वशासित क्षेत्र)'); INSERT INTO "list" ("id", "value") VALUES ('zh_Hans_SG', 'चिनियाँ (सरलिकृत चिनी, सिङ्गापुर)'); INSERT INTO "list" ("id", "value") VALUES ('zh_Hans_HK', 'चिनियाँ (सरलिकृत चिनी, हङकङ चिनिया समाजवादी स्वायत्त क्षेत्र)'); INSERT INTO "list" ("id", "value") VALUES ('zh_Hans', 'चिनियाँ (सरलिकृत चिनी)'); INSERT INTO "list" ("id", "value") VALUES ('zh_SG', 'चिनियाँ (सिङ्गापुर)'); INSERT INTO "list" ("id", "value") VALUES ('zh_HK', 'चिनियाँ (हङकङ चिनिया समाजवादी स्वायत्त क्षेत्र)'); INSERT INTO "list" ("id", "value") VALUES ('cs', 'चेक'); INSERT INTO "list" ("id", "value") VALUES ('cs_CZ', 'चेक (चेक गणतन्त्र)'); INSERT INTO "list" ("id", "value") VALUES ('ka', 'जर्जियाली'); INSERT INTO "list" ("id", "value") VALUES ('ka_GE', 'जर्जियाली (जर्जिया)'); INSERT INTO "list" ("id", "value") VALUES ('de', 'जर्मन'); INSERT INTO "list" ("id", "value") VALUES ('de_AT', 'जर्मन (अष्ट्रिया)'); INSERT INTO "list" ("id", "value") VALUES ('de_DE', 'जर्मन (जर्मनी)'); INSERT INTO "list" ("id", "value") VALUES ('de_BE', 'जर्मन (बेल्जियम)'); INSERT INTO "list" ("id", "value") VALUES ('de_LU', 'जर्मन (लक्जेमबर्ग)'); INSERT INTO "list" ("id", "value") VALUES ('de_LI', 'जर्मन (लिएखटेन्स्टाइन)'); INSERT INTO "list" ("id", "value") VALUES ('de_CH', 'जर्मन (स्विजरल्याण्ड)'); INSERT INTO "list" ("id", "value") VALUES ('ja', 'जापानी'); INSERT INTO "list" ("id", "value") VALUES ('ja_JP', 'जापानी (जापान)'); INSERT INTO "list" ("id", "value") VALUES ('zu', 'जुलु'); INSERT INTO "list" ("id", "value") VALUES ('zu_ZA', 'जुलु (दक्षिण अफ्रिका)'); INSERT INTO "list" ("id", "value") VALUES ('dz', 'जोङ्खा'); INSERT INTO "list" ("id", "value") VALUES ('dz_BT', 'जोङ्खा (भुटान)'); INSERT INTO "list" ("id", "value") VALUES ('tr', 'टर्किश'); INSERT INTO "list" ("id", "value") VALUES ('tr_TR', 'टर्किश (टर्की)'); INSERT INTO "list" ("id", "value") VALUES ('tr_CY', 'टर्किश (साइप्रस)'); INSERT INTO "list" ("id", "value") VALUES ('to', 'टोङ्गन'); INSERT INTO "list" ("id", "value") VALUES ('to_TO', 'टोङ्गन (टोंगा)'); INSERT INTO "list" ("id", "value") VALUES ('nl', 'डच'); INSERT INTO "list" ("id", "value") VALUES ('nl_AW', 'डच (आरूबा)'); INSERT INTO "list" ("id", "value") VALUES ('nl_CW', 'डच (कुराकाओ)'); INSERT INTO "list" ("id", "value") VALUES ('nl_BQ', 'डच (क्यारिवियन नेदरल्याण्ड्स)'); INSERT INTO "list" ("id", "value") VALUES ('nl_NL', 'डच (नेदरल्याण्ड्स)'); INSERT INTO "list" ("id", "value") VALUES ('nl_BE', 'डच (बेल्जियम)'); INSERT INTO "list" ("id", "value") VALUES ('nl_SX', 'डच (सिन्ट मार्टेन)'); INSERT INTO "list" ("id", "value") VALUES ('nl_SR', 'डच (सुरिनेम)'); INSERT INTO "list" ("id", "value") VALUES ('da', 'डेनिश'); INSERT INTO "list" ("id", "value") VALUES ('da_GL', 'डेनिश (ग्रिनल्याण्ड)'); INSERT INTO "list" ("id", "value") VALUES ('da_DK', 'डेनिश (डेनमार्क)'); INSERT INTO "list" ("id", "value") VALUES ('ta', 'तामिल'); INSERT INTO "list" ("id", "value") VALUES ('ta_IN', 'तामिल (भारत)'); INSERT INTO "list" ("id", "value") VALUES ('ta_MY', 'तामिल (मलेसिया)'); INSERT INTO "list" ("id", "value") VALUES ('ta_LK', 'तामिल (श्रीलङ्का)'); INSERT INTO "list" ("id", "value") VALUES ('ta_SG', 'तामिल (सिङ्गापुर)'); INSERT INTO "list" ("id", "value") VALUES ('ti', 'तिग्रीन्या'); INSERT INTO "list" ("id", "value") VALUES ('ti_ET', 'तिग्रीन्या (इथियोपिया)'); INSERT INTO "list" ("id", "value") VALUES ('ti_ER', 'तिग्रीन्या (एरित्रिया)'); INSERT INTO "list" ("id", "value") VALUES ('bo', 'तिब्बती'); INSERT INTO "list" ("id", "value") VALUES ('bo_CN', 'तिब्बती (चीन)'); INSERT INTO "list" ("id", "value") VALUES ('bo_IN', 'तिब्बती (भारत)'); INSERT INTO "list" ("id", "value") VALUES ('te', 'तेलुगु'); INSERT INTO "list" ("id", "value") VALUES ('te_IN', 'तेलुगु (भारत)'); INSERT INTO "list" ("id", "value") VALUES ('th', 'थाई'); INSERT INTO "list" ("id", "value") VALUES ('th_TH', 'थाई (थाइल्याण्ड)'); INSERT INTO "list" ("id", "value") VALUES ('nn', 'नर्वेली नाइनोर्स्क'); INSERT INTO "list" ("id", "value") VALUES ('nn_NO', 'नर्वेली नाइनोर्स्क (नर्वे)'); INSERT INTO "list" ("id", "value") VALUES ('nb', 'नर्वेली बोकमाल'); INSERT INTO "list" ("id", "value") VALUES ('nb_NO', 'नर्वेली बोकमाल (नर्वे)'); INSERT INTO "list" ("id", "value") VALUES ('nb_SJ', 'नर्वेली बोकमाल (सभाल्बार्ड र जान मायेन)'); INSERT INTO "list" ("id", "value") VALUES ('ne', 'नेपाली'); INSERT INTO "list" ("id", "value") VALUES ('ne_NP', 'नेपाली (नेपाल)'); INSERT INTO "list" ("id", "value") VALUES ('ne_IN', 'नेपाली (भारत)'); INSERT INTO "list" ("id", "value") VALUES ('pa', 'पंजाबी'); INSERT INTO "list" ("id", "value") VALUES ('pa_Arab_PK', 'पंजाबी (अरबी, पाकिस्तान)'); INSERT INTO "list" ("id", "value") VALUES ('pa_Arab', 'पंजाबी (अरबी)'); INSERT INTO "list" ("id", "value") VALUES ('pa_Guru_IN', 'पंजाबी (गुरूमुखी, भारत)'); INSERT INTO "list" ("id", "value") VALUES ('pa_Guru', 'पंजाबी (गुरूमुखी)'); INSERT INTO "list" ("id", "value") VALUES ('pa_PK', 'पंजाबी (पाकिस्तान)'); INSERT INTO "list" ("id", "value") VALUES ('pa_IN', 'पंजाबी (भारत)'); INSERT INTO "list" ("id", "value") VALUES ('ps', 'पाश्तो'); INSERT INTO "list" ("id", "value") VALUES ('ps_AF', 'पाश्तो (अफगानिस्तान)'); INSERT INTO "list" ("id", "value") VALUES ('pt', 'पोर्तुगी'); INSERT INTO "list" ("id", "value") VALUES ('pt_AO', 'पोर्तुगी (अङ्गोला)'); INSERT INTO "list" ("id", "value") VALUES ('pt_CV', 'पोर्तुगी (केप भर्डे)'); INSERT INTO "list" ("id", "value") VALUES ('pt_GW', 'पोर्तुगी (गिनी-बिसाउ)'); INSERT INTO "list" ("id", "value") VALUES ('pt_TL', 'पोर्तुगी (टिमोर-लेस्टे)'); INSERT INTO "list" ("id", "value") VALUES ('pt_PT', 'पोर्तुगी (पोर्चुगल)'); INSERT INTO "list" ("id", "value") VALUES ('pt_BR', 'पोर्तुगी (ब्राजिल)'); INSERT INTO "list" ("id", "value") VALUES ('pt_MO', 'पोर्तुगी (मकावो चिनिँया स्वशासित क्षेत्र)'); INSERT INTO "list" ("id", "value") VALUES ('pt_MZ', 'पोर्तुगी (मोजाम्बिक)'); INSERT INTO "list" ("id", "value") VALUES ('pt_ST', 'पोर्तुगी (साओ टोमे र प्रिन्सिप)'); INSERT INTO "list" ("id", "value") VALUES ('pl', 'पोलिश'); INSERT INTO "list" ("id", "value") VALUES ('pl_PL', 'पोलिश (पोल्याण्ड)'); INSERT INTO "list" ("id", "value") VALUES ('fa', 'फारसी'); INSERT INTO "list" ("id", "value") VALUES ('fa_AF', 'फारसी (अफगानिस्तान)'); INSERT INTO "list" ("id", "value") VALUES ('fa_IR', 'फारसी (इरान)'); INSERT INTO "list" ("id", "value") VALUES ('fo', 'फारोज'); INSERT INTO "list" ("id", "value") VALUES ('fo_FO', 'फारोज (फारोर टापुहरु)'); INSERT INTO "list" ("id", "value") VALUES ('fi', 'फिनिश'); INSERT INTO "list" ("id", "value") VALUES ('fi_FI', 'फिनिश (फिन्ल्याण्ड)'); INSERT INTO "list" ("id", "value") VALUES ('fr', 'फ्रान्सेली'); INSERT INTO "list" ("id", "value") VALUES ('fr_DZ', 'फ्रान्सेली (अल्जेरिया)'); INSERT INTO "list" ("id", "value") VALUES ('fr_CI', 'फ्रान्सेली (आइभरी कोस्ट)'); INSERT INTO "list" ("id", "value") VALUES ('fr_CF', 'फ्रान्सेली (केन्द्रीय अफ्रिकी गणतन्त्र)'); INSERT INTO "list" ("id", "value") VALUES ('fr_CG', 'फ्रान्सेली (कोङ्गो - ब्राज्जाभिल्ले)'); INSERT INTO "list" ("id", "value") VALUES ('fr_CD', 'फ्रान्सेली (कोङ्गो-किन्शासा)'); INSERT INTO "list" ("id", "value") VALUES ('fr_KM', 'फ्रान्सेली (कोमोरोस)'); INSERT INTO "list" ("id", "value") VALUES ('fr_CA', 'फ्रान्सेली (क्यानाडा)'); INSERT INTO "list" ("id", "value") VALUES ('fr_CM', 'फ्रान्सेली (क्यामरून)'); INSERT INTO "list" ("id", "value") VALUES ('fr_GA', 'फ्रान्सेली (गावोन)'); INSERT INTO "list" ("id", "value") VALUES ('fr_GN', 'फ्रान्सेली (गिनी)'); INSERT INTO "list" ("id", "value") VALUES ('fr_GP', 'फ्रान्सेली (ग्वाडेलुप)'); INSERT INTO "list" ("id", "value") VALUES ('fr_TD', 'फ्रान्सेली (चाड)'); INSERT INTO "list" ("id", "value") VALUES ('fr_TG', 'फ्रान्सेली (टोगो)'); INSERT INTO "list" ("id", "value") VALUES ('fr_TN', 'फ्रान्सेली (ट्युनिसिया)'); INSERT INTO "list" ("id", "value") VALUES ('fr_DJ', 'फ्रान्सेली (डिजिबुटी)'); INSERT INTO "list" ("id", "value") VALUES ('fr_NC', 'फ्रान्सेली (नयाँ कालेडोनिया)'); INSERT INTO "list" ("id", "value") VALUES ('fr_NE', 'फ्रान्सेली (नाइजर)'); INSERT INTO "list" ("id", "value") VALUES ('fr_FR', 'फ्रान्सेली (फ्रान्स)'); INSERT INTO "list" ("id", "value") VALUES ('fr_GF', 'फ्रान्सेली (फ्रान्सेली गायना)'); INSERT INTO "list" ("id", "value") VALUES ('fr_PF', 'फ्रान्सेली (फ्रान्सेली पोलिनेसिया)'); INSERT INTO "list" ("id", "value") VALUES ('fr_BF', 'फ्रान्सेली (बर्किना फासो)'); INSERT INTO "list" ("id", "value") VALUES ('fr_BI', 'फ्रान्सेली (बुरूण्डी)'); INSERT INTO "list" ("id", "value") VALUES ('fr_BJ', 'फ्रान्सेली (बेनिन)'); INSERT INTO "list" ("id", "value") VALUES ('fr_BE', 'फ्रान्सेली (बेल्जियम)'); INSERT INTO "list" ("id", "value") VALUES ('fr_VU', 'फ्रान्सेली (भानुआतु)'); INSERT INTO "list" ("id", "value") VALUES ('fr_GQ', 'फ्रान्सेली (भू-मध्यीय गिनी)'); INSERT INTO "list" ("id", "value") VALUES ('fr_MG', 'फ्रान्सेली (मडागास्कर)'); INSERT INTO "list" ("id", "value") VALUES ('fr_MU', 'फ्रान्सेली (माउरिटस)'); INSERT INTO "list" ("id", "value") VALUES ('fr_MR', 'फ्रान्सेली (माउरिटानिया)'); INSERT INTO "list" ("id", "value") VALUES ('fr_YT', 'फ्रान्सेली (मायोट्ट)'); INSERT INTO "list" ("id", "value") VALUES ('fr_MQ', 'फ्रान्सेली (मार्टिनिक)'); INSERT INTO "list" ("id", "value") VALUES ('fr_ML', 'फ्रान्सेली (माली)'); INSERT INTO "list" ("id", "value") VALUES ('fr_MC', 'फ्रान्सेली (मोनाको)'); INSERT INTO "list" ("id", "value") VALUES ('fr_MA', 'फ्रान्सेली (मोरोक्को)'); INSERT INTO "list" ("id", "value") VALUES ('fr_RW', 'फ्रान्सेली (रवाण्डा)'); INSERT INTO "list" ("id", "value") VALUES ('fr_RE', 'फ्रान्सेली (रियुनियन)'); INSERT INTO "list" ("id", "value") VALUES ('fr_LU', 'फ्रान्सेली (लक्जेमबर्ग)'); INSERT INTO "list" ("id", "value") VALUES ('fr_WF', 'फ्रान्सेली (वालिस र फुटुना)'); INSERT INTO "list" ("id", "value") VALUES ('fr_SY', 'फ्रान्सेली (सिरिया)'); INSERT INTO "list" ("id", "value") VALUES ('fr_SC', 'फ्रान्सेली (सेचेलेस)'); INSERT INTO "list" ("id", "value") VALUES ('fr_SN', 'फ्रान्सेली (सेनेगाल)'); INSERT INTO "list" ("id", "value") VALUES ('fr_PM', 'फ्रान्सेली (सेन्ट पिर्रे र मिक्केलोन)'); INSERT INTO "list" ("id", "value") VALUES ('fr_BL', 'फ्रान्सेली (सेन्ट बार्थालेमी)'); INSERT INTO "list" ("id", "value") VALUES ('fr_MF', 'फ्रान्सेली (सेन्ट मार्टिन)'); INSERT INTO "list" ("id", "value") VALUES ('fr_CH', 'फ्रान्सेली (स्विजरल्याण्ड)'); INSERT INTO "list" ("id", "value") VALUES ('fr_HT', 'फ्रान्सेली (हैटी)'); INSERT INTO "list" ("id", "value") VALUES ('fy', 'फ्रिजीयन'); INSERT INTO "list" ("id", "value") VALUES ('fy_NL', 'फ्रिजीयन (नेदरल्याण्ड्स)'); INSERT INTO "list" ("id", "value") VALUES ('bn', 'बंगाली'); INSERT INTO "list" ("id", "value") VALUES ('bn_BD', 'बंगाली (बङ्गलादेश)'); INSERT INTO "list" ("id", "value") VALUES ('bn_IN', 'बंगाली (भारत)'); INSERT INTO "list" ("id", "value") VALUES ('bm', 'बाम्बारा'); INSERT INTO "list" ("id", "value") VALUES ('bm_Latn_ML', 'बाम्बारा (ल्याटिन, माली)'); INSERT INTO "list" ("id", "value") VALUES ('bm_Latn', 'बाम्बारा (ल्याटिन)'); INSERT INTO "list" ("id", "value") VALUES ('eu', 'बास्क'); INSERT INTO "list" ("id", "value") VALUES ('eu_ES', 'बास्क (स्पेन)'); INSERT INTO "list" ("id", "value") VALUES ('bg', 'बुल्गेरियाली'); INSERT INTO "list" ("id", "value") VALUES ('bg_BG', 'बुल्गेरियाली (बुल्गेरिया)'); INSERT INTO "list" ("id", "value") VALUES ('bs', 'बोस्नियाली'); INSERT INTO "list" ("id", "value") VALUES ('bs_BA', 'बोस्नियाली (बोस्निया एण्ड हर्जगोभिनिया)'); INSERT INTO "list" ("id", "value") VALUES ('bs_Latn_BA', 'बोस्नियाली (ल्याटिन, बोस्निया एण्ड हर्जगोभिनिया)'); INSERT INTO "list" ("id", "value") VALUES ('bs_Latn', 'बोस्नियाली (ल्याटिन)'); INSERT INTO "list" ("id", "value") VALUES ('bs_Cyrl_BA', 'बोस्नियाली (सिरिलिक, बोस्निया एण्ड हर्जगोभिनिया)'); INSERT INTO "list" ("id", "value") VALUES ('bs_Cyrl', 'बोस्नियाली (सिरिलिक)'); INSERT INTO "list" ("id", "value") VALUES ('br', 'ब्रेटन'); INSERT INTO "list" ("id", "value") VALUES ('br_FR', 'ब्रेटन (फ्रान्स)'); INSERT INTO "list" ("id", "value") VALUES ('vi', 'भियतनामी'); INSERT INTO "list" ("id", "value") VALUES ('vi_VN', 'भियतनामी (भिएतनाम)'); INSERT INTO "list" ("id", "value") VALUES ('mn', 'मंगोल'); INSERT INTO "list" ("id", "value") VALUES ('mn_MN', 'मंगोल (मङ्गोलिया)'); INSERT INTO "list" ("id", "value") VALUES ('mn_Cyrl_MN', 'मंगोल (सिरिलिक, मङ्गोलिया)'); INSERT INTO "list" ("id", "value") VALUES ('mn_Cyrl', 'मंगोल (सिरिलिक)'); INSERT INTO "list" ("id", "value") VALUES ('mr', 'मराठी'); INSERT INTO "list" ("id", "value") VALUES ('mr_IN', 'मराठी (भारत)'); INSERT INTO "list" ("id", "value") VALUES ('ml', 'मलयालम'); INSERT INTO "list" ("id", "value") VALUES ('ml_IN', 'मलयालम (भारत)'); INSERT INTO "list" ("id", "value") VALUES ('mg', 'मलागासी'); INSERT INTO "list" ("id", "value") VALUES ('mg_MG', 'मलागासी (मडागास्कर)'); INSERT INTO "list" ("id", "value") VALUES ('ms', 'मलाया'); INSERT INTO "list" ("id", "value") VALUES ('ms_BN', 'मलाया (ब्रुनाइ)'); INSERT INTO "list" ("id", "value") VALUES ('ms_MY', 'मलाया (मलेसिया)'); INSERT INTO "list" ("id", "value") VALUES ('ms_Latn_BN', 'मलाया (ल्याटिन, ब्रुनाइ)'); INSERT INTO "list" ("id", "value") VALUES ('ms_Latn_MY', 'मलाया (ल्याटिन, मलेसिया)'); INSERT INTO "list" ("id", "value") VALUES ('ms_Latn_SG', 'मलाया (ल्याटिन, सिङ्गापुर)'); INSERT INTO "list" ("id", "value") VALUES ('ms_Latn', 'मलाया (ल्याटिन)'); INSERT INTO "list" ("id", "value") VALUES ('ms_SG', 'मलाया (सिङ्गापुर)'); INSERT INTO "list" ("id", "value") VALUES ('gv', 'मान्क्स'); INSERT INTO "list" ("id", "value") VALUES ('gv_IM', 'मान्क्स (आइज्ले अफ् म्यान)'); INSERT INTO "list" ("id", "value") VALUES ('mt', 'माल्टिज'); INSERT INTO "list" ("id", "value") VALUES ('mt_MT', 'माल्टिज (माल्टा)'); INSERT INTO "list" ("id", "value") VALUES ('mk', 'म्याकेडोनियन'); INSERT INTO "list" ("id", "value") VALUES ('mk_MK', 'म्याकेडोनियन (म्याकेडोनिया)'); INSERT INTO "list" ("id", "value") VALUES ('uk', 'युक्रेनी'); INSERT INTO "list" ("id", "value") VALUES ('uk_UA', 'युक्रेनी (युक्रेन)'); INSERT INTO "list" ("id", "value") VALUES ('yo', 'योरूवा'); INSERT INTO "list" ("id", "value") VALUES ('yo_NG', 'योरूवा (नाइजेरिया)'); INSERT INTO "list" ("id", "value") VALUES ('yo_BJ', 'योरूवा (बेनिन)'); INSERT INTO "list" ("id", "value") VALUES ('rn', 'रूण्डी'); INSERT INTO "list" ("id", "value") VALUES ('rn_BI', 'रूण्डी (बुरूण्डी)'); INSERT INTO "list" ("id", "value") VALUES ('ru', 'रूसी'); INSERT INTO "list" ("id", "value") VALUES ('ru_KZ', 'रूसी (काजाकस्तान)'); INSERT INTO "list" ("id", "value") VALUES ('ru_KG', 'रूसी (किर्गिस्थान)'); INSERT INTO "list" ("id", "value") VALUES ('ru_BY', 'रूसी (बेलारूस)'); INSERT INTO "list" ("id", "value") VALUES ('ru_MD', 'रूसी (माल्डोभा)'); INSERT INTO "list" ("id", "value") VALUES ('ru_UA', 'रूसी (युक्रेन)'); INSERT INTO "list" ("id", "value") VALUES ('ru_RU', 'रूसी (रूस)'); INSERT INTO "list" ("id", "value") VALUES ('ro', 'रोमानियाली'); INSERT INTO "list" ("id", "value") VALUES ('ro_MD', 'रोमानियाली (माल्डोभा)'); INSERT INTO "list" ("id", "value") VALUES ('ro_RO', 'रोमानियाली (रोमानिया)'); INSERT INTO "list" ("id", "value") VALUES ('rm', 'रोमानिश'); INSERT INTO "list" ("id", "value") VALUES ('rm_CH', 'रोमानिश (स्विजरल्याण्ड)'); INSERT INTO "list" ("id", "value") VALUES ('lb', 'लक्जेम्बर्गिस'); INSERT INTO "list" ("id", "value") VALUES ('lb_LU', 'लक्जेम्बर्गिस (लक्जेमबर्ग)'); INSERT INTO "list" ("id", "value") VALUES ('lo', 'लाओ'); INSERT INTO "list" ("id", "value") VALUES ('lo_LA', 'लाओ (लाओस)'); INSERT INTO "list" ("id", "value") VALUES ('lv', 'लात्भियाली'); INSERT INTO "list" ("id", "value") VALUES ('lv_LV', 'लात्भियाली (लाट्भिया)'); INSERT INTO "list" ("id", "value") VALUES ('ln', 'लिंगाला'); INSERT INTO "list" ("id", "value") VALUES ('ln_AO', 'लिंगाला (अङ्गोला)'); INSERT INTO "list" ("id", "value") VALUES ('ln_CF', 'लिंगाला (केन्द्रीय अफ्रिकी गणतन्त्र)'); INSERT INTO "list" ("id", "value") VALUES ('ln_CG', 'लिंगाला (कोङ्गो - ब्राज्जाभिल्ले)'); INSERT INTO "list" ("id", "value") VALUES ('ln_CD', 'लिंगाला (कोङ्गो-किन्शासा)'); INSERT INTO "list" ("id", "value") VALUES ('lt', 'लिथुआनियाली'); INSERT INTO "list" ("id", "value") VALUES ('lt_LT', 'लिथुआनियाली (लिथुअनिया)'); INSERT INTO "list" ("id", "value") VALUES ('lu', 'लुबा-काताङ्गा'); INSERT INTO "list" ("id", "value") VALUES ('lu_CD', 'लुबा-काताङ्गा (कोङ्गो-किन्शासा)'); INSERT INTO "list" ("id", "value") VALUES ('my', 'वर्मेली'); INSERT INTO "list" ("id", "value") VALUES ('my_MM', 'वर्मेली (म्यान्मार (बर्मा))'); INSERT INTO "list" ("id", "value") VALUES ('be', 'वेलारूसी'); INSERT INTO "list" ("id", "value") VALUES ('be_BY', 'वेलारूसी (बेलारूस)'); INSERT INTO "list" ("id", "value") VALUES ('cy', 'वेल्श'); INSERT INTO "list" ("id", "value") VALUES ('cy_GB', 'वेल्श (बेलायत)'); INSERT INTO "list" ("id", "value") VALUES ('sn', 'शोना'); INSERT INTO "list" ("id", "value") VALUES ('sn_ZW', 'शोना (जिम्बाबे)'); INSERT INTO "list" ("id", "value") VALUES ('sr', 'सर्बियाली'); INSERT INTO "list" ("id", "value") VALUES ('sr_XK', 'सर्बियाली (कोसोवो)'); INSERT INTO "list" ("id", "value") VALUES ('sr_BA', 'सर्बियाली (बोस्निया एण्ड हर्जगोभिनिया)'); INSERT INTO "list" ("id", "value") VALUES ('sr_ME', 'सर्बियाली (मोन्टेनेग्रो)'); INSERT INTO "list" ("id", "value") VALUES ('sr_Latn_XK', 'सर्बियाली (ल्याटिन, कोसोवो)'); INSERT INTO "list" ("id", "value") VALUES ('sr_Latn_BA', 'सर्बियाली (ल्याटिन, बोस्निया एण्ड हर्जगोभिनिया)'); INSERT INTO "list" ("id", "value") VALUES ('sr_Latn_ME', 'सर्बियाली (ल्याटिन, मोन्टेनेग्रो)'); INSERT INTO "list" ("id", "value") VALUES ('sr_Latn_RS', 'सर्बियाली (ल्याटिन, सर्बिया)'); INSERT INTO "list" ("id", "value") VALUES ('sr_Latn', 'सर्बियाली (ल्याटिन)'); INSERT INTO "list" ("id", "value") VALUES ('sr_RS', 'सर्बियाली (सर्बिया)'); INSERT INTO "list" ("id", "value") VALUES ('sr_Cyrl_XK', 'सर्बियाली (सिरिलिक, कोसोवो)'); INSERT INTO "list" ("id", "value") VALUES ('sr_Cyrl_BA', 'सर्बियाली (सिरिलिक, बोस्निया एण्ड हर्जगोभिनिया)'); INSERT INTO "list" ("id", "value") VALUES ('sr_Cyrl_ME', 'सर्बियाली (सिरिलिक, मोन्टेनेग्रो)'); INSERT INTO "list" ("id", "value") VALUES ('sr_Cyrl_RS', 'सर्बियाली (सिरिलिक, सर्बिया)'); INSERT INTO "list" ("id", "value") VALUES ('sr_Cyrl', 'सर्बियाली (सिरिलिक)'); INSERT INTO "list" ("id", "value") VALUES ('sg', 'साङ्गो'); INSERT INTO "list" ("id", "value") VALUES ('sg_CF', 'साङ्गो (केन्द्रीय अफ्रिकी गणतन्त्र)'); INSERT INTO "list" ("id", "value") VALUES ('ii', 'सिचुआन यि'); INSERT INTO "list" ("id", "value") VALUES ('ii_CN', 'सिचुआन यि (चीन)'); INSERT INTO "list" ("id", "value") VALUES ('si', 'सिन्हाला'); INSERT INTO "list" ("id", "value") VALUES ('si_LK', 'सिन्हाला (श्रीलङ्का)'); INSERT INTO "list" ("id", "value") VALUES ('so', 'सोमाली'); INSERT INTO "list" ("id", "value") VALUES ('so_ET', 'सोमाली (इथियोपिया)'); INSERT INTO "list" ("id", "value") VALUES ('so_KE', 'सोमाली (केन्या)'); INSERT INTO "list" ("id", "value") VALUES ('so_DJ', 'सोमाली (डिजिबुटी)'); INSERT INTO "list" ("id", "value") VALUES ('so_SO', 'सोमाली (सोमालिया)'); INSERT INTO "list" ("id", "value") VALUES ('es', 'स्पेनिस'); INSERT INTO "list" ("id", "value") VALUES ('es_AR', 'स्पेनिस (अर्जेन्टिना)'); INSERT INTO "list" ("id", "value") VALUES ('es_EC', 'स्पेनिस (इक्वडेर)'); INSERT INTO "list" ("id", "value") VALUES ('es_UY', 'स्पेनिस (उरूग्वे)'); INSERT INTO "list" ("id", "value") VALUES ('es_SV', 'स्पेनिस (एल् साल्भाडोर)'); INSERT INTO "list" ("id", "value") VALUES ('es_CO', 'स्पेनिस (कोलोम्बिया)'); INSERT INTO "list" ("id", "value") VALUES ('es_CR', 'स्पेनिस (कोष्टारिका)'); INSERT INTO "list" ("id", "value") VALUES ('es_IC', 'स्पेनिस (क्यानारी टापुहरू)'); INSERT INTO "list" ("id", "value") VALUES ('es_CU', 'स्पेनिस (क्युबा)'); INSERT INTO "list" ("id", "value") VALUES ('es_GT', 'स्पेनिस (ग्वाटेमाला)'); INSERT INTO "list" ("id", "value") VALUES ('es_CL', 'स्पेनिस (चिली)'); INSERT INTO "list" ("id", "value") VALUES ('es_DO', 'स्पेनिस (डोमिनिकन गणतन्त्र)'); INSERT INTO "list" ("id", "value") VALUES ('es_NI', 'स्पेनिस (निकारागुवा)'); INSERT INTO "list" ("id", "value") VALUES ('es_PA', 'स्पेनिस (पनामा)'); INSERT INTO "list" ("id", "value") VALUES ('es_PR', 'स्पेनिस (पुएर्टो रिको)'); INSERT INTO "list" ("id", "value") VALUES ('es_PE', 'स्पेनिस (पेरू)'); INSERT INTO "list" ("id", "value") VALUES ('es_PY', 'स्पेनिस (प्याराग्वे)'); INSERT INTO "list" ("id", "value") VALUES ('es_PH', 'स्पेनिस (फिलिपिन्स)'); INSERT INTO "list" ("id", "value") VALUES ('es_BO', 'स्पेनिस (बोलिभिया)'); INSERT INTO "list" ("id", "value") VALUES ('es_GQ', 'स्पेनिस (भू-मध्यीय गिनी)'); INSERT INTO "list" ("id", "value") VALUES ('es_VE', 'स्पेनिस (भेनेजुएला)'); INSERT INTO "list" ("id", "value") VALUES ('es_MX', 'स्पेनिस (मेक्सिको)'); INSERT INTO "list" ("id", "value") VALUES ('es_US', 'स्पेनिस (संयुक्त राज्य)'); INSERT INTO "list" ("id", "value") VALUES ('es_EA', 'स्पेनिस (सिउटा र मेलिला)'); INSERT INTO "list" ("id", "value") VALUES ('es_ES', 'स्पेनिस (स्पेन)'); INSERT INTO "list" ("id", "value") VALUES ('es_HN', 'स्पेनिस (हन्डुरास)'); INSERT INTO "list" ("id", "value") VALUES ('sk', 'स्लोभाकियाली'); INSERT INTO "list" ("id", "value") VALUES ('sk_SK', 'स्लोभाकियाली (स्लोभाकिया)'); INSERT INTO "list" ("id", "value") VALUES ('sl', 'स्लोभेनियाली'); INSERT INTO "list" ("id", "value") VALUES ('sl_SI', 'स्लोभेनियाली (स्लोभेनिया)'); INSERT INTO "list" ("id", "value") VALUES ('sw', 'स्वाहिली'); INSERT INTO "list" ("id", "value") VALUES ('sw_KE', 'स्वाहिली (केन्या)'); INSERT INTO "list" ("id", "value") VALUES ('sw_TZ', 'स्वाहिली (तान्जानिया)'); INSERT INTO "list" ("id", "value") VALUES ('sw_UG', 'स्वाहिली (युगाण्डा)'); INSERT INTO "list" ("id", "value") VALUES ('sv', 'स्विडिश'); INSERT INTO "list" ("id", "value") VALUES ('sv_AX', 'स्विडिश (अलान्ड टापुहरु)'); INSERT INTO "list" ("id", "value") VALUES ('sv_FI', 'स्विडिश (फिन्ल्याण्ड)'); INSERT INTO "list" ("id", "value") VALUES ('sv_SE', 'स्विडिश (स्विडेन)'); INSERT INTO "list" ("id", "value") VALUES ('hu', 'हंग्रीयाली'); INSERT INTO "list" ("id", "value") VALUES ('hu_HU', 'हंग्रीयाली (हङ्गेरी)'); INSERT INTO "list" ("id", "value") VALUES ('ha', 'हाउसा'); INSERT INTO "list" ("id", "value") VALUES ('ha_GH', 'हाउसा (घाना)'); INSERT INTO "list" ("id", "value") VALUES ('ha_NE', 'हाउसा (नाइजर)'); INSERT INTO "list" ("id", "value") VALUES ('ha_NG', 'हाउसा (नाइजेरिया)'); INSERT INTO "list" ("id", "value") VALUES ('ha_Latn_GH', 'हाउसा (ल्याटिन, घाना)'); INSERT INTO "list" ("id", "value") VALUES ('ha_Latn_NE', 'हाउसा (ल्याटिन, नाइजर)'); INSERT INTO "list" ("id", "value") VALUES ('ha_Latn_NG', 'हाउसा (ल्याटिन, नाइजेरिया)'); INSERT INTO "list" ("id", "value") VALUES ('ha_Latn', 'हाउसा (ल्याटिन)'); INSERT INTO "list" ("id", "value") VALUES ('hi', 'हिन्दी'); INSERT INTO "list" ("id", "value") VALUES ('hi_IN', 'हिन्दी (भारत)'); INSERT INTO "list" ("id", "value") VALUES ('he', 'हिब्रु'); INSERT INTO "list" ("id", "value") VALUES ('he_IL', 'हिब्रु (इजरायल)');
{ "pile_set_name": "Github" }
from models.bases.base import Base import torch.nn as nn from collections import OrderedDict import torch class Bottleneck3D(nn.Module): expansion = 4 def __init__(self, inplanes, planes, stride=1, downsample=None): super(Bottleneck3D, self).__init__() self.conv1 = nn.ConvTranspose3d(planes, inplanes, kernel_size=(3, 1, 1), padding=(1, 0, 0), bias=False) self.bn1 = nn.BatchNorm3d(inplanes, eps=0.001, momentum=0.01) output_padding = (0, 1, 1) if stride == 2 else 0 self.conv2 = nn.ConvTranspose3d(planes, planes, kernel_size=(1, 3, 3), output_padding=output_padding, stride=(1, stride, stride), padding=(0, 1, 1), bias=False) self.bn2 = nn.BatchNorm3d(planes, eps=0.001, momentum=0.01) self.conv3 = nn.ConvTranspose3d(planes * self.expansion, planes, kernel_size=(1, 1, 1), bias=False) self.bn3 = nn.BatchNorm3d(planes, eps=0.001, momentum=0.01) self.relu = nn.ReLU(inplace=True) self.downsample = downsample self.stride = stride def forward(self, x): residual = x out = self.conv3(x) out = self.bn3(out) out = self.relu(out) out = self.conv2(out) out = self.bn2(out) out = self.relu(out) out = self.conv1(out) out = self.bn1(out) #out = self.conv1(x) #out = self.bn1(out) #out = self.relu(out) #out = self.conv2(out) #out = self.bn2(out) #out = self.relu(out) #out = self.conv3(out) #out = self.bn3(out) if self.downsample is not None: residual = self.downsample(x) out += residual out = self.relu(out) return out class ResNet3DDecoder(nn.Module): def __init__(self, block, layers, num_classes=400): super(ResNet3DDecoder, self).__init__() self.inplanes = 64 self.conv1 = nn.ConvTranspose3d(64, 3, output_padding=1, kernel_size=(5, 7, 7), stride=2, padding=(2, 3, 3), bias=False) self.bn1 = nn.BatchNorm3d(64, eps=0.001, momentum=0.01) self.relu = nn.ReLU(inplace=True) self.maxpool = nn.ConvTranspose3d(self.inplanes, self.inplanes, output_padding=1, kernel_size=3, stride=2, padding=(1, 1, 1), bias=False) self.layer1 = self._make_layer(block, 64, layers[0]) self.maxpool2 = nn.ConvTranspose3d(self.inplanes, self.inplanes, output_padding=(1, 0, 0), kernel_size=(3, 1, 1), stride=(2, 1, 1), padding=(1, 0, 0), bias=False) self.layer2 = self._make_layer(block, 128, layers[1], stride=2) self.layer3 = self._make_layer(block, 256, layers[2], stride=2) self.layer4 = self._make_layer(block, 512, layers[3], stride=2) self.tanh = nn.Tanh() for m in self.modules(): if isinstance(m, nn.Conv3d) or isinstance(m, nn.ConvTranspose3d): nn.init.kaiming_normal_(m.weight, mode='fan_out', nonlinearity='relu') elif isinstance(m, nn.BatchNorm3d): nn.init.constant_(m.weight, 1) nn.init.constant_(m.bias, 0) def _make_layer(self, block, planes, blocks, stride=1): downsample = None if stride != 1 or self.inplanes != planes * block.expansion: output_padding = (0, 1, 1) if stride == 2 else 0 downsample = nn.Sequential( nn.ConvTranspose3d(planes * block.expansion, self.inplanes, output_padding=output_padding, kernel_size=1, stride=(1, stride, stride), bias=False), nn.BatchNorm3d(self.inplanes), ) layers = [] layers.append(block(self.inplanes, planes, stride, downsample)) self.inplanes = planes * block.expansion for _ in range(1, blocks): layers.append(block(self.inplanes, planes)) # return nn.Sequential(*layers) return nn.Sequential(*layers[::-1]) def forward(self, x): # x is 2, 2048, 4, 7, 7 # (2, 2048, 4, 7, 7) x = self.layer4(x) # (2, 1024, 4, 14, 14) x = self.layer3(x) # (2, 512, 4, 28, 28) x = self.layer2(x) x = self.maxpool2(x) # (2, 256, 4, 56, 56) x = self.layer1(x) # (2, 64, 7, 56, 56) x = self.maxpool(x) # (1, 64, 32, 112, 112) x = self.relu(x) x = self.bn1(x) x = self.conv1(x) # (1, 3, 64, 224, 224) x = self.tanh(x) # model expects b x c x n x h x w # x is of the form b x n x h x w x c x = x.permute(0, 2, 3, 4, 1) # match the range of the normalized data x = x * .5 + .5 x = x - torch.Tensor([0.485, 0.456, 0.406])[None, None, None, None, :].to(x.device) x = x / torch.Tensor([0.229, 0.224, 0.225])[None, None, None, None, :].to(x.device) return x # def load_2d(self, model2d): # print('inflating 2d resnet parameters') # sd = self.state_dict() # sd2d = model2d.state_dict() # sd = OrderedDict([(x.replace('module.', ''), y) for x, y in sd.items()]) # sd2d = OrderedDict([(x.replace('module.', ''), y) for x, y in sd2d.items()]) # for k, v in sd2d.items(): # if k not in sd: # print('ignoring state key for loading: {}'.format(k)) # continue # if 'conv' in k or 'downsample.0' in k: # s = sd[k].shape # t = s[2] # sd[k].copy_(v.unsqueeze(2).expand(*s) / t) # elif 'bn' in k or 'downsample.1' in k: # sd[k].copy_(v) # else: # print('skipping: {}'.format(k)) class ResNet503DDecoder(Base): @classmethod def get(cls, args): model = ResNet3DDecoder(Bottleneck3D, [3, 4, 6, 3]) # 50 #if args.pretrained: # from torchvision.models.resnet import resnet50 # model2d = resnet50(pretrained=True) # model.load_2d(model2d) return model
{ "pile_set_name": "Github" }
## DESCRIPTION ## Linear Algebra ## ENDDESCRIPTION ## Tagged by tda2d ## DBsubject(Linear algebra) ## DBchapter(Euclidean spaces) ## DBsection(Linear combinations) ## Date(July 2013) ## Institution(TCNJ and Hope College) ## Author(Paul Pearson) ## Level(2) ## MO(1) ## TitleText1('Linear Algebra with Applications') ## AuthorText1('Jeffrey Holt') ## EditionText1('1') ## Section1('2.1') ## Problem1('') ## KEYWORDS('vector' 'line' 'parametric') DOCUMENT(); loadMacros( "PGstandard.pl", "MathObjects.pl", "parserMultiAnswer.pl", "MatrixCheckers.pl", "PGcourse.pl" ); TEXT(beginproblem()); $showPartialCorrectAnswers = 1; Context('Matrix')->variables->are('x'=>'Real'); $m = random(-1,1,2) * random(2,9,1); $b = non_zero_random(-9,9,1); $y = Formula("$m x + $b")->reduce; $displace = Matrix([0,$b])->transpose; $basis1 = Matrix([1,$m])->transpose; $multians = MultiAnswer($displace, $basis1)->with( singleResult => 1, separator => ', ', tex_separator => ', ', allowBlankAnswers=>0, checker => ~~&parametric_plane_checker_columns, ); Context()->texStrings; BEGIN_TEXT Let \( L \) be the line \( y = $y \) in \( \mathbb{R}^2 \). Find vectors \( \vec{a} \) and \( \vec{b} \) so that \( \vec{v} = \vec{a} + t \vec{b} \) is a parametric equation for \( L \). $BR $BR \( \vec{v} = \) \{ $multians->ans_array \} \( + t \) \{ $multians->ans_array \}. END_TEXT Context()->normalStrings; ANS($multians->cmp); ; ENDDOCUMENT();
{ "pile_set_name": "Github" }
/* * _Thermal.cpp * * Created on: Jan 18, 2019 * Author: yankai */ #include "_Thermal.h" #ifdef USE_OPENCV namespace kai { _Thermal::_Thermal() { m_rL = 200; m_rU = 255; } _Thermal::~_Thermal() { } bool _Thermal::init(void *pKiss) { IF_F(!this->_DetectorBase::init(pKiss)); Kiss *pK = (Kiss*) pKiss; pK->v<double>("rL", &m_rL); pK->v<double>("rU", &m_rU); m_nClass = 1; return true; } bool _Thermal::start(void) { m_bThreadON = true; int retCode = pthread_create(&m_threadID, 0, getUpdateThread, this); if (retCode != 0) { m_bThreadON = false; return false; } return true; } void _Thermal::update(void) { while (m_bThreadON) { this->autoFPSfrom(); if (check() >= 0) { detect(); if (m_bGoSleep) m_pU->m_pPrev->clear(); } this->autoFPSto(); } } int _Thermal::check(void) { NULL__(m_pU, -1); NULL__(m_pV, -1); IF__(m_pV->BGR()->bEmpty(), -1); return 0; } void _Thermal::detect(void) { Mat mBGR = *(m_pV->BGR()->m()); Mat mGray; cv::cvtColor(mBGR, mGray, COLOR_BGR2GRAY); cv::inRange(mGray, m_rL, m_rU, m_mR); vector<vector<Point> > vvContours; findContours(m_mR, vvContours, RETR_EXTERNAL, CHAIN_APPROX_NONE); _Object o; vector<Point> vPoly; for (unsigned int i = 0; i < vvContours.size(); i++) { vPoly.clear(); approxPolyDP(vvContours[i], vPoly, 3, true); Rect r = boundingRect(vPoly); o.init(); o.m_tStamp = m_tStamp; o.setBB2D(rect2BB < vFloat4 > (r)); o.scale(m_mR.cols, m_mR.rows); o.setTopClass(0, o.area()); m_pU->add(o); LOG_I("ID: " + i2str(o.getTopClass())); } m_pU->updateObj(); } void _Thermal::draw(void) { this->_DetectorBase::draw(); IF_(!m_bDebug); if (!m_mR.empty()) { imshow(*this->getName() + ":Thr", m_mR); } } } #endif
{ "pile_set_name": "Github" }
[syncthing] title="BEP (Block Exchange Protocol)" desc="Syncthing File Synchronization" port_forward="yes" dst.ports="22000/tcp" [syncthing-discovery] title="Local Discovery Protocol" desc="Syncthing Local Announcement" port_forward="no" dst.ports="21027/udp" [syncthing-webui] title="HTTP(S)" desc="Syncthing Web GUI" port_forward="yes" dst.ports="8384/tcp"
{ "pile_set_name": "Github" }
///////////////////////////////////////////////////////////////////////// // $Id: access32.cc 11580 2013-01-19 20:45:03Z sshwarts $ ///////////////////////////////////////////////////////////////////////// // // Copyright (c) 2008-2013 Stanislav Shwartsman // Written by Stanislav Shwartsman [sshwarts at sourceforge net] // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA B 02110-1301 USA // ///////////////////////////////////////////////////////////////////////// #define NEED_CPU_REG_SHORTCUTS 1 #include "bochs.h" #include "cpu.h" #define LOG_THIS BX_CPU_THIS_PTR void BX_CPP_AttrRegparmN(3) BX_CPU_C::write_virtual_byte_32(unsigned s, Bit32u offset, Bit8u data) { Bit32u laddr; bx_segment_reg_t *seg = &BX_CPU_THIS_PTR sregs[s]; BX_ASSERT(BX_CPU_THIS_PTR cpu_mode != BX_MODE_LONG_64); if (seg->cache.valid & SegAccessWOK) { if (offset <= seg->cache.u.segment.limit_scaled) { accessOK: laddr = get_laddr32(s, offset); unsigned tlbIndex = BX_TLB_INDEX_OF(laddr, 0); Bit32u lpf = LPFOf(laddr); bx_TLB_entry *tlbEntry = &BX_CPU_THIS_PTR TLB.entry[tlbIndex]; if (tlbEntry->lpf == lpf) { // See if the TLB entry privilege level allows us write access // from this CPL. if (tlbEntry->accessBits & (0x04 << USER_PL)) { bx_hostpageaddr_t hostPageAddr = tlbEntry->hostPageAddr; Bit32u pageOffset = PAGE_OFFSET(laddr); bx_phy_address pAddr = tlbEntry->ppf | pageOffset; BX_NOTIFY_LIN_MEMORY_ACCESS(laddr, pAddr, 1, CPL, BX_WRITE, (Bit8u*) &data); Bit8u *hostAddr = (Bit8u*) (hostPageAddr | pageOffset); pageWriteStampTable.decWriteStamp(pAddr, 1); *hostAddr = data; return; } } access_write_linear(laddr, 1, CPL, (void *) &data); return; } else { BX_ERROR(("write_virtual_byte_32(): segment limit violation")); exception(int_number(s), 0); } } if (!write_virtual_checks(seg, offset, 1)) exception(int_number(s), 0); goto accessOK; } void BX_CPP_AttrRegparmN(3) BX_CPU_C::write_virtual_word_32(unsigned s, Bit32u offset, Bit16u data) { Bit32u laddr; bx_segment_reg_t *seg = &BX_CPU_THIS_PTR sregs[s]; BX_ASSERT(BX_CPU_THIS_PTR cpu_mode != BX_MODE_LONG_64); if (seg->cache.valid & SegAccessWOK) { if (offset < seg->cache.u.segment.limit_scaled) { accessOK: laddr = get_laddr32(s, offset); unsigned tlbIndex = BX_TLB_INDEX_OF(laddr, 1); #if BX_SUPPORT_ALIGNMENT_CHECK && BX_CPU_LEVEL >= 4 Bit32u lpf = AlignedAccessLPFOf(laddr, (1 & BX_CPU_THIS_PTR alignment_check_mask)); #else Bit32u lpf = LPFOf(laddr); #endif bx_TLB_entry *tlbEntry = &BX_CPU_THIS_PTR TLB.entry[tlbIndex]; if (tlbEntry->lpf == lpf) { // See if the TLB entry privilege level allows us write access // from this CPL. if (tlbEntry->accessBits & (0x04 << USER_PL)) { bx_hostpageaddr_t hostPageAddr = tlbEntry->hostPageAddr; Bit32u pageOffset = PAGE_OFFSET(laddr); bx_phy_address pAddr = tlbEntry->ppf | pageOffset; BX_NOTIFY_LIN_MEMORY_ACCESS(laddr, pAddr, 2, CPL, BX_WRITE, (Bit8u*) &data); Bit16u *hostAddr = (Bit16u*) (hostPageAddr | pageOffset); pageWriteStampTable.decWriteStamp(pAddr, 2); WriteHostWordToLittleEndian(hostAddr, data); return; } } #if BX_CPU_LEVEL >= 4 && BX_SUPPORT_ALIGNMENT_CHECK if (BX_CPU_THIS_PTR alignment_check()) { if (laddr & 1) { BX_ERROR(("write_virtual_word_32(): #AC misaligned access")); exception(BX_AC_EXCEPTION, 0); } } #endif access_write_linear(laddr, 2, CPL, (void *) &data); return; } else { BX_ERROR(("write_virtual_word_32(): segment limit violation")); exception(int_number(s), 0); } } if (!write_virtual_checks(seg, offset, 2)) exception(int_number(s), 0); goto accessOK; } void BX_CPP_AttrRegparmN(3) BX_CPU_C::write_virtual_dword_32(unsigned s, Bit32u offset, Bit32u data) { Bit32u laddr; bx_segment_reg_t *seg = &BX_CPU_THIS_PTR sregs[s]; BX_ASSERT(BX_CPU_THIS_PTR cpu_mode != BX_MODE_LONG_64); if (seg->cache.valid & SegAccessWOK) { if (offset < (seg->cache.u.segment.limit_scaled-2)) { accessOK: laddr = get_laddr32(s, offset); unsigned tlbIndex = BX_TLB_INDEX_OF(laddr, 3); #if BX_SUPPORT_ALIGNMENT_CHECK && BX_CPU_LEVEL >= 4 Bit32u lpf = AlignedAccessLPFOf(laddr, (3 & BX_CPU_THIS_PTR alignment_check_mask)); #else Bit32u lpf = LPFOf(laddr); #endif bx_TLB_entry *tlbEntry = &BX_CPU_THIS_PTR TLB.entry[tlbIndex]; if (tlbEntry->lpf == lpf) { // See if the TLB entry privilege level allows us write access // from this CPL. if (tlbEntry->accessBits & (0x04 << USER_PL)) { bx_hostpageaddr_t hostPageAddr = tlbEntry->hostPageAddr; Bit32u pageOffset = PAGE_OFFSET(laddr); bx_phy_address pAddr = tlbEntry->ppf | pageOffset; BX_NOTIFY_LIN_MEMORY_ACCESS(laddr, pAddr, 4, CPL, BX_WRITE, (Bit8u*) &data); Bit32u *hostAddr = (Bit32u*) (hostPageAddr | pageOffset); pageWriteStampTable.decWriteStamp(pAddr, 4); WriteHostDWordToLittleEndian(hostAddr, data); return; } } #if BX_CPU_LEVEL >= 4 && BX_SUPPORT_ALIGNMENT_CHECK if (BX_CPU_THIS_PTR alignment_check()) { if (laddr & 3) { BX_ERROR(("write_virtual_dword_32(): #AC misaligned access")); exception(BX_AC_EXCEPTION, 0); } } #endif access_write_linear(laddr, 4, CPL, (void *) &data); return; } else { BX_ERROR(("write_virtual_dword_32(): segment limit violation")); exception(int_number(s), 0); } } if (!write_virtual_checks(seg, offset, 4)) exception(int_number(s), 0); goto accessOK; } void BX_CPP_AttrRegparmN(3) BX_CPU_C::write_virtual_qword_32(unsigned s, Bit32u offset, Bit64u data) { Bit32u laddr; bx_segment_reg_t *seg = &BX_CPU_THIS_PTR sregs[s]; BX_ASSERT(BX_CPU_THIS_PTR cpu_mode != BX_MODE_LONG_64); if (seg->cache.valid & SegAccessWOK) { if (offset <= (seg->cache.u.segment.limit_scaled-7)) { accessOK: laddr = get_laddr32(s, offset); unsigned tlbIndex = BX_TLB_INDEX_OF(laddr, 7); #if BX_SUPPORT_ALIGNMENT_CHECK && BX_CPU_LEVEL >= 4 Bit32u lpf = AlignedAccessLPFOf(laddr, (7 & BX_CPU_THIS_PTR alignment_check_mask)); #else Bit32u lpf = LPFOf(laddr); #endif bx_TLB_entry *tlbEntry = &BX_CPU_THIS_PTR TLB.entry[tlbIndex]; if (tlbEntry->lpf == lpf) { // See if the TLB entry privilege level allows us write access // from this CPL. if (tlbEntry->accessBits & (0x04 << USER_PL)) { bx_hostpageaddr_t hostPageAddr = tlbEntry->hostPageAddr; Bit32u pageOffset = PAGE_OFFSET(laddr); bx_phy_address pAddr = tlbEntry->ppf | pageOffset; BX_NOTIFY_LIN_MEMORY_ACCESS(laddr, pAddr, 8, CPL, BX_WRITE, (Bit8u*) &data); Bit64u *hostAddr = (Bit64u*) (hostPageAddr | pageOffset); pageWriteStampTable.decWriteStamp(pAddr, 8); WriteHostQWordToLittleEndian(hostAddr, data); return; } } #if BX_CPU_LEVEL >= 4 && BX_SUPPORT_ALIGNMENT_CHECK if (BX_CPU_THIS_PTR alignment_check()) { if (laddr & 7) { BX_ERROR(("write_virtual_qword_32(): #AC misaligned access")); exception(BX_AC_EXCEPTION, 0); } } #endif access_write_linear(laddr, 8, CPL, (void *) &data); return; } else { BX_ERROR(("write_virtual_qword_32(): segment limit violation")); exception(int_number(s), 0); } } if (!write_virtual_checks(seg, offset, 8)) exception(int_number(s), 0); goto accessOK; } #if BX_CPU_LEVEL >= 6 void BX_CPP_AttrRegparmN(3) BX_CPU_C::write_virtual_xmmword_32(unsigned s, Bit32u offset, const BxPackedXmmRegister *data) { Bit32u laddr; bx_segment_reg_t *seg = &BX_CPU_THIS_PTR sregs[s]; BX_ASSERT(BX_CPU_THIS_PTR cpu_mode != BX_MODE_LONG_64); if (seg->cache.valid & SegAccessWOK) { if (offset <= (seg->cache.u.segment.limit_scaled-15)) { accessOK: laddr = get_laddr32(s, offset); unsigned tlbIndex = BX_TLB_INDEX_OF(laddr, 15); Bit32u lpf = LPFOf(laddr); bx_TLB_entry *tlbEntry = &BX_CPU_THIS_PTR TLB.entry[tlbIndex]; if (tlbEntry->lpf == lpf) { // See if the TLB entry privilege level allows us write access // from this CPL. if (tlbEntry->accessBits & (0x04 << USER_PL)) { bx_hostpageaddr_t hostPageAddr = tlbEntry->hostPageAddr; Bit32u pageOffset = PAGE_OFFSET(laddr); bx_phy_address pAddr = tlbEntry->ppf | pageOffset; BX_NOTIFY_LIN_MEMORY_ACCESS(laddr, pAddr, 16, CPL, BX_WRITE, (Bit8u*) data); Bit64u *hostAddr = (Bit64u*) (hostPageAddr | pageOffset); pageWriteStampTable.decWriteStamp(pAddr, 16); WriteHostQWordToLittleEndian(hostAddr, data->xmm64u(0)); WriteHostQWordToLittleEndian(hostAddr+1, data->xmm64u(1)); return; } } access_write_linear(laddr, 16, CPL, (void *) data); return; } else { BX_ERROR(("write_virtual_xmmword_32(): segment limit violation")); exception(int_number(s), 0); } } if (!write_virtual_checks(seg, offset, 16)) exception(int_number(s), 0); goto accessOK; } void BX_CPP_AttrRegparmN(3) BX_CPU_C::write_virtual_xmmword_aligned_32(unsigned s, Bit32u offset, const BxPackedXmmRegister *data) { bx_segment_reg_t *seg = &BX_CPU_THIS_PTR sregs[s]; BX_ASSERT(BX_CPU_THIS_PTR cpu_mode != BX_MODE_LONG_64); Bit32u laddr = get_laddr32(s, offset); // must check alignment here because #GP on misaligned access is higher // priority than other segment related faults if (laddr & 15) { BX_ERROR(("write_virtual_xmmword_aligned_32(): #GP misaligned access")); exception(BX_GP_EXCEPTION, 0); } if (seg->cache.valid & SegAccessWOK) { if (offset <= (seg->cache.u.segment.limit_scaled-15)) { accessOK: unsigned tlbIndex = BX_TLB_INDEX_OF(laddr, 0); Bit32u lpf = LPFOf(laddr); bx_TLB_entry *tlbEntry = &BX_CPU_THIS_PTR TLB.entry[tlbIndex]; if (tlbEntry->lpf == lpf) { // See if the TLB entry privilege level allows us write access // from this CPL. if (tlbEntry->accessBits & (0x04 << USER_PL)) { bx_hostpageaddr_t hostPageAddr = tlbEntry->hostPageAddr; Bit32u pageOffset = PAGE_OFFSET(laddr); bx_phy_address pAddr = tlbEntry->ppf | pageOffset; BX_NOTIFY_LIN_MEMORY_ACCESS(laddr, pAddr, 16, CPL, BX_WRITE, (Bit8u*) data); Bit64u *hostAddr = (Bit64u*) (hostPageAddr | pageOffset); pageWriteStampTable.decWriteStamp(pAddr, 16); WriteHostQWordToLittleEndian(hostAddr, data->xmm64u(0)); WriteHostQWordToLittleEndian(hostAddr+1, data->xmm64u(1)); return; } } access_write_linear(laddr, 16, CPL, (void *) data); return; } else { BX_ERROR(("write_virtual_xmmword_aligned_32(): segment limit violation")); exception(int_number(s), 0); } } if (!write_virtual_checks(seg, offset, 16)) exception(int_number(s), 0); goto accessOK; } #if BX_SUPPORT_AVX void BX_CPU_C::write_virtual_ymmword_32(unsigned s, Bit32u offset, const BxPackedAvxRegister *data) { Bit32u laddr; bx_segment_reg_t *seg = &BX_CPU_THIS_PTR sregs[s]; BX_ASSERT(BX_CPU_THIS_PTR cpu_mode != BX_MODE_LONG_64); if (seg->cache.valid & SegAccessWOK) { if (offset <= (seg->cache.u.segment.limit_scaled-31)) { accessOK: laddr = get_laddr32(s, offset); unsigned tlbIndex = BX_TLB_INDEX_OF(laddr, 31); Bit32u lpf = LPFOf(laddr); bx_TLB_entry *tlbEntry = &BX_CPU_THIS_PTR TLB.entry[tlbIndex]; if (tlbEntry->lpf == lpf) { // See if the TLB entry privilege level allows us write access // from this CPL. if (tlbEntry->accessBits & (0x04 << USER_PL)) { bx_hostpageaddr_t hostPageAddr = tlbEntry->hostPageAddr; Bit32u pageOffset = PAGE_OFFSET(laddr); bx_phy_address pAddr = tlbEntry->ppf | pageOffset; BX_NOTIFY_LIN_MEMORY_ACCESS(laddr, pAddr, 32, CPL, BX_WRITE, (Bit8u*) data); Bit64u *hostAddr = (Bit64u*) (hostPageAddr | pageOffset); pageWriteStampTable.decWriteStamp(pAddr, 32); for (unsigned n=0; n < 4; n++) { WriteHostQWordToLittleEndian(hostAddr+n, data->avx64u(n)); } return; } } access_write_linear(laddr, 32, CPL, (void *) data); return; } else { BX_ERROR(("write_virtual_ymmword_32(): segment limit violation")); exception(int_number(s), 0); } } if (!write_virtual_checks(seg, offset, 32)) exception(int_number(s), 0); goto accessOK; } void BX_CPU_C::write_virtual_ymmword_aligned_32(unsigned s, Bit32u offset, const BxPackedAvxRegister *data) { bx_segment_reg_t *seg = &BX_CPU_THIS_PTR sregs[s]; BX_ASSERT(BX_CPU_THIS_PTR cpu_mode != BX_MODE_LONG_64); Bit32u laddr = get_laddr32(s, offset); // must check alignment here because #GP on misaligned access is higher // priority than other segment related faults if (laddr & 31) { BX_ERROR(("write_virtual_ymmword_aligned_32(): #GP misaligned access")); exception(BX_GP_EXCEPTION, 0); } if (seg->cache.valid & SegAccessWOK) { if (offset <= (seg->cache.u.segment.limit_scaled-31)) { accessOK: unsigned tlbIndex = BX_TLB_INDEX_OF(laddr, 0); Bit32u lpf = LPFOf(laddr); bx_TLB_entry *tlbEntry = &BX_CPU_THIS_PTR TLB.entry[tlbIndex]; if (tlbEntry->lpf == lpf) { // See if the TLB entry privilege level allows us write access // from this CPL. if (tlbEntry->accessBits & (0x04 << USER_PL)) { bx_hostpageaddr_t hostPageAddr = tlbEntry->hostPageAddr; Bit32u pageOffset = PAGE_OFFSET(laddr); bx_phy_address pAddr = tlbEntry->ppf | pageOffset; BX_NOTIFY_LIN_MEMORY_ACCESS(laddr, pAddr, 32, CPL, BX_WRITE, (Bit8u*) data); Bit64u *hostAddr = (Bit64u*) (hostPageAddr | pageOffset); pageWriteStampTable.decWriteStamp(pAddr, 32); for (unsigned n=0; n < 4; n++) { WriteHostQWordToLittleEndian(hostAddr+n, data->avx64u(n)); } return; } } access_write_linear(laddr, 32, CPL, (void *) data); return; } else { BX_ERROR(("write_virtual_ymmword_aligned_32(): segment limit violation")); exception(int_number(s), 0); } } if (!write_virtual_checks(seg, offset, 32)) exception(int_number(s), 0); goto accessOK; } #endif // BX_SUPPORT_AVX #endif Bit8u BX_CPP_AttrRegparmN(2) BX_CPU_C::read_virtual_byte_32(unsigned s, Bit32u offset) { Bit32u laddr; bx_segment_reg_t *seg = &BX_CPU_THIS_PTR sregs[s]; Bit8u data; BX_ASSERT(BX_CPU_THIS_PTR cpu_mode != BX_MODE_LONG_64); if (seg->cache.valid & SegAccessROK) { if (offset <= seg->cache.u.segment.limit_scaled) { accessOK: laddr = get_laddr32(s, offset); unsigned tlbIndex = BX_TLB_INDEX_OF(laddr, 0); Bit32u lpf = LPFOf(laddr); bx_TLB_entry *tlbEntry = &BX_CPU_THIS_PTR TLB.entry[tlbIndex]; if (tlbEntry->lpf == lpf) { // See if the TLB entry privilege level allows us read access // from this CPL. if (tlbEntry->accessBits & (0x01 << USER_PL)) { bx_hostpageaddr_t hostPageAddr = tlbEntry->hostPageAddr; Bit32u pageOffset = PAGE_OFFSET(laddr); Bit8u *hostAddr = (Bit8u*) (hostPageAddr | pageOffset); data = *hostAddr; BX_NOTIFY_LIN_MEMORY_ACCESS(laddr, (tlbEntry->ppf | pageOffset), 1, CPL, BX_READ, (Bit8u*) &data); return data; } } access_read_linear(laddr, 1, CPL, BX_READ, (void *) &data); return data; } else { BX_ERROR(("read_virtual_byte_32(): segment limit violation")); exception(int_number(s), 0); } } if (!read_virtual_checks(seg, offset, 1)) exception(int_number(s), 0); goto accessOK; } Bit16u BX_CPP_AttrRegparmN(2) BX_CPU_C::read_virtual_word_32(unsigned s, Bit32u offset) { Bit32u laddr; bx_segment_reg_t *seg = &BX_CPU_THIS_PTR sregs[s]; Bit16u data; BX_ASSERT(BX_CPU_THIS_PTR cpu_mode != BX_MODE_LONG_64); if (seg->cache.valid & SegAccessROK) { if (offset < seg->cache.u.segment.limit_scaled) { accessOK: laddr = get_laddr32(s, offset); unsigned tlbIndex = BX_TLB_INDEX_OF(laddr, 1); #if BX_SUPPORT_ALIGNMENT_CHECK && BX_CPU_LEVEL >= 4 Bit32u lpf = AlignedAccessLPFOf(laddr, (1 & BX_CPU_THIS_PTR alignment_check_mask)); #else Bit32u lpf = LPFOf(laddr); #endif bx_TLB_entry *tlbEntry = &BX_CPU_THIS_PTR TLB.entry[tlbIndex]; if (tlbEntry->lpf == lpf) { // See if the TLB entry privilege level allows us read access // from this CPL. if (tlbEntry->accessBits & (0x01 << USER_PL)) { bx_hostpageaddr_t hostPageAddr = tlbEntry->hostPageAddr; Bit32u pageOffset = PAGE_OFFSET(laddr); Bit16u *hostAddr = (Bit16u*) (hostPageAddr | pageOffset); ReadHostWordFromLittleEndian(hostAddr, data); BX_NOTIFY_LIN_MEMORY_ACCESS(laddr, (tlbEntry->ppf | pageOffset), 2, CPL, BX_READ, (Bit8u*) &data); return data; } } #if BX_CPU_LEVEL >= 4 && BX_SUPPORT_ALIGNMENT_CHECK if (BX_CPU_THIS_PTR alignment_check()) { if (laddr & 1) { BX_ERROR(("read_virtual_word_32(): #AC misaligned access")); exception(BX_AC_EXCEPTION, 0); } } #endif access_read_linear(laddr, 2, CPL, BX_READ, (void *) &data); return data; } else { BX_ERROR(("read_virtual_word_32(): segment limit violation")); exception(int_number(s), 0); } } if (!read_virtual_checks(seg, offset, 2)) exception(int_number(s), 0); goto accessOK; } Bit32u BX_CPP_AttrRegparmN(2) BX_CPU_C::read_virtual_dword_32(unsigned s, Bit32u offset) { Bit32u laddr; bx_segment_reg_t *seg = &BX_CPU_THIS_PTR sregs[s]; Bit32u data; BX_ASSERT(BX_CPU_THIS_PTR cpu_mode != BX_MODE_LONG_64); if (seg->cache.valid & SegAccessROK) { if (offset < (seg->cache.u.segment.limit_scaled-2)) { accessOK: laddr = get_laddr32(s, offset); unsigned tlbIndex = BX_TLB_INDEX_OF(laddr, 3); #if BX_SUPPORT_ALIGNMENT_CHECK && BX_CPU_LEVEL >= 4 Bit32u lpf = AlignedAccessLPFOf(laddr, (3 & BX_CPU_THIS_PTR alignment_check_mask)); #else Bit32u lpf = LPFOf(laddr); #endif bx_TLB_entry *tlbEntry = &BX_CPU_THIS_PTR TLB.entry[tlbIndex]; if (tlbEntry->lpf == lpf) { // See if the TLB entry privilege level allows us read access // from this CPL. if (tlbEntry->accessBits & (0x01 << USER_PL)) { bx_hostpageaddr_t hostPageAddr = tlbEntry->hostPageAddr; Bit32u pageOffset = PAGE_OFFSET(laddr); Bit32u *hostAddr = (Bit32u*) (hostPageAddr | pageOffset); ReadHostDWordFromLittleEndian(hostAddr, data); BX_NOTIFY_LIN_MEMORY_ACCESS(laddr, (tlbEntry->ppf | pageOffset), 4, CPL, BX_READ, (Bit8u*) &data); return data; } } #if BX_CPU_LEVEL >= 4 && BX_SUPPORT_ALIGNMENT_CHECK if (BX_CPU_THIS_PTR alignment_check()) { if (laddr & 3) { BX_ERROR(("read_virtual_dword_32(): #AC misaligned access")); exception(BX_AC_EXCEPTION, 0); } } #endif access_read_linear(laddr, 4, CPL, BX_READ, (void *) &data); return data; } else { BX_ERROR(("read_virtual_dword_32(): segment limit violation")); exception(int_number(s), 0); } } if (!read_virtual_checks(seg, offset, 4)) exception(int_number(s), 0); goto accessOK; } Bit64u BX_CPP_AttrRegparmN(2) BX_CPU_C::read_virtual_qword_32(unsigned s, Bit32u offset) { Bit32u laddr; bx_segment_reg_t *seg = &BX_CPU_THIS_PTR sregs[s]; Bit64u data; BX_ASSERT(BX_CPU_THIS_PTR cpu_mode != BX_MODE_LONG_64); if (seg->cache.valid & SegAccessROK) { if (offset <= (seg->cache.u.segment.limit_scaled-7)) { accessOK: laddr = get_laddr32(s, offset); unsigned tlbIndex = BX_TLB_INDEX_OF(laddr, 7); #if BX_SUPPORT_ALIGNMENT_CHECK && BX_CPU_LEVEL >= 4 Bit32u lpf = AlignedAccessLPFOf(laddr, (7 & BX_CPU_THIS_PTR alignment_check_mask)); #else Bit32u lpf = LPFOf(laddr); #endif bx_TLB_entry *tlbEntry = &BX_CPU_THIS_PTR TLB.entry[tlbIndex]; if (tlbEntry->lpf == lpf) { // See if the TLB entry privilege level allows us read access // from this CPL. if (tlbEntry->accessBits & (0x01 << USER_PL)) { bx_hostpageaddr_t hostPageAddr = tlbEntry->hostPageAddr; Bit32u pageOffset = PAGE_OFFSET(laddr); Bit64u *hostAddr = (Bit64u*) (hostPageAddr | pageOffset); ReadHostQWordFromLittleEndian(hostAddr, data); BX_NOTIFY_LIN_MEMORY_ACCESS(laddr, (tlbEntry->ppf | pageOffset), 8, CPL, BX_READ, (Bit8u*) &data); return data; } } #if BX_CPU_LEVEL >= 4 && BX_SUPPORT_ALIGNMENT_CHECK if (BX_CPU_THIS_PTR alignment_check()) { if (laddr & 7) { BX_ERROR(("read_virtual_qword_32(): #AC misaligned access")); exception(BX_AC_EXCEPTION, 0); } } #endif access_read_linear(laddr, 8, CPL, BX_READ, (void *) &data); return data; } else { BX_ERROR(("read_virtual_qword_32(): segment limit violation")); exception(int_number(s), 0); } } if (!read_virtual_checks(seg, offset, 8)) exception(int_number(s), 0); goto accessOK; } #if BX_CPU_LEVEL >= 6 void BX_CPP_AttrRegparmN(3) BX_CPU_C::read_virtual_xmmword_32(unsigned s, Bit32u offset, BxPackedXmmRegister *data) { Bit32u laddr; bx_segment_reg_t *seg = &BX_CPU_THIS_PTR sregs[s]; BX_ASSERT(BX_CPU_THIS_PTR cpu_mode != BX_MODE_LONG_64); if (seg->cache.valid & SegAccessROK) { if (offset <= (seg->cache.u.segment.limit_scaled-15)) { accessOK: laddr = get_laddr32(s, offset); unsigned tlbIndex = BX_TLB_INDEX_OF(laddr, 15); Bit32u lpf = LPFOf(laddr); bx_TLB_entry *tlbEntry = &BX_CPU_THIS_PTR TLB.entry[tlbIndex]; if (tlbEntry->lpf == lpf) { // See if the TLB entry privilege level allows us read access // from this CPL. if (tlbEntry->accessBits & (0x01 << USER_PL)) { bx_hostpageaddr_t hostPageAddr = tlbEntry->hostPageAddr; Bit32u pageOffset = PAGE_OFFSET(laddr); Bit64u *hostAddr = (Bit64u*) (hostPageAddr | pageOffset); ReadHostQWordFromLittleEndian(hostAddr, data->xmm64u(0)); ReadHostQWordFromLittleEndian(hostAddr+1, data->xmm64u(1)); BX_NOTIFY_LIN_MEMORY_ACCESS(laddr, (tlbEntry->ppf | pageOffset), 16, CPL, BX_READ, (Bit8u*) data); return; } } access_read_linear(laddr, 16, CPL, BX_READ, (void *) data); return; } else { BX_ERROR(("read_virtual_xmmword_32(): segment limit violation")); exception(int_number(s), 0); } } if (!read_virtual_checks(seg, offset, 16)) exception(int_number(s), 0); goto accessOK; } void BX_CPP_AttrRegparmN(3) BX_CPU_C::read_virtual_xmmword_aligned_32(unsigned s, Bit32u offset, BxPackedXmmRegister *data) { bx_segment_reg_t *seg = &BX_CPU_THIS_PTR sregs[s]; BX_ASSERT(BX_CPU_THIS_PTR cpu_mode != BX_MODE_LONG_64); Bit32u laddr = get_laddr32(s, offset); // must check alignment here because #GP on misaligned access is higher // priority than other segment related faults if (laddr & 15) { BX_ERROR(("read_virtual_xmmword_aligned_32(): #GP misaligned access")); exception(BX_GP_EXCEPTION, 0); } if (seg->cache.valid & SegAccessROK) { if (offset <= (seg->cache.u.segment.limit_scaled-15)) { accessOK: unsigned tlbIndex = BX_TLB_INDEX_OF(laddr, 0); Bit32u lpf = LPFOf(laddr); bx_TLB_entry *tlbEntry = &BX_CPU_THIS_PTR TLB.entry[tlbIndex]; if (tlbEntry->lpf == lpf) { // See if the TLB entry privilege level allows us read access // from this CPL. if (tlbEntry->accessBits & (0x01 << USER_PL)) { bx_hostpageaddr_t hostPageAddr = tlbEntry->hostPageAddr; Bit32u pageOffset = PAGE_OFFSET(laddr); Bit64u *hostAddr = (Bit64u*) (hostPageAddr | pageOffset); ReadHostQWordFromLittleEndian(hostAddr, data->xmm64u(0)); ReadHostQWordFromLittleEndian(hostAddr+1, data->xmm64u(1)); BX_NOTIFY_LIN_MEMORY_ACCESS(laddr, (tlbEntry->ppf | pageOffset), 16, CPL, BX_READ, (Bit8u*) data); return; } } access_read_linear(laddr, 16, CPL, BX_READ, (void *) data); return; } else { BX_ERROR(("read_virtual_xmmword_aligned_32(): segment limit violation")); exception(int_number(s), 0); } } if (!read_virtual_checks(seg, offset, 16)) exception(int_number(s), 0); goto accessOK; } #if BX_SUPPORT_AVX void BX_CPU_C::read_virtual_ymmword_32(unsigned s, Bit32u offset, BxPackedAvxRegister *data) { Bit32u laddr; bx_segment_reg_t *seg = &BX_CPU_THIS_PTR sregs[s]; BX_ASSERT(BX_CPU_THIS_PTR cpu_mode != BX_MODE_LONG_64); if (seg->cache.valid & SegAccessROK) { if (offset <= (seg->cache.u.segment.limit_scaled-31)) { accessOK: laddr = get_laddr32(s, offset); unsigned tlbIndex = BX_TLB_INDEX_OF(laddr, 31); Bit32u lpf = LPFOf(laddr); bx_TLB_entry *tlbEntry = &BX_CPU_THIS_PTR TLB.entry[tlbIndex]; if (tlbEntry->lpf == lpf) { // See if the TLB entry privilege level allows us read access // from this CPL. if (tlbEntry->accessBits & (0x01 << USER_PL)) { bx_hostpageaddr_t hostPageAddr = tlbEntry->hostPageAddr; Bit32u pageOffset = PAGE_OFFSET(laddr); Bit64u *hostAddr = (Bit64u*) (hostPageAddr | pageOffset); for (unsigned n=0; n < 4; n++) { ReadHostQWordFromLittleEndian(hostAddr+n, data->avx64u(n)); } BX_NOTIFY_LIN_MEMORY_ACCESS(laddr, (tlbEntry->ppf | pageOffset), 32, CPL, BX_READ, (Bit8u*) data); return; } } access_read_linear(laddr, 32, CPL, BX_READ, (void *) data); return; } else { BX_ERROR(("read_virtual_ymmword_32: segment limit violation")); exception(int_number(s), 0); } } if (!read_virtual_checks(seg, offset, 32)) exception(int_number(s), 0); goto accessOK; } void BX_CPU_C::read_virtual_ymmword_aligned_32(unsigned s, Bit32u offset, BxPackedAvxRegister *data) { bx_segment_reg_t *seg = &BX_CPU_THIS_PTR sregs[s]; BX_ASSERT(BX_CPU_THIS_PTR cpu_mode != BX_MODE_LONG_64); Bit32u laddr = get_laddr32(s, offset); // must check alignment here because #GP on misaligned access is higher // priority than other segment related faults if (laddr & 31) { BX_ERROR(("read_virtual_ymmword_aligned_32(): #GP misaligned access")); exception(BX_GP_EXCEPTION, 0); } if (seg->cache.valid & SegAccessROK) { if (offset <= (seg->cache.u.segment.limit_scaled-31)) { accessOK: unsigned tlbIndex = BX_TLB_INDEX_OF(laddr, 0); Bit32u lpf = LPFOf(laddr); bx_TLB_entry *tlbEntry = &BX_CPU_THIS_PTR TLB.entry[tlbIndex]; if (tlbEntry->lpf == lpf) { // See if the TLB entry privilege level allows us read access // from this CPL. if (tlbEntry->accessBits & (0x01 << USER_PL)) { bx_hostpageaddr_t hostPageAddr = tlbEntry->hostPageAddr; Bit32u pageOffset = PAGE_OFFSET(laddr); Bit64u *hostAddr = (Bit64u*) (hostPageAddr | pageOffset); for (unsigned n=0; n < 4; n++) { ReadHostQWordFromLittleEndian(hostAddr+n, data->avx64u(n)); } BX_NOTIFY_LIN_MEMORY_ACCESS(laddr, (tlbEntry->ppf | pageOffset), 32, CPL, BX_READ, (Bit8u*) data); return; } } access_read_linear(laddr, 32, CPL, BX_READ, (void *) data); return; } else { BX_ERROR(("read_virtual_ymmword_aligned_32(): segment limit violation")); exception(int_number(s), 0); } } if (!read_virtual_checks(seg, offset, 32)) exception(int_number(s), 0); goto accessOK; } #endif #endif ////////////////////////////////////////////////////////////// // special Read-Modify-Write operations // // address translation info is kept across read/write calls // ////////////////////////////////////////////////////////////// Bit8u BX_CPP_AttrRegparmN(2) BX_CPU_C::read_RMW_virtual_byte_32(unsigned s, Bit32u offset) { Bit32u laddr; bx_segment_reg_t *seg = &BX_CPU_THIS_PTR sregs[s]; Bit8u data; BX_ASSERT(BX_CPU_THIS_PTR cpu_mode != BX_MODE_LONG_64); if (seg->cache.valid & SegAccessWOK) { if (offset <= seg->cache.u.segment.limit_scaled) { accessOK: laddr = get_laddr32(s, offset); unsigned tlbIndex = BX_TLB_INDEX_OF(laddr, 0); Bit32u lpf = LPFOf(laddr); bx_TLB_entry *tlbEntry = &BX_CPU_THIS_PTR TLB.entry[tlbIndex]; //AO change next line if (0) { //tlbEntry->lpf == lpf) { // See if the TLB entry privilege level allows us write access // from this CPL. if (tlbEntry->accessBits & (0x04 << USER_PL)) { bx_hostpageaddr_t hostPageAddr = tlbEntry->hostPageAddr; Bit32u pageOffset = PAGE_OFFSET(laddr); bx_phy_address pAddr = tlbEntry->ppf | pageOffset; Bit8u *hostAddr = (Bit8u*) (hostPageAddr | pageOffset); pageWriteStampTable.decWriteStamp(pAddr, 1); data = *hostAddr; BX_CPU_THIS_PTR address_xlation.pages = (bx_ptr_equiv_t) hostAddr; BX_CPU_THIS_PTR address_xlation.paddress1 = pAddr; BX_NOTIFY_LIN_MEMORY_ACCESS(laddr, pAddr, 1, CPL, BX_READ, (Bit8u*) &data); return data; } } access_read_linear(laddr, 1, CPL, BX_RW, (void *) &data); return data; } else { BX_ERROR(("read_RMW_virtual_byte_32(): segment limit violation")); exception(int_number(s), 0); } } if (!write_virtual_checks(seg, offset, 1)) exception(int_number(s), 0); goto accessOK; } Bit16u BX_CPP_AttrRegparmN(2) BX_CPU_C::read_RMW_virtual_word_32(unsigned s, Bit32u offset) { Bit32u laddr; bx_segment_reg_t *seg = &BX_CPU_THIS_PTR sregs[s]; Bit16u data; BX_ASSERT(BX_CPU_THIS_PTR cpu_mode != BX_MODE_LONG_64); if (seg->cache.valid & SegAccessWOK) { if (offset < seg->cache.u.segment.limit_scaled) { accessOK: laddr = get_laddr32(s, offset); unsigned tlbIndex = BX_TLB_INDEX_OF(laddr, 1); #if BX_SUPPORT_ALIGNMENT_CHECK && BX_CPU_LEVEL >= 4 Bit32u lpf = AlignedAccessLPFOf(laddr, (1 & BX_CPU_THIS_PTR alignment_check_mask)); #else Bit32u lpf = LPFOf(laddr); #endif bx_TLB_entry *tlbEntry = &BX_CPU_THIS_PTR TLB.entry[tlbIndex]; //AO change next line if (0) { //tlbEntry->lpf == lpf) { // See if the TLB entry privilege level allows us write access // from this CPL. if (tlbEntry->accessBits & (0x04 << USER_PL)) { bx_hostpageaddr_t hostPageAddr = tlbEntry->hostPageAddr; Bit32u pageOffset = PAGE_OFFSET(laddr); bx_phy_address pAddr = tlbEntry->ppf | pageOffset; Bit16u *hostAddr = (Bit16u*) (hostPageAddr | pageOffset); pageWriteStampTable.decWriteStamp(pAddr, 2); ReadHostWordFromLittleEndian(hostAddr, data); BX_CPU_THIS_PTR address_xlation.pages = (bx_ptr_equiv_t) hostAddr; BX_CPU_THIS_PTR address_xlation.paddress1 = pAddr; BX_NOTIFY_LIN_MEMORY_ACCESS(laddr, pAddr, 2, CPL, BX_READ, (Bit8u*) &data); return data; } } #if BX_CPU_LEVEL >= 4 && BX_SUPPORT_ALIGNMENT_CHECK if (BX_CPU_THIS_PTR alignment_check()) { if (laddr & 1) { BX_ERROR(("read_RMW_virtual_word_32(): #AC misaligned access")); exception(BX_AC_EXCEPTION, 0); } } #endif access_read_linear(laddr, 2, CPL, BX_RW, (void *) &data); return data; } else { BX_ERROR(("read_RMW_virtual_word_32(): segment limit violation")); exception(int_number(s), 0); } } if (!write_virtual_checks(seg, offset, 2)) exception(int_number(s), 0); goto accessOK; } Bit32u BX_CPP_AttrRegparmN(2) BX_CPU_C::read_RMW_virtual_dword_32(unsigned s, Bit32u offset) { Bit32u laddr; bx_segment_reg_t *seg = &BX_CPU_THIS_PTR sregs[s]; Bit32u data; BX_ASSERT(BX_CPU_THIS_PTR cpu_mode != BX_MODE_LONG_64); if (seg->cache.valid & SegAccessWOK) { if (offset < (seg->cache.u.segment.limit_scaled-2)) { accessOK: laddr = get_laddr32(s, offset); unsigned tlbIndex = BX_TLB_INDEX_OF(laddr, 3); #if BX_SUPPORT_ALIGNMENT_CHECK && BX_CPU_LEVEL >= 4 Bit32u lpf = AlignedAccessLPFOf(laddr, (3 & BX_CPU_THIS_PTR alignment_check_mask)); #else Bit32u lpf = LPFOf(laddr); #endif bx_TLB_entry *tlbEntry = &BX_CPU_THIS_PTR TLB.entry[tlbIndex]; //AO change next line if (0) { //tlbEntry->lpf == lpf) { // See if the TLB entry privilege level allows us write access // from this CPL. if (tlbEntry->accessBits & (0x04 << USER_PL)) { bx_hostpageaddr_t hostPageAddr = tlbEntry->hostPageAddr; Bit32u pageOffset = PAGE_OFFSET(laddr); bx_phy_address pAddr = tlbEntry->ppf | pageOffset; Bit32u *hostAddr = (Bit32u*) (hostPageAddr | pageOffset); pageWriteStampTable.decWriteStamp(pAddr, 4); ReadHostDWordFromLittleEndian(hostAddr, data); BX_CPU_THIS_PTR address_xlation.pages = (bx_ptr_equiv_t) hostAddr; BX_CPU_THIS_PTR address_xlation.paddress1 = pAddr; BX_NOTIFY_LIN_MEMORY_ACCESS(laddr, pAddr, 4, CPL, BX_READ, (Bit8u*) &data); return data; } } #if BX_CPU_LEVEL >= 4 && BX_SUPPORT_ALIGNMENT_CHECK if (BX_CPU_THIS_PTR alignment_check()) { if (laddr & 3) { BX_ERROR(("read_RMW_virtual_dword_32(): #AC misaligned access")); exception(BX_AC_EXCEPTION, 0); } } #endif access_read_linear(laddr, 4, CPL, BX_RW, (void *) &data); return data; } else { BX_ERROR(("read_RMW_virtual_dword_32(): segment limit violation")); exception(int_number(s), 0); } } if (!write_virtual_checks(seg, offset, 4)) exception(int_number(s), 0); goto accessOK; } Bit64u BX_CPP_AttrRegparmN(2) BX_CPU_C::read_RMW_virtual_qword_32(unsigned s, Bit32u offset) { Bit32u laddr; bx_segment_reg_t *seg = &BX_CPU_THIS_PTR sregs[s]; Bit64u data; BX_ASSERT(BX_CPU_THIS_PTR cpu_mode != BX_MODE_LONG_64); if (seg->cache.valid & SegAccessWOK) { if (offset <= (seg->cache.u.segment.limit_scaled-7)) { accessOK: laddr = get_laddr32(s, offset); unsigned tlbIndex = BX_TLB_INDEX_OF(laddr, 7); #if BX_SUPPORT_ALIGNMENT_CHECK && BX_CPU_LEVEL >= 4 Bit32u lpf = AlignedAccessLPFOf(laddr, (7 & BX_CPU_THIS_PTR alignment_check_mask)); #else Bit32u lpf = LPFOf(laddr); #endif bx_TLB_entry *tlbEntry = &BX_CPU_THIS_PTR TLB.entry[tlbIndex]; if (tlbEntry->lpf == lpf) { // See if the TLB entry privilege level allows us write access // from this CPL. if (tlbEntry->accessBits & (0x04 << USER_PL)) { bx_hostpageaddr_t hostPageAddr = tlbEntry->hostPageAddr; Bit32u pageOffset = PAGE_OFFSET(laddr); bx_phy_address pAddr = tlbEntry->ppf | pageOffset; Bit64u *hostAddr = (Bit64u*) (hostPageAddr | pageOffset); pageWriteStampTable.decWriteStamp(pAddr, 8); ReadHostQWordFromLittleEndian(hostAddr, data); BX_CPU_THIS_PTR address_xlation.pages = (bx_ptr_equiv_t) hostAddr; BX_CPU_THIS_PTR address_xlation.paddress1 = pAddr; BX_NOTIFY_LIN_MEMORY_ACCESS(laddr, pAddr, 8, CPL, BX_READ, (Bit8u*) &data); return data; } } #if BX_CPU_LEVEL >= 4 && BX_SUPPORT_ALIGNMENT_CHECK if (BX_CPU_THIS_PTR alignment_check()) { if (laddr & 7) { BX_ERROR(("read_RMW_virtual_qword_32(): #AC misaligned access")); exception(BX_AC_EXCEPTION, 0); } } #endif access_read_linear(laddr, 8, CPL, BX_RW, (void *) &data); return data; } else { BX_ERROR(("read_RMW_virtual_qword_32(): segment limit violation")); exception(int_number(s), 0); } } if (!write_virtual_checks(seg, offset, 8)) exception(int_number(s), 0); goto accessOK; } void BX_CPP_AttrRegparmN(1) BX_CPU_C::write_RMW_virtual_byte(Bit8u val8) { BX_DBG_PHY_MEMORY_ACCESS(BX_CPU_ID, BX_CPU_THIS_PTR address_xlation.paddress1, 1, BX_WRITE, 0, (Bit8u*) &val8); if (BX_CPU_THIS_PTR address_xlation.pages > 2) { // Pages > 2 means it stores a host address for direct access. Bit8u *hostAddr = (Bit8u *) BX_CPU_THIS_PTR address_xlation.pages; *hostAddr = val8; } else { // address_xlation.pages must be 1 access_write_physical(BX_CPU_THIS_PTR address_xlation.paddress1, 1, &val8); } } void BX_CPP_AttrRegparmN(1) BX_CPU_C::write_RMW_virtual_word(Bit16u val16) { if (BX_CPU_THIS_PTR address_xlation.pages > 2) { // Pages > 2 means it stores a host address for direct access. Bit16u *hostAddr = (Bit16u *) BX_CPU_THIS_PTR address_xlation.pages; WriteHostWordToLittleEndian(hostAddr, val16); BX_DBG_PHY_MEMORY_ACCESS(BX_CPU_ID, BX_CPU_THIS_PTR address_xlation.paddress1, 2, BX_WRITE, 0, (Bit8u*) &val16); } else if (BX_CPU_THIS_PTR address_xlation.pages == 1) { access_write_physical(BX_CPU_THIS_PTR address_xlation.paddress1, 2, &val16); BX_DBG_PHY_MEMORY_ACCESS(BX_CPU_ID, BX_CPU_THIS_PTR address_xlation.paddress1, 2, BX_WRITE, 0, (Bit8u*) &val16); } else { #ifdef BX_LITTLE_ENDIAN access_write_physical(BX_CPU_THIS_PTR address_xlation.paddress1, 1, &val16); BX_DBG_PHY_MEMORY_ACCESS(BX_CPU_ID, BX_CPU_THIS_PTR address_xlation.paddress1, 1, BX_WRITE, 0, (Bit8u*) &val16); access_write_physical(BX_CPU_THIS_PTR address_xlation.paddress2, 1, ((Bit8u *) &val16) + 1); BX_DBG_PHY_MEMORY_ACCESS(BX_CPU_ID, BX_CPU_THIS_PTR address_xlation.paddress2, 1, BX_WRITE, 0, ((Bit8u*) &val16)+1); #else access_write_physical(BX_CPU_THIS_PTR address_xlation.paddress1, 1, ((Bit8u *) &val16) + 1); BX_DBG_PHY_MEMORY_ACCESS(BX_CPU_ID, BX_CPU_THIS_PTR address_xlation.paddress1, 1, BX_WRITE, 0, ((Bit8u*) &val16)+1); access_write_physical(BX_CPU_THIS_PTR address_xlation.paddress2, 1, &val16); BX_DBG_PHY_MEMORY_ACCESS(BX_CPU_ID, BX_CPU_THIS_PTR address_xlation.paddress2, 1, BX_WRITE, 0, (Bit8u*) &val16); #endif } } void BX_CPP_AttrRegparmN(1) BX_CPU_C::write_RMW_virtual_dword(Bit32u val32) { if (BX_CPU_THIS_PTR address_xlation.pages > 2) { // Pages > 2 means it stores a host address for direct access. Bit32u *hostAddr = (Bit32u *) BX_CPU_THIS_PTR address_xlation.pages; WriteHostDWordToLittleEndian(hostAddr, val32); BX_DBG_PHY_MEMORY_ACCESS(BX_CPU_ID, BX_CPU_THIS_PTR address_xlation.paddress1, 4, BX_WRITE, 0, (Bit8u*) &val32); } else if (BX_CPU_THIS_PTR address_xlation.pages == 1) { access_write_physical(BX_CPU_THIS_PTR address_xlation.paddress1, 4, &val32); BX_DBG_PHY_MEMORY_ACCESS(BX_CPU_ID, BX_CPU_THIS_PTR address_xlation.paddress1, 4, BX_WRITE, 0, (Bit8u*) &val32); } else { #ifdef BX_LITTLE_ENDIAN access_write_physical(BX_CPU_THIS_PTR address_xlation.paddress1, BX_CPU_THIS_PTR address_xlation.len1, &val32); BX_DBG_PHY_MEMORY_ACCESS(BX_CPU_ID, BX_CPU_THIS_PTR address_xlation.paddress1, BX_CPU_THIS_PTR address_xlation.len1, BX_WRITE, 0, (Bit8u*) &val32); access_write_physical(BX_CPU_THIS_PTR address_xlation.paddress2, BX_CPU_THIS_PTR address_xlation.len2, ((Bit8u *) &val32) + BX_CPU_THIS_PTR address_xlation.len1); BX_DBG_PHY_MEMORY_ACCESS(BX_CPU_ID, BX_CPU_THIS_PTR address_xlation.paddress2, BX_CPU_THIS_PTR address_xlation.len2, BX_WRITE, 0, ((Bit8u *) &val32) + BX_CPU_THIS_PTR address_xlation.len1); #else access_write_physical(BX_CPU_THIS_PTR address_xlation.paddress1, BX_CPU_THIS_PTR address_xlation.len1, ((Bit8u *) &val32) + (4 - BX_CPU_THIS_PTR address_xlation.len1)); BX_DBG_PHY_MEMORY_ACCESS(BX_CPU_ID, BX_CPU_THIS_PTR address_xlation.paddress1, BX_CPU_THIS_PTR address_xlation.len1, BX_WRITE, 0, ((Bit8u *) &val32) + (4 - BX_CPU_THIS_PTR address_xlation.len1)); access_write_physical(BX_CPU_THIS_PTR address_xlation.paddress2, BX_CPU_THIS_PTR address_xlation.len2, &val32); BX_DBG_PHY_MEMORY_ACCESS(BX_CPU_ID, BX_CPU_THIS_PTR address_xlation.paddress2, BX_CPU_THIS_PTR address_xlation.len2, BX_WRITE, 0, (Bit8u*) &val32); #endif } } void BX_CPP_AttrRegparmN(1) BX_CPU_C::write_RMW_virtual_qword(Bit64u val64) { if (BX_CPU_THIS_PTR address_xlation.pages > 2) { // Pages > 2 means it stores a host address for direct access. Bit64u *hostAddr = (Bit64u *) BX_CPU_THIS_PTR address_xlation.pages; WriteHostQWordToLittleEndian(hostAddr, val64); BX_DBG_PHY_MEMORY_ACCESS(BX_CPU_ID, BX_CPU_THIS_PTR address_xlation.paddress1, 8, BX_WRITE, 0, (Bit8u*) &val64); } else if (BX_CPU_THIS_PTR address_xlation.pages == 1) { access_write_physical(BX_CPU_THIS_PTR address_xlation.paddress1, 8, &val64); BX_DBG_PHY_MEMORY_ACCESS(BX_CPU_ID, BX_CPU_THIS_PTR address_xlation.paddress1, 8, BX_WRITE, 0, (Bit8u*) &val64); } else { #ifdef BX_LITTLE_ENDIAN access_write_physical(BX_CPU_THIS_PTR address_xlation.paddress1, BX_CPU_THIS_PTR address_xlation.len1, &val64); BX_DBG_PHY_MEMORY_ACCESS(BX_CPU_ID, BX_CPU_THIS_PTR address_xlation.paddress1, BX_CPU_THIS_PTR address_xlation.len1, BX_WRITE, 0, (Bit8u*) &val64); access_write_physical(BX_CPU_THIS_PTR address_xlation.paddress2, BX_CPU_THIS_PTR address_xlation.len2, ((Bit8u *) &val64) + BX_CPU_THIS_PTR address_xlation.len1); BX_DBG_PHY_MEMORY_ACCESS(BX_CPU_ID, BX_CPU_THIS_PTR address_xlation.paddress2, BX_CPU_THIS_PTR address_xlation.len2, BX_WRITE, 0, ((Bit8u *) &val64) + BX_CPU_THIS_PTR address_xlation.len1); #else access_write_physical(BX_CPU_THIS_PTR address_xlation.paddress1, BX_CPU_THIS_PTR address_xlation.len1, ((Bit8u *) &val64) + (8 - BX_CPU_THIS_PTR address_xlation.len1)); BX_DBG_PHY_MEMORY_ACCESS(BX_CPU_ID, BX_CPU_THIS_PTR address_xlation.paddress1, BX_CPU_THIS_PTR address_xlation.len1, BX_WRITE, 0, ((Bit8u *) &val64) + (8 - BX_CPU_THIS_PTR address_xlation.len1)); access_write_physical(BX_CPU_THIS_PTR address_xlation.paddress2, BX_CPU_THIS_PTR address_xlation.len2, &val64); BX_DBG_PHY_MEMORY_ACCESS(BX_CPU_ID, BX_CPU_THIS_PTR address_xlation.paddress2, BX_CPU_THIS_PTR address_xlation.len2, BX_WRITE, 0, (Bit8u*) &val64); #endif } } // // Write data to new stack, these methods are required for emulation // correctness but not performance critical. // // assuming the write happens in legacy mode void BX_CPU_C::write_new_stack_word_32(bx_segment_reg_t *seg, Bit32u offset, unsigned curr_pl, Bit16u data) { Bit32u laddr; if (seg->cache.valid & SegAccessWOK) { if (offset < seg->cache.u.segment.limit_scaled) { accessOK: laddr = (Bit32u)(seg->cache.u.segment.base) + offset; bx_bool user = (curr_pl == 3); unsigned tlbIndex = BX_TLB_INDEX_OF(laddr, 1); #if BX_SUPPORT_ALIGNMENT_CHECK && BX_CPU_LEVEL >= 4 Bit32u lpf = AlignedAccessLPFOf(laddr, (1 & BX_CPU_THIS_PTR alignment_check_mask)); #else Bit32u lpf = LPFOf(laddr); #endif bx_TLB_entry *tlbEntry = &BX_CPU_THIS_PTR TLB.entry[tlbIndex]; if (tlbEntry->lpf == lpf) { // See if the TLB entry privilege level allows us write access // from this CPL. if (tlbEntry->accessBits & (0x04 << user)) { bx_hostpageaddr_t hostPageAddr = tlbEntry->hostPageAddr; Bit32u pageOffset = PAGE_OFFSET(laddr); bx_phy_address pAddr = tlbEntry->ppf | pageOffset; BX_NOTIFY_LIN_MEMORY_ACCESS(laddr, pAddr, 2, curr_pl, BX_WRITE, (Bit8u*) &data); Bit16u *hostAddr = (Bit16u*) (hostPageAddr | pageOffset); pageWriteStampTable.decWriteStamp(pAddr, 2); WriteHostWordToLittleEndian(hostAddr, data); return; } } #if BX_CPU_LEVEL >= 4 && BX_SUPPORT_ALIGNMENT_CHECK if (BX_CPU_THIS_PTR alignment_check() && user) { if (laddr & 1) { BX_ERROR(("write_new_stack_word_32(): #AC misaligned access")); exception(BX_AC_EXCEPTION, 0); } } #endif access_write_linear(laddr, 2, curr_pl, (void *) &data); return; } else { BX_ERROR(("write_new_stack_word_32(): segment limit violation")); exception(BX_SS_EXCEPTION, seg->selector.rpl != CPL ? (seg->selector.value & 0xfffc) : 0); } } // add error code when segment violation occurs when pushing into new stack if (!write_virtual_checks(seg, offset, 2)) exception(BX_SS_EXCEPTION, seg->selector.rpl != CPL ? (seg->selector.value & 0xfffc) : 0); goto accessOK; } // assuming the write happens in legacy mode void BX_CPU_C::write_new_stack_dword_32(bx_segment_reg_t *seg, Bit32u offset, unsigned curr_pl, Bit32u data) { Bit32u laddr; if (seg->cache.valid & SegAccessWOK) { if (offset < (seg->cache.u.segment.limit_scaled-2)) { accessOK: laddr = (Bit32u)(seg->cache.u.segment.base) + offset; bx_bool user = (curr_pl == 3); unsigned tlbIndex = BX_TLB_INDEX_OF(laddr, 3); #if BX_SUPPORT_ALIGNMENT_CHECK && BX_CPU_LEVEL >= 4 Bit32u lpf = AlignedAccessLPFOf(laddr, (3 & BX_CPU_THIS_PTR alignment_check_mask)); #else Bit32u lpf = LPFOf(laddr); #endif bx_TLB_entry *tlbEntry = &BX_CPU_THIS_PTR TLB.entry[tlbIndex]; if (tlbEntry->lpf == lpf) { // See if the TLB entry privilege level allows us write access // from this CPL. if (tlbEntry->accessBits & (0x04 << user)) { bx_hostpageaddr_t hostPageAddr = tlbEntry->hostPageAddr; Bit32u pageOffset = PAGE_OFFSET(laddr); bx_phy_address pAddr = tlbEntry->ppf | pageOffset; BX_NOTIFY_LIN_MEMORY_ACCESS(laddr, pAddr, 4, curr_pl, BX_WRITE, (Bit8u*) &data); Bit32u *hostAddr = (Bit32u*) (hostPageAddr | pageOffset); pageWriteStampTable.decWriteStamp(pAddr, 4); WriteHostDWordToLittleEndian(hostAddr, data); return; } } #if BX_CPU_LEVEL >= 4 && BX_SUPPORT_ALIGNMENT_CHECK if (BX_CPU_THIS_PTR alignment_check() && user) { if (laddr & 3) { BX_ERROR(("write_new_stack_dword_32(): #AC misaligned access")); exception(BX_AC_EXCEPTION, 0); } } #endif access_write_linear(laddr, 4, curr_pl, (void *) &data); return; } else { BX_ERROR(("write_new_stack_dword_32(): segment limit violation")); exception(BX_SS_EXCEPTION, seg->selector.rpl != CPL ? (seg->selector.value & 0xfffc) : 0); } } // add error code when segment violation occurs when pushing into new stack if (!write_virtual_checks(seg, offset, 4)) exception(BX_SS_EXCEPTION, seg->selector.rpl != CPL ? (seg->selector.value & 0xfffc) : 0); goto accessOK; } // assuming the write happens in legacy mode void BX_CPU_C::write_new_stack_qword_32(bx_segment_reg_t *seg, Bit32u offset, unsigned curr_pl, Bit64u data) { Bit32u laddr; if (seg->cache.valid & SegAccessWOK) { if (offset <= (seg->cache.u.segment.limit_scaled-7)) { accessOK: laddr = (Bit32u)(seg->cache.u.segment.base) + offset; bx_bool user = (curr_pl == 3); unsigned tlbIndex = BX_TLB_INDEX_OF(laddr, 7); #if BX_SUPPORT_ALIGNMENT_CHECK && BX_CPU_LEVEL >= 4 Bit32u lpf = AlignedAccessLPFOf(laddr, (7 & BX_CPU_THIS_PTR alignment_check_mask)); #else Bit32u lpf = LPFOf(laddr); #endif bx_TLB_entry *tlbEntry = &BX_CPU_THIS_PTR TLB.entry[tlbIndex]; if (tlbEntry->lpf == lpf) { // See if the TLB entry privilege level allows us write access // from this CPL. if (tlbEntry->accessBits & (0x04 << user)) { bx_hostpageaddr_t hostPageAddr = tlbEntry->hostPageAddr; Bit32u pageOffset = PAGE_OFFSET(laddr); bx_phy_address pAddr = tlbEntry->ppf | pageOffset; BX_NOTIFY_LIN_MEMORY_ACCESS(laddr, pAddr, 8, curr_pl, BX_WRITE, (Bit8u*) &data); Bit64u *hostAddr = (Bit64u*) (hostPageAddr | pageOffset); pageWriteStampTable.decWriteStamp(pAddr, 8); WriteHostQWordToLittleEndian(hostAddr, data); return; } } #if BX_CPU_LEVEL >= 4 && BX_SUPPORT_ALIGNMENT_CHECK if (BX_CPU_THIS_PTR alignment_check() && user) { if (laddr & 7) { BX_ERROR(("write_new_stack_qword_32(): #AC misaligned access")); exception(BX_AC_EXCEPTION, 0); } } #endif access_write_linear(laddr, 8, curr_pl, (void *) &data); return; } else { BX_ERROR(("write_new_stack_qword_32(): segment limit violation")); exception(BX_SS_EXCEPTION, seg->selector.rpl != CPL ? (seg->selector.value & 0xfffc) : 0); } } // add error code when segment violation occurs when pushing into new stack if (!write_virtual_checks(seg, offset, 8)) exception(BX_SS_EXCEPTION, seg->selector.rpl != CPL ? (seg->selector.value & 0xfffc) : 0); goto accessOK; }
{ "pile_set_name": "Github" }
/** * Checks if `value` is classified as an `Array` object. * * @static * @memberOf _ * @type Function * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. * @example * * _.isArray([1, 2, 3]); * // => true * * _.isArray(document.body.children); * // => false * * _.isArray('abc'); * // => false * * _.isArray(_.noop); * // => false */ var isArray = Array.isArray; module.exports = isArray;
{ "pile_set_name": "Github" }
#' @param prior_PD A logical scalar (defaulting to \code{FALSE}) indicating #' whether to draw from the prior predictive distribution instead of #' conditioning on the outcome.
{ "pile_set_name": "Github" }
.slider-disabled { opacity: 0.5; filter: alpha(opacity=50); } .slider-h { height: 22px; } .slider-v { width: 22px; } .slider-inner { position: relative; height: 6px; top: 7px; border-width: 1px; border-style: solid; border-radius: 0px; } .slider-handle { position: absolute; display: block; outline: none; width: 20px; height: 20px; top: 50%; margin-top: -10px; margin-left: -10px; } .slider-tip { position: absolute; display: inline-block; line-height: 12px; font-size: 12px; white-space: nowrap; top: -22px; } .slider-rule { position: relative; top: 15px; } .slider-rule span { position: absolute; display: inline-block; font-size: 0; height: 5px; border-width: 0 0 0 1px; border-style: solid; } .slider-rulelabel { position: relative; top: 20px; } .slider-rulelabel span { position: absolute; display: inline-block; font-size: 12px; } .slider-v .slider-inner { width: 6px; left: 7px; top: 0; float: left; } .slider-v .slider-handle { left: 50%; margin-top: -10px; } .slider-v .slider-tip { left: -10px; margin-top: -6px; } .slider-v .slider-rule { float: left; top: 0; left: 16px; } .slider-v .slider-rule span { width: 5px; height: 'auto'; border-left: 0; border-width: 1px 0 0 0; border-style: solid; } .slider-v .slider-rulelabel { float: left; top: 0; left: 23px; } .slider-handle { background: url('images/slider_handle.png') no-repeat; } .slider-inner { border-color: #abafb8; background: #c7ccd1; } .slider-rule span { border-color: #abafb8; } .slider-rulelabel span { color: #404040; }
{ "pile_set_name": "Github" }
two cluster plummer 16384 1e-6 64 5 .025 0.0 cost zones
{ "pile_set_name": "Github" }
/********************************************************************** *These solidity codes have been obtained from Etherscan for extracting *the smartcontract related info. *The data will be used by MATRIX AI team as the reference basis for *MATRIX model analysis,extraction of contract semantics, *as well as AI based data analysis, etc. **********************************************************************/ pragma solidity 0.4.19; library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0)); OwnershipTransferred(owner, newOwner); owner = newOwner; } } contract HasNoContracts is Ownable { /** * @dev Reclaim ownership of Ownable contracts * @param contractAddr The address of the Ownable to be reclaimed. */ function reclaimContract(address contractAddr) external onlyOwner { Ownable contractInst = Ownable(contractAddr); contractInst.transferOwnership(owner); } } contract HasNoEther is Ownable { /** * @dev Constructor that rejects incoming Ether * @dev The `payable` flag is added so we can access `msg.value` without compiler warning. If we * leave out payable, then Solidity will allow inheriting contracts to implement a payable * constructor. By doing it this way we prevent a payable constructor from working. Alternatively * we could use assembly to access msg.value. */ function HasNoEther() public payable { require(msg.value == 0); } /** * @dev Disallows direct send by settings a default function without the `payable` flag. */ function() external { } /** * @dev Transfer all Ether held by the contract to the owner. */ function reclaimEther() external onlyOwner { assert(owner.send(this.balance)); } } contract ERC20Basic { uint256 public totalSupply; function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[msg.sender]); // SafeMath.sub will throw if there is not enough balance. balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256 balance) { return balances[_owner]; } } contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeERC20 { function safeTransfer(ERC20Basic token, address to, uint256 value) internal { assert(token.transfer(to, value)); } function safeTransferFrom(ERC20 token, address from, address to, uint256 value) internal { assert(token.transferFrom(from, to, value)); } function safeApprove(ERC20 token, address spender, uint256 value) internal { assert(token.approve(spender, value)); } } contract CanReclaimToken is Ownable { using SafeERC20 for ERC20Basic; /** * @dev Reclaim all ERC20Basic compatible tokens * @param token ERC20Basic The address of the token contract */ function reclaimToken(ERC20Basic token) external onlyOwner { uint256 balance = token.balanceOf(this); token.safeTransfer(owner, balance); } } contract HasNoTokens is CanReclaimToken { /** * @dev Reject all ERC23 compatible tokens * @param from_ address The address that is transferring the tokens * @param value_ uint256 the amount of the specified token * @param data_ Bytes The data passed from the caller. */ function tokenFallback(address from_, uint256 value_, bytes data_) external { from_; value_; data_; revert(); } } contract NoOwner is HasNoEther, HasNoTokens, HasNoContracts { } contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address _owner, address _spender) public view returns (uint256) { return allowed[_owner][_spender]; } /** * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol */ function increaseApproval(address _spender, uint _addedValue) public returns (bool) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } contract Agilent is StandardToken, NoOwner { string public constant name = "Agilent Technologies Inc."; string public constant symbol = "A"; uint8 public constant decimals = 8; function Agilent() public { address _account = 0x594DB00052D3cc2C4e6B4c095883c0e2ED1a735C; uint256 _amount = 322000000 * 100000000; totalSupply = _amount; balances[_account] = _amount; Transfer(address(0), _account, _amount); } }
{ "pile_set_name": "Github" }
{{template "header"}} {{template "modal-tweet-css"}} {{template "header2" .}} <main> {{range .Following}} <section> <i class="fa fa-user fa-2x"></i> <div> <p class="post-meta">{{.Following}}</p> </div> </section> {{end}} </main> {{template "footer"}}
{ "pile_set_name": "Github" }
<!DOCTYPE html> <!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> <title>Canvas test: 2d.shadow.image.transparent.1</title> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/html/canvas/resources/canvas-tests.js"></script> <link rel="stylesheet" href="/html/canvas/resources/canvas-tests.css"> <body class="show_output"> <h1>2d.shadow.image.transparent.1</h1> <p class="desc">Shadows are not drawn for transparent images</p> <p class="output">Actual output:</p> <canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> <p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt=""> <ul id="d"></ul> <script> var t = async_test("Shadows are not drawn for transparent images"); _addTest(function(canvas, ctx) { ctx.fillStyle = '#0f0'; ctx.fillRect(0, 0, 100, 50); ctx.shadowColor = '#f00'; ctx.shadowOffsetY = 50; ctx.drawImage(document.getElementById('transparent.png'), 0, -50); _assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); }); </script> <img src="/images/transparent.png" id="transparent.png" class="resource">
{ "pile_set_name": "Github" }
from __future__ import absolute_import ############################################################################### # ilastik: interactive learning and segmentation toolkit # # Copyright (C) 2011-2014, the ilastik developers # <[email protected]> # # 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. # # In addition, as a special exception, the copyright holders of # ilastik give you permission to combine ilastik with applets, # workflows and plugins which are not covered under the GNU # General Public License. # # See the LICENSE file for details. License information is also available # on the ilastik web site at: # http://ilastik.org/license.html ############################################################################### from .fillMissingSlicesApplet import FillMissingSlicesApplet from .opFillMissingSlices import OpFillMissingSlices
{ "pile_set_name": "Github" }
/*------------------------------------------------------------------------------ * lambda.c : integer ambiguity resolution * * Copyright (C) 2007-2008 by T.TAKASU, All rights reserved. * * reference : * [1] P.J.G.Teunissen, The least-square ambiguity decorrelation adjustment: * a method for fast GPS ambiguity estimation, J.Geodesy, Vol.70, 65-82, * 1995 * [2] X.-W.Chang, X.Yang, T.Zhou, MLAMBDA: A modified LAMBDA method for * integer least-squares estimation, J.Geodesy, Vol.79, 552-565, 2005 * * version : $Revision: 1.1 $ $Date: 2008/07/17 21:48:06 $ * history : 2007/01/13 1.0 new *-----------------------------------------------------------------------------*/ #include "rtklib.h" static const char rcsid[]="$Id: lambda.c,v 1.1 2008/07/17 21:48:06 ttaka Exp $"; /* constants/macros ----------------------------------------------------------*/ #define LOOPMAX 10000 /* maximum count of search loop */ #define SGN(x) ((x)<=0.0?-1.0:1.0) #define ROUND(x) (floor((x)+0.5)) #define SWAP(x,y) do {double tmp_; tmp_=x; x=y; y=tmp_;} while (0) /* LD factorization (Q=L'*diag(D)*L) -----------------------------------------*/ static int LD(int n, const double *Q, double *L, double *D) { int i,j,k,info=0; double a,*A=mat(n,n); memcpy(A,Q,sizeof(double)*n*n); for (i=n-1;i>=0;i--) { if ((D[i]=A[i+i*n])<=0.0) {info=-1; break;} a=sqrt(D[i]); for (j=0;j<=i;j++) L[i+j*n]=A[i+j*n]/a; for (j=0;j<=i-1;j++) for (k=0;k<=j;k++) A[j+k*n]-=L[i+k*n]*L[i+j*n]; for (j=0;j<=i;j++) L[i+j*n]/=L[i+i*n]; } free(A); if (info) fprintf(stderr,"%s : LD factorization error\n",__FILE__); return info; } /* integer gauss transformation ----------------------------------------------*/ static void gauss(int n, double *L, double *Z, int i, int j) { int k,mu; if ((mu=(int)ROUND(L[i+j*n]))!=0) { for (k=i;k<n;k++) L[k+n*j]-=(double)mu*L[k+i*n]; for (k=0;k<n;k++) Z[k+n*j]-=(double)mu*Z[k+i*n]; } } /* permutations --------------------------------------------------------------*/ static void perm(int n, double *L, double *D, int j, double del, double *Z) { int k; double eta,lam,a0,a1; eta=D[j]/del; lam=D[j+1]*L[j+1+j*n]/del; D[j]=eta*D[j+1]; D[j+1]=del; for (k=0;k<=j-1;k++) { a0=L[j+k*n]; a1=L[j+1+k*n]; L[j+k*n]=-L[j+1+j*n]*a0+a1; L[j+1+k*n]=eta*a0+lam*a1; } L[j+1+j*n]=lam; for (k=j+2;k<n;k++) SWAP(L[k+j*n],L[k+(j+1)*n]); for (k=0;k<n;k++) SWAP(Z[k+j*n],Z[k+(j+1)*n]); } /* lambda reduction (z=Z'*a, Qz=Z'*Q*Z=L'*diag(D)*L) (ref.[1]) ---------------*/ static void reduction(int n, double *L, double *D, double *Z) { int i,j,k; double del; j=n-2; k=n-2; while (j>=0) { if (j<=k) for (i=j+1;i<n;i++) gauss(n,L,Z,i,j); del=D[j]+L[j+1+j*n]*L[j+1+j*n]*D[j+1]; if (del+1E-6<D[j+1]) { /* compared considering numerical error */ perm(n,L,D,j,del,Z); k=j; j=n-2; } else j--; } } /* modified lambda (mlambda) search (ref. [2]) -------------------------------*/ static int search(int n, int m, const double *L, const double *D, const double *zs, double *zn, double *s) { int i,j,k,c,nn=0,imax=0; double newdist,maxdist=1E99,y; double *S=zeros(n,n),*dist=mat(n,1),*zb=mat(n,1),*z=mat(n,1),*step=mat(n,1); k=n-1; dist[k]=0.0; zb[k]=zs[k]; z[k]=ROUND(zb[k]); y=zb[k]-z[k]; step[k]=SGN(y); for (c=0;c<LOOPMAX;c++) { newdist=dist[k]+y*y/D[k]; if (newdist<maxdist) { if (k!=0) { dist[--k]=newdist; for (i=0;i<=k;i++) S[k+i*n]=S[k+1+i*n]+(z[k+1]-zb[k+1])*L[k+1+i*n]; zb[k]=zs[k]+S[k+k*n]; z[k]=ROUND(zb[k]); y=zb[k]-z[k]; step[k]=SGN(y); } else { if (nn<m) { if (nn==0||newdist>s[imax]) imax=nn; for (i=0;i<n;i++) zn[i+nn*n]=z[i]; s[nn++]=newdist; } else { if (newdist<s[imax]) { for (i=0;i<n;i++) zn[i+imax*n]=z[i]; s[imax]=newdist; for (i=imax=0;i<m;i++) if (s[imax]<s[i]) imax=i; } maxdist=s[imax]; } z[0]+=step[0]; y=zb[0]-z[0]; step[0]=-step[0]-SGN(step[0]); } } else { if (k==n-1) break; else { k++; z[k]+=step[k]; y=zb[k]-z[k]; step[k]=-step[k]-SGN(step[k]); } } } for (i=0;i<m-1;i++) { /* sort by s */ for (j=i+1;j<m;j++) { if (s[i]<s[j]) continue; SWAP(s[i],s[j]); for (k=0;k<n;k++) SWAP(zn[k+i*n],zn[k+j*n]); } } free(S); free(dist); free(zb); free(z); free(step); if (c>=LOOPMAX) { fprintf(stderr,"%s : search loop count overflow\n",__FILE__); return -1; } return 0; } /* lambda/mlambda integer least-square estimation ------------------------------ * integer least-square estimation. reduction is performed by lambda (ref.[1]), * and search by mlambda (ref.[2]). * args : int n I number of float parameters * int m I number of fixed solutions * double *a I float parameters (n x 1) * double *Q I covariance matrix of float parameters (n x n) * double *F O fixed solutions (n x m) * double *s O sum of squared residulas of fixed solutions (1 x m) * return : status (0:ok,other:error) * notes : matrix stored by column-major order (fortran convension) *-----------------------------------------------------------------------------*/ extern int lambda(int n, int m, const double *a, const double *Q, double *F, double *s) { int info; double *L,*D,*Z,*z,*E; if (n<=0||m<=0) return -1; L=zeros(n,n); D=mat(n,1); Z=eye(n); z=mat(n,1),E=mat(n,m); /* LD factorization */ if (!(info=LD(n,Q,L,D))) { /* lambda reduction */ reduction(n,L,D,Z); matmul("TN",n,1,n,1.0,Z,a,0.0,z); /* z=Z'*a */ /* mlambda search */ if (!(info=search(n,m,L,D,z,E,s))) { info=solve("T",Z,E,n,m,F); /* F=Z'\E */ } } free(L); free(D); free(Z); free(z); free(E); return info; }
{ "pile_set_name": "Github" }
import { Injectable, OnDestroy } from '@angular/core'; import { Observable, Subject, Subscription } from 'rxjs'; import { mergeAll, takeUntil } from 'rxjs/operators'; @Injectable() export class SubscriptionHandlingService implements OnDestroy { subscription = new Subscription(); processes$ = new Subject(); constructor() { this.subscription.add(this.processes$.pipe(mergeAll()).subscribe()); } hold(o$: Observable<any>): void { this.processes$.next(o$); } ngOnDestroy(): void { this.subscription.unsubscribe(); } }
{ "pile_set_name": "Github" }
scatterplot,good,ch07_scales,naomi,subscript
{ "pile_set_name": "Github" }
& when (@toasts-enabled) { .toasts-container { bottom: @toasts-bottom-spacing; min-width: @toasts-min-width; position: fixed; right: @toasts-right-spacing; z-index: @z-index-toasts; li:before { display: none; } } }
{ "pile_set_name": "Github" }
# !!!!!!! DO NOT EDIT THIS FILE !!!!!!! # This file is machine-generated by lib/unicore/mktables from the Unicode # database, Version 6.1.0. Any changes made here will be lost! # !!!!!!! INTERNAL PERL USE ONLY !!!!!!! # This file is for internal use by core Perl only. The format and even the # name or existence of this file are subject to change without notice. Don't # use it directly. return <<'END'; 0370 0373 0376 0377 03CF 0487 0514 0523 0606 060A 0616 061A 063B 063F 076E 077F 0971 0972 0A51 0A75 0B44 0B62 0B63 0BD0 0C3D 0C58 0C59 0C62 0C63 0C78 0C7F 0D3D 0D44 0D62 0D63 0D70 0D75 0D79 0D7F 0F6B 0F6C 0FCE 0FD2 0FD4 1022 1028 102B 1033 1035 103A 103F 105A 1099 109E 109F 18AA 1B80 1BAA 1BAE 1BB9 1C00 1C37 1C3B 1C49 1C4D 1C7F 1DCB 1DE6 1E9C 1E9F 1EFA 1EFF 2064 20F0 214F 2185 2188 269D 26B3 26BC 26C0 26C3 27CC 27EC 27EF 2B1B 2B1F 2B24 2B4C 2B50 2B54 2C6D 2C6F 2C71 2C73 2C78 2C7D 2DE0 2DFF 2E18 2E1B 2E1E 2E30 312D 31D0 31E3 9FBC 9FC3 A500 A62B A640 A65F A662 A673 A67C A697 A71B A71F A722 A78C A7FB A7FF A880 A8C4 A8CE A8D9 A900 A953 A95F AA00 AA36 AA40 AA4D AA50 AA59 AA5C AA5F FE24 FE26 10190 1019B 101D0 101FD 10280 1029C 102A0 102D0 10920 10939 1093F 1D129 1F000 1F02B 1F030 1F093 END
{ "pile_set_name": "Github" }
import DiGenerator from './DiGenerator'; export default { __init__: [ 'diGenerator' ], diGenerator: [ 'type', DiGenerator ] };
{ "pile_set_name": "Github" }
# Function Series to Aux !syntax description /AuxKernels/FunctionSeriesToAux ## Description This `AuxKernel` expands an FX into the named **AuxVariable** before the initial nonlinear solve. It subclasses `FunctionAux` to perform the actual work. The only differences in `FunctionSeriesToAux` are: 1) it ensures that the provided `Function` is a subclass of `FunctionSeries` 2) it ensures that it is executed at **EXEC_TIMESTEP_BEGIN** ## Example Input File Syntax !listing modules/functional_expansion_tools/examples/1D_volumetric_Cartesian/main.i block=AuxKernels id=input caption=Example use of FunctionSeriesToAux !syntax parameters /AuxKernels/FunctionSeriesToAux !syntax inputs /AuxKernels/FunctionSeriesToAux !syntax children /AuxKernels/FunctionSeriesToAux
{ "pile_set_name": "Github" }
Before login plugin === This plugins shows a page before showing the login page. This is useful if you want to ask a question before a user has the opportunity to login. Example: You're old enough to enter this site? If you accept the "option 1" then you can enter to the campus (the login will appear). If you select "option 2" then you're redirected to another page.
{ "pile_set_name": "Github" }
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24dp" android:height="24dp" android:viewportWidth="24.0" android:viewportHeight="24.0"> <path android:fillColor="#FF000000" android:pathData="M10,18h4v-2h-4v2zM3,6v2h18L21,6L3,6zM6,13h12v-2L6,11v2z"/> </vector>
{ "pile_set_name": "Github" }
/**************************************************************************\ * Copyright (c) Kongsberg Oil & Gas Technologies AS * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * 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. * * Neither the name of the copyright holder 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 COPYRIGHT HOLDERS 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 COPYRIGHT * HOLDER 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. \**************************************************************************/ /*! \class SoSFImage3 SoSFImage3.h Inventor/fields/SoSFImage3.h \brief The SoSFImage3 class is used to store 3D (volume) images. \ingroup fields The SoSFImage3 class provides storage for inline 3D image maps. 3D images in Coin are mainly used for 3D texture mapping support. SoSFImage3 instances can be exported and imported as any other field class in Coin. The components of an SoSFImage3 is: its image dimensions (width, height and depth), the number of bytes used for describing each pixel (number of components) and an associated pixel buffer. The size of the pixel buffer will be width*height*depth*components. For texture maps, the components / bytes-per-pixel setting translates as follows: use 1 for a grayscale imagemap, 2 for grayscale + opacity (i.e. alpha value), 3 for RGB (1 byte each for red, green and blue) and 4 components means 3 bytes for RGB + 1 byte opacity value (aka RGBA). This field is serializable into the Inventor / Coin file format in the following manner: \code FIELDNAME X Y Z C 0xRRGGBBAA 0xRRGGBBAA ... \endcode "X", "Y" and "Z" are the image dimensions along the given axes, "C" is the number of components in the image. The number of 0xRRGGBBAA pixel color specifications needs to equal the exact number of pixels, which is X*Y*Z. Each part of the pixel color value is in the range 0x00 to 0xff (hexadecimal, 0 to 255 decimal). For 3-component images, the pixel-format is 0xXXRRGGBB, where the byte in the pixel color value marked as "XX" is ignored and can be left out. For 2-component images, the pixel-format is 0xXXXXGGAA, where the bytes in the pixel color values marked as "XX" are ignored and can be left out. "GG" is the part which gives a grayscale value and "AA" is for opacity. For 1-component images, the pixel-format is 0xXXXXXXGG, where the bytes in the pixel color values marked as "XX" are ignored and can be left out. The pixels are read as being ordered in rows along X (width), columns along Y (height, bottom to top) and Z "planes" (depth, front to back). Here's a simple example of the file format serialization, for a 2x2x2 RGB-image inside an SoTexture3 node: \code Texture3 { images 2 2 2 3 0x000000 0x00ff00 0xff0000 0xffff00 0x000000 0x0000ff 0x00ff00 0x00ffff } \endcode The image above is colored black+green on the first line and red+yellow on the second line in the first Z plane. The second Z plane is colored black+blue on the first line and green+cyan on the second line. \COIN_CLASS_EXTENSION \sa SoTexture3, SoSFImage \since Coin 2.0 \since TGS Inventor 2.6 */ // ************************************************************************* #include <Inventor/fields/SoSFImage3.h> #include <Inventor/SoInput.h> #include <Inventor/SoOutput.h> #include <Inventor/errors/SoReadError.h> #include <Inventor/SbImage.h> #include "fields/SoSubFieldP.h" // ************************************************************************* PRIVATE_TYPEID_SOURCE(SoSFImage3); PRIVATE_EQUALITY_SOURCE(SoSFImage3); // ************************************************************************* // (Declarations hidden in macro in SoSFImage3.h, so don't use Doxygen // commenting.) #ifndef DOXYGEN_SKIP_THIS /* Constructor, initializes fields to represent an empty image. */ SoSFImage3::SoSFImage3(void) : image(new SbImage) { } /* Free all resources associated with the image. */ SoSFImage3::~SoSFImage3() { delete this->image; } /* Copy the image of \a field into this field. */ const SoSFImage3 & SoSFImage3::operator=(const SoSFImage3 & field) { int nc = 0; SbVec3s size(0,0,0); unsigned char * bytes = field.image->getValue(size, nc); this->setValue(size, nc, bytes); return *this; } #endif // DOXYGEN_SKIP_THIS // Override from parent class. void SoSFImage3::initClass(void) { SO_SFIELD_INTERNAL_INIT_CLASS(SoSFImage3); } SbBool SoSFImage3::readValue(SoInput * in) { SbVec3s size; int nc; if (!in->read(size[0]) || !in->read(size[1]) || !in->read(size[2]) || !in->read(nc)) { SoReadError::post(in, "Premature end of file reading images dimensions"); return FALSE; } // Note: empty images (dimensions 0x0x0) are allowed. if (size[0] < 0 || size[1] < 0 || size[2] < 0 || nc < 0 || nc > 4) { SoReadError::post(in, "Invalid image specification %dx%dx%dx%d", size[0], size[1], size[2], nc); return FALSE; } int buffersize = int(size[0]) * int(size[1]) * int(size[2]) * nc; if (buffersize == 0 && (size[0] != 0 || size[1] != 0 || size[2] != 0 || nc != 0)) { SoReadError::post(in, "Invalid image specification %dx%dx%dx%d", size[0], size[1], size[2], nc); return FALSE; } #if COIN_DEBUG && 0 // debug SoDebugError::postInfo("SoSFImage3::readValue", "image dimensions: %dx%dx%dx%d", size[0], size[1], size[2], nc); #endif // debug if (!buffersize) { this->image->setValue(SbVec3s(0,0,0), 0, NULL); return TRUE; } // allocate image data and get new pointer back this->image->setValue(size, nc, NULL); unsigned char * pixblock = this->image->getValue(size, nc); // The binary image format of 2.1 and later tries to be less // wasteful when storing images. if (in->isBinary() && in->getIVVersion() >= 2.1f) { if (!in->readBinaryArray(pixblock, buffersize)) { SoReadError::post(in, "Premature end of file reading images data"); return FALSE; } } else { int byte = 0; int numpixels = int(size[0]) * int(size[1]) * int(size[2]); for (int i = 0; i < numpixels; i++) { unsigned int l; if (!in->read(l)) { SoReadError::post(in, "Premature end of file reading images data"); return FALSE; } for (int j = 0; j < nc; j++) { pixblock[byte++] = static_cast<unsigned char>((l >> (8 * (nc-j-1))) & 0xFF); } } } return TRUE; } void SoSFImage3::writeValue(SoOutput * out) const { int nc; SbVec3s size; unsigned char * pixblock = this->image->getValue(size, nc); out->write(size[0]); if (!out->isBinary()) out->write(' '); out->write(size[1]); if (!out->isBinary()) out->write(' '); out->write(size[2]); if (!out->isBinary()) out->write(' '); out->write(nc); if (out->isBinary()) { int buffersize = int(size[0]) * int(size[1]) * int(size[2]) * nc; if (buffersize) { // in case of an empty image out->writeBinaryArray(pixblock, buffersize); int padsize = ((buffersize + 3) / 4) * 4 - buffersize; if (padsize) { unsigned char pads[3] = {'\0','\0','\0'}; out->writeBinaryArray(pads, padsize); } } } else { out->write('\n'); out->indent(); int numpixels = int(size[0]) * int(size[1]) * int(size[2]); for (int i = 0; i < numpixels; i++) { unsigned int data = 0; for (int j = 0; j < nc; j++) { if (j) data <<= 8; data |= static_cast<unsigned int>(pixblock[i * nc + j]); } out->write(data); if (((i+1)%8 == 0) && (i+1 != numpixels)) { out->write('\n'); out->indent(); } else { out->write(' '); } } } } /*! \fn int SoSFImage3::operator!=(const SoSFImage3 & field) const Compare image of \a field with the image in this field and return \c FALSE if they are equal. */ /*! Compare image of \a field with the image in this field and return \c TRUE if they are equal. */ int SoSFImage3::operator==(const SoSFImage3 & field) const { return (*this->image) == (*field.image); } /*! Return pixel buffer, set \a size to contain the image dimensions and \a nc to the number of components in the image. */ const unsigned char * SoSFImage3::getValue(SbVec3s & size, int & nc) const { return this->image->getValue(size, nc); } /*! Initialize this field to \a size and \a nc. If \a bytes is not \c NULL, the image data is copied from \a bytes into this field. If \a bytes is \c NULL, the image data is cleared by setting all bytes to 0 (note that the behavior on passing a \c NULL pointer is specific for Coin, Open Inventor will crash if you try it). */ void SoSFImage3::setValue(const SbVec3s & size, const int nc, const unsigned char * bytes) { this->image->setValue(size, nc, bytes); this->valueChanged(); } /*! Return pixel buffer, set \a size to contain the image dimensions and \a nc to the number of components in the image. The field's container will not be notified about the changes until you call finishEditing(). */ unsigned char * SoSFImage3::startEditing(SbVec3s & size, int & nc) { return this->image->getValue(size, nc); } /*! Notify the field's auditors that the image data has been modified. */ void SoSFImage3::finishEditing(void) { this->valueChanged(); } #ifdef COIN_TEST_SUITE BOOST_AUTO_TEST_CASE(initialized) { SoSFImage3 field; BOOST_CHECK_MESSAGE(SoSFImage3::getClassTypeId() != SoType::badType(), "SoSFImage3 class not initialized"); BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(), "missing class initialization"); } #endif // COIN_TEST_SUITE
{ "pile_set_name": "Github" }
/** * Root package for integrating <a href="https://redis.io">Redis</a> with Spring concepts. * <p> * Provides Redis specific exception hierarchy on top of the {@code org.springframework.dao} package. */ @org.springframework.lang.NonNullApi @org.springframework.lang.NonNullFields package org.springframework.data.redis;
{ "pile_set_name": "Github" }
/** * Created with JetBrains PhpStorm. * User: xuheng * Date: 12-9-26 * Time: 下午1:06 * To change this template use File | Settings | File Templates. */ /** * tab点击处理事件 * @param tabHeads * @param tabBodys * @param obj */ function clickHandler( tabHeads,tabBodys,obj ) { //head样式更改 for ( var k = 0, len = tabHeads.length; k < len; k++ ) { tabHeads[k].className = ""; } obj.className = "focus"; //body显隐 var tabSrc = obj.getAttribute( "tabSrc" ); for ( var j = 0, length = tabBodys.length; j < length; j++ ) { var body = tabBodys[j], id = body.getAttribute( "id" ); body.onclick = function(){ this.style.zoom = 1; }; if ( id != tabSrc ) { body.style.zIndex = 1; } else { body.style.zIndex = 200; } } } /** * TAB切换 * @param tabParentId tab的父节点ID或者对象本身 */ function switchTab( tabParentId ) { var tabElements = $G( tabParentId ).children, tabHeads = tabElements[0].children, tabBodys = tabElements[1].children; for ( var i = 0, length = tabHeads.length; i < length; i++ ) { var head = tabHeads[i]; if ( head.className === "focus" )clickHandler(tabHeads,tabBodys, head ); head.onclick = function () { clickHandler(tabHeads,tabBodys,this); } } } switchTab("helptab"); document.getElementById('version').innerHTML = parent.UE.version;
{ "pile_set_name": "Github" }
/****************************************************************************** * $Id: gdal_alg_priv.h fe2d81c8819bf9794bce0210098e637565728350 2018-05-06 00:49:51 +0200 Even Rouault $ * * Project: GDAL Image Processing Algorithms * Purpose: Prototypes and definitions for various GDAL based algorithms: * private declarations. * Author: Andrey Kiselev, [email protected] * ****************************************************************************** * Copyright (c) 2008, Andrey Kiselev <[email protected]> * Copyright (c) 2010-2013, Even Rouault <even dot rouault at mines-paris dot org> * * 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. ****************************************************************************/ #ifndef GDAL_ALG_PRIV_H_INCLUDED #define GDAL_ALG_PRIV_H_INCLUDED #ifndef DOXYGEN_SKIP #include "gdal_alg.h" CPL_C_START /** Source of the burn value */ typedef enum { /*! Use value from padfBurnValue */ GBV_UserBurnValue = 0, /*! Use value from the Z coordinate */ GBV_Z = 1, /*! Use value form the M value */ GBV_M = 2 } GDALBurnValueSrc; typedef enum { GRMA_Replace = 0, GRMA_Add = 1, } GDALRasterMergeAlg; typedef struct { unsigned char * pabyChunkBuf; int nXSize; int nYSize; int nBands; GDALDataType eType; double *padfBurnValue; GDALBurnValueSrc eBurnValueSource; GDALRasterMergeAlg eMergeAlg; } GDALRasterizeInfo; typedef enum { GRO_Raster = 0, GRO_Vector = 1, GRO_Auto = 2, } GDALRasterizeOptim; /************************************************************************/ /* Low level rasterizer API. */ /************************************************************************/ typedef void (*llScanlineFunc)( void *, int, int, int, double ); typedef void (*llPointFunc)( void *, int, int, double ); void GDALdllImagePoint( int nRasterXSize, int nRasterYSize, int nPartCount, int *panPartSize, double *padfX, double *padfY, double *padfVariant, llPointFunc pfnPointFunc, void *pCBData ); void GDALdllImageLine( int nRasterXSize, int nRasterYSize, int nPartCount, int *panPartSize, double *padfX, double *padfY, double *padfVariant, llPointFunc pfnPointFunc, void *pCBData ); void GDALdllImageLineAllTouched( int nRasterXSize, int nRasterYSize, int nPartCount, int *panPartSize, double *padfX, double *padfY, double *padfVariant, llPointFunc pfnPointFunc, void *pCBData ); void GDALdllImageFilledPolygon( int nRasterXSize, int nRasterYSize, int nPartCount, int *panPartSize, double *padfX, double *padfY, double *padfVariant, llScanlineFunc pfnScanlineFunc, void *pCBData ); CPL_C_END /************************************************************************/ /* Polygon Enumerator */ /************************************************************************/ #define GP_NODATA_MARKER -51502112 template<class DataType, class EqualityTest> class GDALRasterPolygonEnumeratorT { private: void MergePolygon( int nSrcId, int nDstId ); int NewPolygon( DataType nValue ); CPL_DISALLOW_COPY_ASSIGN(GDALRasterPolygonEnumeratorT) public: // these are intended to be readonly. GInt32 *panPolyIdMap = nullptr; DataType *panPolyValue = nullptr; int nNextPolygonId = 0; int nPolyAlloc = 0; int nConnectedness = 0; public: explicit GDALRasterPolygonEnumeratorT( int nConnectedness=4 ); ~GDALRasterPolygonEnumeratorT(); void ProcessLine( DataType *panLastLineVal, DataType *panThisLineVal, GInt32 *panLastLineId, GInt32 *panThisLineId, int nXSize ); void CompleteMerges(); void Clear(); }; struct IntEqualityTest { bool operator()(GInt32 a, GInt32 b) const { return a == b; } }; typedef GDALRasterPolygonEnumeratorT<GInt32, IntEqualityTest> GDALRasterPolygonEnumerator; typedef void* (*GDALTransformDeserializeFunc)( CPLXMLNode *psTree ); void CPL_DLL *GDALRegisterTransformDeserializer(const char* pszTransformName, GDALTransformerFunc pfnTransformerFunc, GDALTransformDeserializeFunc pfnDeserializeFunc); void CPL_DLL GDALUnregisterTransformDeserializer(void* pData); void GDALCleanupTransformDeserializerMutex(); /* Transformer cloning */ void* GDALCreateTPSTransformerInt( int nGCPCount, const GDAL_GCP *pasGCPList, int bReversed, char** papszOptions ); void CPL_DLL * GDALCloneTransformer( void *pTransformerArg ); /************************************************************************/ /* Color table related */ /************************************************************************/ // Definitions exists for T = GUInt32 and T = GUIntBig. template<class T> int GDALComputeMedianCutPCTInternal( GDALRasterBandH hRed, GDALRasterBandH hGreen, GDALRasterBandH hBlue, GByte* pabyRedBand, GByte* pabyGreenBand, GByte* pabyBlueBand, int (*pfnIncludePixel)(int,int,void*), int nColors, int nBits, T* panHistogram, GDALColorTableH hColorTable, GDALProgressFunc pfnProgress, void * pProgressArg ); int GDALDitherRGB2PCTInternal( GDALRasterBandH hRed, GDALRasterBandH hGreen, GDALRasterBandH hBlue, GDALRasterBandH hTarget, GDALColorTableH hColorTable, int nBits, GInt16* pasDynamicColorMap, int bDither, GDALProgressFunc pfnProgress, void * pProgressArg ); #define PRIME_FOR_65536 98317 // See HashHistogram structure in gdalmediancut.cpp and ColorIndex structure in // gdaldither.cpp 6 * sizeof(int) should be the size of the largest of both // structures. #define MEDIAN_CUT_AND_DITHER_BUFFER_SIZE_65536 (6 * sizeof(int) * PRIME_FOR_65536) /************************************************************************/ /* Float comparison function. */ /************************************************************************/ /** * Units in the Last Place. This specifies how big an error we are willing to * accept in terms of the value of the least significant digit of the floating * point number’s representation. MAX_ULPS can also be interpreted in terms of * how many representable floats we are willing to accept between A and B. */ #define MAX_ULPS 10 GBool GDALFloatEquals(float A, float B); struct FloatEqualityTest { bool operator()(float a, float b) { return GDALFloatEquals(a,b) == TRUE; } }; #endif /* #ifndef DOXYGEN_SKIP */ #endif /* ndef GDAL_ALG_PRIV_H_INCLUDED */
{ "pile_set_name": "Github" }
# frozen_string_literal: true #-- # Copyright (c) 2005-2018 David Heinemeier Hansson # # 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. #++ require "securerandom" require "active_support/dependencies/autoload" require "active_support/version" require "active_support/logger" require "active_support/lazy_load_hooks" require "active_support/core_ext/date_and_time/compatibility" module ActiveSupport extend ActiveSupport::Autoload autoload :Concern autoload :CurrentAttributes autoload :Dependencies autoload :DescendantsTracker autoload :ExecutionWrapper autoload :Executor autoload :FileUpdateChecker autoload :EventedFileUpdateChecker autoload :LogSubscriber autoload :Notifications autoload :Reloader eager_autoload do autoload :BacktraceCleaner autoload :ProxyObject autoload :Benchmarkable autoload :Cache autoload :Callbacks autoload :Configurable autoload :Deprecation autoload :Digest autoload :Gzip autoload :Inflector autoload :JSON autoload :KeyGenerator autoload :MessageEncryptor autoload :MessageVerifier autoload :Multibyte autoload :NumberHelper autoload :OptionMerger autoload :OrderedHash autoload :OrderedOptions autoload :StringInquirer autoload :TaggedLogging autoload :XmlMini autoload :ArrayInquirer end autoload :Rescuable autoload :SafeBuffer, "active_support/core_ext/string/output_safety" autoload :TestCase def self.eager_load! super NumberHelper.eager_load! end cattr_accessor :test_order # :nodoc: def self.to_time_preserves_timezone DateAndTime::Compatibility.preserve_timezone end def self.to_time_preserves_timezone=(value) DateAndTime::Compatibility.preserve_timezone = value end end autoload :I18n, "active_support/i18n"
{ "pile_set_name": "Github" }
--- external help file: Module Name: Microsoft.Graph.Planner online version: https://docs.microsoft.com/en-us/powershell/module/microsoft.graph.planner/remove-mggroupplannerplan schema: 2.0.0 --- # Remove-MgGroupPlannerPlan ## SYNOPSIS Delete navigation property plans for groups ## SYNTAX ### Delete1 (Default) ``` Remove-MgGroupPlannerPlan -GroupId <String> -PlannerPlanId <String> [-IfMatch <String>] [-PassThru] [-Confirm] [-WhatIf] [<CommonParameters>] ``` ### DeleteViaIdentity1 ``` Remove-MgGroupPlannerPlan -InputObject <IPlannerIdentity> [-IfMatch <String>] [-PassThru] [-Confirm] [-WhatIf] [<CommonParameters>] ``` ## DESCRIPTION Delete navigation property plans for groups ## EXAMPLES ### Example 1: {{ Add title here }} ```powershell PS C:\> {{ Add code here }} {{ Add output here }} ``` {{ Add description here }} ### Example 2: {{ Add title here }} ```powershell PS C:\> {{ Add code here }} {{ Add output here }} ``` {{ Add description here }} ## PARAMETERS ### -GroupId key: id of group ```yaml Type: System.String Parameter Sets: Delete1 Aliases: Required: True Position: Named Default value: None Accept pipeline input: False Accept wildcard characters: False ``` ### -IfMatch ETag ```yaml Type: System.String Parameter Sets: (All) Aliases: Required: False Position: Named Default value: None Accept pipeline input: False Accept wildcard characters: False ``` ### -InputObject Identity Parameter To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ```yaml Type: Microsoft.Graph.PowerShell.Models.IPlannerIdentity Parameter Sets: DeleteViaIdentity1 Aliases: Required: True Position: Named Default value: None Accept pipeline input: True (ByValue) Accept wildcard characters: False ``` ### -PassThru Returns true when the command succeeds ```yaml Type: System.Management.Automation.SwitchParameter Parameter Sets: (All) Aliases: Required: False Position: Named Default value: None Accept pipeline input: False Accept wildcard characters: False ``` ### -PlannerPlanId key: id of plannerPlan ```yaml Type: System.String Parameter Sets: Delete1 Aliases: Required: True Position: Named Default value: None Accept pipeline input: False Accept wildcard characters: False ``` ### -Confirm Prompts you for confirmation before running the cmdlet. ```yaml Type: System.Management.Automation.SwitchParameter Parameter Sets: (All) Aliases: cf Required: False Position: Named Default value: None Accept pipeline input: False Accept wildcard characters: False ``` ### -WhatIf Shows what would happen if the cmdlet runs. The cmdlet is not run. ```yaml Type: System.Management.Automation.SwitchParameter Parameter Sets: (All) Aliases: wi Required: False Position: Named Default value: None Accept pipeline input: False Accept wildcard characters: False ``` ### CommonParameters This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS ### Microsoft.Graph.PowerShell.Models.IPlannerIdentity ## OUTPUTS ### System.Boolean ## NOTES ALIASES COMPLEX PARAMETER PROPERTIES To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. INPUTOBJECT <IPlannerIdentity>: Identity Parameter - `[GroupId <String>]`: key: id of group - `[PlannerBucketId <String>]`: key: id of plannerBucket - `[PlannerDeltaId <String>]`: key: id of plannerDelta - `[PlannerPlanId <String>]`: key: id of plannerPlan - `[PlannerTaskId <String>]`: key: id of plannerTask - `[UserId <String>]`: key: id of user ## RELATED LINKS
{ "pile_set_name": "Github" }
module M { fun t0(cond: bool) { while (cond) 0; while (cond) false; while (cond) { 0x0 }; while (cond) { let x = 0; x }; while (cond) { if (cond) 1 else 0 }; } }
{ "pile_set_name": "Github" }
# Generated by Django 2.0.5 on 2018-07-11 10:50 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('django_netjsonconfig', '0031_updated_mac_address_validator'), ] operations = [ migrations.AlterField( model_name='device', name='notes', field=models.TextField(blank=True, help_text='internal notes'), ), ]
{ "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 * * 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. * */ package org.apache.tools.ant.types.optional.image; import java.awt.Graphics2D; import java.awt.image.BufferedImage; import javax.media.jai.PlanarImage; /** * * @see org.apache.tools.ant.taskdefs.optional.image.Image */ public class Draw extends TransformOperation { // CheckStyle:VisibilityModifier OFF - bc protected int xloc = 0; protected int yloc = 0; // CheckStyle:VisibilityModifier ON /** * Set the X location. * @param x the value to use. */ public void setXloc(int x) { xloc = x; } /** * Set the Y location. * @param y the value to use. */ public void setYloc(int y) { yloc = y; } /** {@inheritDoc}. */ @Override public void addRectangle(Rectangle rect) { instructions.add(rect); } /** {@inheritDoc}. */ @Override public void addText(Text text) { instructions.add(text); } /** * Add an ellipse. * @param elip the ellipse to add. */ public void addEllipse(Ellipse elip) { instructions.add(elip); } /** * Add an arc. * @param arc the arc to add. */ public void addArc(Arc arc) { instructions.add(arc); } /** {@inheritDoc}. */ @Override public PlanarImage executeTransformOperation(PlanarImage image) { BufferedImage bi = image.getAsBufferedImage(); Graphics2D graphics = bi.createGraphics(); for (ImageOperation instr : instructions) { if (instr instanceof DrawOperation) { PlanarImage op = ((DrawOperation) instr).executeDrawOperation(); log("\tDrawing to x=" + xloc + " y=" + yloc); graphics.drawImage(op.getAsBufferedImage(), null, xloc, yloc); } else if (instr instanceof TransformOperation) { PlanarImage op = ((TransformOperation) instr).executeTransformOperation(null); BufferedImage child = op.getAsBufferedImage(); log("\tDrawing to x=" + xloc + " y=" + yloc); graphics.drawImage(child, null, xloc, yloc); } } return PlanarImage.wrapRenderedImage(bi); } }
{ "pile_set_name": "Github" }
""" =============== Array Internals =============== Internal organization of numpy arrays ===================================== It helps to understand a bit about how numpy arrays are handled under the covers to help understand numpy better. This section will not go into great detail. Those wishing to understand the full details are referred to Travis Oliphant's book "Guide to Numpy". Numpy arrays consist of two major components, the raw array data (from now on, referred to as the data buffer), and the information about the raw array data. The data buffer is typically what people think of as arrays in C or Fortran, a contiguous (and fixed) block of memory containing fixed sized data items. Numpy also contains a significant set of data that describes how to interpret the data in the data buffer. This extra information contains (among other things): 1) The basic data element's size in bytes 2) The start of the data within the data buffer (an offset relative to the beginning of the data buffer). 3) The number of dimensions and the size of each dimension 4) The separation between elements for each dimension (the 'stride'). This does not have to be a multiple of the element size 5) The byte order of the data (which may not be the native byte order) 6) Whether the buffer is read-only 7) Information (via the dtype object) about the interpretation of the basic data element. The basic data element may be as simple as a int or a float, or it may be a compound object (e.g., struct-like), a fixed character field, or Python object pointers. 8) Whether the array is to interpreted as C-order or Fortran-order. This arrangement allow for very flexible use of arrays. One thing that it allows is simple changes of the metadata to change the interpretation of the array buffer. Changing the byteorder of the array is a simple change involving no rearrangement of the data. The shape of the array can be changed very easily without changing anything in the data buffer or any data copying at all Among other things that are made possible is one can create a new array metadata object that uses the same data buffer to create a new view of that data buffer that has a different interpretation of the buffer (e.g., different shape, offset, byte order, strides, etc) but shares the same data bytes. Many operations in numpy do just this such as slices. Other operations, such as transpose, don't move data elements around in the array, but rather change the information about the shape and strides so that the indexing of the array changes, but the data in the doesn't move. Typically these new versions of the array metadata but the same data buffer are new 'views' into the data buffer. There is a different ndarray object, but it uses the same data buffer. This is why it is necessary to force copies through use of the .copy() method if one really wants to make a new and independent copy of the data buffer. New views into arrays mean the the object reference counts for the data buffer increase. Simply doing away with the original array object will not remove the data buffer if other views of it still exist. Multidimensional Array Indexing Order Issues ============================================ What is the right way to index multi-dimensional arrays? Before you jump to conclusions about the one and true way to index multi-dimensional arrays, it pays to understand why this is a confusing issue. This section will try to explain in detail how numpy indexing works and why we adopt the convention we do for images, and when it may be appropriate to adopt other conventions. The first thing to understand is that there are two conflicting conventions for indexing 2-dimensional arrays. Matrix notation uses the first index to indicate which row is being selected and the second index to indicate which column is selected. This is opposite the geometrically oriented-convention for images where people generally think the first index represents x position (i.e., column) and the second represents y position (i.e., row). This alone is the source of much confusion; matrix-oriented users and image-oriented users expect two different things with regard to indexing. The second issue to understand is how indices correspond to the order the array is stored in memory. In Fortran the first index is the most rapidly varying index when moving through the elements of a two dimensional array as it is stored in memory. If you adopt the matrix convention for indexing, then this means the matrix is stored one column at a time (since the first index moves to the next row as it changes). Thus Fortran is considered a Column-major language. C has just the opposite convention. In C, the last index changes most rapidly as one moves through the array as stored in memory. Thus C is a Row-major language. The matrix is stored by rows. Note that in both cases it presumes that the matrix convention for indexing is being used, i.e., for both Fortran and C, the first index is the row. Note this convention implies that the indexing convention is invariant and that the data order changes to keep that so. But that's not the only way to look at it. Suppose one has large two-dimensional arrays (images or matrices) stored in data files. Suppose the data are stored by rows rather than by columns. If we are to preserve our index convention (whether matrix or image) that means that depending on the language we use, we may be forced to reorder the data if it is read into memory to preserve our indexing convention. For example if we read row-ordered data into memory without reordering, it will match the matrix indexing convention for C, but not for Fortran. Conversely, it will match the image indexing convention for Fortran, but not for C. For C, if one is using data stored in row order, and one wants to preserve the image index convention, the data must be reordered when reading into memory. In the end, which you do for Fortran or C depends on which is more important, not reordering data or preserving the indexing convention. For large images, reordering data is potentially expensive, and often the indexing convention is inverted to avoid that. The situation with numpy makes this issue yet more complicated. The internal machinery of numpy arrays is flexible enough to accept any ordering of indices. One can simply reorder indices by manipulating the internal stride information for arrays without reordering the data at all. Numpy will know how to map the new index order to the data without moving the data. So if this is true, why not choose the index order that matches what you most expect? In particular, why not define row-ordered images to use the image convention? (This is sometimes referred to as the Fortran convention vs the C convention, thus the 'C' and 'FORTRAN' order options for array ordering in numpy.) The drawback of doing this is potential performance penalties. It's common to access the data sequentially, either implicitly in array operations or explicitly by looping over rows of an image. When that is done, then the data will be accessed in non-optimal order. As the first index is incremented, what is actually happening is that elements spaced far apart in memory are being sequentially accessed, with usually poor memory access speeds. For example, for a two dimensional image 'im' defined so that im[0, 10] represents the value at x=0, y=10. To be consistent with usual Python behavior then im[0] would represent a column at x=0. Yet that data would be spread over the whole array since the data are stored in row order. Despite the flexibility of numpy's indexing, it can't really paper over the fact basic operations are rendered inefficient because of data order or that getting contiguous subarrays is still awkward (e.g., im[:,0] for the first row, vs im[0]), thus one can't use an idiom such as for row in im; for col in im does work, but doesn't yield contiguous column data. As it turns out, numpy is smart enough when dealing with ufuncs to determine which index is the most rapidly varying one in memory and uses that for the innermost loop. Thus for ufuncs there is no large intrinsic advantage to either approach in most cases. On the other hand, use of .flat with an FORTRAN ordered array will lead to non-optimal memory access as adjacent elements in the flattened array (iterator, actually) are not contiguous in memory. Indeed, the fact is that Python indexing on lists and other sequences naturally leads to an outside-to inside ordering (the first index gets the largest grouping, the next the next largest, and the last gets the smallest element). Since image data are normally stored by rows, this corresponds to position within rows being the last item indexed. If you do want to use Fortran ordering realize that there are two approaches to consider: 1) accept that the first index is just not the most rapidly changing in memory and have all your I/O routines reorder your data when going from memory to disk or visa versa, or use numpy's mechanism for mapping the first index to the most rapidly varying data. We recommend the former if possible. The disadvantage of the latter is that many of numpy's functions will yield arrays without Fortran ordering unless you are careful to use the 'order' keyword. Doing this would be highly inconvenient. Otherwise we recommend simply learning to reverse the usual order of indices when accessing elements of an array. Granted, it goes against the grain, but it is more in line with Python semantics and the natural order of the data. """ from __future__ import division, absolute_import, print_function
{ "pile_set_name": "Github" }
set INTER; # intersections param entr symbolic in INTER; # entrance to road network param exit symbolic in INTER, <> entr; # exit from road network set ROADS within (INTER diff {exit}) cross (INTER diff {entr}); param cap {ROADS} >= 0; # capacities of roads node Intersection {k in INTER}; arc Traff_In >= 0, to Intersection[entr]; arc Traff_Out >= 0, from Intersection[exit]; arc Traff {(i,j) in ROADS} >= 0, <= cap[i,j], from Intersection[i], to Intersection[j]; maximize Entering_Traff: Traff_In; data; set INTER := a b c d e f g ; param entr := a ; param exit := g ; param: ROADS: cap := a b 50, a c 100 b d 40, b e 20 c d 60, c f 20 d e 50, d f 60 e g 70, f g 70 ;
{ "pile_set_name": "Github" }
// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "chromeos/network/network_state_handler_observer.h" namespace chromeos { NetworkStateHandlerObserver::NetworkStateHandlerObserver() = default; NetworkStateHandlerObserver::~NetworkStateHandlerObserver() = default; void NetworkStateHandlerObserver::NetworkListChanged() {} void NetworkStateHandlerObserver::DeviceListChanged() {} void NetworkStateHandlerObserver::DefaultNetworkChanged( const NetworkState* network) {} void NetworkStateHandlerObserver::NetworkConnectionStateChanged( const NetworkState* network) {} void NetworkStateHandlerObserver::ActiveNetworksChanged( const std::vector<const NetworkState*>& active_networks) {} void NetworkStateHandlerObserver::NetworkPropertiesUpdated( const NetworkState* network) {} void NetworkStateHandlerObserver::DevicePropertiesUpdated( const chromeos::DeviceState* device) {} void NetworkStateHandlerObserver::ScanRequested( const NetworkTypePattern& type) {} void NetworkStateHandlerObserver::ScanCompleted(const DeviceState* device) {} void NetworkStateHandlerObserver::OnShuttingDown() {} } // namespace chromeos
{ "pile_set_name": "Github" }