text:
package main

import (
	"encoding/json"
	"errors"
	"flag"
	"fmt"
	"github.com/jsouthworth/radioshark"
	"log"
	"net/http"
	"os"
	"strings"
	"sync"
)

var (
	shark      string
	addr       string
	configfile string
	root       string
)

var errMethodNotAllowed = errors.New("method not allowed")

func init() {
	flag.StringVar(&shark, "shark", "", "RadioShark device to manage")
	flag.StringVar(&addr, "address", ":8080", "Address on which to listen")
	flag.StringVar(&configfile, "config", "",
		"Configuraton file location (default: /etc/rsharkd.<shark>.conf)")
	flag.StringVar(&root, "path", "/usr/share/rsharkd", "path to html")
}

type configError struct {
	errors []error
}

func (cerr *configError) Empty() bool {
	return len(cerr.errors) == 0
}

func (cerr *configError) Append(err error) {
	if err == nil {
		return
	}
	cerr.errors = append(cerr.errors, err)
}

func (cerr *configError) Error() string {
	errstrs := make([]string, 0, len(cerr.errors))
	for _, err := range cerr.errors {
		errstrs = append(errstrs, err.Error())
	}
	return strings.Join(errstrs, ", ")
}

type Config struct {
	Modulation       string `json:"modulation"`
	Frequency        string `json:"frequency"`
	BlueLEDIntensity uint8  `json:"blue-led-intensity"`
	BlueLEDPulseRate uint8  `json:"blue-led-pulse-rate"`
	RedLEDToggle     bool   `json:"red-led"`
}

func validateFrequency(modulation, frequency string) error {
	switch modulation {
	case "am", "AM":
		_, err := radioshark.ParseAMFrequency(frequency)
		return err
	case "fm", "FM":
		_, err := radioshark.ParseFMFrequency(frequency)
		return err
	}
	return nil
}

func writeConfig(file string, config *Config) error {
	f, err := os.Create(file)
	if err != nil {
		return err
	}
	defer f.Close()
	enc := json.NewEncoder(f)
	return enc.Encode(config)
}

func readConfig(file string) (*Config, error) {
	var config *Config
	defConfig := &Config{
		Modulation:       "FM",
		Frequency:        "88.0",
		BlueLEDIntensity: 127,
		BlueLEDPulseRate: 0,
		RedLEDToggle:     false,
	}

	f, err := os.Open(file)
	if err != nil {
		log.Println(err)
		return defConfig, nil
	}
	defer f.Close()
	dec := json.NewDecoder(f)
	err = dec.Decode(&config)
	if err != nil {
		log.Println(err)
		return defConfig, nil
	}
	return config, nil
}

type Server struct {
	sync.RWMutex
	configfile string
	cfg        *Config
	shark      *radioshark.RadioShark
}

func (srv *Server) setConfig(config *Config) {
	srv.cfg = config
}

func (srv *Server) Apply(config *Config) error {
	cerr := &configError{}

	err := srv.Validate(config)
	if err != nil {
		return err
	}

	curcfg := srv.Get()
	srv.setConfig(config)

	if curcfg.Frequency != config.Frequency ||
		curcfg.Modulation != config.Modulation {
		cerr.Append(srv.shark.SetFrequency(config.Modulation, config.Frequency))
	}

	cerr.Append(srv.shark.SetBlueLEDIntensity(config.BlueLEDIntensity))
	cerr.Append(srv.shark.SetBlueLEDPulse(config.BlueLEDPulseRate))
	cerr.Append(srv.shark.SetRedLED(config.RedLEDToggle))

	if cerr.Empty() {
		return writeConfig(srv.configfile, config)
	}
	return cerr
}

func (srv *Server) Validate(config *Config) error {
	cerr := &configError{}
	cerr.Append(radioshark.ValidateModulation(config.Modulation))
	cerr.Append(validateFrequency(config.Modulation, config.Frequency))
	cerr.Append(radioshark.ValidateBlueLEDIntensity(config.BlueLEDIntensity))
	cerr.Append(radioshark.ValidateBlueLEDPulse(config.BlueLEDPulseRate))
	if cerr.Empty() {
		return nil
	}
	return cerr
}

func (srv *Server) Get() *Config {
	var reply Config
	reply = *srv.cfg
	return &reply
}

func writeHTTPMethodNotAllowed(w http.ResponseWriter) {
	writeHTTPError(w, errMethodNotAllowed, http.StatusMethodNotAllowed)
}

func writeHTTPError(w http.ResponseWriter, err error, code int) {
	log.Println(err)
	resp := &struct {
		Error string `json:"error"`
	}{
		Error: err.Error(),
	}
	w.Header().Set("Content-Type", "application/json")
	w.WriteHeader(code)
	enc := json.NewEncoder(w)
	enc.Encode(resp)
}

func (srv *Server) httpGet(w http.ResponseWriter, req *http.Request) {
	srv.RLock()
	defer srv.RUnlock()
	switch req.Method {
	case "GET":
		enc := json.NewEncoder(w)
		enc.Encode(srv.Get())
	default:
		writeHTTPMethodNotAllowed(w)
	}
}

func (srv *Server) processApplyPOST(req *http.Request) (*Config, error) {
	config := srv.Get()
	reader, err := req.MultipartReader()
	if err != nil {
		return nil, err
	}

	form, err := reader.ReadForm(8192)
	if err != nil {
		return nil, err
	}

	modVals := form.Value["modulation"]
	if len(modVals) != 0 {
		config.Modulation = modVals[0]
	}

	freqVals := form.Value["frequency"]
	if len(freqVals) != 0 {
		config.Frequency = freqVals[0]
	}

	return config, nil
}

func (srv *Server) httpApply(w http.ResponseWriter, req *http.Request) {
	srv.RLock()
	defer srv.RUnlock()
	switch req.Method {
	case "PUT":
		var config *Config
		dec := json.NewDecoder(req.Body)
		dec.Decode(&config)
		err := srv.Apply(config)
		if err != nil {
			writeHTTPError(w, err, http.StatusBadRequest)
			return
		}
	case "POST":
		config, err := srv.processApplyPOST(req)
		if err != nil {
			writeHTTPError(w, err, http.StatusBadRequest)
			return
		}
		err = srv.Apply(config)
		if err != nil {
			writeHTTPError(w, err, http.StatusBadRequest)
			return
		}
	default:
		writeHTTPMethodNotAllowed(w)
	}
}

func (srv *Server) httpValidate(w http.ResponseWriter, req *http.Request) {
	srv.RLock()
	defer srv.RUnlock()
	switch req.Method {
	case "PUT":
		var config *Config
		dec := json.NewDecoder(req.Body)
		dec.Decode(&config)
		err := srv.Validate(config)
		if err != nil {
			writeHTTPError(w, err, http.StatusBadRequest)
			return
		}
	default:
		writeHTTPMethodNotAllowed(w)
	}
}

func NewServer(config string, shark string) (*Server, error) {
	cfg, err := readConfig(config)
	if err != nil {
		return nil, err
	}
	dev, err := radioshark.Open(shark)
	if err != nil {
		return nil, err
	}
	srv := &Server{
		configfile: config,
		cfg:        &Config{},
		shark:      dev,
	}
	err = srv.Apply(cfg)
	if err != nil {
		return nil, err
	}
	return srv, nil
}

func NewHTTPServeMux(config, shark, prefix string) (*http.ServeMux, error) {
	srv, err := NewServer(config, shark)
	if err != nil {
		return nil, err
	}
	mux := http.NewServeMux()
	mux.HandleFunc(prefix+"/get", srv.httpGet)
	mux.HandleFunc(prefix+"/apply", srv.httpApply)
	mux.HandleFunc(prefix+"/validate", srv.httpValidate)
	return mux, nil
}

func die(err error) {
	if err == nil {
		return
	}
	fmt.Fprintln(os.Stderr, err)
	os.Exit(1)
}

func parseFlags() error {
	flag.Parse()
	if shark == "" {
		return errors.New("the radioshark to manage must be supplied")
	}
	if configfile == "" {
		configfile = "/etc/rsharkd." + shark + ".conf"
	}
	return nil
}

func main() {
	die(parseFlags())
	exec.Command("modprobe", "-r", "radio_shark").Run()
	mux, err := NewHTTPServeMux(configfile, shark, "/config")
	die(err)
	mux.Handle("/", http.FileServer(http.Dir(root)))
	httpsrv := &http.Server{
		Handler: mux,
		Addr:    addr,
	}
	die(httpsrv.ListenAndServe())
}


text:
/**
 * \file Library that provides device enumeration and creation of
 * winsys/pipe_screen instances.
 */

#ifndef PIPE_LOADER_H
#define PIPE_LOADER_H

#include "pipe/p_compiler.h"

#ifdef __cplusplus
extern "C" {
#endif

struct pipe_screen;

enum pipe_loader_device_type {
   PIPE_LOADER_DEVICE_SOFTWARE,
   PIPE_LOADER_DEVICE_PCI,
   NUM_PIPE_LOADER_DEVICE_TYPES
};

/**
 * A device known to the pipe loader.
 */
struct pipe_loader_device {
   enum pipe_loader_device_type type;

   union {
      struct {
         int vendor_id;
         int chip_id;
      } pci;
   } u; /**< Discriminated by \a type */

   const char *driver_name;
   const struct pipe_loader_ops *ops;
};

/**
 * Get a list of known devices.
 *
 * \param devs Array that will be filled with pointers to the devices
 *             available in the system.
 * \param ndev Maximum number of devices to return.
 * \return Number of devices available in the system.
 */
int
pipe_loader_probe(struct pipe_loader_device **devs, int ndev);

/**
 * Create a pipe_screen for the specified device.
 *
 * \param dev Device the screen will be created for.
 * \param library_paths Colon-separated list of filesystem paths that
 *                      will be used to look for the pipe driver
 *                      module that handles this device.
 */
struct pipe_screen *
pipe_loader_create_screen(struct pipe_loader_device *dev,
                          const char *library_paths);

/**
 * Release resources allocated for a list of devices.
 *
 * Should be called when the specified devices are no longer in use to
 * release any resources allocated by pipe_loader_probe.
 *
 * \param devs Devices to release.
 * \param ndev Number of devices to release.
 */
void
pipe_loader_release(struct pipe_loader_device **devs, int ndev);

/**
 * Get a list of known software devices.
 *
 * This function is platform-specific.
 *
 * \sa pipe_loader_probe
 */
int
pipe_loader_sw_probe(struct pipe_loader_device **devs, int ndev);

#ifdef HAVE_PIPE_LOADER_DRM

/**
 * Get a list of known DRM devices.
 *
 * This function is platform-specific.
 *
 * \sa pipe_loader_probe
 */
int
pipe_loader_drm_probe(struct pipe_loader_device **devs, int ndev);

/**
 * Initialize a DRM device in an already opened fd.
 *
 * This function is platform-specific.
 *
 * \sa pipe_loader_probe
 */
boolean
pipe_loader_drm_probe_fd(struct pipe_loader_device **dev, int fd);

#endif

#ifdef __cplusplus
}
#endif

#endif /* PIPE_LOADER_H */

redpajama_set_name: RedPajamaGithub


text:
package com.mossle.disk.persistence.domain;

// Generated by Hibernate Tools
import java.util.Date;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * DiskRule 权限规则.
 *
 * @author Lingo
 */
@Entity
@Table(name = "DISK_RULE")
public class DiskRule implements java.io.Serializable {
    private static final long serialVersionUID = 0L;

    /** id. */
    private Long id;

    /** 创建时间. */
    private Date createTime;

    /** 创建人. */
    private String userId;

    /** 更新时间. */
    private Date updateTime;

    /** . */
    private Set<DiskAcl> diskAcls = new HashSet<DiskAcl>(0);

    /** . */
    private Set<DiskSpace> diskSpaces = new HashSet<DiskSpace>(0);

    /** . */
    private Set<DiskInfo> diskInfos = new HashSet<DiskInfo>(0);

    public DiskRule() {
    }

    public DiskRule(Long id) {
        this.id = id;
    }

    public DiskRule(Long id, Date createTime, String userId, Date updateTime,
            Set<DiskAcl> diskAcls, Set<DiskSpace> diskSpaces,
            Set<DiskInfo> diskInfos) {
        this.id = id;
        this.createTime = createTime;
        this.userId = userId;
        this.updateTime = updateTime;
        this.diskAcls = diskAcls;
        this.diskSpaces = diskSpaces;
        this.diskInfos = diskInfos;
    }

    /** @return id. */
    @Id
    @Column(name = "ID", unique = true, nullable = false)
    public Long getId() {
        return this.id;
    }

    /**
     * @param id
     *            id.
     */
    public void setId(Long id) {
        this.id = id;
    }

    /** @return 创建时间. */
    @Temporal(TemporalType.TIMESTAMP)
    @Column(name = "CREATE_TIME", length = 26)
    public Date getCreateTime() {
        return this.createTime;
    }

    /**
     * @param createTime
     *            创建时间.
     */
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    /** @return 创建人. */
    @Column(name = "USER_ID", length = 64)
    public String getUserId() {
        return this.userId;
    }

    /**
     * @param userId
     *            创建人.
     */
    public void setUserId(String userId) {
        this.userId = userId;
    }

    /** @return 更新时间. */
    @Temporal(TemporalType.TIMESTAMP)
    @Column(name = "UPDATE_TIME", length = 26)
    public Date getUpdateTime() {
        return this.updateTime;
    }

    /**
     * @param updateTime
     *            更新时间.
     */
    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    /** @return . */
    @OneToMany(fetch = FetchType.LAZY, mappedBy = "diskRule")
    public Set<DiskAcl> getDiskAcls() {
        return this.diskAcls;
    }

    /**
     * @param diskAcls
     *            .
     */
    public void setDiskAcls(Set<DiskAcl> diskAcls) {
        this.diskAcls = diskAcls;
    }

    /** @return . */
    @OneToMany(fetch = FetchType.LAZY, mappedBy = "diskRule")
    public Set<DiskSpace> getDiskSpaces() {
        return this.diskSpaces;
    }

    /**
     * @param diskSpaces
     *            .
     */
    public void setDiskSpaces(Set<DiskSpace> diskSpaces) {
        this.diskSpaces = diskSpaces;
    }

    /** @return . */
    @OneToMany(fetch = FetchType.LAZY, mappedBy = "diskRule")
    public Set<DiskInfo> getDiskInfos() {
        return this.diskInfos;
    }

    /**
     * @param diskInfos
     *            .
     */
    public void setDiskInfos(Set<DiskInfo> diskInfos) {
        this.diskInfos = diskInfos;
    }
}


text:
package service;

import domain.Brand;
import mapper.BrandMapper;
import org.mybatis.guice.transactional.Isolation;
import org.mybatis.guice.transactional.Transactional;
import util.CustomException;

import javax.inject.Inject;
import java.util.List;

/**
 * use mybatis mapper interface easy link to Postgresql DB.
 * Created by howen on 15/10/23.
 */
@Transactional(isolation = Isolation.SERIALIZABLE, rethrowExceptionsAs= CustomException.class)
public class PostgresqlServiceMapperImpl implements PostgresqlService{

    @Inject
    private BrandMapper brandMapper;

    @Override
    public List<Brand> getAllBrand() {
        return brandMapper.getAllBrands();
    }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<doc>
  <assembly>
    <name>Microsoft.Win32.Primitives</name>
  </assembly>
  <members>
    <member name="T:System.ComponentModel.Win32Exception">
      Löst eine Ausnahme für einen Win32-Fehlercode aus.
    </member>
    <member name="M:System.ComponentModel.Win32Exception.#ctor">
      Initialisiert eine neue Instanz der <see cref="T:System.ComponentModel.Win32Exception" />-Klasse mit dem zuletzt aufgetretenen Win32-Fehler.
    </member>
    <member name="M:System.ComponentModel.Win32Exception.#ctor(System.Int32)">
      Initialisiert eine neue Instanz der <see cref="T:System.ComponentModel.Win32Exception" />-Klasse mit dem angegebenen Fehler.
      <param name="error">Der dieser Ausnahme zugeordnete Win32-Fehlercode. </param>
    </member>
    <member name="M:System.ComponentModel.Win32Exception.#ctor(System.Int32,System.String)">
      Initialisiert eine neue Instanz der <see cref="T:System.ComponentModel.Win32Exception" />-Klasse mit dem angegebenen Fehler und der angegebenen detaillierten Beschreibung.
      <param name="error">Der dieser Ausnahme zugeordnete Win32-Fehlercode. </param>
      <param name="message">Eine detaillierte Beschreibung des Fehlers. </param>
    </member>
    <member name="M:System.ComponentModel.Win32Exception.#ctor(System.String)">
      Initialisiert eine neue Instanz der <see cref="T:System.ComponentModel.Win32Exception" />-Klasse unter Verwendung der angegebenen detaillierten Beschreibung.
      <param name="message">Eine detaillierte Beschreibung des Fehlers.</param>
    </member>
    <member name="M:System.ComponentModel.Win32Exception.#ctor(System.String,System.Exception)">
      Initialisiert eine neue Instanz der <see cref="T:System.ComponentModel.Win32Exception" />-Klasse mit der angegebenen detaillierten Beschreibung und der angegebenen Ausnahme.
      <param name="message">Eine detaillierte Beschreibung des Fehlers.</param>
      <param name="innerException">Ein Verweis auf die innere Ausnahme, die dieser Ausnahme zugrunde liegt.</param>
    </member>
    <member name="P:System.ComponentModel.Win32Exception.NativeErrorCode">
      Ruft den dieser Ausnahme zugeordneten Win32-Fehlercode ab.
      <returns>Der dieser Ausnahme zugeordnete Win32-Fehlercode.</returns>
    </member>
  </members>
</doc>


text:
import {sendObcPollingRequests} from './ChaincodeActions'

export const REQUEST_BLOCK_INFO = 'REQUEST_BLOCK_INFO'
function requestBlockInfo(blockNum){
  return{
    type: REQUEST_BLOCK_INFO,
    blockNum
  }
}

export const RECEIVE_BLOCK_INFO = 'RECEIVE_BLOCK_INFO'
function receiveBlockInfo(blockNum, data){
  return{
    type: RECEIVE_BLOCK_INFO,
    blockNum,
    data: data
  }
}

export const ADD_BLOCKS = 'ADD_BLOCKS'
export function addBlocks(chainHeight){
  return{
    type: REQUEST_BLOCK_INFO,
    chainHeight
  }
}

export const CLEAR_BLOCKCHAIN = 'CLEAR_BLOCKCHAIN'
export function clearBlockchain(){
  return{
    type: CLEAR_BLOCKCHAIN
  }
}

export const REC_CHAIN_HEIGHT = 'REC_CHAIN_HEIGHT'
export function recChainHeight(chainHeight, blocksPerPage){
  return{
    type: 'REC_CHAIN_HEIGHT',
    chainHeight,
    blocksPerPage
  }
}

/**
This is a redux-thunk. We basically invoke all other events that are dependent
on a block being added to the blockchain.
**/
export function fetchChainHeight(urlRestRoot){

  return function (dispatch, getState){

    return fetch(urlRestRoot + '/chain')
    .then(response => response.json())
    .then((json) =>{

      //check if the chain height is any different
      let state = getState();

      //call any other functions that need to be invoked on change in blockchain height
      if(state.blockchain.length === 0 || ((state.blockchain[0].blockNumber+1) !== json.height)){

        //when we receive the chain height, we must also use the blocks per page configuration to generate the blockchain correctly
        dispatch(recChainHeight(json.height, state.configuration.blocksPerPage))
        dispatch(sendObcPollingRequests())
      }
    })

  }
}

/**
Fetches the data for an individual block. This data appears when you click
on a block header on the UI.
**/
export function fetchBlockData(blockNum){

  //dispatch comes from thunk middleware
  return function (dispatch, getState){
    //first update the app state to indicate we are fetching data.
    dispatch(requestBlockInfo(blockNum));

    const state = getState();

    let blockData = (state.blockchain[state.blockchain[0].blockNumber - blockNum]).blockData

    //first make sure that there is no data for this object yet. If there is, we just resolve a promise, because data can't change.
    //The index manipulation is because the blocks are displayed in reverse on the UI, but the blocknums are increasing sequentially.
    if(blockData){
      return Promise.resolve();
    }

    //then return promise. Not necessary but a convienience in case we want to use then against the return.
    return fetch(state.configuration.urlRestRoot + '/chain/blocks/' + blockNum)
    .then(response => response.json())
    .then(json => {
      dispatch(receiveBlockInfo(blockNum, json))
    })
  }
}


text:
package com.digitalpetri.opcua.stack.core.types.enumerated;

import com.digitalpetri.opcua.stack.core.serialization.DelegateRegistry;
import com.digitalpetri.opcua.stack.core.serialization.UaDecoder;
import com.digitalpetri.opcua.stack.core.serialization.UaEncoder;
import com.digitalpetri.opcua.stack.core.serialization.UaEnumeration;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableMap.Builder;

public enum TrustListMasks implements UaEnumeration {

    None(0),
    TrustedCertificates(1),
    TrustedCrls(2),
    IssuerCertificates(4),
    IssuerCrls(8),
    All(15);

    private final int value;

    TrustListMasks(int value) {
        this.value = value;
    }

    @Override
    public int getValue() {
        return value;
    }

    private static final ImmutableMap<Integer, TrustListMasks> VALUES;

    static {
        Builder<Integer, TrustListMasks> builder = ImmutableMap.builder();
        for (TrustListMasks e : values()) {
            builder.put(e.getValue(), e);
        }
        VALUES = builder.build();
    }

    public static TrustListMasks from(Integer value) {
        if (value == null) return null;
        return VALUES.getOrDefault(value, null);
    }

    public static void encode(TrustListMasks trustListMasks, UaEncoder encoder) {
        encoder.encodeInt32(null, trustListMasks.getValue());
    }

    public static TrustListMasks decode(UaDecoder decoder) {
        int value = decoder.decodeInt32(null);

        return VALUES.getOrDefault(value, null);
    }

    static {
        DelegateRegistry.registerEncoder(TrustListMasks::encode, TrustListMasks.class);
        DelegateRegistry.registerDecoder(TrustListMasks::decode, TrustListMasks.class);
    }

}


text:
package loon.component;

import loon.LSystem;
import loon.LTexture;
import loon.action.sprite.ISprite;
import loon.opengl.GLEx;

/**
 * 用于将一个精灵当作UI注入Screen
 */
public class LSpriteUI extends LContainer {

	private ISprite _sprite;

	public LSpriteUI(ISprite sprite) {
		super(sprite.x(), sprite.y(), (int) sprite.getWidth(), (int) sprite.getHeight());
		this.customRendering = true;
		this.setBackground(sprite.getBitmap());
		this.setElastic(true);
		this.setLocked(false);
	}

	public void syncSprite() {
		if (_sprite != null) {
			this.setRotation(_sprite.getRotation());
			this.setAlpha(_sprite.getAlpha());
			this.setBackground(_sprite.getBitmap());
			this.setColor(_sprite.getColor());
			this.setVisible(_sprite.isVisible());
			this.setScale(_sprite.getScaleX(), _sprite.getScaleY());
			this.setState(_sprite.getState());
			this.setTag(_sprite.getTag());
			this.setLocation(_sprite.getX(), _sprite.getY());
			this.setLayer(_sprite.getLayer());
		}
	}

	public void syncComponent() {
		if (_sprite != null) {
			_sprite.setRotation(getRotation());
			_sprite.setAlpha(getAlpha());
			_sprite.setColor(getColor());
			_sprite.setVisible(isVisible());
			_sprite.setScale(getScaleX(), getScaleY());
			_sprite.setState(getState());
			_sprite.setLocation(getX(), getY());
			_sprite.setLayer(getLayer());
		}
	}

	public ISprite getSprite() {
		return this._sprite;
	}

	@Override
	protected void processTouchClicked() {
		if (!input.isMoving()) {
			this.doClick();
		}
	}

	@Override
	protected void processKeyPressed() {
		if (this.isSelected()) {
			this.doClick();
		}
	}

	@Override
	protected void createCustomUI(GLEx g, int x, int y, int w, int h) {
		if (_sprite != null) {
			_sprite.createUI(g, x, y);
		}
	}

	@Override
	protected void processTouchDragged() {
		if (!locked) {
			if (_sprite != null) {
				setLocation(_sprite.getX(), _sprite.getY());
			}
			if (getContainer() != null) {
				getContainer().sendToFront(this);
			}
			this.move(this.input.getTouchDX(), this.input.getTouchDY());
			if (_sprite != null) {
				_sprite.setLocation(getX(), getY());
			}
		}
		super.dragClick();
	}

	@Override
	protected void processTouchPressed() {
		if (!input.isMoving()) {
			super.processTouchPressed();
		}
	}

	@Override
	protected void processTouchReleased() {
		if (!input.isMoving()) {
			super.processTouchReleased();
		}
	}

	@Override
	public void createUI(GLEx g, int x, int y, LComponent component, LTexture[] buttonImage) {

	}

	@Override
	public String getUIName() {
		return "LSprite:" + _sprite == null ? LSystem.UNKOWN : _sprite.getName();
	}

	@Override
	public void close() {
		super.close();
		if (_sprite != null) {
			_sprite.close();
		}
	}

}


text:
/**
 *
 * Library for the max3421e USB host controller shield produced by circuitsathome and Sparkfun.
 * This is a low-level interface that provides access to the internal registers and polls the
 * controller for state changes.
 *
 * This library is based on work done by Oleg Mazurov, but has been heavily restructured.
 *
 * Control over the GPIO pins has been stripped.
 *
 * http://www.circuitsathome.com/
 */
#ifndef __max3421e_h__
#define __max3421e_h__

#include "max3421e_constants.h"
#include "pins_arduino.h"

/**
 * Max3421e registers in host mode.
 */
typedef enum
{
	MAX_REG_RCVFIFO = 0x08,
	MAX_REG_SNDFIFO = 0x10,
	MAX_REG_SUDFIFO = 0x20,
	MAX_REG_RCVBC = 0x30,
	MAX_REG_SNDBC = 0x38,
	MAX_REG_USBIRQ = 0x68,
	MAX_REG_USBIEN = 0x70,
	MAX_REG_CPUCTL = 0x80,
	MAX_REG_USBCTL = 0x78,
	MAX_REG_PINCTL = 0x88,
	MAX_REG_REVISION = 0x90,
	MAX_REG_FNADDR = 0x98,
	MAX_REG_GPINIRQ = 0xb0,
	MAX_REG_HIRQ = 0xc8,
	MAX_REG_HIEN = 0xd0,
	MAX_REG_MODE = 0xd8,
	MAX_REG_PERADDR = 0xe0,
	MAX_REG_HCTL = 0xe8,
	MAX_REG_HXFR = 0xf0,
	MAX_REG_HRSL = 0xf8
} max_registers;

#define PIN_MAX_SS 10
#define PIN_MAX_INT 9
#define PIN_MAX_GPX 8
#define PIN_MAX_RESET 7

#define MAX_SS(x) digitalWrite(SS, x)
#define MAX_INT() digitalRead(PIN_MAX_INT)
#define MAX_GPX() digitalRead(PIN_MAX_INT)
#define MAX_RESET(x) digitalWrite(PIN_MAX_RESET, x)

// Completely untested guesswork for the ADK reference board
#ifdef ADK_REF_BOARD

#define PIN_MAX_SS 53
#define PIN_MAX_INT 9
#define PIN_MAX_GPX 8
#define PIN_MAX_RESET 7

#define MAX_SS(x) digitalWrite(SS, x)
#define MAX_INT() ((PORTE & 0x40) >> 6)
#define MAX_GPX() ((PORTJ & 0x08) >> 3)
#define MAX_RESET(x) { if (x) PORTJ |= 0x04; else PORTJ &= ~0x04; }

#endif

void max3421e_init();
void max3421e_write(uint8_t reg, uint8_t val);
uint8_t * max3421e_writeMultiple(uint8_t reg, uint8_t count, uint8_t * values);
void max3421e_gpioWr(uint8_t val);
uint8_t max3421e_read(uint8_t reg);
uint8_t * max3421e_readMultiple(uint8_t reg, uint8_t count, uint8_t * values);
uint8_t max3421e_gpioRd(void);
boolean max3421e_reset();
boolean max3421e_vbusPwr(boolean action);
void max3421e_busprobe(void);
void max3421e_powerOn();
uint8_t max3421e_getVbusState();

uint8_t max3421e_poll(void);

uint8_t max3421e_interruptHandler(void);
uint8_t max3421e_gpxInterruptHandler(void);

#endif //_MAX3421E_H_


text:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); ?>
<!DOCTYPE html>

	<meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
	<link rel="stylesheet" href="<?php echo base_url(); ?>/assets/css/bootstrap.min.css">
	<link rel="stylesheet" href="<?php echo base_url(); ?>/assets/css/cloud.css">
	<title>SimpleCloud</title>

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

		</button>
		<?= anchor('cloud', ' SimpleCloud', array('class'=>'navbar-brand')) ?>

<?= $this->session->userdata('username') ?>

				 Options

User Management

Add user

Edit user

Delete user

Others

Configure

LOG

<?= anchor('auth/logout', 'Log Out') ?>

	<?php if(isset($error)&&$error!==''): ?>

		<button type="button" class="close" data-dismiss="alert" aria-label="Close">×</button>
		Error <?= $error?>

	<?php endif ?>
	<?php if(isset($_GET['error'])): ?>

		<button type="button" class="close" data-dismiss="alert" aria-label="Close">×</button>
		Error <?= $this->input->get('error') ?>

	<?php endif ?>
	<?php if($this->input->get('upload_success')): ?>

		<button type="button" class="close" data-dismiss="alert" aria-label="Close">×</button>
		Success File <?= $this->input->get('upload_name') ?> uploaded

	<?php endif ?>
	<?php if($this->input->get('create_success')): ?>

		<button type="button" class="close" data-dismiss="alert" aria-label="Close">×</button>
		Success <?= $this->input->get('create_name') ?> created

	<?php endif ?>
	<?php if($this->input->get('delete_success')): ?>

		<button type="button" class="close" data-dismiss="alert" aria-label="Close">×</button>
		Success <?= $this->input->get('delete_name') ?> deleted

	<?php endif ?>


text:
#import <Foundation/Foundation.h>

#import "MGLTypes.h"

NS_ASSUME_NONNULL_BEGIN

/**
 The MGLAccountManager object provides a global way to set a Mapbox API access
 token.
 */
@interface MGLAccountManager : NSObject

#pragma mark Authorizing Access

/**
 Set the
 Mapbox access token
 to be used by all instances of MGLMapView in the current application.

 Mapbox-hosted vector tiles and styles require an API access token, which you
 can obtain from the
 Mapbox account page.
 Access tokens associate requests to Mapbox's vector tile and style APIs with
 your Mapbox account. They also deter other developers from using your styles
 without your permission.

 @param accessToken A Mapbox access token. Calling this method with a value of
    `nil` has no effect.

 @note You must set the access token before attempting to load any Mapbox-hosted
    style. Therefore, you should generally set it before creating an instance of
    MGLMapView. The recommended way to set an access token is to add an entry to
    your application's Info.plist file with the key `MGLMapboxAccessToken` and
    the type String. Alternatively, you may call this method from your
    application delegate's `-applicationDidFinishLaunching:` method.
 */
+ (void)setAccessToken:(nullable NSString *)accessToken;

/**
 Returns the
 Mapbox access token
 in use by instances of MGLMapView in the current application.
 */
+ (nullable NSString *)accessToken;

+ (BOOL)mapboxMetricsEnabledSettingShownInApp __attribute__((deprecated("Telemetry settings are now always shown in the ℹ menu.")));

@end

NS_ASSUME_NONNULL_END


text:
package sms.core.actor

import sms.core.actor.Tasks.TaskEnvelope

object MasterWorkerProtocol {
  /** Sent by master to the workers */
  case class TaskToBeDone(todo: TaskEnvelope*)

  /** Sent by worker to the master to confirm success of done work with its result */
  case class TaskDone(result: Any*)

  /** Sent by worker to the master to indicate failure during work */
  case class TaskExecutionException(result: (Throwable, TaskEnvelope)*)
}


text:
<!DOCTYPE html>

	<meta charset="UTF-8">
	<title>Service</title>
	<link rel="stylesheet" href="../css/bootstrap.min.css">

	Enter a number: <input type="text" data-ng-model="number">
	<button data-ng-click="square()">Square</button>
	<button data-ng-click="cube()">Cube</button>

Answer: {{ answer }}


text:
sudo -H pip2 install --upgrade pip
sudo -H pip2 install -Ur pip2-requirements.txt


text:
namespace uih {

void ListView::hit_test_ex(POINT pt_client, ListView::HitTestResult& result)
{
    const RECT rc_item_area = get_items_rect();
    const int item_area_height = RECT_CY(rc_item_area);

    result.column = pfc_infinite;
    const int first_column_left = -m_horizontal_scroll_position + get_total_indentation();
    const t_size column_count = m_columns.size();
    int last_column_right = first_column_left;

    for (size_t column_index{0}; column_index < column_count; column_index++) {
        const int left = last_column_right;
        const int right = last_column_right + m_columns[column_index].m_display_size;

        if (pt_client.x >= left && pt_client.x < right)
            result.column = column_index;

        last_column_right = right;
    }

    if (pt_client.y < rc_item_area.top) {
        result.index = get_first_viewable_item();
        result.insertion_index = result.index;
        result.category = HitTestCategory::AboveViewport;
        return;
    }

    if (pt_client.y >= rc_item_area.bottom) {
        result.index = get_last_viewable_item();
        result.insertion_index = result.index;
        result.category = HitTestCategory::BelowViewport;
        return;
    }

    const int header_height = rc_item_area.top;
    const int y_position = pt_client.y - header_height + m_scroll_position;
    const auto vertical_hit_test_result = vertical_hit_test(y_position);

    if (vertical_hit_test_result.position_category == VerticalPositionCategory::OnItem) {
        const int item_top = get_item_position(vertical_hit_test_result.item_leftmost);
        const int item_bottom = get_item_position_bottom(vertical_hit_test_result.item_leftmost);
        const int item_height = get_item_height(result.index);

        result.index = vertical_hit_test_result.item_leftmost;
        result.insertion_index = result.index;

        if (pt_client.x < first_column_left)
            result.category = HitTestCategory::LeftOfItem;
        else if (pt_client.x >= last_column_right)
            result.category = HitTestCategory::RightOfItem;
        else if (item_top < m_scroll_position)
            result.category = HitTestCategory::OnItemObscuredAbove;
        else if (item_bottom > m_scroll_position + item_area_height)
            result.category = HitTestCategory::OnItemObscuredBelow;
        else
            result.category = HitTestCategory::OnUnobscuredItem;

        if (item_height >= 2 && y_position - item_top >= item_height / 2)
            result.insertion_index++;

        return;
    }

    if (vertical_hit_test_result.position_category == VerticalPositionCategory::OnGroupHeader) {
        assert(m_group_count > 0);

        const int item_top = get_item_position(vertical_hit_test_result.item_leftmost);

        result.category = HitTestCategory::OnGroupHeader;
        result.index = vertical_hit_test_result.item_leftmost;
        result.insertion_index = result.index;
        result.group_level = m_group_count - (item_top - 1 - y_position) / m_group_height - 1;

        assert(result.group_level < m_group_count);

        if (pt_client.x < 0)
            result.category = HitTestCategory::LeftOfGroupHeader;
        else if (pt_client.x >= last_column_right)
            result.category = HitTestCategory::RightOfGroupHeader;

        return;
    }

    result.index = vertical_hit_test_result.item_leftmost;
    result.insertion_index = vertical_hit_test_result.item_rightmost;
    result.category = HitTestCategory::NotOnItem;
}

ListView::ItemVisibility ListView::get_item_visibility(t_size index)
{
    const auto item_area_height = get_item_area_height();
    const auto item_start_position = get_item_position(index);
    const auto item_end_position = get_item_position_bottom(index);

    if (item_end_position < m_scroll_position)
        return ItemVisibility::AboveViewport;

    if (item_start_position >= m_scroll_position + item_area_height)
        return ItemVisibility::BelowViewport;

    // The case where both the top and bottom of the item is obscured is ignored as it has little practical use
    if (item_start_position < m_scroll_position) {
        return ItemVisibility::ObscuredAbove;
    }

    if (item_end_position > m_scroll_position + item_area_height) {
        return ItemVisibility::ObscuredBelow;
    }

    return ItemVisibility::FullyVisible;
}

bool ListView::is_partially_visible(t_size index)
{
    const auto item_visibility = get_item_visibility(index);

    return item_visibility == ItemVisibility::FullyVisible || item_visibility == ItemVisibility::ObscuredAbove
        || item_visibility == ItemVisibility::ObscuredBelow;
}

bool ListView::is_fully_visible(t_size index)
{
    return get_item_visibility(index) == ItemVisibility::FullyVisible;
}

int ListView::get_last_viewable_item()
{
    if (!m_items.size())
        return 0;

    const auto item_area_height = get_item_area_height();
    const auto vertical_hit_test_result = vertical_hit_test(m_scroll_position + item_area_height);

    const int index = vertical_hit_test_result.item_leftmost;
    const auto item_visibility = get_item_visibility(index);

    if (item_visibility == ItemVisibility::BelowViewport || item_visibility == ItemVisibility::ObscuredBelow)
        return (std::max)(0, index - 1);

    return index;
}

int ListView::get_first_viewable_item()
{
    const auto item_count = gsl::narrow<int>(m_items.size());
    if (item_count == 0)
        return 0;

    const auto vertical_hit_test_result = vertical_hit_test(m_scroll_position);

    const int index = vertical_hit_test_result.item_rightmost;
    const auto item_visibility = get_item_visibility(index);

    if (item_visibility == ItemVisibility::AboveViewport || item_visibility == ItemVisibility::ObscuredAbove)
        return (std::min)(index + 1, item_count);

    return index;
}

ListView::VerticalHitTestResult ListView::vertical_hit_test(int y) const
{
    const auto item_count = gsl::narrow<int>(m_items.size());

    if (item_count == 0)
        return {VerticalPositionCategory::NoItems};

    auto max = item_count;
    auto min = 0;

    while (min <= max) {
        const auto middle = (min + max) / 2;
        const auto item_group_headers_top = get_item_position(middle, true);
        const auto item_top = get_item_position(middle);
        const auto item_bottom = get_item_position_bottom(middle);
        if (y >= item_bottom)
            min = middle + 1;
        else if (y < item_group_headers_top)
            max = middle - 1;
        else if (y < item_top)
            return {VerticalPositionCategory::OnGroupHeader, middle, middle};
        else
            return {VerticalPositionCategory::OnItem, middle, middle};
    }

    const int index_before = std::clamp(max, 0, item_count - 1);
    const int index_after = std::clamp(min, 0, item_count);

    return {VerticalPositionCategory::BetweenItems, index_before, index_after};
}

} // namespace uih


text:
<?php

namespace VB\CommerceBundle\Entity;

use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
use VB\CommerceBundle\Util\StringUtil;
use JMS\Serializer\Annotation as JMS;

/**
 * @ORM\Entity
 * @ORM\Table(name="product_variant")
 * @JMS\AccessType("public_method")
 * @JMS\ExclusionPolicy("all")
 */
class ProductVariant
{
    /**
     * @ORM\Id
     * @ORM\Column(type="integer")
     * @ORM\GeneratedValue(strategy="AUTO")
     * @JMS\Type("integer")
     * @JMS\Expose()
     */
    protected $id;

    /**
     * @ORM\Column(type="integer",length=8,nullable=true)
     * @JMS\Type("integer")
     * @JMS\Expose()
     */
    protected $price;

    /**
     * @ORM\Column(length=16,nullable=true)
     * @JMS\Expose()
     * @JMS\Type("string")
     */
    protected $sku;

    /**
     * @ORM\Column(type="integer",length=8,nullable=true)
     */
    protected $oldPrice;

    /**
     * @ORM\ManyToOne(targetEntity="Product", inversedBy="variants")
     * @ORM\JoinColumn(name="product_id", referencedColumnName="id")
     */
    protected $product;

    /**
     * @ORM\OneToMany(targetEntity="VariantProperty", mappedBy="variant", orphanRemoval=true, cascade="all")
     *
     */
    protected $properties;

    public function __construct()
    {
        $this->properties = new ArrayCollection();
    }

    /**
     * @return mixed
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * @param mixed $id
     */
    public function setId($id)
    {
        $this->id = $id;
    }

    /**
     * @param mixed $oldPrice
     */
    public function setOldPrice($oldPrice)
    {
        $this->oldPrice = $oldPrice;
    }

    /**
     * @return mixed
     */
    public function getOldPrice()
    {
        return $this->oldPrice;
    }

    /**
     * @param mixed $price
     */
    public function setPrice($price)
    {
        $this->price = $price;
    }

    /**
     * @return mixed
     */
    public function getPrice()
    {
        return $this->price;
    }

    /**
     * @param mixed $product
     */
    public function setProduct($product)
    {
        $this->product = $product;
    }

    /**
     * @return Product
     */
    public function getProduct()
    {
        return $this->product;
    }

    /**
     * @param mixed $properties
     */
    public function setProperties($properties)
    {
        $this->properties = $properties;
    }

    /**
     * @return mixed
     */
    public function getProperties()
    {
        return $this->properties;
    }

    /**
     * @param mixed $property
     */
    public function addProperty($property)
    {
        $this->properties->add($property);
        $property->setVariant($this);
    }

    /**
     * @param mixed $property
     */
    public function removeProperty($property)
    {
        $this->properties->removeElement($property);
        $property->setVariant(null);
    }

    /**
     * @param mixed $sku
     */
    public function setSku($sku)
    {
        $this->sku = $sku;
    }

    /**
     * @return mixed
     */
    public function getSku()
    {
        return $this->sku;
    }

}


text:
from msrest.serialization import Model

class TaskUpdateParameter(Model):
    """The set of changes to be made to a task.

    :param constraints: Constraints that apply to this task. If omitted, the
     task is given the default constraints. For multi-instance tasks, updating
     the retention time applies only to the primary task and not subtasks.
    :type constraints: ~azure.batch.models.TaskConstraints
    """

    _attribute_map = {
        'constraints': {'key': 'constraints', 'type': 'TaskConstraints'},
    }

    def __init__(self, constraints=None):
        super(TaskUpdateParameter, self).__init__()
        self.constraints = constraints


text:
<?php

namespace Helthe\Component\Segmentio\Method;

/**
 * TrackMethod is used to track an action done by a user.
 *
 * @author Carl Alexander <carlalexander@helthe.co>
 */
class TrackMethod extends AbstractMethod
{
    /**
     * The event name.
     *
     * @var string
     */
    private $event;

    /**
     * The event properties.
     *
     * @var array
     */
    private $properties;

    /**
     * Constructor.
     *
     * @param string $event
     * @param array  $properties
     */
    public function __construct($event, array $properties = array())
    {
        $this->event = $event;
        $this->properties = $properties;
    }

    /**
     * {@inheritdoc}
     */
    public function getArguments()
    {
        return array(
            'event'      => $this->event,
            'properties' => $this->properties,
        );
    }

    /**
     * {@inheritdoc}
     */
    public function getName()
    {
        return 'track';
    }

    /**
     * {@inheritdoc}
     */
    protected function getSupportedPlatforms()
    {
        return array(
            self::BROWSER_PLATFORM,
            self::SERVER_PLATFORM
        );
    }
}


text:
<?php

namespace Symfony\Bundle\MakerBundle\Doctrine;

/**
 * @internal
 */
abstract class BaseSingleRelation extends BaseRelation
{
    private $isNullable;

    public function isNullable(): bool
    {
        if ($this->isNullable) {
            return $this->isNullable;
        }

        return false;
    }

    public function setIsNullable($isNullable)
    {
        $this->isNullable = $isNullable;

        return $this;
    }
}


text:
package com.hannesdorfmann.mosby.sample.mail.model.contact;

import android.os.Parcel;
import android.os.Parcelable;
import com.hannesdorfmann.parcelableplease.annotation.ParcelablePlease;

/**
 * @author Hannes Dorfmann
 */
@ParcelablePlease public class ProfileScreen implements Parcelable {

  public static final int TYPE_MAILS = 0;
  public static final int TYPE_ABOUT = 1;

  int type;
  String name;

  private ProfileScreen() {
  }

  public ProfileScreen(int type, String name) {
    this.type = type;
    this.name = name;
  }

  public int getType() {
    return type;
  }

  public String getName() {
    return name;
  }

  @Override public int describeContents() {
    return 0;
  }

  @Override public void writeToParcel(Parcel dest, int flags) {
    ProfileScreenParcelablePlease.writeToParcel(this, dest, flags);
  }

  public static final Creator<ProfileScreen> CREATOR = new Creator<ProfileScreen>() {
    public ProfileScreen createFromParcel(Parcel source) {
      ProfileScreen target = new ProfileScreen();
      ProfileScreenParcelablePlease.readFromParcel(target, source);
      return target;
    }

    public ProfileScreen[] newArray(int size) {
      return new ProfileScreen[size];
    }
  };
}


text:
package org.apache.derby.iapi.jdbc;

import javax.transaction.xa.XAException;
import org.apache.derby.iapi.services.context.ContextService;
import org.apache.derby.iapi.store.access.xa.XAResourceManager;
import org.apache.derby.iapi.store.access.xa.XAXactId;
import org.apache.derby.shared.common.error.StandardException;

/**
	The resource adapter is the clearing house for managing connections,
	transactions, and XAResources in a JDBC based resource manager living in
	the distributed transaction processing environment.

 There is one instance of ResourceAdapter per Resource Manager (database).
	The ResourceAdapter is responsible for keeping track of all run time global
	transactions and their state.   The resource adapter only knows of run time
	global transactions, i.e., it does not know of in-doubt global transactions
	re-created by recovery.

	The following is an overall design of the JTA implementation in Derby,
	most of it has little to do with the ResourceAdapter interface itself.

Design Overview

The overriding design principle is that existing code should be disturbed
	as little as possible.  This is so that DTP code will not add to the bloat
	and drag of a normal, local, embbeded system.  The second design principle
	is that as much of the JDBC 2.0 extension functionality is to be
	implemented in the Connectivity layer and not in the underlying storage
	system as possible.  Ideally, the additional storage interface will
	implement no more than what is necessary to support the XAResource
	interface.

Language and replication code should not be touched, or have very
	minimal API changes.  The API changes are confined to passing XA calls down
	to the store.

Some change will be made to existing Connectivity code and new XA
	modules will be added.  This collection of code is hereby referred to as
	the "blob of mysterious connectivity code", or the "resource adapter", or
	"RA" for short.  In the JTA doc, the resource adapter is considered to be
	part of the JDBC driver.  This RA means "some connectivity code", it
	doesn't mean the object that implements the ResourceAdapter interface.

The most important difference, in terms of implementation, between a
	Connection that deals with a local transaction and a Connection that deals
	with a global transaction is that in a global transaction, 2 or more
	objects and threads can influence it - maybe concurrently.  The normal JDBC
	interaction goes thru the Connection, but transaction demarcation comes
	from an XAResource object(s).  The RA will channel all XAResource calls
	that deal with a run time XA transaction (i.e., commit, end, forget,
	prepare, start) thru the TransactionController that represents the real
	transaction underneath.   Furthermore, the RA will make sure that all calls
	thru a Connection or thru any XAResource objects must pass thru some sort
	of synchronized object before it can get to the underlying transaction
	object.  This is so that there is only one path to change the state of a
	run time transaction and the transaction object and the context manager can
	remain single thread access.

In-doubt transaction (i.e., transactions re-created by recovery)
	management and concurrency control is the responsibiliy of store. Moreover,
	since the RA does not know the identities of the list of in-doubt
	transactions, store must deal with (throw exception) when someone wants to
	start a transaction with the same Xid as an existing in-doubt transaction.

In terms of what this means to the app server that is calling us: if the
	Connection and the XAResource that represents a global transaction is being
	accessed by 2 different threads, they will access the database serially and
	not concurrently. An in-doubt transaction gotten thru recovery has no
	transaction object that is ever visible to the RA - because there is no
	connection that was ever made to it.  Therefore it is safe to influence the
	state of an in-doubt transaction directly thru some store factory interface
	- and have that go thru the transaction table underneath to find the actual
	transaction object and context manager etc.

One new functionality of a Connection is the ability to switch around
	with different transactions.  Before JTA, the lifetime of a transaction is
	bounded by a connection, and a transaction cannot migrate from one
	connection to another.  In JTA, a global transaction can be detached from a
	Connection.  A transaction can move around and be attached to different
	connections and its lifetime is not confine to the connection that started
	it.  From the Connection's point of view, before JTA, a (local) transaction
	is always started and ended in the same connection. With JTA, it needs to
	"take on" existing global transactions that was started by some other
	connections.

The RA will have the responsibility of

setting up a Context with the appropriate transaction before calling
	store to do work.

handling error on the context.

restoring a previous context if it was switched out due to an XAResouce
	call to commit a transaction that is not what the XAResoruce is currently
	attached to.

Because of all these switching around, a Connection may be in a
	transaction-less state.  This happens between an XAResource.end call that
	detached the current global transaction from the Connection, and the next
	XAResource.start call that attach the next global transaction with the
	Connection.

An (inferior) implementation is for the Connection object to start a
	local connection once it is detached from a global transaction.  If the
	user then uses the Connection immediately without a XAResource.start call,
	then this Connection behaves just like it did before JTA, i.e., with a
	local transaction.  If, on the other hand, an XAResource.start call happens
	next, then either the local transaction is "morphed" into a global
	transaction, or, if the start call is to attach the connection to a
	pre-existing global transaction, then the local transaction is thrown away
	and the Connection will take on the pre-exising global transaction.

Another (superior) implementation is to make it possible for a
	Connection to be transaction-less.  When a Connection is first created by
	XAConnection.getConnection, or when a XAResource.end call detached a global
	transaction from the Connection, it is left in a transaction-less state.
	If a XAResource.start call happens next, then the Connection either start a
	new global transaction or it takes on an existing one.  If a call is made
	directly on the Connection before XAResource.start call happens, then the
	Connection starts a new local transaction.  This only affects Connections
	that was gotten thru the XAConnection.getConnection().  Connections gotten
	thru the DriverManager or a DataSource will have a local transaction
	automatically started, as is the behavior today.  When a Connection with a
	local transaction commits, the transaction is still around but it is chain
	to the next one - this is the current behavior.  This behavior is very
	desirable from a performance point of view, so it should be retained.
	However, a local transaction cannot "morph" into a global transaction,
	therefore when this Connection is attached to a global transaction, the
	local transaction is thrown away and a global one started

The RA will need to keep track of all global transactions.  This is done
	by (yet another) transaction table that lives in the RA.  This transaction
	table maps Xid to the ContextManager of the global transaction and whatever
	else a connection needs to talk to the transaction - I assume the
	Connection object currently have tendrils into various contexts and objects
	and these are things that need to be detached and attached when a
	Connection is hooked up with another transaction.  The reason for yet
	another transaction table instead of the one in store is because the one in
	store keeps track of local and internal transactions and is really quite
	overworked already.

Detailed design

 First some ugly pictures.  Some links are not shown to reduce
	clutter.  Externally visible object is in bold.

*
* When user ask for an XAConnection via a XADataSource, the following objects
* exists
*

*
*                                                     |-------------|
*                                  |======= produces=>| XAResource  |
*                                  ||                 |-------------|
*                                  ||                       |
*                                  ||                     has A
*                                  ||                       |
*                                  ||  |---------------------
*                                  ||  V
* |--------------| produces |--------------|
* | XADataSource |=========>| XAConnection
* |--------------|          |--------------|
*       |                          |
*     extends                    extends
*       |                          |
*       |                |-----------------------|   |----------------------|
*       |                | DB2jPooledConnection |==>| BrokeredConnection |
*       |                |-----------------------|   |----------------------|
*       |                          |       ^                  |
*       |                        has A     |               has A
*       |                          |       |                  |
* |-----------------|              |       --------------------
* | EmbeddedDataSource |              |
* |-----------------|              |
*       |                          |
*     has A                        |
*       |                          |
*       V                          V
* |------------|           |----------------------|   |-----------------------|
* | JDBCDriver |=produces=>| DetachableConnection |==>| XATransactionResource |
* | LocalDriver|           |----------------------|   |                       |
* |------------|                   |                  |   points to :         |
*                                  |                  |XATransactionController|
*                                  |                  | ContextManager        |
*                                  |                  | LCC                   |
*                                  |                  | .. etc ..             |
*                                  |                  |-----------------------|
*                                  |                            |
*                                extends                     extends
*                                  |                            |
*                           |-----------------|       |-----------------------|
*                           | EmbedConnection |-- ?-->|  TransactionResource  |
*                           |-----------------|       |-----------------------|
*
*
*

* When user ask for a PooledConnection via a PooledDataSource, the following
* objects exists
*

* |-------------------------------|
* | EmbeddedConnectionPoolDataSource |
* |-------------------------------|
*       |                  ||
*       |                  ||
*     extends             produces
*       |                  ||
*       |                  \/
*       |                |-----------------------|   |----------------------|
*       |                | DB2jPooledConnection |==>| BrokeredConnection |
*       |                |-----------------------|   |----------------------|
*       |                          |       ^                  |
*       |                        has A     |               has A
*       |                          |       |                  |
* |-----------------|              |       --------------------
* | EmbeddedDataSource |              |
* |-----------------|              |
*       |                          |
*     has A                        |
*       |                          |
*       V                          V
* |------------|           |----------------------|   |-----------------------|
* | JDBCDriver |=produces=>| EmbedConnection |==>|  TransactionResource  |
* | LocalDriver|           |----------------------|   |-----------------------|
* |------------|
*
*
*
*

* When user ask for a (normal) Connection via a DataSource, the following
* objects exists. The EmbeddedDataSource is just a wrapper for the JDBCDriver.
*

* |-----------------|
* | EmbeddedDataSource |
* |-----------------|
*       |
*     has A
*       |
*       V
* |------------|            |-----------------|     |-----------------------|
* | JDBCDriver |==produces=>| EmbedConnection |- ?->| TransactionResource   |
* | LocalDriver|            |-----------------|     |-----------------------|
* |------------|

XADataSource inherits DataSource methods from EmbeddedDataSource.  It also
	implements ResourceAdapter, whose main job is to keep track of run time
	global transactions.  A global transaction table maps XIDs to
	XATransactionResource.  XADataSource also has a XAResourceManager, which
	implements XAResource functionality in the Store.

XAConnection is the one thing that unites a global connection and the
	XAResource that delineates the global transaction.  This is where the real
	XAResource functionality is implemented.  All XAResource calls to the
	XAResource object as well as Connection call to the BrokeredConnection
	channels thrus the XAConnection, which makes sure only one thread can be
	accessing the DB2jPooledConnection at any given time.

XAResource and BrokeredConnection[23]0 are the two objects we give back
	to the TM and the user application respectively to control a distributed
	transaction.  According to the XA spec, the app server is supposed to make
	sure that these objects are not used the same time by multiple threads, but
	we don't trust the app server.  Therefore, we channel everthing back to the
	XAConnection.

The MT consideration is actually more complicated than this,
	because a XAResource is allowed to control any transaction, not just the
	one its XAConnection is current attached to.  So it is not sufficient to
	just synchronized on XAConnection to guarentee single thread access to the
	underlying transaction context.  To control some arbitrary global
	transaction, the TM can call XAResource to prepare any Xid.  To do that,
	the XAResource pass the request to the XAConnection, the XAConnection ask
	the XADataSource to find the XATransactionResource, sets up the thread's
	context, and call ask the XATransactionResource to prepare.  The
	XATransactionResource is synchronized to prevent some other thread from
	attaching, commiting, and in any way calling on the the same transaction
	context.  If any error is thrown, it is handled with the context of the
	transaction being prepared.  After the error is handled, the old context
	(the one where the XAResource is really attached to), is restored.  While
	this monkey business is going on, the thread that holds the connection the
	XAConnection is supposed to be attached to is blocked out.  It can resume
	after its XAConnection restored its context.  (Here is where I am not
	really sure what happens since that thread obviously doesn't know about all
	these hanky panky caused by the thread holding the XAResource commiting,
	preparing and rolling back some other irrelavant transactions, so how would
	its context be affected in any way?).

DB2jPooledConnection implements PooledConnection, is hands out these
	connection handles which allows some app server to do connection pooling.
	This is a very thin layer.  A connection handle implements a Connection by
	passing thru all calls to the underlaying connection.  In this case, it
	passes Connection call thru the DB2jPooledConnection to the
	DetachableConnection underneath.

EmbeddedDataSource implements JNDI and is a replacement for Driver.

The LocalDriver can now produce a DetachableConnection as well as a
	EmbedConnection (which is the pre-JTA Connection that cannot detach and
	attach to different transactions).  The way the LocalDriver knows to create
	a DetachableConnection versus a EmbedConnection is thru some extremely
	hackish URL settings.  This thing is very ugly and a more elegant way can
	(and should) no doubt be found.

DetachableConnection is a connection which can detach and attach to
	different XATransactionResource, and can be totally unattached to any
	transaction.

XATransactionResource is a bundle of things that sets up a connection
	with all the stuff it needs to actually talk to the database, do error
	handling, etc.  It is also the object that lives in the transaction table
	managed by the ResourceAdapter (XADataSource).  A XAResource (which may or
	may not be attached to a transaction) can commit, prepare, or rollback any
	global transaction that is not attached to an XAConnection.  To do that,
	the ResourceAdapter fishes out the XATransactionResource, set up the
	context, and do the commit processing/error handling on the current
	thread.

Local Connection is the same old local Connection except one
	difference.  Pre-JTA, a localConnection uses itself (or a root Connection)
	as the object to synchronized upon so that multiple threads getting hold of
	the same Connection object cannot simultaneously issue calls to the
	underlying transaction or context (since those things must be single thread
	access).  With JTA, the object of synchronization is the
	TransactionResource itself.  This part has not been well thought through
	and is probably wrong.

TransactionResource is a base class for XATransactionResource.  For a
	local transaction which cannot be detached from a connection, there is no
	need to encapsulate a bundle of things to set up a connection, so a
	TransactionResource (probably misnamed) has nothing and is used only for
	synchronization purposes.  This part has not been well thought throught and
	is probably wrong.

The non-XA PooledConnection is just a thin veneer over the normal
	connection.  I now have it over a Detachable connection just to simplify
	the inheritence (XAConnection need to extend PooledConnection and XAConnect
	needs to be detachable.  However, PooledConnection itself need not be
	detachable).  It could be changed around to have LocalDriver producing
	either EmbedConnection or XAConnection, and have the XAConnection
	implements detachable.  But the current way is simpler.

 */
public interface ResourceAdapter {

	/**
		If a run time global transaction exists, the resource adapter will find
		it and return a capsule of information so that a Connection can be
		attached to the transaction.

		@param xid the global transaction id
		@return the transaction resource if the xid correspond to a run
		time transaction, otherwise return null
	 */
	//XATransactionResource findTransaction(XAXactId xid);

	/**
		Start a run time global transaction.  Add this to the list of
		transactions managed by this resource adapter.

		@return true if transaction can be added, otherwise false (dupid).

	 */
	//boolean addTransaction(XATransactionResource tr);

	/**
		Terminates a run time global transction.  Remove this from the list of
		transactions managed by this resource adapter.
	 */
	//void removeTransaction(XATransactionResource tr);

	/**
		Let a xaResource get the XAResourceManager to commit or rollback an
		in-doubt transaction.

        @return the XA resource manager
	 */
	XAResourceManager getXAResourceManager();

	/**
		Get the context service factory.
	 */
	//ContextService getContextServiceFactory();

	/**
		Is the Resource Manager active

        @return true if the resource manager is active
	 */
	boolean isActive();

	public Object findConnection(XAXactId xid);

	public boolean addConnection(XAXactId xid, Object conn);

	public Object removeConnection(XAXactId xid);

	/**
	 * Cancel the XA transaction identified by the specified xid.  The
	 * method will atomically cancel any running statement on behalf
	 * of the transaction, end the transaction association with the
	 * XAResource instance, and rollback of the global transaction.
	 * @param xid tranaction id to cancel
	 * @param messageId error to report when canceling
     *
     * @throws XAException on error
	 */
	public void cancelXATransaction(XAXactId xid, String messageId)
		throws XAException;
}


text:
"use strict";

import { expect } from "chai";
import 'mocha';
import { GW_GET_GROUP_INFORMATION_CFM, GW_COMMON_STATUS } from "../../src";

describe("KLF200-API", function() {
    describe("GW_GET_GROUP_INFORMATION_CFM", function() {
        describe("Constructor", function() {
            it("should create without error", function() {
                const data = Buffer.from([0x05, 0x02, 0x21, 0x00, 42]);
                expect(() => new GW_GET_GROUP_INFORMATION_CFM(data)).not.to.throw();
            });

            it("should return the group ID", function() {
                const data = Buffer.from([0x05, 0x02, 0x21, 0x00, 42]);
                const result = new GW_GET_GROUP_INFORMATION_CFM(data);
                expect(result.GroupID).to.equal(42);
            });

            it("should return the status", function() {
                const data = Buffer.from([0x05, 0x02, 0x21, 0x00, 42]);
                const result = new GW_GET_GROUP_INFORMATION_CFM(data);
                expect(result.Status).to.equal(GW_COMMON_STATUS.SUCCESS);
            });
        });

        describe("getError", function() {
            it("should throw No error", function() {
                const data = Buffer.from([0x05, 0x02, 0x21, 0x00, 42]);
                const result = new GW_GET_GROUP_INFORMATION_CFM(data);
                expect(() => result.getError()).to.throw();
            });

            it("should return 'Request failed.'", function() {
                const data = Buffer.from([0x05, 0x02, 0x21, 0x01, 42]);
                const result = new GW_GET_GROUP_INFORMATION_CFM(data);
                expect(result.getError()).to.equal("Request failed.");
            });

            it("should return 'Invalid group ID.'", function() {
                const data = Buffer.from([0x05, 0x02, 0x21, 0x02, 42]);
                const result = new GW_GET_GROUP_INFORMATION_CFM(data);
                expect(result.getError()).to.equal("Invalid group ID.");
            });

            it("should return 'Unknown error 3.'", function() {
                const data = Buffer.from([0x05, 0x02, 0x21, 0x03, 42]);
                const result = new GW_GET_GROUP_INFORMATION_CFM(data);
                expect(result.getError()).to.equal("Unknown error 3.");
            });
        });
    });
});


text:
package org.osgi.util.tracker;

import org.osgi.framework.ServiceReference;

/**
 * The {@code ServiceTrackerCustomizer} interface allows a
 * {@code ServiceTracker} to customize the service objects that are
 * tracked. A {@code ServiceTrackerCustomizer} is called when a service is
 * being added to a {@code ServiceTracker}. The
 * {@code ServiceTrackerCustomizer} can then return an object for the
 * tracked service. A {@code ServiceTrackerCustomizer} is also called when
 * a tracked service is modified or has been removed from a
 * {@code ServiceTracker}.
 *
 *

 * The methods in this interface may be called as the result of a
 * {@code ServiceEvent} being received by a {@code ServiceTracker}.
 * Since {@code ServiceEvent}s are synchronously delivered by the
 * Framework, it is highly recommended that implementations of these methods do
 * not register ({@code BundleContext.registerService}), modify (
 * {@code ServiceRegistration.setProperties}) or unregister (
 * {@code ServiceRegistration.unregister}) a service while being
 * synchronized on any object.
 *
 *

 * The {@code ServiceTracker} class is thread-safe. It does not call a
 * {@code ServiceTrackerCustomizer} while holding any locks.
 * {@code ServiceTrackerCustomizer} implementations must also be
 * thread-safe.
 *
 * @param <S> The type of the service being tracked.
 * @param <T> The type of the tracked object.
 * @ThreadSafe
 * @version $Id: c654a963336cee74762b8f54c8cef8d5774f8b4d $
 */
public interface ServiceTrackerCustomizer<S, T> {
	/**
	 * A service is being added to the {@code ServiceTracker}.
	 *
	 *

	 * This method is called before a service which matched the search
	 * parameters of the {@code ServiceTracker} is added to the
	 * {@code ServiceTracker}. This method should return the service object
	 * to be tracked for the specified {@code ServiceReference}. The
	 * returned service object is stored in the {@code ServiceTracker} and
	 * is available from the {@code getService} and
	 * {@code getServices} methods.
	 *
	 * @param reference The reference to the service being added to the
	 *        {@code ServiceTracker}.
	 * @return The service object to be tracked for the specified referenced
	 *         service or {@code null} if the specified referenced service
	 *         should not be tracked.
	 */
	public T addingService(ServiceReference<S> reference);

	/**
	 * A service tracked by the {@code ServiceTracker} has been modified.
	 *
	 *

	 * This method is called when a service being tracked by the
	 * {@code ServiceTracker} has had it properties modified.
	 *
	 * @param reference The reference to the service that has been modified.
	 * @param service The service object for the specified referenced service.
	 */
	public void modifiedService(ServiceReference<S> reference, T service);

	/**
	 * A service tracked by the {@code ServiceTracker} has been removed.
	 *
	 *

	 * This method is called after a service is no longer being tracked by the
	 * {@code ServiceTracker}.
	 *
	 * @param reference The reference to the service that has been removed.
	 * @param service The service object for the specified referenced service.
	 */
	public void removedService(ServiceReference<S> reference, T service);
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
  <component name="ProjectModuleManager">
    <modules>
      <module fileurl="file://$PROJECT_DIR$/app/app.iml" filepath="$PROJECT_DIR$/app/app.iml" />
      <module fileurl="file://$PROJECT_DIR$/distancefieldfonts.iml" filepath="$PROJECT_DIR$/distancefieldfonts.iml" />
    </modules>
  </component>
</project>


text:
package com.amazonaws.services.elasticbeanstalk.model;

import java.io.Serializable;
import javax.annotation.Generated;

/**
 *

 * A list of available AWS Elastic Beanstalk solution stacks.
 *

 *
 * @see AWS API Documentation
 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class ListAvailableSolutionStacksResult extends com.amazonaws.AmazonWebServiceResult<com.amazonaws.ResponseMetadata> implements Serializable, Cloneable {

    /**
     *

     * A list of available solution stacks.
     *

     */
    private com.amazonaws.internal.SdkInternalList<String> solutionStacks;
    /**
     *

     * A list of available solution stacks and their SolutionStackDescription.
     *

     */
    private com.amazonaws.internal.SdkInternalList<SolutionStackDescription> solutionStackDetails;

    /**
     *

     * A list of available solution stacks.
     *

     *
     * @return A list of available solution stacks.
     */

    public java.util.List<String> getSolutionStacks() {
        if (solutionStacks == null) {
            solutionStacks = new com.amazonaws.internal.SdkInternalList<String>();
        }
        return solutionStacks;
    }

    /**
     *

     * A list of available solution stacks.
     *

     *
     * @param solutionStacks
     *        A list of available solution stacks.
     */

    public void setSolutionStacks(java.util.Collection<String> solutionStacks) {
        if (solutionStacks == null) {
            this.solutionStacks = null;
            return;
        }

        this.solutionStacks = new com.amazonaws.internal.SdkInternalList<String>(solutionStacks);
    }

    /**
     *

     * A list of available solution stacks.
     *

     *

     * NOTE: This method appends the values to the existing list (if any). Use
     * {@link #setSolutionStacks(java.util.Collection)} or {@link #withSolutionStacks(java.util.Collection)} if you want
     * to override the existing values.
     *

     *
     * @param solutionStacks
     *        A list of available solution stacks.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public ListAvailableSolutionStacksResult withSolutionStacks(String... solutionStacks) {
        if (this.solutionStacks == null) {
            setSolutionStacks(new com.amazonaws.internal.SdkInternalList<String>(solutionStacks.length));
        }
        for (String ele : solutionStacks) {
            this.solutionStacks.add(ele);
        }
        return this;
    }

    /**
     *

     * A list of available solution stacks.
     *

     *
     * @param solutionStacks
     *        A list of available solution stacks.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public ListAvailableSolutionStacksResult withSolutionStacks(java.util.Collection<String> solutionStacks) {
        setSolutionStacks(solutionStacks);
        return this;
    }

    /**
     *

     * A list of available solution stacks and their SolutionStackDescription.
     *

     *
     * @return A list of available solution stacks and their SolutionStackDescription.
     */

    public java.util.List<SolutionStackDescription> getSolutionStackDetails() {
        if (solutionStackDetails == null) {
            solutionStackDetails = new com.amazonaws.internal.SdkInternalList<SolutionStackDescription>();
        }
        return solutionStackDetails;
    }

    /**
     *

     * A list of available solution stacks and their SolutionStackDescription.
     *

     *
     * @param solutionStackDetails
     *        A list of available solution stacks and their SolutionStackDescription.
     */

    public void setSolutionStackDetails(java.util.Collection<SolutionStackDescription> solutionStackDetails) {
        if (solutionStackDetails == null) {
            this.solutionStackDetails = null;
            return;
        }

        this.solutionStackDetails = new com.amazonaws.internal.SdkInternalList<SolutionStackDescription>(solutionStackDetails);
    }

    /**
     *

     * A list of available solution stacks and their SolutionStackDescription.
     *

     *

     * NOTE: This method appends the values to the existing list (if any). Use
     * {@link #setSolutionStackDetails(java.util.Collection)} or {@link #withSolutionStackDetails(java.util.Collection)}
     * if you want to override the existing values.
     *

     *
     * @param solutionStackDetails
     *        A list of available solution stacks and their SolutionStackDescription.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public ListAvailableSolutionStacksResult withSolutionStackDetails(SolutionStackDescription... solutionStackDetails) {
        if (this.solutionStackDetails == null) {
            setSolutionStackDetails(new com.amazonaws.internal.SdkInternalList<SolutionStackDescription>(solutionStackDetails.length));
        }
        for (SolutionStackDescription ele : solutionStackDetails) {
            this.solutionStackDetails.add(ele);
        }
        return this;
    }

    /**
     *

     * A list of available solution stacks and their SolutionStackDescription.
     *

     *
     * @param solutionStackDetails
     *        A list of available solution stacks and their SolutionStackDescription.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public ListAvailableSolutionStacksResult withSolutionStackDetails(java.util.Collection<SolutionStackDescription> solutionStackDetails) {
        setSolutionStackDetails(solutionStackDetails);
        return this;
    }

    /**
     * Returns a string representation of this object; useful for testing and debugging.
     *
     * @return A string representation of this object.
     *
     * @see java.lang.Object#toString()
     */
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("{");
        if (getSolutionStacks() != null)
            sb.append("SolutionStacks: ").append(getSolutionStacks()).append(",");
        if (getSolutionStackDetails() != null)
            sb.append("SolutionStackDetails: ").append(getSolutionStackDetails());
        sb.append("}");
        return sb.toString();
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;

        if (obj instanceof ListAvailableSolutionStacksResult == false)
            return false;
        ListAvailableSolutionStacksResult other = (ListAvailableSolutionStacksResult) obj;
        if (other.getSolutionStacks() == null ^ this.getSolutionStacks() == null)
            return false;
        if (other.getSolutionStacks() != null && other.getSolutionStacks().equals(this.getSolutionStacks()) == false)
            return false;
        if (other.getSolutionStackDetails() == null ^ this.getSolutionStackDetails() == null)
            return false;
        if (other.getSolutionStackDetails() != null && other.getSolutionStackDetails().equals(this.getSolutionStackDetails()) == false)
            return false;
        return true;
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;

        hashCode = prime * hashCode + ((getSolutionStacks() == null) ? 0 : getSolutionStacks().hashCode());
        hashCode = prime * hashCode + ((getSolutionStackDetails() == null) ? 0 : getSolutionStackDetails().hashCode());
        return hashCode;
    }

    @Override
    public ListAvailableSolutionStacksResult clone() {
        try {
            return (ListAvailableSolutionStacksResult) super.clone();
        } catch (CloneNotSupportedException e) {
            throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
        }
    }

}


text:
package org.apache.ddlutils.platform;

import java.util.HashMap;
import java.util.Map;

import org.apache.ddlutils.TestBase;
import org.apache.ddlutils.model.Database;
import org.apache.ddlutils.model.Table;

/**
 * Test the base SqlBuilder class.
 *
 * @version $Revision: $
 */
public class TestSqlBuilder extends TestBase
{
    /**
     * Tests the {@link SqlBuilder#getUpdateSql(Table, Map, boolean)} method.
     */
    public void testUpdateSql()
    {
        final String modelXml =
            "<?xml version='1.0' encoding='ISO-8859-1'?>\n"+
            "<database name='ddlutils'>\n"+
            "  <table name='TestTable'>\n"+
            "    <column name='id' autoIncrement='true' type='INTEGER' primaryKey='true'/>\n"+
            "    <column name='name' type='VARCHAR' size='15'/>\n"+
            "  </table>\n"+
            "</database>";

        TestPlatform platform   = new TestPlatform();
        SqlBuilder   sqlBuilder = platform.getSqlBuilder();
        Database     database   = parseDatabaseFromString(modelXml);
        Map          map        = new HashMap();

        map.put("name", "ddlutils");
        map.put("id", new Integer(0));

        platform.setDelimitedIdentifierModeOn(true);

        String sql = sqlBuilder.getUpdateSql(database.getTable(0), map, false);

        assertEquals("UPDATE \"TestTable\" SET \"name\" = 'ddlutils' WHERE \"id\" = '0'",
                     sql);
    }
}


text:
// <auto-generated />
using DarkStatsCore.Data;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage;
using Microsoft.EntityFrameworkCore.Storage.Internal;
using System;

namespace DarkStatsCore.Data.Migrations
{
    [DbContext(typeof(DarkStatsDbContext))]
    [Migration("20171202200717_indexes")]
    partial class indexes
    {
        protected override void BuildTargetModel(ModelBuilder modelBuilder)
        {
#pragma warning disable 612, 618
            modelBuilder
                .HasAnnotation("ProductVersion", "2.0.0-rtm-26452");

            modelBuilder.Entity("DarkStatsCore.Data.Settings", b =>
                {
                    b.Property<string>("Name")
                        .ValueGeneratedOnAdd();

                    b.Property<double>("DoubleValue");

                    b.Property<int>("IntValue");

                    b.Property<string>("StringValue");

                    b.HasKey("Name");

                    b.ToTable("Settings");
                });

            modelBuilder.Entity("DarkStatsCore.Data.TrafficStats", b =>
                {
                    b.Property<string>("Ip");

                    b.Property<DateTime>("Day");

                    b.Property<string>("Hostname");

                    b.Property<long>("In");

                    b.Property<string>("LastSeen");

                    b.Property<string>("Mac");

                    b.Property<long>("Out");

                    b.HasKey("Ip", "Day");

                    b.HasIndex("Day", "In", "Out");

                    b.HasIndex("Ip", "Day", "Hostname", "In", "LastSeen", "Mac", "Out");

                    b.ToTable("TrafficStats");
                });
#pragma warning restore 612, 618
        }
    }
}


text:
**Namespace:** [OfficeDevPnP.Core.Framework.Provisioning.Providers.Xml.V201512](OfficeDevPnP.Core.Framework.Provisioning.Providers.Xml.V201512.md)
**Assembly:** OfficeDevPnP.Core.dll
## Syntax
```C#
public TermTerms()
```
## See also
- [TermTerms](OfficeDevPnP.Core.Framework.Provisioning.Providers.Xml.V201512.TermTerms.md)
- [OfficeDevPnP.Core.Framework.Provisioning.Providers.Xml.V201512](OfficeDevPnP.Core.Framework.Provisioning.Providers.Xml.V201512.md)


text:
## Overview

From a paranoid point of view, there's a lot that can go wrong when working
with Protocol Buffers messages, e.g. allocation errors, buffer underruns or
garbled data. For this reason, protobluff is designed to anticipate and catch
all possible errors and to be very specific about what went wrong.

protobluff will always handle erroneous messages gracefully by design. If a
buffer with an allocation error is passed to a message constructor, the message
will be flagged invalid. Next, if a field to or from this invalid message is
written or read, the resulting return code will indicate the same. The error
will gracefully propagate through all subsequent function calls. However, to
catch errors and unexpected behavior, the validity of the created structures
and return values should always be checked explicitly.

Errors are represented through codes defined in the type `pb_error_t` in the
public header file `core/common.h`. For a detailed explanation of the specific
error codes see [this section](#error-codes).

## Errors in return values

All functions that return the type `pb_error_t` are meant to be encapsulated
in conditional clauses. The compiler will be very whiny if this is forgotten,
thanks to the custom compiler attribute `__warn_unused_result__` that is
defined for the respective functions if supported by the compiler (Clang and
GCC have had this for a long time). Though it is not recommended, this
behavior can be deactivated by compiling the linking program with the flag
`-Wno-unused-result`.

If the call to a function is successful, `PB_ERROR_NONE` is returned which is
set to the value `0`, POSIX-style. All other error codes have values greater
than zero. This allows easy checks for error conditions in two levels of
verbosity. If no further details regarding the error are necessary, checking
for errors is as simple as:

``` c
if (pb_validator_check(&validator, &buffer)) {
  /* Nope, there was an error */
}
```

When more information on the type of the error is needed, the following idiom
should be applied:

``` c
pb_error_t error;
if ((error = pb_validator_check(&validator, &buffer))) {
  /* Nope, there was an error */
}
```

The function `pb_error_string` is similar to the POSIX function `strerror`
that returns a human-readable representation of an error code:

``` c
fprintf(stderr, "Error: %s", pb_error_string(error));
```

## Errors upon creation

When creating new structures, protobluff makes heavy use of the stack where
possible to minimize the need for dynamic allocations:

``` c
pb_buffer_t buffer = pb_buffer_create_empty();
```

Usually, libraries that use dynamic allocation and return pointers implement
error conditions by returning `NULL` pointers. However, to get further details
on the type of error an extra argument to receive the type of error would have
to be passed to the function call or a global variable like `errno` would have
to be used. As protobluff uses stack allocation wherever possible, a different
approach has to be taken.

For this reason, errors that happen upon creation are encoded into the
resulting structure, which has two advantages opposed to passing an argument to
receive the error: first, there's no need to pass an error pointer as an extra
argument. Second, as stated before, the error is encoded into the structure, so
subsequent calls on an erroneous structure will fail gracefully, e.g.:

``` c
/* Allocation fails, therefore buffer is invalid */
pb_buffer_t buffer = pb_buffer_create_empty();

/* Message is invalid, as it's created from an invalid buffer */
pb_message_t message = pb_message_create(&descriptor, &buffer);

/* Write to field is not executed, as message is invalid */
pb_message_put(&message, 1, &value);
```

Nevertheless, it is highly recommended to check every function that returns a
new structure or the type `pb_error_t` for errors. See the specific sections
for more details on how this should be done in the respective cases.

## Error codes

### `PB_ERROR_NONE`

The operation was successful. This constant will always yield the value `0`.

### `PB_ERROR_ALLOC`

The required memory could not be allocated, almost only due to an out-of-memory
condition (`ENOMEM`). This may happen when creating a buffer or implicitly
altering a buffer by writing to its dedicated message or fields.

### `PB_ERROR_INVALID`

The arguments passed to the function were not valid, e.g. passing an invalid
buffer to a message constructor or trying to write a value to a message for a
tag that is not part of the underlying message definition.

### `PB_ERROR_VARINT`

An invalid variable-sized integer was encountered, i.e. the corresponding type
is too small. If this happens, the underlying message is either garbled or the
message definitions may not be in sync. For example, a field was changed from
`int32` to `int64` on the encoding side, but forgotten to be updated on the
decoding side.

### `PB_ERROR_OFFSET`

This error is most likely related to garbled data, e.g. when a length prefix
denoted that a message of certain length follows, but the buffer terminated
unexpectedly.

### `PB_ERROR_ABSENT`

This error is returned when trying to read the value of an optional field that
is not present and the field does not define a default value, or a required
field is missing during message validation.

### `PB_ERROR_EOM`

Returned by `pb_cursor_error`, when the cursor is past the end of the last
matching field occurrence, to indicate that the cursor in not valid anymore.


text:
#ifndef LOGREADER_H
#define LOGREADER_H

// Includes
#include <string>
#include <vector>

using namespace std;

#undef BASECLASS
#define BASECLASS Result

#include "Result.h"			// Baseclass definition

////////////////////////////////////////////////////////////////////////////////
// class LogReader

class LogReader : public BASECLASS
{
// Construction and destruction
public:
	///////////////////////////////////////////////////////////////////////////////
	// constructor of LogReader
	//
	// parameters	:	strLogFile		log file to be read
	///////////////////////////////////////////////////////////////////////////////
	explicit LogReader( const string& strLogFile );

	///////////////////////////////////////////////////////////////////////////////
	// destructor of LogReader
	///////////////////////////////////////////////////////////////////////////////
	~LogReader();

private:
	LogReader( const LogReader& src ){};	// Copy constructor

// Public interface
public:
	///////////////////////////////////////////////////////////////////////////////
	// function		:	Good()
	//
	// description	:	This function states whether or not the LogReader object is
	//					able to read its log file.
	//
	// parameters	:	-
	//
	// returns		:	true	able to read log
	//					false	unable to read log
	///////////////////////////////////////////////////////////////////////////////
	bool Good() const;

	///////////////////////////////////////////////////////////////////////////////
	// function		:	GetFileName()
	//
	// description	:	This function returns the name of the log file to read.
	//
	// parameters	:	-
	//
	// returns		:	string containing log file name
	///////////////////////////////////////////////////////////////////////////////
	const string& GetFileName() const;

	///////////////////////////////////////////////////////////////////////////////
	// function		:	NextLine()
	//
	// description	:	This function reads the next line from the log file, and
	//					fills the member variables with the new line's values. If
	//					the end of the file is reached, false is returned.
	//
	// parameters	:	-
	//
	// returns		:	true	next line read
	//					false	end of log file reached
	///////////////////////////////////////////////////////////////////////////////
	bool NextLine();

	///////////////////////////////////////////////////////////////////////////////
	// function		:	GetLine()
	//
	// description	:	This function returns the last read line. If no line has
	//					been read yet, or if the end of file has been read, an
	//					empty string is returned.
	//
	// parameters	:	-
	//
	// returns		:	string containing last read line
	///////////////////////////////////////////////////////////////////////////////
	const string& GetLine() const;

	///////////////////////////////////////////////////////////////////////////////
	// function		:	GetArgument()
	//
	// description	:	This function returns the specified argument from the last
	//					read line. If the specified argument index is out of range,
	//					or if there is no last read line, an empty string is
	//					returned.
	//					Note that the first argument of a line has index 1.
	//
	// parameters	:	nIndex		argument index
	//
	// returns		:	string containing specified argument
	///////////////////////////////////////////////////////////////////////////////
	string GetArgument( int nIndex ) const;

	///////////////////////////////////////////////////////////////////////////////
	// function		:	GetNumberOfArguments()
	//
	// description	:	This function returns the number of arguments that the last
	//					read line has. If there is no last read line, zero is
	//					returned.
	//
	// parameters	:	-
	//
	// returns		:	number of arguments of the last read line
	///////////////////////////////////////////////////////////////////////////////
	int GetNumberOfArguments() const;

	///////////////////////////////////////////////////////////////////////////////
	// function		:	GetLineNumber()
	//
	// description	:	This function returns the number of the last read line; the
	//					first one has number 1.
	//					If there is no last read line, zero is returned.
	//
	// parameters	:	-
	//
	// returns		:	line number of the last read line
	///////////////////////////////////////////////////////////////////////////////
	int GetLineNumber() const;

// Implementation
private:
	///////////////////////////////////////////////////////////////////////////////
	// function		:	ClearLine()
	//
	// description	:	This function sets the last read line to an empty string
	//					and its argument-vector to an empty vector.
	//
	// parameters	:	-
	//
	// returns		:	-
	///////////////////////////////////////////////////////////////////////////////
	void ClearLine();

// Member variables
private:
	bool m_bGood;						// states whether the object is ready
	string m_strDelimiter;				// argument delimiter
	string m_strFileName;				// log file to read
	string m_strLine;					// last read line
	vector<string> m_vstrArguments;		// arguments of last read line
	int m_nLine;						// number of last read line
};

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

#undef BASECLASS
#endif // !LOGREADER_H


text:
Table to show:

		Select a table that you want to show, created in Tables Module.

Rows on table:

		We will paginate the table for you. How many rows do you want? Leave empty to adapt.

Duration of paginated table:

		How long will a table slide durate? Leave it empty to be Automatic


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<meta http-equiv="Content-Type" content="text/html" charset="UTF-8">
<title>Uses of Class com.thinkaurelius.titan.diskstorage.keycolumnvalue.ConsistencyLevel (Titan: Distributed Graph Database 0.3.0 API)</title>
<meta name="date" content="2013-03-29">
<link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Uses of Class
com.thinkaurelius.titan.diskstorage.keycolumnvalue.ConsistencyLevel

Packages that use ConsistencyLevel

Package
Description

com.thinkaurelius.titan.diskstorage.berkeleyje

com.thinkaurelius.titan.diskstorage.cassandra

com.thinkaurelius.titan.diskstorage.common

com.thinkaurelius.titan.diskstorage.hbase

com.thinkaurelius.titan.diskstorage.inmemory

com.thinkaurelius.titan.diskstorage.keycolumnvalue

com.thinkaurelius.titan.diskstorage.keycolumnvalue.inmemory

com.thinkaurelius.titan.diskstorage.keycolumnvalue.keyvalue

com.thinkaurelius.titan.diskstorage.locking.consistentkey

Uses of ConsistencyLevel in com.thinkaurelius.titan.diskstorage.berkeleyje

Methods in com.thinkaurelius.titan.diskstorage.berkeleyje with parameters of type ConsistencyLevel

Modifier and Type
Method and Description

BerkeleyJETx
BerkeleyJEStoreManager.beginTransaction(ConsistencyLevel level)

Constructors in com.thinkaurelius.titan.diskstorage.berkeleyje with parameters of type ConsistencyLevel

Constructor and Description

BerkeleyJETx(com.sleepycat.je.Transaction t,
            ConsistencyLevel level)

Uses of ConsistencyLevel in com.thinkaurelius.titan.diskstorage.cassandra

Methods in com.thinkaurelius.titan.diskstorage.cassandra with parameters of type ConsistencyLevel

Modifier and Type
Method and Description

StoreTransaction
AbstractCassandraStoreManager.beginTransaction(ConsistencyLevel level)

Constructors in com.thinkaurelius.titan.diskstorage.cassandra with parameters of type ConsistencyLevel

Constructor and Description

CassandraTransaction(ConsistencyLevel level,
                    CassandraTransaction.Consistency readConsistency,
                    CassandraTransaction.Consistency writeConsistency)

Uses of ConsistencyLevel in com.thinkaurelius.titan.diskstorage.common

Methods in com.thinkaurelius.titan.diskstorage.common that return ConsistencyLevel

Modifier and Type
Method and Description

ConsistencyLevel
AbstractStoreTransaction.getConsistencyLevel()

Constructors in com.thinkaurelius.titan.diskstorage.common with parameters of type ConsistencyLevel

Constructor and Description

AbstractStoreTransaction(ConsistencyLevel level)

Uses of ConsistencyLevel in com.thinkaurelius.titan.diskstorage.hbase

Methods in com.thinkaurelius.titan.diskstorage.hbase with parameters of type ConsistencyLevel

Modifier and Type
Method and Description

StoreTransaction
HBaseStoreManager.beginTransaction(ConsistencyLevel level)

Constructors in com.thinkaurelius.titan.diskstorage.hbase with parameters of type ConsistencyLevel

Constructor and Description

HBaseTransaction(ConsistencyLevel level)

Uses of ConsistencyLevel in com.thinkaurelius.titan.diskstorage.inmemory

Methods in com.thinkaurelius.titan.diskstorage.inmemory with parameters of type ConsistencyLevel

Modifier and Type
Method and Description

StoreTransaction
InMemoryStorageAdapter.beginTransaction(ConsistencyLevel consistencyLevel)

Uses of ConsistencyLevel in com.thinkaurelius.titan.diskstorage.keycolumnvalue

Methods in com.thinkaurelius.titan.diskstorage.keycolumnvalue that return ConsistencyLevel

Modifier and Type
Method and Description

ConsistencyLevel
StoreTransaction.getConsistencyLevel()

ConsistencyLevel
BufferTransaction.getConsistencyLevel()

static ConsistencyLevel
ConsistencyLevel.valueOf(String name)

Returns the enum constant of this type with the specified name.

static ConsistencyLevel[]
ConsistencyLevel.values()

Returns an array containing the constants of this enum type, in
the order they are declared.

Methods in com.thinkaurelius.titan.diskstorage.keycolumnvalue with parameters of type ConsistencyLevel

Modifier and Type
Method and Description

StoreTransaction
StoreManager.beginTransaction(ConsistencyLevel consistencyLevel)

Returns a transaction handle for a new transaction.

Uses of ConsistencyLevel in com.thinkaurelius.titan.diskstorage.keycolumnvalue.inmemory

Methods in com.thinkaurelius.titan.diskstorage.keycolumnvalue.inmemory with parameters of type ConsistencyLevel

Modifier and Type
Method and Description

StoreTransaction
InMemoryStoreManager.beginTransaction(ConsistencyLevel consistencyLevel)

Uses of ConsistencyLevel in com.thinkaurelius.titan.diskstorage.keycolumnvalue.keyvalue

Methods in com.thinkaurelius.titan.diskstorage.keycolumnvalue.keyvalue with parameters of type ConsistencyLevel

Modifier and Type
Method and Description

StoreTransaction
KeyValueStoreManagerAdapter.beginTransaction(ConsistencyLevel level)

Uses of ConsistencyLevel in com.thinkaurelius.titan.diskstorage.locking.consistentkey

Methods in com.thinkaurelius.titan.diskstorage.locking.consistentkey that return ConsistencyLevel

Modifier and Type
Method and Description

ConsistencyLevel
ConsistentKeyLockTransaction.getConsistencyLevel()

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Copyright © 2012-2013. All Rights Reserved.


text: CodeKindaSmart::Application.config.session_store :cookie_store, key: '_CodeKindaSmart_session'