text:
set -e

function print_help {
    echo "Available options:"
    echo " start commands (rasa cmd line arguments)  - Start RasaNLU server"
    echo " download {mitie, spacy en, spacy de}      - Download packages for mitie or spacy (english or german)"
    echo " start -h                                  - Print RasaNLU help"
    echo " help                                      - Print this help"
    echo " run                                       - Run an arbitrary command inside the container"
}

function download_package {
    case $1 in
        mitie)
            echo "Downloading mitie model..."
            python -m rasa_nlu.download -p mitie
            ;;
        spacy)
            pip install -r requirements-spacy.txt
            case $2 in
                en|de)
                    echo "Downloading spacy.$2 model..."
                    python -m spacy download "$2"
                    echo "Done."
                    ;;

                *)
                    echo "Error. Rasa_nlu supports only english and german models for the time being"
                    print_help
                    exit 1
                    ;;
            esac
            ;;
        *)
            echo "Error: invalid package specified."
            echo
            print_help
            ;;
    esac
}

# If there is only a model, set it as default model
function set_default_model {
   if [ -d "/app/models" ]
     echo "Models directory exists"
     then
     if [ ! -d "/app/models/default" ]
       then
       echo "Default model doesn't exist"
       if [ "x1" == x`ls -ld /app/models/* | wc -l` ]
          then
          echo "Renaming existing model to default"
          mv `ls -d /app/models/*` /app/models/default
          if [ -d "/app/models/default" ]
          then
              echo "Model renamed to default"
          else
              echo "Model couldn't be renamed to default"
          fi
       else
          echo "There are no models or more than one"
       fi
     fi
   fi
}

case ${1} in
    start)
        set_default_model
        exec python -m rasa_nlu.server "${@:2}"
        ;;
    run)
        exec "${@:2}"
        ;;
    download)
        download_package ${@:2}
        ;;
    *)
        print_help
        ;;
esac


text:
class AnimationsController < ApplicationController
  respond_to :html, :json

  before_filter :require_user, :except => [:index]

  def new
  end

  def create
    @animation = Animation.new(params[:animation])
    @animation.user = current_user

    @animation.save

    respond_with(@animation)
  end

  def edit
    @animation = Animation.find(params[:id])
    @user_sprites = current_user.sprites

    respond_with(@animation)
  end

  private
  def object
    @animation ||= animation.find params[:id]
  end
  helper_method :object

  def animation
    object
  end
  helper_method :animation

  def animations
    @animations ||= Animation.all
  end
  helper_method :animations
end

redpajama_set_name: RedPajamaGithub


text:
<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    tools:context=".MainActivity">
    <com.whinc.easemobdemo.easemob.widget.TitleBar
        android:id="@+id/main_toolbar"
        android:layout_width="match_parent"
        android:layout_height="@dimen/action_bar_size"
        />
    <FrameLayout
        android:id="@+id/fragment_container"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
       />

</LinearLayout>


text:
package com.bluecatcode.common.contract.errors;

/**
 * Exception thrown to indicate that a programming error have been detected,
 * on the suppliers part. A post-condition does not hold.
 */
public class EnsureViolation extends ContractViolation {

    private static final long serialVersionUID = 0L;

    public EnsureViolation() {
        /* Empty */
    }

    public EnsureViolation(String message) {
        super(message);
    }

    public EnsureViolation(String message, Throwable cause) {
        super(message, cause);
    }

    public EnsureViolation(Throwable cause) {
        super(cause);
    }
}


text:
<?php

/**
 * This script exchanges oauth req token for access token and stores it,
 * and then passes the session identifier back to the init script (/index.php)
 */

require_once '../config.inc.php';
require('../../yosdk/OAuth.php');

//safely fetch input
$filters = array(

    //openid ax data
    'openid_ax_value_image' => FILTER_SANITIZE_ENCODED,
    'openid_ax_value_fullname' => FILTER_SANITIZE_ENCODED,
    'openid_ax_value_gender' => FILTER_SANITIZE_ENCODED,
    'openid_ax_value_email' => FILTER_SANITIZE_ENCODED,

    'openid_identity' => FILTER_SANITIZE_ENCODED,
    'openid_oauth_request_token' => FILTER_SANITIZE_ENCODED
);
$input = filter_var_array($_REQUEST, $filters);

// exchange request token for access token
// ref: YahooAuthorization::getAccessTokenProxy
if(isset($input['openid_oauth_request_token'])){

	//use oauth consumer to sign request for access token
    $consumer = new OAuthConsumer(YAHOO_OAUTH_APP_KEY, YAHOO_OAUTH_APP_SECRET, YAHOO_OAUTH_APP_ID);

	//format request token as expected by oauth lib
	$requestToken = new stdclass();
	$requestToken->key = $input['openid_oauth_request_token'];

	//ref: http://step2.googlecode.com/svn/spec/openid_oauth_extension/latest/openid_oauth_extension.html#AuthTokenReq
	$requestToken->secret = '';

	$url = 'https://api.login.yahoo.com/oauth/v2/get_token';
    $request = OAuthRequest::from_consumer_and_token($consumer, $requestToken, 'POST', $url, array());
    $request->sign_request(new OAuthSignatureMethod_HMAC_SHA1(), $consumer, $requestToken);
    $headers = array(
    	"Accept: application/json"
    );

    //make request
    $ch = curl_init($url);
    $options = array(
        CURLOPT_POST=> true,
    	CURLOPT_POSTFIELDS => $request->to_postdata(),
		CURLOPT_HTTPHEADER => $headers,
    	CURLOPT_RETURNTRANSFER => true
    );
    curl_setopt_array($ch, $options);
    parse_str(curl_exec($ch), $response);
    curl_close($ch);

	$now = time();
	$accessToken = new stdclass();

	//load token w/ openid params
	$accessToken->openid = $input;

    //set statndard oauth params
	$accessToken->key = $response['oauth_token'];
	$accessToken->secret = $response["oauth_token_secret"];
	$accessToken->guid = $response["xoauth_yahoo_guid"];

	//stash openid ax data in here too after decoding it
	$accessToken->openid_ax = array_map(
	    'urldecode',
	    array_slice($input, 0, 4, true)
	);

	//note: consumer is the app key not consumer obj
	$accessToken->consumer = YAHOO_OAUTH_APP_KEY;

	$accessToken->sessionHandle = $response["oauth_session_handle"];

	// Check to see if the access token ever expires.
	if(array_key_exists("oauth_expires_in", $response)) {
	    $accessToken->tokenExpires = $now + $response["oauth_expires_in"];
	}
	else {
	    $accessToken->tokenExpires = -1;
	}

	// Check to see if the access session handle ever expires.
	if(array_key_exists("oauth_authorization_expires_in", $response)) {
	    $accessToken->handleExpires = $now +
	            $response["oauth_authorization_expires_in"];
	}
	else {
	    $accessToken->handleExpires = -1;
	}

    //for the sake of a simple example, store in local file
	file_put_contents('../accessToken.txt', json_encode($accessToken));
}

?>

You are now logged in.  This window will close in 3 seconds.
<script>

// communicate session state to popup monitor in index.php
var session = 'true';

window.setTimeout(window.close, 3000);
</script>


text:
<?php

namespace site\itcrowd\secure;

use finger\social\facebook as facebook;
use finger\social\google as google;
use finger\config as config;
use finger\request;
use finger\server;
use finger\session as session;
use model\frontusers\content\record as frontusersContentRecord;

/**
 * Secure Page Main Class
 * @package site\itcrowd\secure
 */
class main extends \site\itcrowd\main {

	/**
	 * Facebook class
	 * @var
	 */
	protected $_facebookClass;
	protected $_googleClass;

	/**
	 * main constructor.
	 */
	public function __construct() {
		parent::__construct();
		// Check page enabled without logedin
		$this->checkSecure();
	}

	/**
	 * Inicialization
	 */
	public function init() {
		$_socialConfig = new config( 'social' );
		if ( in_array( request::getRouting(), explode( ';', $_socialConfig->get( 'facebook.pages', '' ) ) ) ) {
			$this->_facebookClass = new facebook();
		}
		if ( in_array( request::getRouting(), explode( ';', $_socialConfig->get( 'google.pages', '' ) ) ) ) {
			$this->_googleClass = new google();
		}
	}

	/**
	 * Check page enabled without logedin
	 * using secure.ini file
	 */
	private function checkSecure() {
		$_secureConfig = new config( 'secure' );
		$_key          = $this->_controller . '_' . $this->_action . '_' . $this->_method;
		$_enabled      = $_secureConfig->get( 'login.' . $_key, 0 );
		if ( $_enabled == 1 ) {
			$_frontuser = session::get( 'frontuser' );
			if ( ! ( $_frontuser instanceof frontusersContentRecord ) ) {
				request::redirect('/');
			}
		}

	}

}


text:
namespace System.Reflection
{
    // This Enum matchs the CorPropertyAttr defined in CorHdr.h
    [Flags]
    public enum PropertyAttributes
    {
        None = 0x0000,
        SpecialName = 0x0200,     // property is special.  Name describes how.

        RTSpecialName = 0x0400,     // Runtime(metadata internal APIs) should check name encoding.
        HasDefault = 0x1000,     // Property has default

        Reserved2 = 0x2000,
        Reserved3 = 0x4000,
        Reserved4 = 0x8000,
        ReservedMask = 0xf400,
    }
}


text:
package compiler.language.parser;

import compiler.language.LexicalPhrase;
import compiler.language.QName;
import compiler.language.ast.expression.ExpressionAST;
import compiler.language.ast.expression.FieldAccessExpressionAST;
import compiler.language.ast.expression.ParenthesisedExpressionAST;
import compiler.language.ast.expression.TupleExpressionAST;
import compiler.language.ast.type.PointerTypeAST;
import compiler.language.ast.type.TupleTypeAST;
import compiler.language.ast.type.TypeAST;
import compiler.language.ast.type.TypeArgumentAST;

/*
 * Created on 17 Aug 2010
 */

/**
 * A class which holds either a QName or a nested list of QNameElementASTs.
 * This should only be used during parsing, and should never occur in the final
 * AST.
 * @author Anthony Bryant
 */
public class QNameElementAST
{

  private QName qname = null;
  private ParseList<QNameElementAST> elements = null;
  private LexicalPhrase listLexicalPhrase = null;

  /**
   * Creates a new QNameElementAST to store the specified QName
   * @param qname - the QName to store
   */
  public QNameElementAST(QName qname)
  {
    this.qname = qname;
  }

  /**
   * Creates a new QNameElementAST to store the specified list of QNameElements
   * @param elements - the list of QNameElements to store
   * @param listLexicalPhrase - the LexicalPhrase for the list this represents, including the surrounding brackets
   */
  public QNameElementAST(ParseList<QNameElementAST> elements, LexicalPhrase listLexicalPhrase)
  {
    this.listLexicalPhrase = listLexicalPhrase;
    this.elements = elements;
  }

  /**
   * @return the LexicalPhrase for this QNameElementAST
   */
  public LexicalPhrase getLexicalPhrase()
  {
    if (qname != null)
    {
      return qname.getLexicalPhrase();
    }
    return listLexicalPhrase;
  }

  /**
   * Converts this QNameElementAST into either a FieldAccessExpressionAST or a ParenthesisedExpressionAST containing a TupleExpressionAST
   * @return the resulting ExpressionAST
   */
  public ExpressionAST toExpression()
  {
    if (qname != null)
    {
      return new FieldAccessExpressionAST(qname, qname.getLexicalPhrase());
    }

    QNameElementAST[] elems = elements.toArray(new QNameElementAST[0]);
    ExpressionAST[] expressions = new ExpressionAST[elems.length];
    for (int i = 0; i < elems.length; i++)
    {
      expressions[i] = elems[i].toExpression();
    }
    TupleExpressionAST expression = new TupleExpressionAST(expressions, elements.getLexicalPhrase());

    return new ParenthesisedExpressionAST(expression, listLexicalPhrase);
  }

  /**
   * Converts this QNameElementAST into either a PointerTypeAST or a TupleTypeAST.
   * @return the resulting TypeAST
   */
  public TypeAST toType()
  {
    if (qname != null)
    {
      TypeArgumentAST[][] typeArgumentLists = new TypeArgumentAST[qname.getLength()][];
      return new PointerTypeAST(false, qname, typeArgumentLists, qname.getLexicalPhrase());
    }

    QNameElementAST[] elems = elements.toArray(new QNameElementAST[0]);
    TypeAST[] types = new TypeAST[elems.length];
    for (int i = 0; i < elems.length; i++)
    {
      types[i] = elems[i].toType();
    }
    return new TupleTypeAST(types, listLexicalPhrase);
  }

}


text:
package net.bootsfaces.component.inputText;

import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.Map;

import javax.el.ValueExpression;
import javax.faces.component.FacesComponent;

import net.bootsfaces.C;
import net.bootsfaces.beans.ELTools;
import net.bootsfaces.component.ajax.IAJAXComponent;
import net.bootsfaces.listeners.AddResourcesListener;
import net.bootsfaces.render.IHasTooltip;
import net.bootsfaces.render.IResponsive;
import net.bootsfaces.render.IResponsiveLabel;
import net.bootsfaces.render.Tooltip;
import net.bootsfaces.utils.BsfUtils;

/**
 *
 * @author thecoder4.eu
 */
@FacesComponent("net.bootsfaces.component.inputText.InputText")
public class InputText extends InputTextCore implements IHasTooltip, IAJAXComponent, IResponsive, IResponsiveLabel {

	private String renderLabel = null;

	/**
	 *

	 * The standard component type for this component.
	 *

	 */
	public static final String COMPONENT_TYPE = "net.bootsfaces.component.inputText.InputText";
	/**
	 *

	 * The component family for this component.
	 *

	 */
	public static final String COMPONENT_FAMILY = C.BSFCOMPONENT;

	private static final Collection<String> EVENT_NAMES = Collections
			.unmodifiableCollection(Arrays.asList("blur", "change", "click", "dblclick", "focus", "input", "keydown",
					"keypress", "keyup", "mousedown", "mousemove", "mouseout", "mouseover", "mouseup", "select"));

	/**
	 * returns the subset of AJAX requests that are implemented by jQuery
	 * callback or other non-standard means (such as the onclick event of
	 * b:tabView, which has to be implemented manually).
	 *
	 * @return
	 */
	public Map<String, String> getJQueryEvents() {
		return null;
	}

	public Collection<String> getEventNames() {
		return EVENT_NAMES;
	}

	public String getDefaultEventName() {
		return "input";
	}

	public InputText() {
		setRendererType("net.bootsfaces.component.inputText.InputText");
		Tooltip.addResourceFiles();
		AddResourcesListener.addThemedCSSResource("core.css");
		AddResourcesListener.addThemedCSSResource("bsf.css");
		renderLabel = BsfUtils.getInitParam("net.bootsfaces.defaults.renderLabel");
		if (null != renderLabel && renderLabel.contains("#{")) {
			renderLabel = ELTools.evalAsString(renderLabel);
		}
	}

	public void setValueExpression(String name, ValueExpression binding) {
		name = BsfUtils.snakeCaseToCamelCase(name);
		super.setValueExpression(name, binding);
	}

	@Override
	public String getFamily() {
		return COMPONENT_FAMILY;
	}

	/**
	 * Show the words of the input text as tags (similar to price tags in the supermarket). You can select one or more tags. The list is sent to the backend bean as a comma-separated list.

	 * Usually this method is called internally by the JSF engine.
	 */
	public void setTags(boolean _tags) {
		if (_tags) {
			AddResourcesListener.addResourceToHeadButAfterJQuery(C.BSF_LIBRARY, "js/bootstrap-tagsinput.min.js");
			//!bs-less//AddResourcesListener.addThemedCSSResource("labels.css");
			AddResourcesListener.addThemedCSSResource("bootstrap-tagsinput.css");

		}
		super.setTags(_tags);
	}

	/**
	 * Activates the type-ahead aka autocomplete function. The list of values has to be defined in typeahead-values.

	 * Usually this method is called internally by the JSF engine.
	 */
	@Override
	public void setTypeahead(boolean _typeahead) {
		if (_typeahead) {
			AddResourcesListener.addResourceToHeadButAfterJQuery(C.BSF_LIBRARY, "js/typeahead.js");
			AddResourcesListener.addThemedCSSResource("typeahead.css");
		}
		super.setTypeahead(_typeahead);
	}

	@Override
	public void setTypeaheadValues(String _typeaheadValues) {
		setTypeahead(true);
		super.setTypeaheadValues(_typeaheadValues);
	}

}


text:
class MetricsServiceBrowserTest : public InProcessBrowserTest {
 public:
  virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE {
    // Enable the metrics service for testing (in recording-only mode).
    command_line->AppendSwitch(switches::kMetricsRecordingOnly);
  }

  // Open a couple of tabs of random content.
  void OpenTabs() {
    const int kBrowserTestFlags =
        ui_test_utils::BROWSER_TEST_WAIT_FOR_TAB |
        ui_test_utils::BROWSER_TEST_WAIT_FOR_NAVIGATION;

    base::FilePath test_directory;
    ASSERT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &test_directory));

    base::FilePath page1_path = test_directory.AppendASCII("title2.html");
    ui_test_utils::NavigateToURLWithDisposition(
        browser(),
        net::FilePathToFileURL(page1_path),
        NEW_FOREGROUND_TAB,
        kBrowserTestFlags);

    base::FilePath page2_path = test_directory.AppendASCII("iframe.html");
    ui_test_utils::NavigateToURLWithDisposition(
        browser(),
        net::FilePathToFileURL(page2_path),
        NEW_FOREGROUND_TAB,
        kBrowserTestFlags);
  }
};

class MetricsServiceReportingTest : public InProcessBrowserTest {
 public:
  virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE {
    // Enable the metrics service for testing (in the full mode).
    command_line->AppendSwitch(switches::kEnableMetricsReportingForTesting);
  }
};

IN_PROC_BROWSER_TEST_F(MetricsServiceBrowserTest, CloseRenderersNormally) {
  OpenTabs();

  // Verify that the expected stability metrics were recorded.
  const PrefService* prefs = g_browser_process->local_state();
  EXPECT_EQ(1, prefs->GetInteger(prefs::kStabilityLaunchCount));
  EXPECT_EQ(3, prefs->GetInteger(prefs::kStabilityPageLoadCount));
  EXPECT_EQ(0, prefs->GetInteger(prefs::kStabilityRendererCrashCount));
  // TODO(isherman): We should also verify that prefs::kStabilityExitedCleanly
  // is set to true, but this preference isn't set until the browser
  // exits... it's not clear to me how to test that.
}

// Flaky on Linux. See http://crbug.com/131094
#if defined(OS_LINUX)
#define MAYBE_CrashRenderers DISABLED_CrashRenderers
#else
#define MAYBE_CrashRenderers CrashRenderers
#endif
IN_PROC_BROWSER_TEST_F(MetricsServiceBrowserTest, MAYBE_CrashRenderers) {
  OpenTabs();

  // Kill the process for one of the tabs.
  content::WindowedNotificationObserver observer(
      content::NOTIFICATION_RENDERER_PROCESS_CLOSED,
      content::NotificationService::AllSources());
  ui_test_utils::NavigateToURL(browser(), GURL(content::kChromeUICrashURL));
  observer.Wait();

  // The MetricsService listens for the same notification, so the |observer|
  // might finish waiting before the MetricsService has a chance to process the
  // notification.  To avoid racing here, we repeatedly run the message loop
  // until the MetricsService catches up.  This should happen "real soon now",
  // since the notification is posted to all observers essentially
  // simultaneously... so busy waiting here shouldn't be too bad.
  const PrefService* prefs = g_browser_process->local_state();
  while (!prefs->GetInteger(prefs::kStabilityRendererCrashCount)) {
    content::RunAllPendingInMessageLoop();
  }

  // Verify that the expected stability metrics were recorded.
  EXPECT_EQ(1, prefs->GetInteger(prefs::kStabilityLaunchCount));
  EXPECT_EQ(4, prefs->GetInteger(prefs::kStabilityPageLoadCount));
  EXPECT_EQ(1, prefs->GetInteger(prefs::kStabilityRendererCrashCount));
  // TODO(isherman): We should also verify that prefs::kStabilityExitedCleanly
  // is set to true, but this preference isn't set until the browser
  // exits... it's not clear to me how to test that.
}

IN_PROC_BROWSER_TEST_F(MetricsServiceBrowserTest, CheckLowEntropySourceUsed) {
  // Since MetricsService is only in recording mode, and is not reporting,
  // check that the low entropy source is returned at some point.
  ASSERT_TRUE(g_browser_process->metrics_service());
  EXPECT_EQ(MetricsService::LAST_ENTROPY_LOW,
            g_browser_process->metrics_service()->entropy_source_returned());
}

IN_PROC_BROWSER_TEST_F(MetricsServiceReportingTest,
                       CheckHighEntropySourceUsed) {
  // Since the full metrics service runs in this test, we expect that
  // MetricsService returns the full entropy source at some point during
  // BrowserMain startup.
  ASSERT_TRUE(g_browser_process->metrics_service());
  EXPECT_EQ(MetricsService::LAST_ENTROPY_HIGH,
            g_browser_process->metrics_service()->entropy_source_returned());
}


text:
/**
 *
 * App.react.js
 *
 * This component is the skeleton around the actual pages, and should only
 * contain code that should be seen on all pages. (e.g. navigation bar)
 *
 */

import React from 'react';
import { connect } from 'react-redux';
import MenuItem from 'material-ui/MenuItem';
import { createStructuredSelector } from 'reselect';

import Header from 'components/Header';
import Sidebar from 'components/Sidebar';
import { makeSelectAppPage } from 'containers/App/selectors';
import { toggleSidebar } from 'containers/App/actions';

class App extends React.PureComponent { // eslint-disable-line react/prefer-stateless-function

  static propTypes = {
    children: React.PropTypes.node,
    onToggleSidebar: React.PropTypes.func,
    sidebarState: React.PropTypes.bool,
  };

  render() {
    return (
      <div>
        <Header
          title="Finance Forecast"
          onToggleSidebar={this.props.onToggleSidebar}
        />
        <Sidebar
          open={this.props.sidebarState}
          onToggleSidebar={this.props.onToggleSidebar}
        >
          <Header
            title="Sidebar"
            onToggleSidebar={this.props.onToggleSidebar}
          />
          <MenuItem>Menu Item</MenuItem>
          <MenuItem>Menu Item 2</MenuItem>
        </Sidebar>
        {React.Children.toArray(this.props.children)}
      </div>
    );
  }
}

const mapStateToProps = createStructuredSelector({
  sidebarState: makeSelectAppPage(),
});

const mapDispatchToProps = (dispatch) => ({
  onToggleSidebar: () => dispatch(toggleSidebar()),
});

export default connect(mapStateToProps, mapDispatchToProps)(App);


text:
// +build freebsd
// +build amd64

package disk

const (
	MntWait    = 1
	MfsNameLen = 16 /* length of type name including null */
	MNameLen   = 88 /* size of on/from name bufs */
)

// sys/mount.h
const (
	MntReadOnly     = 0x00000001 /* read only filesystem */
	MntSynchronous  = 0x00000002 /* filesystem written synchronously */
	MntNoExec       = 0x00000004 /* can't exec from filesystem */
	MntNoSuid       = 0x00000008 /* don't honor setuid bits on fs */
	MntUnion        = 0x00000020 /* union with underlying filesystem */
	MntAsync        = 0x00000040 /* filesystem written asynchronously */
	MntSuidDir      = 0x00100000 /* special handling of SUID on dirs */
	MntSoftDep      = 0x00200000 /* soft updates being done */
	MntNoSymFollow  = 0x00400000 /* do not follow symlinks */
	MntGEOMJournal  = 0x02000000 /* GEOM journal support enabled */
	MntMultilabel   = 0x04000000 /* MAC support for individual objects */
	MntACLs         = 0x08000000 /* ACL support enabled */
	MntNoATime      = 0x10000000 /* disable update of file access time */
	MntClusterRead  = 0x40000000 /* disable cluster read */
	MntClusterWrite = 0x80000000 /* disable cluster write */
	MntNFS4ACLs     = 0x00000010
)

type Statfs struct {
	FVersion     uint32           /* structure version number */
	FType        uint32           /* type of filesystem */
	FFlags       uint64           /* copy of mount exported flags */
	FBsize       uint64           /* filesystem fragment size */
	FIosize      uint64           /* optimal transfer block size */
	FBlocks      uint64           /* total data blocks in filesystem */
	FBfree       uint64           /* free blocks in filesystem */
	FBavail      int64            /* free blocks avail to non-superuser */
	FFiles       uint64           /* total file nodes in filesystem */
	FFfree       int64            /* free nodes avail to non-superuser */
	FSyncwrites  uint64           /* count of sync writes since mount */
	FAsyncwrites uint64           /* count of async writes since mount */
	FSyncreads   uint64           /* count of sync reads since mount */
	FAsyncreads  uint64           /* count of async reads since mount */
	FSpare       [10]uint64       /* unused spare */
	FNamemax     uint32           /* maximum filename length */
	FOwner       uint32           /* user that mounted the filesystem */
	FFsid        int32            /* filesystem id */
	FCharspare   [80]byte         /* spare string space */
	FFstypename  [MfsNameLen]byte /* filesystem type name */
	FMntfromname [MNameLen]byte   /* mounted filesystem */
	FMntonname   [MNameLen]byte   /* directory on which mounted */
}

// /usr/include/devstat.h
// devstat_getdevs()
// kern.devstat.all -> devstats list struct

// struct devinfo {
//         struct devstat  *devices;
//         u_int8_t        *mem_ptr;
//         long            generation;
//         int             numdevs;
// };
//
// struct statinfo {
//         long            cp_time[CPUSTATES];
//         long            tk_nin;
//         long            tk_nout;
//         struct devinfo  *dinfo;
//         long double     snap_time;
// };

// /usr/include/devinfo.h

//    struct devinfo_dev {
//               devinfo_handle_t    dd_handle;      /* device handle */
//               devinfo_handle_t    dd_parent;      /* parent handle */
//               char                *dd_name;       /* name of device */
//               char                *dd_desc;       /* device description */
//               char                *dd_drivername; /* name of attached driver */
//               char                *dd_pnpinfo;    /* pnp info from parent bus */
//               char                *dd_location;   /* Where bus thinks dev at */
//               uint32_t            dd_devflags;    /* API flags */
//               uint16_t            dd_flags;       /* internal dev flags */
//               device_state_t      dd_state;       /* attachment state of dev */
//	};
//
//           struct devinfo_rman {
//               devinfo_handle_t    dm_handle;      /* resource manager handle */
//               u_long              dm_start;       /* resource start */
//               u_long              dm_size;        /* resource size */
//               char                *dm_desc;       /* resource description */
//           };
//
//           struct devinfo_res {
//               devinfo_handle_t    dr_handle;      /* resource handle */
//               devinfo_handle_t    dr_rman;        /* resource manager handle */
//               devinfo_handle_t    dr_device;      /* owning device */
//               u_long              dr_start;       /* region start */
//               u_long              dr_size;        /* region size */
//           };


text:
<?php

namespace InoOicClient\Oic\Token;

class ResponseFactory implements ResponseFactoryInterface
{

    /**
     * {@inhertidoc}
     * @see \InoOicClient\Oic\Token\ResponseFactoryInterface::createResponse()
     */
    public function createResponse(array $responseData)
    {
        $response = new Response();
        $response->fromArray($responseData);

        return $response;
    }
}


text:
package org.apache.hadoop.hive.ql.io.arrow;

import io.netty.buffer.ArrowBuf;
import org.apache.arrow.vector.BigIntVector;
import org.apache.arrow.vector.BitVector;
import org.apache.arrow.vector.BitVectorHelper;
import org.apache.arrow.vector.DateDayVector;
import org.apache.arrow.vector.DecimalVector;
import org.apache.arrow.vector.FieldVector;
import org.apache.arrow.vector.Float4Vector;
import org.apache.arrow.vector.Float8Vector;
import org.apache.arrow.vector.IntVector;
import org.apache.arrow.vector.IntervalDayVector;
import org.apache.arrow.vector.IntervalYearVector;
import org.apache.arrow.vector.SmallIntVector;
import org.apache.arrow.vector.TimeStampMicroTZVector;
import org.apache.arrow.vector.TinyIntVector;
import org.apache.arrow.vector.VarBinaryVector;
import org.apache.arrow.vector.VarCharVector;
import org.apache.arrow.vector.VectorSchemaRoot;
import org.apache.arrow.vector.complex.ListVector;
import org.apache.arrow.vector.complex.NonNullableStructVector;
import org.apache.arrow.vector.complex.StructVector;
import org.apache.arrow.vector.holders.DecimalHolder;
import org.apache.arrow.vector.types.TimeUnit;
import org.apache.arrow.vector.types.Types;
import org.apache.arrow.vector.types.pojo.ArrowType;
import org.apache.arrow.vector.types.pojo.FieldType;
import org.apache.hadoop.conf.Configuration;
import org.apache.arrow.vector.util.DecimalUtility;
import org.apache.hadoop.hive.common.type.HiveDecimal;
import org.apache.hadoop.hive.conf.HiveConf;
import org.apache.hadoop.hive.ql.exec.vector.BytesColumnVector;
import org.apache.hadoop.hive.ql.exec.vector.ColumnVector;
import org.apache.hadoop.hive.ql.exec.vector.DecimalColumnVector;
import org.apache.hadoop.hive.ql.exec.vector.Decimal64ColumnVector;
import org.apache.hadoop.hive.ql.exec.vector.DoubleColumnVector;
import org.apache.hadoop.hive.ql.exec.vector.IntervalDayTimeColumnVector;
import org.apache.hadoop.hive.ql.exec.vector.ListColumnVector;
import org.apache.hadoop.hive.ql.exec.vector.LongColumnVector;
import org.apache.hadoop.hive.ql.exec.vector.MapColumnVector;
import org.apache.hadoop.hive.ql.exec.vector.StructColumnVector;
import org.apache.hadoop.hive.ql.exec.vector.TimestampColumnVector;
import org.apache.hadoop.hive.ql.exec.vector.UnionColumnVector;
import org.apache.hadoop.hive.ql.exec.vector.VectorAssignRow;
import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch;
import org.apache.hadoop.hive.ql.exec.vector.expressions.StringExpr;
import org.apache.hadoop.hive.ql.metadata.HiveException;
import org.apache.hadoop.hive.serde2.SerDeException;
import org.apache.hadoop.hive.serde2.io.HiveDecimalWritable;
import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector;
import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspectorUtils;
import org.apache.hadoop.hive.serde2.objectinspector.PrimitiveObjectInspector;
import org.apache.hadoop.hive.serde2.objectinspector.StructObjectInspector;
import org.apache.hadoop.hive.serde2.typeinfo.CharTypeInfo;
import org.apache.hadoop.hive.serde2.typeinfo.DecimalTypeInfo;
import org.apache.hadoop.hive.serde2.typeinfo.ListTypeInfo;
import org.apache.hadoop.hive.serde2.typeinfo.MapTypeInfo;
import org.apache.hadoop.hive.serde2.typeinfo.PrimitiveTypeInfo;
import org.apache.hadoop.hive.serde2.typeinfo.StructTypeInfo;
import org.apache.hadoop.hive.serde2.typeinfo.TypeInfo;
import org.apache.hadoop.hive.serde2.typeinfo.UnionTypeInfo;
import org.apache.arrow.memory.BufferAllocator;

import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.List;

import static org.apache.hadoop.hive.conf.HiveConf.ConfVars.HIVE_ARROW_BATCH_SIZE;
import static org.apache.hadoop.hive.conf.HiveConf.ConfVars.HIVE_ARROW_BATCH_ALLOCATOR_LIMIT;
import static org.apache.hadoop.hive.ql.exec.vector.VectorizedBatchUtil.createColumnVector;
import static org.apache.hadoop.hive.ql.io.arrow.ArrowColumnarBatchSerDe.MICROS_PER_MILLIS;
import static org.apache.hadoop.hive.ql.io.arrow.ArrowColumnarBatchSerDe.MILLIS_PER_SECOND;
import static org.apache.hadoop.hive.ql.io.arrow.ArrowColumnarBatchSerDe.NS_PER_MICROS;
import static org.apache.hadoop.hive.ql.io.arrow.ArrowColumnarBatchSerDe.NS_PER_MILLIS;
import static org.apache.hadoop.hive.ql.io.arrow.ArrowColumnarBatchSerDe.SECOND_PER_DAY;
import static org.apache.hadoop.hive.ql.io.arrow.ArrowColumnarBatchSerDe.toStructListTypeInfo;
import static org.apache.hadoop.hive.ql.io.arrow.ArrowColumnarBatchSerDe.toStructListVector;
import static org.apache.hadoop.hive.serde2.objectinspector.ObjectInspectorUtils.ObjectInspectorCopyOption.WRITABLE;
import static org.apache.hadoop.hive.serde2.typeinfo.TypeInfoUtils.getTypeInfoFromObjectInspector;

public class Serializer {
  private final int MAX_BUFFERED_ROWS;
  private final static byte[] EMPTY_BYTES = new byte[0];

  // Hive columns
  private final VectorizedRowBatch vectorizedRowBatch;
  private final VectorAssignRow vectorAssignRow;
  private int batchSize;
  private BufferAllocator allocator;
  private List<TypeInfo> fieldTypeInfos;
  private List<String> fieldNames;
  private int fieldSize;

  private final StructVector rootVector;
  private final DecimalHolder decimalHolder = new DecimalHolder();

  //Constructor for non-serde serialization
  public Serializer(Configuration conf, String attemptId, List<TypeInfo> typeInfos, List<String> fieldNames) {
    this.fieldTypeInfos = typeInfos;
    this.fieldNames = fieldNames;
    long childAllocatorLimit = HiveConf.getLongVar(conf, HIVE_ARROW_BATCH_ALLOCATOR_LIMIT);
    //Use per-task allocator for accounting only, no need to reserve per-task memory
    long childAllocatorReservation = 0L;
    //Break out accounting of direct memory per-task, so we can check no memory is leaked when task is completed
    allocator = RootAllocatorFactory.INSTANCE.getRootAllocator(conf).newChildAllocator(
        attemptId,
        childAllocatorReservation,
        childAllocatorLimit);
    rootVector = StructVector.empty(null, allocator);
    //These last fields are unused in non-serde usage
    vectorizedRowBatch = null;
    vectorAssignRow = null;
    MAX_BUFFERED_ROWS = 0;
  }

  Serializer(ArrowColumnarBatchSerDe serDe) throws SerDeException {
    MAX_BUFFERED_ROWS = HiveConf.getIntVar(serDe.conf, HIVE_ARROW_BATCH_SIZE);
    long childAllocatorLimit = HiveConf.getLongVar(serDe.conf, HIVE_ARROW_BATCH_ALLOCATOR_LIMIT);
    ArrowColumnarBatchSerDe.LOG.info("ArrowColumnarBatchSerDe max number of buffered columns: " + MAX_BUFFERED_ROWS);
    String childAllocatorName = Thread.currentThread().getName();
    //Use per-task allocator for accounting only, no need to reserve per-task memory
    long childAllocatorReservation = 0L;
    //Break out accounting of direct memory per-task, so we can check no memory is leaked when task is completed
    allocator = serDe.rootAllocator.newChildAllocator(
        childAllocatorName,
        childAllocatorReservation,
        childAllocatorLimit);

    // Schema
    StructTypeInfo structTypeInfo = (StructTypeInfo) getTypeInfoFromObjectInspector(serDe.rowObjectInspector);
    fieldTypeInfos = structTypeInfo.getAllStructFieldTypeInfos();
    fieldNames = structTypeInfo.getAllStructFieldNames();
    fieldSize = fieldTypeInfos.size();
    // Init Arrow stuffs
    rootVector = StructVector.empty(null, allocator);

    // Init Hive stuffs
    vectorizedRowBatch = new VectorizedRowBatch(fieldSize);
    for (int fieldIndex = 0; fieldIndex < fieldSize; fieldIndex++) {
      final ColumnVector columnVector = createColumnVector(fieldTypeInfos.get(fieldIndex));
      vectorizedRowBatch.cols[fieldIndex] = columnVector;
      columnVector.init();
    }
    vectorizedRowBatch.ensureSize(MAX_BUFFERED_ROWS);
    vectorAssignRow = new VectorAssignRow();
    try {
      vectorAssignRow.init(serDe.rowObjectInspector);
    } catch (HiveException e) {
      throw new SerDeException(e);
    }
  }

  //Construct an emptyBatch which contains schema-only info
  public ArrowWrapperWritable emptyBatch() {
    rootVector.setValueCount(0);
    for (int fieldIndex = 0; fieldIndex < fieldTypeInfos.size(); fieldIndex++) {
      final TypeInfo fieldTypeInfo = fieldTypeInfos.get(fieldIndex);
      final String fieldName = fieldNames.get(fieldIndex);
      final FieldType fieldType = toFieldType(fieldTypeInfo);
      final FieldVector arrowVector = rootVector.addOrGet(fieldName, fieldType, FieldVector.class);
      arrowVector.setInitialCapacity(0);
      arrowVector.allocateNew();
    }
    VectorSchemaRoot vectorSchemaRoot = new VectorSchemaRoot(rootVector);
    return new ArrowWrapperWritable(vectorSchemaRoot, allocator, rootVector);
  }

  //Used for both:
  //1. VectorizedRowBatch constructed by batching rows
  //2. VectorizedRowBatch provided from upstream (isNative)
  public ArrowWrapperWritable serializeBatch(VectorizedRowBatch vectorizedRowBatch, boolean isNative) {
    rootVector.setValueCount(0);

    for (int fieldIndex = 0; fieldIndex < vectorizedRowBatch.projectionSize; fieldIndex++) {
      final int projectedColumn = vectorizedRowBatch.projectedColumns[fieldIndex];
      final ColumnVector hiveVector = vectorizedRowBatch.cols[projectedColumn];
      final TypeInfo fieldTypeInfo = fieldTypeInfos.get(fieldIndex);
      final String fieldName = fieldNames.get(fieldIndex);
      final FieldType fieldType = toFieldType(fieldTypeInfo);
      //Reuse existing FieldVector buffers
      //since we always call setValue or setNull for each row
      boolean fieldExists = false;
      if(rootVector.getChild(fieldName) != null) {
        fieldExists = true;
      }
      final FieldVector arrowVector = rootVector.addOrGet(fieldName, fieldType, FieldVector.class);
      if(fieldExists) {
        arrowVector.setValueCount(isNative ? vectorizedRowBatch.size : batchSize);
      } else {
        arrowVector.setInitialCapacity(isNative ? vectorizedRowBatch.size : batchSize);
        arrowVector.allocateNew();
      }
      write(arrowVector, hiveVector, fieldTypeInfo, isNative ? vectorizedRowBatch.size : batchSize, vectorizedRowBatch, isNative);
    }
    if(!isNative) {
      //Only mutate batches that are constructed by this serde
      vectorizedRowBatch.reset();
      rootVector.setValueCount(batchSize);
    } else {
      rootVector.setValueCount(vectorizedRowBatch.size);
    }

    batchSize = 0;
    VectorSchemaRoot vectorSchemaRoot = new VectorSchemaRoot(rootVector);
    return new ArrowWrapperWritable(vectorSchemaRoot, allocator, rootVector);
  }

  private static FieldType toFieldType(TypeInfo typeInfo) {
    return new FieldType(true, toArrowType(typeInfo), null);
  }

  private static ArrowType toArrowType(TypeInfo typeInfo) {
    switch (typeInfo.getCategory()) {
      case PRIMITIVE:
        switch (((PrimitiveTypeInfo) typeInfo).getPrimitiveCategory()) {
          case BOOLEAN:
            return Types.MinorType.BIT.getType();
          case BYTE:
            return Types.MinorType.TINYINT.getType();
          case SHORT:
            return Types.MinorType.SMALLINT.getType();
          case INT:
            return Types.MinorType.INT.getType();
          case LONG:
            return Types.MinorType.BIGINT.getType();
          case FLOAT:
            return Types.MinorType.FLOAT4.getType();
          case DOUBLE:
            return Types.MinorType.FLOAT8.getType();
          case STRING:
          case VARCHAR:
          case CHAR:
            return Types.MinorType.VARCHAR.getType();
          case DATE:
            return Types.MinorType.DATEDAY.getType();
          case TIMESTAMP:
            // HIVE-19853: Prefer timestamp in microsecond with time zone because Spark supports it
            return new ArrowType.Timestamp(TimeUnit.MICROSECOND, "UTC");
          case BINARY:
            return Types.MinorType.VARBINARY.getType();
          case DECIMAL:
            final DecimalTypeInfo decimalTypeInfo = (DecimalTypeInfo) typeInfo;
            return new ArrowType.Decimal(decimalTypeInfo.precision(), decimalTypeInfo.scale());
          case INTERVAL_YEAR_MONTH:
            return Types.MinorType.INTERVALYEAR.getType();
          case INTERVAL_DAY_TIME:
            return Types.MinorType.INTERVALDAY.getType();
          case VOID:
          case TIMESTAMPLOCALTZ:
          case UNKNOWN:
          default:
            throw new IllegalArgumentException();
        }
      case LIST:
        return ArrowType.List.INSTANCE;
      case STRUCT:
        return ArrowType.Struct.INSTANCE;
      case MAP:
        return ArrowType.List.INSTANCE;
      case UNION:
      default:
        throw new IllegalArgumentException();
    }
  }

  private void write(FieldVector arrowVector, ColumnVector hiveVector, TypeInfo typeInfo, int size,
      VectorizedRowBatch vectorizedRowBatch, boolean isNative) {
    switch (typeInfo.getCategory()) {
      case PRIMITIVE:
        writePrimitive(arrowVector, hiveVector, typeInfo, size, vectorizedRowBatch, isNative);
        break;
      case LIST:
        writeList((ListVector) arrowVector, (ListColumnVector) hiveVector, (ListTypeInfo) typeInfo, size, vectorizedRowBatch, isNative);
        break;
      case STRUCT:
        writeStruct((NonNullableStructVector) arrowVector, (StructColumnVector) hiveVector, (StructTypeInfo) typeInfo, size, vectorizedRowBatch, isNative);
        break;
      case UNION:
        writeUnion(arrowVector, hiveVector, typeInfo, size, vectorizedRowBatch, isNative);
        break;
      case MAP:
        writeMap((ListVector) arrowVector, (MapColumnVector) hiveVector, (MapTypeInfo) typeInfo, size, vectorizedRowBatch, isNative);
        break;
      default:
        throw new IllegalArgumentException();
      }
  }

  private void writeMap(ListVector arrowVector, MapColumnVector hiveVector, MapTypeInfo typeInfo,
      int size, VectorizedRowBatch vectorizedRowBatch, boolean isNative) {
    final ListTypeInfo structListTypeInfo = toStructListTypeInfo(typeInfo);
    final ListColumnVector structListVector = toStructListVector(hiveVector);

    write(arrowVector, structListVector, structListTypeInfo, size, vectorizedRowBatch, isNative);

    final ArrowBuf validityBuffer = arrowVector.getValidityBuffer();
    for (int rowIndex = 0; rowIndex < size; rowIndex++) {
      if (hiveVector.isNull[rowIndex]) {
        BitVectorHelper.setValidityBit(validityBuffer, rowIndex, 0);
      } else {
        BitVectorHelper.setValidityBitToOne(validityBuffer, rowIndex);
      }
    }
  }

  private void writeUnion(FieldVector arrowVector, ColumnVector hiveVector, TypeInfo typeInfo,
      int size, VectorizedRowBatch vectorizedRowBatch, boolean isNative) {
    final UnionTypeInfo unionTypeInfo = (UnionTypeInfo) typeInfo;
    final List<TypeInfo> objectTypeInfos = unionTypeInfo.getAllUnionObjectTypeInfos();
    final UnionColumnVector hiveUnionVector = (UnionColumnVector) hiveVector;
    final ColumnVector[] hiveObjectVectors = hiveUnionVector.fields;

    final int tag = hiveUnionVector.tags[0];
    final ColumnVector hiveObjectVector = hiveObjectVectors[tag];
    final TypeInfo objectTypeInfo = objectTypeInfos.get(tag);

    write(arrowVector, hiveObjectVector, objectTypeInfo, size, vectorizedRowBatch, isNative);
  }

  private void writeStruct(NonNullableStructVector arrowVector, StructColumnVector hiveVector,
      StructTypeInfo typeInfo, int size, VectorizedRowBatch vectorizedRowBatch, boolean isNative) {
    final List<String> fieldNames = typeInfo.getAllStructFieldNames();
    final List<TypeInfo> fieldTypeInfos = typeInfo.getAllStructFieldTypeInfos();
    final ColumnVector[] hiveFieldVectors = hiveVector.fields;
    final int fieldSize = fieldTypeInfos.size();

    for (int fieldIndex = 0; fieldIndex < fieldSize; fieldIndex++) {
      final TypeInfo fieldTypeInfo = fieldTypeInfos.get(fieldIndex);
      final ColumnVector hiveFieldVector = hiveFieldVectors[fieldIndex];
      final String fieldName = fieldNames.get(fieldIndex);
      final FieldVector arrowFieldVector =
          arrowVector.addOrGet(fieldName,
              toFieldType(fieldTypeInfos.get(fieldIndex)), FieldVector.class);
      arrowFieldVector.setInitialCapacity(size);
      arrowFieldVector.allocateNew();
      write(arrowFieldVector, hiveFieldVector, fieldTypeInfo, size, vectorizedRowBatch, isNative);
    }

    final ArrowBuf validityBuffer = arrowVector.getValidityBuffer();
    for (int rowIndex = 0; rowIndex < size; rowIndex++) {
      if (hiveVector.isNull[rowIndex]) {
        BitVectorHelper.setValidityBit(validityBuffer, rowIndex, 0);
      } else {
        BitVectorHelper.setValidityBitToOne(validityBuffer, rowIndex);
      }
    }
  }

  private void writeList(ListVector arrowVector, ListColumnVector hiveVector, ListTypeInfo typeInfo, int size,
      VectorizedRowBatch vectorizedRowBatch, boolean isNative) {
    final int OFFSET_WIDTH = 4;
    final TypeInfo elementTypeInfo = typeInfo.getListElementTypeInfo();
    final ColumnVector hiveElementVector = hiveVector.child;
    final FieldVector arrowElementVector =
        (FieldVector) arrowVector.addOrGetVector(toFieldType(elementTypeInfo)).getVector();
    arrowElementVector.setInitialCapacity(hiveVector.childCount);
    arrowElementVector.allocateNew();

    write(arrowElementVector, hiveElementVector, elementTypeInfo, hiveVector.childCount, vectorizedRowBatch, isNative);

    final ArrowBuf offsetBuffer = arrowVector.getOffsetBuffer();
    int nextOffset = 0;

    for (int rowIndex = 0; rowIndex < size; rowIndex++) {
      if (hiveVector.isNull[rowIndex]) {
        offsetBuffer.setInt(rowIndex * OFFSET_WIDTH, nextOffset);
      } else {
        offsetBuffer.setInt(rowIndex * OFFSET_WIDTH, nextOffset);
        nextOffset += (int) hiveVector.lengths[rowIndex];
        arrowVector.setNotNull(rowIndex);
      }
    }
    offsetBuffer.setInt(size * OFFSET_WIDTH, nextOffset);
  }

  //Handle cases for both internally constructed
  //and externally provided (isNative) VectorRowBatch
  private void writePrimitive(FieldVector arrowVector, ColumnVector hiveVector, TypeInfo typeInfo, int size,
      VectorizedRowBatch vectorizedRowBatch, boolean isNative) {
    final PrimitiveObjectInspector.PrimitiveCategory primitiveCategory =
        ((PrimitiveTypeInfo) typeInfo).getPrimitiveCategory();
    switch (primitiveCategory) {
    case BOOLEAN:
    {
      if(isNative) {
      writeGeneric(arrowVector, hiveVector, size, vectorizedRowBatch.selectedInUse, vectorizedRowBatch.selected, boolNullSetter, boolValueSetter, typeInfo);
        return;
      }
      final BitVector bitVector = (BitVector) arrowVector;
      for (int i = 0; i < size; i++) {
        if (hiveVector.isNull[i]) {
          boolNullSetter.accept(i, arrowVector, hiveVector);
        } else {
          boolValueSetter.accept(i, i, arrowVector, hiveVector, typeInfo);
        }
      }
    }
    break;
    case BYTE:
    {
      if(isNative) {
        writeGeneric(arrowVector, hiveVector, size, vectorizedRowBatch.selectedInUse, vectorizedRowBatch.selected, byteNullSetter, byteValueSetter, typeInfo);
        return;
      }
      final TinyIntVector tinyIntVector = (TinyIntVector) arrowVector;
      for (int i = 0; i < size; i++) {
        if (hiveVector.isNull[i]) {
          byteNullSetter.accept(i, arrowVector, hiveVector);
        } else {
          byteValueSetter.accept(i, i, arrowVector, hiveVector, typeInfo);
        }
      }
    }
    break;
    case SHORT:
    {
      if(isNative) {
        writeGeneric(arrowVector, hiveVector, size, vectorizedRowBatch.selectedInUse, vectorizedRowBatch.selected, shortNullSetter, shortValueSetter, typeInfo);
        return;
      }
      final SmallIntVector smallIntVector = (SmallIntVector) arrowVector;
      for (int i = 0; i < size; i++) {
        if (hiveVector.isNull[i]) {
          shortNullSetter.accept(i, arrowVector, hiveVector);
        } else {
          shortValueSetter.accept(i, i, arrowVector, hiveVector, typeInfo);
        }
      }
    }
    break;
    case INT:
    {
      if(isNative) {
        writeGeneric(arrowVector, hiveVector, size, vectorizedRowBatch.selectedInUse, vectorizedRowBatch.selected, intNullSetter, intValueSetter, typeInfo);
        return;
      }
      for (int i = 0; i < size; i++) {
        if (hiveVector.isNull[i]) {
          intNullSetter.accept(i, arrowVector, hiveVector);
        } else {
          intValueSetter.accept(i, i, arrowVector, hiveVector, typeInfo);
        }
      }
    }
    break;
    case LONG:
    {
      if(isNative) {
        writeGeneric(arrowVector, hiveVector, size, vectorizedRowBatch.selectedInUse, vectorizedRowBatch.selected, longNullSetter, longValueSetter, typeInfo);
        return;
      }
      final BigIntVector bigIntVector = (BigIntVector) arrowVector;
      for (int i = 0; i < size; i++) {
        if (hiveVector.isNull[i]) {
          longNullSetter.accept(i, arrowVector, hiveVector);
        } else {
          longValueSetter.accept(i, i, arrowVector, hiveVector, typeInfo);
        }
      }
    }
    break;
    case FLOAT:
    {
      if(isNative) {
        writeGeneric(arrowVector, hiveVector, size, vectorizedRowBatch.selectedInUse, vectorizedRowBatch.selected, floatNullSetter, floatValueSetter, typeInfo);
        return;
      }
      for (int i = 0; i < size; i++) {
        if (hiveVector.isNull[i]) {
          floatNullSetter.accept(i, arrowVector, hiveVector);
        } else {
          floatValueSetter.accept(i, i, arrowVector, hiveVector, typeInfo);
        }
      }
    }
    break;
    case DOUBLE:
    {
      if(isNative) {
        writeGeneric(arrowVector, hiveVector, size, vectorizedRowBatch.selectedInUse, vectorizedRowBatch.selected, doubleNullSetter, doubleValueSetter, typeInfo);
        return;
      }
      final Float8Vector float8Vector = (Float8Vector) arrowVector;
      for (int i = 0; i < size; i++) {
        if (hiveVector.isNull[i]) {
          doubleNullSetter.accept(i, arrowVector, hiveVector);
        } else {
          doubleValueSetter.accept(i, i, arrowVector, hiveVector, typeInfo);
        }
      }
    }
    break;
    case CHAR:
    {
      if(isNative) {
        writeGeneric(arrowVector, hiveVector, size, vectorizedRowBatch.selectedInUse, vectorizedRowBatch.selected, charNullSetter, charValueSetter, typeInfo);
        return;
      }
      for (int i = 0; i < size; i++) {
        if (hiveVector.isNull[i]) {
          charNullSetter.accept(i, arrowVector, hiveVector);
        } else {
          charValueSetter.accept(i, i, arrowVector, hiveVector, typeInfo);
        }
      }
    }
    break;
    case STRING:
    case VARCHAR:
    {
      if(isNative) {
        writeGeneric(arrowVector, hiveVector, size, vectorizedRowBatch.selectedInUse, vectorizedRowBatch.selected, stringNullSetter, stringValueSetter, typeInfo);
        return;
      }
      for (int i = 0; i < size; i++) {
        if (hiveVector.isNull[i]) {
          stringNullSetter.accept(i, arrowVector, hiveVector);
        } else {
          stringValueSetter.accept(i, i, arrowVector, hiveVector, typeInfo);
        }
      }
    }
    break;
    case DATE:
    {
      if(isNative) {
        writeGeneric(arrowVector, hiveVector, size, vectorizedRowBatch.selectedInUse, vectorizedRowBatch.selected, dateNullSetter, dateValueSetter, typeInfo);
        return;
      }
      for (int i = 0; i < size; i++) {
        if (hiveVector.isNull[i]) {
          dateNullSetter.accept(i, arrowVector, hiveVector);
        } else {
          dateValueSetter.accept(i, i, arrowVector, hiveVector, typeInfo);
        }
      }
    }
    break;
    case TIMESTAMP:
    {
      if(isNative) {
        writeGeneric(arrowVector, hiveVector, size, vectorizedRowBatch.selectedInUse, vectorizedRowBatch.selected, timestampNullSetter, timestampValueSetter, typeInfo);
        return;
      }
      for (int i = 0; i < size; i++) {
        if (hiveVector.isNull[i]) {
          timestampNullSetter.accept(i, arrowVector, hiveVector);
        } else {
          timestampValueSetter.accept(i, i, arrowVector, hiveVector, typeInfo);
        }
      }
    }
    break;
    case BINARY:
    {
      if(isNative) {
        writeGeneric(arrowVector, hiveVector, size, vectorizedRowBatch.selectedInUse, vectorizedRowBatch.selected, binaryNullSetter, binaryValueSetter, typeInfo);
        return;
      }
      for (int i = 0; i < size; i++) {
        if (hiveVector.isNull[i]) {
          binaryNullSetter.accept(i, arrowVector, hiveVector);
        } else {
          binaryValueSetter.accept(i, i, arrowVector, hiveVector, typeInfo);
        }
      }
    }
    break;
    case DECIMAL:
    {
      if(isNative) {
        if(hiveVector instanceof DecimalColumnVector) {
          writeGeneric(arrowVector, hiveVector, size, vectorizedRowBatch.selectedInUse, vectorizedRowBatch.selected, decimalNullSetter, decimalValueSetter, typeInfo);
        } else {
          writeGeneric(arrowVector, hiveVector, size, vectorizedRowBatch.selectedInUse, vectorizedRowBatch.selected, decimalNullSetter, decimal64ValueSetter, typeInfo);
        }
        return;
      }
      for (int i = 0; i < size; i++) {
        if (hiveVector.isNull[i]) {
          decimalNullSetter.accept(i, arrowVector, hiveVector);
        } else if(hiveVector instanceof DecimalColumnVector) {
          decimalValueSetter.accept(i, i, arrowVector, hiveVector, typeInfo);
        } else if(hiveVector instanceof Decimal64ColumnVector) {
          decimal64ValueSetter.accept(i, i, arrowVector, hiveVector, typeInfo);
        } else {
          throw new IllegalArgumentException("Unsupported vector column type: " + hiveVector.getClass().getName());
        }
      }
    }
    break;
    case INTERVAL_YEAR_MONTH:
    {
      if(isNative) {
       writeGeneric(arrowVector, hiveVector, size, vectorizedRowBatch.selectedInUse, vectorizedRowBatch.selected, intervalYearMonthNullSetter, intervalYearMonthValueSetter, typeInfo);
        return;
      }
      for (int i = 0; i < size; i++) {
        if (hiveVector.isNull[i]) {
          intervalYearMonthNullSetter.accept(i, arrowVector, hiveVector);
        } else {
          intervalYearMonthValueSetter.accept(i, i, arrowVector, hiveVector, typeInfo);
        }
      }
    }
    break;
    case INTERVAL_DAY_TIME:
    {
      if(isNative) {
        writeGeneric(arrowVector, hiveVector, size, vectorizedRowBatch.selectedInUse, vectorizedRowBatch.selected, intervalDayTimeNullSetter, intervalDayTimeValueSetter, typeInfo);
        return;
      }
      for (int i = 0; i < size; i++) {
        if (hiveVector.isNull[i]) {
          intervalDayTimeNullSetter.accept(i, arrowVector, hiveVector);
        } else {
          intervalDayTimeValueSetter.accept(i, i, arrowVector, hiveVector, typeInfo);
        }
      }
    }
    break;
    case VOID:
    case UNKNOWN:
    case TIMESTAMPLOCALTZ:
    default:
      throw new IllegalArgumentException();
    }
  }

  ArrowWrapperWritable serialize(Object obj, ObjectInspector objInspector) {
    // if row is null, it means there are no more rows (closeOp()).
    // another case can be that the buffer is full.
    if (obj == null) {
      return serializeBatch(vectorizedRowBatch, false);
    }
    List<Object> standardObjects = new ArrayList<Object>();
    ObjectInspectorUtils.copyToStandardObject(standardObjects, obj,
        ((StructObjectInspector) objInspector), WRITABLE);

    vectorAssignRow.assignRow(vectorizedRowBatch, batchSize, standardObjects, fieldSize);
    batchSize++;
    if (batchSize == MAX_BUFFERED_ROWS) {
      return serializeBatch(vectorizedRowBatch, false);
    }
    return null;
  }

 //Use a provided nullSetter and valueSetter function to populate
 //fieldVector from hiveVector
 private static void writeGeneric(final FieldVector fieldVector, final ColumnVector hiveVector, final int size, final boolean selectedInUse, final int[] selected, final IntAndVectorsConsumer nullSetter, final IntIntAndVectorsConsumer valueSetter, TypeInfo typeInfo)
  {
     final boolean[] inputIsNull = hiveVector.isNull;
     final int[] sel = selected;

     if (hiveVector.isRepeating) {
       if (hiveVector.noNulls || !inputIsNull[0]) {
         for(int i = 0; i < size; i++) {
           //Fill n rows with value in row 0
           valueSetter.accept(i, 0, fieldVector, hiveVector, typeInfo);
         }
       } else {
         for(int i = 0; i < size; i++) {
           //Fill n rows with NULL
           nullSetter.accept(i, fieldVector, hiveVector);
         }
       }
       return;
     }

     if (hiveVector.noNulls) {
       if (selectedInUse) {
         for(int logical = 0; logical < size; logical++) {
           final int batchIndex = sel[logical];
           //Add row batchIndex
           valueSetter.accept(logical, batchIndex, fieldVector, hiveVector, typeInfo);
         }
       } else {
         for(int batchIndex = 0; batchIndex < size; batchIndex++) {
           //Add row batchIndex
           valueSetter.accept(batchIndex, batchIndex, fieldVector, hiveVector, typeInfo);
         }
       }
     } else {
       if (selectedInUse) {
         for(int logical = 0; logical < size; logical++) {
           final int batchIndex = sel[logical];
           if (inputIsNull[batchIndex]) {
             //Add NULL
             nullSetter.accept(batchIndex, fieldVector, hiveVector);
           } else {
             //Add row batchIndex
             valueSetter.accept(logical, batchIndex, fieldVector, hiveVector, typeInfo);
          }
        }
       } else {
         for(int batchIndex = 0; batchIndex < size; batchIndex++) {
           if (inputIsNull[batchIndex]) {
             //Add NULL
             nullSetter.accept(batchIndex, fieldVector, hiveVector);
           } else {
             //Add row batchIndex
             valueSetter.accept(batchIndex, batchIndex, fieldVector, hiveVector, typeInfo);
         }
       }
     }
   }
  }

  //nullSetters and valueSetter for each type

  //bool
  private static final IntAndVectorsConsumer boolNullSetter = (i, arrowVector, hiveVector)
      -> ((BitVector) arrowVector).setNull(i);
  private static final IntIntAndVectorsConsumer boolValueSetter = (i, j, arrowVector, hiveVector, typeInfo)
      -> ((BitVector) arrowVector).set(i, (int) ((LongColumnVector) hiveVector).vector[j]);

  //byte
  private static final IntAndVectorsConsumer byteNullSetter = (i, arrowVector, hiveVector)
      -> ((TinyIntVector) arrowVector).setNull(i);
  private static final IntIntAndVectorsConsumer byteValueSetter = (i, j, arrowVector, hiveVector, typeInfo)
      -> ((TinyIntVector) arrowVector).set(i, (byte) ((LongColumnVector) hiveVector).vector[j]);

  //short
  private static final IntAndVectorsConsumer shortNullSetter = (i, arrowVector, hiveVector)
      -> ((SmallIntVector) arrowVector).setNull(i);
  private static final IntIntAndVectorsConsumer shortValueSetter = (i, j, arrowVector, hiveVector, typeInfo)
      -> ((SmallIntVector) arrowVector).set(i, (short) ((LongColumnVector) hiveVector).vector[j]);

  //int
  private static final IntAndVectorsConsumer intNullSetter = (i, arrowVector, hiveVector)
      -> ((IntVector) arrowVector).setNull(i);
  private static final IntIntAndVectorsConsumer intValueSetter = (i, j, arrowVector, hiveVector, typeInfo)
      -> ((IntVector) arrowVector).set(i, (int) ((LongColumnVector) hiveVector).vector[j]);

  //long
  private static final IntAndVectorsConsumer longNullSetter = (i, arrowVector, hiveVector)
      -> ((BigIntVector) arrowVector).setNull(i);
  private static final IntIntAndVectorsConsumer longValueSetter = (i, j, arrowVector, hiveVector, typeInfo)
      -> ((BigIntVector) arrowVector).set(i, ((LongColumnVector) hiveVector).vector[j]);

  //float
  private static final IntAndVectorsConsumer floatNullSetter = (i, arrowVector, hiveVector)
      -> ((Float4Vector) arrowVector).setNull(i);
  private static final IntIntAndVectorsConsumer floatValueSetter = (i, j, arrowVector, hiveVector, typeInfo)
      -> ((Float4Vector) arrowVector).set(i, (float) ((DoubleColumnVector) hiveVector).vector[j]);

  //double
  private static final IntAndVectorsConsumer doubleNullSetter = (i, arrowVector, hiveVector)
      -> ((Float8Vector) arrowVector).setNull(i);
  private static final IntIntAndVectorsConsumer doubleValueSetter = (i, j, arrowVector, hiveVector, typeInfo)
      -> ((Float8Vector) arrowVector).set(i, ((DoubleColumnVector) hiveVector).vector[j]);

  //string/varchar
  private static final IntAndVectorsConsumer stringNullSetter = (i, arrowVector, hiveVector)
      -> ((VarCharVector) arrowVector).setNull(i);
  private static final IntIntAndVectorsConsumer stringValueSetter = (i, j, arrowVector, hiveVector, typeInfo)
      -> {
    BytesColumnVector bytesVector = (BytesColumnVector) hiveVector;
    ((VarCharVector) arrowVector).setSafe(i, bytesVector.vector[j], bytesVector.start[j], bytesVector.length[j]);
  };

  //fixed-length CHAR
  private static final IntAndVectorsConsumer charNullSetter = (i, arrowVector, hiveVector)
      -> ((VarCharVector) arrowVector).setNull(i);
  private static final IntIntAndVectorsConsumer charValueSetter = (i, j, arrowVector, hiveVector, typeInfo)
      -> {
    BytesColumnVector bytesVector = (BytesColumnVector) hiveVector;
    VarCharVector varCharVector = (VarCharVector) arrowVector;
    byte[] bytes = bytesVector.vector[j];
    int length = bytesVector.length[j];
    int start = bytesVector.start[j];

    if (bytes == null) {
      bytes = EMPTY_BYTES;
      start = 0;
      length = 0;
    }

    final CharTypeInfo charTypeInfo = (CharTypeInfo) typeInfo;
    final int paddedLength = charTypeInfo.getLength();
    final byte[] paddedBytes = StringExpr.padRight(bytes, start, length, paddedLength);
    varCharVector.setSafe(i, paddedBytes, 0, paddedBytes.length);
  };

  //date
  private static final IntAndVectorsConsumer dateNullSetter = (i, arrowVector, hiveVector)
      -> ((DateDayVector) arrowVector).setNull(i);
  private static final IntIntAndVectorsConsumer dateValueSetter = (i, j, arrowVector, hiveVector, typeInfo)
      -> ((DateDayVector) arrowVector).set(i, (int) ((LongColumnVector) hiveVector).vector[j]);

  //timestamp
  private static final IntAndVectorsConsumer timestampNullSetter = (i, arrowVector, hiveVector)
      -> ((TimeStampMicroTZVector) arrowVector).setNull(i);
  private static final IntIntAndVectorsConsumer timestampValueSetter = (i, j, arrowVector, hiveVector, typeInfo)
      -> {
    final TimeStampMicroTZVector timeStampMicroTZVector = (TimeStampMicroTZVector) arrowVector;
    final TimestampColumnVector timestampColumnVector = (TimestampColumnVector) hiveVector;
    // Time = second + sub-second
    final long secondInMillis = timestampColumnVector.getTime(j);
    final long nanos = timestampColumnVector.getNanos(j);
    // nanos should be subtracted from total time(secondInMillis) to obtain micros
    // Divide nanos by 1000_000 to bring it to millisecond precision and then perform the subtraction
    final long secondInMicros = (secondInMillis - nanos / NS_PER_MILLIS) * MICROS_PER_MILLIS;
    final long subSecondInMicros = nanos / NS_PER_MICROS;
    if ((secondInMillis > 0 && secondInMicros < 0) || (secondInMillis < 0 && secondInMicros > 0)) {
      // If the timestamp cannot be represented in long microsecond, set it as a null value
      timeStampMicroTZVector.setNull(i);
    } else {
      timeStampMicroTZVector.set(i, secondInMicros + subSecondInMicros);
    }
  };

  //binary
  private static final IntAndVectorsConsumer binaryNullSetter = (i, arrowVector, hiveVector)
      -> ((VarBinaryVector) arrowVector).setNull(i);
  private static final IntIntAndVectorsConsumer binaryValueSetter = (i, j, arrowVector, hiveVector, typeInfo)
      -> {
    BytesColumnVector bytesVector = (BytesColumnVector) hiveVector;
    ((VarBinaryVector) arrowVector).setSafe(i, bytesVector.vector[j], bytesVector.start[j], bytesVector.length[j]);
  };

  //decimal and decimal64
  private static final IntAndVectorsConsumer decimalNullSetter = (i, arrowVector, hiveVector)
      -> ((DecimalVector) arrowVector).setNull(i);
  private final IntIntAndVectorsConsumer decimalValueSetter = (i, j, arrowVector, hiveVector, typeInfo)
      -> {
    final DecimalVector decimalVector = (DecimalVector) arrowVector;
    final int scale = decimalVector.getScale();
    decimalVector.set(i, ((DecimalColumnVector) hiveVector).vector[j].getHiveDecimal().bigDecimalValue().setScale(scale));

    final HiveDecimalWritable writable = ((DecimalColumnVector) hiveVector).vector[i];
    decimalHolder.precision = writable.precision();
    decimalHolder.scale = scale;
    try (ArrowBuf arrowBuf = allocator.buffer(DecimalHolder.WIDTH)) {
      decimalHolder.buffer = arrowBuf;
      final BigInteger bigInteger = new BigInteger(writable.getInternalStorage()).
          multiply(BigInteger.TEN.pow(scale - writable.scale()));
      decimalVector.set(i, new BigDecimal(bigInteger, scale));
    }
  };
  private static final IntIntAndVectorsConsumer decimal64ValueSetter = (i, j, arrowVector, hiveVector, typeInfo)
      -> {
    final DecimalVector decimalVector = (DecimalVector) arrowVector;
    final int scale = decimalVector.getScale();
    HiveDecimalWritable decimalHolder = new HiveDecimalWritable();
    decimalHolder.setFromLongAndScale(((Decimal64ColumnVector) hiveVector).vector[j], scale);
    decimalVector.set(i, decimalHolder.getHiveDecimal().bigDecimalValue().setScale(scale));
  };

  //interval year
  private static final IntAndVectorsConsumer intervalYearMonthNullSetter = (i, arrowVector, hiveVector)
      -> ((IntervalYearVector) arrowVector).setNull(i);
  private static IntIntAndVectorsConsumer intervalYearMonthValueSetter = (i, j, arrowVector, hiveVector, typeInfo)
      -> ((IntervalYearVector) arrowVector).set(i, (int) ((LongColumnVector) hiveVector).vector[j]);

  //interval day
  private static final IntAndVectorsConsumer intervalDayTimeNullSetter = (i, arrowVector, hiveVector)
      -> ((IntervalDayVector) arrowVector).setNull(i);
  private static IntIntAndVectorsConsumer intervalDayTimeValueSetter = (i, j, arrowVector, hiveVector, typeInfo)
      -> {
    final IntervalDayVector intervalDayVector = (IntervalDayVector) arrowVector;
    final IntervalDayTimeColumnVector intervalDayTimeColumnVector =
        (IntervalDayTimeColumnVector) hiveVector;
    long totalSeconds = intervalDayTimeColumnVector.getTotalSeconds(j);
    final long days = totalSeconds / SECOND_PER_DAY;
    final long millis =
        (totalSeconds - days * SECOND_PER_DAY) * MILLIS_PER_SECOND +
            intervalDayTimeColumnVector.getNanos(j) / NS_PER_MILLIS;
    intervalDayVector.set(i, (int) days, (int) millis);
  };

  //Used for setting null at arrowVector[i]
  private interface IntAndVectorsConsumer {
    void accept(int i, FieldVector arrowVector, ColumnVector hiveVector);
  }

  //Used to copy value from hiveVector[j] -> arrowVector[i]
  //since hiveVector might be referenced through vector.selected
  private interface IntIntAndVectorsConsumer {
    void accept(int i, int j, FieldVector arrowVector, ColumnVector hiveVector, TypeInfo typeInfo);
  }

}


text:
package org.apache.isis.viewer.restfulobjects.server;

import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.ws.rs.core.HttpHeaders;
import javax.ws.rs.core.MediaType;
import com.google.common.collect.Maps;
import org.jmock.Expectations;
import org.jmock.Mockery;
import org.jmock.integration.junit4.JUnit4Mockery;
import org.junit.Before;
import org.junit.Test;
import org.apache.isis.viewer.restfulobjects.applib.RepresentationType;
import org.apache.isis.viewer.restfulobjects.applib.client.RestfulResponse.HttpStatusCode;
import org.apache.isis.viewer.restfulobjects.rendering.RestfulObjectsApplicationException;

import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;

public class ResourceContextTest_ensureCompatibleAcceptHeader {

    private HttpHeaders httpHeaders;
    private HttpServletRequest httpServletRequest;

    private final Mockery context = new JUnit4Mockery();

    @Before
    public void setUp() throws Exception {
        httpHeaders = context.mock(HttpHeaders.class);
        httpServletRequest = context.mock(HttpServletRequest.class);
        context.checking(new Expectations() {
            {
                allowing(httpServletRequest).getQueryString();
                will(returnValue(""));
            }
        });
    }

    @Test
    public void noop() throws Exception {
        final RepresentationType representationType = RepresentationType.HOME_PAGE;
        givenHttpHeadersGetAcceptableMediaTypesReturns(Arrays.<MediaType> asList(representationType.getMediaType()));
        givenServletRequestParameterMapEmpty();

        instantiateResourceContext(representationType);
    }

    @Test
    public void happyCase() throws Exception {
        final RepresentationType representationType = RepresentationType.HOME_PAGE;
        givenHttpHeadersGetAcceptableMediaTypesReturns(Arrays.<MediaType> asList(representationType.getMediaType()));
        givenServletRequestParameterMapEmpty();

        instantiateResourceContext(representationType);
    }

    @Test
    public void acceptGenericAndProduceGeneric() throws Exception {
        final RepresentationType representationType = RepresentationType.GENERIC;
        givenHttpHeadersGetAcceptableMediaTypesReturns(Arrays.<MediaType> asList(MediaType.APPLICATION_JSON_TYPE));
        givenServletRequestParameterMapEmpty();

        instantiateResourceContext(representationType);
    }

    @Test
    public void acceptGenericAndProduceSpecific() throws Exception {
        final RepresentationType representationType = RepresentationType.HOME_PAGE;
        givenHttpHeadersGetAcceptableMediaTypesReturns(Arrays.<MediaType> asList(MediaType.APPLICATION_JSON_TYPE));
        givenServletRequestParameterMapEmpty();

        instantiateResourceContext(representationType);
    }

    @Test
    public void nonMatching() throws Exception {
        final RepresentationType representationType = RepresentationType.HOME_PAGE;
        givenHttpHeadersGetAcceptableMediaTypesReturns(Arrays.<MediaType> asList(MediaType.APPLICATION_ATOM_XML_TYPE));
        givenServletRequestParameterMapEmpty();

        try {
            instantiateResourceContext(representationType);
        } catch(RestfulObjectsApplicationException ex ) {
            assertThat(ex.getHttpStatusCode(), is(HttpStatusCode.NOT_ACCEPTABLE));
        }
    }

    @Test
    public void nonMatchingProfile() throws Exception {
        final RepresentationType representationType = RepresentationType.HOME_PAGE;
        givenHttpHeadersGetAcceptableMediaTypesReturns(Arrays.<MediaType> asList(RepresentationType.USER.getMediaType()));
        givenServletRequestParameterMapEmpty();

        try {
            instantiateResourceContext(representationType);
        } catch(RestfulObjectsApplicationException ex ) {
            assertThat(ex.getHttpStatusCode(), is(HttpStatusCode.NOT_ACCEPTABLE));
        }
    }

    @Test
    public void nonMatchingProfile_ignoreGeneric() throws Exception {
        final RepresentationType representationType = RepresentationType.HOME_PAGE;
        givenHttpHeadersGetAcceptableMediaTypesReturns(Arrays.<MediaType> asList(RepresentationType.USER.getMediaType(), MediaType.APPLICATION_JSON_TYPE));
        givenServletRequestParameterMapEmpty();

        try {
            instantiateResourceContext(representationType);
        } catch(RestfulObjectsApplicationException ex ) {
            assertThat(ex.getHttpStatusCode(), is(HttpStatusCode.NOT_ACCEPTABLE));
        }
    }

    @Test
    public void emptyList_isOK() throws Exception {
        final RepresentationType representationType = RepresentationType.HOME_PAGE;
        givenHttpHeadersGetAcceptableMediaTypesReturns(Arrays.<MediaType> asList());
        givenServletRequestParameterMapEmpty();

        instantiateResourceContext(representationType);
    }

    private void givenHttpHeadersGetAcceptableMediaTypesReturns(final List<MediaType> mediaTypes) {
        context.checking(new Expectations() {
            {
                oneOf(httpHeaders).getAcceptableMediaTypes();
                will(returnValue(mediaTypes));
            }
        });
    }

    private void givenServletRequestParameterMapEmpty() {
        final HashMap<Object, Object> parameterMap = Maps.newHashMap();
        context.checking(new Expectations() {
            {
                oneOf(httpServletRequest).getParameterMap();
                will(returnValue(parameterMap));
            }
        });
    }

    private ResourceContext instantiateResourceContext(
            final RepresentationType representationType) {
        return new ResourceContext(representationType, httpHeaders, null, null, null, null, null, httpServletRequest, null, null, null, null, null, null, null, null, null);
    }

}


text:
package com.ikouz.algorithm.leetcode;

import java.util.HashSet;
import java.util.Set;

/**
 * Write an algorithm to determine if a number is "happy".
 *

 * A happy number is a number defined by the following process: Starting with any positive integer, replace the number by the sum of the squares of its digits,
 * and repeat the process until the number equals 1 (where it will stay), or it loops endlessly in a cycle which does not include 1.
 * Those numbers for which this process ends in 1 are happy numbers.
 *

 * Example: 19 is a happy number
 *

 * 12 + 92 = 82
 * 82 + 22 = 68
 * 62 + 82 = 100
 * 12 + 02 + 02 = 1
 *
 * @author liujiaming
 * @since 2017/07/14
 */
public class HashTable_202_HappyNumber {

    public static boolean isHappy(int n) {
        if (n <= 0) {
            return false;
        }
        Set<Integer> set = new HashSet<>();
        while (n != 1) {
            int sum = 0;
            while (n > 0) {
                sum += (n % 10) * (n % 10);
                n /= 10;
            }
            n = sum;
            if (set.contains(n)) {
                return false;
            }
            set.add(n);
        }
        return true;
    }
}


text:
package com.fincatto.documentofiscal.cte300.classes;

public enum CTTipoTrafego {

    PROPRIO("0", "Próprio"),
    MUTUO("1", "Mútuo"),
    RODOFERROVIARIO("2", "Rodoferroviário"),
    RODOVIARIO("3", "Rodoviário");

    private final String codigo;
    private final String descricao;

    CTTipoTrafego(final String codigo, final String descricao) {
        this.codigo = codigo;
        this.descricao = descricao;
    }

    public String getCodigo() {
        return this.codigo;
    }

    public String getDescricao() {
        return this.descricao;
    }

    public static CTTipoTrafego valueOfCodigo(final String codigo) {
        for (final CTTipoTrafego tipo : CTTipoTrafego.values()) {
            if (tipo.getCodigo().equals(codigo)) {
                return tipo;
            }
        }
        return null;
    }

    @Override
    public String toString() {
        return codigo + " - " + descricao;
    }
}


text:
package com.fh.util;

public class Constants {

	public static String PICTURE_VISIT_FILE_PATH = "";//图片访问的路径

	public static String PICTURE_SAVE_FILE_PATH = "";//图片存放的路径

	public static String getPICTURE_VISIT_FILE_PATH() {
		return PICTURE_VISIT_FILE_PATH;
	}

	public static void setPICTURE_VISIT_FILE_PATH(String pICTURE_VISIT_FILE_PATH) {
		PICTURE_VISIT_FILE_PATH = pICTURE_VISIT_FILE_PATH;
	}

	public static String getPICTURE_SAVE_FILE_PATH() {
		return PICTURE_SAVE_FILE_PATH;
	}

	public static void setPICTURE_SAVE_FILE_PATH(String pICTURE_SAVE_FILE_PATH) {
		PICTURE_SAVE_FILE_PATH = pICTURE_SAVE_FILE_PATH;
	}

	public static void main(String[] args) {
		Constants.setPICTURE_SAVE_FILE_PATH("D:/Tomcat 6.0/webapps/FH/topic/");
		Constants.setPICTURE_VISIT_FILE_PATH("http://192.168.1.225:8888/FH/topic/");
	}

}


text:
// Copyright 2019 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
///////////////////////////////////////////////////////////////////////////////

#ifndef TINK_STREAMINGAEAD_STREAMING_AEAD_KEY_TEMPLATES_H_
#define TINK_STREAMINGAEAD_STREAMING_AEAD_KEY_TEMPLATES_H_

#include "proto/tink.pb.h"

namespace crypto {
namespace tink {

///////////////////////////////////////////////////////////////////////////////
// Pre-generated KeyTemplate for StreamingAead key types. One can use these
// templates to generate new KeysetHandle object with fresh keys.
// To generate a new keyset that contains a single AesGcmKey, one can do:
//
//   auto status = StreamingAeadConfig::Register();
//   if (!status.ok()) { /* fail with error */ }
//   auto handle_result = KeysetHandle::GenerateNew(
//       StreamingAeadKeyTemplates::Aes128GcmHkdf4KB());
//   if (!handle_result.ok()) { /* fail with error */ }
//   auto keyset_handle = std::move(handle_result.value());
class StreamingAeadKeyTemplates {
 public:
  // Returns a KeyTemplate that generates new instances of
  // AesGcmHkdfStreamingKey with the following parameters:
  //   - main key (ikm) size: 16 bytes
  //   - HKDF algorithm: HMAC-SHA256
  //   - size of derived AES-GCM keys: 16 bytes
  //   - ciphertext segment size: 4096 bytes
  //   - OutputPrefixType: RAW
  static const google::crypto::tink::KeyTemplate& Aes128GcmHkdf4KB();

  // Returns a KeyTemplate that generates new instances of
  // AesGcmHkdfStreamingKey with the following parameters:
  //   - main key (ikm) size: 32 bytes
  //   - HKDF algorithm: HMAC-SHA256
  //   - size of derived AES-GCM keys: 32 bytes
  //   - ciphertext segment size: 4096 bytes
  //   - OutputPrefixType: RAW
  static const google::crypto::tink::KeyTemplate& Aes256GcmHkdf4KB();

  // Returns a KeyTemplate that generates new instances of
  // AesGcmHkdfStreamingKey with the following parameters:
  //   - main key (ikm) size: 32 bytes
  //   - HKDF algorithm: HMAC-SHA256
  //   - size of derived AES-GCM keys: 32 bytes
  //   - ciphertext segment size: 1048576 bytes (1 MB)
  //   - OutputPrefixType: RAW
  static const google::crypto::tink::KeyTemplate& Aes256GcmHkdf1MB();

  // Returns a KeyTemplate that generates new instances of
  // AesCtrHmacStreamingKey with the following parameters:
  //   - main key (ikm) size: 16 bytes
  //   - HKDF algorithm: HMAC-SHA256
  //   - size of derived AES-CTR keys: 16 bytes
  //   - tag algorithm: HMAC-SHA256
  //   - tag size: 32 bytes
  //   - ciphertext segment size: 4096 bytes
  //   - OutputPrefixType: RAW
  static const google::crypto::tink::KeyTemplate&
  Aes128CtrHmacSha256Segment4KB();

  // Returns a KeyTemplate that generates new instances of
  // AesCtrHmacStreamingKey with the following parameters:
  //   - main key (ikm) size: 32 bytes
  //   - HKDF algorithm: HMAC-SHA256
  //   - size of derived AES-CTR keys: 32 bytes
  //   - tag algorithm: HMAC-SHA256
  //   - tag size: 32 bytes
  //   - ciphertext segment size: 4096 bytes
  //   - OutputPrefixType: RAW
  static const google::crypto::tink::KeyTemplate&
  Aes256CtrHmacSha256Segment4KB();
};

}  // namespace tink
}  // namespace crypto

#endif  // TINK_STREAMINGAEAD_STREAMING_AEAD_KEY_TEMPLATES_H_


text:
package ch.hsr.challp.museum;

import android.app.Activity;
import android.app.Fragment;

import ch.hsr.challp.museum.helper.FragmentHelper;

public class DrawerFragment extends Fragment {

    private FragmentHelper.FragmentActivity activity;

    @Override
    public void onAttach(Activity activity) {
        super.onAttach(activity);
        this.activity = (FragmentHelper.FragmentActivity) activity;
    }

    protected FragmentHelper.FragmentActivity getFragmentChangeListener() {
        return activity;
    }
}


text:
Barista.Datasets = _.extend(Barista.Datasets,
	{ CellHistology:
			{
			// only return 6 items at a time in the autocomplete dropdown
			limit: 6,

			// provide a name for the default typeahead data source
			name: 'CellHistology',

			// the template to render for all results
			template: '{{ type }} {{ value }}',

			// use twitter's hogan.js to compile the template for the typeahead results
			engine: Hogan,

			remote: {
				// set the remote data source to use cellinfo with custom query params
				url: "",

				replace: function(url,query){
					query = (query[0] === "*") ? query.replace("*",".*") : query;
					return [Barista.APIURL + '/a2/cellinfo?',
						'q={"lincs_status":{"$in":["core_cline","core_pline","DIVR"]},"cell_histology":{"$regex":"^' + query + '", "$options":"i"}}',
						'&l=10',
						'&s={"cell_id":1}'].join('');
				},

				dataType: 'jsonp',

				filter: function(response){
					var datum_list = [];
					var auto_data = [];
					var object_map = {};

					// for each item, pull out its cell_histology and use that for the
					// autocomplete value. Build a datum of other relevant data
					// for use in suggestion displays
					response.forEach(function(element){
						auto_data.push(element.cell_histology);
						object_map[element.cell_histology] = element;
					});

					// make sure we only show unique items
					auto_data = _.uniq(auto_data);

					// build a list of datum objects
					auto_data.forEach(function(item){
						var datum = {
							value: item,
							tokens: [item],
							data: object_map[item]
						}
						_.extend(datum,{
							type: 'Cell Histology',
							search_column: 'cell_histology',
							color: '#BB4D8A',
						});
						datum_list.push(datum);
					});

					// return the processed list of datums for the autocomplete
					return datum_list;
				}
			}
		}
	}
);


text:
var isFn = function isFn(v) {
  return typeof v === 'function';
};

var handlePromise = function handlePromise(promise) {
  return promise.then(function (data) {
    return [null, data];
  }).catch(function (err) {
    return [err];
  });
};

var REGEX = /^on|^create|Sync$|Manager$|^pause/;
var API_NORMAL_LIST = ['os', 'stopRecord', 'stopVoice', 'stopBackgroundAudio', 'stopPullDownRefresh', 'hideKeyboard', 'hideToast', 'hideLoading', 'showNavigationBarLoading', 'hideNavigationBarLoading', 'canIUse', 'navigateBack', 'closeSocket', 'pageScrollTo', 'drawCanvas'];

var shouldPromise = function shouldPromise(name) {
  if (REGEX.test(name) && name !== 'createBLEConnection') {
    return false;
  }
  if (~API_NORMAL_LIST.indexOf(name)) {
    return false;
  }
  return true;
};

var promisify = function promisify(api) {
  return function () {
    for (var _len = arguments.length, params = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
      params[_key - 1] = arguments[_key];
    }

    var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};

    if (isFn(options.success) || isFn(options.fail) || isFn(options.complete)) {
      return api.apply(undefined, [options].concat(params));
    }
    return handlePromise(new Promise(function (resolve, reject) {
      api.apply(undefined, [Object.assign({}, options, {
        success: resolve,
        fail: reject
      })].concat(params));
      /* eslint-disable no-extend-native */
      Promise.prototype.finally = function (callback) {
        var promise = this.constructor;
        return this.then(function (value) {
          return promise.resolve(callback()).then(function () {
            return value;
          });
        }, function (reason) {
          return promise.resolve(callback()).then(function () {
            throw reason;
          });
        });
      };
    }));
  };
};

var UNIAPP_LAUNCH_WEBVIEW_ID = '__UNIAPP_LAUNCH_WEBVIEW_ID';

var plus = weex.requireModule('plus');
var storage = weex.requireModule('plusstorage');
var globalEvent = weex.requireModule('globalEvent');

var id = 0;
var callbacks = {};

var WEBVIEW_ID = '';

if (weex.config.plus_appid) {
  WEBVIEW_ID = weex.config.plus_appid;
} else {
  storage && storage.getItem && storage.getItem(UNIAPP_LAUNCH_WEBVIEW_ID, function (evt) {
    if (evt.result === 'success' && evt.data) {
      WEBVIEW_ID = evt.data;
    }
  });
}

globalEvent.addEventListener('plusMessage', function (e) {
  if (e.data.type === 'UniAppJsApi') {
    invoke(e.data.id, e.data.data);
  } else if (e.data.type === 'onNavigationBarButtonTap') {
    if (typeof onNavigationBarButtonTapCallback === 'function') {
      onNavigationBarButtonTapCallback(e.data.data);
    }
  } else if (e.data.type === 'onNavigationBarSearchInputChanged') {
    if (typeof onNavigationBarSearchInputChangedCallback === 'function') {
      onNavigationBarSearchInputChangedCallback(e.data.data);
    }
  } else if (e.data.type === 'onNavigationBarSearchInputConfirmed') {
    if (typeof onNavigationBarSearchInputConfirmedCallback === 'function') {
      onNavigationBarSearchInputConfirmedCallback(e.data.data);
    }
  } else if (e.data.type === 'onNavigationBarSearchInputClicked') {
    if (typeof onNavigationBarSearchInputClickedCallback === 'function') {
      onNavigationBarSearchInputClickedCallback(e.data.data);
    }
  }
});

var createCallback = function createCallback(args, type) {
  var callback = function callback(res) {
    if (isFn(args)) {
      args(res);
    } else if (args) {
      if (~res.errMsg.indexOf(':ok')) {
        isFn(args.success) && args.success(res);
      } else if (~res.errMsg.indexOf(':fail')) {
        isFn(args.fail) && args.fail(res);
      }
      isFn(args.complete) && args.complete(res);
    }
  };
  if (isFn(args) || args && isFn(args.callback)) {
    callback.keepAlive = true;
  }
  return callback;
};

var invoke = function invoke(callbackId, data) {
  var callback = callbacks[callbackId];
  if (callback) {
    callback(data);
    if (!callback.keepAlive) {
      delete callbacks[callbackId];
    }
  } else {
    console.error('callback[' + callbackId + '] is undefined');
  }
};

var publish = function publish(_ref) {
  var id = _ref.id,
      type = _ref.type,
      params = _ref.params;

  callbacks[id] = createCallback(params, type);
  if (WEBVIEW_ID) {
    plus.postMessage({
      id: id,
      type: type,
      params: params
    }, WEBVIEW_ID);
  } else {
    console.error('launch webview id is not ready');
  }
};

function postMessage(data) {
  if (WEBVIEW_ID) {
    plus.postMessage(data, WEBVIEW_ID);
  } else {
    console.error('launch webview id is not ready');
  }
}

var createPublish = function createPublish(name) {
  return function (args) {
    publish({
      id: id++,
      type: name,
      params: args
    });
  };
};

var onNavigationBarButtonTapCallback = void 0;
var onNavigationBarSearchInputChangedCallback = void 0;
var onNavigationBarSearchInputConfirmedCallback = void 0;
var onNavigationBarSearchInputClickedCallback = void 0;
function onNavigationBarButtonTap(callback) {
  onNavigationBarButtonTapCallback = callback;
}
function onNavigationBarSearchInputChanged(callback) {
  onNavigationBarSearchInputChangedCallback = callback;
}
function onNavigationBarSearchInputConfirmed(callback) {
  onNavigationBarSearchInputConfirmedCallback = callback;
}
function onNavigationBarSearchInputClicked(callback) {
  onNavigationBarSearchInputClickedCallback = callback;
}

function requireNativePlugin(pluginName) {
  return weex.requireModule(pluginName);
}

var dom = weex.requireModule('dom');

function loadFontFace(_ref) {
  var family = _ref.family,
      source = _ref.source,
      desc = _ref.desc,
      success = _ref.success,
      fail = _ref.fail,
      complete = _ref.complete;

  dom.addRule('fontFace', {
    fontFamily: family,
    src: source.replace(/"/g, '\'')
  });
  var res = {
    errMsg: 'loadFontFace:ok',
    status: 'loaded'
  };
  isFn(success) && success(res);
  isFn(complete) && complete(res);
}

var globalEvent$1 = weex.requireModule('globalEvent');

var callbacks$1 = [];

globalEvent$1.addEventListener('plusMessage', function (e) {
  if (e.data.type === 'UniAppReady') {
    ready.isUniAppReady = true;
    if (callbacks$1.length) {
      callbacks$1.forEach(function (callback) {
        return callback();
      });
      callbacks$1 = [];
    }
  }
});

function ready(callback) {
  if (typeof callback === 'function') {
    if (this.isUniAppReady) {
      callback();
    } else {
      callbacks$1.push(callback);
    }
  }
}

var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) {
  return typeof obj;
} : function (obj) {
  return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
};

var stream = weex.requireModule('stream');

// let requestTaskId = 0

var METHOD_GET = 'GET';
var METHOD_POST = 'POST';
var CONTENT_TYPE_JSON = 'application/json';
var CONTENT_TYPE_FORM = 'application/x-www-form-urlencoded';

var serialize = function serialize(data) {
  var method = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : METHOD_GET;
  var contentType = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : CONTENT_TYPE_FORM;

  if ((typeof data === 'undefined' ? 'undefined' : _typeof(data)) === 'object') {
    if (method.toUpperCase() === METHOD_POST && contentType.toLowerCase() === CONTENT_TYPE_JSON) {
      return JSON.stringify(data);
    } else {
      return Object.keys(data).map(function (key) {
        return encodeURIComponent(key) + '=' + encodeURIComponent(data[key]);
      }).join('&');
    }
  }
  return data;
};

function request(_ref) {
  var url = _ref.url,
      data = _ref.data,
      header = _ref.header,
      _ref$method = _ref.method,
      method = _ref$method === undefined ? 'GET' : _ref$method,
      _ref$dataType = _ref.dataType,
      dataType = _ref$dataType === undefined ? 'json' : _ref$dataType,
      responseType = _ref.responseType,
      success = _ref.success,
      fail = _ref.fail,
      complete = _ref.complete;

  // requestTaskId++
  var aborted = false;

  var hasContentType = false;
  var headers = {};
  if (header) {
    for (var name in header) {
      if (!hasContentType && name.toLowerCase() === 'content-type') {
        hasContentType = true;
        headers['Content-Type'] = header[name];
      } else {
        headers[name] = header[name];
      }
    }
  }
  if (method === METHOD_GET && data) {
    url = url + (~url.indexOf('?') ? url.substr(-1) === '&' || url.substr(-1) === '?' ? '' : '&' : '?') + serialize(data);
  }
  stream.fetch({
    url: url,
    method: method,
    headers: headers,
    type: dataType === 'json' ? 'json' : 'text',
    body: method !== METHOD_GET ? serialize(data, method, headers['Content-Type']) : ''
  }, function (_ref2) {
    var status = _ref2.status,
        ok = _ref2.ok,
        statusText = _ref2.statusText,
        data = _ref2.data,
        headers = _ref2.headers;

    var ret = {};
    if (!status || status === -1 || aborted) {
      ret.errMsg = 'request:fail';
      isFn(fail) && fail(ret);
    } else {
      ret.data = data;
      ret.statusCode = status;
      ret.header = headers;
      isFn(success) && success(ret);
    }
    isFn(complete) && complete(ret);
  });
  return {
    abort: function abort() {
      aborted = true;
    }
  };
}

var storage$1 = weex.requireModule('plusstorage');
var UNIAPP_STORAGE_DATA_TYPE = '__TYPE';

function getStorage(_ref) {
  var key = _ref.key,
      data = _ref.data,
      success = _ref.success,
      fail = _ref.fail,
      complete = _ref.complete;

  storage$1.getItem(key + UNIAPP_STORAGE_DATA_TYPE, function (ret) {
    if (ret.result === 'success') {
      var dataType = ret.data;
      storage$1.getItem(key, function (res) {
        if (res.result === 'success') {
          var result = res.data;
          if (dataType && result) {
            if (dataType !== 'String') {
              result = JSON.parse(result);
            }
            isFn(success) && success({
              errMsg: 'getStorage:ok',
              data: result
            });
          } else {
            res.errMsg = 'setStorage:fail';
            isFn(fail) && fail(res);
          }
        } else {
          res.errMsg = 'setStorage:fail';
          isFn(fail) && fail(res);
        }
        isFn(complete) && complete(res);
      });
    } else {
      ret.errMsg = 'setStorage:fail';
      isFn(fail) && fail(ret);
      isFn(complete) && complete(ret);
    }
  });
}
function setStorage(_ref2) {
  var key = _ref2.key,
      data = _ref2.data,
      success = _ref2.success,
      fail = _ref2.fail,
      complete = _ref2.complete;

  var dataType = 'String';
  if ((typeof data === 'undefined' ? 'undefined' : _typeof(data)) === 'object') {
    dataType = 'Object';
    data = JSON.stringify(data);
  }
  storage$1.setItem(key, data, function (res) {
    if (res.result === 'success') {
      storage$1.setItem(key + UNIAPP_STORAGE_DATA_TYPE, dataType, function (ret) {
        if (ret.result === 'success') {
          isFn(success) && success({
            errMsg: 'setStorage:ok'
          });
        } else {
          ret.errMsg = 'setStorage:fail';
          isFn(fail) && fail(ret);
        }
      });
    } else {
      res.errMsg = 'setStorage:fail';
      isFn(fail) && fail(res);
    }
    isFn(complete) && complete(res);
  });
}

function removeStorage(_ref3) {
  var key = _ref3.key,
      data = _ref3.data,
      success = _ref3.success,
      fail = _ref3.fail,
      complete = _ref3.complete;

  storage$1.removeItem(key, function (res) {
    if (res.result === 'success') {
      isFn(success) && success({
        errMsg: 'removeStorage:ok'
      });
    } else {
      res.errMsg = 'removeStorage:fail';
      isFn(fail) && fail(res);
    }
    isFn(complete) && complete(res);
  });
  storage$1.removeItem(key + UNIAPP_STORAGE_DATA_TYPE);
}

function clearStorage(_ref4) {
  var key = _ref4.key,
      data = _ref4.data,
      success = _ref4.success,
      fail = _ref4.fail,
      complete = _ref4.complete;
}

var clipboard = weex.requireModule('clipboard');

function getClipboardData(_ref) {
  var success = _ref.success,
      fail = _ref.fail,
      complete = _ref.complete;

  clipboard.getString(function (_ref2) {
    var data = _ref2.data;

    var res = {
      errMsg: 'getClipboardData:ok',
      data: data
    };
    isFn(success) && success(res);
    isFn(complete) && complete(res);
  });
}

function setClipboardData(_ref3) {
  var data = _ref3.data,
      success = _ref3.success,
      fail = _ref3.fail,
      complete = _ref3.complete;

  var res = {
    errMsg: 'setClipboardData:ok'
  };
  clipboard.setString(data);
  isFn(success) && success(res);
  isFn(complete) && complete(res);
}

var api = /*#__PURE__*/Object.freeze({
  loadFontFace: loadFontFace,
  ready: ready,
  request: request,
  getStorage: getStorage,
  setStorage: setStorage,
  removeStorage: removeStorage,
  clearStorage: clearStorage,
  getClipboardData: getClipboardData,
  setClipboardData: setClipboardData
});

var wx = {
  uploadFile: true,
  downloadFile: true,
  chooseImage: true,
  previewImage: true,
  getImageInfo: true,
  saveImageToPhotosAlbum: true,
  chooseVideo: true,
  saveVideoToPhotosAlbum: true,
  saveFile: true,
  getSavedFileList: true,
  getSavedFileInfo: true,
  removeSavedFile: true,
  openDocument: true,
  setStorage: true,
  getStorage: true,
  getStorageInfo: true,
  removeStorage: true,
  clearStorage: true,
  getLocation: true,
  chooseLocation: true,
  openLocation: true,
  getSystemInfo: true,
  getNetworkType: true,
  makePhoneCall: true,
  scanCode: true,
  setScreenBrightness: true,
  getScreenBrightness: true,
  setKeepScreenOn: true,
  vibrateLong: true,
  vibrateShort: true,
  addPhoneContact: true,
  showToast: true,
  showLoading: true,
  hideToast: true,
  hideLoading: true,
  showModal: true,
  showActionSheet: true,
  setNavigationBarTitle: true,
  setNavigationBarColor: true,
  navigateTo: true,
  redirectTo: true,
  reLaunch: true,
  switchTab: true,
  navigateBack: true,
  getProvider: true,
  login: true,
  getUserInfo: true,
  share: true,
  requestPayment: true,
  subscribePush: true,
  unsubscribePush: true,
  onPush: true,
  offPush: true
};

var uni = {};

var baseUni = {
  os: {
    nvue: true
  }
};

if (typeof Proxy !== 'undefined') {
  uni = new Proxy({}, {
    get: function get(target, name) {
      if (name === 'os') {
        return {
          nvue: true
        };
      }
      if (name === 'postMessage') {
        return postMessage;
      }
      if (name === 'requireNativePlugin') {
        return requireNativePlugin;
      }
      if (name === 'onNavigationBarButtonTap') {
        return onNavigationBarButtonTap;
      }
      if (name === 'onNavigationBarSearchInputChanged') {
        return onNavigationBarSearchInputChanged;
      }
      if (name === 'onNavigationBarSearchInputConfirmed') {
        return onNavigationBarSearchInputConfirmed;
      }
      if (name === 'onNavigationBarSearchInputClicked') {
        return onNavigationBarSearchInputClicked;
      }
      var method = api[name];
      if (!method) {
        method = createPublish(name);
      }
      if (shouldPromise(name)) {
        return promisify(method);
      }
      return method;
    }
  });
} else {
  Object.keys(baseUni).forEach(function (key) {
    uni[key] = baseUni[key];
  });

  uni.postMessage = postMessage;

  uni.requireNativePlugin = requireNativePlugin;

  uni.onNavigationBarButtonTap = onNavigationBarButtonTap;

  uni.onNavigationBarSearchInputChanged = onNavigationBarSearchInputChanged;

  uni.onNavigationBarSearchInputConfirmed = onNavigationBarSearchInputConfirmed;

  uni.onNavigationBarSearchInputClicked = onNavigationBarSearchInputClicked;

  Object.keys(wx).forEach(function (name) {
    var method = api[name];
    if (!method) {
      method = createPublish(name);
    }
    if (shouldPromise(name)) {
      uni[name] = promisify(method);
    } else {
      uni[name] = method;
    }
  });
}

var uni$1 = uni;

export default uni$1;


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
in Song & Li, Mycotaxon 84: 404 (2002)

#### Original name
Lembosia luodingensis B. Song

### Remarks
null


text:
package ua.ikrosh.ab.tests;

import org.testng.annotations.Test;
import ua.ikrosh.ab.model.GroupData;

public class GroupCreationTests extends TestBase {

  @Test
  public void testGroupCreation() {

    app.getNavigationHelper().gotoGroupPage();
    app.getGroupHelper().initGroupCreation();
    app.getGroupHelper().fillGroupForm(new GroupData("test1", "header", null));
    app.getGroupHelper().submitGroupCreation();
    app.getNavigationHelper().returnToGroupPage();
  }

}