text:
layout: page
title: Metrics
---
<!--
   Licensed to the Apache Software Foundation (ASF) under one or more
   contributor license agreements.  See the NOTICE file distributed with
   this work for additional information regarding copyright ownership.
   The ASF licenses this file to You under the Apache License, Version 2.0
   (the "License"); you may not use this file except in compliance with
   the License.  You may obtain a copy of the License at

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

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

When you're running a stream process in production, it's important that you have good metrics to track the health of your job. In order to make this easy, Samza includes a metrics library. It is used by Samza itself to generate some standard metrics such as message throughput, but you can also use it in your task code to emit custom metrics.

Metrics can be reported in various ways. You can expose them via [JMX](jmx.html), which is useful in development. In production, a common setup is for each Samza container to periodically publish its metrics to a "metrics" Kafka topic, in which the metrics from all Samza jobs are aggregated. You can then consume this stream in another Samza job, and send the metrics to your favorite graphing system such as [Graphite](http://graphite.wikidot.com/).

To set up your job to publish metrics to Kafka, you can use the following configuration:

{% highlight jproperties %}
# Define a metrics reporter called "snapshot", which publishes metrics
# every 60 seconds.
metrics.reporters=snapshot
metrics.reporter.snapshot.class=org.apache.samza.metrics.reporter.MetricsSnapshotReporterFactory

# Tell the snapshot reporter to publish to a topic called "metrics"
# in the "kafka" system.
metrics.reporter.snapshot.stream=kafka.metrics

# Encode metrics data as JSON.
serializers.registry.metrics.class=org.apache.samza.serializers.MetricsSnapshotSerdeFactory
systems.kafka.streams.metrics.samza.msg.serde=metrics
{% endhighlight %}

With this configuration, the job automatically sends several JSON-encoded messages to the "metrics" topic in Kafka every 60 seconds. The messages look something like this:

{% highlight json %}
{
  "header": {
    "container-name": "samza-container-0",
    "host": "samza-grid-1234.example.com",
    "job-id": "1",
    "job-name": "my-samza-job",
    "reset-time": 1401729000347,
    "samza-version": "0.0.1",
    "source": "Partition-2",
    "time": 1401729420566,
    "version": "0.0.1"
  },
  "metrics": {
    "org.apache.samza.container.TaskInstanceMetrics": {
      "commit-calls": 7,
      "commit-skipped": 77948,
      "kafka-input-topic-offset": "1606",
      "messages-sent": 985,
      "process-calls": 1093,
      "send-calls": 985,
      "send-skipped": 76970,
      "window-calls": 0,
      "window-skipped": 77955
    }
  }
}
{% endhighlight %}

There is a separate message for each task instance, and the header tells you the job name, job ID and partition of the task. The metrics allow you to see how many messages have been processed and sent, the current offset in the input stream partition, and other details. There are additional messages which give you metrics about the JVM (heap size, garbage collection information, threads etc.), internal metrics of the Kafka producers and consumers, and more.

It's easy to generate custom metrics in your job, if there's some value you want to keep an eye on. You can use Samza's built-in metrics framework, which is similar in design to Coda Hale's [metrics](http://metrics.codahale.com/) library.

You can register your custom metrics through a [MetricsRegistry](../api/javadocs/org/apache/samza/metrics/MetricsRegistry.html). Your stream task needs to implement [InitableTask](../api/javadocs/org/apache/samza/task/InitableTask.html), so that you can get the metrics registry from the [TaskContext](../api/javadocs/org/apache/samza/task/TaskContext.html). This simple example shows how to count the number of messages processed by your task:

{% highlight java %}
public class MyJavaStreamTask implements StreamTask, InitableTask {
  private Counter messageCount;

  public void init(Config config, TaskContext context) {
    this.messageCount = context
      .getMetricsRegistry()
      .newCounter(getClass().getName(), "message-count");
  }

  public void process(IncomingMessageEnvelope envelope,
                      MessageCollector collector,
                      TaskCoordinator coordinator) {
    messageCount.inc();
  }
}
{% endhighlight %}

Samza currently supports three kinds of metrics: [counters](../api/javadocs/org/apache/samza/metrics/Counter.html), [gauges](../api/javadocs/org/apache/samza/metrics/Gauge.html) and [timer](../api/javadocs/org/apache/samza/metrics/Timer.html). Use a counter when you want to track how often something occurs, a gauge when you want to report the level of something, such as the size of a buffer, and a timer when you want to know how much time the block of code spends. Each task instance (for each input stream partition) gets its own set of metrics.

If you want to report metrics in some other way, e.g. directly to a graphing system (without going via Kafka), you can implement a [MetricsReporterFactory](../api/javadocs/org/apache/samza/metrics/MetricsReporterFactory.html) and reference it in your job configuration.

## [Windowing »](windowing.html)


text:
"use strict";

const Const = require("../constants");

const PanelActTypes = Const.ActTypes.Panel;

let PanelActions = {
  setInitialValues(statInfo) {
    this.dispatch(
      PanelActTypes.SET_INITIAL_VALUES,
      {
        filters: statInfo.filters,
        measurement: statInfo.measurement,
        aggregator: statInfo.measurement.aggregator
      }
    );
  },

  updateFilters(filters) {
    this.dispatch(
      PanelActTypes.UPDATE_FILTERS,
      { filters: filters}
    );
  },

  updateMeasurement(measurement) {
    this.dispatch(
      PanelActTypes.UPDATE_MEASUREMENT,
      { measurement: measurement} //measurement === undefined if not found
    );
  },

  updateAggregator(agr) {
    this.dispatch(
      PanelActTypes.UPDATE_AGGREGATOR,
      { aggregator: agr}
    );
  },

  createFilter() {
    this.dispatch(
      PanelActTypes.CREATE_FILTER,
      {}
    );
  },

  deleteFilter(index) {
    this.dispatch(
      PanelActTypes.DELETE_FILTER,
      {index: index}
    );
  },

  updateFilterCol(index, filter) {
    this.dispatch(
      PanelActTypes.UPDATE_FILTER_COL,
      {
        index: index,
        filter: filter
      }
    );
  },

  updateFilterWhere(index, whereExp) {
    this.dispatch(
      PanelActTypes.UPDATE_FILTER_WHERE,
      {
        index: index,
        whereExp: whereExp
      }
    );
  },

  updateFilterValue(index, value) {
    this.dispatch(
      PanelActTypes.UPDATE_FILTER_VALUE,
      {
        index: index,
        value: value
      }
    );
  }

};

module.exports = PanelActions;

redpajama_set_name: RedPajamaGithub


text:
package projects.nk.shortestroute.data;

import static org.junit.Assert.*;
import org.junit.Test;

public class DataGraphTest {

	private static final String DEL = "DEL";
	private static final String BOM = "BOM";
	private static final String PNQ = "PNQ";

	@Test
	public void testFindInvalidNode() throws ObjectNotFoundException {
		DataGraph dataGraph = new DataGraph();
		dataGraph.populateGraph(BOM, PNQ);

		assertFalse("Should not find this node since it was not added", dataGraph.hasGraphNode(DEL));
	}

	public void testFindInvalidPath() throws ObjectNotFoundException {
		DataGraph dataGraph = new DataGraph();
		dataGraph.populateGraph(BOM, PNQ);
		dataGraph.populateGraph(DEL, PNQ);
		dataGraph.populateGraph(BOM, DEL);

		assertFalse("This path was never added", dataGraph.isConnected(PNQ, DEL));
	}

	@Test(expected=ObjectNotFoundException.class)
	public void testFindInvalidNodeInPath() throws ObjectNotFoundException {
		DataGraph dataGraph = new DataGraph();
		dataGraph.populateGraph(BOM, PNQ);
		dataGraph.populateGraph(DEL, PNQ);
		dataGraph.populateGraph(BOM, DEL);

		dataGraph.isConnected(PNQ, "MAA");
	}

	@Test
	public void testPopulateGraph() throws ObjectNotFoundException {
		DataGraph dataGraph = new DataGraph();
		dataGraph.populateGraph(BOM, PNQ);

		assertTrue("Should find this node",dataGraph.hasGraphNode(BOM));
		assertTrue("Should find this node",dataGraph.hasGraphNode(PNQ));

		// PNQ should not be connected to anything else
		assertEquals("There should be exactly 0 outgoing paths from here", 0, dataGraph.getConnectionCount(PNQ));

		// BOM should not be connected to PNQ and nothing else
		assertEquals("There should be exactly 1 outgoing paths from here", 1, dataGraph.getConnectionCount(BOM));
		assertTrue("Needs to have this path", dataGraph.isConnected(BOM,PNQ));
	}

	@Test
	public void testConnectionCount() throws ObjectNotFoundException {
		DataGraph dataGraph = new DataGraph();
		dataGraph.populateGraph(BOM, PNQ);
		dataGraph.populateGraph(BOM, DEL);

		// PNQ should not be connected to anything else
		assertEquals(0, dataGraph.getConnectionCount(PNQ));

		// DEL should not be connected to anything else
		assertEquals(0, dataGraph.getConnectionCount(DEL));

		// BOM should not be connected to PNQ and DEL and nothing else
		assertEquals(2, dataGraph.getConnectionCount(BOM));
		assertTrue(dataGraph.isConnected(BOM, PNQ));
		assertTrue(dataGraph.isConnected(BOM, DEL));
	}

	@Test
	public void testGraphWithCyclicPath() throws ObjectNotFoundException {
		DataGraph dataGraph = new DataGraph();
		dataGraph.populateGraph(BOM, PNQ);
		dataGraph.populateGraph(BOM, DEL);
		dataGraph.populateGraph(PNQ, DEL);
		dataGraph.populateGraph(DEL, PNQ);
		dataGraph.populateGraph(PNQ, BOM);

		// BOM should not be connected to PNQ and DEL and nothing else
		assertEquals(2, dataGraph.findPaths(BOM, DEL).size());
	}
}


text:
module ZAWS
  class External
    class AWSCLI
      class Commands
        class EC2
          class AssignPrivateIpAddresses
            def initialize(shellout=nil, awscli=nil)
              @shellout=shellout
              @awscli=awscli
              clear_settings
              self
            end

            def aws
              @aws ||= ZAWS::External::AWSCLI::Commands::AWS.new(self)
              @aws
            end

            def clear_settings
              @network_interface_id=nil
              @private_ip_addresses=nil
              @aws=nil
              self
            end

            def network_interface_id(id)
              @network_interface_id=id
              self
            end

            def private_ip_addresses(ip)
              @private_ip_addresses=ip
              self
            end

            def get_command
              command = "ec2 assign-private-ip-addresses"
              command = "#{command} --network-interface-id \"#{@network_interface_id}\"" if @network_interface_id
              command = "#{command} --private-ip-addresses \"#{@private_ip_addresses}\"" if @private_ip_addresses
              return command
            end
          end
        end
      end
    end
  end
end


text:
class CBaseHudChatInputLine;
class CBaseHudChatEntry;
class CHudChatFilterPanel;

namespace vgui
{
	class IScheme;
};

#define CHATLINE_NUM_FLASHES 8.0f
#define CHATLINE_FLASH_TIME 5.0f
#define CHATLINE_FADE_TIME 1.0f

#define CHAT_HISTORY_FADE_TIME 0.25f
#define CHAT_HISTORY_IDLE_TIME 10.0f
#define CHAT_HISTORY_IDLE_FADE_TIME 2.5f
#define CHAT_HISTORY_ALPHA 127

extern ConVar cl_showtextmsg;

enum ChatFilters
{
	CHAT_FILTER_NONE = 0,
	CHAT_FILTER_JOINLEAVE = 1,
	CHAT_FILTER_NAMECHANGE = 2,
	CHAT_FILTER_PUBLICCHAT = 4,
	CHAT_FILTER_SERVERMSG = 8,
	CHAT_FILTER_TEAMCHANGE = 16
};

//-----------------------------------------------------------------------------
enum TextColor
{
	COLOR_NORMAL = 1,
	COLOR_USEOLDCOLORS = 2,
	COLOR_PLAYERNAME = 3,
	COLOR_LOCATION = 4,
	COLOR_ACHIEVEMENT = 5,
	COLOR_MAX
};

//--------------------------------------------------------------------------------------------------------------
struct TextRange
{
	int start;
	int end;
	Color color;
};

void StripEndNewlineFromString( char *str );
void StripEndNewlineFromString( wchar_t *str );

char* ConvertCRtoNL( char *str );
wchar_t* ConvertCRtoNL( wchar_t *str );
wchar_t* ReadLocalizedString( bf_read &msg, wchar_t *pOut, int outSize, bool bStripNewline, char *originalString = NULL, int originalSize = 0 );
wchar_t* ReadChatTextString( bf_read &msg, wchar_t *pOut, int outSize );
char* RemoveColorMarkup( char *str );

//-----------------------------------------------------------------------------
// Purpose: An output/display line of the chat interface
//-----------------------------------------------------------------------------
class CBaseHudChatLine : public vgui::RichText
{
	typedef vgui::RichText BaseClass;

public:
	CBaseHudChatLine( vgui::Panel *parent, const char *panelName );
	~CBaseHudChatLine();

	void			SetExpireTime( void );

	bool			IsReadyToExpire( void );

	void			Expire( void );

	float			GetStartTime( void );

	int				GetCount( void );

	virtual void	ApplySchemeSettings(vgui::IScheme *pScheme);

	vgui::HFont		GetFont() { return m_hFont; }

	Color			GetTextColor( void ) { return m_clrText; }
	void			SetNameLength( int iLength ) { m_iNameLength = iLength;	}
	void			SetNameColor( Color cColor ){ m_clrNameColor = cColor; 	}

	virtual void	PerformFadeout( void );
	virtual void	InsertAndColorizeText( wchar_t *buf, int clientIndex );
	virtual			void Colorize( int alpha = 255 );								///< Re-inserts the text in the appropriate colors at the given alpha

	void			SetNameStart( int iStart ) { m_iNameStart = iStart;	}

protected:
	int				m_iNameLength;
	vgui::HFont		m_hFont;

	Color			m_clrText;
	Color			m_clrNameColor;

	float			m_flExpireTime;

	CUtlVector< TextRange > m_textRanges;
	wchar_t					*m_text;

	int				m_iNameStart;

private:
	float			m_flStartTime;
	int				m_nCount;

	vgui::HFont		m_hFontMarlett;

private:
	CBaseHudChatLine( const CBaseHudChatLine & ); // not defined, not accessible
};

class CHudChatHistory : public vgui::RichText
{
	DECLARE_CLASS_SIMPLE( CHudChatHistory, vgui::RichText );
public:

	CHudChatHistory( vgui::Panel *pParent, const char *panelName );

	virtual void	ApplySchemeSettings(vgui::IScheme *pScheme);
};

class CHudChatFilterButton : public vgui::Button
{
	DECLARE_CLASS_SIMPLE( CHudChatFilterButton, vgui::Button );

public:

	CHudChatFilterButton(  vgui::Panel *pParent, const char *pName, const char *pText );

	virtual void DoClick( void );
};

class CHudChatFilterCheckButton : public vgui::CheckButton
{
	DECLARE_CLASS_SIMPLE( CHudChatFilterCheckButton, vgui::CheckButton );

public:

	CHudChatFilterCheckButton( vgui::Panel *pParent, const char *pName, const char *pText, int iFlag );

	int		GetFilterFlag( void ) { return m_iFlag; }

private:

	int m_iFlag;
};

//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
class CBaseHudChat : public CHudElement, public vgui::EditablePanel
{
	DECLARE_CLASS_SIMPLE( CBaseHudChat, vgui::EditablePanel );
public:
	DECLARE_MULTIPLY_INHERITED();

	enum
	{
		CHAT_INTERFACE_LINES = 6,
		MAX_CHARS_PER_LINE = 128
	};

	CBaseHudChat( const char *pElementName );

	virtual void	CreateChatInputLine( void );
	virtual void	CreateChatLines( void );

	virtual void	Init( void );

	void			LevelInit( const char *newmap );
	void			LevelShutdown( void );

	void			MsgFunc_TextMsg(const char *pszName, int iSize, void *pbuf);

	virtual void	Printf( int iFilter, const char *fmt, ... );
	virtual void	ChatPrintf( int iPlayerIndex, int iFilter, const char *fmt, ... );

	void			StartMessageMode( int iMessageModeType );
	void			StopMessageMode( void );
	void			Send( void );

	virtual void	ApplySchemeSettings(vgui::IScheme *pScheme);
	virtual void	Paint( void );
	virtual void	OnTick( void );
	virtual void	Reset();
#ifdef _XBOX
	virtual bool	ShouldDraw();
#endif
	vgui::Panel		*GetInputPanel( void );

	static int		m_nLineCounter;

	virtual int		GetChatInputOffset( void );

	// IGameEventListener interface:
	virtual void FireGameEvent( IGameEvent *event);

	CHudChatHistory			*GetChatHistory();

	void					FadeChatHistory();
	float					m_flHistoryFadeTime;
	float					m_flHistoryIdleTime;

	virtual void			MsgFunc_SayText( bf_read &msg );
	virtual void			MsgFunc_SayText2( bf_read &msg );
	virtual void			MsgFunc_TextMsg( bf_read &msg );
	virtual void			MsgFunc_VoiceSubtitle( bf_read &msg );

	CBaseHudChatInputLine	*GetChatInput( void ) { return m_pChatInput; }
	CHudChatFilterPanel		*GetChatFilterPanel( void );

	virtual int				GetFilterFlags( void ) { return m_iFilterFlags; }
	void					SetFilterFlag( int iFilter );

	//-----------------------------------------------------------------------------
	virtual Color	GetDefaultTextColor( void );
	virtual Color	GetTextColorForClient( TextColor colorNum, int clientIndex );
	virtual Color	GetClientColor( int clientIndex );

	virtual int		GetFilterForString( const char *pString );

	virtual const char *GetDisplayedSubtitlePlayerName( int clientIndex );

	bool			IsVoiceSubtitle( void ) { return m_bEnteringVoice; }
	void			SetVoiceSubtitleState( bool bState ) { m_bEnteringVoice = bState; }

protected:
	CBaseHudChatLine		*FindUnusedChatLine( void );

	CBaseHudChatInputLine	*m_pChatInput;
	CBaseHudChatLine		*m_ChatLine;
	int					m_iFontHeight;

	CHudChatHistory			*m_pChatHistory;

	CHudChatFilterButton	*m_pFiltersButton;
	CHudChatFilterPanel		*m_pFilterPanel;

private:
	void			Clear( void );

	int				ComputeBreakChar( int width, const char *text, int textlen );

	int				m_nMessageMode;

	int				m_nVisibleHeight;

	vgui::HFont		m_hChatFont;

	int				m_iFilterFlags;
	bool			m_bEnteringVoice;
};

class CBaseHudChatEntry : public vgui::TextEntry
{
	typedef vgui::TextEntry BaseClass;
public:
	CBaseHudChatEntry( vgui::Panel *parent, char const *panelName, CBaseHudChat *pChat )
		: BaseClass( parent, panelName )
	{
		SetCatchEnterKey( true );
		SetAllowNonAsciiCharacters( true );
		SetDrawLanguageIDAtLeft( true );
		m_pHudChat = pChat;
	}

	virtual void ApplySchemeSettings( vgui::IScheme *pScheme )
	{
		BaseClass::ApplySchemeSettings(pScheme);

		SetPaintBorderEnabled( false );
	}

	virtual void OnKeyCodeTyped(vgui::KeyCode code)
	{
		if ( code == KEY_ENTER || code == KEY_PAD_ENTER || code == KEY_ESCAPE )
		{
			if ( code != KEY_ESCAPE )
			{
				if ( m_pHudChat )
				{
					m_pHudChat->Send();
				}
			}

			// End message mode.
			if ( m_pHudChat )
			{
				m_pHudChat->StopMessageMode();
			}
		}
		else if ( code == KEY_TAB )
		{
			// Ignore tab, otherwise vgui will screw up the focus.
			return;
		}
		else
		{
			BaseClass::OnKeyCodeTyped( code );
		}
	}

private:
	CBaseHudChat *m_pHudChat;
};

//-----------------------------------------------------------------------------
// Purpose: The prompt and text entry area for chat messages
//-----------------------------------------------------------------------------
class CBaseHudChatInputLine : public vgui::Panel
{
	typedef vgui::Panel BaseClass;

public:
	CBaseHudChatInputLine( CBaseHudChat *parent, char const *panelName );

	void			SetPrompt( const wchar_t *prompt );
	void			ClearEntry( void );
	void			SetEntry( const wchar_t *entry );
	void			GetMessageText( wchar_t *buffer, int buffersizebytes );

	virtual void	PerformLayout();
	virtual void	ApplySchemeSettings(vgui::IScheme *pScheme);

	vgui::Panel		*GetInputPanel( void );
	virtual vgui::VPANEL GetCurrentKeyFocus() { return m_pInput->GetVPanel(); }

	virtual void Paint()
	{
		BaseClass::Paint();
	}

	vgui::Label		*GetPrompt( void ) { return m_pPrompt; }

protected:
	vgui::Label		*m_pPrompt;
	CBaseHudChatEntry	*m_pInput;
};

class CHudChatFilterPanel : public vgui::EditablePanel
{
	DECLARE_CLASS_SIMPLE( CHudChatFilterPanel, vgui::EditablePanel );

public:

	CHudChatFilterPanel(  vgui::Panel *pParent, const char *pName );

	virtual void ApplySchemeSettings( vgui::IScheme *pScheme );
	MESSAGE_FUNC_PTR( OnFilterButtonChecked, "CheckButtonChecked", panel );

	CBaseHudChat *GetChatParent( void ) { return dynamic_cast < CBaseHudChat * > ( GetParent() ); }

	virtual void SetVisible(bool state);

private:

};

#endif // HUD_BASECHAT_H


text:
package glisp

import (
	"errors"
	"hash/fnv"
	"fmt"
)

func HashExpression(expr Sexp) (int, error) {
	switch e := expr.(type) {
	case SexpInt:
		return int(e), nil
	case SexpChar:
		return int(e), nil
	case SexpSymbol:
		return e.number, nil
	case SexpStr:
		hasher := fnv.New32()
		_, err := hasher.Write([]byte(e))
		if err != nil {
			return 0, err
		}
		return int(hasher.Sum32()), nil
	}
	return 0, errors.New(fmt.Sprintf("cannot hash type %T", expr))
}

func MakeHash(args []Sexp) (SexpHash, error) {
	hash := SexpHash(make(map[int][]SexpPair))

	if len(args) % 2 != 0 {
		return SexpHash(nil),
			errors.New("hash requires even number of arguments")
	}

	for i := 0; i < len(args); i += 2 {
		key := args[i]
		val := args[i + 1]
		err := HashSet(hash, key, val)
		if err != nil {
			return hash, err
		}
	}

	return hash, nil
}

func HashGet(hash SexpHash, key Sexp) (Sexp, error) {
	// this is kind of a hack
	// SexpEnd can't be created by user
	// so there is no way it would actually show up in the map
	val, err := HashGetDefault(hash, key, SexpEnd)

	if err != nil {
		return SexpNull, err
	}

	if val == SexpEnd {
		msg := fmt.Sprintf("key %s not found", key.SexpString())
		return SexpNull, errors.New(msg)
	}
	return val, nil
}

func HashGetDefault(hash SexpHash, key Sexp, defaultval Sexp) (Sexp, error) {
	hashval, err := HashExpression(key)
	if err != nil {
		return SexpNull, err
	}
	arr, ok := hash[hashval]

	if !ok {
		return defaultval, nil
	}

	for _, pair := range arr {
		res, err := Compare(pair.head, key)
		if err == nil && res == 0 {
			return pair.tail, nil
		}
	}
	return defaultval, nil
}

func HashSet(hash SexpHash, key Sexp, val Sexp) error {
	hashval, err := HashExpression(key)
	if err != nil {
		return err
	}
	arr, ok := hash[hashval]

	if !ok {
		hash[hashval] = []SexpPair{Cons(key, val)}
		return nil
	}

	found := false
	for i, pair := range arr {
		res, err := Compare(pair.head, key)
		if err == nil && res == 0 {
			arr[i] = Cons(key, val)
			found = true
		}
	}

	if !found {
		arr = append(arr, Cons(key, val))
	}
	hash[hashval] = arr

	return nil
}

func HashDelete(hash SexpHash, key Sexp) error {
	hashval, err := HashExpression(key)
	if err != nil {
		return err
	}
	arr, ok := hash[hashval]

	// if it doesn't exist, no need to delete it
	if !ok {
		return nil
	}

	for i, pair := range arr {
		res, err := Compare(pair.head, key)
		if err == nil && res == 0 {
			hash[hashval] = append(arr[0:i], arr[i+1:]...)
			break
		}
	}

	return nil
}

func HashCountKeys(hash SexpHash) int {
	var num int
	for _, arr := range hash {
		num += len(arr)
	}
	return num
}

func HashIsEmpty(hash SexpHash) bool {
	for _, arr := range hash {
		if len(arr) > 0 {
			return false
		}
	}
	return true
}


text:
package com.ameliant.tools.kafka.perftool.config;

/**
 * @author jkorab
 */
public class KeyAllocationStrategyDefinition {

    /**
     * How keys are allocated to each message.
     */
    private KeyAllocationType type;

    /**
     * How many unique keys are used.
     */
    private int uniqueKeys;

    // for Jackson
    public KeyAllocationStrategyDefinition() {}

    public KeyAllocationStrategyDefinition(KeyAllocationType type, int uniqueKeys) {
        this.type = type;
        this.uniqueKeys = uniqueKeys;
    }

    public KeyAllocationType getType() {
        return type;
    }

    public void setType(KeyAllocationType type) {
        this.type = type;
    }

    public int getUniqueKeys() {
        return uniqueKeys;
    }

    public void setUniqueKeys(int uniqueKeys) {
        this.uniqueKeys = uniqueKeys;
    }
}


text:
// ZipAddCommon.cpp

#include "StdAfx.h"

#include "../../../../C/7zCrc.h"
#include "../../../../C/Alloc.h"

#include "../../../Windows/PropVariant.h"

#include "../../ICoder.h"
#include "../../IPassword.h"
#include "../../MyVersion.h"

#include "../../Common/CreateCoder.h"
#include "../../Common/StreamObjects.h"
#include "../../Common/StreamUtils.h"

#include "../../Compress/LzmaEncoder.h"
#include "../../Compress/PpmdZip.h"

#include "../Common/InStreamWithCRC.h"

#include "ZipAddCommon.h"
#include "ZipHeader.h"

namespace NArchive {
namespace NZip {

static const CMethodId kMethodId_ZipBase   = 0x040100;
static const CMethodId kMethodId_BZip2     = 0x040202;

static const UInt32 kLzmaPropsSize = 5;
static const UInt32 kLzmaHeaderSize = 4 + kLzmaPropsSize;

class CLzmaEncoder:
  public ICompressCoder,
  public ICompressSetCoderProperties,
  public CMyUnknownImp
{
  NCompress::NLzma::CEncoder *EncoderSpec;
  CMyComPtr<ICompressCoder> Encoder;
  Byte Header[kLzmaHeaderSize];
public:
  STDMETHOD(Code)(ISequentialInStream *inStream, ISequentialOutStream *outStream,
      const UInt64 *inSize, const UInt64 *outSize, ICompressProgressInfo *progress);
  STDMETHOD(SetCoderProperties)(const PROPID *propIDs, const PROPVARIANT *props, UInt32 numProps);

  MY_UNKNOWN_IMP1(ICompressSetCoderProperties)
};

STDMETHODIMP CLzmaEncoder::SetCoderProperties(const PROPID *propIDs, const PROPVARIANT *props, UInt32 numProps)
{
  if (!Encoder)
  {
    EncoderSpec = new NCompress::NLzma::CEncoder;
    Encoder = EncoderSpec;
  }
  CBufPtrSeqOutStream *outStreamSpec = new CBufPtrSeqOutStream;
  CMyComPtr<ISequentialOutStream> outStream(outStreamSpec);
  outStreamSpec->Init(Header + 4, kLzmaPropsSize);
  RINOK(EncoderSpec->SetCoderProperties(propIDs, props, numProps));
  RINOK(EncoderSpec->WriteCoderProperties(outStream));
  if (outStreamSpec->GetPos() != kLzmaPropsSize)
    return E_FAIL;
  Header[0] = MY_VER_MAJOR;
  Header[1] = MY_VER_MINOR;
  Header[2] = kLzmaPropsSize;
  Header[3] = 0;
  return S_OK;
}

STDMETHODIMP CLzmaEncoder::Code(ISequentialInStream *inStream, ISequentialOutStream *outStream,
    const UInt64 *inSize, const UInt64 *outSize, ICompressProgressInfo *progress)
{
  RINOK(WriteStream(outStream, Header, kLzmaHeaderSize));
  return Encoder->Code(inStream, outStream, inSize, outSize, progress);
}

CAddCommon::CAddCommon(const CCompressionMethodMode &options):
    _options(options),
    _copyCoderSpec(NULL),
    _cryptoStreamSpec(NULL),
    _buf(NULL)
    {}

CAddCommon::~CAddCommon()
{
  MidFree(_buf);
}

static const UInt32 kBufSize = ((UInt32)1 << 16);

HRESULT CAddCommon::CalcStreamCRC(ISequentialInStream *inStream, UInt32 &resultCRC)
{
  if (!_buf)
  {
    _buf = (Byte *)MidAlloc(kBufSize);
    if (!_buf)
      return E_OUTOFMEMORY;
  }

  UInt32 crc = CRC_INIT_VAL;
  for (;;)
  {
    UInt32 processed;
    RINOK(inStream->Read(_buf, kBufSize, &processed));
    if (processed == 0)
    {
      resultCRC = CRC_GET_DIGEST(crc);
      return S_OK;
    }
    crc = CrcUpdate(crc, _buf, (size_t)processed);
  }
}

HRESULT CAddCommon::Compress(
    DECL_EXTERNAL_CODECS_LOC_VARS
    ISequentialInStream *inStream, IOutStream *outStream,
    UInt32 /* fileTime */,
    ICompressProgressInfo *progress, CCompressingResult &opRes)
{
  if (!inStream)
  {
    // We can create empty stream here. But it was already implemented in caller code in 9.33+
    return E_INVALIDARG;
  }

  // CSequentialInStreamWithCRC *inSecCrcStreamSpec = NULL;
  CInStreamWithCRC *inCrcStreamSpec = NULL;
  CMyComPtr<ISequentialInStream> inCrcStream;
  {
    CMyComPtr<IInStream> inStream2;

    inStream->QueryInterface(IID_IInStream, (void **)&inStream2);

    if (inStream2)
    {
      inCrcStreamSpec = new CInStreamWithCRC;
      inCrcStream = inCrcStreamSpec;
      inCrcStreamSpec->SetStream(inStream2);
      inCrcStreamSpec->Init();
    }
    else
    {
      // we don't support stdin, since stream from stdin can require 64-bit size header
      return E_NOTIMPL;
      /*
      inSecCrcStreamSpec = new CSequentialInStreamWithCRC;
      inCrcStream = inSecCrcStreamSpec;
      inSecCrcStreamSpec->SetStream(inStream);
      inSecCrcStreamSpec->Init();
      */
    }
  }

  unsigned numTestMethods = _options.MethodSequence.Size();

  if (numTestMethods > 1 && !inCrcStreamSpec)
    numTestMethods = 1;

  UInt32 crc = 0;
  bool crc_IsCalculated = false;

  Byte method = 0;
  CFilterCoder::C_OutStream_Releaser outStreamReleaser;
  opRes.ExtractVersion = NFileHeader::NCompressionMethod::kExtractVersion_Default;
  opRes.FileTimeWasUsed = false;

  for (unsigned i = 0; i < numTestMethods; i++)
  {
    opRes.ExtractVersion = NFileHeader::NCompressionMethod::kExtractVersion_Default;
    if (inCrcStreamSpec)
      RINOK(inCrcStreamSpec->Seek(0, STREAM_SEEK_SET, NULL));
    RINOK(outStream->SetSize(0));
    RINOK(outStream->Seek(0, STREAM_SEEK_SET, NULL));

    if (_options.PasswordIsDefined)
    {
      opRes.ExtractVersion = NFileHeader::NCompressionMethod::kExtractVersion_ZipCrypto;

      if (!_cryptoStream)
      {
        _cryptoStreamSpec = new CFilterCoder(true);
        _cryptoStream = _cryptoStreamSpec;
      }

      if (_options.IsAesMode)
      {
        opRes.ExtractVersion = NFileHeader::NCompressionMethod::kExtractVersion_Aes;
        if (!_cryptoStreamSpec->Filter)
        {
          _cryptoStreamSpec->Filter = _filterAesSpec = new NCrypto::NWzAes::CEncoder;
          _filterAesSpec->SetKeyMode(_options.AesKeyMode);
          RINOK(_filterAesSpec->CryptoSetPassword((const Byte *)(const char *)_options.Password, _options.Password.Len()));
        }
        RINOK(_filterAesSpec->WriteHeader(outStream));
      }
      else
      {
        if (!_cryptoStreamSpec->Filter)
        {
          _cryptoStreamSpec->Filter = _filterSpec = new NCrypto::NZip::CEncoder;
          _filterSpec->CryptoSetPassword((const Byte *)(const char *)_options.Password, _options.Password.Len());
        }

        UInt32 check;

        // if (inCrcStreamSpec)
        {
          if (!crc_IsCalculated)
          {
            RINOK(CalcStreamCRC(inStream, crc));
            crc_IsCalculated = true;
            RINOK(inCrcStreamSpec->Seek(0, STREAM_SEEK_SET, NULL));
          }
          check = (crc >> 16);
        }
        /*
        else
        {
          opRes.FileTimeWasUsed = true;
          check = (fileTime & 0xFFFF);
        }
        */

        RINOK(_filterSpec->WriteHeader_Check16(outStream, (UInt16)check));
      }

      RINOK(_cryptoStreamSpec->SetOutStream(outStream));
      RINOK(_cryptoStreamSpec->InitEncoder());
      outStreamReleaser.FilterCoder = _cryptoStreamSpec;
    }

    method = _options.MethodSequence[i];

    switch (method)
    {
      case NFileHeader::NCompressionMethod::kStored:
      {
        if (_copyCoderSpec == NULL)
        {
          _copyCoderSpec = new NCompress::CCopyCoder;
          _copyCoder = _copyCoderSpec;
        }
        CMyComPtr<ISequentialOutStream> outStreamNew;
        if (_options.PasswordIsDefined)
          outStreamNew = _cryptoStream;
        else
          outStreamNew = outStream;
        RINOK(_copyCoder->Code(inCrcStream, outStreamNew, NULL, NULL, progress));
        break;
      }

      default:
      {
        if (!_compressEncoder)
        {
          if (method == NFileHeader::NCompressionMethod::kLZMA)
          {
            _compressExtractVersion = NFileHeader::NCompressionMethod::kExtractVersion_LZMA;
            CLzmaEncoder *_lzmaEncoder = new CLzmaEncoder();
            _compressEncoder = _lzmaEncoder;
          }
          else if (method == NFileHeader::NCompressionMethod::kPPMd)
          {
            _compressExtractVersion = NFileHeader::NCompressionMethod::kExtractVersion_PPMd;
            NCompress::NPpmdZip::CEncoder *encoder = new NCompress::NPpmdZip::CEncoder();
            _compressEncoder = encoder;
          }
          else
          {
          CMethodId methodId;
          switch (method)
          {
            case NFileHeader::NCompressionMethod::kBZip2:
              methodId = kMethodId_BZip2;
              _compressExtractVersion = NFileHeader::NCompressionMethod::kExtractVersion_BZip2;
              break;
            default:
              _compressExtractVersion = ((method == NFileHeader::NCompressionMethod::kDeflated64) ?
                  NFileHeader::NCompressionMethod::kExtractVersion_Deflate64 :
                  NFileHeader::NCompressionMethod::kExtractVersion_Deflate);
              methodId = kMethodId_ZipBase + method;
              break;
          }
          RINOK(CreateCoder(
              EXTERNAL_CODECS_LOC_VARS
              methodId, true, _compressEncoder));
          if (!_compressEncoder)
            return E_NOTIMPL;

          if (method == NFileHeader::NCompressionMethod::kDeflated ||
              method == NFileHeader::NCompressionMethod::kDeflated64)
          {
          }
          else if (method == NFileHeader::NCompressionMethod::kBZip2)
          {
          }
          }
          {
            CMyComPtr<ICompressSetCoderProperties> setCoderProps;
            _compressEncoder.QueryInterface(IID_ICompressSetCoderProperties, &setCoderProps);
            if (setCoderProps)
            {
              RINOK(_options.MethodInfo.SetCoderProps(setCoderProps,
                  _options._dataSizeReduceDefined ? &_options._dataSizeReduce : NULL));
            }
          }
        }
        CMyComPtr<ISequentialOutStream> outStreamNew;
        if (_options.PasswordIsDefined)
          outStreamNew = _cryptoStream;
        else
          outStreamNew = outStream;
        if (_compressExtractVersion > opRes.ExtractVersion)
          opRes.ExtractVersion = _compressExtractVersion;
        RINOK(_compressEncoder->Code(inCrcStream, outStreamNew, NULL, NULL, progress));
        break;
      }
    }

    if (_options.PasswordIsDefined)
    {
      RINOK(_cryptoStreamSpec->OutStreamFinish());

      if (_options.IsAesMode)
      {
        RINOK(_filterAesSpec->WriteFooter(outStream));
      }
    }

    RINOK(outStream->Seek(0, STREAM_SEEK_CUR, &opRes.PackSize));

    // if (inCrcStreamSpec)
    {
      opRes.CRC = inCrcStreamSpec->GetCRC();
      opRes.UnpackSize = inCrcStreamSpec->GetSize();
    }
    /*
    else
    {
      opRes.CRC = inSecCrcStreamSpec->GetCRC();
      opRes.UnpackSize = inSecCrcStreamSpec->GetSize();
    }
    */

    if (_options.PasswordIsDefined)
    {
      if (opRes.PackSize < opRes.UnpackSize +
          (_options.IsAesMode ? _filterAesSpec->GetAddPackSize() : NCrypto::NZip::kHeaderSize))
        break;
    }
    else if (opRes.PackSize < opRes.UnpackSize)
      break;
  }

  opRes.Method = method;
  return S_OK;
}

}}


text:
// # Populate
// Create a brand new database for a new install of ghost
var Promise = require('bluebird'),
    commands = require('../schema').commands,
    fixtures = require('./fixtures'),
    errors = require('../../errors'),
    schema = require('../schema').tables,
    schemaTables = Object.keys(schema),
    populate, logger;

// @TODO: remove me asap!
logger = {
    info: function info(message) {
        errors.logComponentInfo('Migrations', message);
    },
    warn: function warn(message) {
        errors.logComponentWarn('Skipping Migrations', message);
    }
};

/**
 * ## Populate
 * Uses the schema to determine table structures, and automatically creates each table in order
 */
populate = function populate(options) {
    options = options || {};

    var tablesOnly = options.tablesOnly,
        modelOptions = {
            context: {
                internal: true
            }
        },
        tableSequence = Promise.mapSeries(schemaTables, function createTable(table) {
            logger.info('Creating table: ' + table);
            return commands.createTable(table);
        });

    logger.info('Creating tables...');

    if (tablesOnly) {
        return tableSequence;
    }

    return tableSequence.then(function () {
        return fixtures.populate(logger, modelOptions);
    });
};

module.exports = populate;


text:
<?php

namespace ZendTest\Test\PHPUnit\Controller;

use Zend\Router\RouteMatch;
use Zend\Test\PHPUnit\Controller\AbstractConsoleControllerTestCase;

/**
 * @group      Zend_Test
 */
class AbstractConsoleControllerTestCaseTest extends AbstractConsoleControllerTestCase
{
    protected function setUp()
    {
        $this->setApplicationConfig(
            include __DIR__ . '/../../_files/application.config.php'
        );
        parent::setUp();
    }

    public function testUseOfRouter()
    {
        $this->assertEquals(true, $this->useConsoleRequest);
    }

    public function testAssertResponseStatusCode()
    {
        $this->dispatch('--console');
        $this->assertResponseStatusCode(0);

        $this->setExpectedException(
            'PHPUnit_Framework_ExpectationFailedException',
            'actual status code is "0"' // check actual status code is display
        );
        $this->assertResponseStatusCode(1);
    }

    public function testAssertNotResponseStatusCode()
    {
        $this->dispatch('--console');
        $this->assertNotResponseStatusCode(1);

        $this->setExpectedException('PHPUnit_Framework_ExpectationFailedException');
        $this->assertNotResponseStatusCode(0);
    }

    public function testAssertResponseStatusCodeWithBadCode()
    {
        $this->dispatch('--console');
        $this->setExpectedException(
            'PHPUnit_Framework_ExpectationFailedException',
            'Console status code assert value must be O (valid) or 1 (error)'
        );
        $this->assertResponseStatusCode(2);
    }

    public function testAssertNotResponseStatusCodeWithBadCode()
    {
        $this->dispatch('--console');
        $this->setExpectedException(
            'PHPUnit_Framework_ExpectationFailedException',
            'Console status code assert value must be O (valid) or 1 (error)'
        );
        $this->assertNotResponseStatusCode(2);
    }

    public function testAssertConsoleOutputContains()
    {
        $this->dispatch('--console');
        $this->assertConsoleOutputContains('foo');
        $this->assertConsoleOutputContains('foo, bar');

        $this->setExpectedException(
            'PHPUnit_Framework_ExpectationFailedException',
            'actual content is "foo, bar"' // check actual content is display
        );
        $this->assertConsoleOutputContains('baz');
    }

    public function testNotAssertConsoleOutputContains()
    {
        $this->dispatch('--console');
        $this->assertNotConsoleOutputContains('baz');

        $this->setExpectedException('PHPUnit_Framework_ExpectationFailedException');
        $this->assertNotConsoleOutputContains('foo');
    }

    public function testAssertMatchedArgumentsWithValue()
    {
        $this->dispatch('filter --date="2013-03-07 00:00:00" --id=10 --text="custom text"');
        $routeMatch = $this->getApplication()->getMvcEvent()->getRouteMatch();
        $this->assertInstanceOf(RouteMatch::class, $routeMatch, 'Did not receive a route match?');
        $this->assertEquals("2013-03-07 00:00:00", $routeMatch->getParam('date'));
        $this->assertEquals("10", $routeMatch->getParam('id'));
        $this->assertEquals("custom text", $routeMatch->getParam('text'));
    }

    /**
     * @group 6837
     */
    public function testAssertMatchedArgumentsWithMandatoryValue()
    {
        $this->dispatch("foo --bar='FOO' --baz='ARE'");
        /** @var \Zend\Mvc\Router\Console\RouteMatch $routeMatch */
        $routeMatch = $this->getApplication()->getMvcEvent()->getRouteMatch();
        $this->assertNotNull($routeMatch);
        $this->assertEquals('arguments-mandatory', $routeMatch->getMatchedRouteName());

        $this->reset();

        $this->dispatch('foo --bar="FOO" --baz="ARE"');
        /** @var \Zend\Mvc\Router\Console\RouteMatch $routeMatch */
        $routeMatch = $this->getApplication()->getMvcEvent()->getRouteMatch();
        $this->assertNotNull($routeMatch);
        $this->assertEquals('arguments-mandatory', $routeMatch->getMatchedRouteName());
    }

    public function testAssertMatchedArgumentsWithValueWithoutEqualsSign()
    {
        $this->dispatch('filter --date "2013-03-07 00:00:00" --id=10 --text="custom text"');
        $routeMatch = $this->getApplication()->getMvcEvent()->getRouteMatch();
        $this->assertInstanceOf(RouteMatch::class, $routeMatch, 'Did not receive a route match?');
        $this->assertEquals("2013-03-07 00:00:00", $routeMatch->getParam('date'));
        $this->assertEquals("10", $routeMatch->getParam('id'));
        $this->assertEquals("custom text", $routeMatch->getParam('text'));
    }

    public function testAssertMatchedArgumentsWithLiteralFlags()
    {
        $this->dispatch('literal --foo --bar');
        $routeMatch = $this->getApplication()->getMvcEvent()->getRouteMatch();
        $this->assertInstanceOf(RouteMatch::class, $routeMatch, 'Did not receive a route match?');
        $this->assertMatchedRouteName('arguments-literal');
        $this->assertTrue($routeMatch->getParam('foo'));
        $this->assertTrue($routeMatch->getParam('bar'));
        $this->assertFalse($routeMatch->getParam('optional'));
        $this->assertNull($routeMatch->getParam('doo'));

        $this->reset();

        $this->dispatch('literal --foo --bar --doo test');
        $routeMatch = $this->getApplication()->getMvcEvent()->getRouteMatch();
        $this->assertInstanceOf(RouteMatch::class, $routeMatch, 'Did not receive a route match?');
        $this->assertMatchedRouteName('arguments-literal');
        $this->assertTrue($routeMatch->getParam('foo'));
        $this->assertTrue($routeMatch->getParam('bar'));
        $this->assertFalse($routeMatch->getParam('optional'));
        $this->assertSame('test', $routeMatch->getParam('doo'));
    }
}


text:
using Newtonsoft.Json;
using System;
using System.Collections.Generic;

namespace DaaSDemo.KubeClient.Models
{
    /// <summary>
    ///     SelfSubjectAccessReviewSpec is a description of the access request.  Exactly one of ResourceAuthorizationAttributes and NonResourceAuthorizationAttributes must be set
    /// </summary>
    public class SelfSubjectAccessReviewSpecV1
    {
        /// <summary>
        ///     NonResourceAttributes describes information for a non-resource access request
        /// </summary>
        [JsonProperty("nonResourceAttributes")]
        public NonResourceAttributesV1 NonResourceAttributes { get; set; }

        /// <summary>
        ///     ResourceAuthorizationAttributes describes information for a resource access request
        /// </summary>
        [JsonProperty("resourceAttributes")]
        public ResourceAttributesV1 ResourceAttributes { get; set; }
    }
}


text:
package com.jacksen.mvpdemo.util;

/**
 * Created by Admin on 2016/4/21.
 */
public class Constants {

    /**
     * http://apis.baidu.com/heweather/weather/free 接口需要的key
     */
    public static final String API_KEY = "48b0fc4c8047a43a9da5d5c1f65df2e9";

    /**
     * 查询天气接口
     */
    public static final String API_URL = "http://apis.baidu.com/heweather/weather/free";

    public static final String SuperJsonObject = "HeWeather data service 3.0";
}


text:
class OverlayPresenter;
class WebStateList;
@protocol BrowserContainerConsumer;

// Mediator that updates a BrowserContainerConsumer
@interface BrowserContainerMediator : NSObject

// Initializer for a mediator.  `webStateList` is the WebStateList for the
// Browser whose content is shown within the BrowserContainerConsumer.
// `overlayPresenter` is the OverlayModality::kWebContentArea OverlayPresenter.
// Both `webSateList` and `overlaPresenter` must be non-null.
- (instancetype)initWithWebStateList:(WebStateList*)webStateList
      webContentAreaOverlayPresenter:(OverlayPresenter*)overlayPresenter
    NS_DESIGNATED_INITIALIZER;
- (instancetype)init NS_UNAVAILABLE;

// The consumer.  Setting to a new value configures the new consumer.
@property(nonatomic, strong) id<BrowserContainerConsumer> consumer;

@end

#endif  // IOS_CHROME_BROWSER_UI_BROWSER_CONTAINER_BROWSER_CONTAINER_MEDIATOR_H_


text:
class SinkFundAllocationSerializer < ActiveModel::Serializer
  type 'sink_fund_allocation'

  attributes :id, :name, :amount, :bank_account_id, :comment, :spent, :remaining, :status,
              # new attributes
             :target, :current_balance, :difference

end


text:
#ifndef AGENT_BASED_EPIDEMIC_SIM_CORE_INTEGRAL_TYPES_H_
#define AGENT_BASED_EPIDEMIC_SIM_CORE_INTEGRAL_TYPES_H_

// TODO: <sys/types.h> is not portable C. Take a close look at this when we add
// mobile support.
#include <sys/types.h>

#include <cstdint>

typedef signed char schar;
typedef int8_t int8;
typedef int16_t int16;
typedef int32_t int32;
typedef int64_t int64;

typedef uint8_t uint8;
typedef uint16_t uint16;
typedef uint32_t uint32;
typedef uint64_t uint64;

typedef signed int char32;
typedef unsigned long uword_t;

#define GG_LONGLONG(x) x##LL
#define GG_ULONGLONG(x) x##ULL
#define GG_LL_FORMAT "ll"  // As in "%lld". Note that "q" is poor form also.
#define GG_LL_FORMAT_W L"ll"

const uint8 kuint8max{0xFF};
const uint16 kuint16max{0xFFFF};
const uint32 kuint32max{0xFFFFFFFF};
const uint64 kuint64max{GG_ULONGLONG(0xFFFFFFFFFFFFFFFF)};
const int8 kint8min{~0x7F};
const int8 kint8max{0x7F};
const int16 kint16min{~0x7FFF};
const int16 kint16max{0x7FFF};
const int32 kint32min{~0x7FFFFFFF};
const int32 kint32max{0x7FFFFFFF};
const int64 kint64min{GG_LONGLONG(~0x7FFFFFFFFFFFFFFF)};
const int64 kint64max{GG_LONGLONG(0x7FFFFFFFFFFFFFFF)};

typedef uint64 Fprint;
static const Fprint kIllegalFprint = 0;
static const Fprint kMaxFprint = GG_ULONGLONG(0xFFFFFFFFFFFFFFFF);

#endif  // AGENT_BASED_EPIDEMIC_SIM_CORE_INTEGRAL_TYPES_H_


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
    <title>Statistics of VerbForm in UD_Akkadian-RIAO</title>
    <link rel="root" href=""/>
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css">
    <link rel="stylesheet" type="text/css" href="../../css/jquery-ui-redmond.css"/>
    <link rel="stylesheet" type="text/css" href="../../css/style.css"/>
    <link rel="stylesheet" type="text/css" href="../../css/style-vis.css"/>
    <link rel="stylesheet" type="text/css" href="../../css/hint.css"/>

          home

          edit page
          issue tracker

          <gcse:search></gcse:search>

        This page pertains to UD version 2.

            It appears that you have Javascript disabled.
            Please consider enabling Javascript for this page to see the visualizations.

Treebank Statistics: UD_Akkadian-RIAO: Features: VerbForm

This feature is universal but the values Stat are language-specific.
It occurs with 3 different values: Fin, Inf, Stat.

3137 tokens (14%) have a non-empty value of VerbForm.
683 types (23%) occur at least once with a non-empty value of VerbForm.
236 lemmas (15%) occur at least once with a non-empty value of VerbForm.
The feature is used with 3 part-of-speech tags: <tt>VERB</tt> (3080; 13% instances), <tt>ADJ</tt> (30; 0% instances), <tt>NOUN</tt> (27; 0% instances).

VERB

3080 <tt>VERB</tt> tokens (100% of all VERB tokens) have a non-empty value of VerbForm.

The most frequent other feature values with which VERB and VerbForm co-occurred: <tt>Number</tt><tt>=Sing</tt> (2774; 90%), <tt>Subordinative</tt><tt>=EMPTY</tt> (2736; 89%), <tt>Mood</tt><tt>=Ind</tt> (2636; 86%), <tt>Tense</tt><tt>=Past</tt> (2513; 82%), <tt>VerbStem</tt><tt>=G</tt> (2225; 72%), <tt>Gender</tt><tt>=Com</tt> (1992; 65%), <tt>Person</tt><tt>=1</tt> (1992; 65%).

VERB tokens may have the following values of VerbForm:

Fin (2777; 90% of non-empty VerbForm): attumuš, akšud, adūk, assakan, aqqur, amhur, appul, aqṭirib, aṣbat, arṣip

Inf (105; 3% of non-empty VerbForm): šūzub, epēš, arāk, šumʾud, uppušu, pêli, šuknuše, hulluq, napāhi, šapāri

Stat (198; 6% of non-empty VerbForm): bēde, bēdāk, šaknū, ṣali, usbakūni, šaknu, bašû, labi, dān, ṣabtat

EMPTY (14): x, i-x-x-lu, ušatmih, uṭabbi, u₂-x-x-x

ADJ

30 <tt>ADJ</tt> tokens (3% of all ADJ tokens) have a non-empty value of VerbForm.

The most frequent other feature values with which ADJ and VerbForm co-occurred: <tt>Case</tt><tt>=EMPTY</tt> (30; 100%), <tt>Gender</tt><tt>=Com</tt> (30; 100%), <tt>Number</tt><tt>=Sing</tt> (30; 100%).

ADJ tokens may have the following values of VerbForm:

Stat (30; 100% of non-empty VerbForm): ašarēdāku, kabtāku, šurruhāku, ṣīrāku, nâdāku, gešrāku, šitmurāku, ašṭāku, dandannāku, dannāku

EMPTY (893): dannu, rabû, rabûti, rabê, danni, dannūte, dannūti, rapšāte, arkû, qardu

VerbForm seems to be lexical feature of ADJ. 100% lemmas (13) occur only with one value of VerbForm.

NOUN

27 <tt>NOUN</tt> tokens (0% of all NOUN tokens) have a non-empty value of VerbForm.

The most frequent other feature values with which NOUN and VerbForm co-occurred: <tt>Case</tt><tt>=EMPTY</tt> (27; 100%), <tt>Gender</tt><tt>=Com</tt> (27; 100%), <tt>NounBase</tt><tt>=EMPTY</tt> (27; 100%), <tt>Number</tt><tt>=Sing</tt> (27; 100%).

NOUN tokens may have the following values of VerbForm:

Stat (27; 100% of non-empty VerbForm): labbāku, qarrādāku, zikarāku, bēlāku, uršānāku, šarrāku

EMPTY (8702): šar, māt, mār, kiššati, šarru, ālāni, libbi, maddattu, ummānāti, ilāni

Relations with Agreement in VerbForm

The 10 most frequent relations where parent and child node agree in VerbForm:
<tt>VERB –[<tt>conj</tt>]–> VERB</tt> (968; 91%),
<tt>VERB –[<tt>xcomp</tt>]–> VERB</tt> (47; 100%),
<tt>NOUN –[<tt>conj</tt>]–> ADJ</tt> (30; 100%),
<tt>NOUN –[<tt>conj</tt>]–> NOUN</tt> (22; 100%),
<tt>VERB –[<tt>parataxis</tt>]–> VERB</tt> (15; 79%),
<tt>VERB –[<tt>nmod:poss</tt>]–> VERB</tt> (1; 100%).

© 2014–2021
            Universal Dependencies contributors.
            Site powered by Annodoc and brat
.


text:
Build form from specific params and custom validation

## Installation

Add this line to your application's Gemfile:

```ruby
gem 'light_form'
```

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install light_form

## How it works
Build form from specific params and custom validation:

```ruby
class Address
  include ActiveModel::Model
  attr_accessor :street, :post_code
end

class Child
  include ActiveModel::Model
  attr_accessor :name, :age
end

class PersonForm < LightForm::Form
  properties :title, :first_name, :last_name
  property :email, validates: { presence: true }
  property :age, with: -> (v) { v.to_i }

  property :address, model: Address do
    properties :street, :post_code
  end

  property :children, collection: Child, uniq: true do
    property :name, validates: { presence: true }
    property :age, with: -> (v) { v.to_i }
  end

  property :interests, collection: true, uniq: true
end

person = PersonForm.new(
  {
    title: 'Mr', first_name: 'Pawel', last_name: 'Awesome', email: nil,
    age: '31', address: { street: 'Best', post_code: '33333' },
    children: [ {name: 'Emi', age: '2'}, {name: 'Emi', age: '2'}, {age: '2'} ],
    interests: [ 'football', 'football', 'basketball', 'football' ]
  }
)

person.valid? == false

person.errors.as_json == {
  children: [{1=>{name: ["can't be blank"]}}],
  email: ["can't be blank"]
}

person.to_h == {
  title: 'Mr',
  first_name: 'Pawel',
  last_name: 'Awesome',
  email: nil,
  age: 31,
  address: <AddressModel:0x007faf0ba22238 @street='Best', @post_code='33333'>,
  children: [<ChildModel:0x007faf0ba21ec8 @name='Emi', @age=2>, <ChildModel:0x007faf0ba21c70 @name='', @age=2>],
  interests: ['football', 'basketball']
}
```

## Contributing

1. Fork it ( https://github.com/[my-github-username]/light_form/fork )
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create a new Pull Request


text:
package com.jhello.db.result;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 返回ArrayList<HashMap<字段,值>>
 * @author huangy
 * @date   2013-4-12
 */
public class ListMapResultProcessor implements IResultProcessor {

	/**
	 * @see cn.hy.db.result.IResultProcessor#getResult(java.sql.ResultSet)
	 * @param rs
	 * @return
	 * @throws SQLException
	 * @author huangy
	 * @date 2013-4-12 上午11:05:34
	 */
	public List<Map<String,Object>> getResult(ResultSet rs) throws SQLException{
		List<Map<String,Object>> result=new ArrayList<Map<String,Object>>();
		if(rs!=null){
			while(rs.next()){
				Map<String,Object> map=new HashMap<String, Object>();
				for(int i=1;i<=rs.getMetaData().getColumnCount();i++){
					//获取的是字段别名,如果是select name as username from user这样的,返回的结果是是获取username
					String columnName=rs.getMetaData().getColumnLabel(i);
					map.put(columnName, rs.getObject(i));
				}
				result.add(map);
			}
		}
		return result;
	}
}


text:
ichmod -rM own hsuserproxy /hydroshareuserZone/home/$1
ils /hydroshareuserZone/home/$1 | rev | cut -d '/' -f 1 | rev | sed '1d' > resource_list
while read line; do irm -rf /hydroshareuserZone/home/$1/$line; done < <(cat resource_list)

iadmin rmuser $1

exit 0;


text:
Adds HTML5 input types and some WYSIWYG features to admin forms and product attributes

## Introduction
Form Elements currently adds support for the following [HTML5 input types](http://html5doctor.com/html5-forms-input-types/):

- `color`
- `email`
- `number`
- `url`

Additionally there are two complex types, `mediaurl` and `widget`.  These function like inline versions of the "Insert Image" and "Insert Widget" buttons on CMS pages.

## Installation
For modman enter:

    modman clone https://github.com/clockworkgeek/formelements

For composer enter:

    composer config repositories.firegento composer http://packages.firegento.com
    composer require clockworkgeek/formelements

For [Magento Connect](http://www.magentocommerce.com/magento-connect/html5-form-elements.html) use the key:

    http://connect20.magentocommerce.com/community/Clockworkgeek_Formelements

## Instructions
Please visit the wiki for documentation:

> https://github.com/clockworkgeek/formelements/wiki


text:
<#
    Purpose:
        Verify Format-Hex displays the Hexadecimal value for the input data.

    Action:
        Run Format-Hex.

    Expected Result:
        Hexadecimal equivalent of the input data is displayed.
#>

Describe "FormatHex" -tags "CI" {

    BeforeAll {

        $newline = [Environment]::Newline

        Setup -d FormatHexDataDir
        $inputText1 = 'Hello World'
        $inputText2 = 'More text'
        $inputText3 = 'Literal path'
        $inputText4 = 'Now is the winter of our discontent'
        $inputFile1 = setup -f "FormatHexDataDir/SourceFile-1.txt" -content $inputText1 -pass
        $inputFile2 = setup -f "FormatHexDataDir/SourceFile-2.txt" -content $inputText2 -pass
        $inputFile3 = setup -f "FormatHexDataDir/SourceFile literal [3].txt" -content $inputText3 -pass
        $inputFile4 = setup -f "FormatHexDataDir/SourceFile-4.txt" -content $inputText4 -pass

        $certificateProvider = Get-ChildItem Cert:\CurrentUser\My\ -ErrorAction SilentlyContinue
        $thumbprint = $null
        $certProviderAvailable = $false

        if ($certificateProvider.Count -gt 0)
        {
            $thumbprint = $certificateProvider[0].Thumbprint
            $certProviderAvailable = $true
        }

        $skipTest = ([System.Management.Automation.Platform]::IsLinux -or [System.Management.Automation.Platform]::IsMacOS -or (-not $certProviderAvailable))
    }

    Context "InputObject Paramater" {
        $testCases = @(
            @{
                Name = "Can process byte type 'fhx -InputObject [byte]5'"
                InputObject = [byte]5
                Count = 1
                ExpectedResult = "00000000   05"
            }
            @{
                Name = "Can process byte[] type 'fhx -InputObject [byte[]](1,2,3,4,5)'"
                InputObject = [byte[]](1,2,3,4,5)
                Count = 1
                ExpectedResult = "00000000   01 02 03 04 05                                   ....."
            }
            @{
                Name = "Can process int type 'fhx -InputObject 7'"
                InputObject = 7
                Count = 1
                ExpectedResult = "00000000   07 00 00 00                                      ...."
            }
            @{
                Name = "Can process int[] type 'fhx -InputObject [int[]](5,6,7,8)'"
                InputObject = [int[]](5,6,7,8)
                Count = 1
                ExpectedResult = "00000000   05 00 00 00 06 00 00 00 07 00 00 00 08 00 00 00  ................"
            }
            @{
                Name = "Can process int32 type 'fhx -InputObject [int32]2032'"
                InputObject = [int32]2032
                Count = 1
                ExpectedResult = "00000000   F0 07 00 00                                      ð..."
            }
            @{
                Name = "Can process int32[] type 'fhx -InputObject [int32[]](2032, 2033, 2034)'"
                InputObject = [int32[]](2032, 2033, 2034)
                Count = 1
                ExpectedResult = "00000000000000000000   F0 07 00 00 F1 07 00 00 F2 07 00 00              ð...ñ...ò..."
            }
            @{
                Name = "Can process Int64 type 'fhx -InputObject [Int64]9223372036854775807'"
                InputObject = [Int64]9223372036854775807
                Count = 1
                ExpectedResult = "00000000000000000000   FF FF FF FF FF FF FF 7F                          ......."
            }
            @{
                Name = "Can process Int64[] type 'fhx -InputObject [Int64[]](9223372036852,9223372036853)'"
                InputObject = [Int64[]](9223372036852,9223372036853)
                Count = 1
                ExpectedResult = "00000000000000000000   F4 5A D0 7B 63 08 00 00 F5 5A D0 7B 63 08 00 00  ôZÐ{c...õZÐ{c..."
            }
            @{
                Name = "Can process string type 'fhx -InputObject hello world'"
                InputObject = "hello world"
                Count = 1
                ExpectedResult = "00000000000000000000   68 65 6C 6C 6F 20 77 6F 72 6C 64                 hello world"
            }
            @{
                Name = "Can process enum type 'fhx -InputObject ([DisplayHintType]::DateTime)'"
                InputObject = [Microsoft.PowerShell.Commands.DisplayHintType]::DateTime
                Count = 1
                ExpectedResult = "00000000000000000000   02 00 00 00                                      ...."
            }
            @{
                Name = "Can process DisplayHintType[] type 'fhx -InputObject ([DisplayHintType[]](DateTime, Time))'"
                InputObject = [Microsoft.PowerShell.Commands.DisplayHintType[]]([Microsoft.PowerShell.Commands.DisplayHintType]::DateTime)
                Count = 1
                ExpectedResult = "00000000000000000000   02 00 00 00                                      ...."
            }
            @{
                Name = "Can process DisplayHintType[] type 'fhx -InputObject ([DisplayHintType[]](DateTime, Time))'"
                InputObject = [Microsoft.PowerShell.Commands.DisplayHintType[]]([Microsoft.PowerShell.Commands.DisplayHintType]::DateTime, [Microsoft.PowerShell.Commands.DisplayHintType]::Time)
                Count = 1
                ExpectedResult = "00000000000000000000   02 00 00 00 01 00 00 00                          ........"
            }
            @{
                Name = "Can process char type 'fhx -InputObject ([char]`'A`')'"
                InputObject = [char]'A'
                Count = 1
                ExpectedResult = "00000000000000000000   41                                               A"
            }
            @{
                Name = "Can process char[] type 'fhx -InputObject ([char[]](`'A`'))'"
                InputObject = [char[]]('A')
                Count = 1
                ExpectedResult = "00000000000000000000   41                                               A"
            }
            @{
                Name = "Can process char[] type 'fhx -InputObject ([char[]](`'A`', 'B'))'"
                InputObject = [char[]]('A', 'B')
                Count = 1
                ExpectedResult = "00000000000000000000   41 42                                            AB"
            }
        )

        It "<Name>" -TestCase $testCases{

            param ($Name, $InputObject, $Count, $ExpectedResult)

            $result = Format-Hex -InputObject $InputObject

            $result.count | Should -Be $Count
            $result | Should -BeOfType 'Microsoft.PowerShell.Commands.ByteCollection'
            $result.ToString() | Should -MatchExactly $ExpectedResult
        }
    }

    Context "InputObject From Pipeline" {
        $testCases = @(
            @{
                Name = "Can process byte type '[byte]5 | fhx'"
                InputObject = [byte]5
                Count = 1
                ExpectedResult = "00000000000000000000   05"
            }
            @{
                Name = "Can process byte[] type '[byte[]](1,2) | fhx'"
                InputObject = [byte[]](1,2)
                Count = 2
                ExpectedResult = "00000000000000000000   01                                               ."
                ExpectedSecondResult = "00000000000000000000   02                                               ."
            }
            @{
                Name = "Can process int type '7 | fhx'"
                InputObject = 7
                Count = 1
                ExpectedResult = "00000000000000000000   07 00 00 00                                      ...."
            }
            @{
                Name = "Can process int[] type '[int[]](5,6) | fhx'"
                InputObject = [int[]](5,6)
                Count = 2
                ExpectedResult = "00000000000000000000   05 00 00 00                                      ...."
                ExpectedSecondResult = "00000000000000000000   06 00 00 00                                      ...."
            }
            @{
                Name = "Can process int32 type '[int32]2032 | fhx'"
                InputObject = [int32]2032
                Count = 1
                ExpectedResult = "00000000000000000000   F0 07 00 00                                      ð..."
            }
            @{
                Name = "Can process int32[] type '[int32[]](2032, 2033) | fhx'"
                InputObject = [int32[]](2032, 2033)
                Count = 2
                ExpectedResult = "00000000000000000000   F0 07 00 00                                      ð..."
                ExpectedSecondResult = "00000000000000000000   F1 07 00 00                                      ñ..."
            }
            @{
                Name = "Can process Int64 type '[Int64]9223372036854775807 | fhx'"
                InputObject = [Int64]9223372036854775807
                Count = 1
                ExpectedResult = "00000000000000000000   FF FF FF FF FF FF FF 7F                          ......."
            }
            @{
                Name = "Can process Int64[] type '[Int64[]](9223372036852,9223372036853) | fhx'"
                InputObject = [Int64[]](9223372036852,9223372036853)
                Count = 2
                ExpectedResult = "00000000000000000000   F4 5A D0 7B 63 08 00 00                          ôZÐ{c..."
                ExpectedSecondResult = "00000000000000000000   F5 5A D0 7B 63 08 00 00                          õZÐ{c..."
            }
            @{
                Name = "Can process string type 'hello world | fhx'"
                InputObject = "hello world"
                Count = 1
                ExpectedResult = "00000000000000000000   68 65 6C 6C 6F 20 77 6F 72 6C 64                 hello world"
            }
            @{
                Name = "Can process enum type '[DisplayHintType]::DateTime | fhx"
                InputObject = [Microsoft.PowerShell.Commands.DisplayHintType]::DateTime
                Count = 1
                ExpectedResult = "00000000000000000000   02 00 00 00                                      ...."
            }
            @{
                Name = "Can process DisplayHintType[] type '[DisplayHintType[]](DateTime) | fhx'"
                InputObject = [Microsoft.PowerShell.Commands.DisplayHintType[]]([Microsoft.PowerShell.Commands.DisplayHintType]::DateTime)
                Count = 1
                ExpectedResult = "00000000000000000000   02 00 00 00                                      ...."
            }
            @{
                Name = "Can process DisplayHintType[] type '[DisplayHintType[]](DateTime, Time) | fhx'"
                InputObject = [Microsoft.PowerShell.Commands.DisplayHintType[]]([Microsoft.PowerShell.Commands.DisplayHintType]::DateTime, [Microsoft.PowerShell.Commands.DisplayHintType]::Time)
                Count = 2
                ExpectedResult = "00000000000000000000   02 00 00 00                                      ...."
                ExpectedSecondResult = "00000000000000000000   01 00 00 00                                      ...."
            }
            @{
                Name = "Can process char type '[char]`'A`' | fhx'"
                InputObject = [char]'A'
                Count = 1
                ExpectedResult = "00000000000000000000   41                                               A"
            }
            @{
                Name = "Can process char[] type '[char[]](`'A`') | fhx'"
                InputObject = [char[]]('A')
                Count = 1
                ExpectedResult = "00000000000000000000   41                                               A"
            }
            @{
                Name = "Can process char[] type '[char[]](`'A`', 'B') | fhx'"
                InputObject = [char[]]('A', 'B')
                Count = 2
                ExpectedResult = "00000000000000000000   41                                               A"
                ExpectedSecondResult = "00000000000000000000   42                                               B"
            }
        )

        It "<Name>" -Testcase $testCases {

            param ($Name, $InputObject, $Count, $ExpectedResult, $ExpectedSecondResult)

            $result = $InputObject | Format-Hex

            $result.count | Should -Be $Count
            $result | Should -BeOfType 'Microsoft.PowerShell.Commands.ByteCollection'
            $result[0].ToString() | Should -MatchExactly $ExpectedResult

            if ($result.count -gt 1)
            {
                $result[1].ToString() | Should -MatchExactly $ExpectedSecondResult
            }
        }
    }

    Context "Path and LiteralPath Parameters" {

        $testDirectory = $inputFile1.DirectoryName

        $testCases = @(
            @{
                Name = "Can process file content from given file path 'fhx -Path `$inputFile1'"
                PathCase = $true
                Path =  $inputFile1
                Count = 1
                ExpectedResult = $inputText1
            }
            @{
                Name = "Can process file content from all files in array of file paths 'fhx -Path `$inputFile1, `$inputFile2'"
                PathCase = $true
                Path = @($inputFile1, $inputFile2)
                Count = 2
                ExpectedResult = $inputText1
                ExpectedSecondResult = $inputText2
            }
            @{
                Name = "Can process file content from all files when resolved to multiple paths 'fhx -Path '`$testDirectory\SourceFile-*''"
                PathCase = $true
                Path = "$testDirectory\SourceFile-*"
                Count = 2
                ExpectedResult = $inputText1
                ExpectedSecondResult = $inputText2
            }
            @{
                Name = "Can process file content from given file path 'fhx -LiteralPath `$inputFile3'"
                Path =  $inputFile3
                Count = 1
                ExpectedResult = $inputText3
            }
            @{
                Name = "Can process file content from all files in array of file paths 'fhx -LiteralPath `$inputFile1, `$inputFile3'"
                Path = @($inputFile1, $inputFile3)
                Count = 2
                ExpectedResult = $inputText1
                ExpectedSecondResult = $inputText3
            }
        )

        It "<Name>" -TestCase $testCases {

            param ($Name, $PathCase, $Path, $ExpectedResult, $ExpectedSecondResult)

            if ($PathCase)
            {
                $result =  Format-Hex -Path $Path
            }
            else # LiteralPath
            {
                $result = Format-Hex -LiteralPath $Path
            }

            $result | Should -BeOfType 'Microsoft.PowerShell.Commands.ByteCollection'
            $result[0].ToString() | Should -MatchExactly $ExpectedResult

            if ($result.count -gt 1)
            {
                $result[1].ToString() | Should -MatchExactly $ExpectedSecondResult
            }
        }
    }

    Context "Encoding Parameter" {
        $testCases = @(
            @{
                Name = "Can process ASCII encoding 'fhx -InputObject 'hello' -Encoding ASCII'"
                Encoding = "ASCII"
                Count = 1
                ExpectedResult = "00000000000000000000   68 65 6C 6C 6F                                   hello"
            }
            @{
                Name = "Can process BigEndianUnicode encoding 'fhx -InputObject 'hello' -Encoding BigEndianUnicode'"
                Encoding = "BigEndianUnicode"
                Count = 1
                ExpectedResult = "00000000000000000000   00 68 00 65 00 6C 00 6C 00 6F                    .h.e.l.l.o"
            }
            @{
                Name = "Can process Unicode encoding 'fhx -InputObject 'hello' -Encoding Unicode'"
                Encoding = "Unicode"
                Count = 1
                ExpectedResult = "00000000000000000000   68 00 65 00 6C 00 6C 00 6F 00                    h.e.l.l.o."
            }
            @{
                Name = "Can process UTF7 encoding 'fhx -InputObject 'hello' -Encoding UTF7'"
                Encoding = "UTF7"
                Count = 1
                ExpectedResult = "00000000000000000000   68 65 6C 6C 6F                                   hello"
            }
             @{
                Name = "Can process UTF8 encoding 'fhx -InputObject 'hello' -Encoding UTF8'"
                Encoding = "UTF8"
                Count = 1
                ExpectedResult = "00000000000000000000   68 65 6C 6C 6F                                   hello"
            }
             @{
                Name = "Can process UTF32 encoding 'fhx -InputObject 'hello' -Encoding UTF32'"
                Encoding = "UTF32"
                Count = 1
                ExpectedResult = "00000000000000000000   68 00 00 00 65 00 00 00 6C 00 00 00 6C 00 00 00  h...e...l...l...$($newline)00000000000000000010   6F 00 00 00                                      o..."
            }
        )

        It "<Name>" -TestCase $testCases {

            param ($Name, $Encoding, $Count, $ExpectedResult)

            $result = Format-Hex -InputObject 'hello' -Encoding $Encoding

            $result.count | Should -Be $Count
            $result | Should -BeOfType 'Microsoft.PowerShell.Commands.ByteCollection'
            $result[0].ToString() | Should -MatchExactly $ExpectedResult
        }
    }

    Context "Validate Error Scenarios" {

        $testDirectory = $inputFile1.DirectoryName

        $testCases = @(
            @{
                Name = "Does not support non-FileSystem Provider paths 'fhx -Path 'Cert:\CurrentUser\My\`$thumbprint' -ErrorAction Stop'"
                PathParameterErrorCase = $true
                Path = "Cert:\CurrentUser\My\$thumbprint"
                ExpectedFullyQualifiedErrorId = "FormatHexOnlySupportsFileSystemPaths,Microsoft.PowerShell.Commands.FormatHex"
            }
            @{
                Name = "Type Not Supported 'fhx -InputObject @{'hash' = 'table'} -ErrorAction Stop'"
                InputObjectErrorCase = $true
                Path = $inputFile1
                InputObject = @{ "hash" = "table" }
                ExpectedFullyQualifiedErrorId = "FormatHexTypeNotSupported,Microsoft.PowerShell.Commands.FormatHex"
            }
        )

        It "<Name>" -Skip:$skipTest -TestCase $testCases {

            param ($Name, $PathParameterErrorCase, $Path, $InputObject, $InputObjectErrorCase, $ExpectedFullyQualifiedErrorId)

            {
                if ($PathParameterErrorCase)
                {
                    $result = Format-Hex -Path $Path -ErrorAction Stop
                }
                if ($InputObjectErrorCase)
                {
                    $result = Format-Hex -InputObject $InputObject -ErrorAction Stop
                }
            } | Should -Throw -ErrorId $ExpectedFullyQualifiedErrorId
        }
    }

    Context "Continues to Process Valid Paths" {

        $testCases = @(
            @{
                Name = "If given invalid path in array, continues to process valid paths 'fhx -Path `$invalidPath, `$inputFile1  -ErrorVariable e -ErrorAction SilentlyContinue'"
                PathCase = $true
                InvalidPath = "$($inputFile1.DirectoryName)\fakefile8888845345345348709.txt"
                ExpectedFullyQualifiedErrorId = "FileNotFound,Microsoft.PowerShell.Commands.FormatHex"
            }
            @{
                Name = "If given a non FileSystem path in array, continues to process valid paths 'fhx -Path `$invalidPath, `$inputFile1  -ErrorVariable e -ErrorAction SilentlyContinue'"
                PathCase = $true
                InvalidPath = "Cert:\CurrentUser\My\$thumbprint"
                ExpectedFullyQualifiedErrorId = "FormatHexOnlySupportsFileSystemPaths,Microsoft.PowerShell.Commands.FormatHex"
            }
            @{
                Name = "If given a non FileSystem path in array (with LiteralPath), continues to process valid paths 'fhx -Path `$invalidPath, `$inputFile1  -ErrorVariable e -ErrorAction SilentlyContinue'"
                InvalidPath = "Cert:\CurrentUser\My\$thumbprint"
                ExpectedFullyQualifiedErrorId = "FormatHexOnlySupportsFileSystemPaths,Microsoft.PowerShell.Commands.FormatHex"
            }
        )

        It "<Name>" -Skip:$skipTest -TestCase $testCases {

            param ($Name, $PathCase, $InvalidPath, $ExpectedFullyQualifiedErrorId)

            $output = $null
            $errorThrown = $null

            if ($PathCase)
            {
                $output = Format-Hex -Path $InvalidPath, $inputFile1 -ErrorVariable errorThrown -ErrorAction SilentlyContinue
            }
            else # LiteralPath
            {
                $output = Format-Hex -LiteralPath $InvalidPath, $inputFile1 -ErrorVariable errorThrown -ErrorAction SilentlyContinue
            }

            $errorThrown.FullyQualifiedErrorId | Should -MatchExactly $ExpectedFullyQualifiedErrorId

            $output.Length | Should -Be 1
            $output[0].ToString() | Should -MatchExactly $inputText1
        }
    }

    Context "Cmdlet Functionality" {

        It "Path is default Parameter Set 'fhx `$inputFile1'" {

            $result =  Format-Hex $inputFile1

            $result | Should -Not -BeNullOrEmpty
            ,$result | Should -BeOfType 'Microsoft.PowerShell.Commands.ByteCollection'
            $actualResult = $result.ToString()
            $actualResult | Should -MatchExactly $inputText1
        }

        It "Validate file input from Pipeline 'Get-ChildItem `$inputFile1 | Format-Hex'" {

            $result = Get-ChildItem $inputFile1 | Format-Hex

            $result | Should -Not -BeNullOrEmpty
            ,$result | Should -BeOfType 'Microsoft.PowerShell.Commands.ByteCollection'
            $actualResult = $result.ToString()
            $actualResult | Should -MatchExactly $inputText1
        }

        It "Validate that streamed text does not have buffer underrun problems ''a' * 30 | Format-Hex'" {

            $result = "a" * 30 | Format-Hex

            $result | Should -Not -BeNullOrEmpty
            ,$result | Should -BeOfType 'Microsoft.PowerShell.Commands.ByteCollection'
            $result.ToString() | Should -MatchExactly "00000000000000000000   61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61  aaaaaaaaaaaaaaaa$($newline)00000000000000000010   61 61 61 61 61 61 61 61 61 61 61 61 61 61        aaaaaaaaaaaaaa  "
        }

        It "Validate that files do not have buffer underrun problems 'Format-Hex -Path `$InputFile4'" {

            $result = Format-Hex -Path $InputFile4

            $result | Should -Not -BeNullOrEmpty
            $result.Count | Should -Be 3
            $result[0].ToString() | Should -MatchExactly "00000000000000000000   4E 6F 77 20 69 73 20 74 68 65 20 77 69 6E 74 65  Now is the winte"
            $result[1].ToString() | Should -MatchExactly "00000000000000000010   72 20 6F 66 20 6F 75 72 20 64 69 73 63 6F 6E 74  r of our discont"
            $result[2].ToString() | Should -MatchExactly "00000000000000000020   65 6E 74                                         ent             "
        }
    }

    Context "Count and Offset parameters" {
        It "Count = length" {

            $result = Format-Hex -Path $InputFile4 -Count $inputText4.Length

            $result | Should -Not -BeNullOrEmpty
            $result.Count | Should -Be 3
            $result[0].ToString() | Should -MatchExactly "00000000000000000000   4E 6F 77 20 69 73 20 74 68 65 20 77 69 6E 74 65  Now is the winte"
            $result[1].ToString() | Should -MatchExactly "00000000000000000010   72 20 6F 66 20 6F 75 72 20 64 69 73 63 6F 6E 74  r of our discont"
            $result[2].ToString() | Should -MatchExactly "00000000000000000020   65 6E 74                                         ent             "
        }

        It "Count = 1" {
            $result = Format-Hex -Path $inputFile4 -Count 1
            $result.ToString() | Should -MatchExactly    "00000000000000000000   4E                                               N               "
        }

        It "Offset = length" {

            $result = Format-Hex -Path $InputFile4 -Offset $inputText4.Length
            $result | Should -BeNullOrEmpty

            $result = Format-Hex -InputObject $inputText4 -Offset $inputText4.Length
            $result.Bytes | Should -HaveCount 0
        }

        It "Offset = 1" {

            $result = Format-Hex -Path $InputFile4 -Offset 1

            $result | Should -Not -BeNullOrEmpty
            $result.Count | Should -Be 3
            $result[0].ToString() | Should -MatchExactly "00000000000000000001   6F 77 20 69 73 20 74 68 65 20 77 69 6E 74 65 72  ow is the winter"
            $result[1].ToString() | Should -MatchExactly "00000000000000000011   20 6F 66 20 6F 75 72 20 64 69 73 63 6F 6E 74 65   of our disconte"
            $result[2].ToString() | Should -MatchExactly "00000000000000000021   6E 74                                            nt              "
        }

        It "Count = 1 and Offset = 1" {
            $result = Format-Hex -Path $inputFile4 -Count 1 -Offset 1
            $result.ToString() | Should -MatchExactly    "00000000000000000001   6F                                               o               "
        }

        It "Count should be > 0" {
            { Format-Hex -Path $inputFile4 -Count 0 } | Should -Throw -ErrorId "ParameterArgumentValidationError,Microsoft.PowerShell.Commands.FormatHex"
        }

        It "Offset should be >= 0" {
            { Format-Hex -Path $inputFile4 -Offset -1 } | Should -Throw -ErrorId "ParameterArgumentValidationError,Microsoft.PowerShell.Commands.FormatHex"
        }

        It "Offset = 0" {

            $result = Format-Hex -Path $InputFile4 -Offset 0

            $result | Should -Not -BeNullOrEmpty
            $result.Count | Should -Be 3
            $result[0].ToString() | Should -MatchExactly "00000000000000000000   4E 6F 77 20 69 73 20 74 68 65 20 77 69 6E 74 65  Now is the winte"
            $result[1].ToString() | Should -MatchExactly "00000000000000000010   72 20 6F 66 20 6F 75 72 20 64 69 73 63 6F 6E 74  r of our discont"
            $result[2].ToString() | Should -MatchExactly "00000000000000000020   65 6E 74                                         ent             "
        }
    }
}


text:
<?php
include_once 'header.php';
/* Include header */
?>

Membership system

Introduction: Full membership system written in PHP,
                It includes up to date password salting, secure validation, MySQL injection protection and beautiful design.

                Check out this code at GitHub

                Back to main page


text:
package org.spongepowered.common.mixin.core.item;

import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import org.spongepowered.api.block.BlockType;
import org.spongepowered.api.data.Property;
import org.spongepowered.api.data.manipulator.DataManipulator;
import org.spongepowered.api.data.manipulator.mutable.DisplayNameData;
import org.spongepowered.api.data.manipulator.mutable.item.EnchantmentData;
import org.spongepowered.api.item.ItemType;
import org.spongepowered.api.text.translation.Translation;
import org.spongepowered.api.util.annotation.NonnullByDefault;
import org.spongepowered.asm.mixin.Implements;
import org.spongepowered.asm.mixin.Interface;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.common.interfaces.item.IMixinItem;
import org.spongepowered.common.registry.SpongeGameRegistry;
import org.spongepowered.common.text.translation.SpongeTranslation;

import java.util.List;
import java.util.Optional;

@NonnullByDefault
@Mixin(Item.class)
@Implements(@Interface(iface = ItemType.class, prefix = "item$"))
public abstract class MixinItem implements ItemType, IMixinItem{

    public Optional<BlockType> blockType = Optional.empty();

    @Shadow
    public abstract int getItemStackLimit();

    @Shadow
    public abstract String getUnlocalizedName();

    @Override
    public String getId() {
        if ((Object) this == SpongeGameRegistry.NONE_ITEM) {
            return "NONE";
        }
        return Item.itemRegistry.getNameForObject(this).toString();
    }

    @Override
    public String getName() {
        if ((Object) this == SpongeGameRegistry.NONE_ITEM) {
            return "NONE";
        }
        return Item.itemRegistry.getNameForObject(this).toString();
    }

    @Override
    public <T extends Property<?, ?>> Optional<T> getDefaultProperty(Class<T> propertyClass) {
        return Optional.empty(); // TODO
    }

    @Override
    public Translation getTranslation() {
        return new SpongeTranslation(getUnlocalizedName() + ".name");
    }

    @Override
    public int getMaxStackQuantity() {
        return getItemStackLimit();
    }

    public Optional<BlockType> item$getBlock() {
        return this.blockType;
    }

    @Override
    public void getManipulatorsFor(ItemStack itemStack, List<DataManipulator<?, ?>> list) {
        if (!itemStack.hasTagCompound()) {
            return;
        }
        if (itemStack.isItemEnchanted()) {
            list.add(getData(itemStack, EnchantmentData.class));
        }
        if (itemStack.getTagCompound().hasKey("display")) {
            final NBTTagCompound displayCompound = itemStack.getTagCompound().getCompoundTag("display");
            if (displayCompound.hasKey("Name")) {
                list.add(getData(itemStack, DisplayNameData.class));
            }
            if (displayCompound.hasKey("Lore")) {
                // list.add(getData(itemStack, LoreData.class)); // TODO implement
            }
        }
    }

    protected final <T extends DataManipulator<T, ?>> T getData(ItemStack itemStack, Class<T> manipulatorClass) {
        return ((org.spongepowered.api.item.inventory.ItemStack) itemStack).get(manipulatorClass).get();
    }
}


text:
#include "cuda_runtime.h"
#include "curand.h"
#include "cublas_v2.h"

extern "C" {
#include "dropout_layer.h"
#include "cuda.h"
#include "utils.h"
}

__global__ void yoloswag420blazeit360noscope(float *input, int size, float *rand, float prob, float scale)
{
    int id = (blockIdx.x + blockIdx.y*gridDim.x) * blockDim.x + threadIdx.x;
    if(id < size) input[id] = (rand[id] < prob) ? 0 : input[id]*scale;
}

void forward_dropout_layer_gpu(dropout_layer layer, network net)
{
    if (!net.train) return;
    int size = layer.inputs*layer.batch;
    cuda_random(layer.rand_gpu, size);
    /*
    int i;
    for(i = 0; i < size; ++i){
        layer.rand[i] = rand_uniform();
    }
    cuda_push_array(layer.rand_gpu, layer.rand, size);
    */

    yoloswag420blazeit360noscope<<<cuda_gridsize(size), BLOCK>>>(net.input_gpu, size, layer.rand_gpu, layer.probability, layer.scale);
    check_error(cudaPeekAtLastError());
}

void backward_dropout_layer_gpu(dropout_layer layer, network net)
{
    if(!net.delta_gpu) return;
    int size = layer.inputs*layer.batch;

    yoloswag420blazeit360noscope<<<cuda_gridsize(size), BLOCK>>>(net.delta_gpu, size, layer.rand_gpu, layer.probability, layer.scale);
    check_error(cudaPeekAtLastError());
}


text:
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JButton;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.JComboBox;
import java.awt.Container;
import java.awt.FlowLayout;
import java.awt.BorderLayout;
import java.awt.*;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import java.sql.Connection;
import java.sql.Date;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import javax.swing.BorderFactory;
import javax.swing.JOptionPane;
import javax.swing.JTextArea;
import javax.swing.JTextField;
import javax.swing.border.Border;

public class FrameAvaliaSugestao extends JFrame implements ActionListener {

    private JButton btnEnviar, btnVoltar;
    private Connection conn;
    private JLabel lblTitulo, lblDescricao, lblVazio, lblTelaSugestao;
    private JTextField txtTitulo;
    private JTextArea txtDescricao;
    private JScrollPane scrollPane;
    private JScrollPane areaScrollPane;
    private JPanel painelFundo;

    public FrameAvaliaSugestao(Connection conn) {

        super("Area de Sugestão");
        JPanel pnlGrid = new JPanel(new GridBagLayout());
        GridBagConstraints gbcCentro = new GridBagConstraints();
        //JPanel pnlGrid = new JPanel(new GridLayout(8,3));
        JPanel pnlFlow = new JPanel(new FlowLayout());
        JPanel pnlGrids = new JPanel(new FlowLayout());
        ///tabela
        //JPanel pnlCentro = new JPanel (new GridBagLayout());
        //GridBagConstraints gbcCentro = new GridBagConstraints();
        btnVoltar = new JButton("Voltar");
        btnEnviar = new JButton("Enviar");
        lblVazio = new JLabel("Selecione uma categoria");
        lblTitulo = new JLabel("Titulo: ");
        txtTitulo = new JTextField(15);
        lblDescricao = new JLabel("Titulo Descição");

        txtDescricao = new JTextArea();
        areaScrollPane = new JScrollPane(txtDescricao);
        //itens combobox

        gbcCentro.gridx = 0;
        gbcCentro.gridy = 0;
        gbcCentro.gridwidth = 4;
        pnlGrid.add(lblVazio, gbcCentro);

        //comboBox
        //Label vazia para espaço entre ComboBox e Tabela
        gbcCentro.gridx = 0;
        gbcCentro.gridy = 2;
        gbcCentro.gridwidth = 4;
        pnlGrid.add(lblTitulo, gbcCentro);

        gbcCentro.gridx = 0;
        gbcCentro.gridy = 3;
        gbcCentro.gridwidth = 4;
        pnlGrid.add(txtTitulo, gbcCentro);

        //label vazia para espaço entre tabela e botão enviar
        gbcCentro.gridx = 0;
        gbcCentro.gridy = 4;
        gbcCentro.gridwidth = 4;
        pnlGrid.add(lblDescricao, gbcCentro);

        gbcCentro.gridx = 0;
        gbcCentro.gridy = 5;
        gbcCentro.gridwidth = 4;
        pnlGrid.add(areaScrollPane, gbcCentro);

        //botão enviar
        gbcCentro.gridx = 0;
        gbcCentro.gridy = 6;
        gbcCentro.gridwidth = 4;
        pnlGrids.add(btnEnviar, gbcCentro);

        gbcCentro.gridx = 3;
        gbcCentro.gridy = 7;
        gbcCentro.gridwidth = 4;
        pnlGrids.add(btnVoltar, gbcCentro);

        pnlFlow.add(pnlGrid);

        btnEnviar.addActionListener(this);
        btnVoltar.addActionListener(this);

        JPanel pnlNorte = new JPanel(new GridBagLayout());
        GridBagConstraints gbc = new GridBagConstraints();
        JLabel lblTelaSugestao = new JLabel("Sugestão");
        JLabel lblVazio3 = new JLabel("\n");

        gbc.gridx = 0;
        gbc.gridy = 1;
        gbc.gridwidth = 4;
        pnlNorte.add(lblTelaSugestao, gbc);

        Container caixa = getContentPane();
        caixa.setLayout(new BorderLayout());
        caixa.add(pnlFlow, BorderLayout.CENTER);
        caixa.add(pnlNorte, BorderLayout.NORTH);
        caixa.add(pnlGrids, BorderLayout.SOUTH);
        txtDescricao.setFont(new Font("Arial", Font.PLAIN, 12));
        txtDescricao.setLineWrap(true);
        txtDescricao.setWrapStyleWord(true);
        txtDescricao.setEditable(true);
        areaScrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
        areaScrollPane.setPreferredSize(new Dimension(400, 250));
        setSize(500, 500);
        setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
        setLocationRelativeTo(null);
        setVisible(true);
    }

    public boolean validaForm() { //ARRUMAR
        boolean error;
        int contErros = 0;
        Border borderRed = BorderFactory.createLineBorder(Color.red);
        Border borderBlack = BorderFactory.createLineBorder(Color.black);
        //Validacao de data de nascimento
        if (txtTitulo.getText() == null || txtTitulo.getText().length() < 10) {
            txtTitulo.setBorder(borderRed);
            contErros++;
        } else {
            txtTitulo.setBorder(borderBlack);
        }
        if (txtDescricao.getText() == null || txtDescricao.getText().length() < 10) {
            txtDescricao.setBorder(borderRed);
            contErros++;
        } else {
            txtTitulo.setBorder(borderBlack);
        }
        //Validacao de RA, caso Colaborador

        if (contErros == 0) {
            error = false;
        } else {
            error = true;
        }
        return error;
    }

    public String[] carregaCategoria(Connection conn) {
        CarregaCategoria categorias = new CarregaCategoria();
        ArrayList<Categoria> lista = categorias.buscarCategoria(conn);
        DateFormat formatter = new SimpleDateFormat("dd/MM/yyyy");
        String[] saida = new String[lista.size()];
        Categoria categoria;
        for (int i = 0; i < lista.size(); i++) {
            categoria = lista.get(i);
            saida[i] = categoria.getNomeCategoria();
        } //{"Categoria","Titulo", "Data"}

        return saida;
    }

    public void actionPerformed(ActionEvent ae) {
        if (ae.getSource() == btnEnviar) {
            if (!validaForm()) {

            } else {
                JOptionPane.showMessageDialog(null, "Campos obrigatórios não preenchidos.");
            }
        } else if (ae.getSource() == btnVoltar) {
            this.dispose();
            FrameIndexAvaliador tela = FrameIndexAvaliador.getInstance();
            tela.refazTela();

        }
    }

    /*public static void main(String[] args) {
        ConexaoBD bd = new ConexaoBD();
        Connection conn = null;
        try {
            conn = bd.conectar();
            FrameNovaSugestao telaSugestao = new FrameNovaSugestao(conn);
        } catch (Exception e) {
        }
    }*/
}


text:
<html>
	<head>
		<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.7.3/Chart.min.js"></script>
		<script>

			var container;
			var containerWidth = 500;
			var containerHeight = 300;

			var MAX_HEIGHT = 1000;
			var MIN_HEIGHT = 100;
			var MAX_WIDTH = 2000;
			var MIN_WIDTH = 200;

			var myChart;

			function init() {

				container = document.getElementById("container");
				setSize(containerHeight,containerWidth);

				var ctx = document.getElementById('myChart').getContext('2d');
				myChart = new Chart(ctx, {
					// The type of chart we want to create
					type: 'line',

					// The data for our dataset
					data: {
						labels: ["January", "February", "March", "April", "May", "June", "July"],
						datasets: [{
							label: "My First dataset",
							backgroundColor: 'rgb(255, 99, 132)',
							borderColor: 'rgb(255, 99, 132)',
							data: [0, 10, 5, 2, 20, 30, 45],
						}]
					},

					// Configuration options go here
					options: {}
				});
			}

			function onClick() {
				console.log("Before: " + containerHeight + ", " + containerWidth);
				containerHeight = containerHeight * getRandomScaleFactor();
				containerWidth = containerWidth * getRandomScaleFactor();
				console.log("After: " + containerHeight + ", " + containerWidth);

				if(containerHeight > MAX_HEIGHT) containerHeight = MAX_HEIGHT;
				if(containerHeight < MIN_HEIGHT) containerHeight = MIN_HEIGHT;
				if(containerWidth > MAX_WIDTH) containerWidth = MAX_WIDTH;
				if(containerWidth < MIN_WIDTH) containerWidth = MIN_WIDTH;

				setSize(containerHeight,containerWidth);

				myChart.resize();
			}

			//this makes a random scale factor between .5 and 2
			function getRandomScaleFactor() {
				var baseFactor = Math.random();
				var scaleFactor;
				if(baseFactor <= .5) {
					scaleFactor = 1/(1-baseFactor);
				}
				else {
					scaleFactor = baseFactor;
				}
				console.log(scaleFactor);
				return scaleFactor;
			}

			function setSize(height,width) {
				container.style.width = width + "px";
				container.style.height = height + "px";
			}
		</script>
		<style>
			#container {
				width: 500px;
				height: 500px;
			}
		</style>
	</head>
	<body onload="init()">
		<button onclick="onClick()">RESIZE</button>
		<div id="container">
			<canvas id="myChart"></canvas>
		</div>
	</body>
</html>


text:
import React from "react";

export const STRINGS = {
  BRANDING: {
    SITE_TITLE: ["dr4ft", "info"].join("."),
    SITE_NAME: DRFT,
    DEFAULT_USERNAME: "dr4fter",
    PAYPAL: "",
  },

  PAGE_SECTIONS: {
    MOTD: null, // TODO: handle overwrite of this message of the day; can be a React element

    FOOTER:

        Contributions welcome!

          dr4fters/dr4ft

  }
};


text:
<?xml version="1.0"?>
<!--

  Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You under the Apache License, Version 2.0
  (the "License"); you may not use this file except in compliance with
  the License.  You may obtain a copy of the License at

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

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

-->

<componentPackage>

    <component id="Application" class="org.apache.cordova.Application"/>
    <component id="Camera" class="org.apache.cordova.camera.Camera"/>
    <component id="Weinre" class="org.apache.cordova.Weinre"/>
    <component id="Geolocation" class="org.apache.cordova.geolocation.Geolocation" />

</componentPackage>


text:
#ifndef FL_NILPOTENTMAXIMUM_H
#define FL_NILPOTENTMAXIMUM_H

#include "fl/norm/SNorm.h"

namespace fl {

    class FL_API NilpotentMaximum : public SNorm {
    public:
        std::string className() const FL_IOVERRIDE;
        scalar compute(scalar a, scalar b) const FL_IOVERRIDE;
        NilpotentMaximum* clone() const FL_IOVERRIDE;

        static SNorm* constructor();
    };
}

#endif  /* FL_NILPOTENTMAXIMUM_H */


text:
TreeViewFunctions::SelectStateIcon  (deprecated for: CheckTextNode)

RC

<short_desc xmlns="">
                 Select/check a node's state icon (checkbox) according to its associated text value.
              </short_desc>

<detailed_desc xmlns="">
                 This command might not function correctly when there
                 are duplicate nodes in the tree.  However, we have made it possible to
                 attempt to select the Nth duplicate item with the optional MatchIndex
                 parameter for those trees which we can properly process.
              </detailed_desc>

Fields: [ ]=Optional with Default Value

TextValue

<short_desc xmlns="">
                 Case-sensitive text of the node to be selected/checked.
              </short_desc>

<detailed_desc xmlns="">
                 TextValue is the case-sensitive text of the node to be selected/checked.
              </detailed_desc>

[ MatchIndex =  ]

<short_desc xmlns="">
                 Optional index of the Nth duplicate item to match.
              </short_desc>

<detailed_desc xmlns="">
                 Allows us to match duplicate item N in a list containing duplicate
                 entries.  For example, match the 2nd (or specified Nth) item whose text matches
                 the provided text value.

                 The value of the parameter can have 2 forms:

A numeric value.  Ex: "3"

Index prefixed value.  Ex: "Index=3"

                 If the field parameter data does not match one of these two forms then
                 the data is ignored and the default(first match) is used.

</detailed_desc>

Examples:

<usage xmlns="">T, WINDOW, TreeView, SELECTSTATEICON, "MyNode"</usage>

<short_desc xmlns="">
                Selects/checks the first "MyNode" node state icon (checkbox) on the TreeView object.
              </short_desc>

<usage xmlns="">T, WINDOW, TreeView, SELECTSTATEICON, "MyNode", 3</usage>

<short_desc xmlns="">
                Selects/Checks the 3rd duplicate "MyNode" node state icon (checkbox) on the TreeView object.
              </short_desc>

<usage xmlns="">T, WINDOW, TreeView, SELECTSTATEICON, "MyNode", "Index=3"</usage>

<short_desc xmlns="">
                Selects/Checks the 3rd duplicate "MyNode" node state icon (checkbox) on the TreeView object.
              </short_desc>

[How To Read This Reference]