text:
<!DOCTYPE html>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width" />

<link rel="shortcut icon" type="image/x-icon" href="../../../../favicon.ico" />
<title>SSLServerSocket - Android SDK | Android Developers</title>

<link rel="stylesheet"
href="http://fonts.googleapis.com/css?family=Roboto:regular,medium,thin,italic,mediumitalic,bold" title="roboto">
<link href="../../../../assets/css/default.css" rel="stylesheet" type="text/css">

<link href="../../../../assets/css/fullscreen.css" rel="stylesheet" class="fullscreen"
type="text/css">

          	Quicknav
			      Quicknav

                  Design

Develop

Distribute

Links

Google Play Developer Console

Android Developers Blog

About Android

Android Sites

Android.com

Android Developers

Android Open Source Project

      <form onsubmit="return submit_search()">
        <input id="search_autocomplete" type="text" value="" autocomplete="off" name="q"
onfocus="search_focus_changed(this, true)" onblur="search_focus_changed(this, false)"
onkeydown="return search_changed(event, true, '../../../../')"
onkeyup="return search_changed(event, false, '../../../../')" />
      </form>

        close

Get Started

Style

Patterns

Building Blocks

Downloads

Videos

Training

API Guides

Reference

Tools

Get the SDK

Google Services

Google Play

Publishing

Promoting

App Quality

Spotlight

Open Distribution

Results

Loading...

Training

API Guides

Reference

Tools

Google Services

to top

          API level:

            <select id="apiLevelSelector">

            </select>

Android APIs

  android

  android.accessibilityservice

  android.accounts

  android.animation

  android.app

  android.app.admin

  android.app.backup

  android.appwidget

  android.bluetooth

  android.content

  android.content.pm

  android.content.res

  android.database

  android.database.sqlite

  android.drm

  android.gesture

  android.graphics

  android.graphics.drawable

  android.graphics.drawable.shapes

  android.graphics.pdf

  android.hardware

  android.hardware.display

  android.hardware.input

  android.hardware.location

  android.hardware.usb

  android.inputmethodservice

  android.location

  android.media

  android.media.audiofx

  android.media.effect

  android.mtp

  android.net

  android.net.http

  android.net.nsd

  android.net.rtp

  android.net.sip

  android.net.wifi

  android.net.wifi.p2p

  android.net.wifi.p2p.nsd

  android.nfc

  android.nfc.cardemulation

  android.nfc.tech

  android.opengl

  android.os

  android.os.storage

  android.preference

  android.print

  android.print.pdf

  android.printservice

  android.provider

  android.renderscript

  android.sax

  android.security

  android.service.dreams

  android.service.notification

  android.service.textservice

  android.service.wallpaper

  android.speech

  android.speech.tts

  android.support.v13.app

  android.support.v4.accessibilityservice

  android.support.v4.app

  android.support.v4.content

  android.support.v4.content.pm

  android.support.v4.database

  android.support.v4.graphics.drawable

  android.support.v4.hardware.display

  android.support.v4.media

  android.support.v4.net

  android.support.v4.os

  android.support.v4.print

  android.support.v4.text

  android.support.v4.util

  android.support.v4.view

  android.support.v4.view.accessibility

  android.support.v4.widget

  android.support.v7.app

  android.support.v7.appcompat

  android.support.v7.gridlayout

  android.support.v7.media

  android.support.v7.mediarouter

  android.support.v7.view

  android.support.v7.widget

  android.support.v8.renderscript

  android.telephony

  android.telephony.cdma

  android.telephony.gsm

  android.test

  android.test.mock

  android.test.suitebuilder

  android.text

  android.text.format

  android.text.method

  android.text.style

  android.text.util

  android.transition

  android.util

  android.view

  android.view.accessibility

  android.view.animation

  android.view.inputmethod

  android.view.textservice

  android.webkit

  android.widget

  dalvik.bytecode

  dalvik.system

  java.awt.font

  java.beans

  java.io

  java.lang

  java.lang.annotation

  java.lang.ref

  java.lang.reflect

  java.math

  java.net

  java.nio

  java.nio.channels

  java.nio.channels.spi

  java.nio.charset

  java.nio.charset.spi

  java.security

  java.security.acl

  java.security.cert

  java.security.interfaces

  java.security.spec

  java.sql

  java.text

  java.util

  java.util.concurrent

  java.util.concurrent.atomic

  java.util.concurrent.locks

  java.util.jar

  java.util.logging

  java.util.prefs

  java.util.regex

  java.util.zip

  javax.crypto

  javax.crypto.interfaces

  javax.crypto.spec

  javax.microedition.khronos.egl

  javax.microedition.khronos.opengles

  javax.net

  javax.net.ssl

  javax.security.auth

  javax.security.auth.callback

  javax.security.auth.login

  javax.security.auth.x500

  javax.security.cert

  javax.sql

  javax.xml

  javax.xml.datatype

  javax.xml.namespace

  javax.xml.parsers

  javax.xml.transform

  javax.xml.transform.dom

  javax.xml.transform.sax

  javax.xml.transform.stream

  javax.xml.validation

  javax.xml.xpath

  junit.framework

  junit.runner

  org.apache.http

  org.apache.http.auth

  org.apache.http.auth.params

  org.apache.http.client

  org.apache.http.client.entity

  org.apache.http.client.methods

  org.apache.http.client.params

  org.apache.http.client.protocol

  org.apache.http.client.utils

  org.apache.http.conn

  org.apache.http.conn.params

  org.apache.http.conn.routing

  org.apache.http.conn.scheme

  org.apache.http.conn.ssl

  org.apache.http.conn.util

  org.apache.http.cookie

  org.apache.http.cookie.params

  org.apache.http.entity

  org.apache.http.impl

  org.apache.http.impl.auth

  org.apache.http.impl.client

  org.apache.http.impl.conn

  org.apache.http.impl.conn.tsccm

  org.apache.http.impl.cookie

  org.apache.http.impl.entity

  org.apache.http.impl.io

  org.apache.http.io

  org.apache.http.message

  org.apache.http.params

  org.apache.http.protocol

  org.apache.http.util

  org.json

  org.w3c.dom

  org.w3c.dom.ls

  org.xml.sax

  org.xml.sax.ext

  org.xml.sax.helpers

  org.xmlpull.v1

  org.xmlpull.v1.sax2

Interfaces

HandshakeCompletedListener

HostnameVerifier

KeyManager

ManagerFactoryParameters

SSLSession

SSLSessionBindingListener

SSLSessionContext

TrustManager

X509KeyManager

X509TrustManager

Classes

CertPathTrustManagerParameters

HandshakeCompletedEvent

HttpsURLConnection

KeyManagerFactory

KeyManagerFactorySpi

KeyStoreBuilderParameters

SSLContext

SSLContextSpi

SSLEngine

SSLEngineResult

SSLParameters

SSLPermission

SSLServerSocket

SSLServerSocketFactory

SSLSessionBindingEvent

SSLSocket

SSLSocketFactory

TrustManagerFactory

TrustManagerFactorySpi

X509ExtendedKeyManager

Enums

SSLEngineResult.HandshakeStatus

SSLEngineResult.Status

Exceptions

SSLException

SSLHandshakeException

SSLKeyException

SSLPeerUnverifiedException

SSLProtocolException

      fullscreen
      Use Tree NavigationUse Panel Navigation

Summary:

  Protected Ctors

  | Methods

  | Inherited Methods

| [Expand All]

  Added in API level 1

    public

    abstract
    class

SSLServerSocket

    extends ServerSocket

        java.lang.Object

               ↳

        java.net.ServerSocket

               ↳

        javax.net.ssl.SSLServerSocket

Class Overview

The extension of ServerSocket which provides secure server sockets
 based on protocols like SSL, TLS, or others.

Summary

Protected Constructors

        <nobr>

            </nobr>

        <nobr>
        SSLServerSocket()</nobr>

Only to be used by subclasses.

        <nobr>

            </nobr>

        <nobr>
        SSLServerSocket(int port)</nobr>

Only to be used by subclasses.

        <nobr>

            </nobr>

        <nobr>
        SSLServerSocket(int port, int backlog)</nobr>

Only to be used by subclasses.

        <nobr>

            </nobr>

        <nobr>
        SSLServerSocket(int port, int backlog, InetAddress address)</nobr>

Only to be used by subclasses.

Public Methods

        <nobr>
            abstract

            boolean</nobr>

        <nobr>
        getEnableSessionCreation()</nobr>

Returns whether new SSL sessions may be established for new connections.

        <nobr>
            abstract

            String[]</nobr>

        <nobr>
        getEnabledCipherSuites()</nobr>

Returns the names of the enabled cipher suites to be used for new
 connections.

        <nobr>
            abstract

            String[]</nobr>

        <nobr>
        getEnabledProtocols()</nobr>

Returns the names of the enabled protocols to be used for new
 connections.

        <nobr>
            abstract

            boolean</nobr>

        <nobr>
        getNeedClientAuth()</nobr>

Returns whether server-mode connections will be configured to require
 client authentication.

        <nobr>
            abstract

            String[]</nobr>

        <nobr>
        getSupportedCipherSuites()</nobr>

Returns the names of the supported cipher suites.

        <nobr>
            abstract

            String[]</nobr>

        <nobr>
        getSupportedProtocols()</nobr>

Returns the names of the supported protocols.

        <nobr>
            abstract

            boolean</nobr>

        <nobr>
        getUseClientMode()</nobr>

Returns whether new connection will act in client mode when handshaking.

        <nobr>
            abstract

            boolean</nobr>

        <nobr>
        getWantClientAuth()</nobr>

Returns whether server-mode connections will be configured to request
 client authentication.

        <nobr>
            abstract

            void</nobr>

        <nobr>
        setEnableSessionCreation(boolean flag)</nobr>

Sets whether new SSL sessions may be established for new connections.

        <nobr>
            abstract

            void</nobr>

        <nobr>
        setEnabledCipherSuites(String[] suites)</nobr>

Sets the names of the cipher suites to be enabled for new connections.

        <nobr>
            abstract

            void</nobr>

        <nobr>
        setEnabledProtocols(String[] protocols)</nobr>

Sets the names of the protocols to be enabled for new connections.

        <nobr>
            abstract

            void</nobr>

        <nobr>
        setNeedClientAuth(boolean need)</nobr>

Sets whether server-mode connections will be configured to require client
 authentication.

        <nobr>
            abstract

            void</nobr>

        <nobr>
        setUseClientMode(boolean mode)</nobr>

Sets whether new connections should act in client mode when handshaking.

        <nobr>
            abstract

            void</nobr>

        <nobr>
        setWantClientAuth(boolean want)</nobr>

Sets whether server-mode connections will be configured to request client
 authentication.

  [Expand]

Inherited Methods

From class

  java.net.ServerSocket

        <nobr>

            Socket</nobr>

        <nobr>
        accept()</nobr>

Waits for an incoming request and blocks until the connection is opened.

        <nobr>

            void</nobr>

        <nobr>
        bind(SocketAddress localAddr)</nobr>

Binds this server socket to the given local socket address with a maximum
 backlog of 50 unaccepted connections.

        <nobr>

            void</nobr>

        <nobr>
        bind(SocketAddress localAddr, int backlog)</nobr>

Binds this server socket to the given local socket address.

        <nobr>

            void</nobr>

        <nobr>
        close()</nobr>

Closes this server socket and its implementation.

        <nobr>

            ServerSocketChannel</nobr>

        <nobr>
        getChannel()</nobr>

Returns this socket's ServerSocketChannel, if one exists.

        <nobr>

            InetAddress</nobr>

        <nobr>
        getInetAddress()</nobr>

Gets the local IP address of this server socket or null if the
 socket is unbound.

        <nobr>

            int</nobr>

        <nobr>
        getLocalPort()</nobr>

Gets the local port of this server socket or -1 if the socket is
 unbound.

        <nobr>

            SocketAddress</nobr>

        <nobr>
        getLocalSocketAddress()</nobr>

Gets the local socket address of this server socket or null if
 the socket is unbound.

        <nobr>

            int</nobr>

        <nobr>
        getReceiveBufferSize()</nobr>

Returns this socket's receive buffer size.

        <nobr>

            boolean</nobr>

        <nobr>
        getReuseAddress()</nobr>

Gets the value of the socket option SocketOptions.SO_REUSEADDR.

        <nobr>

            synchronized

            int</nobr>

        <nobr>
        getSoTimeout()</nobr>

Gets the socket accept timeout.

        <nobr>

            final

            void</nobr>

        <nobr>
        implAccept(Socket aSocket)</nobr>

Invokes the server socket implementation to accept a connection on the
 given socket aSocket.

        <nobr>

            boolean</nobr>

        <nobr>
        isBound()</nobr>

Returns whether this server socket is bound to a local address and port
 or not.

        <nobr>

            boolean</nobr>

        <nobr>
        isClosed()</nobr>

Returns whether this server socket is closed or not.

        <nobr>

            void</nobr>

        <nobr>
        setPerformancePreferences(int connectionTime, int latency, int bandwidth)</nobr>

Sets performance preferences for connection time, latency and bandwidth.

        <nobr>

            void</nobr>

        <nobr>
        setReceiveBufferSize(int size)</nobr>

Sets this socket's receive buffer size.

        <nobr>

            void</nobr>

        <nobr>
        setReuseAddress(boolean reuse)</nobr>

Sets the value for the socket option SocketOptions.SO_REUSEADDR.

        <nobr>

            synchronized

            void</nobr>

        <nobr>
        setSoTimeout(int timeout)</nobr>

Sets the accept timeout in milliseconds for this socket.

        <nobr>

            synchronized

            static

            void</nobr>

        <nobr>
        setSocketFactory(SocketImplFactory aFactory)</nobr>

Sets the server socket implementation factory of this instance.

        <nobr>

            String</nobr>

        <nobr>
        toString()</nobr>

Returns a textual representation of this server socket including the
 address, port and the state.

From class

  java.lang.Object

        <nobr>

            Object</nobr>

        <nobr>
        clone()</nobr>

Creates and returns a copy of this Object.

        <nobr>

            boolean</nobr>

        <nobr>
        equals(Object o)</nobr>

Compares this instance with the specified object and indicates if they
 are equal.

        <nobr>

            void</nobr>

        <nobr>
        finalize()</nobr>

Invoked when the garbage collector has detected that this instance is no longer reachable.

        <nobr>

            final

            Class<?></nobr>

        <nobr>
        getClass()</nobr>

Returns the unique instance of Class that represents this
 object's class.

        <nobr>

            int</nobr>

        <nobr>
        hashCode()</nobr>

Returns an integer hash code for this object.

        <nobr>

            final

            void</nobr>

        <nobr>
        notify()</nobr>

Causes a thread which is waiting on this object's monitor (by means of
 calling one of the wait() methods) to be woken up.

        <nobr>

            final

            void</nobr>

        <nobr>
        notifyAll()</nobr>

Causes all threads which are waiting on this object's monitor (by means
 of calling one of the wait() methods) to be woken up.

        <nobr>

            String</nobr>

        <nobr>
        toString()</nobr>

Returns a string containing a concise, human-readable description of this
 object.

        <nobr>

            final

            void</nobr>

        <nobr>
        wait()</nobr>

Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object.

        <nobr>

            final

            void</nobr>

        <nobr>
        wait(long millis, int nanos)</nobr>

Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object or until the
 specified timeout expires.

        <nobr>

            final

            void</nobr>

        <nobr>
        wait(long millis)</nobr>

Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object or until the
 specified timeout expires.

From interface

  java.io.Closeable

        <nobr>
            abstract

            void</nobr>

        <nobr>
        close()</nobr>

Closes the object and release any system resources it holds.

From interface

  java.lang.AutoCloseable

        <nobr>
            abstract

            void</nobr>

        <nobr>
        close()</nobr>

Closes the object and release any system resources it holds.

Protected Constructors

        protected

      SSLServerSocket
      ()

  Added in API level 1

Only to be used by subclasses.

 Creates a TCP server socket with the default authentication context.

Throws

            IOException
            if creating the socket fails.

        protected

      SSLServerSocket
      (int port)

  Added in API level 1

Only to be used by subclasses.

 Creates a TCP server socket on the specified port with the default
 authentication context. The connection's default backlog size is 50
 connections.

Parameters

          port
          the port to listen on.

Throws

            IOException
            if creating the socket fails.

        protected

      SSLServerSocket
      (int port, int backlog)

  Added in API level 1

Only to be used by subclasses.

 Creates a TCP server socket on the specified port using the specified
 backlog and the default authentication context.

Parameters

          port
          the port to listen on.

          backlog
          the number of pending connections to queue.

Throws

            IOException
            if creating the socket fails.

        protected

      SSLServerSocket
      (int port, int backlog, InetAddress address)

  Added in API level 1

Only to be used by subclasses.

 Creates a TCP server socket on the specified port, using the specified
 backlog, listening on the specified interface, and using the default
 authentication context.

Parameters

          port
          the port the listen on.

          backlog
          the number of pending connections to queue.

          address
          the address of the interface to accept connections on.

Throws

            IOException
            if creating the socket fails.

Public Methods

        public

        abstract

        boolean

      getEnableSessionCreation
      ()

  Added in API level 1

Returns whether new SSL sessions may be established for new connections.

Returns

true if new SSL sessions may be established,
         false if existing SSL sessions must be reused.

        public

        abstract

        String[]

      getEnabledCipherSuites
      ()

  Added in API level 1

Returns the names of the enabled cipher suites to be used for new
 connections.

Returns

the names of the enabled cipher suites to be used for new
         connections.

        public

        abstract

        String[]

      getEnabledProtocols
      ()

  Added in API level 1

Returns the names of the enabled protocols to be used for new
 connections.

Returns

the names of the enabled protocols to be used for new
         connections.

        public

        abstract

        boolean

      getNeedClientAuth
      ()

  Added in API level 1

Returns whether server-mode connections will be configured to require
 client authentication.

Returns

true if client authentication is required, false
         if no client authentication is needed.

        public

        abstract

        String[]

      getSupportedCipherSuites
      ()

  Added in API level 1

Returns the names of the supported cipher suites.

Returns

the names of the supported cipher suites.

        public

        abstract

        String[]

      getSupportedProtocols
      ()

  Added in API level 1

Returns the names of the supported protocols.

Returns

the names of the supported protocols.

        public

        abstract

        boolean

      getUseClientMode
      ()

  Added in API level 1

Returns whether new connection will act in client mode when handshaking.

Returns

true if new connections will act in client mode when
         handshaking, false if not.

        public

        abstract

        boolean

      getWantClientAuth
      ()

  Added in API level 1

Returns whether server-mode connections will be configured to request
 client authentication.

Returns

true is client authentication will be requested,
         false if no client authentication is needed.

        public

        abstract

        void

      setEnableSessionCreation
      (boolean flag)

  Added in API level 1

Sets whether new SSL sessions may be established for new connections.

Parameters

          flag
          true if new SSL sessions may be established,
            false if existing SSL sessions must be reused.

        public

        abstract

        void

      setEnabledCipherSuites
      (String[] suites)

  Added in API level 1

Sets the names of the cipher suites to be enabled for new connections.
 Only cipher suites returned by getSupportedCipherSuites() are
 allowed.

Parameters

          suites
          the names of the to be enabled cipher suites.

Throws

            IllegalArgumentException
            if one of the cipher suite names is not supported.

        public

        abstract

        void

      setEnabledProtocols
      (String[] protocols)

  Added in API level 1

Sets the names of the protocols to be enabled for new connections. Only
 protocols returned by getSupportedProtocols() are allowed.

Parameters

          protocols
          the names of the to be enabled protocols.

Throws

            IllegalArgumentException
            if one of the protocols is not supported.

        public

        abstract

        void

      setNeedClientAuth
      (boolean need)

  Added in API level 1

Sets whether server-mode connections will be configured to require client
 authentication. The client authentication is one of the following:

authentication required

authentication requested

no authentication needed

 This method overrides the setting of setWantClientAuth(boolean).

Parameters

          need
          true if client authentication is required,
            false if no authentication is needed.

        public

        abstract

        void

      setUseClientMode
      (boolean mode)

  Added in API level 1

Sets whether new connections should act in client mode when handshaking.

Parameters

          mode
          true if new connections should act in client mode,
            false if not.

        public

        abstract

        void

      setWantClientAuth
      (boolean want)

  Added in API level 1

Sets whether server-mode connections will be configured to request client
 authentication. The client authentication is one of the following:

authentication required

authentication requested

no authentication needed

 This method overrides the setting of setNeedClientAuth(boolean).

Parameters

          want
          true if client authentication should be requested,
            false if no authentication is needed.

  Except as noted, this content is licensed under Apache 2.0.
  For details and restrictions, see the
  Content License.

    Android 4.4 r1 —

    About Android  |
    Legal  |
    Support


text:
package org.jkiss.dbeaver.model.struct.cache;

import org.jkiss.code.NotNull;
import org.jkiss.code.Nullable;
import org.jkiss.dbeaver.model.runtime.DBRProgressMonitor;
import org.jkiss.dbeaver.model.struct.DBSObject;

import java.util.List;

/**
 * Simple objects cache.
 * Doesn't provide any reading facilities, just stores objects
 */
public class SimpleObjectCache<OWNER extends DBSObject, OBJECT extends DBSObject> extends AbstractObjectCache<OWNER, OBJECT> {

    @NotNull
    @Override
    public List<OBJECT> getAllObjects(@NotNull DBRProgressMonitor monitor, @Nullable OWNER owner) {
        return getCachedObjects();
    }

    @Nullable
    @Override
    public OBJECT getObject(@NotNull DBRProgressMonitor monitor, @Nullable OWNER owner, @NotNull String name) {
        return getCachedObject(name);
    }
}

redpajama_set_name: RedPajamaGithub


text:
define(['dojo/_base/declare', 'jimu/BaseWidget',
  'dojo/_base/lang',
  'dojo/_base/html',
  'dojo/promise/all',
  'esri/request',
  'esri/arcgis/OAuthInfo',
  'esri/IdentityManager'],
function(declare, BaseWidget,
  lang,
  html,
  all,
  esriRequest,
  OAuthInfo,
  esriId
  ) {
  //To create a widget, you need to derive from BaseWidget.
  return declare([BaseWidget], {
    // DemoWidget code goes here

    //please note that this property is be set by the framework when widget is loaded.
    //templateString: template,

    baseClass: 'jimu-widget-create-webmap',

    postCreate: function() {
      this.inherited(arguments);
      console.log('postCreate');
    },

    startup: function() {
      this.inherited(arguments);

      this.signInResult = null;

      console.log('startup');
    },

    onOpen: function(){
      console.log('onOpen');
    },

    onClose: function(){
      console.log('onClose');
    },

    onMinimize: function(){
      console.log('onMinimize');
    },

    onMaximize: function(){
      console.log('onMaximize');
    },

    onSignIn: function(credential){
      /* jshint unused:false*/
      console.log('onSignIn');
    },

    onSignOut: function(){
      console.log('onSignOut');
    },

    _onExecuteSignInClick: function() {

      esriId.getCredential(this.appConfig.portalUrl, {
          oAuthPopupConfirmation: false
      }).then(lang.hitch(this, function (signInResult){

        this.signInResult = signInResult;

        this.signInNameNode.innerHTML = this.signInResult.userId;

        html.setStyle(this.signInNode, 'display', 'none');
        html.setStyle(this.signOutNode, 'display', 'block');
        html.setStyle(this.signInNameNode, 'display', 'block');

      }));
    },

    _onExecuteSignOutClick: function() {
      esriId.destroyCredentials();

      html.setStyle(this.signInNode, 'display', 'block');
      html.setStyle(this.signOutNode, 'display', 'none');
      html.setStyle(this.signInNameNode, 'display', 'none');
      this.signInNameNode.innerHTML = "";
      this.signInResult = null;
    },

    _onCreateWebmapClick: function(evt) {

      this.outputWebmapNode.innerHTML = "";

      var text = "";
      var outputMediaType = "";
      var outputExtension = "";

      if (this.signInResult == null) {
        // Error Check 1: Is user is signed in?
        console.log('Not logged in yet error placeholder');
        this.outputWebmapNode.innerHTML = "
Error: Please log in to your ArcGIS Online account
";
      } else if (this.webMapNameNode.value.trim().length == 0) {
        // Error Check 2: Has a valid Hosted Feature name been set? (not empty, no trailing spaces (trim))
        console.log('Needs a proper service name placeholder');
        this.outputWebmapNode.innerHTML = "
Error: Please enter a name for your Feature Service
";
      } else {

        var jsonContext = this.generateJSON();

        //var accountUrl = this.appConfig.portalUrl + 'sharing/rest/content/users/' + this.signInResult.userId + '/addItem?f=json';
        var accountUrl = this.signInResult.server + "/sharing/rest/content/users/" + this.signInResult.userId + "/addItem";
        // var path = "content/users/" + this.signInResult.userId + "/addItem";

        var addWebMapItemRequest = esriRequest({
          url: accountUrl,
          method: 'post',
          content: {
            f: "json",
            title: this.webMapNameNode.value,
            type: 'Web Map',
            tags: "Generated Web Map",
            access: "public",
            token: this.signInResult.token,
            text: JSON.stringify(jsonContext.text)
          },
          callbackParamName:'callback'
        }, {usePost: true});

        addWebMapItemRequest.then(
          lang.hitch(this, function(response) {
            // Link to the hosted feature service AGO content page
            this.outputWebmapNode.innerHTML = "Open Webmap";

          }), lang.hitch(this, function(error) {
              console.log("Add Item Error: ", error.message);
              this.outputWebmapNode.innerHTML = "
" + error.message + "
";
          }));

      } // end else

    },

    generateJSON: function() {

      // based off this spec: https://developers.arcgis.com/web-map-specification/objects/webmap/
      var webmapJSON = {
        "title": this.webMapNameNode.value, // should be user defined since new web map being created
        "description": "Test Add Item",
        "tags": "test", // could use user tags or default tags
        "text": {
            "operationalLayers": [], // handles all layer types properly it seems
            "baseMap": {
                "baseMapLayers": [],
                "title": "Basemap"
            },
            "version": 2,
            "spatialReference": {} // documentation shows as lowercase...
        },
        "token": this.signInResult.token, // grab from user AGO login(?)
        "type": "Web Map" // type should always be web map by default
      }

      // read through map object to create webmap JSON
      var mapObject = this.map;

      // the "text" of "webmapJSON.text" is to contain the webmap JSON for submission to the "Add Item" Operation

      // set the default webmap infos
      webmapJSON.text.operationalLayers = mapObject.itemInfo.itemData.operationalLayers;
      webmapJSON.text.baseMap = mapObject.itemInfo.itemData.baseMap;
      webmapJSON.text.spatialReference = mapObject.itemInfo.itemData.spatialReference;
      webmapJSON.text.version = mapObject.itemInfo.itemData.version;

      // push additional layers into the correct properties

      // check for map services

      // make an array of webmap only layers to check against
      var webmapLayerIDs = [];

      for (var wol in webmapJSON.text.operationalLayers) {
        webmapLayerIDs.push(webmapJSON.text.operationalLayers[wol].id);
      }

      for (var wbl in webmapJSON.text.baseMap.baseMapLayers) {
        webmapLayerIDs.push(webmapJSON.text.baseMap.baseMapLayers[wbl].id);
      }

      // account for all non feature layers
      var mapLayerIdArray = mapObject.layerIds;

      for (var ml in mapLayerIdArray) {
        var currentLayerID = mapLayerIdArray[ml];
        if (webmapLayerIDs.indexOf(currentLayerID) > -1) {
          console.log('not an added layer, skip it');
        } else {

          // add the "added" layer to the JSON and add the id to the layer check
          var currentLayer = this.map.getLayer(currentLayerID);

          if(currentLayer.infoTemplate != null) {

            var opLayerTemplate = {
              "opacity": currentLayer.opacity,
              "mode": currentLayer.mode,
              "layerType": currentLayer.layerType,
              "title": currentLayer.title,
              "url": currentLayer.url,
              "popupInfo": {
                  "showAttachments": currentLayer.infoTemplate.info.showAttachments,
                  "fieldInfos": currentLayer.infoTemplate.info.fieldInfos,
                  "description": currentLayer.infoTemplate.info.description,
                  "title": currentLayer.infoTemplate.info.title
              },
              "visibility": currentLayer.visibility
            }

          } else {

            var opLayerTemplate = {
              "opacity": currentLayer.opacity,
              "mode": currentLayer.mode,
              "layerType": currentLayer.layerType,
              "title": currentLayer.title,
              "url": currentLayer.url,
              "visibility": currentLayer.visibility
            }

          }

          // add the "added" layer to the JSON and add the id to the layer check
          webmapJSON.text.operationalLayers.push(opLayerTemplate);
          webmapLayerIDs.push(currentLayerID);
        }
      }

      var featureLayerIdArray = mapObject.graphicsLayerIds;

      // get rid of default graphics layer
      if (featureLayerIdArray.indexOf('graphicsLayer1') > -1) {
        featureLayerIdArray.splice(featureLayerIdArray.indexOf('graphicsLayer1'), 1);
      }

      // check for all feature layers
      for (var fl in featureLayerIdArray) {
        var currentLayerID = featureLayerIdArray[fl];
        if (webmapLayerIDs.indexOf(currentLayerID) > -1) {
          console.log('not an added feature layer, skip it');
        } else {
          // add the "added" layer to the JSON and add the id to the layer check
          var currentLayer = this.map.getLayer(currentLayerID);

          if(currentLayer.infoTemplate != null) {

            var opLayerTemplate = {
              "opacity": currentLayer.opacity,
              "mode": currentLayer.mode,
              "layerType": currentLayer.layerType,
              "title": currentLayer.title,
              "url": currentLayer.url,
              "popupInfo": {
                  "showAttachments": currentLayer.infoTemplate.info.showAttachments,
                  "fieldInfos": currentLayer.infoTemplate.info.fieldInfos,
                  "description": currentLayer.infoTemplate.info.description,
                  "title": currentLayer.infoTemplate.info.title
              },
              "visibility": currentLayer.visibility
            }

          } else {

            var opLayerTemplate = {
              "opacity": currentLayer.opacity,
              "mode": currentLayer.mode,
              "layerType": currentLayer.layerType,
              "title": currentLayer.title,
              "url": currentLayer.url,
              "visibility": currentLayer.visibility
            }

          }

          webmapJSON.text.operationalLayers.push(opLayerTemplate);
          webmapLayerIDs.push(currentLayerID);
        }
      }

      // clean op layers and basemap layers
      for(var t in webmapJSON.text.operationalLayers) {
        webmapJSON.text.operationalLayers[t].layerObject = null;
      }

      for(var r in webmapJSON.text.baseMap.baseMapLayers) {
        webmapJSON.text.baseMap.baseMapLayers[r].layerObject = null;
      }

      return webmapJSON;

    }

  });
});


text:
"""Client and server classes corresponding to protobuf-defined services."""
import grpc

from worker import ffmpeg_worker_pb2 as worker_dot_ffmpeg__worker__pb2

class FFmpegStub(object):
    """Missing associated documentation comment in .proto file."""

    def __init__(self, channel):
        """Constructor.

        Args:
            channel: A grpc.Channel.
        """
        self.transcode = channel.unary_stream(
                '/FFmpeg/transcode',
                request_serializer=worker_dot_ffmpeg__worker__pb2.FFmpegRequest.SerializeToString,
                response_deserializer=worker_dot_ffmpeg__worker__pb2.FFmpegResponse.FromString,
                )

class FFmpegServicer(object):
    """Missing associated documentation comment in .proto file."""

    def transcode(self, request, context):
        """Missing associated documentation comment in .proto file."""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

def add_FFmpegServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'transcode': grpc.unary_stream_rpc_method_handler(
                    servicer.transcode,
                    request_deserializer=worker_dot_ffmpeg__worker__pb2.FFmpegRequest.FromString,
                    response_serializer=worker_dot_ffmpeg__worker__pb2.FFmpegResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'FFmpeg', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))

 # This class is part of an EXPERIMENTAL API.
class FFmpeg(object):
    """Missing associated documentation comment in .proto file."""

    @staticmethod
    def transcode(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_stream(request, target, '/FFmpeg/transcode',
            worker_dot_ffmpeg__worker__pb2.FFmpegRequest.SerializeToString,
            worker_dot_ffmpeg__worker__pb2.FFmpegResponse.FromString,
            options, channel_credentials,
            call_credentials, compression, wait_for_ready, timeout, metadata)


text:
import {Directive} from '@angular/core';

/** Prefix to be placed the the front of the form field. */
@Directive({
  selector: '[matPrefix]',
})
export class MatPrefix {}


text:
{% extends "base_form.html" %}

{% block title %}Create Skill{% endblock %}


text:
rfunc
==========

[![Build Status][bd_travis_shield_url]][bd_travis_url]
[![npm Version][bd_npm_shield_url]][bd_npm_url]
[![JS Standard][bd_standard_shield_url]][bd_standard_url]

[bd_repo_url]: https://github.com/rfunc-labo/rfunc
[bd_travis_url]: http://travis-ci.org/rfunc-labo/rfunc
[bd_travis_shield_url]: http://img.shields.io/travis/rfunc-labo/rfunc.svg?style=flat
[bd_travis_com_url]: http://travis-ci.com/rfunc-labo/rfunc
[bd_travis_com_shield_url]: https://api.travis-ci.com/rfunc-labo/rfunc.svg?token=
[bd_license_url]: https://github.com/rfunc-labo/rfunc/blob/master/LICENSE
[bd_codeclimate_url]: http://codeclimate.com/github/rfunc-labo/rfunc
[bd_codeclimate_shield_url]: http://img.shields.io/codeclimate/github/rfunc-labo/rfunc.svg?style=flat
[bd_codeclimate_coverage_shield_url]: http://img.shields.io/codeclimate/coverage/github/rfunc-labo/rfunc.svg?style=flat
[bd_gemnasium_url]: https://gemnasium.com/rfunc-labo/rfunc
[bd_gemnasium_shield_url]: https://gemnasium.com/rfunc-labo/rfunc.svg
[bd_npm_url]: http://www.npmjs.org/package/rfunc
[bd_npm_shield_url]: http://img.shields.io/npm/v/rfunc.svg?style=flat
[bd_standard_url]: http://standardjs.com/
[bd_standard_shield_url]: https://img.shields.io/badge/code%20style-standard-brightgreen.svg

Remote function call with async interface

Installation
-----

```bash
$ npm install rfunc --save
```

Usage
---------

Define functions on server side.

```javascript
#!/usr/bin/env node

/**
 * This is an example to invoke rfunc server
 */
'use strict'

const rfunc = require('rfunc')

void async function () {
  // Setup server for remote call
  await  rfunc({
    // Define APIs
    'sign': {
      async signin (username, password) {
        /* ... */
        return {success: true}
      },
      async signout () {
        /* ... */
      }
    }
  }).listen(3000)
}().catch((err) => console.error(err))

```

rfunc client create the function dynamically on client side and you can just call it.

```javascript
#!/usr/bin/env node

/**
 * This is an example of rfunc client
 */
'use strict'

const rclient = require('rfunc-clinet')

void async function () {
  const sign = await rclient().connect('sign') // Define a client

  // Call remote api and receive the result
  const {success} = await sign.signin('foo', 'bar1234')
  console.log('success:', success)
}().catch((err) => console.error(err))

```

Advanced Usage
---------

To be more specific about api, provide `$spec` on server side.

```javascript
#!/usr/bin/env node

/**
 * Advanced usage of the server
 */
'use strict'

const rfunc = require('rfunc')
const http = require('http')

void async function () {
  const server = http.createServer()
  rfunc({
    'sign': {
      async signin (username, password) {
        const {state} = this // Access state property of koa
        console.log(state)
        /* ... */
      },
      async signout () { /* ... */ },
      // Callback before a method invoked
      async $before (methodName, params) {
        const {state} = this
        if (state.somethingIsWrong) {
          throw new Error('Something wrong!') // Throw error to reject invoking
        }
        state.hey = 'Say hey from before' // Set state value to share something with methods
        /* ... */
      },
      // Callback after a method invoked
      async $after (methodName, params, returns) {
        let {state} = this
        /* ... */
      },
      // Describe api specification
      $spec: {
        name: 'sign-api',
        version: '1.0.0',
        desc: 'Remote API for user sign procedures',
        methods: {
          signin: {
            desc: 'Signin in to the application',
            params: [
              {name: 'username', desc: 'Name of user to signin'},
              {name: 'password', desc: 'User password'}
            ],
            returns: {
              type: 'object'
            }
          },
          signout: {/* ... */}
        }
      }
    },
    // Koa middlewares
    $middlewares: [
      async function customMW (ctx, next) {
        // Called before handling
        /* ... */
        await next()
      }
    ],
    $jsonLimit: '4mb',
    $endpoints: {
      '/api/foo/:id': { // Pass object to handle each HTTP verbs
        'POST': (ctx) => {
          const {id} = ctx.params
          ctx.body = `This is foo with id: "${id}"`
        }
      },
    },
    $static: '/opt/www/public'
  }).applyTo(server) // Apply to existing http server
  server.listen(3000)
}().catch((err) => console.error(err))

```

Then you can fetch the spec data via `.describe()` method on client side.

```javascript
#!/usr/bin/env node

/**
 * This is an example of rfunc client
 */
'use strict'

const rclient = require('rfunc/clinet')

void async function () {
  let sign = await rclient().connect('sign')

  // Fetch the spec data
  let $spec = await sign.describe()
  /* ... */
}().catch((err) => console.error(err))

```

This cloud be useful to generate API documentations.

License
-------
This software is released under the [MIT License](https://github.com/rfunc-labo/rfunc/blob/master/LICENSE).

Links
------

+ [rfunc-client][rfunc_client_url]
+ [rfunc-labo][rfunc_labo_url]

[rfunc_client_url]: https://github.com/rfunc-labo/rfunc-client
[rfunc_labo_url]: https://github.com/rfunc-labo


text:
export default [
  {
    type: 'checkbox',
    input: true,
    weight: 105,
    key: 'inlineEdit',
    label: 'Inline Editing',
    tooltip: 'Check this if you would like your changes within \'edit\' mode to be committed directly to the submission object as that row is being changed',
  },
  {
    key: 'defaultValue',
    ignore: true,
  },
  {
    key: 'multiple',
    ignore: true
  },
];


text:
/* @flow */

import { combineReducers } from 'redux-immutable';
import { routerReducer as router } from 'react-router-redux';
import ProtectedReducer from '../containers/Protected/ProtectedReducer'
import LoginReducer from '../containers/Login/LoginReducer'
import BackupReducer from '../containers/Backup/BackupReducer'
import SettingsReducer from '../containers/Settings/SettingsReducer'
import NavBarReducer from '../components/NavBar/NavBarReducer'
import AlertReducer from '../components/Alert/AlertReducer'
//import WorkReducer from '../components/Calendar/Reducer';
import { loadingBarReducer } from 'react-redux-loading-bar'
export default combineReducers({

  router,
  ProtectedReducer,
  BackupReducer,
  SettingsReducer,
  NavBarReducer,
  LoginReducer,
  AlertReducer,
  loadingBar: loadingBarReducer,
//  WorkReducer,
});


text:
import { TestBed } from '@angular/core/testing';

import { NotesApiService } from './notes-api.service';

describe('NotesApiService', () => {
  let service: NotesApiService;

  beforeEach(() => {
    TestBed.configureTestingModule({});
    service = TestBed.inject(NotesApiService);
  });

  it('should be created', () => {
    expect(service).toBeTruthy();
  });
});


text:
NODE_MODULE_INIT() {
  #if NODE_VERSION_AT_LEAST(0, 11, 0)
    v8::Isolate* isolate = v8::Isolate::GetCurrent();
  #endif
  INIT(wiringPi);
  INIT(softPwm);
  INIT(softServo);
  INIT(softTone);
  INIT(wiringPiI2C);
  INIT(wiringPiSPI);
  INIT(wiringSerial);
  INIT(wiringShift);
  INIT(wiringPiISR);

  INIT(extensions);
  INIT(devlib);
}

NODE_MODULE_DECLARE(wiringPi);


text:
require('dotenv').config();

let express = require('express');
let morgan = require('morgan');
let helmet = require('helmet');
let bodyParser = require('body-parser');

let api = require('./routes/api');

const app = module.exports = express();
const port = process.env.PORT || 3000;

app.use(helmet());
app.use(morgan('dev'));
app.use(express.static(__dirname + '/public'));
app.use(bodyParser.urlencoded({ extended: true }));
app.use(bodyParser.json());
app.use('/api/v1', api);

app.get('/', (req, res) => res.sendFile(__dirname + '/public/index.html'));
app.get('*', (req, res) => res.redirect('/'));

app.listen(port, () => console.info('Ready on http://localhost:' + port));


text:
package drat.proteus.rest;

import backend.FileConstants;
import com.google.gson.Gson;
import drat.proteus.services.general.Item;
import drat.proteus.services.general.ServiceStatus;
import drat.proteus.services.health.HealthMonitorService;
import drat.proteus.services.licenses.RatInstanceService;
import drat.proteus.services.mimetype.MimeTypeBreakdownService;
import drat.proteus.services.product.RecentProductService;
import drat.proteus.services.repo.Repository;
import org.wicketstuff.rest.annotations.MethodMapping;
import org.wicketstuff.rest.annotations.parameters.RequestParam;
import org.wicketstuff.rest.resource.gson.GsonRestResource;
import org.wicketstuff.rest.utils.http.HttpMethod;
import java.util.List;
import java.util.Map;

public class ServicesRestResource extends GsonRestResource {
    private RecentProductService productService;
    private HealthMonitorService healthMonitorService;
    private MimeTypeBreakdownService mimeTypeBreakdownService;
    private RatInstanceService ratInstanceService;
    public ServicesRestResource() {
        productService = new RecentProductService();
        healthMonitorService = new HealthMonitorService();
        mimeTypeBreakdownService = new MimeTypeBreakdownService();
        ratInstanceService = new RatInstanceService();
    }

    @MethodMapping(value = "/repo/licenses/unapproved", httpMethod = HttpMethod.GET)
    public List<Item> getUnapprovedLicensesFromRatInstances() {
        ratInstanceService.getRatLogs();
        return ratInstanceService.getUnapprovedLicenses();
    }

    @MethodMapping(value = "/products", httpMethod = HttpMethod.GET)
    public List<Item> getRecentProducts() {
        return productService.getAllRecentProducts();
    }

    @MethodMapping(value = "/repo/breakdown/mime", httpMethod = HttpMethod.GET)
    public List<Item> getRepoMimeTypeBreakdown(@RequestParam(value = "limit", required = false) Integer limit) {
        if(limit == null) {
            limit = 0;
        }
        return mimeTypeBreakdownService.getMimeTypes(limit);
    }

    @MethodMapping(value = "/repo/breakdown/license", httpMethod = HttpMethod.GET)
    public List<Item> getRepoLicenseTypeBreakdown() {
        ratInstanceService.getRatLogs();
        return ratInstanceService.getLicenseTypeBreakdown();
    }

    @MethodMapping(value = "/repo/size", httpMethod = HttpMethod.GET)
    public Repository.Size getRepositorySize() {
        return new Repository(FileConstants.DRAT_TEMP_UNZIPPED_PATH).getSize();
    }

    @MethodMapping(value = "/status/drat", httpMethod = HttpMethod.GET)
    public ServiceStatus getDratRunningStatus() {
        return healthMonitorService.getDratStatus();
    }

    @MethodMapping(value = "/status/oodt", httpMethod = HttpMethod.GET)
    public ServiceStatus getOodtRunningStatus() {
        return healthMonitorService.getOodtStatus();
    }

    @MethodMapping(value = "/status/oodt/raw", httpMethod = HttpMethod.GET)
    public Object getOodtRawHealthStatus() {
        String jsonBody = healthMonitorService.rerouteHealthMonitorData().readEntity(String.class);
        return (Map<String,Object>)new Gson().fromJson(jsonBody, Map.class);
    }
}


text:
package com.iwc.shop.modules.shop.dao;

import com.iwc.shop.common.persistence.CrudDao;
import com.iwc.shop.common.persistence.annotation.MyBatisDao;
import com.iwc.shop.modules.shop.entity.OrderStatusProcess;

/**
 * 订单状态流程集DAO
 * @author Tony Wong
 * @version 2015-04-16
 */
@MyBatisDao
public interface OrderStatusProcessDao extends CrudDao<OrderStatusProcess> {

}


text:
using System;
using System.Runtime.Serialization;

using Carbon.Data.Annotations;
using Carbon.Net.Dns;
using Carbon.Platform.Resources;
using Carbon.Platform.Sequences;

namespace Carbon.Platform.Hosting
{
    [Dataset("DomainRecords")]
    public class DomainRecord : IResource, IDomainRecord
    {
        public DomainRecord() { }

        public DomainRecord(
            long id,
            string name,
            string path,
            DnsRecordType type,
            string value,
            int? ttl = null,
            DomainRecordFlags flags = default)
        {
            Ensure.IsValidId(id);
            Ensure.NotNullOrEmpty(name, nameof(name));
            Ensure.NotNullOrEmpty(value, nameof(value));

            #region Preconditions

            if (name.Length > 253)
                throw new ArgumentOutOfRangeException(nameof(name), name.Length, "Must be 253 characters or fewer");

            if (type == default)
                throw new ArgumentException("Required", nameof(type));

            if (ttl != null && ttl.Value < 0)
                throw new ArgumentOutOfRangeException(nameof(ttl), ttl.Value, "Must be >=0");

            #endregion

            Id    = id;
            Type  = type;
            Name  = name;
            Path  = path;
            Value = value;
            Ttl   = ttl;
            Flags = flags;
        }

        [Member("id"), Key] // domainId | #
        public long Id { get; }

        /// <summary>
        /// The name relative to the domainId
        /// e.g. @ |  subdomain
        /// </summary>
        [Member("name")]
        [Ascii, StringLength(253)]
        public string Name { get; }

        /// <summary>
        /// Punycoded Domain:ReversedPathNotation
        /// ai/processor
        /// ai/processor/*
        /// </summary>
        [Member("path"), Indexed]
        [Ascii, StringLength(253)]
        public string Path { get; }

        /// <summary>
        /// Resource Record Type
        /// e.g. A, MX, CNAME, AAAA
        /// </summary>
        [Member("type")]
        public DnsRecordType Type { get; }

        // A      : 192.0.2.1
        // AAAA   : 2001:0db8:85a3:0:0:8a2e:0370:7334
        // CA     : 0 issue "ca.example.net; account=123456"
        // MX     : 10 mail.example.com \ 20 mail2.example.com
        // CNAME  : hostname.example.com
        // SOA    : hostname.example.com. hostmaster.a.com. 1 7200 900 1209600 86400

        [Member("value")]
        [StringLength(4000)]
        public string Value { get; }

        [Member("ttl")] // in seconds (defaults to domain TTL if undefined)
        public int? Ttl { get; }

        // Priority / Weight?

        [Member("flags")]
        public DomainRecordFlags Flags { get; }

        /// <summary>
        /// The authoritive domain the record is under (DNS Zone)
        /// </summary>
        [IgnoreDataMember]
        public long DomainId => ScopedId.GetScope(Id);

        #region Timestamps

        [Member("created"), Timestamp]
        public DateTime Created { get; }

        [Member("deleted")]
        public DateTime? Deleted { get; }

        [Member("modified"), Timestamp(true)]
        public DateTime Modified { get; }

        #endregion

        #region IResource

        ResourceType IResource.ResourceType => ResourceTypes.DnsRecord;

        #endregion
    }
}


text:
<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>Tweakr</title>
  <base href="https://google.github.io/tweakr/easyserver/">

  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="icon" type="image/x-icon" href="favicon.ico">
  <link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500&display=swap" rel="stylesheet">
  <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
</head>
<body class="mat-typography">
  <app-root></app-root>
<script src="https://google.github.io/tweakr/easyserver/runtime-es2015.js" type="module"></script><script src="https://google.github.io/tweakr/easyserver/runtime-es5.js" nomodule defer></script><script src="https://google.github.io/tweakr/easyserver/polyfills-es5.js" nomodule defer></script><script src="https://google.github.io/tweakr/easyserver/polyfills-es2015.js" type="module"></script><script src="https://google.github.io/tweakr/easyserver/styles-es2015.js" type="module"></script><script src="https://google.github.io/tweakr/easyserver/styles-es5.js" nomodule defer></script><script src="https://google.github.io/tweakr/easyserver/vendor-es2015.js" type="module"></script><script src="https://google.github.io/tweakr/easyserver/vendor-es5.js" nomodule defer></script><script src="https://google.github.io/tweakr/easyserver/main-es2015.js" type="module"></script><script src="https://google.github.io/tweakr/easyserver/main-es5.js" nomodule defer></script></body>
</html>


text:
//
//  NSFont+KDIExtensions.h
//  Ditko-macOS
//
//  Created by William Towe on 3/15/18.
//  Copyright © 2021 Kosoku Interactive, LLC. All rights reserved.
//
//  Licensed under the Apache License, Version 2.0 (the "License");
//  you may not use this file except in compliance with the License.
//  You may obtain a copy of the License at
//
//  http://www.apache.org/licenses/LICENSE-2.0
//
//  Unless required by applicable law or agreed to in writing, software
//  distributed under the License is distributed on an "AS IS" BASIS,
//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//  See the License for the specific language governing permissions and
//  limitations under the License.

#import <Cocoa/Cocoa.h>

@interface NSFont (KDIExtensions)

/**
 Returns a character set containing all characters in the receiver.
 */
@property (readonly,nonatomic) NSCharacterSet *KDI_characterSet;

/**
 Attempts to register fonts from the specified URL, returning YES if successful, otherwise NO and an error by reference.

 @param URL The URL for which to register fonts
 @error The error to return by reference
 @return YES if the fonts were registered, otherwise NO
 */
+ (BOOL)KDI_registerFontsForURL:(NSURL *)URL error:(NSError **)error;

@end


text:
<?xml version="1.0" encoding="UTF-8"?>

<phpunit bootstrap="Bootstrap.php" colors="true">
    <filter>
        <whitelist>
            <directory suffix=".php">../src</directory>
        </whitelist>
    </filter>
    <testsuites>
            <testsuite name="ApplicationsTest">
		         <directory>./ApplicationsTest</directory>
            </testsuite>
     </testsuites>
</phpunit>


text:
package org.apache.skywalking.apm.plugin.jdk.http;

import org.apache.skywalking.apm.agent.core.context.CarrierItem;
import org.apache.skywalking.apm.agent.core.context.ContextCarrier;
import org.apache.skywalking.apm.agent.core.context.ContextManager;
import org.apache.skywalking.apm.agent.core.context.tag.Tags;
import org.apache.skywalking.apm.agent.core.context.trace.AbstractSpan;
import org.apache.skywalking.apm.agent.core.context.trace.SpanLayer;
import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance;
import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceMethodsAroundInterceptor;
import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.MethodInterceptResult;
import org.apache.skywalking.apm.network.trace.component.ComponentsDefine;
import org.apache.skywalking.apm.util.StringUtil;
import sun.net.www.MessageHeader;

import java.lang.reflect.Method;
import java.net.HttpURLConnection;
import java.net.URL;

public class HttpClientWriteRequestInterceptor implements InstanceMethodsAroundInterceptor {

    @Override
    public void beforeMethod(EnhancedInstance objInst, Method method, Object[] allArguments, Class<?>[] argumentsTypes,
        MethodInterceptResult result) throws Throwable {
        HttpURLConnection connection = (HttpURLConnection) objInst.getSkyWalkingDynamicField();
        MessageHeader headers = (MessageHeader) allArguments[0];
        URL url = connection.getURL();
        ContextCarrier contextCarrier = new ContextCarrier();
        AbstractSpan span = ContextManager.createExitSpan(getPath(url), contextCarrier, getPeer(url));
        span.setComponent(ComponentsDefine.JDK_HTTP);
        Tags.HTTP.METHOD.set(span, connection.getRequestMethod());
        Tags.URL.set(span, url.toString());
        SpanLayer.asHttp(span);
        CarrierItem next = contextCarrier.items();
        while (next.hasNext()) {
            next = next.next();
            headers.add(next.getHeadKey(), next.getHeadValue());
        }
    }

    @Override
    public Object afterMethod(EnhancedInstance objInst, Method method, Object[] allArguments, Class<?>[] argumentsTypes,
        Object ret) throws Throwable {
        return ret;
    }

    @Override
    public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments,
        Class<?>[] argumentsTypes, Throwable t) {
        AbstractSpan span = ContextManager.activeSpan();
        span.log(t);
    }

    private String getPeer(URL url) {
        String host = url.getHost();
        if (url.getPort() > 0) {
            return host + ":" + url.getPort();
        }
        return host;
    }

    private String getPath(URL url) {
        return StringUtil.isEmpty(url.getPath()) ? "/" : url.getPath();
    }

}


text:
files-rb
========

A simple solution to host your files.


text:
package santo.vertx.arangodb.rest;

import org.vertx.java.core.eventbus.Message;
import org.vertx.java.core.json.JsonObject;
import org.vertx.java.core.logging.Logger;
import santo.vertx.arangodb.ArangoPersistor;
import static santo.vertx.arangodb.rest.AbstractRestAPI.API_BASE_PATH;

/**
 *
 * @author sANTo
 */
public class AqlAPI extends AbstractRestAPI {

    public static final String API_PATH_CURSOR = API_BASE_PATH + "/cursor";
    public static final String API_PATH_QUERY = API_BASE_PATH + "/query";
    public static final String API_PATH_EXPLAIN = API_BASE_PATH + "/explain";
    public static final String API_PATH_FUNCTION = API_BASE_PATH + "/aqlfunction";

    public static final String MSG_ACTION_EXECUTE = "execute";
    public static final String MSG_ACTION_CURSOR = "cursor";
    public static final String MSG_ACTION_EXECUTE_CURSOR = "execute-cursor";
    public static final String MSG_ACTION_VALIDATE = "validate";
    public static final String MSG_ACTION_VALIDATE_QUERY = "validate-query";
    public static final String MSG_ACTION_NEXT = "next";
    public static final String MSG_ACTION_CURSOR_NEXT = "cursor-next";
    public static final String MSG_ACTION_EXECUTE_NEXT = "execute-next";
    public static final String MSG_ACTION_DELETE = "delete";
    public static final String MSG_ACTION_DELETE_CURSOR = "delete-cursor";
    public static final String MSG_ACTION_EXPLAIN = "explain";
    public static final String MSG_ACTION_EXPLAIN_QUERY = "explain-query";
    public static final String MSG_ACTION_CREATE_FUNCTION = "create-function";
    public static final String MSG_ACTION_GET_FUNCTION = "get-function";
    public static final String MSG_ACTION_DELETE_FUNCTION = "delete-function";

    public AqlAPI(Logger logger, ArangoPersistor persistor) {
        this.logger = logger;
        this.persistor = persistor;
    }

    @Override
    protected void performAction(Message<JsonObject> msg, String action, JsonObject headers, int timeout, String dbName) {
        logger.trace(logPrefix + "Action: " + action);

        switch (action) {
            case MSG_ACTION_EXECUTE:
            case MSG_ACTION_CURSOR:
            case MSG_ACTION_EXECUTE_CURSOR:
                execute(msg, timeout, headers, dbName);
                break;
            case MSG_ACTION_VALIDATE:
            case MSG_ACTION_VALIDATE_QUERY:
                validate(msg, timeout, headers, dbName);
                break;
            case MSG_ACTION_NEXT:
            case MSG_ACTION_CURSOR_NEXT:
            case MSG_ACTION_EXECUTE_NEXT:
                next(msg, timeout, headers, dbName);
                break;
            case MSG_ACTION_DELETE:
            case MSG_ACTION_DELETE_CURSOR:
                delete(msg, timeout, headers, dbName);
                break;
            case MSG_ACTION_EXPLAIN:
            case MSG_ACTION_EXPLAIN_QUERY:
                explain(msg, timeout, headers, dbName);
                break;
            case MSG_ACTION_CREATE_FUNCTION:
                createFunction(msg, timeout, headers, dbName);
                break;
            case MSG_ACTION_GET_FUNCTION:
                getFunction(msg, timeout, headers, dbName);
                break;
            case MSG_ACTION_DELETE_FUNCTION:
                deleteFunction(msg, timeout, headers, dbName);
                break;

            default:
                logger.info(logPrefix + "invalid action, ignoring (" + action + ")");
                helper.sendError(msg, "invalid action, ignoring (" + action + ")");
        }
    }

    // executes a query and creates a cursor when necessary
    private void execute(Message<JsonObject> msg, int timeout, JsonObject headers, String dbName) {
        // check required params
        JsonObject document = helper.getMandatoryObject(msg.body(), MSG_PROPERTY_DOCUMENT, msg);
        if (document == null) return;

        // Check required attributes
        if (!ensureAttribute(document, DOC_ATTRIBUTE_QUERY, msg)) return;

        // prepare PATH
        StringBuilder apiPath = new StringBuilder();
        if (dbName != null) apiPath.append("/_db/").append(dbName);
        apiPath.append(API_PATH_CURSOR);

        httpPost(persistor, apiPath.toString(), headers, document, timeout, msg);
    }

    // parses the specified query and validates it
    private void validate(Message<JsonObject> msg, int timeout, JsonObject headers, String dbName) {
        // check required params
        JsonObject document = helper.getMandatoryObject(msg.body(), MSG_PROPERTY_DOCUMENT, msg);
        if (document == null) return;

        // Check required attributes
        if (!ensureAttribute(document, DOC_ATTRIBUTE_QUERY, msg)) return;

        // prepare PATH
        StringBuilder apiPath = new StringBuilder();
        if (dbName != null) apiPath.append("/_db/").append(dbName);
        apiPath.append(API_PATH_QUERY);

        httpPost(persistor, apiPath.toString(), headers, document, timeout, msg);
    }

    // reads next batch from cursor
    private void next(Message<JsonObject> msg, int timeout, JsonObject headers, String dbName) {
        // check required params

        // the cursor identifier
        String id = helper.getMandatoryString(msg.body(), MSG_PROPERTY_ID, msg);
        if (id == null) return;

        // prepare PATH
        StringBuilder apiPath = new StringBuilder();
        if (dbName != null) apiPath.append("/_db/").append(dbName);
        apiPath.append(API_PATH_CURSOR);
        apiPath.append("/").append(id);

        httpPut(persistor, apiPath.toString(), headers, null, timeout, msg);
    }

    // deletes a cursor
    private void delete(Message<JsonObject> msg, int timeout, JsonObject headers, String dbName) {
        // check required params

        // the cursor identifier
        String id = helper.getMandatoryString(msg.body(), MSG_PROPERTY_ID, msg);
        if (id == null) return;

        // prepare PATH
        StringBuilder apiPath = new StringBuilder();
        if (dbName != null) apiPath.append("/_db/").append(dbName);
        apiPath.append(API_PATH_CURSOR);
        apiPath.append("/").append(id);

        httpDelete(persistor, apiPath.toString(), headers, timeout, msg);
    }

    // explains how an AQL query would be executed
    private void explain(Message<JsonObject> msg, int timeout, JsonObject headers, String dbName) {
        // check required params
        JsonObject document = helper.getMandatoryObject(msg.body(), MSG_PROPERTY_DOCUMENT, msg);
        if (document == null) return;

        // prepare PATH
        StringBuilder apiPath = new StringBuilder();
        if (dbName != null) apiPath.append("/_db/").append(dbName);
        apiPath.append(API_PATH_EXPLAIN);

        httpPost(persistor, apiPath.toString(), headers, document, timeout, msg);
    }

    // creates or replaces an AQL user function
    private void createFunction(Message<JsonObject> msg, int timeout, JsonObject headers, String dbName) {
        // check required params
        JsonObject document = helper.getMandatoryObject(msg.body(), MSG_PROPERTY_DOCUMENT, msg);
        if (document == null) return;

        // Check required attributes
        if (!ensureAttribute(document, DOC_ATTRIBUTE_NAME, msg)) return;
        if (!ensureAttribute(document, DOC_ATTRIBUTE_CODE, msg)) return;

        // prepare PATH
        StringBuilder apiPath = new StringBuilder();
        if (dbName != null) apiPath.append("/_db/").append(dbName);
        apiPath.append(API_PATH_FUNCTION);

        httpPost(persistor, apiPath.toString(), headers, document, timeout, msg);
    }

    // retrieves all registered AQL user functions, optionally for given namespace
    private void getFunction(Message<JsonObject> msg, int timeout, JsonObject headers, String dbName) {
        // check optional params
        String namespace = helper.getOptionalString(msg.body(), MSG_PROPERTY_NAMESPACE);

        // prepare PATH
        StringBuilder apiPath = new StringBuilder();
        if (dbName != null) apiPath.append("/_db/").append(dbName);
        apiPath.append(API_PATH_FUNCTION);
        if (namespace != null) apiPath.append("/?").append(namespace);

        httpGet(persistor, apiPath.toString(), headers, timeout, msg);
    }

    // deletes the specified AQL user function or all user functions in namespace if name should be treated as group (i.e. group=true)
    private void deleteFunction(Message<JsonObject> msg, int timeout, JsonObject headers, String dbName) {
        // check required params

        // the function name
        String name = helper.getMandatoryString(msg.body(), MSG_PROPERTY_NAME, msg);
        if (name == null) return;

        // check optional params
        boolean group = helper.getOptionalBoolean(msg.body(), MSG_PROPERTY_GROUP);

        // prepare PATH
        StringBuilder apiPath = new StringBuilder();
        if (dbName != null) apiPath.append("/_db/").append(dbName);
        apiPath.append(API_PATH_FUNCTION);
        apiPath.append("/").append(name);
        if (group) apiPath.append("/?").append(MSG_PROPERTY_GROUP).append("=").append(group);

        httpDelete(persistor, apiPath.toString(), headers, timeout, msg);
    }

}


text:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!--
 ! @(#)C13Observe_DQ_Cosy.xml 1.1 10/28/10
 !
 -->
<template type="basic" name="C13Observe_DQ_Cosy" author="chempack" investigator=""
         label="C13 DQ-Cosy" menu1="C13Observe"  menu2=""
        time_created="20101028T082542" tabname="BioPack" apptype="BioPack"
        application="liquids" scans="C13Observe_DQ_Cosy" seqfil="C13dqcosy">
  <protocol title="C13Observe_DQ_Cosy" type="protocol">
    <action  type="LIB" status="Ready" lock="off" title="C13Observe_DQ_Cosy" exp="C13Observe_DQ_Cosy"
         dodialog="yes"
        time="0:25" macro="C13dqcosy" data="" />
  </protocol>
</template>


text:
<com.jrummyapps.android.colorpicker.ColorPanelView
    android:id="@id/cpv_preference_preview_color_panel"
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="@dimen/cpv_color_preference_large"
    android:layout_height="@dimen/cpv_color_preference_large"
    app:cpv_colorShape="square"/>


text:
package brooklyn.util.os;

import static org.testng.Assert.assertEquals;

import java.io.File;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.testng.Assert;
import org.testng.annotations.Test;

import com.google.common.collect.ImmutableSet;

@Test
public class OsTest {

    private static final Logger log = LoggerFactory.getLogger(OsTest.class);

    public void testTmp() {
        log.info("tmp dir is: "+Os.tmp());
        Assert.assertNotNull(Os.tmp());
    }

    public void testHome() {
        log.info("home dir is: "+Os.home());
        Assert.assertNotNull(Os.home());
    }

    public void testUser() {
        log.info("user name is: "+Os.user());
        Assert.assertNotNull(Os.user());
    }

    public void testTidyPathCanonicalize() throws Exception {
        for (String path : ImmutableSet.of("/a/b", "//a///b", "/a/b/", "/a/b/.", "/q/../a/b")) {
            assertEquals(Os.tidyPath(path), "/a/b");
        }
    }

    public void testTidyPathSimplify() throws Exception {
        assertEquals(Os.tidyPath("x/y/z"), "x/y/z");
        assertEquals(Os.tidyPath(""), ".");
        assertEquals(Os.tidyPath("."), ".");
        assertEquals(Os.tidyPath(".."), "..");
        assertEquals(Os.tidyPath("./x"), "x");
        assertEquals(Os.tidyPath("../x"), "../x");
        assertEquals(Os.tidyPath("/.."), "/");
        assertEquals(Os.tidyPath("x"), "x");
        assertEquals(Os.tidyPath("/"), "/");
        assertEquals(Os.tidyPath("///"), "/");
        assertEquals(Os.tidyPath("/x\\"), "/x\\");
        assertEquals(Os.tidyPath("/x\\y/.."), "/");
    }

    public void testTidyPathHome() throws Exception {
        String userhome = System.getProperty("user.home");
        assertEquals(Os.tidyPath("~/a/b"), userhome+"/a/b");
        assertEquals(Os.tidyPath("~"), userhome);
        assertEquals(Os.tidyPath("/a/~/b"), "/a/~/b");
    }

    public void testMergePaths() throws Exception {
        assertEquals(Os.mergePaths("a"), "a");
        assertEquals(Os.mergePaths("a", "b"), "a/b");
        assertEquals(Os.mergePaths("a/", "b"), "a/b");
        assertEquals(Os.mergePaths("a", "b/"), "a/b/");
        assertEquals(Os.mergePaths("/a", "b"), "/a/b");
    }

}


text:
package io.zucchiniui.backend.testrun.views;

import io.zucchiniui.backend.shared.views.AbstractConfigurableMapper;
import io.zucchiniui.backend.testrun.domain.TestRun;
import ma.glasnost.orika.MapperFactory;
import ma.glasnost.orika.converter.builtin.PassThroughConverter;

import java.time.ZonedDateTime;

class TestRunMapper extends AbstractConfigurableMapper {

    @Override
    protected void doConfigure(final MapperFactory factory) {
        factory.getConverterFactory().registerConverter(new PassThroughConverter(ZonedDateTime.class));

        factory.classMap(TestRun.class, TestRunListItem.class)
            .byDefault()
            .register();
    }

}