text:
package storage

import (
	"io"
	"os"
	"path/filepath"

	"github.com/anacrolix/missinggo"

	"github.com/anacrolix/torrent/metainfo"
)

// File-based storage for torrents, that isn't yet bound to a particular
// torrent.
type fileClientImpl struct {
	baseDir   string
	pathMaker func(baseDir string, info *metainfo.Info, infoHash metainfo.Hash) string
	pc        PieceCompletion
}

// The Default path maker just returns the current path
func defaultPathMaker(baseDir string, info *metainfo.Info, infoHash metainfo.Hash) string {
	return baseDir
}

func infoHashPathMaker(baseDir string, info *metainfo.Info, infoHash metainfo.Hash) string {
	return filepath.Join(baseDir, infoHash.HexString())
}

// All Torrent data stored in this baseDir
func NewFile(baseDir string) ClientImpl {
	return NewFileWithCompletion(baseDir, pieceCompletionForDir(baseDir))
}

func NewFileWithCompletion(baseDir string, completion PieceCompletion) ClientImpl {
	return newFileWithCustomPathMakerAndCompletion(baseDir, nil, completion)
}

// File storage with data partitioned by infohash.
func NewFileByInfoHash(baseDir string) ClientImpl {
	return NewFileWithCustomPathMaker(baseDir, infoHashPathMaker)
}

// Allows passing a function to determine the path for storing torrent data
func NewFileWithCustomPathMaker(baseDir string, pathMaker func(baseDir string, info *metainfo.Info, infoHash metainfo.Hash) string) ClientImpl {
	return newFileWithCustomPathMakerAndCompletion(baseDir, pathMaker, pieceCompletionForDir(baseDir))
}

func newFileWithCustomPathMakerAndCompletion(baseDir string, pathMaker func(baseDir string, info *metainfo.Info, infoHash metainfo.Hash) string, completion PieceCompletion) ClientImpl {
	if pathMaker == nil {
		pathMaker = defaultPathMaker
	}
	return &fileClientImpl{
		baseDir:   baseDir,
		pathMaker: pathMaker,
		pc:        completion,
	}
}

func (me *fileClientImpl) Close() error {
	return me.pc.Close()
}

func (fs *fileClientImpl) OpenTorrent(info *metainfo.Info, infoHash metainfo.Hash) (TorrentImpl, error) {
	dir := fs.pathMaker(fs.baseDir, info, infoHash)
	err := CreateNativeZeroLengthFiles(info, dir)
	if err != nil {
		return nil, err
	}
	return &fileTorrentImpl{
		dir,
		info,
		infoHash,
		fs.pc,
	}, nil
}

type fileTorrentImpl struct {
	dir        string
	info       *metainfo.Info
	infoHash   metainfo.Hash
	completion PieceCompletion
}

func (fts *fileTorrentImpl) Piece(p metainfo.Piece) PieceImpl {
	// Create a view onto the file-based torrent storage.
	_io := fileTorrentImplIO{fts}
	// Return the appropriate segments of this.
	return &filePieceImpl{
		fts,
		p,
		missinggo.NewSectionWriter(_io, p.Offset(), p.Length()),
		io.NewSectionReader(_io, p.Offset(), p.Length()),
	}
}

func (fs *fileTorrentImpl) Close() error {
	return nil
}

// Creates natives files for any zero-length file entries in the info. This is
// a helper for file-based storages, which don't address or write to zero-
// length files because they have no corresponding pieces.
func CreateNativeZeroLengthFiles(info *metainfo.Info, dir string) (err error) {
	for _, fi := range info.UpvertedFiles() {
		if fi.Length != 0 {
			continue
		}
		name := filepath.Join(append([]string{dir, info.Name}, fi.Path...)...)
		os.MkdirAll(filepath.Dir(name), 0777)
		var f io.Closer
		f, err = os.Create(name)
		if err != nil {
			break
		}
		f.Close()
	}
	return
}

// Exposes file-based storage of a torrent, as one big ReadWriterAt.
type fileTorrentImplIO struct {
	fts *fileTorrentImpl
}

// Returns EOF on short or missing file.
func (fst *fileTorrentImplIO) readFileAt(fi metainfo.FileInfo, b []byte, off int64) (n int, err error) {
	f, err := os.Open(fst.fts.fileInfoName(fi))
	if os.IsNotExist(err) {
		// File missing is treated the same as a short file.
		err = io.EOF
		return
	}
	if err != nil {
		return
	}
	defer f.Close()
	// Limit the read to within the expected bounds of this file.
	if int64(len(b)) > fi.Length-off {
		b = b[:fi.Length-off]
	}
	for off < fi.Length && len(b) != 0 {
		n1, err1 := f.ReadAt(b, off)
		b = b[n1:]
		n += n1
		off += int64(n1)
		if n1 == 0 {
			err = err1
			break
		}
	}
	return
}

// Only returns EOF at the end of the torrent. Premature EOF is ErrUnexpectedEOF.
func (fst fileTorrentImplIO) ReadAt(b []byte, off int64) (n int, err error) {
	for _, fi := range fst.fts.info.UpvertedFiles() {
		for off < fi.Length {
			n1, err1 := fst.readFileAt(fi, b, off)
			n += n1
			off += int64(n1)
			b = b[n1:]
			if len(b) == 0 {
				// Got what we need.
				return
			}
			if n1 != 0 {
				// Made progress.
				continue
			}
			err = err1
			if err == io.EOF {
				// Lies.
				err = io.ErrUnexpectedEOF
			}
			return
		}
		off -= fi.Length
	}
	err = io.EOF
	return
}

func (fst fileTorrentImplIO) WriteAt(p []byte, off int64) (n int, err error) {
	for _, fi := range fst.fts.info.UpvertedFiles() {
		if off >= fi.Length {
			off -= fi.Length
			continue
		}
		n1 := len(p)
		if int64(n1) > fi.Length-off {
			n1 = int(fi.Length - off)
		}
		name := fst.fts.fileInfoName(fi)
		os.MkdirAll(filepath.Dir(name), 0777)
		var f *os.File
		f, err = os.OpenFile(name, os.O_WRONLY|os.O_CREATE, 0666)
		if err != nil {
			return
		}
		n1, err = f.WriteAt(p[:n1], off)
		// TODO: On some systems, write errors can be delayed until the Close.
		f.Close()
		if err != nil {
			return
		}
		n += n1
		off = 0
		p = p[n1:]
		if len(p) == 0 {
			break
		}
	}
	return
}

func (fts *fileTorrentImpl) fileInfoName(fi metainfo.FileInfo) string {
	return filepath.Join(append([]string{fts.dir, fts.info.Name}, fi.Path...)...)
}


text:
package pkcs12

import (
	"errors"
	"unicode/utf16"
)

// bmpString returns s encoded in UCS-2 with a zero terminator.
func bmpString(s string) ([]byte, error) {
	// References:
	// https://tools.ietf.org/html/rfc7292#appendix-B.1
	// http://en.wikipedia.org/wiki/Plane_(Unicode)#Basic_Multilingual_Plane
	//  - non-BMP characters are encoded in UTF 16 by using a surrogate pair of 16-bit codes
	//	  EncodeRune returns 0xfffd if the rune does not need special encoding
	//  - the above RFC provides the info that BMPStrings are NULL terminated.

	ret := make([]byte, 0, 2*len(s)+2)

	for _, r := range s {
		if t, _ := utf16.EncodeRune(r); t != 0xfffd {
			return nil, errors.New("go-pkcs12: string contains characters that cannot be encoded in UCS-2")
		}
		ret = append(ret, byte(r/256), byte(r%256))
	}

	return append(ret, 0, 0), nil
}

func decodeBMPString(bmpString []byte) (string, error) {
	if len(bmpString)%2 != 0 {
		return "", errors.New("go-pkcs12: odd-length BMP string")
	}

	// strip terminator if present
	if l := len(bmpString); l >= 2 && bmpString[l-1] == 0 && bmpString[l-2] == 0 {
		bmpString = bmpString[:l-2]
	}

	s := make([]uint16, 0, len(bmpString)/2)
	for len(bmpString) > 0 {
		s = append(s, uint16(bmpString[0])<<8+uint16(bmpString[1]))
		bmpString = bmpString[2:]
	}

	return string(utf16.Decode(s)), nil
}

redpajama_set_name: RedPajamaGithub


text:
package com.example.sandro.alertablumenau;

import android.app.Activity;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

import com.example.sandro.alertablumenau.model.Ruas;

import java.util.List;

/**
 * Created by Sandro on 30/06/2017.
 */

public class RuasAdapter  extends BaseAdapter {

    private List<Ruas> ruas;
    private Activity activity;

    public RuasAdapter(Activity activity, List<Ruas> ruas){
        this.ruas =ruas;
        this.activity=activity;
    }
    @Override
    public int getCount() {
        return ruas.size();
    }

    @Override
    public Object getItem(int position) {
        return ruas.get(position);
    }

    @Override
    public long getItemId(int position) {
        return ruas.get(position).getId();
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        View view = this.activity.getLayoutInflater().inflate(android.R.layout.simple_list_item_1,parent,false);
        TextView txt = (TextView)view;
        txt.setText(ruas.get(position).getNome());
        return view;
    }

    public void remove(int position) {
        ruas.remove(position);

    }
}


text:
package cmd

import (
	"fmt"
	"os"
	"strconv"

	"github.com/cilium/cilium/pkg/bpf"
	"github.com/cilium/cilium/pkg/command"
	"github.com/cilium/cilium/pkg/common"
	"github.com/cilium/cilium/pkg/maps/ctmap"

	"github.com/spf13/cobra"
)

// bpfCtListCmd represents the bpf_ct_list command
var bpfCtListCmd = &cobra.Command{
	Use:     "list ( <endpoint identifier> | global )",
	Aliases: []string{"ls"},
	Short:   "List connection tracking entries",
	PreRun:  requireEndpointIDorGlobal,
	Run: func(cmd *cobra.Command, args []string) {
		maps := getMaps(args[0])
		ctMaps := make([]interface{}, len(maps))
		for i, m := range maps {
			ctMaps[i] = m
		}
		common.RequireRootPrivilege("cilium bpf ct list")
		dumpCt(ctMaps, args[0])
	},
}

func init() {
	bpfCtCmd.AddCommand(bpfCtListCmd)
	command.AddJSONOutput(bpfCtListCmd)
}

func getMaps(eID string) []*ctmap.Map {
	if eID == "global" {
		return ctmap.GlobalMaps(true, true)
	}
	id, _ := strconv.Atoi(eID)
	return ctmap.LocalMaps(&dummyEndpoint{ID: id}, true, true)
}

func dumpCt(maps []interface{}, args ...interface{}) {
	entries := make([]ctmap.CtMapRecord, 0)
	eID := args[0]

	for _, m := range maps {
		path, err := m.(ctmap.CtMap).Path()
		if err == nil {
			err = m.(ctmap.CtMap).Open()
		}
		if err != nil {
			if os.IsNotExist(err) {
				msg := "Unable to open %s: %s."
				if eID.(string) != "global" {
					msg = "Unable to open %s: %s: please try using \"cilium bpf ct list global\"."
				}
				fmt.Fprintf(os.Stderr, msg+" Skipping.\n", path, err)
				continue
			}
			Fatalf("Unable to open %s: %s", path, err)
		}
		defer m.(ctmap.CtMap).Close()
		// Plain output prints immediately, JSON output holds until it
		// collected values from all maps to have one consistent object
		if command.OutputJSON() {
			callback := func(key bpf.MapKey, value bpf.MapValue) {
				record := ctmap.CtMapRecord{Key: key.(ctmap.CtKey), Value: *value.(*ctmap.CtEntry)}
				entries = append(entries, record)
			}
			if err = m.(ctmap.CtMap).DumpWithCallback(callback); err != nil {
				Fatalf("Error while collecting BPF map entries: %s", err)
			}
		} else {
			out, err := m.(ctmap.CtMap).DumpEntries()
			if err != nil {
				Fatalf("Error while dumping BPF Map: %s", err)
			}
			fmt.Println(out)
		}
	}
	if command.OutputJSON() {
		if err := command.PrintOutput(entries); err != nil {
			os.Exit(1)
		}
	}
}


text:
An overview of the [Aurelia](http://aurelia.io) framework's value
converter functionality.

This page is written using Aurelia and contains **live examples**.  The full
source is [here](https://github.com/jdanyow/aurelia-converters-sample).

## Data Binding

A short description of data-binding from the Aurelia
[docs](http://aurelia.io/docs.html):

*In Aurelia, user interface elements are composed of view and view-model
pairs. The view is written with HTML and is rendered into the DOM. The
view-model is written with JavaScript and provides data and behavior to
the view.  Aurelia's powerful databinding links the two pieces together
allowing changes in your data to be reflected in the view and vice versa.*

Check out the getting started video
[here](http://aurelia.io/) or the docs [here](http://aurelia.io/docs.html)
for more information.

### Simple Binding Example

Here's a simple data-binding example using the **bind** (`.bind="expression"`)
and **interpolation** (`${expression}`) techniques:


text:
// .NAME vtkWarpTo - deform geometry by warping towards a point
// .SECTION Description
// vtkWarpTo is a filter that modifies point coordinates by moving the
// points towards a user specified position.

#ifndef __vtkWarpTo_h
#define __vtkWarpTo_h

#include "vtkPointSetAlgorithm.h"

class VTK_GRAPHICS_EXPORT vtkWarpTo : public vtkPointSetAlgorithm
{
public:
  static vtkWarpTo *New();
  vtkTypeRevisionMacro(vtkWarpTo,vtkPointSetAlgorithm);
  void PrintSelf(ostream& os, vtkIndent indent);

  // Description:
  // Set/Get the value to scale displacement.
  vtkSetMacro(ScaleFactor,double);
  vtkGetMacro(ScaleFactor,double);

  // Description:
  // Set/Get the position to warp towards.
  vtkGetVectorMacro(Position,double,3);
  vtkSetVector3Macro(Position,double);

  // Description:
  // Set/Get the Absolute ivar. Turning Absolute on causes scale factor
  // of the new position to be one unit away from Position.
  vtkSetMacro(Absolute,int);
  vtkGetMacro(Absolute,int);
  vtkBooleanMacro(Absolute,int);

protected:
  vtkWarpTo();
  ~vtkWarpTo() {};

  int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
  double ScaleFactor;
  double Position[3];
  int   Absolute;
private:
  vtkWarpTo(const vtkWarpTo&);  // Not implemented.
  void operator=(const vtkWarpTo&);  // Not implemented.
};

#endif


text:
package com.elmakers.mine.bukkit.block;

import org.apache.commons.lang.StringUtils;
import org.bukkit.Bukkit;
import org.bukkit.Chunk;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.World;
import org.bukkit.block.Block;
import org.bukkit.block.BlockFace;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.util.BlockVector;
import com.elmakers.mine.bukkit.api.block.UndoList;

import com.elmakers.mine.bukkit.utility.ConfigurationUtils;

import java.lang.ref.WeakReference;
import java.util.Set;

/**
 * Stores a cached Block. Stores the coordinates and world, but will look up a block reference on demand.
 *
 * This also stores the block state using the MaterialAndData structure as a base, and can be
 * used to restore a previously stored state.
 *
 * In addition, BlockData instances can be linked to each other for layered undo queues that work
 * even when undone out of order.
 *
 */
public class BlockData extends MaterialAndData implements com.elmakers.mine.bukkit.api.block.BlockData
{
    public static final BlockFace[] FACES = new BlockFace[] { BlockFace.WEST, BlockFace.NORTH, BlockFace.SOUTH, BlockFace.EAST, BlockFace.UP, BlockFace.DOWN };
    public static final BlockFace[] SIDES = new BlockFace[] { BlockFace.WEST, BlockFace.NORTH, BlockFace.SOUTH, BlockFace.EAST };

    // Transient
    protected com.elmakers.mine.bukkit.api.block.BlockData	nextState;
    protected com.elmakers.mine.bukkit.api.block.BlockData	priorState;

    // Persistent
    protected BlockVector  location;
    protected String       worldName;

    // Used for UndoList lookups
    protected WeakReference<UndoList> undoList = null;

    public static long getBlockId(Block block)
    {
        return getBlockId(block.getWorld().getName(), block.getX(), block.getY(), block.getZ());
    }

    public static long getBlockId(String world, int x, int y, int z)
    {
        // Long is 63 bits
        // 15 sets of F's (4-bits)
        // world gets 4 bits
        // y gets 8 bits
        // and x and z get 24 bits each
        return ((world.hashCode() & 0xF) << 56)
            | (((long)x & 0xFFFFFF) << 32)
            | (((long)z & 0xFFFFFF) << 8)
            | ((long)y & 0xFF);
    }

    @Override
    public int hashCode()
    {
        return (int)getId();
    }

    @Override
    public boolean equals(Object other)
    {
        if (other instanceof BlockData) {
            return getId() == ((BlockData)other).getId();
        }
        return super.equals(other);
    }

    public long getId()
    {
        return getBlockId(worldName, location.getBlockX(), location.getBlockY(), location.getBlockZ());
    }

    public static BlockFace getReverseFace(BlockFace blockFace)
    {
        switch (blockFace)
        {
        case NORTH:
            return BlockFace.SOUTH;
        case WEST:
            return BlockFace.EAST;
        case SOUTH:
            return BlockFace.NORTH;
        case EAST:
            return BlockFace.WEST;
        case UP:
            return BlockFace.DOWN;
        case DOWN:
            return BlockFace.UP;
        default:
            return BlockFace.SELF;
        }
    }

    public BlockData()
    {
    }

    public BlockData(Block block)
    {
        super(block);
        location = new BlockVector(block.getX(), block.getY(), block.getZ());
        worldName = block.getWorld().getName();
    }

    public BlockData(com.elmakers.mine.bukkit.api.block.BlockData copy)
    {
        super(copy);
        location = copy.getPosition();
        worldName = copy.getWorldName();
    }

    public BlockData(Location location, Material material, byte data)
    {
        super(material, data);
        if (location != null) {
            this.location = new BlockVector(location.getBlockX(), location.getBlockY(), location.getBlockZ());
            this.worldName = location.getWorld().getName();
        }
    }

    public BlockData(int x, int y, int z, String world, Material material, byte data)
    {
        super(material, data);
        this.location = new BlockVector(x, y, z);
        this.worldName = world;
    }

    public BlockData(ConfigurationSection node) {
        this(
            ConfigurationUtils.getLocation(node, "location"),
            ConfigurationUtils.getMaterial(node, "material"),
            (byte)node.getInt("data", 0)
        );
    }

    public void save(ConfigurationSection node) {
        node.set("material", ConfigurationUtils.fromMaterial(material));
        node.set("data", data);
        Location location = new Location(Bukkit.getWorld(worldName), this.location.getX(), this.location.getY(), this.location.getZ());
        node.set("location", ConfigurationUtils.fromLocation(location));
    }

    protected boolean checkBlock()
    {
        return getBlock() != null;
    }

    public void setPosition(BlockVector location)
    {
        this.location = location;
    }

    public void unlink()
    {
        if (priorState != null) {
            priorState.setNextState(nextState);
        }
        if (nextState != null) {
            // Pass state up the chain
            nextState.updateFrom(this);
            nextState.setPriorState(priorState);
        }

        priorState = null;
        nextState = null;
    }

    @Override
    public boolean undo()
    {
        return undo(false);
    }

    @Override
    public boolean undo(boolean applyPhysics)
    {
        Block block = getBlock();
        if (block == null)
        {
            return true;
        }

        Chunk chunk = block.getChunk();
        if (!chunk.isLoaded())
        {
            chunk.load();
            return false;
        }

        // Don't undo if not the top of the stack
        // Otherwise, state will be pushed up in unlink
        if (nextState == null && isDifferent(block))
        {
            modify(block, applyPhysics);
        }
        unlink();

        return true;
    }

    @Override
    public void commit()
    {
        if (nextState != null) {
            nextState.setPriorState(null);
            nextState.updateFrom(getBlock());
            nextState = null;
        }

        if (priorState != null) {
            // Very important for recursion!
            priorState.setNextState(null);

            // Cascade the commit downward, unlinking everything,
            // in case other BlockLists contain these records
            priorState.updateFrom(getBlock());
            priorState.commit();
            priorState = null;
        }
    }

    @SuppressWarnings("deprecation")
    public String toString() {
        return location.getBlockX() + "," + location.getBlockY() + "," + location.getBlockZ() + "," + worldName + "|" + getMaterial().getId() + ":" + getData();
    }

    @SuppressWarnings("deprecation")
    public static BlockData fromString(String s) {
        BlockData result = null;
        if (s == null) return null;
        try {
            String[] pieces = StringUtils.split(s, '|');
            String[] locationPieces = StringUtils.split(pieces[0], ',');
            int x = Integer.parseInt(locationPieces[0]);
            int y = Integer.parseInt(locationPieces[1]);
            int z = Integer.parseInt(locationPieces[2]);
            String world = locationPieces[3];
            String[] materialPieces = StringUtils.split(pieces[1], ':');
            int materialId = Integer.parseInt(materialPieces[0]);
            byte dataId = Byte.parseByte(materialPieces[1]);
            return new BlockData(x, y, z, world, Material.getMaterial(materialId), dataId);
        } catch(Exception ex) {
        }

        return result;
    }

    @Override
    public com.elmakers.mine.bukkit.api.block.BlockData getNextState() {
        return nextState;
    }

    @Override
    public void setNextState(com.elmakers.mine.bukkit.api.block.BlockData next) {
        nextState = next;
    }

    @Override
    public com.elmakers.mine.bukkit.api.block.BlockData getPriorState() {
        return priorState;
    }

    @Override
    public void setPriorState(com.elmakers.mine.bukkit.api.block.BlockData prior) {
        priorState = prior;
    }

    @Override
    public void restore() {
        restore(false);
    }

    @Override
    public void restore(boolean applyPhysics) {
        modify(getBlock(), applyPhysics);
    }

    @Override
    public String getWorldName() {
        return worldName;
    }

    @Override
    public BlockVector getPosition()
    {
        return location;
    }

    @Override
    public World getWorld()
    {
        if (worldName == null || worldName.length() == 0) return null;
        return Bukkit.getWorld(worldName);
    }

    @Override
    public Block getBlock()
    {
        Block block = null;
        if (location != null)
        {
            World world = getWorld();
            if (world != null) {
                block = world.getBlockAt(location.getBlockX(), location.getBlockY(), location.getBlockZ());
            }
        }
        return block;
    }

    @Override
    public boolean isDifferent()
    {
        return isDifferent(getBlock());
    }

    @Override
    public UndoList getUndoList() {
        return undoList != null ? undoList.get() : null;
    }

    @Override
    public void setUndoList(UndoList list) {
        if (list == null) {
            undoList = null;
            return;
        }
        undoList = new WeakReference<UndoList>(list);
    }

    public BlockVector getLocation() {
        return location;
    }

    public boolean containsAny(Set<Material> materials)
    {
        if (materials.contains(material)) return true;
        if (priorState != null) {
            return priorState.containsAny(materials);
        }

        return false;
    }
}


text:
var path = require('path');
var webpack = require('webpack');
var _ = require('lodash');
var config = require('../webpack.config.js');

var development = _.extend({}, config, {
  devtool: 'eval',
  entry: ['webpack/hot/dev-server','./index.js'],
  output: {
    path: __dirname,
    filename: 'bundle.js',
    publicPath: '/'
  },
  plugins: config.plugins.concat(
    new webpack.NormalModuleReplacementPlugin(
      /^webpack-react-starter$/,
      '../src/index'
    )
  ),
  eslint: {
    configFile: '../.eslintrc'
  }
});

module.exports = development;


text:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/local_song_item"
    android:layout_width="match_parent"
    android:layout_height="@dimen/y120"
    android:background="?attr/selectableItemBackground">

    <ImageView
        android:id="@+id/local_song_cover"
        android:layout_width="@dimen/x80"
        android:layout_height="@dimen/y80"
        android:layout_centerVertical="true"
        android:layout_marginLeft="@dimen/x12"
        android:src="@drawable/cover" />

    <android.support.v7.widget.AppCompatImageView
        android:id="@+id/local_song_setting"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentRight="true"
        android:layout_centerVertical="true"
        android:layout_marginRight="@dimen/x12"
        android:background="?attr/selectableItemBackgroundBorderless"
        android:padding="4dp"
        android:src="@drawable/ic_more_vert" />

    <LinearLayout
        android:id="@+id/linearLayout"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_toLeftOf="@+id/local_song_setting"
        android:layout_toRightOf="@+id/local_song_cover"
        android:layout_marginLeft="@dimen/x12"
        android:gravity="center_vertical"
        android:orientation="vertical">

        <TextView
            android:id="@+id/local_song_title"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:ellipsize="end"
            android:lines="1"
            android:textColor="@color/black_normal"
            android:textSize="14sp"
            tools:text="STYX HELIX" />

        <TextView
            android:id="@+id/local_song_detail"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="@dimen/x8"
            android:ellipsize="end"
            android:lines="1"
            android:textColor="@color/black_alpha"
            android:textSize="12sp"
            tools:text="MYTH & ROID" />

    </LinearLayout>

    <!--<com.bilibili.magicasakura.widgets.TintImageView-->
        <!--android:id="@+id/play_state"-->
        <!--android:layout_width="wrap_content"-->
        <!--android:layout_height="match_parent"-->
        <!--android:src="@drawable/song_play_icon"-->
        <!--android:visibility="gone"-->
        <!--android:layout_marginRight="@dimen/x8"-->
        <!--android:layout_centerVertical="true"-->
        <!--android:layout_above="@+id/view"-->
        <!--android:layout_toRightOf="@+id/linearLayout"-->
        <!--android:layout_toEndOf="@+id/linearLayout"-->
        <!--/>-->

    <View
        android:id="@+id/view"
        android:layout_width="match_parent"
        android:layout_height="1dp"
        android:layout_alignParentBottom="true"
        android:background="@android:drawable/divider_horizontal_bright" />

</RelativeLayout>


text:
package org.jzy3d.plot3d.primitives.axes;

import javax.media.opengl.GL2;
import javax.media.opengl.glu.GLU;

import org.jzy3d.maths.BoundingBox3d;
import org.jzy3d.maths.Coord3d;
import org.jzy3d.plot3d.primitives.axes.layout.IAxeLayout;
import org.jzy3d.plot3d.rendering.view.Camera;

/**Specify services that a concrete Axe must provide.*/
public interface IAxe {
	public void dispose();

	public void setAxe(BoundingBox3d box);
	public void draw(GL2 gl, GLU glu, Camera camera);

	public void setScale(Coord3d scale);
	public BoundingBox3d getBoxBounds();
	public Coord3d getCenter();

	public IAxeLayout getLayout();
}


text:
@interface AlarmInfoViewController : BaseViewController <UITableViewDataSource, UITableViewDelegate>
{
    CustomObjectModbus *_obj_modbus;
    NSInteger          _int_device_position;
}

@property (nonatomic, retain) CustomObjectModbus *obj_modbus;
@property (nonatomic, assign) NSInteger           int_device_position;

- (id)initWithModbusObject:(CustomObjectModbus *)obj;

@end


text:
class AddColumnApprovedToQuestion < ActiveRecord::Migration
  def change
    add_column :questions, :approved, :boolean, default: false
  end
end


text:
package models.squares;

import gui.Color;
import models.Player;
import models.Rules;
import models.cards.TownCard;

/**
 * @author Alper Önder, Ani Kristo
 *         Town Square class is the class for manage the towns in the game.  It holds color of the town,
 *         card of the town which has diffrent properties for each town.
 *         Building house and hotel can be done in this class.
 */
public class TownSquare extends Square implements PropertySquare {

    // ATTRIBUTES
    private final Color color;
    private final TownCard theTownCard;
    private int nrOfHouses;
    private boolean hotel;
    private PropertyGroup<TownSquare> group;

    // CONSTRUCTOR
    public TownSquare(int position, TownCard theTownCard) {
        super(position, theTownCard.getName(), SquareType.TOWN);
        this.color = theTownCard.getColor();
        this.nrOfHouses = 0;
        this.hotel = false;
        this.theTownCard = theTownCard;
    }

    // METHODS
    public Color getColor() {
        return color;
    }

    public int getBuildingCount() {
        return hotel ? 1 : nrOfHouses;
    }

    public boolean hasHotel() {
        return hotel;
    }

    public int getRentPrice() {
        if (theTownCard.getOwner() == null)
            return 0;
        else if (group.ownsAllProperties(theTownCard.getOwner())
                && nrOfHouses == 0
                && !hotel) {
            // Twice the rent price
            return theTownCard.getRentPrice(0) * 2;

        } else if (hotel)
            return theTownCard.getHotelRentPrice();
        else
            return theTownCard.getRentPrice(nrOfHouses);
    }

    @Override
    public TownCard getCard() {
        return theTownCard;
    }

    @Override
    public void removeOwner() {
        theTownCard.removeOwner();
        group.removeOwner(this);
    }

    @Override
    public boolean hasOwner() {
        return theTownCard.getOwner() != null;
    }

    @Override
    public boolean isOwner(Player p) {
        return theTownCard.getOwner() == p;
    }

    @Override
    public PropertyGroup<TownSquare> getGroup() {
        return group;
    }

    @Override
    public void setGroup(PropertyGroup propertyGroup) {
        this.group = propertyGroup;
    }

    public void removeBuildings() {
        nrOfHouses = 0;
        hotel = false;
        setChanged();
        notifyObservers();
    }

    /**
     * @return true if it build a hotel, false otherwise
     * @throws CannotBuildException POST: self.nrOfHouses == selfPRE:.nrOfHouses+1 || self.nrOfHouses == selfPRE:.nrOfHouses+1
     */
    public boolean build() throws CannotBuildException {
        if (nrOfHouses < Rules.MAX_HOUSE_COUNT && !hotel) {
            nrOfHouses++;
            setChanged();
            notifyObservers();
            return false;
        } else if (nrOfHouses == Rules.MAX_HOUSE_COUNT && !hotel) {
            nrOfHouses = 0;
            hotel = true;
            setChanged();
            notifyObservers();
            return true;
        } else
            throw new CannotBuildException();
    }

    public boolean isFull() {
        return hotel && nrOfHouses == 0;
    }

    public boolean hasMonopoly(Player currentPlayer) {
        return group.ownsAllProperties(currentPlayer);
    }

    @Override
    public Player getOwner() {
        return theTownCard.getOwner();
    }

    @Override
    public void setOwner(Player currentPlayer) {
        theTownCard.setOwner(currentPlayer);
        group.setOwner(this, currentPlayer);
    }

    public static class CannotBuildException extends Exception {
        @Override
        public String getMessage() {
            return super.getClass().getName() + ", " + super.getMessage() + "Cannot build any house or hotel more!";
        }
    }

}


text:
package skywalkingexporter

import (
	"context"
	"errors"
	"io"
	"net"
	"sync"
	"testing"

	"github.com/stretchr/testify/assert"
	"github.com/stretchr/testify/require"
	"go.opentelemetry.io/collector/component"
	"go.opentelemetry.io/collector/component/componenttest"
	"go.opentelemetry.io/collector/config"
	"go.opentelemetry.io/collector/config/configgrpc"
	"go.opentelemetry.io/collector/config/configtls"
	"go.opentelemetry.io/collector/consumer"
	"go.opentelemetry.io/collector/exporter/exporterhelper"
	"google.golang.org/grpc"
	v3 "skywalking.apache.org/repo/goapi/collect/common/v3"
	metricpb "skywalking.apache.org/repo/goapi/collect/language/agent/v3"
	logpb "skywalking.apache.org/repo/goapi/collect/logging/v3"

	"github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal/testdata"
)

func TestSwExporter(t *testing.T) {
	server, addr, handler := initializeGRPCTestServer(t, grpc.MaxConcurrentStreams(10))
	tt := &Config{
		NumStreams:       10,
		ExporterSettings: config.NewExporterSettings(component.NewID(typeStr)),
		GRPCClientSettings: configgrpc.GRPCClientSettings{
			Endpoint: addr.String(),
			TLSSetting: configtls.TLSClientSetting{
				Insecure: true,
			},
		},
	}

	oce := newLogsExporter(context.Background(), tt, componenttest.NewNopTelemetrySettings())
	got, err := exporterhelper.NewLogsExporter(
		context.Background(),
		componenttest.NewNopExporterCreateSettings(),
		tt,
		oce.pushLogs,
		exporterhelper.WithCapabilities(consumer.Capabilities{MutatesData: false}),
		exporterhelper.WithRetry(tt.RetrySettings),
		exporterhelper.WithQueue(tt.QueueSettings),
		exporterhelper.WithTimeout(tt.TimeoutSettings),
		exporterhelper.WithStart(oce.start),
		exporterhelper.WithShutdown(oce.shutdown),
	)
	assert.NoError(t, err)
	assert.NotNil(t, got)

	t.Cleanup(func() {
		require.NoError(t, got.Shutdown(context.Background()))
	})

	err = got.Start(context.Background(), componenttest.NewNopHost())

	assert.NoError(t, err)

	w1 := &sync.WaitGroup{}
	var i int64
	for i = 0; i < 200; i++ {
		w1.Add(1)
		go func() {
			defer w1.Done()
			l := testdata.GenerateLogsOneLogRecordNoResource()
			l.ResourceLogs().At(0).ScopeLogs().At(0).LogRecords().At(0).Body().SetInt(0)
			e := got.ConsumeLogs(context.Background(), l)
			assert.NoError(t, e)
		}()
	}
	w1.Wait()
	var logs []*logpb.LogData
	for i := 0; i < 200; i++ {
		logs = append(logs, <-handler.logChan)
	}
	assert.Equal(t, 200, len(logs))
	assert.Equal(t, 10, len(oce.logsClients))

	// when grpc server stops
	server.Stop()
	w2 := &sync.WaitGroup{}
	for i = 0; i < 200; i++ {
		w2.Add(1)
		go func() {
			defer w2.Done()
			l := testdata.GenerateLogsOneLogRecordNoResource()
			l.ResourceLogs().At(0).ScopeLogs().At(0).LogRecords().At(0).Body().SetInt(0)
			e := got.ConsumeLogs(context.Background(), l)
			if e != nil {
				return
			}
		}()
	}
	w2.Wait()
	assert.Equal(t, 10, len(oce.logsClients))

	server, addr, handler2 := initializeGRPCTestServerMetric(t, grpc.MaxConcurrentStreams(10))
	tt = &Config{
		NumStreams:       10,
		ExporterSettings: config.NewExporterSettings(component.NewID(typeStr)),
		GRPCClientSettings: configgrpc.GRPCClientSettings{
			Endpoint: addr.String(),
			TLSSetting: configtls.TLSClientSetting{
				Insecure: true,
			},
		},
	}

	oce = newMetricsExporter(context.Background(), tt, componenttest.NewNopTelemetrySettings())
	got2, err2 := exporterhelper.NewMetricsExporter(
		context.Background(),
		componenttest.NewNopExporterCreateSettings(),
		tt,
		oce.pushMetrics,
		exporterhelper.WithCapabilities(consumer.Capabilities{MutatesData: false}),
		exporterhelper.WithRetry(tt.RetrySettings),
		exporterhelper.WithQueue(tt.QueueSettings),
		exporterhelper.WithTimeout(tt.TimeoutSettings),
		exporterhelper.WithStart(oce.start),
		exporterhelper.WithShutdown(oce.shutdown),
	)
	assert.NoError(t, err2)
	assert.NotNil(t, got2)

	t.Cleanup(func() {
		require.NoError(t, got2.Shutdown(context.Background()))
	})

	err = got2.Start(context.Background(), componenttest.NewNopHost())

	assert.NoError(t, err)

	w1 = &sync.WaitGroup{}
	for i = 0; i < 200; i++ {
		w1.Add(1)
		go func() {
			defer w1.Done()
			l := testdata.GenerateMetricsOneMetric()
			e := got2.ConsumeMetrics(context.Background(), l)
			assert.NoError(t, e)
		}()
	}
	w1.Wait()
	var metrics []*metricpb.MeterDataCollection
	for i := 0; i < 200; i++ {
		metrics = append(metrics, <-handler2.metricChan)
	}
	assert.Equal(t, 200, len(metrics))
	assert.Equal(t, 10, len(oce.metricsClients))

	// when grpc server stops
	server.Stop()
	w3 := &sync.WaitGroup{}
	for i = 0; i < 200; i++ {
		w3.Add(1)
		go func() {
			defer w3.Done()
			l := testdata.GenerateMetricsOneMetric()
			e := got2.ConsumeMetrics(context.Background(), l)
			if e != nil {
				return
			}
		}()
	}
	w3.Wait()
	assert.Equal(t, 10, len(oce.metricsClients))
}

func initializeGRPCTestServer(t *testing.T, opts ...grpc.ServerOption) (*grpc.Server, net.Addr, *mockLogHandler) {
	server := grpc.NewServer(opts...)
	lis, err := net.Listen("tcp", "localhost:0")
	require.NoError(t, err)
	m := &mockLogHandler{
		logChan: make(chan *logpb.LogData, 200),
	}
	logpb.RegisterLogReportServiceServer(
		server,
		m,
	)
	go func() {
		require.NoError(t, server.Serve(lis))
	}()
	return server, lis.Addr(), m
}

func initializeGRPCTestServerMetric(t *testing.T, opts ...grpc.ServerOption) (*grpc.Server, net.Addr, *mockMetricHandler) {
	server := grpc.NewServer(opts...)
	lis, err := net.Listen("tcp", "localhost:0")
	require.NoError(t, err)
	m := &mockMetricHandler{
		metricChan: make(chan *metricpb.MeterDataCollection, 200),
	}
	metricpb.RegisterMeterReportServiceServer(
		server,
		m,
	)
	go func() {
		require.NoError(t, server.Serve(lis))
	}()
	return server, lis.Addr(), m
}

type mockLogHandler struct {
	logChan chan *logpb.LogData
	logpb.UnimplementedLogReportServiceServer
}

func (h *mockLogHandler) Collect(stream logpb.LogReportService_CollectServer) error {
	for {
		r, err := stream.Recv()
		if errors.Is(err, io.EOF) {
			return stream.SendAndClose(&v3.Commands{})
		}
		if err == nil {
			h.logChan <- r
		}
	}
}

type mockMetricHandler struct {
	metricChan chan *metricpb.MeterDataCollection
	metricpb.UnimplementedMeterReportServiceServer
}

func (h *mockMetricHandler) CollectBatch(stream metricpb.MeterReportService_CollectBatchServer) error {
	for {
		r, err := stream.Recv()
		if errors.Is(err, io.EOF) {
			return stream.SendAndClose(&v3.Commands{})
		}
		if err == nil {
			h.metricChan <- r
		}
	}
}


text:
package com.cjm721.overloaded.storage.energy;

import com.cjm721.overloaded.storage.stacks.bigint.BigIntEnergyStack;
import com.cjm721.overloaded.storage.stacks.intint.LongEnergyStack;
import com.cjm721.overloaded.util.IDataUpdate;
import net.minecraft.nbt.CompoundNBT;
import net.minecraftforge.common.util.INBTSerializable;

import javax.annotation.Nonnull;
import java.math.BigInteger;

public class BigIntEnergyStorage implements IHyperHandlerEnergy, INBTSerializable<CompoundNBT> {

  @Nonnull private final IDataUpdate dataUpdate;
  @Nonnull private BigIntEnergyStack energy;

  public BigIntEnergyStorage(@Nonnull IDataUpdate dataUpdate) {
    energy = new BigIntEnergyStack(BigInteger.ZERO);
    this.dataUpdate = dataUpdate;
  }

  @Nonnull
  public BigIntEnergyStack bigStatus() {
    return energy;
  }

  @Nonnull
  @Override
  public LongEnergyStack status() {
    return new LongEnergyStack(
        energy.amount.min(BigInteger.valueOf(Long.MAX_VALUE)).longValueExact());
  }

  @Nonnull
  @Override
  public LongEnergyStack take(@Nonnull LongEnergyStack stack, boolean doAction) {
    BigInteger takenAmount = energy.amount.min(BigInteger.valueOf(stack.amount));
    LongEnergyStack result = new LongEnergyStack(takenAmount.longValueExact());

    if (doAction) {
      energy.amount = energy.amount.subtract(takenAmount);
      dataUpdate.dataUpdated();
    }

    return result;
  }

  @Nonnull
  @Override
  public LongEnergyStack give(@Nonnull LongEnergyStack stack, boolean doAction) {
    if (doAction) {
      energy.amount = energy.amount.add(BigInteger.valueOf(stack.amount));
      dataUpdate.dataUpdated();
    }

    return new LongEnergyStack(0);
  }

  @Override
  public CompoundNBT serializeNBT() {
    CompoundNBT compound = new CompoundNBT();
    compound.putByteArray("Count", energy.amount.toByteArray());
    return compound;
  }

  @Override
  public void deserializeNBT(CompoundNBT nbt) {
    energy =
        new BigIntEnergyStack(
            nbt.contains("Count") ? new BigInteger(nbt.getByteArray("Count")) : BigInteger.ZERO);
  }
}


text:
/*	$NetBSD: grf_clreg.h,v 1.6 1997/03/21 09:40:58 veego Exp $	*/

/*
 * Copyright (c) 1995 Ezra Story
 * Copyright (c) 1995 Kari Mettinen
 * Copyright (c) 1994 Markus Wild
 * Copyright (c) 1994 Lutz Vieweg
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 * 3. All advertising materials mentioning features or use of this software
 *    must display the following acknowledgement:
 *      This product includes software developed by Lutz Vieweg.
 * 4. The name of the author may not be used to endorse or promote products
 *    derived from this software without specific prior written permission
 *
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

#ifndef _GRF_CLREG_H
#define _GRF_CLREG_H

/*
 * Written & Copyright by Kari Mettinen, Ezra Story.
 *
 * This is derived from retina driver source
 */

/* Extension to grfvideo_mode to support text modes.
 * This can be passed to both text & gfx functions
 * without worry.  If gv.depth == 4, then the extended
 * fields for a text mode are present.
 */
struct grfcltext_mode {
    	struct grfvideo_mode gv;
    	unsigned short	fx; 	    /* font x dimension */
    	unsigned short	fy; 	    /* font y dimension */
    	unsigned short  cols;       /* screen dimensions */
    	unsigned short	rows;
    	void	    	*fdata;     /* font data */
    	unsigned short	fdstart;
    	unsigned short	fdend;
};

/* 5426 boards types, stored in  cltype in grf_cl.c .
 * used to decide how to handle SR7 and Pass-through
 */

#define PICASSO		2167
#define SPECTRUM 	2193
#define PICCOLO		2195

/* read VGA register */
#define vgar(ba, reg) (*(((volatile unsigned char *)ba)+reg))

/* write VGA register */
#define vgaw(ba, reg, val) \
	*(((volatile unsigned char *)ba)+reg) = ((val) & 0xff)

/*
 * defines for the used register addresses (mw)
 *
 * NOTE: there are some registers that have different addresses when
 *       in mono or color mode. We only support color mode, and thus
 *       some addresses won't work in mono-mode!
 *
 * General and VGA-registers taken from retina driver. Fixed a few
 * bugs in it. (SR and GR read address is Port + 1, NOT Port)
 *
 */

/* General Registers: */
#define GREG_STATUS0_R		0x03C2
#define GREG_STATUS1_R		0x03DA
#define GREG_MISC_OUTPUT_R	0x03CC
#define GREG_MISC_OUTPUT_W	0x03C2
#define GREG_FEATURE_CONTROL_R	0x03CA
#define GREG_FEATURE_CONTROL_W	0x03DA
#define GREG_POS		0x0102

/* Attribute Controller: */
#define ACT_ADDRESS		0x03C0
#define ACT_ADDRESS_R		0x03C1
#define ACT_ADDRESS_W		0x03C0
#define ACT_ADDRESS_RESET	0x03DA
#define ACT_ID_PALETTE0		0x00
#define ACT_ID_PALETTE1		0x01
#define ACT_ID_PALETTE2		0x02
#define ACT_ID_PALETTE3		0x03
#define ACT_ID_PALETTE4		0x04
#define ACT_ID_PALETTE5		0x05
#define ACT_ID_PALETTE6		0x06
#define ACT_ID_PALETTE7		0x07
#define ACT_ID_PALETTE8		0x08
#define ACT_ID_PALETTE9		0x09
#define ACT_ID_PALETTE10	0x0A
#define ACT_ID_PALETTE11	0x0B
#define ACT_ID_PALETTE12	0x0C
#define ACT_ID_PALETTE13	0x0D
#define ACT_ID_PALETTE14	0x0E
#define ACT_ID_PALETTE15	0x0F
#define ACT_ID_ATTR_MODE_CNTL	0x10
#define ACT_ID_OVERSCAN_COLOR	0x11
#define ACT_ID_COLOR_PLANE_ENA	0x12
#define ACT_ID_HOR_PEL_PANNING	0x13
#define ACT_ID_COLOR_SELECT	0x14

/* Graphics Controller: */
#define GCT_ADDRESS		0x03CE
#define GCT_ADDRESS_R		0x03CF
#define GCT_ADDRESS_W		0x03CF
#define GCT_ID_SET_RESET	0x00
#define GCT_WR5_BG_EXT		0x00
#define GCT_ID_ENABLE_SET_RESET	0x01
#define GCT_ID_WR45_FG_EXT	0x01
#define GCT_ID_COLOR_COMPARE	0x02
#define GCT_ID_DATA_ROTATE	0x03
#define GCT_ID_READ_MAP_SELECT	0x04
#define GCT_ID_GRAPHICS_MODE	0x05
#define GCT_ID_MISC		0x06
#define GCT_ID_COLOR_XCARE	0x07
#define GCT_ID_BITMASK		0x08
#define GCT_ID_OFFSET_0		0x09
#define GCT_ID_OFFSET_1		0x0A
#define GCT_ID_MODE_EXT	0x0B
#define GCT_ID_COLOR_KEY	0x0C
#define GCT_ID_COLOR_KEY_MASK	0x0D
#define GCT_ID_MISC_CNTL	0x0E
#define GCT_ID_16BIT_BG_HIGH	0x10
#define GCT_ID_16BIT_FG_HIGH	0x11
#define GCT_ID_BLT_WIDTH_LOW	0x20
#define GCT_ID_BLT_WIDTH_HIGH	0x21
#define GCT_ID_BLT_HEIGHT_LOW	0x22
#define GCT_ID_BLT_HEIGHT_HIGH	0x23
#define GCT_ID_DST_PITCH_LOW	0x24
#define GCT_ID_DST_PITCH_HIGH	0x25
#define GCT_ID_SRC_PITCH_LOW	0x26
#define GCT_ID_SRC_PITCH_HIGH	0x27
#define GCT_ID_DST_START_LOW	0x28
#define GCT_ID_DST_START_MID	0x29
#define GCT_ID_DST_START_HIGH	0x2A
#define GCT_ID_SRC_START_LOW	0x2C
#define GCT_ID_SRC_START_MID	0x2D
#define GCT_ID_SRC_START_HIGH	0x2E
#define GCT_ID_BLT_MODE		0x30
#define GCT_ID_BLT_STAT_START	0x31
#define GCT_ID_BLT_ROP		0x32
#define GCT_ID_RESERVED		0x33
#define GCT_ID_TRP_COL_LOW	0x34	/* transparent color */
#define GCT_ID_TRP_COL_HIGH	0x35
#define GCT_ID_TRP_MASK_LOW	0x38
#define GCT_ID_TRP_MASK_HIGH	0x39

/* Sequencer: */
#define SEQ_ADDRESS		0x03C4
#define SEQ_ADDRESS_R		0x03C5
#define SEQ_ADDRESS_W		0x03C5
#define SEQ_ID_RESET		0x00
#define SEQ_ID_CLOCKING_MODE	0x01
#define SEQ_ID_MAP_MASK		0x02
#define SEQ_ID_CHAR_MAP_SELECT	0x03

#define TEXT_PLANE_CHAR	    0x01
#define TEXT_PLANE_ATTR	    0x02
#define TEXT_PLANE_FONT	    0x04

#define SEQ_ID_MEMORY_MODE	0x04
#define SEQ_ID_UNLOCK_EXT	0x06	/* down from here, all seq registers are Cirrus extensions */
#define SEQ_ID_EXT_SEQ_MODE     0x07
#define SEQ_ID_EEPROM_CNTL	0x08
#define SEQ_ID_SCRATCH_0        0x09
#define SEQ_ID_SCRATCH_1	0x0A
#define SEQ_ID_VCLK_0_NUM	0x0B
#define SEQ_ID_VCLK_1_NUM	0x0C
#define SEQ_ID_VCLK_2_NUM	0x0D
#define SEQ_ID_VCLK_3_NUM	0x0E
#define SEQ_ID_DRAM_CNTL	0x0F
#define SEQ_ID_CURSOR_X		0x10	/* Cursor position can't be set with WSeq
*/
#define SEQ_ID_CURSOR_Y		0x11
#define SEQ_ID_CURSOR_ATTR	0x12
#define SEQ_ID_CURSOR_STORE	0x13
#define SEQ_ID_SCRATCH_2	0x14
#define SEQ_ID_SCRATCH_3	0x15
#define SEQ_ID_PERF_TUNE	0x16
#define SEQ_ID_CONF_RBACK	0x17
#define SEQ_ID_SIG_CNTL		0x18
#define SEQ_ID_SIG_RES_LOW	0x19
#define SEQ_ID_SIG_RES_HIGH	0x1A
#define SEQ_ID_VCLK_0_DENOM	0x1B
#define SEQ_ID_VCLK_1_DENOM	0x1C
#define SEQ_ID_VCLK_2_DENOM	0x1D
#define SEQ_ID_VCLK_3_DENOM	0x1E
#define SEQ_ID_MCLK_SELECT	0x1F

/* CRT Controller: */
#define CRT_ADDRESS		0x03D4
#define CRT_ADDRESS_R		0x03D5
#define CRT_ADDRESS_W		0x03D5
#define CRT_ID_HOR_TOTAL	0x00
#define CRT_ID_HOR_DISP_ENA_END	0x01
#define CRT_ID_START_HOR_BLANK	0x02
#define CRT_ID_END_HOR_BLANK	0x03
#define CRT_ID_START_HOR_RETR	0x04
#define CRT_ID_END_HOR_RETR	0x05
#define CRT_ID_VER_TOTAL	0x06
#define CRT_ID_OVERFLOW		0x07
#define CRT_ID_PRESET_ROW_SCAN	0x08
#define CRT_ID_CHAR_HEIGHT	0x09	/* was MAX_SCANLINES on retina, weird, eh? */
#define CRT_ID_CURSOR_START	0x0A
#define CRT_ID_CURSOR_END	0x0B
#define CRT_ID_START_ADDR_HIGH	0x0C
#define CRT_ID_START_ADDR_LOW	0x0D
#define CRT_ID_CURSOR_LOC_HIGH	0x0E
#define CRT_ID_CURSOR_LOC_LOW	0x0F
#define CRT_ID_START_VER_RETR	0x10
#define CRT_ID_END_VER_RETR	0x11
#define CRT_ID_VER_DISP_ENA_END	0x12
#define CRT_ID_OFFSET		0x13
#define CRT_ID_UNDERLINE_LOC	0x14
#define CRT_ID_START_VER_BLANK	0x15
#define CRT_ID_END_VER_BLANK	0x16
#define CRT_ID_MODE_CONTROL	0x17
#define CRT_ID_LINE_COMPARE	0x18
#define CRT_ID_LACE_END         0x19
#define CRT_ID_LACE_CNTL        0x1A
#define CRT_ID_EXT_DISP_CNTL    0x1B
#define CRT_ID_SYNC_ADJ_GENLOCK 0x1C
#define CRT_ID_OVERLAY_EXT_CTRL_REG    0x1D

#define CRT_ID_GD_LATCH_RBACK	0x22

#define CRT_ID_ACT_TOGGLE_RBACK	0x24
#define CRT_ID_ACT_INDEX_RBACK 	0x26

/* Pass-through */
#define PASS_ADDRESS		0x8000
#define PASS_ADDRESS_W		0x8000
/* Special Picasso Address */
#define PASS_ADDRESS_WP		0x9000

/* Video DAC */
#define VDAC_ADDRESS	0x03c8
#define VDAC_ADDRESS_W	0x03c8
#define VDAC_ADDRESS_R	(((cltype==PICASSO)&&(cl_64bit==0))?0x03c7+0xfff:0x3c7)
#define VDAC_STATE	0x03c7
#define VDAC_DATA	(((cltype==PICASSO)&&(cl_64bit==0))?0x03c9+0xfff:0x3c9)
#define VDAC_MASK       0x03c6
#define HDR	        0x03c6	/* Hidden DAC register, 4 reads to access */

#define WGfx(ba, idx, val) \
	do { \
		vgaw(ba, GCT_ADDRESS, idx); \
		vgaw(ba, GCT_ADDRESS_W , val); \
	} while (0)

#define WSeq(ba, idx, val) \
	do { \
		vgaw(ba, SEQ_ADDRESS, idx); \
		vgaw(ba, SEQ_ADDRESS_W , val); \
	} while (0) \

/*		asm volatile ("nop"); \ */

#define WCrt(ba, idx, val) \
	do { \
		vgaw(ba, CRT_ADDRESS, idx); \
		vgaw(ba, CRT_ADDRESS_W , val); \
	} while (0)

#define WAttr(ba, idx, val) \
	do {	\
		vgar(ba, ACT_ADDRESS_RESET); \
		vgaw(ba, ACT_ADDRESS_W, idx); \
		vgaw(ba, ACT_ADDRESS_W, val); \
	} while (0)

#define SetTextPlane(ba, m) \
	do { \
		WGfx(ba, GCT_ID_READ_MAP_SELECT, m & 3 ); \
		WSeq(ba, SEQ_ID_MAP_MASK, (1 << (m & 3))); \
	} while (0)

int cl_mode __P((register struct grf_softc *gp, u_long cmd, void *arg,
			u_long a2, int a3));
int cl_load_mon __P((struct grf_softc *gp, struct grfcltext_mode *gv));
int grfcl_cnprobe __P((void));
void grfcl_iteinit __P((struct grf_softc *gp));

#endif /* _GRF_RHREG_H */


text:
"""

 Copyright 2014 Sotera Defense Solutions, Inc.

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

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

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

"""

import threading
from Queue import Queue
import json

import tangelo

import datawake.util.dataconnector.factory as factory
from datawake.util.dataconnector.domain_upload_connector import ConnectorUtil
from datawake.util.db import datawake_mysql as db

completed_threads = Queue()

def get_domains(*args):
    domains = db.get_domains()
    return json.dumps(map(lambda x: dict(name=x[0], description=x[1]), domains))

def get_preview(domain):
    domain_content_connector = factory.get_entity_data_connector()
    try:
        data = domain_content_connector.get_domain_items(domain, 10)
        return json.dumps(data)
    finally:
        domain_content_connector.close()

def valid_domain_line(line):
    return '\0' not in line

def finished_database_upload(*args):
    if not completed_threads.empty():
        return json.dumps(completed_threads.get())
    return json.dumps(dict(complete=False))

def upload_file(file_upload, name, description):
    tangelo.log("Loading new domain: "+name)
    domain_content_connector = factory.get_entity_data_connector()
    try:
        if not db.domain_exists(name):
            if file_upload is not None:
                domain_file_lines = file_upload.file.readlines()
                domain_file_lines = map(lambda x: x.strip().replace('\0', ''), domain_file_lines)
                db.add_new_domain(name, description)
                rowkeys = []
                for line in domain_file_lines:
                    i = line.index(',')  # split on the first comma
                    type = line[:i]
                    value = line[i + 1:]
                    if type[0] == '"' and type[len(type) - 1] == '"': type = type[1:-1]
                    if value[0] == '"' and value[len(value) - 1] == '"': value = value[1:-1]
                    rowkeys.append("%s\0%s\0%s" % (name, type, value))
                result = domain_content_connector.add_new_domain_items(rowkeys)
                return json.dumps(dict(success=result))
            return json.dumps(dict(success=False))
        return json.dumps(dict(success=False))
    finally:
        domain_content_connector.close()

def upload_database_threaded(domain_name, connection_string, domain_description, table_name, attribute_column, value_column):
    domain_content_connector = factory.get_entity_data_connector()
    connector = ConnectorUtil.get_database_connector(connection_string, table_name, attribute_column, value_column)
    rows = connector.get_domain_items()
    success = domain_content_connector.add_new_domain_items(map(lambda items: "%s\0%s\0%s" % (domain_name, items[0], items[1]), rows))
    complete_dict = dict(domain=domain_name, description=domain_description, success=success, complete=True)
    completed_threads.put(complete_dict)

def upload_database(domain_name, domain_description):
    if not db.domain_exists(domain_name):
        db.add_new_domain(domain_name, domain_description)
        kwargs = dict(domain_name=domain_name, domain_description=domain_description)
        database_upload_thread = threading.Thread(target=upload_database_threaded, kwargs=kwargs)
        database_upload_thread.daemon = True
        database_upload_thread.start()
        return json.dumps(dict(success=True))
    return json.dumps(dict(success=False))

def delete_domain(domain_name):
    if db.domain_exists(domain_name):
        domain_content_connector = factory.get_entity_data_connector()
        db.remove_domain(domain_name)
        domain_content_connector.delete_domain_items(domain_name)
        return json.dumps(dict(success=True))
    return json.dumps(dict(success=False))

get_actions = {
    'domains': get_domains,
    'poll': finished_database_upload
}

post_actions = {
    'upload': upload_file,
    'preview': get_preview,
    'upload-database': upload_database,
    'delete': delete_domain
}

@tangelo.restful
def post(action, *args, **kwargs):
    def unknown(*args):
        return tangelo.HTTPStatusCode(400, "invalid service call")

    return post_actions.get(action, unknown)(**kwargs)

@tangelo.restful
def get(action, *args, **kwargs):
    def unknown(*args):
        return tangelo.HTTPStatusCode(400, "invalid service call")

    return get_actions.get(action, unknown)(*args)


text:
/* Source code for textbook:
 Flexible Reliable Software, by Henrik B. Christensen
 CRC Press 2010
 ***********************************
 Project developped in java by Henrik B. Christensen
 C++ port by Robert Benkoczi
 ***********************************
 */

/**Implementation for clock based weekend decision interface:
   Responsibilities:

	 1) Decide whether current time is weekend or not
*/

#ifndef __FIXEDDECISIONSTRATEGY_H
#define __FIXEDDECISIONSTRATEGY_H

#include "WeekendDecisionStrategy.h"

class FixedDecisionStrategy : public WeekendDecisionStrategyInterface {
private:
	bool weekend; // true if should return weekend
public:
	/// \return true if current day is on a weekend
	bool isWeekend() {
		return weekend;
	}

	/// constructor
	/// \param [in] theWeekend true if the object should always return
	/// weekend state, false if it should return weekday state
	FixedDecisionStrategy(bool theWeekend) {
		weekend = theWeekend;
	}
};

#endif


text:
/**
 * @overview Nodes in the visualization that map to simulation entities.
 */
/* jshint
 funcscope: true,
 newcap: true,
 nonew: true,
 shadow: false,
 unused: true,

 maxlen: 90,
 maxstatements: 200
 */
'use strict';

require('../utils');
var netsimConstants = require('./netsimConstants');
var NetSimVizNode = require('./NetSimVizNode');

var NodeType = netsimConstants.NodeType;

var netsimGlobals = require('./netsimGlobals');

/**
 * @param {NetSimNode} sourceNode
 * @constructor
 * @augments NetSimVizNode
 */
var NetSimVizSimulationNode = module.exports = function (sourceNode) {
  NetSimVizNode.call(this);

  /**
   * ID of the simulation node that this viz element represents.
   * @type {number}
   */
  this.correspondingNodeID_ = sourceNode.entityID;

  /**
   * If we end up representing a router, we may need to hold the auto-dns address
   * to pass to a fake auto-dns node.
   * @type {string}
   */
  this.autoDnsAddress = undefined;

  this.configureFrom(sourceNode);
  this.render();
};
NetSimVizSimulationNode.inherits(NetSimVizNode);

/**
 *
 * @param {NetSimNode} sourceNode
 */
NetSimVizSimulationNode.prototype.configureFrom = function (sourceNode) {
  this.correspondingNodeID_ = sourceNode.entityID;

  var levelConfig = netsimGlobals.getLevelConfig();
  if (levelConfig.showHostnameInGraph) {
    this.setName(sourceNode.getHostname());
  } else {
    this.setName(sourceNode.getShortDisplayName());
  }

  if (sourceNode.getNodeType() === NodeType.ROUTER) {
    this.isRouter = true;
    this.getRoot().addClass('router-node');
    this.autoDnsAddress = sourceNode.getAutoDnsAddress();
    if (levelConfig.broadcastMode) {
      this.getRoot().css('display', 'none');
    }
  }
};

/**
 * ID of the simulation entity that maps to this one.
 * @returns {number}
 */
NetSimVizSimulationNode.prototype.getCorrespondingEntityID = function () {
  return this.correspondingNodeID_;
};

/**
 * Killing a visualization node removes its ID so that it won't conflict with
 * another node of matching ID being added, and begins its exit animation.
 * @override
 */
NetSimVizSimulationNode.prototype.kill = function () {
  NetSimVizSimulationNode.superPrototype.kill.call(this);
  this.correspondingNodeID_ = undefined;
};


text:
package com.mxixm.fastboot.weixin.module.message;

import com.mxixm.fastboot.weixin.module.message.parameter.WxMessageParameter;

/**
 * FastBootWeixin WxTemplateMessageProcessor
 *
 * @author Guangshan
 * @date 2017-10-13 11:17:00
 * @since 0.2.1
 */
public class WxTemplateMessageProcessor implements WxMessageProcessor<WxTemplateMessage> {

    @Override
    public WxTemplateMessage process(WxMessageParameter wxMessageParameter, WxTemplateMessage wxMessage) {
        // 这个重复逻辑可以使用processInternal处理
        if (wxMessage == null) {
            return null;
        }
        if (wxMessage.getToUser() == null) {
            wxMessage.setToUser(wxMessageParameter.getToUser());
        }
        return wxMessage;
    }

}


text:
package com.netflix.spectator.api.patterns;

import com.netflix.spectator.api.BasicTag;
import com.netflix.spectator.api.Tag;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;

/**
 * Base class used for builders that need to allow for additional tagging to be
 * added onto a base id. This is typically used in conjunction with {@link IdBuilder}.
 */
@SuppressWarnings("unchecked")
public class TagsBuilder<T extends TagsBuilder<T>> {

  /** Create a new instance. */
  protected TagsBuilder() {
    // This class is only intended to be created by a sub-class. Since there are no
    // abstract methods at this time it is documented via the protected constructor
    // rather than making the class abstract.
  }

  /** Set of extra tags that the sub-class should add in to the id. */
  protected final List<Tag> extraTags = new ArrayList<>();

  /** Add an additional tag value. */
  public T withTag(String k, String v) {
    extraTags.add(new BasicTag(k, v));
    return (T) this;
  }

  /** Add an additional tag value. */
  public T withTag(String k, Boolean v) {
    return withTag(k, Boolean.toString(v));
  }

  /** Add an additional tag value based on the name of the enum. */
  public <E extends Enum<E>> T withTag(String k, Enum<E> v) {
    return withTag(k, v.name());
  }

  /** Add an additional tag value. */
  public T withTag(Tag t) {
    extraTags.add(t);
    return (T) this;
  }

  /** Add additional tag values. */
  public T withTags(String... tags) {
    for (int i = 0; i < tags.length; i += 2) {
      extraTags.add(new BasicTag(tags[i], tags[i + 1]));
    }
    return (T) this;
  }

  /** Add additional tag values. */
  public T withTags(Tag... tags) {
    Collections.addAll(extraTags, tags);
    return (T) this;
  }

  /** Add additional tag values. */
  public T withTags(Iterable<Tag> tags) {
    for (Tag t : tags) {
      extraTags.add(t);
    }
    return (T) this;
  }

  /** Add additional tag values. */
  public T withTags(Map<String, String> tags) {
    for (Map.Entry<String, String> entry : tags.entrySet()) {
      extraTags.add(new BasicTag(entry.getKey(), entry.getValue()));
    }
    return (T) this;
  }
}


text:
package com.silentgo.utils.reflect;

import java.util.Map;

/**
 * Project : SilentGo
 * Package : com.silentgo.utils.reflect
 *
 * @author teddyzhu
 *

 *         Created by teddyzhu on 2017/1/5.
 */
public class ParameterAnnotationMap extends AnnotationMap {

    private String[] parameterNames;

    private Map<String, SGParameter> parameterMap;

    public Map<String, SGParameter> getParameterMap() {
        return parameterMap;
    }

    public void setParameterMap(Map<String, SGParameter> parameterMap) {
        this.parameterMap = parameterMap;
    }

    public String[] getParameterNames() {
        return parameterNames;
    }

    public void setParameterNames(String[] parameterNames) {
        this.parameterNames = parameterNames;
    }
}


text:
import sys
import pypacksrc
srcdirectory=pypacksrc.srcpydir+"/pyaccords/pygen"
sys.path.append(srcdirectory)
from intercloudGWInterface import *

def create(categStr):
	l=categStr.split(",")
	categInterf = CintercloudGW(l[0],l[1],l[2],l[3],l[4] )
	resCateg = intercloudGW_create(categInterf)
	categStrR = [ str(resCateg.name),str(resCateg.node),str(resCateg.account),str(resCateg.price),str(resCateg.state) ]
	categStrNew = ",".join(categStrR)
	return categStrNew

def retrieve(categStr):
	l=categStr.split(",")
	categInterf = CintercloudGW(l[0],l[1],l[2],l[3],l[4] )
	resCateg = intercloudGW_retrieve(categInterf)
	categStrR = [ str(resCateg.name),str(resCateg.node),str(resCateg.account),str(resCateg.price),str(resCateg.state) ]
	categStrNew = ",".join(categStrR)
	return categStrNew

def update(categStr):
	l=categStr.split(",")
	categInterf = CintercloudGW(l[0],l[1],l[2],l[3],l[4] )
	resCateg = intercloudGW_update(categInterf)
	categStrR = [ str(resCateg.name),str(resCateg.node),str(resCateg.account),str(resCateg.price),str(resCateg.state) ]
	categStrNew = ",".join(categStrR)
	return categStrNew

def delete(categStr):
	l=categStr.split(",")
	categInterf = CintercloudGW(l[0],l[1],l[2],l[3],l[4] )
	resCateg = intercloudGW_delete(categInterf)
	categStrR = [ str(resCateg.name),str(resCateg.node),str(resCateg.account),str(resCateg.price),str(resCateg.state) ]
	categStrNew = ",".join(categStrR)
	return categStrNew


text:
from __future__ import absolute_import, division, print_function, with_statement
from __future__ import unicode_literals

from deepstreampy import jsonpath
import unittest

class TestGet(unittest.TestCase):

    def setUp(self):
        self.test_data = {'firstname': 'John',
                          'lastname': 'Smith',
                          'address': {
                                      'street': 'currentStreet'
                                  },
                          'pastAddresses': [
                                    {'street': 'firststreet', 'postCode': 1001},
                                    {'street': 'secondstreet', 'postCode': 2002}
                                  ],
                          1234: 'integer index'}

    def test_simple_path(self):
        value = jsonpath.get(self.test_data, 'firstname', False)
        self.assertEquals(value, 'John')

        value = jsonpath.get(self.test_data, 'lastname', False)
        self.assertEquals(value, 'Smith')

    def test_nested_path(self):
        value = jsonpath.get(self.test_data, 'address.street', False)
        self.assertEquals(value, 'currentStreet')

    def test_other_array_entries(self):
        value = jsonpath.get(self.test_data, 'pastAddresses[0]', False)
        self.assertEquals(value,
                          {'street': 'firststreet', 'postCode': 1001})

    def test_array_entries(self):
        value = jsonpath.get(self.test_data, 'pastAddresses[1]', False)
        self.assertEquals(value,
                          {'street': 'secondstreet', 'postCode': 2002})

    def test_values_from_array(self):
        value = jsonpath.get(self.test_data, 'pastAddresses[0].postCode', False)
        self.assertEquals(value, 1001)

    def test_handle_whitespace(self):
        value = jsonpath.get(self.test_data, 'pastAddresses[  1  ].postCode',
                             False)
        self.assertEquals(value, 2002)

    def test_handle_integers(self):
        value = jsonpath.get(self.test_data, 1234, False)
        self.assertEquals(value, 'integer index')

    def test_nonexisting_keys(self):
        value = jsonpath.get(self.test_data, 'does not exist', False)
        self.assertEqual(value, None)

    def test_nested_nonexisting(self):
        value = jsonpath.get(self.test_data, 'address.number', False)
        self.assertEqual(value, None)

    def test_nonexisting_array_index(self):
        value = jsonpath.get(self.test_data, 'pastAddresses[3]', False)
        self.assertEqual(value, None)

    def test_negative_array_index(self):
        value = jsonpath.get(self.test_data, 'pastAddresses[-1]', False)
        self.assertEquals(value,
                          {'street': 'secondstreet', 'postCode': 2002})

    def test_detect_changes(self):
        value = jsonpath.get(self.test_data, 'firstname', False)
        self.assertEquals(value, 'John')
        self.test_data['firstname'] = 'Adam'
        value = jsonpath.get(self.test_data, 'firstname', False)
        self.assertEquals(value, 'Adam')

    def test_detect_changes_to_arrays(self):
        value = jsonpath.get(self.test_data, 'pastAddresses[1].street', False)
        self.assertEquals(value, 'secondstreet')
        self.test_data['pastAddresses'].pop()
        value = jsonpath.get(self.test_data, 'pastAddresses[1].street', False)
        self.assertEquals(value, None)

class TestSet(unittest.TestCase):

    def setUp(self):
        self.test_data = {}

    def test_simple_value(self):
        jsonpath.set(self.test_data, 'firstname', 'John', False)
        self.assertEqual(self.test_data, {'firstname': 'John'})

    def test_nested_values(self):
        jsonpath.set(self.test_data, 'address.street', 'someStreet', False)
        self.assertEqual(self.test_data, {
            'address': {
                'street': 'someStreet'
            }
        })

    def test_arrays(self):
        jsonpath.set(self.test_data, 'pastAddresses[1].street', 'someStreet',
                     False)
        self.assertEquals(self.test_data, {
            'pastAddresses': [None, {'street': 'someStreet'}]
        })

    def test_extend_objects(self):
        self.test_data = {'firstname': 'John'}
        jsonpath.set(self.test_data, 'lastname', 'Smith', False)
        self.assertEqual(self.test_data, {'firstname': 'John',
                                          'lastname': 'Smith'})

    def test_extend_lists(self):
        self.test_data = {'firstname': 'John',
                          'animals': ['Bear', 'Cow', 'Ostrich']}
        jsonpath.set(self.test_data, 'animals[1]', 'Emu', False)
        self.assertEqual(self.test_data,
                         {'firstname': 'John',
                          'animals': ['Bear', 'Emu', 'Ostrich']})

if __name__ == '__main__':
    unittest.main()


text:
.dropdown-context ul {
 border:none;
 border-radius:4px;
 background:{{=background}};
}
.dropdown-context li a{color: {{=linkColor}};}
.dropdown-context li a:hover{color:{{=linkColor2}};}
.dropdown-context hr{
  margin:1px;
}
.dropdown-context h6{
  padding-top:12px;
  padding-left:10px;color:{{=headColor}};
  font-size:12pt;
}
.dropdown-context:before,.dropdown-context:after {
 background: none;
 border-color: transparent transparent transparent;
}


text:
var anObject = require('../internals/an-object');
var isObject = require('../internals/is-object');
var newPromiseCapability = require('../internals/new-promise-capability');

module.exports = function (C, x) {
  anObject(C);
  if (isObject(x) && x.constructor === C) return x;
  var promiseCapability = newPromiseCapability.f(C);
  var resolve = promiseCapability.resolve;
  resolve(x);
  return promiseCapability.promise;
};


text:
/*
============================================================================
  The Ohio State University Research Foundation, The University of Chicago -
  Argonne National Laboratory, Emory University, SemanticBits LLC,
  and Ekagra Software Technologies Ltd.

  Distributed under the OSI-approved BSD 3-Clause License.
  See http://ncip.github.com/cagrid-portal/LICENSE.txt for details.
============================================================================
*/
create table ActivityTracker (
	activityTrackerId decimal(20,0) not null primary key,
	groupId decimal(20,0),
	companyId decimal(20,0),
	userId decimal(20,0),
	userName varchar(75) null,
	createDate datetime null,
	classNameId decimal(20,0),
	classPK decimal(20,0),
	activity varchar(75) null,
	extraData text null,
	receiverUserId decimal(20,0),
	receiverUserName varchar(75) null
)
go

alter table BlogsEntry add uuid_ varchar(75) null;

alter table BookmarksEntry add uuid_ varchar(75) null;

alter table BookmarksFolder add uuid_ varchar(75) null;

alter table CalEvent add uuid_ varchar(75) null;

alter table DLFileEntry add uuid_ varchar(75) null;

alter table DLFileShortcut add uuid_ varchar(75) null;

alter table DLFolder add uuid_ varchar(75) null;

update Group_ set type_ = '0' where type_ is null;
update Group_ set type_ = '0' where type_ = '';
update Group_ set type_ = '1' where type_ = 'COMMUNITY_OPEN';
update Group_ set type_ = '2' where type_ = 'COMMUNITY_RESTRICTED';
update Group_ set type_ = '3' where type_ = 'COMMUNITY_CLOSED';
update Group_ set type_ = '3' where type_ = '0';

alter table IGFolder add uuid_ varchar(75) null;

alter table IGImage add uuid_ varchar(75) null;

alter table JournalArticle add uuid_ varchar(75) null;
alter table JournalArticle add smallImage int;
alter table JournalArticle add smallImageId decimal(20,0)
go
alter table JournalArticle add smallImageURL varchar(75) null;

alter table JournalArticleImage add uuid_ varchar(75) null;

create table JournalFeed (
	uuid_ varchar(75) null,
	id_ decimal(20,0) not null primary key,
	groupId decimal(20,0),
	companyId decimal(20,0),
	userId decimal(20,0),
	userName varchar(75) null,
	createDate datetime null,
	modifiedDate datetime null,
	feedId varchar(75) null,
	name varchar(75) null,
	description varchar(1000) null,
	type_ varchar(75) null,
	structureId varchar(75) null,
	templateId varchar(75) null,
	rendererTemplateId varchar(75) null,
	delta int,
	orderByCol varchar(75) null,
	orderByType varchar(75) null,
	targetLayoutFriendlyUrl varchar(75) null,
	targetPortletId varchar(75) null,
	contentField varchar(75) null,
	feedType varchar(75) null,
	feedVersion float
)
go

alter table JournalStructure add uuid_ varchar(75) null;

alter table JournalTemplate add uuid_ varchar(75) null;
alter table JournalTemplate add cacheable int;

go

update JournalTemplate set cacheable = 1;

alter table MBCategory add uuid_ varchar(75) null;

alter table MBMessage add uuid_ varchar(75) null;

create table MembershipRequest (
	membershipRequestId decimal(20,0) not null primary key,
	companyId decimal(20,0),
	userId decimal(20,0),
	createDate datetime null,
	groupId decimal(20,0),
	comments varchar(1000) null,
	replyComments varchar(1000) null,
	replyDate datetime null,
	replierUserId decimal(20,0),
	statusId int
)
go

alter table PollsChoice add uuid_ varchar(75) null;

alter table PollsQuestion add uuid_ varchar(75) null;

alter table TagsAsset add groupId decimal(20,0)
go
alter table TagsAsset add priority float;
alter table TagsAsset add viewCount int;

go

update TagsAsset set priority = 0, viewCount = 0;

alter table User_ add uuid_ varchar(75) null;

create table WebDAVProps (
	webDavPropsId decimal(20,0) not null primary key,
	companyId decimal(20,0),
	createDate datetime null,
	modifiedDate datetime null,
	classNameId decimal(20,0),
	classPK decimal(20,0),
	props text null
)
go

alter table WikiNode add uuid_ varchar(75) null;

alter table WikiPage add uuid_ varchar(75) null;


text:
// Generated file, do not modify manually!
package v1

import (
	v1 "github.com/amadeusitgroup/workflow-controller/pkg/api/cronworkflow/v1"
	"github.com/amadeusitgroup/workflow-controller/pkg/client/clientset/versioned/scheme"
	serializer "k8s.io/apimachinery/pkg/runtime/serializer"
	rest "k8s.io/client-go/rest"
)

type CronworkflowV1Interface interface {
	RESTClient() rest.Interface
	CronWorkflowsGetter
}

// CronworkflowV1Client is used to interact with features provided by the cronworkflow group.
type CronworkflowV1Client struct {
	restClient rest.Interface
}

func (c *CronworkflowV1Client) CronWorkflows(namespace string) CronWorkflowInterface {
	return newCronWorkflows(c, namespace)
}

// NewForConfig creates a new CronworkflowV1Client for the given config.
func NewForConfig(c *rest.Config) (*CronworkflowV1Client, error) {
	config := *c
	if err := setConfigDefaults(&config); err != nil {
		return nil, err
	}
	client, err := rest.RESTClientFor(&config)
	if err != nil {
		return nil, err
	}
	return &CronworkflowV1Client{client}, nil
}

// NewForConfigOrDie creates a new CronworkflowV1Client for the given config and
// panics if there is an error in the config.
func NewForConfigOrDie(c *rest.Config) *CronworkflowV1Client {
	client, err := NewForConfig(c)
	if err != nil {
		panic(err)
	}
	return client
}

// New creates a new CronworkflowV1Client for the given RESTClient.
func New(c rest.Interface) *CronworkflowV1Client {
	return &CronworkflowV1Client{c}
}

func setConfigDefaults(config *rest.Config) error {
	gv := v1.SchemeGroupVersion
	config.GroupVersion = &gv
	config.APIPath = "/apis"
	config.NegotiatedSerializer = serializer.DirectCodecFactory{CodecFactory: scheme.Codecs}

	if config.UserAgent == "" {
		config.UserAgent = rest.DefaultKubernetesUserAgent()
	}

	return nil
}

// RESTClient returns a RESTClient that is used to communicate
// with API server by this client implementation.
func (c *CronworkflowV1Client) RESTClient() rest.Interface {
	if c == nil {
		return nil
	}
	return c.restClient
}


text:
/**
 * Copyright [2009-2010] [dennis zhuang(killme2008@gmail.com)] Licensed under the Apache License,
 * Version 2.0 (the "License"); you may not use this file except in compliance with the License. You
 * may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by
 * applicable law or agreed to in writing, software distributed under the License is distributed on
 * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See
 * the License for the specific language governing permissions and limitations under the License
 */
package net.rubyeye.xmemcached.command.binary;

import java.nio.ByteBuffer;
import java.util.concurrent.CountDownLatch;
import com.google.code.yanf4j.buffer.IoBuffer;
import net.rubyeye.xmemcached.command.Command;
import net.rubyeye.xmemcached.command.CommandType;
import net.rubyeye.xmemcached.command.StoreCommand;
import net.rubyeye.xmemcached.exception.MemcachedDecodeException;
import net.rubyeye.xmemcached.exception.MemcachedServerException;
import net.rubyeye.xmemcached.exception.UnknownCommandException;
import net.rubyeye.xmemcached.impl.MemcachedTCPSession;
import net.rubyeye.xmemcached.transcoders.CachedData;
import net.rubyeye.xmemcached.transcoders.Transcoder;
import net.rubyeye.xmemcached.utils.ByteUtils;
import net.rubyeye.xmemcached.utils.OpaqueGenerater;

/**
 * Base Binary command.
 *
 * @author dennis
 *
 */
public abstract class BaseBinaryCommand extends Command implements StoreCommand {
  static final short DEFAULT_VBUCKET_ID = 0;
  protected int expTime;
  protected long cas;
  protected Object value;

  protected OpCode opCode;
  protected BinaryDecodeStatus decodeStatus = BinaryDecodeStatus.NONE;
  protected int responseKeyLength, responseExtrasLength, responseTotalBodyLength;
  protected ResponseStatus responseStatus;
  protected int opaque;
  protected short vbucketId = DEFAULT_VBUCKET_ID;

  @SuppressWarnings("unchecked")
  public BaseBinaryCommand(final String key, final byte[] keyBytes, final CommandType cmdType,
      final CountDownLatch latch, final int exp, final long cas, final Object value,
      final boolean noreply, final Transcoder transcoder) {
    super(key, keyBytes, cmdType, latch);
    this.expTime = exp;
    this.cas = cas;
    this.value = value;
    this.noreply = noreply;
    this.transcoder = transcoder;
  }

  public final int getExpTime() {
    return this.expTime;
  }

  public final void setExpTime(final int exp) {
    this.expTime = exp;
  }

  public final long getCas() {
    return this.cas;
  }

  public int getOpaque() {
    return this.opaque;
  }

  public void setOpaque(final int opaque) {
    this.opaque = opaque;
  }

  public final void setCas(final long cas) {
    this.cas = cas;
  }

  public final Object getValue() {
    return this.value;
  }

  public final void setValue(final Object value) {
    this.value = value;
  }

  @Override
  @SuppressWarnings("unchecked")
  public final Transcoder getTranscoder() {
    return this.transcoder;
  }

  @Override
  @SuppressWarnings("unchecked")
  public final void setTranscoder(final Transcoder transcoder) {
    this.transcoder = transcoder;
  }

  @Override
  public boolean decode(final MemcachedTCPSession session, final ByteBuffer buffer) {
    while (true) {
      LABEL: switch (this.decodeStatus) {
        case NONE:
          if (buffer.remaining() < 24) {
            return false;
          } else {
            readHeader(buffer);
          }
          continue;
        case READ_EXTRAS:
          if (readExtras(buffer, this.responseExtrasLength)) {
            this.decodeStatus = BinaryDecodeStatus.READ_KEY;
            continue;
          } else {
            return false;
          }
        case READ_KEY:
          if (readKey(buffer, this.responseKeyLength)) {
            this.decodeStatus = BinaryDecodeStatus.READ_VALUE;
            continue;
          } else {
            return false;
          }
        case READ_VALUE:
          if (this.responseStatus == null || this.responseStatus == ResponseStatus.NO_ERROR) {
            if (readValue(buffer, this.responseTotalBodyLength, this.responseKeyLength,
                this.responseExtrasLength)) {
              this.decodeStatus = BinaryDecodeStatus.DONE;
              continue;
            } else {
              return false;
            }
          } else {
            // Ignore error message
            if (ByteUtils.stepBuffer(buffer, this.responseTotalBodyLength - this.responseKeyLength
                - this.responseExtrasLength)) {
              this.decodeStatus = BinaryDecodeStatus.DONE;
              continue;
            } else {
              return false;
            }
          }
        case DONE:
          if (finish()) {
            return true;
          } else {
            // Do not finish,continue to decode
            this.decodeStatus = BinaryDecodeStatus.NONE;
            break LABEL;
          }
        case IGNORE:
          buffer.reset();
          return true;
      }
    }
  }

  protected boolean finish() {
    if (this.result == null) {
      if (this.responseStatus == ResponseStatus.NO_ERROR) {
        setResult(Boolean.TRUE);
      } else {
        setResult(Boolean.FALSE);
      }
    }
    countDownLatch();
    return true;
  }

  protected void readHeader(final ByteBuffer buffer) {
    markBuffer(buffer);
    readMagicNumber(buffer);
    if (!readOpCode(buffer)) {
      this.decodeStatus = BinaryDecodeStatus.IGNORE;
      return;
    }
    readKeyLength(buffer);
    readExtrasLength(buffer);
    readDataType(buffer);
    readStatus(buffer);
    readBodyLength(buffer);
    if (!readOpaque(buffer)) {
      this.decodeStatus = BinaryDecodeStatus.IGNORE;
      return;
    }
    this.decodeStatus = BinaryDecodeStatus.READ_EXTRAS;
    readCAS(buffer);

  }

  private void markBuffer(final ByteBuffer buffer) {
    buffer.mark();
  }

  protected boolean readOpaque(final ByteBuffer buffer) {
    if (this.noreply) {
      int returnOpaque = buffer.getInt();
      if (returnOpaque != this.opaque) {
        return false;
      }
    } else {
      ByteUtils.stepBuffer(buffer, 4);
    }
    return true;
  }

  protected long readCAS(final ByteBuffer buffer) {
    ByteUtils.stepBuffer(buffer, 8);
    return 0;
  }

  protected boolean readKey(final ByteBuffer buffer, final int keyLength) {
    return ByteUtils.stepBuffer(buffer, keyLength);
  }

  protected boolean readValue(final ByteBuffer buffer, final int bodyLength, final int keyLength,
      final int extrasLength) {
    return ByteUtils.stepBuffer(buffer, bodyLength - keyLength - extrasLength);
  }

  protected boolean readExtras(final ByteBuffer buffer, final int extrasLength) {
    return ByteUtils.stepBuffer(buffer, extrasLength);
  }

  private int readBodyLength(final ByteBuffer buffer) {
    this.responseTotalBodyLength = buffer.getInt();
    return this.responseTotalBodyLength;
  }

  protected void readStatus(final ByteBuffer buffer) {
    this.responseStatus = ResponseStatus.parseShort(buffer.getShort());
    switch (this.responseStatus) {
      case NOT_SUPPORTED:
      case UNKNOWN_COMMAND:
        setException(new UnknownCommandException());
        break;
      case AUTH_REQUIRED:
      case FUTHER_AUTH_REQUIRED:
      case VALUE_TOO_BIG:
      case INVALID_ARGUMENTS:
      case INC_DEC_NON_NUM:
      case BELONGS_TO_ANOTHER_SRV:
      case AUTH_ERROR:
      case OUT_OF_MEMORY:
      case INTERNAL_ERROR:
      case BUSY:
      case TEMP_FAILURE:
        setException(new MemcachedServerException(this.responseStatus.errorMessage()));
        break;
    }

  }

  public final OpCode getOpCode() {
    return this.opCode;
  }

  public final void setOpCode(final OpCode opCode) {
    this.opCode = opCode;
  }

  public final ResponseStatus getResponseStatus() {
    return this.responseStatus;
  }

  public final void setResponseStatus(final ResponseStatus responseStatus) {
    this.responseStatus = responseStatus;
  }

  private int readKeyLength(final ByteBuffer buffer) {
    this.responseKeyLength = buffer.getShort();
    return this.responseKeyLength;
  }

  private int readExtrasLength(final ByteBuffer buffer) {
    this.responseExtrasLength = buffer.get();
    return this.responseExtrasLength;
  }

  private byte readDataType(final ByteBuffer buffer) {
    return buffer.get();
  }

  protected boolean readOpCode(final ByteBuffer buffer) {
    byte op = buffer.get();
    if (op != this.opCode.fieldValue()) {
      if (this.noreply) {
        return false;
      } else {
        throw new MemcachedDecodeException("Not a proper " + this.opCode.name() + " response");
      }
    }
    return true;
  }

  private void readMagicNumber(final ByteBuffer buffer) {
    byte magic = buffer.get();

    if (magic != RESPONSE_MAGIC_NUMBER) {
      throw new MemcachedDecodeException("Not a proper response");
    }
  }

  /**
   * Set,add,replace protocol's extras length
   */
  static final byte EXTRAS_LENGTH = (byte) 8;

  @Override
  @SuppressWarnings("unchecked")
  public void encode() {
    CachedData data = null;
    if (this.transcoder != null) {
      data = this.transcoder.encode(this.value);
    }
    // header+key+value+extras
    int length = 24 + getKeyLength() + getValueLength(data) + getExtrasLength();

    this.ioBuffer = IoBuffer.allocate(length);
    fillHeader(data);
    fillExtras(data);
    fillKey();
    fillValue(data);

    this.ioBuffer.flip();

  }

  protected void fillValue(final CachedData data) {
    this.ioBuffer.put(data.getData());
  }

  protected void fillKey() {
    this.ioBuffer.put(this.keyBytes);
  }

  protected void fillExtras(final CachedData data) {
    this.ioBuffer.putInt(data.getFlag());
    this.ioBuffer.putInt(this.expTime);
  }

  private void fillHeader(final CachedData data) {
    byte[] bs = new byte[24];
    bs[0] = REQUEST_MAGIC_NUMBER;
    bs[1] = this.opCode.fieldValue();
    short keyLen = getKeyLength();
    bs[2] = ByteUtils.short1(keyLen);
    bs[3] = ByteUtils.short0(keyLen);
    bs[4] = getExtrasLength();
    // dataType,always zero bs[5]=0;

    bs[6] = ByteUtils.short1(this.vbucketId);
    bs[7] = ByteUtils.short0(this.vbucketId);
    // body len
    int bodyLen = getExtrasLength() + getKeyLength() + getValueLength(data);
    bs[8] = ByteUtils.int3(bodyLen);
    bs[9] = ByteUtils.int2(bodyLen);
    bs[10] = ByteUtils.int1(bodyLen);
    bs[11] = ByteUtils.int0(bodyLen);
    // Opaque
    if (this.noreply) {
      this.opaque = OpaqueGenerater.getInstance().getNextValue();
    }
    bs[12] = ByteUtils.int3(this.opaque);
    bs[13] = ByteUtils.int2(this.opaque);
    bs[14] = ByteUtils.int1(this.opaque);
    bs[15] = ByteUtils.int0(this.opaque);
    // cas
    long casValue = getCasValue();
    bs[16] = ByteUtils.long7(casValue);
    bs[17] = ByteUtils.long6(casValue);
    bs[18] = ByteUtils.long5(casValue);
    bs[19] = ByteUtils.long4(casValue);
    bs[20] = ByteUtils.long3(casValue);
    bs[21] = ByteUtils.long2(casValue);
    bs[22] = ByteUtils.long1(casValue);
    bs[23] = ByteUtils.long0(casValue);
    this.ioBuffer.put(bs);
  }

  protected long getCasValue() {
    return 0L;
  }

  protected int getValueLength(final CachedData data) {
    return data.getData().length;
  }

  protected short getKeyLength() {
    return (short) this.keyBytes.length;
  }

  protected byte getExtrasLength() {
    return EXTRAS_LENGTH;
  }

}


text:
class ConfirmInfoBar : public InfoBarAndroid {
 public:
  explicit ConfirmInfoBar(scoped_ptr<ConfirmInfoBarDelegate> delegate);
  ~ConfirmInfoBar() override;

 protected:
  base::string16 GetTextFor(ConfirmInfoBarDelegate::InfoBarButton button);
  ConfirmInfoBarDelegate* GetDelegate();
  void OnLinkClicked(JNIEnv* env,
                     const base::android::JavaParamRef<jobject>& obj) override;

  // InfoBarAndroid overrides.
  base::android::ScopedJavaLocalRef<jobject> CreateRenderInfoBar(
      JNIEnv* env) override;

 private:
  void ProcessButton(int action) override;

  base::android::ScopedJavaGlobalRef<jobject> java_confirm_delegate_;

  DISALLOW_COPY_AND_ASSIGN(ConfirmInfoBar);
};

// Registers native methods.
bool RegisterConfirmInfoBarDelegate(JNIEnv* env);

#endif  // CHROME_BROWSER_UI_ANDROID_INFOBARS_CONFIRM_INFOBAR_H_


text:
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { HomeComponent } from './pages/home/home.component';
import { ProfileComponent } from './pages/profile/profile.component';
import { LogoutComponent } from './pages/logout/logout.component';
import { AuthGuard } from './guards/auth.guard';

const routes: Routes = [
  { path: 'home', component: HomeComponent },
  { path: 'profile', component: ProfileComponent, canActivate: [AuthGuard] },
  { path: 'logout', component: LogoutComponent },
  { path: '', redirectTo: '/home', pathMatch: 'full' }
];

@NgModule({
  exports: [RouterModule],
  imports: [RouterModule.forRoot(routes)],
  declarations: []
})
export class AppRoutingModule {}


text:
<?php

namespace Kendo\Dataviz\UI;

class SparklineCategoryAxisItemNotesIcon extends \Kendo\SerializableObject {
//>> Properties

    /**
    * The background color of the notes icon.
    * @param string $value
    * @return \Kendo\Dataviz\UI\SparklineCategoryAxisItemNotesIcon
    */
    public function background($value) {
        return $this->setProperty('background', $value);
    }

    /**
    * The border of the icon.
    * @param \Kendo\Dataviz\UI\SparklineCategoryAxisItemNotesIconBorder|array $value
    * @return \Kendo\Dataviz\UI\SparklineCategoryAxisItemNotesIcon
    */
    public function border($value) {
        return $this->setProperty('border', $value);
    }

    /**
    * The size of the icon.
    * @param float $value
    * @return \Kendo\Dataviz\UI\SparklineCategoryAxisItemNotesIcon
    */
    public function size($value) {
        return $this->setProperty('size', $value);
    }

    /**
    * The icon shape.The supported values are:
* "circle" - the marker shape is circle.
* "square" - the marker shape is square.
* "triangle" - the marker shape is triangle.
    * @param string $value
    * @return \Kendo\Dataviz\UI\SparklineCategoryAxisItemNotesIcon
    */
    public function type($value) {
        return $this->setProperty('type', $value);
    }

    /**
    * The icon visibility.
    * @param boolean $value
    * @return \Kendo\Dataviz\UI\SparklineCategoryAxisItemNotesIcon
    */
    public function visible($value) {
        return $this->setProperty('visible', $value);
    }

//<< Properties
}

?>


text:
import Diagram from '../..';

describe('Diagram', function() {

  var container;

  beforeEach(function() {
    container = document.createElement('div');
    document.body.appendChild(container);
  });

  afterEach(function() {
    container.parentNode.removeChild(container);
  });

  describe('runtime', function() {

    it('should bootstrap', function() {

      new Diagram({
        canvas: {
          container: container,
          width: 700,
          height: 500
        }
      });
    });

    it('should offer #destroy method', function() {

      // when
      var diagram = new Diagram({
        canvas: {
          container: container,
          width: 700,
          height: 500
        }
      });

      // then
      expect(diagram.destroy).to.be.an('function');
    });

    it('should throw inspectable errors', function() {

      expect(function() {
        new Diagram({
          modules: {
            __init__: [
              function(foo) {}
            ]
          }
        });
      }).to.throw(/No provider for "foo"!/);
    });

    describe('should expose diagram services', function() {

      it('via #get', function() {

        // when
        var diagram = new Diagram({
          canvas: {
            container: container,
            width: 700,
            height: 500
          }
        });

        // then
        expect(diagram.get('canvas')).to.be.an('object');
      });

      it('via #get / non-existing service', function() {

        // when
        var diagram = new Diagram({
          canvas: {
            container: container,
            width: 700,
            height: 500
          }
        });

        // then
        expect(function() {
          diagram.get('foobar');
        }).to.throw('No provider for "foobar"! (Resolving: foobar)');
      });

      it('via #get / non-existing optional service', function() {

        // when
        var diagram = new Diagram({
          canvas: {
            container: container,
            width: 700,
            height: 500
          }
        });

        // then
        expect(diagram.get('foobar', false)).to.be.null;
      });

      it('via #invoke', function() {

        // when
        var diagram = new Diagram({
          canvas: {
            container: container,
            width: 700,
            height: 500
          }
        });

        diagram.invoke([ 'canvas', function(canvas) {
          canvas.addShape({ id: 's1', x: 10, y: 10, width: 30, height: 30 });
          canvas.addShape({ id: 's2', x: 100, y: 100, width: 30, height: 30 });

          canvas.addConnection({ id: 'c1', waypoints: [ { x: 25, y: 25 }, { x: 115, y: 115 } ] });
        } ]);
      });

    });

  });

});


text:
#ifndef _XTENSA_SIGCONTEXT_H
#define _XTENSA_SIGCONTEXT_H

struct sigcontext {
	unsigned long sc_pc;
	unsigned long sc_ps;
	unsigned long sc_lbeg;
	unsigned long sc_lend;
	unsigned long sc_lcount;
	unsigned long sc_sar;
	unsigned long sc_acclo;
	unsigned long sc_acchi;
	unsigned long sc_a[16];
	void *sc_xtregs;
};

#endif /* _XTENSA_SIGCONTEXT_H */


text:
package uk.theretiredprogrammer.nbpcglibrary.node.nodes;

import java.awt.Image;
import java.awt.datatransfer.DataFlavor;
import java.io.File;
import java.io.IOException;
import java.util.logging.Level;
import javax.imageio.ImageIO;
import uk.theretiredprogrammer.nbpcglibrary.data.entity.EntityManager;
import uk.theretiredprogrammer.nbpcglibrary.node.ImageFileFinder;
import uk.theretiredprogrammer.nbpcglibrary.api.LogicException;
import org.openide.cookies.InstanceCookie;
import org.openide.filesystems.FileObject;
import org.openide.filesystems.FileUtil;
import org.openide.loaders.DataObject;
import org.openide.loaders.DataObjectNotFoundException;
import uk.theretiredprogrammer.nbpcglibrary.common.LogBuilder;
import uk.theretiredprogrammer.nbpcglibrary.data.entity.CoreEntity;
import uk.theretiredprogrammer.nbpcglibrary.data.entity.Entity;

/**
 * Read-Write Icon Node Abstract Class
 *
 * @author Richard Linsdale (richard at theretiredprogrammer.uk)
 * @param <K> the Entity primary Key class
 * @param <E> the Entity Class
 * @param <P> the parent Entity Class
 * @param <F> the Entity Field enum class
 */
public abstract class IconNode<K, E extends Entity<K, E, P, F>, P extends CoreEntity, F> extends TreeNode<K, E, P, F> {

    private final ImageFileFinder<E> imagefilefinder;
    private final String nodename;

    /**
     * Constructor
     *
     * @param nodename the node name
     * @param e the entity
     * @param cf the childfactory
     * @param emclass the entity manager class
     * @param allowedDataFlavors allowed paste actions
     * @param operationsEnabled set for copy , cut and delete enabled
     */
    public IconNode(String nodename, E e, BasicChildFactory<K, E, P> cf, Class<? extends EntityManager> emclass, DataFlavor[] allowedDataFlavors, int operationsEnabled) {
        super(nodename, e, cf, emclass, allowedDataFlavors, operationsEnabled);
        this.nodename = nodename;
        imagefilefinder = getImageFileFinder(nodename);
    }

    /**
     * Constructor.
     *
     * @param nodename the node name
     * @param e the entity
     * @param emclass the entity manager class
     * @param operationsEnabled set for copy , cut and delete enabled
     */
    protected IconNode(String nodename, E e, Class<? extends EntityManager> emclass, int operationsEnabled) {
        super(nodename, e, emclass, operationsEnabled);
        this.nodename = nodename;
        imagefilefinder = getImageFileFinder(nodename);
    }

    private ImageFileFinder<E> getImageFileFinder(String nodename) {
        FileObject ff = FileUtil.getConfigFile("nbpcglibrary/node/" + nodename + "/imagefilefinder"); // get folder
        if (ff == null) {
            throw new LogicException("no image file finders defined for node " + nodename);
        }
        FileObject[] ffc = ff.getChildren();
        switch (ffc.length) {
            case 0:
                throw new LogicException("no image file finders defined for node " + nodename);
            case 1:
                return getInstanceFromFileObject(ffc[0]);
            default:
                throw new LogicException("multiple image file finders defined for node " + nodename);
        }
    }

    private ImageFileFinder<E> getInstanceFromFileObject(FileObject fo) {
        try {
            DataObject dobj = DataObject.find(fo);
            InstanceCookie ic = dobj.getLookup().lookup(InstanceCookie.class);
            if (ic == null) {
                throw new LogicException("Bad image file finder - no instance cookie");
            }
            return (ImageFileFinder<E>) ic.instanceCreate();
        } catch (DataObjectNotFoundException ex) {
            throw new LogicException("Bad image file finder", ex);
        } catch (IOException | ClassNotFoundException ex) {
            throw new LogicException("Bad image file finder", ex);
        }
    }

    @Override
    public String getHtmlDisplayName() {
        return null;
    }

    @Override
    public Image getIcon(int type) {
        E entity = getEntity();
        File fi = imagefilefinder.getFile(entity);
        if (fi == null) {
            LogBuilder.create("nbpcglibrary.node", Level.WARNING).addMethodName(this, "getIcon")
                    .addMsg("Nodename is {0} - No image defined", nodename).write();
            return entity.getIconWithError();
        }
        try {
            return entity.checkRules(new StringBuilder()) ? ImageIO.read(fi) : entity.addErrorToIcon(ImageIO.read(fi));
        } catch (IOException ex) {
            LogBuilder.create("nbpcglibrary.node", Level.WARNING).addMethodName(this, "getIcon")
                    .addMsg("Nodename is {0} - IOException when reading image", nodename).addExceptionMessage(ex).write();
            return entity.getIconWithError();
        }
    }
}