text:
import warnings
from typing import Callable, Dict, Optional, Sequence, Tuple, Union

from google.api_core import grpc_helpers
from google.api_core import gapic_v1
import google.auth  # type: ignore
from google.auth import credentials as ga_credentials  # type: ignore
from google.auth.transport.grpc import SslCredentials  # type: ignore

import grpc  # type: ignore

from google.cloud.logging_v2.types import logging
from google.protobuf import empty_pb2  # type: ignore
from .base import LoggingServiceV2Transport, DEFAULT_CLIENT_INFO

class LoggingServiceV2GrpcTransport(LoggingServiceV2Transport):
    """gRPC backend transport for LoggingServiceV2.

    Service for ingesting and querying logs.

    This class defines the same methods as the primary client, so the
    primary client can load the underlying transport implementation
    and call it.

    It sends protocol buffers over the wire using gRPC (which is built on
    top of HTTP/2); the ``grpcio`` package must be installed.
    """

    _stubs: Dict[str, Callable]

    def __init__(
        self,
        *,
        host: str = "logging.googleapis.com",
        credentials: ga_credentials.Credentials = None,
        credentials_file: str = None,
        scopes: Sequence[str] = None,
        channel: grpc.Channel = None,
        api_mtls_endpoint: str = None,
        client_cert_source: Callable[[], Tuple[bytes, bytes]] = None,
        ssl_channel_credentials: grpc.ChannelCredentials = None,
        client_cert_source_for_mtls: Callable[[], Tuple[bytes, bytes]] = None,
        quota_project_id: Optional[str] = None,
        client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO,
        always_use_jwt_access: Optional[bool] = False,
        api_audience: Optional[str] = None,
    ) -> None:
        """Instantiate the transport.

        Args:
            host (Optional[str]):
                 The hostname to connect to.
            credentials (Optional[google.auth.credentials.Credentials]): The
                authorization credentials to attach to requests. These
                credentials identify the application to the service; if none
                are specified, the client will attempt to ascertain the
                credentials from the environment.
                This argument is ignored if ``channel`` is provided.
            credentials_file (Optional[str]): A file with credentials that can
                be loaded with :func:`google.auth.load_credentials_from_file`.
                This argument is ignored if ``channel`` is provided.
            scopes (Optional(Sequence[str])): A list of scopes. This argument is
                ignored if ``channel`` is provided.
            channel (Optional[grpc.Channel]): A ``Channel`` instance through
                which to make calls.
            api_mtls_endpoint (Optional[str]): Deprecated. The mutual TLS endpoint.
                If provided, it overrides the ``host`` argument and tries to create
                a mutual TLS channel with client SSL credentials from
                ``client_cert_source`` or application default SSL credentials.
            client_cert_source (Optional[Callable[[], Tuple[bytes, bytes]]]):
                Deprecated. A callback to provide client SSL certificate bytes and
                private key bytes, both in PEM format. It is ignored if
                ``api_mtls_endpoint`` is None.
            ssl_channel_credentials (grpc.ChannelCredentials): SSL credentials
                for the grpc channel. It is ignored if ``channel`` is provided.
            client_cert_source_for_mtls (Optional[Callable[[], Tuple[bytes, bytes]]]):
                A callback to provide client certificate bytes and private key bytes,
                both in PEM format. It is used to configure a mutual TLS channel. It is
                ignored if ``channel`` or ``ssl_channel_credentials`` is provided.
            quota_project_id (Optional[str]): An optional project to use for billing
                and quota.
            client_info (google.api_core.gapic_v1.client_info.ClientInfo):
                The client info used to send a user-agent string along with
                API requests. If ``None``, then default info will be used.
                Generally, you only need to set this if you're developing
                your own client library.
            always_use_jwt_access (Optional[bool]): Whether self signed JWT should
                be used for service account credentials.

        Raises:
          google.auth.exceptions.MutualTLSChannelError: If mutual TLS transport
              creation failed for any reason.
          google.api_core.exceptions.DuplicateCredentialArgs: If both ``credentials``
              and ``credentials_file`` are passed.
        """
        self._grpc_channel = None
        self._ssl_channel_credentials = ssl_channel_credentials
        self._stubs: Dict[str, Callable] = {}

        if api_mtls_endpoint:
            warnings.warn("api_mtls_endpoint is deprecated", DeprecationWarning)
        if client_cert_source:
            warnings.warn("client_cert_source is deprecated", DeprecationWarning)

        if channel:
            # Ignore credentials if a channel was passed.
            credentials = False
            # If a channel was explicitly provided, set it.
            self._grpc_channel = channel
            self._ssl_channel_credentials = None

        else:
            if api_mtls_endpoint:
                host = api_mtls_endpoint

                # Create SSL credentials with client_cert_source or application
                # default SSL credentials.
                if client_cert_source:
                    cert, key = client_cert_source()
                    self._ssl_channel_credentials = grpc.ssl_channel_credentials(
                        certificate_chain=cert, private_key=key
                    )
                else:
                    self._ssl_channel_credentials = SslCredentials().ssl_credentials

            else:
                if client_cert_source_for_mtls and not ssl_channel_credentials:
                    cert, key = client_cert_source_for_mtls()
                    self._ssl_channel_credentials = grpc.ssl_channel_credentials(
                        certificate_chain=cert, private_key=key
                    )

        # The base transport sets the host, credentials and scopes
        super().__init__(
            host=host,
            credentials=credentials,
            credentials_file=credentials_file,
            scopes=scopes,
            quota_project_id=quota_project_id,
            client_info=client_info,
            always_use_jwt_access=always_use_jwt_access,
            api_audience=api_audience,
        )

        if not self._grpc_channel:
            self._grpc_channel = type(self).create_channel(
                self._host,
                # use the credentials which are saved
                credentials=self._credentials,
                # Set ``credentials_file`` to ``None`` here as
                # the credentials that we saved earlier should be used.
                credentials_file=None,
                scopes=self._scopes,
                ssl_credentials=self._ssl_channel_credentials,
                quota_project_id=quota_project_id,
                options=[
                    ("grpc.max_send_message_length", -1),
                    ("grpc.max_receive_message_length", -1),
                ],
            )

        # Wrap messages. This must be done after self._grpc_channel exists
        self._prep_wrapped_messages(client_info)

    @classmethod
    def create_channel(
        cls,
        host: str = "logging.googleapis.com",
        credentials: ga_credentials.Credentials = None,
        credentials_file: str = None,
        scopes: Optional[Sequence[str]] = None,
        quota_project_id: Optional[str] = None,
        **kwargs,
    ) -> grpc.Channel:
        """Create and return a gRPC channel object.
        Args:
            host (Optional[str]): The host for the channel to use.
            credentials (Optional[~.Credentials]): The
                authorization credentials to attach to requests. These
                credentials identify this application to the service. If
                none are specified, the client will attempt to ascertain
                the credentials from the environment.
            credentials_file (Optional[str]): A file with credentials that can
                be loaded with :func:`google.auth.load_credentials_from_file`.
                This argument is mutually exclusive with credentials.
            scopes (Optional[Sequence[str]]): A optional list of scopes needed for this
                service. These are only used when credentials are not specified and
                are passed to :func:`google.auth.default`.
            quota_project_id (Optional[str]): An optional project to use for billing
                and quota.
            kwargs (Optional[dict]): Keyword arguments, which are passed to the
                channel creation.
        Returns:
            grpc.Channel: A gRPC channel object.

        Raises:
            google.api_core.exceptions.DuplicateCredentialArgs: If both ``credentials``
              and ``credentials_file`` are passed.
        """

        return grpc_helpers.create_channel(
            host,
            credentials=credentials,
            credentials_file=credentials_file,
            quota_project_id=quota_project_id,
            default_scopes=cls.AUTH_SCOPES,
            scopes=scopes,
            default_host=cls.DEFAULT_HOST,
            **kwargs,
        )

    @property
    def grpc_channel(self) -> grpc.Channel:
        """Return the channel designed to connect to this service."""
        return self._grpc_channel

    @property
    def delete_log(self) -> Callable[[logging.DeleteLogRequest], empty_pb2.Empty]:
        r"""Return a callable for the delete log method over gRPC.

        Deletes all the log entries in a log for the \_Default Log
        Bucket. The log reappears if it receives new entries. Log
        entries written shortly before the delete operation might not be
        deleted. Entries received after the delete operation with a
        timestamp before the operation will be deleted.

        Returns:
            Callable[[~.DeleteLogRequest],
                    ~.Empty]:
                A function that, when called, will call the underlying RPC
                on the server.
        """
        # Generate a "stub function" on-the-fly which will actually make
        # the request.
        # gRPC handles serialization and deserialization, so we just need
        # to pass in the functions for each.
        if "delete_log" not in self._stubs:
            self._stubs["delete_log"] = self.grpc_channel.unary_unary(
                "/google.logging.v2.LoggingServiceV2/DeleteLog",
                request_serializer=logging.DeleteLogRequest.serialize,
                response_deserializer=empty_pb2.Empty.FromString,
            )
        return self._stubs["delete_log"]

    @property
    def write_log_entries(
        self,
    ) -> Callable[[logging.WriteLogEntriesRequest], logging.WriteLogEntriesResponse]:
        r"""Return a callable for the write log entries method over gRPC.

        Writes log entries to Logging. This API method is the
        only way to send log entries to Logging. This method is
        used, directly or indirectly, by the Logging agent
        (fluentd) and all logging libraries configured to use
        Logging. A single request may contain log entries for a
        maximum of 1000 different resources (projects,
        organizations, billing accounts or folders)

        Returns:
            Callable[[~.WriteLogEntriesRequest],
                    ~.WriteLogEntriesResponse]:
                A function that, when called, will call the underlying RPC
                on the server.
        """
        # Generate a "stub function" on-the-fly which will actually make
        # the request.
        # gRPC handles serialization and deserialization, so we just need
        # to pass in the functions for each.
        if "write_log_entries" not in self._stubs:
            self._stubs["write_log_entries"] = self.grpc_channel.unary_unary(
                "/google.logging.v2.LoggingServiceV2/WriteLogEntries",
                request_serializer=logging.WriteLogEntriesRequest.serialize,
                response_deserializer=logging.WriteLogEntriesResponse.deserialize,
            )
        return self._stubs["write_log_entries"]

    @property
    def list_log_entries(
        self,
    ) -> Callable[[logging.ListLogEntriesRequest], logging.ListLogEntriesResponse]:
        r"""Return a callable for the list log entries method over gRPC.

        Lists log entries. Use this method to retrieve log entries that
        originated from a project/folder/organization/billing account.
        For ways to export log entries, see `Exporting
        Logs <https://cloud.google.com/logging/docs/export>`__.

        Returns:
            Callable[[~.ListLogEntriesRequest],
                    ~.ListLogEntriesResponse]:
                A function that, when called, will call the underlying RPC
                on the server.
        """
        # Generate a "stub function" on-the-fly which will actually make
        # the request.
        # gRPC handles serialization and deserialization, so we just need
        # to pass in the functions for each.
        if "list_log_entries" not in self._stubs:
            self._stubs["list_log_entries"] = self.grpc_channel.unary_unary(
                "/google.logging.v2.LoggingServiceV2/ListLogEntries",
                request_serializer=logging.ListLogEntriesRequest.serialize,
                response_deserializer=logging.ListLogEntriesResponse.deserialize,
            )
        return self._stubs["list_log_entries"]

    @property
    def list_monitored_resource_descriptors(
        self,
    ) -> Callable[
        [logging.ListMonitoredResourceDescriptorsRequest],
        logging.ListMonitoredResourceDescriptorsResponse,
    ]:
        r"""Return a callable for the list monitored resource
        descriptors method over gRPC.

        Lists the descriptors for monitored resource types
        used by Logging.

        Returns:
            Callable[[~.ListMonitoredResourceDescriptorsRequest],
                    ~.ListMonitoredResourceDescriptorsResponse]:
                A function that, when called, will call the underlying RPC
                on the server.
        """
        # Generate a "stub function" on-the-fly which will actually make
        # the request.
        # gRPC handles serialization and deserialization, so we just need
        # to pass in the functions for each.
        if "list_monitored_resource_descriptors" not in self._stubs:
            self._stubs[
                "list_monitored_resource_descriptors"
            ] = self.grpc_channel.unary_unary(
                "/google.logging.v2.LoggingServiceV2/ListMonitoredResourceDescriptors",
                request_serializer=logging.ListMonitoredResourceDescriptorsRequest.serialize,
                response_deserializer=logging.ListMonitoredResourceDescriptorsResponse.deserialize,
            )
        return self._stubs["list_monitored_resource_descriptors"]

    @property
    def list_logs(
        self,
    ) -> Callable[[logging.ListLogsRequest], logging.ListLogsResponse]:
        r"""Return a callable for the list logs method over gRPC.

        Lists the logs in projects, organizations, folders,
        or billing accounts. Only logs that have entries are
        listed.

        Returns:
            Callable[[~.ListLogsRequest],
                    ~.ListLogsResponse]:
                A function that, when called, will call the underlying RPC
                on the server.
        """
        # Generate a "stub function" on-the-fly which will actually make
        # the request.
        # gRPC handles serialization and deserialization, so we just need
        # to pass in the functions for each.
        if "list_logs" not in self._stubs:
            self._stubs["list_logs"] = self.grpc_channel.unary_unary(
                "/google.logging.v2.LoggingServiceV2/ListLogs",
                request_serializer=logging.ListLogsRequest.serialize,
                response_deserializer=logging.ListLogsResponse.deserialize,
            )
        return self._stubs["list_logs"]

    @property
    def tail_log_entries(
        self,
    ) -> Callable[[logging.TailLogEntriesRequest], logging.TailLogEntriesResponse]:
        r"""Return a callable for the tail log entries method over gRPC.

        Streaming read of log entries as they are ingested.
        Until the stream is terminated, it will continue reading
        logs.

        Returns:
            Callable[[~.TailLogEntriesRequest],
                    ~.TailLogEntriesResponse]:
                A function that, when called, will call the underlying RPC
                on the server.
        """
        # Generate a "stub function" on-the-fly which will actually make
        # the request.
        # gRPC handles serialization and deserialization, so we just need
        # to pass in the functions for each.
        if "tail_log_entries" not in self._stubs:
            self._stubs["tail_log_entries"] = self.grpc_channel.stream_stream(
                "/google.logging.v2.LoggingServiceV2/TailLogEntries",
                request_serializer=logging.TailLogEntriesRequest.serialize,
                response_deserializer=logging.TailLogEntriesResponse.deserialize,
            )
        return self._stubs["tail_log_entries"]

    def close(self):
        self.grpc_channel.close()

    @property
    def kind(self) -> str:
        return "grpc"

__all__ = ("LoggingServiceV2GrpcTransport",)


text:
import com.azure.core.util.logging.ClientLogger;

public class DirectThrowExceptionTestData {
    private final ClientLogger logger = new ClientLogger(DirectThrowExceptionTestData.class);

    // Skip check on constructor
    DirectThrowExceptionTestData() {
        throw new RuntimeException("Error Messages.");
    }

    public void directThrowException () {
        throw new RuntimeException("Error Messages.");
    }

    public void correctThrowException() {
        throw logger.logExceptionAsWarning(Exceptions.propagate(new IllegalStateException("Error Messages")));
    }

    public static skipCheckOnStaticMethod() {
        throw new RuntimeException("Error Messages.");
    }

    // Skip check on static class
    static class SkipCheckOnStaticClass {
        public void directThrowException () {
            throw new RuntimeException("Error Messages.");
        }
    }

    public void validLogExceptionAsError() {
        throw logger.logExceptionAsError(new RuntimeException("Error message."));
    }

    public void validLogThrowableAsError() {
        throw logger.logThrowableAsError(new RuntimeException("Error message."));
    }

    public void validLogExceptionAsWarning() {
        throw logger.logExceptionAsWarning(new RuntimeException("Error message."));
    }

    public void validLogThrowableAsWarning() {
        throw logger.logThrowableAsWarning(new RuntimeException("Error message."));
    }
}

redpajama_set_name: RedPajamaGithub


text:
static String createCred(const char* id, const char* pass);
static String getJsessionid(String line);
static String getValidationkey(String line);
static int getStatusCode(String line);
static String buildMultipart(String boundary, FileInfo info);
static String createMetadata(FileInfo info, String Id);
static String getId(String line);
static String createGetBody(String Id);
static String getUrl(String line);
String sendMetadata(Session login, FileInfo file, String Id);
int saveFile(Session log, FileInfo file, String Id);

//do the login at onemediahub.com, get the jSessionid, validationkey and returns a number code 0, if the login is happened successfully, 1 failed to stabiliz connetion with the host
//2 username or password is wrong, 3 anexatly error in response from server
int doLogin(const char* username, const char* password, Session* login){
	WiFiClientSecure client;
	const char* host = "onemediahub.com";
	const int httpsPort = 443;
	if(!client.connect(host, httpsPort)){
		return SERVER_NOT_CONNECTED;
	}
	String user = createCred(username, password);
	String url = "/sapi/login?action=login";
	String request = "POST " + url + " HTTP/1.1\r\n" +
	           "Host: " + host + "\r\n" +
	           "Content-Type: application/x-www-form-urlencoded\r\n" +
	           "Content-Length: " + user.length() + "\r\n" +
	           "Connection: close\r\n" +
	           "\r\n"+

	           user;
	client.print(request);
	String line= "";
	String control = "p";
	while (client.connected()||(control!=line)) {
    control = line;
    line += client.readStringUntil('\n');
    if (line == "\r") {
      break;
    }
  }
  client.read();
  login->jsonid = getJsessionid(line);
  login->key = getValidationkey(line);
  if(login->jsonid == NULL){
  	return JSESSIONID_MISS;
  }
  if(login->key == NULL){
  	return AUTENTICATION_KEY_NOT_FOUND;
  }
  return getStatusCode(line);
}

int uploadBuffer(Session login, const char* buffer, long length){
	FileInfo file = {"NoName.txt", "text/plain", buffer, length};
	return uploadFile(login, file);
}

int uploadFile(Session login, FileInfo file){
	const char* host = "onemediahub.com";
	const int httpsPort = 443;
	WiFiClientSecure client;
	if(!client.connect(host, httpsPort)){
		return SERVER_NOT_CONNECTED;
	}
	String url = "/sapi/upload?action=save&validationkey=" + login.key;
	String boundary = "46w9f0apovnw23951faydgi";
	String body = buildMultipart(boundary,file);
 	String request = String("POST ") + url + " HTTP/1.1\r\n" + //rfc http 1.1
               "Host: " + host + "\r\n" +
               "Cookie: JSESSIONID=" + login.jsonid + "\r\n" +
               "Content-Type: multipart/form-data;boundary=" + boundary + "\r\n" +
               "Content-Length: " + body.length() + "\r\n" +
               "Connection: close" + "\r\n" +
               "\r\n"+

               body;
    client.print(request);
    String line= "";
    String control = "p";
    while ((control!=line)) {
	    control = line;
	    line += client.readStringUntil('\n');
	    if (line == "\r") {
	      break;
	    }
	}
    client.read();
	return getStatusCode(line);
}

int resumableUploadFile(Session login, FileInfo file){
	int statusCode;
	String Id = sendMetadata(login, file, "");
	if (Id != NULL){
		statusCode = saveFile(login, file, Id);
	}
	return statusCode;
}

String dowloadWithId(String Id, FileInfo* file, Session login){
	WiFiClientSecure client;
	const char* host = "onemediahub.com";
	const int httpsPort = 443;
	if(!client.connect(host, httpsPort)){
		return "no_server_connect";
	}
	String body = createGetBody(Id);
	String url = "/sapi/media?action=get&origin=omh&validationkey=" + login.key;
	String request = "POST " + url + " HTTP/1.1\r\n" +
	           "Host: " + host + "\r\n" +
	           "Cookie: JSESSIONID=" + login.jsonid + "\r\n" +
	           "Content-Type: application/json \r\n" +
	           "Content-Length: " + body.length() + "\r\n" +
	           "Connection: close\r\n" +
	           "\r\n"+

	           body;
	client.print(request);
	String line= "";
	String control = "p";
	while (client.connected()||(control!=line)) {
	    control = line;
	    line += client.readStringUntil('\n');
	    if (line == "\r") {
	      break;
	    }
	}
	client.read();
	return getUrl(line);
}

String fileGet(String url){
	WiFiClientSecure client;
	String request;
	const char* host = "onemediahub.com";
	const int httpsPort = 443;
	if(!client.connect(host, httpsPort)){
		return "no_server_connect";
	}
	request += String("GET ") + url + " HTTP/1.1\r\n" +
               "Host: " + host + "\r\n" +
               "Connection: close\r\n\r\n";
	client.print(request);
	String line= "";
	String control = "p";
	while (client.connected()&&(control!=line)) {
	    control = line;
	    line += client.readStringUntil('\0');
	}
    client.read();
    return line;
}

String fileContent(String line){
	String content;
	int a = 0;
	String token = "\r\n\r\n";
	int index = line.indexOf(token);
	index += token.length();
	return line.substring(index,line.length());
}

//create the login=username&password=account-infomation
static String createCred(const char* id, const char* pass){
  String login="login=";
  String e="&";
  String other="password=";
  String postData;
  postData = postData + login + id + e + other + pass;
  return postData;
}

static String getJsessionid(String line){
	String token = "\"jsessionid\":\"";
	int index = line.indexOf("\"jsessionid\":\"" );
	index += token.length();
	int endindex = line.indexOf("\"", index);
	return line.substring(index,endindex);
}

static String getValidationkey(String line){
	String token = "\"validationkey\":\"";
	int index = line.indexOf("\"validationkey\":\"" );
	index += token.length();
	int endindex = line.indexOf("\"", index);
	return line.substring(index,endindex);
}

String getUrl(String line){
	String token = "\"url\":\"";
	int index = line.indexOf("\"url\":\"" );
	index += token.length();
	int endindex = line.indexOf("\"", index);
	return line.substring(index,endindex);
}

int getStatusCode(String line){
	String token = "HTTP/1.1 ";
	token = line.substring(token.length(),(token.length()+3));
	switch(token.toInt()){
		case 200:
			return LOGIN_OK;
		break;
		case 401:
			return AUTENTICATION_FAILED;
		break;
		default:
			return GENERIC_ERROR;
		break;
	}
}

String buildMultipart(String boundary, FileInfo info){
	String multipart;
	multipart += "--" + boundary + "\r\n" +
				"Content-Disposition: form-data; name=\"data\"\r\n\r\n" +
				"{" +
				    "\"data\":{" +
						"\"name\":\"" + info.name + "\"," +
						"\"creationdate\":\""+ info.date + "\"," +
						"\"modificationdate\":\""+ info.date + "\"," +
						"\"contenttype\":\"" + info.type + "\"," +
						"\"size\":" + info.length + "," +
						"\"folderid\":-1" +
				    "}" +
				"}\r\n" +

              "--" + boundary + "\r\n" +
              "Content-Disposition: form-data; name=\"file\"; filename=\"" + info.name + "\"\r\n" +
			  "Content-Type: \"" + info.type + "\"\r\n\r\n" +
			  info.content + "\r\n" +
              "--" + boundary + "--";
  return multipart;
}

String sendMetadata(Session login, FileInfo file, String Id){
	WiFiClientSecure client;
	const char* host = "onemediahub.com";
	const int httpsPort = 443;
	if(!client.connect(host, httpsPort)){
		return "no log";
	}
	String url = "/sapi/upload/file?action=save-metadata&validationkey=" + login.key;
	String body = createMetadata(file, Id);
	String request = String("POST ") + url + " HTTP/1.1\r\n" +
               "Host: " + host + "\r\n" +
               "Cookie: JSESSIONID=" + login.jsonid + "\r\n" +
               "Content-Type: application/json\r\n" +
               "Content-Length: " + body.length() + "\r\n" +
               "Connection: close" + "\r\n" +
               "\r\n"+

               body;
    client.print(request);
    Serial.println(request);
    String line= "";
	String control = "p";
	while (client.connected()||(control!=line)) {
	    control = line;
	    line += client.readStringUntil('\n');
	    if (line == "\r") {
	      break;
	    }
	}
	client.read();
	Serial.println(line);
    return getId(line);
}

String createMetadata(FileInfo info, String Id){
	String metadata;
	metadata += "{";
	metadata +=     "\"data\":{";
	metadata +=         "\"name\":\"" + info.name + "\"," +
						Id +
						"\"creationdate\":\""+ info.date + "\"," +
						"\"modificationdate\":\""+ info.date + "\"," +
						"\"contenttype\":\"" + info.type + "\"," +
						"\"size\":" + info.length + "," +
						"\"folderid\":-1" +
				    "}" +
				"}";
	return metadata;
}

String getId(String line){
	String token = "\"id\":\"";
	int index = line.indexOf("\"id\":\"" );
	index += token.length();
	int endindex = line.indexOf("\"", index);
	return line.substring(index,endindex);
}

int saveFile(Session log, FileInfo file, String Id){
	WiFiClientSecure client;
	const char* host = "onemediahub.com";
	const int httpsPort = 443;
	if(!client.connect(host, httpsPort)){
		return SERVER_NOT_CONNECTED;
	}
	String url = "/sapi/upload/file?action=save&validationkey=" + log.key;
	String request = String("POST ") + url + " HTTP/1.1\r\n" +
               "Host: " + host + "\r\n" +
			   "x-funambol-id: " + Id + "\r\n" +
			   "x-funambol-file-size:" + file.content.length() + "\r\n" +
               "Cookie: JSESSIONID=" + log.jsonid + "\r\n" +
               "Content-Type: text/plain\r\n" +
               "Content-Length: " + file.content.length() + "\r\n" +
               "Connection: close" + "\r\n" +
               "\r\n"+

               file.content;
    client.print(request);
    Serial.print(request);
    String line= "";
    String control = "p";
    while ((control!=line)) {
	    control = line;
	    line += client.readStringUntil('\n');
	    if (line == "\r") {
	      break;
	    }
	}
    client.read();
    Serial.print(line);
    if(line.indexOf("\"MED-1000\"" )>0){
    	return 1000;
	}
    return 0;
}

String createGetBody(String Id){
	String request;
	request += 	    "{";
	request +=			"\"data\":{";
	request +=		    "\"ids\":[\"" +
					    	Id +
 					    "\"]," +
 					    "\"fields\":[" +
 					    	"\"url\"" +
						 "]" +
					  "}"+
					"}";
	return request;
}

void storageId(String Id){
	for(int a = 0; a < Id.length(); a++){
		EEPROM.write(a, Id[a]);
	}
	EEPROM.commit();
}

String readId(){
	char Id[20];
	int a = 0;
	Id[a] = EEPROM.read(a);
	while(int(Id[a]) != 0){
		a++;
		Id[a] = EEPROM.read(a);
	}
	return Id;
}


text:
package io.estatico.effect

/**
 * Type class for effects which support synchronous execution.
 *
 * For types F which are also an Applicative, this provides something similar to
 * Applicative#point, the difference being that Sync.now will create a new
 * synchronous effect instead of running the effect asynchronously, which is
 * generally what point does. From the standpoint of async operations, the Sync
 * type class can be an optimization to avoid spinning up new threads where unnecessary.
 */
trait Sync[F[_]] {
  /** Create a synchronous effect from a pure value. */
  def sync[A](a: A): F[A]
}

object Sync {
  def apply[F[_]](implicit ev: Sync[F]): Sync[F] = ev
}

object SyncFunctions extends SyncFunctions

trait SyncFunctions {
  /** Smart constructor for Sync effects. */
  def sync[F[_]]: SyncEffectBuilder[F] = SyncEffectBuilder.instance
}

final class SyncEffectBuilder[F[_]] private {
  def apply[A](a: A)(implicit ev: Sync[F]): F[A] = ev.sync(a)
}

object SyncEffectBuilder {

  def instance[F[_]]: SyncEffectBuilder[F] = _instance.asInstanceOf[SyncEffectBuilder[F]]

  private val _instance = new SyncEffectBuilder[Nothing]
}


text:
import axios from 'axios';
import { push } from 'react-router-redux';

import {
  GET_BOOKS_SUCCESS,
  GET_BOOKS_REQUEST,
  GET_BOOKS_FAILURE,
  GET_UPVOTED_BOOKS_SUCCESS,
  GET_UPVOTED_BOOKS_REQUEST,
  GET_UPVOTED_BOOKS_FAILURE,
  SEARCHING_BOOKS,
  SEARCH_BOOKS_SUCCESS,
  SEARCH_BOOKS_FAILURE,
  ADDING_BOOK,
  ADD_BOOK_SUCCESS,
  ADD_BOOK_FAILURE,
  EDIT_BOOK_SUCCESS,
  EDIT_BOOK_REQUEST,
  EDIT_BOOK_FAILURE,
  DELETE_BOOK_SUCCESS,
  DELETE_BOOK_REQUEST,
  DELETE_BOOK_FAILURE,
} from './types';

import checkError from '../helpers/checkError';
import setHeader from '../helpers/setHeader';
import { apiURL } from './signUp';
import Notify from '../helpers/Notify';

const getBooksRequest = () => ({
  type: GET_BOOKS_REQUEST,
});

const getBooksSuccess = ({ books, pagination }) => ({
  type: GET_BOOKS_SUCCESS,
  books,
  pagination,
});

const getBooksFailure = error => ({
  type: GET_BOOKS_FAILURE,
  error,
});

const getUpvotedBooksRequest = () => ({
  type: GET_UPVOTED_BOOKS_REQUEST,
});

const getUpvotedBooksSuccess = ({ books, pagination }) => ({
  type: GET_UPVOTED_BOOKS_SUCCESS,
  books,
  pagination,
});

const getUpvotedBooksFailure = error => ({
  type: GET_UPVOTED_BOOKS_FAILURE,
  error,
});

export const getBooks = page => (dispatch) => {
  dispatch(getBooksRequest());
  return axios.get(`${apiURL}/books/?page=${page}`)
    .then((response) => {
      dispatch(getBooksSuccess(response.data));
    })
    .catch((error) => {
      const errorMessage = checkError(error);
      dispatch(getBooksFailure(errorMessage));
    });
};

const addingBook = () => ({
  type: ADDING_BOOK,
});

const addBookSuccess = book => ({
  type: ADD_BOOK_SUCCESS,
  book,
});

const addBookFailure = () => ({
  type: ADD_BOOK_FAILURE,
});

export const addBook = book => (dispatch) => {
  dispatch(addingBook());
  setHeader();
  return axios.post(`${apiURL}/books`, book)
    .then((response) => {
      dispatch(addBookSuccess(response.data.bookEntry));
      Notify.notifySuccess('Book has been added');
      dispatch(push('/admin'));
    })
    .catch((error) => {
      const errorMessage = checkError(error);
      dispatch(addBookFailure());
      Notify.notifyError(`Error adding book. ${errorMessage}`);
    });
};

const searchingBooks = () => ({
  type: SEARCHING_BOOKS,
});

const searchBooksSuccess = ({ books, pagination }) => ({
  type: SEARCH_BOOKS_SUCCESS,
  books,
  pagination,
});

const searchBooksFailure = error => ({
  type: SEARCH_BOOKS_FAILURE,
  error,
});

export const searchBooks = (searchBy, searchParam) => (dispatch) => {
  dispatch(searchingBooks());
  return axios.post(`${apiURL}/books/search?${searchBy}=${searchParam}`)
    .then((response) => {
      dispatch(searchBooksSuccess(response.data));
      dispatch(push('/books'));
    })
    .catch((error) => {
      const errorMessage = checkError(error);
      dispatch(searchBooksFailure(errorMessage));
    });
};

const editingBook = () => ({
  type: EDIT_BOOK_REQUEST,
});

const editBookSuccess = (book, bookId) => ({
  type: EDIT_BOOK_SUCCESS,
  book,
  bookId,
});

const editBookFailure = () => ({
  type: EDIT_BOOK_FAILURE,
});

export const editBook = (bookId, book) => (dispatch) => {
  dispatch(editingBook());
  setHeader();
  return axios.put(`${apiURL}/books/${bookId}`, book)
    .then((response) => {
      dispatch(editBookSuccess(response.data.updatedBook, bookId));
      Notify.notifySuccess('Book has been updated');
    })
    .catch((error) => {
      const errorMessage = checkError(error);
      dispatch(editBookFailure());
      Notify.notifyError(`Error editing book. ${errorMessage}`);
    });
};

const deleteBookRequest = () => ({
  type: DELETE_BOOK_REQUEST,
});

const deleteBookSuccess = bookId => ({
  type: DELETE_BOOK_SUCCESS,
  bookId,
});

const deleteBookFailure = () => ({
  type: DELETE_BOOK_FAILURE,
});

export const deleteBook = bookId => (dispatch) => {
  dispatch(deleteBookRequest());
  setHeader();
  return axios.delete(`${apiURL}/books/${bookId}`)
    .then(() => {
      dispatch(deleteBookSuccess(bookId));
      Notify.notifySuccess('Book has been successfully deleted');
    })
    .catch((error) => {
      const errorMessage = checkError(error);
      dispatch(deleteBookFailure());
      Notify.notifyError(errorMessage);
    });
};

export const getMostUpvotedBooks = page => (dispatch) => {
  dispatch(getUpvotedBooksRequest());
  return axios
    .get(`${apiURL}/books?sort=upvotes&order=desc&page=${page}&limit=4`)
    .then((response) => {
      dispatch(getUpvotedBooksSuccess(response.data));
    })
    .catch((error) => {
      const errorMessage = checkError(error);
      dispatch(getUpvotedBooksFailure(errorMessage));
    });
};


text:
<?xml version="1.0" encoding="UTF-8"?>
<!--
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.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.mycompany</groupId>
  <artifactId>example</artifactId>
  <packaging>pom</packaging>
  <version>1.0-SNAPSHOT</version>
  <name>Example</name>
  <url>http://maven.apache.org</url>
  <modules>
    <module>module</module>
  </modules>
  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-checkstyle-plugin</artifactId>
        <version>@project.version@</version>
        <executions>
          <execution>
            <id>check</id>
            <phase>process-resources</phase>
            <goals>
              <goal>check</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <logViolationsToConsole>true</logViolationsToConsole>
          <checkstyleRules>
            <module name="Checker">
              <module name="TreeWalker">
                <module name="EmptyBlock"/>
              </module>
              <module name="FileTabCharacter">
                <property name="eachLine" value="true" />
              </module>
            </module>
          </checkstyleRules>
        </configuration>
      </plugin>
    </plugins>
  </build>
</project>


text:
<?xml version="1.0"?>
<doc>
    <assembly>
        <name>mindtouch.core</name>
    </assembly>
    <members>
        <member name="T:MindTouch.Dream.Http.HttpHandler">
            <summary>
            Provides an <see cref="T:System.Web.IHttpHandler"/> implementation to load Dream inside of IIS.
            </summary>
        </member>
        <member name="M:MindTouch.Dream.Http.HttpHandler.#ctor">
            <summary>
            Create new handler instance
            </summary>
        </member>
        <member name="M:MindTouch.Dream.CoreUtil.ExecuteAction(MindTouch.Dream.Plug,MindTouch.Dream.DreamHeaders,MindTouch.Xml.XDoc)">
            <summary>
            WARNING: This method is thread-blocking.  Please avoid using it if possible.
            </summary>
        </member>
        <member name="M:MindTouch.Dream.CoreUtil.ExecutePipe(MindTouch.Dream.Plug,MindTouch.Dream.DreamHeaders,MindTouch.Xml.XDoc)">
            <summary>
            WARNING: This method is thread-blocking.  Please avoid using it if possible.
            </summary>
        </member>
        <member name="T:MindTouch.Dream.DreamHost">
            <summary>
            Provides a hosting environment for <see cref="T:MindTouch.Dream.IDreamService"/> based services.
            </summary>
        </member>
        <member name="F:MindTouch.Dream.DreamHost.DEFAULT_PORT">
            <summary>
            Default dream host port: 8081
            </summary>
        </member>
        <member name="M:MindTouch.Dream.DreamHost.#ctor">
            <summary>
            Create a new host with default settings.
            </summary>
        </member>
        <member name="M:MindTouch.Dream.DreamHost.#ctor(MindTouch.Xml.XDoc)">
            <summary>
            Create a new host with provided configuration.
            </summary>
            <param name="config">Host configuration.</param>
        </member>
        <member name="M:MindTouch.Dream.DreamHost.#ctor(MindTouch.Xml.XDoc,Autofac.IContainer)">
            <summary>
            Create a new host with provided configuration and an Inversion of Control container.
            </summary>
            <remarks>
            The IoC container is also injected into default activator, so that <see cref="T:MindTouch.Dream.IDreamService"/> instances
            can be resolved from the container. The host configuration is provided to the container as a typed parameter.
            </remarks>
            <param name="config">Host configuration.</param>
            <param name="container">IoC Container.</param>
        </member>
        <member name="M:MindTouch.Dream.DreamHost.Finalize">
            <summary>
            Finalizer to clean-up an undisposed host.
            </summary>
        </member>
        <member name="M:MindTouch.Dream.DreamHost.RunScripts(MindTouch.Xml.XDoc,System.String)">
            <summary>
            Execute a set of scripts against the host.
            </summary>
            <remarks>
            This method is thread-blocking.  Please avoid using it if possible.
            </remarks>
            <param name="scripts">Scripts document.</param>
            <param name="path">Host path to post the scripts against.</param>
        </member>
        <member name="M:MindTouch.Dream.DreamHost.RunScript(MindTouch.Xml.XDoc,System.String)">
            <summary>
            Execute a script against the host.
            </summary>
            <remarks>
            This method is thread-blocking.  Please avoid using it if possible.
            </remarks>
            <param name="script">Script document.</param>
            <param name="path">Host path to post the script against.</param>
        </member>
        <member name="M:MindTouch.Dream.DreamHost.WaitUntilShutdown">
            <summary>
            Block the current thread until the host shuts down.
            </summary>
            <remarks>
            This call does not initiate a shut down.
            </remarks>
        </member>
        <member name="M:MindTouch.Dream.DreamHost.AddActivityDescription(System.Object,System.String)">
            <summary>
            Add a host activity.
            </summary>
            <param name="key">Activity key.</param>
            <param name="description">Description of activity.</param>
        </member>
        <member name="M:MindTouch.Dream.DreamHost.RemoveActivityDescription(System.Object)">
            <summary>
            Remove a host activity.
            </summary>
            <param name="key">Activity key.</param>
        </member>
        <member name="M:MindTouch.Dream.DreamHost.UpdateInfoMessage(System.String,System.String)">
            <summary>
            Update the host's info message.
            </summary>
            <param name="source">Message source.</param>
            <param name="message">Info message.</param>
        </member>
        <member name="M:MindTouch.Dream.DreamHost.Dispose">
            <summary>
            Shut down and clean up the host's resources.
            </summary>
        </member>
        <member name="P:MindTouch.Dream.DreamHost.Self">
            <summary>
            Http location of host <see cref="T:MindTouch.Dream.IDreamService"/>.
            </summary>
        </member>
        <member name="P:MindTouch.Dream.DreamHost.GlobalId">
            <summary>
            Global Id used for local:// uri's
            </summary>
        </member>
        <member name="P:MindTouch.Dream.DreamHost.IsRunning">
            <summary>
            <see langword="True"/> if the host is running.
            </summary>
        </member>
        <member name="P:MindTouch.Dream.DreamHost.LocalMachineUri">
            <summary>
            Root local:// uri for this host.
            </summary>
        </member>
        <member name="P:MindTouch.Dream.DreamHost.ActivityMessages">
            <summary>
            Current host activity.
            </summary>
        </member>
        <member name="T:MindTouch.Dream.IServiceActivator">
            <summary>
            Provides a mechanism for instantiating <see cref="T:MindTouch.Dream.IDreamService"/> instances.
            </summary>
        </member>
        <member name="M:MindTouch.Dream.IServiceActivator.Create(MindTouch.Xml.XDoc,System.Type)">
            <summary>
            Create a new <see cref="T:MindTouch.Dream.IDreamService"/> instance.
            </summary>
            <param name="config">Service configuration that will later be used to initialize the instance.</param>
            <param name="type">Type of the <see cref="T:MindTouch.Dream.IDreamService"/> implemntor to instantiate.</param>
            <returns>A service instance.</returns>
        </member>
    </members>
</doc>


text:
A cleverbot wrapper for .NET 4.6.1+ and .NET Core (targets .NET Standard 1.6).

## How to set up?
First, get an api key from http://www.cleverbot.com/api/ to be able to create a instance of
Cleverbot. To further set up Cleverbot.Net, download it from the nuget package manager.

>Install-Package Cleverbot

Once you've installed Cleverbot.Net in your C# project. Include the new header `using Cleverbot.Net;`

## Sample code

Asynchronous sample
```csharp
// Let's say we are in a thread
CleverbotSession cleverbot = new CleverbotSession("api-key-here");
Label1.Text = "Cleverbot is typing...";
CleverbotResponse r = await cleverbot.GetResponseAsync("Hello!");
Label1.Text = r.Response;
```

Synchronous sample
```Csharp
CleverbotSession cleverbot = new CleverbotSession("api-key-here");
CleverbotResponse r = cleverbot.GetResponse("Hello!");
Console.WriteLine(r.Response);
```


text:
namespace OpenStack.Services.Identity.V2
{
    /// <summary>
    /// This class serves as the base class for all service extension definitions for the
    /// <see cref="IIdentityService"/>.
    /// </summary>
    /// <typeparam name="TExtension">The service extension type.</typeparam>
    /// <seealso cref="IExtensibleService{TService}.GetServiceExtension{TExtension}"/>
    /// <threadsafety static="true" instance="false"/>
    /// <preliminary/>
    public abstract class IdentityServiceExtensionDefinition<TExtension> : ServiceExtensionDefinition<IIdentityService, TExtension>
    {
    }
}


text:
package nndb

import "fmt"

// Models representing data sourced from the National Nutrient Database

// Food represents a food item
// TODO: Add Measurements
type Food struct {
	ID            int           `json:"id"`
	Name          string        `json:"name"`
	AlternateName string        `json:"alt_name"`
	Manufacturer  string        `json:"manufacturer"`
	FoodGroup     FoodGroup     `json:"food_group"`
	Nutrients     Nutrients     `json:"nutrients"`
	Measurements  []Measurement `json:"measurements"`
}

func (f Food) String() string {
	return fmt.Sprintf("Food {ID: %v Name: %v, AltName: %v, Manufacturer: %v, %v, %v, %v}", f.ID, f.Name, strOrDefault(f.AlternateName, "n/a"), strOrDefault(f.Manufacturer, "n/a"), f.FoodGroup, f.Nutrients, f.Measurements)
}

// FoodGroup represents a food group, such as `Cereal Grains and Pasta`
type FoodGroup struct {
	ID   int    `json:"id"`
	Name string `json:"name"`
}

func (fg FoodGroup) String() string {
	return fmt.Sprintf("FoodGroup {ID: %v Name: %v}", fg.ID, fg.Name)
}

// Nutrients represents the nutritional information, such as `Calories` per 100g.  All values in g other than kCal.
type Nutrients struct {
	Calories float64 `json:"calories"`
	Fat      float64 `json:"fat"`
	Sugar    float64 `json:"sugar"`
	Protein  float64 `json:"protein"`
	Fiber    float64 `json:"fiber"`
}

func (n Nutrients) String() string {
	return fmt.Sprintf("Nutrients {Calories: %.2f kCal, Fat: %.2fg, Sugar: %.2fg, Protein: %.2fg, Fiber: %.2fg}", n.Calories, n.Fat, n.Sugar, n.Protein, n.Fiber)
}

// Measurement represents the number of grams of weight that common measurements have (per Food)
type Measurement struct {
	Amount float64 `json:"amount"`
	Unit   string  `json:"unit"`
	Weight float64 `json:"weight"`
}

func (m Measurement) String() string {
	return fmt.Sprintf("Measurements {Amount: %.2f, Unit: %v, Weight: %.2f}", m.Amount, m.Unit, m.Weight)
}

func strOrDefault(s string, def string) string {
	if s == "" {
		return def
	}
	return s
}


text: A very simple SCRUM project manager for daily use.


text:
package org.apache.predictionio.core

import org.apache.predictionio.annotation.DeveloperApi
import org.apache.predictionio.annotation.Experimental
import org.apache.predictionio.controller.EngineParams
import org.apache.predictionio.controller.Evaluation
import org.apache.predictionio.workflow.WorkflowParams
import org.apache.spark.SparkContext
import org.apache.spark.rdd.RDD

/** :: DeveloperApi ::
  * Base class of all evaluator controller classes
  *
  * @tparam EI Evaluation information class
  * @tparam Q Query class
  * @tparam P Predicted result class
  * @tparam A Actual result class
  * @tparam ER Evaluation result class
  */
@DeveloperApi
abstract class BaseEvaluator[EI, Q, P, A, ER <: BaseEvaluatorResult]
  extends AbstractDoer {
  /** :: DeveloperApi ::
    * Engine developers should not use this directly. This is called by
    * evaluation workflow to perform evaluation.
    *
    * @param sc Spark context
    * @param evaluation Evaluation to run
    * @param engineEvalDataSet Sets of engine parameters and data for evaluation
    * @param params Evaluation workflow parameters
    * @return Evaluation result
    */
  @DeveloperApi
  def evaluateBase(
    sc: SparkContext,
    evaluation: Evaluation,
    engineEvalDataSet: Seq[(EngineParams, Seq[(EI, RDD[(Q, P, A)])])],
    params: WorkflowParams): ER
}

/** Base trait of evaluator result */
trait BaseEvaluatorResult extends Serializable {
  /** A short description of the result */
  def toOneLiner(): String = ""

  /** HTML portion of the rendered evaluator results */
  def toHTML(): String = ""

  /** JSON portion of the rendered evaluator results */
  def toJSON(): String = ""

  /** :: Experimental ::
    * Indicate if this result is inserted into database
    */
  @Experimental
  val noSave: Boolean = false
}


text:
package org.support.project.knowledge.logic;

import java.util.HashMap;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import org.support.project.di.Container;
import org.support.project.di.DI;
import org.support.project.di.Instance;

@DI(instance = Instance.Singleton)
public class KeywordLogic {
    public static final Map<String, String> REGEX_LIST = new HashMap<String, String>();

    static {
        REGEX_LIST.put("groups", "(?:groups: *\\((?<groups>[^)]+)\\))");
        REGEX_LIST.put("tags", "(?:tags: *\\((?<tags>[^)]+)\\))");
    }

    public static KeywordLogic get() {
        return Container.getComp(KeywordLogic.class);
    }

    /**
     * 文字列を指定の検索クエリでパースして検索クエリの内容を返す
     *
     * @param key
     * @param text
     * @return String
     */
    public String parseQuery(String key, String text) {
        Pattern pattern = Pattern.compile(REGEX_LIST.get(key));
        Matcher matcher = pattern.matcher(text);

        if (!matcher.find()) {
            return null;
        }
        return matcher.group(key).replaceAll(", *", ",");
    }

    /**
     * 文字列をパースしてキーワードを返す
     *
     * @param text
     * @return String
     */
    public String parseKeyword(String text) {
        String parsedText = text.replaceAll(KeywordLogic.REGEX_LIST.get("groups"), "");
        parsedText = parsedText.replaceAll(KeywordLogic.REGEX_LIST.get("tags"), "");
        return parsedText.trim();
    }

    /**
     * グループのクエリにして返す
     *
     * @param groupName
     * @return
     */
    public String toGroupsQuery(String groupName) {
        return String.format("groups: (%s) ", groupName);
    }

    /**
     * タグのクエリにして返す
     *
     * @param tagName
     * @return
     */
    public String toTagsQuery(String tagName) {
        return String.format("tags: (%s) ", tagName);
    }
}


text:
'use strict';

module.exports = {
  Client: require('./client'),
  Worker: require('./worker')
};


text:
package com.domain.web;

import java.net.MalformedURLException;
import java.net.URL;
import java.util.Map;

import com.domain.base.Content;

/**
 * @author justburrow
 * @since 2017. 4. 1.
 */
public interface Page extends WebObject {
  /**
   * @return
   */
  Site getSite();

  /**
   * @return URL pattern.
   */
  String getPath();

  /**
   * @return
   */
  default URL getUrl() {
    URL siteUrl = getSite().getUrl();
    try {
      return new URL(siteUrl.getProtocol(), siteUrl.getHost(), getPath());
    } catch (MalformedURLException e) {
      throw new RuntimeException(e);
    }
  }

  /**
   * @param path
   *          URL pattern.
   */
  void setPath(String path);

  /**
   * @return
   */
  String getTitle();

  /**
   * @param title
   */
  void setTitle(String title);

  /**
   * @return
   */
  Layout getLayout();

  /**
   * @param layout
   */
  void setLayout(Layout layout);

  /**
   * @return
   */
  Map<String, Content> getContents();

  /**
   * @param name
   * @return
   */
  Content getContent(String name);

  /**
   * @param name
   * @param content
   * @return
   */
  Content setContent(String name, Content content);
}


text:
import {Permission} from '@influxdata/influx'
import {get} from 'lodash'

export const permissions = (
  permissions: Permission[]
): {[x: string]: Permission.ActionEnum[]} => {
  const p = permissions.reduce((acc, {action, resource}) => {
    const {type} = resource
    const name = get(resource, 'name', '')
    let key = `${type}`
    if (name) {
      key = `${type}-${name}`
    }

    let actions = get(acc, key, [])

    if (name && actions) {
      return {...acc, [key]: [...actions, action]}
    }

    actions = get(acc, key || resource.type, [])
    return {...acc, [type]: [...actions, action]}
  }, {})
  return p
}


text:
package org.apache.geode.distributed.internal.tcpserver;

import org.apache.geode.internal.serialization.BasicSerializable;

/**
 * A response from the TCP server that it received a ShutdownRequest
 *
 * @see TcpClient#requestToServer(HostAndPort, Object, int)
 * @see ShutdownRequest
 * @since GemFire 5.7
 */
public class ShutdownResponse implements BasicSerializable {
}


text:
import * as firebaseui from "firebaseui";
import AuthUI from "../../containers/AuthUI/AuthUI";
import Page from "material-ui-shell/lib/containers/Page/Page";
import React from "react";
import { Helmet } from "react-helmet";
import { useConfig } from "base-shell/lib/providers/Config";
import { useIntl } from "react-intl";
import { useMenu } from "material-ui-shell/lib/providers/Menu";
import { useNavigate, useLocation } from "react-router-dom";

const SignIn = () => {
  const intl = useIntl();
  const { appConfig } = useConfig();
  const { firebase = {}, auth } = appConfig || {};
  const { redirectTo = "/" } = auth || {};
  const { firebaseuiProps = {} } = firebase;
  const { toggleThis } = useMenu();
  let navigate = useNavigate();
  let location = useLocation();
  let from = new URLSearchParams(location.search).get("from") || redirectTo;

  const uiConfig = {
    signInSuccessUrl: from,
    signInFlow: "popup",
    callbacks: {
      signInSuccessWithAuthResult: () => {
        toggleThis("isAuthMenuOpen", false);
        // To avoid page reload on single page applications
        return false;
      },
    },
    credentialHelper: firebaseui.auth.CredentialHelper.NONE,
    ...firebaseuiProps,
  };

  return (
    <Page pageTitle={intl.formatMessage({ id: "sign_in" })}>
      <Helmet>
        <link
          type="text/css"
          rel="stylesheet"
          href="https://www.gstatic.com/firebasejs/ui/4.6.1/firebase-ui-auth.css"
        />
      </Helmet>
      <AuthUI uiConfig={uiConfig} />
    </Page>
  );
};

export default SignIn;


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using HTLib2;
using HTLib2.Bioinfo;

namespace HTLib2.Bioinfo
{
    public partial class Coarse
    {
        public static partial class CoarseHessForcExt
        {
            public static Tuple<int[], int[][]> GetIdxKeepListRemv_RemoveHOH
                ( object[] atoms
                , Vector[] coords
                , int box_size // = 20 A (default)
                )
            {
                Tinker.Xyz.Atom[] xyzatoms = atoms as Tinker.Xyz.Atom[];
                Dictionary<Tinker.Xyz.Atom, int> xyzatom_idx = xyzatoms.HToDictionaryAsValueIndex();
                Dictionary<int, Tinker.Xyz.Atom> ID_xyzatom = xyzatoms.ToIdDictionary();

                //////////////////////////////////////////////////////////////////////////////////////////////
                // 1. find left bottom corner of solvent sphere
                Vector center = coords.Average();
                Vector min    = new double[]{ double.PositiveInfinity, double.PositiveInfinity, double.PositiveInfinity };
                double radius = 0;
                foreach(var coord in coords)
                {
                    radius = Math.Max(radius, (center - coord).Dist);
                    min[0] = Math.Min(min[0], coord[0]);
                    min[1] = Math.Min(min[1], coord[1]);
                    min[2] = Math.Min(min[2], coord[2]);
                }

                //////////////////////////////////////////////////////////////////////////////////////////////
                // 2. determine protein and solvent atoms
                HashSet<Tinker.Xyz.Atom> solv = new HashSet<Tinker.Xyz.Atom>();
                foreach(var xyzatom in xyzatoms)
                {
                    if(xyzatom.AtomType == "OT ")
                    {
                        solv.Add(xyzatom);
                        HDebug.Assert(xyzatom.BondedIds.Length == 2);
                        foreach(var ID in xyzatom.BondedIds)
                        {
                            var hydrogen = ID_xyzatom[ID];
                            solv.Add(hydrogen);
                        }
                    }
                }
                HashSet<Tinker.Xyz.Atom> prot = xyzatoms.HSetDiff(solv).HToHashSet();
                HDebug.Assert(xyzatoms.Length == prot.Count + solv.Count);

                //////////////////////////////////////////////////////////////////////////////////////////////
                // 3. put solvent atoms in blocks whose size is box_size x box_size x box_size
                //
                // bx_by_bz_atoms[i,j,k] is the (i-th, j-th, k-th) box that contains solvent atoms within the box
                HDictionary3<int, int, int, HashSet<Tinker.Xyz.Atom>> bx_by_bz_atoms = new HDictionary3<int, int, int, HashSet<Tinker.Xyz.Atom>>();
                int maxbx = 0;
                int maxby = 0;
                int maxbz = 0;
                foreach(var atom in solv)
                {
                    if(atom.AtomType == "OT ")
                    {
                        //int box_size = 20;
                        int bx = (int)(atom.X - min[0]) / box_size; HDebug.Assert(bx >= 0); maxbx = Math.Max(maxbx, bx);
                        int by = (int)(atom.Y - min[1]) / box_size; HDebug.Assert(by >= 0); maxby = Math.Max(maxby, by);
                        int bz = (int)(atom.Z - min[2]) / box_size; HDebug.Assert(bz >= 0); maxbz = Math.Max(maxbz, bz);
                        if(bx_by_bz_atoms.ContainsKey(bx, by, bz) == false)
                            bx_by_bz_atoms.Add(bx, by, bz, new HashSet<Tinker.Xyz.Atom>());

                        var blk_atoms = bx_by_bz_atoms[bx, by, bz];
                        blk_atoms.Add(atom);
                        foreach(var ID in atom.BondedIds)
                        {
                            var hydrogen = ID_xyzatom[ID];
                            blk_atoms.Add(hydrogen);
                        }
                    }
                }

                //////////////////////////////////////////////////////////////////////////////////////////////
                // 3. put protein atom indices into idxProt
                //    and solvent atom indices of each box into idxListRemv.
                //    idxListRemv[k-1] is the first atoms to be removed
                //    idxListRemv[k-2] is the second atoms to be removed
                //    ..
                //    idxListRemv[  1] is the last second atoms to be removed
                //    idxListRemv[  0] is the last atoms to be removed
                List<int[]> idxListRemv = new List<int[]>();
                List<int>   idxProt = new List<int>();
                {
                    foreach(var atom in prot)
                    {
                        int idx = xyzatom_idx[atom];
                        idxProt.Add(idx);
                    }
                    int count = 0;
                    for(int bx=0; bx<=maxbx; bx++)
                        for(int by=0; by<=maxby; by++)
                            for(int bz=0; bz<=maxbz; bz++)
                            {
                                if(bx_by_bz_atoms.ContainsKey(bx, by, bz) == true)
                                {
                                    List<int> idxRemv = new List<int>();
                                    var blk_atoms = bx_by_bz_atoms[bx, by, bz];
                                    foreach(var atom in blk_atoms)
                                    {
                                        int idx = xyzatom_idx[atom];
                                        idxRemv.Add(idx);
                                        count++;
                                    }
                                    idxListRemv.Insert(0, idxRemv.ToArray());
                                }
                            }
                }

                //////////////////////////////////////////////////////////////////////////////////////////////
                // 4. return indices of atoms to keep (protein)
                //       and a set of indices of atoms to remove iteratively (waters)
                return new Tuple<int[], int[][]>
                    ( idxProt.ToArray()
                    , idxListRemv.ToArray()
                    );
            }
        }
    }
}


text:
package org.nalloc.bitb.kcits.sandbox.memoryusage

import java.util.Random
import org.nalloc.bitb.kcits.optional.OptionalLong
import scala.annotation.switch

object GetOrElseMemoryUsage extends MemoryUsageApp {
  protected def passes = 25
  private[this] val passes_ = passes
  private[this] val iterations = 1e7.toInt
  private[this] val random = new Random
  private[this] val seedValues = (1 to iterations).map(_ => random.nextLong()).toArray
  private[this] val seedValuesReverse = seedValues.reverse

  private[this] val customOptionValues = new Array[Long](passes)

  forceGc()
  touchCode()
  forceGc()
  Thread.sleep(1000)
  forceGc()
  private[this] var i = 0
  while (i < passes_) {
    forceGc()
    runCustomOptionsTest(i)
    i += 1
  }

  println(customOptionValues.sum)
  dumpMemoryStats()

  private def touchCode() {
    seedValues(0) match {
      case OptionalLong(x) => println(s"Seed Values first entry is $x")
      case _               =>
    }

    seedValuesReverse(0) match {
      case OptionalLong(x) => println(s"Seed Values Reverse first entry is $x")
      case _               =>
    }

    Long.MinValue match {
      case OptionalLong(x) => sys.error("Sentinel value unapplied")
      case _               =>
    }

    if (OptionalLong(10).getOrElse(15) != 10) sys.error("")
    if (customOptionValues(0) != 0) sys.error("")
    initMemory()
  }

  def runCustomOptionsTest(pass: Int) {
    var i = 0
    var sum = 0L
    val limit = iterations
    recordMemoryBefore(pass)
    while (i < limit) {
      val optional = (pass % 2: @switch) match {
        case 0 => seedValues(i)
        case 1 => seedValuesReverse(i)
      }

      sum += OptionalLong(optional).getOrElse(i)

      i += 1
    }
    customOptionValues(pass) = sum
    recordMemoryAfter(pass)
  }
}


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <title>Struct AsyncAwaiter
   | Asynchronous Operations for Unity </title>
    <meta name="viewport" content="width=device-width">
    <meta name="title" content="Struct AsyncAwaiter
   | Asynchronous Operations for Unity ">
    <meta name="generator" content="docfx 2.31.0.0">

    <link rel="shortcut icon" href="../../favicon.ico">
    <link rel="stylesheet" href="../../styles/docfx.vendor.css">
    <link rel="stylesheet" href="../../styles/docfx.css">
    <link rel="stylesheet" href="../../styles/main.css">
    <meta property="docfx:navrel" content="../../toc.html">
    <meta property="docfx:tocrel" content="../toc.html">

              <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar">
                Toggle navigation

              </button>

              <form class="navbar-form navbar-right" role="search" id="search">

                  <input type="text" class="form-control" id="search-query" placeholder="Search" autocomplete="off">

              </form>

          Show / Hide Table of Contents

Struct AsyncAwaiter

Provides an object that waits for the completion of an asynchronous operation. This type and its members are intended for compiler use only.

Implements

INotifyCompletion

Inherited Members

      System.ValueType.Equals(System.Object)

      System.ValueType.GetHashCode()

      System.ValueType.ToString()

      System.Object.Equals(System.Object, System.Object)

      System.Object.GetType()

      System.Object.ReferenceEquals(System.Object, System.Object)

Namespace: UnityFx.Async.CompilerServices

Assembly: UnityFx.Async-netstandard2.0.dll

Syntax

public struct AsyncAwaiter : INotifyCompletion

Constructors

    |
    Improve this Doc

    View Source

AsyncAwaiter(IAsyncOperation)

Initializes a new instance of the AsyncAwaiter struct.

Declaration

public AsyncAwaiter(IAsyncOperation op)

Parameters

        Type
        Name
        Description

        IAsyncOperation
        op

    |
    <a href="https://github.com/Arvtesh/UnityFx.Async/new/master/apiSpec/new?filename=UnityFx_Async_CompilerServices_AsyncAwaiter__ctor_UnityFx_Async_IAsyncOperation_System_Threading_SynchronizationContext_.md&value=---%0Auid%3A%20UnityFx.Async.CompilerServices.AsyncAwaiter.%23ctor(UnityFx.Async.IAsyncOperation%2CSystem.Threading.SynchronizationContext)%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc

    View Source

AsyncAwaiter(IAsyncOperation, SynchronizationContext)

Initializes a new instance of the AsyncAwaiter struct.

Declaration

public AsyncAwaiter(IAsyncOperation op, SynchronizationContext syncContext)

Parameters

        Type
        Name
        Description

        IAsyncOperation
        op

        SynchronizationContext
        syncContext

Properties

    |
    Improve this Doc

    View Source

IsCompleted

Gets a value indicating whether the underlying operation is completed.

Declaration

public bool IsCompleted { get; }

Property Value

        Type
        Description

        Boolean

The operation completion flag.

Methods

    |
    Improve this Doc

    View Source

GetResult()

Returns the source result value.

Declaration

public void GetResult()

    |
    Improve this Doc

    View Source

OnCompleted(Action)

Declaration

public void OnCompleted(Action continuation)

Parameters

        Type
        Name
        Description

        Action
        continuation

Implements

      System.Runtime.CompilerServices.INotifyCompletion

See Also

IAsyncOperation

                    Improve this Doc

                    View Source

              Back to top

            Copyright (c) 2017-2018 Alexander Bogarsukov


text:
/**
 * This package contains classes to run metrics processor and metrics query server.
 */
package co.cask.cdap.metrics.runtime;


text:
-----------------------------------------------------------------------------
-- VORTEX DDL $Id$
-- XXX: This file is outdated
-----------------------------------------------------------------------------

-----------------------------------------------------------------------------
-- resource
-----------------------------------------------------------------------------

DROP SEQUENCE vortex_resource_seq_pk;

CREATE SEQUENCE vortex_resource_seq_pk INCREMENT 1 START 1000;

DROP TABLE vortex_resource CASCADE;

CREATE TABLE vortex_resource
(
    resource_id int NOT NULL,
    uri VARCHAR (2048) NOT NULL,
    creation_time TIMESTAMP NOT NULL,
    last_modified TIMESTAMP NOT NULL,
    modified_by VARCHAR (64) NOT NULL,
    resource_owner VARCHAR (64) NOT NULL,
    display_name VARCHAR (128) NULL,
    content_language VARCHAR (64) NULL,
    content_type VARCHAR (64) NULL,
    is_collection CHAR(1) DEFAULT 'N' NOT NULL,
    acl_inherited CHAR(1) DEFAULT 'Y' NOT NULL,
    CONSTRAINT resource_uri_index UNIQUE (uri)
);

ALTER TABLE vortex_resource
    ADD CONSTRAINT vortex_resource_PK
PRIMARY KEY (resource_id);

-----------------------------------------------------------------------------
-- parent_child
-----------------------------------------------------------------------------
DROP SEQUENCE parent_child_seq_pk;

CREATE SEQUENCE parent_child_seq_pk INCREMENT 1 START 1000;

DROP TABLE parent_child CASCADE;

CREATE TABLE parent_child
(
    parent_child_id int NOT NULL,
    parent_resource_id int NOT NULL,
    child_resource_id int NOT NULL,
    CONSTRAINT parent_child_unique1_index UNIQUE (parent_resource_id, child_resource_id)
);

ALTER TABLE parent_child
    ADD CONSTRAINT parent_child_PK
PRIMARY KEY (parent_child_id);

ALTER TABLE parent_child
    ADD CONSTRAINT parent_child_FK_1 FOREIGN KEY (parent_resource_id)
    REFERENCES vortex_resource (resource_id)
;

ALTER TABLE parent_child
    ADD CONSTRAINT parent_child_FK_2 FOREIGN KEY (child_resource_id)
    REFERENCES vortex_resource (resource_id)
;

-----------------------------------------------------------------------------
-- lock_type
-----------------------------------------------------------------------------
DROP TABLE lock_type CASCADE;

CREATE TABLE lock_type
(
    lock_type_id int NOT NULL,
    name VARCHAR (64) NOT NULL
);

ALTER TABLE lock_type
    ADD CONSTRAINT lock_type_PK
PRIMARY KEY (lock_type_id);

-----------------------------------------------------------------------------
-- lock
-----------------------------------------------------------------------------
DROP SEQUENCE vortex_lock_seq_pk;

CREATE SEQUENCE vortex_lock_seq_pk INCREMENT 1 START 1000;

DROP TABLE vortex_lock CASCADE;

CREATE TABLE vortex_lock
(
    lock_id int NOT NULL,
    resource_id int NOT NULL,
    token VARCHAR (128) NOT NULL,
    lock_type_id int NOT NULL,
    lock_owner VARCHAR (128) NOT NULL,
    lock_owner_info VARCHAR (128) NOT NULL,
    depth CHAR (1) DEFAULT '1' NOT NULL,
    timeout TIMESTAMP NOT NULL
);

ALTER TABLE vortex_lock
    ADD CONSTRAINT vortex_lock_PK
PRIMARY KEY (lock_id);

ALTER TABLE vortex_lock
    ADD CONSTRAINT vortex_lock_FK_1 FOREIGN KEY (resource_id)
    REFERENCES vortex_resource (resource_id)
;

ALTER TABLE vortex_lock
    ADD CONSTRAINT vortex_lock_FK_2 FOREIGN KEY (lock_type_id)
    REFERENCES lock_type (lock_type_id)
;

CREATE INDEX vortex_lock_index1 ON vortex_lock(resource_id);

-----------------------------------------------------------------------------
-- action_type
-----------------------------------------------------------------------------
DROP TABLE action_type CASCADE;

CREATE TABLE action_type
(
    action_type_id int NOT NULL,
    namespace VARCHAR (64) NOT NULL,
    name VARCHAR (64) NOT NULL
);

ALTER TABLE action_type
    ADD CONSTRAINT action_type_PK
PRIMARY KEY (action_type_id);

-----------------------------------------------------------------------------
-- acl_entry
-----------------------------------------------------------------------------
DROP SEQUENCE acl_entry_seq_pk;

CREATE SEQUENCE acl_entry_seq_pk INCREMENT 1 START 1000;

DROP TABLE acl_entry CASCADE;

CREATE TABLE acl_entry
(
    acl_entry_id int NOT NULL,
    resource_id int NOT NULL,
    action_type_id int NOT NULL,
    user_or_group_name VARCHAR (64) NOT NULL,
    is_user CHAR (1) DEFAULT 'Y' NOT NULL,
    granted_by_user_name VARCHAR (64) NOT NULL,
    granted_date TIMESTAMP NOT NULL
);

ALTER TABLE acl_entry
    ADD CONSTRAINT acl_entry_PK
PRIMARY KEY (acl_entry_id);

ALTER TABLE acl_entry
    ADD CONSTRAINT acl_entry_FK_1 FOREIGN KEY (resource_id)
    REFERENCES vortex_resource (resource_id)
;

ALTER TABLE acl_entry
    ADD CONSTRAINT acl_entry_FK_2 FOREIGN KEY (action_type_id)
    REFERENCES action_type (action_type_id)
;

CREATE INDEX acl_entry_index1 ON acl_entry(resource_id);

-----------------------------------------------------------------------------
-- extra_prop_entry
-----------------------------------------------------------------------------
DROP SEQUENCE extra_prop_entry_seq_pk;

CREATE SEQUENCE extra_prop_entry_seq_pk INCREMENT 1 START 1000;

DROP TABLE extra_prop_entry CASCADE;

CREATE TABLE extra_prop_entry
(
    extra_prop_entry_id int NOT NULL,
    resource_id int NOT NULL,
    prop_type_id number default 0 not null,
    name_space VARCHAR (128) NOT NULL,
    name VARCHAR (64) NOT NULL,
    value VARCHAR (2048) NOT NULL,
    binary_content BLOB,
    binary_mimetype varchar2 (64)
);

ALTER TABLE extra_prop_entry
    ADD CONSTRAINT extra_prop_entry_PK
PRIMARY KEY (extra_prop_entry_id);

ALTER TABLE extra_prop_entry
    ADD CONSTRAINT extra_prop_entry_FK_1 FOREIGN KEY (resource_id)
    REFERENCES vortex_resource (resource_id)
;

CREATE INDEX extra_prop_entry_index1 ON extra_prop_entry(resource_id);

-----------------------------------------------------------------------------
-- changelog_entry
-----------------------------------------------------------------------------
DROP SEQUENCE changelog_entry_seq_pk;

CREATE SEQUENCE changelog_entry_seq_pk INCREMENT BY 1 START WITH 1000;

DROP TABLE changelog_entry CASCADE CONSTRAINTS;

/* The attribute 'uri' can't be longer that 1578 chars (OS-dependent?).     */
/* If bigger -> "ORA-01450: maximum key length exceeded" (caused by index). */
/* Since combined index '(uri, changelog_entry_id)' -> 1500 chars.          */

CREATE TABLE changelog_entry
(
    changelog_entry_id NUMBER NOT NULL,
    logger_id NUMBER NOT NULL,
    logger_type NUMBER NOT NULL,
    operation VARCHAR2 (128) NULL,
    timestamp DATE NOT NULL,
    uri NVARCHAR2 (1500) NOT NULL
);

ALTER TABLE changelog_entry
    ADD CONSTRAINT changelog_entry_PK
PRIMARY KEY (changelog_entry_id);

DROP INDEX changelog_entry_index1;

CREATE UNIQUE INDEX changelog_entry_index1
    ON changelog_entry (uri, changelog_entry_id);

-----------------------------------------------------------------------------
-- initial application data
-----------------------------------------------------------------------------

INSERT INTO action_type (action_type_id, namespace, name) VALUES (1, 'dav', 'read');
INSERT INTO action_type (action_type_id, namespace, name) VALUES (2, 'dav', 'write');
INSERT INTO action_type (action_type_id, namespace, name) VALUES (3, 'dav', 'write-acl');
INSERT INTO action_type (action_type_id, namespace, name) VALUES (4, 'uio', 'read-processed');

INSERT INTO LOCK_TYPE (lock_type_id, name)
VALUES (1, 'EXCLUSIVE_WRITE');

-- root resource

INSERT INTO VORTEX_RESOURCE (
    resource_id,
    uri,
    creation_time,
    last_modified,
    modified_by,
    resource_owner,
    display_name,
    content_language,
    content_type,
    is_collection,
    acl_inherited)
VALUES (
    nextval('vortex_resource_seq_pk'),
    '/',
    current_timestamp,
    current_timestamp,
    'vortex',
    'vortex',
    '/',
    null,
    'application/x-vortex-collection',
    'Y',
    'N'
);

-- (dav:authenticated (dav:read))

INSERT INTO ACL_ENTRY (
    acl_entry_id,
    resource_id,
    action_type_id,
    user_or_group_name,
    is_user,
    granted_by_user_name,
    granted_date)
VALUES (
    nextval('acl_entry_seq_pk'),
    currval('vortex_resource_seq_pk'),
    1,
    'dav:authenticated',
    'Y',
    'vortex',
    current_timestamp
);

-- (dav:all (uio:read-processed))

INSERT INTO ACL_ENTRY (
    acl_entry_id,
    resource_id,
    action_type_id,
    user_or_group_name,
    is_user,
    granted_by_user_name,
    granted_date)
VALUES (
    nextval('acl_entry_seq_pk'),
    currval('vortex_resource_seq_pk'),
    4,
    'dav:all',
    'Y',
    'vortex',
    current_timestamp
);

-- (dav:owner (dav:read))

INSERT INTO ACL_ENTRY (
    acl_entry_id,
    resource_id,
    action_type_id,
    user_or_group_name,
    is_user,
    granted_by_user_name,
    granted_date)
VALUES (
    nextval('acl_entry_seq_pk'),
    currval('vortex_resource_seq_pk'),
    1,
    'dav:owner',
    'Y',
    'vortex',
    current_timestamp
);

-- (dav:owner (dav:write))

INSERT INTO ACL_ENTRY (
    acl_entry_id,
    resource_id,
    action_type_id,
    user_or_group_name,
    is_user,
    granted_by_user_name,
    granted_date)
VALUES (
    nextval('acl_entry_seq_pk'),
    currval('vortex_resource_seq_pk'),
    2,
    'dav:owner',
    'Y',
    'vortex',
    current_timestamp
);

-- (dav:owner (dav:write-acl))

INSERT INTO ACL_ENTRY (
    acl_entry_id,
    resource_id,
    action_type_id,
    user_or_group_name,
    is_user,
    granted_by_user_name,
    granted_date)
VALUES (
    nextval('acl_entry_seq_pk'),
    currval('vortex_resource_seq_pk'),
    3,
    'dav:owner',
    'Y',
    'vortex',
    current_timestamp
);


text:
var csrftoken = $('meta[name=csrf-token]').attr('content');
$.ajaxSetup({
    beforeSend: function(xhr, settings) {
        if (!/^(GET|HEAD|OPTIONS|TRACE)$/i.test(settings.type)) {
         xhr.setRequestHeader("X-CSRFToken", csrftoken);
      }
    }
});

$(function(){
    var url = "/api/analysis/movies_analyzer";

    function successHandler (data) {
        $("#response_text").val(data.text);
        $("#prediction").text(data.pred_msg);
    }

    function errorHandler (xhr) {
        alert('Error occured: ' + xhr.responseText);
    }

    function formHandler(event) {
        event.preventDefault();
        $.ajax({
            url: url,
            type: "POST",
            data: $(this).serialize(),
            dataType: "json",
            success: successHandler,
            error: errorHandler
        });
    }

    $("#request_form").submit(formHandler);
})


text:
package mlesiewski.simpledi.apt.model;

import javax.lang.model.element.TypeElement;
import java.util.List;
import java.util.stream.Collectors;

/**
 * An entity representing BeanProvider that delegates calls to a BeanProducer method.
 */
public class ProducedBeanProviderEntity extends BeanProviderEntity implements GeneratedCode {

    private static final TypeElement SOURCE = null;
    private final BeanEntity beanProducer;
    private final String producerMethod;
    private final String thrown;

    /**
     * @param producedBean a bean that is going to be produced by this provider
     * @param beanProducer a bean that is going to be a delegate for bean production call
     * @param producerMethod name of the method of beanProducer that produces producedBean instances
     * @param thrown list of names of thrown types declared by the producer method
     */
    public ProducedBeanProviderEntity(BeanEntity producedBean, BeanEntity beanProducer, String producerMethod, List<String> thrown) {
        super(producedBean, "Wrapper", SOURCE);
        this.beanProducer = beanProducer;
        this.producerMethod = producerMethod;
        this.thrown = thrown.stream().collect(Collectors.joining(" | "));
    }

    public String producerMethod() {
        return producerMethod;
    }

    public BeanEntity beanProducer() {
        return beanProducer;
    }

    public String thrown() {
        return thrown;
    }
}


text:
#define pr_fmt(fmt) "efi: " fmt

#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/mm.h>
#include <linux/types.h>
#include <linux/spinlock.h>
#include <linux/bootmem.h>
#include <linux/ioport.h>
#include <linux/module.h>
#include <linux/efi.h>
#include <linux/uaccess.h>
#include <linux/io.h>
#include <linux/reboot.h>
#include <linux/slab.h>

#include <asm/setup.h>
#include <asm/page.h>
#include <asm/e820.h>
#include <asm/pgtable.h>
#include <asm/tlbflush.h>
#include <asm/proto.h>
#include <asm/efi.h>
#include <asm/cacheflush.h>
#include <asm/fixmap.h>
#include <asm/realmode.h>
#include <asm/time.h>
#include <asm/pgalloc.h>

/*
 * We allocate runtime services regions bottom-up, starting from -4G, i.e.
 * 0xffff_ffff_0000_0000 and limit EFI VA mapping space to 64G.
 */
static u64 efi_va = EFI_VA_START;

struct efi_scratch efi_scratch;

static void __init early_code_mapping_set_exec(int executable)
{
	efi_memory_desc_t *md;

	if (!(__supported_pte_mask & _PAGE_NX))
		return;

	/* Make EFI service code area executable */
	for_each_efi_memory_desc(md) {
		if (md->type == EFI_RUNTIME_SERVICES_CODE ||
		    md->type == EFI_BOOT_SERVICES_CODE)
			efi_set_executable(md, executable);
	}
}

pgd_t * __init efi_call_phys_prolog(void)
{
	unsigned long vaddress;
	pgd_t *save_pgd;

	int pgd;
	int n_pgds;

	if (!efi_enabled(EFI_OLD_MEMMAP)) {
		save_pgd = (pgd_t *)read_cr3();
		write_cr3((unsigned long)efi_scratch.efi_pgt);
		goto out;
	}

	early_code_mapping_set_exec(1);

	n_pgds = DIV_ROUND_UP((max_pfn << PAGE_SHIFT), PGDIR_SIZE);
	save_pgd = kmalloc(n_pgds * sizeof(pgd_t), GFP_KERNEL);

	for (pgd = 0; pgd < n_pgds; pgd++) {
		save_pgd[pgd] = *pgd_offset_k(pgd * PGDIR_SIZE);
		vaddress = (unsigned long)__va(pgd * PGDIR_SIZE);
		set_pgd(pgd_offset_k(pgd * PGDIR_SIZE), *pgd_offset_k(vaddress));
	}
out:
	__flush_tlb_all();

	return save_pgd;
}

void __init efi_call_phys_epilog(pgd_t *save_pgd)
{
	/*
	 * After the lock is released, the original page table is restored.
	 */
	int pgd_idx;
	int nr_pgds;

	if (!efi_enabled(EFI_OLD_MEMMAP)) {
		write_cr3((unsigned long)save_pgd);
		__flush_tlb_all();
		return;
	}

	nr_pgds = DIV_ROUND_UP((max_pfn << PAGE_SHIFT) , PGDIR_SIZE);

	for (pgd_idx = 0; pgd_idx < nr_pgds; pgd_idx++)
		set_pgd(pgd_offset_k(pgd_idx * PGDIR_SIZE), save_pgd[pgd_idx]);

	kfree(save_pgd);

	__flush_tlb_all();
	early_code_mapping_set_exec(0);
}

static pgd_t *efi_pgd;

/*
 * We need our own copy of the higher levels of the page tables
 * because we want to avoid inserting EFI region mappings (EFI_VA_END
 * to EFI_VA_START) into the standard kernel page tables. Everything
 * else can be shared, see efi_sync_low_kernel_mappings().
 */
int __init efi_alloc_page_tables(void)
{
	pgd_t *pgd;
	pud_t *pud;
	gfp_t gfp_mask;

	if (efi_enabled(EFI_OLD_MEMMAP))
		return 0;

	gfp_mask = GFP_KERNEL | __GFP_NOTRACK | __GFP_ZERO;
	efi_pgd = (pgd_t *)__get_free_page(gfp_mask);
	if (!efi_pgd)
		return -ENOMEM;

	pgd = efi_pgd + pgd_index(EFI_VA_END);

	pud = pud_alloc_one(NULL, 0);
	if (!pud) {
		free_page((unsigned long)efi_pgd);
		return -ENOMEM;
	}

	pgd_populate(NULL, pgd, pud);

	return 0;
}

/*
 * Add low kernel mappings for passing arguments to EFI functions.
 */
void efi_sync_low_kernel_mappings(void)
{
	unsigned num_entries;
	pgd_t *pgd_k, *pgd_efi;
	pud_t *pud_k, *pud_efi;

	if (efi_enabled(EFI_OLD_MEMMAP))
		return;

	/*
	 * We can share all PGD entries apart from the one entry that
	 * covers the EFI runtime mapping space.
	 *
	 * Make sure the EFI runtime region mappings are guaranteed to
	 * only span a single PGD entry and that the entry also maps
	 * other important kernel regions.
	 */
	BUILD_BUG_ON(pgd_index(EFI_VA_END) != pgd_index(MODULES_END));
	BUILD_BUG_ON((EFI_VA_START & PGDIR_MASK) !=
			(EFI_VA_END & PGDIR_MASK));

	pgd_efi = efi_pgd + pgd_index(PAGE_OFFSET);
	pgd_k = pgd_offset_k(PAGE_OFFSET);

	num_entries = pgd_index(EFI_VA_END) - pgd_index(PAGE_OFFSET);
	memcpy(pgd_efi, pgd_k, sizeof(pgd_t) * num_entries);

	/*
	 * We share all the PUD entries apart from those that map the
	 * EFI regions. Copy around them.
	 */
	BUILD_BUG_ON((EFI_VA_START & ~PUD_MASK) != 0);
	BUILD_BUG_ON((EFI_VA_END & ~PUD_MASK) != 0);

	pgd_efi = efi_pgd + pgd_index(EFI_VA_END);
	pud_efi = pud_offset(pgd_efi, 0);

	pgd_k = pgd_offset_k(EFI_VA_END);
	pud_k = pud_offset(pgd_k, 0);

	num_entries = pud_index(EFI_VA_END);
	memcpy(pud_efi, pud_k, sizeof(pud_t) * num_entries);

	pud_efi = pud_offset(pgd_efi, EFI_VA_START);
	pud_k = pud_offset(pgd_k, EFI_VA_START);

	num_entries = PTRS_PER_PUD - pud_index(EFI_VA_START);
	memcpy(pud_efi, pud_k, sizeof(pud_t) * num_entries);
}

int __init efi_setup_page_tables(unsigned long pa_memmap, unsigned num_pages)
{
	unsigned long pfn, text;
	efi_memory_desc_t *md;
	struct page *page;
	unsigned npages;
	pgd_t *pgd;

	if (efi_enabled(EFI_OLD_MEMMAP))
		return 0;

	efi_scratch.efi_pgt = (pgd_t *)__pa(efi_pgd);
	pgd = efi_pgd;

	/*
	 * It can happen that the physical address of new_memmap lands in memory
	 * which is not mapped in the EFI page table. Therefore we need to go
	 * and ident-map those pages containing the map before calling
	 * phys_efi_set_virtual_address_map().
	 */
	pfn = pa_memmap >> PAGE_SHIFT;
	if (kernel_map_pages_in_pgd(pgd, pfn, pa_memmap, num_pages, _PAGE_NX | _PAGE_RW)) {
		pr_err("Error ident-mapping new memmap (0x%lx)!\n", pa_memmap);
		return 1;
	}

	efi_scratch.use_pgd = true;

	/*
	 * When making calls to the firmware everything needs to be 1:1
	 * mapped and addressable with 32-bit pointers. Map the kernel
	 * text and allocate a new stack because we can't rely on the
	 * stack pointer being < 4GB.
	 */
	if (!IS_ENABLED(CONFIG_EFI_MIXED))
		return 0;

	/*
	 * Map all of RAM so that we can access arguments in the 1:1
	 * mapping when making EFI runtime calls.
	 */
	for_each_efi_memory_desc(md) {
		if (md->type != EFI_CONVENTIONAL_MEMORY &&
		    md->type != EFI_LOADER_DATA &&
		    md->type != EFI_LOADER_CODE)
			continue;

		pfn = md->phys_addr >> PAGE_SHIFT;
		npages = md->num_pages;

		if (kernel_map_pages_in_pgd(pgd, pfn, md->phys_addr, npages, _PAGE_RW)) {
			pr_err("Failed to map 1:1 memory\n");
			return 1;
		}
	}

	page = alloc_page(GFP_KERNEL|__GFP_DMA32);
	if (!page)
		panic("Unable to allocate EFI runtime stack < 4GB\n");

	efi_scratch.phys_stack = virt_to_phys(page_address(page));
	efi_scratch.phys_stack += PAGE_SIZE; /* stack grows down */

	npages = (_etext - _text) >> PAGE_SHIFT;
	text = __pa(_text);
	pfn = text >> PAGE_SHIFT;

	if (kernel_map_pages_in_pgd(pgd, pfn, text, npages, _PAGE_RW)) {
		pr_err("Failed to map kernel text 1:1\n");
		return 1;
	}

	return 0;
}

void __init efi_cleanup_page_tables(unsigned long pa_memmap, unsigned num_pages)
{
	kernel_unmap_pages_in_pgd(efi_pgd, pa_memmap, num_pages);
}

static void __init __map_region(efi_memory_desc_t *md, u64 va)
{
	unsigned long flags = _PAGE_RW;
	unsigned long pfn;
	pgd_t *pgd = efi_pgd;

	if (!(md->attribute & EFI_MEMORY_WB))
		flags |= _PAGE_PCD;

	pfn = md->phys_addr >> PAGE_SHIFT;
	if (kernel_map_pages_in_pgd(pgd, pfn, va, md->num_pages, flags))
		pr_warn("Error mapping PA 0x%llx -> VA 0x%llx!\n",
			   md->phys_addr, va);
}

void __init efi_map_region(efi_memory_desc_t *md)
{
	unsigned long size = md->num_pages << PAGE_SHIFT;
	u64 pa = md->phys_addr;

	if (efi_enabled(EFI_OLD_MEMMAP))
		return old_map_region(md);

	/*
	 * Make sure the 1:1 mappings are present as a catch-all for b0rked
	 * firmware which doesn't update all internal pointers after switching
	 * to virtual mode and would otherwise crap on us.
	 */
	__map_region(md, md->phys_addr);

	/*
	 * Enforce the 1:1 mapping as the default virtual address when
	 * booting in EFI mixed mode, because even though we may be
	 * running a 64-bit kernel, the firmware may only be 32-bit.
	 */
	if (!efi_is_native () && IS_ENABLED(CONFIG_EFI_MIXED)) {
		md->virt_addr = md->phys_addr;
		return;
	}

	efi_va -= size;

	/* Is PA 2M-aligned? */
	if (!(pa & (PMD_SIZE - 1))) {
		efi_va &= PMD_MASK;
	} else {
		u64 pa_offset = pa & (PMD_SIZE - 1);
		u64 prev_va = efi_va;

		/* get us the same offset within this 2M page */
		efi_va = (efi_va & PMD_MASK) + pa_offset;

		if (efi_va > prev_va)
			efi_va -= PMD_SIZE;
	}

	if (efi_va < EFI_VA_END) {
		pr_warn(FW_WARN "VA address range overflow!\n");
		return;
	}

	/* Do the VA map */
	__map_region(md, efi_va);
	md->virt_addr = efi_va;
}

/*
 * kexec kernel will use efi_map_region_fixed to map efi runtime memory ranges.
 * md->virt_addr is the original virtual address which had been mapped in kexec
 * 1st kernel.
 */
void __init efi_map_region_fixed(efi_memory_desc_t *md)
{
	__map_region(md, md->virt_addr);
}

void __iomem *__init efi_ioremap(unsigned long phys_addr, unsigned long size,
				 u32 type, u64 attribute)
{
	unsigned long last_map_pfn;

	if (type == EFI_MEMORY_MAPPED_IO)
		return ioremap(phys_addr, size);

	last_map_pfn = init_memory_mapping(phys_addr, phys_addr + size);
	if ((last_map_pfn << PAGE_SHIFT) < phys_addr + size) {
		unsigned long top = last_map_pfn << PAGE_SHIFT;
		efi_ioremap(top, size - (top - phys_addr), type, attribute);
	}

	if (!(attribute & EFI_MEMORY_WB))
		efi_memory_uc((u64)(unsigned long)__va(phys_addr), size);

	return (void __iomem *)__va(phys_addr);
}

void __init parse_efi_setup(u64 phys_addr, u32 data_len)
{
	efi_setup = phys_addr + sizeof(struct setup_data);
}

void __init efi_runtime_update_mappings(void)
{
	unsigned long pfn;
	pgd_t *pgd = efi_pgd;
	efi_memory_desc_t *md;

	if (efi_enabled(EFI_OLD_MEMMAP)) {
		if (__supported_pte_mask & _PAGE_NX)
			runtime_code_page_mkexec();
		return;
	}

	if (!efi_enabled(EFI_NX_PE_DATA))
		return;

	for_each_efi_memory_desc(md) {
		unsigned long pf = 0;

		if (!(md->attribute & EFI_MEMORY_RUNTIME))
			continue;

		if (!(md->attribute & EFI_MEMORY_WB))
			pf |= _PAGE_PCD;

		if ((md->attribute & EFI_MEMORY_XP) ||
			(md->type == EFI_RUNTIME_SERVICES_DATA))
			pf |= _PAGE_NX;

		if (!(md->attribute & EFI_MEMORY_RO) &&
			(md->type != EFI_RUNTIME_SERVICES_CODE))
			pf |= _PAGE_RW;

		/* Update the 1:1 mapping */
		pfn = md->phys_addr >> PAGE_SHIFT;
		if (kernel_map_pages_in_pgd(pgd, pfn, md->phys_addr, md->num_pages, pf))
			pr_warn("Error mapping PA 0x%llx -> VA 0x%llx!\n",
				   md->phys_addr, md->virt_addr);

		if (kernel_map_pages_in_pgd(pgd, pfn, md->virt_addr, md->num_pages, pf))
			pr_warn("Error mapping PA 0x%llx -> VA 0x%llx!\n",
				   md->phys_addr, md->virt_addr);
	}
}

void __init efi_dump_pagetable(void)
{
#ifdef CONFIG_EFI_PGT_DUMP
	ptdump_walk_pgd_level(NULL, efi_pgd);
#endif
}

#ifdef CONFIG_EFI_MIXED
extern efi_status_t efi64_thunk(u32, ...);

#define runtime_service32(func)						 \
({									 \
	u32 table = (u32)(unsigned long)efi.systab;			 \
	u32 *rt, *___f;							 \
									 \
	rt = (u32 *)(table + offsetof(efi_system_table_32_t, runtime));	 \
	___f = (u32 *)(*rt + offsetof(efi_runtime_services_32_t, func)); \
	*___f;								 \
})

/*
 * Switch to the EFI page tables early so that we can access the 1:1
 * runtime services mappings which are not mapped in any other page
 * tables. This function must be called before runtime_service32().
 *
 * Also, disable interrupts because the IDT points to 64-bit handlers,
 * which aren't going to function correctly when we switch to 32-bit.
 */
#define efi_thunk(f, ...)						\
({									\
	efi_status_t __s;						\
	unsigned long flags;						\
	u32 func;							\
									\
	efi_sync_low_kernel_mappings();					\
	local_irq_save(flags);						\
									\
	efi_scratch.prev_cr3 = read_cr3();				\
	write_cr3((unsigned long)efi_scratch.efi_pgt);			\
	__flush_tlb_all();						\
									\
	func = runtime_service32(f);					\
	__s = efi64_thunk(func, __VA_ARGS__);			\
									\
	write_cr3(efi_scratch.prev_cr3);				\
	__flush_tlb_all();						\
	local_irq_restore(flags);					\
									\
	__s;								\
})

efi_status_t efi_thunk_set_virtual_address_map(
	void *phys_set_virtual_address_map,
	unsigned long memory_map_size,
	unsigned long descriptor_size,
	u32 descriptor_version,
	efi_memory_desc_t *virtual_map)
{
	efi_status_t status;
	unsigned long flags;
	u32 func;

	efi_sync_low_kernel_mappings();
	local_irq_save(flags);

	efi_scratch.prev_cr3 = read_cr3();
	write_cr3((unsigned long)efi_scratch.efi_pgt);
	__flush_tlb_all();

	func = (u32)(unsigned long)phys_set_virtual_address_map;
	status = efi64_thunk(func, memory_map_size, descriptor_size,
			     descriptor_version, virtual_map);

	write_cr3(efi_scratch.prev_cr3);
	__flush_tlb_all();
	local_irq_restore(flags);

	return status;
}

static efi_status_t efi_thunk_get_time(efi_time_t *tm, efi_time_cap_t *tc)
{
	efi_status_t status;
	u32 phys_tm, phys_tc;

	spin_lock(&rtc_lock);

	phys_tm = virt_to_phys(tm);
	phys_tc = virt_to_phys(tc);

	status = efi_thunk(get_time, phys_tm, phys_tc);

	spin_unlock(&rtc_lock);

	return status;
}

static efi_status_t efi_thunk_set_time(efi_time_t *tm)
{
	efi_status_t status;
	u32 phys_tm;

	spin_lock(&rtc_lock);

	phys_tm = virt_to_phys(tm);

	status = efi_thunk(set_time, phys_tm);

	spin_unlock(&rtc_lock);

	return status;
}

static efi_status_t
efi_thunk_get_wakeup_time(efi_bool_t *enabled, efi_bool_t *pending,
			  efi_time_t *tm)
{
	efi_status_t status;
	u32 phys_enabled, phys_pending, phys_tm;

	spin_lock(&rtc_lock);

	phys_enabled = virt_to_phys(enabled);
	phys_pending = virt_to_phys(pending);
	phys_tm = virt_to_phys(tm);

	status = efi_thunk(get_wakeup_time, phys_enabled,
			     phys_pending, phys_tm);

	spin_unlock(&rtc_lock);

	return status;
}

static efi_status_t
efi_thunk_set_wakeup_time(efi_bool_t enabled, efi_time_t *tm)
{
	efi_status_t status;
	u32 phys_tm;

	spin_lock(&rtc_lock);

	phys_tm = virt_to_phys(tm);

	status = efi_thunk(set_wakeup_time, enabled, phys_tm);

	spin_unlock(&rtc_lock);

	return status;
}

static efi_status_t
efi_thunk_get_variable(efi_char16_t *name, efi_guid_t *vendor,
		       u32 *attr, unsigned long *data_size, void *data)
{
	efi_status_t status;
	u32 phys_name, phys_vendor, phys_attr;
	u32 phys_data_size, phys_data;

	phys_data_size = virt_to_phys(data_size);
	phys_vendor = virt_to_phys(vendor);
	phys_name = virt_to_phys(name);
	phys_attr = virt_to_phys(attr);
	phys_data = virt_to_phys(data);

	status = efi_thunk(get_variable, phys_name, phys_vendor,
			   phys_attr, phys_data_size, phys_data);

	return status;
}

static efi_status_t
efi_thunk_set_variable(efi_char16_t *name, efi_guid_t *vendor,
		       u32 attr, unsigned long data_size, void *data)
{
	u32 phys_name, phys_vendor, phys_data;
	efi_status_t status;

	phys_name = virt_to_phys(name);
	phys_vendor = virt_to_phys(vendor);
	phys_data = virt_to_phys(data);

	/* If data_size is > sizeof(u32) we've got problems */
	status = efi_thunk(set_variable, phys_name, phys_vendor,
			   attr, data_size, phys_data);

	return status;
}

static efi_status_t
efi_thunk_get_next_variable(unsigned long *name_size,
			    efi_char16_t *name,
			    efi_guid_t *vendor)
{
	efi_status_t status;
	u32 phys_name_size, phys_name, phys_vendor;

	phys_name_size = virt_to_phys(name_size);
	phys_vendor = virt_to_phys(vendor);
	phys_name = virt_to_phys(name);

	status = efi_thunk(get_next_variable, phys_name_size,
			   phys_name, phys_vendor);

	return status;
}

static efi_status_t
efi_thunk_get_next_high_mono_count(u32 *count)
{
	efi_status_t status;
	u32 phys_count;

	phys_count = virt_to_phys(count);
	status = efi_thunk(get_next_high_mono_count, phys_count);

	return status;
}

static void
efi_thunk_reset_system(int reset_type, efi_status_t status,
		       unsigned long data_size, efi_char16_t *data)
{
	u32 phys_data;

	phys_data = virt_to_phys(data);

	efi_thunk(reset_system, reset_type, status, data_size, phys_data);
}

static efi_status_t
efi_thunk_update_capsule(efi_capsule_header_t **capsules,
			 unsigned long count, unsigned long sg_list)
{
	/*
	 * To properly support this function we would need to repackage
	 * 'capsules' because the firmware doesn't understand 64-bit
	 * pointers.
	 */
	return EFI_UNSUPPORTED;
}

static efi_status_t
efi_thunk_query_variable_info(u32 attr, u64 *storage_space,
			      u64 *remaining_space,
			      u64 *max_variable_size)
{
	efi_status_t status;
	u32 phys_storage, phys_remaining, phys_max;

	if (efi.runtime_version < EFI_2_00_SYSTEM_TABLE_REVISION)
		return EFI_UNSUPPORTED;

	phys_storage = virt_to_phys(storage_space);
	phys_remaining = virt_to_phys(remaining_space);
	phys_max = virt_to_phys(max_variable_size);

	status = efi_thunk(query_variable_info, attr, phys_storage,
			   phys_remaining, phys_max);

	return status;
}

static efi_status_t
efi_thunk_query_capsule_caps(efi_capsule_header_t **capsules,
			     unsigned long count, u64 *max_size,
			     int *reset_type)
{
	/*
	 * To properly support this function we would need to repackage
	 * 'capsules' because the firmware doesn't understand 64-bit
	 * pointers.
	 */
	return EFI_UNSUPPORTED;
}

void efi_thunk_runtime_setup(void)
{
	efi.get_time = efi_thunk_get_time;
	efi.set_time = efi_thunk_set_time;
	efi.get_wakeup_time = efi_thunk_get_wakeup_time;
	efi.set_wakeup_time = efi_thunk_set_wakeup_time;
	efi.get_variable = efi_thunk_get_variable;
	efi.get_next_variable = efi_thunk_get_next_variable;
	efi.set_variable = efi_thunk_set_variable;
	efi.get_next_high_mono_count = efi_thunk_get_next_high_mono_count;
	efi.reset_system = efi_thunk_reset_system;
	efi.query_variable_info = efi_thunk_query_variable_info;
	efi.update_capsule = efi_thunk_update_capsule;
	efi.query_capsule_caps = efi_thunk_query_capsule_caps;
}
#endif /* CONFIG_EFI_MIXED */