text:
package embedded // import "google.golang.org/genproto/googleapis/assistant/embedded/v1alpha1"

import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"
import _ "google.golang.org/genproto/googleapis/api/annotations"
import status "google.golang.org/genproto/googleapis/rpc/status"

import (
	context "golang.org/x/net/context"
	grpc "google.golang.org/grpc"
)

// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf

// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package

// Audio encoding of the data sent in the audio message.
// Audio must be one-channel (mono). The only language supported is "en-US".
type AudioInConfig_Encoding int32

const (
	// Not specified. Will return result [google.rpc.Code.INVALID_ARGUMENT][].
	AudioInConfig_ENCODING_UNSPECIFIED AudioInConfig_Encoding = 0
	// Uncompressed 16-bit signed little-endian samples (Linear PCM).
	// This encoding includes no header, only the raw audio bytes.
	AudioInConfig_LINEAR16 AudioInConfig_Encoding = 1
	// [`FLAC`](https://xiph.org/flac/documentation.html) (Free Lossless Audio
	// Codec) is the recommended encoding because it is
	// lossless--therefore recognition is not compromised--and
	// requires only about half the bandwidth of `LINEAR16`. This encoding
	// includes the `FLAC` stream header followed by audio data. It supports
	// 16-bit and 24-bit samples, however, not all fields in `STREAMINFO` are
	// supported.
	AudioInConfig_FLAC AudioInConfig_Encoding = 2
)

var AudioInConfig_Encoding_name = map[int32]string{
	0: "ENCODING_UNSPECIFIED",
	1: "LINEAR16",
	2: "FLAC",
}
var AudioInConfig_Encoding_value = map[string]int32{
	"ENCODING_UNSPECIFIED": 0,
	"LINEAR16":             1,
	"FLAC":                 2,
}

func (x AudioInConfig_Encoding) String() string {
	return proto.EnumName(AudioInConfig_Encoding_name, int32(x))
}
func (AudioInConfig_Encoding) EnumDescriptor() ([]byte, []int) {
	return fileDescriptor_embedded_assistant_907a82b6d4d77187, []int{1, 0}
}

// Audio encoding of the data returned in the audio message. All encodings are
// raw audio bytes with no header, except as indicated below.
type AudioOutConfig_Encoding int32

const (
	// Not specified. Will return result [google.rpc.Code.INVALID_ARGUMENT][].
	AudioOutConfig_ENCODING_UNSPECIFIED AudioOutConfig_Encoding = 0
	// Uncompressed 16-bit signed little-endian samples (Linear PCM).
	AudioOutConfig_LINEAR16 AudioOutConfig_Encoding = 1
	// MP3 audio encoding. The sample rate is encoded in the payload.
	AudioOutConfig_MP3 AudioOutConfig_Encoding = 2
	// Opus-encoded audio wrapped in an ogg container. The result will be a
	// file which can be played natively on Android and in some browsers (such
	// as Chrome). The quality of the encoding is considerably higher than MP3
	// while using the same bitrate. The sample rate is encoded in the payload.
	AudioOutConfig_OPUS_IN_OGG AudioOutConfig_Encoding = 3
)

var AudioOutConfig_Encoding_name = map[int32]string{
	0: "ENCODING_UNSPECIFIED",
	1: "LINEAR16",
	2: "MP3",
	3: "OPUS_IN_OGG",
}
var AudioOutConfig_Encoding_value = map[string]int32{
	"ENCODING_UNSPECIFIED": 0,
	"LINEAR16":             1,
	"MP3":                  2,
	"OPUS_IN_OGG":          3,
}

func (x AudioOutConfig_Encoding) String() string {
	return proto.EnumName(AudioOutConfig_Encoding_name, int32(x))
}
func (AudioOutConfig_Encoding) EnumDescriptor() ([]byte, []int) {
	return fileDescriptor_embedded_assistant_907a82b6d4d77187, []int{2, 0}
}

// Possible states of the microphone after a `Converse` RPC completes.
type ConverseResult_MicrophoneMode int32

const (
	// No mode specified.
	ConverseResult_MICROPHONE_MODE_UNSPECIFIED ConverseResult_MicrophoneMode = 0
	// The service is not expecting a follow-on question from the user.
	// The microphone should remain off until the user re-activates it.
	ConverseResult_CLOSE_MICROPHONE ConverseResult_MicrophoneMode = 1
	// The service is expecting a follow-on question from the user. The
	// microphone should be re-opened when the `AudioOut` playback completes
	// (by starting a new `Converse` RPC call to send the new audio).
	ConverseResult_DIALOG_FOLLOW_ON ConverseResult_MicrophoneMode = 2
)

var ConverseResult_MicrophoneMode_name = map[int32]string{
	0: "MICROPHONE_MODE_UNSPECIFIED",
	1: "CLOSE_MICROPHONE",
	2: "DIALOG_FOLLOW_ON",
}
var ConverseResult_MicrophoneMode_value = map[string]int32{
	"MICROPHONE_MODE_UNSPECIFIED": 0,
	"CLOSE_MICROPHONE":            1,
	"DIALOG_FOLLOW_ON":            2,
}

func (x ConverseResult_MicrophoneMode) String() string {
	return proto.EnumName(ConverseResult_MicrophoneMode_name, int32(x))
}
func (ConverseResult_MicrophoneMode) EnumDescriptor() ([]byte, []int) {
	return fileDescriptor_embedded_assistant_907a82b6d4d77187, []int{5, 0}
}

// Indicates the type of event.
type ConverseResponse_EventType int32

const (
	// No event specified.
	ConverseResponse_EVENT_TYPE_UNSPECIFIED ConverseResponse_EventType = 0
	// This event indicates that the server has detected the end of the user's
	// speech utterance and expects no additional speech. Therefore, the server
	// will not process additional audio (although it may subsequently return
	// additional results). The client should stop sending additional audio
	// data, half-close the gRPC connection, and wait for any additional results
	// until the server closes the gRPC connection.
	ConverseResponse_END_OF_UTTERANCE ConverseResponse_EventType = 1
)

var ConverseResponse_EventType_name = map[int32]string{
	0: "EVENT_TYPE_UNSPECIFIED",
	1: "END_OF_UTTERANCE",
}
var ConverseResponse_EventType_value = map[string]int32{
	"EVENT_TYPE_UNSPECIFIED": 0,
	"END_OF_UTTERANCE":       1,
}

func (x ConverseResponse_EventType) String() string {
	return proto.EnumName(ConverseResponse_EventType_name, int32(x))
}
func (ConverseResponse_EventType) EnumDescriptor() ([]byte, []int) {
	return fileDescriptor_embedded_assistant_907a82b6d4d77187, []int{7, 0}
}

// Specifies how to process the `ConverseRequest` messages.
type ConverseConfig struct {
	// *Required* Specifies how to process the subsequent incoming audio.
	AudioInConfig *AudioInConfig `protobuf:"bytes,1,opt,name=audio_in_config,json=audioInConfig,proto3" json:"audio_in_config,omitempty"`
	// *Required* Specifies how to format the audio that will be returned.
	AudioOutConfig *AudioOutConfig `protobuf:"bytes,2,opt,name=audio_out_config,json=audioOutConfig,proto3" json:"audio_out_config,omitempty"`
	// *Required* Represents the current dialog state.
	ConverseState        *ConverseState `protobuf:"bytes,3,opt,name=converse_state,json=converseState,proto3" json:"converse_state,omitempty"`
	XXX_NoUnkeyedLiteral struct{}       `json:"-"`
	XXX_unrecognized     []byte         `json:"-"`
	XXX_sizecache        int32          `json:"-"`
}

func (m *ConverseConfig) Reset()         { *m = ConverseConfig{} }
func (m *ConverseConfig) String() string { return proto.CompactTextString(m) }
func (*ConverseConfig) ProtoMessage()    {}
func (*ConverseConfig) Descriptor() ([]byte, []int) {
	return fileDescriptor_embedded_assistant_907a82b6d4d77187, []int{0}
}
func (m *ConverseConfig) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_ConverseConfig.Unmarshal(m, b)
}
func (m *ConverseConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_ConverseConfig.Marshal(b, m, deterministic)
}
func (dst *ConverseConfig) XXX_Merge(src proto.Message) {
	xxx_messageInfo_ConverseConfig.Merge(dst, src)
}
func (m *ConverseConfig) XXX_Size() int {
	return xxx_messageInfo_ConverseConfig.Size(m)
}
func (m *ConverseConfig) XXX_DiscardUnknown() {
	xxx_messageInfo_ConverseConfig.DiscardUnknown(m)
}

var xxx_messageInfo_ConverseConfig proto.InternalMessageInfo

func (m *ConverseConfig) GetAudioInConfig() *AudioInConfig {
	if m != nil {
		return m.AudioInConfig
	}
	return nil
}

func (m *ConverseConfig) GetAudioOutConfig() *AudioOutConfig {
	if m != nil {
		return m.AudioOutConfig
	}
	return nil
}

func (m *ConverseConfig) GetConverseState() *ConverseState {
	if m != nil {
		return m.ConverseState
	}
	return nil
}

// Specifies how to process the `audio_in` data that will be provided in
// subsequent requests. For recommended settings, see the Google Assistant SDK
// [best
// practices](https://developers.google.com/assistant/sdk/develop/grpc/best-practices/audio).
type AudioInConfig struct {
	// *Required* Encoding of audio data sent in all `audio_in` messages.
	Encoding AudioInConfig_Encoding `protobuf:"varint,1,opt,name=encoding,proto3,enum=google.assistant.embedded.v1alpha1.AudioInConfig_Encoding" json:"encoding,omitempty"`
	// *Required* Sample rate (in Hertz) of the audio data sent in all `audio_in`
	// messages. Valid values are from 16000-24000, but 16000 is optimal.
	// For best results, set the sampling rate of the audio source to 16000 Hz.
	// If that's not possible, use the native sample rate of the audio source
	// (instead of re-sampling).
	SampleRateHertz      int32    `protobuf:"varint,2,opt,name=sample_rate_hertz,json=sampleRateHertz,proto3" json:"sample_rate_hertz,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (m *AudioInConfig) Reset()         { *m = AudioInConfig{} }
func (m *AudioInConfig) String() string { return proto.CompactTextString(m) }
func (*AudioInConfig) ProtoMessage()    {}
func (*AudioInConfig) Descriptor() ([]byte, []int) {
	return fileDescriptor_embedded_assistant_907a82b6d4d77187, []int{1}
}
func (m *AudioInConfig) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_AudioInConfig.Unmarshal(m, b)
}
func (m *AudioInConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_AudioInConfig.Marshal(b, m, deterministic)
}
func (dst *AudioInConfig) XXX_Merge(src proto.Message) {
	xxx_messageInfo_AudioInConfig.Merge(dst, src)
}
func (m *AudioInConfig) XXX_Size() int {
	return xxx_messageInfo_AudioInConfig.Size(m)
}
func (m *AudioInConfig) XXX_DiscardUnknown() {
	xxx_messageInfo_AudioInConfig.DiscardUnknown(m)
}

var xxx_messageInfo_AudioInConfig proto.InternalMessageInfo

func (m *AudioInConfig) GetEncoding() AudioInConfig_Encoding {
	if m != nil {
		return m.Encoding
	}
	return AudioInConfig_ENCODING_UNSPECIFIED
}

func (m *AudioInConfig) GetSampleRateHertz() int32 {
	if m != nil {
		return m.SampleRateHertz
	}
	return 0
}

// Specifies the desired format for the server to use when it returns
// `audio_out` messages.
type AudioOutConfig struct {
	// *Required* The encoding of audio data to be returned in all `audio_out`
	// messages.
	Encoding AudioOutConfig_Encoding `protobuf:"varint,1,opt,name=encoding,proto3,enum=google.assistant.embedded.v1alpha1.AudioOutConfig_Encoding" json:"encoding,omitempty"`
	// *Required* The sample rate in Hertz of the audio data returned in
	// `audio_out` messages. Valid values are: 16000-24000.
	SampleRateHertz int32 `protobuf:"varint,2,opt,name=sample_rate_hertz,json=sampleRateHertz,proto3" json:"sample_rate_hertz,omitempty"`
	// *Required* Current volume setting of the device's audio output.
	// Valid values are 1 to 100 (corresponding to 1% to 100%).
	VolumePercentage     int32    `protobuf:"varint,3,opt,name=volume_percentage,json=volumePercentage,proto3" json:"volume_percentage,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (m *AudioOutConfig) Reset()         { *m = AudioOutConfig{} }
func (m *AudioOutConfig) String() string { return proto.CompactTextString(m) }
func (*AudioOutConfig) ProtoMessage()    {}
func (*AudioOutConfig) Descriptor() ([]byte, []int) {
	return fileDescriptor_embedded_assistant_907a82b6d4d77187, []int{2}
}
func (m *AudioOutConfig) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_AudioOutConfig.Unmarshal(m, b)
}
func (m *AudioOutConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_AudioOutConfig.Marshal(b, m, deterministic)
}
func (dst *AudioOutConfig) XXX_Merge(src proto.Message) {
	xxx_messageInfo_AudioOutConfig.Merge(dst, src)
}
func (m *AudioOutConfig) XXX_Size() int {
	return xxx_messageInfo_AudioOutConfig.Size(m)
}
func (m *AudioOutConfig) XXX_DiscardUnknown() {
	xxx_messageInfo_AudioOutConfig.DiscardUnknown(m)
}

var xxx_messageInfo_AudioOutConfig proto.InternalMessageInfo

func (m *AudioOutConfig) GetEncoding() AudioOutConfig_Encoding {
	if m != nil {
		return m.Encoding
	}
	return AudioOutConfig_ENCODING_UNSPECIFIED
}

func (m *AudioOutConfig) GetSampleRateHertz() int32 {
	if m != nil {
		return m.SampleRateHertz
	}
	return 0
}

func (m *AudioOutConfig) GetVolumePercentage() int32 {
	if m != nil {
		return m.VolumePercentage
	}
	return 0
}

// Provides information about the current dialog state.
type ConverseState struct {
	// *Required* The `conversation_state` value returned in the prior
	// `ConverseResponse`. Omit (do not set the field) if there was no prior
	// `ConverseResponse`. If there was a prior `ConverseResponse`, do not omit
	// this field; doing so will end that conversation (and this new request will
	// start a new conversation).
	ConversationState    []byte   `protobuf:"bytes,1,opt,name=conversation_state,json=conversationState,proto3" json:"conversation_state,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (m *ConverseState) Reset()         { *m = ConverseState{} }
func (m *ConverseState) String() string { return proto.CompactTextString(m) }
func (*ConverseState) ProtoMessage()    {}
func (*ConverseState) Descriptor() ([]byte, []int) {
	return fileDescriptor_embedded_assistant_907a82b6d4d77187, []int{3}
}
func (m *ConverseState) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_ConverseState.Unmarshal(m, b)
}
func (m *ConverseState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_ConverseState.Marshal(b, m, deterministic)
}
func (dst *ConverseState) XXX_Merge(src proto.Message) {
	xxx_messageInfo_ConverseState.Merge(dst, src)
}
func (m *ConverseState) XXX_Size() int {
	return xxx_messageInfo_ConverseState.Size(m)
}
func (m *ConverseState) XXX_DiscardUnknown() {
	xxx_messageInfo_ConverseState.DiscardUnknown(m)
}

var xxx_messageInfo_ConverseState proto.InternalMessageInfo

func (m *ConverseState) GetConversationState() []byte {
	if m != nil {
		return m.ConversationState
	}
	return nil
}

// The audio containing the assistant's response to the query. Sequential chunks
// of audio data are received in sequential `ConverseResponse` messages.
type AudioOut struct {
	// *Output-only* The audio data containing the assistant's response to the
	// query. Sequential chunks of audio data are received in sequential
	// `ConverseResponse` messages.
	AudioData            []byte   `protobuf:"bytes,1,opt,name=audio_data,json=audioData,proto3" json:"audio_data,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (m *AudioOut) Reset()         { *m = AudioOut{} }
func (m *AudioOut) String() string { return proto.CompactTextString(m) }
func (*AudioOut) ProtoMessage()    {}
func (*AudioOut) Descriptor() ([]byte, []int) {
	return fileDescriptor_embedded_assistant_907a82b6d4d77187, []int{4}
}
func (m *AudioOut) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_AudioOut.Unmarshal(m, b)
}
func (m *AudioOut) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_AudioOut.Marshal(b, m, deterministic)
}
func (dst *AudioOut) XXX_Merge(src proto.Message) {
	xxx_messageInfo_AudioOut.Merge(dst, src)
}
func (m *AudioOut) XXX_Size() int {
	return xxx_messageInfo_AudioOut.Size(m)
}
func (m *AudioOut) XXX_DiscardUnknown() {
	xxx_messageInfo_AudioOut.DiscardUnknown(m)
}

var xxx_messageInfo_AudioOut proto.InternalMessageInfo

func (m *AudioOut) GetAudioData() []byte {
	if m != nil {
		return m.AudioData
	}
	return nil
}

// The semantic result for the user's spoken query.
type ConverseResult struct {
	// *Output-only* The recognized transcript of what the user said.
	SpokenRequestText string `protobuf:"bytes,1,opt,name=spoken_request_text,json=spokenRequestText,proto3" json:"spoken_request_text,omitempty"`
	// *Output-only* The text of the assistant's spoken response. This is only
	// returned for an IFTTT action.
	SpokenResponseText string `protobuf:"bytes,2,opt,name=spoken_response_text,json=spokenResponseText,proto3" json:"spoken_response_text,omitempty"`
	// *Output-only* State information for subsequent `ConverseRequest`. This
	// value should be saved in the client and returned in the
	// `conversation_state` with the next `ConverseRequest`. (The client does not
	// need to interpret or otherwise use this value.) There is no need to save
	// this information across device restarts.
	ConversationState []byte `protobuf:"bytes,3,opt,name=conversation_state,json=conversationState,proto3" json:"conversation_state,omitempty"`
	// *Output-only* Specifies the mode of the microphone after this `Converse`
	// RPC is processed.
	MicrophoneMode ConverseResult_MicrophoneMode `protobuf:"varint,4,opt,name=microphone_mode,json=microphoneMode,proto3,enum=google.assistant.embedded.v1alpha1.ConverseResult_MicrophoneMode" json:"microphone_mode,omitempty"`
	// *Output-only* Updated volume level. The value will be 0 or omitted
	// (indicating no change) unless a voice command such as "Increase the volume"
	// or "Set volume level 4" was recognized, in which case the value will be
	// between 1 and 100 (corresponding to the new volume level of 1% to 100%).
	// Typically, a client should use this volume level when playing the
	// `audio_out` data, and retain this value as the current volume level and
	// supply it in the `AudioOutConfig` of the next `ConverseRequest`. (Some
	// clients may also implement other ways to allow the current volume level to
	// be changed, for example, by providing a knob that the user can turn.)
	VolumePercentage     int32    `protobuf:"varint,5,opt,name=volume_percentage,json=volumePercentage,proto3" json:"volume_percentage,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (m *ConverseResult) Reset()         { *m = ConverseResult{} }
func (m *ConverseResult) String() string { return proto.CompactTextString(m) }
func (*ConverseResult) ProtoMessage()    {}
func (*ConverseResult) Descriptor() ([]byte, []int) {
	return fileDescriptor_embedded_assistant_907a82b6d4d77187, []int{5}
}
func (m *ConverseResult) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_ConverseResult.Unmarshal(m, b)
}
func (m *ConverseResult) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_ConverseResult.Marshal(b, m, deterministic)
}
func (dst *ConverseResult) XXX_Merge(src proto.Message) {
	xxx_messageInfo_ConverseResult.Merge(dst, src)
}
func (m *ConverseResult) XXX_Size() int {
	return xxx_messageInfo_ConverseResult.Size(m)
}
func (m *ConverseResult) XXX_DiscardUnknown() {
	xxx_messageInfo_ConverseResult.DiscardUnknown(m)
}

var xxx_messageInfo_ConverseResult proto.InternalMessageInfo

func (m *ConverseResult) GetSpokenRequestText() string {
	if m != nil {
		return m.SpokenRequestText
	}
	return ""
}

func (m *ConverseResult) GetSpokenResponseText() string {
	if m != nil {
		return m.SpokenResponseText
	}
	return ""
}

func (m *ConverseResult) GetConversationState() []byte {
	if m != nil {
		return m.ConversationState
	}
	return nil
}

func (m *ConverseResult) GetMicrophoneMode() ConverseResult_MicrophoneMode {
	if m != nil {
		return m.MicrophoneMode
	}
	return ConverseResult_MICROPHONE_MODE_UNSPECIFIED
}

func (m *ConverseResult) GetVolumePercentage() int32 {
	if m != nil {
		return m.VolumePercentage
	}
	return 0
}

// The top-level message sent by the client. Clients must send at least two, and
// typically numerous `ConverseRequest` messages. The first message must
// contain a `config` message and must not contain `audio_in` data. All
// subsequent messages must contain `audio_in` data and must not contain a
// `config` message.
type ConverseRequest struct {
	// Exactly one of these fields must be specified in each `ConverseRequest`.
	//
	// Types that are valid to be assigned to ConverseRequest:
	//	*ConverseRequest_Config
	//	*ConverseRequest_AudioIn
	ConverseRequest      isConverseRequest_ConverseRequest `protobuf_oneof:"converse_request"`
	XXX_NoUnkeyedLiteral struct{}                          `json:"-"`
	XXX_unrecognized     []byte                            `json:"-"`
	XXX_sizecache        int32                             `json:"-"`
}

func (m *ConverseRequest) Reset()         { *m = ConverseRequest{} }
func (m *ConverseRequest) String() string { return proto.CompactTextString(m) }
func (*ConverseRequest) ProtoMessage()    {}
func (*ConverseRequest) Descriptor() ([]byte, []int) {
	return fileDescriptor_embedded_assistant_907a82b6d4d77187, []int{6}
}
func (m *ConverseRequest) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_ConverseRequest.Unmarshal(m, b)
}
func (m *ConverseRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_ConverseRequest.Marshal(b, m, deterministic)
}
func (dst *ConverseRequest) XXX_Merge(src proto.Message) {
	xxx_messageInfo_ConverseRequest.Merge(dst, src)
}
func (m *ConverseRequest) XXX_Size() int {
	return xxx_messageInfo_ConverseRequest.Size(m)
}
func (m *ConverseRequest) XXX_DiscardUnknown() {
	xxx_messageInfo_ConverseRequest.DiscardUnknown(m)
}

var xxx_messageInfo_ConverseRequest proto.InternalMessageInfo

type isConverseRequest_ConverseRequest interface {
	isConverseRequest_ConverseRequest()
}

type ConverseRequest_Config struct {
	Config *ConverseConfig `protobuf:"bytes,1,opt,name=config,proto3,oneof"`
}

type ConverseRequest_AudioIn struct {
	AudioIn []byte `protobuf:"bytes,2,opt,name=audio_in,json=audioIn,proto3,oneof"`
}

func (*ConverseRequest_Config) isConverseRequest_ConverseRequest() {}

func (*ConverseRequest_AudioIn) isConverseRequest_ConverseRequest() {}

func (m *ConverseRequest) GetConverseRequest() isConverseRequest_ConverseRequest {
	if m != nil {
		return m.ConverseRequest
	}
	return nil
}

func (m *ConverseRequest) GetConfig() *ConverseConfig {
	if x, ok := m.GetConverseRequest().(*ConverseRequest_Config); ok {
		return x.Config
	}
	return nil
}

func (m *ConverseRequest) GetAudioIn() []byte {
	if x, ok := m.GetConverseRequest().(*ConverseRequest_AudioIn); ok {
		return x.AudioIn
	}
	return nil
}

// XXX_OneofFuncs is for the internal use of the proto package.
func (*ConverseRequest) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {
	return _ConverseRequest_OneofMarshaler, _ConverseRequest_OneofUnmarshaler, _ConverseRequest_OneofSizer, []interface{}{
		(*ConverseRequest_Config)(nil),
		(*ConverseRequest_AudioIn)(nil),
	}
}

func _ConverseRequest_OneofMarshaler(msg proto.Message, b *proto.Buffer) error {
	m := msg.(*ConverseRequest)
	// converse_request
	switch x := m.ConverseRequest.(type) {
	case *ConverseRequest_Config:
		b.EncodeVarint(1<<3 | proto.WireBytes)
		if err := b.EncodeMessage(x.Config); err != nil {
			return err
		}
	case *ConverseRequest_AudioIn:
		b.EncodeVarint(2<<3 | proto.WireBytes)
		b.EncodeRawBytes(x.AudioIn)
	case nil:
	default:
		return fmt.Errorf("ConverseRequest.ConverseRequest has unexpected type %T", x)
	}
	return nil
}

func _ConverseRequest_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) {
	m := msg.(*ConverseRequest)
	switch tag {
	case 1: // converse_request.config
		if wire != proto.WireBytes {
			return true, proto.ErrInternalBadWireType
		}
		msg := new(ConverseConfig)
		err := b.DecodeMessage(msg)
		m.ConverseRequest = &ConverseRequest_Config{msg}
		return true, err
	case 2: // converse_request.audio_in
		if wire != proto.WireBytes {
			return true, proto.ErrInternalBadWireType
		}
		x, err := b.DecodeRawBytes(true)
		m.ConverseRequest = &ConverseRequest_AudioIn{x}
		return true, err
	default:
		return false, nil
	}
}

func _ConverseRequest_OneofSizer(msg proto.Message) (n int) {
	m := msg.(*ConverseRequest)
	// converse_request
	switch x := m.ConverseRequest.(type) {
	case *ConverseRequest_Config:
		s := proto.Size(x.Config)
		n += 1 // tag and wire
		n += proto.SizeVarint(uint64(s))
		n += s
	case *ConverseRequest_AudioIn:
		n += 1 // tag and wire
		n += proto.SizeVarint(uint64(len(x.AudioIn)))
		n += len(x.AudioIn)
	case nil:
	default:
		panic(fmt.Sprintf("proto: unexpected type %T in oneof", x))
	}
	return n
}

// The top-level message received by the client. A series of one or more
// `ConverseResponse` messages are streamed back to the client.
type ConverseResponse struct {
	// Exactly one of these fields will be populated in each `ConverseResponse`.
	//
	// Types that are valid to be assigned to ConverseResponse:
	//	*ConverseResponse_Error
	//	*ConverseResponse_EventType_
	//	*ConverseResponse_AudioOut
	//	*ConverseResponse_Result
	ConverseResponse     isConverseResponse_ConverseResponse `protobuf_oneof:"converse_response"`
	XXX_NoUnkeyedLiteral struct{}                            `json:"-"`
	XXX_unrecognized     []byte                              `json:"-"`
	XXX_sizecache        int32                               `json:"-"`
}

func (m *ConverseResponse) Reset()         { *m = ConverseResponse{} }
func (m *ConverseResponse) String() string { return proto.CompactTextString(m) }
func (*ConverseResponse) ProtoMessage()    {}
func (*ConverseResponse) Descriptor() ([]byte, []int) {
	return fileDescriptor_embedded_assistant_907a82b6d4d77187, []int{7}
}
func (m *ConverseResponse) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_ConverseResponse.Unmarshal(m, b)
}
func (m *ConverseResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_ConverseResponse.Marshal(b, m, deterministic)
}
func (dst *ConverseResponse) XXX_Merge(src proto.Message) {
	xxx_messageInfo_ConverseResponse.Merge(dst, src)
}
func (m *ConverseResponse) XXX_Size() int {
	return xxx_messageInfo_ConverseResponse.Size(m)
}
func (m *ConverseResponse) XXX_DiscardUnknown() {
	xxx_messageInfo_ConverseResponse.DiscardUnknown(m)
}

var xxx_messageInfo_ConverseResponse proto.InternalMessageInfo

type isConverseResponse_ConverseResponse interface {
	isConverseResponse_ConverseResponse()
}

type ConverseResponse_Error struct {
	Error *status.Status `protobuf:"bytes,1,opt,name=error,proto3,oneof"`
}

type ConverseResponse_EventType_ struct {
	EventType ConverseResponse_EventType `protobuf:"varint,2,opt,name=event_type,json=eventType,proto3,enum=google.assistant.embedded.v1alpha1.ConverseResponse_EventType,oneof"`
}

type ConverseResponse_AudioOut struct {
	AudioOut *AudioOut `protobuf:"bytes,3,opt,name=audio_out,json=audioOut,proto3,oneof"`
}

type ConverseResponse_Result struct {
	Result *ConverseResult `protobuf:"bytes,5,opt,name=result,proto3,oneof"`
}

func (*ConverseResponse_Error) isConverseResponse_ConverseResponse() {}

func (*ConverseResponse_EventType_) isConverseResponse_ConverseResponse() {}

func (*ConverseResponse_AudioOut) isConverseResponse_ConverseResponse() {}

func (*ConverseResponse_Result) isConverseResponse_ConverseResponse() {}

func (m *ConverseResponse) GetConverseResponse() isConverseResponse_ConverseResponse {
	if m != nil {
		return m.ConverseResponse
	}
	return nil
}

func (m *ConverseResponse) GetError() *status.Status {
	if x, ok := m.GetConverseResponse().(*ConverseResponse_Error); ok {
		return x.Error
	}
	return nil
}

func (m *ConverseResponse) GetEventType() ConverseResponse_EventType {
	if x, ok := m.GetConverseResponse().(*ConverseResponse_EventType_); ok {
		return x.EventType
	}
	return ConverseResponse_EVENT_TYPE_UNSPECIFIED
}

func (m *ConverseResponse) GetAudioOut() *AudioOut {
	if x, ok := m.GetConverseResponse().(*ConverseResponse_AudioOut); ok {
		return x.AudioOut
	}
	return nil
}

func (m *ConverseResponse) GetResult() *ConverseResult {
	if x, ok := m.GetConverseResponse().(*ConverseResponse_Result); ok {
		return x.Result
	}
	return nil
}

// XXX_OneofFuncs is for the internal use of the proto package.
func (*ConverseResponse) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {
	return _ConverseResponse_OneofMarshaler, _ConverseResponse_OneofUnmarshaler, _ConverseResponse_OneofSizer, []interface{}{
		(*ConverseResponse_Error)(nil),
		(*ConverseResponse_EventType_)(nil),
		(*ConverseResponse_AudioOut)(nil),
		(*ConverseResponse_Result)(nil),
	}
}

func _ConverseResponse_OneofMarshaler(msg proto.Message, b *proto.Buffer) error {
	m := msg.(*ConverseResponse)
	// converse_response
	switch x := m.ConverseResponse.(type) {
	case *ConverseResponse_Error:
		b.EncodeVarint(1<<3 | proto.WireBytes)
		if err := b.EncodeMessage(x.Error); err != nil {
			return err
		}
	case *ConverseResponse_EventType_:
		b.EncodeVarint(2<<3 | proto.WireVarint)
		b.EncodeVarint(uint64(x.EventType))
	case *ConverseResponse_AudioOut:
		b.EncodeVarint(3<<3 | proto.WireBytes)
		if err := b.EncodeMessage(x.AudioOut); err != nil {
			return err
		}
	case *ConverseResponse_Result:
		b.EncodeVarint(5<<3 | proto.WireBytes)
		if err := b.EncodeMessage(x.Result); err != nil {
			return err
		}
	case nil:
	default:
		return fmt.Errorf("ConverseResponse.ConverseResponse has unexpected type %T", x)
	}
	return nil
}

func _ConverseResponse_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) {
	m := msg.(*ConverseResponse)
	switch tag {
	case 1: // converse_response.error
		if wire != proto.WireBytes {
			return true, proto.ErrInternalBadWireType
		}
		msg := new(status.Status)
		err := b.DecodeMessage(msg)
		m.ConverseResponse = &ConverseResponse_Error{msg}
		return true, err
	case 2: // converse_response.event_type
		if wire != proto.WireVarint {
			return true, proto.ErrInternalBadWireType
		}
		x, err := b.DecodeVarint()
		m.ConverseResponse = &ConverseResponse_EventType_{ConverseResponse_EventType(x)}
		return true, err
	case 3: // converse_response.audio_out
		if wire != proto.WireBytes {
			return true, proto.ErrInternalBadWireType
		}
		msg := new(AudioOut)
		err := b.DecodeMessage(msg)
		m.ConverseResponse = &ConverseResponse_AudioOut{msg}
		return true, err
	case 5: // converse_response.result
		if wire != proto.WireBytes {
			return true, proto.ErrInternalBadWireType
		}
		msg := new(ConverseResult)
		err := b.DecodeMessage(msg)
		m.ConverseResponse = &ConverseResponse_Result{msg}
		return true, err
	default:
		return false, nil
	}
}

func _ConverseResponse_OneofSizer(msg proto.Message) (n int) {
	m := msg.(*ConverseResponse)
	// converse_response
	switch x := m.ConverseResponse.(type) {
	case *ConverseResponse_Error:
		s := proto.Size(x.Error)
		n += 1 // tag and wire
		n += proto.SizeVarint(uint64(s))
		n += s
	case *ConverseResponse_EventType_:
		n += 1 // tag and wire
		n += proto.SizeVarint(uint64(x.EventType))
	case *ConverseResponse_AudioOut:
		s := proto.Size(x.AudioOut)
		n += 1 // tag and wire
		n += proto.SizeVarint(uint64(s))
		n += s
	case *ConverseResponse_Result:
		s := proto.Size(x.Result)
		n += 1 // tag and wire
		n += proto.SizeVarint(uint64(s))
		n += s
	case nil:
	default:
		panic(fmt.Sprintf("proto: unexpected type %T in oneof", x))
	}
	return n
}

func init() {
	proto.RegisterType((*ConverseConfig)(nil), "google.assistant.embedded.v1alpha1.ConverseConfig")
	proto.RegisterType((*AudioInConfig)(nil), "google.assistant.embedded.v1alpha1.AudioInConfig")
	proto.RegisterType((*AudioOutConfig)(nil), "google.assistant.embedded.v1alpha1.AudioOutConfig")
	proto.RegisterType((*ConverseState)(nil), "google.assistant.embedded.v1alpha1.ConverseState")
	proto.RegisterType((*AudioOut)(nil), "google.assistant.embedded.v1alpha1.AudioOut")
	proto.RegisterType((*ConverseResult)(nil), "google.assistant.embedded.v1alpha1.ConverseResult")
	proto.RegisterType((*ConverseRequest)(nil), "google.assistant.embedded.v1alpha1.ConverseRequest")
	proto.RegisterType((*ConverseResponse)(nil), "google.assistant.embedded.v1alpha1.ConverseResponse")
	proto.RegisterEnum("google.assistant.embedded.v1alpha1.AudioInConfig_Encoding", AudioInConfig_Encoding_name, AudioInConfig_Encoding_value)
	proto.RegisterEnum("google.assistant.embedded.v1alpha1.AudioOutConfig_Encoding", AudioOutConfig_Encoding_name, AudioOutConfig_Encoding_value)
	proto.RegisterEnum("google.assistant.embedded.v1alpha1.ConverseResult_MicrophoneMode", ConverseResult_MicrophoneMode_name, ConverseResult_MicrophoneMode_value)
	proto.RegisterEnum("google.assistant.embedded.v1alpha1.ConverseResponse_EventType", ConverseResponse_EventType_name, ConverseResponse_EventType_value)
}

// Reference imports to suppress errors if they are not otherwise used.
var _ context.Context
var _ grpc.ClientConn

// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
const _ = grpc.SupportPackageIsVersion4

// EmbeddedAssistantClient is the client API for EmbeddedAssistant service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
type EmbeddedAssistantClient interface {
	// Initiates or continues a conversation with the embedded assistant service.
	// Each call performs one round-trip, sending an audio request to the service
	// and receiving the audio response. Uses bidirectional streaming to receive
	// results, such as the `END_OF_UTTERANCE` event, while sending audio.
	//
	// A conversation is one or more gRPC connections, each consisting of several
	// streamed requests and responses.
	// For example, the user says *Add to my shopping list* and the assistant
	// responds *What do you want to add?*. The sequence of streamed requests and
	// responses in the first gRPC message could be:
	//
	// *   ConverseRequest.config
	// *   ConverseRequest.audio_in
	// *   ConverseRequest.audio_in
	// *   ConverseRequest.audio_in
	// *   ConverseRequest.audio_in
	// *   ConverseResponse.event_type.END_OF_UTTERANCE
	// *   ConverseResponse.result.microphone_mode.DIALOG_FOLLOW_ON
	// *   ConverseResponse.audio_out
	// *   ConverseResponse.audio_out
	// *   ConverseResponse.audio_out
	//
	// The user then says *bagels* and the assistant responds
	// *OK, I've added bagels to your shopping list*. This is sent as another gRPC
	// connection call to the `Converse` method, again with streamed requests and
	// responses, such as:
	//
	// *   ConverseRequest.config
	// *   ConverseRequest.audio_in
	// *   ConverseRequest.audio_in
	// *   ConverseRequest.audio_in
	// *   ConverseResponse.event_type.END_OF_UTTERANCE
	// *   ConverseResponse.result.microphone_mode.CLOSE_MICROPHONE
	// *   ConverseResponse.audio_out
	// *   ConverseResponse.audio_out
	// *   ConverseResponse.audio_out
	// *   ConverseResponse.audio_out
	//
	// Although the precise order of responses is not guaranteed, sequential
	// ConverseResponse.audio_out messages will always contain sequential portions
	// of audio.
	Converse(ctx context.Context, opts ...grpc.CallOption) (EmbeddedAssistant_ConverseClient, error)
}

type embeddedAssistantClient struct {
	cc *grpc.ClientConn
}

func NewEmbeddedAssistantClient(cc *grpc.ClientConn) EmbeddedAssistantClient {
	return &embeddedAssistantClient{cc}
}

func (c *embeddedAssistantClient) Converse(ctx context.Context, opts ...grpc.CallOption) (EmbeddedAssistant_ConverseClient, error) {
	stream, err := c.cc.NewStream(ctx, &_EmbeddedAssistant_serviceDesc.Streams[0], "/google.assistant.embedded.v1alpha1.EmbeddedAssistant/Converse", opts...)
	if err != nil {
		return nil, err
	}
	x := &embeddedAssistantConverseClient{stream}
	return x, nil
}

type EmbeddedAssistant_ConverseClient interface {
	Send(*ConverseRequest) error
	Recv() (*ConverseResponse, error)
	grpc.ClientStream
}

type embeddedAssistantConverseClient struct {
	grpc.ClientStream
}

func (x *embeddedAssistantConverseClient) Send(m *ConverseRequest) error {
	return x.ClientStream.SendMsg(m)
}

func (x *embeddedAssistantConverseClient) Recv() (*ConverseResponse, error) {
	m := new(ConverseResponse)
	if err := x.ClientStream.RecvMsg(m); err != nil {
		return nil, err
	}
	return m, nil
}

// EmbeddedAssistantServer is the server API for EmbeddedAssistant service.
type EmbeddedAssistantServer interface {
	// Initiates or continues a conversation with the embedded assistant service.
	// Each call performs one round-trip, sending an audio request to the service
	// and receiving the audio response. Uses bidirectional streaming to receive
	// results, such as the `END_OF_UTTERANCE` event, while sending audio.
	//
	// A conversation is one or more gRPC connections, each consisting of several
	// streamed requests and responses.
	// For example, the user says *Add to my shopping list* and the assistant
	// responds *What do you want to add?*. The sequence of streamed requests and
	// responses in the first gRPC message could be:
	//
	// *   ConverseRequest.config
	// *   ConverseRequest.audio_in
	// *   ConverseRequest.audio_in
	// *   ConverseRequest.audio_in
	// *   ConverseRequest.audio_in
	// *   ConverseResponse.event_type.END_OF_UTTERANCE
	// *   ConverseResponse.result.microphone_mode.DIALOG_FOLLOW_ON
	// *   ConverseResponse.audio_out
	// *   ConverseResponse.audio_out
	// *   ConverseResponse.audio_out
	//
	// The user then says *bagels* and the assistant responds
	// *OK, I've added bagels to your shopping list*. This is sent as another gRPC
	// connection call to the `Converse` method, again with streamed requests and
	// responses, such as:
	//
	// *   ConverseRequest.config
	// *   ConverseRequest.audio_in
	// *   ConverseRequest.audio_in
	// *   ConverseRequest.audio_in
	// *   ConverseResponse.event_type.END_OF_UTTERANCE
	// *   ConverseResponse.result.microphone_mode.CLOSE_MICROPHONE
	// *   ConverseResponse.audio_out
	// *   ConverseResponse.audio_out
	// *   ConverseResponse.audio_out
	// *   ConverseResponse.audio_out
	//
	// Although the precise order of responses is not guaranteed, sequential
	// ConverseResponse.audio_out messages will always contain sequential portions
	// of audio.
	Converse(EmbeddedAssistant_ConverseServer) error
}

func RegisterEmbeddedAssistantServer(s *grpc.Server, srv EmbeddedAssistantServer) {
	s.RegisterService(&_EmbeddedAssistant_serviceDesc, srv)
}

func _EmbeddedAssistant_Converse_Handler(srv interface{}, stream grpc.ServerStream) error {
	return srv.(EmbeddedAssistantServer).Converse(&embeddedAssistantConverseServer{stream})
}

type EmbeddedAssistant_ConverseServer interface {
	Send(*ConverseResponse) error
	Recv() (*ConverseRequest, error)
	grpc.ServerStream
}

type embeddedAssistantConverseServer struct {
	grpc.ServerStream
}

func (x *embeddedAssistantConverseServer) Send(m *ConverseResponse) error {
	return x.ServerStream.SendMsg(m)
}

func (x *embeddedAssistantConverseServer) Recv() (*ConverseRequest, error) {
	m := new(ConverseRequest)
	if err := x.ServerStream.RecvMsg(m); err != nil {
		return nil, err
	}
	return m, nil
}

var _EmbeddedAssistant_serviceDesc = grpc.ServiceDesc{
	ServiceName: "google.assistant.embedded.v1alpha1.EmbeddedAssistant",
	HandlerType: (*EmbeddedAssistantServer)(nil),
	Methods:     []grpc.MethodDesc{},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "Converse",
			Handler:       _EmbeddedAssistant_Converse_Handler,
			ServerStreams: true,
			ClientStreams: true,
		},
	},
	Metadata: "google/assistant/embedded/v1alpha1/embedded_assistant.proto",
}

func init() {
	proto.RegisterFile("google/assistant/embedded/v1alpha1/embedded_assistant.proto", fileDescriptor_embedded_assistant_907a82b6d4d77187)
}

var fileDescriptor_embedded_assistant_907a82b6d4d77187 = []byte{
	// 892 bytes of a gzipped FileDescriptorProto
	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x56, 0x51, 0x73, 0xdb, 0x44,
	0x10, 0xb6, 0xec, 0xa6, 0xb5, 0xb7, 0x89, 0x2c, 0x5f, 0x33, 0x90, 0x49, 0x61, 0x60, 0xf4, 0xc0,
	0x94, 0x02, 0x72, 0xe3, 0x30, 0x3c, 0x10, 0xe8, 0x8c, 0x63, 0x2b, 0xb1, 0xc1, 0x96, 0x3c, 0x67,
	0xa7, 0xa5, 0x0c, 0xcc, 0xcd, 0x55, 0x3e, 0x1c, 0x81, 0x7d, 0x27, 0xa4, 0x73, 0xa6, 0xe1, 0x07,
	0xf0, 0xd8, 0xe1, 0x95, 0x67, 0x7e, 0x11, 0xff, 0x88, 0xd1, 0x9d, 0xa4, 0xd8, 0x90, 0x42, 0x1c,
	0x1e, 0x6f, 0xf7, 0xbe, 0x4f, 0xbb, 0xdf, 0x7e, 0xb7, 0x23, 0x38, 0x9a, 0x09, 0x31, 0x9b, 0xb3,
	0x26, 0x4d, 0x92, 0x30, 0x91, 0x94, 0xcb, 0x26, 0x5b, 0xbc, 0x64, 0xd3, 0x29, 0x9b, 0x36, 0x2f,
	0x0e, 0xe8, 0x3c, 0x3a, 0xa7, 0x07, 0x45, 0x84, 0x14, 0x97, 0x9c, 0x28, 0x16, 0x52, 0x20, 0x5b,
	0x83, 0x9d, 0xab, 0x78, 0x7e, 0xd5, 0xc9, 0xc1, 0xfb, 0xef, 0xe4, 0x1f, 0x88, 0xc2, 0x26, 0xe5,
	0x5c, 0x48, 0x2a, 0x43, 0xc1, 0x13, 0xcd, 0xb0, 0xff, 0x76, 0x96, 0x8d, 0xa3, 0xa0, 0x99, 0x48,
	0x2a, 0x97, 0x59, 0xc2, 0xfe, 0xa3, 0x0c, 0x66, 0x47, 0xf0, 0x0b, 0x16, 0x27, 0xac, 0x23, 0xf8,
	0x0f, 0xe1, 0x0c, 0xbd, 0x80, 0x3a, 0x5d, 0x4e, 0x43, 0x41, 0x42, 0x4e, 0x02, 0x15, 0xda, 0x33,
	0xde, 0x37, 0x1e, 0xdd, 0x6f, 0x1d, 0x38, 0xff, 0x5d, 0x87, 0xd3, 0x4e, 0xa1, 0x7d, 0xae, 0xb9,
	0xf0, 0x0e, 0x5d, 0x3d, 0xa2, 0xef, 0xc0, 0xd2, 0xd4, 0x62, 0x29, 0x73, 0xee, 0xb2, 0xe2, 0x6e,
	0xdd, 0x98, 0xdb, 0x5f, 0xca, 0x8c, 0xdc, 0xa4, 0x6b, 0x67, 0xf4, 0x0d, 0x98, 0x41, 0xd6, 0x0a,
	0x49, 0x9b, 0x64, 0x7b, 0x95, 0x9b, 0xd7, 0x9d, 0x8b, 0x30, 0x4e, 0x81, 0x78, 0x27, 0x58, 0x3d,
	0xda, 0x7f, 0x1a, 0xb0, 0xb3, 0xd6, 0x18, 0x7a, 0x06, 0x55, 0xc6, 0x03, 0x31, 0x0d, 0xb9, 0x56,
	0xc7, 0x6c, 0x7d, 0xbe, 0xb1, 0x3a, 0x8e, 0x9b, 0x31, 0xe0, 0x82, 0x0b, 0x3d, 0x86, 0x46, 0x42,
	0x17, 0xd1, 0x9c, 0x91, 0x98, 0x4a, 0x46, 0xce, 0x59, 0x2c, 0x7f, 0x51, 0x12, 0x6d, 0xe1, 0xba,
	0x4e, 0x60, 0x2a, 0x59, 0x2f, 0x0d, 0xdb, 0x5f, 0x40, 0x35, 0x67, 0x40, 0x7b, 0xb0, 0xeb, 0x7a,
	0x1d, 0xbf, 0xdb, 0xf7, 0x4e, 0xc9, 0x99, 0x37, 0x1e, 0xb9, 0x9d, 0xfe, 0x49, 0xdf, 0xed, 0x5a,
	0x25, 0xb4, 0x0d, 0xd5, 0x41, 0xdf, 0x73, 0xdb, 0xf8, 0xe0, 0x33, 0xcb, 0x40, 0x55, 0xb8, 0x73,
	0x32, 0x68, 0x77, 0xac, 0xb2, 0xfd, 0x5b, 0x19, 0xcc, 0x75, 0x41, 0xd1, 0xf3, 0x7f, 0x34, 0x75,
	0xb4, 0xf9, 0x58, 0xfe, 0x67, 0x57, 0xe8, 0x23, 0x68, 0x5c, 0x88, 0xf9, 0x72, 0xc1, 0x48, 0xc4,
	0xe2, 0x80, 0x71, 0x49, 0x67, 0x7a, 0x90, 0x5b, 0xd8, 0xd2, 0x89, 0x51, 0x11, 0xb7, 0x07, 0xb7,
	0x90, 0xe0, 0x1e, 0x54, 0x86, 0xa3, 0x43, 0xab, 0x8c, 0xea, 0x70, 0xdf, 0x1f, 0x9d, 0x8d, 0x49,
	0xdf, 0x23, 0xfe, 0xe9, 0xa9, 0x55, 0xb1, 0x9f, 0xc2, 0xce, 0x9a, 0x0d, 0xd0, 0x27, 0x80, 0x32,
	0x23, 0xa8, 0xd7, 0x94, 0xb9, 0x2a, 0x95, 0x66, 0x1b, 0x37, 0x56, 0x33, 0xda, 0x26, 0x1f, 0x42,
	0x35, 0xd7, 0x02, 0xbd, 0x0b, 0xa0, 0xad, 0x3e, 0xa5, 0x92, 0x66, 0x90, 0x9a, 0x8a, 0x74, 0xa9,
	0xa4, 0xf6, 0xef, 0x95, 0xab, 0x77, 0x87, 0x59, 0xb2, 0x9c, 0x4b, 0xe4, 0xc0, 0x83, 0x24, 0x12,
	0x3f, 0x31, 0x4e, 0x62, 0xf6, 0xf3, 0x92, 0x25, 0x92, 0x48, 0xf6, 0x4a, 0x2a, 0x68, 0x0d, 0x37,
	0x74, 0x0a, 0xeb, 0xcc, 0x84, 0xbd, 0x92, 0xe8, 0x09, 0xec, 0x16, 0xf7, 0x93, 0x48, 0xf0, 0x84,
	0x69, 0x40, 0x59, 0x01, 0x50, 0x0e, 0xd0, 0x29, 0x85, 0xb8, 0xbe, 0x9d, 0xca, 0x1b, 0xda, 0x41,
	0x3f, 0x42, 0x7d, 0x11, 0x06, 0xb1, 0x88, 0xce, 0x05, 0x67, 0x64, 0x21, 0xa6, 0x6c, 0xef, 0x8e,
	0x72, 0x45, 0x7b, 0x93, 0x07, 0xa5, 0xbb, 0x73, 0x86, 0x05, 0xd3, 0x50, 0x4c, 0x19, 0x36, 0x17,
	0x6b, 0xe7, 0xeb, 0xa7, 0xbe, 0xf5, 0x86, 0xa9, 0x7f, 0x0f, 0xe6, 0x3a, 0x1d, 0x7a, 0x0f, 0x1e,
	0x0e, 0xfb, 0x1d, 0xec, 0x8f, 0x7a, 0xbe, 0xe7, 0x92, 0xa1, 0xdf, 0x75, 0xff, 0x66, 0x81, 0x5d,
	0xb0, 0x3a, 0x03, 0x7f, 0xec, 0x92, 0xab, 0x6b, 0x96, 0x91, 0x46, 0xbb, 0xfd, 0xf6, 0xc0, 0x3f,
	0x25, 0x27, 0xfe, 0x60, 0xe0, 0x3f, 0x27, 0xbe, 0x97, 0xbe, 0x0c, 0x03, 0xea, 0x57, 0xd5, 0x2b,
	0xc1, 0xd1, 0x00, 0xee, 0xae, 0xed, 0xc2, 0xd6, 0x26, 0x12, 0xe8, 0x87, 0xd1, 0x2b, 0xe1, 0x8c,
	0x03, 0x3d, 0x84, 0x6a, 0xbe, 0x62, 0xd5, 0xb8, 0xb6, 0x7b, 0x25, 0x7c, 0x2f, 0x5b, 0x95, 0xc7,
	0x08, 0xac, 0x62, 0x8d, 0x65, 0x4e, 0xb0, 0x5f, 0x57, 0xc0, 0x5a, 0x11, 0x54, 0x8d, 0x14, 0x3d,
	0x86, 0x2d, 0x16, 0xc7, 0x22, 0xce, 0x4a, 0x42, 0x79, 0x49, 0x71, 0x14, 0x38, 0x63, 0xb5, 0xe4,
	0x7b, 0x25, 0xac, 0xaf, 0x20, 0x02, 0xc0, 0x2e, 0x18, 0x97, 0x44, 0x5e, 0x46, 0x4c, 0x7d, 0xd3,
	0x6c, 0x3d, 0xdd, 0x70, 0x8c, 0xea, 0xab, 0x8e, 0x9b, 0xd2, 0x4c, 0x2e, 0x23, 0xd6, 0x2b, 0xe1,
	0x1a, 0xcb, 0x0f, 0xe8, 0x6b, 0xa8, 0x15, 0xab, 0x3d, 0xdb, 0xbb, 0x1f, 0x6f, 0xb2, 0x3c, 0x7a,
	0x25, 0x5c, 0xcd, 0xf7, 0x79, 0xaa, 0x76, 0xac, 0x6c, 0xa3, 0x2c, 0xb0, 0xa1, 0xda, 0xda, 0x70,
	0xa9, 0xda, 0x9a, 0xc3, 0xfe, 0x12, 0x6a, 0x45, 0xd1, 0x68, 0x1f, 0xde, 0x72, 0x9f, 0xb9, 0xde,
	0x84, 0x4c, 0x5e, 0x8c, 0xae, 0x31, 0x89, 0xeb, 0x75, 0x89, 0x7f, 0x42, 0xce, 0x26, 0x13, 0x17,
	0xb7, 0xbd, 0x8e, 0x6b, 0x19, 0xc7, 0x0f, 0xa0, 0xb1, 0x32, 0x0f, 0xad, 0x42, 0xeb, 0xb5, 0x01,
	0x0d, 0x37, 0x2b, 0xa1, 0x9d, 0x17, 0x85, 0x2e, 0xa1, 0x9a, 0x57, 0x81, 0x0e, 0x37, 0xab, 0x59,
	0xcd, 0x79, 0xff, 0xd3, 0xdb, 0x8c, 0xe4, 0x91, 0xf1, 0xc4, 0x38, 0xfe, 0xd5, 0x80, 0x0f, 0x02,
	0xb1, 0xb8, 0x01, 0xfe, 0xd8, 0x2c, 0x0a, 0x1e, 0xa5, 0xff, 0x00, 0x23, 0xe3, 0xdb, 0xaf, 0x32,
	0xd4, 0x4c, 0xcc, 0x29, 0x9f, 0x39, 0x22, 0x9e, 0x35, 0x67, 0x8c, 0xab, 0x3f, 0x84, 0xa6, 0x4e,
	0xd1, 0x28, 0x4c, 0xfe, 0xed, 0xe7, 0xe5, 0x28, 0x8f, 0xbc, 0xbc, 0xab, 0x60, 0x87, 0x7f, 0x05,
	0x00, 0x00, 0xff, 0xff, 0xec, 0x7a, 0x68, 0xfa, 0xf2, 0x08, 0x00, 0x00,
}


text:
FactoryBot.define do
  factory :project do
    name { "project title" }

    # TaxonomyHelper.valid_taxon_uuid
    taxonomy_branch { "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa" }

    bulk_tagging_enabled { true }

    trait :with_content_items do
      content_items { build_list :project_content_item, 3 }
    end

    trait :with_content_item do
      content_items { build_list :project_content_item, 1 }
    end

    trait :with_a_content_item do
      content_items { build_list :project_content_item, 1 }
    end

    trait :with_bulk_tagging_disabled do
      bulk_tagging_enabled { false }
    end
  end
end

redpajama_set_name: RedPajamaGithub


text:
'use strict';

/**
 * Unit tests for aws-core-utils/api-lambdas.js
 * @author Byron du Preez
 */

const test = require('tape');

// The test subject
const apiLambdas = require('../api-lambdas');

const appErrors = require('core-functions/app-errors');
const BadRequest = appErrors.BadRequest;

const Promises = require('core-functions/promises');

const Strings = require('core-functions/strings');
const stringify = Strings.stringify;

const logging = require('logging-utils');
const LogLevel = logging.LogLevel;

const kinesisCache = require("../kinesis-cache");
const dynamoDBDocClientCache = require("../dynamodb-doc-client-cache");

const samples = require('./samples');
// For AWS contexts
const sampleInvokedFunctionArn = samples.sampleInvokedFunctionArn;
const sampleAwsContext = samples.sampleAwsContext;

// const uuid = require('uuid');

function sampleFunction(resolvedResponse, rejectedError, ms) {
  if (!ms) ms = 1;

  function doSomethingUseful(event, context) {
    context.info(`Simulating doing something useful with event ${JSON.stringify(event)}`);
    return Promises.delay(ms)
      .then(() => {
        return rejectedError ? Promise.reject(rejectedError) : Promise.resolve(resolvedResponse);
      });
  }

  return doSomethingUseful;
}

function setRegionStageAndDeleteCachedInstances(region, stage) {
  // Set up region
  if (region)
    process.env.AWS_REGION = region;
  else
    delete process.env.AWS_REGION;

  // Set up stage
  if (stage)
    process.env.STAGE = stage;
  else
    delete process.env.STAGE;

  // Remove any cached entries before configuring
  deleteCachedInstances();
  return region;
}

function deleteCachedInstances() {
  const region = process.env.AWS_REGION;
  kinesisCache.deleteKinesis(region);
  dynamoDBDocClientCache.deleteDynamoDBDocClient(region);
}

// =====================================================================================================================
// generateHandlerFunction simulating successful response (with legacy parameters & useLambdaProxy false)
// =====================================================================================================================

test('generateHandlerFunction simulating successful response (with LEGACY parameters & useLambdaProxy false)', t => {
  try {
    // Set up environment for testing
    const region = setRegionStageAndDeleteCachedInstances('us-west-2', 'dev99');

    // Create sample AWS event and AWS context
    const event = {body: {abc: 123}};
    const invokedFunctionArn = sampleInvokedFunctionArn(region, 'myLambdaFunctionName', 'dev77');
    const awsContext = sampleAwsContext('myLambdaFunctionName', '1.0.1', invokedFunctionArn, 500);

    const expectedResponse = {def: 456};

    // Create a sample function to be executed within the Lambda handler function
    const fn = sampleFunction(expectedResponse, undefined);

    // Create a sample AWS Lambda handler function
    const createContext = () => ({});
    const createSettings = undefined;
    const createOptions = () => require('./api-lambdas-context-options-LEGACY.json');
    const handler = apiLambdas.generateHandlerFunction(createContext, createSettings, createOptions, fn, LogLevel.INFO);
    //, undefined, 'Invalid do something request', 'Failed to do something useful', 'Did something useful');

    // Wrap the callback-based AWS Lambda handler function as a Promise returning function purely for testing purposes
    const handlerWithPromise = Promises.wrap(handler);

    // Invoke the handler function
    handlerWithPromise(event, awsContext)
      .then(response => {
        t.pass(`handler should have passed`);
        t.deepEqual(response, expectedResponse, `response must be ${JSON.stringify(expectedResponse)}`);
        t.end();
      })
      .catch(err => {
        t.fail(`handler should not have failed - ${err}`);
        t.end();
      });

  } catch (err) {
    t.fail(`handler should not have failed in try-catch - ${err}`);
    t.end();

  } finally {
    // Clean up environment
    setRegionStageAndDeleteCachedInstances(undefined, undefined);
  }
});

// =====================================================================================================================
// generateHandlerFunction simulating invalid request (with LEGACY parameters, i.e. implied useLambdaProxy false)
// =====================================================================================================================

test('generateHandlerFunction simulating invalid request (with LEGACY parameters, i.e. implied useLambdaProxy false)', t => {
  try {
    // Set up environment for testing
    const region = setRegionStageAndDeleteCachedInstances('us-west-2', 'dev99');

    // Create sample AWS event and AWS context
    const event = {body: {abc: 123}};
    const invokedFunctionArn = sampleInvokedFunctionArn(region, 'myLambdaFunctionName', 'dev77');
    const awsContext = sampleAwsContext('myLambdaFunctionName', '1.0.1', invokedFunctionArn, 500);

    const expectedError = new BadRequest('you forgot something');

    // Create a sample function to be executed within the Lambda handler function
    const fn = sampleFunction(undefined, expectedError);

    // Create a sample AWS Lambda handler function
    const createContext = () => ({});
    const createOptions = () => require('./api-lambdas-context-options-LEGACY.json');
    const handler = apiLambdas.generateHandlerFunction(createContext, undefined, createOptions, fn, LogLevel.DEBUG,
      undefined, 'Invalid do something request', 'Failed to do something useful', 'Did something useful');

    // Wrap the callback-based AWS Lambda handler function as a Promise returning function purely for testing purposes
    const handlerWithPromise = Promises.wrap(handler);

    // Invoke the handler function
    handlerWithPromise(event, awsContext)
      .then(response => {
        t.fail(`handler should NOT have passed with response ${stringify(response)}`);
        t.end();
      })
      .catch(err => {
        //console.error(`################### err = ${err}`);
        t.pass(`handler should have failed - ${err}`);
        const e = JSON.parse(err);
        t.equal(e.message, expectedError.message, `e.message must be "${expectedError.message}"`);
        t.equal(e.code, "BadRequest", `e.code must be "BadRequest"`);
        t.equal(e.httpStatus, 400, `e.httpStatus must be 400`);
        const expectedCause = undefined;
        t.equal(e.cause, expectedCause, `e.cause must be ${expectedCause}`);
        t.equal(e.causeStatus, undefined, `e.causeStatus must be undefined`);
        t.equal(e.awsRequestId, awsContext.awsRequestId, `e.awsRequestId must be "${awsContext.awsRequestId}"`);
        t.end();
      });

  } catch (err) {
    t.fail(`handler should not have failed in try-catch - ${err}`);
    t.end();

  } finally {
    // Clean up environment
    setRegionStageAndDeleteCachedInstances(undefined, undefined);
  }
});

// =====================================================================================================================
// generateHandlerFunction simulating failure (with LEGACY parameters, i.e. implied useLambdaProxy false)
// =====================================================================================================================

test('generateHandlerFunction simulating failure (with LEGACY parameters, i.e. implied useLambdaProxy false)', t => {
  try {
    // Set up environment for testing
    const region = setRegionStageAndDeleteCachedInstances('us-west-2', 'dev99');

    // Create sample AWS event and AWS context
    const event = {body: {abc: 123}};
    const invokedFunctionArn = sampleInvokedFunctionArn(region, 'myLambdaFunctionName', 'dev77');
    const awsContext = sampleAwsContext('myLambdaFunctionName', '1.0.1', invokedFunctionArn, 500);

    const expectedError = new Error('Kaboom');

    // Create a sample function to be executed within the Lambda handler function
    const fn = sampleFunction(undefined, expectedError);

    // Create a sample AWS Lambda handler function
    const createContext = () => ({});
    const createSettings = undefined;
    const createOptions = () => require('./api-lambdas-context-options-LEGACY.json');
    const handler = apiLambdas.generateHandlerFunction(createContext, createSettings, createOptions, fn, LogLevel.TRACE,
      undefined, 'Invalid do something request', 'Failed to do something useful', 'Did something useful');

    // Wrap the callback-based AWS Lambda handler function as a Promise returning function purely for testing purposes
    const handlerWithPromise = Promises.wrap(handler);

    // Invoke the handler function
    handlerWithPromise(event, awsContext)
      .then(response => {
        t.fail(`handler should NOT have passed with response ${stringify(response)}`);
        t.end();
      })
      .catch(err => {
        //console.error(`################### err = ${err}`);
        t.pass(`handler should have failed - ${err}`);
        const e = JSON.parse(err);
        t.equal(e.message, expectedError.message, `e.message must be "${expectedError.message}"`);
        t.equal(e.code, "Error", `e.code must be "Error"`);
        t.equal(e.httpStatus, 500, `e.httpStatus must be 500`);
        const expectedCause = 'Error: ' + expectedError.message;
        t.equal(e.cause, expectedCause, `e.cause must be "${expectedCause}"`);
        t.equal(e.causeStatus, undefined, `e.causeStatus must be undefined`);
        t.equal(e.awsRequestId, awsContext.awsRequestId, `e.awsRequestId must be "${awsContext.awsRequestId}"`);
        t.end();
      });

  } catch (err) {
    t.fail(`handler should not have failed in try-catch - ${err}`);
    t.end();

  } finally {
    // Clean up environment
    setRegionStageAndDeleteCachedInstances(undefined, undefined);
  }
});


text:
//-----------------------------------------------
//
//	This file is part of the Siv3D Engine.
//
//	Copyright (c) 2008-2018 Ryo Suzuki
//	Copyright (c) 2016-2018 OpenSiv3D Project
//
//	Licensed under the MIT License.
//
//-----------------------------------------------

# include <Siv3D/Platform.hpp>
# if defined(SIV3D_TARGET_WINDOWS)

# include "CShader_D3D11.hpp"
# include "../../EngineUtility.hpp"
# include <Siv3D/IReader.hpp>
# include <Siv3D/ByteArray.hpp>
# include <Siv3D/BinaryReader.hpp>
# include <Siv3D/Resource.hpp>
# include <Siv3D/Logger.hpp>

namespace s3d
{
	CShader_D3D11::CShader_D3D11()
	{

	}

	CShader_D3D11::~CShader_D3D11()
	{
		m_standardVSs.clear();

		m_standardPSs.clear();

		m_vertexShaders.destroy();

		m_pixelShaders.destroy();

		if (m_d3dcompiler)
		{
			::FreeLibrary(m_d3dcompiler);
		}
	}

	bool CShader_D3D11::init(ID3D11Device* const device, ID3D11DeviceContext* const context)
	{
		m_device = device;
		m_context = context;

	# if defined(SIV3D_TARGET_WINDOWS_DESKTOP_X64)

		m_d3dcompiler = ::LoadLibraryW(L"dll_x64/d3d/d3dcompiler_47.dll");

	# elif defined(SIV3D_TARGET_WINDOWS_DESKTOP_X86)

		m_d3dcompiler = ::LoadLibraryW(L"dll_x86/d3d/d3dcompiler_47.dll");

	# endif

		if (!m_d3dcompiler)
		{
			m_d3dcompiler = ::LoadLibraryW(L"d3dcompiler_47.dll");
		}

		if (m_d3dcompiler)
		{
			p_D3DCompile2 = FunctionPointer(m_d3dcompiler, "D3DCompile2");
		}

		{
			const auto nullVertexShader = std::make_shared<VertexShader_D3D11>(VertexShader_D3D11::Null{});

			if (!nullVertexShader->isInitialized())
			{
				return false;
			}

			m_vertexShaders.setNullData(nullVertexShader);
		}

		{
			const auto nullPixelShader = std::make_shared<PixelShader_D3D11>(PixelShader_D3D11::Null{});

			if (!nullPixelShader->isInitialized())
			{
				return false;
			}

			m_pixelShaders.setNullData(nullPixelShader);
		}

		///*
		//compileHLSLToFile(U"engine/shader/sprite.hlsl", U"engine/shader/sprite.vs", "VS", "vs_4_0");
		//compileHLSLToFile(U"engine/shader/sprite.hlsl", U"engine/shader/shape.ps", "PS_Shape", "ps_4_0");
		//compileHLSLToFile(U"engine/shader/sprite.hlsl", U"engine/shader/line_dot.ps", "PS_LineDot", "ps_4_0");
		//compileHLSLToFile(U"engine/shader/sprite.hlsl", U"engine/shader/line_round_dot.ps", "PS_LineRoundDot", "ps_4_0");
		//compileHLSLToFile(U"engine/shader/sprite.hlsl", U"engine/shader/sprite.ps", "PS_Sprite", "ps_4_0");
		//compileHLSLToFile(U"engine/shader/sprite.hlsl", U"engine/shader/sprite_sdf.ps", "PS_SDF", "ps_4_0");
		//*/

# define RSC(path) Resource(path)
//# define RSC(path) path

		m_standardVSs.push_back(VertexShader(RSC(U"engine/shader/sprite.vs")));
		m_standardPSs.push_back(PixelShader(RSC(U"engine/shader/shape.ps")));
		m_standardPSs.push_back(PixelShader(RSC(U"engine/shader/line_dot.ps")));
		m_standardPSs.push_back(PixelShader(RSC(U"engine/shader/line_round_dot.ps")));
		m_standardPSs.push_back(PixelShader(RSC(U"engine/shader/sprite.ps")));
		m_standardPSs.push_back(PixelShader(RSC(U"engine/shader/sprite_sdf.ps")));

		if (m_standardVSs.count_if(!Lambda::_) > 1)
		{
			LOG_FAIL(U"❌ CShader_GL: Failed to load standard vertex shaders");
			return false;
		}

		if (m_standardPSs.count_if(!Lambda::_) > 1)
		{
			LOG_FAIL(U"❌ CShader_GL: Failed to load standard pixel shaders");
			return false;
		}

		LOG_INFO(U"ℹ Shader initialized");

		return true;
	}

	VertexShaderID CShader_D3D11::createVS(ByteArray&& binary)
	{
		const auto vertexShader = std::make_shared<VertexShader_D3D11>(std::move(binary), m_device);

		if (!vertexShader->isInitialized())
		{
			return VertexShaderID::NullAsset();
		}

		return m_vertexShaders.add(vertexShader);
	}

	VertexShaderID CShader_D3D11::createVSFromFile(const FilePath& path, const Array<BindingPoint>&)
	{
		BinaryReader reader(path);

		if (!reader.isOpened() || reader.size() == 0 || !reader.supportsLookahead())
		{
			return VertexShaderID::NullAsset();
		}

		static constexpr uint8 dxbc[4] = { 'D', 'X', 'B', 'C' };
		uint8 fourcc[4];

		if (!reader.lookahead(fourcc))
		{
			return VertexShaderID::NullAsset();
		}

		const bool isBinary = (::memcmp(dxbc, fourcc, 4) == 0);

		ByteArray memory;

		if (isBinary)
		{
			memory = reader.readAll();
		}
		else if (!compileHLSL(reader, memory, reader.path().narrow().c_str(), "VS", "vs_4_0"))
		{
			return VertexShaderID::NullAsset();
		}

		return createVS(std::move(memory));
	}

	PixelShaderID CShader_D3D11::createPS(ByteArray&& binary)
	{
		const auto pixelShader = std::make_shared<PixelShader_D3D11>(std::move(binary), m_device);

		if (!pixelShader->isInitialized())
		{
			return PixelShaderID::NullAsset();
		}

		return m_pixelShaders.add(pixelShader);
	}

	PixelShaderID CShader_D3D11::createPSFromFile(const FilePath& path, const Array<BindingPoint>&)
	{
		BinaryReader reader(path);

		if (!reader.isOpened() || reader.size() == 0 || !reader.supportsLookahead())
		{
			return PixelShaderID::NullAsset();
		}

		static constexpr uint8 dxbc[4] = { 'D', 'X', 'B', 'C' };
		uint8 fourcc[4];

		if (!reader.lookahead(fourcc))
		{
			return PixelShaderID::NullAsset();
		}

		const bool isBinary = (::memcmp(dxbc, fourcc, 4) == 0);

		ByteArray memory;

		if (isBinary)
		{
			memory = reader.readAll();
		}
		else if (!compileHLSL(reader, memory, reader.path().narrow().c_str(), "PS", "ps_4_0"))
		{
			return PixelShaderID::NullAsset();
		}

		return createPS(std::move(memory));
	}

	void CShader_D3D11::releaseVS(const VertexShaderID handleID)
	{
		m_vertexShaders.erase(handleID);
	}

	void CShader_D3D11::releasePS(const PixelShaderID handleID)
	{
		m_pixelShaders.erase(handleID);
	}

	ByteArrayView CShader_D3D11::getBinaryViewVS(const VertexShaderID handleID)
	{
		return m_vertexShaders[handleID]->getView();
	}

	ByteArrayView CShader_D3D11::getBinaryViewPS(const PixelShaderID handleID)
	{
		return m_pixelShaders[handleID]->getView();
	}

	const VertexShader& CShader_D3D11::getStandardVS(const size_t index) const
	{
		return m_standardVSs[index];
	}

	const PixelShader& CShader_D3D11::getStandardPS(const size_t index) const
	{
		return m_standardPSs[index];
	}

	void CShader_D3D11::setVS(const VertexShaderID handleID)
	{
		if (handleID == m_currentVS)
		{
			return;
		}

		m_context->VSSetShader(m_vertexShaders[handleID]->getShader(), nullptr, 0);

		m_currentVS = handleID;
	}

	void CShader_D3D11::setPS(const PixelShaderID handleID)
	{
		if (m_currentPS == handleID)
		{
			return;
		}

		m_context->PSSetShader(m_pixelShaders[handleID]->getShader(), nullptr, 0);

		m_currentPS = handleID;
	}

	bool CShader_D3D11::compileHLSL(IReader& reader, ByteArray& to, const char* filePath, const char* entryPoint, const char* target)
	{
		if (!p_D3DCompile2)
		{
			return false;
		}

		Array<Byte> data(static_cast<size_t>(reader.size()));

		reader.read(data.data(), data.size());

		const bool preferFlow = false;
		const uint32 flags =
		D3DCOMPILE_ENABLE_STRICTNESS
		| D3DCOMPILE_OPTIMIZATION_LEVEL3
		| D3DCOMPILE_WARNINGS_ARE_ERRORS
		| (preferFlow ? D3DCOMPILE_PREFER_FLOW_CONTROL : 0);

		ID3DBlob* pBlobOut = nullptr;
		ID3DBlob* pErrorBlob = nullptr;
		const HRESULT hr = p_D3DCompile2(data.data(), data.size(), filePath, nullptr, nullptr,
										 entryPoint, target, flags, 0, 0, nullptr, 0, &pBlobOut, &pErrorBlob);

		if (pErrorBlob)
		{
			::OutputDebugStringA((const char*)pErrorBlob->GetBufferPointer());

			pErrorBlob->Release();
		}

		if (FAILED(hr))
		{
			if (pBlobOut)
			{
				pBlobOut->Release();
			}

			return false;
		}

		to.create(pBlobOut->GetBufferPointer(), pBlobOut->GetBufferSize());

		pBlobOut->Release();

		return true;
	}

	bool CShader_D3D11::compileHLSLToFile(const FilePath& hlsl, const FilePath& to, const char* entryPoint, const char* target)
	{
		BinaryReader reader(hlsl);
		ByteArray binary;

		if (!compileHLSL(reader, binary, hlsl.narrow().c_str(), entryPoint, target))
		{
			return false;
		}

		return binary.save(to);
	}
}

# endif


text:
package org.apache.camel.builder;

import java.util.Map;

import org.apache.camel.CamelContext;
import org.apache.camel.EndpointProducerResolver;
import org.apache.camel.Expression;

/**
 * Type-safe endpoint DSL for building producer endpoints.
 *
 * @see EndpointConsumerBuilder
 */
public interface EndpointProducerBuilder extends EndpointProducerResolver {
    /**
     * Builds the url of this endpoint. This API is only intended for Camel internally.
     */
    String getUri();

    /**
     * Adds an option to this endpoint. This API is only intended for Camel internally.
     */
    void doSetProperty(String name, Object value);

    /**
     * Adds a multi-value option to this endpoint. This API is only intended for Camel internally.
     */
    void doSetMultiValueProperty(String name, String key, Object value);

    /**
     * Adds multi-value options to this endpoint. This API is only intended for Camel internally.
     */
    void doSetMultiValueProperties(String name, String prefix, Map<String, Object> values);

    /**
     * Builds an expression of this endpoint url. This API is only intended for Camel internally.
     */
    Expression expr();

    /**
     * Builds a dynamic expression of this endpoint url. This API is only intended for Camel internally.
     */
    Expression expr(CamelContext camelContext);

}


text:
import { Component, OnInit } from '@angular/core';

@Component({
  selector: 'app-comp-4024',
  templateUrl: './comp-4024.component.html',
  styleUrls: ['./comp-4024.component.css']
})
export class Comp4024Component implements OnInit {

  constructor() { }

  ngOnInit() {
  }

}


text:
<%
def uncapitalize(s) { s[0].toLowerCase() + s[1..-1]}
classNameLowerCase = uncapitalize(className)
projectName = project.toLowerCase()
%>

            <button class="topcoat-button controller" >Home</button>

${classNameLowerCase}

            <input type="search" value="" placeholder="search" class="topcoat-search-input"/>

    <form class="${classNameLowerCase}-display hidden" style="margin:2em auto; margin-bottom: 4em; max-width: 13em">
        <%
        props.eachWithIndex { p, i ->
        %>${p.name}

            <input type="text" class="topcoat-text-input" placeholder="text" name="${p.name}">

<%
        }
        %>
        <input class="hidden" name="id"/>
        <input class="hidden" name="version"/>
        <input class="hidden" name="class"/>

    </form>

            <button class="topcoat-button full displayAdd" >Add</button>

            <button class="topcoat-button full cancel">Cancel</button>

            <button class="topcoat-button full remove">Delete</button>

            <button class="topcoat-button full add">Save</button>

            <button class="topcoat-button full update">Update</button>


text:
<?php

namespace PW\TaggingBundle\Controller\Admin;

use Symfony\Bundle\FrameworkBundle\Controller\Controller,
    Symfony\Component\HttpFoundation\Request,
    Symfony\Component\HttpFoundation\Response,
    Symfony\Component\Security\Core\SecurityContext,
    Sensio\Bundle\FrameworkExtraBundle\Configuration\Route,
    Sensio\Bundle\FrameworkExtraBundle\Configuration\Template,
    Sensio\Bundle\FrameworkExtraBundle\Configuration\Method,
    JMS\SecurityExtraBundle\Annotation\Secure,
    PW\TaggingBundle\Document\Tagging,
    PW\TaggingBundle\Form\Type\TaggingType;

class TaggingController extends Controller
{
    /**
     * @Method("GET")
     * @Secure(roles="ROLE_ADMIN")
     * @Route("/admin/taggings", name="admin_taggings")
     * @Template
     */
    public function indexAction(Request $request)
    {

        $taggings = $this->get('doctrine_mongodb.odm.document_manager')
            ->getRepository('PWTaggingBundle:Tagging')
            ->findAll()
        ;

        return compact('taggings');
    }

    /**
     * @Method({"GET", "POST"})
     * @Secure(roles="ROLE_ADMIN")
     * @Route("/admin/taggings/new", name="admin_tagging_new")
     * @Template
     */
    public function newAction(Request $request)
    {

        $tagging  = new Tagging;
        $form = $this->get('form.factory')->create(new TaggingType, $tagging);

        if ($request->getMethod() === 'POST') {
            $form->bindRequest($request);
            if ($form->isValid()) {
                $this->flushTagging($tagging);
                $this->get('session')->getFlashBag()->add('notice', 'Your tagging has been added successfully.');
                return $this->redirect($this->generateUrl('admin_taggings'));
            }
        }

        return array('form' => $form->createView(), 'form_path' => $this->generateUrl('admin_tagging_new'));

    }

    /**
     * @Method({"GET", "POST"})
     * @Secure(roles="ROLE_ADMIN")
     * @Route("/admin/taggings/edit/{id}", name="admin_tagging_edit")
     * @Template
     */
    public function editAction(Request $request, $id)
    {
        $tagging = $this->get('doctrine_mongodb.odm.document_manager')
            ->getRepository('PWTaggingBundle:Tagging')
            ->find($id)
        ;

        $form = $this->get('form.factory')->create(new TaggingType, $tagging);

        if ($request->getMethod() === 'POST') {
            $form->bindRequest($request);
            if ($form->isValid()) {
                $this->flushTagging($tagging);
                $this->get('session')->getFlashBag()->add('notice', 'Your tagging has been added successfully.');
                return $this->redirect($this->generateUrl('admin_taggings'));
            }
        }

        return array('form' => $form->createView(), 'form_path' => $this->generateUrl('admin_tagging_edit', array('id' => $tagging->getId())));
    }

    /**
     * @Method("GET")
     * @Secure(roles="ROLE_ADMIN")
     * @Route("/admin/tagging/delete/{id}", name="admin_tagging_delete")
     * @Template
     */
    public function deleteAction(Request $request, $id)
    {
        $tagging = $this->get('doctrine_mongodb.odm.document_manager')
            ->getRepository('PWTaggingBundle:Tagging')
            ->find($id)
        ;
        $dm = $this->get('doctrine_mongodb.odm.document_manager');
        $dm->remove($tagging);
        $dm->flush();

        $this->get('session')->setFlash('success', sprintf("Successfully deleted tagging '%s'", $tagging->getName()));
        return $this->redirect($this->generateUrl('admin_taggings'));
    }

    protected function flushTagging(Tagging $t)
    {
        $dm = $this->get('doctrine_mongodb.odm.document_manager');
        $dm->persist($t);
        $dm->flush();
    }

}


text:
<?php
namespace backend\models;

use Yii;
use common\models\User;
use yii\base\NotSupportedException;
use yii\behaviors\TimestampBehavior;
use yii\db\ActiveRecord;
use yii\db\Expression;
use yii\web\IdentityInterface;
use yii\helpers\Security;
use backend\models\Role;
use yii\helpers\ArrayHelper;
use backend\models\Status;
use backend\models\UserType;
use yii\helpers\Url;
use yii\helpers\Html;

/**
* User model
*
* @property integer $id
* @property string $username
* @property string $password_hash
* @property string $password_reset_token
* @property string $email
* @property string $auth_key
* @property integer $role_id
* @property integer $status_id
* @proprty integer $user_type_id
* @property integer $created_at
* @property integer $updated_at
* @property string $password write-only password
*/

class Users extends ActiveRecord implements IdentityInterface
{
    const STATUS_ACTIVE = 10;

    public $password;
    public $confirm_password;

    public static function tableName() {
        return 'user';
    }

    /**
    * behaviors
    */
    public function behaviors(){
        return [
            'timestamp' => [
                'class' => TimestampBehavior::className(),
                'attributes' => [
                    ActiveRecord::EVENT_BEFORE_INSERT => ['created_at', 'updated_at'],
                    ActiveRecord::EVENT_BEFORE_UPDATE => ['updated_at'],
                ],
                'value' => new Expression('NOW()'),
            ],
        ];
    }

    /**
    * validation rules
    */
    public function rules(){
        return [
            ['status_id', 'default', 'value' => self::STATUS_ACTIVE],
            [['status_id'],'in', 'range'=>array_keys($this->getStatusList())],
            ['role_id', 'default', 'value' => 10],
            [['role_id'],'in', 'range'=>array_keys($this->getRoleList())],
            ['user_type_id', 'default', 'value' => 10],
            [['user_type_id'],'in', 'range'=>array_keys($this->getUserTypeList())],
            ['username', 'required'],
            ['username', 'unique'],
            ['username', 'string', 'min' => 2, 'max' => 255],
            ['username', 'filter', 'filter' => 'trim'],
            ['email', 'required'],
            ['email', 'unique'],
            ['email', 'email'],
            ['email', 'filter', 'filter' => 'trim'],

            ['password', 'required'],
            ['password', 'string', 'min' => 6],
            ['password', 'passwordCriteria'],
            ['confirm_password', 'string', 'min' => 6],
            [['confirm_password'], 'compare', 'compareAttribute' => 'password'],

        ];
    }

    /* Your model attribute labels */
    public function attributeLabels(){
        return [
            /* Your other attribute labels */
            'roleName' => Yii::t('app', 'Role'),
            'statusName' => Yii::t('app', 'Status'),
            'userLink' => Yii::t('app', 'User'),
            'username' => Yii::t('app', 'User Name'),
            'userTypeName' => Yii::t('app', 'User Type'),
            'userTypeId' => Yii::t('app', 'User Type'),
            'userIdLink' => Yii::t('app', 'ID'),
            'password' => Yii::t('app', 'Password'),
            'confirm_password' => Yii::t('app', 'Confirm Password'),
        ];
    }

    /*
     * Función para validar criterios adicionales en la cadena de password
     * REVISAR CON CUIDADO PARA COLOCAR CRITERIOS COMPLETOS
     */
    public function passwordCriteria()
    {
        if(!empty($this->password)){
            if(strlen($this->password)<6){
                $this->addError('password','Password must contains at least six letters, one digit and one character.');
            }
            else{
                if(!preg_match('/[0-9]/',$this->password)){
                    $this->addError('password','Password must contain at least one digit.');
                }
                if(!preg_match('/[a-zA-Z]/', $this->password)){
                    $this->addError('password','Password must contain at least one character.');
                }
            }
        }
    }

    /**
     * Signs user up.
     *
     * @return User|null the saved model or null if saving fails
     */
    public function addUser()
    {
        $user = new User();
        $user->username = $this->username;
        $user->email = $this->email;
        $user->status_id = $this->status_id;
        $user->role_id = $this->role_id;
        $user->user_type_id = $this->user_type_id;
        $user->setPassword($this->password);
        $user->generateAuthKey();

        return $user;
    }

    /**
    * @findIdentity
    */
    public static function findIdentity($id){
        return static::findOne(['id' => $id, 'status_id' => self::STATUS_ACTIVE]);
    }

    /**
    * @findIdentityByAccessToken
    */
    public static function findIdentityByAccessToken($token, $type = null){
        return static::findOne(['auth_key' => $token]);
    }

    /**
    * Finds user by username
    * broken into 2 lines to avoid wordwrapping * @param string $username
    * @return static|null
    */
    public static function findByUsername($username){
        return static::findOne(['username' => $username, 'status_id' =>self::STATUS_ACTIVE]);
    }

    /**
    * Finds user by password reset token
    *
    * @param string $token password reset token
    * @return static|null
    */
    public static function findByPasswordResetToken($token){
        $expire = Yii::$app->params['user.passwordResetTokenExpire'];
        $parts = explode('_', $token);
        $timestamp = (int) end($parts);
        if ($timestamp + $expire < time()) {
            // token expired
            return null;
        }
        return static::findOne([
            'password_reset_token' => $token,
            'status_id' => self::STATUS_ACTIVE,
        ]);
    }

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

    /**
    * @getAuthKey
    */
    public function getAuthKey(){
        return $this->auth_key;
    }

    /**
    * @getPassword
    */
    public function getPassword(){
        $this->confirm_password = $this->password_hash;
        return $this->password_hash;
    }

    /**
    * @validateAuthKey
    */
    public function validateAuthKey($authKey){
        return $this->getAuthKey() === $authKey;
    }

    /**
    * Validates password
    *
    * @param string $password password to validate
    * @return boolean if password provided is valid for current user
    */
    public function validatePassword($password){
        return Yii::$app->security->validatePassword($password, $this->password_hash);
    }

    /**
    * Generates password hash from password and sets it to the model
    *
    * @param string $password
    */
    public function setPassword($password){
        $this->password_hash = Yii::$app->security->generatePasswordHash($password);
    }

    /**
    * Generates "remember me" authentication key
    */
    public function generateAuthKey(){
        $this->auth_key = Yii::$app->security->generateRandomString();
    }

    /**
    * Generates new password reset token
    * broken into 2 lines to avoid wordwrapping
    */
    public function generatePasswordResetToken(){
        $this->password_reset_token = Yii::$app->security->generateRandomString(). '_' . time();
    }

    /**
    * Removes password reset token
    */
    public function removePasswordResetToken(){
        $this->password_reset_token = null;
    }

    /**
    * get role relationship
    *
    */
    public function getRole(){
        return $this->hasOne(Role::className(), ['role_value' => 'role_id']);
    }

    /**
    * get role name
    *
    */
    public function getRoleName(){
        return $this->role ? $this->role->role_name : '- no role -';
    }

    /**
    * get list of roles for dropdown
    */
    public static function getRoleList(){
        $droptions = Role::find()->asArray()->all();
        return Arrayhelper::map($droptions, 'role_value', 'role_name');
    }

    /**
    * get status relation
    *
    */
    public function getStatus(){
        return $this->hasOne(Status::className(), ['status_value' => 'status_id']);
    }

    /**
     * get status name
    *
    */
    public function getStatusName(){
        return $this->status ? $this->status->status_name : '- no status -';
    }

    /**
    * get list of statuses for dropdown
    */
    public static function getStatusList(){
        $droptions = Status::find()->asArray()->all();
        return Arrayhelper::map($droptions, 'status_value', 'status_name');
    }

    /**
    * getUserType
    * line break to avoid word wrap in PDF
    * code as single line in your IDE
    */
    public function getUserType(){
        return $this->hasOne(UserType::className(), ['user_type_value' =>'user_type_id']);
    }

    /**
    * get user type name
    *
    */
    public function getUserTypeName(){
        return $this->userType ? $this->userType->user_type_name : '- no user type -';
    }

    /**
    * get list of user types for dropdown
    */
    public static function getUserTypeList(){
        $droptions = UserType::find()->asArray()->all();
        return Arrayhelper::map($droptions, 'user_type_value', 'user_type_name');
    }

    /**
    * get user type id
    *
    */
    public function getUserTypeId(){
        return $this->userType ? $this->userType->id : 'none';
    }

    /**
    * get user id Link
    *
    */
    public function getUserIdLink(){
        $url = Url::to(['user/update', 'id'=>$this->id]);
        $options = [];
        return Html::a($this->id, $url, $options);
    }

    /**
    * @getUserLink
    *
    */
    public function getUserLink(){
        $url = Url::to(['user/view', 'id'=>$this->Id]);
        $options = [];
        return Html::a($this->username, $url, $options);
    }
}


text:
if [[ -z "${FLUTTER_SDK}" ]]; then
  FLUTTER_SDK="$(flutter --version --machine | jq -r '.flutterRoot')"
fi

if [[ -z "${DART_SDK}" ]]; then
  DART_SDK="${FLUTTER_SDK}/bin/cache/dart-sdk"
fi

DISTRIBUTION_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
TAQO_ROOT="$(dirname -- "${DISTRIBUTION_DIR}")"

BUILD="${TAQO_ROOT}/taqo_client/build/macos"
#DEBUG="${BUILD}/Build/Products/Debug"
RELEASE="${BUILD}/Build/Products/Release"

"${TAQO_ROOT}/resolve_deps.sh"

mkdir -p "${RELEASE}"

cd -- "${TAQO_ROOT}" || exit

# Build PAL event server / macos daemon
"${DART_SDK}"/bin/dart2native -p pal_event_server/.packages \
  -o "${RELEASE}"/taqo_daemon \
  pal_event_server/lib/main.dart

# cp daemon to Flutter asset
cp "${RELEASE}"/taqo_daemon taqo_client/macos/TaqoLauncher/taqo_daemon

# Build IntelliJ Plugin
pushd pal_intellij_plugin || exit
dart --no-sound-null-safety builder/bin/builder.dart
cp build/distributions/pal_intellij_plugin-*.zip "../taqo_client/assets/"
popd || exit

# Build flutter app
pushd taqo_client || exit
"${FLUTTER_SDK}"/bin/flutter build macos
popd || exit


text:
layout: post
title: The Age of American Unreason
tags:
- Colbert
- media
- politics
published: true
---

Last night, Susan Jacoby was on The Colbert Report to discuss her book, The Age of American Unreason.

<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="332" height="316" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="name" value="comedy_central_player" /><param name="bgcolor" value="#cccccc" /><param name="align" value="middle" /><param name="flashvars" value="videoId=166772" /><param name="src" value="http://www.comedycentral.com/sitewide/video_player/view/default/swf.jhtml" /><embed type="application/x-shockwave-flash" width="332" height="316" src="http://www.comedycentral.com/sitewide/video_player/view/default/swf.jhtml" flashvars="videoId=166772" align="middle" bgcolor="#cccccc" name="comedy_central_player"></embed></object>

She touches on themes similar to those raised in my recent post, War on Intelligence.


text:
package com.OA.mainsite.service;

import java.util.List;

import org.apache.ibatis.annotations.Param;

import com.OA.mainsite.entity.AttendType;
import com.OA.mainsite.entity.Attendance;
import com.OA.mainsite.entity.Lecture;
import com.OA.mainsite.entity.Teacher;
import com.OA.mainsite.vo.LectureVo;
import com.OA.mainsite.vo.TeacherVo;

public interface TeacherService {
	TeacherVo selectByUsername(String username);
	List<LectureVo> selectClassList(String username);
	Teacher selectTeacher(String username);
	List<Attendance> selectAttendance(Integer result,String username);
	List<AttendType> selectAttendType();
	List<Lecture> selectLecturesByIdAndName(String username,Integer id,String name);
}


text:
function init(mapid){
	var map = L.mapbox.map('map', mapid);
	getIssues(map);
}

function getIssues(map){
	var Issue = Parse.Object.extend("Issue");
	var query = new Parse.Query(Issue);
	query.find({
	    success:function(results) {
	            console.log("Total: "+results.length);
				var issueList = "";
				for (var i = 0; i < results.length; i++) {
				    var object = results[i];
//				      alert(object.id + ' - ' + object.get('IssueType') + ' - ' + object.get('Latitude') + ' - ' + object.get('Longitude'));
					issueList += '' + object.get('IssueType') + '
';
					addMarker(map,object.get('IssueType'),object.get('Description'),object.get('Longitude'),object.get('Latitude'),object.get('Photo').url());
				}
				document.getElementById("left").innerHTML = issueList;
			},
	        error:function(error) {
	        	alert("Error when getting objects!");
	        }
    });
}

function addMarker(map,title,description,lng,lat,photourl){
	L.mapbox.featureLayer({
	    // this feature is in the GeoJSON format: see geojson.org
	    // for the full specification
	    type: 'Feature',
	    geometry: {
	        type: 'Point',
	        // coordinates here are in longitude, latitude order because
	        // x, y is the standard for GeoJSON and many formats
	        coordinates: [lng,lat]
	    },
	    properties: {
	        title: title,
	        description: description + '

View Photo (new window)',
	        // one can customize markers by adding simplestyle properties
	        // http://mapbox.com/developers/simplestyle/
	        'marker-size': 'large',
	        'marker-color': '#f0a'
	    }
	}).addTo(map);
}


text:
#ifdef USE_TI_UITAB

#import "TiWindowProxy.h"
#import "TiUITabProxy.h"
#import "TiTabController.h"

@interface TiUITabController : TiViewController<TiTabController> {
@private
//Window is now the superclass's proxy.
//This is an assign only property. Tabs retain instances of TiTabController.
	TiUITabProxy *tab;
}

-(id)initWithProxy:(TiWindowProxy*)proxy tab:(TiUITabProxy*)tab;
@property(nonatomic,readonly)	TiWindowProxy *window;
@property(nonatomic,readonly)	TiUITabProxy *tab;

@end

#endif


text:
@echo off

if "%~3"=="" goto :Usage
set srcFile=%1%
set tgtStore=%2%
set certAlias=%3%
set action=%4%

rem Setup the Java Virtual Machine
if not "%JAVA%" == "" goto :Check_JAVA_END
    if not "%JAVA_HOME%" == "" goto :TryJDKEnd
:TryWOWJRE
    FOR /F "usebackq tokens=3*" %%A IN (`REG QUERY "HKLM\Software\WOW6432NODE\JavaSoft\Java Runtime Environment" /s /v CurrentVersion ^| find "CurrentVersion"`) DO (
       set JAVA_VERSION=%%A
    )
    FOR /F "usebackq tokens=3*" %%A IN (`REG QUERY "HKLM\Software\WOW6432NODE\JavaSoft\Java Runtime Environment\%JAVA_VERSION%" /s /v JavaHome ^| find "JavaHome"`) DO (
       set JAVA_HOME=%%A %%B
    )
    if not exist "%JAVA_HOME%" goto :TryWOWJDK
    goto TryJDKEnd
:TryWOWJDK
    FOR /F "usebackq tokens=3*" %%A IN (`REG QUERY "HKLM\Software\WOW6432NODE\JavaSoft\Java Development Kit" /s /v CurrentVersion  ^| find "CurrentVersion"`) DO (
       set JAVA_VERSION=%%A
    )
    FOR /F "usebackq tokens=3*" %%A IN (`REG QUERY "HKLM\Software\WOW6432NODE\JavaSoft\Java Development Kit\%JAVA_VERSION%" /s /v JavaHome ^| find "JavaHome"`) DO (
       set JAVA_HOME=%%A %%B
    )
    if not exist "%JAVA_HOME%" goto :TryJRE
    goto TryJDKEnd
:TryJRE
    FOR /F "usebackq tokens=3*" %%A IN (`REG QUERY "HKLM\Software\JavaSoft\Java Runtime Environment" /s /v CurrentVersion  ^| find "CurrentVersion"`) DO (
       set JAVA_VERSION=%%A
    )
    FOR /F "usebackq tokens=3*" %%A IN (`REG QUERY "HKLM\Software\JavaSoft\Java Runtime Environment\%JAVA_VERSION%" /s /v JavaHome ^| find "JavaHome"`) DO (
       set JAVA_HOME=%%A %%B
    )
    if not exist "%JAVA_HOME%" goto :TryJDK
    goto TryJDKEnd
:TryJDK
    FOR /F "usebackq tokens=3*" %%A IN (`REG QUERY "HKLM\Software\JavaSoft\Java Development Kit" /s /v CurrentVersion  ^| find "CurrentVersion"`) DO (
       set JAVA_VERSION=%%A
    )
    FOR /F "usebackq tokens=3*" %%A IN (`REG QUERY "HKLM\Software\JavaSoft\Java Development Kit\%JAVA_VERSION%" /s /v JavaHome ^| find "JavaHome"`) DO (
       set JAVA_HOME=%%A %%B
    )
    if not exist "%JAVA_HOME%" (
       echo Unable to retrieve JAVA_HOME from Registry
       EXIT /B 1
    )
:TryJDKEnd
    if not exist "%JAVA_HOME%" (
        echo JAVA_HOME is not valid: "%JAVA_HOME%"
        EXIT /B 1
    )
    set JAVA=%JAVA_HOME%\bin\java
:Check_JAVA_END

echo "Executing action \"%action%\" on certificate from file \"%srcFile%\" using alias \"%certAlias%\" to: %tgtStore%"

set /p ksPwd=Enter password for keystore:%=%

if "%action%" == "replace" (
    "%JAVA_HOME%\bin\keytool" -delete -alias %certAlias% -keystore %tgtStore% -storepass %ksPwd% -storetype pkcs12
    if errorlevel 1 (
    	echo
        echo Failed to delete the certificate in the keystore for alias "%certAlias%". See errors above to correct the problem.
        EXIT /B 1
    )
)

"%JAVA_HOME%\bin\keytool" -importcert -file %srcFile% -alias %certAlias% -keystore %tgtStore% -storepass %ksPwd% -storetype pkcs12
if errorlevel 1 (
	echo.
    echo ***** Failed to import the certificate to the keystore. See errors above to correct the problem.
    echo       If the error shows the certifcate already eists then add the "replace" option to the command line.
    EXIT /B 1
)

echo.
echo   Sucessfully Imported certificate from file "%srcFile%" using alias "%certAlias%" to: %tgtStore%
echo.

goto END

:Usage
  echo Import a public certificate to a PKCS12 key store.
  echo You must specify the source file, target key store file name and an alias for imported certificate.
  echo By default the script will attemopt to import the designated certificate.
  echo If you wish to replace an existing certificate then specify "replace" as a 4th argument to the script
  echo usage: %~nx0 ^<src certificate^> ^<target keystore^> ^<cert alias^> [action]
  echo             WHERE
  echo                src certificate = name of the file containg the public key to be imported
  echo                target keystore = name of the target keystore file including .p12 extension
  echo                cert alias = alias name used to store the created digital certificate in the keystore
  echo                action = if not provided this defaults to "import". The only other option is "replace"
  echo                          anything other than "replace" will be interpreted as "import"

  echo.
  echo        eg. %~nx0 partnera.cer as2_certs.p12 partnera
  echo                 OR
  echo        eg. %~nx0 partnera.cer as2_certs.p12 partnera replace
  EXIT /B 1
:END


text:
This is Flask + React + ES6/JSX with Babel + webpack Tutorial.

## Instructions

### Pre-requisites
`python3.6 with dev`, `pip`, `npm`

### clone repo
`$ git clone https://github.com/U-lis/react_tutorial.git`

### setup env
`$ virtualenv -p python3.6 [your_env]`
`$ . [your_env]/bin/activate`
`([your_env])$ pip install -r requirements.txt`
`([your_env])$ cp config.py.example config.py`  # setup your config

`$ sudo npm -g install npm`  # for upgrade npm
`$ sudo npm -g install webpack` # need global
`$ npm install`

### build, start
`$ webapck` # for build bundle
`$ webpack --watch` # for watching changes

`$ npm start`   # `python manage.py runserver` implemented


text:
<?php
/**
 * Project : simple-php-git-deploy
 * User: thuytien
 * Date: 11/10/2014
 * Time: 12:44 AM
 */

namespace AutoGitPuller\Server;

class BaseEvent
{
    protected $author; //the author, who maked event
    protected $repository;
    protected $secretkey;
    protected $username;
    protected $password;

    function __construct( $secretkey = '', $username = '', $password = '')
    {
        $this->secretkey = $secretkey;
        $this->username = $username;
        $this->password = $password;
    }

    public function processRequest()
    {
        return '';
    }

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

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

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

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

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

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

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

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

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

    public function getCommiterUsername()
    {
        return '';
    }

    public function getRepositoryName()
    {
        return '';
    }

    public function getRepositoryBranch()
    {
        return '';
    }

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

}


text:
package io.d8a.conjure;

import org.joda.time.DateTimeZone;
import org.joda.time.format.DateTimeFormat;
import org.joda.time.format.DateTimeFormatter;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;

import java.util.Random;

import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertTrue;

@Test
public class DateNodeTypeTest {
    private static final Random RAND = new Random();
    private ConjureTemplate samples;
    private long randTime;

    @BeforeMethod
    public void setUp() throws Exception {
        randTime = Math.abs(RAND.nextLong());
        Clock clock = new SimulatedClock(randTime);

        samples = new ConjureTemplate(clock);
        samples.addNodeType("date", TimeNode.class);
    }

    public void generatesSystemTimestamp(){
        samples = new ConjureTemplate();
        samples.addNodeType("date", TimeNode.class);
        samples.addFragment("sample", "The current time is [${type:\"date\"}].");

        long start = System.currentTimeMillis();
        String text = samples.conjure();
        long stop = System.currentTimeMillis();

        long timestamp = parseNumber(text);

        assertInRange(timestamp, start, stop);
    }

    public void usesClockFromSampleGenerator(){
        samples.addFragment("sample", "The current time is [${type:\"date\"}].");
        long timestamp = parseNumber(samples.conjure());
        assertEquals(timestamp, randTime);
    }

    public void allowsFormat(){
        samples.addFragment("sample", "The current time is ${type:\"date\",format:\"yyyyMMDD hh:mm:ss\"}.");
        DateTimeFormatter utc = DateTimeFormat.forPattern("yyyyMMDD hh:mm:ss").withZone(DateTimeZone.getDefault());

        String timeFormatted = utc.print(randTime);
        assertEquals(samples.conjure(), "The current time is "+timeFormatted+".");
    }

    public void allowsTimezone(){
        samples.addFragment("sample", "The current time is ${type:\"date\",format:\"yyyyMMDD hh:mm:ss\", timezone:\"UTC\"}.");
        DateTimeFormatter utc = DateTimeFormat.forPattern("yyyyMMDD hh:mm:ss").withZone(DateTimeZone.forID("UTC"));
        String timeFormatted = utc.print(randTime);
        assertEquals(samples.conjure(), "The current time is " + timeFormatted + ".");
    }

    public void allowsDateJitter(){
        samples.addFragment("sample", "The current time is [${type:\"date\",min:10, max:100}].");
        long value = parseNumber(samples.conjure());
        assertInRange(value, randTime + 10, randTime + 100);
    }

    public void allowsNegativeLowJitter(){
        samples.addFragment("sample", "The current time is [${type:\"date\",min:-110, max:100}].");
        long value = parseNumber(samples.conjure());
        assertInRange(value, randTime - 110, randTime + 100);
    }

    public void allowsNegativeHighJitter(){
        samples.addFragment("sample", "The current time is [${type:\"date\",min:-110, max:-10}].");
        long value = parseNumber(samples.conjure());
        assertInRange(value, randTime - 110, randTime - 10);
    }

    public void fixesTransposedLowHigh(){
        samples.addFragment("sample", "The current time is [${type:\"date\",min:100, max:10}].");
        long value = parseNumber(samples.conjure());
        assertInRange(value, randTime + 10, randTime + 100);
    }

    public void canHaveSameJitterLowAndHigh(){
        samples.addFragment("sample", "The current time is [${type:\"date\",min:100, max:100}].");
        long value = parseNumber(samples.conjure());
        assertEquals(value, randTime + 100);
    }

    public void canReferenceMinMaxForJitter(){
        samples.addNodeType("minmax",MinMaxNode.class);
        samples.addFragment("sample", "The current time is [${type:\"date\",minmaxRef:\"jitter\"}].");
        samples.addFragment("jitter", "${type:\"minmax\",min:200,max:200}");
        long value = parseNumber(samples.conjure());
        assertEquals(value, randTime + 200);
    }

    private long parseNumber(String text) {
        return Long.valueOf(text.substring(text.indexOf('[')+1, text.indexOf(']')));
    }

    private void assertInRange(long value, long start, long stop) {
        assertTrue(value >= start && value <= stop, "Value '" + value + "' not contained in the range [" + start + "," + stop + "]");
    }
}


text:
    <img data-interchange="[<?php echo helpers\url::template_path() . 'img/Baskets-mobile.png'?>, (small)],
    [<?php echo helpers\url::template_path() . 'img/Baskets-half.png'?>, (medium)],
    [<?php echo helpers\url::template_path() . 'img/Baskets-slim.png'?>, (large)]
    "/>
    <img src="<?php echo helpers\url::template_path() . 'img/Baskets-half.png'?>">

Specialty Coffee Retail Price Index

<a href='<?php echo DIR;?>'>SCRPI

<?php echo $data['post'][0]->postTitle;?>

        <?php
        if($data['post']){
            foreach($data['post'] as $row){

//				echo "
\n";
                echo "
$row->postTitle
\n";
                echo "
The Specialty Coffee Retail Price Index (SCRPI)* is being developed by researchers at Social Enterprise @ Goizueta to track the retail prices charged by a representative group of North American specialty coffee roasters
";
                echo "
Posted on ".date('jS M Y H:i:s', strtotime($row->postDate))." in catSlug'>$row->catTitle
";

                echo "
".stripslashes($row->postCont)."
";

//				echo "
\n";
            }
        }
        ?>

Share on your favorite social media!

        <a href="https://www.facebook.com/sharer/sharer.php?u=<?php echo urlencode($_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);?>" target="_blank" title="Share on Facebook">
        <a href="https://twitter.com/share" data-url="<?php echo urlencode($_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);?>" target="_blank" title="Tweet">
        <a href="http://www.linkedin.com/shareArticle?mini=true&url=<?php echo urlencode($_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);?>" target="_blank" title="Share on LinkedIn">


text:
[Index](/docs/README.md) | [Interface definitions](/docs/interface/README.md) | Finished callback function

Finished callback function is added to [Feature](/docs/objects/feature/README.md) to be notified once execution finished successfully or failed.

**Example**

    () => {
        document.querySelector('#loading').style.display = 'none';
    }