<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <parent>
        <groupId>org.atmosphere</groupId>
        <artifactId>wasync-project</artifactId>
        <version>2.1.8-SNAPSHOT</version>
        <relativePath>../</relativePath>
    </parent>
    <modelVersion>4.0.0</modelVersion>
    <groupId>org.atmosphere</groupId>
    <artifactId>wasync</artifactId>
    <name>wasync</name>
    <version>2.1.8-SNAPSHOT</version>
    <packaging>bundle</packaging>
    <description>
        wAsync: A WebSockets/HTTP Client Library
    </description>
    <dependencies>
        <dependency>
            <groupId>com.ning</groupId>
            <artifactId>async-http-client</artifactId>
        </dependency>
        <dependency>
    		<groupId>com.google.guava</groupId>
    		<artifactId>guava</artifactId>
    		<version>14.0.1</version>
            <scope>provided</scope>
		</dependency>
	   <dependency>
            <groupId>org.atmosphere</groupId>
            <artifactId>nettosphere</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.atmosphere</groupId>
            <artifactId>atmosphere-runtime</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-core</artifactId>
            <version>1.1.2</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-classic</artifactId>
            <version>1.1.2</version>
            <scope>test</scope>

        </dependency>
        <dependency>
            <groupId>org.testng</groupId>
            <artifactId>testng</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
                <extensions>true</extensions>
                <version>2.5.3</version>
                <configuration>
                    <instructions>
                        <Bundle-SymbolicName>org.atmosphere.wasync</Bundle-SymbolicName>
                        <Export-Package>
                            org.atmosphere.wasync.*
                        </Export-Package>
                    </instructions>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <version>2.3</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                        <configuration>
                            <shadedArtifactAttached>true</shadedArtifactAttached>
                            <shadedClassifierName>all</shadedClassifierName>
                            <transformers>
                                <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" />
                                <transformer implementation="org.apache.maven.plugins.shade.resource.ComponentsXmlResourceTransformer" />
                                <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
                                    <mainClass>org.atmosphere.wasync.util.WebSocketLoader</mainClass>
                                </transformer>
                            </transformers>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>

{'repo_name': 'Atmosphere/wasync', 'stars': '158', 'repo_language': 'Java', 'file_name': 'javadoc.sh', 'mime_type': 'text/x-shellscript', 'hash': 7862545732076430992, 'source_dataset': 'data'}


<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<libraryInfos>
<libraryInfo home="/usr/lib/jvm/java-7-openjdk-amd64/jre" version="1.7.0_65">
<bootpath>
<entry path="/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/resources.jar"/>
<entry path="/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/rt.jar"/>
<entry path="/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/sunrsasign.jar"/>
<entry path="/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/jsse.jar"/>
<entry path="/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/jce.jar"/>
<entry path="/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/charsets.jar"/>
<entry path="/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/rhino.jar"/>
<entry path="/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/jfr.jar"/>
<entry path="/usr/lib/jvm/java-7-openjdk-amd64/jre/classes"/>
</bootpath>
<extensionDirs>
<entry path="/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/ext"/>
<entry path="/usr/java/packages/lib/ext"/>
</extensionDirs>
<endorsedDirs>
<entry path="/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/endorsed"/>
</endorsedDirs>
</libraryInfo>
<libraryInfo home="/usr/local/lib/java/jdk1.7.0_71" version="1.7.0_71">
<bootpath>
<entry path="/usr/local/lib/java/jdk1.7.0_71/jre/lib/resources.jar"/>
<entry path="/usr/local/lib/java/jdk1.7.0_71/jre/lib/rt.jar"/>
<entry path="/usr/local/lib/java/jdk1.7.0_71/jre/lib/sunrsasign.jar"/>
<entry path="/usr/local/lib/java/jdk1.7.0_71/jre/lib/jsse.jar"/>
<entry path="/usr/local/lib/java/jdk1.7.0_71/jre/lib/jce.jar"/>
<entry path="/usr/local/lib/java/jdk1.7.0_71/jre/lib/charsets.jar"/>
<entry path="/usr/local/lib/java/jdk1.7.0_71/jre/lib/jfr.jar"/>
<entry path="/usr/local/lib/java/jdk1.7.0_71/jre/classes"/>
</bootpath>
<extensionDirs>
<entry path="/usr/local/lib/java/jdk1.7.0_71/jre/lib/ext"/>
<entry path="/usr/java/packages/lib/ext"/>
</extensionDirs>
<endorsedDirs>
<entry path="/usr/local/lib/java/jdk1.7.0_71/jre/lib/endorsed"/>
</endorsedDirs>
</libraryInfo>
<libraryInfo home="/usr/local/lib/java/jdk1.8.0_25/jre" version="1.8.0_25">
<bootpath>
<entry path="/usr/local/lib/java/jdk1.8.0_25/jre/lib/resources.jar"/>
<entry path="/usr/local/lib/java/jdk1.8.0_25/jre/lib/rt.jar"/>
<entry path="/usr/local/lib/java/jdk1.8.0_25/jre/lib/sunrsasign.jar"/>
<entry path="/usr/local/lib/java/jdk1.8.0_25/jre/lib/jsse.jar"/>
<entry path="/usr/local/lib/java/jdk1.8.0_25/jre/lib/jce.jar"/>
<entry path="/usr/local/lib/java/jdk1.8.0_25/jre/lib/charsets.jar"/>
<entry path="/usr/local/lib/java/jdk1.8.0_25/jre/lib/jfr.jar"/>
<entry path="/usr/local/lib/java/jdk1.8.0_25/jre/classes"/>
</bootpath>
<extensionDirs>
<entry path="/usr/local/lib/java/jdk1.8.0_25/jre/lib/ext"/>
<entry path="/usr/java/packages/lib/ext"/>
</extensionDirs>
<endorsedDirs>
<entry path="/usr/local/lib/java/jdk1.8.0_25/jre/lib/endorsed"/>
</endorsedDirs>
</libraryInfo>
<libraryInfo home="/usr/lib/jvm/java-7-openjdk-amd64" version="1.7.0_65">
<bootpath>
<entry path="/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/resources.jar"/>
<entry path="/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/rt.jar"/>
<entry path="/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/sunrsasign.jar"/>
<entry path="/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/jsse.jar"/>
<entry path="/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/jce.jar"/>
<entry path="/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/charsets.jar"/>
<entry path="/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/rhino.jar"/>
<entry path="/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/jfr.jar"/>
<entry path="/usr/lib/jvm/java-7-openjdk-amd64/jre/classes"/>
</bootpath>
<extensionDirs>
<entry path="/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/ext"/>
<entry path="/usr/java/packages/lib/ext"/>
</extensionDirs>
<endorsedDirs>
<entry path="/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/endorsed"/>
</endorsedDirs>
</libraryInfo>
</libraryInfos>

{'repo_name': 'sics-sse/moped', 'stars': '109', 'repo_language': 'Java', 'file_name': 'dialog_settings.xml', 'mime_type': 'text/xml', 'hash': -7796590021651022841, 'source_dataset': 'data'}


'use strict';

module.exports.definition = {
    set: function (v) {
        this._setProperty('stroke-linejoin', v);
    },
    get: function () {
        return this.getPropertyValue('stroke-linejoin');
    },
    enumerable: true,
    configurable: true
};

{'repo_name': 'tartanguru/alexa-google-search', 'stars': '207', 'repo_language': 'JavaScript', 'file_name': 'SEARCH.txt', 'mime_type': 'text/plain', 'hash': 7402911111314559053, 'source_dataset': 'data'}


// Copyright 2012-2014 Charles Banning. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file

package mxj

import (
	"bytes"
	"encoding/json"
	"fmt"
	"io"
	"time"
)

// ------------------------------ write JSON -----------------------

// Just a wrapper on json.Marshal.
// If option safeEncoding is'true' then safe encoding of '<', '>' and '&'
// is preserved. (see encoding/json#Marshal, encoding/json#Encode)
func (mv Map) Json(safeEncoding ...bool) ([]byte, error) {
	var s bool
	if len(safeEncoding) == 1 {
		s = safeEncoding[0]
	}

	b, err := json.Marshal(mv)

	if !s {
		b = bytes.Replace(b, []byte("\\u003c"), []byte("<"), -1)
		b = bytes.Replace(b, []byte("\\u003e"), []byte(">"), -1)
		b = bytes.Replace(b, []byte("\\u0026"), []byte("&"), -1)
	}
	return b, err
}

// Just a wrapper on json.MarshalIndent.
// If option safeEncoding is'true' then safe encoding of '<' , '>' and '&'
// is preserved. (see encoding/json#Marshal, encoding/json#Encode)
func (mv Map) JsonIndent(prefix, indent string, safeEncoding ...bool) ([]byte, error) {
	var s bool
	if len(safeEncoding) == 1 {
		s = safeEncoding[0]
	}

	b, err := json.MarshalIndent(mv, prefix, indent)
	if !s {
		b = bytes.Replace(b, []byte("\\u003c"), []byte("<"), -1)
		b = bytes.Replace(b, []byte("\\u003e"), []byte(">"), -1)
		b = bytes.Replace(b, []byte("\\u0026"), []byte("&"), -1)
	}
	return b, err
}

// The following implementation is provided for symmetry with NewMapJsonReader[Raw]
// The names will also provide a key for the number of return arguments.

// Writes the Map as JSON on the Writer.
// If 'safeEncoding' is 'true', then "safe" encoding of '<', '>' and '&' is preserved.
func (mv Map) JsonWriter(jsonWriter io.Writer, safeEncoding ...bool) error {
	b, err := mv.Json(safeEncoding...)
	if err != nil {
		return err
	}

	_, err = jsonWriter.Write(b)
	return err
}

// Writes the Map as JSON on the Writer. []byte is the raw JSON that was written.
// If 'safeEncoding' is 'true', then "safe" encoding of '<', '>' and '&' is preserved.
func (mv Map) JsonWriterRaw(jsonWriter io.Writer, safeEncoding ...bool) ([]byte, error) {
	b, err := mv.Json(safeEncoding...)
	if err != nil {
		return b, err
	}

	_, err = jsonWriter.Write(b)
	return b, err
}

// Writes the Map as pretty JSON on the Writer.
// If 'safeEncoding' is 'true', then "safe" encoding of '<', '>' and '&' is preserved.
func (mv Map) JsonIndentWriter(jsonWriter io.Writer, prefix, indent string, safeEncoding ...bool) error {
	b, err := mv.JsonIndent(prefix, indent, safeEncoding...)
	if err != nil {
		return err
	}

	_, err = jsonWriter.Write(b)
	return err
}

// Writes the Map as pretty JSON on the Writer. []byte is the raw JSON that was written.
// If 'safeEncoding' is 'true', then "safe" encoding of '<', '>' and '&' is preserved.
func (mv Map) JsonIndentWriterRaw(jsonWriter io.Writer, prefix, indent string, safeEncoding ...bool) ([]byte, error) {
	b, err := mv.JsonIndent(prefix, indent, safeEncoding...)
	if err != nil {
		return b, err
	}

	_, err = jsonWriter.Write(b)
	return b, err
}

// --------------------------- read JSON -----------------------------

// Decode numericvalues as json.Number type Map values - see encoding/json#Number.
// NOTE: this is for decoding JSON into a Map with NewMapJson(), NewMapJsonReader(),
// etc.; it does not affect NewMapXml(), etc.  The XML encoders mv.Xml() and mv.XmlIndent()
// do recognize json.Number types; a JSON object can be decoded to a Map with json.Number
// value types and the resulting Map can be correctly encoded into a XML object.
var JsonUseNumber bool

// Just a wrapper on json.Unmarshal
//	Converting JSON to XML is a simple as:
//		...
//		mapVal, merr := mxj.NewMapJson(jsonVal)
//		if merr != nil {
//			// handle error
//		}
//		xmlVal, xerr := mapVal.Xml()
//		if xerr != nil {
//			// handle error
//		}
// NOTE: as a special case, passing a list, e.g., [{"some-null-value":"", "a-non-null-value":"bar"}],
// will be interpreted as having the root key 'object' prepended - {"object":[ ... ]} - to unmarshal to a Map.
// See mxj/j2x/j2x_test.go.
func NewMapJson(jsonVal []byte) (Map, error) {
	// empty or nil begets empty
	if len(jsonVal) == 0 {
		m := make(map[string]interface{}, 0)
		return m, nil
	}
	// handle a goofy case ...
	if jsonVal[0] == '[' {
		jsonVal = []byte(`{"object":` + string(jsonVal) + `}`)
	}
	m := make(map[string]interface{})
	// err := json.Unmarshal(jsonVal, &m)
	buf := bytes.NewReader(jsonVal)
	dec := json.NewDecoder(buf)
	if JsonUseNumber {
		dec.UseNumber()
	}
	err := dec.Decode(&m)
	return m, err
}

// Retrieve a Map value from an io.Reader.
//  NOTE: The raw JSON off the reader is buffered to []byte using a ByteReader. If the io.Reader is an
//        os.File, there may be significant performance impact. If the io.Reader is wrapping a []byte
//        value in-memory, however, such as http.Request.Body you CAN use it to efficiently unmarshal
//        a JSON object.
func NewMapJsonReader(jsonReader io.Reader) (Map, error) {
	jb, err := getJson(jsonReader)
	if err != nil || len(*jb) == 0 {
		return nil, err
	}

	// Unmarshal the 'presumed' JSON string
	return NewMapJson(*jb)
}

// Retrieve a Map value and raw JSON - []byte - from an io.Reader.
//  NOTE: The raw JSON off the reader is buffered to []byte using a ByteReader. If the io.Reader is an
//        os.File, there may be significant performance impact. If the io.Reader is wrapping a []byte
//        value in-memory, however, such as http.Request.Body you CAN use it to efficiently unmarshal
//        a JSON object and retrieve the raw JSON in a single call.
func NewMapJsonReaderRaw(jsonReader io.Reader) (Map, []byte, error) {
	jb, err := getJson(jsonReader)
	if err != nil || len(*jb) == 0 {
		return nil, *jb, err
	}

	// Unmarshal the 'presumed' JSON string
	m, merr := NewMapJson(*jb)
	return m, *jb, merr
}

// Pull the next JSON string off the stream: just read from first '{' to its closing '}'.
// Returning a pointer to the slice saves 16 bytes - maybe unnecessary, but internal to package.
func getJson(rdr io.Reader) (*[]byte, error) {
	bval := make([]byte, 1)
	jb := make([]byte, 0)
	var inQuote, inJson bool
	var parenCnt int
	var previous byte

	// scan the input for a matched set of {...}
	// json.Unmarshal will handle syntax checking.
	for {
		_, err := rdr.Read(bval)
		if err != nil {
			if err == io.EOF && inJson && parenCnt > 0 {
				return &jb, fmt.Errorf("no closing } for JSON string: %s", string(jb))
			}
			return &jb, err
		}
		switch bval[0] {
		case '{':
			if !inQuote {
				parenCnt++
				inJson = true
			}
		case '}':
			if !inQuote {
				parenCnt--
			}
			if parenCnt < 0 {
				return nil, fmt.Errorf("closing } without opening {: %s", string(jb))
			}
		case '"':
			if inQuote {
				if previous == '\\' {
					break
				}
				inQuote = false
			} else {
				inQuote = true
			}
		case '\n', '\r', '\t', ' ':
			if !inQuote {
				continue
			}
		}
		if inJson {
			jb = append(jb, bval[0])
			if parenCnt == 0 {
				break
			}
		}
		previous = bval[0]
	}

	return &jb, nil
}

// ------------------------------- JSON Reader handler via Map values  -----------------------

// Default poll delay to keep Handler from spinning on an open stream
// like sitting on os.Stdin waiting for imput.
var jhandlerPollInterval = time.Duration(1e6)

// While unnecessary, we make HandleJsonReader() have the same signature as HandleXmlReader().
// This avoids treating one or other as a special case and discussing the underlying stdlib logic.

// Bulk process JSON using handlers that process a Map value.
//	'rdr' is an io.Reader for the JSON (stream).
//	'mapHandler' is the Map processing handler. Return of 'false' stops io.Reader processing.
//	'errHandler' is the error processor. Return of 'false' stops io.Reader  processing and returns the error.
//	Note: mapHandler() and errHandler() calls are blocking, so reading and processing of messages is serialized.
//	      This means that you can stop reading the file on error or after processing a particular message.
//	      To have reading and handling run concurrently, pass argument to a go routine in handler and return 'true'.
func HandleJsonReader(jsonReader io.Reader, mapHandler func(Map) bool, errHandler func(error) bool) error {
	var n int
	for {
		m, merr := NewMapJsonReader(jsonReader)
		n++

		// handle error condition with errhandler
		if merr != nil && merr != io.EOF {
			merr = fmt.Errorf("[jsonReader: %d] %s", n, merr.Error())
			if ok := errHandler(merr); !ok {
				// caused reader termination
				return merr
			}
			continue
		}

		// pass to maphandler
		if len(m) != 0 {
			if ok := mapHandler(m); !ok {
				break
			}
		} else if merr != io.EOF {
			<-time.After(jhandlerPollInterval)
		}

		if merr == io.EOF {
			break
		}
	}
	return nil
}

// Bulk process JSON using handlers that process a Map value and the raw JSON.
//	'rdr' is an io.Reader for the JSON (stream).
//	'mapHandler' is the Map and raw JSON - []byte - processor. Return of 'false' stops io.Reader processing.
//	'errHandler' is the error and raw JSON processor. Return of 'false' stops io.Reader processing and returns the error.
//	Note: mapHandler() and errHandler() calls are blocking, so reading and processing of messages is serialized.
//	      This means that you can stop reading the file on error or after processing a particular message.
//	      To have reading and handling run concurrently, pass argument(s) to a go routine in handler and return 'true'.
func HandleJsonReaderRaw(jsonReader io.Reader, mapHandler func(Map, []byte) bool, errHandler func(error, []byte) bool) error {
	var n int
	for {
		m, raw, merr := NewMapJsonReaderRaw(jsonReader)
		n++

		// handle error condition with errhandler
		if merr != nil && merr != io.EOF {
			merr = fmt.Errorf("[jsonReader: %d] %s", n, merr.Error())
			if ok := errHandler(merr, raw); !ok {
				// caused reader termination
				return merr
			}
			continue
		}

		// pass to maphandler
		if len(m) != 0 {
			if ok := mapHandler(m, raw); !ok {
				break
			}
		} else if merr != io.EOF {
			<-time.After(jhandlerPollInterval)
		}

		if merr == io.EOF {
			break
		}
	}
	return nil
}

{'repo_name': 'clbanning/mxj', 'stars': '386', 'repo_language': 'Go', 'file_name': 'x2j_valuesAt.go', 'mime_type': 'text/plain', 'hash': -4739224342193486258, 'source_dataset': 'data'}


platform :osx, '10.10'
use_frameworks!
install! 'cocoapods', :generate_multiple_pod_projects => true

target 'CriolloServerStats' do
  pod 'Criollo', :git => '../../', :submodules => true
  pod 'CSSystemInfoHelper', '~> 1.4'
end

{'repo_name': 'thecatalinstan/Criollo', 'stars': '210', 'repo_language': 'Objective-C', 'file_name': 'CRHTTPResponse.h', 'mime_type': 'text/x-objective-c', 'hash': -483712832240863090, 'source_dataset': 'data'}


import React, { InputHTMLAttributes, useEffect, useRef } from 'react';

import { useField } from '../../lib';

interface Props extends InputHTMLAttributes<HTMLInputElement> {
  name: string;
  label?: string;
}

export default function Input({ name, label, ...rest }: Props) {
  const ref = useRef<HTMLInputElement>(null);
  const { fieldName, registerField, defaultValue, error } = useField(name);

  useEffect(() => {
    if (ref.current) {
      registerField({
        name: fieldName,
        ref: ref.current,
        path: 'value',
        clearValue: (inputRef: HTMLInputElement) => {
          inputRef.value = 'test';
        },
      });
    }
  }, [fieldName, registerField]);

  return (
    <>
      {label && {label}}

      <input
        {...rest}
        ref={ref}
        id={fieldName}
        name={fieldName}
        aria-label={fieldName}
        defaultValue={defaultValue}
      />

      {error && {error}}
    </>
  );
}

{'repo_name': 'Rocketseat/unform', 'stars': '3562', 'repo_language': 'TypeScript', 'file_name': 'Input.tsx', 'mime_type': 'text/x-java', 'hash': 9078803256097546820, 'source_dataset': 'data'}


// Copyright 2007, Google 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:
//
//     * 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.

//
// Utilities for testing Google Test itself and code that uses Google Test
// (e.g. frameworks built on top of Google Test).

// GOOGLETEST_CM0004 DO NOT DELETE

#ifndef GTEST_INCLUDE_GTEST_GTEST_SPI_H_
#define GTEST_INCLUDE_GTEST_GTEST_SPI_H_

#include "gtest/gtest.h"

GTEST_DISABLE_MSC_WARNINGS_PUSH_(4251 \
/* class A needs to have dll-interface to be used by clients of class B */)

namespace testing {

// This helper class can be used to mock out Google Test failure reporting
// so that we can test Google Test or code that builds on Google Test.
//
// An object of this class appends a TestPartResult object to the
// TestPartResultArray object given in the constructor whenever a Google Test
// failure is reported. It can either intercept only failures that are
// generated in the same thread that created this object or it can intercept
// all generated failures. The scope of this mock object can be controlled with
// the second argument to the two arguments constructor.
class GTEST_API_ ScopedFakeTestPartResultReporter
    : public TestPartResultReporterInterface {
 public:
  // The two possible mocking modes of this object.
  enum InterceptMode {
    INTERCEPT_ONLY_CURRENT_THREAD,  // Intercepts only thread local failures.
    INTERCEPT_ALL_THREADS           // Intercepts all failures.
  };

  // The c'tor sets this object as the test part result reporter used
  // by Google Test.  The 'result' parameter specifies where to report the
  // results. This reporter will only catch failures generated in the current
  // thread. DEPRECATED
  explicit ScopedFakeTestPartResultReporter(TestPartResultArray* result);

  // Same as above, but you can choose the interception scope of this object.
  ScopedFakeTestPartResultReporter(InterceptMode intercept_mode,
                                   TestPartResultArray* result);

  // The d'tor restores the previous test part result reporter.
  virtual ~ScopedFakeTestPartResultReporter();

  // Appends the TestPartResult object to the TestPartResultArray
  // received in the constructor.
  //
  // This method is from the TestPartResultReporterInterface
  // interface.
  virtual void ReportTestPartResult(const TestPartResult& result);
 private:
  void Init();

  const InterceptMode intercept_mode_;
  TestPartResultReporterInterface* old_reporter_;
  TestPartResultArray* const result_;

  GTEST_DISALLOW_COPY_AND_ASSIGN_(ScopedFakeTestPartResultReporter);
};

namespace internal {

// A helper class for implementing EXPECT_FATAL_FAILURE() and
// EXPECT_NONFATAL_FAILURE().  Its destructor verifies that the given
// TestPartResultArray contains exactly one failure that has the given
// type and contains the given substring.  If that's not the case, a
// non-fatal failure will be generated.
class GTEST_API_ SingleFailureChecker {
 public:
  // The constructor remembers the arguments.
  SingleFailureChecker(const TestPartResultArray* results,
                       TestPartResult::Type type, const std::string& substr);
  ~SingleFailureChecker();
 private:
  const TestPartResultArray* const results_;
  const TestPartResult::Type type_;
  const std::string substr_;

  GTEST_DISALLOW_COPY_AND_ASSIGN_(SingleFailureChecker);
};

}  // namespace internal

}  // namespace testing

GTEST_DISABLE_MSC_WARNINGS_POP_()  //  4251

// A set of macros for testing Google Test assertions or code that's expected
// to generate Google Test fatal failures.  It verifies that the given
// statement will cause exactly one fatal Google Test failure with 'substr'
// being part of the failure message.
//
// There are two different versions of this macro. EXPECT_FATAL_FAILURE only
// affects and considers failures generated in the current thread and
// EXPECT_FATAL_FAILURE_ON_ALL_THREADS does the same but for all threads.
//
// The verification of the assertion is done correctly even when the statement
// throws an exception or aborts the current function.
//
// Known restrictions:
//   - 'statement' cannot reference local non-static variables or
//     non-static members of the current object.
//   - 'statement' cannot return a value.
//   - You cannot stream a failure message to this macro.
//
// Note that even though the implementations of the following two
// macros are much alike, we cannot refactor them to use a common
// helper macro, due to some peculiarity in how the preprocessor
// works.  The AcceptsMacroThatExpandsToUnprotectedComma test in
// gtest_unittest.cc will fail to compile if we do that.
#define EXPECT_FATAL_FAILURE(statement, substr) \
  do { \
    class GTestExpectFatalFailureHelper {\
     public:\
      static void Execute() { statement; }\
    };\
    ::testing::TestPartResultArray gtest_failures;\
    ::testing::internal::SingleFailureChecker gtest_checker(\
        &gtest_failures, ::testing::TestPartResult::kFatalFailure, (substr));\
    {\
      ::testing::ScopedFakeTestPartResultReporter gtest_reporter(\
          ::testing::ScopedFakeTestPartResultReporter:: \
          INTERCEPT_ONLY_CURRENT_THREAD, &gtest_failures);\
      GTestExpectFatalFailureHelper::Execute();\
    }\
  } while (::testing::internal::AlwaysFalse())

#define EXPECT_FATAL_FAILURE_ON_ALL_THREADS(statement, substr) \
  do { \
    class GTestExpectFatalFailureHelper {\
     public:\
      static void Execute() { statement; }\
    };\
    ::testing::TestPartResultArray gtest_failures;\
    ::testing::internal::SingleFailureChecker gtest_checker(\
        &gtest_failures, ::testing::TestPartResult::kFatalFailure, (substr));\
    {\
      ::testing::ScopedFakeTestPartResultReporter gtest_reporter(\
          ::testing::ScopedFakeTestPartResultReporter:: \
          INTERCEPT_ALL_THREADS, &gtest_failures);\
      GTestExpectFatalFailureHelper::Execute();\
    }\
  } while (::testing::internal::AlwaysFalse())

// A macro for testing Google Test assertions or code that's expected to
// generate Google Test non-fatal failures.  It asserts that the given
// statement will cause exactly one non-fatal Google Test failure with 'substr'
// being part of the failure message.
//
// There are two different versions of this macro. EXPECT_NONFATAL_FAILURE only
// affects and considers failures generated in the current thread and
// EXPECT_NONFATAL_FAILURE_ON_ALL_THREADS does the same but for all threads.
//
// 'statement' is allowed to reference local variables and members of
// the current object.
//
// The verification of the assertion is done correctly even when the statement
// throws an exception or aborts the current function.
//
// Known restrictions:
//   - You cannot stream a failure message to this macro.
//
// Note that even though the implementations of the following two
// macros are much alike, we cannot refactor them to use a common
// helper macro, due to some peculiarity in how the preprocessor
// works.  If we do that, the code won't compile when the user gives
// EXPECT_NONFATAL_FAILURE() a statement that contains a macro that
// expands to code containing an unprotected comma.  The
// AcceptsMacroThatExpandsToUnprotectedComma test in gtest_unittest.cc
// catches that.
//
// For the same reason, we have to write
//   if (::testing::internal::AlwaysTrue()) { statement; }
// instead of
//   GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement)
// to avoid an MSVC warning on unreachable code.
#define EXPECT_NONFATAL_FAILURE(statement, substr) \
  do {\
    ::testing::TestPartResultArray gtest_failures;\
    ::testing::internal::SingleFailureChecker gtest_checker(\
        &gtest_failures, ::testing::TestPartResult::kNonFatalFailure, \
        (substr));\
    {\
      ::testing::ScopedFakeTestPartResultReporter gtest_reporter(\
          ::testing::ScopedFakeTestPartResultReporter:: \
          INTERCEPT_ONLY_CURRENT_THREAD, &gtest_failures);\
      if (::testing::internal::AlwaysTrue()) { statement; }\
    }\
  } while (::testing::internal::AlwaysFalse())

#define EXPECT_NONFATAL_FAILURE_ON_ALL_THREADS(statement, substr) \
  do {\
    ::testing::TestPartResultArray gtest_failures;\
    ::testing::internal::SingleFailureChecker gtest_checker(\
        &gtest_failures, ::testing::TestPartResult::kNonFatalFailure, \
        (substr));\
    {\
      ::testing::ScopedFakeTestPartResultReporter gtest_reporter(\
          ::testing::ScopedFakeTestPartResultReporter::INTERCEPT_ALL_THREADS, \
          &gtest_failures);\
      if (::testing::internal::AlwaysTrue()) { statement; }\
    }\
  } while (::testing::internal::AlwaysFalse())

#endif  // GTEST_INCLUDE_GTEST_GTEST_SPI_H_

{'repo_name': 'MoonchildProductions/UXP', 'stars': '338', 'repo_language': 'None', 'file_name': 'copyimage.h', 'mime_type': 'text/x-c++', 'hash': 8960607494042306608, 'source_dataset': 'data'}


//
// fiware
//
(function(hello) {

  function formatError(o, headers) {
    var code = headers ? headers.statusCode : (o && "meta" in o && "status" in o.meta && o.meta.status);
    if ((code === 401 || code === 403)) {
      o.error = {
        code: "access_denied",
        message: o.message || (o.data ? o.data.message : "Could not get response")
      };
      delete o.message;
    }
  }

  function formatUser(o) {
    if (o.id) {
      o.thumbnail = o.picture = o.avatar_url;
      o.name = o.displayName;
    }
  }

  function paging(res, headers, req) {
    if (res.data && res.data.length && headers && headers.Link) {
      var next = headers.Link.match(/&page=([0-9]+)/);
      if (next) {
        res.paging = {
          next: "?page=" + next[1]
        };
      }
    }
  }

  hello.init({
    fiware: {
      name: 'FIWare',
      oauth: {
        version: 2,
        auth: 'https://account.lab.fi-ware.org/authorize',
        grant: 'https://account.lab.fi-ware.org/access_token'
      },
      base: 'https://account.lab.fi-ware.org/',
      get: {
        'me': 'user'
      },
      wrap: {
        me: function(o, headers) {
          formatError(o, headers);
          formatUser(o);
          return o;
        },
        "default": function(o, headers, req) {

          formatError(o, headers);

          if (Object.prototype.toString.call(o) === '[object Array]') {
            o = {
              data: o
            };
            paging(o, headers, req);
            for (var i = 0; i < o.data.length; i++) {
              formatUser(o.data[i]);
            }
          }
          return o;
        }
      }
    }
  });

})(hello);

{'repo_name': 'pixelpark/ppnet', 'stars': '118', 'repo_language': 'JavaScript', 'file_name': 'Dockerfile-couchdb', 'mime_type': 'text/plain', 'hash': -3580546483560746216, 'source_dataset': 'data'}


/*
Copyright 2019 The Kubernetes Authors.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package mocktarget

import (
	gomock "github.com/golang/mock/gomock"
	labels "k8s.io/apimachinery/pkg/labels"
	vpa_types "k8s.io/autoscaler/vertical-pod-autoscaler/pkg/apis/autoscaling.k8s.io/v1"
)

// MockVpaTargetSelectorFetcher is a mock of VpaTargetSelectorFetcher interface
type MockVpaTargetSelectorFetcher struct {
	ctrl     *gomock.Controller
	recorder *_MockVpaTargetSelectorFetcherRecorder
}

// Recorder for MockVpaTargetSelectorFetcher (not exported)
type _MockVpaTargetSelectorFetcherRecorder struct {
	mock *MockVpaTargetSelectorFetcher
}

// NewMockVpaTargetSelectorFetcher returns mock instance of a mock of VpaTargetSelectorFetcher
func NewMockVpaTargetSelectorFetcher(ctrl *gomock.Controller) *MockVpaTargetSelectorFetcher {
	mock := &MockVpaTargetSelectorFetcher{ctrl: ctrl}
	mock.recorder = &_MockVpaTargetSelectorFetcherRecorder{mock}
	return mock
}

// EXPECT enables configuring expectaions
func (_m *MockVpaTargetSelectorFetcher) EXPECT() *_MockVpaTargetSelectorFetcherRecorder {
	return _m.recorder
}

// Fetch enables configuring expectations on Fetch method
func (_m *MockVpaTargetSelectorFetcher) Fetch(vpa *vpa_types.VerticalPodAutoscaler) (labels.Selector, error) {
	ret := _m.ctrl.Call(_m, "Fetch", vpa)
	ret0, _ := ret[0].(labels.Selector)
	ret1, _ := ret[1].(error)
	return ret0, ret1
}

func (_mr *_MockVpaTargetSelectorFetcherRecorder) Fetch(arg0 interface{}) *gomock.Call {
	return _mr.mock.ctrl.RecordCall(_mr.mock, "Fetch", arg0)
}

{'repo_name': 'kubernetes/autoscaler', 'stars': '3328', 'repo_language': 'Go', 'file_name': 'PATENTS', 'mime_type': 'text/plain', 'hash': -2480200838157932475, 'source_dataset': 'data'}


@comment $NetBSD: PLIST,v 1.7 2016/04/21 23:38:28 prlw1 Exp $
bin/gnome-autogen.sh
share/aclocal/ax_check_enable_debug.m4
share/aclocal/ax_code_coverage.m4
share/aclocal/gnome-code-coverage.m4
share/aclocal/gnome-common.m4
share/aclocal/gnome-compiler-flags.m4

{'repo_name': 'NetBSD/pkgsrc', 'stars': '152', 'repo_language': 'None', 'file_name': 'patch-CoinMP-configure', 'mime_type': 'text/x-diff', 'hash': 8311314870968808550, 'source_dataset': 'data'}


/*
 * Copyright (C) 2014 by Array Systems Computing Inc. http://www.array.ca
 *
 * 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/
 */
package org.esa.s1tbx.dat.layers.maptools;

import org.esa.snap.core.datamodel.RasterDataNode;
import org.esa.snap.rcp.SnapApp;
import org.esa.snap.ui.layer.AbstractLayerSourceAssistantPage;
import org.esa.snap.ui.layer.LayerSource;
import org.esa.snap.ui.layer.LayerSourcePageContext;

/**

 */
public class MapToolsLayerSource implements LayerSource {

    public boolean isApplicable(LayerSourcePageContext pageContext) {
        return true;
    }

    public boolean hasFirstPage() {
        return true;
    }

    public AbstractLayerSourceAssistantPage getFirstPage(LayerSourcePageContext pageContext) {
        return new MapToolsAssistantPage();
    }

    public boolean canFinish(LayerSourcePageContext pageContext) {
        return false;
    }

    public boolean performFinish(LayerSourcePageContext pageContext) {
        return false;
    }

    public void cancel(LayerSourcePageContext pageContext) {
    }

    public static void createLayer(final LayerSourcePageContext pageContext, final MapToolsOptions options) {
        final RasterDataNode raster = SnapApp.getDefault().getSelectedProductSceneView().getRaster();
        final MapToolsLayer geoLayer = MapToolsLayerType.createLayer(raster, options);
        pageContext.getLayerContext().getRootLayer().getChildren().add(0, geoLayer);
    }
}

{'repo_name': 'senbox-org/s1tbx', 'stars': '115', 'repo_language': 'Java', 'file_name': 'RemoveAntennaPatternOpUI.java', 'mime_type': 'text/x-java', 'hash': 8756917232469445893, 'source_dataset': 'data'}


/*
 * Copyright 2006-2008 The FLWOR Foundation.
 *
 * 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.
 */

#ifndef ZORBA_RSTRING_REP_PROXY_H
#define ZORBA_RSTRING_REP_PROXY_H

#include <cassert>

#include <zorba/config.h>
#include <zorba/internal/cxx_util.h>

namespace zorba {
namespace rstring_classes {

/**
 * A proxy for either default_rep or ptr_rep.
 */
template<class RepType>
class rep_proxy {
public:
  typedef typename RepType::allocator_type allocator_type;
  typedef typename RepType::difference_type difference_type;
  typedef typename RepType::size_type size_type;
  typedef typename RepType::traits_type traits_type;

  typedef typename RepType::value_type value_type;
  typedef typename RepType::pointer pointer;
  typedef typename RepType::const_pointer const_pointer;
  typedef typename RepType::reference reference;
  typedef typename RepType::const_reference const_reference;

  typedef typename RepType::iterator iterator;
  typedef typename RepType::const_iterator const_iterator;
  typedef typename RepType::reverse_iterator reverse_iterator;
  typedef typename RepType::const_reverse_iterator const_reverse_iterator;

  typedef rep_proxy<typename RepType::result_rep_type> result_rep_type;

  enum { takes_pointer_ownership = RepType::takes_pointer_ownership };

  /**
   * Constructs a %rep_proxy.
   */
  rep_proxy() {
    set_rep( RepType::empty_rep() );
  }

  /**
   * Destroys a %rep_proxy.
   */
  ~rep_proxy() {
    assert( rep_ == RepType::empty_rep() );
  }

  /**
   * Disposes of this %rep_proxy and its associated string representation.
   *
   * @param a The allocator that was used to allocate the string
   * representation.
   */
  void dispose( allocator_type const &a ) {
    if ( rep_ )
      rep_->dispose( a );
    set_rep( RepType::empty_rep() );
  }

  /**
   * Makes the representation unsharable if necessary.  If it is currently
   * shared, it must be cloned.
   */
  void make_unsharable_if_necessary( allocator_type const &a ) {
    if ( rep_ != RepType::empty_rep() ) {
      typename RepType::count_type const count = rep_->count();
      if ( RepType::is_sharable( count ) ) {
        if ( RepType::is_shared( count ) ) {
          RepType *const new_rep = rep_->clone( a );
          rep_->dispose( a );
          set_rep( new_rep );
        }
        rep_->set_unsharable();
      }
    }
  }

  /**
   * This method is used only in the mutate method of rstring, when
   * copy-on-write is necessary. It creates a representation with zero length
   * and capacity >= to the given capacity. The actual capacity is computed
   * internally, taking into account the given "old" capacity.
   */
  void realloc( size_type cap, size_type old_cap, allocator_type const &a ) {
    assert( rep_ == RepType::empty_rep() );
    set_rep( RepType::alloc( a, cap, old_cap ) );
    rep_->set_length( 0 );
  }

  /**
   * Shares 2 string representations.
   *
   * @param that The %rep_proxy of the representation to share.
   * @param this_alloc This allocator.
   * @param that_alloc The allocator used by \a that.
   */
  void share( rep_proxy const &that, allocator_type const &this_alloc,
              allocator_type const &that_alloc ) {
    dispose( this_alloc );
    if ( that.rep_->is_sharable() && this_alloc == that_alloc ) {
      if ( that.rep_ != RepType::empty_rep() )
        that.rep_->inc();
      set_rep( that.rep_ );
    } else {
      set_rep( that.rep_->clone( this_alloc ) );
    }
  }

  /**
   * Swaps this string representation for another.
   *
   * @param that The %rep_proxy to swap with.
   */
  void swap( rep_proxy &that ) {
    RepType *const tmp = rep_;
    set_rep( that.rep_ );
    that.set_rep( tmp );
  }

  /**
   * Performs a destructive assignment.
   *
   * @param that The %rep_proxy to copy from.  It is set to the empty string.
   * @param this_alloc This allocator.
   * @param that_allor The allocator used by \a that.
   */
  void take( rep_proxy &that, allocator_type const &this_alloc,
             allocator_type const &that_alloc ) {
    if ( *this != that ) {
      dispose( this_alloc );
      if ( this_alloc == that_alloc ) {
        set_rep( that.rep_ );
        that.set_rep( RepType::empty_rep() );
      } else {
        set_rep( that.rep_->clone( this_alloc ) );
      }
    }
  }

  /**
   * Compares 2 %rep_proxy objects for equality.
   *
   * @param i The first %rep_proxy.
   * @param j The second %rep_proxy.
   * @return Returns \c true only if they're equal.
   */
  friend bool operator==( rep_proxy const &i, rep_proxy const &j ) {
    return i.rep_ == j.rep_;
  }

  /**
   * Compares 2 %rep_proxy objects for inequality.
   *
   * @param i The first %rep_proxy.
   * @param j The second %rep_proxy.
   * @return Returns \c true only if they're not equal.
   */
  friend bool operator!=( rep_proxy const &i, rep_proxy const &j ) {
    return !(i == j);
  }

  ////////// Delegate member functions ////////////////////////////////////////

  size_type capacity() const {
    return rep_->capacity();
  }

  void construct( size_type size, value_type c, allocator_type const &a ) {
    assert( rep_ == RepType::empty_rep() );
    set_rep( RepType::construct( size, c, a ) );
  }

  template<class IteratorType>
  void construct( IteratorType begin, IteratorType end,
                  allocator_type const &a ) {
    assert( rep_ == RepType::empty_rep() );
    set_rep( RepType::construct( begin, end, a ) );
  }

  pointer data() const {
    return rep_->data();
  }

  bool is_sharable() {
    return rep_->is_sharable();
  }

  bool is_shared() const {
    return rep_->is_shared();
  }

  size_type length() const {
    return rep_->length();
  }

  void reserve( size_type cap, allocator_type const &a ) {
    set_rep( rep_->reserve( cap, a ) );
  }

  void set_length( size_type n ) {
    rep_->set_length( n );
  }

  void set_sharable() {
    rep_->set_sharable();
  }

  void set_unsharable() {
    rep_->set_unsharable();
  }

  /////////////////////////////////////////////////////////////////////////////

private:
  RepType *rep_;

#ifdef ZORBA_DEBUG_STRING
  const_pointer debug_str_;
#endif /* ZORBA_DEBUG_STRING */

  void set_rep( RepType *r ) {
    rep_ = r;
#ifdef ZORBA_DEBUG_STRING
    debug_str_ = rep_ ? data() : nullptr;
#endif /* ZORBA_DEBUG_STRING */
  }

  // forbid these
  rep_proxy( rep_proxy const& );
  rep_proxy& operator=( rep_proxy const& );
};

} // rstring_classes
} // zorba

#endif /* ZORBA_RSTRING_REP_PROXY_H */
/*
 * Local variables:
 * mode: c++
 * End:
 */
/* vim:set et sw=2 ts=2: */

{'repo_name': '28msec/zorba', 'stars': '113', 'repo_language': 'C++', 'file_name': 'zorba_architecture.txt', 'mime_type': 'text/x-c++', 'hash': 3682100502763441118, 'source_dataset': 'data'}


/*
 * W.J. van der Laan 2011-2012
 */

#include <QApplication>

#include "bitcoingui.h"
#include "clientmodel.h"
#include "walletmodel.h"
#include "optionsmodel.h"
#include "guiutil.h"
#include "guiconstants.h"
#include "init.h"
#include "util.h"
#include "wallet.h"
#include "ui_interface.h"
#include "paymentserver.h"
#ifdef Q_OS_MAC
#include "macdockiconhandler.h"
#endif

#include <QMessageBox>
#include <QTextCodec>
#include <QLocale>
#include <QTimer>
#include <QTranslator>
#include <QSplashScreen>
#include <QLibraryInfo>

#if defined(BITCOIN_NEED_QT_PLUGINS) && !defined(_BITCOIN_QT_PLUGINS_INCLUDED)
#define _BITCOIN_QT_PLUGINS_INCLUDED
#define __INSURE__
#include <QtPlugin>
Q_IMPORT_PLUGIN(qcncodecs)
Q_IMPORT_PLUGIN(qjpcodecs)
Q_IMPORT_PLUGIN(qtwcodecs)
Q_IMPORT_PLUGIN(qkrcodecs)
Q_IMPORT_PLUGIN(qtaccessiblewidgets)
#endif

// Need a global reference for the notifications to find the GUI
static BitcoinGUI *guiref;
static QSplashScreen *splashref;

static void ThreadSafeMessageBox(const std::string& message, const std::string& caption, unsigned int style)
{
    // Message from network thread
    if(guiref)
    {
        bool modal = (style & CClientUIInterface::MODAL);
        // In case of modal message, use blocking connection to wait for user to click a button
        QMetaObject::invokeMethod(guiref, "message",
                                   modal ? GUIUtil::blockingGUIThreadConnection() : Qt::QueuedConnection,
                                   Q_ARG(QString, QString::fromStdString(caption)),
                                   Q_ARG(QString, QString::fromStdString(message)),
                                   Q_ARG(bool, modal),
                                   Q_ARG(unsigned int, style));
    }
    else
    {
        LogPrintf("%s: %s\n", caption, message);
        fprintf(stderr, "%s: %s\n", caption.c_str(), message.c_str());
    }
}

static bool ThreadSafeAskFee(int64_t nFeeRequired, const std::string& strCaption)
{
    if(!guiref)
        return false;
    if(nFeeRequired < MIN_TX_FEE || nFeeRequired <= nTransactionFee || fDaemon)
        return true;
    bool payFee = false;

    QMetaObject::invokeMethod(guiref, "askFee", GUIUtil::blockingGUIThreadConnection(),
                               Q_ARG(qint64, nFeeRequired),
                               Q_ARG(bool*, &payFee));

    return payFee;
}

static void InitMessage(const std::string &message)
{
    if(splashref)
    {
        splashref->showMessage(QString::fromStdString(message), Qt::AlignBottom|Qt::AlignHCenter, QColor(232,186,63));
        QApplication::instance()->processEvents();
    }
    LogPrintf("init message: %s\n", message);
}

/*
   Translate string to current locale using Qt.
 */
static std::string Translate(const char* psz)
{
    return QCoreApplication::translate("bitcoin-core", psz).toStdString();
}

/* Handle runaway exceptions. Shows a message box with the problem and quits the program.
 */
static void handleRunawayException(std::exception *e)
{
    PrintExceptionContinue(e, "Runaway exception");
    QMessageBox::critical(0, "Runaway exception", BitcoinGUI::tr("A fatal error occurred. HShare can no longer continue safely and will quit.") + QString("\n\n") + QString::fromStdString(strMiscWarning));
    exit(1);
}

/* qDebug() message handler --> debug.log */
#if QT_VERSION < 0x050000
void DebugMessageHandler(QtMsgType type, const char * msg)
{
    const char *category = (type == QtDebugMsg) ? "qt" : NULL;
    LogPrint(category, "GUI: %s\n", msg);
}
#else
void DebugMessageHandler(QtMsgType type, const QMessageLogContext& context, const QString &msg)
{
    const char *category = (type == QtDebugMsg) ? "qt" : NULL;
    LogPrint(category, "GUI: %s\n", msg.toStdString());
}
#endif

#ifndef BITCOIN_QT_TEST
int main(int argc, char *argv[])
{
    fHaveGUI = true;

    // Command-line options take precedence:
    ParseParameters(argc, argv);

#if QT_VERSION < 0x050000
    // Internal string conversion is all UTF-8
    QTextCodec::setCodecForTr(QTextCodec::codecForName("UTF-8"));
    QTextCodec::setCodecForCStrings(QTextCodec::codecForTr());
#endif

    Q_INIT_RESOURCE(bitcoin);
    QApplication app(argc, argv);

    // Do this early as we don't want to bother initializing if we are just calling IPC
    // ... but do it after creating app, so QCoreApplication::arguments is initialized:
    if (PaymentServer::ipcSendCommandLine())
        exit(0);
    PaymentServer* paymentServer = new PaymentServer(&app);

    // Install global event filter that makes sure that long tooltips can be word-wrapped
    app.installEventFilter(new GUIUtil::ToolTipToRichTextFilter(TOOLTIP_WRAP_THRESHOLD, &app));
    // Install qDebug() message handler to route to debug.log
#if QT_VERSION < 0x050000
    qInstallMsgHandler(DebugMessageHandler);
#else
    qInstallMessageHandler(DebugMessageHandler);
#endif

    // Command-line options take precedence:
    ParseParameters(argc, argv);

    // ... then bitcoin.conf:
    if (!boost::filesystem::is_directory(GetDataDir(false)))
    {
        // This message can not be translated, as translation is not initialized yet
        // (which not yet possible because lang=XX can be overridden in bitcoin.conf in the data directory)
        QMessageBox::critical(0, "HShare",
                              QString("Error: Specified data directory \"%1\" does not exist.").arg(QString::fromStdString(mapArgs["-datadir"])));
        return 1;
    }
    ReadConfigFile(mapArgs, mapMultiArgs);

    // Application identification (must be set before OptionsModel is initialized,
    // as it is used to locate QSettings)
    app.setOrganizationName("HShare");
    //XXX app.setOrganizationDomain("");
    if(GetBoolArg("-testnet", false)) // Separate UI settings for testnet
        app.setApplicationName("HShare-Qt-testnet");
    else
        app.setApplicationName("HShare-Qt");

    // ... then GUI settings:
    OptionsModel optionsModel;

    // Get desired locale (e.g. "de_DE") from command line or use system locale
    QString lang_territory = QString::fromStdString(GetArg("-lang", QLocale::system().name().toStdString()));
    QString lang = lang_territory;
    // Convert to "de" only by truncating "_DE"
    lang.truncate(lang_territory.lastIndexOf('_'));

    QTranslator qtTranslatorBase, qtTranslator, translatorBase, translator;
    // Load language files for configured locale:
    // - First load the translator for the base language, without territory
    // - Then load the more specific locale translator

    // Load e.g. qt_de.qm
    if (qtTranslatorBase.load("qt_" + lang, QLibraryInfo::location(QLibraryInfo::TranslationsPath)))
        app.installTranslator(&qtTranslatorBase);

    // Load e.g. qt_de_DE.qm
    if (qtTranslator.load("qt_" + lang_territory, QLibraryInfo::location(QLibraryInfo::TranslationsPath)))
        app.installTranslator(&qtTranslator);

    // Load e.g. bitcoin_de.qm (shortcut "de" needs to be defined in bitcoin.qrc)
    if (translatorBase.load(lang, ":/translations/"))
        app.installTranslator(&translatorBase);

    // Load e.g. bitcoin_de_DE.qm (shortcut "de_DE" needs to be defined in bitcoin.qrc)
    if (translator.load(lang_territory, ":/translations/"))
        app.installTranslator(&translator);

    // Subscribe to global signals from core
    uiInterface.ThreadSafeMessageBox.connect(ThreadSafeMessageBox);
    uiInterface.ThreadSafeAskFee.connect(ThreadSafeAskFee);
    uiInterface.InitMessage.connect(InitMessage);
    uiInterface.Translate.connect(Translate);

    // Show help message immediately after parsing command-line options (for "-lang") and setting locale,
    // but before showing splash screen.
    if (mapArgs.count("-?") || mapArgs.count("--help"))
    {
        GUIUtil::HelpMessageBox help;
        help.showOrPrint();
        return 1;
    }

#ifdef Q_OS_MAC
    // on mac, also change the icon now because it would look strange to have a testnet splash (green) and a std app icon (orange)
    if(GetBoolArg("-testnet", false))
    {
        MacDockIconHandler::instance()->setIcon(QIcon(":icons/bitcoin_testnet"));
    }
#endif

    QSplashScreen splash(QPixmap(":/images/splash"), 0);
    if (GetBoolArg("-splash", true) && !GetBoolArg("-min", false))
    {
        splash.show();
        splashref = &splash;
    }

    app.processEvents();

    app.setQuitOnLastWindowClosed(false);

    try
    {
        if (fUseBlackTheme)
            GUIUtil::SetBlackThemeQSS(app);

        // Regenerate startup link, to fix links to old versions
        if (GUIUtil::GetStartOnSystemStartup())
            GUIUtil::SetStartOnSystemStartup(true);

        boost::thread_group threadGroup;

        BitcoinGUI window;
        guiref = &window;

        QTimer* pollShutdownTimer = new QTimer(guiref);
        QObject::connect(pollShutdownTimer, SIGNAL(timeout()), guiref, SLOT(detectShutdown()));
        pollShutdownTimer->start(200);

        if(AppInit2(threadGroup))
        {
            {
                // Put this in a block, so that the Model objects are cleaned up before
                // calling Shutdown().

                paymentServer->setOptionsModel(&optionsModel);

                if (splashref)
                    splash.finish(&window);

                ClientModel clientModel(&optionsModel);
                WalletModel walletModel(pwalletMain, &optionsModel);

                window.setClientModel(&clientModel);
                window.setWalletModel(&walletModel);

                // If -min option passed, start window minimized.
                if(GetBoolArg("-min", false))
                {
                    window.showMinimized();
                }
                else
                {
                    window.show();
                }

                // Now that initialization/startup is done, process any command-line
                // bitcoin: URIs
                QObject::connect(paymentServer, SIGNAL(receivedURI(QString)), &window, SLOT(handleURI(QString)));
                QTimer::singleShot(100, paymentServer, SLOT(uiReady()));

                app.exec();

                window.hide();
                window.setClientModel(0);
                window.setWalletModel(0);
                guiref = 0;
            }
            // Shutdown the core and its threads, but don't exit Bitcoin-Qt here
            threadGroup.interrupt_all();
            threadGroup.join_all();
            Shutdown();
        }
        else
        {
            threadGroup.interrupt_all();
            threadGroup.join_all();
            Shutdown();
            return 1;
        }
    } catch (std::exception& e) {
        handleRunawayException(&e);
    } catch (...) {
        handleRunawayException(NULL);
    }
    return 0;
}
#endif // BITCOIN_QT_TEST

{'repo_name': 'HcashOrg/Hshare', 'stars': '420', 'repo_language': 'C', 'file_name': 'Doxyfile', 'mime_type': 'text/plain', 'hash': 5956506253819882470, 'source_dataset': 'data'}


.tooltip {
    position: relative;
    display: inline-block;
    line-height: 18px;
    vertical-align: middle;
    margin-right: 6px;

    > span {
        display: inline;
        font-family: 'Icons';
        cursor: pointer;
    }

    > div {
        position: absolute;
        display: block;
        float: left;
        pointer-events: none;
        background: var(--box-bg);
        padding: 12px;
        border-radius: 4px;
        bottom: calc(100% + 4px);
        left: 100%;
        min-width: 300px;
        line-height: 24px;
        font-size: 14px;
        opacity: 0;
        transition: opacity 0.1s ease-out;

        em,
        strong {
            display: block;
            font-style: normal;
            columns: var(--box-body);
            text-align: left;
        }
        strong {
            white-space: nowrap;
            color: var(--primary);
            margin-bottom: 8px;
        }
    }
    &:hover > div {
        opacity: 1;
    }
}

{'repo_name': 'iotaledger/trinity-wallet', 'stars': '367', 'repo_language': 'JavaScript', 'file_name': 'post-merge-githook.sh', 'mime_type': 'text/x-shellscript', 'hash': 915555895330807671, 'source_dataset': 'data'}


.\objects\system_stm32f10x.o: RTE\Device\STM32F103C8\system_stm32f10x.c
.\objects\system_stm32f10x.o: C:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\2.0.0\Device\Include\stm32f10x.h
.\objects\system_stm32f10x.o: D:\Git\arm-tutorial\stm32f103-keil\gpio-register\RTE\RTE_Components.h
.\objects\system_stm32f10x.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.2.0\CMSIS\Include\core_cm3.h
.\objects\system_stm32f10x.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdint.h
.\objects\system_stm32f10x.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.2.0\CMSIS\Include\core_cmInstr.h
.\objects\system_stm32f10x.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.2.0\CMSIS\Include\core_cmFunc.h
.\objects\system_stm32f10x.o: C:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\2.0.0\Device\Include\system_stm32f10x.h
.\objects\system_stm32f10x.o: D:\Git\arm-tutorial\stm32f103-keil\gpio-register\RTE\Device\STM32F103C8\stm32f10x_conf.h
.\objects\system_stm32f10x.o: C:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\2.0.0\Device\StdPeriph_Driver\inc\stm32f10x_gpio.h
.\objects\system_stm32f10x.o: C:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\2.0.0\Device\Include\stm32f10x.h
.\objects\system_stm32f10x.o: C:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\2.0.0\Device\StdPeriph_Driver\inc\stm32f10x_rcc.h
.\objects\system_stm32f10x.o: C:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\2.0.0\Device\StdPeriph_Driver\inc\misc.h

{'repo_name': 'yohanes-erwin/stm32f103-keil', 'stars': '139', 'repo_language': 'C', 'file_name': 'led-matrix-8x8-scrolling-text.map', 'mime_type': 'text/plain', 'hash': -3262770722638888481, 'source_dataset': 'data'}